mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 19:03:39 +00:00
95 lines
2.8 KiB
Diff
95 lines
2.8 KiB
Diff
From 6167dad7647fca057215110b0f371a949f952fd0 Mon Sep 17 00:00:00 2001
|
|
From: Aloka Dixit <quic_alokad@quicinc.com>
|
|
Date: Fri, 10 Sep 2021 15:12:06 -0700
|
|
Subject: [PATCH 09/15] mbssid: set extended capabilities
|
|
|
|
Set extended capabilities as described in IEEE Std 802.11-2020
|
|
section 9.4.2.26 Extended Capabilities element.
|
|
|
|
Co-developed-by: John Crispin <john@phrozen.org>
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
|
---
|
|
src/ap/beacon.c | 38 ++++++++++++++++++++++++++++++++++++--
|
|
1 file changed, 36 insertions(+), 2 deletions(-)
|
|
|
|
Index: b/src/ap/beacon.c
|
|
===================================================================
|
|
--- a/src/ap/beacon.c 2022-10-17 02:00:55.052754218 +0530
|
|
+++ b/src/ap/beacon.c 2022-10-17 02:02:21.956146621 +0530
|
|
@@ -542,12 +542,41 @@ static u8 * hostapd_set_mbssid_beacon(st
|
|
}
|
|
|
|
|
|
+static u8 * hostapd_ext_capab_mbssid(struct hostapd_data *hapd, u8 *eid,
|
|
+ u8 *eid_ext_cap, u8 ema_periodicity)
|
|
+{
|
|
+ size_t len;
|
|
+
|
|
+ if (eid == eid_ext_cap)
|
|
+ return eid;
|
|
+
|
|
+ len = eid_ext_cap[1];
|
|
+ eid_ext_cap += 2;
|
|
+
|
|
+ if (!hapd->iconf->mbssid && len >= 3)
|
|
+ eid_ext_cap[2] &= ~0x40;
|
|
+
|
|
+ if (!hapd->iconf->ema && len >= 11)
|
|
+ eid_ext_cap[10] &= ~0x08;
|
|
+
|
|
+ if (hapd->iconf->mbssid && ema_periodicity <= 1) {
|
|
+ while (len < 11) {
|
|
+ *eid++ = 0x00;
|
|
+ len++;
|
|
+ }
|
|
+ eid_ext_cap[10] |= 0x01;
|
|
+ }
|
|
+
|
|
+ return eid;
|
|
+}
|
|
+
|
|
+
|
|
static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
|
|
const struct ieee80211_mgmt *req,
|
|
int is_p2p, size_t *resp_len)
|
|
{
|
|
struct ieee80211_mgmt *resp;
|
|
- u8 *pos, *epos, *csa_pos;
|
|
+ u8 *pos, *epos, *csa_pos, *ext_cap_pos;
|
|
size_t buflen;
|
|
|
|
hapd = hostapd_mbssid_get_tx_bss(hapd);
|
|
@@ -663,7 +692,10 @@ static u8 * hostapd_gen_probe_resp(struc
|
|
pos = hostapd_eid_mbssid(hapd, pos, epos, WLAN_FC_STYPE_PROBE_RESP, 0,
|
|
NULL);
|
|
|
|
+ ext_cap_pos = pos;
|
|
pos = hostapd_eid_ext_capab(hapd, pos);
|
|
+ if (!is_6ghz_op_class(hapd->iconf->op_class))
|
|
+ pos = hostapd_ext_capab_mbssid(hapd, pos, ext_cap_pos, 1);
|
|
|
|
pos = hostapd_eid_time_adv(hapd, pos);
|
|
pos = hostapd_eid_time_zone(hapd, pos);
|
|
@@ -1589,7 +1621,7 @@ int ieee802_11_build_ap_params(struct ho
|
|
size_t resp_len = 0;
|
|
#ifdef NEED_AP_MLME
|
|
u16 capab_info;
|
|
- u8 *pos, *tailpos, *tailend, *csa_pos;
|
|
+ u8 *pos, *tailpos, *tailend, *csa_pos, *ext_cap_pos;
|
|
#endif /* NEED_AP_MLME */
|
|
|
|
os_memset(params, 0, sizeof(*params));
|
|
@@ -1731,7 +1763,11 @@ int ieee802_11_build_ap_params(struct ho
|
|
tailpos = hostapd_eid_ht_operation(hapd, tailpos);
|
|
tailpos = hostapd_set_mbssid_beacon(hapd, params, tailpos);
|
|
|
|
+ ext_cap_pos = tailpos;
|
|
tailpos = hostapd_eid_ext_capab(hapd, tailpos);
|
|
+ if (!is_6ghz_op_class(hapd->iconf->op_class))
|
|
+ tailpos = hostapd_ext_capab_mbssid(hapd, tailpos, ext_cap_pos,
|
|
+ params->mbssid_elem_count);
|
|
|
|
/*
|
|
* TODO: Time Advertisement element should only be included in some
|