Skip to content

Commit

Permalink
mac80211: only create default STA interface if supported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Dec 12, 2008
1 parent 0f202aa commit 8dffff2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 8dffff2

Please sign in to comment.