diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index 59564a17c86d..1c08e8bc6323 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -350,14 +350,16 @@ QDF_STATUS csr_roam_read_tsf(tpAniSirGlobal pMac, uint8_t *pTimestamp, const uint8_t sessionId); #endif /* FEATURE_WLAN_ESE */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD -void csr_roam_synch_callback(tpAniSirGlobal mac, +QDF_STATUS csr_roam_synch_callback(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason); #else -static inline void csr_roam_synch_callback(tpAniSirGlobal mac, +static inline QDF_STATUS csr_roam_synch_callback(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason) -{} +{ + return QDF_STATUS_E_NOSUPPORT; +} #endif void csr_neighbor_roam_state_transition(tpAniSirGlobal mac_ctx, uint8_t newstate, uint8_t session); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 0fa4fd65220e..233ee69c1f15 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20044,9 +20044,9 @@ void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, * is achieved through the already defined callback for assoc completion * handler. * - * Return: None. + * Return: Success or Failure. */ -void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, +QDF_STATUS csr_roam_synch_callback(tpAniSirGlobal mac_ctx, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc, enum sir_roam_op_code reason) { @@ -20068,12 +20068,12 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, status = sme_acquire_global_lock(&mac_ctx->sme); if (!QDF_IS_STATUS_SUCCESS(status)) { sms_log(mac_ctx, LOGE, FL("LFR3: Locking failed, bailing out")); - return; + return status; } if (!session) { sms_log(mac_ctx, LOGE, FL("LFR3: Session not found")); sme_release_global_lock(&mac_ctx->sme); - return; + return QDF_STATUS_E_FAILURE; } sms_log(mac_ctx, LOG1, FL("LFR3: reason: %d"), reason); @@ -20085,10 +20085,15 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, */ csr_roam_roaming_offload_timer_action(mac_ctx, 0, session_id, ROAMING_OFFLOAD_TIMER_STOP); + if (!CSR_IS_ROAM_JOINED(mac_ctx, session_id)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, + FL("LFR3: Session not in connected state")); + return QDF_STATUS_E_FAILURE; + } csr_roam_call_callback(mac_ctx, session_id, NULL, 0, eCSR_ROAM_FT_START, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); - return; + return status; case SIR_ROAMING_START: csr_roam_roaming_offload_timer_action(mac_ctx, CSR_ROAMING_OFFLOAD_TIMEOUT_PERIOD, session_id, @@ -20096,19 +20101,19 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, csr_roam_call_callback(mac_ctx, session_id, NULL, 0, eCSR_ROAM_START, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); - return; + return status; case SIR_ROAMING_ABORT: csr_roam_roaming_offload_timer_action(mac_ctx, 0, session_id, ROAMING_OFFLOAD_TIMER_STOP); csr_roam_call_callback(mac_ctx, session_id, NULL, 0, eCSR_ROAM_ABORT, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); - return; + return status; case SIR_ROAM_SYNCH_NAPI_OFF: csr_roam_call_callback(mac_ctx, session_id, NULL, 0, eCSR_ROAM_NAPI_OFF, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); - return; + return status; case SIR_ROAM_SYNCH_PROPAGATION: break; case SIR_ROAM_SYNCH_COMPLETE: @@ -20133,20 +20138,21 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, session->roam_synch_in_progress = false; cds_check_concurrent_intf_and_restart_sap(session->pContext); sme_release_global_lock(&mac_ctx->sme); - return; + return status; default: sms_log(mac_ctx, LOGE, FL("LFR3: callback reason %d"), reason); sme_release_global_lock(&mac_ctx->sme); - return; + return QDF_STATUS_E_FAILURE; } session->roam_synch_in_progress = true; session->roam_synch_data = roam_synch_data; - if (!QDF_IS_STATUS_SUCCESS(csr_get_parsed_bss_description_ies(mac_ctx, - bss_desc, &ies_local))) { + status = csr_get_parsed_bss_description_ies( + mac_ctx, bss_desc, &ies_local); + if (!QDF_IS_STATUS_SUCCESS(status)) { sms_log(mac_ctx, LOGE, FL("LFR3: fail to parse IEs")); session->roam_synch_in_progress = false; sme_release_global_lock(&mac_ctx->sme); - return; + return status; } conn_profile = &session->connectedProfile; csr_roam_stop_network(mac_ctx, session_id, @@ -20162,7 +20168,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, session->roam_synch_in_progress = false; qdf_mem_free(ies_local); sme_release_global_lock(&mac_ctx->sme); - return; + return QDF_STATUS_E_NOMEM; } csr_scan_save_roam_offload_ap_to_scan_cache(mac_ctx, roam_synch_data, bss_desc); @@ -20236,7 +20242,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, qdf_mem_free(roam_info); qdf_mem_free(ies_local); sme_release_global_lock(&mac_ctx->sme); - return; + return QDF_STATUS_E_NOMEM; } qdf_mem_copy(roam_info->pbFrames, (uint8_t *)roam_synch_data + @@ -20376,5 +20382,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, qdf_mem_free(roam_info); qdf_mem_free(ies_local); sme_release_global_lock(&mac_ctx->sme); + + return status; } #endif diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index feacec7167fc..811366151931 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1537,7 +1537,7 @@ typedef struct { * the serialized MC thread context with a timer. */ qdf_mc_timer_t service_ready_ext_timer; - void (*csr_roam_synch_cb)(tpAniSirGlobal mac, + QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason); diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 88a28252d0a9..9a887f9d0502 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -739,7 +739,7 @@ QDF_STATUS wma_register_mgmt_frm_client(void); QDF_STATUS wma_de_register_mgmt_frm_client(void); #ifdef WLAN_FEATURE_ROAM_OFFLOAD QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, - void (*csr_roam_synch_cb)(tpAniSirGlobal mac, + QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason), @@ -748,7 +748,7 @@ QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, tpSirBssDescription bss_desc_ptr)); #else static inline QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, - void (*csr_roam_synch_cb)(tpAniSirGlobal mac, + QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason), diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 1166d98e328e..0443baab0918 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -3587,7 +3587,7 @@ QDF_STATUS wma_de_register_mgmt_frm_client(void) * Return: Success or Failure Status */ QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, - void (*csr_roam_synch_cb)(tpAniSirGlobal mac, + QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, enum sir_roam_op_code reason), diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index e65c128509e6..a3e72ed6ffee 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2133,9 +2133,9 @@ void wma_process_roam_synch_fail(WMA_HANDLE handle, * parameters are parsed and filled into the roam synch indication * buffer which will be used at different layers for propagation. * - * Return: None + * Return: Success or Failure */ -static void wma_fill_roam_synch_buffer(tp_wma_handle wma, +static QDF_STATUS wma_fill_roam_synch_buffer(tp_wma_handle wma, roam_offload_synch_ind *roam_synch_ind_ptr, WMI_ROAM_SYNCH_EVENTID_param_tlvs *param_buf) { @@ -2145,6 +2145,7 @@ static void wma_fill_roam_synch_buffer(tp_wma_handle wma, uint8_t *reassoc_req_ptr; wmi_channel *chan; wmi_key_material *key; + QDF_STATUS status = QDF_STATUS_SUCCESS; synch_event = param_buf->fixed_param; roam_synch_ind_ptr->roamedVdevId = synch_event->vdev_id; @@ -2163,8 +2164,12 @@ static void wma_fill_roam_synch_buffer(tp_wma_handle wma, roam_synch_ind_ptr->rssi, roam_synch_ind_ptr->isBeacon); - wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, - roam_synch_ind_ptr, NULL, SIR_ROAMING_DEREGISTER_STA); + if (!QDF_IS_STATUS_SUCCESS( + wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, + roam_synch_ind_ptr, NULL, SIR_ROAMING_DEREGISTER_STA))) { + WMA_LOGE("LFR3: CSR Roam synch cb failed"); + return QDF_STATUS_E_FAILURE; + } /* Beacon/Probe Rsp data */ roam_synch_ind_ptr->beaconProbeRespOffset = sizeof(roam_offload_synch_ind); @@ -2223,6 +2228,8 @@ static void wma_fill_roam_synch_buffer(tp_wma_handle wma, &roam_synch_ind_ptr->hw_mode_trans_ind); else WMA_LOGD(FL("hw_mode transition fixed param is NULL")); + + return status; } /** @@ -2357,7 +2364,9 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, goto cleanup_label; } qdf_mem_zero(roam_synch_ind_ptr, len); - wma_fill_roam_synch_buffer(wma, roam_synch_ind_ptr, param_buf); + status = wma_fill_roam_synch_buffer(wma, roam_synch_ind_ptr, param_buf); + if (!QDF_IS_STATUS_SUCCESS(status)) + goto cleanup_label; /* 24 byte MAC header and 12 byte to ssid IE */ if (roam_synch_ind_ptr->beaconProbeRespLength > (SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET)) {