Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87a1047e authored by Lincoln Tran's avatar Lincoln Tran Committed by Madan Koyyalamudi
Browse files

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
parent 821102a4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3529,6 +3529,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();

@@ -3560,6 +3561,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));
@@ -6403,7 +6407,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();

@@ -6501,9 +6504,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);