Skip to content

Commit da6a435

Browse files
committed
mac80211: separate encoding/bandwidth from flags
We currently use a lot of flags that are mutually incompatible, separate this out into actual encoding and bandwidth enum values. Much of this again done with spatch, with manual post-editing, mostly to add the switch statements and get rid of the conversions. @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_80MHZ +status->bw = RATE_INFO_BW_80 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_40MHZ +status->bw = RATE_INFO_BW_40 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_20MHZ +status->bw = RATE_INFO_BW_20 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_160MHZ +status->bw = RATE_INFO_BW_160 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_5MHZ +status->bw = RATE_INFO_BW_5 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_10MHZ +status->bw = RATE_INFO_BW_10 @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_VHT +status->encoding = RX_ENC_VHT @@ expression status; @@ -status->enc_flags |= RX_ENC_FLAG_HT +status->encoding = RX_ENC_HT @@ expression status; @@ -status.enc_flags |= RX_ENC_FLAG_VHT +status.encoding = RX_ENC_VHT @@ expression status; @@ -status.enc_flags |= RX_ENC_FLAG_HT +status.encoding = RX_ENC_HT @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_HT) +(status->encoding == RX_ENC_HT) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_VHT) +(status->encoding == RX_ENC_VHT) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_5MHZ) +(status->bw == RATE_INFO_BW_5) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_10MHZ) +(status->bw == RATE_INFO_BW_10) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_40MHZ) +(status->bw == RATE_INFO_BW_40) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_80MHZ) +(status->bw == RATE_INFO_BW_80) @@ expression status; @@ -(status->enc_flags & RX_ENC_FLAG_160MHZ) +(status->bw == RATE_INFO_BW_160) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 7fdd69c commit da6a435

File tree

40 files changed

+182
-171
lines changed

40 files changed

+182
-171
lines changed

drivers/net/wireless/ath/ath10k/htt_rx.c

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,11 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
632632
sgi = (info3 >> 7) & 1;
633633

634634
status->rate_idx = mcs;
635-
status->enc_flags |= RX_ENC_FLAG_HT;
635+
status->encoding = RX_ENC_HT;
636636
if (sgi)
637637
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
638638
if (bw)
639-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
639+
status->bw = RATE_INFO_BW_40;
640640
break;
641641
case HTT_RX_VHT:
642642
case HTT_RX_VHT_WITH_TXBF:
@@ -700,18 +700,18 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
700700
break;
701701
/* 40MHZ */
702702
case 1:
703-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
703+
status->bw = RATE_INFO_BW_40;
704704
break;
705705
/* 80MHZ */
706706
case 2:
707-
status->enc_flags |= RX_ENC_FLAG_80MHZ;
707+
status->bw = RATE_INFO_BW_80;
708708
break;
709709
case 3:
710-
status->enc_flags |= RX_ENC_FLAG_160MHZ;
710+
status->bw = RATE_INFO_BW_160;
711711
break;
712712
}
713713

