aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-sme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-05-15 18:55:45 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-04 07:03:11 -0400
commitceca7b7121795ef81bd598a240d53a925662d0c1 (patch)
tree510d7a6c578d7ede025c8b4714b9584729517b0a /net/wireless/wext-sme.c
parent6ff57cf88807dd81300b5b9c623dc5eb6422b9f6 (diff)
cfg80211: separate internal SME implementation
The current internal SME implementation in cfg80211 is very mixed up with the MLME handling, which has been causing issues for a long time. There are three things that the implementation has to provide: * a basic SME implementation for nl80211's connect() call (for drivers implementing auth/assoc, which is really just mac80211) and wireless extensions * MLME events for the userspace SME * SME events (connected, disconnected etc.) for all different SME implementation possibilities (driver, cfg80211 and userspace) To achieve these goals it isn't necessary to track the software SME's connection status outside of it's state (which is the part that caused many issues.) Instead, track it only in the SME data (wdev->conn) and in the general case only track whether the wdev is connected or not (via wdev->current_bss.) Also separate the internal implementation to not have callbacks from the SME events, but rather call it from the API functions that the driver (or rather mac80211) calls. This separates the code better. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/wext-sme.c')
-rw-r--r--net/wireless/wext-sme.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index a53f8404f451..14c9a2583ba0 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -89,7 +89,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
89 89
90 wdev_lock(wdev); 90 wdev_lock(wdev);
91 91
92 if (wdev->sme_state != CFG80211_SME_IDLE) { 92 if (wdev->conn) {
93 bool event = true; 93 bool event = true;
94 94
95 if (wdev->wext.connect.channel == chan) { 95 if (wdev->wext.connect.channel == chan) {
@@ -188,7 +188,7 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev,
188 188
189 err = 0; 189 err = 0;
190 190
191 if (wdev->sme_state != CFG80211_SME_IDLE) { 191 if (wdev->conn) {
192 bool event = true; 192 bool event = true;
193 193
194 if (wdev->wext.connect.ssid && len && 194 if (wdev->wext.connect.ssid && len &&
@@ -277,7 +277,7 @@ int cfg80211_mgd_wext_siwap(struct net_device *dev,
277 277
278 wdev_lock(wdev); 278 wdev_lock(wdev);
279 279
280 if (wdev->sme_state != CFG80211_SME_IDLE) { 280 if (wdev->conn) {
281 err = 0; 281 err = 0;
282 /* both automatic */ 282 /* both automatic */
283 if (!bssid && !wdev->wext.connect.bssid) 283 if (!bssid && !wdev->wext.connect.bssid)
@@ -364,7 +364,7 @@ int cfg80211_wext_siwgenie(struct net_device *dev,
364 wdev->wext.ie = ie; 364 wdev->wext.ie = ie;
365 wdev->wext.ie_len = ie_len; 365 wdev->wext.ie_len = ie_len;
366 366
367 if (wdev->sme_state != CFG80211_SME_IDLE) { 367 if (wdev->conn) {
368 err = cfg80211_disconnect(rdev, dev, 368 err = cfg80211_disconnect(rdev, dev,
369 WLAN_REASON_DEAUTH_LEAVING, false); 369 WLAN_REASON_DEAUTH_LEAVING, false);
370 if (err) 370 if (err)