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
This commit is contained in:
Priyadarshnee Srinivasan
2022-11-02 15:41:23 +05:30
committed by Madan Koyyalamudi
parent f8e6f61b2e
commit ed3f00bb01
4 changed files with 34 additions and 0 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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
};

View File

@@ -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);