|
@@ -1,6 +1,6 @@
|
|
|
/*
|
|
|
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
|
|
|
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
+ * Copyright (c) 2021-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
|
|
@@ -617,6 +617,7 @@ enum phy_ch_width wlan_sap_get_concurrent_bw(struct wlan_objmgr_pdev *pdev,
|
|
|
bool sta_present, is_con_chan_dfs = false, is_con_sta_indoor = false;
|
|
|
uint8_t sta_vdev_id;
|
|
|
uint8_t sta_sap_scc_on_dfs_chnl;
|
|
|
+ bool is_hw_dbs_capable = false;
|
|
|
|
|
|
if (WLAN_REG_IS_24GHZ_CH_FREQ(con_ch_freq))
|
|
|
return CH_WIDTH_20MHZ;
|
|
@@ -630,6 +631,8 @@ enum phy_ch_width wlan_sap_get_concurrent_bw(struct wlan_objmgr_pdev *pdev,
|
|
|
&sta_ch_width);
|
|
|
if (sta_present) {
|
|
|
sta_chan_width = policy_mgr_get_ch_width(sta_ch_width);
|
|
|
+ sap_debug("sta_chan_width:%d, channel_width:%d",
|
|
|
+ sta_chan_width, channel_width);
|
|
|
if (wlan_reg_is_dfs_for_freq(pdev, con_ch_freq) ||
|
|
|
sta_chan_width == CH_WIDTH_160MHZ)
|
|
|
is_con_chan_dfs = true;
|
|
@@ -638,56 +641,73 @@ enum phy_ch_width wlan_sap_get_concurrent_bw(struct wlan_objmgr_pdev *pdev,
|
|
|
is_con_sta_indoor = true;
|
|
|
}
|
|
|
|
|
|
- if (!policy_mgr_is_hw_dbs_capable(psoc))
|
|
|
- goto sap_ch_width_check;
|
|
|
+ policy_mgr_get_sta_sap_scc_on_dfs_chnl(psoc, &sta_sap_scc_on_dfs_chnl);
|
|
|
+ is_hw_dbs_capable = policy_mgr_is_hw_dbs_capable(psoc);
|
|
|
+ sap_debug("sta_sap_scc_on_dfs_chnl:%d, is_hw_dbs_capable:%d",
|
|
|
+ sta_sap_scc_on_dfs_chnl, is_hw_dbs_capable);
|
|
|
|
|
|
- if (is_con_chan_dfs) {
|
|
|
+ if (!is_hw_dbs_capable)
|
|
|
+ goto dfs_master_mode_check;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * In indoor concurrency cases, limit the channel width with the STA
|
|
|
+ * interface bandwidth. Since, only the bonded channels are active
|
|
|
+ * channels.
|
|
|
+ */
|
|
|
+ if (is_con_sta_indoor) {
|
|
|
channel_width = QDF_MIN(sta_chan_width, channel_width);
|
|
|
+ sap_debug("STA + SAP on indoor channels");
|
|
|
+ return channel_width;
|
|
|
+ } else if (is_con_chan_dfs) {
|
|
|
+ channel_width = QDF_MIN(sta_chan_width, channel_width);
|
|
|
+ sap_debug("STA + SAP on dfs channels");
|
|
|
+ goto dfs_master_mode_check;
|
|
|
+ } else {
|
|
|
+ /* Handle "DBS + active channel" concurrency/standalone SAP */
|
|
|
+ sap_debug("STA + SAP/GO or standalone SAP on active channel");
|
|
|
+ if (sta_present)
|
|
|
+ return QDF_MAX(sta_chan_width, CH_WIDTH_80MHZ);
|
|
|
+ return channel_width;
|
|
|
+ }
|
|
|
|
|
|
- if (sta_present && channel_width == CH_WIDTH_160MHZ)
|
|
|
- channel_width = CH_WIDTH_80MHZ;
|
|
|
+dfs_master_mode_check:
|
|
|
+ /* Handle "DBS/non-DBS + dfs channels" concurrency */
|
|
|
+ if (sta_sap_scc_on_dfs_chnl == PM_STA_SAP_ON_DFS_MASTER_MODE_FLEX) {
|
|
|
+ if (sta_present) {
|
|
|
+ sap_debug("STA+SAP/GO: limit the SAP channel width");
|
|
|
+ return QDF_MIN(sta_chan_width, channel_width);
|
|
|
+ }
|
|
|
|
|
|
- policy_mgr_get_sta_sap_scc_on_dfs_chnl(
|
|
|
- psoc, &sta_sap_scc_on_dfs_chnl);
|
|
|
- if (sta_sap_scc_on_dfs_chnl ==
|
|
|
- PM_STA_SAP_ON_DFS_MASTER_MODE_FLEX) {
|
|
|
+ sap_debug("Standalone SAP/GO: set BW coming in start req");
|
|
|
+ return channel_width;
|
|
|
+ } else if (sta_sap_scc_on_dfs_chnl ==
|
|
|
+ PM_STA_SAP_ON_DFS_MASTER_MODE_DISABLED) {
|
|
|
+ if (sta_present) {
|
|
|
+ sap_debug("STA present: Limit the SAP channel width");
|
|
|
+ channel_width = QDF_MIN(sta_chan_width, channel_width);
|
|
|
return channel_width;
|
|
|
- } else if (sta_sap_scc_on_dfs_chnl ==
|
|
|
- PM_STA_SAP_ON_DFS_MASTER_MODE_DISABLED) {
|
|
|
- if (sta_present)
|
|
|
- return channel_width;
|
|
|
- /*
|
|
|
- * sta_sap_scc_on_dfs_chnl = 1, DFS master is disabled.
|
|
|
- * If STA not present (SAP single), the SAP (160Mhz) is
|
|
|
- * not allowed on DFS, so limit SAP to 80Mhz.
|
|
|
- */
|
|
|
- return QDF_MIN(channel_width, CH_WIDTH_80MHZ);
|
|
|
}
|
|
|
/*
|
|
|
- * sta_sap_scc_on_dfs_chnl = 0, not allow STA+SAP SCC
|
|
|
- * on DFS. Limit SAP to 80Mhz if STA present.
|
|
|
+ * sta_sap_scc_on_dfs_chnl = 1, DFS master is disabled.
|
|
|
+ * If STA not present (SAP single), the SAP (160Mhz) is
|
|
|
+ * not allowed on DFS, so limit SAP to 80Mhz.
|
|
|
*/
|
|
|
- if (sta_present)
|
|
|
- return QDF_MIN(channel_width, CH_WIDTH_80MHZ);
|
|
|
-
|
|
|
- return channel_width;
|
|
|
- } else if (is_con_sta_indoor) {
|
|
|
- sap_debug("Indoor STA channel width is %d", sta_chan_width);
|
|
|
- return QDF_MIN(channel_width, sta_chan_width);
|
|
|
+ sap_debug("Limit Standalone SAP/GO to 80Mhz");
|
|
|
+ return QDF_MIN(channel_width, CH_WIDTH_80MHZ);
|
|
|
}
|
|
|
|
|
|
-sap_ch_width_check:
|
|
|
-
|
|
|
- /* if no STA present return max of BW and 80MHZ */
|
|
|
- if (!sta_present)
|
|
|
- return CH_WIDTH_80MHZ;
|
|
|
+ /*
|
|
|
+ * sta_sap_scc_on_dfs_chnl = 0, not allow STA+SAP SCC on DFS.
|
|
|
+ * Limit SAP to 80Mhz if STA present.
|
|
|
+ */
|
|
|
+ if (sta_present) {
|
|
|
+ sap_debug("STA present, Limit SAP/GO to 80Mhz");
|
|
|
+ return QDF_MIN(channel_width, CH_WIDTH_80MHZ);
|
|
|
+ }
|
|
|
|
|
|
- /* if STA not on DFS return max of BW and 80MHZ */
|
|
|
- if (!is_con_chan_dfs)
|
|
|
- return QDF_MAX(sta_chan_width, CH_WIDTH_80MHZ);
|
|
|
+ sap_debug("Single SAP/GO: set BW coming in SAP/GO start req");
|
|
|
+ return channel_width;
|
|
|
|
|
|
- /* If sta channel is DFS return min of 80 and STA BW */
|
|
|
- return QDF_MIN(sta_chan_width, CH_WIDTH_80MHZ);
|
|
|
}
|
|
|
|
|
|
uint32_t wlan_sap_get_vht_ch_width(struct sap_context *sap_ctx)
|