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:
@@ -1277,7 +1277,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
||||
struct nlattr *nl_bands, *nl_band;
|
||||
struct nlattr *nl_freqs, *nl_freq;
|
||||
struct nlattr *nl_cmds;
|
||||
enum ieee80211_band band;
|
||||
enum nl80211_band band;
|
||||
struct ieee80211_channel *chan;
|
||||
int i;
|
||||
const struct ieee80211_txrx_stypes *mgmt_stypes =
|
||||
@@ -1410,7 +1410,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
||||
goto nla_put_failure;
|
||||
|
||||
for (band = state->band_start;
|
||||
band < IEEE80211_NUM_BANDS; band++) {
|
||||
band < NUM_NL80211_BANDS; band++) {
|
||||
struct ieee80211_supported_band *sband;
|
||||
|
||||
sband = rdev->wiphy.bands[band];
|
||||
@@ -1472,7 +1472,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
||||
}
|
||||
nla_nest_end(msg, nl_bands);
|
||||
|
||||
if (band < IEEE80211_NUM_BANDS)
|
||||
if (band < NUM_NL80211_BANDS)
|
||||
state->band_start = band + 1;
|
||||
else
|
||||
state->band_start = 0;
|
||||
@@ -3493,7 +3493,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
|
||||
}
|
||||
|
||||
params.pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]);
|
||||
if (params.pbss && !rdev->wiphy.bands[IEEE80211_BAND_60GHZ])
|
||||
if (params.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ])
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
wdev_lock(wdev);
|
||||
@@ -5821,9 +5821,9 @@ static int validate_scan_freqs(struct nlattr *freqs)
|
||||
return n_channels;
|
||||
}
|
||||
|
||||
static bool is_band_valid(struct wiphy *wiphy, enum ieee80211_band b)
|
||||
static bool is_band_valid(struct wiphy *wiphy, enum nl80211_band b)
|
||||
{
|
||||
return b < IEEE80211_NUM_BANDS && wiphy->bands[b];
|
||||
return b < NUM_NL80211_BANDS && wiphy->bands[b];
|
||||
}
|
||||
|
||||
static int parse_bss_select(struct nlattr *nla, struct wiphy *wiphy,
|
||||
@@ -6018,10 +6018,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
enum ieee80211_band band;
|
||||
enum nl80211_band band;
|
||||
|
||||
/* all channels */
|
||||
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
int j;
|
||||
if (!wiphy->bands[band])
|
||||
continue;
|
||||
@@ -6066,7 +6066,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
|
||||
request->ie_len);
|
||||
}
|
||||
|
||||
for (i = 0; i < IEEE80211_NUM_BANDS; i++)
|
||||
for (i = 0; i < NUM_NL80211_BANDS; i++)
|
||||
if (wiphy->bands[i])
|
||||
request->rates[i] =
|
||||
(1 << wiphy->bands[i]->n_bitrates) - 1;
|
||||
@@ -6075,9 +6075,9 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
|
||||
nla_for_each_nested(attr,
|
||||
info->attrs[NL80211_ATTR_SCAN_SUPP_RATES],
|
||||
tmp) {
|
||||
enum ieee80211_band band = nla_type(attr);
|
||||
enum nl80211_band band = nla_type(attr);
|
||||
|
||||
if (band < 0 || band >= IEEE80211_NUM_BANDS) {
|
||||
if (band < 0 || band >= NUM_NL80211_BANDS) {
|
||||
err = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
@@ -6265,7 +6265,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
struct cfg80211_sched_scan_request *request;
|
||||
struct nlattr *attr;
|
||||
int err, tmp, n_ssids = 0, n_match_sets = 0, n_channels, i, n_plans = 0;
|
||||
enum ieee80211_band band;
|
||||
enum nl80211_band band;
|
||||
size_t ie_len;
|
||||
struct nlattr *tb[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1];
|
||||
s32 default_match_rssi = NL80211_SCAN_RSSI_THOLD_OFF;
|
||||
@@ -6430,7 +6430,7 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
}
|
||||
} else {
|
||||
/* all channels */
|
||||
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
int j;
|
||||
if (!wiphy->bands[band])
|
||||
continue;
|
||||
@@ -7538,14 +7538,14 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
static bool
|
||||
nl80211_parse_mcast_rate(struct cfg80211_registered_device *rdev,
|
||||
int mcast_rate[IEEE80211_NUM_BANDS],
|
||||
int mcast_rate[NUM_NL80211_BANDS],
|
||||
int rateval)
|
||||
{
|
||||
struct wiphy *wiphy = &rdev->wiphy;
|
||||
bool found = false;
|
||||
int band, i;
|
||||
|
||||
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
|
||||
for (band = 0; band < NUM_NL80211_BANDS; band++) {
|
||||
struct ieee80211_supported_band *sband;
|
||||
|
||||
sband = wiphy->bands[band];
|
||||
@@ -7725,7 +7725,7 @@ static int nl80211_set_mcast_rate(struct sk_buff *skb, struct genl_info *info)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||
struct net_device *dev = info->user_ptr[1];
|
||||
int mcast_rate[IEEE80211_NUM_BANDS];
|
||||
int mcast_rate[NUM_NL80211_BANDS];
|
||||
u32 nla_rate;
|
||||
int err;
|
||||
|
||||
@@ -8130,7 +8130,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
|
||||
}
|
||||
|
||||
connect.pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]);
|
||||
if (connect.pbss && !rdev->wiphy.bands[IEEE80211_BAND_60GHZ]) {
|
||||
if (connect.pbss && !rdev->wiphy.bands[NL80211_BAND_60GHZ]) {
|
||||
kzfree(connkeys);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
@@ -8550,7 +8550,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
|
||||
|
||||
memset(&mask, 0, sizeof(mask));
|
||||
/* Default to all rates enabled */
|
||||
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
|
||||
for (i = 0; i < NUM_NL80211_BANDS; i++) {
|
||||
sband = rdev->wiphy.bands[i];
|
||||
|
||||
if (!sband)
|
||||
@@ -8574,14 +8574,14 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
|
||||
|
||||
/*
|
||||
* The nested attribute uses enum nl80211_band as the index. This maps
|
||||
* directly to the enum ieee80211_band values used in cfg80211.
|
||||
* directly to the enum nl80211_band values used in cfg80211.
|
||||
*/
|
||||
BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
|
||||
nla_for_each_nested(tx_rates, info->attrs[NL80211_ATTR_TX_RATES], rem) {
|
||||
enum ieee80211_band band = nla_type(tx_rates);
|
||||
enum nl80211_band band = nla_type(tx_rates);
|
||||
int err;
|
||||
|
||||
if (band < 0 || band >= IEEE80211_NUM_BANDS)
|
||||
if (band < 0 || band >= NUM_NL80211_BANDS)
|
||||
return -EINVAL;
|
||||
sband = rdev->wiphy.bands[band];
|
||||
if (sband == NULL)
|
||||
@@ -10746,7 +10746,7 @@ static int nl80211_tdls_channel_switch(struct sk_buff *skb,
|
||||
* section 10.22.6.2.1. Disallow 5/10Mhz channels as well for now, the
|
||||
* specification is not defined for them.
|
||||
*/
|
||||
if (chandef.chan->band == IEEE80211_BAND_2GHZ &&
|
||||
if (chandef.chan->band == NL80211_BAND_2GHZ &&
|
||||
chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
|
||||
chandef.width != NL80211_CHAN_WIDTH_20)
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user