EHT: Provide EHT capabilities in STA addition path

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>
This commit is contained in:
Aloka Dixit 2022-04-19 11:04:13 -07:00 committed by Jouni Malinen
parent a6d1b4c46c
commit f915d52dee
6 changed files with 36 additions and 1 deletions

View file

@ -418,6 +418,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const struct ieee80211_vht_capabilities *vht_capab, const struct ieee80211_vht_capabilities *vht_capab,
const struct ieee80211_he_capabilities *he_capab, const struct ieee80211_he_capabilities *he_capab,
size_t he_capab_len, 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, const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps, u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
int set) int set)
@ -440,6 +442,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
params.vht_capabilities = vht_capab; params.vht_capabilities = vht_capab;
params.he_capab = he_capab; params.he_capab = he_capab;
params.he_capab_len = he_capab_len; 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.he_6ghz_capab = he_6ghz_capab;
params.vht_opmode_enabled = !!(flags & WLAN_STA_VHT_OPMODE_ENABLED); params.vht_opmode_enabled = !!(flags & WLAN_STA_VHT_OPMODE_ENABLED);
params.vht_opmode = vht_opmode; params.vht_opmode = vht_opmode;

View file

@ -43,6 +43,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
const struct ieee80211_vht_capabilities *vht_capab, const struct ieee80211_vht_capabilities *vht_capab,
const struct ieee80211_he_capabilities *he_capab, const struct ieee80211_he_capabilities *he_capab,
size_t he_capab_len, 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, const struct ieee80211_he_6ghz_band_cap *he_6ghz_capab,
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps, u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
int set); int set);

View file

@ -4936,6 +4936,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
struct ieee80211_ht_capabilities ht_cap; struct ieee80211_ht_capabilities ht_cap;
struct ieee80211_vht_capabilities vht_cap; struct ieee80211_vht_capabilities vht_cap;
struct ieee80211_he_capabilities he_cap; struct ieee80211_he_capabilities he_cap;
struct ieee80211_eht_capabilities eht_cap;
int set = 1; int set = 1;
/* /*
@ -4992,6 +4993,11 @@ static int add_associated_sta(struct hostapd_data *hapd,
sta->he_capab_len); sta->he_capab_len);
} }
#endif /* CONFIG_IEEE80211AX */ #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 * 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_VHT ? &vht_cap : NULL,
sta->flags & WLAN_STA_HE ? &he_cap : NULL, sta->flags & WLAN_STA_HE ? &he_cap : NULL,
sta->flags & WLAN_STA_HE ? sta->he_capab_len : 0, 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->he_6ghz_capab,
sta->flags | WLAN_STA_ASSOC, sta->qosinfo, sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
sta->vht_opmode, sta->p2p_ie ? 1 : 0, sta->vht_opmode, sta->p2p_ie ? 1 : 0,

View file

@ -78,6 +78,10 @@ void hostapd_get_he_capab(struct hostapd_data *hapd,
const struct ieee80211_he_capabilities *he_cap, const struct ieee80211_he_capabilities *he_cap,
struct ieee80211_he_capabilities *neg_he_cap, struct ieee80211_he_capabilities *neg_he_cap,
size_t he_capab_len); 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); 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, u16 copy_sta_ht_capab(struct hostapd_data *hapd, struct sta_info *sta,
const u8 *ht_capab); const u8 *ht_capab);

View file

@ -336,3 +336,20 @@ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta,
return WLAN_STATUS_SUCCESS; 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);
}

View 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, if (hostapd_sta_add(hapd, sta->addr, 0, 0,
sta->supported_rates, sta->supported_rates,
sta->supported_rates_len, sta->supported_rates_len,
0, NULL, NULL, NULL, 0, NULL, 0, NULL, NULL, NULL, 0, NULL, 0, NULL,
sta->flags, 0, 0, 0, 0)) { sta->flags, 0, 0, 0, 0)) {
hostapd_logger(hapd, sta->addr, hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE80211, HOSTAPD_MODULE_IEEE80211,