Skip to content
Permalink
Browse files

Merge pull request #2 from ivkos/force-ht40

Add option to force 40 MHz channel width
  • Loading branch information...
ivkos committed Sep 9, 2014
2 parents 76db5b6 + 8526009 commit 004876e562b310d85ffab0f1d671b7a51ff0ce51
Showing with 19 additions and 4 deletions.
  1. +2 −0 hostapd/config_file.c
  2. +7 −0 hostapd/hostapd.conf
  3. +2 −0 src/ap/ap_config.c
  4. +1 −0 src/ap/ap_config.h
  5. +1 −1 src/ap/hw_features.c
  6. +6 −3 src/ap/ieee802_11_ht.c
@@ -2647,6 +2647,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
line);
return 1;
}
} else if (os_strcmp(buf, "force_ht40") == 0) {
conf->force_ht40 = atoi(pos);
} else if (os_strcmp(buf, "require_ht") == 0) {
conf->require_ht = atoi(pos);
} else if (os_strcmp(buf, "obss_interval") == 0) {
@@ -484,6 +484,13 @@ wmm_ac_vo_acm=0
# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set)
#ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]

# Skip checks for 40 MHz intolerance or overlapping stations and force
# 40 MHz channel width
# Please note that this violates IEEE Std 802.11-2012, 10.15.3.2
# 0 = disabled (default)
# 1 = enabled
#force_ht40=0

# Require stations to support HT PHY (reject association if they do not)
#require_ht=1

@@ -170,6 +170,8 @@ struct hostapd_config * hostapd_config_defaults(void)

conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;

conf->force_ht40 = 0;

conf->ap_table_max_size = 255;
conf->ap_table_expiration_time = 60;

@@ -576,6 +576,7 @@ struct hostapd_config {

int ht_op_mode_fixed;
u16 ht_capab;
int force_ht40;
int ieee80211n;
int secondary_channel;
int require_ht;
@@ -533,7 +533,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
wpa_scan_results_free(scan_res);

iface->secondary_ch = iface->conf->secondary_channel;
if (!oper40) {
if (!iface->conf->force_ht40 && !oper40) {
wpa_printf(MSG_INFO, "20/40 MHz operation not permitted on "
"channel pri=%d sec=%d based on overlapping BSSes",
iface->conf->channel,
@@ -184,6 +184,9 @@ static int is_40_allowed(struct hostapd_iface *iface, int channel)
if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
return 1;

if (iface->conf->force_ht40)
return 1;

pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel);

if (iface->conf->secondary_channel > 0)
@@ -233,15 +236,15 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
"20 MHz BSS width request bit is set in BSS coexistence information field");
is_ht_allowed = 0;
is_ht_allowed = iface->conf->force_ht40;
}

if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_40MHZ_INTOL) {
hostapd_logger(hapd, mgmt->sa,
HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG,
"40 MHz intolerant bit is set in BSS coexistence information field");
is_ht_allowed = 0;
is_ht_allowed = iface->conf->force_ht40;
}

if (ic_report &&
@@ -256,7 +259,7 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
HOSTAPD_LEVEL_DEBUG,
"20_40_INTOLERANT channel %d reported",
ic_report->variable[i]);
is_ht_allowed = 0;
is_ht_allowed = iface->conf->force_ht40;
break;
}
}

0 comments on commit 004876e

Please sign in to comment.
You can’t perform that action at this time.