]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Add IEEE 802.11ax HE IEs into Beacon/Probe Response frames
authorPeng Xu <pxu@qca.qualcomm.com>
Tue, 25 Oct 2016 17:23:24 +0000 (10:23 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 19 Feb 2017 15:37:55 +0000 (17:37 +0200)
IEEE 802.11ax HE changes to include HE IEs in Beacon and Probe Response
frames. These elements are using vendor specific forms for now since the
IEEE 802.11ax draft is not yet finalized and the element contents is
subject to change.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/Android.mk
hostapd/Makefile
src/ap/beacon.c
src/ap/ieee802_11.h
src/ap/ieee802_11_he.c [new file with mode: 0644]
wpa_supplicant/Android.mk
wpa_supplicant/Makefile

index 102172c8a41f5c984decd47cc1a7367065d4ab4f..17cc39114094f57f0e803211cf3b93ad713ea091 100644 (file)
@@ -917,6 +917,10 @@ ifdef CONFIG_IEEE80211AC
 OBJS += src/ap/ieee802_11_vht.c
 endif
 
+ifdef CONFIG_IEEE80211AX
+OBJS += src/ap/ieee802_11_he.c
+endif
+
 ifdef CONFIG_P2P_MANAGER
 L_CFLAGS += -DCONFIG_P2P_MANAGER
 OBJS += src/ap/p2p_hostapd.c
index ca17c8484adcf98a7a28997de2046bb7c0b27f56..3160d0debbfe1e83a9eba23cc30f55c7391a1b9c 100644 (file)
@@ -327,6 +327,7 @@ endif
 
 ifdef CONFIG_IEEE80211AX
 CFLAGS += -DCONFIG_IEEE80211AX
+OBJS += ../src/ap/ieee802_11_he.o
 endif
 
 ifdef CONFIG_MBO
index 3788a9764091f5804cf2f7a7105a8ee22fc3d4a3..c6bbda3cc219a7503a8b6adaa3c886157ed8b773 100644 (file)
@@ -392,6 +392,13 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
                        2 + sizeof(struct ieee80211_vht_operation);
        }
 
+#ifdef CONFIG_IEEE80211AX
+       if (hapd->iconf->ieee80211ax) {
+               buflen += 4 + sizeof (struct ieee80211_he_capabilities) +
+                       4 + sizeof (struct ieee80211_he_operation);
+       }
+#endif
+
        buflen += hostapd_mbo_ie_len(hapd);
 
        resp = os_zalloc(buflen);
@@ -500,6 +507,13 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
                pos = hostapd_eid_vendor_vht(hapd, pos);
 #endif /* CONFIG_IEEE80211AC */
 
+#ifdef CONFIG_IEEE80211AX
+       if (hapd->iconf->ieee80211ax) {
+               pos = hostapd_eid_vendor_he_capab(hapd, pos);
+               pos = hostapd_eid_vendor_he_operation(hapd, pos);
+       }
+#endif /* CONFIG_IEEE80211AX */
+
        /* Wi-Fi Alliance WMM */
        pos = hostapd_eid_wmm(hapd, pos);
 
@@ -1040,6 +1054,13 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_IEEE80211AC */
 
+#ifdef CONFIG_IEEE80211AX
+       if (hapd->iconf->ieee80211ax) {
+               tail_len += 4 + sizeof (struct ieee80211_he_capabilities) +
+                       4 + sizeof (struct ieee80211_he_operation);
+       }
+#endif
+
        tail_len += hostapd_mbo_ie_len(hapd);
 
        tailpos = tail = os_malloc(tail_len);
@@ -1171,6 +1192,13 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
                tailpos = hostapd_eid_vendor_vht(hapd, tailpos);
 #endif /* CONFIG_IEEE80211AC */
 
+#ifdef CONFIG_IEEE80211AX
+       if (hapd->iconf->ieee80211ax) {
+               tailpos = hostapd_eid_vendor_he_capab(hapd, tailpos);
+               tailpos = hostapd_eid_vendor_he_operation(hapd, tailpos);
+       }
+#endif /* CONFIG_IEEE80211AX */
+
        /* Wi-Fi Alliance WMM */
        tailpos = hostapd_eid_wmm(hapd, tailpos);
 
index 74ed69013a24fa89d2990426f146083509b84593..ce3abcbb06c91f06713b84e680c4571072754fab 100644 (file)
@@ -55,6 +55,8 @@ u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_vendor_vht(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid);
 u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid);
+u8 * hostapd_eid_vendor_he_capab(struct hostapd_data *hapd, u8 *eid);
+u8 * hostapd_eid_vendor_he_operation(struct hostapd_data *hapd, u8 *eid);
 
 int hostapd_ht_operation_update(struct hostapd_iface *iface);
 void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
