From 6549e02ce3bb3cd9a7b9db9e3824d54cb833aab9 Mon Sep 17 00:00:00 2001 From: Lincoln Tran Date: Tue, 30 Mar 2021 15:59:32 -0700 Subject: [PATCH] qcacld-3.0: Update the AP pwr mode when country changes Currently, the AP power mode is only updated during HE OP IE population. This causes the country IE to use the incorrect TX powers since HE OP is populated afterwards. Add a call to update the power mode whenever the country changes. Change-Id: I46641d12f1aed045dbe1becf4b96ff65c5746c5b CRs-fixed: 2910774 --- core/hdd/src/wlan_hdd_hostapd.c | 4 ++++ core/mac/src/sys/legacy/src/utils/src/parser_api.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 1435f6053a3f..da42cfb0a821 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6444,6 +6444,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, bool srd_channel_allowed, disable_nan = true; enum QDF_OPMODE vdev_opmode; uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS], i; + enum reg_6g_ap_type ap_pwr_type; hdd_enter(); @@ -6541,6 +6542,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, if (!status) return -EINVAL; + ap_pwr_type = wlan_reg_decide_6g_ap_pwr_type(hdd_ctx->pdev); + hdd_debug("selecting AP power type %d", ap_pwr_type); + vdev_opmode = wlan_vdev_mlme_get_opmode(adapter->vdev); ucfg_mlme_get_srd_master_mode_for_vdev(hdd_ctx->psoc, vdev_opmode, &srd_channel_allowed); diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index cfd9fabd7d8f..2114e8db070c 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -6357,6 +6357,7 @@ QDF_STATUS populate_dot11f_he_operation(struct mac_context *mac_ctx, struct pe_session *session, tDot11fIEhe_op *he_op) { + enum reg_6g_ap_type ap_pwr_type; qdf_mem_copy(he_op, &session->he_op, sizeof(*he_op)); he_op->present = 1; @@ -6379,8 +6380,8 @@ populate_dot11f_he_operation(struct mac_context *mac_ctx, session->curr_op_freq); he_op->oper_info_6g.info.dup_bcon = 0; he_op->oper_info_6g.info.min_rate = 0; - he_op->oper_info_6g.info.reg_info = - wlan_reg_decide_6g_ap_pwr_type(mac_ctx->pdev); + wlan_reg_get_cur_6g_ap_pwr_type(mac_ctx->pdev, &ap_pwr_type); + he_op->oper_info_6g.info.reg_info = ap_pwr_type; } lim_log_he_op(mac_ctx, he_op, session);