* [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
@ 2025-01-09 18:43 Aditya Kumar Singh
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Aditya Kumar Singh @ 2025-01-09 18:43 UTC (permalink / raw)
To: Kalle Valo, Jeff Johnson
Cc: linux-wireless, ath12k, linux-kernel, Aditya Kumar Singh
Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
sta's deflink member. This works only for non-ML station. Now that MLO
support is there, extend this function to use link sta instead of deflink.
Patch 1 relocates ath12k_mac_ieee80211_sta_bw_to_wmi() so that it can be
called from a function used in Patch 2. No functionality change.
Patch 2 actually extends the ath12k_mac_ieee80211_sta_bw_to_wmi() to handle
link sta.
---
Aditya Kumar Singh (2):
wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi()
wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
drivers/net/wireless/ath/ath12k/mac.c | 79 +++++++++++++++++------------------
1 file changed, 38 insertions(+), 41 deletions(-)
---
base-commit: dbe50a7420e22954c747e79e72df2750d795ea77
change-id: 20250109-fix_link_sta_bandwidth_update-3fac98920766
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi()
2025-01-09 18:43 [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
@ 2025-01-09 18:43 ` Aditya Kumar Singh
2025-01-13 22:38 ` Jeff Johnson
2025-01-14 18:36 ` Kalle Valo
2025-01-09 18:43 ` [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-02-03 22:49 ` [PATCH 0/2] " Jeff Johnson
2 siblings, 2 replies; 9+ messages in thread
From: Aditya Kumar Singh @ 2025-01-09 18:43 UTC (permalink / raw)
To: Kalle Valo, Jeff Johnson
Cc: linux-wireless, ath12k, linux-kernel, Aditya Kumar Singh
An upcoming change will invoke ath12k_mac_ieee80211_sta_bw_to_wmi() from a
line located above its current definition. Hence, relocate it to above
so that it can be invoked later on.
No functionality changes. Compile tested only.
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 64 +++++++++++++++++------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 48d110e2a7ded61c4094b0ce7e5bbb50b94d5cd4..750b41ec29e2c329fe98b7b717ec183fd6807eb0 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <net/mac80211.h>
@@ -3138,6 +3138,37 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_link_vif *arv
ath12k_smps_map[smps]);
}
+static u32 ath12k_mac_ieee80211_sta_bw_to_wmi(struct ath12k *ar,
+ struct ieee80211_sta *sta)
+{
+ u32 bw = WMI_PEER_CHWIDTH_20MHZ;
+
+ switch (sta->deflink.bandwidth) {
+ case IEEE80211_STA_RX_BW_20:
+ bw = WMI_PEER_CHWIDTH_20MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_40:
+ bw = WMI_PEER_CHWIDTH_40MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_80:
+ bw = WMI_PEER_CHWIDTH_80MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_160:
+ bw = WMI_PEER_CHWIDTH_160MHZ;
+ break;
+ case IEEE80211_STA_RX_BW_320:
+ bw = WMI_PEER_CHWIDTH_320MHZ;
+ break;
+ default:
+ ath12k_warn(ar->ab, "Invalid bandwidth %d in rc update for %pM\n",
+ sta->deflink.bandwidth, sta->addr);
+ bw = WMI_PEER_CHWIDTH_20MHZ;
+ break;
+ }
+
+ return bw;
+}
+
static void ath12k_bss_assoc(struct ath12k *ar,
struct ath12k_link_vif *arvif,
struct ieee80211_bss_conf *bss_conf)
@@ -5409,37 +5440,6 @@ static int ath12k_mac_station_add(struct ath12k *ar,
return ret;
}
-static u32 ath12k_mac_ieee80211_sta_bw_to_wmi(struct ath12k *ar,
- struct ieee80211_sta *sta)
-{
- u32 bw = WMI_PEER_CHWIDTH_20MHZ;
-
- switch (sta->deflink.bandwidth) {
- case IEEE80211_STA_RX_BW_20:
- bw = WMI_PEER_CHWIDTH_20MHZ;
- break;
- case IEEE80211_STA_RX_BW_40:
- bw = WMI_PEER_CHWIDTH_40MHZ;
- break;
- case IEEE80211_STA_RX_BW_80:
- bw = WMI_PEER_CHWIDTH_80MHZ;
- break;
- case IEEE80211_STA_RX_BW_160:
- bw = WMI_PEER_CHWIDTH_160MHZ;
- break;
- case IEEE80211_STA_RX_BW_320:
- bw = WMI_PEER_CHWIDTH_320MHZ;
- break;
- default:
- ath12k_warn(ar->ab, "Invalid bandwidth %d in rc update for %pM\n",
- sta->deflink.bandwidth, sta->addr);
- bw = WMI_PEER_CHWIDTH_20MHZ;
- break;
- }
-
- return bw;
-}
-
static int ath12k_mac_assign_link_sta(struct ath12k_hw *ah,
struct ath12k_sta *ahsta,
struct ath12k_link_sta *arsta,
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
2025-01-09 18:43 [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
@ 2025-01-09 18:43 ` Aditya Kumar Singh
2025-01-13 22:37 ` Jeff Johnson
2025-01-14 18:39 ` Kalle Valo
2025-02-03 22:49 ` [PATCH 0/2] " Jeff Johnson
2 siblings, 2 replies; 9+ messages in thread
From: Aditya Kumar Singh @ 2025-01-09 18:43 UTC (permalink / raw)
To: Kalle Valo, Jeff Johnson
Cc: linux-wireless, ath12k, linux-kernel, Aditya Kumar Singh
Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
sta's deflink member. This works only for non-ML station. Now that MLO
support is there, extend this function to use link sta instead of deflink.
Additionally, in ath12k_mac_handle_link_sta_state(), the link sta structure
is not accessible, making it difficult to fetch the bandwidth there.
However, ath12k_mac_station_assoc() does reference the link sta structure.
Therefore, move the initial assignment of the arsta bandwidth member to
ath12k_mac_station_assoc().
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/mac.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 750b41ec29e2c329fe98b7b717ec183fd6807eb0..67ae213a1dcd7bc3be0838d7948097c559dde625 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -3139,11 +3139,11 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_link_vif *arv
}
static u32 ath12k_mac_ieee80211_sta_bw_to_wmi(struct ath12k *ar,
- struct ieee80211_sta *sta)
+ struct ieee80211_link_sta *link_sta)
{
- u32 bw = WMI_PEER_CHWIDTH_20MHZ;
+ u32 bw;
- switch (sta->deflink.bandwidth) {
+ switch (link_sta->bandwidth) {
case IEEE80211_STA_RX_BW_20:
bw = WMI_PEER_CHWIDTH_20MHZ;
break;
@@ -3160,8 +3160,8 @@ static u32 ath12k_mac_ieee80211_sta_bw_to_wmi(struct ath12k *ar,
bw = WMI_PEER_CHWIDTH_320MHZ;
break;
default:
- ath12k_warn(ar->ab, "Invalid bandwidth %d in rc update for %pM\n",
- sta->deflink.bandwidth, sta->addr);
+ ath12k_warn(ar->ab, "Invalid bandwidth %d for link station %pM\n",
+ link_sta->bandwidth, link_sta->addr);
bw = WMI_PEER_CHWIDTH_20MHZ;
break;
}
@@ -4934,6 +4934,11 @@ static int ath12k_mac_station_assoc(struct ath12k *ar,
return -EINVAL;
}
+ spin_lock_bh(&ar->data_lock);
+ arsta->bw = ath12k_mac_ieee80211_sta_bw_to_wmi(ar, link_sta);
+ arsta->bw_prev = link_sta->bandwidth;
+ spin_unlock_bh(&ar->data_lock);
+
if (link_sta->vht_cap.vht_supported && num_vht_rates == 1) {
ret = ath12k_mac_set_peer_vht_fixed_rate(arvif, arsta, mask,
band);
@@ -5523,7 +5528,6 @@ static int ath12k_mac_handle_link_sta_state(struct ieee80211_hw *hw,
enum ieee80211_sta_state new_state)
{
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(arvif->ahvif);
- struct ieee80211_sta *sta = ath12k_ahsta_to_sta(arsta->ahsta);
struct ath12k *ar = arvif->ar;
int ret = 0;
@@ -5566,13 +5570,6 @@ static int ath12k_mac_handle_link_sta_state(struct ieee80211_hw *hw,
ath12k_warn(ar->ab, "Failed to associate station: %pM\n",
arsta->addr);
- spin_lock_bh(&ar->data_lock);
-
- arsta->bw = ath12k_mac_ieee80211_sta_bw_to_wmi(ar, sta);
- arsta->bw_prev = sta->deflink.bandwidth;
-
- spin_unlock_bh(&ar->data_lock);
-
/* IEEE80211_STA_ASSOC -> IEEE80211_STA_AUTHORIZED: set peer status as
* authorized
*/
@@ -5840,7 +5837,7 @@ static void ath12k_mac_op_link_sta_rc_update(struct ieee80211_hw *hw,
spin_lock_bh(&ar->data_lock);
if (changed & IEEE80211_RC_BW_CHANGED) {
- bw = ath12k_mac_ieee80211_sta_bw_to_wmi(ar, sta);
+ bw = ath12k_mac_ieee80211_sta_bw_to_wmi(ar, link_sta);
arsta->bw_prev = arsta->bw;
arsta->bw = bw;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
2025-01-09 18:43 ` [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
@ 2025-01-13 22:37 ` Jeff Johnson
2025-01-14 18:39 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Jeff Johnson @ 2025-01-13 22:37 UTC (permalink / raw)
To: Aditya Kumar Singh, Kalle Valo, Jeff Johnson
Cc: linux-wireless, ath12k, linux-kernel
On 1/9/2025 10:43 AM, Aditya Kumar Singh wrote:
> Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
> sta's deflink member. This works only for non-ML station. Now that MLO
> support is there, extend this function to use link sta instead of deflink.
>
> Additionally, in ath12k_mac_handle_link_sta_state(), the link sta structure
> is not accessible, making it difficult to fetch the bandwidth there.
> However, ath12k_mac_station_assoc() does reference the link sta structure.
> Therefore, move the initial assignment of the arsta bandwidth member to
> ath12k_mac_station_assoc().
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi()
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
@ 2025-01-13 22:38 ` Jeff Johnson
2025-01-14 18:36 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Jeff Johnson @ 2025-01-13 22:38 UTC (permalink / raw)
To: Aditya Kumar Singh, Kalle Valo, Jeff Johnson
Cc: linux-wireless, ath12k, linux-kernel
On 1/9/2025 10:43 AM, Aditya Kumar Singh wrote:
> An upcoming change will invoke ath12k_mac_ieee80211_sta_bw_to_wmi() from a
> line located above its current definition. Hence, relocate it to above
> so that it can be invoked later on.
>
> No functionality changes. Compile tested only.
>
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi()
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
2025-01-13 22:38 ` Jeff Johnson
@ 2025-01-14 18:36 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2025-01-14 18:36 UTC (permalink / raw)
To: Aditya Kumar Singh; +Cc: Jeff Johnson, linux-wireless, ath12k, linux-kernel
Aditya Kumar Singh <quic_adisi@quicinc.com> writes:
> An upcoming change will invoke ath12k_mac_ieee80211_sta_bw_to_wmi() from a
> line located above its current definition. Hence, relocate it to above
> so that it can be invoked later on.
>
> No functionality changes. Compile tested only.
>
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
2025-01-09 18:43 ` [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-01-13 22:37 ` Jeff Johnson
@ 2025-01-14 18:39 ` Kalle Valo
2025-01-15 4:52 ` Aditya Kumar Singh
1 sibling, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2025-01-14 18:39 UTC (permalink / raw)
To: Aditya Kumar Singh; +Cc: Jeff Johnson, linux-wireless, ath12k, linux-kernel
Aditya Kumar Singh <quic_adisi@quicinc.com> writes:
> Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
> sta's deflink member. This works only for non-ML station. Now that MLO
> support is there, extend this function to use link sta instead of deflink.
>
> Additionally, in ath12k_mac_handle_link_sta_state(), the link sta structure
> is not accessible, making it difficult to fetch the bandwidth there.
> However, ath12k_mac_station_assoc() does reference the link sta structure.
> Therefore, move the initial assignment of the arsta bandwidth member to
> ath12k_mac_station_assoc().
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
So how does this help in practice? Ie. what are the user visible
symptoms this patch is fixing?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
2025-01-14 18:39 ` Kalle Valo
@ 2025-01-15 4:52 ` Aditya Kumar Singh
0 siblings, 0 replies; 9+ messages in thread
From: Aditya Kumar Singh @ 2025-01-15 4:52 UTC (permalink / raw)
To: Kalle Valo; +Cc: Jeff Johnson, linux-wireless, ath12k, linux-kernel
On 1/15/25 00:09, Kalle Valo wrote:
> Aditya Kumar Singh <quic_adisi@quicinc.com> writes:
>
>> Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
>> sta's deflink member. This works only for non-ML station. Now that MLO
>> support is there, extend this function to use link sta instead of deflink.
>>
>> Additionally, in ath12k_mac_handle_link_sta_state(), the link sta structure
>> is not accessible, making it difficult to fetch the bandwidth there.
>> However, ath12k_mac_station_assoc() does reference the link sta structure.
>> Therefore, move the initial assignment of the arsta bandwidth member to
>> ath12k_mac_station_assoc().
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
>
> So how does this help in practice? Ie. what are the user visible
> symptoms this patch is fixing?
>
For MLO station, any bandwidth change post initial association, the data
will not go in the latest bandwidth of that link. Since to firmware,
only deflink's bandwidth will always be configured.
For non-ML stations, no affect.
--
Aditya
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
2025-01-09 18:43 [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
2025-01-09 18:43 ` [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
@ 2025-02-03 22:49 ` Jeff Johnson
2 siblings, 0 replies; 9+ messages in thread
From: Jeff Johnson @ 2025-02-03 22:49 UTC (permalink / raw)
To: Kalle Valo, Jeff Johnson, Aditya Kumar Singh
Cc: linux-wireless, ath12k, linux-kernel
On Fri, 10 Jan 2025 00:13:11 +0530, Aditya Kumar Singh wrote:
> Currently ath12k_mac_ieee80211_sta_bw_to_wmi() handles the bandwidth from
> sta's deflink member. This works only for non-ML station. Now that MLO
> support is there, extend this function to use link sta instead of deflink.
>
> Patch 1 relocates ath12k_mac_ieee80211_sta_bw_to_wmi() so that it can be
> called from a function used in Patch 2. No functionality change.
>
> [...]
Applied, thanks!
[1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi()
commit: 090c645b2acc835cccf52a8876dccec55629f479
[2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta
commit: 2fc98b24adb93457254ee16418cffa89de038ad9
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-02-03 22:49 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 18:43 [PATCH 0/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-01-09 18:43 ` [PATCH 1/2] wifi: ath12k: relocate ath12k_mac_ieee80211_sta_bw_to_wmi() Aditya Kumar Singh
2025-01-13 22:38 ` Jeff Johnson
2025-01-14 18:36 ` Kalle Valo
2025-01-09 18:43 ` [PATCH 2/2] wifi: ath12k: handle ath12k_mac_ieee80211_sta_bw_to_wmi() for link sta Aditya Kumar Singh
2025-01-13 22:37 ` Jeff Johnson
2025-01-14 18:39 ` Kalle Valo
2025-01-15 4:52 ` Aditya Kumar Singh
2025-02-03 22:49 ` [PATCH 0/2] " Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).