qcacld-3.0: Update callers of wlan_reg_get_5g_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 API to use supper channel list. Replaced wlan_reg_get_5g_bonded_channel_state_for_freq API to use the super channel API wlan_reg_get_5g_bonded_channel_state_for_pwrmode Change-Id: If5d40a704efa3130da63ba20f163aa2e0e027be4 CRs-Fixed: 3143058
This commit is contained in:

committed by
Madan Koyyalamudi

parent
4968633370
commit
f2ecda5efe
@@ -6574,6 +6574,7 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
bool go_force_scc;
|
||||
enum channel_state chan_state;
|
||||
bool is_dfs_ch = false;
|
||||
struct ch_params ch_params;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
@@ -6597,10 +6598,12 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
if (ch_freq) {
|
||||
if (wlan_reg_is_5ghz_ch_freq(ch_freq)) {
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
ch_params.ch_width = policy_mgr_get_ch_width(bw);
|
||||
chan_state =
|
||||
wlan_reg_get_5g_bonded_channel_state_for_freq(
|
||||
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pm_ctx->pdev, ch_freq,
|
||||
policy_mgr_get_ch_width(bw));
|
||||
&ch_params, REG_CURRENT_PWR_MODE);
|
||||
if (chan_state == CHANNEL_STATE_DFS)
|
||||
is_dfs_ch = true;
|
||||
}
|
||||
@@ -9251,6 +9254,7 @@ bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t mcc_to_scc_switch;
|
||||
uint32_t num_connections;
|
||||
bool is_dfs_ch = false;
|
||||
struct ch_params ch_params;
|
||||
|
||||
if (!psoc || !vdev || !pdev) {
|
||||
policy_mgr_debug("psoc or vdev or pdev is NULL");
|
||||
@@ -9259,9 +9263,12 @@ bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
mode = wlan_vdev_mlme_get_opmode(vdev);
|
||||
con_mode = policy_mgr_convert_device_mode_to_qdf_type(mode);
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
ch_params.ch_width = ch_wdith;
|
||||
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
|
||||
wlan_reg_get_5g_bonded_channel_state_for_freq(
|
||||
pdev, ch_freq, ch_wdith) == CHANNEL_STATE_DFS)
|
||||
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, ch_freq, &ch_params,
|
||||
REG_CURRENT_PWR_MODE) == CHANNEL_STATE_DFS)
|
||||
is_dfs_ch = true;
|
||||
/*
|
||||
* For 3Vif concurrency we only support SCC in same MAC
|
||||
|
@@ -157,6 +157,7 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
|
||||
enum phy_ch_width bandwidth = mlme_get_vht_ch_width();
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
bool is_he_enabled;
|
||||
struct ch_params ch_params;
|
||||
|
||||
if (!pdev) {
|
||||
son_err("invalid pdev");
|
||||
@@ -173,6 +174,7 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
|
||||
&sub_20_channel_width);
|
||||
|
||||
qdf_mem_zero(chan_params, sizeof(*chan_params));
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
qdf_mem_zero(&ch_width40_ch_params, sizeof(ch_width40_ch_params));
|
||||
if (wlan_reg_is_24ghz_ch_freq(freq)) {
|
||||
if (bandwidth == CH_WIDTH_80P80MHZ ||
|
||||
@@ -181,10 +183,13 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
|
||||
bandwidth = CH_WIDTH_40MHZ;
|
||||
}
|
||||
|
||||
ch_params.ch_width = bandwidth;
|
||||
switch (bandwidth) {
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = CH_WIDTH_80P80MHZ;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (!flag_160) {
|
||||
chan_params->ch_width = CH_WIDTH_80P80MHZ;
|
||||
@@ -200,8 +205,10 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
|
||||
bandwidth = CH_WIDTH_160MHZ;
|
||||
fallthrough;
|
||||
case CH_WIDTH_160MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = CH_WIDTH_160MHZ;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (flag_160) {
|
||||
chan_params->ch_width = CH_WIDTH_160MHZ;
|
||||
@@ -217,8 +224,10 @@ uint32_t wlan_son_get_chan_flag(struct wlan_objmgr_pdev *pdev,
|
||||
bandwidth = CH_WIDTH_80MHZ;
|
||||
fallthrough;
|
||||
case CH_WIDTH_80MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = CH_WIDTH_80MHZ;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (!flag_160 &&
|
||||
chan_params->ch_width != CH_WIDTH_80P80MHZ) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023 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
|
||||
@@ -62,11 +62,14 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
|
||||
flags |= IEEE80211_CHAN_2GHZ;
|
||||
} else
|
||||
flags |= IEEE80211_CHAN_5GHZ;
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
|
||||
switch (bandwidth) {
|
||||
case CH_WIDTH_80P80MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = bandwidth;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (is_vht_enabled)
|
||||
flags |= IEEE80211_CHAN_VHT80_80;
|
||||
@@ -74,8 +77,10 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
|
||||
bandwidth = CH_WIDTH_160MHZ;
|
||||
fallthrough;
|
||||
case CH_WIDTH_160MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = bandwidth;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (is_vht_enabled)
|
||||
flags |= IEEE80211_CHAN_VHT160;
|
||||
@@ -83,8 +88,10 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
|
||||
bandwidth = CH_WIDTH_80MHZ;
|
||||
fallthrough;
|
||||
case CH_WIDTH_80MHZ:
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
|
||||
bandwidth) !=
|
||||
ch_params.ch_width = bandwidth;
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
pdev, freq,
|
||||
&ch_params, REG_CURRENT_PWR_MODE) !=
|
||||
CHANNEL_STATE_INVALID) {
|
||||
if (is_vht_enabled)
|
||||
flags |= IEEE80211_CHAN_VHT80;
|
||||
|
@@ -638,16 +638,23 @@ def_chan:
|
||||
hdd_ctx->psoc, PM_SAP_MODE, true);
|
||||
if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
|
||||
ch_bw > CH_WIDTH_20MHZ) {
|
||||
struct ch_params ch_params;
|
||||
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
ch_params.ch_width = ch_bw;
|
||||
ch_state =
|
||||
wlan_reg_get_5g_bonded_channel_state_for_freq(
|
||||
hdd_ctx->pdev, ch_freq, ch_bw);
|
||||
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
hdd_ctx->pdev, ch_freq, &ch_params,
|
||||
REG_CURRENT_PWR_MODE);
|
||||
while (ch_bw > CH_WIDTH_20MHZ &&
|
||||
ch_state != CHANNEL_STATE_ENABLE) {
|
||||
ch_bw =
|
||||
wlan_reg_get_next_lower_bandwidth(ch_bw);
|
||||
ch_params.ch_width = ch_bw;
|
||||
ch_state =
|
||||
wlan_reg_get_5g_bonded_channel_state_for_freq(
|
||||
hdd_ctx->pdev, ch_freq, ch_bw);
|
||||
wlan_reg_get_5g_bonded_channel_state_for_pwrmode
|
||||
(hdd_ctx->pdev, ch_freq, &ch_params,
|
||||
REG_CURRENT_PWR_MODE);
|
||||
}
|
||||
hdd_debug("bw change from %d to %d",
|
||||
hdd_ap_ctx->sap_config.ch_width_orig,
|
||||
|
@@ -7571,6 +7571,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
||||
enum channel_state ch_state;
|
||||
enum phy_ch_width sub_20_ch_width = CH_WIDTH_INVALID;
|
||||
struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
|
||||
struct ch_params ch_params;
|
||||
|
||||
if (CHANNEL_STATE_DFS ==
|
||||
wlan_reg_get_channel_state_from_secondary_list_for_freq(
|
||||
@@ -7588,9 +7589,13 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
||||
sub_20_ch_width = CH_WIDTH_5MHZ;
|
||||
if (cds_is_10_mhz_enabled())
|
||||
sub_20_ch_width = CH_WIDTH_10MHZ;
|
||||
qdf_mem_zero(&ch_params, sizeof(ch_params));
|
||||
ch_params.ch_width = sub_20_ch_width;
|
||||
if (WLAN_REG_IS_5GHZ_CH_FREQ(freq))
|
||||
ch_state = wlan_reg_get_5g_bonded_channel_state_for_freq(hdd_ctx->pdev, freq,
|
||||
sub_20_ch_width);
|
||||
ch_state =
|
||||
wlan_reg_get_5g_bonded_channel_state_for_pwrmode(
|
||||
hdd_ctx->pdev, freq, &ch_params,
|
||||
REG_CURRENT_PWR_MODE);
|
||||
else
|
||||
ch_state = wlan_reg_get_2g_bonded_channel_state_for_freq(hdd_ctx->pdev, freq,
|
||||
sub_20_ch_width, 0);
|
||||
|
Reference in New Issue
Block a user