HE: Use device HE capability instead of HT/VHT for 6 GHz IEs

Previously, 6 GHz Band Capability element was derived from HT and VHT
capabilities of the device. Removes such unnecessary dependency by
relying directly on the HE capability.

In addition, clean up the struct ieee80211_he_6ghz_band_cap definition
to use a 16-bit little endian field instead of two 8-bit fields to match
the definition in P802.11ax.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
This commit is contained in:
Rajkumar Manoharan 2020-06-01 23:14:25 -07:00 committed by Jouni Malinen
parent 9272ebae83
commit 6a34bd3007
2 changed files with 30 additions and 42 deletions

View file

@ -314,45 +314,26 @@ u8 * hostapd_eid_spatial_reuse(struct hostapd_data *hapd, u8 *eid)
u8 * hostapd_eid_he_6ghz_band_cap(struct hostapd_data *hapd, u8 *eid) u8 * hostapd_eid_he_6ghz_band_cap(struct hostapd_data *hapd, u8 *eid)
{ {
struct hostapd_hw_modes *mode = hapd->iface->current_mode; struct hostapd_hw_modes *mode = hapd->iface->current_mode;
struct he_capabilities *he_cap;
struct ieee80211_he_6ghz_band_cap *cap; struct ieee80211_he_6ghz_band_cap *cap;
u32 vht_cap; u16 capab;
u8 ht_info;
u8 params;
u8 *pos; u8 *pos;
if (!mode || !is_6ghz_op_class(hapd->iconf->op_class)) if (!mode || !is_6ghz_op_class(hapd->iconf->op_class) ||
!is_6ghz_freq(hapd->iface->freq))
return eid; return eid;
vht_cap = hapd->iface->conf->vht_capab; he_cap = &mode->he_capab[IEEE80211_MODE_AP];
ht_info = mode->a_mpdu_params; capab = he_cap->he_6ghz_capa;
capab |= HE_6GHZ_BAND_CAP_SMPS_DISABLED;
pos = eid; pos = eid;
*pos++ = WLAN_EID_EXTENSION; *pos++ = WLAN_EID_EXTENSION;
*pos++ = 1 + sizeof(*cap); *pos++ = 1 + sizeof(*cap);
*pos++ = WLAN_EID_EXT_HE_6GHZ_BAND_CAP; *pos++ = WLAN_EID_EXT_HE_6GHZ_BAND_CAP;
/* Minimum MPDU Start Spacing B0..B2 */
params = (ht_info >> 2) & HE_6GHZ_BAND_CAP_MIN_MPDU_START_SPACE_MASK;
/* Maximum A-MPDU Length Exponent B3..B5 */
params |= ((((vht_cap & VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX) >>
VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT) &
HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) <<
HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
/* Maximum MPDU Length B6..B7 */
params |= ((((vht_cap & VHT_CAP_MAX_MPDU_LENGTH_MASK) >>
VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT) &
HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_MASK) <<
HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_SHIFT);
cap = (struct ieee80211_he_6ghz_band_cap *) pos; cap = (struct ieee80211_he_6ghz_band_cap *) pos;
cap->a_mpdu_params = params; cap->capab = host_to_le16(capab);
cap->info = HE_6GHZ_BAND_CAP_SMPS_DISABLED;
if (vht_cap & VHT_CAP_RX_ANTENNA_PATTERN)
cap->info |= HE_6GHZ_BAND_CAP_RX_ANTENNA_PATTERN;
if (vht_cap & VHT_CAP_TX_ANTENNA_PATTERN)
cap->info |= HE_6GHZ_BAND_CAP_TX_ANTENNA_PATTERN;
pos += sizeof(*cap); pos += sizeof(*cap);
return pos; return pos;

View file

@ -2173,23 +2173,30 @@ struct ieee80211_he_6ghz_band_cap {
/* Minimum MPDU Start Spacing B0..B2 /* Minimum MPDU Start Spacing B0..B2
* Maximum A-MPDU Length Exponent B3..B5 * Maximum A-MPDU Length Exponent B3..B5
* Maximum MPDU Length B6..B7 */ * Maximum MPDU Length B6..B7 */
u8 a_mpdu_params; /* B0..B7 */ le16 capab;
u8 info; /* B8..B15 */
} STRUCT_PACKED; } STRUCT_PACKED;
#define HE_6GHZ_BAND_CAP_MIN_MPDU_START_SPACE_MASK 0x7 #define HE_6GHZ_BAND_CAP_MIN_MPDU_START (BIT(0) | BIT(1) | BIT(2))
#define HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK 0x7 #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_16K BIT(3)
#define HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 3 #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_32K BIT(4)
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_MASK 0x3 #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_64K (BIT(3) | BIT(4))
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_SHIFT 6 #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_128K BIT(5)
#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_256K (BIT(3) | BIT(5))
#define HE_6GHZ_BAND_CAP_SMPS_MASK (BIT(1) | BIT(2)) #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_512K (BIT(4) | BIT(5))
#define HE_6GHZ_BAND_CAP_SMPS_STATIC 0 #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_1024K (BIT(3) | BIT(4) | BIT(5))
#define HE_6GHZ_BAND_CAP_SMPS_DYNAMIC BIT(1) #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_MASK (BIT(3) | BIT(4) | BIT(5))
#define HE_6GHZ_BAND_CAP_SMPS_DISABLED (BIT(1) | BIT(2)) #define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_SHIFT 3
#define HE_6GHZ_BAND_CAP_RD_RESPONDER BIT(3) #define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_7991 BIT(6)
#define HE_6GHZ_BAND_CAP_RX_ANTENNA_PATTERN BIT(4) #define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_11454 BIT(7)
#define HE_6GHZ_BAND_CAP_TX_ANTENNA_PATTERN BIT(5) #define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_MASK (BIT(6) | BIT(7))
#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_SHIFT 6
#define HE_6GHZ_BAND_CAP_SMPS_MASK (BIT(9) | BIT(10))
#define HE_6GHZ_BAND_CAP_SMPS_STATIC 0
#define HE_6GHZ_BAND_CAP_SMPS_DYNAMIC BIT(9)
#define HE_6GHZ_BAND_CAP_SMPS_DISABLED (BIT(9) | BIT(10))
#define HE_6GHZ_BAND_CAP_RD_RESPONDER BIT(11)
#define HE_6GHZ_BAND_CAP_RX_ANTPAT_CONS BIT(12)
#define HE_6GHZ_BAND_CAP_TX_ANTPAT_CONS BIT(13)
/* /*
* IEEE P802.11ax/D4.0, 9.4.2.246 Spatial Reuse Parameter Set element * IEEE P802.11ax/D4.0, 9.4.2.246 Spatial Reuse Parameter Set element