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>
此提交包含在:
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
新增問題並參考
封鎖使用者