qcacld-3.0: Replace callers of wlan_reg_get_bonded_channel_state_for_freq

The current channel list alone is not enough to represent the
capability of the chip or device. Given a channel, in many
cases it may be required to know all the power modes that are
supported by this channel.

Update caller APIs to use super channel list.
Removed wlan_reg_get_bonded_channel_state_for_freq and
wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode to use the
super channel API wlan_reg_get_bonded_channel_state_for_pwrmode
and wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode

Change-Id: I797ecaf0d01d47c5369f9e334805d855841566df
CRs-Fixed: 3144692
This commit is contained in:
Vinod Kumar Myadam
2022-09-01 10:48:25 +05:30
committed by Madan Koyyalamudi
parent f2ecda5efe
commit 94b9aa8de3
3 changed files with 27 additions and 20 deletions

View File

@@ -256,9 +256,10 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
else else
sec_freq = 0; sec_freq = 0;
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
sec_freq) != bandwidth, sec_freq,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID) { CHANNEL_STATE_INVALID) {
if (ch_width40_ch_params.sec_ch_offset == if (ch_width40_ch_params.sec_ch_offset ==
LOW_PRIMARY_CH) { LOW_PRIMARY_CH) {
@@ -290,18 +291,20 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
bandwidth = CH_WIDTH_10MHZ; bandwidth = CH_WIDTH_10MHZ;
fallthrough; fallthrough;
case CH_WIDTH_10MHZ: case CH_WIDTH_10MHZ:
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
0) != bandwidth, 0,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID && CHANNEL_STATE_INVALID &&
sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_10) sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_10)
flags |= QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HALF; flags |= QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_HALF;
bandwidth = CH_WIDTH_5MHZ; bandwidth = CH_WIDTH_5MHZ;
fallthrough; fallthrough;
case CH_WIDTH_5MHZ: case CH_WIDTH_5MHZ:
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
0) != bandwidth, 0,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID && CHANNEL_STATE_INVALID &&
sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_5) sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_5)
flags |= QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_QUARTER; flags |= QCA_WLAN_VENDOR_CHANNEL_PROP_FLAG_QUARTER;

View File

@@ -112,9 +112,10 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
else else
sec_freq = 0; sec_freq = 0;
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
sec_freq) != bandwidth, sec_freq,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID) { CHANNEL_STATE_INVALID) {
if (ch_params.sec_ch_offset == LOW_PRIMARY_CH) { if (ch_params.sec_ch_offset == LOW_PRIMARY_CH) {
flags |= IEEE80211_CHAN_HT40PLUS; flags |= IEEE80211_CHAN_HT40PLUS;
@@ -137,18 +138,20 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
bandwidth = CH_WIDTH_10MHZ; bandwidth = CH_WIDTH_10MHZ;
fallthrough; fallthrough;
case CH_WIDTH_10MHZ: case CH_WIDTH_10MHZ:
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
0) != bandwidth, 0,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID && CHANNEL_STATE_INVALID &&
sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_10) sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_10)
flags |= IEEE80211_CHAN_HALF; flags |= IEEE80211_CHAN_HALF;
bandwidth = CH_WIDTH_5MHZ; bandwidth = CH_WIDTH_5MHZ;
fallthrough; fallthrough;
case CH_WIDTH_5MHZ: case CH_WIDTH_5MHZ:
if (wlan_reg_get_bonded_channel_state_for_freq(pdev, freq, if (wlan_reg_get_bonded_channel_state_for_pwrmode(
bandwidth, pdev, freq,
0) != bandwidth, 0,
REG_CURRENT_PWR_MODE) !=
CHANNEL_STATE_INVALID && CHANNEL_STATE_INVALID &&
sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_5) sub_20_channel_width == WLAN_SUB_20_CH_WIDTH_5)
flags |= IEEE80211_CHAN_QUARTER; flags |= IEEE80211_CHAN_QUARTER;

View File

@@ -2082,9 +2082,10 @@ void sap_append_cac_history(struct mac_context *mac_ctx,
enum channel_state state; enum channel_state state;
const struct bonded_channel_freq *bonded_chan_ptr = NULL; const struct bonded_channel_freq *bonded_chan_ptr = NULL;
state = wlan_reg_get_5g_bonded_channel_and_state_for_freq state = wlan_reg_get_5g_bonded_channel_and_state_for_pwrmode
(mac_ctx->pdev, ch_param.mhz_freq_seg0, (mac_ctx->pdev, ch_param.mhz_freq_seg0,
ch_param.ch_width, &bonded_chan_ptr); ch_param.ch_width, &bonded_chan_ptr,
REG_CURRENT_PWR_MODE, NO_SCHANS_PUNC);
if (!bonded_chan_ptr || state == CHANNEL_STATE_INVALID) { if (!bonded_chan_ptr || state == CHANNEL_STATE_INVALID) {
sap_debug("invalid freq %d", ch_param.mhz_freq_seg0); sap_debug("invalid freq %d", ch_param.mhz_freq_seg0);
return; return;