From 5c35ae4ee4e2dc4a66f8747547485d020eb2b1ac Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Tue, 18 Apr 2017 15:35:07 -0700 Subject: [PATCH] qcacld-3.0: Send ROAM_SCAN_OFFLOAD_STOP to FW directly from HDD In case user space disconnects, directly send ROAM_SCAN_OFFLOAD_STOP to FW to avoid delays in queues. Change-Id: Ia6e458617818da5ad2e956cd30a203652949db21 CRs-Fixed: 2035160 --- core/sme/src/common/sme_api.c | 41 ++++++++++++++++++++++++++++------- core/wma/inc/wma.h | 12 ++++++++++ core/wma/inc/wma_internal.h | 3 --- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index aeb8d3db6bc9..3139dfa10c56 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -8022,17 +8022,42 @@ QDF_STATUS sme_update_is_mawc_ini_feature_enabled(tHalHandle hHal, --------------------------------------------------------------------------*/ QDF_STATUS sme_stop_roaming(tHalHandle hHal, uint8_t sessionId, uint8_t reason) { - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - QDF_STATUS status = QDF_STATUS_SUCCESS; + struct scheduler_msg wma_msg = {0}; + tSirRetStatus status; + tSirRoamOffloadScanReq *req; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal); - status = sme_acquire_global_lock(&pMac->sme); - if (QDF_IS_STATUS_SUCCESS(status)) { - csr_roam_offload_scan(pMac, sessionId, ROAM_SCAN_OFFLOAD_STOP, - reason); - sme_release_global_lock(&pMac->sme); + if (!CSR_IS_SESSION_VALID(mac_ctx, sessionId)) { + sme_err("incorrect session/vdev ID"); + return QDF_STATUS_E_INVAL; } - return status; + req = qdf_mem_malloc(sizeof(*req)); + if (!req) { + sme_err("failed to allocated memory"); + return QDF_STATUS_E_NOMEM; + } + + req->Command = ROAM_SCAN_OFFLOAD_STOP; + req->reason = REASON_ROAM_SYNCH_FAILED; + req->sessionId = sessionId; + if (csr_neighbor_middle_of_roaming(mac_ctx, sessionId)) + req->middle_of_roaming = 1; + else + csr_roam_reset_roam_params(mac_ctx); + + wma_msg.type = WMA_ROAM_SCAN_OFFLOAD_REQ; + wma_msg.bodyptr = req; + + status = wma_post_ctrl_msg(mac_ctx, &wma_msg); + if (eSIR_SUCCESS != status) { + sme_err("WMA_ROAM_SCAN_OFFLOAD_REQ failed, session_id: %d", + sessionId); + qdf_mem_free(req); + return QDF_STATUS_E_FAULT; + } + + return QDF_STATUS_SUCCESS; } /*-------------------------------------------------------------------------- diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index d4f3da97a1a4..797ed4a5a954 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -2404,6 +2404,18 @@ void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos) iface->pause_bitmap &= ~(1 << bit_pos); } +/** + * wma_process_roaming_config() - process roam request + * @wma_handle: wma handle + * @roam_req: roam request parameters + * + * Main routine to handle ROAM commands coming from CSR module. + * + * Return: QDF status + */ +QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, + tSirRoamOffloadScanReq *roam_req); + #ifdef WMI_INTERFACE_EVENT_LOGGING static inline void wma_print_wmi_cmd_log(uint32_t count, qdf_abstract_print *print, diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index e034a1746bd4..02318017d9bc 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -263,9 +263,6 @@ QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle, QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle, uint32_t command, uint32_t vdev_id); -QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, - tSirRoamOffloadScanReq *roam_req); - QDF_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle, tpSwitchChannelParams params, uint8_t vdev_id);