提交 7138763e 编写于 作者: J Johannes Berg 提交者: Gregory Greenman

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: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20220906161827.623e32931b67.Id743a7879e84ae37a849179e536c58b1bf55380f@changeidSigned-off-by: NGregory Greenman <gregory.greenman@intel.com>
上级 3d579204
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册