diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index cf9b2576c631..dff1bd9d2556 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -170,6 +170,7 @@ typedef struct sCsrNeighborRoamControlInfo { uint8_t currentRoamBmissFinalBcnt; uint8_t currentRoamBeaconRssiWeight; uint8_t last_sent_cmd; + bool b_roam_scan_offload_started; } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo; /* All the necessary Function declarations are here */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index a77fc5d96e55..719635ab6f5b 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7971,27 +7971,29 @@ QDF_STATUS sme_update_is_mawc_ini_feature_enabled(tHalHandle hHal, } -/*-------------------------------------------------------------------------- - \brief sme_stop_roaming() - Stop roaming for a given sessionId - This is a synchronous call - \param hHal - The handle returned by mac_open - \param sessionId - Session Identifier - \return QDF_STATUS_SUCCESS on success - Other status on failure - \sa - --------------------------------------------------------------------------*/ -QDF_STATUS sme_stop_roaming(tHalHandle hHal, uint8_t sessionId, uint8_t reason) +/** + * sme_stop_roaming() - Stop roaming for a given sessionId + * This is a synchronous call + * + * @hHal - The handle returned by mac_open + * @sessionId - Session Identifier + * + * Return QDF_STATUS_SUCCESS on success + * Other status on failure + */ +QDF_STATUS sme_stop_roaming(tHalHandle hal, uint8_t session_id, uint8_t reason) { struct scheduler_msg wma_msg = {0}; tSirRetStatus status; tSirRoamOffloadScanReq *req; - tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal); + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + tpCsrNeighborRoamControlInfo roam_info; - if (!CSR_IS_SESSION_VALID(mac_ctx, sessionId)) { + if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) { sme_err("incorrect session/vdev ID"); return QDF_STATUS_E_INVAL; } - + roam_info = &mac_ctx->roam.neighborRoamInfo[session_id]; req = qdf_mem_malloc(sizeof(*req)); if (!req) { sme_err("failed to allocated memory"); @@ -8003,8 +8005,8 @@ QDF_STATUS sme_stop_roaming(tHalHandle hHal, uint8_t sessionId, uint8_t reason) req->reason = REASON_ROAM_STOP_ALL; else req->reason = REASON_ROAM_SYNCH_FAILED; - req->sessionId = sessionId; - if (csr_neighbor_middle_of_roaming(mac_ctx, sessionId)) + req->sessionId = session_id; + if (csr_neighbor_middle_of_roaming(mac_ctx, session_id)) req->middle_of_roaming = 1; else csr_roam_reset_roam_params(mac_ctx); @@ -8015,10 +8017,12 @@ QDF_STATUS sme_stop_roaming(tHalHandle hHal, uint8_t sessionId, uint8_t reason) 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); + session_id); qdf_mem_free(req); return QDF_STATUS_E_FAULT; } + roam_info->b_roam_scan_offload_started = false; + roam_info->last_sent_cmd = ROAM_SCAN_OFFLOAD_STOP; return QDF_STATUS_SUCCESS; } diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 3661dc7fbe39..cee26ed540a8 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -98,8 +98,6 @@ #define ROAMING_OFFLOAD_TIMER_STOP 2 #define CSR_ROAMING_OFFLOAD_TIMEOUT_PERIOD (5 * QDF_MC_TIMER_TO_SEC_UNIT) -static bool b_roam_scan_offload_started; - /* Static Type declarations */ static tCsrRoamSession csr_roam_roam_session[CSR_ROAM_SESSION_MAX]; @@ -927,14 +925,6 @@ QDF_STATUS csr_stop(tpAniSirGlobal pMac, tHalStopType stopType) pMac->roam.curSubState[sessionId] = eCSR_ROAM_SUBSTATE_NONE; } - /* When HAL resets all the context information - * in HAL is lost, so we might need to send the - * scan offload request again when it comes - * out of reset for scan offload to be functional - */ - if (HAL_STOP_TYPE_SYS_RESET == stopType) - b_roam_scan_offload_started = false; - return QDF_STATUS_SUCCESS; } @@ -17284,24 +17274,24 @@ static void check_allowed_ssid_list(tSirRoamOffloadScanReq *req_buffer, /* * Below Table describe whether RSO command can be send down to fimrware or not. * Host check it on the basis of previous RSO command sent down to firmware. - *||==========================================================================|| - *|| New cmd | LAST SENT COMMAND ---> || - *||====|=====================================================================|| - *|| V | START | STOP | RESTART | UPDATE_CFG| ABORT_SCAN || - *|| -------------------------------------------------------------------------|| - *|| RSO_START | NO | YES | NO | NO | NO || - *|| RSO_STOP | YES | YES | YES | YES | YES || - *|| RSO_RESTART | YES | YES | NO | YES | YES || - *|| RSO_UPDATE_CFG | YES | NO | YES | YES | YES || - *|| RSO_ABORT_SCAN | YES | NO | YES | YES | YES || - *||==========================================================================|| + * ||=========================================================================|| + * || New cmd | LAST SENT COMMAND ---> || + * ||====|====================================================================|| + * || V | START | STOP | RESTART | UPDATE_CFG| ABORT_SCAN || + * || ------------------------------------------------------------------------|| + * || RSO_START | NO | YES | NO | YES | NO || + * || RSO_STOP | YES | YES | YES | YES | YES || + * || RSO_RESTART | YES | YES | NO | YES | YES || + * || RSO_UPDATE_CFG | YES | NO | YES | YES | YES || + * || RSO_ABORT_SCAN | YES | NO | YES | YES | YES || + * ||=========================================================================|| **/ #define RSO_START_BIT (1<b_roam_scan_offload_started) && (ROAM_SCAN_OFFLOAD_START == command)) { sme_err("Roam Scan Offload is already started"); return QDF_STATUS_E_FAILURE; @@ -17848,9 +17838,9 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, return QDF_STATUS_E_FAILURE; } if (ROAM_SCAN_OFFLOAD_START == command) - b_roam_scan_offload_started = true; + roam_info->b_roam_scan_offload_started = true; else if (ROAM_SCAN_OFFLOAD_STOP == command) - b_roam_scan_offload_started = false; + roam_info->b_roam_scan_offload_started = false; /* update the last sent cmd */ roam_info->last_sent_cmd = command; diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 61931cbc73a6..15b94e381187 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -1420,6 +1420,7 @@ void csr_neighbor_roam_close(tpAniSirGlobal pMac, uint8_t sessionId) &pNeighborRoamInfo->FTRoamInfo. preAuthDoneList); csr_ll_close(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList); + pNeighborRoamInfo->b_roam_scan_offload_started = false; csr_neighbor_roam_state_transition(pMac, eCSR_NEIGHBOR_ROAM_STATE_CLOSED, sessionId);