diff options
author | Mahesh Palivela <maheshp@posedge.com> | 2012-06-30 13:57:52 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-06-30 13:57:52 +0300 |
commit | 532b16c7a9d29cbf6e62a4120b54f2bf4ef525a2 (patch) | |
tree | 50b490327c5527b6fdc63871352102d9561b7c2e | |
parent | efe45d147165368e916670ba83f621df7107c282 (diff) | |
download | external_wpa_supplicant_8_ti-532b16c7a9d29cbf6e62a4120b54f2bf4ef525a2.zip external_wpa_supplicant_8_ti-532b16c7a9d29cbf6e62a4120b54f2bf4ef525a2.tar.gz external_wpa_supplicant_8_ti-532b16c7a9d29cbf6e62a4120b54f2bf4ef525a2.tar.bz2 |
hostapd: Add IEEE 802.11ac VHT IEs into Beacon/Probe Response
IEEE 802.11ac VHT changes to include VHT IEs in Beacon and Probe
Response frames.
Signed-hostap: Mahesh Palivela <maheshp@posedge.com>
-rw-r--r-- | hostapd/Makefile | 4 | ||||
-rw-r--r-- | src/ap/beacon.c | 10 | ||||
-rw-r--r-- | src/ap/ieee802_11.h | 2 | ||||
-rw-r--r-- | src/ap/ieee802_11_vht.c | 72 |
4 files changed, 88 insertions, 0 deletions
diff --git a/hostapd/Makefile b/hostapd/Makefile index 5789ee3..b43aa75 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -761,6 +761,10 @@ ifdef CONFIG_IEEE80211N OBJS += ../src/ap/ieee802_11_ht.o endif +ifdef CONFIG_IEEE80211AC +OBJS += ../src/ap/ieee802_11_vht.o +endif + ifdef CONFIG_P2P_MANAGER CFLAGS += -DCONFIG_P2P_MANAGER OBJS += ../src/ap/p2p_hostapd.o diff --git a/src/ap/beacon.c b/src/ap/beacon.c index b711063..0f29ccd 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -262,6 +262,11 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, pos = hostapd_eid_adv_proto(hapd, pos); pos = hostapd_eid_roaming_consortium(hapd, pos); +#ifdef CONFIG_IEEE80211AC + pos = hostapd_eid_vht_capabilities(hapd, pos); + pos = hostapd_eid_vht_operation(hapd, pos); +#endif /* CONFIG_IEEE80211AC */ + /* Wi-Fi Alliance WMM */ pos = hostapd_eid_wmm(hapd, pos); @@ -595,6 +600,11 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd) tailpos = hostapd_eid_adv_proto(hapd, tailpos); tailpos = hostapd_eid_roaming_consortium(hapd, tailpos); +#ifdef CONFIG_IEEE80211AC + tailpos = hostapd_eid_vht_capabilities(hapd, tailpos); + tailpos = hostapd_eid_vht_operation(hapd, tailpos); +#endif /* CONFIG_IEEE80211AC */ + /* Wi-Fi Alliance WMM */ tailpos = hostapd_eid_wmm(hapd, tailpos); diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h index b60350f..9993bee 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h @@ -45,6 +45,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid); +u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid); +u8 * hostapd_eid_vht_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, const u8 *addr, const u8 *trans_id); diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c new file mode 100644 index 0000000..3ad33c8 --- /dev/null +++ b/src/ap/ieee802_11_vht.c @@ -0,0 +1,72 @@ +/* + * hostapd / IEEE 802.11ac VHT + * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of BSD license + * + * See README and COPYING for more details. + */ + +#include "utils/includes.h" + +#include "utils/common.h" +#include "common/ieee802_11_defs.h" +#include "drivers/driver.h" +#include "hostapd.h" +#include "ap_config.h" +#include "sta_info.h" +#include "beacon.h" +#include "ieee802_11.h" + + +u8 * hostapd_eid_vht_capabilities(struct hostapd_data *hapd, u8 *eid) +{ + struct ieee80211_vht_capabilities *cap; + u8 *pos = eid; + + if (!hapd->iconf->ieee80211ac || !hapd->iface->current_mode || + hapd->conf->disable_11ac) + return eid; + + *pos++ = WLAN_EID_VHT_CAP; + *pos++ = sizeof(*cap); + + cap = (struct ieee80211_vht_capabilities *) pos; + os_memset(cap, 0, sizeof(*cap)); + cap->vht_capabilities_info = host_to_le32( + hapd->iface->current_mode->vht_capab); + + /* Supported MCS set comes from hw */ + os_memcpy(cap->vht_supported_mcs_set, + hapd->iface->current_mode->vht_mcs_set, 8); + + pos += sizeof(*cap); + + return pos; +} + + +u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid) +{ + struct ieee80211_vht_operation *oper; + u8 *pos = eid; + + if (!hapd->iconf->ieee80211ac || hapd->conf->disable_11ac) + return eid; + + *pos++ = WLAN_EID_VHT_OPERATION; + *pos++ = sizeof(*oper); + + oper = (struct ieee80211_vht_operation *) pos; + os_memset(oper, 0, sizeof(*oper)); + + oper->vht_op_info_chwidth = hapd->iconf->vht_oper_chwidth; + + /* VHT Basic MCS set comes from hw */ + /* Hard code 1 stream, MCS0-7 is a min Basic VHT MCS rates */ + oper->vht_basic_mcs_set = 0xfffc; + pos += sizeof(*oper); + + return pos; +} |