@@ -6266,10 +6266,11 @@ ath12k_mac_update_active_vif_chan(struct ath12k *ar,
6266
6266
struct ieee80211_chanctx_conf * ctx )
6267
6267
{
6268
6268
struct ath12k_mac_change_chanctx_arg arg = { .ctx = ctx };
6269
+ struct ieee80211_hw * hw = ar -> hw ;
6269
6270
6270
6271
lockdep_assert_held (& ar -> conf_mutex );
6271
6272
6272
- ieee80211_iterate_active_interfaces_atomic (ar -> hw ,
6273
+ ieee80211_iterate_active_interfaces_atomic (hw ,
6273
6274
IEEE80211_IFACE_ITER_NORMAL ,
6274
6275
ath12k_mac_change_chanctx_cnt_iter ,
6275
6276
& arg );
@@ -6280,7 +6281,7 @@ ath12k_mac_update_active_vif_chan(struct ath12k *ar,
6280
6281
if (!arg .vifs )
6281
6282
return ;
6282
6283
6283
- ieee80211_iterate_active_interfaces_atomic (ar -> hw ,
6284
+ ieee80211_iterate_active_interfaces_atomic (hw ,
6284
6285
IEEE80211_IFACE_ITER_NORMAL ,
6285
6286
ath12k_mac_change_chanctx_fill_iter ,
6286
6287
& arg );
@@ -7159,6 +7160,7 @@ static u32 ath12k_get_phy_id(struct ath12k *ar, u32 band)
7159
7160
static int ath12k_mac_setup_channels_rates (struct ath12k * ar ,
7160
7161
u32 supported_bands )
7161
7162
{
7163
+ struct ieee80211_hw * hw = ar -> hw ;
7162
7164
struct ieee80211_supported_band * band ;
7163
7165
struct ath12k_wmi_hal_reg_capabilities_ext_arg * reg_cap ;
7164
7166
void * channels ;
@@ -7184,7 +7186,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
7184
7186
band -> channels = channels ;
7185
7187
band -> n_bitrates = ath12k_g_rates_size ;
7186
7188
band -> bitrates = ath12k_g_rates ;
7187
- ar -> hw -> wiphy -> bands [NL80211_BAND_2GHZ ] = band ;
7189
+ hw -> wiphy -> bands [NL80211_BAND_2GHZ ] = band ;
7188
7190
7189
7191
if (ar -> ab -> hw_params -> single_pdev_only ) {
7190
7192
phy_id = ath12k_get_phy_id (ar , WMI_HOST_WLAN_2G_CAP );
@@ -7211,7 +7213,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
7211
7213
band -> channels = channels ;
7212
7214
band -> n_bitrates = ath12k_a_rates_size ;
7213
7215
band -> bitrates = ath12k_a_rates ;
7214
- ar -> hw -> wiphy -> bands [NL80211_BAND_6GHZ ] = band ;
7216
+ hw -> wiphy -> bands [NL80211_BAND_6GHZ ] = band ;
7215
7217
ath12k_mac_update_ch_list (ar , band ,
7216
7218
reg_cap -> low_5ghz_chan ,
7217
7219
reg_cap -> high_5ghz_chan );
@@ -7233,7 +7235,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
7233
7235
band -> channels = channels ;
7234
7236
band -> n_bitrates = ath12k_a_rates_size ;
7235
7237
band -> bitrates = ath12k_a_rates ;
7236
- ar -> hw -> wiphy -> bands [NL80211_BAND_5GHZ ] = band ;
7238
+ hw -> wiphy -> bands [NL80211_BAND_5GHZ ] = band ;
7237
7239
7238
7240
if (ar -> ab -> hw_params -> single_pdev_only ) {
7239
7241
phy_id = ath12k_get_phy_id (ar , WMI_HOST_WLAN_5G_CAP );
@@ -7252,6 +7254,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
7252
7254
static int ath12k_mac_setup_iface_combinations (struct ath12k * ar )
7253
7255
{
7254
7256
struct ath12k_base * ab = ar -> ab ;
7257
+ struct ieee80211_hw * hw = ar -> hw ;
7255
7258
struct ieee80211_iface_combination * combinations ;
7256
7259
struct ieee80211_iface_limit * limits ;
7257
7260
int n_limits , max_interfaces ;
@@ -7302,8 +7305,8 @@ static int ath12k_mac_setup_iface_combinations(struct ath12k *ar)
7302
7305
BIT (NL80211_CHAN_WIDTH_40 ) |
7303
7306
BIT (NL80211_CHAN_WIDTH_80 );
7304
7307
7305
- ar -> hw -> wiphy -> iface_combinations = combinations ;
7306
- ar -> hw -> wiphy -> n_iface_combinations = 1 ;
7308
+ hw -> wiphy -> iface_combinations = combinations ;
7309
+ hw -> wiphy -> n_iface_combinations = 1 ;
7307
7310
7308
7311
return 0 ;
7309
7312
}
@@ -7347,9 +7350,11 @@ static const struct wiphy_iftype_ext_capab ath12k_iftypes_ext_capa[] = {
7347
7350
7348
7351
static void __ath12k_mac_unregister (struct ath12k * ar )
7349
7352
{
7353
+ struct ieee80211_hw * hw = ar -> hw ;
7354
+
7350
7355
cancel_work_sync (& ar -> regd_update_work );
7351
7356
7352
- ieee80211_unregister_hw (ar -> hw );
7357
+ ieee80211_unregister_hw (hw );
7353
7358
7354
7359
idr_for_each (& ar -> txmgmt_idr , ath12k_mac_tx_mgmt_pending_free , ar );
7355
7360
idr_destroy (& ar -> txmgmt_idr );
@@ -7358,10 +7363,10 @@ static void __ath12k_mac_unregister(struct ath12k *ar)
7358
7363
kfree (ar -> mac .sbands [NL80211_BAND_5GHZ ].channels );
7359
7364
kfree (ar -> mac .sbands [NL80211_BAND_6GHZ ].channels );
7360
7365
7361
- kfree (ar -> hw -> wiphy -> iface_combinations [0 ].limits );
7362
- kfree (ar -> hw -> wiphy -> iface_combinations );
7366
+ kfree (hw -> wiphy -> iface_combinations [0 ].limits );
7367
+ kfree (hw -> wiphy -> iface_combinations );
7363
7368
7364
- SET_IEEE80211_DEV (ar -> hw , NULL );
7369
+ SET_IEEE80211_DEV (hw , NULL );
7365
7370
}
7366
7371
7367
7372
void ath12k_mac_unregister (struct ath12k_base * ab )
@@ -7383,6 +7388,7 @@ void ath12k_mac_unregister(struct ath12k_base *ab)
7383
7388
static int __ath12k_mac_register (struct ath12k * ar )
7384
7389
{
7385
7390
struct ath12k_base * ab = ar -> ab ;
7391
+ struct ieee80211_hw * hw = ar -> hw ;
7386
7392
struct ath12k_pdev_cap * cap = & ar -> pdev -> cap ;
7387
7393
static const u32 cipher_suites [] = {
7388
7394
WLAN_CIPHER_SUITE_TKIP ,
@@ -7400,9 +7406,9 @@ static int __ath12k_mac_register(struct ath12k *ar)
7400
7406
7401
7407
ath12k_pdev_caps_update (ar );
7402
7408
7403
- SET_IEEE80211_PERM_ADDR (ar -> hw , ar -> mac_addr );
7409
+ SET_IEEE80211_PERM_ADDR (hw , ar -> mac_addr );
7404
7410
7405
- SET_IEEE80211_DEV (ar -> hw , ab -> dev );
7411
+ SET_IEEE80211_DEV (hw , ab -> dev );
7406
7412
7407
7413
ret = ath12k_mac_setup_channels_rates (ar ,
7408
7414
cap -> supported_bands );
@@ -7418,103 +7424,103 @@ static int __ath12k_mac_register(struct ath12k *ar)
7418
7424
goto err_free_channels ;
7419
7425
}
7420
7426
7421
- ar -> hw -> wiphy -> available_antennas_rx = cap -> rx_chain_mask ;
7422
- ar -> hw -> wiphy -> available_antennas_tx = cap -> tx_chain_mask ;
7427
+ hw -> wiphy -> available_antennas_rx = cap -> rx_chain_mask ;
7428
+ hw -> wiphy -> available_antennas_tx = cap -> tx_chain_mask ;
7423
7429
7424
- ar -> hw -> wiphy -> interface_modes = ab -> hw_params -> interface_modes ;
7430
+ hw -> wiphy -> interface_modes = ab -> hw_params -> interface_modes ;
7425
7431
7426
- if (ar -> hw -> wiphy -> bands [NL80211_BAND_2GHZ ] &&
7427
- ar -> hw -> wiphy -> bands [NL80211_BAND_5GHZ ] &&
7428
- ar -> hw -> wiphy -> bands [NL80211_BAND_6GHZ ])
7429
- ieee80211_hw_set (ar -> hw , SINGLE_SCAN_ON_ALL_BANDS );
7432
+ if (hw -> wiphy -> bands [NL80211_BAND_2GHZ ] &&
7433
+ hw -> wiphy -> bands [NL80211_BAND_5GHZ ] &&
7434
+ hw -> wiphy -> bands [NL80211_BAND_6GHZ ])
7435
+ ieee80211_hw_set (hw , SINGLE_SCAN_ON_ALL_BANDS );
7430
7436
7431
- ieee80211_hw_set (ar -> hw , SIGNAL_DBM );
7432
- ieee80211_hw_set (ar -> hw , SUPPORTS_PS );
7433
- ieee80211_hw_set (ar -> hw , SUPPORTS_DYNAMIC_PS );
7434
- ieee80211_hw_set (ar -> hw , MFP_CAPABLE );
7435
- ieee80211_hw_set (ar -> hw , REPORTS_TX_ACK_STATUS );
7436
- ieee80211_hw_set (ar -> hw , HAS_RATE_CONTROL );
7437
- ieee80211_hw_set (ar -> hw , AP_LINK_PS );
7438
- ieee80211_hw_set (ar -> hw , SPECTRUM_MGMT );
7439
- ieee80211_hw_set (ar -> hw , CONNECTION_MONITOR );
7440
- ieee80211_hw_set (ar -> hw , SUPPORTS_PER_STA_GTK );
7441
- ieee80211_hw_set (ar -> hw , CHANCTX_STA_CSA );
7442
- ieee80211_hw_set (ar -> hw , QUEUE_CONTROL );
7443
- ieee80211_hw_set (ar -> hw , SUPPORTS_TX_FRAG );
7444
- ieee80211_hw_set (ar -> hw , REPORTS_LOW_ACK );
7437
+ ieee80211_hw_set (hw , SIGNAL_DBM );
7438
+ ieee80211_hw_set (hw , SUPPORTS_PS );
7439
+ ieee80211_hw_set (hw , SUPPORTS_DYNAMIC_PS );
7440
+ ieee80211_hw_set (hw , MFP_CAPABLE );
7441
+ ieee80211_hw_set (hw , REPORTS_TX_ACK_STATUS );
7442
+ ieee80211_hw_set (hw , HAS_RATE_CONTROL );
7443
+ ieee80211_hw_set (hw , AP_LINK_PS );
7444
+ ieee80211_hw_set (hw , SPECTRUM_MGMT );
7445
+ ieee80211_hw_set (hw , CONNECTION_MONITOR );
7446
+ ieee80211_hw_set (hw , SUPPORTS_PER_STA_GTK );
7447
+ ieee80211_hw_set (hw , CHANCTX_STA_CSA );
7448
+ ieee80211_hw_set (hw , QUEUE_CONTROL );
7449
+ ieee80211_hw_set (hw , SUPPORTS_TX_FRAG );
7450
+ ieee80211_hw_set (hw , REPORTS_LOW_ACK );
7445
7451
7446
7452
if (ht_cap & WMI_HT_CAP_ENABLED ) {
7447
- ieee80211_hw_set (ar -> hw , AMPDU_AGGREGATION );
7448
- ieee80211_hw_set (ar -> hw , TX_AMPDU_SETUP_IN_HW );
7449
- ieee80211_hw_set (ar -> hw , SUPPORTS_REORDERING_BUFFER );
7450
- ieee80211_hw_set (ar -> hw , SUPPORTS_AMSDU_IN_AMPDU );
7451
- ieee80211_hw_set (ar -> hw , USES_RSS );
7453
+ ieee80211_hw_set (hw , AMPDU_AGGREGATION );
7454
+ ieee80211_hw_set (hw , TX_AMPDU_SETUP_IN_HW );
7455
+ ieee80211_hw_set (hw , SUPPORTS_REORDERING_BUFFER );
7456
+ ieee80211_hw_set (hw , SUPPORTS_AMSDU_IN_AMPDU );
7457
+ ieee80211_hw_set (hw , USES_RSS );
7452
7458
}
7453
7459
7454
- ar -> hw -> wiphy -> features |= NL80211_FEATURE_STATIC_SMPS ;
7455
- ar -> hw -> wiphy -> flags |= WIPHY_FLAG_IBSS_RSN ;
7460
+ hw -> wiphy -> features |= NL80211_FEATURE_STATIC_SMPS ;
7461
+ hw -> wiphy -> flags |= WIPHY_FLAG_IBSS_RSN ;
7456
7462
7457
7463
/* TODO: Check if HT capability advertised from firmware is different
7458
7464
* for each band for a dual band capable radio. It will be tricky to
7459
7465
* handle it when the ht capability different for each band.
7460
7466
*/
7461
7467
if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS )
7462
- ar -> hw -> wiphy -> features |= NL80211_FEATURE_DYNAMIC_SMPS ;
7468
+ hw -> wiphy -> features |= NL80211_FEATURE_DYNAMIC_SMPS ;
7463
7469
7464
- ar -> hw -> wiphy -> max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID ;
7465
- ar -> hw -> wiphy -> max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN ;
7470
+ hw -> wiphy -> max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID ;
7471
+ hw -> wiphy -> max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN ;
7466
7472
7467
- ar -> hw -> max_listen_interval = ATH12K_MAX_HW_LISTEN_INTERVAL ;
7473
+ hw -> max_listen_interval = ATH12K_MAX_HW_LISTEN_INTERVAL ;
7468
7474
7469
- ar -> hw -> wiphy -> flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL ;
7470
- ar -> hw -> wiphy -> flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH ;
7471
- ar -> hw -> wiphy -> max_remain_on_channel_duration = 5000 ;
7475
+ hw -> wiphy -> flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL ;
7476
+ hw -> wiphy -> flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH ;
7477
+ hw -> wiphy -> max_remain_on_channel_duration = 5000 ;
7472
7478
7473
- ar -> hw -> wiphy -> flags |= WIPHY_FLAG_AP_UAPSD ;
7474
- ar -> hw -> wiphy -> features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |
7479
+ hw -> wiphy -> flags |= WIPHY_FLAG_AP_UAPSD ;
7480
+ hw -> wiphy -> features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |
7475
7481
NL80211_FEATURE_AP_SCAN ;
7476
7482
7477
7483
ar -> max_num_stations = TARGET_NUM_STATIONS ;
7478
7484
ar -> max_num_peers = TARGET_NUM_PEERS_PDEV ;
7479
7485
7480
- ar -> hw -> wiphy -> max_ap_assoc_sta = ar -> max_num_stations ;
7486
+ hw -> wiphy -> max_ap_assoc_sta = ar -> max_num_stations ;
7481
7487
7482
- ar -> hw -> queues = ATH12K_HW_MAX_QUEUES ;
7483
- ar -> hw -> wiphy -> tx_queue_len = ATH12K_QUEUE_LEN ;
7484
- ar -> hw -> offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1 ;
7485
- ar -> hw -> max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE ;
7488
+ hw -> queues = ATH12K_HW_MAX_QUEUES ;
7489
+ hw -> wiphy -> tx_queue_len = ATH12K_QUEUE_LEN ;
7490
+ hw -> offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1 ;
7491
+ hw -> max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE ;
7486
7492
7487
- ar -> hw -> vif_data_size = sizeof (struct ath12k_vif );
7488
- ar -> hw -> sta_data_size = sizeof (struct ath12k_sta );
7493
+ hw -> vif_data_size = sizeof (struct ath12k_vif );
7494
+ hw -> sta_data_size = sizeof (struct ath12k_sta );
7489
7495
7490
- wiphy_ext_feature_set (ar -> hw -> wiphy , NL80211_EXT_FEATURE_CQM_RSSI_LIST );
7491
- wiphy_ext_feature_set (ar -> hw -> wiphy , NL80211_EXT_FEATURE_STA_TX_PWR );
7496
+ wiphy_ext_feature_set (hw -> wiphy , NL80211_EXT_FEATURE_CQM_RSSI_LIST );
7497
+ wiphy_ext_feature_set (hw -> wiphy , NL80211_EXT_FEATURE_STA_TX_PWR );
7492
7498
7493
- ar -> hw -> wiphy -> cipher_suites = cipher_suites ;
7494
- ar -> hw -> wiphy -> n_cipher_suites = ARRAY_SIZE (cipher_suites );
7499
+ hw -> wiphy -> cipher_suites = cipher_suites ;
7500
+ hw -> wiphy -> n_cipher_suites = ARRAY_SIZE (cipher_suites );
7495
7501
7496
- ar -> hw -> wiphy -> iftype_ext_capab = ath12k_iftypes_ext_capa ;
7497
- ar -> hw -> wiphy -> num_iftype_ext_capab =
7502
+ hw -> wiphy -> iftype_ext_capab = ath12k_iftypes_ext_capa ;
7503
+ hw -> wiphy -> num_iftype_ext_capab =
7498
7504
ARRAY_SIZE (ath12k_iftypes_ext_capa );
7499
7505
7500
7506
if (ar -> supports_6ghz ) {
7501
- wiphy_ext_feature_set (ar -> hw -> wiphy ,
7507
+ wiphy_ext_feature_set (hw -> wiphy ,
7502
7508
NL80211_EXT_FEATURE_FILS_DISCOVERY );
7503
- wiphy_ext_feature_set (ar -> hw -> wiphy ,
7509
+ wiphy_ext_feature_set (hw -> wiphy ,
7504
7510
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP );
7505
7511
}
7506
7512
7507
- wiphy_ext_feature_set (ar -> hw -> wiphy , NL80211_EXT_FEATURE_PUNCT );
7513
+ wiphy_ext_feature_set (hw -> wiphy , NL80211_EXT_FEATURE_PUNCT );
7508
7514
7509
- ath12k_reg_init (ar );
7515
+ ath12k_reg_init (hw );
7510
7516
7511
7517
if (!test_bit (ATH12K_FLAG_RAW_MODE , & ab -> dev_flags )) {
7512
- ar -> hw -> netdev_features = NETIF_F_HW_CSUM ;
7513
- ieee80211_hw_set (ar -> hw , SW_CRYPTO_CONTROL );
7514
- ieee80211_hw_set (ar -> hw , SUPPORT_FAST_XMIT );
7518
+ hw -> netdev_features = NETIF_F_HW_CSUM ;
7519
+ ieee80211_hw_set (hw , SW_CRYPTO_CONTROL );
7520
+ ieee80211_hw_set (hw , SUPPORT_FAST_XMIT );
7515
7521
}
7516
7522
7517
- ret = ieee80211_register_hw (ar -> hw );
7523
+ ret = ieee80211_register_hw (hw );
7518
7524
if (ret ) {
7519
7525
ath12k_err (ar -> ab , "ieee80211 registration failed: %d\n" , ret );
7520
7526
goto err_free_if_combs ;
@@ -7526,7 +7532,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
7526
7532
* while. But that time is so short and in practise it make
7527
7533
* a difference in real life.
7528
7534
*/
7529
- ar -> hw -> wiphy -> interface_modes &= ~BIT (NL80211_IFTYPE_MONITOR );
7535
+ hw -> wiphy -> interface_modes &= ~BIT (NL80211_IFTYPE_MONITOR );
7530
7536
7531
7537
/* Apply the regd received during initialization */
7532
7538
ret = ath12k_regd_update (ar , true);
@@ -7538,19 +7544,19 @@ static int __ath12k_mac_register(struct ath12k *ar)
7538
7544
return 0 ;
7539
7545
7540
7546
err_unregister_hw :
7541
- ieee80211_unregister_hw (ar -> hw );
7547
+ ieee80211_unregister_hw (hw );
7542
7548
7543
7549
err_free_if_combs :
7544
- kfree (ar -> hw -> wiphy -> iface_combinations [0 ].limits );
7545
- kfree (ar -> hw -> wiphy -> iface_combinations );
7550
+ kfree (hw -> wiphy -> iface_combinations [0 ].limits );
7551
+ kfree (hw -> wiphy -> iface_combinations );
7546
7552
7547
7553
err_free_channels :
7548
7554
kfree (ar -> mac .sbands [NL80211_BAND_2GHZ ].channels );
7549
7555
kfree (ar -> mac .sbands [NL80211_BAND_5GHZ ].channels );
7550
7556
kfree (ar -> mac .sbands [NL80211_BAND_6GHZ ].channels );
7551
7557
7552
7558
err :
7553
- SET_IEEE80211_DEV (ar -> hw , NULL );
7559
+ SET_IEEE80211_DEV (hw , NULL );
7554
7560
return ret ;
7555
7561
}
7556
7562
0 commit comments