aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@codeaurora.org>2020-06-02 06:14:25 (GMT)
committerJouni Malinen <j@w1.fi>2020-06-10 18:23:24 (GMT)
commit6a34bd30077912075d440325872ac8089f0067f1 (patch)
tree100df97727323d351ac37ebdbfa5425f646781c5
parent9272ebae83e6caf087fa9ec72b459f997ca60331 (diff)
downloadhostap-6a34bd30077912075d440325872ac8089f0067f1.zip
hostap-6a34bd30077912075d440325872ac8089f0067f1.tar.gz
hostap-6a34bd30077912075d440325872ac8089f0067f1.tar.bz2
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>
-rw-r--r--src/ap/ieee802_11_he.c35
-rw-r--r--src/common/ieee802_11_defs.h37
2 files changed, 30 insertions, 42 deletions
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
index f1f2442..85b7140 100644
--- a/src/ap/ieee802_11_he.c
+++ b/src/ap/ieee802_11_he.c
@@ -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)
{
struct hostapd_hw_modes *mode = hapd->iface->current_mode;
+ struct he_capabilities *he_cap;
struct ieee80211_he_6ghz_band_cap *cap;
- u32 vht_cap;
- u8 ht_info;
- u8 params;
+ u16 capab;
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;
- vht_cap = hapd->iface->conf->vht_capab;
- ht_info = mode->a_mpdu_params;
+ he_cap = &mode->he_capab[IEEE80211_MODE_AP];
+ capab = he_cap->he_6ghz_capa;
+ capab |= HE_6GHZ_BAND_CAP_SMPS_DISABLED;
pos = eid;
*pos++ = WLAN_EID_EXTENSION;
*pos++ = 1 + sizeof(*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->a_mpdu_params = params;
- 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;
+ cap->capab = host_to_le16(capab);
pos += sizeof(*cap);
return pos;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index b7c6947..da0e7bd 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -2173,23 +2173,30 @@ struct ieee80211_he_6ghz_band_cap {
/* Minimum MPDU Start Spacing B0..B2
* Maximum A-MPDU Length Exponent B3..B5
* Maximum MPDU Length B6..B7 */
- u8 a_mpdu_params; /* B0..B7 */
- u8 info; /* B8..B15 */
+ le16 capab;
} STRUCT_PACKED;
-#define HE_6GHZ_BAND_CAP_MIN_MPDU_START_SPACE_MASK 0x7
-#define HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK 0x7
-#define HE_6GHZ_BAND_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 3
-#define HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_MASK 0x3
-#define HE_6GHZ_BAND_CAP_MAX_MPDU_LENGTH_SHIFT 6
-
-#define HE_6GHZ_BAND_CAP_SMPS_MASK (BIT(1) | BIT(2))
-#define HE_6GHZ_BAND_CAP_SMPS_STATIC 0
-#define HE_6GHZ_BAND_CAP_SMPS_DYNAMIC BIT(1)
-#define HE_6GHZ_BAND_CAP_SMPS_DISABLED (BIT(1) | BIT(2))
-#define HE_6GHZ_BAND_CAP_RD_RESPONDER BIT(3)
-#define HE_6GHZ_BAND_CAP_RX_ANTENNA_PATTERN BIT(4)
-#define HE_6GHZ_BAND_CAP_TX_ANTENNA_PATTERN BIT(5)
+#define HE_6GHZ_BAND_CAP_MIN_MPDU_START (BIT(0) | BIT(1) | BIT(2))
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_16K BIT(3)
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_32K BIT(4)
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_64K (BIT(3) | BIT(4))
+#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_MAX_AMPDU_LEN_EXP_512K (BIT(4) | BIT(5))
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_1024K (BIT(3) | BIT(4) | BIT(5))
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_MASK (BIT(3) | BIT(4) | BIT(5))
+#define HE_6GHZ_BAND_CAP_MAX_AMPDU_LEN_EXP_SHIFT 3
+#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_7991 BIT(6)
+#define HE_6GHZ_BAND_CAP_MAX_MPDU_LEN_11454 BIT(7)
+#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