@@ -542,7 +542,7 @@ struct ath12k_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id)
542542 arvif_iter .vdev_id = vdev_id ;
543543
544544 flags = IEEE80211_IFACE_ITER_RESUME_ALL ;
545- ieee80211_iterate_active_interfaces_atomic (ar -> hw ,
545+ ieee80211_iterate_active_interfaces_atomic (ath12k_ar_to_hw ( ar ) ,
546546 flags ,
547547 ath12k_get_arvif_iter ,
548548 & arvif_iter );
@@ -1040,7 +1040,7 @@ static int ath12k_mac_monitor_start(struct ath12k *ar)
10401040 if (ar -> monitor_started )
10411041 return 0 ;
10421042
1043- ieee80211_iter_chan_contexts_atomic (ar -> hw ,
1043+ ieee80211_iter_chan_contexts_atomic (ath12k_ar_to_hw ( ar ) ,
10441044 ath12k_mac_get_any_chandef_iter ,
10451045 & chandef );
10461046 if (!chandef )
@@ -1085,7 +1085,7 @@ static int ath12k_mac_monitor_stop(struct ath12k *ar)
10851085
10861086static int ath12k_mac_config (struct ath12k * ar , u32 changed )
10871087{
1088- struct ieee80211_hw * hw = ar -> hw ;
1088+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
10891089 struct ieee80211_conf * conf = & hw -> conf ;
10901090 int ret = 0 ;
10911091
@@ -1139,7 +1139,7 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_vif *arvif)
11391139{
11401140 struct ath12k * ar = arvif -> ar ;
11411141 struct ath12k_base * ab = ar -> ab ;
1142- struct ieee80211_hw * hw = ar -> hw ;
1142+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
11431143 struct ieee80211_vif * vif = arvif -> vif ;
11441144 struct ieee80211_mutable_offsets offs = {};
11451145 struct sk_buff * bcn ;
@@ -1227,6 +1227,7 @@ static void ath12k_peer_assoc_h_basic(struct ath12k *ar,
12271227 struct ath12k_wmi_peer_assoc_arg * arg )
12281228{
12291229 struct ath12k_vif * arvif = ath12k_vif_to_arvif (vif );
1230+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
12301231 u32 aid ;
12311232
12321233 lockdep_assert_held (& ar -> conf_mutex );
@@ -1241,7 +1242,7 @@ static void ath12k_peer_assoc_h_basic(struct ath12k *ar,
12411242 arg -> peer_associd = aid ;
12421243 arg -> auth_flag = true;
12431244 /* TODO: STA WAR in ath10k for listen interval required? */
1244- arg -> peer_listen_intval = ar -> hw -> conf .listen_interval ;
1245+ arg -> peer_listen_intval = hw -> conf .listen_interval ;
12451246 arg -> peer_nss = 1 ;
12461247 arg -> peer_caps = vif -> bss_conf .assoc_capability ;
12471248}
@@ -1255,6 +1256,7 @@ static void ath12k_peer_assoc_h_crypto(struct ath12k *ar,
12551256 struct cfg80211_chan_def def ;
12561257 struct cfg80211_bss * bss ;
12571258 struct ath12k_vif * arvif = ath12k_vif_to_arvif (vif );
1259+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
12581260 const u8 * rsnie = NULL ;
12591261 const u8 * wpaie = NULL ;
12601262
@@ -1263,7 +1265,7 @@ static void ath12k_peer_assoc_h_crypto(struct ath12k *ar,
12631265 if (WARN_ON (ath12k_mac_vif_chan (vif , & def )))
12641266 return ;
12651267
1266- bss = cfg80211_get_bss (ar -> hw -> wiphy , def .chan , info -> bssid , NULL , 0 ,
1268+ bss = cfg80211_get_bss (hw -> wiphy , def .chan , info -> bssid , NULL , 0 ,
12671269 IEEE80211_BSS_TYPE_ANY , IEEE80211_PRIVACY_ANY );
12681270
12691271 if (arvif -> rsnie_present || arvif -> wpaie_present ) {
@@ -1283,7 +1285,7 @@ static void ath12k_peer_assoc_h_crypto(struct ath12k *ar,
12831285 ies -> data ,
12841286 ies -> len );
12851287 rcu_read_unlock ();
1286- cfg80211_put_bss (ar -> hw -> wiphy , bss );
1288+ cfg80211_put_bss (hw -> wiphy , bss );
12871289 }
12881290
12891291 /* FIXME: base on RSN IE/WPA IE is a correct idea? */
@@ -1317,6 +1319,7 @@ static void ath12k_peer_assoc_h_rates(struct ath12k *ar,
13171319 struct cfg80211_chan_def def ;
13181320 const struct ieee80211_supported_band * sband ;
13191321 const struct ieee80211_rate * rates ;
1322+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
13201323 enum nl80211_band band ;
13211324 u32 ratemask ;
13221325 u8 rate ;
@@ -1328,7 +1331,7 @@ static void ath12k_peer_assoc_h_rates(struct ath12k *ar,
13281331 return ;
13291332
13301333 band = def .chan -> band ;
1331- sband = ar -> hw -> wiphy -> bands [band ];
1334+ sband = hw -> wiphy -> bands [band ];
13321335 ratemask = sta -> deflink .supp_rates [band ];
13331336 ratemask &= arvif -> bitrate_mask .control [band ].legacy ;
13341337 rates = sband -> bitrates ;
@@ -2423,6 +2426,7 @@ static void ath12k_recalculate_mgmt_rate(struct ath12k *ar,
24232426 struct cfg80211_chan_def * def )
24242427{
24252428 struct ath12k_vif * arvif = ath12k_vif_to_arvif (vif );
2429+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
24262430 const struct ieee80211_supported_band * sband ;
24272431 u8 basic_rate_idx ;
24282432 int hw_rate_code ;
@@ -2432,7 +2436,7 @@ static void ath12k_recalculate_mgmt_rate(struct ath12k *ar,
24322436
24332437 lockdep_assert_held (& ar -> conf_mutex );
24342438
2435- sband = ar -> hw -> wiphy -> bands [def -> chan -> band ];
2439+ sband = hw -> wiphy -> bands [def -> chan -> band ];
24362440 basic_rate_idx = ffs (vif -> bss_conf .basic_rates ) - 1 ;
24372441 bitrate = sband -> bitrates [basic_rate_idx ].bitrate ;
24382442
@@ -2459,6 +2463,7 @@ static int ath12k_mac_fils_discovery(struct ath12k_vif *arvif,
24592463 struct ieee80211_bss_conf * info )
24602464{
24612465 struct ath12k * ar = arvif -> ar ;
2466+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
24622467 struct sk_buff * tmpl ;
24632468 int ret ;
24642469 u32 interval ;
@@ -2467,15 +2472,15 @@ static int ath12k_mac_fils_discovery(struct ath12k_vif *arvif,
24672472 if (info -> fils_discovery .max_interval ) {
24682473 interval = info -> fils_discovery .max_interval ;
24692474
2470- tmpl = ieee80211_get_fils_discovery_tmpl (ar -> hw , arvif -> vif );
2475+ tmpl = ieee80211_get_fils_discovery_tmpl (hw , arvif -> vif );
24712476 if (tmpl )
24722477 ret = ath12k_wmi_fils_discovery_tmpl (ar , arvif -> vdev_id ,
24732478 tmpl );
24742479 } else if (info -> unsol_bcast_probe_resp_interval ) {
24752480 unsol_bcast_probe_resp_enabled = 1 ;
24762481 interval = info -> unsol_bcast_probe_resp_interval ;
24772482
2478- tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl (ar -> hw ,
2483+ tmpl = ieee80211_get_unsol_bcast_probe_resp_tmpl (hw ,
24792484 arvif -> vif );
24802485 if (tmpl )
24812486 ret = ath12k_wmi_probe_resp_tmpl (ar , arvif -> vdev_id ,
@@ -2798,6 +2803,8 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
27982803
27992804void __ath12k_mac_scan_finish (struct ath12k * ar )
28002805{
2806+ struct ieee80211_hw * hw = ath12k_ar_to_hw (ar );
2807+
28012808 lockdep_assert_held (& ar -> data_lock );
28022809
28032810 switch (ar -> scan .state ) {
@@ -2806,7 +2813,7 @@ void __ath12k_mac_scan_finish(struct ath12k *ar)
28062813 case ATH12K_SCAN_RUNNING :
28072814 case ATH12K_SCAN_ABORTING :
28082815 if (ar -> scan .is_roc && ar -> scan .roc_notify )
2809- ieee80211_remain_on_channel_expired (ar -> hw );
2816+ ieee80211_remain_on_channel_expired (hw );
28102817 fallthrough ;
28112818 case ATH12K_SCAN_STARTING :
28122819 if (!ar -> scan .is_roc ) {
@@ -2817,7 +2824,7 @@ void __ath12k_mac_scan_finish(struct ath12k *ar)
28172824 ATH12K_SCAN_STARTING )),
28182825 };
28192826
2820- ieee80211_scan_completed (ar -> hw , & info );
2827+ ieee80211_scan_completed (hw , & info );
28212828 }
28222829
28232830 ar -> scan .state = ATH12K_SCAN_IDLE ;
@@ -3036,7 +3043,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
30363043 }
30373044
30383045 /* Add a margin to account for event/command processing */
3039- ieee80211_queue_delayed_work (ar -> hw , & ar -> scan .timeout ,
3046+ ieee80211_queue_delayed_work (ath12k_ar_to_hw ( ar ) , & ar -> scan .timeout ,
30403047 msecs_to_jiffies (arg .max_scan_time +
30413048 ATH12K_MAC_SCAN_TIMEOUT_MSECS ));
30423049
@@ -4819,7 +4826,7 @@ static void ath12k_mgmt_over_wmi_tx_drop(struct ath12k *ar, struct sk_buff *skb)
48194826{
48204827 int num_mgmt ;
48214828
4822- ieee80211_free_txskb (ar -> hw , skb );
4829+ ieee80211_free_txskb (ath12k_ar_to_hw ( ar ) , skb );
48234830
48244831 num_mgmt = atomic_dec_if_positive (& ar -> num_pending_mgmt_tx );
48254832
@@ -4996,7 +5003,7 @@ static int ath12k_mac_mgmt_tx(struct ath12k *ar, struct sk_buff *skb,
49965003
49975004 skb_queue_tail (q , skb );
49985005 atomic_inc (& ar -> num_pending_mgmt_tx );
4999- ieee80211_queue_work (ar -> hw , & ar -> wmi_mgmt_tx_work );
5006+ ieee80211_queue_work (ath12k_ar_to_hw ( ar ) , & ar -> wmi_mgmt_tx_work );
50005007
50015008 return 0 ;
50025009}
@@ -6357,7 +6364,7 @@ ath12k_mac_update_active_vif_chan(struct ath12k *ar,
63576364 struct ieee80211_chanctx_conf * ctx )
63586365{
63596366 struct ath12k_mac_change_chanctx_arg arg = { .ctx = ctx };
6360- struct ieee80211_hw * hw = ar -> hw ;
6367+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
63616368
63626369 lockdep_assert_held (& ar -> conf_mutex );
63636370
@@ -6874,7 +6881,7 @@ static void ath12k_mac_set_bitrate_mask_iter(void *data,
68746881 arsta -> changed |= IEEE80211_RC_SUPP_RATES_CHANGED ;
68756882 spin_unlock_bh (& ar -> data_lock );
68766883
6877- ieee80211_queue_work (ar -> hw , & arsta -> update_wk );
6884+ ieee80211_queue_work (ath12k_ar_to_hw ( ar ) , & arsta -> update_wk );
68786885}
68796886
68806887static void ath12k_mac_disable_peer_fixed_rate (void * data ,
@@ -7350,7 +7357,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
73507357static int ath12k_mac_setup_iface_combinations (struct ath12k * ar )
73517358{
73527359 struct ath12k_base * ab = ar -> ab ;
7353- struct ieee80211_hw * hw = ar -> hw ;
7360+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
73547361 struct wiphy * wiphy = hw -> wiphy ;
73557362 struct ieee80211_iface_combination * combinations ;
73567363 struct ieee80211_iface_limit * limits ;
@@ -7457,7 +7464,7 @@ static void ath12k_mac_cleanup_unregister(struct ath12k *ar)
74577464
74587465static void ath12k_mac_hw_unregister (struct ath12k * ar )
74597466{
7460- struct ieee80211_hw * hw = ar -> hw ;
7467+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
74617468 struct wiphy * wiphy = hw -> wiphy ;
74627469
74637470 cancel_work_sync (& ar -> regd_update_work );
@@ -7503,7 +7510,7 @@ static int ath12k_mac_setup_register(struct ath12k *ar,
75037510static int ath12k_mac_hw_register (struct ath12k * ar )
75047511{
75057512 struct ath12k_base * ab = ar -> ab ;
7506- struct ieee80211_hw * hw = ar -> hw ;
7513+ struct ieee80211_hw * hw = ath12k_ar_to_hw ( ar ) ;
75077514 struct wiphy * wiphy = hw -> wiphy ;
75087515 struct ath12k_pdev * pdev = ar -> pdev ;
75097516 struct ath12k_pdev_cap * cap = & pdev -> cap ;
@@ -7777,7 +7784,7 @@ static void ath12k_mac_hw_destroy(struct ath12k_base *ab)
77777784 if (!ar )
77787785 continue ;
77797786
7780- ieee80211_free_hw (ar -> hw );
7787+ ieee80211_free_hw (ath12k_ar_to_hw ( ar ) );
77817788 pdev -> ar = NULL ;
77827789 }
77837790}
0 commit comments