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

Commit cbb9c275 authored by Lincoln Tran's avatar Lincoln Tran Committed by snandini
Browse files

qcacmn: Remove option LPI as option for AP pwr type

For devices operating in SAP mode, they must operate in VLP mode only,
unless in the countries which does not yet support VLP. In US and PR,
they currently operate in LPI, which will be updated when VLP support
comes. Remove the condition that allows the power type to be set to
LPI. Also, update the current channel list when the power type
changes.

Change-Id: I999862e44f213026ed11da2c08766d9bd77e3b7a
CRs-fixed: 2909703
parent ab2ed037
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -4494,41 +4494,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev,
	return status;
}

/**
 * reg_is_afc_available() - check if the automated frequency control system is
 * available, function will need to be updated once AFC is implemented
 * @pdev: Pointer to pdev structure
 *
 * Return: false since the AFC system is not yet available
 */
static bool reg_is_afc_available(struct wlan_objmgr_pdev *pdev)
{
	return false;
}

enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
{
	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
	enum reg_6g_ap_type ap_pwr_type = REG_INDOOR_AP;

	pdev_priv_obj = reg_get_pdev_obj(pdev);
	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
		reg_err("pdev reg component is NULL");
		return REG_VERY_LOW_POWER_AP;
	}

	if (reg_is_afc_available(pdev))
		ap_pwr_type = REG_STANDARD_POWER_AP;
	else if (pdev_priv_obj->indoor_chan_enabled)
		ap_pwr_type = REG_INDOOR_AP;
	else if (pdev_priv_obj->reg_6g_superid != FCC1_6G &&
		 pdev_priv_obj->reg_6g_superid != FCC1_6G_CL)
		ap_pwr_type = REG_VERY_LOW_POWER_AP;

	reg_set_cur_6g_ap_pwr_type(pdev, ap_pwr_type);

	return ap_pwr_type;
}
#endif

QDF_STATUS
+0 −15
Original line number Diff line number Diff line
@@ -1435,15 +1435,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev,
					    qdf_freq_t chan_freq,
					    bool *is_psd, uint16_t *tx_power,
					    uint16_t *eirp_psd_power);

/**
 * reg_decide_6g_ap_pwr_type() - Decide which power mode AP should operate in
 *
 * @pdev: pdev ptr
 *
 * Return: AP power type
 */
enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev);
#else
static inline QDF_STATUS
reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
@@ -1529,12 +1520,6 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev,
	*eirp_psd_power = 0;
	return QDF_STATUS_E_NOSUPPORT;
}

static inline enum reg_6g_ap_type
reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
{
	return REG_INDOOR_AP;
}
#endif

/**
+37 −0
Original line number Diff line number Diff line
@@ -742,6 +742,43 @@ bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq)
	return true;
}

#ifdef CONFIG_BAND_6GHZ
/**
 * reg_is_afc_available() - check if the automated frequency control system is
 * available, function will need to be updated once AFC is implemented
 * @pdev: Pointer to pdev structure
 *
 * Return: false since the AFC system is not yet available
 */
static bool reg_is_afc_available(struct wlan_objmgr_pdev *pdev)
{
	return false;
}

enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
{
	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
	enum reg_6g_ap_type ap_pwr_type = REG_INDOOR_AP;

	pdev_priv_obj = reg_get_pdev_obj(pdev);
	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
		reg_err("pdev reg component is NULL");
		return REG_VERY_LOW_POWER_AP;
	}

	if (reg_is_afc_available(pdev))
		ap_pwr_type = REG_STANDARD_POWER_AP;
	else if (pdev_priv_obj->reg_6g_superid != FCC1_6G &&
		 pdev_priv_obj->reg_6g_superid != FCC1_6G_CL)
		ap_pwr_type = REG_VERY_LOW_POWER_AP;

	reg_set_cur_6g_ap_pwr_type(pdev, ap_pwr_type);
	reg_compute_pdev_current_chan_list(pdev_priv_obj);

	return ap_pwr_type;
}
#endif /* CONFIG_BAND_6GHZ */

#endif /* CONFIG_REG_CLIENT */

/**
+22 −0
Original line number Diff line number Diff line
@@ -390,6 +390,22 @@ QDF_STATUS reg_set_curr_country(
bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
				struct cur_regulatory_info *regulat_info);

#ifdef CONFIG_BAND_6GHZ
/**
 * reg_decide_6g_ap_pwr_type() - Decide which power mode AP should operate in
 *
 * @pdev: pdev ptr
 *
 * Return: AP power type
 */
enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev);
#else
static inline enum reg_6g_ap_type
reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
{
	return REG_CURRENT_MAX_AP_TYPE;
}
#endif /* CONFIG_BAND_6GHZ */
#else
static inline QDF_STATUS reg_read_current_country(struct wlan_objmgr_psoc *psoc,
						  uint8_t *country_code)
@@ -488,6 +504,12 @@ bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq)
	return false;
}

static inline enum reg_6g_ap_type
reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
{
	return REG_CURRENT_MAX_AP_TYPE;
}

#endif

#if defined(WLAN_FEATURE_DSRC) && defined(CONFIG_REG_CLIENT)