qcacmn: Replace reg curchan with 6g ap power based chan list

The consumers of the current channel list may want to search through 6G
channels that are not part of current channel list and belong to channel
list of different power mode.

Therefore, replace the regulatory current channel list with that of 6G
power based channel list.

Change-Id: Ie2ff8bbfb50a5f95f584b134b18246cb28b1c406
CRs-Fixed: 3110987
This commit is contained in:
Hariharan Basuthkar 2022-02-14 18:23:24 +05:30 committed by Madan Koyyalamudi
parent 5aba520461
commit e7b559d010
15 changed files with 297 additions and 112 deletions

View File

@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-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
@ -216,8 +217,11 @@ void target_if_vdev_start_link_handler(struct wlan_objmgr_vdev *vdev,
ch_freq = curr_channel->ch_freq;
ch_width = curr_channel->ch_width;
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);
ch_state =
wlan_reg_get_5g_bonded_channel_state_for_freq(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",
@ -235,7 +239,8 @@ void target_if_vdev_start_link_handler(struct wlan_objmgr_vdev *vdev,
prev_ch_freq);
prev_ch_state =
wlan_reg_get_5g_bonded_channel_state_for_freq(pdev,
prev_ch_freq, prev_ch_width);
prev_ch_freq, prev_ch_width,
REG_CURRENT_PWR_MODE);
/*
* In restart case, if SAP is on non DFS channel and
* previously it was on DFS channel then vote for link
@ -294,8 +299,11 @@ 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(pdev,
ch_freq, ch_width) == CHANNEL_STATE_DFS))
(wlan_reg_get_5g_bonded_channel_state_for_freq(
pdev,
ch_freq,
ch_width,
REG_CURRENT_PWR_MODE) == CHANNEL_STATE_DFS))
target_if_vote_for_link_down(psoc, psoc_wakelock);
}

View File

@ -3957,7 +3957,7 @@ target_if_calculate_center_freq(struct target_if_spectral *spectral,
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
(spectral->pdev_obj, chan_freq, agile_ch_width,
&bonded_chan_ptr);
&bonded_chan_ptr, REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
state == CHANNEL_STATE_INVALID) {
spectral_err("Channel state is disable or invalid");
@ -4038,7 +4038,8 @@ target_if_validate_center_freq(struct target_if_spectral *spectral,
st = wlan_reg_get_5g_bonded_channel_and_state_for_freq
(pdev, center_freq + FREQ_OFFSET_10MHZ,
agile_ch_width,
&bonded_chan_ptr);
&bonded_chan_ptr,
REG_CURRENT_PWR_MODE);
if (st == CHANNEL_STATE_DISABLE ||
st == CHANNEL_STATE_INVALID) {
spectral_err("Channel state disable/invalid");
@ -4145,7 +4146,8 @@ target_if_is_agile_span_overlap_with_operating_span
enum channel_state state;
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
(pdev, chan_freq, op_ch_width, &bonded_chan_ptr);
(pdev, chan_freq, op_ch_width, &bonded_chan_ptr,
REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
state == CHANNEL_STATE_INVALID) {
spectral_err("Channel state is disable or invalid");
@ -4296,7 +4298,8 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
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);
0, &ch_params,
REG_CURRENT_PWR_MODE);
if (ch_params.ch_width != CH_WIDTH_80P80MHZ)
return false;
@ -4308,7 +4311,8 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
chan_state1 = wlan_reg_get_5g_bonded_channel_state_for_freq(
pdev,
ch_params.mhz_freq_seg0 - FREQ_OFFSET_10MHZ,
CH_WIDTH_80MHZ);
CH_WIDTH_80MHZ,
REG_CURRENT_PWR_MODE);
if ((chan_state1 == CHANNEL_STATE_DISABLE) ||
(chan_state1 == CHANNEL_STATE_INVALID))
return false;
@ -4316,7 +4320,8 @@ target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
chan_state2 = wlan_reg_get_5g_bonded_channel_state_for_freq(
pdev,
ch_params.mhz_freq_seg1 - FREQ_OFFSET_10MHZ,
CH_WIDTH_80MHZ);
CH_WIDTH_80MHZ,
REG_CURRENT_PWR_MODE);
if ((chan_state2 == CHANNEL_STATE_DISABLE) ||
(chan_state2 == CHANNEL_STATE_INVALID))
return false;

View File

@ -895,7 +895,7 @@ target_if_spectral_unify_cfreq_format(struct target_if_spectral *spectral,
/* Get the 80MHz channel containing the pri20 freq */
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq
(spectral->pdev_obj, pri20_freq, CH_WIDTH_80MHZ,
&bonded_chan_ptr);
&bonded_chan_ptr, REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
state == CHANNEL_STATE_INVALID) {

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-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
@ -1566,9 +1566,11 @@ 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(dfs->dfs_pdev_obj,
target_freq,
0, chan_params);
wlan_reg_set_channel_params_for_freq(
dfs->dfs_pdev_obj,
target_freq,
0, chan_params,
REG_CURRENT_PWR_MODE);
if (!(CHAN_WITHIN_RESTRICTED_80P80(
chan_params->mhz_freq_seg0,
chan_params->mhz_freq_seg1))) {

View File

@ -916,7 +916,8 @@ QDF_STATUS utils_dfs_get_vdev_random_channel_for_freq(
if (*target_chan_freq) {
wlan_reg_set_channel_params_for_freq(pdev, *target_chan_freq, 0,
chan_params);
chan_params,
REG_CURRENT_PWR_MODE);
utils_dfs_get_max_phy_mode(pdev, hw_mode);
status = QDF_STATUS_SUCCESS;
}
@ -981,7 +982,8 @@ 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);
dfs_curchan->dfs_ch_freq,
REG_CURRENT_PWR_MODE);
if (ch_state == CHANNEL_STATE_DFS ||
ch_state == CHANNEL_STATE_ENABLE) {
@ -1000,7 +1002,8 @@ QDF_STATUS utils_dfs_bw_reduced_channel_for_freq(
dfs_curchan->dfs_ch_mhz_freq_seg2;
wlan_reg_set_channel_params_for_freq(pdev,
dfs_curchan->dfs_ch_freq,
0, chan_params);
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

@ -1,5 +1,6 @@
/*
* Copyright (c) 2012-2015,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
@ -84,8 +85,10 @@ 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(pdev,
ch_freq);
state = wlan_reg_get_channel_state_for_freq(
pdev,
ch_freq,
REG_CURRENT_PWR_MODE);
if (state == CHANNEL_STATE_DISABLE ||
state == CHANNEL_STATE_INVALID) {

View File

@ -679,6 +679,7 @@ reg_modify_chan_list_for_japan(struct wlan_objmgr_pdev *pdev)
{
}
#endif
/**
* reg_modify_chan_list_for_freq_range() - Modify channel list for the given low
* and high frequency range.
@ -2366,7 +2367,8 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj
cur_chan_list);
reg_modify_chan_list_for_max_chwidth(pdev_priv_obj->pdev_ptr,
pdev_priv_obj->cur_chan_list);
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,7 +1224,8 @@ 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_set_channel_params_for_freq(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),

View File

@ -3660,11 +3660,16 @@ wlan_reg_get_usable_channel(struct wlan_objmgr_pdev *pdev,
}
#endif
enum channel_state reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq)
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)
{
enum channel_enum ch_idx;
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
struct regulatory_channel *reg_chan_list;
enum channel_state state;
QDF_STATUS status;
ch_idx = reg_get_chan_enum_for_freq(freq);
@ -3678,7 +3683,20 @@ enum channel_state reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
return CHANNEL_STATE_INVALID;
}
return pdev_priv_obj->cur_chan_list[ch_idx].state;
reg_chan_list = qdf_mem_malloc(NUM_CHANNELS * sizeof(*reg_chan_list));
if (!reg_chan_list)
return CHANNEL_STATE_INVALID;
status = reg_get_pwrmode_chan_list(pdev, reg_chan_list, in_6g_pwr_type);
if (!QDF_IS_STATUS_SUCCESS(status)) {
qdf_mem_free(reg_chan_list);
return CHANNEL_STATE_INVALID;
}
state = reg_chan_list[ch_idx].state;
qdf_mem_free(reg_chan_list);
return state;
}
static uint32_t reg_get_channel_flags_for_freq(struct wlan_objmgr_pdev *pdev,
@ -3758,6 +3776,8 @@ static uint32_t reg_get_channel_flags_from_secondary_list_for_freq(
* @pdev: Pointer to pdev.
* @freq: Channel center frequency.
* @bonded_chan_ptr: Pointer to bonded_channel_freq.
* @in_6g_pwr_type: Input 6g power mode which decides the which power mode based
* channel list will be chosen.
*
* Return: Channel State
*/
@ -3765,7 +3785,9 @@ static enum channel_state
reg_get_5g_bonded_chan_array_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
const struct bonded_channel_freq *
bonded_chan_ptr)
bonded_chan_ptr,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
uint16_t chan_cfreq;
enum channel_state chan_state = CHANNEL_STATE_INVALID;
@ -3778,8 +3800,10 @@ reg_get_5g_bonded_chan_array_for_freq(struct wlan_objmgr_pdev *pdev,
chan_cfreq = bonded_chan_ptr->start_freq;
while (chan_cfreq <= bonded_chan_ptr->end_freq) {
temp_chan_state = reg_get_channel_state_for_freq(pdev,
chan_cfreq);
temp_chan_state = reg_get_channel_state_for_freq(
pdev,
chan_cfreq,
in_6g_pwr_type);
if (temp_chan_state < chan_state)
chan_state = temp_chan_state;
chan_cfreq = chan_cfreq + 20;
@ -3838,7 +3862,8 @@ static void reg_update_5g_bonded_channel_state_punc(
struct wlan_objmgr_pdev *pdev,
const struct bonded_channel_freq *bonded_chan_ptr,
struct ch_params *ch_params,
enum channel_state *chan_state)
enum channel_state *chan_state,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
qdf_freq_t chan_cfreq;
enum channel_state temp_chan_state;
@ -3852,8 +3877,10 @@ static void reg_update_5g_bonded_channel_state_punc(
chan_cfreq = bonded_chan_ptr->start_freq;
while (chan_cfreq <= bonded_chan_ptr->end_freq) {
temp_chan_state = reg_get_channel_state_for_freq(pdev,
chan_cfreq);
temp_chan_state =
reg_get_channel_state_for_freq(pdev,
chan_cfreq,
in_6g_pwr_mode);
if (!reg_is_state_allowed(temp_chan_state))
puncture_bitmap |= BIT(i);
/* Remember of any of the sub20 channel is a DFS channel */
@ -3873,7 +3900,8 @@ static void reg_update_5g_bonded_channel_state_punc(
struct wlan_objmgr_pdev *pdev,
const struct bonded_channel_freq *bonded_chan_ptr,
struct ch_params *ch_params,
enum channel_state *chan_state)
enum channel_state *chan_state,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
}
#endif
@ -3881,7 +3909,9 @@ static void reg_update_5g_bonded_channel_state_punc(
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)
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
enum phy_ch_width bw;
enum channel_enum ch_indx;
@ -3890,6 +3920,7 @@ reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
bool bw_enabled = false;
const struct bonded_channel_freq *bonded_chan_ptr = NULL;
QDF_STATUS status;
if (!ch_params) {
reg_err_rl("Invalid ch_params");
@ -3902,10 +3933,12 @@ reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
}
chan_state = reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
&bonded_chan_ptr);
&bonded_chan_ptr,
in_6g_pwr_mode);
reg_update_5g_bonded_channel_state_punc(pdev, bonded_chan_ptr,
ch_params, &chan_state);
ch_params, &chan_state,
in_6g_pwr_mode);
if ((chan_state == CHANNEL_STATE_INVALID) ||
(chan_state == CHANNEL_STATE_DISABLE))
@ -3917,11 +3950,21 @@ reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
reg_err("pdev reg obj is NULL");
return CHANNEL_STATE_INVALID;
}
reg_channels = pdev_priv_obj->cur_chan_list;
reg_channels = qdf_mem_malloc(NUM_CHANNELS * sizeof(*reg_channels));
if (!reg_channels)
return CHANNEL_STATE_INVALID;
status = reg_get_pwrmode_chan_list(pdev, reg_channels, in_6g_pwr_mode);
if (!QDF_IS_STATUS_SUCCESS(status)) {
qdf_mem_free(reg_channels);
return CHANNEL_STATE_INVALID;
}
ch_indx = reg_get_chan_enum_for_freq(freq);
if (ch_indx == INVALID_CHANNEL)
if (ch_indx == INVALID_CHANNEL) {
qdf_mem_free(reg_channels);
return CHANNEL_STATE_INVALID;
}
if (bw == CH_WIDTH_5MHZ)
bw_enabled = true;
else if (bw == CH_WIDTH_10MHZ)
@ -3943,10 +3986,10 @@ reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
bw_enabled = (reg_channels[ch_indx].min_bw <= 80) &&
(reg_channels[ch_indx].max_bw >= 80);
qdf_mem_free(reg_channels);
if (bw_enabled)
return chan_state;
else
return CHANNEL_STATE_DISABLE;
return CHANNEL_STATE_DISABLE;
}
enum channel_state
@ -3969,11 +4012,12 @@ reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
if ((sec_ch_freq + 20 != oper_ch_freq) &&
(oper_ch_freq + 20 != sec_ch_freq))
return CHANNEL_STATE_INVALID;
chan_state2 = reg_get_channel_state_for_freq(pdev, sec_ch_freq);
chan_state2 =
reg_get_channel_state_for_freq(pdev, sec_ch_freq,
REG_CURRENT_PWR_MODE);
if (chan_state2 == CHANNEL_STATE_INVALID)
return chan_state2;
}
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
@ -3983,7 +4027,8 @@ reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
reg_channels = pdev_priv_obj->cur_chan_list;
chan_state = reg_get_channel_state_for_freq(pdev, oper_ch_freq);
chan_state = reg_get_channel_state_for_freq(pdev, oper_ch_freq,
REG_CURRENT_PWR_MODE);
if (chan_state2 < chan_state)
chan_state = chan_state2;
@ -4096,8 +4141,10 @@ reg_get_320_bonded_chan_array(struct wlan_objmgr_pdev *pdev,
#define BW_160MHZ 160
#define REG_IS_TOT_CHAN_BW_BELOW_160(_x, _y) \
(reg_is_state_allowed((_x)) && (_y) < BW_160MHZ)
#define REG_IS_PRIMARY_CHAN_NOT_ALLOWED(_x, _y) \
(!reg_is_state_allowed(reg_get_channel_state_for_freq((_x), (_y))))
#define REG_IS_PRIMARY_CHAN_NOT_ALLOWED(_x, _y, _z) \
(!reg_is_state_allowed(reg_get_channel_state_for_freq((_x), \
(_y), \
(_z))))
static inline qdf_freq_t
reg_get_endchan_cen_from_bandstart(qdf_freq_t band_start,
@ -4114,7 +4161,8 @@ reg_get_320_bonded_channel_state(struct wlan_objmgr_pdev *pdev,
const struct bonded_channel_freq
*bonded_chan_ptr,
enum phy_ch_width bw,
uint16_t *out_punc_bitmap)
uint16_t *out_punc_bitmap,
enum supported_6g_pwr_types in_6g_pwr_type)
{
enum channel_state chan_state = CHANNEL_STATE_INVALID;
enum channel_state temp_chan_state;
@ -4136,7 +4184,8 @@ reg_get_320_bonded_channel_state(struct wlan_objmgr_pdev *pdev,
while (startchan_cfreq <= endchan_cfreq) {
temp_chan_state =
reg_get_channel_state_for_freq(pdev,
startchan_cfreq);
startchan_cfreq,
in_6g_pwr_type);
if (reg_is_state_allowed(temp_chan_state)) {
max_cont_bw += SUB_CHAN_BW;
*out_punc_bitmap &= ~BIT(i);
@ -4161,7 +4210,7 @@ reg_get_320_bonded_channel_state(struct wlan_objmgr_pdev *pdev,
* and return channel state as ENABLE.
*/
if (REG_IS_TOT_CHAN_BW_BELOW_160(chan_state, max_cont_bw) ||
REG_IS_PRIMARY_CHAN_NOT_ALLOWED(pdev, freq))
REG_IS_PRIMARY_CHAN_NOT_ALLOWED(pdev, freq, in_6g_pwr_type))
return CHANNEL_STATE_INVALID;
else
return CHANNEL_STATE_ENABLE;
@ -4234,6 +4283,8 @@ reg_fill_chan320mhz_seg0_center(struct wlan_objmgr_pdev *pdev,
* @band_center_320: Center of 320MHZ channel.
* @chan_list: Pointer to reg_channel_list to be filled.
* @update_bw: Flag to hold if bw is updated.
* @in_6g_pwr_type: Input 6g power mode which decides the which power mode based
* channel list will be chosen.
*
* Return - None.
*/
@ -4243,7 +4294,8 @@ reg_fill_channel_list_for_320(struct wlan_objmgr_pdev *pdev,
enum phy_ch_width *in_ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list,
bool *update_bw)
bool *update_bw,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
uint8_t num_bonded_pairs, i, num_ch_params;
enum channel_state chan_state;
@ -4253,6 +4305,8 @@ reg_fill_channel_list_for_320(struct wlan_objmgr_pdev *pdev,
enum channel_enum chan_enum;
const struct bonded_channel_freq *bonded_ch_ptr[2] = {NULL, NULL};
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
struct regulatory_channel *reg_chan_list;
QDF_STATUS status;
*update_bw = false;
@ -4271,8 +4325,18 @@ reg_fill_channel_list_for_320(struct wlan_objmgr_pdev *pdev,
/* Maximum bandwidth of the channel supported by regulatory for
* the given freq.
*/
max_reg_bw = pdev_priv_obj->cur_chan_list[chan_enum].max_bw;
reg_chan_list = qdf_mem_malloc(NUM_CHANNELS * sizeof(*reg_chan_list));
if (!reg_chan_list)
return;
status = reg_get_pwrmode_chan_list(pdev, reg_chan_list, in_6g_pwr_mode);
if (!QDF_IS_STATUS_SUCCESS(status)) {
qdf_mem_free(reg_chan_list);
return;
}
max_reg_bw = reg_chan_list[chan_enum].max_bw;
qdf_mem_free(reg_chan_list);
/* Regulatory does not support BW greater than 160.
* Try finding a channel in a lower mode.
*/
@ -4310,7 +4374,8 @@ reg_fill_channel_list_for_320(struct wlan_objmgr_pdev *pdev,
reg_get_320_bonded_channel_state(pdev, freq,
bonded_ch_ptr[i],
*in_ch_width,
&out_punc_bitmap);
&out_punc_bitmap,
in_6g_pwr_mode);
if (chan_state == CHANNEL_STATE_ENABLE) {
struct ch_params *t_chan_param =
&chan_list->chan_param[num_ch_params];
@ -4375,10 +4440,12 @@ static void
reg_set_chan_params_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq,
struct reg_channel_list *chan_list)
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
wlan_reg_get_channel_params(pdev, freq, sec_ch_2g_freq,
&chan_list->chan_param[0]);
&chan_list->chan_param[0],
in_6g_pwr_mode);
}
#endif
@ -4390,18 +4457,22 @@ reg_set_chan_params_for_freq(struct wlan_objmgr_pdev *pdev,
* @ch_width: Channel width
* @freq: Center frequency of the primary channel in MHz
* @sec_ch_2g_freq: Secondary 2G channel frequency in MHZ
* @in_6g_pwr_type: Input 6g power mode which decides the which power mode based
* channel list will be chosen.
*/
static void
reg_fill_pre320mhz_channel(struct wlan_objmgr_pdev *pdev,
struct reg_channel_list *chan_list,
enum phy_ch_width ch_width,
qdf_freq_t freq,
qdf_freq_t sec_ch_2g_freq)
qdf_freq_t sec_ch_2g_freq,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
chan_list->num_ch_params = 1;
chan_list->chan_param[0].ch_width = ch_width;
chan_list->chan_param[0].reg_punc_bitmap = NO_SCHANS_PUNC;
reg_set_chan_params_for_freq(pdev, freq, sec_ch_2g_freq, chan_list);
reg_set_chan_params_for_freq(pdev, freq, sec_ch_2g_freq, chan_list,
in_6g_pwr_mode);
}
void
@ -4410,7 +4481,8 @@ reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
qdf_freq_t sec_ch_2g_freq,
enum phy_ch_width in_ch_width,
qdf_freq_t band_center_320,
struct reg_channel_list *chan_list)
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
bool update_bw;
@ -4426,7 +4498,7 @@ reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
update_bw = 0;
reg_fill_channel_list_for_320(pdev, freq, &in_ch_width,
band_center_320, chan_list,
&update_bw);
&update_bw, in_6g_pwr_mode);
if (!update_bw)
return;
}
@ -4437,7 +4509,7 @@ reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
* next available mode and fills ch_params.
*/
reg_fill_pre320mhz_channel(pdev, chan_list, in_ch_width, freq,
sec_ch_2g_freq);
sec_ch_2g_freq, in_6g_pwr_mode);
}
#endif
@ -4494,11 +4566,13 @@ 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)
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
if (ch_width == CH_WIDTH_20MHZ)
return reg_get_channel_state_for_freq(pdev, freq);
return reg_get_channel_state_for_freq(pdev, freq,
in_6g_pwr_mode);
/* Fetch the bonded_chan_ptr for width greater than 20MHZ. */
*bonded_chan_ptr_ptr = reg_get_bonded_chan_entry(freq, ch_width);
@ -4509,7 +4583,8 @@ reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
}
return reg_get_5g_bonded_chan_array_for_freq(pdev, freq,
*bonded_chan_ptr_ptr);
*bonded_chan_ptr_ptr,
in_6g_pwr_mode);
}
#endif
@ -4520,12 +4595,16 @@ reg_get_5g_bonded_channel_for_freq(struct wlan_objmgr_pdev *pdev,
* @pdev: Pointer to pdev.
* @freq: Channel center frequency.
* ch_params: Pointer to ch_params.
* @in_6g_pwr_type: Input 6g power mode which decides the which power mode based
* channel list will be chosen.
*
* Return: void
*/
static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
struct ch_params *ch_params)
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
/*
* Set channel parameters like center frequency for a bonded channel
@ -4539,6 +4618,8 @@ static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
enum channel_enum chan_enum, sec_5g_chan_enum;
uint16_t max_bw, bw_80, sec_5g_freq_max_bw = 0;
struct regulatory_channel *reg_chan_list;
QDF_STATUS status;
if (!ch_params) {
reg_err("ch_params is NULL");
@ -4564,7 +4645,18 @@ static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
ch_params->ch_width = CH_WIDTH_160MHZ;
}
max_bw = pdev_priv_obj->cur_chan_list[chan_enum].max_bw;
reg_chan_list = qdf_mem_malloc(NUM_CHANNELS * sizeof(*reg_chan_list));
if (!reg_chan_list)
return;
status = reg_get_pwrmode_chan_list(pdev, reg_chan_list, in_6g_pwr_type);
if (!QDF_IS_STATUS_SUCCESS(status)) {
qdf_mem_free(reg_chan_list);
return;
}
max_bw = reg_chan_list[chan_enum].max_bw;
bw_80 = reg_get_bw_value(CH_WIDTH_80MHZ);
if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
@ -4573,13 +4665,14 @@ static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
NEAREST_20MHZ_CHAN_FREQ_OFFSET);
if (sec_5g_chan_enum == INVALID_CHANNEL) {
reg_err("secondary channel freq is not valid");
qdf_mem_free(reg_chan_list);
return;
}
sec_5g_freq_max_bw =
pdev_priv_obj->cur_chan_list[sec_5g_chan_enum].max_bw;
sec_5g_freq_max_bw = reg_chan_list[sec_5g_chan_enum].max_bw;
}
qdf_mem_free(reg_chan_list);
while (ch_params->ch_width != CH_WIDTH_INVALID) {
if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
if ((max_bw < bw_80) || (sec_5g_freq_max_bw < bw_80))
@ -4592,10 +4685,10 @@ static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
bonded_chan_ptr2 = NULL;
chan_state = reg_get_5g_bonded_channel_for_freq(
pdev, freq, ch_params->ch_width,
&bonded_chan_ptr);
&bonded_chan_ptr, in_6g_pwr_type);
chan_state = reg_get_5g_bonded_channel_state_for_freq(
pdev, freq, ch_params);
pdev, freq, ch_params, in_6g_pwr_type);
if (ch_params->ch_width == CH_WIDTH_80P80MHZ) {
struct ch_params temp_ch_params = {0};
@ -4606,7 +4699,7 @@ static void reg_set_5g_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
chan_state2 = reg_get_5g_bonded_channel_state_for_freq(
pdev, ch_params->mhz_freq_seg1 -
NEAREST_20MHZ_CHAN_FREQ_OFFSET,
&temp_ch_params);
&temp_ch_params, in_6g_pwr_type);
chan_state = reg_combine_channel_states(
chan_state, chan_state2);
@ -4653,7 +4746,8 @@ update_bw:
ch_params->mhz_freq_seg1);
chan_state = reg_get_5g_bonded_channel_for_freq(
pdev, freq, CH_WIDTH_80MHZ, &bonded_chan_ptr);
pdev, freq, CH_WIDTH_80MHZ, &bonded_chan_ptr,
in_6g_pwr_type);
if (bonded_chan_ptr) {
ch_params->mhz_freq_seg0 =
(bonded_chan_ptr->start_freq +
@ -4838,10 +4932,12 @@ void reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
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)
struct ch_params *ch_params,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
if (reg_is_5ghz_ch_freq(freq) || reg_is_6ghz_chan_freq(freq))
reg_set_5g_channel_params_for_freq(pdev, freq, ch_params);
reg_set_5g_channel_params_for_freq(pdev, freq, ch_params,
in_6g_pwr_mode);
else if (reg_is_24ghz_ch_freq(freq))
reg_set_2g_channel_params_for_freq(pdev, freq, ch_params,
sec_ch_2g_freq);
@ -5049,11 +5145,12 @@ enum reg_wifi_band reg_freq_to_band(qdf_freq_t freq)
return REG_BAND_UNKNOWN;
}
bool reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
bool reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
enum channel_state ch_state;
ch_state = reg_get_channel_state_for_freq(pdev, freq);
ch_state = reg_get_channel_state_for_freq(pdev, freq, in_6g_pwr_mode);
return ch_state == CHANNEL_STATE_DISABLE;
}

View File

@ -879,11 +879,14 @@ 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 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);
#ifdef CONFIG_REG_CLIENT
/**
@ -905,13 +908,16 @@ enum channel_state reg_get_channel_state_from_secondary_list_for_freq(
* @pdev: Pointer to pdev
* @freq: channel center frequency.
* @ch_params: channel parameters
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: channel state
*/
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);
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
/**
* reg_get_2g_bonded_channel_state_for_freq() - Get channel state for 2G
@ -937,13 +943,16 @@ 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);
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
/**
* reg_fill_channel_list() - Fills an array of ch_params (list of
@ -959,6 +968,7 @@ void reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
* @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
*/
@ -969,7 +979,8 @@ reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
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);
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode);
/**
* reg_is_punc_bitmap_valid() - is puncture bitmap valid or not
@ -1104,6 +1115,7 @@ qdf_freq_t reg_max_chan_freq(void);
* @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
*/
@ -1112,17 +1124,20 @@ 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);
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types in_6g_pwr_mode);
/**
* reg_is_disable_for_freq() - 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_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq);
bool reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode);
#ifdef CONFIG_REG_CLIENT
/**
@ -1688,6 +1703,7 @@ void reg_update_max_phymode_chwidth_for_pdev(struct wlan_objmgr_pdev *pdev);
* each channel in the current channel list.
* @pdev: Pointer to PDEV object.
* @cur_chan_list: Pointer to the pdev current channel list.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* In countries like DK, the channel 144 is not supported by the regulatory.
* When we get the regulatory rules, the entire UNII-2E's max bandwidth is set
@ -1702,7 +1718,9 @@ void reg_update_max_phymode_chwidth_for_pdev(struct wlan_objmgr_pdev *pdev);
*/
void
reg_modify_chan_list_for_max_chwidth(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *cur_chan_list);
struct regulatory_channel *cur_chan_list,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#else
static inline void
@ -1712,7 +1730,8 @@ 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)
struct regulatory_channel *cur_chan_list,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
}

