VHT: Add option for requiring use of VHT
authorMahesh Palivela <maheshp@posedge.com>
Fri, 10 Aug 2012 16:53:24 +0000 (19:53 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 10 Aug 2012 16:53:24 +0000 (19:53 +0300)
Signed-hostap: Mahesh Palivela <maheshp@posedge.com>

hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/ieee802_11.c

index b7156be..b9ba700 100644 (file)
@@ -2222,6 +2222,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                           "vht_capab", line);
                                errors++;
                        }
+               } else if (os_strcmp(buf, "require_vht") == 0) {
+                       conf->require_vht = atoi(pos);
                } else if (os_strcmp(buf, "vht_oper_chwidth") == 0) {
                        conf->vht_oper_chwidth = atoi(pos);
 #endif /* CONFIG_IEEE80211AC */
index 22c7f75..41c10e8 100644 (file)
@@ -550,6 +550,9 @@ wmm_ac_vo_acm=0
 # 0 = Tx antenna pattern might change during the lifetime of an association
 # 1 = Tx antenna pattern does not change during the lifetime of an association
 #vht_capab=[SHORT-GI-80][HTC-VHT]
+#
+# Require stations to support VHT PHY (reject association if they do not)
+#require_vht=1
 
 # 0 = 20 or 40 MHz operating Channel width
 # 1 = 80 MHz channel width
index 9a546ee..af31403 100644 (file)
@@ -476,6 +476,7 @@ struct hostapd_config {
        int require_ht;
        u32 vht_capab;
        int ieee80211ac;
+       int require_vht;
        u8 vht_oper_chwidth;
 };
 
index 96b6c19..dedf72a 100644 (file)
@@ -653,6 +653,13 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
                                  elems.vht_capabilities_len);
        if (resp != WLAN_STATUS_SUCCESS)
                return resp;
+       if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht &&
+           !(sta->flags & WLAN_STA_VHT)) {
+               hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
+                              HOSTAPD_LEVEL_INFO, "Station does not support "
+                              "mandatory VHT PHY - reject association");
+               return WLAN_STATUS_UNSPECIFIED_FAILURE;
+       }
 #endif /* CONFIG_IEEE80211AC */
 
        if ((hapd->conf->wpa & WPA_PROTO_RSN) && elems.rsn_ie) {