|
@@ -120,6 +120,22 @@ QDF_STATUS policy_mgr_get_force_1x1(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+QDF_STATUS
|
|
|
+policy_mgr_set_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
|
|
+ uint8_t sta_sap_scc_on_dfs_chnl)
|
|
|
+{
|
|
|
+ struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
+
|
|
|
+ pm_ctx = policy_mgr_get_context(psoc);
|
|
|
+ if (!pm_ctx) {
|
|
|
+ policy_mgr_err("pm_ctx is NULL");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+ pm_ctx->cfg.sta_sap_scc_on_dfs_chnl = sta_sap_scc_on_dfs_chnl;
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
QDF_STATUS
|
|
|
policy_mgr_get_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
|
|
uint8_t *sta_sap_scc_on_dfs_chnl)
|
|
@@ -3103,6 +3119,77 @@ bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc)
|
|
|
psoc, PM_STA_MODE, NULL) > 1;
|
|
|
}
|
|
|
|
|
|
+bool policy_mgr_is_sta_present_on_dfs_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
+ uint8_t *vdev_id,
|
|
|
+ qdf_freq_t *ch_freq,
|
|
|
+ enum hw_mode_bandwidth *ch_width)
|
|
|
+{
|
|
|
+ struct policy_mgr_conc_connection_info *conn_info;
|
|
|
+ bool status = false;
|
|
|
+ uint32_t conn_index = 0;
|
|
|
+ struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
+
|
|
|
+ pm_ctx = policy_mgr_get_context(psoc);
|
|
|
+ if (!pm_ctx) {
|
|
|
+ policy_mgr_err("Invalid Context");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
|
|
+ for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
|
|
|
+ conn_index++) {
|
|
|
+ conn_info = &pm_conc_connection_list[conn_index];
|
|
|
+ if (conn_info->in_use &&
|
|
|
+ (conn_info->mode == PM_STA_MODE ||
|
|
|
+ conn_info->mode == PM_P2P_CLIENT_MODE) &&
|
|
|
+ (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) ||
|
|
|
+ (wlan_reg_is_5ghz_ch_freq(conn_info->freq) &&
|
|
|
+ conn_info->bw == HW_MODE_160_MHZ))) {
|
|
|
+ *vdev_id = conn_info->vdev_id;
|
|
|
+ *ch_freq = pm_conc_connection_list[conn_index].freq;
|
|
|
+ *ch_width = conn_info->bw;
|
|
|
+ status = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
+bool policy_mgr_is_sta_present_on_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
+ uint8_t *vdev_id,
|
|
|
+ qdf_freq_t ch_freq,
|
|
|
+ enum hw_mode_bandwidth *ch_width)
|
|
|
+{
|
|
|
+ struct policy_mgr_conc_connection_info *conn_info;
|
|
|
+ bool status = false;
|
|
|
+ uint32_t conn_index = 0;
|
|
|
+ struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
+
|
|
|
+ pm_ctx = policy_mgr_get_context(psoc);
|
|
|
+ if (!pm_ctx) {
|
|
|
+ policy_mgr_err("Invalid Context");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
|
|
+ for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
|
|
|
+ conn_index++) {
|
|
|
+ conn_info = &pm_conc_connection_list[conn_index];
|
|
|
+ if (conn_info->in_use &&
|
|
|
+ (conn_info->mode == PM_STA_MODE ||
|
|
|
+ conn_info->mode == PM_P2P_CLIENT_MODE) &&
|
|
|
+ ch_freq == conn_info->freq) {
|
|
|
+ *vdev_id = conn_info->vdev_id;
|
|
|
+ *ch_width = conn_info->bw;
|
|
|
+ status = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
|
|
+
|
|
|
+ return status;
|
|
|
+}
|
|
|
+
|
|
|
bool policy_mgr_is_sta_gc_active_on_mac(struct wlan_objmgr_psoc *psoc,
|
|
|
uint8_t mac_id)
|
|
|
{
|
|
@@ -3217,7 +3304,8 @@ uint32_t policy_mgr_get_dfs_beaconing_session_id(
|
|
|
}
|
|
|
|
|
|
bool policy_mgr_is_any_dfs_beaconing_session_present(
|
|
|
- struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq)
|
|
|
+ struct wlan_objmgr_psoc *psoc, qdf_freq_t *ch_freq,
|
|
|
+ enum hw_mode_bandwidth *ch_width)
|
|
|
{
|
|
|
struct policy_mgr_conc_connection_info *conn_info;
|
|
|
bool status = false;
|
|
@@ -3234,10 +3322,13 @@ bool policy_mgr_is_any_dfs_beaconing_session_present(
|
|
|
conn_index++) {
|
|
|
conn_info = &pm_conc_connection_list[conn_index];
|
|
|
if (conn_info->in_use &&
|
|
|
- wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) &&
|
|
|
- (PM_SAP_MODE == conn_info->mode ||
|
|
|
- PM_P2P_GO_MODE == conn_info->mode)) {
|
|
|
+ (conn_info->mode == PM_SAP_MODE ||
|
|
|
+ conn_info->mode == PM_P2P_GO_MODE) &&
|
|
|
+ (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) ||
|
|
|
+ (wlan_reg_is_5ghz_ch_freq(conn_info->freq) &&
|
|
|
+ conn_info->bw == HW_MODE_160_MHZ))) {
|
|
|
*ch_freq = pm_conc_connection_list[conn_index].freq;
|
|
|
+ *ch_width = conn_info->bw;
|
|
|
status = true;
|
|
|
}
|
|
|
}
|
|
@@ -3249,7 +3340,9 @@ bool policy_mgr_is_any_dfs_beaconing_session_present(
|
|
|
bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
|
|
{
|
|
|
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
- uint32_t ap_dfs_ch_freq = 0;
|
|
|
+ qdf_freq_t dfs_ch_frq = 0;
|
|
|
+ uint8_t vdev_id;
|
|
|
+ enum hw_mode_bandwidth ch_width;
|
|
|
|
|
|
pm_ctx = policy_mgr_get_context(psoc);
|
|
|
if (!pm_ctx) {
|
|
@@ -3257,8 +3350,17 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- policy_mgr_is_any_dfs_beaconing_session_present(psoc, &ap_dfs_ch_freq);
|
|
|
- if (!ap_dfs_ch_freq)
|
|
|
+ if (policy_mgr_is_sta_present_on_dfs_channel(psoc, &vdev_id,
|
|
|
+ &dfs_ch_frq,
|
|
|
+ &ch_width)) {
|
|
|
+ policymgr_nofl_err("DFS STA present vdev_id %d ch_feq %d ch_width %d",
|
|
|
+ vdev_id, dfs_ch_frq, ch_width);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ policy_mgr_is_any_dfs_beaconing_session_present(psoc, &dfs_ch_frq,
|
|
|
+ &ch_width);
|
|
|
+ if (!dfs_ch_frq)
|
|
|
return false;
|
|
|
/*
|
|
|
* 1) if agile & DFS scans are supportet
|
|
@@ -3273,8 +3375,8 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
|
|
policy_mgr_get_single_mac_scan_with_dfs_config(psoc))
|
|
|
return false;
|
|
|
|
|
|
- policy_mgr_debug("scan skip 5g chan due to dfs ap(ch %d) present",
|
|
|
- ap_dfs_ch_freq);
|
|
|
+ policy_mgr_debug("scan skip 5g chan due to dfs ap(ch %d / ch_width %d) present",
|
|
|
+ dfs_ch_frq, ch_width);
|
|
|
|
|
|
return true;
|
|
|
}
|