| 1 | --- a/net80211/ieee80211_scan_ap.c |
| 2 | +++ b/net80211/ieee80211_scan_ap.c |
| 3 | @@ -595,6 +595,14 @@ ap_end(struct ieee80211_scan_state *ss, |
| 4 | |
| 5 | ic = vap->iv_ic; |
| 6 | |
| 7 | + /* if we're already running, switch back to the home channel */ |
| 8 | + if ((vap->iv_state == IEEE80211_S_RUN) && |
| 9 | + (ic->ic_bsschan != IEEE80211_CHAN_ANYC)) { |
| 10 | + ic->ic_curchan = ic->ic_bsschan; |
| 11 | + ic->ic_set_channel(ic); |
| 12 | + goto out; |
| 13 | + } |
| 14 | + |
| 15 | /* record stats for the channel that was scanned last */ |
| 16 | ic->ic_set_channel(ic); |
| 17 | spin_lock_irqsave(&channel_lock, sflags); |
| 18 | @@ -648,6 +656,8 @@ ap_end(struct ieee80211_scan_state *ss, |
| 19 | IEEE80211_SCHEDULE_TQUEUE(&as->as_actiontq); |
| 20 | res = 1; |
| 21 | } |
| 22 | + |
| 23 | +out: |
| 24 | SCAN_AP_UNLOCK_IRQ(as); |
| 25 | return res; |
| 26 | } |
| 27 | |