aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-09-21 11:58:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-09-25 09:15:00 +0200
commit7534e9665ae7a78c1e47fc07f1e3ed14bc579ea9 (patch)
treeae64f528457a0946db66cc3de49a2cde5c77488f /drivers/net/wireless/intel/iwlwifi/mvm/tx.c
parentwifi: iwlwifi: mvm: refactor TX rate handling (diff)
downloadwireguard-linux-7534e9665ae7a78c1e47fc07f1e3ed14bc579ea9.tar.xz
wireguard-linux-7534e9665ae7a78c1e47fc07f1e3ed14bc579ea9.zip
wifi: iwlwifi: mvm: support injection antenna control
Pull up the injection rate control one layer, and let it control the antenna settings as well. Since mac80211 has already checked that enough antennas are configured, and we only have two bits, it's enough to just copy the data over. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230921110727.12ab7634dbbc.I5aa16c99864ecd7375011a8996de2564fd01fc30@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tx.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/tx.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index c398e04b597c..ec18e348553d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -295,7 +295,9 @@ static u32 iwl_mvm_convert_rate_idx(struct iwl_mvm *mvm,
}
static u32 iwl_mvm_get_inject_tx_rate(struct iwl_mvm *mvm,
- struct ieee80211_tx_info *info)
+ struct ieee80211_tx_info *info,
+ struct ieee80211_sta *sta,
+ __le16 fc)
{
struct ieee80211_tx_rate *rate = &info->control.rates[0];
u32 result;
@@ -345,6 +347,12 @@ static u32 iwl_mvm_get_inject_tx_rate(struct iwl_mvm *mvm,
result = iwl_mvm_convert_rate_idx(mvm, info, rate_idx);
}
+ if (info->control.antennas)
+ result |= u32_encode_bits(info->control.antennas,
+ RATE_MCS_ANT_AB_MSK);
+ else
+ result |= iwl_mvm_get_tx_ant(mvm, info, sta, fc);
+
return result;
}
@@ -354,9 +362,6 @@ static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm,
{
int rate_idx = -1;
- if (unlikely(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
- return iwl_mvm_get_inject_tx_rate(mvm, info);
-
if (!ieee80211_hw_check(mvm->hw, HAS_RATE_CONTROL)) {
/* info->control is only relevant for non HW rate control */
@@ -389,6 +394,9 @@ static u32 iwl_mvm_get_tx_rate_n_flags(struct iwl_mvm *mvm,
struct ieee80211_tx_info *info,
struct ieee80211_sta *sta, __le16 fc)
{
+ if (unlikely(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
+ return iwl_mvm_get_inject_tx_rate(mvm, info, sta, fc);
+
return iwl_mvm_get_tx_rate(mvm, info, sta, fc) |
iwl_mvm_get_tx_ant(mvm, info, sta, fc);
}