Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: properly remove RX_ENC_FLAG_40MHZ

Somehow I missed this in my RX rate cleanup series, causing some
drivers to not report correct bandwidth since this flag isn't
used by mac80211 anymore. Fix this, and make hwsim also report
higher bandwidths appropriately.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+16 -8
+1 -1
drivers/net/wireless/ath/ath9k/ar9003_mac.c
··· 522 522 rxs->rs_moreaggr = (rxsp->status11 & AR_RxMoreAggr) ? 1 : 0; 523 523 rxs->rs_antenna = (MS(rxsp->status4, AR_RxAntenna) & 0x7); 524 524 rxs->enc_flags |= (rxsp->status4 & AR_GI) ? RX_ENC_FLAG_SHORT_GI : 0; 525 - rxs->enc_flags |= (rxsp->status4 & AR_2040) ? RX_ENC_FLAG_40MHZ : 0; 525 + rxs->bw = (rxsp->status4 & AR_2040) ? RATE_INFO_BW_40 : RATE_INFO_BW_20; 526 526 527 527 rxs->evm0 = rxsp->status6; 528 528 rxs->evm1 = rxsp->status7;
+2 -2
drivers/net/wireless/ath/ath9k/mac.c
··· 580 580 /* directly mapped flags for ieee80211_rx_status */ 581 581 rs->enc_flags |= 582 582 (ads.ds_rxstatus3 & AR_GI) ? RX_ENC_FLAG_SHORT_GI : 0; 583 - rs->enc_flags |= 584 - (ads.ds_rxstatus3 & AR_2040) ? RX_ENC_FLAG_40MHZ : 0; 583 + rs->bw = (ads.ds_rxstatus3 & AR_2040) ? RATE_INFO_BW_40 : 584 + RATE_INFO_BW_20; 585 585 if (AR_SREV_9280_20_OR_LATER(ah)) 586 586 rs->enc_flags |= 587 587 (ads.ds_rxstatus3 & AR_STBC) ?
+3 -1
drivers/net/wireless/intel/iwlegacy/4965-mac.c
··· 734 734 if (rate_n_flags & RATE_MCS_HT_MSK) 735 735 rx_status.encoding = RX_ENC_HT; 736 736 if (rate_n_flags & RATE_MCS_HT40_MSK) 737 - rx_status.enc_flags |= RX_ENC_FLAG_40MHZ; 737 + rx_status.bw = RATE_INFO_BW_40; 738 + else 739 + rx_status.bw = RATE_INFO_BW_20; 738 740 if (rate_n_flags & RATE_MCS_SGI_MSK) 739 741 rx_status.enc_flags |= RX_ENC_FLAG_SHORT_GI; 740 742
+3 -1
drivers/net/wireless/intel/iwlwifi/dvm/rx.c
··· 889 889 if (rate_n_flags & RATE_MCS_HT_MSK) 890 890 rx_status.encoding = RX_ENC_HT; 891 891 if (rate_n_flags & RATE_MCS_HT40_MSK) 892 - rx_status.enc_flags |= RX_ENC_FLAG_40MHZ; 892 + rx_status.bw = RATE_INFO_BW_40; 893 + else 894 + rx_status.bw = RATE_INFO_BW_20; 893 895 if (rate_n_flags & RATE_MCS_SGI_MSK) 894 896 rx_status.enc_flags |= RX_ENC_FLAG_SHORT_GI; 895 897 if (rate_n_flags & RATE_MCS_GF_MSK)
+7 -1
drivers/net/wireless/mac80211_hwsim.c
··· 1201 1201 rx_status.encoding = RX_ENC_HT; 1202 1202 } 1203 1203 if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) 1204 - rx_status.enc_flags |= RX_ENC_FLAG_40MHZ; 1204 + rx_status.bw = RATE_INFO_BW_40; 1205 + else if (info->control.rates[0].flags & IEEE80211_TX_RC_80_MHZ_WIDTH) 1206 + rx_status.bw = RATE_INFO_BW_80; 1207 + else if (info->control.rates[0].flags & IEEE80211_TX_RC_160_MHZ_WIDTH) 1208 + rx_status.bw = RATE_INFO_BW_160; 1209 + else 1210 + rx_status.bw = RATE_INFO_BW_20; 1205 1211 if (info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI) 1206 1212 rx_status.enc_flags |= RX_ENC_FLAG_SHORT_GI; 1207 1213 /* TODO: simulate real signal strength (and optional packet loss) */
-2
include/net/mac80211.h
··· 1141 1141 * enum mac80211_rx_encoding_flags - MCS & bandwidth flags 1142 1142 * 1143 1143 * @RX_ENC_FLAG_SHORTPRE: Short preamble was used for this frame 1144 - * @RX_ENC_FLAG_40MHZ: HT40 (40 MHz) was used 1145 1144 * @RX_ENC_FLAG_SHORT_GI: Short guard interval was used 1146 1145 * @RX_ENC_FLAG_HT_GF: This frame was received in a HT-greenfield transmission, 1147 1146 * if the driver fills this value it should add ··· 1152 1153 */ 1153 1154 enum mac80211_rx_encoding_flags { 1154 1155 RX_ENC_FLAG_SHORTPRE = BIT(0), 1155 - RX_ENC_FLAG_40MHZ = BIT(1), 1156 1156 RX_ENC_FLAG_SHORT_GI = BIT(2), 1157 1157 RX_ENC_FLAG_HT_GF = BIT(3), 1158 1158 RX_ENC_FLAG_STBC_MASK = BIT(4) | BIT(5),