From: Johannes Berg Date: Mon, 8 Dec 2008 23:10:30 +0000 (+0100) Subject: mac80211: only create default STA interface if supported X-Git-Tag: v3.12-rc1~16879^2~203^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8dffff216fcac4f79078478085e86d68db64922e;p=kernel%2Fkernel-generic.git mac80211: only create default STA interface if supported Drivers will support this, obviously, but this forces them to set it up properly. (This includes the fix posted as "mac80211: fix ifmodes check" and tested in wireless-testing by Hin-Tak and others. -- JWL) Signed-off-by: Johannes Berg Reported-by: Larry Finger Tested-by: Hin-Tak Leung Signed-off-by: John W. Linville --- diff --git a/net/mac80211/main.c b/net/mac80211/main.c index df7e9a8..6d87103 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -886,12 +886,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) 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 & BIT(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();