wlan-ap-Telecominfraproject/feeds/ipq95xx/hostapd.old/patches/q02-047-hostapd-Fix-tx-power-envelope-for-non-PSD-countries.patch
John Crispin b9b03a6e38 ipq95xx: add Qualcomm wifi-7 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00

65 lines
2.3 KiB
Diff

From 11873ac90db3f8c73088a1d7b4bd44509b832348 Mon Sep 17 00:00:00 2001
From: Ramya Gnanasekar <quic_rgnanase@quicinc.com>
Date: Fri, 21 Oct 2022 19:20:46 +0530
Subject: [PATCH] hostapd: Fix tx power envelope for non PSD countries
TX power envelope will contain PSD value for countries.
In case of non PSD countries, it is expected to carry
max EIRP for the channel received from FW through reg
rules.
Updated the power value in IE with max EIRP power for
other non PSD countries
Signed-off-by: Ramya Gnanasekar <quic_rgnanase@quicinc.com>
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index b7c55ca..2563a26 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -7084,6 +7084,7 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
if (i == mode->num_channels)
return eid;
+ chan = &mode->channels[i];
/* For now, 6GHz has only support for Indoor AP type
* From IEEE P802.11ax/D7.0: An AP that is an
* Indoor Access Point per regulatory rules shall send at least
@@ -7105,9 +7106,12 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
*/
if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) {
tx_pwr_cat = REG_SUBORDINATE_CLIENT;
- psd = mode->psd_values[NL80211_REG_SUBORDINATE_CLIENT_LPI + ap_type];
+ psd = mode->psd_values[NL80211_REG_AP_LPI + ap_type];
#ifdef REG_DOM_SUPPORT_TX_POWER
- tx_pwr = psd * 2;
+ if (psd)
+ tx_pwr = psd * 2;
+ else
+ tx_pwr = chan->max_tx_power;
#else
tx_pwr = (hostapd_get_6g_tx_power(hapd, ap_type, tx_pwr_cat) * 2);
#endif /* REG_DOM_SUPPORT_TX_POWER */
@@ -7119,7 +7123,10 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
tx_pwr_cat = REG_DEFAULT_CLIENT;
psd = mode->psd_values[NL80211_REG_REGULAR_CLIENT_LPI + ap_type];
#ifdef REG_DOM_SUPPORT_TX_POWER
- tx_pwr = psd * 2;
+ if (psd)
+ tx_pwr = psd * 2;
+ else
+ tx_pwr = chan->max_tx_power;
#else
tx_pwr = (hostapd_get_6g_tx_power(hapd, ap_type, tx_pwr_cat) * 2);
#endif /* REG_DOM_SUPPORT_TX_POWER */
@@ -7181,7 +7188,6 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
* channel in Country element and local pwr constraint is specified
* for channel in this Power Constraint element.
*/
- chan = &mode->channels[i];
max_tx_power = chan->max_tx_power - local_pwr_constraint;
/*
--
2.17.1