From 4f97da5b23c5d50b6c019f69b5e45a169b1aad01 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 21 May 2020 01:50:58 +0530 Subject: [PATCH] qcacld-3.0: Add BSSID to avoid list for STA-KICKOUT If the STA-KICKOUT event comes too frequently for a certain AP, then the AP might have some genuine issue and should not be tried again and again in intial connection and roaming case scenarios. So it is better to avoid this AP and if the AP still faces a kickout then after 3 attempts which is ini configurable the driver would blacklist it to avoid ping pong. Change-Id: I8221cca9adc777ca275fdd76c2f8ba17cd12c14f CRs-Fixed: 2683615 --- core/sme/src/csr/csr_api_roam.c | 11 +++++++++++ core/wma/src/wma_mgmt.c | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f429f9303f..ac7eef6423 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -20748,6 +20748,9 @@ csr_check_and_set_sae_single_pmk_cap(struct mac_context *mac_ctx, } #endif +#define IS_ROAM_REASON_STA_KICKOUT(reason) ((reason & 0xF) == \ + WMI_ROAM_TRIGGER_REASON_STA_KICKOUT) + static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx, struct roam_offload_synch_ind *roam_synch_data, struct bss_description *bss_desc, enum sir_roam_op_code reason) @@ -20970,6 +20973,14 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx, session->connectedProfile.bssid, BLM_AP_DISCONNECTED); + if (IS_ROAM_REASON_STA_KICKOUT(roam_synch_data->roamReason)) { + struct reject_ap_info ap_info; + + ap_info.bssid = session->connectedProfile.bssid; + ap_info.reject_ap_type = DRIVER_AVOID_TYPE; + wlan_blm_add_bssid_to_reject_list(mac_ctx->pdev, &ap_info); + } + /* Remove old BSSID mlme info from scan cache */ csr_update_scan_entry_associnfo(mac_ctx, session, SCAN_ENTRY_CON_STATE_NONE); diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index c1daafb10e..b731e44b1f 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -43,7 +43,7 @@ #include "lim_session_utils.h" #include "cds_utils.h" - +#include "wlan_blm_api.h" #if !defined(REMOVE_PKT_LOG) #include "pktlog_ac.h" #else @@ -331,6 +331,7 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event, uint8_t *addr, *bssid; struct wlan_objmgr_vdev *vdev; void *soc = cds_get_context(QDF_MODULE_ID_SOC); + struct reject_ap_info ap_info; param_buf = (WMI_PEER_STA_KICKOUT_EVENTID_param_tlvs *) event; kickout_event = param_buf->fixed_param; @@ -458,6 +459,11 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event, wma_send_msg(wma, SIR_LIM_DELETE_STA_CONTEXT_IND, (void *)del_sta_ctx, 0); wma_lost_link_info_handler(wma, vdev_id, del_sta_ctx->rssi); + + qdf_mem_copy(&ap_info.bssid, macaddr, QDF_MAC_ADDR_SIZE); + ap_info.reject_ap_type = DRIVER_AVOID_TYPE; + wlan_blm_add_bssid_to_reject_list(wma->pdev, &ap_info); + exit_handler: return 0; }