Skip to content

Commit

Permalink
mac80211: separate encoding/bandwidth from flags
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jmberg-intel committed Apr 28, 2017
1 parent 7fdd69c commit da6a435
Show file tree
Hide file tree
Showing 40 changed files with 182 additions and 171 deletions.
32 changes: 14 additions & 18 deletions drivers/net/wireless/ath/ath10k/htt_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,11 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
sgi = (info3 >> 7) & 1;

status->rate_idx = mcs;
status->enc_flags |= RX_ENC_FLAG_HT;
status->encoding = RX_ENC_HT;
if (sgi)
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
if (bw)
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
break;
case HTT_RX_VHT:
case HTT_RX_VHT_WITH_TXBF:
Expand Down Expand Up @@ -700,18 +700,18 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
break;
/* 40MHZ */
case 1:
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
break;
/* 80MHZ */
case 2:
status->enc_flags |= RX_ENC_FLAG_80MHZ;
status->bw = RATE_INFO_BW_80;
break;
case 3:
status->enc_flags |= RX_ENC_FLAG_160MHZ;
status->bw = RATE_INFO_BW_160;
break;
}

status->enc_flags |= RX_ENC_FLAG_VHT;
status->encoding = RX_ENC_VHT;
break;
default:
break;
Expand Down Expand Up @@ -875,11 +875,8 @@ static void ath10k_htt_rx_h_ppdu(struct ath10k *ar,
status->freq = 0;
status->rate_idx = 0;
status->vht_nss = 0;
status->enc_flags &= ~(RX_ENC_FLAG_HT |
RX_ENC_FLAG_VHT |
RX_ENC_FLAG_SHORT_GI |
RX_ENC_FLAG_40MHZ |
RX_ENC_FLAG_80MHZ);
status->encoding = RX_ENC_LEGACY;
status->bw = RATE_INFO_BW_20;
status->flag &= ~RX_FLAG_MACTIME_END;
status->flag |= RX_FLAG_NO_SIGNAL_VAL;

Expand Down Expand Up @@ -941,13 +938,12 @@ static void ath10k_process_rx(struct ath10k *ar,
is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
"mcast" : "ucast",
(__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
(status->enc_flags & (RX_ENC_FLAG_HT | RX_ENC_FLAG_VHT)) == 0 ?
"legacy" : "",
status->enc_flags & RX_ENC_FLAG_HT ? "ht" : "",
status->enc_flags & RX_ENC_FLAG_VHT ? "vht" : "",
status->enc_flags & RX_ENC_FLAG_40MHZ ? "40" : "",
status->enc_flags & RX_ENC_FLAG_80MHZ ? "80" : "",
status->enc_flags & RX_ENC_FLAG_160MHZ ? "160" : "",
(status->encoding == RX_ENC_LEGACY) ? "legacy" : "",
(status->encoding == RX_ENC_HT) ? "ht" : "",
(status->encoding == RX_ENC_VHT) ? "vht" : "",
(status->bw == RATE_INFO_BW_40) ? "40" : "",
(status->bw == RATE_INFO_BW_80) ? "80" : "",
(status->bw == RATE_INFO_BW_160) ? "160" : "",
status->enc_flags & RX_ENC_FLAG_SHORT_GI ? "sgi " : "",
status->rate_idx,
status->vht_nss,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,10 +1414,10 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
rxs->flag |= ath5k_rx_decrypted(ah, skb, rs);
switch (ah->ah_bwmode) {
case AR5K_BWMODE_5MHZ:
rxs->enc_flags |= RX_ENC_FLAG_5MHZ;
rxs->bw = RATE_INFO_BW_5;
break;
case AR5K_BWMODE_10MHZ:
rxs->enc_flags |= RX_ENC_FLAG_10MHZ;
rxs->bw = RATE_INFO_BW_10;
break;
default:
break;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath9k/ar9003_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs,
rxs->rs_status = 0;
rxs->rs_flags = 0;
rxs->enc_flags = 0;
rxs->bw = RATE_INFO_BW_20;

rxs->rs_datalen = rxsp->status2 & AR_DataLen;
rxs->rs_tstamp = rxsp->status3;
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/wireless/ath/ath9k/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@ int ath9k_cmn_process_rate(struct ath_common *common,
sband = hw->wiphy->bands[band];

if (IS_CHAN_QUARTER_RATE(ah->curchan))
rxs->enc_flags |= RX_ENC_FLAG_5MHZ;
rxs->bw = RATE_INFO_BW_5;
else if (IS_CHAN_HALF_RATE(ah->curchan))
rxs->enc_flags |= RX_ENC_FLAG_10MHZ;
rxs->bw = RATE_INFO_BW_10;

if (rx_stats->rs_rate & 0x80) {
/* HT rate */
rxs->enc_flags |= RX_ENC_FLAG_HT | rx_stats->enc_flags;
rxs->encoding = RX_ENC_HT;
rxs->enc_flags |= rx_stats->enc_flags;
rxs->bw = rx_stats->bw;
rxs->rate_idx = rx_stats->rs_rate & 0x7f;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/debug_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void ath_debug_rate_stats(struct ath_softc *sc,
if (rxs->rate_idx >= ARRAY_SIZE(rstats->ht_stats))
goto exit;

if (rxs->enc_flags & RX_ENC_FLAG_40MHZ)
if ((rxs->bw == RATE_INFO_BW_40))
rstats->ht_stats[rxs->rate_idx].ht40_cnt++;
else
rstats->ht_stats[rxs->rate_idx].ht20_cnt++;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,9 @@ static inline void convert_htc_flag(struct ath_rx_status *rx_stats,
struct ath_htc_rx_status *rxstatus)
{
rx_stats->enc_flags = 0;
rx_stats->bw = RATE_INFO_BW_20;
if (rxstatus->rs_flags & ATH9K_RX_2040)
rx_stats->enc_flags |= RX_ENC_FLAG_40MHZ;
rx_stats->bw = RATE_INFO_BW_40;
if (rxstatus->rs_flags & ATH9K_RX_GI)
rx_stats->enc_flags |= RX_ENC_FLAG_SHORT_GI;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath9k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
rs->rs_status = 0;
rs->rs_flags = 0;
rs->enc_flags = 0;
rs->bw = RATE_INFO_BW_20;

rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
rs->rs_tstamp = ads.AR_RcvTimestamp;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath9k/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#ifndef MAC_H
#define MAC_H
#include <net/cfg80211.h>

#define set11nTries(_series, _index) \
(SM((_series)[_index].Tries, AR_XmitDataTries##_index))
Expand Down Expand Up @@ -144,6 +145,7 @@ struct ath_rx_status {
u32 evm3;
u32 evm4;
u16 enc_flags;
enum rate_info_bw bw;
};

struct ath_htc_rx_status {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,10 +1038,10 @@ static void ath_rx_count_airtime(struct ath_softc *sc,
rxs = IEEE80211_SKB_RXCB(skb);

is_sgi = !!(rxs->enc_flags & RX_ENC_FLAG_SHORT_GI);
is_40 = !!(rxs->enc_flags & RX_ENC_FLAG_40MHZ);
is_40 = !!(rxs->bw == RATE_INFO_BW_40);
is_sp = !!(rxs->enc_flags & RX_ENC_FLAG_SHORTPRE);

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

airtime += ath_pkt_duration(sc, rxs->rate_idx, len,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/carl9170/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ static int carl9170_rx_mac_status(struct ar9170 *ar,

case AR9170_RX_STATUS_MODULATION_HT:
if (head->plcp[3] & 0x80)
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
if (head->plcp[6] & 0x80)
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;

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

default:
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7092,9 +7092,9 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
rspec = brcms_c_compute_rspec(rxh, plcp);
if (is_mcs_rate(rspec)) {
rx_status->rate_idx = rspec & RSPEC_RATE_MASK;
rx_status->enc_flags |= RX_ENC_FLAG_HT;
rx_status->encoding = RX_ENC_HT;
if (rspec_is40mhz(rspec))
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
rx_status->bw = RATE_INFO_BW_40;
} else {
switch (rspec2rate(rspec)) {
case BRCM_RATE_1M:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlegacy/4965-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)

/* Set up the HT phy flags */
if (rate_n_flags & RATE_MCS_HT_MSK)
rx_status.enc_flags |= RX_ENC_FLAG_HT;
rx_status.encoding = RX_ENC_HT;
if (rate_n_flags & RATE_MCS_HT40_MSK)
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;
if (rate_n_flags & RATE_MCS_SGI_MSK)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/dvm/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ static void iwlagn_rx_reply_rx(struct iwl_priv *priv,

/* Set up the HT phy flags */
if (rate_n_flags & RATE_MCS_HT_MSK)
rx_status.enc_flags |= RX_ENC_FLAG_HT;
rx_status.encoding = RX_ENC_HT;
if (rate_n_flags & RATE_MCS_HT40_MSK)
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;
if (rate_n_flags & RATE_MCS_SGI_MSK)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/intel/iwlwifi/mvm/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,13 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
case RATE_MCS_CHAN_WIDTH_20:
break;
case RATE_MCS_CHAN_WIDTH_40:
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
rx_status->bw = RATE_INFO_BW_40;
break;
case RATE_MCS_CHAN_WIDTH_80:
rx_status->enc_flags |= RX_ENC_FLAG_80MHZ;
rx_status->bw = RATE_INFO_BW_80;
break;
case RATE_MCS_CHAN_WIDTH_160:
rx_status->enc_flags |= RX_ENC_FLAG_160MHZ;
rx_status->bw = RATE_INFO_BW_160;
break;
}
if (rate_n_flags & RATE_MCS_SGI_MSK)
Expand All @@ -445,7 +445,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
if (rate_n_flags & RATE_MCS_HT_MSK) {
u8 stbc = (rate_n_flags & RATE_MCS_HT_STBC_MSK) >>
RATE_MCS_STBC_POS;
rx_status->enc_flags |= RX_ENC_FLAG_HT;
rx_status->encoding = RX_ENC_HT;
rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK;
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
} else if (rate_n_flags & RATE_MCS_VHT_MSK) {
Expand All @@ -455,7 +455,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi,
((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
RATE_VHT_MCS_NSS_POS) + 1;
rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
rx_status->enc_flags |= RX_ENC_FLAG_VHT;
rx_status->encoding = RX_ENC_VHT;
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
if (rate_n_flags & RATE_MCS_BF_MSK)
rx_status->enc_flags |= RX_ENC_FLAG_BF;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,13 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
case RATE_MCS_CHAN_WIDTH_20:
break;
case RATE_MCS_CHAN_WIDTH_40:
rx_status->enc_flags |= RX_ENC_FLAG_40MHZ;
rx_status->bw = RATE_INFO_BW_40;
break;
case RATE_MCS_CHAN_WIDTH_80:
rx_status->enc_flags |= RX_ENC_FLAG_80MHZ;
rx_status->bw = RATE_INFO_BW_80;
break;
case RATE_MCS_CHAN_WIDTH_160:
rx_status->enc_flags |= RX_ENC_FLAG_160MHZ;
rx_status->bw = RATE_INFO_BW_160;
break;
}
if (rate_n_flags & RATE_MCS_SGI_MSK)
Expand All @@ -976,7 +976,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
if (rate_n_flags & RATE_MCS_HT_MSK) {
u8 stbc = (rate_n_flags & RATE_MCS_HT_STBC_MSK) >>
RATE_MCS_STBC_POS;
rx_status->enc_flags |= RX_ENC_FLAG_HT;
rx_status->encoding = RX_ENC_HT;
rx_status->rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK;
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
} else if (rate_n_flags & RATE_MCS_VHT_MSK) {
Expand All @@ -986,7 +986,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
RATE_VHT_MCS_NSS_POS) + 1;
rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
rx_status->enc_flags |= RX_ENC_FLAG_VHT;
rx_status->encoding = RX_ENC_VHT;
rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT;
if (rate_n_flags & RATE_MCS_BF_MSK)
rx_status->enc_flags |= RX_ENC_FLAG_BF;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,11 +1194,11 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
ieee80211_rate_get_vht_mcs(&info->control.rates[0]);
rx_status.vht_nss =
ieee80211_rate_get_vht_nss(&info->control.rates[0]);
rx_status.enc_flags |= RX_ENC_FLAG_VHT;
rx_status.encoding = RX_ENC_VHT;
} else {
rx_status.rate_idx = info->control.rates[0].idx;
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
rx_status.enc_flags |= RX_ENC_FLAG_HT;
rx_status.encoding = RX_ENC_HT;
}
if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
rx_status.enc_flags |= RX_ENC_FLAG_40MHZ;
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/marvell/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,9 @@ mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,
*noise = -rxd->noise_floor;

if (rxd->rate & MWL8K_AP_RATE_INFO_MCS_FORMAT) {
status->enc_flags |= RX_ENC_FLAG_HT;
status->encoding = RX_ENC_HT;
if (rxd->rate & MWL8K_AP_RATE_INFO_40MHZ)
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
status->rate_idx = MWL8K_AP_RATE_INFO_RATEID(rxd->rate);
} else {
int i;
Expand All @@ -1011,7 +1011,7 @@ mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,

if (rxd->channel > 14) {
status->band = NL80211_BAND_5GHZ;
if (!(status->enc_flags & RX_ENC_FLAG_HT))
if (!(status->encoding == RX_ENC_HT))
status->rate_idx -= 5;
} else {
status->band = NL80211_BAND_2GHZ;
Expand Down Expand Up @@ -1111,15 +1111,15 @@ mwl8k_rxd_sta_process(void *_rxd, struct ieee80211_rx_status *status,
if (rate_info & MWL8K_STA_RATE_INFO_SHORTPRE)
status->enc_flags |= RX_ENC_FLAG_SHORTPRE;
if (rate_info & MWL8K_STA_RATE_INFO_40MHZ)
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
if (rate_info & MWL8K_STA_RATE_INFO_SHORTGI)
status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
if (rate_info & MWL8K_STA_RATE_INFO_MCS_FORMAT)
status->enc_flags |= RX_ENC_FLAG_HT;
status->encoding = RX_ENC_HT;

if (rxd->channel > 14) {
status->band = NL80211_BAND_5GHZ;
if (!(status->enc_flags & RX_ENC_FLAG_HT))
if (!(status->encoding == RX_ENC_HT))
status->rate_idx -= 5;
} else {
status->band = NL80211_BAND_2GHZ;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt7601u/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ mt76_mac_process_rate(struct ieee80211_rx_status *status, u16 rate)
status->enc_flags |= RX_ENC_FLAG_HT_GF;
/* fall through */
case MT_PHY_TYPE_HT:
status->enc_flags |= RX_ENC_FLAG_HT;
status->encoding = RX_ENC_HT;
status->rate_idx = idx;
break;
default:
Expand All @@ -428,7 +428,7 @@ mt76_mac_process_rate(struct ieee80211_rx_status *status, u16 rate)
status->enc_flags |= 1 << RX_ENC_FLAG_STBC_SHIFT;

if (rate & MT_RXWI_RATE_BW)
status->enc_flags |= RX_ENC_FLAG_40MHZ;
status->bw = RATE_INFO_BW_40;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ralink/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ void rt2800_process_rxwi(struct queue_entry *entry,
rxdesc->enc_flags |= RX_ENC_FLAG_SHORT_GI;

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

/*
* Detect RX rate, always use MCS as signal type.
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
rate_idx = rt2x00lib_rxdone_read_signal(rt2x00dev, &rxdesc);
if (rxdesc.rate_mode == RATE_MODE_HT_MIX ||
rxdesc.rate_mode == RATE_MODE_HT_GREENFIELD)
rxdesc.enc_flags |= RX_ENC_FLAG_HT;
rxdesc.encoding = RX_ENC_HT;

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

ieee80211_rx_ni(rt2x00dev->hw, entry->skb);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ struct rxdone_entry_desc {
int dev_flags;
u16 rate_mode;
u16 enc_flags;
enum mac80211_rx_encoding encoding;
enum rate_info_bw bw;
u8 cipher;
u8 cipher_status;

Expand Down
Loading

0 comments on commit da6a435

Please sign in to comment.