* [PATCH v2] ath10k: Add support for configuring management packet rate
@ 2018-09-25 5:38 ` Sriram R
0 siblings, 0 replies; 8+ messages in thread
From: Sriram R @ 2018-09-25 5:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Sriram R
By default the firmware uses 1Mbps and 6Mbps rate for management packets
in 2G and 5G bands respectively. But when the user selects different
basic rates from the userspace, we need to send the management
packets at the lowest basic rate selected by the user.
This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
management packets rate to the firmware.
Chipsets Tested : QCA988X, QCA9887, QCA9984
FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
Signed-off-by: Sriram R <srirrama@codeaurora.org>
---
v2:
* Correction to ath10k_rates array indexing.
* Usage of appropriate indent.
drivers/net/wireless/ath/ath10k/mac.c | 45 +++++++++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97548f9..c0cde94 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -157,6 +157,22 @@ u8 ath10k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
return 0;
}
+static int ath10k_mac_get_rate_hw_value(int bitrate)
+{
+ int i;
+ u8 hw_value_prefix = 0;
+
+ if (ath10k_mac_bitrate_is_cck(bitrate))
+ hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
+
+ for (i = 0; i < ARRAY_SIZE(ath10k_rates); i++) {
+ if (ath10k_rates[i].bitrate == bitrate)
+ return hw_value_prefix | ath10k_rates[i].hw_value;
+ }
+
+ return -EINVAL;
+}
+
static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
{
switch ((mcs_map >> (2 * nss)) & 0x3) {
@@ -5452,9 +5468,10 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
- u8 rate;
- int rateidx, ret = 0;
+ u8 rate, basic_rate_idx;
+ int rateidx, ret = 0, hw_rate_code;
enum nl80211_band band;
+ const struct ieee80211_supported_band *sband;
mutex_lock(&ar->conf_mutex);
@@ -5660,6 +5677,30 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
arvif->vdev_id, ret);
}
+ if (changed & BSS_CHANGED_BASIC_RATES) {
+ if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ sband = ar->hw->wiphy->bands[def.chan->band];
+ basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
+ bitrate = sband->bitrates[basic_rate_idx].bitrate;
+
+ hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
+ if (hw_rate_code < 0) {
+ ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ vdev_param = ar->wmi.vdev_param->mgmt_rate;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+ hw_rate_code);
+ if (ret)
+ ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
+ }
+
mutex_unlock(&ar->conf_mutex);
}
--
2.7.4
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2] ath10k: Add support for configuring management packet rate
@ 2018-09-25 5:38 ` Sriram R
0 siblings, 0 replies; 8+ messages in thread
From: Sriram R @ 2018-09-25 5:38 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Sriram R
By default the firmware uses 1Mbps and 6Mbps rate for management packets
in 2G and 5G bands respectively. But when the user selects different
basic rates from the userspace, we need to send the management
packets at the lowest basic rate selected by the user.
This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
management packets rate to the firmware.
Chipsets Tested : QCA988X, QCA9887, QCA9984
FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
Signed-off-by: Sriram R <srirrama@codeaurora.org>
---
v2:
* Correction to ath10k_rates array indexing.
* Usage of appropriate indent.
drivers/net/wireless/ath/ath10k/mac.c | 45 +++++++++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97548f9..c0cde94 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -157,6 +157,22 @@ u8 ath10k_mac_bitrate_to_idx(const struct ieee80211_supported_band *sband,
return 0;
}
+static int ath10k_mac_get_rate_hw_value(int bitrate)
+{
+ int i;
+ u8 hw_value_prefix = 0;
+
+ if (ath10k_mac_bitrate_is_cck(bitrate))
+ hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
+
+ for (i = 0; i < ARRAY_SIZE(ath10k_rates); i++) {
+ if (ath10k_rates[i].bitrate == bitrate)
+ return hw_value_prefix | ath10k_rates[i].hw_value;
+ }
+
+ return -EINVAL;
+}
+
static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
{
switch ((mcs_map >> (2 * nss)) & 0x3) {
@@ -5452,9 +5468,10 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
- u8 rate;
- int rateidx, ret = 0;
+ u8 rate, basic_rate_idx;
+ int rateidx, ret = 0, hw_rate_code;
enum nl80211_band band;
+ const struct ieee80211_supported_band *sband;
mutex_lock(&ar->conf_mutex);
@@ -5660,6 +5677,30 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
arvif->vdev_id, ret);
}
+ if (changed & BSS_CHANGED_BASIC_RATES) {
+ if (WARN_ON(ath10k_mac_vif_chan(vif, &def))) {
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ sband = ar->hw->wiphy->bands[def.chan->band];
+ basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
+ bitrate = sband->bitrates[basic_rate_idx].bitrate;
+
+ hw_rate_code = ath10k_mac_get_rate_hw_value(bitrate);
+ if (hw_rate_code < 0) {
+ ath10k_warn(ar, "bitrate not supported %d\n", bitrate);
+ mutex_unlock(&ar->conf_mutex);
+ return;
+ }
+
+ vdev_param = ar->wmi.vdev_param->mgmt_rate;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+ hw_rate_code);
+ if (ret)
+ ath10k_warn(ar, "failed to set mgmt tx rate %d\n", ret);
+ }
+
mutex_unlock(&ar->conf_mutex);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
2018-09-25 5:38 ` Sriram R
(?)
(?)
@ 2018-10-01 14:48 ` Kalle Valo
-1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-01 14:48 UTC (permalink / raw)
To: Sriram R; +Cc: linux-wireless, ath10k
Sriram R <srirrama@codeaurora.org> wrote:
> By default the firmware uses 1Mbps and 6Mbps rate for management packets
> in 2G and 5G bands respectively. But when the user selects different
> basic rates from the userspace, we need to send the management
> packets at the lowest basic rate selected by the user.
>
> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
> management packets rate to the firmware.
>
> Chipsets Tested : QCA988X, QCA9887, QCA9984
> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>
> Signed-off-by: Sriram R <srirrama@codeaurora.org>
Really sorry, I missed this and accidentally applied v1. Can you submit a followup
patch with the changes you made in v2, please? That way the final code is still
the same.
--
https://patchwork.kernel.org/patch/10613355/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
2018-09-25 5:38 ` Sriram R
(?)
@ 2018-10-01 14:48 ` Kalle Valo
-1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-01 14:48 UTC (permalink / raw)
To: Sriram R; +Cc: ath10k, linux-wireless, Sriram R
Sriram R <srirrama@codeaurora.org> wrote:
> By default the firmware uses 1Mbps and 6Mbps rate for management packets
> in 2G and 5G bands respectively. But when the user selects different
> basic rates from the userspace, we need to send the management
> packets at the lowest basic rate selected by the user.
>
> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for configuring the
> management packets rate to the firmware.
>
> Chipsets Tested : QCA988X, QCA9887, QCA9984
> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>
> Signed-off-by: Sriram R <srirrama@codeaurora.org>
Really sorry, I missed this and accidentally applied v1. Can you submit a followup
patch with the changes you made in v2, please? That way the final code is still
the same.
--
https://patchwork.kernel.org/patch/10613355/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
[not found] ` <20181001144822.BE46A60A98@smtp.codeaurora.org>
@ 2018-10-03 3:23 ` Sriram R
0 siblings, 0 replies; 8+ messages in thread
From: Sriram R @ 2018-10-03 3:23 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, ath10k
On 2018-10-01 20:18, Kalle Valo wrote:
> Sriram R <srirrama@codeaurora.org> wrote:
>
>> By default the firmware uses 1Mbps and 6Mbps rate for management
>> packets
>> in 2G and 5G bands respectively. But when the user selects different
>> basic rates from the userspace, we need to send the management
>> packets at the lowest basic rate selected by the user.
>>
>> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for
>> configuring the
>> management packets rate to the firmware.
>>
>> Chipsets Tested : QCA988X, QCA9887, QCA9984
>> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>>
>> Signed-off-by: Sriram R <srirrama@codeaurora.org>
>
> Really sorry, I missed this and accidentally applied v1. Can you
> submit a followup
> patch with the changes you made in v2, please? That way the final code
> is still
> the same.
Hi Kalle,
I've raised a followup patch with the delta in v2.
https://patchwork.kernel.org/patch/10624227/
Thanks,
Sriram.R
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
@ 2018-10-03 3:23 ` Sriram R
0 siblings, 0 replies; 8+ messages in thread
From: Sriram R @ 2018-10-03 3:23 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
On 2018-10-01 20:18, Kalle Valo wrote:
> Sriram R <srirrama@codeaurora.org> wrote:
>
>> By default the firmware uses 1Mbps and 6Mbps rate for management
>> packets
>> in 2G and 5G bands respectively. But when the user selects different
>> basic rates from the userspace, we need to send the management
>> packets at the lowest basic rate selected by the user.
>>
>> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for
>> configuring the
>> management packets rate to the firmware.
>>
>> Chipsets Tested : QCA988X, QCA9887, QCA9984
>> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>>
>> Signed-off-by: Sriram R <srirrama@codeaurora.org>
>
> Really sorry, I missed this and accidentally applied v1. Can you
> submit a followup
> patch with the changes you made in v2, please? That way the final code
> is still
> the same.
Hi Kalle,
I've raised a followup patch with the delta in v2.
https://patchwork.kernel.org/patch/10624227/
Thanks,
Sriram.R
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
2018-10-03 3:23 ` Sriram R
@ 2018-10-03 9:09 ` Kalle Valo
-1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-03 9:09 UTC (permalink / raw)
To: Sriram R; +Cc: linux-wireless, ath10k
Sriram R <srirrama@codeaurora.org> writes:
> On 2018-10-01 20:18, Kalle Valo wrote:
>> Sriram R <srirrama@codeaurora.org> wrote:
>>
>>> By default the firmware uses 1Mbps and 6Mbps rate for management
>>> packets
>>> in 2G and 5G bands respectively. But when the user selects different
>>> basic rates from the userspace, we need to send the management
>>> packets at the lowest basic rate selected by the user.
>>>
>>> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for
>>> configuring the
>>> management packets rate to the firmware.
>>>
>>> Chipsets Tested : QCA988X, QCA9887, QCA9984
>>> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>>>
>>> Signed-off-by: Sriram R <srirrama@codeaurora.org>
>>
>> Really sorry, I missed this and accidentally applied v1. Can you
>> submit a followup
>> patch with the changes you made in v2, please? That way the final
>> code is still
>> the same.
>
> I've raised a followup patch with the delta in v2.
> https://patchwork.kernel.org/patch/10624227/
Great, thanks for this and sorry for the mess.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ath10k: Add support for configuring management packet rate
@ 2018-10-03 9:09 ` Kalle Valo
0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-03 9:09 UTC (permalink / raw)
To: Sriram R; +Cc: ath10k, linux-wireless
Sriram R <srirrama@codeaurora.org> writes:
> On 2018-10-01 20:18, Kalle Valo wrote:
>> Sriram R <srirrama@codeaurora.org> wrote:
>>
>>> By default the firmware uses 1Mbps and 6Mbps rate for management
>>> packets
>>> in 2G and 5G bands respectively. But when the user selects different
>>> basic rates from the userspace, we need to send the management
>>> packets at the lowest basic rate selected by the user.
>>>
>>> This change makes use of WMI_VDEV_PARAM_MGMT_RATE param for
>>> configuring the
>>> management packets rate to the firmware.
>>>
>>> Chipsets Tested : QCA988X, QCA9887, QCA9984
>>> FW Tested : 10.2.4-1.0-41, 10.4-3.6.104
>>>
>>> Signed-off-by: Sriram R <srirrama@codeaurora.org>
>>
>> Really sorry, I missed this and accidentally applied v1. Can you
>> submit a followup
>> patch with the changes you made in v2, please? That way the final
>> code is still
>> the same.
>
> I've raised a followup patch with the delta in v2.
> https://patchwork.kernel.org/patch/10624227/
Great, thanks for this and sorry for the mess.
--
Kalle Valo
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-10-03 9:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-25 5:38 [PATCH v2] ath10k: Add support for configuring management packet rate Sriram R
2018-09-25 5:38 ` Sriram R
2018-10-01 14:48 ` Kalle Valo
2018-10-01 14:48 ` Kalle Valo
[not found] ` <20181001144822.BE46A60A98@smtp.codeaurora.org>
2018-10-03 3:23 ` Sriram R
2018-10-03 3:23 ` Sriram R
2018-10-03 9:09 ` Kalle Valo
2018-10-03 9:09 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.