diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-09-10 14:53:27 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-09-10 15:04:19 +0200 |
commit | d5bbf34613a877dbe3da847fa0432da8c6721e73 (patch) | |
tree | 902a90fd7eda61aad7abae9c35b0da2e7a786995 /net/mac80211/scan.c | |
parent | c6c1f7a2c194f1a2291a15c6691c0d6785f8976e (diff) | |
parent | 336961dd3cf9c39456dd9657e8f205718740c797 (diff) |
Merge branch 'l4t/l4t-r16' into colibri
Merge with latest NVIDIA L4T R16.
Only real conflict concerning inverted VBUS gpio support.
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 6f09eca01112..4aa2cec04f31 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -477,6 +477,7 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local, unsigned long min_beacon_int = 0; struct ieee80211_sub_if_data *sdata; struct ieee80211_channel *next_chan; + enum mac80211_scan_state next_scan_state; /* * check if at least one STA interface is associated, @@ -512,13 +513,21 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local, /* We're currently on operating channel. */ if (next_chan == local->oper_channel) /* We don't need to move off of operating channel. */ - local->next_scan_state = SCAN_SET_CHANNEL; - else + next_scan_state = SCAN_SET_CHANNEL; + else { /* * We do need to leave operating channel, as next - * scan is somewhere else. + * scan is somewhere else, unless + * there is pending traffic and the scan request is + * marked to abort when this happens */ - local->next_scan_state = SCAN_LEAVE_OPER_CHANNEL; + if (associated && !tx_empty && + (local->scan_req->flags & + CFG80211_SCAN_FLAG_TX_ABORT)) + next_scan_state = SCAN_ABORT; + else + next_scan_state = SCAN_LEAVE_OPER_CHANNEL; + } } else { /* * we're currently scanning a different channel, let's @@ -547,12 +556,24 @@ static void ieee80211_scan_state_decision(struct ieee80211_local *local, usecs_to_jiffies(min_beacon_int * 1024) * local->hw.conf.listen_interval); - if (associated && ( !tx_empty || bad_latency || - listen_int_exceeded)) - local->next_scan_state = SCAN_ENTER_OPER_CHANNEL; + if (associated && !tx_empty) { + if (unlikely(local->scan_req->flags & + CFG80211_SCAN_FLAG_TX_ABORT)) { + /* + * Scan request is marked to abort when there + * is outbound traffic. Mark state to return + * the operating channel and then abort. This + * happens as soon as possible. + */ + next_scan_state = SCAN_ENTER_OPER_CHANNEL_ABORT; + } else + next_scan_state = SCAN_ENTER_OPER_CHANNEL; + } else if (associated && (bad_latency || listen_int_exceeded)) + next_scan_state = SCAN_ENTER_OPER_CHANNEL; else - local->next_scan_state = SCAN_SET_CHANNEL; + next_scan_state = SCAN_SET_CHANNEL; } + local->next_scan_state = next_scan_state; *next_delay = 0; } @@ -596,8 +617,13 @@ static void ieee80211_scan_state_enter_oper_channel(struct ieee80211_local *loca */ ieee80211_offchannel_return(local, true, false); - *next_delay = HZ / 5; - local->next_scan_state = SCAN_DECISION; + if (local->next_scan_state == SCAN_ENTER_OPER_CHANNEL) { + *next_delay = HZ / 5; + local->next_scan_state = SCAN_DECISION; + } else { + *next_delay = 0; + local->next_scan_state = SCAN_ABORT; + } } static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, @@ -741,11 +767,15 @@ void ieee80211_scan_work(struct work_struct *work) ieee80211_scan_state_send_probe(local, &next_delay); break; case SCAN_LEAVE_OPER_CHANNEL: + case SCAN_ENTER_OPER_CHANNEL_ABORT: ieee80211_scan_state_leave_oper_channel(local, &next_delay); break; case SCAN_ENTER_OPER_CHANNEL: ieee80211_scan_state_enter_oper_channel(local, &next_delay); break; + case SCAN_ABORT: + aborted = true; + goto out_complete; } } while (next_delay == 0); |