From 05376ee6c05c661684490175baabc58f4cc97c77 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Mon, 18 Jul 2016 16:43:32 -0700 Subject: [PATCH] qcacld-3.0: Check for LFR3 to call appropriate API in hdd_reassoc In hdd_reassoc check for LFR2/LFR3 before calling appropriate API for reassociation. Change-Id: I40e7de6dbc093e93053c12d4628b543b32cece6b CRs-Fixed: 1044268 --- core/hdd/inc/wlan_hdd_assoc.h | 5 +++ core/hdd/src/wlan_hdd_ioctl.c | 85 ++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 37 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index c71450f3e6e9..89d89cadf2ae 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -358,4 +358,9 @@ void hdd_delete_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id); int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr); QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *adapter, uint8_t sta_id); +#ifdef WLAN_FEATURE_ROAM_OFFLOAD +void hdd_wma_send_fastreassoc_cmd(int session_id, const tSirMacAddr bssid, + int channel); +#endif + #endif diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 384783976fb4..78318563f79f 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -837,6 +837,44 @@ static int hdd_parse_reassoc_command_v1_data(const uint8_t *pValue, return 0; } +#ifdef WLAN_FEATURE_ROAM_OFFLOAD +void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, + int channel) +{ + struct wma_roam_invoke_cmd *fastreassoc; + cds_msg_t msg = {0}; + + fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc)); + if (NULL == fastreassoc) { + hdd_err("qdf_mem_malloc failed for fastreassoc"); + return; + } + fastreassoc->vdev_id = sessionId; + fastreassoc->channel = channel; + fastreassoc->bssid[0] = bssid[0]; + fastreassoc->bssid[1] = bssid[1]; + fastreassoc->bssid[2] = bssid[2]; + fastreassoc->bssid[3] = bssid[3]; + fastreassoc->bssid[4] = bssid[4]; + fastreassoc->bssid[5] = bssid[5]; + + msg.type = SIR_HAL_ROAM_INVOKE; + msg.reserved = 0; + msg.bodyptr = fastreassoc; + if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA, + &msg)) { + qdf_mem_free(fastreassoc); + hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); + } +} +#else +void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, + int channel) +{ +} + +#endif + /** * hdd_reassoc() - perform a userspace-directed reassoc * @adapter: Adapter upon which the command was received @@ -852,8 +890,14 @@ int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, const uint8_t channel, const handoff_src src) { hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); int ret = 0; + if (hdd_ctx == NULL) { + hdd_err("Invalid hdd ctx"); + return -EINVAL; + } + if (QDF_STA_MODE != adapter->device_mode) { hdd_warn("Unsupported in mode %s(%d)", hdd_device_mode_to_string(adapter->device_mode), @@ -890,9 +934,11 @@ int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, } /* Proceed with reassoc */ - { + if (roaming_offload_enabled(hdd_ctx)) { + hdd_wma_send_fastreassoc_cmd((int)adapter->sessionId, + bssid, (int)channel); + } else { tCsrHandoffRequest handoffInfo; - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); handoffInfo.channel = channel; handoffInfo.src = src; @@ -4344,41 +4390,6 @@ exit: return ret; } -#ifdef WLAN_FEATURE_ROAM_OFFLOAD -static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid, - int channel) -{ - struct wma_roam_invoke_cmd *fastreassoc; - cds_msg_t msg = {0}; - - fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc)); - if (NULL == fastreassoc) { - hdd_err("qdf_mem_malloc failed for fastreassoc"); - return; - } - fastreassoc->vdev_id = sessionId; - fastreassoc->channel = channel; - fastreassoc->bssid[0] = bssid[0]; - fastreassoc->bssid[1] = bssid[1]; - fastreassoc->bssid[2] = bssid[2]; - fastreassoc->bssid[3] = bssid[3]; - fastreassoc->bssid[4] = bssid[4]; - fastreassoc->bssid[5] = bssid[5]; - - msg.type = SIR_HAL_ROAM_INVOKE; - msg.reserved = 0; - msg.bodyptr = fastreassoc; - if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA, - &msg)) { - qdf_mem_free(fastreassoc); - hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); - } -} -#else -static inline void hdd_wma_send_fastreassoc_cmd(int sessionId, - tSirMacAddr bssid, int channel) -{} -#endif static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx, uint8_t *command,