rt2x00: change order when stop beaconing
authorStanislaw Gruszka <sgruszka@redhat.com>
Thu, 5 Jun 2014 11:52:26 +0000 (13:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 Jun 2014 19:49:15 +0000 (15:49 -0400)
When no beaconing is needed, first stop beacon queue (disable beaconing
globally) to avoid possible sending of not prepared beacon on short
period after clearing beacon and before stop of BCN queue.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00mac.c

index d63636bbb9d741e2ea8f66061556aa709f320f42..e5935ea3719f930210be2578e0a3583e0808d164 100644 (file)
@@ -628,12 +628,6 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
                if (!bss_conf->enable_beacon && intf->enable_beacon) {
                        rt2x00dev->intf_beaconing--;
                        intf->enable_beacon = false;
-                       /*
-                        * Clear beacon in the H/W for this vif. This is needed
-                        * to disable beaconing on this particular interface
-                        * and keep it running on other interfaces.
-                        */
-                       rt2x00queue_clear_beacon(rt2x00dev, vif);
 
                        if (rt2x00dev->intf_beaconing == 0) {
                                /*
@@ -642,6 +636,12 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
                                 */
                                rt2x00queue_stop_queue(rt2x00dev->bcn);
                        }
+                       /*
+                        * Clear beacon in the H/W for this vif. This is needed
+                        * to disable beaconing on this particular interface
+                        * and keep it running on other interfaces.
+                        */
+                       rt2x00queue_clear_beacon(rt2x00dev, vif);
                } else if (bss_conf->enable_beacon && !intf->enable_beacon) {
                        rt2x00dev->intf_beaconing++;
                        intf->enable_beacon = true;