Skip to content

Commit 57fbcce

Browse files
committed
cfg80211: remove enum ieee80211_band
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 35eb8f7 commit 57fbcce

230 files changed

Lines changed: 1420 additions & 1437 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/DocBook/80211.tmpl‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
<chapter>
7676
<title>Device registration</title>
7777
!Pinclude/net/cfg80211.h Device registration
78-
!Finclude/net/cfg80211.h ieee80211_band
7978
!Finclude/net/cfg80211.h ieee80211_channel_flags
8079
!Finclude/net/cfg80211.h ieee80211_channel
8180
!Finclude/net/cfg80211.h ieee80211_rate_flags

‎drivers/net/wireless/admtek/adm8211.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ static void adm8211_interrupt_rci(struct ieee80211_hw *dev)
440440
rx_status.rate_idx = rate;
441441

442442
rx_status.freq = adm8211_channels[priv->channel - 1].center_freq;
443-
rx_status.band = IEEE80211_BAND_2GHZ;
443+
rx_status.band = NL80211_BAND_2GHZ;
444444

445445
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
446446
ieee80211_rx_irqsafe(dev, skb);
@@ -1894,7 +1894,7 @@ static int adm8211_probe(struct pci_dev *pdev,
18941894

18951895
priv->channel = 1;
18961896

1897-
dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
1897+
dev->wiphy->bands[NL80211_BAND_2GHZ] = &priv->band;
18981898

18991899
err = ieee80211_register_hw(dev);
19001900
if (err) {

‎drivers/net/wireless/ath/ar5523/ar5523.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,12 +1471,12 @@ static int ar5523_init_modes(struct ar5523 *ar)
14711471
memcpy(ar->channels, ar5523_channels, sizeof(ar5523_channels));
14721472
memcpy(ar->rates, ar5523_rates, sizeof(ar5523_rates));
14731473

1474-
ar->band.band = IEEE80211_BAND_2GHZ;
1474+
ar->band.band = NL80211_BAND_2GHZ;
14751475
ar->band.channels = ar->channels;
14761476
ar->band.n_channels = ARRAY_SIZE(ar5523_channels);
14771477
ar->band.bitrates = ar->rates;
14781478
ar->band.n_bitrates = ARRAY_SIZE(ar5523_rates);
1479-
ar->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &ar->band;
1479+
ar->hw->wiphy->bands[NL80211_BAND_2GHZ] = &ar->band;
14801480
return 0;
14811481
}
14821482

‎drivers/net/wireless/ath/ath.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ struct ath_common {
185185
bool bt_ant_diversity;
186186

187187
int last_rssi;
188-
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
188+
struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
189189
};
190190

191191
static inline const struct ath_ps_ops *ath_ps_ops(struct ath_common *common)

‎drivers/net/wireless/ath/ath10k/core.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ struct ath10k {
765765
} scan;
766766

767767
struct {
768-
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
768+
struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
769769
} mac;
770770

771771
/* should never be NULL; needed for regular htt rx */

‎drivers/net/wireless/ath/ath10k/htt_rx.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,9 +2182,9 @@ static void ath10k_htt_rx_tx_mode_switch_ind(struct ath10k *ar,
21822182
ath10k_mac_tx_push_pending(ar);
21832183
}
21842184

2185-
static inline enum ieee80211_band phy_mode_to_band(u32 phy_mode)
2185+
static inline enum nl80211_band phy_mode_to_band(u32 phy_mode)
21862186
{
2187-
enum ieee80211_band band;
2187+
enum nl80211_band band;
21882188

21892189
switch (phy_mode) {
21902190
case MODE_11A:
@@ -2193,7 +2193,7 @@ static inline enum ieee80211_band phy_mode_to_band(u32 phy_mode)
21932193
case MODE_11AC_VHT20:
21942194
case MODE_11AC_VHT40:
21952195
case MODE_11AC_VHT80:
2196-
band = IEEE80211_BAND_5GHZ;
2196+
band = NL80211_BAND_5GHZ;
21972197
break;
21982198
case MODE_11G:
21992199
case MODE_11B:
@@ -2204,7 +2204,7 @@ static inline enum ieee80211_band phy_mode_to_band(u32 phy_mode)
22042204
case MODE_11AC_VHT40_2G:
22052205
case MODE_11AC_VHT80_2G:
22062206
default:
2207-
band = IEEE80211_BAND_2GHZ;
2207+
band = NL80211_BAND_2GHZ;
22082208
}
22092209

22102210
return band;

‎drivers/net/wireless/ath/ath10k/mac.c‎

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef)
482482
enum wmi_phy_mode phymode = MODE_UNKNOWN;
483483

484484
switch (chandef->chan->band) {
485-
case IEEE80211_BAND_2GHZ:
485+
case NL80211_BAND_2GHZ:
486486
switch (chandef->width) {
487487
case NL80211_CHAN_WIDTH_20_NOHT:
488488
if (chandef->chan->flags & IEEE80211_CHAN_NO_OFDM)
@@ -505,7 +505,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef)
505505
break;
506506
}
507507
break;
508-
case IEEE80211_BAND_5GHZ:
508+
case NL80211_BAND_5GHZ:
509509
switch (chandef->width) {
510510
case NL80211_CHAN_WIDTH_20_NOHT:
511511
phymode = MODE_11A;
@@ -2055,7 +2055,7 @@ static void ath10k_peer_assoc_h_rates(struct ath10k *ar,
20552055
struct cfg80211_chan_def def;
20562056
const struct ieee80211_supported_band *sband;
20572057
const struct ieee80211_rate *rates;
2058-
enum ieee80211_band band;
2058+
enum nl80211_band band;
20592059
u32 ratemask;
20602060
u8 rate;
20612061
int i;
@@ -2115,7 +2115,7 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar,
21152115
const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
21162116
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
21172117
struct cfg80211_chan_def def;
2118-
enum ieee80211_band band;
2118+
enum nl80211_band band;
21192119
const u8 *ht_mcs_mask;
21202120
const u16 *vht_mcs_mask;
21212121
int i, n;
@@ -2339,7 +2339,7 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar,
23392339
const struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
23402340
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
23412341
struct cfg80211_chan_def def;
2342-
enum ieee80211_band band;
2342+
enum nl80211_band band;
23432343
const u16 *vht_mcs_mask;
23442344
u8 ampdu_factor;
23452345

@@ -2357,7 +2357,7 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar,
23572357

23582358
arg->peer_flags |= ar->wmi.peer_flags->vht;
23592359

2360-
if (def.chan->band == IEEE80211_BAND_2GHZ)
2360+
if (def.chan->band == NL80211_BAND_2GHZ)
23612361
arg->peer_flags |= ar->wmi.peer_flags->vht_2g;
23622362

23632363
arg->peer_vht_caps = vht_cap->cap;
@@ -2426,7 +2426,7 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
24262426

24272427
static bool ath10k_mac_sta_has_ofdm_only(struct ieee80211_sta *sta)
24282428
{
2429-
return sta->supp_rates[IEEE80211_BAND_2GHZ] >>
2429+
return sta->supp_rates[NL80211_BAND_2GHZ] >>
24302430
ATH10K_MAC_FIRST_OFDM_RATE_IDX;
24312431
}
24322432

@@ -2437,7 +2437,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
24372437
{
24382438
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
24392439
struct cfg80211_chan_def def;
2440-
enum ieee80211_band band;
2440+
enum nl80211_band band;
24412441
const u8 *ht_mcs_mask;
24422442
const u16 *vht_mcs_mask;
24432443
enum wmi_phy_mode phymode = MODE_UNKNOWN;
@@ -2450,7 +2450,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
24502450
vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs;
24512451

24522452
switch (band) {
2453-
case IEEE80211_BAND_2GHZ:
2453+
case NL80211_BAND_2GHZ:
24542454
if (sta->vht_cap.vht_supported &&
24552455
!ath10k_peer_assoc_h_vht_masked(vht_mcs_mask)) {
24562456
if (sta->bandwidth == IEEE80211_STA_RX_BW_40)
@@ -2470,7 +2470,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
24702470
}
24712471

24722472
break;
2473-
case IEEE80211_BAND_5GHZ:
2473+
case NL80211_BAND_5GHZ:
24742474
/*
24752475
* Check VHT first.
24762476
*/
@@ -2848,7 +2848,7 @@ static int ath10k_update_channel_list(struct ath10k *ar)
28482848
{
28492849
struct ieee80211_hw *hw = ar->hw;
28502850
struct ieee80211_supported_band **bands;
2851-
enum ieee80211_band band;
2851+
enum nl80211_band band;
28522852
struct ieee80211_channel *channel;
28532853
struct wmi_scan_chan_list_arg arg = {0};
28542854
struct wmi_channel_arg *ch;
@@ -2860,7 +2860,7 @@ static int ath10k_update_channel_list(struct ath10k *ar)
28602860
lockdep_assert_held(&ar->conf_mutex);
28612861

28622862
bands = hw->wiphy->bands;
2863-
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
2863+
for (band = 0; band < NUM_NL80211_BANDS; band++) {
28642864
if (!bands[band])
28652865
continue;
28662866

@@ -2879,7 +2879,7 @@ static int ath10k_update_channel_list(struct ath10k *ar)
28792879
return -ENOMEM;
28802880

28812881
ch = arg.channels;
2882-
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
2882+
for (band = 0; band < NUM_NL80211_BANDS; band++) {
28832883
if (!bands[band])
28842884
continue;
28852885

@@ -2917,7 +2917,7 @@ static int ath10k_update_channel_list(struct ath10k *ar)
29172917
/* FIXME: why use only legacy modes, why not any
29182918
* HT/VHT modes? Would that even make any
29192919
* difference? */
2920-
if (channel->band == IEEE80211_BAND_2GHZ)
2920+
if (channel->band == NL80211_BAND_2GHZ)
29212921
ch->mode = MODE_11G;
29222922
else
29232923
ch->mode = MODE_11A;
@@ -4254,14 +4254,14 @@ static void ath10k_mac_setup_ht_vht_cap(struct ath10k *ar)
42544254
vht_cap = ath10k_create_vht_cap(ar);
42554255

42564256
if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) {
4257-
band = &ar->mac.sbands[IEEE80211_BAND_2GHZ];
4257+
band = &ar->mac.sbands[NL80211_BAND_2GHZ];
42584258
band->ht_cap = ht_cap;
42594259

42604260
/* Enable the VHT support at 2.4 GHz */
42614261
band->vht_cap = vht_cap;
42624262
}
42634263
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
4264-
band = &ar->mac.sbands[IEEE80211_BAND_5GHZ];
4264+
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
42654265
band->ht_cap = ht_cap;
42664266
band->vht_cap = vht_cap;
42674267
}
@@ -5595,7 +5595,7 @@ static void ath10k_sta_rc_update_wk(struct work_struct *wk)
55955595
struct ath10k_sta *arsta;
55965596
struct ieee80211_sta *sta;
55975597
struct cfg80211_chan_def def;
5598-
enum ieee80211_band band;
5598+
enum nl80211_band band;
55995599
const u8 *ht_mcs_mask;
56005600
const u16 *vht_mcs_mask;
56015601
u32 changed, bw, nss, smps;
@@ -6394,14 +6394,14 @@ static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,
63946394

63956395
mutex_lock(&ar->conf_mutex);
63966396

6397-
sband = hw->wiphy->bands[IEEE80211_BAND_2GHZ];
6397+
sband = hw->wiphy->bands[NL80211_BAND_2GHZ];
63986398
if (sband && idx >= sband->n_channels) {
63996399
idx -= sband->n_channels;
64006400
sband = NULL;
64016401
}
64026402

64036403
if (!sband)
6404-
sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ];
6404+
sband = hw->wiphy->bands[NL80211_BAND_5GHZ];
64056405

64066406
if (!sband || idx >= sband->n_channels) {
64076407
ret = -ENOENT;
@@ -6424,7 +6424,7 @@ static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,
64246424

64256425
static bool
64266426
ath10k_mac_bitrate_mask_has_single_rate(struct ath10k *ar,
6427-
enum ieee80211_band band,
6427+
enum nl80211_band band,
64286428
const struct cfg80211_bitrate_mask *mask)
64296429
{
64306430
int num_rates = 0;
@@ -6443,7 +6443,7 @@ ath10k_mac_bitrate_mask_has_single_rate(struct ath10k *ar,
64436443

64446444
static bool
64456445
ath10k_mac_bitrate_mask_get_single_nss(struct ath10k *ar,
6446-
enum ieee80211_band band,
6446+
enum nl80211_band band,
64476447
const struct cfg80211_bitrate_mask *mask,
64486448
int *nss)
64496449
{
@@ -6492,7 +6492,7 @@ ath10k_mac_bitrate_mask_get_single_nss(struct ath10k *ar,
64926492

64936493
static int
64946494
ath10k_mac_bitrate_mask_get_single_rate(struct ath10k *ar,
6495-
enum ieee80211_band band,
6495+
enum nl80211_band band,
64966496
const struct cfg80211_bitrate_mask *mask,
64976497
u8 *rate, u8 *nss)
64986498
{
@@ -6593,7 +6593,7 @@ static int ath10k_mac_set_fixed_rate_params(struct ath10k_vif *arvif,
65936593

65946594
static bool
65956595
ath10k_mac_can_set_bitrate_mask(struct ath10k *ar,
6596-
enum ieee80211_band band,
6596+
enum nl80211_band band,
65976597
const struct cfg80211_bitrate_mask *mask)
65986598
{
65996599
int i;
@@ -6645,7 +6645,7 @@ static int ath10k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
66456645
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
66466646
struct cfg80211_chan_def def;
66476647
struct ath10k *ar = arvif->ar;
6648-
enum ieee80211_band band;
6648+
enum nl80211_band band;
66496649
const u8 *ht_mcs_mask;
66506650
const u16 *vht_mcs_mask;
66516651
u8 rate;
@@ -7275,7 +7275,7 @@ static const struct ieee80211_ops ath10k_ops = {
72757275
};
72767276

72777277
#define CHAN2G(_channel, _freq, _flags) { \
7278-
.band = IEEE80211_BAND_2GHZ, \
7278+
.band = NL80211_BAND_2GHZ, \
72797279
.hw_value = (_channel), \
72807280
.center_freq = (_freq), \
72817281
.flags = (_flags), \
@@ -7284,7 +7284,7 @@ static const struct ieee80211_ops ath10k_ops = {
72847284
}
72857285

72867286
#define CHAN5G(_channel, _freq, _flags) { \
7287-
.band = IEEE80211_BAND_5GHZ, \
7287+
.band = NL80211_BAND_5GHZ, \
72887288
.hw_value = (_channel), \
72897289
.center_freq = (_freq), \
72907290
.flags = (_flags), \
@@ -7604,13 +7604,13 @@ int ath10k_mac_register(struct ath10k *ar)
76047604
goto err_free;
76057605
}
76067606

7607-
band = &ar->mac.sbands[IEEE80211_BAND_2GHZ];
7607+
band = &ar->mac.sbands[NL80211_BAND_2GHZ];
76087608
band->n_channels = ARRAY_SIZE(ath10k_2ghz_channels);
76097609
band->channels = channels;
76107610
band->n_bitrates = ath10k_g_rates_size;
76117611
band->bitrates = ath10k_g_rates;
76127612

7613-
ar->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = band;
7613+
ar->hw->wiphy->bands[NL80211_BAND_2GHZ] = band;
76147614
}
76157615

76167616
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
@@ -7622,12 +7622,12 @@ int ath10k_mac_register(struct ath10k *ar)
76227622
goto err_free;
76237623
}
76247624

7625-
band = &ar->mac.sbands[IEEE80211_BAND_5GHZ];
7625+
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
76267626
band->n_channels = ARRAY_SIZE(ath10k_5ghz_channels);
76277627
band->channels = channels;
76287628
band->n_bitrates = ath10k_a_rates_size;
76297629
band->bitrates = ath10k_a_rates;
7630-
ar->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
7630+
ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
76317631
}
76327632

76337633
ath10k_mac_setup_ht_vht_cap(ar);
@@ -7815,8 +7815,8 @@ int ath10k_mac_register(struct ath10k *ar)
78157815
ar->dfs_detector->exit(ar->dfs_detector);
78167816

78177817
err_free:
7818-
kfree(ar->mac.sbands[IEEE80211_BAND_2GHZ].channels);
7819-
kfree(ar->mac.sbands[IEEE80211_BAND_5GHZ].channels);
7818+
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
7819+
kfree(ar->mac.sbands[NL80211_BAND_5GHZ].channels);
78207820

78217821
SET_IEEE80211_DEV(ar->hw, NULL);
78227822
return ret;
@@ -7829,8 +7829,8 @@ void ath10k_mac_unregister(struct ath10k *ar)
78297829
if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
78307830
ar->dfs_detector->exit(ar->dfs_detector);
78317831

7832-
kfree(ar->mac.sbands[IEEE80211_BAND_2GHZ].channels);
7833-
kfree(ar->mac.sbands[IEEE80211_BAND_5GHZ].channels);
7832+
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
7833+
kfree(ar->mac.sbands[NL80211_BAND_5GHZ].channels);
78347834

78357835
SET_IEEE80211_DEV(ar->hw, NULL);
78367836
}

0 commit comments

Comments
 (0)