mac80211: fix release_reorder_timeout in scan
authorJohannes Berg <johannes.berg@intel.com>
Fri, 24 Sep 2010 09:21:08 +0000 (11:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Sep 2010 19:57:53 +0000 (15:57 -0400)
Even if the reorder timeout timer fires while
scanning, the frames weren't received during
scanning and therefore shouldn't be dropped.
To implement this, changes to the passive scan
RX handler simplify understanding it, because
it currently checks HW_SCANNING independently
of a packet's in-scan receive status (which
doesn't make a big difference, since scan_rx()
will only pick up probe responses and beacons,
which can't be aggregated.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/rx.c

index 2b6b4eab44dde883c0fed92b66822b44e93a04ce..8c666e9e8fb0594247d25068e3a9f14982e8a3c6 100644 (file)
@@ -389,24 +389,22 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
        struct ieee80211_local *local = rx->local;
        struct sk_buff *skb = rx->skb;
 
-       if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning)))
+       if (likely(!(rx->flags & IEEE80211_RX_IN_SCAN)))
+               return RX_CONTINUE;
+
+       if (test_bit(SCAN_HW_SCANNING, &local->scanning))
                return ieee80211_scan_rx(rx->sdata, skb);
 
-       if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning) &&
-                    (rx->flags & IEEE80211_RX_IN_SCAN))) {
+       if (test_bit(SCAN_SW_SCANNING, &local->scanning)) {
                /* drop all the other packets during a software scan anyway */
                if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED)
                        dev_kfree_skb(skb);
                return RX_QUEUED;
        }
 
-       if (unlikely(rx->flags & IEEE80211_RX_IN_SCAN)) {
-               /* scanning finished during invoking of handlers */
-               I802_DEBUG_INC(local->rx_handlers_drop_passive_scan);
-               return RX_DROP_UNUSABLE;
-       }
-
-       return RX_CONTINUE;
+       /* scanning finished during invoking of handlers */
+       I802_DEBUG_INC(local->rx_handlers_drop_passive_scan);
+       return RX_DROP_UNUSABLE;
 }
 
 
@@ -2495,10 +2493,6 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
        rx.queue = tid;
        rx.flags |= IEEE80211_RX_RA_MATCH;
 
-       if (unlikely(test_bit(SCAN_HW_SCANNING, &sta->local->scanning) ||
-                    test_bit(SCAN_OFF_CHANNEL, &sta->local->scanning)))
-               rx.flags |= IEEE80211_RX_IN_SCAN;
-
        spin_lock(&tid_agg_rx->reorder_lock);
        ieee80211_sta_reorder_release(&sta->local->hw, tid_agg_rx, &frames);
        spin_unlock(&tid_agg_rx->reorder_lock);