qcacld-3.0: handle ML scenario for PCL setting
Handle ML scenario for PCL setting. Change-Id: Ida632bff8709e2467649d094de4b4074ff0f15d7 CRs-Fixed: 3107517
Этот коммит содержится в:

коммит произвёл
Madan Koyyalamudi

родитель
bc631524e4
Коммит
95310d4c81
@@ -2556,6 +2556,16 @@ bool policy_mgr_current_concurrency_is_scc(struct wlan_objmgr_psoc *psoc);
|
||||
*/
|
||||
bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* policy_mgr_concurrent_sta_doing_dbs() - To check the current
|
||||
* concurrency STA combination if it is doing DBS
|
||||
* @psoc: PSOC object information
|
||||
* This routine is called to check if it is doing DBS
|
||||
*
|
||||
* Return: True - DBS, False - Otherwise
|
||||
*/
|
||||
bool policy_mgr_concurrent_sta_doing_dbs(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_sap_p2pgo_on_dfs() - check if there is a P2PGO or SAP
|
||||
* operating in a DFS channel
|
||||
|
@@ -35,6 +35,11 @@
|
||||
#include "wlan_mlme_ucfg_api.h"
|
||||
#include "wlan_cm_api.h"
|
||||
#include "wlan_reg_ucfg_api.h"
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
#include "wlan_mlo_mgr_cmn.h"
|
||||
#include "wlan_mlo_mgr_public_structs.h"
|
||||
#endif
|
||||
#include "wlan_cm_ucfg_api.h"
|
||||
|
||||
#define POLICY_MGR_MAX_CON_STRING_LEN 100
|
||||
#define LOWER_END_FREQ_5GHZ 4900
|
||||
@@ -731,6 +736,7 @@ void policy_mgr_store_and_del_conn_info_by_vdev_id(
|
||||
policy_mgr_err("Invalid parameters");
|
||||
return;
|
||||
}
|
||||
|
||||
*num_cxn_del = 0;
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
@@ -758,6 +764,8 @@ void policy_mgr_store_and_del_conn_info_by_vdev_id(
|
||||
psoc,
|
||||
pm_conc_connection_list[conn_index].vdev_id);
|
||||
}
|
||||
|
||||
policy_mgr_debug("vdev id %d, num_cxn_del %d", vdev_id, *num_cxn_del);
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
}
|
||||
|
||||
@@ -827,6 +835,7 @@ void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
uint32_t conn_index;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
int i;
|
||||
|
||||
if (MAX_NUMBER_OF_CONC_CONNECTIONS < num_cxn_del || 0 == num_cxn_del) {
|
||||
policy_mgr_err("Failed to restore %d/%d deleted information",
|
||||
@@ -841,20 +850,21 @@ void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
conn_index = policy_mgr_get_connection_count(psoc);
|
||||
if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) {
|
||||
if (MAX_NUMBER_OF_CONC_CONNECTIONS - num_cxn_del <= conn_index) {
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
policy_mgr_err("Failed to restore the deleted information %d/%d",
|
||||
conn_index, MAX_NUMBER_OF_CONC_CONNECTIONS);
|
||||
policy_mgr_err("Failed to restore the deleted information %d/%d/%d",
|
||||
conn_index, num_cxn_del,
|
||||
MAX_NUMBER_OF_CONC_CONNECTIONS);
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(&pm_conc_connection_list[conn_index], info,
|
||||
num_cxn_del * sizeof(*info));
|
||||
num_cxn_del * sizeof(*info));
|
||||
pm_ctx->no_of_active_sessions[info->mode] += num_cxn_del;
|
||||
for (i = 0; i < num_cxn_del; i++)
|
||||
policy_mgr_debug("Restored the deleleted conn info, vdev:%d, index:%d",
|
||||
info[i].vdev_id, conn_index++);
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
policy_mgr_debug("Restored the deleleted conn info, vdev:%d, index:%d",
|
||||
info->vdev_id, conn_index);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -1568,35 +1578,13 @@ void policy_mgr_set_pcl_for_existing_combo(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
struct policy_mgr_conc_connection_info
|
||||
info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
|
||||
enum QDF_OPMODE pcl_mode;
|
||||
uint8_t num_cxn_del = 0;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
struct policy_mgr_pcl_list pcl;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid Context");
|
||||
return;
|
||||
}
|
||||
|
||||
pcl_mode = policy_mgr_get_qdf_mode_from_pm(mode);
|
||||
if (pcl_mode == QDF_MAX_NO_OF_MODE)
|
||||
return;
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) {
|
||||
/* Check, store and temp delete the mode's parameter */
|
||||
policy_mgr_store_and_del_conn_info(psoc, mode, false,
|
||||
info, &num_cxn_del);
|
||||
/* Set the PCL to the FW since connection got updated */
|
||||
status = policy_mgr_pdev_get_pcl(psoc, pcl_mode, &pcl);
|
||||
policy_mgr_debug("Set PCL to FW for mode:%d", mode);
|
||||
/* Restore the connection info */
|
||||
policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del);
|
||||
}
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
status = policy_mgr_get_pcl_for_vdev_id(psoc, mode, pcl.pcl_list,
|
||||
&pcl.pcl_len,
|
||||
pcl.weight_list,
|
||||
QDF_ARRAY_SIZE(pcl.weight_list),
|
||||
vdev_id);
|
||||
/* Send PCL only if policy_mgr_pdev_get_pcl returned success */
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
status = policy_mgr_set_pcl(psoc, &pcl, vdev_id, false);
|
||||
@@ -1610,7 +1598,7 @@ void policy_mgr_set_pcl_for_connected_vdev(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
struct policy_mgr_pcl_list msg = { {0} };
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
uint8_t roam_enabled_vdev_id, count;
|
||||
uint8_t roam_enabled_vdev_id;
|
||||
bool sta_concurrency_is_dbs, dual_sta_roam_enabled;
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||
@@ -1626,14 +1614,6 @@ void policy_mgr_set_pcl_for_connected_vdev(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
|
||||
|
||||
count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
|
||||
NULL);
|
||||
sta_concurrency_is_dbs = (count == 2) &&
|
||||
!(policy_mgr_current_concurrency_is_mcc(psoc) ||
|
||||
policy_mgr_current_concurrency_is_scc(psoc));
|
||||
|
||||
dual_sta_roam_enabled = wlan_mlme_get_dual_sta_roaming_enabled(psoc);
|
||||
|
||||
/*
|
||||
* Get the vdev id of the STA on which roaming is already
|
||||
* initialized and set the vdev PCL for that STA vdev if dual
|
||||
@@ -1644,8 +1624,10 @@ void policy_mgr_set_pcl_for_connected_vdev(struct wlan_objmgr_psoc *psoc,
|
||||
if (roam_enabled_vdev_id == WLAN_UMAC_VDEV_ID_MAX)
|
||||
return;
|
||||
|
||||
policy_mgr_debug("count:%d, dual_sta_roam:%d, is_dbs:%d, clear_pcl:%d",
|
||||
count, dual_sta_roam_enabled, sta_concurrency_is_dbs,
|
||||
sta_concurrency_is_dbs = policy_mgr_concurrent_sta_doing_dbs(psoc);
|
||||
dual_sta_roam_enabled = wlan_mlme_get_dual_sta_roaming_enabled(psoc);
|
||||
policy_mgr_debug("dual_sta_roam:%d, is_dbs:%d, clear_pcl:%d",
|
||||
dual_sta_roam_enabled, sta_concurrency_is_dbs,
|
||||
clear_pcl);
|
||||
|
||||
if (dual_sta_roam_enabled && sta_concurrency_is_dbs) {
|
||||
@@ -1671,6 +1653,77 @@ void policy_mgr_set_pcl_for_connected_vdev(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
static uint32_t
|
||||
policy_mgr_get_connected_vdev_band_mask(struct wlan_objmgr_vdev *vdev) {
|
||||
struct wlan_channel *chan;
|
||||
uint32_t band_mask = 0;
|
||||
struct wlan_objmgr_vdev *ml_vdev_list[WLAN_UMAC_MLO_MAX_VDEVS] = {0};
|
||||
uint16_t ml_vdev_cnt = 0;
|
||||
struct wlan_objmgr_vdev *t_vdev;
|
||||
int i;
|
||||
|
||||
if (!vdev) {
|
||||
policy_mgr_err("vdev is NULL");
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
if (wlan_vdev_mlme_is_link_sta_vdev(vdev)) {
|
||||
policy_mgr_debug("skip mlo link sta");
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE ||
|
||||
!wlan_vdev_mlme_is_mlo_vdev(vdev)) {
|
||||
chan = wlan_vdev_get_active_channel(vdev);
|
||||
if (!chan) {
|
||||
policy_mgr_err("no active channel");
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
band_mask |= BIT(wlan_reg_freq_to_band(chan->ch_freq));
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
mlo_get_ml_vdev_list(vdev, &ml_vdev_cnt, ml_vdev_list);
|
||||
for (i = 0; i < ml_vdev_cnt; i++) {
|
||||
t_vdev = ml_vdev_list[i];
|
||||
if (!ucfg_cm_is_vdev_connected(t_vdev))
|
||||
goto next;
|
||||
|
||||
chan = wlan_vdev_get_active_channel(t_vdev);
|
||||
if (!chan)
|
||||
goto next;
|
||||
|
||||
band_mask |= BIT(wlan_reg_freq_to_band(chan->ch_freq));
|
||||
next:
|
||||
mlo_release_vdev_ref(t_vdev);
|
||||
}
|
||||
|
||||
return band_mask;
|
||||
}
|
||||
#else
|
||||
static uint32_t
|
||||
policy_mgr_get_connected_vdev_band_mask(struct wlan_objmgr_vdev *vdev) {
|
||||
struct wlan_channel *chan;
|
||||
uint32_t band_mask = 0;
|
||||
|
||||
if (!vdev) {
|
||||
policy_mgr_err("vdev is NULL");
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
chan = wlan_vdev_get_active_channel(vdev);
|
||||
if (!chan) {
|
||||
policy_mgr_err("no active channel");
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
band_mask |= BIT(wlan_reg_freq_to_band(chan->ch_freq));
|
||||
return band_mask;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* policy_mgr_get_connected_roaming_vdev_band_mask() - get connected vdev
|
||||
* band mask
|
||||
@@ -1683,11 +1736,9 @@ static uint32_t
|
||||
policy_mgr_get_connected_roaming_vdev_band_mask(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
uint32_t band_mask;
|
||||
uint32_t band_mask = 0, roam_band_mask, band_mask_for_vdev;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
bool dual_sta_roam_active, is_pcl_per_vdev;
|
||||
struct wlan_channel *chan;
|
||||
uint32_t roam_band_mask;
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||
WLAN_POLICY_MGR_ID);
|
||||
@@ -1696,25 +1747,20 @@ policy_mgr_get_connected_roaming_vdev_band_mask(struct wlan_objmgr_psoc *psoc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
chan = wlan_vdev_get_active_channel(vdev);
|
||||
if (!chan) {
|
||||
policy_mgr_err("no active channel");
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
|
||||
return 0;
|
||||
}
|
||||
band_mask_for_vdev = policy_mgr_get_connected_vdev_band_mask(vdev);
|
||||
|
||||
is_pcl_per_vdev = wlan_cm_roam_is_pcl_per_vdev_active(psoc, vdev_id);
|
||||
dual_sta_roam_active = wlan_mlme_get_dual_sta_roaming_enabled(psoc);
|
||||
|
||||
policy_mgr_debug("connected STA (vdev_id:%d, freq:%d), pcl_per_vdev:%d, dual_sta_roam_active:%d",
|
||||
vdev_id, chan->ch_freq, is_pcl_per_vdev,
|
||||
policy_mgr_debug("connected STA vdev_id:%d, pcl_per_vdev:%d, dual_sta_roam_active:%d",
|
||||
vdev_id, is_pcl_per_vdev,
|
||||
dual_sta_roam_active);
|
||||
|
||||
if (dual_sta_roam_active && is_pcl_per_vdev) {
|
||||
band_mask = BIT(wlan_reg_freq_to_band(chan->ch_freq));
|
||||
policy_mgr_debug("connected vdev band mask:%d", band_mask);
|
||||
policy_mgr_debug("connected vdev band mask:%d",
|
||||
band_mask_for_vdev);
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
|
||||
return band_mask;
|
||||
return band_mask_for_vdev;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1730,17 +1776,18 @@ policy_mgr_get_connected_roaming_vdev_band_mask(struct wlan_objmgr_psoc *psoc,
|
||||
policy_mgr_debug("roam_band_mask:%d", roam_band_mask);
|
||||
return roam_band_mask;
|
||||
}
|
||||
|
||||
/*
|
||||
* If PCL command is PDEV level, only one sta is active.
|
||||
* So fill the band mask if intra band roaming is enabled
|
||||
*/
|
||||
if (!is_pcl_per_vdev)
|
||||
if (ucfg_mlme_is_roam_intra_band(psoc)) {
|
||||
band_mask = BIT(wlan_reg_freq_to_band(chan->ch_freq));
|
||||
policy_mgr_debug("connected STA band mask:%d",
|
||||
band_mask);
|
||||
}
|
||||
if ((!is_pcl_per_vdev) && ucfg_mlme_is_roam_intra_band(psoc)) {
|
||||
policy_mgr_debug("connected STA band mask:%d",
|
||||
band_mask_for_vdev);
|
||||
return band_mask_for_vdev;
|
||||
}
|
||||
|
||||
policy_mgr_debug("band_mask:%d", band_mask);
|
||||
return band_mask;
|
||||
}
|
||||
|
||||
|
@@ -3292,6 +3292,8 @@ void policy_mgr_get_ml_and_non_ml_sta_count(struct wlan_objmgr_psoc *psoc,
|
||||
if (!temp_vdev) {
|
||||
policy_mgr_err("invalid vdev for id %d",
|
||||
vdev_id_list[i]);
|
||||
*num_ml = 0;
|
||||
*num_non_ml = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3330,6 +3332,66 @@ void policy_mgr_get_ml_and_non_ml_sta_count(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
#endif
|
||||
|
||||
bool policy_mgr_concurrent_sta_doing_dbs(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
uint8_t num_ml = 0, num_non_ml = 0;
|
||||
uint8_t ml_idx[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
uint8_t non_ml_idx[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
qdf_freq_t freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
bool doing_dbs = false, is_1st_non_ml_24ghz;
|
||||
int i;
|
||||
|
||||
if (!policy_mgr_is_hw_dbs_capable(psoc))
|
||||
return false;
|
||||
|
||||
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);
|
||||
policy_mgr_get_ml_and_non_ml_sta_count(psoc, &num_ml, ml_idx,
|
||||
&num_non_ml, non_ml_idx,
|
||||
freq_list, vdev_id_list);
|
||||
if (num_ml + num_non_ml < 2 || !num_non_ml)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* If more than 1 Non-ML STA is present, check whether they are
|
||||
* within the same band.
|
||||
*/
|
||||
is_1st_non_ml_24ghz =
|
||||
wlan_reg_is_24ghz_ch_freq(freq_list[non_ml_idx[0]]);
|
||||
for (i = 1; i < num_non_ml; i++) {
|
||||
if (wlan_reg_is_24ghz_ch_freq(freq_list[non_ml_idx[i]]) !=
|
||||
is_1st_non_ml_24ghz) {
|
||||
doing_dbs = true;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_non_ml >= 2)
|
||||
goto out;
|
||||
|
||||
/* ML STA + Non-ML STA */
|
||||
for (i = 0; i < num_ml; i++) {
|
||||
if (wlan_reg_is_24ghz_ch_freq(freq_list[ml_idx[i]]) !=
|
||||
is_1st_non_ml_24ghz) {
|
||||
doing_dbs = true;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
policy_mgr_debug("Non-ML STA count %d, ML STA count %d, doing dbs %d",
|
||||
num_non_ml, num_ml, doing_dbs);
|
||||
return doing_dbs;
|
||||
}
|
||||
|
||||
bool policy_mgr_max_concurrent_connections_reached(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
|
@@ -34,6 +34,11 @@
|
||||
#include "wlan_objmgr_global_obj.h"
|
||||
#include "wlan_utility.h"
|
||||
#include "wlan_mlme_ucfg_api.h"
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
#include "wlan_mlo_mgr_cmn.h"
|
||||
#endif
|
||||
#include "wlan_cm_ucfg_api.h"
|
||||
#include "wlan_cm_roam_api.h"
|
||||
|
||||
/**
|
||||
* first_connection_pcl_table - table which provides PCL for the
|
||||
@@ -107,6 +112,155 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
/**
|
||||
* policy_mgr_get_pcl_concurrent_connetions() - Get concurrent connections
|
||||
* those will affect PCL fetching for the given vdev id
|
||||
* @psoc: PSOC object information
|
||||
* @mode: Connection Mode
|
||||
* @vdev_id: vdev id
|
||||
* @vdev_ids: vdev id list of the concurrent connections
|
||||
* @vdev_ids_size: size of the vdev id list
|
||||
*
|
||||
* Return: number of the concurrent connections
|
||||
*/
|
||||
static uint32_t
|
||||
policy_mgr_get_pcl_concurrent_connetions(struct wlan_objmgr_psoc *psoc,
|
||||
enum policy_mgr_con_mode mode,
|
||||
uint8_t vdev_id, uint8_t *vdev_ids,
|
||||
uint32_t vdev_ids_size)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
uint32_t num_related = 0;
|
||||
bool is_ml_sta, has_same_band = false;
|
||||
uint8_t vdev_id_with_diff_band = WLAN_INVALID_VDEV_ID;
|
||||
uint8_t num_ml = 0, num_non_ml = 0, ml_vdev_id;
|
||||
uint8_t ml_idx[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
uint8_t non_ml_idx[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
qdf_freq_t freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0};
|
||||
qdf_freq_t freq = 0, ml_freq;
|
||||
int i;
|
||||
|
||||
if (!vdev_ids || !vdev_ids_size) {
|
||||
policy_mgr_err("Invalid parameters");
|
||||
return num_related;
|
||||
}
|
||||
|
||||
if (mode != PM_STA_MODE) {
|
||||
vdev_ids[0] = vdev_id;
|
||||
return 1;
|
||||
}
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid Context");
|
||||
return 0;
|
||||
}
|
||||
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||
WLAN_POLICY_MGR_ID);
|
||||
if (!vdev) {
|
||||
policy_mgr_err("vdev %d is not present", vdev_id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (wlan_vdev_mlme_is_link_sta_vdev(vdev)) {
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
|
||||
policy_mgr_debug("ignore ML STA link vdev %d", vdev_id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
is_ml_sta = wlan_vdev_mlme_is_mlo_vdev(vdev);
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
|
||||
|
||||
policy_mgr_get_ml_and_non_ml_sta_count(psoc, &num_ml, ml_idx,
|
||||
&num_non_ml, non_ml_idx,
|
||||
freq_list, vdev_id_list);
|
||||
for (i = 0;
|
||||
i < num_non_ml + num_ml && num_related < vdev_ids_size; i++) {
|
||||
if (vdev_id_list[i] == vdev_id) {
|
||||
vdev_ids[num_related++] = vdev_id;
|
||||
freq = freq_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* No existing connection for the vdev id */
|
||||
if (!freq)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < num_ml && num_related < vdev_ids_size; i++) {
|
||||
ml_vdev_id = vdev_id_list[ml_idx[i]];
|
||||
if (ml_vdev_id == vdev_id)
|
||||
continue;
|
||||
|
||||
/* If it's ML STA, return vdev ids for all links */
|
||||
if (is_ml_sta) {
|
||||
policy_mgr_debug("vdev_ids[%d]: %d",
|
||||
num_related, ml_vdev_id);
|
||||
vdev_ids[num_related++] = ml_vdev_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
ml_freq = freq_list[ml_idx[i]];
|
||||
if (wlan_reg_is_24ghz_ch_freq(ml_freq) ==
|
||||
wlan_reg_is_24ghz_ch_freq(freq)) {
|
||||
if (policy_mgr_are_sbs_chan(psoc, freq, ml_freq) &&
|
||||
wlan_cm_same_band_sta_allowed(psoc))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* If it's Non-ML STA, and its freq is within the same
|
||||
* band with one of the existing ML link, but can NOT
|
||||
* lead to SBS, return the original vdev id and vdev id
|
||||
* of the ML link within same band.
|
||||
*/
|
||||
policy_mgr_debug("vdev_ids[%d]: %d",
|
||||
num_related, ml_vdev_id);
|
||||
vdev_ids[num_related++] = ml_vdev_id;
|
||||
has_same_band = true;
|
||||
break;
|
||||
}
|
||||
|
||||
vdev_id_with_diff_band = ml_vdev_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* If it's Non-ML STA, and ML STA is present but the links are
|
||||
* within different band or (within same band but can lead to SBS and
|
||||
* same band STA is allowed), return original vdev id and vdev id of
|
||||
* any ML link within different band.
|
||||
*/
|
||||
if (!has_same_band && vdev_id_with_diff_band != WLAN_INVALID_VDEV_ID) {
|
||||
policy_mgr_debug("vdev_ids[%d]: %d",
|
||||
num_related, vdev_id_with_diff_band);
|
||||
vdev_ids[num_related++] = vdev_id_with_diff_band;
|
||||
}
|
||||
|
||||
out:
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
return num_related;
|
||||
}
|
||||
#else
|
||||
static inline uint32_t
|
||||
policy_mgr_get_pcl_concurrent_connetions(struct wlan_objmgr_psoc *psoc,
|
||||
enum policy_mgr_con_mode mode,
|
||||
uint8_t vdev_id, uint8_t *vdev_ids,
|
||||
uint32_t vdev_ids_size)
|
||||
{
|
||||
if (!vdev_ids || !vdev_ids_size) {
|
||||
policy_mgr_err("Invalid parameters");
|
||||
return 0;
|
||||
}
|
||||
|
||||
vdev_ids[0] = vdev_id;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS policy_mgr_get_pcl_for_vdev_id(struct wlan_objmgr_psoc *psoc,
|
||||
enum policy_mgr_con_mode mode,
|
||||
uint32_t *pcl_ch, uint32_t *len,
|
||||
@@ -116,32 +270,48 @@ QDF_STATUS policy_mgr_get_pcl_for_vdev_id(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
struct policy_mgr_conc_connection_info
|
||||
info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
|
||||
uint8_t num_cxn_del = 0;
|
||||
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
uint8_t ids[MAX_NUMBER_OF_CONC_CONNECTIONS];
|
||||
uint8_t num_del = 0, total_del = 0, id_num = 0;
|
||||
int i;
|
||||
|
||||
policy_mgr_debug("get pcl for existing conn:%d", mode);
|
||||
policy_mgr_debug("get pcl for existing conn:%d vdev id %d",
|
||||
mode, vdev_id);
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid Context");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
*len = 0;
|
||||
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) {
|
||||
/* Check, store and temp delete the mode's parameter */
|
||||
policy_mgr_store_and_del_conn_info_by_vdev_id(psoc,
|
||||
vdev_id,
|
||||
info,
|
||||
&num_cxn_del);
|
||||
/* Get the PCL */
|
||||
status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len,
|
||||
pcl_weight, weight_len);
|
||||
policy_mgr_debug("Get PCL to FW for mode:%d", mode);
|
||||
/* Restore the connection info */
|
||||
policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del);
|
||||
id_num = policy_mgr_get_pcl_concurrent_connetions(psoc, mode,
|
||||
vdev_id, ids,
|
||||
QDF_ARRAY_SIZE(ids));
|
||||
if (!id_num) {
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
*len = 0;
|
||||
|
||||
/* Check, store and temp delete the mode's parameter */
|
||||
for (i = 0; i < id_num; i++) {
|
||||
policy_mgr_store_and_del_conn_info_by_vdev_id(psoc,
|
||||
ids[i],
|
||||
&info[i],
|
||||
&num_del);
|
||||
total_del += num_del;
|
||||
}
|
||||
|
||||
/* Get the PCL */
|
||||
status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len,
|
||||
pcl_weight, weight_len);
|
||||
policy_mgr_debug("Get PCL to FW for mode:%d", mode);
|
||||
/* Restore the connection info */
|
||||
policy_mgr_restore_deleted_conn_info(psoc, info, total_del);
|
||||
|
||||
out:
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
return status;
|
||||
@@ -2411,7 +2581,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t i, j;
|
||||
struct policy_mgr_conc_connection_info
|
||||
info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
|
||||
uint8_t num_cxn_del = 0;
|
||||
uint8_t num_del = 0;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
@@ -2433,10 +2603,17 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
|
||||
* check can be used as though a new connection is coming up,
|
||||
* allowing to detect the disallowed channels.
|
||||
*/
|
||||
if (mode == PM_STA_MODE)
|
||||
policy_mgr_store_and_del_conn_info(psoc, mode,
|
||||
false, info,
|
||||
&num_cxn_del);
|
||||
if (mode == PM_STA_MODE) {
|
||||
if (vdev)
|
||||
policy_mgr_store_and_del_conn_info_by_vdev_id(
|
||||
psoc, wlan_vdev_get_id(vdev),
|
||||
info, &num_del);
|
||||
else
|
||||
policy_mgr_store_and_del_conn_info(psoc,
|
||||
mode, true,
|
||||
info,
|
||||
&num_del);
|
||||
}
|
||||
/*
|
||||
* There is a small window between releasing the above lock
|
||||
* and acquiring the same in policy_mgr_allow_concurrency,
|
||||
@@ -2454,7 +2631,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
|
||||
/* Restore the connection info */
|
||||
if (mode == PM_STA_MODE)
|
||||
policy_mgr_restore_deleted_conn_info(psoc, info,
|
||||
num_cxn_del);
|
||||
num_del);
|
||||
}
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
|
@@ -620,7 +620,6 @@ cm_roam_is_change_in_band_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id, uint32_t roam_band_mask)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
uint32_t count;
|
||||
bool concurrency_is_dbs;
|
||||
struct wlan_channel *chan;
|
||||
|
||||
@@ -638,14 +637,7 @@ cm_roam_is_change_in_band_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
return false;
|
||||
}
|
||||
|
||||
count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
|
||||
NULL);
|
||||
if (count != 2)
|
||||
return true;
|
||||
|
||||
concurrency_is_dbs = !(policy_mgr_current_concurrency_is_mcc(psoc) ||
|
||||
policy_mgr_current_concurrency_is_scc(psoc));
|
||||
|
||||
concurrency_is_dbs = policy_mgr_concurrent_sta_doing_dbs(psoc);
|
||||
if (!concurrency_is_dbs)
|
||||
return true;
|
||||
|
||||
@@ -3339,14 +3331,13 @@ void cm_handle_sta_sta_roaming_enablement(struct wlan_objmgr_psoc *psoc,
|
||||
vdev_id_list,
|
||||
PM_STA_MODE);
|
||||
|
||||
if (!(wlan_mlme_get_dual_sta_roaming_enabled(psoc) && sta_count == 2)) {
|
||||
if (!(wlan_mlme_get_dual_sta_roaming_enabled(psoc) && sta_count >= 2)) {
|
||||
mlme_debug("Dual sta roaming is not enabled or count:%d",
|
||||
sta_count);
|
||||
goto rel_ref;
|
||||
}
|
||||
|
||||
if (!(policy_mgr_current_concurrency_is_mcc(psoc) ||
|
||||
policy_mgr_current_concurrency_is_scc(psoc))) {
|
||||
if (policy_mgr_concurrent_sta_doing_dbs(psoc)) {
|
||||
mlme_debug("After roam on vdev_id:%d, STA + STA concurrency is in DBS:%d",
|
||||
curr_vdev_id, sta_count);
|
||||
for (conn_idx = 0; conn_idx < sta_count; conn_idx++) {
|
||||
@@ -3567,7 +3558,7 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
|
||||
{
|
||||
enum roam_offload_state cur_state;
|
||||
uint8_t temp_vdev_id, roam_enabled_vdev_id;
|
||||
uint32_t roaming_bitmap, count;
|
||||
uint32_t roaming_bitmap;
|
||||
bool dual_sta_roam_active, usr_disabled_roaming, sta_concurrency_is_dbs;
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
|
||||
@@ -3584,18 +3575,12 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
dual_sta_policy = &mlme_obj->cfg.gen.dual_sta_policy;
|
||||
dual_sta_roam_active =
|
||||
wlan_mlme_get_dual_sta_roaming_enabled(psoc);
|
||||
count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
|
||||
NULL);
|
||||
sta_concurrency_is_dbs = (count == 2) &&
|
||||
!(policy_mgr_current_concurrency_is_mcc(psoc) ||
|
||||
policy_mgr_current_concurrency_is_scc(psoc));
|
||||
|
||||
dual_sta_roam_active = wlan_mlme_get_dual_sta_roaming_enabled(psoc);
|
||||
sta_concurrency_is_dbs = policy_mgr_concurrent_sta_doing_dbs(psoc);
|
||||
cur_state = mlme_get_roam_state(psoc, vdev_id);
|
||||
|
||||
mlme_info("sta count:%d, dual_sta_roam_active:%d, is_dbs:%d, state:%d",
|
||||
count, dual_sta_roam_active, sta_concurrency_is_dbs,
|
||||
mlme_info("dual_sta_roam_active:%d, is_dbs:%d, state:%d",
|
||||
dual_sta_roam_active, sta_concurrency_is_dbs,
|
||||
cur_state);
|
||||
|
||||
switch (cur_state) {
|
||||
|
Ссылка в новой задаче
Block a user