From 63eb9e48ddea33d5ef8f356767cc478484755787 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Sun, 4 Aug 2019 23:59:48 +0530 Subject: [PATCH] qcacmn: Set WMI_PMK_CACHE_OP_FLAG_FLUSH_ALL only for pmksa_flush The supplicant sends del_pmksa command to delete the pmk,pmkid for a particular bssid. In this command pmk_len will be 0. In send_set_del_pmkid_cache_cmd_tlv() the host driver currently checks the pmk_len to set WMI_PMK_CACHE_OP_FLAG_FLUSH_ALL. If pmk_len is 0 WMI_PMK_CACHE_OP_FLAG_FLUSH_ALL is set, which is not correct. pmk_len will be zero in both the flush and delete cases. So add a new flag is_flush_all which will be set to true when the supplicant sends pmksa flush command. At WMI based on this flag set the flush flag to the wmi cmd. Change-Id: I7626c500721a4b8cccbb21a08d4235c041456d1b CRs-Fixed: 2502478 --- wmi/inc/wmi_unified_sta_param.h | 3 +++ wmi/src/wmi_unified_sta_tlv.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wmi/inc/wmi_unified_sta_param.h b/wmi/inc/wmi_unified_sta_param.h index 4276217b24..14eca73439 100644 --- a/wmi/inc/wmi_unified_sta_param.h +++ b/wmi/inc/wmi_unified_sta_param.h @@ -204,6 +204,8 @@ struct sar_limit_event { * @cache_id: PMK Cache ID * @cat_flag: whether (bssid) or (ssid,cache_id) is valid * @action_flag: add/delete the entry + * @is_flush_all: FLAG to indicate PMKSA flush. True if PMKSA cache flush is + * needed. */ struct wmi_unified_pmk_cache { uint8_t vdev_id; @@ -216,6 +218,7 @@ struct wmi_unified_pmk_cache { uint32_t cache_id; uint32_t cat_flag; uint32_t action_flag; + bool is_flush_all; }; #define WMI_QOS_NUM_AC_MAX 4 diff --git a/wmi/src/wmi_unified_sta_tlv.c b/wmi/src/wmi_unified_sta_tlv.c index bb75b67df0..de4806649a 100644 --- a/wmi/src/wmi_unified_sta_tlv.c +++ b/wmi/src/wmi_unified_sta_tlv.c @@ -1581,7 +1581,8 @@ static QDF_STATUS send_set_del_pmkid_cache_cmd_tlv(wmi_unified_t wmi_handle, wmi_pmk_cache *pmksa; uint32_t len = sizeof(*cmd); - if (pmk_info->pmk_len) + if (pmk_info && + !pmk_info->is_flush_all) len += WMI_TLV_HDR_SIZE + sizeof(*pmksa); buf = wmi_buf_alloc(wmi_handle, len); @@ -1599,8 +1600,8 @@ static QDF_STATUS send_set_del_pmkid_cache_cmd_tlv(wmi_unified_t wmi_handle, cmd->vdev_id = pmk_info->vdev_id; - /* If pmk_info->pmk_len is 0, this is a flush request */ - if (!pmk_info->pmk_len) { + /* If pmk_info->is_flush_all is true, this is a flush request */ + if (pmk_info->is_flush_all) { cmd->op_flag = WMI_PMK_CACHE_OP_FLAG_FLUSH_ALL; cmd->num_cache = 0; goto send_cmd;