aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-02-09 13:08:47 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-09 13:08:47 (GMT)
commit2944824315b7c74838c551ef08c9843e02de1d46 (patch)
tree88d3ea5e4144e937070c815d66016780f6b60fbd /src
parente67b55fb11fde405a0bbeeb4c33abf0d1b6dc7c2 (diff)
downloadhostap-2944824315b7c74838c551ef08c9843e02de1d46.zip
hostap-2944824315b7c74838c551ef08c9843e02de1d46.tar.gz
hostap-2944824315b7c74838c551ef08c9843e02de1d46.tar.bz2
hostapd: Add require_ht configuration parameter
This can be used to configure hostapd to reject association with any station that does not support HT PHY.
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_config.h1
-rw-r--r--src/ap/hw_features.c3
-rw-r--r--src/ap/ieee802_11.c19
-rw-r--r--src/common/ieee802_11_defs.h6
4 files changed, 26 insertions, 3 deletions
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index ff7e8cf..8761ad2 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -387,6 +387,7 @@ struct hostapd_config {
u16 ht_capab;
int ieee80211n;
int secondary_channel;
+ int require_ht;
};
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 9b4c2a9..9b0265f 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -162,7 +162,8 @@ int hostapd_prepare_rates(struct hostapd_data *hapd,
hapd->iface->num_rates++;
}
- if (hapd->iface->num_rates == 0 || num_basic_rates == 0) {
+ if ((hapd->iface->num_rates == 0 || num_basic_rates == 0) &&
+ (!hapd->iconf->ieee80211n || !hapd->iconf->require_ht)) {
wpa_printf(MSG_ERROR, "No rates remaining in supported/basic "
"rate sets (%d,%d).",
hapd->iface->num_rates, num_basic_rates);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index f19c817..06fc701 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -53,6 +53,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
*pos++ = WLAN_EID_SUPP_RATES;
num = hapd->iface->num_rates;
+ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
+ num++;
if (num > 8) {
/* rest of the rates are encoded in Extended supported
* rates element */
@@ -70,6 +72,10 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
pos++;
}
+ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
+ hapd->iface->num_rates < 8)
+ *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
+
return pos;
}
@@ -83,6 +89,8 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
return eid;
num = hapd->iface->num_rates;
+ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
+ num++;
if (num <= 8)
return eid;
num -= 8;
@@ -101,6 +109,10 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
pos++;
}
+ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
+ hapd->iface->num_rates >= 8)
+ *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
+
return pos;
}
@@ -667,6 +679,13 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
elems.ht_capabilities_len);
if (resp != WLAN_STATUS_SUCCESS)
return resp;
+ if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
+ !(sta->flags & WLAN_STA_HT)) {
+ hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_INFO, "Station does not support "
+ "mandatory HT PHY - reject association");
+ return WLAN_STATUS_ASSOC_DENIED_NO_HT;
+ }
#endif /* CONFIG_IEEE80211N */
if ((hapd->conf->wpa & WPA_PROTO_RSN) && elems.rsn_ie) {
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 7526894..a143e40 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -120,9 +120,10 @@
#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
/* IEEE 802.11g */
#define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
-#define WLAN_STATUS_ASSOC_DENIED_NO_ER_PBCC 26
-#define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 27
+#define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 26
+#define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
#define WLAN_STATUS_R0KH_UNREACHABLE 28
+#define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
/* IEEE 802.11w */
#define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
#define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
@@ -545,6 +546,7 @@ struct ieee80211_ht_operation {
#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10))
#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11))
+#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
* 00:50:F2 */