@@ -946,7 +946,7 @@ static void ath12k_rfkill_work(struct work_struct *work)
rfkill_radio_on = ab->rfkill_radio_on;
spin_unlock_bh(&ab->base_lock);
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah)
continue;
@@ -998,7 +998,7 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
if (ab->is_reset)
set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags);
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
continue;
@@ -1037,7 +1037,7 @@ static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
struct ath12k *ar;
int i, j;
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah || ah->state == ATH12K_HW_STATE_OFF)
continue;
@@ -1062,4 +1062,9 @@ static inline void ath12k_ab_set_ah(struct ath12k_base *ab, int idx,
{
ab->ah[idx] = ah;
}
+
+static inline int ath12k_get_num_hw(struct ath12k_base *ab)
+{
+ return ab->num_hw;
+}
#endif /* _CORE_H_ */
@@ -9157,7 +9157,7 @@ int ath12k_mac_register(struct ath12k_base *ab)
ab->cc_freq_hz = 320000;
ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1;
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ret = ath12k_mac_hw_register(ah);
@@ -9184,7 +9184,7 @@ void ath12k_mac_unregister(struct ath12k_base *ab)
struct ath12k_hw *ah;
int i;
- for (i = ab->num_hw - 1; i >= 0; i--) {
+ for (i = ath12k_get_num_hw(ab) - 1; i >= 0; i--) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah)
continue;
@@ -9254,7 +9254,7 @@ void ath12k_mac_destroy(struct ath12k_base *ab)
pdev->ar = NULL;
}
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
if (!ah)
continue;
@@ -9277,7 +9277,7 @@ int ath12k_mac_allocate(struct ath12k_base *ab)
ab->num_hw = ab->num_radios;
radio_per_hw = 1;
- for (i = 0; i < ab->num_hw; i++) {
+ for (i = 0; i < ath12k_get_num_hw(ab); i++) {
for (j = 0; j < radio_per_hw; j++) {
pdev_map[j].ab = ab;
pdev_map[j].pdev_idx = (i * radio_per_hw) + j;