View File

@ -790,6 +790,7 @@ 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
*/
@ -797,7 +798,9 @@ 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);
qdf_freq_t sec_freq,
enum supported_6g_pwr_types
in_6g_pwr_mode);
/**
* wlan_reg_set_dfs_region() - set the dfs region
@ -1301,13 +1304,16 @@ wlan_reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
* @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 phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type);
/**
* wlan_reg_get_2g_bonded_channel_state_for_freq() - Get 2G bonded channel state
* @pdev: The physical dev to program country code or regdomain
@ -1327,12 +1333,14 @@ 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);
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type);
#ifdef CONFIG_REG_CLIENT
/**
@ -1356,6 +1364,7 @@ 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
*/
@ -1365,7 +1374,8 @@ void wlan_reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
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);
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_type);
/**
* wlan_reg_is_punc_bitmap_valid() - is puncture bitmap valid or not
@ -1400,13 +1410,16 @@ 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);
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode);
/**
* wlan_reg_get_channel_cfreq_reg_power_for_freq() - Provide the channel
@ -1463,11 +1476,13 @@ 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);
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode);
#ifdef CONFIG_REG_CLIENT
/**
@ -1609,6 +1624,7 @@ 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.
* @in_6g_pwr_type: 6g power type which decides 6G channel list lookup.
*
* Return: Channel State
*/
@ -1618,7 +1634,9 @@ wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr);
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types
in_6g_pwr_mode);
#endif /*CONFIG_CHAN_FREQ_API */
/**

View File

@ -1056,9 +1056,10 @@ 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)
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_mode)
{
return reg_is_disable_for_freq(pdev, freq);
return reg_is_disable_for_freq(pdev, freq, in_6g_pwr_mode);
}
#ifdef CONFIG_REG_CLIENT
@ -1103,7 +1104,9 @@ 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 phy_ch_width bw,
enum supported_6g_pwr_types
in_6g_pwr_type)
{
struct ch_params params = {0};
@ -1116,7 +1119,8 @@ 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);
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params,
in_6g_pwr_type);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
@ -1126,13 +1130,16 @@ 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 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_freq(pdev, freq, &params);
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, &params,
in_6g_pwr_type);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_state_for_freq);
@ -1153,9 +1160,12 @@ 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)
struct ch_params *ch_params,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params);
reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params,
in_6g_pwr_mode);
}
qdf_export_symbol(wlan_reg_set_channel_params_for_freq);
@ -1166,10 +1176,11 @@ void wlan_reg_fill_channel_list(struct wlan_objmgr_pdev *pdev,
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)
struct reg_channel_list *chan_list,
enum supported_6g_pwr_types in_6g_pwr_type)
{
reg_fill_channel_list(pdev, freq, sec_ch_2g_freq, ch_width,
band_center_320, chan_list);
band_center_320, chan_list, in_6g_pwr_type);
}
bool wlan_reg_is_punc_bitmap_valid(enum phy_ch_width bw,
@ -1187,9 +1198,10 @@ void wlan_reg_set_create_punc_bitmap(struct ch_params *ch_params,
enum channel_state
wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
qdf_freq_t freq)
qdf_freq_t freq,
enum supported_6g_pwr_types in_6g_pwr_type)
{
return reg_get_channel_state_for_freq(pdev, freq);
return reg_get_channel_state_for_freq(pdev, freq, in_6g_pwr_type);
}
#ifdef CONFIG_REG_CLIENT
@ -1284,13 +1296,16 @@ wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr)
**bonded_chan_ptr_ptr,
enum supported_6g_pwr_types
in_6g_pwr_mode)
{
/*
* Get channel frequencies and state from regulatory
*/
return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
bonded_chan_ptr_ptr);
bonded_chan_ptr_ptr,
in_6g_pwr_mode);
}
#if defined(WLAN_FEATURE_11BE) && defined(CONFIG_REG_CLIENT)
@ -1298,7 +1313,9 @@ 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)
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,
@ -1307,14 +1324,16 @@ 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);
&bonded_chan_ptr_ptr,
in_6g_pwr_mode);
} else {
struct ch_params params = {0};
params.ch_width = bw;
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
&params);
&params,
in_6g_pwr_mode);
}
}
@ -1325,7 +1344,9 @@ 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)
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,
@ -1336,7 +1357,8 @@ 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);
&params,
in_6g_pwr_mode);
}
}

View File

@ -1048,7 +1048,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,
scan_entry->channel.chan_freq)) {
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",
scan_entry->channel.chan_freq,
QDF_MAC_ADDR_REF(scan_entry->bssid.bytes),

View File

@ -329,7 +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)) {
wlan_reg_is_disable_for_freq(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);
@ -1285,7 +1286,9 @@ 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(pdev, *chan_freq)) {
wlan_reg_is_disable_for_freq(
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",
QDF_MAC_ADDR_REF(scan_params->bssid.bytes),
chan_idx, *chan_freq);

View File

@ -461,7 +461,8 @@ static void wifi_update_channel_bw_info(struct wlan_objmgr_psoc *psoc,
}
wlan_reg_set_channel_params_for_freq(pdev, freq,
sec_ch_2g, &ch_params);
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) {