[PATCH 4/7] AP: Publish correct PSD value in RNR TBTT information field

Andrei Otcheretianski andrei.otcheretianski at intel.com
Fri Dec 22 01:04:20 PST 2023


According to the IEEE P802.11-REVme/D2.0 the 20 MHz PSD subfield is a
signed value with valid range of -127 to +126, while +127 indicates "no
maximum transmit power is specified".
Fix the default value advertised.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/ap/ieee802_11.c          | 4 ++--
 src/common/ieee802_11_defs.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 12725011bd..92b368b997 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -7498,7 +7498,7 @@ static u8 * hostapd_eid_nr_db(struct hostapd_data *hapd, u8 *eid,
 		/* BSS parameters */
 		*eid++ = nr->bss_parameters;
 		/* 20 MHz PSD */
-		*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER - 1;
+		*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER;
 		len += RNR_TBTT_INFO_LEN;
 		*size_offset = (eid - size_offset) - 1;
 	}
@@ -7595,7 +7595,7 @@ static u8 * hostapd_eid_rnr_iface(struct hostapd_data *hapd,
 			bss_param |= RNR_BSS_PARAM_CO_LOCATED;
 
 			*eid++ = bss_param;
-			*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER - 1;
+			*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER;
 
 			if (!ap_mld) {
 				len += RNR_TBTT_INFO_LEN;
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 223fd7501d..aa42a5b730 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -2523,7 +2523,7 @@ struct ieee80211_he_mu_edca_parameter_set {
 #define RNR_BSS_PARAM_MEMBER_CO_LOCATED_ESS         BIT(4)
 #define RNR_BSS_PARAM_UNSOLIC_PROBE_RESP_ACTIVE     BIT(5)
 #define RNR_BSS_PARAM_CO_LOCATED                    BIT(6)
-#define RNR_20_MHZ_PSD_MAX_TXPOWER                  255 /* dBm */
+#define RNR_20_MHZ_PSD_MAX_TXPOWER                  127 /* Y/2 dBm */
 
 /* IEEE P802.11be/D2.3, 9.4.2.311 - EHT Operation element */
 
-- 
2.43.0




More information about the Hostap mailing list