]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add Non EHT SCS Capability in (Re)Association Request frames
authorPurushottam Kushwaha <quic_pkushwah@quicinc.com>
Tue, 18 Apr 2023 14:24:09 +0000 (19:54 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 28 Aug 2023 13:06:50 +0000 (16:06 +0300)
Set WFA capability to allow non-EHT SCS Traffic support in association
elements when the AP advertises support for non-EHT SCS Traffic support
via Beacon or Probe Response frame. This capability is upper layer
functionality and as such, does not need a separate driver capability
indication or configuration, but indicate this only if the AP supports
the feature to minimize risk of interoperability issues with a new
information element.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
src/common/ieee802_11_defs.h
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 381613d14e4db1e030cade5a5e3544986e7ad3b0..fbf9afa7783b62981d46320a41e02491c00dafd5 100644 (file)
@@ -2857,6 +2857,7 @@ enum dscp_policy_request_type {
 /* Wi-Fi Alliance Capabilities element - Capabilities field */
 #define WFA_CAPA_QM_DSCP_POLICY BIT(0)
 #define WFA_CAPA_QM_UNSOLIC_DSCP BIT(1)
+#define WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC BIT(2)
 
 struct ieee80211_neighbor_ap_info {
        u8 tbtt_info_hdr;
index e0f3240e87af22f3e378d81d8414e5b0473e84f9..e712c8154594d8163dce43b405541049f821af8e 100644 (file)
@@ -3173,6 +3173,29 @@ int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s)
 #endif /* CONFIG_FILS */
 
 
+bool wpa_is_non_eht_scs_traffic_desc_supported(struct wpa_bss *bss)
+{
+       const u8 *wfa_capa;
+
+       if (!bss)
+               return false;
+
+       /* Get WFA capability from Beacon or Probe Response frame elements */
+       wfa_capa = wpa_bss_get_vendor_ie(bss, WFA_CAPA_IE_VENDOR_TYPE);
+       if (!wfa_capa)
+               wfa_capa = wpa_bss_get_vendor_ie_beacon(
+                       bss, WFA_CAPA_IE_VENDOR_TYPE);
+
+       if (!wfa_capa || wfa_capa[1] < 6 || wfa_capa[6] < 1 ||
+           !(wfa_capa[7] & WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC)) {
+               /* AP does not enable QM non EHT traffic description policy */
+               return false;
+       }
+
+       return true;
+}
+
+
 static int wpas_populate_wfa_capa(struct wpa_supplicant *wpa_s,
                                  struct wpa_bss *bss,
                                  u8 *wpa_ie, size_t wpa_ie_len,
@@ -3186,6 +3209,9 @@ static int wpas_populate_wfa_capa(struct wpa_supplicant *wpa_s,
        if (wpa_s->enable_dscp_policy_capa)
                wfa_capa[0] |= WFA_CAPA_QM_DSCP_POLICY;
 
+       if (wpa_is_non_eht_scs_traffic_desc_supported(bss))
+               wfa_capa[0] |= WFA_CAPA_QM_NON_EHT_SCS_TRAFFIC_DESC;
+
        if (!wfa_capa[0])
                return wpa_ie_len;
 
index 1c31569c6ae6b880c085ad4af6187a409a481658..478b36d867ba21eaa4a37b00eb8da6ea82cb4963 100644 (file)
@@ -1918,4 +1918,6 @@ void wpas_pasn_auth_trigger(struct wpa_supplicant *wpa_s,
                            struct pasn_auth *pasn_auth);
 void wpas_pasn_auth_work_done(struct wpa_supplicant *wpa_s, int status);
 
+bool wpa_is_non_eht_scs_traffic_desc_supported(struct wpa_bss *bss);
+
 #endif /* WPA_SUPPLICANT_I_H */