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/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h
index 5327bf9..d2c58af 100644
--- a/components/mlme/core/inc/wlan_mlme_main.h
+++ b/components/mlme/core/inc/wlan_mlme_main.h
@@ -90,6 +90,7 @@
* originated from driver
* @peer_disconnect_ies: Disconnect IEs received in deauth/disassoc frames
* from peer
+ * @vdev_stop_type: vdev stop type request
*/
struct mlme_legacy_priv {
bool chan_switch_in_progress;
@@ -104,6 +105,7 @@
struct mlme_roam_after_data_stall roam_invoke_params;
struct wlan_ies self_disconnect_ies;
struct wlan_ies peer_disconnect_ies;
+ uint32_t vdev_stop_type;
};
#ifndef CRYPTO_SET_KEY_CONVERGED
diff --git a/components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h b/components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h
index 9399b4a..42a025a 100644
--- a/components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h
+++ b/components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h
@@ -188,6 +188,43 @@
enum vdev_assoc_type assoc_type);
/**
+ * mlme_get_vdev_bss_peer_mac_addr() - to get peer mac address
+ * @vdev: pointer to vdev
+ * @bss_peer_mac_address: pointer to bss_peer_mac_address
+ *
+ * This API is used to get mac address of peer.
+ *
+ * Return: QDF_STATUS based on overall success
+ */
+QDF_STATUS mlme_get_vdev_bss_peer_mac_addr(
+ struct wlan_objmgr_vdev *vdev,
+ struct qdf_mac_addr *bss_peer_mac_address);
+
+/**
+ * mlme_get_vdev_stop_type() - to get vdev stop type
+ * @vdev: vdev pointer
+ * @vdev_stop_type: vdev stop type
+ *
+ * This API will get vdev stop type from mlme legacy priv.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_get_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
+ uint32_t *vdev_stop_type);
+
+/**
+ * mlme_set_vdev_stop_type() - to set vdev stop type
+ * @vdev: vdev pointer
+ * @vdev_stop_type: vdev stop type
+ *
+ * This API will set vdev stop type from mlme legacy priv.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_set_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
+ uint32_t vdev_stop_type);
+
+/**
* mlme_get_assoc_type() - get associate type
* @vdev: vdev pointer
*
diff --git a/components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c b/components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c
index 98bd7a2..5fb8d05 100644
--- a/components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c
+++ b/components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c
@@ -669,6 +669,64 @@
return QDF_STATUS_SUCCESS;
}
+QDF_STATUS mlme_get_vdev_bss_peer_mac_addr(
+ struct wlan_objmgr_vdev *vdev,
+ struct qdf_mac_addr *bss_peer_mac_address)
+{
+ struct wlan_objmgr_peer *peer;
+
+ if (!vdev) {
+ mlme_legacy_err("vdev is null");
+ return QDF_STATUS_E_INVAL;
+ }
+
+ peer = wlan_objmgr_vdev_try_get_bsspeer(vdev, WLAN_MLME_OBJMGR_ID);
+ if (!peer) {
+ mlme_legacy_err("peer is null");
+ return QDF_STATUS_E_INVAL;
+ }
+ wlan_peer_obj_lock(peer);
+ qdf_mem_copy(bss_peer_mac_address->bytes, wlan_peer_get_macaddr(peer),
+ QDF_MAC_ADDR_SIZE);
+ wlan_peer_obj_unlock(peer);
+
+ wlan_objmgr_peer_release_ref(peer, WLAN_MLME_OBJMGR_ID);
+
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS mlme_get_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
+ uint32_t *vdev_stop_type)
+{
+ struct mlme_legacy_priv *mlme_priv;
+
+ mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+ if (!mlme_priv) {
+ mlme_legacy_err("vdev legacy private object is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *vdev_stop_type = mlme_priv->vdev_stop_type;
+
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS mlme_set_vdev_stop_type(struct wlan_objmgr_vdev *vdev,
+ uint32_t vdev_stop_type)
+{
+ struct mlme_legacy_priv *mlme_priv;
+
+ mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+ if (!mlme_priv) {
+ mlme_legacy_err("vdev legacy private object is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ mlme_priv->vdev_stop_type = vdev_stop_type;
+
+ return QDF_STATUS_SUCCESS;
+}
+
enum vdev_assoc_type mlme_get_assoc_type(struct wlan_objmgr_vdev *vdev)
{
struct mlme_legacy_priv *mlme_priv;
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,
diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c
index 2b47031..380907e 100644
--- a/core/mac/src/pe/nan/nan_datapath.c
+++ b/core/mac/src/pe/nan/nan_datapath.c
@@ -373,16 +373,8 @@
lim_send_start_bss_confirm(mac_ctx, &mlm_start_cnf);
}
-/**
- * lim_ndi_del_bss_rsp() - Handler for DEL BSS resp for NDI interface
- * @mac_ctx: handle to mac structure
- * @msg: pointer to message
- * @session_entry: session entry
- *
- * Return: None
- */
void lim_ndi_del_bss_rsp(struct mac_context * mac_ctx,
- struct del_bss_param *del_bss,
+ struct del_bss_resp *del_bss,
struct pe_session *session_entry)
{
tSirResultCodes rc = eSIR_SME_SUCCESS;
@@ -409,8 +401,6 @@
session_entry->limMlmState = eLIM_MLM_IDLE_STATE;
end:
- if (del_bss)
- qdf_mem_free(del_bss);
/* Delete PE session once BSS is deleted */
if (session_entry) {
lim_send_sme_rsp(mac_ctx, eWNI_SME_STOP_BSS_RSP,
diff --git a/core/mac/src/pe/nan/nan_datapath.h b/core/mac/src/pe/nan/nan_datapath.h
index 2c8106e..ecb9907 100644
--- a/core/mac/src/pe/nan/nan_datapath.h
+++ b/core/mac/src/pe/nan/nan_datapath.h
@@ -45,8 +45,17 @@
struct bss_params *add_bss_params,
struct pe_session *session_entry);
/* Handler for DEL BSS resp for NDI interface */
+
+/**
+ * lim_ndi_del_bss_rsp() - Handler for DEL BSS resp for NDI interface
+ * @mac_ctx: handle to mac structure
+ * @del_bss: pointer to del bss response
+ * @session_entry: session entry
+ *
+ * Return: None
+ */
void lim_ndi_del_bss_rsp(struct mac_context * mac_ctx,
- struct del_bss_param *del_bss,
+ struct del_bss_resp *del_bss,
struct pe_session *session_entry);
void lim_ndp_add_sta_rsp(struct mac_context *mac_ctx,
@@ -74,9 +83,17 @@
{
}
+/**
+ * lim_ndi_del_bss_rsp() - Handler for DEL BSS resp for NDI interface
+ * @mac_ctx: handle to mac structure
+ * @del_bss: pointer to del bss response
+ * @session_entry: session entry
+ *
+ * Return: None
+ */
static inline
void lim_ndi_del_bss_rsp(struct mac_context *mac_ctx,
- struct del_bss_param *del_bss,
+ struct del_bss_resp *del_bss,
struct pe_session *session_entry)
{
}
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index a3bc247..9ef5727 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -173,7 +173,6 @@
#define WMA_BSS_STATUS_STOPPED 0x2
#define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
-#define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
#define WMA_PEER_ASSOC_CNF_START 0x01
#define WMA_PEER_ASSOC_TIMEOUT SIR_PEER_ASSOC_TIMEOUT
@@ -190,7 +189,6 @@
/* FW response timeout values in milli seconds */
#define WMA_VDEV_START_REQUEST_TIMEOUT START_RESPONSE_TIMER
-#define WMA_VDEV_STOP_REQUEST_TIMEOUT STOP_RESPONSE_TIMER
#define WMA_VDEV_PLCY_MGR_TIMEOUT SIR_VDEV_PLCY_MGR_TIMEOUT
#define WMA_VDEV_HW_MODE_REQUEST_TIMEOUT WMA_VDEV_PLCY_MGR_TIMEOUT
#define WMA_VDEV_DUAL_MAC_CFG_TIMEOUT WMA_VDEV_PLCY_MGR_TIMEOUT
@@ -2590,10 +2588,10 @@
/**
* wma_send_vdev_stop() - WMA api to send vdev stop to fw
- * @params: del bss params
+ * @vdev_id: vdev id
*
* Return: 0 on success, else error on failure
*/
-QDF_STATUS wma_send_vdev_stop(struct del_bss_param *params);
+QDF_STATUS wma_send_vdev_stop(uint8_t vdev_id);
#endif
diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h
index d0072b5..1609ecc 100644
--- a/core/wma/inc/wma_if.h
+++ b/core/wma/inc/wma_if.h
@@ -499,14 +499,12 @@
};
/**
- * struct struct del_bss_param - params required for del bss request
+ * struct struct del_bss_resp - params required for del bss response
* @status: QDF status
- * @bssid: BSSID mac address
* @vdev_id: vdev_id
*/
-struct del_bss_param {
+struct del_bss_resp {
QDF_STATUS status;
- tSirMacAddr bssid;
uint8_t vdev_id;
};
diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h
index 8519189..3433211 100644
--- a/core/wma/inc/wma_internal.h
+++ b/core/wma/inc/wma_internal.h
@@ -623,11 +623,11 @@
/**
* wma_send_del_bss_response() - send delete bss resp
* @wma: wma handle
- * @req: target request
+ * @resp: pointer to del bss response
*
* Return: none
*/
-void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req);
+void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp);
/**
* __wma_handle_vdev_stop_rsp() - vdev stop response handler
@@ -663,14 +663,35 @@
void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta);
-void wma_delete_bss(tp_wma_handle wma, struct del_bss_param *params);
+/**
+ * wma_delete_bss() - process delete bss request from upper layer
+ * @wma: wma handle
+ * @vdev_id: vdev id
+ *
+ * Return: none
+ */
+void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id);
int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
tpDisableIntraBssFwd pdis_intra_fwd);
-void wma_delete_bss_ho_fail(tp_wma_handle wma, struct del_bss_param *params);
+/**
+ * wma_delete_bss_ho_fail() - process delete bss request for handoff failure
+ * @wma: wma handle
+ * @vdev_id: vdev id
+ *
+ * Delete BSS in case of ROAM_HO_FAIL processing is handled separately in
+ * this routine. It needs to be done without sending any commands to firmware
+ * because firmware has already stopped and deleted peer and vdev is down.
+ * Relevant logic is aggregated from other routines. It changes the host
+ * data structures without sending VDEV_STOP, PEER_FLUSH_TIDS, PEER_DELETE
+ * and VDEV_DOWN commands to firmware.
+ *
+ * Return: none
+ */
+void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id);
uint32_t wma_get_bcn_rate_code(uint16_t rate);
@@ -1580,13 +1601,13 @@
/**
* wma_send_vdev_down() - send del bss req to firmware
* @wma: wma handle.
- * @vdev_id: vdev ID of device for which MCC has to be checked
+ * @req: pointer to del bss response
*
* This function sends del bss resp to upper layer
*
* Return: none
*/
-void wma_send_vdev_down(tp_wma_handle wma, struct wma_target_req *req);
+void wma_send_vdev_down(tp_wma_handle wma, struct del_bss_resp *req);
/**
* wma_cold_boot_cal_event_handler() - Cold boot cal event handler
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index ec65765..ca3b519 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -878,7 +878,7 @@
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
uint8_t vdev_id = pdel_vdev_req_param->vdev_id;
struct wma_txrx_node *iface = &wma_handle->interfaces[vdev_id];
- struct wma_target_req *req_msg;
+ uint32_t vdev_stop_type;
if (!iface->handle) {
WMA_LOGE("handle of vdev_id %d is NULL vdev is already freed",
@@ -901,12 +901,16 @@
}
if (qdf_atomic_read(&iface->bss_status) == WMA_BSS_STATUS_STARTED) {
- req_msg = wma_find_vdev_req(wma_handle, vdev_id,
- WMA_TARGET_REQ_TYPE_VDEV_STOP, false);
- if (!req_msg)
+ status = mlme_get_vdev_stop_type(iface->vdev, &vdev_stop_type);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("Failed to get wma req msg_type for vdev_id: %d",
+ vdev_id);
goto send_fail_rsp;
- if (req_msg->msg_type != WMA_DELETE_BSS_REQ)
+ }
+
+ if (vdev_stop_type != WMA_DELETE_BSS_REQ)
goto send_fail_rsp;
+
WMA_LOGA("BSS is not yet stopped. Defering vdev(vdev id %x) deletion",
vdev_id);
iface->del_staself_req = pdel_vdev_req_param;
@@ -2029,9 +2033,7 @@
WMA_LOGE("%s: Free target req user_data msg_type:%d", __func__,
tgt_req->msg_type);
if (tgt_req->msg_type == WMA_CHNL_SWITCH_REQ ||
- tgt_req->msg_type == WMA_DELETE_BSS_REQ ||
- tgt_req->msg_type == WMA_ADD_BSS_REQ ||
- tgt_req->msg_type == WMA_SET_LINK_STATE) {
+ tgt_req->msg_type == WMA_ADD_BSS_REQ) {
qdf_mem_free(tgt_req->user_data);
tgt_req->user_data = NULL;
}
@@ -2042,7 +2044,7 @@
* @wma: pointer to WMA handle
* @pdev: pointer to PDEV
* @vdev_id: vdev id on which delete BSS request was received
- * @params: pointer to Delete BSS params
+ * @vdev_stop_resp: pointer to Delete BSS response
*
* This function is called on receiving vdev stop response from FW or
* vdev stop response timeout. In case of IBSS/NDI, use vdev's self MAC
@@ -2052,7 +2054,8 @@
* Return: 0 on success, ERROR code on failure
*/
static int wma_remove_bss_peer(tp_wma_handle wma, void *pdev, uint32_t vdev_id,
- struct del_bss_param *params, uint8_t type)
+ struct del_bss_resp *vdev_stop_resp,
+ uint8_t type)
{
void *peer, *vdev;
uint8_t peer_id;
@@ -2061,6 +2064,7 @@
struct wma_target_req *del_req;
int ret_value = 0;
QDF_STATUS qdf_status;
+ struct qdf_mac_addr bssid;
vdev = cdp_get_vdev_from_vdev_id(soc, pdev, vdev_id);
if (!vdev) {
@@ -2077,7 +2081,15 @@
return -EINVAL;
}
} else {
- mac_addr = params->bssid;
+ qdf_status = mlme_get_vdev_bss_peer_mac_addr(
+ wma->interfaces[vdev_id].vdev,
+ &bssid);
+ if (QDF_IS_STATUS_ERROR(qdf_status)) {
+ WMA_LOGE(FL("Failed to get bssid for vdev_id: %d"),
+ vdev_id);
+ return -EINVAL;
+ }
+ mac_addr = bssid.bytes;
}
peer = cdp_peer_find_by_addr(soc, pdev, mac_addr, &peer_id);
@@ -2100,12 +2112,12 @@
del_req = wma_fill_hold_req(wma, vdev_id,
WMA_DELETE_STA_REQ,
type,
- params,
+ vdev_stop_resp,
WMA_DELETE_STA_TIMEOUT);
if (!del_req) {
WMA_LOGE(FL("Failed to allocate request. vdev_id %d"),
vdev_id);
- params->status = QDF_STATUS_E_NOMEM;
+ vdev_stop_resp->status = QDF_STATUS_E_NOMEM;
ret_value = -EINVAL;
}
}
@@ -2194,32 +2206,28 @@
{}
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-void wma_send_del_bss_response(tp_wma_handle wma, struct wma_target_req *req)
+void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp)
{
struct wma_txrx_node *iface;
struct beacon_info *bcn;
- struct del_bss_param *params;
uint8_t vdev_id;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
- if (!req) {
+ if (!resp) {
WMA_LOGE("%s req is NULL", __func__);
return;
}
- vdev_id = req->vdev_id;
+ vdev_id = resp->vdev_id;
iface = &wma->interfaces[vdev_id];
if (!iface->handle) {
WMA_LOGE("%s vdev id %d is already deleted",
__func__, vdev_id);
- if (req->user_data)
- qdf_mem_free(req->user_data);
- req->user_data = NULL;
+ if (resp)
+ qdf_mem_free(resp);
return;
}
- params = (struct del_bss_param *)req->user_data;
-
cdp_fc_vdev_flush(soc, iface->handle);
WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
__func__, vdev_id);
@@ -2246,15 +2254,14 @@
* BSS REQ was timed out to stop the VDEV in this case no need
* to send response to UMAC
*/
- if (params->status == QDF_STATUS_FW_MSG_TIMEDOUT) {
- qdf_mem_free(req->user_data);
- req->user_data = NULL;
+ if (resp->status == QDF_STATUS_FW_MSG_TIMEDOUT) {
+ qdf_mem_free(resp);
WMA_LOGE("%s: DEL BSS from ADD BSS timeout do not send resp to UMAC (vdev id %x)",
__func__, vdev_id);
} else {
- params->status = QDF_STATUS_SUCCESS;
+ resp->status = QDF_STATUS_SUCCESS;
wma_send_msg_high_priority(wma, WMA_DELETE_BSS_RSP,
- (void *)params, 0);
+ (void *)resp, 0);
}
if (iface->del_staself_req && iface->is_del_sta_defered) {
@@ -2265,18 +2272,27 @@
}
}
-void wma_send_vdev_down(tp_wma_handle wma, struct wma_target_req *req)
+void wma_send_vdev_down(tp_wma_handle wma, struct del_bss_resp *resp)
{
uint8_t vdev_id;
- struct wma_txrx_node *iface = &wma->interfaces[req->vdev_id];
+ struct wma_txrx_node *iface = &wma->interfaces[resp->vdev_id];
+ uint32_t vdev_stop_type;
+ QDF_STATUS status;
- if (!req) {
+ if (!resp) {
WMA_LOGE("%s req is NULL", __func__);
return;
}
- vdev_id = req->vdev_id;
- if (req->msg_type != WMA_DELETE_BSS_HO_FAIL_REQ) {
+ vdev_id = resp->vdev_id;
+ status = mlme_get_vdev_stop_type(iface->vdev, &vdev_stop_type);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s : Failed to get vdev stop type", __func__);
+ qdf_mem_free(resp);
+ return;
+ }
+
+ if (vdev_stop_type != WMA_DELETE_BSS_HO_FAIL_REQ) {
if (wma_send_vdev_down_to_fw(wma, vdev_id) !=
QDF_STATUS_SUCCESS)
WMA_LOGE("Failed to send vdev down cmd: vdev %d",
@@ -2286,24 +2302,24 @@
}
wlan_vdev_mlme_sm_deliver_evt(iface->vdev,
WLAN_VDEV_SM_EV_DOWN_COMPLETE,
- sizeof(*req), req);
+ sizeof(*resp), resp);
}
/**
* wma_send_vdev_down_req() - handle vdev down req
* @wma: wma handle
- * @req: target req
+ * @resp: pointer to vde del bss response
*
* Return: none
*/
static void wma_send_vdev_down_req(tp_wma_handle wma,
- struct wma_target_req *req)
+ struct del_bss_resp *resp)
{
- struct wma_txrx_node *iface = &wma->interfaces[req->vdev_id];
+ struct wma_txrx_node *iface = &wma->interfaces[resp->vdev_id];
wlan_vdev_mlme_sm_deliver_evt(iface->vdev,
WLAN_VDEV_SM_EV_MLME_DOWN_REQ,
- sizeof(*req), req);
+ sizeof(*resp), resp);
}
#ifdef WLAN_FEATURE_11W
@@ -2321,12 +2337,14 @@
__wma_handle_vdev_stop_rsp(struct vdev_stop_response *resp_event)
{
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
- struct wma_target_req *req_msg;
struct cdp_pdev *pdev;
void *peer = NULL;
uint8_t peer_id;
struct wma_txrx_node *iface;
- int status = 0;
+ int status = QDF_STATUS_SUCCESS;
+ struct qdf_mac_addr bssid;
+ uint32_t vdev_stop_type;
+ struct del_bss_resp *vdev_stop_resp;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (!wma) {
@@ -2353,49 +2371,55 @@
resp_event->vdev_id);
}
+ status = mlme_get_vdev_bss_peer_mac_addr(iface->vdev, &bssid);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to get bssid", __func__);
+ return QDF_STATUS_E_INVAL;
+ }
+
/* Clear key information */
wma_clear_iface_key(iface);
- req_msg = wma_find_vdev_req(wma, resp_event->vdev_id,
- WMA_TARGET_REQ_TYPE_VDEV_STOP, true);
- if (!req_msg) {
- WMA_LOGE("%s: Failed to lookup vdev request for vdev id %d",
+ status = mlme_get_vdev_stop_type(iface->vdev, &vdev_stop_type);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to get wma req msg type for vdev id %d",
__func__, resp_event->vdev_id);
return QDF_STATUS_E_INVAL;
}
+ vdev_stop_resp = qdf_mem_malloc(sizeof(*vdev_stop_resp));
+ if (!vdev_stop_resp) {
+ WMA_LOGE("%s: Failed to alloc vdev_stop_resp for vdev id %d",
+ __func__, resp_event->vdev_id);
+ return QDF_STATUS_E_NOMEM;
+ }
+
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
if (!pdev) {
WMA_LOGE("%s: pdev is NULL", __func__);
status = -EINVAL;
- wma_cleanup_target_req_param(req_msg);
- qdf_mc_timer_stop(&req_msg->event_timeout);
- goto free_req_msg;
+ goto free_params;
}
- qdf_mc_timer_stop(&req_msg->event_timeout);
- if (req_msg->msg_type == WMA_DELETE_BSS_HO_FAIL_REQ) {
- struct del_bss_param *params =
- (struct del_bss_param *)req_msg->user_data;
-
+ if (vdev_stop_type == WMA_DELETE_BSS_HO_FAIL_REQ) {
peer = cdp_peer_find_by_addr(soc, pdev,
- params->bssid, &peer_id);
+ bssid.bytes, &peer_id);
if (!peer) {
WMA_LOGE("%s: Failed to find peer %pM", __func__,
- params->bssid);
+ bssid.bytes);
status = QDF_STATUS_E_FAILURE;
- goto free_req_msg;
+ goto free_params;
}
if (!iface->peer_count) {
WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
- __func__, params->bssid, resp_event->vdev_id,
+ __func__, bssid.bytes, resp_event->vdev_id,
iface->peer_count);
- goto free_req_msg;
+ goto free_params;
}
if (peer) {
WMA_LOGD("%s: vdev %pK is peer_addr %pM to vdev_id %d, peer_count - %d",
- __func__, peer, params->bssid,
+ __func__, peer, bssid.bytes,
resp_event->vdev_id, iface->peer_count);
if (cdp_cfg_get_peer_unmap_conf_support(soc))
cdp_peer_delete_sync(soc, peer,
@@ -2405,59 +2429,58 @@
cdp_peer_delete(soc, peer,
1 << CDP_PEER_DELETE_NO_SPECIAL);
wma_remove_objmgr_peer(wma, resp_event->vdev_id,
- params->bssid);
+ bssid.bytes);
}
iface->peer_count--;
WMA_LOGI("%s: Removed peer %pK with peer_addr %pM vdevid %d peer_count %d",
- __func__, peer, params->bssid, resp_event->vdev_id,
+ __func__, peer, bssid.bytes, resp_event->vdev_id,
iface->peer_count);
- wma_send_vdev_down_req(wma, req_msg);
- } else if (req_msg->msg_type == WMA_DELETE_BSS_REQ ||
- req_msg->msg_type == WMA_SET_LINK_STATE) {
- struct del_bss_param *params =
- (struct del_bss_param *)req_msg->user_data;
+ vdev_stop_resp->status = status;
+ vdev_stop_resp->vdev_id = resp_event->vdev_id;
+ wma_send_vdev_down_req(wma, vdev_stop_resp);
+ } else if (vdev_stop_type == WMA_DELETE_BSS_REQ ||
+ vdev_stop_type == WMA_SET_LINK_STATE) {
uint8_t type;
if (!iface->handle) {
WMA_LOGE("%s vdev id %d is already deleted",
__func__, resp_event->vdev_id);
- wma_cleanup_target_req_param(req_msg);
status = -EINVAL;
- goto free_req_msg;
+ goto free_params;
}
/* CCA is required only for sta interface */
if (iface->type == WMI_VDEV_TYPE_STA)
wma_get_cca_stats(wma, resp_event->vdev_id);
- if (req_msg->msg_type == WMA_DELETE_BSS_REQ)
+ if (vdev_stop_type == WMA_DELETE_BSS_REQ)
type = WMA_DELETE_PEER_RSP;
else
type = WMA_SET_LINK_PEER_RSP;
+
+ vdev_stop_resp->vdev_id = resp_event->vdev_id;
+ vdev_stop_resp->status = status;
status = wma_remove_bss_peer(wma, pdev, resp_event->vdev_id,
- params, type);
+ vdev_stop_resp, type);
if (status) {
WMA_LOGE("%s Del bss failed vdev:%d", __func__,
resp_event->vdev_id);
- wma_send_vdev_down_req(wma, req_msg);
- goto free_req_msg;
+ wma_send_vdev_down_req(wma, vdev_stop_resp);
+ return status;
}
if (wmi_service_enabled(wma->wmi_handle,
wmi_service_sync_delete_cmds))
- goto free_req_msg;
+ return status;
- wma_send_vdev_down_req(wma, req_msg);
+ wma_send_vdev_down_req(wma, vdev_stop_resp);
}
-free_req_msg:
- qdf_mc_timer_destroy(&req_msg->event_timeout);
- qdf_mem_free(req_msg);
+ return status;
- if (status)
- return QDF_STATUS_E_INVAL;
- else
- return QDF_STATUS_SUCCESS;
+free_params:
+ qdf_mem_free(vdev_stop_resp);
+ return status;
}
/**
@@ -2872,10 +2895,11 @@
uint32_t temp_reg_info_2 = 0;
uint16_t bw_val;
struct wma_txrx_node *iface = &wma->interfaces[req->vdev_id];
- struct wma_target_req *req_msg;
uint32_t chan_mode;
enum phy_ch_width ch_width;
struct wlan_mlme_nss_chains *ini_cfg;
+ QDF_STATUS status;
+ uint32_t vdev_stop_type;
ini_cfg = mlme_get_ini_vdev_config(iface->vdev);
if (!ini_cfg) {
@@ -2950,10 +2974,14 @@
if (!isRestart &&
qdf_atomic_read(&iface->bss_status) == WMA_BSS_STATUS_STARTED &&
wmi_service_enabled(wma->wmi_handle, wmi_service_roam_ho_offload)) {
- req_msg = wma_find_vdev_req(wma, req->vdev_id,
- WMA_TARGET_REQ_TYPE_VDEV_STOP,
- false);
- if (!req_msg || req_msg->msg_type != WMA_DELETE_BSS_REQ) {
+ status = mlme_get_vdev_stop_type(iface->vdev, &vdev_stop_type);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to get wma req msg_type",
+ __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (vdev_stop_type != WMA_DELETE_BSS_REQ) {
WMA_LOGE("BSS is in started state before vdev start");
cds_trigger_recovery(QDF_REASON_UNSPECIFIED);
}
@@ -3280,7 +3308,7 @@
qdf_mem_free(data);
} else if (req_msg->type == WMA_SET_LINK_PEER_RSP ||
req_msg->type == WMA_DELETE_PEER_RSP) {
- wma_send_vdev_down_req(wma, req_msg);
+ wma_send_vdev_down_req(wma, req_msg->user_data);
}
qdf_mem_free(req_msg);
@@ -3397,8 +3425,8 @@
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_SET_LINK_PEER_RSP ||
tgt_req->type == WMA_DELETE_PEER_RSP)) {
- struct del_bss_param *params =
- (struct del_bss_param *)tgt_req->user_data;
+ struct del_bss_resp *params =
+ (struct del_bss_resp *)tgt_req->user_data;
params->status = QDF_STATUS_E_TIMEOUT;
WMA_LOGE(FL("wma delete peer for del bss req timed out"));
@@ -3406,7 +3434,7 @@
if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_DELETE_STA_REQ);
- wma_send_vdev_down_req(wma, tgt_req);
+ wma_send_vdev_down_req(wma, params);
} else if ((tgt_req->msg_type == SIR_HAL_PDEV_SET_HW_MODE) &&
(tgt_req->type == WMA_PDEV_SET_HW_MODE_RESP)) {
struct sir_set_hw_mode_resp *params =
@@ -3592,10 +3620,7 @@
tp_wma_handle wma;
struct wma_target_req *tgt_req = (struct wma_target_req *)data;
struct cdp_pdev *pdev;
- int status;
QDF_STATUS qdf_status;
- void *soc = cds_get_context(QDF_MODULE_ID_SOC);
- struct wma_txrx_node *iface;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
struct mac_context *mac_ctx;
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
@@ -3643,98 +3668,6 @@
if (tgt_req->msg_type == WMA_CHNL_SWITCH_REQ) {
wma_handle_channel_switch_req_timeout(wma, tgt_req);
- } else if (tgt_req->msg_type == WMA_DELETE_BSS_REQ ||
- tgt_req->msg_type == WMA_SET_LINK_STATE) {
- struct del_bss_param *params =
- (struct del_bss_param *)tgt_req->user_data;
- struct beacon_info *bcn;
- uint8_t type;
-
- if (tgt_req->vdev_id >= wma->max_bssid) {
- WMA_LOGE("%s: Invalid vdev_id %d", __func__,
- tgt_req->vdev_id);
- wma_cleanup_target_req_param(tgt_req);
- qdf_mc_timer_stop(&tgt_req->event_timeout);
- goto free_tgt_req;
- }
-
- iface = &wma->interfaces[tgt_req->vdev_id];
- if (!iface->handle) {
- WMA_LOGE("%s vdev id %d is already deleted",
- __func__, tgt_req->vdev_id);
- wma_cleanup_target_req_param(tgt_req);
- qdf_mc_timer_stop(&tgt_req->event_timeout);
- goto free_tgt_req;
- }
- /*
- * Trigger host crash if the flag is set or if the timeout
- * is not due to fw down
- */
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
- wma_trigger_recovery_assert_on_fw_timeout(
- WMA_DELETE_BSS_REQ);
-
- if (tgt_req->msg_type == WMA_DELETE_BSS_REQ)
- type = WMA_DELETE_PEER_RSP;
- else
- type = WMA_SET_LINK_PEER_RSP;
- status = wma_remove_bss_peer(wma, pdev, tgt_req->vdev_id,
- params, type);
- if (status) {
- WMA_LOGE("Del BSS failed call del bss response vdev_id:%d", tgt_req->vdev_id);
- wma_send_vdev_down_req(wma, tgt_req);
- }
-
- if (wmi_service_enabled(wma->wmi_handle,
- wmi_service_sync_delete_cmds))
- goto free_tgt_req;
-
- if (wma_send_vdev_down_to_fw(wma, tgt_req->vdev_id) !=
- QDF_STATUS_SUCCESS) {
- WMA_LOGE("Failed to send vdev down cmd: vdev %d",
- tgt_req->vdev_id);
- } else {
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
- if (mac_ctx->sap.sap_channel_avoidance)
- wma_find_mcc_ap(wma, tgt_req->vdev_id, false);
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
- }
- cdp_fc_vdev_flush(soc, iface->handle);
- WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for WDA_DELETE_BSS_REQ timeout",
- __func__, tgt_req->vdev_id);
- cdp_fc_vdev_unpause(soc, iface->handle,
- OL_TXQ_PAUSE_REASON_VDEV_STOP);
- wma_vdev_clear_pause_bit(tgt_req->vdev_id, PAUSE_TYPE_HOST);
- qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
- WMA_LOGD("%s: (type %d subtype %d) BSS is stopped",
- __func__, iface->type, iface->sub_type);
-
- bcn = wma->interfaces[tgt_req->vdev_id].beacon;
-
- if (bcn) {
- WMA_LOGD("%s: Freeing beacon struct %pK, template memory %pK",
- __func__, bcn, bcn->buf);
- if (bcn->dma_mapped)
- qdf_nbuf_unmap_single(wma->qdf_dev, bcn->buf,
- QDF_DMA_TO_DEVICE);
- qdf_nbuf_free(bcn->buf);
- qdf_mem_free(bcn);
- wma->interfaces[tgt_req->vdev_id].beacon = NULL;
- }
- params->status = QDF_STATUS_E_TIMEOUT;
- if (tgt_req->msg_type == WMA_DELETE_BSS_REQ)
- WMA_LOGA("%s: WMA_DELETE_BSS_REQ timedout", __func__);
- else
- WMA_LOGA("%s: WMA_SET_LINK_STATE timedout", __func__);
-
- wma_send_msg_high_priority(wma, type,
- (void *)params, 0);
- if (iface->del_staself_req && iface->is_del_sta_defered) {
- iface->is_del_sta_defered = false;
- WMA_LOGA("scheduling defered deletion(vdev id %x)",
- tgt_req->vdev_id);
- wma_vdev_detach(wma, iface->del_staself_req);
- }
} else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) {
wma_handle_add_bss_req_timeout(wma, tgt_req);
@@ -5573,29 +5506,15 @@
#endif
}
-/**
- * wma_delete_bss_ho_fail() - process delete bss request for handoff failure
- * @wma: wma handle
- * @params: del bss parameters
- *
- * Delete BSS in case of ROAM_HO_FAIL processing is handled separately in
- * this routine. It needs to be done without sending any commands to firmware
- * because firmware has already stopped and deleted peer and vdev is down.
- * Relevant logic is aggregated from other routines. It changes the host
- * data structures without sending VDEV_STOP, PEER_FLUSH_TIDS, PEER_DELETE
- * and VDEV_DOWN commands to firmware.
- *
- * Return: none
- */
-void wma_delete_bss_ho_fail(tp_wma_handle wma, struct del_bss_param *params)
+void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id)
{
struct cdp_pdev *pdev;
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct cdp_vdev *txrx_vdev = NULL;
struct wma_txrx_node *iface;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
- struct wma_target_req *msg;
struct vdev_stop_response resp_event;
+ struct del_bss_resp *vdev_stop_resp;
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
@@ -5604,15 +5523,15 @@
goto fail_del_bss_ho_fail;
}
- iface = &wma->interfaces[params->vdev_id];
+ iface = &wma->interfaces[vdev_id];
if (!iface || !iface->handle) {
WMA_LOGE("%s vdev id %d is already deleted",
- __func__, params->vdev_id);
+ __func__, vdev_id);
goto fail_del_bss_ho_fail;
}
qdf_mem_zero(iface->bssid, QDF_MAC_ADDR_SIZE);
- txrx_vdev = wma_find_vdev_by_id(wma, params->vdev_id);
+ txrx_vdev = wma_find_vdev_by_id(wma, vdev_id);
if (!txrx_vdev) {
WMA_LOGE("%s:Invalid vdev handle", __func__);
status = QDF_STATUS_E_FAILURE;
@@ -5640,47 +5559,49 @@
}
WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)",
- __func__, params->vdev_id);
+ __func__, vdev_id);
cdp_fc_vdev_pause(soc, iface->handle,
OL_TXQ_PAUSE_REASON_VDEV_STOP);
- wma_vdev_set_pause_bit(params->vdev_id, PAUSE_TYPE_HOST);
-
+ wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
cdp_fc_vdev_flush(soc, iface->handle);
WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
- __func__, params->vdev_id);
+ __func__, vdev_id);
cdp_fc_vdev_unpause(soc, iface->handle,
OL_TXQ_PAUSE_REASON_VDEV_STOP);
- wma_vdev_clear_pause_bit(params->vdev_id, PAUSE_TYPE_HOST);
+ wma_vdev_clear_pause_bit(vdev_id, PAUSE_TYPE_HOST);
qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
WMA_LOGD("%s: (type %d subtype %d) BSS is stopped",
__func__, iface->type, iface->sub_type);
- params->status = QDF_STATUS_SUCCESS;
- msg = wma_fill_vdev_req(wma, params->vdev_id,
- WMA_DELETE_BSS_HO_FAIL_REQ,
- WMA_TARGET_REQ_TYPE_VDEV_STOP, params,
- WMA_VDEV_STOP_REQUEST_TIMEOUT);
- if (!msg) {
- WMA_LOGE("%s: Failed to fill vdev request for vdev_id %d",
- __func__, params->vdev_id);
- status = QDF_STATUS_E_NOMEM;
+ status = mlme_set_vdev_stop_type(iface->vdev,
+ WMA_DELETE_BSS_HO_FAIL_REQ);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to set wma req msg_type for vdev_id: %d",
+ __func__, vdev_id);
goto fail_del_bss_ho_fail;
}
/* Try to use the vdev stop response path */
- resp_event.vdev_id = params->vdev_id;
+ resp_event.vdev_id = vdev_id;
status = wma_handle_vdev_stop_rsp(wma, &resp_event);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE("%s: Failed to handle vdev stop rsp for vdev_id %d",
- __func__, params->vdev_id);
+ __func__, vdev_id);
goto fail_del_bss_ho_fail;
}
return;
+
fail_del_bss_ho_fail:
- params->status = status;
+ vdev_stop_resp = qdf_mem_malloc(sizeof(*vdev_stop_resp));
+ if (!vdev_stop_resp) {
+ WMA_LOGE("%s: Failed to alloc del bss resp ", __func__);
+ return;
+ }
+ vdev_stop_resp->vdev_id = vdev_id;
+ vdev_stop_resp->status = status;
wma_send_msg_high_priority(wma, WMA_DELETE_BSS_HO_FAIL_RSP,
- (void *)params, 0);
+ (void *)vdev_stop_resp, 0);
}
/**
@@ -5721,72 +5642,73 @@
}
}
-/**
- * wma_delete_bss() - process delete bss request from upper layer
- * @wma: wma handle
- * @params: del bss parameters
- *
- * Return: none
- */
-void wma_delete_bss(tp_wma_handle wma, struct del_bss_param *params)
+void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
{
struct cdp_pdev *pdev;
void *peer = NULL;
- struct wma_target_req *msg;
QDF_STATUS status = QDF_STATUS_SUCCESS;
uint8_t peer_id;
struct cdp_vdev *txrx_vdev = NULL;
bool roam_synch_in_progress = false;
struct wma_txrx_node *iface;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
-
+ struct qdf_mac_addr bssid;
+ struct del_bss_resp *params;
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
if (!pdev) {
WMA_LOGE("%s:Unable to get TXRX context", __func__);
goto out;
}
- if (wma_is_vdev_in_ibss_mode(wma, params->vdev_id))
+
+ iface = &wma->interfaces[vdev_id];
+ if (!iface || !iface->handle) {
+ WMA_LOGE("%s vdev id %d is already deleted",
+ __func__, vdev_id);
+ goto out;
+ }
+
+ status = mlme_get_vdev_bss_peer_mac_addr(iface->vdev, &bssid);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s vdev id %d : failed to get bssid",
+ __func__, vdev_id);
+ goto out;
+ }
+
+ if (wma_is_vdev_in_ibss_mode(wma, vdev_id))
/* in rome ibss case, self mac is used to create the bss peer */
peer = cdp_peer_find_by_addr(soc,
pdev,
- wma->interfaces[params->vdev_id].addr,
+ wma->interfaces[vdev_id].addr,
&peer_id);
else if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces,
- params->vdev_id))
+ vdev_id))
/* In ndi case, self mac is used to create the self peer */
peer = cdp_peer_find_by_addr(soc, pdev,
- wma->interfaces[params->vdev_id].addr,
+ wma->interfaces[vdev_id].addr,
&peer_id);
else
peer = cdp_peer_find_by_addr(soc, pdev,
- params->bssid,
+ bssid.bytes,
&peer_id);
if (!peer) {
WMA_LOGE("%s: Failed to find peer %pM", __func__,
- params->bssid);
+ bssid.bytes);
status = QDF_STATUS_E_FAILURE;
goto out;
}
- qdf_mem_zero(wma->interfaces[params->vdev_id].bssid,
+ qdf_mem_zero(wma->interfaces[vdev_id].bssid,
QDF_MAC_ADDR_SIZE);
- txrx_vdev = wma_find_vdev_by_id(wma, params->vdev_id);
+ txrx_vdev = wma_find_vdev_by_id(wma, vdev_id);
if (!txrx_vdev) {
WMA_LOGE("%s:Invalid vdev handle", __func__);
status = QDF_STATUS_E_FAILURE;
goto out;
}
- iface = &wma->interfaces[params->vdev_id];
- if (!iface || !iface->handle) {
- WMA_LOGE("%s vdev id %d is already deleted",
- __func__, params->vdev_id);
- goto out;
- }
-
if (iface->psnr_req) {
qdf_mem_free(iface->psnr_req);
iface->psnr_req = NULL;
@@ -5810,26 +5732,25 @@
if (wlan_op_mode_ibss == cdp_get_opmode(soc, txrx_vdev))
wma->ibss_started = 0;
- if (wma_is_roam_synch_in_progress(wma, params->vdev_id)) {
+ if (wma_is_roam_synch_in_progress(wma, vdev_id)) {
roam_synch_in_progress = true;
WMA_LOGD("LFR3:%s: Setting vdev_up to FALSE for session %d",
- __func__, params->vdev_id);
+ __func__, vdev_id);
goto detach_peer;
}
- msg = wma_fill_vdev_req(wma, params->vdev_id, WMA_DELETE_BSS_REQ,
- WMA_TARGET_REQ_TYPE_VDEV_STOP, params,
- WMA_VDEV_STOP_REQUEST_TIMEOUT);
- if (!msg) {
- WMA_LOGE("%s: Failed to fill vdev request for vdev_id %d",
- __func__, params->vdev_id);
- status = QDF_STATUS_E_NOMEM;
- goto detach_peer;
+
+ status = mlme_set_vdev_stop_type(iface->vdev,
+ WMA_DELETE_BSS_REQ);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to set wma req msg_type for vdev_id: %d",
+ __func__, vdev_id);
+ goto out;
}
WMA_LOGD(FL("Outstanding msdu packets: %d"),
cdp_get_tx_pending(soc, pdev));
- wma_wait_tx_complete(wma, params->vdev_id);
+ wma_wait_tx_complete(wma, vdev_id);
if (cdp_get_tx_pending(soc, pdev)) {
WMA_LOGW(FL("Outstanding msdu packets before VDEV_STOP : %d"),
@@ -5837,31 +5758,38 @@
}
WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)",
- __func__, params->vdev_id);
- wma_vdev_set_pause_bit(params->vdev_id, PAUSE_TYPE_HOST);
+ __func__, vdev_id);
+ wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
cdp_fc_vdev_pause(soc,
- wma->interfaces[params->vdev_id].handle,
+ wma->interfaces[vdev_id].handle,
OL_TXQ_PAUSE_REASON_VDEV_STOP);
- if (wma_send_vdev_stop_to_fw(wma, params->vdev_id)) {
+ if (wma_send_vdev_stop_to_fw(wma, vdev_id)) {
WMA_LOGE("%s: %d Failed to send vdev stop", __func__, __LINE__);
- wma_remove_vdev_req(wma, params->vdev_id,
- WMA_TARGET_REQ_TYPE_VDEV_STOP);
status = QDF_STATUS_E_FAILURE;
goto detach_peer;
- }
+ }
WMA_LOGD("%s: bssid %pM vdev_id %d",
- __func__, params->bssid, params->vdev_id);
+ __func__, bssid.bytes, vdev_id);
+
return;
+
detach_peer:
- wma_remove_peer(wma, params->bssid, params->vdev_id, peer,
+ wma_remove_peer(wma, bssid.bytes, vdev_id, peer,
roam_synch_in_progress);
- if (wma_is_roam_synch_in_progress(wma, params->vdev_id))
+ if (wma_is_roam_synch_in_progress(wma, vdev_id))
return;
out:
+ params = qdf_mem_malloc(sizeof(*params));
+ if (!params) {
+ WMA_LOGE("%s vdev id %d : failed to alloc del bss resp",
+ __func__, vdev_id);
+ return;
+ }
+ params->vdev_id = vdev_id;
params->status = status;
- wma_send_msg_high_priority(wma, WMA_DELETE_BSS_RSP, (void *)params, 0);
+ wma_send_msg_high_priority(wma, WMA_DELETE_BSS_RSP, params, 0);
}
/**
@@ -6018,12 +5946,12 @@
return status;
}
-QDF_STATUS wma_send_vdev_stop(struct del_bss_param *params)
+QDF_STATUS wma_send_vdev_stop(uint8_t vdev_id)
{
tp_wma_handle wma;
struct cdp_pdev *pdev;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
- struct wma_target_req *msg;
+ QDF_STATUS status;
pdev = cds_get_context(QDF_MODULE_ID_TXRX);
wma = cds_get_context(QDF_MODULE_ID_WMA);
@@ -6033,30 +5961,27 @@
}
WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP",
- __func__, params->vdev_id);
- cdp_fc_vdev_pause(soc, wma->interfaces[params->vdev_id].handle,
+ __func__, vdev_id);
+ cdp_fc_vdev_pause(soc, wma->interfaces[vdev_id].handle,
OL_TXQ_PAUSE_REASON_VDEV_STOP);
- msg = wma_fill_vdev_req(wma, params->vdev_id,
- WMA_SET_LINK_STATE,
- WMA_TARGET_REQ_TYPE_VDEV_STOP, params,
- WMA_VDEV_STOP_REQUEST_TIMEOUT);
- if (!msg) {
- WMA_LOGP(FL("Failed to fill vdev request for vdev_id %d"),
- params->vdev_id);
- params->status = QDF_STATUS_E_NOMEM;
+
+ status = mlme_set_vdev_stop_type(
+ wma->interfaces[vdev_id].vdev,
+ WMA_SET_LINK_STATE);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGP(FL("Failed to set wma req msg_type for vdev_id %d"),
+ vdev_id);
return QDF_STATUS_E_FAILURE;
}
- wma_vdev_set_pause_bit(params->vdev_id, PAUSE_TYPE_HOST);
- if (wma_send_vdev_stop_to_fw(wma, params->vdev_id)) {
+
+ wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
+ if (wma_send_vdev_stop_to_fw(wma, vdev_id)) {
WMA_LOGP("%s: %d Failed to send vdev stop",
__func__, __LINE__);
- params->status = QDF_STATUS_E_FAILURE;
- wma_remove_vdev_req(wma, params->vdev_id,
- WMA_TARGET_REQ_TYPE_VDEV_STOP);
}
WMA_LOGP("%s: %d vdev stop sent vdev %d", __func__, __LINE__,
- params->vdev_id);
+ vdev_id);
/*
* Remove peer, Vdev down and sending set link
* response will be handled in vdev stop response
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index adbd045..da505ca 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -8526,10 +8526,10 @@
wma_delete_sta(wma_handle, (tpDeleteStaParams) msg->bodyptr);
break;
case WMA_DELETE_BSS_HO_FAIL_REQ:
- wma_delete_bss_ho_fail(wma_handle, msg->bodyptr);
+ wma_delete_bss_ho_fail(wma_handle, msg->bodyval);
break;
case WMA_DELETE_BSS_REQ:
- wma_delete_bss(wma_handle, msg->bodyptr);
+ wma_delete_bss(wma_handle, msg->bodyval);
break;
case WMA_UPDATE_EDCA_PROFILE_IND:
wma_process_update_edca_param_req(wma_handle,
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 56c980f..7520123 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -2643,7 +2643,6 @@
wma_roam_update_vdev(tp_wma_handle wma,
struct roam_offload_synch_ind *roam_synch_ind_ptr)
{
- struct del_bss_param *del_bss_params;
tDeleteStaParams *del_sta_params;
tAddStaParams *add_sta_params;
uint32_t uc_cipher = 0, cipher_cap = 0;
@@ -2651,35 +2650,26 @@
vdev_id = roam_synch_ind_ptr->roamed_vdev_id;
wma->interfaces[vdev_id].nss = roam_synch_ind_ptr->nss;
- del_bss_params = qdf_mem_malloc(sizeof(*del_bss_params));
- if (!del_bss_params)
- return;
del_sta_params = qdf_mem_malloc(sizeof(*del_sta_params));
if (!del_sta_params) {
- qdf_mem_free(del_bss_params);
return;
}
add_sta_params = qdf_mem_malloc(sizeof(*add_sta_params));
if (!add_sta_params) {
- qdf_mem_free(del_bss_params);
qdf_mem_free(del_sta_params);
return;
}
- qdf_mem_zero(del_bss_params, sizeof(*del_bss_params));
qdf_mem_zero(del_sta_params, sizeof(*del_sta_params));
qdf_mem_zero(add_sta_params, sizeof(*add_sta_params));
- del_bss_params->vdev_id = vdev_id;
del_sta_params->smesessionId = vdev_id;
- qdf_mem_copy(del_bss_params->bssid, wma->interfaces[vdev_id].bssid,
- QDF_MAC_ADDR_SIZE);
add_sta_params->staType = STA_ENTRY_SELF;
add_sta_params->smesessionId = vdev_id;
qdf_mem_copy(&add_sta_params->bssId, &roam_synch_ind_ptr->bssid.bytes,
- QDF_MAC_ADDR_SIZE);
+ QDF_MAC_ADDR_SIZE);
add_sta_params->staIdx = STA_INVALID_IDX;
add_sta_params->assocId = roam_synch_ind_ptr->aid;
@@ -2687,11 +2677,11 @@
* Get uc cipher of old peer to update new peer as it doesnt
* change in roaming
*/
- wma_get_peer_uc_cipher(wma, del_bss_params->bssid, &uc_cipher,
- &cipher_cap);
+ wma_get_peer_uc_cipher(wma, wma->interfaces[vdev_id].bssid,
+ &uc_cipher, &cipher_cap);
wma_delete_sta(wma, del_sta_params);
- wma_delete_bss(wma, del_bss_params);
+ wma_delete_bss(wma, vdev_id);
wma_add_bss_peer_sta(roam_synch_ind_ptr->self_mac.bytes,
roam_synch_ind_ptr->bssid.bytes, true);
/* Update new peer's uc cipher */
@@ -2701,7 +2691,6 @@
wma_add_sta(wma, add_sta_params);
qdf_mem_copy(wma->interfaces[vdev_id].bssid,
roam_synch_ind_ptr->bssid.bytes, QDF_MAC_ADDR_SIZE);
- qdf_mem_free(del_bss_params);
qdf_mem_free(add_sta_params);
}
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 75e4c0c..f438420 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -4171,7 +4171,7 @@
return QDF_STATUS_E_INVAL;
}
- wma_send_vdev_down(wma, (struct wma_target_req *)data);
+ wma_send_vdev_down(wma, data);
return QDF_STATUS_SUCCESS;
}
@@ -4181,7 +4181,9 @@
uint16_t data_len, void *data)
{
tp_wma_handle wma;
- struct wma_target_req *req = (struct wma_target_req *)data;
+ QDF_STATUS status;
+ uint32_t vdev_stop_type;
+ struct del_bss_resp *resp = (struct del_bss_resp *)data;
if (mlme_is_connection_fail(vdev_mlme->vdev)) {
WMA_LOGD("%s Vdev start req failed, no action required",
@@ -4192,32 +4194,42 @@
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
WMA_LOGE("%s wma handle is NULL", __func__);
- return QDF_STATUS_E_INVAL;
+ status = QDF_STATUS_E_INVAL;
+ goto end;
}
- if (req->msg_type == WMA_DELETE_BSS_HO_FAIL_REQ) {
- struct del_bss_param *params =
- (struct del_bss_param *)req->user_data;
- params->status = QDF_STATUS_SUCCESS;
+ status = mlme_get_vdev_stop_type(wma->interfaces[resp->vdev_id].vdev,
+ &vdev_stop_type);
+ if (QDF_IS_STATUS_ERROR(status)) {
+ WMA_LOGE("%s: Failed to get msg_type", __func__);
+ status = QDF_STATUS_E_INVAL;
+ goto end;
+ }
+
+ if (vdev_stop_type == WMA_DELETE_BSS_HO_FAIL_REQ) {
+ resp->status = QDF_STATUS_SUCCESS;
wma_send_msg_high_priority(wma, WMA_DELETE_BSS_HO_FAIL_RSP,
- (void *)params, 0);
+ (void *)resp, 0);
return QDF_STATUS_SUCCESS;
}
- if (!mlme_get_vdev_start_failed(vdev_mlme->vdev))
- if (req->msg_type == WMA_SET_LINK_STATE ||
- req->type == WMA_SET_LINK_PEER_RSP) {
+ if (!mlme_get_vdev_start_failed(vdev_mlme->vdev)) {
+ if (vdev_stop_type == WMA_SET_LINK_STATE) {
lim_join_result_callback(
wma->mac_context,
wlan_vdev_get_id(vdev_mlme->vdev));
- qdf_mem_free(req->user_data);
+ } else {
+ wma_send_del_bss_response(wma, resp);
+ return QDF_STATUS_SUCCESS;
}
- else
- wma_send_del_bss_response(wma, req);
- else
+ } else {
mlme_set_vdev_start_failed(vdev_mlme->vdev, false);
+ }
- return QDF_STATUS_SUCCESS;
+end:
+ qdf_mem_free(resp);
+
+ return status;
}
QDF_STATUS wma_ap_mlme_vdev_stop_start_send(struct vdev_mlme_obj *vdev_mlme,