qcacld-3.0: Clean up struct del_bss_params
As a part of vdev convergence, legacy vdev code for vdev delete/stop/
down is removed. WMA timer for vdev manager operations are deleted,
now target_if takes care of it.
Structure del_bss_params is no more used to store bss delete request
params, hence struct del_bss_params is cleaned up from legacy code.
Change-Id: I487d2683908b705176ff8064dd3ce7cd49a3ce47
CRs-Fixed: 2517880
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index 4015aa9..bec4a0a 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -3354,14 +3354,9 @@
lim_del_bss(struct mac_context *mac, tpDphHashNode sta, uint16_t bss_idx,
struct pe_session *pe_session)
{
- struct del_bss_param *pDelBssParams = NULL;
struct scheduler_msg msgQ = {0};
QDF_STATUS retCode = QDF_STATUS_SUCCESS;
- pDelBssParams = qdf_mem_malloc(sizeof(*pDelBssParams));
- if (!pDelBssParams)
- return QDF_STATUS_E_NOMEM;
-
/* DPH was storing the AssocID in staID field, */
/* staID is actually assigned by HAL when AddSTA message is sent. */
if (sta) {
@@ -3380,10 +3375,6 @@
lim_deactivate_and_change_timer(mac, eLIM_JOIN_FAIL_TIMER);
}
- pDelBssParams->status = QDF_STATUS_SUCCESS;
- qdf_mem_copy(pDelBssParams->bssid, pe_session->bssId,
- sizeof(tSirMacAddr));
- pDelBssParams->vdev_id = pe_session->smeSessionId;
pe_debug("Sessionid %d : Sending HAL_DELETE_BSS_REQ BSSID:"
QDF_MAC_ADDR_STR,
pe_session->peSessionId,
@@ -3397,8 +3388,8 @@
else
msgQ.type = WMA_DELETE_BSS_REQ;
msgQ.reserved = 0;
- msgQ.bodyptr = pDelBssParams;
- msgQ.bodyval = 0;
+ msgQ.bodyptr = NULL;
+ msgQ.bodyval = pe_session->smeSessionId;
MTRACE(mac_trace_msg_tx(mac, pe_session->peSessionId, msgQ.type));
@@ -3407,7 +3398,6 @@
SET_LIM_PROCESS_DEFD_MESGS(mac, true);
pe_err("Posting DELETE_BSS_REQ to HAL failed, reason=%X",
retCode);
- qdf_mem_free(pDelBssParams);
}
return retCode;
diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
index 392acd1..d245425 100644
--- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
+++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
@@ -1204,30 +1204,26 @@
return QDF_STATUS_SUCCESS;
}
-void lim_ibss_del_bss_rsp_when_coalescing(struct mac_context *mac, void *msg,
+void lim_ibss_del_bss_rsp_when_coalescing(struct mac_context *mac,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session)
{
- struct del_bss_param *pDelBss = (struct del_bss_param *)msg;
-
pe_debug("IBSS: DEL_BSS_RSP Rcvd during coalescing!");
- if (!pDelBss) {
+ if (!vdev_stop_rsp) {
pe_err("IBSS: DEL_BSS_RSP(coalesce) with no body!");
- goto end;
+ return;
}
- if (pDelBss->status != QDF_STATUS_SUCCESS) {
+ if (vdev_stop_rsp->status != QDF_STATUS_SUCCESS) {
pe_err("IBSS: DEL_BSS_RSP(coalesce) error: %x",
- pDelBss->status);
- goto end;
+ vdev_stop_rsp->status);
+ return;
}
/* Delete peer entries. */
/* add the new bss */
ibss_bss_add(mac, pe_session);
-end:
- if (pDelBss)
- qdf_mem_free(pDelBss);
}
void lim_ibss_add_bss_rsp_when_coalescing(struct mac_context *mac,
@@ -1267,19 +1263,21 @@
ibss_coalesce_free(mac);
}
-void lim_ibss_del_bss_rsp(struct mac_context *mac, void *msg, struct pe_session *pe_session)
+void lim_ibss_del_bss_rsp(struct mac_context *mac,
+ struct del_bss_resp *vdev_stop_rsp,
+ struct pe_session *pe_session)
{
tSirResultCodes rc = eSIR_SME_SUCCESS;
- struct del_bss_param *pDelBss = (struct del_bss_param *)msg;
SET_LIM_PROCESS_DEFD_MESGS(mac, true);
- if (!pDelBss) {
+ if (!vdev_stop_rsp) {
pe_err("IBSS: DEL_BSS_RSP with no body!");
rc = eSIR_SME_REFUSED;
goto end;
}
- pe_session = pe_find_session_by_sme_session_id(mac, pDelBss->vdev_id);
+ pe_session = pe_find_session_by_sme_session_id(mac,
+ vdev_stop_rsp->vdev_id);
if (!pe_session) {
pe_err("Session Does not exist for given sessionID");
goto end;
@@ -1292,13 +1290,13 @@
* 'IDLE' and gLimIbssCoalescingHappened flag will be false. In this case STOP BSS RSP has to be sent to SME.
*/
if (true == mac->lim.gLimIbssCoalescingHappened) {
-
- lim_ibss_del_bss_rsp_when_coalescing(mac, msg, pe_session);
+ lim_ibss_del_bss_rsp_when_coalescing(mac, vdev_stop_rsp,
+ pe_session);
return;
}
- if (pDelBss->status != QDF_STATUS_SUCCESS) {
- pe_err("IBSS: DEL_BSS_RSP error: %x", pDelBss->status);
+ if (vdev_stop_rsp->status != QDF_STATUS_SUCCESS) {
+ pe_err("IBSS: DEL_BSS_RSP error: %x", vdev_stop_rsp->status);
rc = eSIR_SME_STOP_BSS_FAILURE;
goto end;
}
@@ -1323,8 +1321,6 @@
cfg_default(CFG_SHORT_SLOT_TIME_ENABLED);
end:
- if (pDelBss)
- qdf_mem_free(pDelBss);
/* Delete PE session once BSS is deleted */
if (pe_session) {
lim_send_sme_rsp(mac, eWNI_SME_STOP_BSS_RSP, rc,
diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h
index 4950b96..06bd4fa 100644
--- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h
+++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h
@@ -89,9 +89,38 @@
void lim_process_ibss_del_sta_rsp(struct mac_context *mac_ctx,
struct scheduler_msg *lim_msg,
struct pe_session *pe_session);
+
tLimIbssPeerNode *lim_ibss_peer_find(struct mac_context *mac, tSirMacAddr macAddr);
-void lim_ibss_del_bss_rsp(struct mac_context *, void *, struct pe_session *);
-void lim_ibss_del_bss_rsp_when_coalescing(struct mac_context *, void *, struct pe_session *);
+
+/**
+ * lim_ibss_del_bss_rsp() - Handle ibss delete
+ * response
+ *
+ * @mac: Pointer to Global MAC structure
+ * @vdev_stop_rsp: pointer to del bss response
+ * @pe_session: pointer to pe session
+ *
+ * Return: None
+ *
+ */
+void lim_ibss_del_bss_rsp(struct mac_context *mac,
+ struct del_bss_resp *vdev_stop_rsp,
+ struct pe_session *pe_session);
+
+/**
+ * lim_ibss_del_bss_rsp_when_coalescing() - Handle ibss delete
+ * response when coalescing
+ *
+ * @mac: Pointer to Global MAC structure
+ * @vdev_stop_rsp: pointer to del bss response
+ * @pe_session: pointer to pe session
+ *
+ * Return: None
+ *
+ */
+void lim_ibss_del_bss_rsp_when_coalescing(struct mac_context *mac,
+ struct del_bss_resp *vdev_stop_rsp,
+ struct pe_session *pe_session);
/**
* lim_ibss_add_bss_rsp_when_coalescing()- Handle ADD BSS rsp of IBSS coalescing
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index b0e752e..3d53e2b 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -1267,27 +1267,15 @@
* failure should be sent to the upper layers.
*/
if (param->result_code != eSIR_SME_PEER_CREATE_FAILED) {
- struct del_bss_param *params;
QDF_STATUS status;
session->prot_status_code = param->prot_status_code;
session->result_code = param->result_code;
- params = qdf_mem_malloc(sizeof(*params));
- if (!params) {
- lim_join_result_callback(mac_ctx,
- session->smeSessionId);
- return QDF_STATUS_E_NOMEM;
- }
- params->vdev_id = session->smeSessionId;
- qdf_mem_copy(params->bssid, session->bssId,
- sizeof(tSirMacAddr));
-
- status = wma_send_vdev_stop(params);
+ status = wma_send_vdev_stop(session->smeSessionId);
if (QDF_IS_STATUS_ERROR(status)) {
lim_join_result_callback(mac_ctx,
session->smeSessionId);
- qdf_mem_free(params);
}
return status;
@@ -1553,7 +1541,7 @@
}
void lim_process_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session)
{
/* we need to process the deferred message since the initiating req. there might be nested request. */
@@ -1564,10 +1552,10 @@
if (LIM_IS_AP_ROLE(pe_session) &&
(pe_session->statypeForBss == STA_ENTRY_SELF)) {
- lim_process_ap_mlm_del_bss_rsp(mac, pDelBss, pe_session);
+ lim_process_ap_mlm_del_bss_rsp(mac, vdev_stop_rsp, pe_session);
return;
}
- lim_process_sta_mlm_del_bss_rsp(mac, pDelBss, pe_session);
+ lim_process_sta_mlm_del_bss_rsp(mac, vdev_stop_rsp, pe_session);
#ifdef WLAN_FEATURE_11W
if (pe_session->limRmfEnabled) {
@@ -1580,7 +1568,7 @@
}
void lim_process_sta_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBssParams,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session)
{
tpDphHashNode sta =
@@ -1588,11 +1576,11 @@
&pe_session->dph.dphHashTable);
tSirResultCodes status_code = eSIR_SME_SUCCESS;
- if (!pDelBssParams) {
+ if (!vdev_stop_rsp) {
pe_err("Invalid body pointer in message");
goto end;
}
- if (QDF_STATUS_SUCCESS == pDelBssParams->status) {
+ if (vdev_stop_rsp->status == QDF_STATUS_SUCCESS) {
pe_debug("STA received the DEL_BSS_RSP");
if (!sta) {
pe_err("DPH Entry for STA 1 missing");
@@ -1613,9 +1601,6 @@
status_code = eSIR_SME_STOP_BSS_FAILURE;
}
end:
- if (pDelBssParams)
- qdf_mem_free(pDelBssParams);
-
if (!sta)
return;
if ((LIM_IS_STA_ROLE(pe_session)) &&
@@ -1637,20 +1622,19 @@
}
void lim_process_ap_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session)
{
tSirResultCodes rc = eSIR_SME_SUCCESS;
if (!pe_session) {
pe_err("Session entry passed is NULL");
- if (pDelBss) {
- qdf_mem_free(pDelBss);
- }
+ if (vdev_stop_rsp)
+ qdf_mem_free(vdev_stop_rsp);
return;
}
- if (!pDelBss) {
+ if (!vdev_stop_rsp) {
pe_err("BSS: DEL_BSS_RSP with no body!");
rc = eSIR_SME_REFUSED;
goto end;
@@ -1666,8 +1650,8 @@
rc = eSIR_SME_REFUSED;
goto end;
}
- if (pDelBss->status != QDF_STATUS_SUCCESS) {
- pe_err("BSS: DEL_BSS_RSP error (%x)", pDelBss->status);
+ if (vdev_stop_rsp->status != QDF_STATUS_SUCCESS) {
+ pe_err("BSS: DEL_BSS_RSP error (%x)", vdev_stop_rsp->status);
rc = eSIR_SME_STOP_BSS_FAILURE;
goto end;
}
@@ -1683,10 +1667,6 @@
lim_send_sme_rsp(mac, eWNI_SME_STOP_BSS_RSP, rc,
pe_session->smeSessionId);
pe_delete_session(mac, pe_session);
-
- if (pDelBss) {
- qdf_mem_free(pDelBss);
- }
}
/**
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index e8e34b9..dc71711 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -1830,16 +1830,16 @@
--------------------------------------------------------------------------*/
void lim_handle_delete_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss)
+ struct del_bss_resp *del_bss_rsp)
{
struct pe_session *pe_session;
pe_session =
- pe_find_session_by_sme_session_id(mac, pDelBss->vdev_id);
+ pe_find_session_by_sme_session_id(mac, del_bss_rsp->vdev_id);
if (!pe_session) {
pe_err("Session Does not exist for vdev id: %d",
- pDelBss->vdev_id);
- qdf_mem_free(pDelBss);
+ del_bss_rsp->vdev_id);
+ qdf_mem_free(del_bss_rsp);
return;
}
@@ -1851,14 +1851,15 @@
*/
pe_session->process_ho_fail = false;
if (LIM_IS_IBSS_ROLE(pe_session))
- lim_ibss_del_bss_rsp(mac, pDelBss, pe_session);
+ lim_ibss_del_bss_rsp(mac, del_bss_rsp, pe_session);
else if (LIM_IS_UNKNOWN_ROLE(pe_session))
lim_process_sme_del_bss_rsp(mac, pe_session);
else if (LIM_IS_NDI_ROLE(pe_session))
- lim_ndi_del_bss_rsp(mac, pDelBss, pe_session);
+ lim_ndi_del_bss_rsp(mac, del_bss_rsp, pe_session);
else
- lim_process_mlm_del_bss_rsp(mac, pDelBss, pe_session);
+ lim_process_mlm_del_bss_rsp(mac, del_bss_rsp, pe_session);
+ qdf_mem_free(del_bss_rsp);
}
/** -----------------------------------------------------------------
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
index b20c5fb..fba236f 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
@@ -179,8 +179,15 @@
struct pe_session *pe_session,
uint8_t smesessionId);
+/**
+ * lim_handle_delete_bss_rsp () - API to handle delete bss response
+ * @mac: global mac structure
+ * @del_bss_rsp: pointer to del bss response
+ *
+ * Return: None
+ */
void lim_handle_delete_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss);
+ struct del_bss_resp *del_bss_rsp);
void lim_handle_csa_offload_msg(struct mac_context *mac_ctx,
struct scheduler_msg *msg);
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index d82a4c5..9d89b5f 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -755,18 +755,38 @@
struct pe_session *pe_session);
void lim_process_mlm_del_sta_rsp(struct mac_context *mac,
struct scheduler_msg *limMsgQ);
+
+/**
+ * lim_process_mlm_del_bss_rsp () - API to process delete bss response
+ * @mac: Pointer to Global MAC structure
+ * @vdev_stop_rsp: pointer to vdev stop response
+ * @pe_session: pointer to pe_session
+ *
+ * Return: None
+ */
void lim_process_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session);
+
void lim_process_sta_mlm_add_sta_rsp(struct mac_context *mac,
struct scheduler_msg *limMsgQ,
struct pe_session *pe_session);
void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac,
struct scheduler_msg *limMsgQ,
struct pe_session *pe_session);
+
+/**
+ * lim_process_sta_mlm_del_bss_rsp() - handle del bss response of STA
+ * @mac: Pointer to Global MAC structure
+ * @vdev_stop_rsp: pointer to vdev stop response
+ * @pe_session: pointer to pe_session
+ *
+ * Return: none
+ */
void lim_process_sta_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBssParams,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session);
+
void lim_process_mlm_set_sta_key_rsp(struct mac_context *mac,
struct scheduler_msg *limMsgQ);
void lim_process_mlm_set_bss_key_rsp(struct mac_context *mac,
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 6a48537..f1cfcaf 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -532,8 +532,17 @@
void lim_process_ap_mlm_add_sta_rsp(struct mac_context *mac,
struct scheduler_msg *limMsgQ,
struct pe_session *pe_session);
+
+/**
+ * lim_process_ap_mlm_del_bss_rsp() - handle del bss response of AP
+ * @mac: Pointer to Global MAC structure
+ * @vdev_stop_rsp: pointer to vdev stop response
+ * @pe_session: pointer to pe_session
+ *
+ * Return: none
+ */
void lim_process_ap_mlm_del_bss_rsp(struct mac_context *mac,
- struct del_bss_param *pDelBss,
+ struct del_bss_resp *vdev_stop_rsp,
struct pe_session *pe_session);
void lim_process_ap_mlm_del_sta_rsp(struct mac_context *mac,