diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 381613d14..fbf9afa77 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -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; diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index e0f3240e8..e712c8154 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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; diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 1c31569c6..478b36d86 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -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 */