From e1a59839dffb9b8656beb90c76966feace665fdb Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Wed, 7 Sep 2016 12:19:24 -0700 Subject: [PATCH] qcacld-3.0: Update tlv_check_required() to handle all WoW reason Update tlv_check_required() to handle all WoW reason to prevent failure of parsing the wow packet buffer. WOW event AP_LOST_ASSOC reason is not handled in tlv_check_required function which returns true to parse the wow packet buffer which is incorrect. Enhance the tlv_check_required function by adding only the reasons that require tlv parsing and return false for others. Change-Id: I4079086c4a49279921f6af8dda72b32d923022c2 CRs-Fixed: 1064249 (cherry picked from commit 1cc8d077fb321e2b83a5f15bcd2a3bdb7d8ccb19) --- core/wma/src/wma_features.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 73d5ca8ec961..8324233a55db 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -2640,20 +2640,17 @@ static int wow_get_wmi_eventid(int32_t reason, uint32_t tag) static bool tlv_check_required(int32_t reason) { switch (reason) { - case WOW_REASON_PATTERN_MATCH_FOUND: - case WOW_REASON_BPF_ALLOW: - case WOW_REASON_AUTH_REQ_RECV: - case WOW_REASON_ASSOC_REQ_RECV: - case WOW_REASON_DEAUTH_RECVD: - case WOW_REASON_DISASSOC_RECVD: - case WOW_REASON_ASSOC_RES_RECV: - case WOW_REASON_REASSOC_REQ_RECV: - case WOW_REASON_REASSOC_RES_RECV: - case WOW_REASON_BEACON_RECV: - case WOW_REASON_ACTION_FRAME_RECV: - return false; - default: + case WOW_REASON_NLO_SCAN_COMPLETE: + case WOW_REASON_CSA_EVENT: + case WOW_REASON_LOW_RSSI: + case WOW_REASON_CLIENT_KICKOUT_EVENT: + case WOW_REASON_EXTSCAN: + case WOW_REASON_RSSI_BREACH_EVENT: + case WOW_REASON_NAN_EVENT: + case WOW_REASON_NAN_DATA: return true; + default: + return false; } }