AP: Publish the correct PSD value in RNR TBTT information field

According to IEEE P802.11-REVme/D4.0, 9.4.2.169.2 (Neighbor AP
Information field), the 20 MHz PSD subfield in the TBTT Information
field 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.

Fixes: 3db24e4eef ("RNR: Define element format")
Fixes: a7c152d6b8 ("RNR: Add data from neighbor database")
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2023-12-22 11:04:20 +02:00 committed by Jouni Malinen
parent 61c0f64360
commit bcad7fec65
2 changed files with 5 additions and 3 deletions

View file

@ -7504,7 +7504,7 @@ static u8 * hostapd_eid_nr_db(struct hostapd_data *hapd, u8 *eid,
/* BSS parameters */ /* BSS parameters */
*eid++ = nr->bss_parameters; *eid++ = nr->bss_parameters;
/* 20 MHz PSD */ /* 20 MHz PSD */
*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER - 1; *eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER;
len += RNR_TBTT_INFO_LEN; len += RNR_TBTT_INFO_LEN;
*size_offset = (eid - size_offset) - 1; *size_offset = (eid - size_offset) - 1;
} }
@ -7563,7 +7563,7 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd,
bss_param |= RNR_BSS_PARAM_CO_LOCATED; bss_param |= RNR_BSS_PARAM_CO_LOCATED;
*eid++ = bss_param; *eid++ = bss_param;
*eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER - 1; *eid++ = RNR_20_MHZ_PSD_MAX_TXPOWER;
if (!ap_mld) { if (!ap_mld) {
*len += RNR_TBTT_INFO_LEN; *len += RNR_TBTT_INFO_LEN;

View file

@ -2524,7 +2524,9 @@ struct ieee80211_he_mu_edca_parameter_set {
#define RNR_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4) #define RNR_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4)
#define RNR_BSS_PARAM_UNSOLIC_PROBE_RESP_ACTIVE BIT(5) #define RNR_BSS_PARAM_UNSOLIC_PROBE_RESP_ACTIVE BIT(5)
#define RNR_BSS_PARAM_CO_LOCATED BIT(6) #define RNR_BSS_PARAM_CO_LOCATED BIT(6)
#define RNR_20_MHZ_PSD_MAX_TXPOWER 255 /* dBm */ /* Maximum transmit power in Y/2 dBm (-127..126); 127 indicates no maximum
* transmit power is specified for the corresponding 20 MHz channel. */
#define RNR_20_MHZ_PSD_MAX_TXPOWER 127
/* IEEE P802.11be/D5.0, Figure 9-704c - MLD Parameters subfield format */ /* IEEE P802.11be/D5.0, Figure 9-704c - MLD Parameters subfield format */
/* B0..B7: AP MLD ID */ /* B0..B7: AP MLD ID */