mac80211: unset SDATA_STATE_OFFCHANNEL when cancelling a scan

For client STA interfaces, ieee80211_do_stop unsets the relevant
interface's SDATA_STATE_RUNNING state bit prior to cancelling an
interrupted scan.  When ieee80211_offchannel_return is invoked as
part of cancelling the scan, it doesn't bother unsetting the
SDATA_STATE_OFFCHANNEL bit because it sees that the interface is
down.  Normally this doesn't matter because when the client STA
interface is brought back up, it will probably issue a scan.  But
in some cases (e.g., the user changes the interface type while it
is down), the SDATA_STATE_OFFCHANNEL bit will remain set.  This
prevents the interface queues from being started.  So we
cancel the scan before unsetting the SDATA_STATE_RUNNING bit.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Brian Cavagnolo 2010-11-04 16:59:28 -07:00 committed by John W. Linville
parent fbb078fcd2
commit 352ffad646
1 changed files with 3 additions and 3 deletions

View File

@ -391,6 +391,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
u32 hw_reconf_flags = 0; u32 hw_reconf_flags = 0;
int i; int i;
if (local->scan_sdata == sdata)
ieee80211_scan_cancel(local);
clear_bit(SDATA_STATE_RUNNING, &sdata->state); clear_bit(SDATA_STATE_RUNNING, &sdata->state);
/* /*
@ -523,9 +526,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
synchronize_rcu(); synchronize_rcu();
skb_queue_purge(&sdata->skb_queue); skb_queue_purge(&sdata->skb_queue);
if (local->scan_sdata == sdata)
ieee80211_scan_cancel(local);
/* /*
* Disable beaconing here for mesh only, AP and IBSS * Disable beaconing here for mesh only, AP and IBSS
* are already taken care of. * are already taken care of.