aboutsummaryrefslogtreecommitdiff
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-01 21:26:56 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:51 -0400
commitf21293549f60f88c74fcb9944737f11048896dc4 (patch)
treed4a00663f87816c0c742e74d7b2c9bad31a18816 /net/wireless/core.c
parent6829c878ecd24ff0ae41b4668c7e9d0f11b66942 (diff)
cfg80211: managed mode wext compatibility
This adds code to make it possible to use the cfg80211 connect() API with wireless extensions, and because the previous patch added emulation of that API with auth() and assoc(), by extension also supports wext on that. At the same time, removes code from mac80211 for wext, but doesn't yet clean up mac80211's mlme code more. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index a0a67970461..e2f80dd0e4a 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -553,6 +553,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
#ifdef CONFIG_WIRELESS_EXT
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
+ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
#endif
mutex_unlock(&rdev->devlist_mtx);
break;
@@ -565,8 +566,13 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
cfg80211_leave_ibss(rdev, dev, true);
break;
case NL80211_IFTYPE_STATION:
+#ifdef CONFIG_WIRELESS_EXT
+ kfree(wdev->wext.ie);
+ wdev->wext.ie = NULL;
+ wdev->wext.ie_len = 0;
+#endif
cfg80211_disconnect(rdev, dev,
- WLAN_REASON_DEAUTH_LEAVING);
+ WLAN_REASON_DEAUTH_LEAVING, true);
break;
default:
break;
@@ -578,11 +584,20 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
break;
case NETDEV_UP:
#ifdef CONFIG_WIRELESS_EXT
- if (wdev->iftype != NL80211_IFTYPE_ADHOC)
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ if (wdev->wext.ibss.ssid_len)
+ cfg80211_join_ibss(rdev, dev,
+ &wdev->wext.ibss);
break;
- if (!wdev->wext.ibss.ssid_len)
+ case NL80211_IFTYPE_STATION:
+ if (wdev->wext.connect.ssid_len)
+ cfg80211_connect(rdev, dev,
+ &wdev->wext.connect);
+ break;
+ default:
break;
- cfg80211_join_ibss(rdev, dev, &wdev->wext.ibss);
+ }
#endif
break;
case NETDEV_UNREGISTER: