From 6d2c97a1d8eb42e4fac4abed857d8aad558e65f2 Mon Sep 17 00:00:00 2001 From: Deepak Dhamdhere Date: Sat, 4 Feb 2017 22:09:27 -0800 Subject: [PATCH] qcacld-3.0: Enable event handler for WOW_REASON_ROAM_HO When roaming engine in firmware comes across handoff-failure and host processor is in sleep state, it sends WOW_REASON_ROAM_HO. Enable that reason code to follow the code path that leads into wma_roam_event_callback() where it is handled as normal. Modify peer debug log messages for better information for this event. CRs-Fixed: 2002239 Change-Id: I9ed854382287077ea66de78ce05e3d24c74058f3 --- core/wma/src/wma_features.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index f3ea3d73fcbe..5bfa03d7c881 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1641,6 +1641,8 @@ static int wow_get_wmi_eventid(int32_t reason, uint32_t tag) return wma_ndp_get_eventid_from_tlvtag(tag); case WOW_REASON_TDLS_CONN_TRACKER_EVENT: return WOW_TDLS_CONN_TRACKER_EVENT; + case WOW_REASON_ROAM_HO: + return WMI_ROAM_EVENTID; default: WMA_LOGD(FL("No Event Id for WOW reason %s(%d)"), wma_wow_wake_reason_str(reason), reason); @@ -1672,6 +1674,7 @@ static bool is_piggybacked_event(int32_t reason) case WOW_REASON_NAN_EVENT: case WOW_REASON_NAN_DATA: case WOW_REASON_TDLS_CONN_TRACKER_EVENT: + case WOW_REASON_ROAM_HO: return true; default: return false; @@ -2353,7 +2356,7 @@ static int wma_wake_event_piggybacked( WMI_WOW_WAKEUP_HOST_EVENTID_param_tlvs *event_param, uint32_t length) { - int errno; + int errno = 0; void *pb_event; uint32_t pb_event_len; uint32_t wake_reason; @@ -2417,8 +2420,27 @@ static int wma_wake_event_piggybacked( errno = wma_csa_offload_handler(wma, pb_event, pb_event_len); break; + /* + * WOW_REASON_LOW_RSSI is used for following roaming events - + * WMI_ROAM_REASON_BETTER_AP, WMI_ROAM_REASON_BMISS, + * WMI_ROAM_REASON_SUITABLE_AP will be handled by + * wma_roam_event_callback(). + * WOW_REASON_ROAM_HO is associated with + * WMI_ROAM_REASON_HO_FAILED event and it will be handled by + * wma_roam_event_callback(). + */ case WOW_REASON_LOW_RSSI: - errno = wma_roam_event_callback(wma, pb_event, pb_event_len); + case WOW_REASON_ROAM_HO: + if (pb_event_len > 0) { + errno = wma_roam_event_callback(wma, pb_event, + pb_event_len); + } else { + /* + * No wow_packet_buffer means a better AP beacon + * will follow in a later event. + */ + WMA_LOGD("Host woken up because of better AP beacon"); + } break; case WOW_REASON_CLIENT_KICKOUT_EVENT: