* [PATCH v2 0/5] wireless: listen to reg bw preferences
@ 2009-04-06 20:15 Luis R. Rodriguez
2009-04-06 20:15 ` [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
This new series addresses Johannes comments. Gabor -- didn't have
time to rename variables in iwl for fat-->ht40, feel free to take a stab.
Luis R. Rodriguez (5):
cfg80211: Process regulatory max bandwidth checks for HT40
wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+
mac80211: check if HT40+/- is allowed before sending assoc
cfg80211: check allowed channel type upon userspace requests
mac80211: expose HT channel flags through debugfs
drivers/net/wireless/ath/regd.c | 10 +-
drivers/net/wireless/iwlwifi/iwl-core.c | 4 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 8 +-
include/net/wireless.h | 22 ++-
net/mac80211/debugfs.c | 10 ++
net/mac80211/ht.c | 8 +-
net/mac80211/ieee80211_i.h | 2 +
net/mac80211/mlme.c | 4 +-
net/wireless/nl80211.c | 47 ++++---
net/wireless/reg.c | 200 +++++++++++++++++++++++------
10 files changed, 230 insertions(+), 85 deletions(-)
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez @ 2009-04-06 20:15 ` Luis R. Rodriguez 2009-04-07 10:08 ` Johannes Berg 2009-04-06 20:15 ` [PATCH v2 2/5] wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+ Luis R. Rodriguez ` (3 subsequent siblings) 4 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw) To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez We are not correctly listening to the regulatory max bandwidth settings. To actually make use of it we need to redesign things a bit. This patch does the work for that. We do this to so we can obey to regulatory rules accordingly for use of HT40. We end up dealing with HT40 by having two passes for each channel. The first check will see if a 20 MHz channel fits into the channel's center freq on a given frequency range. We check for a 20 MHz banwidth channel as that is the maximum an individual channel will use, at least for now. The first pass will go ahead and check if the regulatory rule for that given center of frequency allows 40 MHz bandwidths and we use this to determine whether or not the channel supports HT40 or not. So to support HT40 you'll need at a regulatory rule that allows you to use 40 MHz channels but you're channel must also be enabled and support 20 MHz by itself. The second pass is done after we do the regulatory checks over an device's supported channel list. On each channel we'll check if the control channel and the extension both: o exist o are enabled o regulatory allows 40 MHz bandwidth on its frequency range This work allows allows us to idependently check for HT40- and HT40+. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> --- drivers/net/wireless/ath/regd.c | 10 +- include/net/wireless.h | 14 ++- net/wireless/reg.c | 200 ++++++++++++++++++++++++++++++-------- 3 files changed, 174 insertions(+), 50 deletions(-) diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index 4b5c851..a90c7cf 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c @@ -201,8 +201,10 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy, continue; if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { - r = freq_reg_info(wiphy, ch->center_freq, - &bandwidth, ®_rule); + r = freq_reg_info(wiphy, + ch->center_freq, + bandwidth, + ®_rule); if (r) continue; /* @@ -266,7 +268,7 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy, */ ch = &sband->channels[11]; /* CH 12 */ - r = freq_reg_info(wiphy, ch->center_freq, &bandwidth, ®_rule); + r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule); if (!r) { if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) @@ -274,7 +276,7 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy, } ch = &sband->channels[12]; /* CH 13 */ - r = freq_reg_info(wiphy, ch->center_freq, &bandwidth, ®_rule); + r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule); if (!r) { if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) diff --git a/include/net/wireless.h b/include/net/wireless.h index 64a7620..5211f5d 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h @@ -54,6 +54,9 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_NO_FAT_BELOW = 1<<5, }; +#define IEEE80211_CHAN_NO_HT40 \ + (IEEE80211_CHAN_NO_FAT_ABOVE | IEEE80211_CHAN_NO_FAT_BELOW) + /** * struct ieee80211_channel - channel definition * @@ -449,9 +452,10 @@ extern void wiphy_apply_custom_regulatory( * freq_reg_info - get regulatory information for the given frequency * @wiphy: the wiphy for which we want to process this rule for * @center_freq: Frequency in KHz for which we want regulatory information for - * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one - * you can set this to 0. If this frequency is allowed we then set - * this value to the maximum allowed bandwidth. + * @desired_bw_khz: the desired max bandwidth you want to use per + * channel. Note that this is still 20 MHz if you want to use HT40 + * as HT40 makes use of two channels for its 40 MHz width bandwidth. + * If set to 0 we'll assume you want the standard 20 MHz. * @reg_rule: the regulatory rule which we have for this frequency * * Use this function to get the regulatory rule for a specific frequency on @@ -466,7 +470,9 @@ extern void wiphy_apply_custom_regulatory( * freq_in_rule_band() for our current definition of a band -- this is purely * subjective and right now its 802.11 specific. */ -extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, +extern int freq_reg_info(struct wiphy *wiphy, + u32 center_freq, + u32 desired_bw_khz, const struct ieee80211_reg_rule **reg_rule); #endif /* __NET_WIRELESS_H */ diff --git a/net/wireless/reg.c b/net/wireless/reg.c index a3ed913..b5810a0 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -49,12 +49,6 @@ static struct regulatory_request *last_request; /* To trigger userspace events */ static struct platform_device *reg_pdev; -/* Keep the ordering from large to small */ -static u32 supported_bandwidths[] = { - MHZ_TO_KHZ(40), - MHZ_TO_KHZ(20), -}; - /* * Central wireless core regulatory domains, we only need two, * the current one and a world regulatory domain in case we have no @@ -436,19 +430,20 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd) return true; } -/* Returns value in KHz */ -static u32 freq_max_bandwidth(const struct ieee80211_freq_range *freq_range, - u32 freq) +static bool reg_does_bw_fit(const struct ieee80211_freq_range *freq_range, + u32 center_freq_khz, + u32 bw_khz) { - unsigned int i; - for (i = 0; i < ARRAY_SIZE(supported_bandwidths); i++) { - u32 start_freq_khz = freq - supported_bandwidths[i]/2; - u32 end_freq_khz = freq + supported_bandwidths[i]/2; - if (start_freq_khz >= freq_range->start_freq_khz && - end_freq_khz <= freq_range->end_freq_khz) - return supported_bandwidths[i]; - } - return 0; + u32 start_freq_khz, end_freq_khz; + + start_freq_khz = center_freq_khz - (bw_khz/2); + end_freq_khz = center_freq_khz + (bw_khz/2); + + if (start_freq_khz >= freq_range->start_freq_khz && + end_freq_khz <= freq_range->end_freq_khz) + return true; + + return false; } /** @@ -848,14 +843,17 @@ static u32 map_regdom_flags(u32 rd_flags) static int freq_reg_info_regd(struct wiphy *wiphy, u32 center_freq, - u32 *bandwidth, + u32 desired_bw_khz, const struct ieee80211_reg_rule **reg_rule, const struct ieee80211_regdomain *custom_regd) { int i; bool band_rule_found = false; const struct ieee80211_regdomain *regd; - u32 max_bandwidth = 0; + bool bw_fits = false; + + if (!desired_bw_khz) + desired_bw_khz = MHZ_TO_KHZ(20); regd = custom_regd ? custom_regd : cfg80211_regdomain; @@ -888,37 +886,53 @@ static int freq_reg_info_regd(struct wiphy *wiphy, if (!band_rule_found) band_rule_found = freq_in_rule_band(fr, center_freq); - max_bandwidth = freq_max_bandwidth(fr, center_freq); + bw_fits = reg_does_bw_fit(fr, + center_freq, + desired_bw_khz); - if (max_bandwidth && *bandwidth <= max_bandwidth) { + if (band_rule_found && bw_fits) { *reg_rule = rr; - *bandwidth = max_bandwidth; - break; + return 0; } } if (!band_rule_found) return -ERANGE; - return !max_bandwidth; + return -EINVAL; } EXPORT_SYMBOL(freq_reg_info); -int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, - const struct ieee80211_reg_rule **reg_rule) +int freq_reg_info(struct wiphy *wiphy, + u32 center_freq, + u32 desired_bw_khz, + const struct ieee80211_reg_rule **reg_rule) { - return freq_reg_info_regd(wiphy, center_freq, - bandwidth, reg_rule, NULL); + return freq_reg_info_regd(wiphy, + center_freq, + desired_bw_khz, + reg_rule, + NULL); } +/* + * Note that right now we assume the desired channel bandwidth + * is always 20 MHz for each individual channel (HT40 uses 20 MHz + * per channel, the primary and the extension channel). To support + * smaller custom bandwidths such as 5 MHz or 10 MHz we'll need a + * new ieee80211_channel.target_bw and re run the regulatory check + * on the wiphy with the target_bw specified. Then we can simply use + * that below for the desired_bw_khz below. + */ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, unsigned int chan_idx) { int r; - u32 flags; - u32 max_bandwidth = 0; + u32 flags, bw_flags = 0; + u32 desired_bw_khz = MHZ_TO_KHZ(20); const struct ieee80211_reg_rule *reg_rule = NULL; const struct ieee80211_power_rule *power_rule = NULL; + const struct ieee80211_freq_range *freq_range = NULL; struct ieee80211_supported_band *sband; struct ieee80211_channel *chan; struct wiphy *request_wiphy = NULL; @@ -933,8 +947,10 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, flags = chan->orig_flags; - r = freq_reg_info(wiphy, MHZ_TO_KHZ(chan->center_freq), - &max_bandwidth, ®_rule); + r = freq_reg_info(wiphy, + MHZ_TO_KHZ(chan->center_freq), + desired_bw_khz, + ®_rule); if (r) { /* @@ -977,6 +993,10 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, } power_rule = ®_rule->power_rule; + freq_range = ®_rule->freq_range; + + if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) + bw_flags = IEEE80211_CHAN_NO_HT40; if (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && request_wiphy && request_wiphy == wiphy && @@ -987,19 +1007,19 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, * settings */ chan->flags = chan->orig_flags = - map_regdom_flags(reg_rule->flags); + map_regdom_flags(reg_rule->flags) | bw_flags; chan->max_antenna_gain = chan->orig_mag = (int) MBI_TO_DBI(power_rule->max_antenna_gain); - chan->max_bandwidth = KHZ_TO_MHZ(max_bandwidth); + chan->max_bandwidth = KHZ_TO_MHZ(desired_bw_khz); chan->max_power = chan->orig_mpwr = (int) MBM_TO_DBM(power_rule->max_eirp); return; } - chan->flags = flags | map_regdom_flags(reg_rule->flags); + chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags); chan->max_antenna_gain = min(chan->orig_mag, (int) MBI_TO_DBI(power_rule->max_antenna_gain)); - chan->max_bandwidth = KHZ_TO_MHZ(max_bandwidth); + chan->max_bandwidth = KHZ_TO_MHZ(desired_bw_khz); if (chan->orig_mpwr) chan->max_power = min(chan->orig_mpwr, (int) MBM_TO_DBM(power_rule->max_eirp)); @@ -1149,6 +1169,92 @@ static void reg_process_beacons(struct wiphy *wiphy) wiphy_update_beacon_reg(wiphy); } +static bool is_ht40_not_allowed(struct ieee80211_channel *chan) +{ + if (!chan) + return true; + if (chan->flags & IEEE80211_CHAN_DISABLED) + return true; + /* This would happen when regulatory rules disallow HT40 completely */ + if (IEEE80211_CHAN_NO_HT40 == (chan->flags & (IEEE80211_CHAN_NO_HT40))) + return true; + return false; +} + +static void reg_process_ht_flags_channel(struct wiphy *wiphy, + enum ieee80211_band band, + unsigned int chan_idx) +{ + struct ieee80211_supported_band *sband; + struct ieee80211_channel *channel, *channel_before, *channel_after; + unsigned int i; + + assert_cfg80211_lock(); + + sband = wiphy->bands[band]; + BUG_ON(chan_idx >= sband->n_channels); + channel = &sband->channels[chan_idx]; + + if (is_ht40_not_allowed(channel)) { + channel->flags |= IEEE80211_CHAN_NO_HT40; + return; + } + + /* + * We need to ensure the extension channels exist to + * be able to use HT40- or HT40+, this finds them (or not) + */ + for (i = 0; i < sband->n_channels; i++) { + struct ieee80211_channel *c = &sband->channels[i]; + if (c->center_freq == (channel->center_freq - 20)) + channel_before = c; + if (c->center_freq == (channel->center_freq + 20)) + channel_after = c; + } + + /* + * Please note that this assumes target bandwidth is 20 MHz, + * if that ever changes we also need to change the below logic + * to include that as well. + */ + if (is_ht40_not_allowed(channel_before)) + channel->flags |= IEEE80211_CHAN_NO_FAT_BELOW; + else + channel->flags &= ~IEEE80211_CHAN_NO_FAT_BELOW; + + if (is_ht40_not_allowed(channel_after)) + channel->flags |= IEEE80211_CHAN_NO_FAT_ABOVE; + else + channel->flags &= ~IEEE80211_CHAN_NO_FAT_ABOVE; +} + +static void reg_process_ht_flags_band(struct wiphy *wiphy, + enum ieee80211_band band) +{ + unsigned int i; + struct ieee80211_supported_band *sband; + + BUG_ON(!wiphy->bands[band]); + sband = wiphy->bands[band]; + + for (i = 0; i < sband->n_channels; i++) + reg_process_ht_flags_channel(wiphy, band, i); +} + +static void reg_process_ht_flags(struct wiphy *wiphy) +{ + enum ieee80211_band band; + + if (!wiphy) + return; + + for (band = 0; band < IEEE80211_NUM_BANDS; band++) { + if (wiphy->bands[band]) + reg_process_ht_flags_band(wiphy, band); + } + +} + void wiphy_update_regulatory(struct wiphy *wiphy, enum nl80211_reg_initiator initiator) { @@ -1162,6 +1268,7 @@ void wiphy_update_regulatory(struct wiphy *wiphy, } out: reg_process_beacons(wiphy); + reg_process_ht_flags(wiphy); if (wiphy->reg_notifier) wiphy->reg_notifier(wiphy, last_request); } @@ -1172,9 +1279,11 @@ static void handle_channel_custom(struct wiphy *wiphy, const struct ieee80211_regdomain *regd) { int r; - u32 max_bandwidth = 0; + u32 desired_bw_khz = MHZ_TO_KHZ(20); + u32 bw_flags = 0; const struct ieee80211_reg_rule *reg_rule = NULL; const struct ieee80211_power_rule *power_rule = NULL; + const struct ieee80211_freq_range *freq_range = NULL; struct ieee80211_supported_band *sband; struct ieee80211_channel *chan; @@ -1182,8 +1291,11 @@ static void handle_channel_custom(struct wiphy *wiphy, BUG_ON(chan_idx >= sband->n_channels); chan = &sband->channels[chan_idx]; - r = freq_reg_info_regd(wiphy, MHZ_TO_KHZ(chan->center_freq), - &max_bandwidth, ®_rule, regd); + r = freq_reg_info_regd(wiphy, + MHZ_TO_KHZ(chan->center_freq), + desired_bw_khz, + ®_rule, + regd); if (r) { chan->flags = IEEE80211_CHAN_DISABLED; @@ -1191,10 +1303,14 @@ static void handle_channel_custom(struct wiphy *wiphy, } power_rule = ®_rule->power_rule; + freq_range = ®_rule->freq_range; + + if (freq_range->max_bandwidth_khz < MHZ_TO_KHZ(40)) + bw_flags = IEEE80211_CHAN_NO_HT40; - chan->flags |= map_regdom_flags(reg_rule->flags); + chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags; chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain); - chan->max_bandwidth = KHZ_TO_MHZ(max_bandwidth); + chan->max_bandwidth = KHZ_TO_MHZ(desired_bw_khz); chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp); } -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 2009-04-06 20:15 ` [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez @ 2009-04-07 10:08 ` Johannes Berg 2009-04-07 16:10 ` Luis R. Rodriguez 0 siblings, 1 reply; 17+ messages in thread From: Johannes Berg @ 2009-04-07 10:08 UTC (permalink / raw) To: Luis R. Rodriguez; +Cc: linville, linux-wireless [-- Attachment #1: Type: text/plain, Size: 612 bytes --] On Mon, 2009-04-06 at 16:15 -0400, Luis R. Rodriguez wrote: > +static bool is_ht40_not_allowed(struct ieee80211_channel *chan) I think it would be nicer on the reader to remove the not? > +{ > + if (!chan) > + return true; > + if (chan->flags & IEEE80211_CHAN_DISABLED) > + return true; > + /* This would happen when regulatory rules disallow HT40 completely */ > + if (IEEE80211_CHAN_NO_HT40 == (chan->flags & (IEEE80211_CHAN_NO_HT40))) > + return true; How would that happen at this point? /me stops reading. Ok, whatever, I know I want to rewrite most of this anyway. johannes [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 2009-04-07 10:08 ` Johannes Berg @ 2009-04-07 16:10 ` Luis R. Rodriguez 0 siblings, 0 replies; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-07 16:10 UTC (permalink / raw) To: Johannes Berg Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org On Tue, Apr 07, 2009 at 03:08:45AM -0700, Johannes Berg wrote: > On Mon, 2009-04-06 at 16:15 -0400, Luis R. Rodriguez wrote: > > > +static bool is_ht40_not_allowed(struct ieee80211_channel *chan) > > I think it would be nicer on the reader to remove the not? > > > +{ > > + if (!chan) > > + return true; > > + if (chan->flags & IEEE80211_CHAN_DISABLED) > > + return true; > > + /* This would happen when regulatory rules disallow HT40 completely */ > > + if (IEEE80211_CHAN_NO_HT40 == (chan->flags & (IEEE80211_CHAN_NO_HT40))) > > + return true; > > How would that happen at this point? Due to the regulatory freq rule. > /me stops reading. > > Ok, whatever, I know I want to rewrite most of this anyway. :) ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 2/5] wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+ 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez @ 2009-04-06 20:15 ` Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc Luis R. Rodriguez ` (2 subsequent siblings) 4 siblings, 0 replies; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw) To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez This is more consistent with our nl80211 naming convention for HT40-/+. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> --- drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-eeprom.c | 8 ++++---- include/net/wireless.h | 10 +++++----- net/mac80211/mlme.c | 4 ++-- net/wireless/reg.c | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c54fb93..d558797 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c @@ -591,10 +591,10 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv, if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) return !(ch_info->fat_extension_channel & - IEEE80211_CHAN_NO_FAT_ABOVE); + IEEE80211_CHAN_NO_HT40PLUS); else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) return !(ch_info->fat_extension_channel & - IEEE80211_CHAN_NO_FAT_BELOW); + IEEE80211_CHAN_NO_HT40MINUS); return 0; } diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 75517d0..9d73f19 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c @@ -481,8 +481,8 @@ int iwl_init_channel_map(struct iwl_priv *priv) /* First write that fat is not enabled, and then enable * one by one */ ch_info->fat_extension_channel = - (IEEE80211_CHAN_NO_FAT_ABOVE | - IEEE80211_CHAN_NO_FAT_BELOW); + (IEEE80211_CHAN_NO_HT40PLUS | + IEEE80211_CHAN_NO_HT40MINUS); if (!(is_channel_valid(ch_info))) { IWL_DEBUG_INFO(priv, "Ch. %d Flags %x [%sGHz] - " @@ -561,7 +561,7 @@ int iwl_init_channel_map(struct iwl_priv *priv) fat_extension_chan = 0; else fat_extension_chan = - IEEE80211_CHAN_NO_FAT_BELOW; + IEEE80211_CHAN_NO_HT40MINUS; /* Set up driver's info for lower half */ iwl_set_fat_chan_info(priv, ieeeband, @@ -573,7 +573,7 @@ int iwl_init_channel_map(struct iwl_priv *priv) iwl_set_fat_chan_info(priv, ieeeband, (eeprom_ch_index[ch] + 4), &(eeprom_ch_info[ch]), - IEEE80211_CHAN_NO_FAT_ABOVE); + IEEE80211_CHAN_NO_HT40PLUS); } } diff --git a/include/net/wireless.h b/include/net/wireless.h index 5211f5d..bb0a8f0 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h @@ -40,9 +40,9 @@ enum ieee80211_band { * on this channel. * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. - * @IEEE80211_CHAN_NO_FAT_ABOVE: extension channel above this channel + * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel * is not permitted. - * @IEEE80211_CHAN_NO_FAT_BELOW: extension channel below this channel + * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel * is not permitted. */ enum ieee80211_channel_flags { @@ -50,12 +50,12 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, IEEE80211_CHAN_NO_IBSS = 1<<2, IEEE80211_CHAN_RADAR = 1<<3, - IEEE80211_CHAN_NO_FAT_ABOVE = 1<<4, - IEEE80211_CHAN_NO_FAT_BELOW = 1<<5, + IEEE80211_CHAN_NO_HT40PLUS = 1<<4, + IEEE80211_CHAN_NO_HT40MINUS = 1<<5, }; #define IEEE80211_CHAN_NO_HT40 \ - (IEEE80211_CHAN_NO_FAT_ABOVE | IEEE80211_CHAN_NO_FAT_BELOW) + (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) /** * struct ieee80211_channel - channel definition diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7ecda9d..3670014 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -263,13 +263,13 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: - if (flags & IEEE80211_CHAN_NO_FAT_ABOVE) { + if (flags & IEEE80211_CHAN_NO_HT40PLUS) { cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; cap &= ~IEEE80211_HT_CAP_SGI_40; } break; case IEEE80211_HT_PARAM_CHA_SEC_BELOW: - if (flags & IEEE80211_CHAN_NO_FAT_BELOW) { + if (flags & IEEE80211_CHAN_NO_HT40MINUS) { cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; cap &= ~IEEE80211_HT_CAP_SGI_40; } diff --git a/net/wireless/reg.c b/net/wireless/reg.c index b5810a0..8cf2208 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1218,14 +1218,14 @@ static void reg_process_ht_flags_channel(struct wiphy *wiphy, * to include that as well. */ if (is_ht40_not_allowed(channel_before)) - channel->flags |= IEEE80211_CHAN_NO_FAT_BELOW; + channel->flags |= IEEE80211_CHAN_NO_HT40MINUS; else - channel->flags &= ~IEEE80211_CHAN_NO_FAT_BELOW; + channel->flags &= ~IEEE80211_CHAN_NO_HT40MINUS; if (is_ht40_not_allowed(channel_after)) - channel->flags |= IEEE80211_CHAN_NO_FAT_ABOVE; + channel->flags |= IEEE80211_CHAN_NO_HT40PLUS; else - channel->flags &= ~IEEE80211_CHAN_NO_FAT_ABOVE; + channel->flags &= ~IEEE80211_CHAN_NO_HT40PLUS; } static void reg_process_ht_flags_band(struct wiphy *wiphy, -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 2/5] wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+ Luis R. Rodriguez @ 2009-04-06 20:15 ` Luis R. Rodriguez 2009-04-07 10:11 ` Johannes Berg 2009-04-06 20:15 ` [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 5/5] mac80211: expose HT channel flags through debugfs Luis R. Rodriguez 4 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw) To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez We weren't checking this at all. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> --- net/mac80211/ht.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 4e3c72f..967367c 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -122,10 +122,14 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: - channel_type = NL80211_CHAN_HT40PLUS; + if (!(local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40PLUS)) + channel_type = NL80211_CHAN_HT40PLUS; break; case IEEE80211_HT_PARAM_CHA_SEC_BELOW: - channel_type = NL80211_CHAN_HT40MINUS; + if (!(local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40MINUS)) + channel_type = NL80211_CHAN_HT40MINUS; break; } } -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-06 20:15 ` [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc Luis R. Rodriguez @ 2009-04-07 10:11 ` Johannes Berg 2009-04-07 16:23 ` Luis R. Rodriguez 0 siblings, 1 reply; 17+ messages in thread From: Johannes Berg @ 2009-04-07 10:11 UTC (permalink / raw) To: Luis R. Rodriguez; +Cc: linville, linux-wireless [-- Attachment #1: Type: text/plain, Size: 1034 bytes --] On Mon, 2009-04-06 at 16:15 -0400, Luis R. Rodriguez wrote: > We weren't checking this at all. > > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> > --- > net/mac80211/ht.c | 8 ++++++-- > 1 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c > index 4e3c72f..967367c 100644 > --- a/net/mac80211/ht.c > +++ b/net/mac80211/ht.c > @@ -122,10 +122,14 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, > (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { > switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { > case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: > - channel_type = NL80211_CHAN_HT40PLUS; > + if (!(local->hw.conf.channel->flags & > + IEEE80211_CHAN_NO_HT40PLUS)) > + channel_type = NL80211_CHAN_HT40PLUS; This patch is not sufficient -- you also need to modify ieee80211_send_assoc. Otherwise we end up telling the AP that we support HT40, but tuning the hardware to HT20. johannes [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 10:11 ` Johannes Berg @ 2009-04-07 16:23 ` Luis R. Rodriguez 2009-04-07 19:09 ` Johannes Berg 0 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-07 16:23 UTC (permalink / raw) To: Johannes Berg Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org On Tue, Apr 07, 2009 at 03:11:11AM -0700, Johannes Berg wrote: > On Mon, 2009-04-06 at 16:15 -0400, Luis R. Rodriguez wrote: > > We weren't checking this at all. > > > > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> > > --- > > net/mac80211/ht.c | 8 ++++++-- > > 1 files changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c > > index 4e3c72f..967367c 100644 > > --- a/net/mac80211/ht.c > > +++ b/net/mac80211/ht.c > > @@ -122,10 +122,14 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, > > (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { > > switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { > > case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: > > - channel_type = NL80211_CHAN_HT40PLUS; > > + if (!(local->hw.conf.channel->flags & > > + IEEE80211_CHAN_NO_HT40PLUS)) > > + channel_type = NL80211_CHAN_HT40PLUS; > > This patch is not sufficient -- you also need to modify > ieee80211_send_assoc. Otherwise we end up telling the AP that we support > HT40, but tuning the hardware to HT20. Like this? switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: if (flags & IEEE80211_CHAN_NO_HT40PLUS) { cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; cap &= ~IEEE80211_HT_CAP_SGI_40; } break; case IEEE80211_HT_PARAM_CHA_SEC_BELOW: if (flags & IEEE80211_CHAN_NO_HT40MINUS) { cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; cap &= ~IEEE80211_HT_CAP_SGI_40; } Luis ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 16:23 ` Luis R. Rodriguez @ 2009-04-07 19:09 ` Johannes Berg 2009-04-07 20:38 ` Luis R. Rodriguez 0 siblings, 1 reply; 17+ messages in thread From: Johannes Berg @ 2009-04-07 19:09 UTC (permalink / raw) To: Luis R. Rodriguez Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org On Tue, 2009-04-07 at 09:23 -0700, Luis R. Rodriguez wrote: > > This patch is not sufficient -- you also need to modify > > ieee80211_send_assoc. Otherwise we end up telling the AP that we support > > HT40, but tuning the hardware to HT20. > > Like this? > > switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { > case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: > if (flags & IEEE80211_CHAN_NO_HT40PLUS) { > cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; > cap &= ~IEEE80211_HT_CAP_SGI_40; > } > break; > case IEEE80211_HT_PARAM_CHA_SEC_BELOW: > if (flags & IEEE80211_CHAN_NO_HT40MINUS) { > cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; > cap &= ~IEEE80211_HT_CAP_SGI_40; > } Yeah, that looks ok. johannes ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 19:09 ` Johannes Berg @ 2009-04-07 20:38 ` Luis R. Rodriguez 2009-04-07 20:41 ` Johannes Berg 0 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-07 20:38 UTC (permalink / raw) To: Johannes Berg Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org T24gVHVlLCBBcHIgNywgMjAwOSBhdCAxMjowOSBQTSwgSm9oYW5uZXMgQmVyZwo8am9oYW5uZXNA c2lwc29sdXRpb25zLm5ldD4gd3JvdGU6C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qAgwqAgwqAgwqAgwqAgwqAgwqAgY2FzZSBJRUVFODAyMTFfSFRfUEFSQU1fQ0hBX1NFQ19C RUxPVzoKPj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgaWYgKGZsYWdzICYg SUVFRTgwMjExX0NIQU5fTk9fSFQ0ME1JTlVTKSB7Cj4+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIGNhcCAmPSB+SUVFRTgwMjExX0hUX0NBUF9TVVBfV0lE VEhfMjBfNDA7Cj4+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIGNhcCAmPSB+SUVFRTgwMjExX0hUX0NBUF9TR0lfNDA7Cj4+IMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIH0KPgo+IFllYWgsIHRoYXQgbG9va3Mgb2suCgpUaGF0J3Mgd2hh dCB3YXMgdGhlcmUgb3Igd2hhdCBJIGFkZGVkIGluIG15IHBhdGNoZXMuCgogIEx1aXMK ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 20:38 ` Luis R. Rodriguez @ 2009-04-07 20:41 ` Johannes Berg 2009-04-07 20:44 ` Luis R. Rodriguez 0 siblings, 1 reply; 17+ messages in thread From: Johannes Berg @ 2009-04-07 20:41 UTC (permalink / raw) To: Luis R. Rodriguez Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 999 bytes --] On Tue, 2009-04-07 at 13:38 -0700, Luis R. Rodriguez wrote: > >> switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { > >> case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: > >> if (flags & IEEE80211_CHAN_NO_HT40PLUS) { > >> cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; > >> cap &= ~IEEE80211_HT_CAP_SGI_40; > >> } > >> break; > >> case IEEE80211_HT_PARAM_CHA_SEC_BELOW: > >> if (flags & IEEE80211_CHAN_NO_HT40MINUS) { > >> cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; > >> cap &= ~IEEE80211_HT_CAP_SGI_40; > >> } > > > > Yeah, that looks ok. > > That's what was there or what I added in my patches. Indeed, it's already there. I guess I got confused, sorry for the noise. johannes [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 20:41 ` Johannes Berg @ 2009-04-07 20:44 ` Luis R. Rodriguez 2009-04-07 20:53 ` Johannes Berg 0 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-07 20:44 UTC (permalink / raw) To: Johannes Berg Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org T24gVHVlLCBBcHIgNywgMjAwOSBhdCAxOjQxIFBNLCBKb2hhbm5lcyBCZXJnIDxqb2hhbm5lc0Bz aXBzb2x1dGlvbnMubmV0PiB3cm90ZToKPiBPbiBUdWUsIDIwMDktMDQtMDcgYXQgMTM6MzggLTA3 MDAsIEx1aXMgUi4gUm9kcmlndWV6IHdyb3RlOgo+Cj4+ID4+IMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIHN3aXRjaCAoaHRfaW5mby0+aHRfcGFyYW0gJiBJRUVFODAyMTFfSFRfUEFSQU1fQ0hBX1NF Q19PRkZTRVQpIHsKPj4gPj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgY2FzZSBJRUVFODAyMTFf SFRfUEFSQU1fQ0hBX1NFQ19BQk9WRToKPj4gPj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgaWYgKG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gcGF0Y2hlcy4K Pgo+IEluZGVlZCwgaXQncyBhbHJlYWR5IHRoZXJlLiBJIGd1ZXNzIEkgZ290IGNvbmZ1c2VkLCBz b3JyeSBmb3IgdGhlIG5vaXNlLgoKaGVoZSwgbnAsIGFyZSB0aGVzZSBBQ0tlZCBub3cgdGhlbj8K CiAgTHVpcwo= ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 20:44 ` Luis R. Rodriguez @ 2009-04-07 20:53 ` Johannes Berg 2009-04-07 20:59 ` Luis R. Rodriguez 0 siblings, 1 reply; 17+ messages in thread From: Johannes Berg @ 2009-04-07 20:53 UTC (permalink / raw) To: Luis R. Rodriguez Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 362 bytes --] On Tue, 2009-04-07 at 13:44 -0700, Luis R. Rodriguez wrote: > >> That's what was there or what I added in my patches. > > > > Indeed, it's already there. I guess I got confused, sorry for the noise. > > hehe, np, are these ACKed now then? Yeah seems fine to me -- I'm happy as long as the userspace interface doesn't include all this :) johannes [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc 2009-04-07 20:53 ` Johannes Berg @ 2009-04-07 20:59 ` Luis R. Rodriguez 0 siblings, 0 replies; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-07 20:59 UTC (permalink / raw) To: Johannes Berg, Senthil Balasubramanian Cc: Luis Rodriguez, linville@tuxdriver.com, linux-wireless@vger.kernel.org On Tue, Apr 7, 2009 at 1:53 PM, Johannes Berg <johannes@sipsolutions.net> wrote: > On Tue, 2009-04-07 at 13:44 -0700, Luis R. Rodriguez wrote: > >> >> That's what was there or what I added in my patches. >> > >> > Indeed, it's already there. I guess I got confused, sorry for the noise. >> >> hehe, np, are these ACKed now then? > > Yeah seems fine to me -- I'm happy as long as the userspace interface > doesn't include all this :) Thanks :) Luis ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez ` (2 preceding siblings ...) 2009-04-06 20:15 ` [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc Luis R. Rodriguez @ 2009-04-06 20:15 ` Luis R. Rodriguez 2009-04-06 20:19 ` Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 5/5] mac80211: expose HT channel flags through debugfs Luis R. Rodriguez 4 siblings, 1 reply; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw) To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez Thanks to nl80211 userspace can be very specific upon device configuration. Before processing the request for the new HT40 channel types (HT40- or HT40+) we need to ensure we can use them regulatory-wise. This wasn't required with wireless extensions as specifying the channel type wasn't not available and configuration was done towards the end implicitly upon association or reception of beacons from the AP. For the new nl80211 we have to check this when configuring the interfaces explicitly. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> --- net/wireless/nl80211.c | 47 ++++++++++++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 21 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 411c233..4e3af27 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -431,7 +431,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT; struct ieee80211_channel *chan; struct ieee80211_sta_ht_cap *ht_cap; - u32 freq, sec_freq; + u32 freq; if (!rdev->ops->set_channel) { result = -EOPNOTSUPP; @@ -457,39 +457,44 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info) if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) goto bad_res; - if (channel_type == NL80211_CHAN_HT40MINUS) - sec_freq = freq - 20; - else if (channel_type == NL80211_CHAN_HT40PLUS) - sec_freq = freq + 20; - else - sec_freq = 0; - - ht_cap = &rdev->wiphy.bands[chan->band]->ht_cap; + if (channel_type == NL80211_CHAN_HT40MINUS || + channel_type == NL80211_CHAN_HT40PLUS) + if (chan->flags & IEEE80211_CHAN_NO_HT40) + goto bad_res; - /* no HT capabilities */ - if (channel_type != NL80211_CHAN_NO_HT && - !ht_cap->ht_supported) + if (channel_type == NL80211_CHAN_HT40MINUS && + (chan->flags & IEEE80211_CHAN_NO_HT40MINUS)) goto bad_res; + else if (channel_type == NL80211_CHAN_HT40PLUS && + (chan->flags & IEEE80211_CHAN_NO_HT40PLUS)) + goto bad_res; + + /* + * At this point we know if that if HT40 was requested + * we are allowed to use it and the extension channel + * exists. + */ - if (sec_freq) { - struct ieee80211_channel *schan; + ht_cap = &rdev->wiphy.bands[chan->band]->ht_cap; - /* no 40 MHz capabilities */ + /* no HT capabilities or intolerant */ + if (channel_type != NL80211_CHAN_NO_HT) { + if (!ht_cap->ht_supported) + goto bad_res; if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) || (ht_cap->cap & IEEE80211_HT_CAP_40MHZ_INTOLERANT)) goto bad_res; - - schan = ieee80211_get_channel(&rdev->wiphy, sec_freq); - - /* Secondary channel not allowed */ - if (!schan || schan->flags & IEEE80211_CHAN_DISABLED) - goto bad_res; } result = rdev->ops->set_channel(&rdev->wiphy, chan, channel_type); if (result) goto bad_res; + + result = rdev->ops->set_channel(&rdev->wiphy, chan, + channel_type); + if (result) + goto bad_res; } -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests 2009-04-06 20:15 ` [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests Luis R. Rodriguez @ 2009-04-06 20:19 ` Luis R. Rodriguez 0 siblings, 0 replies; 17+ mess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IMKgIMKgIHJlc3VsdCA9IHJkZXYtPm9wcy0+c2V0X2NoYW5uZWwoJnJkZXYtPndpcGh5 LCBjaGFuLAo+ICsgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgY2hhbm5lbF90eXBlKTsKPiArIMKgIMKgIMKgIMKgIMKg IMKgIMKgIGlmIChyZXN1bHQpCj4gKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBn b3RvIGJhZF9yZXM7Cj4gwqAgwqAgwqAgwqB9CgpPb3BzLCB0aGF0J3MgYSBkdXBsaWNhdGUuLiBu b3Qgc3VyZSBob3cgSSBtaXNzZWQgdGhhdC4gV2lsbCByZXNlbmQgdGhpcyBwYXRjaC4KCiAgTHVp cwo= ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 5/5] mac80211: expose HT channel flags through debugfs 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez ` (3 preceding siblings ...) 2009-04-06 20:15 ` [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests Luis R. Rodriguez @ 2009-04-06 20:15 ` Luis R. Rodriguez 4 siblings, 0 replies; 17+ messages in thread From: Luis R. Rodriguez @ 2009-04-06 20:15 UTC (permalink / raw) To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez Since we are not going to be exporting HT40-/+ flags for now through nl80211 we supply the channel flags as a whole through debugfs so users/testers can see whether or not HT40-/+ is allowed. Screenshot on channel 1 (2.412 GHz): [root@pogo ~]# mount -t debugfs debugfs /debug/ [root@pogo ~]# cat /debug/ieee80211/phy0/ht40minusallowed 0 [root@pogo ~]# cat /debug/ieee80211/phy0/ht40plusallowed 1 [root@pogo ~]# umount /debug Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> --- net/mac80211/debugfs.c | 10 ++++++++++ net/mac80211/ieee80211_i.h | 2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 210b9b6..fa15a88 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -51,6 +51,12 @@ static const struct file_operations name## _ops = { \ DEBUGFS_READONLY_FILE(frequency, 20, "%d", local->hw.conf.channel->center_freq); +DEBUGFS_READONLY_FILE(ht40plusallowed, 20, "%d", + !(local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40PLUS)); +DEBUGFS_READONLY_FILE(ht40minusallowed, 20, "%d", + !(local->hw.conf.channel->flags & + IEEE80211_CHAN_NO_HT40MINUS)); DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d", local->rts_threshold); DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d", @@ -269,6 +275,8 @@ void debugfs_hw_add(struct ieee80211_local *local) local->debugfs.keys = debugfs_create_dir("keys", phyd); DEBUGFS_ADD(frequency); + DEBUGFS_ADD(ht40plusallowed); + DEBUGFS_ADD(ht40minusallowed); DEBUGFS_ADD(rts_threshold); DEBUGFS_ADD(fragmentation_threshold); DEBUGFS_ADD(short_retry_limit); @@ -324,6 +332,8 @@ void debugfs_hw_add(struct ieee80211_local *local) void debugfs_hw_del(struct ieee80211_local *local) { DEBUGFS_DEL(frequency); + DEBUGFS_DEL(ht40plusallowed); + DEBUGFS_DEL(ht40minusallowed); DEBUGFS_DEL(rts_threshold); DEBUGFS_DEL(fragmentation_threshold); DEBUGFS_DEL(short_retry_limit); diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e6ed78c..f7b192a 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -750,6 +750,8 @@ struct ieee80211_local { struct dentry *rcdir; struct dentry *rcname; struct dentry *frequency; + struct dentry *ht40plusallowed; + struct dentry *ht40minusallowed; struct dentry *rts_threshold; struct dentry *fragmentation_threshold; struct dentry *short_retry_limit; -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2009-04-07 20:59 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-04-06 20:15 [PATCH v2 0/5] wireless: listen to reg bw preferences Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 1/5] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez 2009-04-07 10:08 ` Johannes Berg 2009-04-07 16:10 ` Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 2/5] wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+ Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 3/5] mac80211: check if HT40+/- is allowed before sending assoc Luis R. Rodriguez 2009-04-07 10:11 ` Johannes Berg 2009-04-07 16:23 ` Luis R. Rodriguez 2009-04-07 19:09 ` Johannes Berg 2009-04-07 20:38 ` Luis R. Rodriguez 2009-04-07 20:41 ` Johannes Berg 2009-04-07 20:44 ` Luis R. Rodriguez 2009-04-07 20:53 ` Johannes Berg 2009-04-07 20:59 ` Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 4/5] cfg80211: check allowed channel type upon userspace requests Luis R. Rodriguez 2009-04-06 20:19 ` Luis R. Rodriguez 2009-04-06 20:15 ` [PATCH v2 5/5] mac80211: expose HT channel flags through debugfs Luis R. Rodriguez
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).