| .. | .. |
|---|
| 413 | 413 | if (sc->cur_chandef.width != NL80211_CHAN_WIDTH_20_NOHT) |
|---|
| 414 | 414 | rfilt |= ATH9K_RX_FILTER_COMP_BAR; |
|---|
| 415 | 415 | |
|---|
| 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))) { |
|---|
| 417 | 418 | /* This is needed for older chips */ |
|---|
| 418 | 419 | if (sc->sc_ah->hw_version.macVersion <= AR_SREV_VERSION_9160) |
|---|
| 419 | 420 | rfilt |= ATH9K_RX_FILTER_PROM; |
|---|
| .. | .. |
|---|
| 815 | 816 | struct ath_common *common = ath9k_hw_common(ah); |
|---|
| 816 | 817 | struct ieee80211_hdr *hdr; |
|---|
| 817 | 818 | bool discard_current = sc->rx.discard_next; |
|---|
| 819 | + bool is_phyerr; |
|---|
| 818 | 820 | |
|---|
| 819 | 821 | /* |
|---|
| 820 | 822 | * Discard corrupt descriptors which are marked in |
|---|
| .. | .. |
|---|
| 827 | 829 | |
|---|
| 828 | 830 | /* |
|---|
| 829 | 831 | * Discard zero-length packets and packets smaller than an ACK |
|---|
| 832 | + * which are not PHY_ERROR (short radar pulses have a length of 3) |
|---|
| 830 | 833 | */ |
|---|
| 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); |
|---|
| 833 | 838 | goto corrupt; |
|---|
| 834 | 839 | } |
|---|
| 835 | 840 | |
|---|
| .. | .. |
|---|
| 839 | 844 | * those frames. |
|---|
| 840 | 845 | */ |
|---|
| 841 | 846 | 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); |
|---|
| 843 | 848 | goto corrupt; |
|---|
| 844 | 849 | } |
|---|
| 845 | 850 | |
|---|
| .. | .. |
|---|
| 880 | 885 | } else if (sc->spec_priv.spectral_mode != SPECTRAL_DISABLED && |
|---|
| 881 | 886 | ath_cmn_process_fft(&sc->spec_priv, hdr, rx_stats, |
|---|
| 882 | 887 | rx_status->mactime)) { |
|---|
| 883 | | - RX_STAT_INC(rx_spectral); |
|---|
| 888 | + RX_STAT_INC(sc, rx_spectral); |
|---|
| 884 | 889 | } |
|---|
| 885 | 890 | return -EINVAL; |
|---|
| 886 | 891 | } |
|---|
| .. | .. |
|---|
| 898 | 903 | spin_unlock_bh(&sc->chan_lock); |
|---|
| 899 | 904 | |
|---|
| 900 | 905 | if (ath_is_mybeacon(common, hdr)) { |
|---|
| 901 | | - RX_STAT_INC(rx_beacons); |
|---|
| 906 | + RX_STAT_INC(sc, rx_beacons); |
|---|
| 902 | 907 | rx_stats->is_mybeacon = true; |
|---|
| 903 | 908 | } |
|---|
| 904 | 909 | |
|---|
| .. | .. |
|---|
| 915 | 920 | */ |
|---|
| 916 | 921 | ath_dbg(common, ANY, "unsupported hw bitrate detected 0x%02x using 1 Mbit\n", |
|---|
| 917 | 922 | rx_stats->rs_rate); |
|---|
| 918 | | - RX_STAT_INC(rx_rate_err); |
|---|
| 923 | + RX_STAT_INC(sc, rx_rate_err); |
|---|
| 919 | 924 | return -EINVAL; |
|---|
| 920 | 925 | } |
|---|
| 921 | 926 | |
|---|
| .. | .. |
|---|
| 1006 | 1011 | struct ath_rx_status *rs, |
|---|
| 1007 | 1012 | struct sk_buff *skb) |
|---|
| 1008 | 1013 | { |
|---|
| 1009 | | - struct ath_node *an; |
|---|
| 1010 | | - struct ath_acq *acq; |
|---|
| 1011 | | - struct ath_vif *avp; |
|---|
| 1012 | 1014 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
|---|
| 1013 | 1015 | struct ath_hw *ah = sc->sc_ah; |
|---|
| 1014 | 1016 | struct ath_common *common = ath9k_hw_common(ah); |
|---|
| .. | .. |
|---|
| 1019 | 1021 | int phy; |
|---|
| 1020 | 1022 | u16 len = rs->rs_datalen; |
|---|
| 1021 | 1023 | u32 airtime = 0; |
|---|
| 1022 | | - u8 tidno, acno; |
|---|
| 1024 | + u8 tidno; |
|---|
| 1023 | 1025 | |
|---|
| 1024 | 1026 | if (!ieee80211_is_data(hdr->frame_control)) |
|---|
| 1025 | 1027 | return; |
|---|
| .. | .. |
|---|
| 1029 | 1031 | sta = ieee80211_find_sta_by_ifaddr(sc->hw, hdr->addr2, NULL); |
|---|
| 1030 | 1032 | if (!sta) |
|---|
| 1031 | 1033 | goto exit; |
|---|
| 1032 | | - an = (struct ath_node *) sta->drv_priv; |
|---|
| 1033 | | - avp = (struct ath_vif *) an->vif->drv_priv; |
|---|
| 1034 | 1034 | tidno = skb->priority & IEEE80211_QOS_CTL_TID_MASK; |
|---|
| 1035 | | - acno = TID_TO_WME_AC(tidno); |
|---|
| 1036 | | - acq = &avp->chanctx->acq[acno]; |
|---|
| 1037 | 1035 | |
|---|
| 1038 | 1036 | rxs = IEEE80211_SKB_RXCB(skb); |
|---|
| 1039 | 1037 | |
|---|
| .. | .. |
|---|
| 1054 | 1052 | len, rxs->rate_idx, is_sp); |
|---|
| 1055 | 1053 | } |
|---|
| 1056 | 1054 | |
|---|
| 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); |
|---|
| 1065 | 1056 | exit: |
|---|
| 1066 | 1057 | rcu_read_unlock(); |
|---|
| 1067 | 1058 | } |
|---|
| .. | .. |
|---|
| 1136 | 1127 | * skb and put it at the tail of the sc->rx.rxbuf list for |
|---|
| 1137 | 1128 | * processing. */ |
|---|
| 1138 | 1129 | if (!requeue_skb) { |
|---|
| 1139 | | - RX_STAT_INC(rx_oom_err); |
|---|
| 1130 | + RX_STAT_INC(sc, rx_oom_err); |
|---|
| 1140 | 1131 | goto requeue_drop_frag; |
|---|
| 1141 | 1132 | } |
|---|
| 1142 | 1133 | |
|---|
| .. | .. |
|---|
| 1164 | 1155 | rxs, decrypt_error); |
|---|
| 1165 | 1156 | |
|---|
| 1166 | 1157 | if (rs.rs_more) { |
|---|
| 1167 | | - RX_STAT_INC(rx_frags); |
|---|
| 1158 | + RX_STAT_INC(sc, rx_frags); |
|---|
| 1168 | 1159 | /* |
|---|
| 1169 | 1160 | * rs_more indicates chained descriptors which can be |
|---|
| 1170 | 1161 | * used to link buffers together for a sort of |
|---|
| .. | .. |
|---|
| 1174 | 1165 | /* too many fragments - cannot handle frame */ |
|---|
| 1175 | 1166 | dev_kfree_skb_any(sc->rx.frag); |
|---|
| 1176 | 1167 | dev_kfree_skb_any(skb); |
|---|
| 1177 | | - RX_STAT_INC(rx_too_many_frags_err); |
|---|
| 1168 | + RX_STAT_INC(sc, rx_too_many_frags_err); |
|---|
| 1178 | 1169 | skb = NULL; |
|---|
| 1179 | 1170 | } |
|---|
| 1180 | 1171 | sc->rx.frag = skb; |
|---|
| .. | .. |
|---|
| 1186 | 1177 | |
|---|
| 1187 | 1178 | if (pskb_expand_head(hdr_skb, 0, space, GFP_ATOMIC) < 0) { |
|---|
| 1188 | 1179 | dev_kfree_skb(skb); |
|---|
| 1189 | | - RX_STAT_INC(rx_oom_err); |
|---|
| 1180 | + RX_STAT_INC(sc, rx_oom_err); |
|---|
| 1190 | 1181 | goto requeue_drop_frag; |
|---|
| 1191 | 1182 | } |
|---|
| 1192 | 1183 | |
|---|