From ead7750ba5238b997ddf24c3da3c93b72c86b4a3 Mon Sep 17 00:00:00 2001 From: abhinav kumar Date: Mon, 27 Feb 2023 17:29:32 +0530 Subject: [PATCH] qcacld-3.0: Fill proper RSSI value during kickout/bmiss Issue: Host reports different RSSI values during roaming trigger logging and subsequent deauth TX logging to user space. In case of roam trigger roaming, driver sends the rssi value to user space from wmi_roam_ap_info tlv in roam scan results. In case of disconnection due to BMISS or STA KICKOUT case, host does not receive latest beacon from FW. This results, on disconnection, host reports deauth TX logs to userspace using old RSSI present in mac->lim.bss_rssi which is updated when beacon or probe response is received in host. Fix is to update mac->lim.bss_rssi while processing sta kickout or bmiss event coming from FW. Change-Id: I108f94959fbf915d8f67f443a9fcd54d595c27d1 CRs-Fixed: 3417363 --- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 10 ++++++++++ core/mac/src/pe/lim/lim_types.h | 9 +++++++++ core/wma/src/wma_utils.c | 1 + 3 files changed, 20 insertions(+) diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 64ca0d806e..62f4892443 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -1275,6 +1275,16 @@ void lim_process_mlm_set_keys_cnf(struct mac_context *mac, uint32_t *msg_buf) pe_session, pe_session->smeSessionId); } /*** end lim_process_mlm_set_keys_cnf() ***/ +void lim_update_lost_link_rssi(struct mac_context *mac, uint32_t rssi) +{ + if (!mac) { + pe_debug("mac is null"); + return; + } + + mac->lim.bss_rssi = rssi; +} + void lim_join_result_callback(struct mac_context *mac, uint8_t vdev_id) { diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index ac2c5a53c3..2c2a755a20 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -1186,6 +1186,15 @@ QDF_STATUS lim_sta_handle_connect_fail(join_params *param); void lim_join_result_callback(struct mac_context *mac, uint8_t vdev_id); +/** + * lim_update_lost_link_rssi() - API to update lost link rssi in lim session + * @mac: Pointer to Global MAC structure + * @rssi: rssi at disconnect time + * + * Return: None + */ +void lim_update_lost_link_rssi(struct mac_context *mac, uint32_t rssi); + #ifdef WLAN_FEATURE_HOST_ROAM QDF_STATUS lim_sta_reassoc_error_handler(struct reassoc_params *param); #else diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 19c6eaad46..c45a8c5efe 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -604,6 +604,7 @@ void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id, if (wma_is_vdev_up(vdev_id) && (WMI_VDEV_TYPE_STA == wma->interfaces[vdev_id].type) && (0 == wma->interfaces[vdev_id].sub_type)) { + lim_update_lost_link_rssi(wma->mac_context, rssi); lost_link_info = qdf_mem_malloc(sizeof(*lost_link_info)); if (!lost_link_info) return;