diff options
author | Ben Greear <greearb@candelatech.com> | 2011-02-04 14:54:17 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-04 16:30:32 -0500 |
commit | b23b025fe246f3acc2988eb6d400df34c27cb8ae (patch) | |
tree | e1c8cd163dc4dc7c603652a9e101f8381cf66fdc /net/mac80211/rx.c | |
parent | cb8d61de2d7f074654057b2b924da1efbf625ad4 (diff) |
mac80211: Optimize scans on current operating channel.
This should decrease un-necessary flushes, on/off channel work,
and channel changes in cases where the only scanned channel is
the current operating channel.
* Removes SCAN_OFF_CHANNEL flag, uses SDATA_STATE_OFFCHANNEL
and is-scanning flags instead.
* Add helper method to determine if we are currently configured
for the operating channel.
* Do no blindly go off/on channel in work.c Instead, only call
appropriate on/off code when we really need to change channels.
Always enable offchannel-ps mode when starting work,
and disable it when we are done.
* Consolidate ieee80211_offchannel_stop_station and
ieee80211_offchannel_stop_beaconing, call it
ieee80211_offchannel_stop_vifs instead.
* Accept non-beacon frames when scanning on operating channel.
* Scan state machine optimized to minimize on/off channel
transitions. Also, when going on-channel, go ahead and
re-enable beaconing. We're going to be there for 200ms,
so seems like some useful beaconing could happen.
Always enable offchannel-ps mode when starting software
scan, and disable it when we are done.
* Grab local->mtx earlier in __ieee80211_scan_completed_finish
so that we are protected when calling hw_config(), etc.
* Pass probe-responses up the stack if scanning on local
channel, so that mlme can take a look.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 753ffc41c1aa..b5f59ed24000 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -409,16 +409,10 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx) | |||
409 | if (likely(!(status->rx_flags & IEEE80211_RX_IN_SCAN))) | 409 | if (likely(!(status->rx_flags & IEEE80211_RX_IN_SCAN))) |
410 | return RX_CONTINUE; | 410 | return RX_CONTINUE; |
411 | 411 | ||
412 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) | 412 | if (test_bit(SCAN_HW_SCANNING, &local->scanning) || |
413 | test_bit(SCAN_SW_SCANNING, &local->scanning)) | ||
413 | return ieee80211_scan_rx(rx->sdata, skb); | 414 | return ieee80211_scan_rx(rx->sdata, skb); |
414 | 415 | ||
415 | if (test_bit(SCAN_SW_SCANNING, &local->scanning)) { | ||
416 | /* drop all the other packets during a software scan anyway */ | ||
417 | if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED) | ||
418 | dev_kfree_skb(skb); | ||
419 | return RX_QUEUED; | ||
420 | } | ||
421 | |||
422 | /* scanning finished during invoking of handlers */ | 416 | /* scanning finished during invoking of handlers */ |
423 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); | 417 | I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); |
424 | return RX_DROP_UNUSABLE; | 418 | return RX_DROP_UNUSABLE; |
@@ -2793,7 +2787,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2793 | local->dot11ReceivedFragmentCount++; | 2787 | local->dot11ReceivedFragmentCount++; |
2794 | 2788 | ||
2795 | if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) || | 2789 | if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) || |
2796 | test_bit(SCAN_OFF_CHANNEL, &local->scanning))) | 2790 | test_bit(SCAN_SW_SCANNING, &local->scanning))) |
2797 | status->rx_flags |= IEEE80211_RX_IN_SCAN; | 2791 | status->rx_flags |= IEEE80211_RX_IN_SCAN; |
2798 | 2792 | ||
2799 | if (ieee80211_is_mgmt(fc)) | 2793 | if (ieee80211_is_mgmt(fc)) |