mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-18 18:36:41 +07:00
rtw88: rearrange if..else statements for rx rate indexes
Driver just memset() rx_status to 0 before assigning rate indexes. And driver could never hit the 'else' because the driver checks if 'pkt_stat->rate >= DESC_RATEMCS0', so the 'else' statement can be removed. Also rearrange the if..else statements because DESC_RATEMCS0 is actually larger than DESC_RATE1M ~ DESC_RATE54M, move the check of 'pkt_stat->rate >= DESC_RATEMCS0' to the last to keep an increasing order. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
0b8db87da5
commit
ff0dfe5b03
@ -160,19 +160,17 @@ void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
|
||||
else if (pkt_stat->rate >= DESC_RATEMCS0)
|
||||
rx_status->encoding = RX_ENC_HT;
|
||||
|
||||
if (pkt_stat->rate >= DESC_RATEMCS0) {
|
||||
rtw_desc_to_mcsrate(pkt_stat->rate, &rx_status->rate_idx,
|
||||
&rx_status->nss);
|
||||
} else if (rx_status->band == NL80211_BAND_5GHZ &&
|
||||
pkt_stat->rate >= DESC_RATE6M &&
|
||||
pkt_stat->rate <= DESC_RATE54M) {
|
||||
if (rx_status->band == NL80211_BAND_5GHZ &&
|
||||
pkt_stat->rate >= DESC_RATE6M &&
|
||||
pkt_stat->rate <= DESC_RATE54M) {
|
||||
rx_status->rate_idx = pkt_stat->rate - DESC_RATE6M;
|
||||
} else if (rx_status->band == NL80211_BAND_2GHZ &&
|
||||
pkt_stat->rate >= DESC_RATE1M &&
|
||||
pkt_stat->rate <= DESC_RATE54M) {
|
||||
rx_status->rate_idx = pkt_stat->rate - DESC_RATE1M;
|
||||
} else {
|
||||
rx_status->rate_idx = 0;
|
||||
} else if (pkt_stat->rate >= DESC_RATEMCS0) {
|
||||
rtw_desc_to_mcsrate(pkt_stat->rate, &rx_status->rate_idx,
|
||||
&rx_status->nss);
|
||||
}
|
||||
|
||||
rx_status->flag |= RX_FLAG_MACTIME_START;
|
||||
|
Loading…
Reference in New Issue
Block a user