hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/ath/ath9k/recv.c
....@@ -413,7 +413,8 @@
413413 if (sc->cur_chandef.width != NL80211_CHAN_WIDTH_20_NOHT)
414414 rfilt |= ATH9K_RX_FILTER_COMP_BAR;
415415
416
- if (sc->cur_chan->nvifs > 1 || (sc->cur_chan->rxfilter & FIF_OTHER_BSS)) {
416
+ if (sc->cur_chan->nvifs > 1 ||
417
+ (sc->cur_chan->rxfilter & (FIF_OTHER_BSS | FIF_MCAST_ACTION))) {
417418 /* This is needed for older chips */
418419 if (sc->sc_ah->hw_version.macVersion <= AR_SREV_VERSION_9160)
419420 rfilt |= ATH9K_RX_FILTER_PROM;
....@@ -815,6 +816,7 @@
815816 struct ath_common *common = ath9k_hw_common(ah);
816817 struct ieee80211_hdr *hdr;
817818 bool discard_current = sc->rx.discard_next;
819
+ bool is_phyerr;
818820
819821 /*
820822 * Discard corrupt descriptors which are marked in
....@@ -827,9 +829,12 @@
827829
828830 /*
829831 * Discard zero-length packets and packets smaller than an ACK
832
+ * which are not PHY_ERROR (short radar pulses have a length of 3)
830833 */
831
- if (rx_stats->rs_datalen < 10) {
832
- RX_STAT_INC(rx_len_err);
834
+ is_phyerr = rx_stats->rs_status & ATH9K_RXERR_PHY;
835
+ if (!rx_stats->rs_datalen ||
836
+ (rx_stats->rs_datalen < 10 && !is_phyerr)) {
837
+ RX_STAT_INC(sc, rx_len_err);
833838 goto corrupt;
834839 }
835840
....@@ -839,7 +844,7 @@
839844 * those frames.
840845 */
841846 if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
842
- RX_STAT_INC(rx_len_err);
847
+ RX_STAT_INC(sc, rx_len_err);
843848 goto corrupt;
844849 }
845850
....@@ -880,7 +885,7 @@
880885 } else if (sc->spec_priv.spectral_mode != SPECTRAL_DISABLED &&
881886 ath_cmn_process_fft(&sc->spec_priv, hdr, rx_stats,
882887 rx_status->mactime)) {
883
- RX_STAT_INC(rx_spectral);
888
+ RX_STAT_INC(sc, rx_spectral);
884889 }
885890 return -EINVAL;
886891 }
....@@ -898,7 +903,7 @@
898903 spin_unlock_bh(&sc->chan_lock);
899904
900905 if (ath_is_mybeacon(common, hdr)) {
901
- RX_STAT_INC(rx_beacons);
906
+ RX_STAT_INC(sc, rx_beacons);
902907 rx_stats->is_mybeacon = true;
903908 }
904909
....@@ -915,7 +920,7 @@
915920 */
916921 ath_dbg(common, ANY, "unsupported hw bitrate detected 0x%02x using 1 Mbit\n",
917922 rx_stats->rs_rate);
918
- RX_STAT_INC(rx_rate_err);
923
+ RX_STAT_INC(sc, rx_rate_err);
919924 return -EINVAL;
920925 }
921926
....@@ -1006,9 +1011,6 @@
10061011 struct ath_rx_status *rs,
10071012 struct sk_buff *skb)
10081013 {
1009
- struct ath_node *an;
1010
- struct ath_acq *acq;
1011
- struct ath_vif *avp;
10121014 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
10131015 struct ath_hw *ah = sc->sc_ah;
10141016 struct ath_common *common = ath9k_hw_common(ah);
....@@ -1019,7 +1021,7 @@
10191021 int phy;
10201022 u16 len = rs->rs_datalen;
10211023 u32 airtime = 0;
1022
- u8 tidno, acno;
1024
+ u8 tidno;
10231025
10241026 if (!ieee80211_is_data(hdr->frame_control))
10251027 return;
....@@ -1029,11 +1031,7 @@
10291031 sta = ieee80211_find_sta_by_ifaddr(sc->hw, hdr->addr2, NULL);
10301032 if (!sta)
10311033 goto exit;
1032
- an = (struct ath_node *) sta->drv_priv;
1033
- avp = (struct ath_vif *) an->vif->drv_priv;
10341034 tidno = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
1035
- acno = TID_TO_WME_AC(tidno);
1036
- acq = &avp->chanctx->acq[acno];
10371035
10381036 rxs = IEEE80211_SKB_RXCB(skb);
10391037
....@@ -1054,14 +1052,7 @@
10541052 len, rxs->rate_idx, is_sp);
10551053 }
10561054
1057
- if (!!(sc->airtime_flags & AIRTIME_USE_RX)) {
1058
- spin_lock_bh(&acq->lock);
1059
- an->airtime_deficit[acno] -= airtime;
1060
- if (an->airtime_deficit[acno] <= 0)
1061
- __ath_tx_queue_tid(sc, ATH_AN_2_TID(an, tidno));
1062
- spin_unlock_bh(&acq->lock);
1063
- }
1064
- ath_debug_airtime(sc, an, airtime, 0);
1055
+ ieee80211_sta_register_airtime(sta, tidno, 0, airtime);
10651056 exit:
10661057 rcu_read_unlock();
10671058 }
....@@ -1136,7 +1127,7 @@
11361127 * skb and put it at the tail of the sc->rx.rxbuf list for
11371128 * processing. */
11381129 if (!requeue_skb) {
1139
- RX_STAT_INC(rx_oom_err);
1130
+ RX_STAT_INC(sc, rx_oom_err);
11401131 goto requeue_drop_frag;
11411132 }
11421133
....@@ -1164,7 +1155,7 @@
11641155 rxs, decrypt_error);
11651156
11661157 if (rs.rs_more) {
1167
- RX_STAT_INC(rx_frags);
1158
+ RX_STAT_INC(sc, rx_frags);
11681159 /*
11691160 * rs_more indicates chained descriptors which can be
11701161 * used to link buffers together for a sort of
....@@ -1174,7 +1165,7 @@
11741165 /* too many fragments - cannot handle frame */
11751166 dev_kfree_skb_any(sc->rx.frag);
11761167 dev_kfree_skb_any(skb);
1177
- RX_STAT_INC(rx_too_many_frags_err);
1168
+ RX_STAT_INC(sc, rx_too_many_frags_err);
11781169 skb = NULL;
11791170 }
11801171 sc->rx.frag = skb;
....@@ -1186,7 +1177,7 @@
11861177
11871178 if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) {
11881179 dev_kfree_skb(skb);
1189
- RX_STAT_INC(rx_oom_err);
1180
+ RX_STAT_INC(sc, rx_oom_err);
11901181 goto requeue_drop_frag;
11911182 }
11921183