aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2009-07-23 07:18:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:17 -0400
commit142b9f5074dc0d09dc0025739ad437723d7bf527 (patch)
tree07173ed0ffae8956c1f8938bc41695b1d19cebb0 /net/mac80211/rx.c
parentfbe9c429f195111bbf7f1630efa19aee295fd8e7 (diff)
mac80211: implement basic background scanning
Introduce a new scan flag "SCAN_OFF_CHANNEL" which basically tells us that we are currently on a different channel for scanning and cannot RX/TX. "SCAN_SW_SCANNING" tells us that we are currently running a software scan but we might as well be on the operating channel to RX/TX. While "SCAN_SW_SCANNING" is set during the whole scan "SCAN_OFF_CHANNEL" is set when leaving the operating channel and unset when coming back. Introduce two new scan states "SCAN_LEAVE_OPER_CHANNEL" and "SCAN_ENTER_OPER_CHANNEL" which basically implement the functionality we need to leave the operating channel (send a nullfunc to the AP and stop the queues) and enter it again (send a nullfunc to the AP and start the queues again). Enhance the scan state "SCAN_DECISION" to switch back to the operating channel after each scanned channel. In the future it sould be simple to enhance the decision state to scan as much channels in a row as the qos latency allows us. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 9c1679d124ba..cb95a3116034 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -421,7 +421,8 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
421 if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning))) 421 if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning)))
422 return ieee80211_scan_rx(rx->sdata, skb); 422 return ieee80211_scan_rx(rx->sdata, skb);
423 423
424 if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning))) { 424 if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning) &&
425 (rx->flags & IEEE80211_RX_IN_SCAN))) {
425 /* drop all the other packets during a software scan anyway */ 426 /* drop all the other packets during a software scan anyway */
426 if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED) 427 if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED)
427 dev_kfree_skb(skb); 428 dev_kfree_skb(skb);
@@ -2136,7 +2137,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
2136 return; 2137 return;
2137 } 2138 }
2138 2139
2139 if (unlikely(local->scanning)) 2140 if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
2141 test_bit(SCAN_OFF_CHANNEL, &local->scanning)))
2140 rx.flags |= IEEE80211_RX_IN_SCAN; 2142 rx.flags |= IEEE80211_RX_IN_SCAN;
2141 2143
2142 ieee80211_parse_qos(&rx); 2144 ieee80211_parse_qos(&rx);