qcacmn: Add powermode APIs under a new macro

Use  CONFIG_REG_ 6G_PWR_MODE for the new API.
Use "_for_pwrmode" as suffix for the new functions.

Change-Id: I9b84944a59062277b76bc48877c47ea5afada0ec
CRs-Fixed: 3133023
This commit is contained in:
Abhijit Pradhan 2022-02-17 16:29:15 +05:30 committed by Madan Koyyalamudi
parent e7b559d010
commit 3f95481d0e
16 changed files with 1223 additions and 189 deletions

View File

@ -219,9 +219,9 @@ void target_if_vdev_start_link_handler(struct wlan_objmgr_vdev *vdev,
is_dfs = wlan_reg_is_dfs_for_freq(pdev, ch_freq);
ch_state =
wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, ch_freq,
ch_width,
REG_CURRENT_PWR_MODE);
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
pdev, ch_freq, ch_width,
REG_CURRENT_PWR_MODE);
rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
if (!rx_ops || !rx_ops->psoc_get_wakelock_info) {
mlme_err("psoc_id:%d No Rx Ops",
@ -238,7 +238,8 @@ void target_if_vdev_start_link_handler(struct wlan_objmgr_vdev *vdev,
prev_ch_is_dfs = wlan_reg_is_dfs_for_freq(pdev,
prev_ch_freq);
prev_ch_state =
wlan_reg_get_5g_bonded_channel_state_for_freq(pdev,
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
pdev,
prev_ch_freq, prev_ch_width,
REG_CURRENT_PWR_MODE);
/*
@ -299,7 +300,7 @@ void target_if_vdev_stop_link_handler(struct wlan_objmgr_vdev *vdev)
psoc_wakelock = rx_ops->psoc_get_wakelock_info(psoc);
if (wlan_vdev_mlme_get_opmode(vdev) == QDF_SAP_MODE)
if (is_dfs ||
(wlan_reg_get_5g_bonded_channel_state_for_freq(
(wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
pdev,
ch_freq,
ch_width,

View File

@ -3955,7 +3955,7 @@ target_if_calculate_center_freq(struct target_if_spectral *spectral,
const struct bonded_channel_freq *bonded_chan_ptr = NULL;
enum channel_state state;
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
state = wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode
(spectral->pdev_obj, chan_freq, agile_ch_width,
&bonded_chan_ptr, REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
@ -4035,7 +4035,8 @@ target_if_validate_center_freq(struct target_if_spectral *spectral,
uint32_t calulated_center_freq;
enum channel_state st;
st = wlan_reg_get_5g_bonded_channel_and_state_for_freq
st =
wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode
(pdev, center_freq + FREQ_OFFSET_10MHZ,
agile_ch_width,
&bonded_chan_ptr,
@ -4145,7 +4146,7 @@ target_if_is_agile_span_overlap_with_operating_span
} else {
enum channel_state state;
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
state = wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode
(pdev, chan_freq, op_ch_width, &bonded_chan_ptr,
REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
@ -4297,9 +4298,12 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
ch_params.center_freq_seg1 = wlan_reg_freq_to_chan(pdev, cfreq2);
ch_params.mhz_freq_seg1 = cfreq2;
ch_params.ch_width = CH_WIDTH_80P80MHZ;
wlan_reg_set_channel_params_for_freq(pdev, cfreq1 - FREQ_OFFSET_10MHZ,
0, &ch_params,
REG_CURRENT_PWR_MODE);
wlan_reg_set_channel_params_for_pwrmode(
pdev,
cfreq1 - FREQ_OFFSET_10MHZ,
0,
&ch_params,
REG_CURRENT_PWR_MODE);
if (ch_params.ch_width != CH_WIDTH_80P80MHZ)
return false;
@ -4308,7 +4312,7 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
ch_params.mhz_freq_seg1 != cfreq2)
return false;
chan_state1 = wlan_reg_get_5g_bonded_channel_state_for_freq(
chan_state1 = wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
pdev,
ch_params.mhz_freq_seg0 - FREQ_OFFSET_10MHZ,
CH_WIDTH_80MHZ,
@ -4317,7 +4321,7 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
(chan_state1 == CHANNEL_STATE_INVALID))
return false;
chan_state2 = wlan_reg_get_5g_bonded_channel_state_for_freq(
chan_state2 = wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
pdev,
ch_params.mhz_freq_seg1 - FREQ_OFFSET_10MHZ,
CH_WIDTH_80MHZ,

View File

@ -893,7 +893,8 @@ target_if_spectral_unify_cfreq_format(struct target_if_spectral *spectral,
enum channel_state state;
/* Get the 80MHz channel containing the pri20 freq */
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
state =
wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode
(spectral->pdev_obj, pri20_freq, CH_WIDTH_80MHZ,
&bonded_chan_ptr, REG_CURRENT_PWR_MODE);

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -783,7 +784,10 @@ static uint32_t wlan_dcs_get_pcl_for_sap(struct wlan_objmgr_vdev *vdev,
for (i = 0, j = 0; i < pcl->pcl_len && i < freq_list_sz; i++) {
freq = (qdf_freq_t)pcl->pcl_list[i];
state = wlan_reg_get_channel_state_for_freq(pdev, freq);
state = wlan_reg_get_channel_state_for_pwrmode(
pdev,
freq,
REG_CURRENT_PWR_MODE);
if (state != CHANNEL_STATE_ENABLE)
continue;
@ -821,7 +825,10 @@ static uint32_t wlan_dcs_get_pcl_for_sap(struct wlan_objmgr_vdev *vdev,
for (i = 0, j = 0; i < NUM_CHANNELS && i < freq_list_sz; i++) {
freq = cur_chan_list[i].center_freq;
state = wlan_reg_get_channel_state_for_freq(pdev, freq);
state = wlan_reg_get_channel_state_for_pwrmode(
pdev,
freq,
REG_CURRENT_PWR_MODE);
if (state != CHANNEL_STATE_ENABLE)
continue;
@ -1029,8 +1036,9 @@ wlan_dcs_get_available_chan_for_bw(struct wlan_objmgr_pdev *pdev,
continue;
}
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq(
pdev, freq, bw, &bonded_chan_ptr);
state = wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode(
pdev, freq, bw, &bonded_chan_ptr,
REG_CURRENT_PWR_MODE);
if (state != CHANNEL_STATE_ENABLE)
continue;

View File

@ -1566,7 +1566,7 @@ uint16_t dfs_prepare_random_channel_for_freq(struct wlan_dfs *dfs,
if ((*chan_wd == DFS_CH_WIDTH_80P80MHZ) &&
(flags & DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED) &&
target_freq) {
wlan_reg_set_channel_params_for_freq(
wlan_reg_set_channel_params_for_pwrmode(
dfs->dfs_pdev_obj,
target_freq,
0, chan_params,

View File

@ -915,7 +915,8 @@ QDF_STATUS utils_dfs_get_vdev_random_channel_for_freq(
"input width=%d", chan_params->ch_width);
if (*target_chan_freq) {
wlan_reg_set_channel_params_for_freq(pdev, *target_chan_freq, 0,
wlan_reg_set_channel_params_for_pwrmode(
pdev, *target_chan_freq, 0,
chan_params,
REG_CURRENT_PWR_MODE);
utils_dfs_get_max_phy_mode(pdev, hw_mode);
@ -981,9 +982,9 @@ QDF_STATUS utils_dfs_bw_reduced_channel_for_freq(
}
dfs_curchan = dfs->dfs_curchan;
ch_state =
wlan_reg_get_channel_state_for_freq(pdev,
dfs_curchan->dfs_ch_freq,
REG_CURRENT_PWR_MODE);
wlan_reg_get_channel_state_for_pwrmode(pdev,
dfs_curchan->dfs_ch_freq,
REG_CURRENT_PWR_MODE);
if (ch_state == CHANNEL_STATE_DFS ||
ch_state == CHANNEL_STATE_ENABLE) {
@ -1000,10 +1001,10 @@ QDF_STATUS utils_dfs_bw_reduced_channel_for_freq(
dfs_curchan->dfs_ch_mhz_freq_seg1;
chan_params->mhz_freq_seg1 =
dfs_curchan->dfs_ch_mhz_freq_seg2;
wlan_reg_set_channel_params_for_freq(pdev,
dfs_curchan->dfs_ch_freq,
0, chan_params,
REG_CURRENT_PWR_MODE);
wlan_reg_set_channel_params_for_pwrmode(pdev, dfs_curchan->
dfs_ch_freq,
0, chan_params,
REG_CURRENT_PWR_MODE);
*target_chan_freq = dfs_curchan->dfs_ch_freq;
utils_dfs_get_max_phy_mode(pdev, hw_mode);

View File

@ -85,7 +85,7 @@ static QDF_STATUS cm_fill_scan_req(struct cnx_mgr *cm_ctx,
ch_freq = cm_req->req.chan_freq;
if (ch_freq) {
state = wlan_reg_get_channel_state_for_freq(
state = wlan_reg_get_channel_state_for_pwrmode(
pdev,
ch_freq,
REG_CURRENT_PWR_MODE);

View File

@ -2366,9 +2366,10 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj
pdev_priv_obj->
cur_chan_list);
reg_modify_chan_list_for_max_chwidth(pdev_priv_obj->pdev_ptr,
pdev_priv_obj->cur_chan_list,
REG_CURRENT_PWR_MODE);
reg_modify_chan_list_for_max_chwidth_for_pwrmode(
pdev_priv_obj->pdev_ptr,
pdev_priv_obj->cur_chan_list,
REG_CURRENT_PWR_MODE);
reg_modify_chan_list_for_6g_edge_channels(pdev_priv_obj->pdev_ptr,
pdev_priv_obj->

View File

@ -1224,8 +1224,10 @@ void reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
}
chan_params.ch_width = CH_WIDTH_MAX;
reg_set_channel_params_for_freq(pdev, freq, 0, &chan_params,
REG_CURRENT_PWR_MODE);
reg_set_channel_params_for_pwrmode(pdev, freq,
0,
&chan_params,
REG_CURRENT_PWR_MODE);
reg_freq_width_to_chan_op_class(pdev, freq,
reg_get_bw_value(chan_params.ch_width),

File diff suppressed because it is too large Load Diff

View File

@ -879,14 +879,27 @@ reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
* reg_get_channel_state_for_freq() - Get channel state from regulatory
* @pdev: Pointer to pdev
* @freq: channel center frequency.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type);
qdf_freq_t freq);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* reg_get_channel_state_for_freq() - Get channel state from regulatory
* @pdev: Pointer to pdev
* @freq: channel center frequency.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
reg_get_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type);
#endif
#ifdef CONFIG_REG_CLIENT
/**
@ -915,9 +928,16 @@ enum channel_state reg_get_channel_state_from_secondary_list_for_freq(
enum channel_state
reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
struct ch_params *ch_params);
#ifdef CONFIG_REG_6G_PWRMODE
enum channel_state
reg_get_5g_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
/**
* reg_get_2g_bonded_channel_state_for_freq() - Get channel state for 2G
@ -943,17 +963,35 @@ reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
* @freq: Channel center frequency.
* @sec_ch_2g_freq: Secondary 2G channel frequency
* @ch_params: pointer to the channel parameters.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
struct ch_params *ch_params);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* reg_set_channel_params_for_pwrmode () - Sets channel parameteres for given
* bandwidth
* @pdev: Pointer to pdev
* @freq: Channel center frequency.
* @sec_ch_2g_freq: Secondary 2G channel frequency
* @ch_params: pointer to the channel parameters.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void reg_set_channel_params_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
#ifdef WLAN_FEATURE_11BE
/**
* reg_fill_channel_list() - Fills an array of ch_params (list of
* channels) for the given channel width and primary freq.
@ -972,15 +1010,42 @@ void reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
*
* Return: None
*/
#ifdef WLAN_FEATURE_11BE
void
reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode);
struct reg_channel_list *chan_list);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* reg_fill_channel_list_for_pwrmode() - Fills an array of ch_params (list of
* channels) for the given channel width and primary freq.
* If 320 band_center is given, ch_params corresponding to the
* given band_center is filled.
*
* @pdev: Pointer to pdev
* @freq: Center frequency of the primary channel in MHz
* @sec_ch_2g_freq: Secondary 2G channel frequency in MHZ
* @ch_width: Input channel width.
* @band_center: Center frequency of the 320MHZ channel.
* @chan_list: Pointer to struct reg_channel_list to be filled (Output).
* The caller is supposed to provide enough storage for the elements
* in the list.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void
reg_fill_channel_list_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode);
#endif
/**
* reg_is_punc_bitmap_valid() - is puncture bitmap valid or not
@ -1124,8 +1189,29 @@ reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width ch_width,
const struct bonded_channel_freq
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types in_6g_pwr_mode);
**bonded_chan_ptr_ptr);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* reg_get_5g_bonded_channel_for_pwrmode()- Return the channel state for a
* 5G or 6G channel frequency based on the channel width and bonded channel
* @pdev: Pointer to pdev.
* @freq: Channel center frequency.
* @ch_width: Channel Width.
* @bonded_chan_ptr_ptr: Pointer to bonded_channel_freq.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: Channel State
*/
enum channel_state
reg_get_5g_bonded_channel_for_pwrmode(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width ch_width,
const struct bonded_channel_freq
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
/**
* reg_is_disable_for_freq() - Check if the given channel frequency in
@ -1136,8 +1222,21 @@ reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
*
* Return: True if channel state is disabled, else false
*/
bool reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode);
bool reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* reg_is_disable_for_pwrmode() - Check if the given channel frequency in
* disable state
* @pdev: Pointer to pdev
* @freq: Channel frequency
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: True if channel state is disabled, else false
*/
bool reg_is_disable_for_pwrmode(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode);
#endif
#ifdef CONFIG_REG_CLIENT
/**
@ -1699,7 +1798,8 @@ reg_find_txpower_from_6g_list(qdf_freq_t freq,
void reg_update_max_phymode_chwidth_for_pdev(struct wlan_objmgr_pdev *pdev);
/**
* reg_modify_chan_list_for_max_chwidth() - Update the maximum bandwidth for
* reg_modify_chan_list_for_max_chwidth_for_pwrmode() - Update the maximum
* bandwidth for
* each channel in the current channel list.
* @pdev: Pointer to PDEV object.
* @cur_chan_list: Pointer to the pdev current channel list.
@ -1717,10 +1817,11 @@ void reg_update_max_phymode_chwidth_for_pdev(struct wlan_objmgr_pdev *pdev);
* capabilities and the availability of adjacent channels.
*/
void
reg_modify_chan_list_for_max_chwidth(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *cur_chan_list,
enum supported_6g_pwr_types
in_6g_pwr_mode);
reg_modify_chan_list_for_max_chwidth_for_pwrmode(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel
*cur_chan_list,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#else
static inline void
@ -1729,12 +1830,13 @@ reg_update_max_phymode_chwidth_for_pdev(struct wlan_objmgr_pdev *pdev)
}
static inline void
reg_modify_chan_list_for_max_chwidth(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *cur_chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode)
reg_modify_chan_list_for_max_chwidth_for_pwrmode(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel
*cur_chan_list,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
}
#endif /* CONFIG_HOST_FIND_CHAN */
/**

View File

@ -790,7 +790,6 @@ wlan_reg_get_6g_afc_chan_list(struct wlan_objmgr_pdev *pdev,
* @freq: channel frequency
* @bw: channel band width
* @sec_freq: secondary frequency
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
@ -798,9 +797,27 @@ enum channel_state
wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode);
qdf_freq_t sec_freq);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_get_bonded_channel_state_for_pwrmode() - Get bonded channel freq
* state
* @freq: channel frequency
* @bw: channel band width
* @sec_freq: secondary frequency
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
/**
* wlan_reg_set_dfs_region() - set the dfs region
@ -1298,22 +1315,38 @@ QDF_STATUS
wlan_reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
struct channel_power *ch_list,
uint8_t *num_chan);
/**
* wlan_reg_get_5g_bonded_channel_state_for_freq() - Get 5G bonded channel state
* @pdev: The physical dev to program country code or regdomain
* @freq: channel frequency.
* @bw: channel band width
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_get_5g_bonded_channel_state_for_pwrmode() - Get 5G bonded channel
* state.
* @pdev: The physical dev to program country code or regdomain
* @freq: channel frequency.
* @bw: channel band width
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type);
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type);
#endif
/**
* wlan_reg_get_2g_bonded_channel_state_for_freq() - Get 2G bonded channel state
* @pdev: The physical dev to program country code or regdomain
@ -1333,14 +1366,28 @@ wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
* wlan_reg_get_channel_state_for_freq() - Get channel state from regulatory
* @pdev: Pointer to pdev
* @freq: channel center frequency.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_get_channel_state_for_pwrmode() - Get channel state from regulatory
* @pdev: Pointer to pdev
* @freq: channel center frequency.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_channel_state_for_pwrmode(
struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type);
#endif
#ifdef CONFIG_REG_CLIENT
/**
@ -1356,6 +1403,7 @@ enum channel_state wlan_reg_get_channel_state_from_secondary_list_for_freq(
qdf_freq_t freq);
#endif
#ifdef WLAN_FEATURE_11BE
/**
* wlan_reg_fill_channel_list() - Fills the reg_channel_list (list of channels)
* @pdev: Pointer to struct wlan_objmgr_pdev.
@ -1364,18 +1412,15 @@ enum channel_state wlan_reg_get_channel_state_from_secondary_list_for_freq(
* @ch_width: Channel width of type 'enum phy_ch_width'.
* @band_center_320: Center frequency of 320MHZ channel.
* @chan_list: Pointer to struct reg_channel_list to be filled (Output param).
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
#ifdef WLAN_FEATURE_11BE
void wlan_reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_type);
struct reg_channel_list *chan_list);
/**
* wlan_reg_is_punc_bitmap_valid() - is puncture bitmap valid or not
@ -1396,6 +1441,29 @@ bool wlan_reg_is_punc_bitmap_valid(enum phy_ch_width bw,
*/
void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
bool is_create_punc_bitmap);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_fill_channel_list_for_pwrmode() - Fills the reg_channel_list
* (list of channels)
* @pdev: Pointer to struct wlan_objmgr_pdev.
* @freq: Center frequency of the primary channel in MHz
* @sec_ch_2g_freq: Secondary channel center frequency.
* @ch_width: Channel width of type 'enum phy_ch_width'.
* @band_center_320: Center frequency of 320MHZ channel.
* @chan_list: Pointer to struct reg_channel_list to be filled (Output param).
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void wlan_reg_fill_channel_list_for_pwrmode(
struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_type);
#endif
#else
static inline void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
bool is_create_punc_bitmap)
@ -1410,16 +1478,33 @@ static inline void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
* @freq: channel center frequency.
* @sec_ch_2g_freq: Secondary channel center frequency.
* @ch_params: pointer to the channel parameters.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void wlan_reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
struct ch_params *ch_params);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_set_channel_params_for_pwrmode() - Sets channel parameteres for
* given bandwidth
* @pdev: The physical dev to program country code or regdomain
* @freq: channel center frequency.
* @sec_ch_2g_freq: Secondary channel center frequency.
* @ch_params: pointer to the channel parameters.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: None
*/
void wlan_reg_set_channel_params_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
/**
* wlan_reg_get_channel_cfreq_reg_power_for_freq() - Provide the channel
@ -1476,13 +1561,25 @@ bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
* wlan_reg_is_disable_for_freq() - Checks chan state for disabled
* @pdev: pdev ptr
* @freq: Channel center frequency
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: true or false
*/
bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_is_disable_for_pwrmode() - Checks chan state for disabled
* @pdev: pdev ptr
* @freq: Channel center frequency
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: true or false
*/
bool wlan_reg_is_disable_for_pwrmode(
struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode);
#endif
#ifdef CONFIG_REG_CLIENT
/**
@ -1615,7 +1712,6 @@ bool wlan_reg_is_freq_in_country_opclass(struct wlan_objmgr_pdev *pdev,
const uint8_t country[3],
uint8_t op_class,
qdf_freq_t chan_freq);
/**
* wlan_reg_get_5g_bonded_channel_and_state_for_freq()- Return the channel
* state for a 5G or 6G channel frequency based on the channel width and
@ -1624,12 +1720,33 @@ bool wlan_reg_is_freq_in_country_opclass(struct wlan_objmgr_pdev *pdev,
* @freq: Channel center frequency.
* @bw Channel Width.
* @bonded_chan_ptr_ptr: Pointer to bonded_channel_freq.
*
* Return: Channel State
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr);
#ifdef CONFIG_REG_6G_PWRMODE
/**
* wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode()- Return the channel
* state for a 5G or 6G channel frequency based on the channel width and
* bonded channel.
* @pdev: Pointer to pdev.
* @freq: Channel center frequency.
* @bw Channel Width.
* @bonded_chan_ptr_ptr: Pointer to bonded_channel_freq.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: Channel State
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode(
struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
@ -1637,6 +1754,7 @@ wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif
#endif /*CONFIG_CHAN_FREQ_API */
/**

View File

@ -1056,12 +1056,20 @@ bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
}
bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode)
qdf_freq_t freq)
{
return reg_is_disable_for_freq(pdev, freq, in_6g_pwr_mode);
return reg_is_disable_for_freq(pdev, freq);
}
#ifdef CONFIG_REG_6G_PWRMODE
bool wlan_reg_is_disable_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
return reg_is_disable_for_pwrmode(pdev, freq, in_6g_pwr_mode);
}
#endif
#ifdef CONFIG_REG_CLIENT
bool wlan_reg_is_disable_in_secondary_list_for_freq(
struct wlan_objmgr_pdev *pdev,
@ -1104,9 +1112,7 @@ wlan_reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type)
enum phy_ch_width bw)
{
struct ch_params params = {0};
@ -1119,8 +1125,7 @@ wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params,
in_6g_pwr_type);
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
@ -1130,21 +1135,36 @@ qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type)
enum phy_ch_width bw)
{
struct ch_params params = {0};
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params,
in_6g_pwr_type);
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
#endif
#ifdef CONFIG_REG_6G_PWRMODE
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
struct ch_params params = {0};
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_pwrmode(pdev, freq, &params,
in_6g_pwr_type);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_pwrmode);
#endif
enum channel_state
wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
@ -1160,29 +1180,58 @@ wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
void wlan_reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode)
struct ch_params *ch_params)
{
reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params,
in_6g_pwr_mode);
reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params);
}
qdf_export_symbol(wlan_reg_set_channel_params_for_freq);
#ifdef CONFIG_REG_6G_PWRMODE
void wlan_reg_set_channel_params_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
reg_set_channel_params_for_pwrmode(pdev, freq, sec_ch_2g_freq,
ch_params,
in_6g_pwr_mode);
}
qdf_export_symbol(wlan_reg_set_channel_params_for_pwrmode);
#endif
#ifdef WLAN_FEATURE_11BE
void wlan_reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_type)
struct reg_channel_list *chan_list)
{
reg_fill_channel_list(pdev, freq, sec_ch_2g_freq, ch_width,
band_center_320, chan_list, in_6g_pwr_type);
band_center_320, chan_list);
}
#ifdef CONFIG_REG_6G_PWRMODE
void
wlan_reg_fill_channel_list_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
reg_fill_channel_list_for_pwrmode(pdev, freq, sec_ch_2g_freq, ch_width,
band_center_320, chan_list,
in_6g_pwr_type);
}
#endif /* CONFIG_REG_6G_PWRMODE */
bool wlan_reg_is_punc_bitmap_valid(enum phy_ch_width bw,
uint16_t puncture_bitmap)
{
@ -1194,16 +1243,26 @@ void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
{
reg_set_create_punc_bitmap(ch_params, is_create_punc_bitmap);
}
#endif
#endif /* WLAN_FEATURE_11BE */
enum channel_state
wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type)
qdf_freq_t freq)
{
return reg_get_channel_state_for_freq(pdev, freq, in_6g_pwr_type);
return reg_get_channel_state_for_freq(pdev, freq);
}
#ifdef CONFIG_REG_6G_PWRMODE
enum channel_state
wlan_reg_get_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
return reg_get_channel_state_for_pwrmode(pdev, freq, in_6g_pwr_type);
}
#endif
#ifdef CONFIG_REG_CLIENT
enum channel_state wlan_reg_get_channel_state_from_secondary_list_for_freq(
struct wlan_objmgr_pdev *pdev,
@ -1292,6 +1351,23 @@ bool wlan_reg_is_freq_in_country_opclass(struct wlan_objmgr_pdev *pdev,
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr)
{
/*
* Get channel frequencies and state from regulatory
*/
return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
bonded_chan_ptr_ptr);
}
#ifdef CONFIG_REG_6G_PWRMODE
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode(
struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
@ -1303,19 +1379,20 @@ wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
/*
* Get channel frequencies and state from regulatory
*/
return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
bonded_chan_ptr_ptr,
in_6g_pwr_mode);
return reg_get_5g_bonded_channel_for_pwrmode(pdev, freq, bw,
bonded_chan_ptr_ptr,
in_6g_pwr_mode);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode);
#endif
#if defined(WLAN_FEATURE_11BE) && defined(CONFIG_REG_CLIENT)
enum channel_state
wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode)
qdf_freq_t sec_freq)
{
if (WLAN_REG_IS_24GHZ_CH_FREQ(freq))
return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
@ -1324,16 +1401,14 @@ wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
const struct bonded_channel_freq *bonded_chan_ptr_ptr = NULL;
return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
&bonded_chan_ptr_ptr,
in_6g_pwr_mode);
&bonded_chan_ptr_ptr);
} else {
struct ch_params params = {0};
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
&params,
in_6g_pwr_mode);
&params);
}
}
@ -1344,9 +1419,7 @@ enum channel_state
wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode)
qdf_freq_t sec_freq)
{
if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) {
return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
@ -1357,12 +1430,37 @@ wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
&params);
}
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
#ifdef CONFIG_REG_6G_PWRMODE
enum channel_state
wlan_reg_get_bonded_channel_state_for_pwrmode(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
enum phy_ch_width bw,
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
if (WLAN_REG_IS_24GHZ_CH_FREQ(freq)) {
return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
sec_freq, bw);
} else {
struct ch_params params = {0};
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_pwrmode(pdev, freq,
&params,
in_6g_pwr_mode);
}
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
qdf_export_symbol(wlan_reg_get_bonded_channel_state_for_pwrmode);
#endif
#endif
#endif /* CONFIG CHAN FREQ API */

