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

Commit 06043e1d authored by Gururaj Pandurangi's avatar Gururaj Pandurangi Committed by Madan Koyyalamudi
Browse files

qcacmn: Add new API to update ap power type for 6G roam

Add a new API reg_get_6g_power_type to update ap power
type when STA roams in/out of 6GHz channel. It is invoked
from CSR during initial connection and sch beacon process
during roaming.

Change-Id: I0d20d4d7f291ec608b27a1611c8877c33f4b45b1
CRs-Fixed: 2968243
parent 357bf19f
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -321,6 +321,37 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
	return QDF_STATUS_SUCCESS;
}

#ifdef CONFIG_REG_CLIENT
QDF_STATUS
reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
			       enum reg_6g_ap_type *pwr_type_6g,
			       bool *ctry_code_match)
{
	*pwr_type_6g = REG_INDOOR_AP;

	if (qdf_mem_cmp(ap_ctry, sta_ctry, REG_ALPHA2_LEN)) {
		reg_debug("Country IE:%c%c, STA country:%c%c", ap_ctry[0],
			  ap_ctry[1], sta_ctry[0], sta_ctry[1]);
		*ctry_code_match = false;

		if (wlan_reg_is_us(sta_ctry)) {
			reg_err("US VLP not in place yet, connection not allowed");
			return QDF_STATUS_E_NOSUPPORT;
		}

		if (wlan_reg_is_etsi(sta_ctry)) {
			reg_debug("STA ctry:%c%c, doesn't match with AP ctry, switch to VLP",
				 sta_ctry[0], sta_ctry[1]);
			*pwr_type_6g = REG_VERY_LOW_POWER_AP;
		}
	} else {
		*ctry_code_match = true;
	}

	return QDF_STATUS_SUCCESS;
}
#endif

#ifdef CONFIG_CHAN_NUM_API
bool reg_is_passive_or_disable_ch(struct wlan_objmgr_pdev *pdev,
				  uint8_t chan)
+16 −0
Original line number Diff line number Diff line
@@ -309,6 +309,22 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
					    const uint8_t *country_alpha2,
					    enum country_src source);

#ifdef CONFIG_REG_CLIENT
/**
 * reg_get_6g_power_type_for_ctry() - Return power type for 6G based on cntry IE
 * @ap_ctry: ptr to country string in country IE
 * @sta_ctry: ptr to sta programmed country
 * @pwr_type_6g: ptr to 6G power type
 * @ctry_code_match: Check for country IE and sta country code match
 *
 * Return: QDF_STATUS
 */
QDF_STATUS
reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
			       enum reg_6g_ap_type *pwr_type_6g,
			       bool *ctry_code_match);
#endif

/**
 * reg_set_config_vars () - set configration variables
 * @psoc: psoc ptr
+17 −0
Original line number Diff line number Diff line
@@ -517,6 +517,23 @@ bool wlan_reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq);
QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
				   uint8_t *country);

#ifdef CONFIG_REG_CLIENT
/**
 * wlan_reg_get_6g_power_type_for_ctry() - Return power type for 6G based
 * on country IE
 * @ap_ctry: ptr to country string in country IE
 * @sta_ctry: ptr to sta programmed country
 * @pwr_type_6g: ptr to 6G power type
 * @ctry_code_match: Check for country IE and sta country code match
 *
 * Return: QDF_STATUS
 */
QDF_STATUS
wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
				    enum reg_6g_ap_type *pwr_type_6g,
				    bool *ctry_code_match);
#endif

#ifdef CONFIG_CHAN_NUM_API
/**
 * wlan_reg_chan_has_dfs_attribute() - check channel has dfs attribute flag
+11 −0
Original line number Diff line number Diff line
@@ -84,6 +84,17 @@ QDF_STATUS wlan_reg_get_max_5g_bw_from_regdomain(uint16_t regdmn,
	return reg_get_max_5g_bw_from_regdomain(regdmn, max_bw_5g);
}

#ifdef CONFIG_REG_CLIENT
QDF_STATUS
wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
				    enum reg_6g_ap_type *pwr_type_6g,
				    bool *ctry_code_match)
{
	return reg_get_6g_power_type_for_ctry(ap_ctry, sta_ctry, pwr_type_6g,
					      ctry_code_match);
}
#endif

#ifdef CONFIG_CHAN_NUM_API
/**
 * wlan_reg_get_channel_state() - Get channel state from regulatory