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
committato da Madan Koyyalamudi
parent cea21cd5c9
commit fb350af4eb
12 ha cambiato i file con 279 aggiunte e 33 eliminazioni

Vedi File

@@ -3474,6 +3474,34 @@ sap_restart:
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_get_sap_acs_band(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
uint32_t *acs_band)
{
struct hdd_adapter *ap_adapter = wlan_hdd_get_adapter_from_vdev(psoc,
vdev_id);
struct sap_config *sap_config;
if (!ap_adapter || (ap_adapter->device_mode != QDF_SAP_MODE &&
ap_adapter->device_mode != QDF_P2P_GO_MODE)) {
hdd_err("invalid adapter");
return QDF_STATUS_E_FAILURE;
}
/*
* If acs mode is false, that means acs is disabled and acs band can be
* QCA_ACS_MODE_IEEE80211ANY
*/
sap_config = &ap_adapter->session.ap.sap_config;
if (sap_config->acs_cfg.acs_mode == false) {
*acs_band = QCA_ACS_MODE_IEEE80211ANY;
return QDF_STATUS_SUCCESS;
}
*acs_band = sap_config->acs_cfg.band;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_get_ap_prefer_conc_ch_params(
struct wlan_objmgr_psoc *psoc,

Vedi File

@@ -110,6 +110,21 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint32_t *ch_freq);
/**
* wlan_get_sap_acs_band() - Get sap acs band
*
* @psoc: pointer to psoc
* @vdev_id: vdev id
* @acs_band: Pointer to acs_band
*
* This function is used to get sap acs band from sap config
*
* Return: QDF_STATUS_SUCCESS if successful
*/
uint32_t
wlan_get_sap_acs_band(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
uint32_t *acs_band);
/**
* wlan_get_ap_prefer_conc_ch_params() - Get prefer sap target channel
* bw parameters

Vedi File

@@ -3831,6 +3831,8 @@ static void hdd_register_policy_manager_callback(
hdd_indicate_active_ndp_cnt;
hdd_cbacks.wlan_get_ap_prefer_conc_ch_params =
wlan_get_ap_prefer_conc_ch_params;
hdd_cbacks.wlan_get_sap_acs_band =
wlan_get_sap_acs_band;
if (QDF_STATUS_SUCCESS !=
policy_mgr_register_hdd_cb(psoc, &hdd_cbacks)) {

Vedi File

@@ -976,7 +976,8 @@ sap_validate_chan(struct sap_context *sap_context,
mac_handle,
sap_context->chan_freq,
sap_context->phyMode,
sap_context->cc_switch_mode);
sap_context->cc_switch_mode,
sap_context->sessionId);
sap_debug("After check overlap: sap freq %d con freq:%d",
sap_context->chan_freq, con_ch_freq);
ch_params = sap_context->ch_params;

Vedi File

@@ -454,6 +454,7 @@ uint16_t wlansap_check_cc_intf(struct sap_context *sap_ctx)
struct mac_context *mac;
uint16_t intf_ch_freq;
eCsrPhyMode phy_mode;
uint8_t vdev_id;
mac = sap_get_mac_context();
if (!mac) {
@@ -461,11 +462,13 @@ uint16_t wlansap_check_cc_intf(struct sap_context *sap_ctx)
return 0;
}
phy_mode = sap_ctx->phyMode;
vdev_id = sap_ctx->sessionId;
intf_ch_freq = sme_check_concurrent_channel_overlap(
MAC_HANDLE(mac),
sap_ctx->chan_freq,
phy_mode,
sap_ctx->cc_switch_mode);
sap_ctx->cc_switch_mode,
vdev_id);
return intf_ch_freq;
}
#endif
@@ -3250,14 +3253,14 @@ qdf_freq_t wlansap_get_chan_band_restrict(struct sap_context *sap_ctx,
cc_mode = sap_ctx->cc_switch_mode;
phy_mode = sap_ctx->phyMode;
vdev_id = wlan_vdev_get_id(sap_ctx->vdev);
intf_ch_freq = sme_check_concurrent_channel_overlap(
MAC_HANDLE(mac),
restart_freq,
phy_mode,
cc_mode);
cc_mode, vdev_id);
if (intf_ch_freq)
restart_freq = intf_ch_freq;
vdev_id = sap_ctx->vdev->vdev_objmgr.vdev_id;
sap_debug("vdev: %d, CSA target freq: %d", vdev_id, restart_freq);
return restart_freq;

Vedi File

@@ -544,7 +544,7 @@ uint32_t csr_get_beaconing_concurrent_channel(struct mac_context *mac_ctx,
uint16_t csr_check_concurrent_channel_overlap(
struct mac_context *mac,
uint32_t sap_ch_freq, eCsrPhyMode sap_phymode,
uint8_t cc_switch_mode);
uint8_t cc_switch_mode, uint8_t vdev_id);
#endif
/* Returns whether the current association is a 11r assoc or not */

Vedi File

@@ -853,6 +853,7 @@ uint32_t sme_get_beaconing_concurrent_operation_channel(mac_handle_t mac_handle,
* @sap_ch_freq: SAP home channel frequency
* @sapPhyMode: sap phymode
* @cc_switch_mode: force scc channel switch mode
* @vdev_id: vdev id
*
* Determine if a concurrent channel is interfering.
*
@@ -861,7 +862,8 @@ uint32_t sme_get_beaconing_concurrent_operation_channel(mac_handle_t mac_handle,
uint16_t sme_check_concurrent_channel_overlap(mac_handle_t mac_handle,
uint16_t sap_ch_freq,
eCsrPhyMode sapPhyMode,
uint8_t cc_switch_mode);
uint8_t cc_switch_mode,
uint8_t vdev_id);
#endif
/**
@@ -1924,7 +1926,7 @@ void sme_update_tgt_services(mac_handle_t mac_handle,
bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
uint32_t sap_ch_freq, eCsrPhyMode sap_phy_mode,
uint8_t cc_switch_mode,
uint8_t session_id);
uint8_t vdev_id);
bool sme_is_session_id_valid(mac_handle_t mac_handle, uint32_t session_id);

Vedi File

@@ -5361,7 +5361,8 @@ uint32_t sme_get_beaconing_concurrent_operation_channel(mac_handle_t mac_handle,
uint16_t sme_check_concurrent_channel_overlap(mac_handle_t mac_handle,
uint16_t sap_ch_freq,
eCsrPhyMode sapPhyMode,
uint8_t cc_switch_mode)
uint8_t cc_switch_mode,
uint8_t vdev_id)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct mac_context *mac = MAC_CONTEXT(mac_handle);
@@ -5370,7 +5371,7 @@ uint16_t sme_check_concurrent_channel_overlap(mac_handle_t mac_handle,
status = sme_acquire_global_lock(&mac->sme);
if (QDF_IS_STATUS_SUCCESS(status)) {
intf_ch_freq = csr_check_concurrent_channel_overlap(
mac, sap_ch_freq, sapPhyMode, cc_switch_mode);
mac, sap_ch_freq, sapPhyMode, cc_switch_mode, vdev_id);
sme_release_global_lock(&mac->sme);
}
@@ -10353,7 +10354,7 @@ QDF_STATUS sme_enable_dfs_chan_scan(mac_handle_t mac_handle, uint8_t dfs_flag)
* @sap_ch - channel to switch
* @sap_phy_mode - phy mode of SAP
* @cc_switch_mode - concurreny switch mode
* @session_id - sme session id.
* @vdev_id - vdev id.
*
* Return: true if there is no channel interference else return false
*/
@@ -10361,11 +10362,11 @@ bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
uint32_t sap_ch_freq,
eCsrPhyMode sap_phy_mode,
uint8_t cc_switch_mode,
uint8_t session_id)
uint8_t vdev_id)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct csr_roam_session *session = CSR_GET_SESSION(mac, session_id);
struct csr_roam_session *session = CSR_GET_SESSION(mac, vdev_id);
uint16_t intf_channel_freq = 0;
if (!session)
@@ -10375,7 +10376,8 @@ bool sme_validate_sap_channel_switch(mac_handle_t mac_handle,
status = sme_acquire_global_lock(&mac->sme);
if (QDF_IS_STATUS_SUCCESS(status)) {
intf_channel_freq = csr_check_concurrent_channel_overlap(
mac, sap_ch_freq, sap_phy_mode, cc_switch_mode);
mac, sap_ch_freq, sap_phy_mode, cc_switch_mode,
vdev_id);
sme_release_global_lock(&mac->sme);
} else {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,

Vedi File

@@ -614,7 +614,7 @@ static void csr_handle_conc_chnl_overlap_for_sap_go(
*/
uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
uint32_t sap_ch_freq, eCsrPhyMode sap_phymode,
uint8_t cc_switch_mode)
uint8_t cc_switch_mode, uint8_t vdev_id)
{
struct csr_roam_session *session = NULL;
uint8_t i = 0, chb = PHY_SINGLE_CHANNEL_CENTERED;
@@ -708,24 +708,9 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
intf_ch_freq = 0;
} else if (intf_ch_freq && sap_ch_freq != intf_ch_freq &&
(policy_mgr_is_force_scc(mac_ctx->psoc))) {
if (!((intf_ch_freq <= wlan_reg_ch_to_freq(CHAN_ENUM_2484) &&
sap_ch_freq <= wlan_reg_ch_to_freq(CHAN_ENUM_2484)) ||
(intf_ch_freq > wlan_reg_ch_to_freq(CHAN_ENUM_2484) &&
sap_ch_freq > wlan_reg_ch_to_freq(CHAN_ENUM_2484)))) {
if (policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) ||
cc_switch_mode ==
QDF_MCC_TO_SCC_WITH_PREFERRED_BAND)
intf_ch_freq = 0;
} else if (policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) &&
cc_switch_mode ==
QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) {
status = policy_mgr_get_sap_mandatory_channel(
mac_ctx->psoc, sap_ch_freq,
&intf_ch_freq);
if (QDF_IS_STATUS_ERROR(status))
sme_err("no mandatory channels (%d, %d)",
sap_ch_freq, intf_ch_freq);
}
policy_mgr_check_scc_sbs_channel(mac_ctx->psoc, &intf_ch_freq,
sap_ch_freq, vdev_id,
cc_switch_mode);
} else if ((intf_ch_freq == sap_ch_freq) && (cc_switch_mode ==
QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL)) {
if (WLAN_REG_IS_24GHZ_CH_FREQ(intf_ch_freq) ||