All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: refactor the rfkill worker
@ 2024-01-25 15:45 Karthikeyan Periyasamy
  2024-01-26  0:59 ` Jeff Johnson
  2024-02-02 12:38 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Karthikeyan Periyasamy @ 2024-01-25 15:45 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Karthikeyan Periyasamy

Currently, the rfkill worker handler access mac80211 HW from the radio/link
structure. This is will be incorrect for single wiphy model, as they will
hold multiple link/radio structures. To fix this, access mac80211 HW based
on the number of hardware in the SoC/chip. This approach makes the rfkill
worker handler compatible with both multi wiphy and single wiphy models.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/core.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 1baad3302157..f27a6ec3a394 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -879,21 +879,29 @@ static void ath12k_rfkill_work(struct work_struct *work)
 {
 	struct ath12k_base *ab = container_of(work, struct ath12k_base, rfkill_work);
 	struct ath12k *ar;
+	struct ath12k_hw *ah;
 	struct ieee80211_hw *hw;
 	bool rfkill_radio_on;
-	int i;
+	int i, j;
 
 	spin_lock_bh(&ab->base_lock);
 	rfkill_radio_on = ab->rfkill_radio_on;
 	spin_unlock_bh(&ab->base_lock);
 
-	for (i = 0; i < ab->num_radios; i++) {
-		ar = ab->pdevs[i].ar;
-		if (!ar)
+	for (i = 0; i < ab->num_hw; i++) {
+		ah = ab->ah[i];
+		if (!ah)
 			continue;
 
-		hw = ath12k_ar_to_hw(ar);
-		ath12k_mac_rfkill_enable_radio(ar, rfkill_radio_on);
+		for (j = 0; j < ah->num_radio; j++) {
+			ar = &ah->radio[j];
+			if (!ar)
+				continue;
+
+			ath12k_mac_rfkill_enable_radio(ar, rfkill_radio_on);
+		}
+
+		hw = ah->hw;
 		wiphy_rfkill_set_hw_state(hw->wiphy, !rfkill_radio_on);
 	}
 }

base-commit: 64d1dfa649b8d8f2980f95dbded4bcb6210ad073
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: ath12k: refactor the rfkill worker
  2024-01-25 15:45 [PATCH] wifi: ath12k: refactor the rfkill worker Karthikeyan Periyasamy
@ 2024-01-26  0:59 ` Jeff Johnson
  2024-02-02 12:38 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2024-01-26  0:59 UTC (permalink / raw)
  To: Karthikeyan Periyasamy, ath12k; +Cc: linux-wireless

On 1/25/2024 7:45 AM, Karthikeyan Periyasamy wrote:
> Currently, the rfkill worker handler access mac80211 HW from the radio/link
> structure. This is will be incorrect for single wiphy model, as they will
> hold multiple link/radio structures. To fix this, access mac80211 HW based
> on the number of hardware in the SoC/chip. This approach makes the rfkill
> worker handler compatible with both multi wiphy and single wiphy models.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: ath12k: refactor the rfkill worker
  2024-01-25 15:45 [PATCH] wifi: ath12k: refactor the rfkill worker Karthikeyan Periyasamy
  2024-01-26  0:59 ` Jeff Johnson
@ 2024-02-02 12:38 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-02-02 12:38 UTC (permalink / raw)
  To: Karthikeyan Periyasamy; +Cc: ath12k, linux-wireless, Karthikeyan Periyasamy

Karthikeyan Periyasamy <quic_periyasa@quicinc.com> wrote:

> Currently, the rfkill worker handler access mac80211 HW from the radio/link
> structure. This is will be incorrect for single wiphy model, as they will
> hold multiple link/radio structures. To fix this, access mac80211 HW based
> on the number of hardware in the SoC/chip. This approach makes the rfkill
> worker handler compatible with both multi wiphy and single wiphy models.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

e7c7fbb582bc wifi: ath12k: refactor the rfkill worker

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240125154555.3169706-1-quic_periyasa@quicinc.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-02 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 15:45 [PATCH] wifi: ath12k: refactor the rfkill worker Karthikeyan Periyasamy
2024-01-26  0:59 ` Jeff Johnson
2024-02-02 12:38 ` 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.