hostapd: Add require_he configuration
Add the ability to require HE, advertising that via the BSS membership selector as well as rejecting association without HE. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
parent
c46351d10e
commit
054fcfab6f
5 changed files with 39 additions and 0 deletions
|
@ -1107,6 +1107,7 @@ struct hostapd_config {
|
|||
u8 he_6ghz_rx_ant_pat;
|
||||
u8 he_6ghz_tx_ant_pat;
|
||||
u8 he_6ghz_reg_pwr_type;
|
||||
bool require_he;
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
|
||||
/* VHT enable/disable config from CHAN_SWITCH */
|
||||
|
|
|
@ -115,6 +115,10 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
num++;
|
||||
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht)
|
||||
num++;
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
if (hapd->iconf->ieee80211ax && hapd->iconf->require_he)
|
||||
num++;
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
h2e_required = (hapd->conf->sae_pwe == SAE_PWE_HASH_TO_ELEMENT ||
|
||||
hostapd_sae_pw_id_in_use(hapd->conf) == 2) &&
|
||||
hapd->conf->sae_pwe != SAE_PWE_FORCE_HUNT_AND_PECK &&
|
||||
|
@ -147,6 +151,13 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
if (hapd->iconf->ieee80211ax && hapd->iconf->require_he && count < 8) {
|
||||
count++;
|
||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HE_PHY;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
|
||||
if (h2e_required && count < 8) {
|
||||
count++;
|
||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY;
|
||||
|
@ -171,6 +182,10 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
num++;
|
||||
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht)
|
||||
num++;
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
if (hapd->iconf->ieee80211ax && hapd->iconf->require_he)
|
||||
num++;
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
h2e_required = (hapd->conf->sae_pwe == SAE_PWE_HASH_TO_ELEMENT ||
|
||||
hostapd_sae_pw_id_in_use(hapd->conf) == 2) &&
|
||||
hapd->conf->sae_pwe != SAE_PWE_FORCE_HUNT_AND_PECK &&
|
||||
|
@ -206,6 +221,14 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211AX
|
||||
if (hapd->iconf->ieee80211ax && hapd->iconf->require_he) {
|
||||
count++;
|
||||
if (count > 8)
|
||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HE_PHY;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211AX */
|
||||
|
||||
if (h2e_required) {
|
||||
count++;
|
||||
if (count > 8)
|
||||
|
@ -3704,6 +3727,15 @@ static int check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
elems.he_capabilities_len);
|
||||
if (resp != WLAN_STATUS_SUCCESS)
|
||||
return resp;
|
||||
|
||||
if (hapd->iconf->require_he && !(sta->flags & WLAN_STA_HE)) {
|
||||
hostapd_logger(hapd, sta->addr,
|
||||
HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_INFO,
|
||||
"Station does not support mandatory HE PHY - reject association");
|
||||
return WLAN_STATUS_DENIED_HE_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (is_6ghz_op_class(hapd->iconf->op_class)) {
|
||||
if (!(sta->flags & WLAN_STA_HE)) {
|
||||
hostapd_logger(hapd, sta->addr,
|
||||
|
|
|
@ -1289,6 +1289,7 @@ struct ieee80211_ampe_ie {
|
|||
#define HT_OPER_PARAM_PCO_PHASE ((u16) BIT(11))
|
||||
/* B36..B39 - Reserved */
|
||||
|
||||
#define BSS_MEMBERSHIP_SELECTOR_HE_PHY 122
|
||||
#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
|
||||
#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
|
||||
#define BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY 123
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue