qcacld-3.0: Cleanup SAP flow in CSR

Remove redundant structures in CSR for SAP functionality
and add a new flow to post SAP requests from SAP module to
LIM.

Change-Id: If3339cf138140ea148bbd263960907fb3a01de43
CRs-Fixed: 3123072
This commit is contained in:
Surya Prakash Sivaraj
2022-01-20 13:57:53 +05:30
committed by Madan Koyyalamudi
parent eed1953b12
commit 08bdec292e
18 changed files with 675 additions and 44 deletions

View File

@@ -1459,7 +1459,10 @@ QDF_STATUS sap_clear_session_param(mac_handle_t mac_handle,
mac_ctx->sap.sapCtxList[sapctx->sessionId].sapPersona =
QDF_MAX_NO_OF_MODE;
sap_clear_global_dfs_param(mac_handle, sapctx);
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_free_roam_profile(&sapctx->csr_roamProfile);
#endif
sap_err("Set sapCtxList null for session %d", sapctx->sessionId);
qdf_mem_zero(sapctx, sizeof(*sapctx));
sapctx->sessionId = WLAN_UMAC_VDEV_ID_MAX;
@@ -1592,7 +1595,10 @@ static QDF_STATUS sap_goto_stopping(struct sap_context *sap_ctx)
}
sap_update_mcs_rate(sap_ctx, false);
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_free_roam_profile(&sap_ctx->csr_roamProfile);
#endif
status = sme_roam_stop_bss(MAC_HANDLE(mac_ctx), sap_ctx->sessionId);
if (status != QDF_STATUS_SUCCESS) {
sap_err("Calling sme_roam_stop_bss status = %d", status);
@@ -2840,11 +2846,17 @@ static void sap_validate_chanmode_and_chwidth(struct mac_context *mac_ctx,
if (WLAN_REG_IS_5GHZ_CH_FREQ(sap_ctx->chan_freq) &&
(sap_ctx->phyMode == eCSR_DOT11_MODE_11g ||
sap_ctx->phyMode == eCSR_DOT11_MODE_11g_ONLY)) {
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.phyMode = eCSR_DOT11_MODE_11a;
#endif
sap_ctx->phyMode = eCSR_DOT11_MODE_11a;
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ctx->chan_freq) &&
(sap_ctx->phyMode == eCSR_DOT11_MODE_11a)) {
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.phyMode = eCSR_DOT11_MODE_11g;
#endif
sap_ctx->phyMode = eCSR_DOT11_MODE_11g;
}
@@ -2941,6 +2953,8 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
"SAP_INIT", "SAP_STARTING", sap_ctx->phyMode,
sap_ctx->ch_params.ch_width);
/* Specify the channel */
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.ChannelInfo.numOfChannels =
1;
sap_ctx->csr_roamProfile.ChannelInfo.freq_list =
@@ -2957,6 +2971,7 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
!!sap_ctx->csr_roamProfile.cac_duration_ms);
sap_ctx->csr_roamProfile.beacon_tx_rate =
sap_ctx->beacon_tx_rate;
#endif
sap_debug("notify hostapd about chan freq selection: %d",
sap_ctx->chan_freq);
sap_signal_hdd_event(sap_ctx, NULL,
@@ -2970,9 +2985,12 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx,
sap_debug("session: %d", sap_ctx->sessionId);
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
qdf_status = sme_bss_start(mac_handle, sap_ctx->sessionId,
&sap_ctx->csr_roamProfile,
&sap_ctx->csr_roamId);
#endif
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
sap_err("Failed to issue sme_roam_connect");
@@ -3593,6 +3611,7 @@ QDF_STATUS sap_fsm(struct sap_context *sap_ctx, struct sap_sm_event *sap_event)
return qdf_status;
}
#ifndef SAP_CP_CLEANUP
eSapStatus
sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
struct csr_roam_profile *profile)
@@ -3745,6 +3764,7 @@ void sap_free_roam_profile(struct csr_roam_profile *profile)
profile->pRSNReqIE = NULL;
}
}
#endif
void sap_sort_mac_list(struct qdf_mac_addr *macList, uint16_t size)
{
@@ -4577,3 +4597,21 @@ bool sap_is_conc_sap_doing_scc_dfs(mac_handle_t mac_handle,
return false;
}
#ifdef SAP_CP_CLEANUP
/**
* sap_build_start_bss_config() - Fill the start bss request for SAP
* @sap_bss_cfg: start bss config
* @config: sap config
*
* This function fills the start bss request for SAP
*
* Return: None
*/
void
sap_build_start_bss_config(struct start_bss_config *sap_bss_cfg,
struct sap_config *config)
{
return;
}
#endif

View File

@@ -139,9 +139,12 @@ struct sap_context {
/* Include the associations MAC addresses */
uint8_t self_mac_addr[CDS_MAC_ADDRESS_LEN];
#ifndef SAP_CP_CLEANUP
/* Include the SME(CSR) context here */
struct csr_roam_profile csr_roamProfile;
#else
struct start_bss_config sap_bss_cfg;
#endif
uint32_t csr_roamId;
/* SAP event Callback to hdd */
@@ -325,12 +328,14 @@ sap_signal_hdd_event(struct sap_context *sap_ctx,
QDF_STATUS sap_fsm(struct sap_context *sap_ctx, struct sap_sm_event *sap_event);
#ifndef SAP_CP_CLEANUP
eSapStatus
sapconvert_to_csr_profile(struct sap_config *config,
eCsrRoamBssType bssType,
struct csr_roam_profile *profile);
void sap_free_roam_profile(struct csr_roam_profile *profile);
#endif
QDF_STATUS
sap_is_peer_mac_allowed(struct sap_context *sap_ctx, uint8_t *peerMac);
@@ -503,4 +508,10 @@ bool
sap_chan_bond_dfs_sub_chan(struct sap_context *sap_context,
qdf_freq_t channel_freq,
ePhyChanBondState bond_state);
#ifdef SAP_CP_CLEANUP
void
sap_build_start_bss_config(struct start_bss_config *sap_bss_cfg,
struct sap_config *config);
#endif
#endif

View File

@@ -306,7 +306,8 @@ QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx,
sap_err("Invalid SAP pointer");
return QDF_STATUS_E_FAULT;
}
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
/* Now configure the roaming profile links. To SSID and bssid.*/
/* We have room for two SSIDs. */
sap_ctx->csr_roamProfile.SSIDs.numOfSSIDs = 1; /* This is true for now. */
@@ -316,9 +317,10 @@ QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx,
sap_ctx->SSIDList[0].ssidHidden;
sap_ctx->csr_roamProfile.BSSIDs.numOfBSSIDs = 1; /* This is true for now. */
sap_ctx->csa_reason = CSA_REASON_UNKNOWN;
sap_ctx->csr_roamProfile.BSSIDs.bssid = &sap_ctx->bssid;
sap_ctx->csr_roamProfile.csrPersona = mode;
#endif
sap_ctx->csa_reason = CSA_REASON_UNKNOWN;
qdf_mem_copy(sap_ctx->self_mac_addr, addr, QDF_MAC_ADDR_SIZE);
mac = sap_get_mac_context();
@@ -376,7 +378,10 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx)
sap_ctx->freq_list = NULL;
sap_ctx->num_of_channel = 0;
}
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_free_roam_profile(&sap_ctx->csr_roamProfile);
#endif
if (sap_ctx->sessionId != WLAN_UMAC_VDEV_ID_MAX) {
/* empty queues/lists/pkts if any */
sap_clear_session_param(MAC_HANDLE(mac), sap_ctx,
@@ -534,7 +539,8 @@ wlansap_set_scan_acs_channel_params(struct sap_config *config,
psap_ctx->acs_cfg = &config->acs_cfg;
psap_ctx->ch_width_orig = config->acs_cfg.ch_width;
psap_ctx->sec_ch_freq = config->sec_ch_freq;
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
/*
* Set the BSSID to your "self MAC Addr" read
* the mac address from Configuation ITEM received
@@ -545,6 +551,7 @@ wlansap_set_scan_acs_channel_params(struct sap_config *config,
/* Save a copy to SAP context */
qdf_mem_copy(psap_ctx->csr_roamProfile.BSSIDs.bssid,
config->self_macaddr.bytes, QDF_MAC_ADDR_SIZE);
#endif
qdf_mem_copy(psap_ctx->self_mac_addr,
config->self_macaddr.bytes, QDF_MAC_ADDR_SIZE);
@@ -757,6 +764,8 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
sap_ctx->phyMode = config->SapHw_mode;
sap_ctx->csa_reason = CSA_REASON_UNKNOWN;
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
/* Set the BSSID to your "self MAC Addr" read the mac address
from Configuation ITEM received from HDD */
sap_ctx->csr_roamProfile.BSSIDs.numOfBSSIDs = 1;
@@ -766,13 +775,13 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
/* Save a copy to SAP context */
qdf_mem_copy(sap_ctx->csr_roamProfile.BSSIDs.bssid,
config->self_macaddr.bytes, QDF_MAC_ADDR_SIZE);
qdf_mem_copy(sap_ctx->self_mac_addr,
config->self_macaddr.bytes, QDF_MAC_ADDR_SIZE);
/* copy the configuration items to csrProfile */
sapconvert_to_csr_profile(config, eCSR_BSS_TYPE_INFRA_AP,
&sap_ctx->csr_roamProfile);
#endif
qdf_mem_copy(sap_ctx->self_mac_addr,
config->self_macaddr.bytes, QDF_MAC_ADDR_SIZE);
/*
* Set the DFS Test Mode setting
* Set beacon channel count before chanel switch
@@ -835,9 +844,11 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx,
/* Handle event */
qdf_status = sap_fsm(sap_ctx, &sap_event);
fail:
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
if (QDF_IS_STATUS_ERROR(qdf_status))
sap_free_roam_profile(&sap_ctx->csr_roamProfile);
#endif
return qdf_status;
} /* wlansap_start_bss */
@@ -1746,6 +1757,24 @@ void wlansap_get_sec_channel(uint8_t sec_ch_offset,
}
}
#ifdef SAP_CP_CLEANUP
/**
* wlansap_fill_channel_change_request() - Fills the channel change request
* @sap_ctx: sap context
* @req: pointer to change channel request
*
* This function fills the channel change request for SAP
*
* Return: None
*/
static void
wlansap_fill_channel_change_request(struct sap_context *sap_ctx,
struct channel_change_req *req)
{
return;
}
#endif
QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
uint32_t target_chan_freq)
{
@@ -1780,16 +1809,20 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
else if (WLAN_REG_IS_24GHZ_CH_FREQ(target_chan_freq) &&
(phy_mode == eCSR_DOT11_MODE_11a))
phy_mode = eCSR_DOT11_MODE_11g;
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.phyMode = phy_mode;
#endif
sap_ctx->phyMode = phy_mode;
if (!sap_ctx->chan_freq) {
sap_err("Invalid channel list");
return QDF_STATUS_E_FAULT;
}
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.ChannelInfo.freq_list[0] = target_chan_freq;
#endif
/*
* We are getting channel bonding mode from sapDfsInfor structure
* because we've implemented channel width fallback mechanism for DFS
@@ -1806,9 +1839,13 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
sap_ctx->chan_freq = target_chan_freq;
wlansap_get_sec_channel(ch_params->sec_ch_offset, sap_ctx->chan_freq,
&sap_ctx->sec_ch_freq);
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_ctx->csr_roamProfile.ch_params = *ch_params;
#endif
sap_dfs_set_current_channel(sap_ctx);
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_get_cac_dur_dfs_region(sap_ctx,
&sap_ctx->csr_roamProfile.cac_duration_ms,
&sap_ctx->csr_roamProfile.dfs_regdomain,
@@ -1821,7 +1858,7 @@ QDF_STATUS wlansap_channel_change_request(struct sap_context *sap_ctx,
sap_ctx->sessionId,
ch_params,
&sap_ctx->csr_roamProfile);
#endif
sap_debug("chan_freq:%d phy_mode %d width:%d offset:%d seg0:%d seg1:%d",
sap_ctx->chan_freq, phy_mode, ch_params->ch_width,
ch_params->sec_ch_offset, ch_params->center_freq_seg0,
@@ -2467,7 +2504,10 @@ QDF_STATUS wlansap_acs_chselect(struct sap_context *sap_context,
sap_context->acs_cfg = &config->acs_cfg;
sap_context->ch_width_orig = config->acs_cfg.ch_width;
/* To be removed after SAP CSR cleanup changes */
#ifndef SAP_CP_CLEANUP
sap_context->csr_roamProfile.phyMode = config->acs_cfg.hw_mode;
#endif
sap_context->phyMode = config->acs_cfg.hw_mode;
/*