u8 ppe_thres_hdr;
cap = (struct ieee80211_he_capabilities *) buf;
- cap_len = sizeof(*cap) - sizeof(cap->optional);
+ cap_len = sizeof(cap->he_mac_capab_info) +
+ sizeof(cap->he_phy_capab_info);
if (len < cap_len)
return 1;
const struct he_capabilities *he_capab;
u8 *pos = eid;
u8 ie_size = 0, mcs_nss_size, ppet_size;
+ u8 *epos;
if (!mode)
return eid;
HE_MAX_MAC_CAPAB_SIZE);
os_memcpy(cap->he_phy_capab_info, he_capab->phy_cap,
HE_MAX_PHY_CAPAB_SIZE);
- os_memcpy(cap->optional, he_capab->mcs, mcs_nss_size);
+ epos = (u8 *) &cap->he_basic_supported_mcs_set;
+ os_memcpy(epos, he_capab->mcs, mcs_nss_size);
+ epos += mcs_nss_size;
if (ppet_size)
- os_memcpy(&cap->optional[mcs_nss_size], he_capab->ppet,
- ppet_size);
+ os_memcpy(epos, he_capab->ppet, ppet_size);
if (hapd->iface->conf->he_phy_capab.he_su_beamformer)
cap->he_phy_capab_info[HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX] |=
{
u16 sta_rx_mcs_set, ap_tx_mcs_set;
u8 mcs_count = 0;
- const u16 *ap_mcs_set, *sta_mcs_set;
+ const u16 *ap_mcs_set;
+ const u8 *sta_mcs_set;
int i;
if (!hapd->iface->current_mode)
return 1;
ap_mcs_set = (u16 *) hapd->iface->current_mode->he_capab[opmode].mcs;
- sta_mcs_set = (u16 *) ((const struct ieee80211_he_capabilities *)
- sta_he_capab)->optional;
+ sta_mcs_set = (const u8 *) &((const struct ieee80211_he_capabilities *)
+ sta_he_capab)->he_basic_supported_mcs_set;
/*
* Disable HE capabilities for STAs for which there is not even a single
int j;
/* AP Tx MCS map vs. STA Rx MCS map */
- sta_rx_mcs_set = WPA_GET_LE16((const u8 *) &sta_mcs_set[i * 2]);
+ sta_rx_mcs_set = WPA_GET_LE16(&sta_mcs_set[i * 4]);
ap_tx_mcs_set = WPA_GET_LE16((const u8 *)
&ap_mcs_set[(i * 2) + 1]);
struct ieee80211_he_capabilities {
u8 he_mac_capab_info[6];
u8 he_phy_capab_info[11];
- /* Followed by 4, 8, or 12 octets of Supported HE-MCS And NSS Set field
- * and optional variable length PPE Thresholds field. */
- u8 optional[37];
+ /* Supported HE-MCS And NSS Set field */
+ struct {
+ le16 rx_map; /* Rx HE-MCS Map <= 80 MHz */
+ le16 tx_map; /* Tx HE-MCS Map <= 80 MHz */
+ /* Followed by 0, 4, or 8 octets of optional Rx/Tx HE-MCS maps
+ * for 160 MHz and 80+80 MHz. These are included in the
+ * optional[] below. */
+ } he_basic_supported_mcs_set;
+ /* Followed by optional variable length PPE Thresholds field. */
+ u8 optional[33];
} STRUCT_PACKED;
#define IEEE80211_HE_CAPAB_MIN_LEN (6 + 11)