Skip to content

Commit

Permalink
wlcore: don't switch channels on disconnected STA vifs
Browse files Browse the repository at this point in the history
Sending the FW a channel switch command on a disconnected
vif may result in a beacon loss event. Avoid this corner case.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arik Nemtsov authored and John W. Linville committed Jul 15, 2014
1 parent d8c5a48 commit e656286
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5192,6 +5192,10 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw,
if (unlikely(wl->state == WLCORE_STATE_OFF)) {
wl12xx_for_each_wlvif_sta(wl, wlvif) {
struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);

if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
continue;

ieee80211_chswitch_done(vif, false);
}
goto out;
Expand All @@ -5207,6 +5211,9 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw,
wl12xx_for_each_wlvif_sta(wl, wlvif) {
unsigned long delay_usec;

if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
continue;

ret = wl->ops->channel_switch(wl, wlvif, ch_switch);
if (ret)
goto out_sleep;
Expand Down

0 comments on commit e656286

Please sign in to comment.