Skip to content

Commit

Permalink
wifi: ath12k: Refactor the ath12k_hw get helper function argument
Browse files Browse the repository at this point in the history
Currently, ath12k_hw is placed inside the ath12k_hw_group. However, the
ath12k_hw get helper function takes the device handle and the index as
parameters. Here, the index parameter is specific to the group handle.
Therefore, change this helper function argument from the device handle
to the group handle.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20250112071630.4059410-3-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
  • Loading branch information
Karthikeyan Periyasamy authored and Jeff Johnson committed Jan 14, 2025
1 parent 21261e4 commit 812a302
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath/ath12k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ static void ath12k_rfkill_work(struct work_struct *work)
spin_unlock_bh(&ab->base_lock);

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ab->ag, i);
if (!ah)
continue;

Expand Down Expand Up @@ -1236,7 +1236,7 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags);

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ab->ag, i);
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
continue;

Expand Down Expand Up @@ -1275,7 +1275,7 @@ static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
int i, j;

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ab->ag, i);
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
continue;

Expand Down Expand Up @@ -1337,7 +1337,7 @@ static void ath12k_core_restart(struct work_struct *work)
}

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ab->ag, i);
ieee80211_restart_hw(ah->hw);
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath12k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1194,9 +1194,9 @@ static inline struct ieee80211_hw *ath12k_ar_to_hw(struct ath12k *ar)
for ((index) = 0; ((index) < (ah)->num_radio && \
((ar) = &(ah)->radio[(index)])); (index)++)

static inline struct ath12k_hw *ath12k_ab_to_ah(struct ath12k_base *ab, int idx)
static inline struct ath12k_hw *ath12k_ag_to_ah(struct ath12k_hw_group *ag, int idx)
{
return ab->ag->ah[idx];
return ag->ah[idx];
}

static inline void ath12k_ag_set_ah(struct ath12k_hw_group *ag, int idx,
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/ath/ath12k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -11244,7 +11244,7 @@ int ath12k_mac_register(struct ath12k_hw_group *ag)
int ret;

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ag, i);

ret = ath12k_mac_hw_register(ah);
if (ret)
Expand All @@ -11257,7 +11257,7 @@ int ath12k_mac_register(struct ath12k_hw_group *ag)

err:
for (i = i - 1; i >= 0; i--) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ag, i);
if (!ah)
continue;

Expand All @@ -11276,7 +11276,7 @@ void ath12k_mac_unregister(struct ath12k_hw_group *ag)
clear_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags);

for (i = ath12k_get_num_hw(ab) - 1; i >= 0; i--) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ag, i);
if (!ah)
continue;

Expand Down Expand Up @@ -11357,7 +11357,7 @@ void ath12k_mac_destroy(struct ath12k_hw_group *ag)
}

for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ag, i);
if (!ah)
continue;

Expand Down Expand Up @@ -11438,7 +11438,7 @@ int ath12k_mac_allocate(struct ath12k_hw_group *ag)

err:
for (i = i - 1; i >= 0; i--) {
ah = ath12k_ab_to_ah(ab, i);
ah = ath12k_ag_to_ah(ag, i);
if (!ah)
continue;

Expand Down

0 comments on commit 812a302

Please sign in to comment.