new file mode 100644 (file)
index 0000000..7d6a84f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * hostapd / IEEE 802.11ax HE
+ * Copyright (c) 2016-2017, Qualcomm Atheros, Inc.
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#include "utils/includes.h"
+
+#include "utils/common.h"
+#include "common/ieee802_11_defs.h"
+#include "common/qca-vendor.h"
+#include "hostapd.h"
+#include "ap_config.h"
+#include "beacon.h"
+#include "ieee802_11.h"
+#include "dfs.h"
+
+u8 * hostapd_eid_vendor_he_capab(struct hostapd_data *hapd, u8 *eid)
+{
+       struct ieee80211_he_capabilities *cap;
+       u8 *pos = eid;
+
+       if (!hapd->iface->current_mode)
+               return eid;
+
+       /* For now, use a vendor specific element since the P802.11ax draft is
+        * still subject to changes and the contents of this element may change.
+        * This can be replaced with the actual element once P802.11ax is
+        * finalized. */
+       /* Vendor HE Capabilities element */
+       *pos++ = WLAN_EID_VENDOR_SPECIFIC;
+       *pos++ = 4 /* The Vendor OUI, subtype */ +
+               sizeof(struct ieee80211_he_capabilities);
+
+       WPA_PUT_BE32(pos, (OUI_QCA << 8) | QCA_VENDOR_ELEM_HE_CAPAB);
+       pos += 4;
+       cap = (struct ieee80211_he_capabilities *) pos;
+       os_memset(cap, 0, sizeof(*cap));
+
+       if (hapd->iface->conf->he_phy_capab.he_su_beamformer)
+               cap->he_phy_capab_info[HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX] |=
+                       HE_PHYCAP_SU_BEAMFORMER_CAPAB;
+
+       if (hapd->iface->conf->he_phy_capab.he_su_beamformee)
+               cap->he_phy_capab_info[HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX] |=
+                       HE_PHYCAP_SU_BEAMFORMEE_CAPAB;
+
+       if (hapd->iface->conf->he_phy_capab.he_mu_beamformer)
+               cap->he_phy_capab_info[HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX] |=
+                       HE_PHYCAP_MU_BEAMFORMER_CAPAB;
+
+       pos += sizeof(*cap);
+
+       return pos;
+}
+
+
+u8 * hostapd_eid_vendor_he_operation(struct hostapd_data *hapd, u8 *eid)
+{
+       struct ieee80211_he_operation *oper;
+       u8 *pos = eid;
+
+       if (!hapd->iface->current_mode)
+               return eid;
+
+       /* For now, use a vendor specific element since the P802.11ax draft is
+        * still subject to changes and the contents of this element may change.
+        * This can be replaced with the actual element once P802.11ax is
+        * finalized. */
+       /* Vendor HE Operation element */
+       *pos++ = WLAN_EID_VENDOR_SPECIFIC;
+       *pos++ = 4 /* The Vendor OUI, subtype */ +
+               sizeof(struct ieee80211_he_operation);
+
+       WPA_PUT_BE32(pos, (OUI_QCA << 8) | QCA_VENDOR_ELEM_HE_OPER);
+       pos += 4;
+       oper = (struct ieee80211_he_operation *) pos;
+       os_memset(oper, 0, sizeof(*oper));
+
+       if (hapd->iface->conf->he_op.he_bss_color)
+               oper->he_oper_params |= hapd->iface->conf->he_op.he_bss_color;
+
+       if (hapd->iface->conf->he_op.he_default_pe_duration)
+               oper->he_oper_params |=
+                       (hapd->iface->conf->he_op.he_default_pe_duration <<
+                        HE_OPERATION_DFLT_PE_DURATION_OFFSET);
+
+       if (hapd->iface->conf->he_op.he_twt_required)
+               oper->he_oper_params |= HE_OPERATION_TWT_REQUIRED;
+
+       if (hapd->iface->conf->he_op.he_rts_threshold)
+               oper->he_oper_params |=
+                       (hapd->iface->conf->he_op.he_rts_threshold <<
+                        HE_OPERATION_RTS_THRESHOLD_OFFSET);
+
+       pos += sizeof(*oper);
+
+       return pos;
+}
index 448f954a28018949b4500ab6da88d4e438a65251..dd8af4d6224bbbbd31e028d4b1d14947ab4db175 100644 (file)
@@ -827,6 +827,9 @@ OBJS += src/ap/ieee802_11_ht.c
 ifdef CONFIG_IEEE80211AC
 OBJS += src/ap/ieee802_11_vht.c
 endif
+ifdef CONFIG_IEEE80211AX
+OBJS += src/ap/ieee802_11_he.c
+endif
 endif
 ifdef CONFIG_WNM
 OBJS += src/ap/wnm_ap.c
index 65b55c208e61736c8b5296b791a82ab8032b2ede..7bcb7e431f1d414b4309579ae450d7ac7e2dbdde 100644 (file)
@@ -868,6 +868,9 @@ OBJS += ../src/ap/ieee802_11_ht.o
 ifdef CONFIG_IEEE80211AC
 OBJS += ../src/ap/ieee802_11_vht.o
 endif
+ifdef CONFIG_IEEE80211AX
+OBJS += ../src/ap/ieee802_11_he.o
+endif
 endif
 ifdef CONFIG_WNM
 OBJS += ../src/ap/wnm_ap.o