mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
wifi: iwlwifi: mvm: refactor iwl_mvm_set_sta_rate() a bit
Use a switch statement over the rate type instead of the if chain, to simplify. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20220906161827.623e32931b67.Id743a7879e84ae37a849179e536c58b1bf55380f@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
This commit is contained in:
parent
3d579204e0
commit
7138763e02
|
|
@ -4949,6 +4949,7 @@ static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx,
|
|||
static void iwl_mvm_set_sta_rate(u32 rate_n_flags, struct rate_info *rinfo)
|
||||
{
|
||||
u32 format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK;
|
||||
u32 gi_ltf;
|
||||
|
||||
switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) {
|
||||
case RATE_MCS_CHAN_WIDTH_20:
|
||||
|
|
@ -5019,9 +5020,12 @@ static void iwl_mvm_set_sta_rate(u32 rate_n_flags, struct rate_info *rinfo)
|
|||
RATE_HT_MCS_INDEX(rate_n_flags) :
|
||||
u32_get_bits(rate_n_flags, RATE_MCS_CODE_MSK);
|
||||
|
||||
if (format == RATE_MCS_HE_MSK) {
|
||||
u32 gi_ltf = u32_get_bits(rate_n_flags,
|
||||
RATE_MCS_HE_GI_LTF_MSK);
|
||||
if (rate_n_flags & RATE_MCS_SGI_MSK)
|
||||
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
|
||||
|
||||
switch (format) {
|
||||
case RATE_MCS_HE_MSK:
|
||||
gi_ltf = u32_get_bits(rate_n_flags, RATE_MCS_HE_GI_LTF_MSK);
|
||||
|
||||
rinfo->flags |= RATE_INFO_FLAGS_HE_MCS;
|
||||
|
||||
|
|
@ -5060,19 +5064,14 @@ static void iwl_mvm_set_sta_rate(u32 rate_n_flags, struct rate_info *rinfo)
|
|||
|
||||
if (rate_n_flags & RATE_HE_DUAL_CARRIER_MODE_MSK)
|
||||
rinfo->he_dcm = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (rate_n_flags & RATE_MCS_SGI_MSK)
|
||||
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
|
||||
|
||||
if (format == RATE_MCS_HT_MSK) {
|
||||
break;
|
||||
case RATE_MCS_HT_MSK:
|
||||
rinfo->flags |= RATE_INFO_FLAGS_MCS;
|
||||
|
||||
} else if (format == RATE_MCS_VHT_MSK) {
|
||||
break;
|
||||
case RATE_MCS_VHT_MSK:
|
||||
rinfo->flags |= RATE_INFO_FLAGS_VHT_MCS;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user