]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Provide EHT capabilities in STA addition path
authorAloka Dixit <quic_alokad@quicinc.com>
Tue, 19 Apr 2022 18:04:13 +0000 (11:04 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 29 Apr 2022 14:28:40 +0000 (17:28 +0300)
Add support for EHT capabilities in the addition of a new station entry
to the driver.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
src/ap/ap_drv_ops.c
src/ap/ap_drv_ops.h
src/ap/ieee802_11.c
src/ap/ieee802_11.h
src/ap/ieee802_11_eht.c
src/ap/sta_info.c

index e2aca25d384d6b3c6058ec045eb4dd297e129006..027b459a083aac011c77e372cfcc859650e0b7bd 100644 (file)
@@ -418,6 +418,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
                    const struct ieee80211_vht_capabilities *vht_capab,
                    const struct ieee80211_he_capabilities *he_capab,
                    size_t he_capab_len,
+                   const struct ieee80211_eht_capabilities *eht_capab,
+                   size_t eht_capab_len,
                    const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
                    u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
                    int set)
@@ -440,6 +442,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
        params.vht_capabilities = vht_capab;
        params.he_capab = he_capab;
        params.he_capab_len = he_capab_len;
+       params.eht_capab = eht_capab;
+       params.eht_capab_len = eht_capab_len;
        params.he_6ghz_capab = he_6ghz_capab;
        params.vht_opmode_enabled = !!(flags & WLAN_STA_VHT_OPMODE_ENABLED);
        params.vht_opmode = vht_opmode;
index d15f9defef96141bc3825f9402742f3dac423bbd..e5669a0c937ccdfa574f45b6db5816c2a9225586 100644 (file)
@@ -43,6 +43,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
                    const struct ieee80211_vht_capabilities *vht_capab,
                    const struct ieee80211_he_capabilities *he_capab,
                    size_t he_capab_len,
+                   const struct ieee80211_eht_capabilities *eht_capab,
+                   size_t eht_capab_len,
                    const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
                    u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
                    int set);
index f477a0234338ffb32117adfce93df967a2801525..ddc4d85748ea794b3179c31d168e804caebef401 100644 (file)
@@ -4936,6 +4936,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
        struct ieee80211_ht_capabilities ht_cap;
        struct ieee80211_vht_capabilities vht_cap;
        struct ieee80211_he_capabilities he_cap;
+       struct ieee80211_eht_capabilities eht_cap;
        int set = 1;
 
        /*
@@ -4992,6 +4993,11 @@ static int add_associated_sta(struct hostapd_data *hapd,
                                     sta->he_capab_len);
        }
 #endif /* CONFIG_IEEE80211AX */
+#ifdef CONFIG_IEEE80211BE
+       if (sta->flags & WLAN_STA_EHT)
+               hostapd_get_eht_capab(hapd, sta->eht_capab, &eht_cap,
+                                     sta->eht_capab_len);
+#endif /* CONFIG_IEEE80211BE */
 
        /*
         * Add the station with forced WLAN_STA_ASSOC flag. The sta->flags
@@ -5005,6 +5011,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
                            sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
                            sta->flags & WLAN_STA_HE ? &he_cap : NULL,
                            sta->flags & WLAN_STA_HE ? sta->he_capab_len : 0,
+                           sta->flags & WLAN_STA_EHT ? &eht_cap : NULL,
+                           sta->flags & WLAN_STA_EHT ? sta->eht_capab_len : 0,
                            sta->he_6ghz_capab,
                            sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
                            sta->vht_opmode, sta->p2p_ie ? 1 : 0,
index 141915cda0a54596561d0e147a20ae2f6ee61d5a..fa1f47b957e45d633c5448a9c0e5563830227b53 100644 (file)
@@ -78,6 +78,10 @@ void hostapd_get_he_capab(struct hostapd_data *hapd,
                          const struct ieee80211_he_capabilities *he_cap,
                          struct ieee80211_he_capabilities *neg_he_cap,
                          size_t he_capab_len);
+void hostapd_get_eht_capab(struct hostapd_data *hapd,
+                          const struct ieee80211_eht_capabilities *src,
+                          struct ieee80211_eht_capabilities *dest,
+                          size_t len);
 int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta);
 u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta,
                      const u8 *ht_capab);
index c9040c7b0e655b746a0c89d88c255cbc00f1bbfb..0f5d3805834ba1cbc75b95712d85ae070fd50509 100644 (file)
@@ -336,3 +336,20 @@ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta,
 
        return WLAN_STATUS_SUCCESS;
 }
+
+
+void hostapd_get_eht_capab(struct hostapd_data *hapd,
+                          const struct ieee80211_eht_capabilities *src,
+                          struct ieee80211_eht_capabilities *dest,
+                          size_t len)
+{
+       if (!src || !dest)
+               return;
+
+       if (len > sizeof(*dest))
+               len = sizeof(*dest);
+       /* TODO: mask out unsupported features */
+
+       os_memset(dest, 0, sizeof(*dest));
+       os_memcpy(dest, src, len);
+}
index 44fac50995f2fa969a461432264dac42ede66010..7cb5276939f197c692fe582e9fed58a124525bfe 100644 (file)
@@ -1553,7 +1553,7 @@ int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta)
        if (hostapd_sta_add(hapd, sta->addr, 0, 0,
                            sta->supported_rates,
                            sta->supported_rates_len,
-                           0, NULL, NULL, NULL, 0, NULL,
+                           0, NULL, NULL, NULL, 0, NULL, 0, NULL,
                            sta->flags, 0, 0, 0, 0)) {
                hostapd_logger(hapd, sta->addr,
                               HOSTAPD_MODULE_IEEE80211,