Эх сурвалжийг харах

qcacmn: Add min_psd changes for best power mode

Add reg txops to fetch min_psd for punctured SP channels.
min_psd is computed from afc response. Using the min_psd power value,
EIRP is computed for the non-punctured BW using the formula
EIRP = PSD + 10 * log10(non-punctured BW).
Add an entry in bw_to_10log10_map for all possible non-punctured
bandwidth.

CRs-Fixed: 3329625
Change-Id: I79707cb233640342c521e41e9c4d776e121c1d6d
Priyadarshnee Srinivasan 2 жил өмнө
parent
commit
ed3f00bb01

+ 1 - 0
target_if/regulatory/src/target_if_reg.c

@@ -911,6 +911,7 @@ static void
 tgt_if_register_afc_callback(struct wlan_lmac_if_reg_tx_ops *reg_ops)
 {
 	reg_ops->send_afc_ind = tgt_if_regulatory_send_afc_cmd;
+	reg_ops->reg_get_min_psd = NULL;
 }
 #else
 static void

+ 6 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1104,6 +1104,12 @@ struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*unregister_afc_event_handler)
 				(struct wlan_objmgr_psoc *psoc, void *arg);
 	QDF_STATUS (*trigger_acs_for_afc)(struct wlan_objmgr_pdev *pdev);
+
+	QDF_STATUS (*reg_get_min_psd) (struct wlan_objmgr_pdev *pdev,
+				       qdf_freq_t primary_freq,
+				       qdf_freq_t cen320,
+				       uint16_t punc_pattern, uint16_t bw,
+				       int16_t *min_psd);
 #endif
 	bool (*is_chip_11be)(struct wlan_objmgr_psoc *psoc,
 			     uint16_t phy_id);

+ 6 - 0
umac/regulatory/core/src/reg_build_chan_list.c

@@ -4965,6 +4965,12 @@ static const struct bw_10log10_pair bw_to_10log10_map[] = {
 	{160, 22}, /* 10* 2.20411 = 22.0411 */
 #ifdef WLAN_FEATURE_11BE
 	{320, 25}, /* 10* 2.50514 = 25.0514 */
+	{ 60, 18}, /* 10* 1.77815 = 17.7815 */
+	{140, 21}, /* 10* 2.14612 = 21.4612 */
+	{120, 21}, /* 10* 2.07918 = 20.7918 */
+	{200, 23}, /* 10* 2.30102 = 23.0102 */
+	{240, 24}, /* 10* 2.38021 = 23.8021 */
+	{280, 24}, /* 10* 2.44715 = 24.4715 */
 #endif
 };
 

+ 21 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -9345,8 +9345,29 @@ reg_get_sp_eirp_for_punc_chans(struct wlan_objmgr_pdev *pdev,
 	int16_t min_psd = 0;
 	uint16_t afc_eirp_pwr = 0;
 	uint16_t non_punc_bw;
+	struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+
+	if (!psoc)
+		return 0;
+
+	reg_tx_ops = reg_get_psoc_tx_ops(psoc);
+
+	if (!reg_tx_ops->reg_get_min_psd)
+		return 0;
 
 	/* min_psd will be calculated here */
+	status = reg_tx_ops->reg_get_min_psd(pdev, freq, cen320,
+					     in_punc_pattern, bw,
+					     &min_psd);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_debug("Could not derive min_psd power for width %u, freq; %d, cen320: %d, in_punc: 0x%x\n",
+			  bw, freq, cen320, in_punc_pattern);
+		return 0;
+	}
 
 	non_punc_bw = reg_find_non_punctured_bw(bw, in_punc_pattern);