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>
This commit is contained in:
@@ -76,14 +76,14 @@ struct p54_channel_entry {
|
||||
u16 data;
|
||||
int index;
|
||||
int max_power;
|
||||
enum ieee80211_band band;
|
||||
enum nl80211_band band;
|
||||
};
|
||||
|
||||
struct p54_channel_list {
|
||||
struct p54_channel_entry *channels;
|
||||
size_t entries;
|
||||
size_t max_entries;
|
||||
size_t band_channel_num[IEEE80211_NUM_BANDS];
|
||||
size_t band_channel_num[NUM_NL80211_BANDS];
|
||||
};
|
||||
|
||||
static int p54_get_band_from_freq(u16 freq)
|
||||
@@ -91,10 +91,10 @@ static int p54_get_band_from_freq(u16 freq)
|
||||
/* FIXME: sync these values with the 802.11 spec */
|
||||
|
||||
if ((freq >= 2412) && (freq <= 2484))
|
||||
return IEEE80211_BAND_2GHZ;
|
||||
return NL80211_BAND_2GHZ;
|
||||
|
||||
if ((freq >= 4920) && (freq <= 5825))
|
||||
return IEEE80211_BAND_5GHZ;
|
||||
return NL80211_BAND_5GHZ;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -124,16 +124,16 @@ static int p54_compare_rssichan(const void *_a,
|
||||
|
||||
static int p54_fill_band_bitrates(struct ieee80211_hw *dev,
|
||||
struct ieee80211_supported_band *band_entry,
|
||||
enum ieee80211_band band)
|
||||
enum nl80211_band band)
|
||||
{
|
||||
/* TODO: generate rate array dynamically */
|
||||
|
||||
switch (band) {
|
||||
case IEEE80211_BAND_2GHZ:
|
||||
case NL80211_BAND_2GHZ:
|
||||
band_entry->bitrates = p54_bgrates;
|
||||
band_entry->n_bitrates = ARRAY_SIZE(p54_bgrates);
|
||||
break;
|
||||
case IEEE80211_BAND_5GHZ:
|
||||
case NL80211_BAND_5GHZ:
|
||||
band_entry->bitrates = p54_arates;
|
||||
band_entry->n_bitrates = ARRAY_SIZE(p54_arates);
|
||||
break;
|
||||
@@ -147,7 +147,7 @@ static int p54_fill_band_bitrates(struct ieee80211_hw *dev,
|
||||
static int p54_generate_band(struct ieee80211_hw *dev,
|
||||
struct p54_channel_list *list,
|
||||
unsigned int *chan_num,
|
||||
enum ieee80211_band band)
|
||||
enum nl80211_band band)
|
||||
{
|
||||
struct p54_common *priv = dev->priv;
|
||||
struct ieee80211_supported_band *tmp, *old;
|
||||
@@ -206,7 +206,7 @@ static int p54_generate_band(struct ieee80211_hw *dev,
|
||||
|
||||
if (j == 0) {
|
||||
wiphy_err(dev->wiphy, "Disabling totally damaged %d GHz band\n",
|
||||
(band == IEEE80211_BAND_2GHZ) ? 2 : 5);
|
||||
(band == NL80211_BAND_2GHZ) ? 2 : 5);
|
||||
|
||||
ret = -ENODATA;
|
||||
goto err_out;
|
||||
@@ -396,7 +396,7 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
|
||||
p54_compare_channels, NULL);
|
||||
|
||||
k = 0;
|
||||
for (i = 0, j = 0; i < IEEE80211_NUM_BANDS; i++) {
|
||||
for (i = 0, j = 0; i < NUM_NL80211_BANDS; i++) {
|
||||
if (p54_generate_band(dev, list, &k, i) == 0)
|
||||
j++;
|
||||
}
|
||||
@@ -573,10 +573,10 @@ static int p54_parse_rssical(struct ieee80211_hw *dev,
|
||||
for (i = 0; i < entries; i++) {
|
||||
u16 freq = 0;
|
||||
switch (i) {
|
||||
case IEEE80211_BAND_2GHZ:
|
||||
case NL80211_BAND_2GHZ:
|
||||
freq = 2437;
|
||||
break;
|
||||
case IEEE80211_BAND_5GHZ:
|
||||
case NL80211_BAND_5GHZ:
|
||||
freq = 5240;
|
||||
break;
|
||||
}
|
||||
@@ -902,11 +902,11 @@ good_eeprom:
|
||||
if (priv->rxhw == PDR_SYNTH_FRONTEND_XBOW)
|
||||
p54_init_xbow_synth(priv);
|
||||
if (!(synth & PDR_SYNTH_24_GHZ_DISABLED))
|
||||
dev->wiphy->bands[IEEE80211_BAND_2GHZ] =
|
||||
priv->band_table[IEEE80211_BAND_2GHZ];
|
||||
dev->wiphy->bands[NL80211_BAND_2GHZ] =
|
||||
priv->band_table[NL80211_BAND_2GHZ];
|
||||
if (!(synth & PDR_SYNTH_5_GHZ_DISABLED))
|
||||
dev->wiphy->bands[IEEE80211_BAND_5GHZ] =
|
||||
priv->band_table[IEEE80211_BAND_5GHZ];
|
||||
dev->wiphy->bands[NL80211_BAND_5GHZ] =
|
||||
priv->band_table[NL80211_BAND_5GHZ];
|
||||
if ((synth & PDR_SYNTH_RX_DIV_MASK) == PDR_SYNTH_RX_DIV_SUPPORTED)
|
||||
priv->rx_diversity_mask = 3;
|
||||
if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED)
|
||||
|
Fai riferimento in un nuovo problema
Block a user