hostapd: Add VHT PHY selector if VHT is required
If VHT is required, add the VHT PHY selector to the (extended) supported rates IE. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
bff954e9a2
commit
202d97d477
2 changed files with 24 additions and 5 deletions
|
@ -49,6 +49,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
||||||
num = hapd->iface->num_rates;
|
num = hapd->iface->num_rates;
|
||||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
||||||
num++;
|
num++;
|
||||||
|
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht)
|
||||||
|
num++;
|
||||||
if (num > 8) {
|
if (num > 8) {
|
||||||
/* rest of the rates are encoded in Extended supported
|
/* rest of the rates are encoded in Extended supported
|
||||||
* rates element */
|
* rates element */
|
||||||
|
@ -66,9 +68,15 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
|
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht && count < 8) {
|
||||||
hapd->iface->num_rates < 8)
|
count++;
|
||||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht && count < 8) {
|
||||||
|
count++;
|
||||||
|
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY;
|
||||||
|
}
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +93,8 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
||||||
num = hapd->iface->num_rates;
|
num = hapd->iface->num_rates;
|
||||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
||||||
num++;
|
num++;
|
||||||
|
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht)
|
||||||
|
num++;
|
||||||
if (num <= 8)
|
if (num <= 8)
|
||||||
return eid;
|
return eid;
|
||||||
num -= 8;
|
num -= 8;
|
||||||
|
@ -103,9 +113,17 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
|
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht) {
|
||||||
hapd->iface->num_rates >= 8)
|
count++;
|
||||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
if (count > 8)
|
||||||
|
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hapd->iconf->ieee80211ac && hapd->iconf->require_vht) {
|
||||||
|
count++;
|
||||||
|
if (count > 8)
|
||||||
|
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY;
|
||||||
|
}
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,6 +671,7 @@ struct ieee80211_vht_operation {
|
||||||
#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10))
|
#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10))
|
||||||
#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11))
|
#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11))
|
||||||
|
|
||||||
|
#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
|
||||||
#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
|
#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
|
||||||
|
|
||||||
/* VHT Defines */
|
/* VHT Defines */
|
||||||
|
|
Loading…
Reference in a new issue