714-
status->enc_flags |= RX_ENC_FLAG_VHT;
714+
status->encoding = RX_ENC_VHT;
715715
break;
716716
default:
717717
break;
@@ -875,11 +875,8 @@ static void ath10k_htt_rx_h_ppdu(struct ath10k *ar,
875875
status->freq = 0;
876876
status->rate_idx = 0;
877877
status->vht_nss = 0;
878-
status->enc_flags &= ~(RX_ENC_FLAG_HT |
879-
RX_ENC_FLAG_VHT |
880-
RX_ENC_FLAG_SHORT_GI |
881-
RX_ENC_FLAG_40MHZ |
882-
RX_ENC_FLAG_80MHZ);
878+
status->encoding = RX_ENC_LEGACY;
879+
status->bw = RATE_INFO_BW_20;
883880
status->flag &= ~RX_FLAG_MACTIME_END;
884881
status->flag |= RX_FLAG_NO_SIGNAL_VAL;
885882

@@ -941,13 +938,12 @@ static void ath10k_process_rx(struct ath10k *ar,
941938
is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
942939
"mcast" : "ucast",
943940
(__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
944-
(status->enc_flags & (RX_ENC_FLAG_HT | RX_ENC_FLAG_VHT)) == 0 ?
945-
"legacy" : "",
946-
status->enc_flags & RX_ENC_FLAG_HT ? "ht" : "",
947-
status->enc_flags & RX_ENC_FLAG_VHT ? "vht" : "",
948-
status->enc_flags & RX_ENC_FLAG_40MHZ ? "40" : "",
949-
status->enc_flags & RX_ENC_FLAG_80MHZ ? "80" : "",
950-
status->enc_flags & RX_ENC_FLAG_160MHZ ? "160" : "",
941+
(status->encoding == RX_ENC_LEGACY) ? "legacy" : "",
942+
(status->encoding == RX_ENC_HT) ? "ht" : "",
943+
(status->encoding == RX_ENC_VHT) ? "vht" : "",
944+
(status->bw == RATE_INFO_BW_40) ? "40" : "",
945+
(status->bw == RATE_INFO_BW_80) ? "80" : "",
946+
(status->bw == RATE_INFO_BW_160) ? "160" : "",
951947
status->enc_flags & RX_ENC_FLAG_SHORT_GI ? "sgi " : "",
952948
status->rate_idx,
953949
status->vht_nss,

drivers/net/wireless/ath/ath5k/base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,10 +1414,10 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
14141414
rxs->flag |= ath5k_rx_decrypted(ah, skb, rs);
14151415
switch (ah->ah_bwmode) {
14161416
case AR5K_BWMODE_5MHZ:
1417-
rxs->enc_flags |= RX_ENC_FLAG_5MHZ;
1417+
rxs->bw = RATE_INFO_BW_5;
14181418
break;
14191419
case AR5K_BWMODE_10MHZ:
1420-
rxs->enc_flags |= RX_ENC_FLAG_10MHZ;
1420+
rxs->bw = RATE_INFO_BW_10;
14211421
break;
14221422
default:
14231423
break;

drivers/net/wireless/ath/ath9k/ar9003_mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
495495
rxs->rs_status = 0;
496496
rxs->rs_flags = 0;
497497
rxs->enc_flags = 0;
498+
rxs->bw = RATE_INFO_BW_20;
498499

499500
rxs->rs_datalen = rxsp->status2 & AR_DataLen;
500501
rxs->rs_tstamp = rxsp->status3;

drivers/net/wireless/ath/ath9k/common.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,15 @@ int ath9k_cmn_process_rate(struct ath_common *common,
181181
sband = hw->wiphy->bands[band];
182182

183183
if (IS_CHAN_QUARTER_RATE(ah->curchan))
184-
rxs->enc_flags |= RX_ENC_FLAG_5MHZ;
184+
rxs->bw = RATE_INFO_BW_5;
185185
else if (IS_CHAN_HALF_RATE(ah->curchan))
186-
rxs->enc_flags |= RX_ENC_FLAG_10MHZ;
186+
rxs->bw = RATE_INFO_BW_10;
187187

188188
if (rx_stats->rs_rate & 0x80) {
189189
/* HT rate */
190-
rxs->enc_flags |= RX_ENC_FLAG_HT | rx_stats->enc_flags;
190+
rxs->encoding = RX_ENC_HT;
191+
rxs->enc_flags |= rx_stats->enc_flags;
192+
rxs->bw = rx_stats->bw;
191193
rxs->rate_idx = rx_stats->rs_rate & 0x7f;
192194
return 0;
193195
}

drivers/net/wireless/ath/ath9k/debug_sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void ath_debug_rate_stats(struct ath_softc *sc,
116116
if (rxs->rate_idx >= ARRAY_SIZE(rstats->ht_stats))
117117
goto exit;
118118

119-
if (rxs->enc_flags & RX_ENC_FLAG_40MHZ)
119+
if ((rxs->bw == RATE_INFO_BW_40))
120120
rstats->ht_stats[rxs->rate_idx].ht40_cnt++;
121121
else
122122
rstats->ht_stats[rxs->rate_idx].ht20_cnt++;

drivers/net/wireless/ath/ath9k/htc_drv_txrx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,9 @@ static inline void convert_htc_flag(struct ath_rx_status *rx_stats,
930930
struct ath_htc_rx_status *rxstatus)
931931
{
932932
rx_stats->enc_flags = 0;
933+
rx_stats->bw = RATE_INFO_BW_20;
933934
if (rxstatus->rs_flags & ATH9K_RX_2040)
934-
rx_stats->enc_flags |= RX_ENC_FLAG_40MHZ;
935+
rx_stats->bw = RATE_INFO_BW_40;
935936
if (rxstatus->rs_flags & ATH9K_RX_GI)
936937
rx_stats->enc_flags |= RX_ENC_FLAG_SHORT_GI;
937938
}

drivers/net/wireless/ath/ath9k/mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
536536
rs->rs_status = 0;
537537
rs->rs_flags = 0;
538538
rs->enc_flags = 0;
539+
rs->bw = RATE_INFO_BW_20;
539540

540541
rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
541542
rs->rs_tstamp = ads.AR_RcvTimestamp;

drivers/net/wireless/ath/ath9k/mac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#ifndef MAC_H
1818
#define MAC_H
19+
#include <net/cfg80211.h>
1920

2021
#define set11nTries(_series, _index) \
2122
(SM((_series)[_index].Tries, AR_XmitDataTries##_index))
@@ -144,6 +145,7 @@ struct ath_rx_status {
144145
u32 evm3;
145146
u32 evm4;
146147
u16 enc_flags;
148+
enum rate_info_bw bw;
147149
};
148150

149151
struct ath_htc_rx_status {

drivers/net/wireless/ath/ath9k/recv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,10 +1038,10 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
10381038
rxs = IEEE80211_SKB_RXCB(skb);
10391039

10401040
is_sgi = !!(rxs->enc_flags & RX_ENC_FLAG_SHORT_GI);
1041-
is_40 = !!(rxs->enc_flags & RX_ENC_FLAG_40MHZ);
1041+
is_40 = !!(rxs->bw == RATE_INFO_BW_40);
10421042
is_sp = !!(rxs->enc_flags & RX_ENC_FLAG_SHORTPRE);
10431043

1044-
if (!!(rxs->enc_flags & RX_ENC_FLAG_HT)) {
1044+
if (!!(rxs->encoding == RX_ENC_HT)) {
10451045
/* MCS rates */
10461046

10471047
airtime += ath_pkt_duration(sc, rxs->rate_idx, len,

drivers/net/wireless/ath/carl9170/rx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ static int carl9170_rx_mac_status(struct ar9170 *ar,
423423

424424
case AR9170_RX_STATUS_MODULATION_HT:
425425
if (head->plcp[3] & 0x80)
426-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
426+
status->bw = RATE_INFO_BW_40;
427427
if (head->plcp[6] & 0x80)
428428
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
429429

430430
status->rate_idx = clamp(0, 75, head->plcp[3] & 0x7f);
431-
status->enc_flags |= RX_ENC_FLAG_HT;
431+
status->encoding = RX_ENC_HT;
432432
break;
433433

434434
default:

drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7092,9 +7092,9 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
70927092
rspec = brcms_c_compute_rspec(rxh, plcp);
70937093
if (is_mcs_rate(rspec)) {
70947094
rx_status->rate_idx = rspec & RSPEC_RATE_MASK;
7095-
rx_status->enc_flags |= RX_ENC_FLAG_HT;
7095+
rx_status->encoding = RX_ENC_HT;
70967096
if (rspec_is40mhz(rspec))
7097-
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
7097+
rx_status->bw = RATE_INFO_BW_40;
70987098
} else {
70997099
switch (rspec2rate(rspec)) {
71007100
case BRCM_RATE_1M:

drivers/net/wireless/intel/iwlegacy/4965-mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)
732732

733733
/* Set up the HT phy flags */
734734
if (rate_n_flags & RATE_MCS_HT_MSK)
735-
rx_status.enc_flags |= RX_ENC_FLAG_HT;
735+
rx_status.encoding = RX_ENC_HT;
736736
if (rate_n_flags & RATE_MCS_HT40_MSK)
737737
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;
738738
if (rate_n_flags & RATE_MCS_SGI_MSK)

drivers/net/wireless/intel/iwlwifi/dvm/rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ static void iwlagn_rx_reply_rx(struct iwl_priv *priv,
887887

888888
/* Set up the HT phy flags */
889889
if (rate_n_flags & RATE_MCS_HT_MSK)
890-
rx_status.enc_flags |= RX_ENC_FLAG_HT;
890+
rx_status.encoding = RX_ENC_HT;
891891
if (rate_n_flags & RATE_MCS_HT40_MSK)
892892
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;
893893
if (rate_n_flags & RATE_MCS_SGI_MSK)

drivers/net/wireless/intel/iwlwifi/mvm/rx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,13 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
427427
case RATE_MCS_CHAN_WIDTH_20:
428428
break;
429429
case RATE_MCS_CHAN_WIDTH_40:
430-
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
430+
rx_status->bw = RATE_INFO_BW_40;
431431
break;
432432
case RATE_MCS_CHAN_WIDTH_80:
433-
rx_status->enc_flags |= RX_ENC_FLAG_80MHZ;
433+
rx_status->bw = RATE_INFO_BW_80;
434434
break;
435435
case RATE_MCS_CHAN_WIDTH_160:
436-
rx_status->enc_flags |= RX_ENC_FLAG_160MHZ;
436+
rx_status->bw = RATE_INFO_BW_160;
437437
break;
438438
}
439439
if (rate_n_flags & RATE_MCS_SGI_MSK)
@@ -445,7 +445,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
445445
if (rate_n_flags & RATE_MCS_HT_MSK) {
446446
u8 stbc = (rate_n_flags & RATE_MCS_HT_STBC_MSK) >>
447447
RATE_MCS_STBC_POS;
448-
rx_status->enc_flags |= RX_ENC_FLAG_HT;
448+
rx_status->encoding = RX_ENC_HT;
449449
rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK;
450450
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
451451
} else if (rate_n_flags & RATE_MCS_VHT_MSK) {
@@ -455,7 +455,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
455455
((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
456456
RATE_VHT_MCS_NSS_POS) + 1;
457457
rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
458-
rx_status->enc_flags |= RX_ENC_FLAG_VHT;
458+
rx_status->encoding = RX_ENC_VHT;
459459
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
460460
if (rate_n_flags & RATE_MCS_BF_MSK)
461461
rx_status->enc_flags |= RX_ENC_FLAG_BF;

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,13 +958,13 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
958958
case RATE_MCS_CHAN_WIDTH_20:
959959
break;
960960
case RATE_MCS_CHAN_WIDTH_40:
961-
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
961+
rx_status->bw = RATE_INFO_BW_40;
962962
break;
963963
case RATE_MCS_CHAN_WIDTH_80:
964-
rx_status->enc_flags |= RX_ENC_FLAG_80MHZ;
964+
rx_status->bw = RATE_INFO_BW_80;
965965
break;
966966
case RATE_MCS_CHAN_WIDTH_160:
967-
rx_status->enc_flags |= RX_ENC_FLAG_160MHZ;
967+
rx_status->bw = RATE_INFO_BW_160;
968968
break;
969969
}
970970
if (rate_n_flags & RATE_MCS_SGI_MSK)
@@ -976,7 +976,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
976976
if (rate_n_flags & RATE_MCS_HT_MSK) {
977977
u8 stbc = (rate_n_flags & RATE_MCS_HT_STBC_MSK) >>
978978
RATE_MCS_STBC_POS;
979-
rx_status->enc_flags |= RX_ENC_FLAG_HT;
979+
rx_status->encoding = RX_ENC_HT;
980980
rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK;
981981
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
982982
} else if (rate_n_flags & RATE_MCS_VHT_MSK) {
@@ -986,7 +986,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
986986
((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
987987
RATE_VHT_MCS_NSS_POS) + 1;
988988
rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
989-
rx_status->enc_flags |= RX_ENC_FLAG_VHT;
989+
rx_status->encoding = RX_ENC_VHT;
990990
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
991991
if (rate_n_flags & RATE_MCS_BF_MSK)
992992
rx_status->enc_flags |= RX_ENC_FLAG_BF;

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,11 +1194,11 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
11941194
ieee80211_rate_get_vht_mcs(&info->control.rates[0]);
11951195
rx_status.vht_nss =
11961196
ieee80211_rate_get_vht_nss(&info->control.rates[0]);
1197-
rx_status.enc_flags |= RX_ENC_FLAG_VHT;
1197+
rx_status.encoding = RX_ENC_VHT;
11981198
} else {
11991199
rx_status.rate_idx = info->control.rates[0].idx;
12001200
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
1201-
rx_status.enc_flags |= RX_ENC_FLAG_HT;
1201+
rx_status.encoding = RX_ENC_HT;
12021202
}
12031203
if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
12041204
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;

drivers/net/wireless/marvell/mwl8k.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,9 @@ mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,
994994
*noise = -rxd->noise_floor;
995995

996996
if (rxd->rate & MWL8K_AP_RATE_INFO_MCS_FORMAT) {
997-
status->enc_flags |= RX_ENC_FLAG_HT;
997+
status->encoding = RX_ENC_HT;
998998
if (rxd->rate & MWL8K_AP_RATE_INFO_40MHZ)
999-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
999+
status->bw = RATE_INFO_BW_40;
10001000
status->rate_idx = MWL8K_AP_RATE_INFO_RATEID(rxd->rate);
10011001
} else {
10021002
int i;
@@ -1011,7 +1011,7 @@ mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,
10111011

10121012
if (rxd->channel > 14) {
10131013
status->band = NL80211_BAND_5GHZ;
1014-
if (!(status->enc_flags & RX_ENC_FLAG_HT))
1014+
if (!(status->encoding == RX_ENC_HT))
10151015
status->rate_idx -= 5;
10161016
} else {
10171017
status->band = NL80211_BAND_2GHZ;
@@ -1111,15 +1111,15 @@ mwl8k_rxd_sta_process(void *_rxd, struct ieee80211_rx_status *status,
11111111
if (rate_info & MWL8K_STA_RATE_INFO_SHORTPRE)
11121112
status->enc_flags |= RX_ENC_FLAG_SHORTPRE;
11131113
if (rate_info & MWL8K_STA_RATE_INFO_40MHZ)
1114-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
1114+
status->bw = RATE_INFO_BW_40;
11151115
if (rate_info & MWL8K_STA_RATE_INFO_SHORTGI)
11161116
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
11171117
if (rate_info & MWL8K_STA_RATE_INFO_MCS_FORMAT)
1118-
status->enc_flags |= RX_ENC_FLAG_HT;
1118+
status->encoding = RX_ENC_HT;
11191119

11201120
if (rxd->channel > 14) {
11211121
status->band = NL80211_BAND_5GHZ;
1122-
if (!(status->enc_flags & RX_ENC_FLAG_HT))
1122+
if (!(status->encoding == RX_ENC_HT))
11231123
status->rate_idx -= 5;
11241124
} else {
11251125
status->band = NL80211_BAND_2GHZ;

drivers/net/wireless/mediatek/mt7601u/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ mt76_mac_process_rate(struct ieee80211_rx_status *status, u16 rate)
413413
status->enc_flags |= RX_ENC_FLAG_HT_GF;
414414
/* fall through */
415415
case MT_PHY_TYPE_HT:
416-
status->enc_flags |= RX_ENC_FLAG_HT;
416+
status->encoding = RX_ENC_HT;
417417
status->rate_idx = idx;
418418
break;
419419
default:
@@ -428,7 +428,7 @@ mt76_mac_process_rate(struct ieee80211_rx_status *status, u16 rate)
428428
status->enc_flags |= 1 << RX_ENC_FLAG_STBC_SHIFT;
429429

430430
if (rate & MT_RXWI_RATE_BW)
431-
status->enc_flags |= RX_ENC_FLAG_40MHZ;
431+
status->bw = RATE_INFO_BW_40;
432432
}
433433

434434
static void

drivers/net/wireless/ralink/rt2x00/rt2800lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ void rt2800_process_rxwi(struct queue_entry *entry,
892892
rxdesc->enc_flags |= RX_ENC_FLAG_SHORT_GI;
893893

894894
if (rt2x00_get_field32(word, RXWI_W1_BW))
895-
rxdesc->enc_flags |= RX_ENC_FLAG_40MHZ;
895+
rxdesc->bw = RATE_INFO_BW_40;
896896

897897
/*
898898
* Detect RX rate, always use MCS as signal type.

drivers/net/wireless/ralink/rt2x00/rt2x00dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
825825
rate_idx = rt2x00lib_rxdone_read_signal(rt2x00dev, &rxdesc);
826826
if (rxdesc.rate_mode == RATE_MODE_HT_MIX ||
827827
rxdesc.rate_mode == RATE_MODE_HT_GREENFIELD)
828-
rxdesc.enc_flags |= RX_ENC_FLAG_HT;
828+
rxdesc.encoding = RX_ENC_HT;
829829

830830
/*
831831
* Check if this is a beacon, and more frames have been
@@ -866,6 +866,8 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
866866
rx_status->signal = rxdesc.rssi;
867867
rx_status->flag = rxdesc.flags;
868868
rx_status->enc_flags = rxdesc.enc_flags;
869+
rx_status->encoding = rxdesc.encoding;
870+
rx_status->bw = rxdesc.bw;
869871
rx_status->antenna = rt2x00dev->link.ant.active.rx;
870872

871873
ieee80211_rx_ni(rt2x00dev->hw, entry->skb);

drivers/net/wireless/ralink/rt2x00/rt2x00queue.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ struct rxdone_entry_desc {
185185
int dev_flags;
186186
u16 rate_mode;
187187
u16 enc_flags;
188+
enum mac80211_rx_encoding encoding;
189+
enum rate_info_bw bw;
188190
u8 cipher;
189191
u8 cipher_status;
190192

0 commit comments

Comments
 (0)