View File

@ -1047,7 +1047,8 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
}
/* Do not add invalid channel entry as kernel will reject it */
if (scan_obj->drop_bcn_on_invalid_freq &&
wlan_reg_is_disable_for_freq(pdev,
wlan_reg_is_disable_for_pwrmode(
pdev,
scan_entry->channel.chan_freq,
REG_CURRENT_PWR_MODE)) {
scm_nofl_debug("Drop frame for invalid freq %d: "QDF_MAC_ADDR_FMT" Seq Num: %d RSSI %d",

View File

@ -329,8 +329,8 @@ util_scan_get_chan_from_he_6g_params(struct wlan_objmgr_pdev *pdev,
he_6g_params->primary_channel,
band_mask);
if (scan_obj->drop_bcn_on_invalid_freq &&
wlan_reg_is_disable_for_freq(pdev, *chan_freq,
REG_CURRENT_PWR_MODE)) {
wlan_reg_is_disable_for_pwrmode(pdev, *chan_freq,
REG_CURRENT_PWR_MODE)) {
scm_debug_rl(QDF_MAC_ADDR_FMT": Drop as invalid channel %d freq %d in HE 6Ghz params",
QDF_MAC_ADDR_REF(scan_params->bssid.bytes),
he_6g_params->primary_channel, *chan_freq);
@ -1286,7 +1286,7 @@ util_scan_populate_bcn_ie_list(struct wlan_objmgr_pdev *pdev,
band_mask);
/* Drop if invalid freq */
if (scan_obj->drop_bcn_on_invalid_freq &&
wlan_reg_is_disable_for_freq(
wlan_reg_is_disable_for_pwrmode(
pdev, *chan_freq,
REG_CURRENT_PWR_MODE)) {
scm_debug_rl(QDF_MAC_ADDR_FMT": Drop as invalid channel %d freq %d in HT_INFO IE",

View File

@ -460,9 +460,9 @@ static void wifi_update_channel_bw_info(struct wlan_objmgr_psoc *psoc,
return;
}
wlan_reg_set_channel_params_for_freq(pdev, freq,
sec_ch_2g, &ch_params,
REG_CURRENT_PWR_MODE);
wlan_reg_set_channel_params_for_pwrmode(pdev, freq, sec_ch_2g,
&ch_params,
REG_CURRENT_PWR_MODE);
chan->band_center_freq1 = ch_params.mhz_freq_seg0;
if (wifi_pos_psoc->wifi_pos_get_fw_phy_mode_for_freq) {