qcacld-3.0: SAP concurrency changes

SAP concurrency changes to support
SBS

Change-Id: I8a509b20ab172bce2df977f69a78f5ec0070535a
CRs-Fixed: 3052123
This commit is contained in:
Utkarsh Bhatnagar
2021-10-08 10:46:17 +05:30
committed by Madan Koyyalamudi
parent cea21cd5c9
commit fb350af4eb
12 changed files with 279 additions and 33 deletions

View File

@@ -1040,6 +1040,28 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc,
enum hw_mode_bandwidth bw,
uint32_t ext_flags);
/**
* policy_mgr_check_scc_sbs_channel() - Check for allowed
* concurrency combination
* @psoc: PSOC object information
* @mode: new connection mode
* @ch_freq: channel frequency on which new connection is coming up
* @bw: Bandwidth requested by the connection (optional)
* @vdev_id: Vdev Id
* @cc_mode: concurrent switch mode
*
* When a new connection is about to come up check if current
* concurrency combination including the new connection is
* allowed or not based on the HW capability, but no need to
* invoke get_pcl
*
* Return: True/False
*/
void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
qdf_freq_t *intf_ch_freq,
qdf_freq_t sap_ch_freq,
uint8_t vdev_id, uint8_t cc_mode);
/**
* policy_mgr_nan_sap_pre_enable_conc_check() - Check if NAN+SAP SCC is
* allowed in given ch
@@ -1638,6 +1660,7 @@ struct policy_mgr_sme_cbacks {
* @wlan_hdd_indicate_active_ndp_cnt: indicate active ndp cnt to hdd
* @wlan_get_ap_prefer_conc_ch_params: get prefer ap channel bw parameters
* based on target channel frequency and concurrent connections.
* @wlan_get_sap_acs_band: get acs band from sap config
*/
struct policy_mgr_hdd_cbacks {
void (*sap_restart_chan_switch_cb)(struct wlan_objmgr_psoc *psoc,
@@ -1663,6 +1686,8 @@ struct policy_mgr_hdd_cbacks {
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint32_t chan_freq,
struct ch_params *ch_params);
uint32_t (*wlan_get_sap_acs_band)(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint32_t *acs_band);
};
/**

View File

@@ -3155,7 +3155,9 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc,
}
} else if (WLAN_REG_IS_5GHZ_CH_FREQ
(pm_conc_connection_list[index].freq)) {
if (pm_conc_connection_list[index].freq != ch_freq) {
if (pm_conc_connection_list[index].freq != ch_freq &&
!policy_mgr_are_sbs_chan(psoc, ch_freq,
pm_conc_connection_list[index].freq)) {
match = true;
break;
}
@@ -3370,6 +3372,184 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
return true;
}
static qdf_freq_t
policy_mgr_get_iface_5g_freq(struct wlan_objmgr_psoc *psoc)
{
qdf_freq_t if_freq = 0;
struct policy_mgr_psoc_priv_obj *pm_ctx;
uint32_t conn_index;
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);
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if (pm_conc_connection_list[conn_index].in_use &&
(WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[conn_index].freq) ||
WLAN_REG_IS_6GHZ_CHAN_FREQ(
pm_conc_connection_list[conn_index].freq))) {
if_freq = pm_conc_connection_list[conn_index].freq;
break;
}
}
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
return if_freq;
}
static qdf_freq_t
policy_mgr_get_iface_2g_freq(struct wlan_objmgr_psoc *psoc)
{
qdf_freq_t if_freq = 0;
struct policy_mgr_psoc_priv_obj *pm_ctx;
uint32_t conn_index;
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);
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if (pm_conc_connection_list[conn_index].in_use &&
(WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[conn_index].freq))) {
if_freq = pm_conc_connection_list[conn_index].freq;
break;
}
}
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
return if_freq;
}
static qdf_freq_t
policy_mgr_get_same_band_iface_frq(struct wlan_objmgr_psoc *psoc,
qdf_freq_t ch_freq)
{
return (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq) ?
policy_mgr_get_iface_2g_freq(psoc) :
policy_mgr_get_iface_5g_freq(psoc));
}
void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
qdf_freq_t *intf_ch_freq,
qdf_freq_t sap_ch_freq,
uint8_t vdev_id, uint8_t cc_mode)
{
uint32_t num_connections, acs_band = QCA_ACS_MODE_IEEE80211ANY;
struct policy_mgr_psoc_priv_obj *pm_ctx;
QDF_STATUS status;
struct policy_mgr_conc_connection_info
info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
uint8_t num_cxn_del = 0;
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("Invalid Context");
return;
}
if (pm_ctx->hdd_cbacks.wlan_get_sap_acs_band) {
status = pm_ctx->hdd_cbacks.wlan_get_sap_acs_band(psoc,
vdev_id,
&acs_band);
if (QDF_IS_STATUS_SUCCESS(status))
policy_mgr_debug("acs_band: %d", acs_band);
}
/*
* Different band, this also means that there is only one interface
* which is not on same band as csr_check_concurrent_channel_overlap
* try to find same band vdev if available
*/
if ((WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
!WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq)) ||
(WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq) &&
!WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq))) {
if (policy_mgr_is_current_hwmode_sbs(psoc))
goto sbs_check;
if (policy_mgr_is_hw_dbs_capable(psoc) ||
cc_mode == QDF_MCC_TO_SCC_WITH_PREFERRED_BAND) {
*intf_ch_freq = 0;
return;
}
} else if (policy_mgr_is_hw_dbs_capable(psoc) &&
cc_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) {
/* Same band with Fav channel */
status = policy_mgr_get_sap_mandatory_channel(psoc,
sap_ch_freq,
intf_ch_freq);
if (QDF_IS_STATUS_SUCCESS(status))
return;
policy_mgr_debug("no mandatory channels (%d, %d)", sap_ch_freq,
*intf_ch_freq);
}
sbs_check:
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
/*
* For SAP restart case SAP entry might be present in table,
* so delete it temporary
*/
policy_mgr_store_and_del_conn_info_by_vdev_id(psoc, vdev_id, info,
&num_cxn_del);
/*
* If at least one interface is in same band as the required freq, try
* and set SBS/SCC.
*/
num_connections = policy_mgr_get_connection_count(psoc);
switch (num_connections) {
case 0:
/* use sap channel */
*intf_ch_freq = 0;
break;
case 1:
/* Do not overwrite if the channel can create SBS */
if (policy_mgr_are_sbs_chan(psoc, sap_ch_freq,
*intf_ch_freq))
*intf_ch_freq = 0;
break;
case 2:
if (policy_mgr_is_current_hwmode_sbs(psoc)) {
if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq)) {
if (acs_band == QCA_ACS_MODE_IEEE80211ANY)
*intf_ch_freq =
policy_mgr_get_iface_5g_freq(psoc);
else
/* keep the sap req unchanged, MCC on MAC 0 */
*intf_ch_freq = 0;
} else {
*intf_ch_freq =
policy_mgr_get_iface_5g_freq(psoc);
}
} else if (policy_mgr_is_current_hwmode_dbs(psoc)) {
*intf_ch_freq =
policy_mgr_get_same_band_iface_frq(psoc,
sap_ch_freq);
}
/* This mean Force SCC on *intf_ch_freq */
break;
default:
break;
}
/* Restore the connection entry */
if (num_cxn_del > 0)
policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del);
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
}
/**
* policy_mgr_nss_update_cb() - callback from SME confirming nss
* update

View File

@@ -717,6 +717,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc,
hdd_cbacks->wlan_hdd_indicate_active_ndp_cnt;
pm_ctx->hdd_cbacks.wlan_get_ap_prefer_conc_ch_params =
hdd_cbacks->wlan_get_ap_prefer_conc_ch_params;
pm_ctx->hdd_cbacks.wlan_get_sap_acs_band =
hdd_cbacks->wlan_get_sap_acs_band;
return QDF_STATUS_SUCCESS;
}
@@ -739,6 +741,7 @@ QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc)
pm_ctx->hdd_cbacks.hdd_is_cac_in_progress = NULL;
pm_ctx->hdd_cbacks.hdd_get_ap_6ghz_capable = NULL;
pm_ctx->hdd_cbacks.wlan_get_ap_prefer_conc_ch_params = NULL;
pm_ctx->hdd_cbacks.wlan_get_sap_acs_band = NULL;
return QDF_STATUS_SUCCESS;
}