mac80211: fix client mode state handling issues

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 36632
This commit is contained in:
Felix Fietkau 2013-05-14 11:01:54 +00:00
parent 144cfb65a4
commit c27351f2fa

View File

@ -1921,6 +1921,39 @@
}
mutex_unlock(&ifmgd->mtx);
@@ -4197,7 +4344,7 @@ int ieee80211_mgd_deauth(struct ieee8021
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
bool tx = !req->local_state_change;
- bool sent_frame = false;
+ bool report_frame = false;
mutex_lock(&ifmgd->mtx);
@@ -4214,7 +4361,7 @@ int ieee80211_mgd_deauth(struct ieee8021
ieee80211_destroy_auth_data(sdata, false);
mutex_unlock(&ifmgd->mtx);
- sent_frame = tx;
+ report_frame = true;
goto out;
}
@@ -4222,12 +4369,12 @@ int ieee80211_mgd_deauth(struct ieee8021
ether_addr_equal(ifmgd->associated->bssid, req->bssid)) {
ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
req->reason_code, tx, frame_buf);
- sent_frame = tx;
+ report_frame = true;
}
mutex_unlock(&ifmgd->mtx);
out:
- if (sent_frame)
+ if (report_frame)
__cfg80211_send_deauth(sdata->dev, frame_buf,
IEEE80211_DEAUTH_FRAME_LEN);
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -38,8 +38,8 @@ int __ieee80211_suspend(struct ieee80211
@ -3836,3 +3869,32 @@
skb_put(skb, rs.rs_datalen + ah->caps.rx_status_len);
if (ah->caps.rx_status_len)
skb_pull(skb, ah->caps.rx_status_len);
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -885,7 +885,6 @@ void cfg80211_leave(struct cfg80211_regi
#endif
__cfg80211_disconnect(rdev, dev,
WLAN_REASON_DEAUTH_LEAVING, true);
- cfg80211_mlme_down(rdev, dev);
wdev_unlock(wdev);
break;
case NL80211_IFTYPE_MESH_POINT:
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -961,7 +961,7 @@ int __cfg80211_disconnect(struct cfg8021
/* was it connected by userspace SME? */
if (!wdev->conn) {
cfg80211_mlme_down(rdev, dev);
- return 0;
+ goto disconnect;
}
if (wdev->sme_state == CFG80211_SME_CONNECTING &&
@@ -987,6 +987,7 @@ int __cfg80211_disconnect(struct cfg8021
return err;
}
+ disconnect:
if (wdev->sme_state == CFG80211_SME_CONNECTED)
__cfg80211_disconnected(dev, NULL, 0, 0, false);
else if (wdev->sme_state == CFG80211_SME_CONNECTING)