ath10k: Allow setting bcast, mcast, mgt fixed tx rates.
RFC 1/1 ath10k: Allow setting bcast, mcast, mgt fixed tx rates.
From: Ben Greear <[email protected]>
The default behaviour when setting a fixed transmit rate in ath10k is to only set the 'ucast' rate. This does not affect beacons, multicast, or broadcast traffic.
In order to allow a back-door way to set these other types of traffic as well, provide a debugfs file that can set the traffic type. Then, use can use the normal 'iw' commands to set the rate to the desired value.
Upstream firmware *should* support all of this, but at least 10.1 does NOT have support for the WMI_10X_VDEV_PARAM_MGMT_RATE parameter. I added this to the CT firmware so it works there.
Possibly other upstream firmware have fixed this as well.
--- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/debug.c | 102 ++++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/mac.c | 22 +++++-- 3 files changed, 119 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +1 -0
@@ -477,6 +477,7 @@ struct ath10k {u32 ht_cap_info;u32 vht_cap_info;u32 num_rf_chains; +u32 set_rate_type;/* override for set-rate behaviour */ DECLARE_BITMAP (fw_features,ATH10K_FW_FEATURE_COUNT );
drivers/net/wireless/ath/ath10k/debug.c +102 -0
114 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/mac.c +16 -6
@@ -4481,11 +4481,12 @@ static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif,mutex_lock (&ar->conf_mutex); -ath10k_dbg (ar,ATH10K_DBG_MAC ,"mac set fixed rate, current: rt: %i nss: %i sgi: %i new: rt: %i nss: %i sgi: %i\n" , +ath10k_dbg (ar,ATH10K_DBG_MAC ,"mac set fixed rate, current: rt: %i nss: %i sgi: %i new: rt: %i nss: %i sgi: %i set-rate-type: %d\n" , (int )(arvif->fixed_rate), (int )(arvif->fixed_nss), (int )(arvif->force_sgi), - (int )(fixed_rate), (int )(fixed_nss), (int )(force_sgi)); + (int )(fixed_rate), (int )(fixed_nss), (int )(force_sgi), ar->set_rate_type); -if (arvif->fixed_rate == fixed_rate && +if (ar->set_rate_type ==0 && + arvif->fixed_rate == fixed_rate && arvif->fixed_nss == fixed_nss && arvif->force_sgi == force_sgi) goto exit;
@@ -4496,16 +4497,25 @@ static int ath10k_set_fixed_rate_param(struct ath10k_vif *arvif,if (force_sgi)ath10k_dbg (ar,ATH10K_DBG_MAC ,"mac force sgi\n" ); - vdev_param = ar->wmi.vdev_param->fixed_rate; +if (ar->set_rate_type) + vdev_param = ar->set_rate_type; +else + vdev_param = ar->wmi.vdev_param->fixed_rate; ret =ath10k_wmi_vdev_set_param (ar, arvif->vdev_id, vdev_param, fixed_rate);if (ret) { -ath10k_warn (ar,"failed to set fixed rate param 0x%02x: %d\n" , - fixed_rate, ret); +ath10k_warn (ar,"failed to set fixed rate (0x%x) param 0x%02x: %d\n" , + vdev_param, fixed_rate, ret); ret = -EINVAL ; goto exit; } +/* If we are setting one of the specialized rates (mgmt, ucast, bcast) +* then we do not need to set the other values, so skip to exit. +*/ +if (ar->set_rate_type !=0 ) + goto exit; + arvif->fixed_rate = fixed_rate; vdev_param = ar->wmi.vdev_param->nss;
Signature · 1 line
1.7.11.7