Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: only create default STA interface if supported
@ 2008-12-08 23:10 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2008-12-08 23:10 UTC (permalink / raw)
  To: John Linville; +Cc: Kalle Valo, linux-wireless

Drivers will support this, obviously, but this forces them to
set it up properly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/main.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- everything.orig/net/mac80211/main.c	2008-12-09 00:07:37.000000000 +0100
+++ everything/net/mac80211/main.c	2008-12-09 00:09:00.000000000 +0100
@@ -892,12 +892,14 @@ int ieee80211_register_hw(struct ieee802
 
 	local->mdev->select_queue = ieee80211_select_queue;
 
-	/* add one default STA interface */
-	result = ieee80211_if_add(local, "wlan%d", NULL,
-				  NL80211_IFTYPE_STATION, NULL);
-	if (result)
-		printk(KERN_WARNING "%s: Failed to add default virtual iface\n",
-		       wiphy_name(local->hw.wiphy));
+	/* add one default STA interface if supported */
+	if (local->hw.wiphy->interface_modes & NL80211_IFTYPE_STATION) {
+		result = ieee80211_if_add(local, "wlan%d", NULL,
+					  NL80211_IFTYPE_STATION, NULL);
+		if (result)
+			printk(KERN_WARNING "%s: Failed to add default virtual iface\n",
+			       wiphy_name(local->hw.wiphy));
+	}
 
 	rtnl_unlock();
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-08 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 23:10 [PATCH] mac80211: only create default STA interface if supported Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox