aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2015-09-08 09:46:25 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-03 18:01:49 (GMT)
commitc0d94d611834475c7bd27f895fd5412a85c57c6d (patch)
treead2b35be00c05c9200a3cfa50281f37c925c9b2f /src/ap
parent61f121d925e4ff2d2a7827064dfb5e18ec729b18 (diff)
downloadhostap-c0d94d611834475c7bd27f895fd5412a85c57c6d.zip
hostap-c0d94d611834475c7bd27f895fd5412a85c57c6d.tar.gz
hostap-c0d94d611834475c7bd27f895fd5412a85c57c6d.tar.bz2
Advertise Supported Operating Classes elements in Beacon/Probe Response
Advertise current operating class in Beacon and Probe Response frames. This Supported Operating Classes element is required by the standard when extended channel switch is supported. However, since this element doesn't reflect correctly the sub-band spectrum breakdown and can't be effectively used by clients, publish only the minimal required part which is the current operating class. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/beacon.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index fdfc9f3..72b2227 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -326,6 +326,34 @@ static u8 * hostapd_eid_ecsa(struct hostapd_data *hapd, u8 *eid)
}
+static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid)
+{
+ u8 op_class, channel;
+
+ if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) ||
+ !hapd->iface->freq)
+ return eid;
+
+ if (ieee80211_freq_to_channel_ext(hapd->iface->freq,
+ hapd->iconf->secondary_channel,
+ hapd->iconf->vht_oper_chwidth,
+ &op_class, &channel) ==
+ NUM_HOSTAPD_MODES)
+ return eid;
+
+ *eid++ = WLAN_EID_SUPPORTED_OPERATING_CLASSES;
+ *eid++ = 2;
+
+ /* Current Operating Class */
+ *eid++ = op_class;
+
+ /* TODO: Advertise all the supported operating classes */
+ *eid++ = 0;
+
+ return eid;
+}
+
+
static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
const struct ieee80211_mgmt *req,
int is_p2p, size_t *resp_len)
@@ -416,6 +444,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
hapd->cs_c_off_ecsa_proberesp = csa_pos - (u8 *) resp - 1;
pos = csa_pos;
+ pos = hostapd_eid_supported_op_classes(hapd, pos);
+
#ifdef CONFIG_IEEE80211N
/* Secondary Channel Offset element */
/* TODO: The standard doesn't specify a position for this element. */
@@ -997,6 +1027,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
hapd->cs_c_off_ecsa_beacon = csa_pos - tail - 1;
tailpos = csa_pos;
+ tailpos = hostapd_eid_supported_op_classes(hapd, tailpos);
+
#ifdef CONFIG_IEEE80211N
/* Secondary Channel Offset element */
/* TODO: The standard doesn't specify a position for this element. */