arvif_iter.vdev_id = vdev_id;
 
        flags = IEEE80211_IFACE_ITER_RESUME_ALL;
-       ieee80211_iterate_active_interfaces_atomic(ar->hw,
+       ieee80211_iterate_active_interfaces_atomic(ath12k_ar_to_hw(ar),
                                                   flags,
                                                   ath12k_get_arvif_iter,
                                                   &arvif_iter);
        if (ar->monitor_started)
                return 0;
 
-       ieee80211_iter_chan_contexts_atomic(ar->hw,
+       ieee80211_iter_chan_contexts_atomic(ath12k_ar_to_hw(ar),
                                            ath12k_mac_get_any_chandef_iter,
                                            &chandef);
        if (!chandef)
 
 static int ath12k_mac_config(struct ath12k *ar, u32 changed)
 {
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct ieee80211_conf *conf = &hw->conf;
        int ret = 0;
 
 {
        struct ath12k *ar = arvif->ar;
        struct ath12k_base *ab = ar->ab;
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct ieee80211_vif *vif = arvif->vif;
        struct ieee80211_mutable_offsets offs = {};
        struct sk_buff *bcn;
                                      struct ath12k_wmi_peer_assoc_arg *arg)
 {
        struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        u32 aid;
 
        lockdep_assert_held(&ar->conf_mutex);
        arg->peer_associd = aid;
        arg->auth_flag = true;
        /* TODO: STA WAR in ath10k for listen interval required? */
-       arg->peer_listen_intval = ar->hw->conf.listen_interval;
+       arg->peer_listen_intval = hw->conf.listen_interval;
        arg->peer_nss = 1;
        arg->peer_caps = vif->bss_conf.assoc_capability;
 }
        struct cfg80211_chan_def def;
        struct cfg80211_bss *bss;
        struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        const u8 *rsnie = NULL;
        const u8 *wpaie = NULL;
 
        if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
                return;
 
-       bss = cfg80211_get_bss(ar->hw->wiphy, def.chan, info->bssid, NULL, 0,
+       bss = cfg80211_get_bss(hw->wiphy, def.chan, info->bssid, NULL, 0,
                               IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY);
 
        if (arvif->rsnie_present || arvif->wpaie_present) {
                                                ies->data,
                                                ies->len);
                rcu_read_unlock();
-               cfg80211_put_bss(ar->hw->wiphy, bss);
+               cfg80211_put_bss(hw->wiphy, bss);
        }
 
        /* FIXME: base on RSN IE/WPA IE is a correct idea? */
        struct cfg80211_chan_def def;
        const struct ieee80211_supported_band *sband;
        const struct ieee80211_rate *rates;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        enum nl80211_band band;
        u32 ratemask;
        u8 rate;
                return;
 
        band = def.chan->band;
-       sband = ar->hw->wiphy->bands[band];
+       sband = hw->wiphy->bands[band];
        ratemask = sta->deflink.supp_rates[band];
        ratemask &= arvif->bitrate_mask.control[band].legacy;
        rates = sband->bitrates;
                                         struct cfg80211_chan_def *def)
 {
        struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        const struct ieee80211_supported_band *sband;
        u8 basic_rate_idx;
        int hw_rate_code;
 
        lockdep_assert_held(&ar->conf_mutex);
 
-       sband = ar->hw->wiphy->bands[def->chan->band];
+       sband = hw->wiphy->bands[def->chan->band];
        basic_rate_idx = ffs(vif->bss_conf.basic_rates) - 1;
        bitrate = sband->bitrates[basic_rate_idx].bitrate;
 
                                     struct ieee80211_bss_conf *info)
 {
        struct ath12k *ar = arvif->ar;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct sk_buff *tmpl;
        int ret;
        u32 interval;
        if (info->fils_discovery.max_interval) {
                interval = info->fils_discovery.max_interval;
 
-               tmpl = ieee80211_get_fils_discovery_tmpl(ar->hw, arvif->vif);
+               tmpl = ieee80211_get_fils_discovery_tmpl(hw, arvif->vif);
                if (tmpl)
                        ret = ath12k_wmi_fils_discovery_tmpl(ar, arvif->vdev_id,
                                                             tmpl);
                unsol_bcast_probe_resp_enabled = 1;
                interval = info->unsol_bcast_probe_resp_interval;
 
-               tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(ar->hw,
+               tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl(hw,
                                                                 arvif->vif);
                if (tmpl)
                        ret = ath12k_wmi_probe_resp_tmpl(ar, arvif->vdev_id,
 
 void __ath12k_mac_scan_finish(struct ath12k *ar)
 {
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
+
        lockdep_assert_held(&ar->data_lock);
 
        switch (ar->scan.state) {
        case ATH12K_SCAN_RUNNING:
        case ATH12K_SCAN_ABORTING:
                if (ar->scan.is_roc && ar->scan.roc_notify)
-                       ieee80211_remain_on_channel_expired(ar->hw);
+                       ieee80211_remain_on_channel_expired(hw);
                fallthrough;
        case ATH12K_SCAN_STARTING:
                if (!ar->scan.is_roc) {
                                            ATH12K_SCAN_STARTING)),
                        };
 
-                       ieee80211_scan_completed(ar->hw, &info);
+                       ieee80211_scan_completed(hw, &info);
                }
 
                ar->scan.state = ATH12K_SCAN_IDLE;
        }
 
        /* Add a margin to account for event/command processing */
-       ieee80211_queue_delayed_work(ar->hw, &ar->scan.timeout,
+       ieee80211_queue_delayed_work(ath12k_ar_to_hw(ar), &ar->scan.timeout,
                                     msecs_to_jiffies(arg.max_scan_time +
                                                      ATH12K_MAC_SCAN_TIMEOUT_MSECS));
 
 {
        int num_mgmt;
 
-       ieee80211_free_txskb(ar->hw, skb);
+       ieee80211_free_txskb(ath12k_ar_to_hw(ar), skb);
 
        num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx);
 
 
        skb_queue_tail(q, skb);
        atomic_inc(&ar->num_pending_mgmt_tx);
-       ieee80211_queue_work(ar->hw, &ar->wmi_mgmt_tx_work);
+       ieee80211_queue_work(ath12k_ar_to_hw(ar), &ar->wmi_mgmt_tx_work);
 
        return 0;
 }
                                  struct ieee80211_chanctx_conf *ctx)
 {
        struct ath12k_mac_change_chanctx_arg arg = { .ctx = ctx };
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
 
        lockdep_assert_held(&ar->conf_mutex);
 
        arsta->changed |= IEEE80211_RC_SUPP_RATES_CHANGED;
        spin_unlock_bh(&ar->data_lock);
 
-       ieee80211_queue_work(ar->hw, &arsta->update_wk);
+       ieee80211_queue_work(ath12k_ar_to_hw(ar), &arsta->update_wk);
 }
 
 static void ath12k_mac_disable_peer_fixed_rate(void *data,
 static int ath12k_mac_setup_iface_combinations(struct ath12k *ar)
 {
        struct ath12k_base *ab = ar->ab;
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct wiphy *wiphy = hw->wiphy;
        struct ieee80211_iface_combination *combinations;
        struct ieee80211_iface_limit *limits;
 
 static void ath12k_mac_hw_unregister(struct ath12k *ar)
 {
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct wiphy *wiphy = hw->wiphy;
 
        cancel_work_sync(&ar->regd_update_work);
 static int ath12k_mac_hw_register(struct ath12k *ar)
 {
        struct ath12k_base *ab = ar->ab;
-       struct ieee80211_hw *hw = ar->hw;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        struct wiphy *wiphy = hw->wiphy;
        struct ath12k_pdev *pdev = ar->pdev;
        struct ath12k_pdev_cap *cap = &pdev->cap;
                if (!ar)
                        continue;
 
-               ieee80211_free_hw(ar->hw);
+               ieee80211_free_hw(ath12k_ar_to_hw(ar));
                pdev->ar = NULL;
        }
 }
 
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 #include <linux/skbuff.h>
 #include <linux/ctype.h>
        if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) && !status)
                info->flags |= IEEE80211_TX_STAT_ACK;
 
-       ieee80211_tx_status_irqsafe(ar->hw, msdu);
+       ieee80211_tx_status_irqsafe(ath12k_ar_to_hw(ar), msdu);
 
        num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx);
 
 
 static void ath12k_wmi_event_scan_foreign_chan(struct ath12k *ar, u32 freq)
 {
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
+
        lockdep_assert_held(&ar->data_lock);
 
        switch (ar->scan.state) {
                break;
        case ATH12K_SCAN_RUNNING:
        case ATH12K_SCAN_ABORTING:
-               ar->scan_channel = ieee80211_get_channel(ar->hw->wiphy, freq);
+               ar->scan_channel = ieee80211_get_channel(hw->wiphy, freq);
                break;
        }
 }
 static int freq_to_idx(struct ath12k *ar, int freq)
 {
        struct ieee80211_supported_band *sband;
+       struct ieee80211_hw *hw = ath12k_ar_to_hw(ar);
        int band, ch, idx = 0;
 
        for (band = NL80211_BAND_2GHZ; band < NUM_NL80211_BANDS; band++) {
                if (!ar->mac.sbands[band].channels)
                        continue;
 
-               sband = ar->hw->wiphy->bands[band];
+               sband = hw->wiphy->bands[band];
                if (!sband)
                        continue;
 
                   status->freq, status->band, status->signal,
                   status->rate_idx);
 
-       ieee80211_rx_ni(ar->hw, skb);
+       ieee80211_rx_ni(ath12k_ar_to_hw(ar), skb);
 
 exit:
        rcu_read_unlock();
                goto exit;
        }
 
-       sta = ieee80211_find_sta_by_ifaddr(ar->hw,
+       sta = ieee80211_find_sta_by_ifaddr(ath12k_ar_to_hw(ar),
                                           arg.mac_addr, NULL);
        if (!sta) {
                ath12k_warn(ab, "Spurious quick kickout for STA %pM\n",
        if (ar->dfs_block_radar_events)
                ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
        else
-               ieee80211_radar_detected(ar->hw);
+               ieee80211_radar_detected(ath12k_ar_to_hw(ar));
 
 exit:
        rcu_read_unlock();