aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-12-08 18:10:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-12 13:59:43 -0500
commit8dffff216fcac4f79078478085e86d68db64922e (patch)
treea264aa2d10538004d8c5614e69c6fe0c6c76f5b0 /net/mac80211/main.c
parent0f202aa2e1e1db1d20da9bcc3f5ad43c5a22d2d5 (diff)
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 <johannes@sipsolutions.net> Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index df7e9a810b88..6d8710327d14 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -886,12 +886,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
886 886
887 local->mdev->select_queue = ieee80211_select_queue; 887 local->mdev->select_queue = ieee80211_select_queue;
888 888
889 /* add one default STA interface */ 889 /* add one default STA interface if supported */
890 result = ieee80211_if_add(local, "wlan%d", NULL, 890 if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
891 NL80211_IFTYPE_STATION, NULL); 891 result = ieee80211_if_add(local, "wlan%d", NULL,
892 if (result) 892 NL80211_IFTYPE_STATION, NULL);
893 printk(KERN_WARNING "%s: Failed to add default virtual iface\n", 893 if (result)
894 wiphy_name(local->hw.wiphy)); 894 printk(KERN_WARNING "%s: Failed to add default virtual iface\n",
895 wiphy_name(local->hw.wiphy));
896 }
895 897
896 rtnl_unlock(); 898 rtnl_unlock();
897 899