mac80211: fix client mode state handling issues
authorFelix Fietkau <nbd@openwrt.org>
Tue, 14 May 2013 11:01:54 +0000 (11:01 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 14 May 2013 11:01:54 +0000 (11:01 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 36632

package/mac80211/patches/300-pending_work.patch

index 5d946ca102ada537c674e34852cc47bb9faab7c4..fd7417b44b02a487e8cf595cb81cff2130f075ff 100644 (file)
        }
        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
                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)