From 462ab8693fa97f57ef49efa0eb853cbc7ae18bbe Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Thu, 21 Feb 2019 11:14:49 +0800 Subject: [PATCH] qcacld-3.0: Fix assert when iwpriv wlan0 addTspec If ACM is off and can't send AddTspec too, we should be still ok to send uapsd info to AP via reassoc req. If roam offload is enabled, when csr_reassoc is called, vdev start cmd is sent during vdev started status, assert will happen. Fix: call sme_fast_reassoc in sme_qos_request_reassoc to invoke LFR3 roam if roam offload supported. Reproduce steps: 1. Change ini: gAddTSWhenACMIsOff=0 2. DUT STA connected AP 3. iwpriv wlan0 addTspec 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Change-Id: Idbd53ff0af36cb3b68c514e399d0033c41c74a78 CRs-Fixed: 2402542 --- .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 17 +++++++++++- core/sme/inc/sme_api.h | 9 +++++++ core/sme/src/qos/sme_qos.c | 27 +++++++++++++++++-- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index af47df5c363a..9900769e5d00 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1062,8 +1062,23 @@ ucfg_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_mlme_set_roaming_offload(struct wlan_objmgr_psoc *psoc, bool val); -#endif +#else +static inline QDF_STATUS +ucfg_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc, + bool *val) +{ + *val = false; + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +ucfg_mlme_set_roaming_offload(struct wlan_objmgr_psoc *psoc, + bool val) +{ + return QDF_STATUS_SUCCESS; +} +#endif /** * ucfg_mlme_get_first_scan_bucket_threshold() - Get first scan bucket thre * @psoc: pointer to psoc object diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 4ca06a9f3c08..56c40d7a2b97 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1941,6 +1941,15 @@ QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle, struct csr_roam_profile *profile, const tSirMacAddr bssid, int channel, uint8_t vdev_id, const tSirMacAddr connected_bssid); +#else +static inline +QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle, + struct csr_roam_profile *profile, + const tSirMacAddr bssid, int channel, + uint8_t vdev_id, const tSirMacAddr connected_bssid) +{ + return QDF_STATUS_SUCCESS; +} #endif /** * sme_congestion_register_callback() - registers congestion callback diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index 898633376b0c..b1172800c6f7 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -33,6 +33,7 @@ #include "utils_parser.h" #include "sme_power_save_api.h" +#include "wlan_mlme_ucfg_api.h" #ifndef WLAN_MDM_CODE_REDUCTION_OPT /* TODO : 6Mbps as Cisco APs seem to like only this value; analysis req. */ @@ -7464,13 +7465,35 @@ static QDF_STATUS sme_qos_request_reassoc(struct mac_context *mac, struct sme_qos_sessioninfo *pSession; struct sme_qos_acinfo *pACInfo; QDF_STATUS status; + struct csr_roam_session *session; + tCsrRoamConnectedProfile connected_profile; + struct csr_roam_profile *roam_profile; + bool roam_offload_enable = true; QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, "%s: %d: Invoked on session %d with UAPSD mask 0x%X", __func__, __LINE__, sessionId, pModFields->uapsd_mask); pSession = &sme_qos_cb.sessionInfo[sessionId]; - status = csr_reassoc(mac, sessionId, pModFields, &pSession->roamID, - fForce); + + status = ucfg_mlme_get_roaming_offload(mac->psoc, &roam_offload_enable); + if (QDF_IS_STATUS_ERROR(status)) + return status; + if (roam_offload_enable) { + session = CSR_GET_SESSION(mac, sessionId); + roam_profile = session->pCurRoamProfile; + connected_profile = session->connectedProfile; + status = sme_fast_reassoc( + MAC_HANDLE(mac), + roam_profile, + connected_profile.bssid.bytes, + connected_profile.operationChannel, + sessionId, + connected_profile.bssid.bytes); + } else { + status = csr_reassoc(mac, sessionId, pModFields, + &pSession->roamID, fForce); + } + if (QDF_IS_STATUS_SUCCESS(status)) { /* Update the state to Handoff so subsequent requests are * queued until this one is finished