Browse Source

qcacld-3.0: Decide AP power type in init AP

Currently, the AP power type is only decided when the start AP
notification comes. Since ACS occurs before start AP, the power mode is
always the default of LPI. This could cause a SAP start issue if ACS
selects a frequency that is not valid for the updated power mode. Move
the call to select the power mode before either logic is invoked.

Change-Id: I6265dc242a8fae9174dc7efcf7154bdb2cf82a47
CRs-fixed: 2928987
Lincoln Tran 4 years ago
parent
commit
126b7047c7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      core/hdd/src/wlan_hdd_hostapd.c

+ 4 - 4
core/hdd/src/wlan_hdd_hostapd.c

@@ -3562,6 +3562,7 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	bool acs_with_more_param = 0;
 	uint8_t enable_sifs_burst = 0;
 	bool is_6g_sap_fd_enabled = 0;
+	enum reg_6g_ap_type ap_pwr_type;
 
 	hdd_enter();
 
@@ -3593,6 +3594,9 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	/* Allocate the Wireless Extensions state structure */
 	phostapdBuf = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
 
+	ap_pwr_type = wlan_reg_decide_6g_ap_pwr_type(hdd_ctx->pdev);
+	hdd_debug("selecting AP power type %d", ap_pwr_type);
+
 	sme_set_curr_device_mode(hdd_ctx->mac_handle, adapter->device_mode);
 	/* Zero the memory.  This zeros the profile structure. */
 	memset(phostapdBuf, 0, sizeof(struct hdd_hostapd_state));
@@ -6494,7 +6498,6 @@ 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();
 
@@ -6589,9 +6592,6 @@ 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);