summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>2024-01-25 21:15:55 +0530
committerKalle Valo <quic_kvalo@quicinc.com>2024-02-02 14:38:51 +0200
commite7c7fbb582bc7936cf7ee744f62b82bd46a7d4a8 (patch)
treebd2be0b8697bd1b93f994055c2fe779919bb815f /drivers/net/wireless/ath
parentad2b29ad94c3ed9e39f2eae50915c0f34af4f6fc (diff)
downloadlinux-stable-e7c7fbb582bc7936cf7ee744f62b82bd46a7d4a8.tar.gz
linux-stable-e7c7fbb582bc7936cf7ee744f62b82bd46a7d4a8.tar.bz2
linux-stable-e7c7fbb582bc7936cf7ee744f62b82bd46a7d4a8.zip
wifi: ath12k: refactor the rfkill worker
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> Link: https://msgid.link/20240125154555.3169706-1-quic_periyasa@quicinc.com
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath12k/core.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 0d4640ff8d6f..b82550b35149 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -909,21 +909,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);
}
}