|
@@ -1245,7 +1245,6 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
|
|
uint32_t chan_freq,
|
|
uint32_t chan_freq,
|
|
struct ch_params *tgt_ch_params)
|
|
struct ch_params *tgt_ch_params)
|
|
{
|
|
{
|
|
- uint32_t max_fw_bw;
|
|
|
|
enum phy_ch_width ch_width, concurrent_bw = 0;
|
|
enum phy_ch_width ch_width, concurrent_bw = 0;
|
|
struct mac_context *mac;
|
|
struct mac_context *mac;
|
|
struct ch_params ch_params = {0};
|
|
struct ch_params ch_params = {0};
|
|
@@ -1264,40 +1263,13 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
|
|
*/
|
|
*/
|
|
ch_width = CH_WIDTH_20MHZ;
|
|
ch_width = CH_WIDTH_20MHZ;
|
|
} else {
|
|
} else {
|
|
- if (sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11ac ||
|
|
|
|
- sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11ac_ONLY ||
|
|
|
|
- sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11ax ||
|
|
|
|
- sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11ax_ONLY ||
|
|
|
|
- CSR_IS_DOT11_PHY_MODE_11BE(
|
|
|
|
- sap_context->csr_roamProfile.phyMode) ||
|
|
|
|
- CSR_IS_DOT11_PHY_MODE_11BE_ONLY(
|
|
|
|
- sap_context->csr_roamProfile.phyMode)) {
|
|
|
|
- max_fw_bw = sme_get_vht_ch_width();
|
|
|
|
- if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
|
|
|
|
- ch_width = CH_WIDTH_160MHZ;
|
|
|
|
- else
|
|
|
|
- ch_width = CH_WIDTH_80MHZ;
|
|
|
|
-
|
|
|
|
- ch_width = QDF_MAX(
|
|
|
|
- wlansap_get_target_eht_phy_ch_width(),
|
|
|
|
- ch_width);
|
|
|
|
- } else if (sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11n ||
|
|
|
|
- sap_context->csr_roamProfile.phyMode ==
|
|
|
|
- eCSR_DOT11_MODE_11n_ONLY) {
|
|
|
|
- ch_width = CH_WIDTH_40MHZ;
|
|
|
|
- } else {
|
|
|
|
- /* For legacy 11a mode return 20MHz */
|
|
|
|
- ch_width = CH_WIDTH_20MHZ;
|
|
|
|
- }
|
|
|
|
|
|
+ ch_width = wlansap_get_max_bw_by_phymode(sap_context);
|
|
concurrent_bw = wlan_sap_get_concurrent_bw(
|
|
concurrent_bw = wlan_sap_get_concurrent_bw(
|
|
mac->pdev, mac->psoc, chan_freq,
|
|
mac->pdev, mac->psoc, chan_freq,
|
|
ch_width);
|
|
ch_width);
|
|
ch_width = QDF_MIN(ch_width, concurrent_bw);
|
|
ch_width = QDF_MIN(ch_width, concurrent_bw);
|
|
|
|
+ if (tgt_ch_params)
|
|
|
|
+ ch_width = QDF_MIN(ch_width, tgt_ch_params->ch_width);
|
|
}
|
|
}
|
|
ch_params.ch_width = ch_width;
|
|
ch_params.ch_width = ch_width;
|
|
wlan_reg_set_channel_params_for_freq(mac->pdev, chan_freq, 0,
|
|
wlan_reg_set_channel_params_for_freq(mac->pdev, chan_freq, 0,
|
|
@@ -1305,11 +1277,11 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context,
|
|
ch_width = ch_params.ch_width;
|
|
ch_width = ch_params.ch_width;
|
|
if (tgt_ch_params)
|
|
if (tgt_ch_params)
|
|
*tgt_ch_params = ch_params;
|
|
*tgt_ch_params = ch_params;
|
|
- sap_nofl_debug("freq %d bw %d (orig bw %d phymode %d, con bw %d)",
|
|
|
|
|
|
+ sap_nofl_debug("freq %d bw %d (phymode %d, con bw %d, tgt bw %d)",
|
|
chan_freq, ch_width,
|
|
chan_freq, ch_width,
|
|
- sap_context->ch_width_orig,
|
|
|
|
sap_context->csr_roamProfile.phyMode,
|
|
sap_context->csr_roamProfile.phyMode,
|
|
- concurrent_bw);
|
|
|
|
|
|
+ concurrent_bw,
|
|
|
|
+ tgt_ch_params ? tgt_ch_params->ch_width : CH_WIDTH_MAX);
|
|
|
|
|
|
return ch_width;
|
|
return ch_width;
|
|
}
|
|
}
|
|
@@ -1383,10 +1355,13 @@ wlansap_set_chan_params_for_csa(struct mac_context *mac,
|
|
uint32_t target_chan_freq,
|
|
uint32_t target_chan_freq,
|
|
enum phy_ch_width target_bw)
|
|
enum phy_ch_width target_bw)
|
|
{
|
|
{
|
|
|
|
+ struct ch_params tmp_ch_params = {0};
|
|
|
|
+
|
|
|
|
+ tmp_ch_params.ch_width = target_bw;
|
|
mac->sap.SapDfsInfo.new_chanWidth =
|
|
mac->sap.SapDfsInfo.new_chanWidth =
|
|
wlansap_get_csa_chanwidth_from_phymode(sap_ctx,
|
|
wlansap_get_csa_chanwidth_from_phymode(sap_ctx,
|
|
target_chan_freq,
|
|
target_chan_freq,
|
|
- NULL);
|
|
|
|
|
|
+ &tmp_ch_params);
|
|
/*
|
|
/*
|
|
* Copy the requested target channel
|
|
* Copy the requested target channel
|
|
* to sap context.
|
|
* to sap context.
|
|
@@ -1478,10 +1453,10 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
|
|
sta_sap_scc_on_dfs_chan =
|
|
sta_sap_scc_on_dfs_chan =
|
|
policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(mac->psoc);
|
|
policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(mac->psoc);
|
|
|
|
|
|
- tmp_ch_params.ch_width =
|
|
|
|
- wlansap_get_csa_chanwidth_from_phymode(sap_ctx,
|
|
|
|
- target_chan_freq,
|
|
|
|
- NULL);
|
|
|
|
|
|
+ tmp_ch_params.ch_width = target_bw;
|
|
|
|
+ wlansap_get_csa_chanwidth_from_phymode(sap_ctx,
|
|
|
|
+ target_chan_freq,
|
|
|
|
+ &tmp_ch_params);
|
|
if (target_bw != CH_WIDTH_MAX) {
|
|
if (target_bw != CH_WIDTH_MAX) {
|
|
tmp_ch_params.ch_width =
|
|
tmp_ch_params.ch_width =
|
|
QDF_MIN(tmp_ch_params.ch_width, target_bw);
|
|
QDF_MIN(tmp_ch_params.ch_width, target_bw);
|
|
@@ -2639,6 +2614,51 @@ uint32_t wlansap_get_chan_width(struct sap_context *sap_ctx)
|
|
return wlan_sap_get_vht_ch_width(sap_ctx);
|
|
return wlan_sap_get_vht_ch_width(sap_ctx);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+enum phy_ch_width
|
|
|
|
+wlansap_get_max_bw_by_phymode(struct sap_context *sap_ctx)
|
|
|
|
+{
|
|
|
|
+ uint32_t max_fw_bw;
|
|
|
|
+ enum phy_ch_width ch_width;
|
|
|
|
+
|
|
|
|
+ if (!sap_ctx) {
|
|
|
|
+ sap_err("Invalid SAP pointer");
|
|
|
|
+ return CH_WIDTH_20MHZ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11ac ||
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11ac_ONLY ||
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11ax ||
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11ax_ONLY ||
|
|
|
|
+ CSR_IS_DOT11_PHY_MODE_11BE(
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode) ||
|
|
|
|
+ CSR_IS_DOT11_PHY_MODE_11BE_ONLY(
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode)) {
|
|
|
|
+ max_fw_bw = sme_get_vht_ch_width();
|
|
|
|
+ if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
|
|
|
|
+ ch_width = CH_WIDTH_160MHZ;
|
|
|
|
+ else
|
|
|
|
+ ch_width = CH_WIDTH_80MHZ;
|
|
|
|
+
|
|
|
|
+ ch_width = QDF_MAX(
|
|
|
|
+ wlansap_get_target_eht_phy_ch_width(),
|
|
|
|
+ ch_width);
|
|
|
|
+ } else if (sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11n ||
|
|
|
|
+ sap_ctx->csr_roamProfile.phyMode ==
|
|
|
|
+ eCSR_DOT11_MODE_11n_ONLY) {
|
|
|
|
+ ch_width = CH_WIDTH_40MHZ;
|
|
|
|
+ } else {
|
|
|
|
+ /* For legacy 11a mode return 20MHz */
|
|
|
|
+ ch_width = CH_WIDTH_20MHZ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ch_width;
|
|
|
|
+}
|
|
|
|
+
|
|
QDF_STATUS wlansap_set_invalid_session(struct sap_context *sap_ctx)
|
|
QDF_STATUS wlansap_set_invalid_session(struct sap_context *sap_ctx)
|
|
{
|
|
{
|
|
if (!sap_ctx) {
|
|
if (!sap_ctx) {
|