summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2015-07-27 17:51:37 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-07-28 03:20:10 -0700
commit64a1d3c4d0e44bb77430bcff45822df79ef00281 (patch)
tree985d60e9527b3434ec91cf6d2b4ea9093cfd327b
parent3dc89d47ac85e4b90af4e649b809b43db75a603a (diff)
qcacld-2.0: extscan: Process extscan events in WoW mode
In WoW mode, extscan events are embedded inside a WoW event. The wow event is followed by the payload of the event which generated the wow event. Payload is 4 bytes of length followed by event buffer. The first 4 bytes of event buffer is common tlv header, which is a combination of tag (higher 2 bytes) and length (lower 2 bytes). The tag is used to identify the event which triggered wow event. Once the event is identified, extract the event data and invoke the appropriate event handlers. Change-Id: I42ff7b3e5b73d98d4f168c5ff54176e0ab73d534 CRs-Fixed: 880356
-rw-r--r--CORE/SERVICES/WMA/wma.c119
1 files changed, 116 insertions, 3 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 25958bb7f282..87c5863b17f3 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -18474,6 +18474,108 @@ static int wma_flush_complete_evt_handler(void *handle,
return 0;
}
+#ifdef FEATURE_WLAN_EXTSCAN
+/**
+ * wma_extscan_wow_event_callback() - extscan wow event callback
+ * @handle: WMA handle
+ * @event: event buffer
+ * @len: length of @event buffer
+ *
+ * In wow case, the wow event is followed by the payload of the event
+ * which generated the wow event.
+ * payload is 4 bytes of length followed by event buffer. the first 4 bytes
+ * of event buffer is common tlv header, which is a combination
+ * of tag (higher 2 bytes) and length (lower 2 bytes). The tag is used to
+ * identify the event which triggered wow event.
+ *
+ * @Return: none
+ */
+static void wma_extscan_wow_event_callback(void *handle, void *event,
+ uint32_t len)
+{
+ uint32_t tag = WMITLV_GET_TLVTAG(WMITLV_GET_HDR(event));
+ WMA_LOGI("%s: Enter Tag: %d", __func__, tag);
+
+ switch (tag) {
+ case WMITLV_TAG_STRUC_wmi_extscan_start_stop_event_fixed_param:
+ {
+ WMI_EXTSCAN_START_STOP_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_start_stop_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_operation_event_fixed_param:
+ {
+ WMI_EXTSCAN_OPERATION_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_operations_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_table_usage_event_fixed_param:
+ {
+ WMI_EXTSCAN_TABLE_USAGE_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_table_usage_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_cached_results_event_fixed_param:
+ {
+ WMI_EXTSCAN_CACHED_RESULTS_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_cached_results_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_wlan_change_results_event_fixed_param:
+ {
+ WMI_EXTSCAN_WLAN_CHANGE_RESULTS_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_change_results_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_hotlist_match_event_fixed_param:
+ {
+ WMI_EXTSCAN_HOTLIST_MATCH_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_hotlist_match_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_capabilities_event_fixed_param:
+ {
+ WMI_EXTSCAN_CAPABILITIES_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_capabilities_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ case WMITLV_TAG_STRUC_wmi_extscan_hotlist_ssid_match_event_fixed_param:
+ {
+ WMI_EXTSCAN_HOTLIST_SSID_MATCH_EVENTID_param_tlvs param;
+ param.fixed_param = event;
+ wma_extscan_hotlist_ssid_match_event_handler(handle,
+ (uint8_t *)&param, sizeof(param));
+ break;
+ }
+
+ default:
+ WMA_LOGE("%s: Unknown tag: %d", __func__, tag);
+ break;
+ }
+}
+#endif
+
/*
* Handler to catch wow wakeup host event. This event will have
* reason why the firmware has woken the host.
@@ -18649,9 +18751,20 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
}
#ifdef FEATURE_WLAN_EXTSCAN
case WOW_REASON_EXTSCAN:
- {
- WMA_LOGD("Host woken up because of extscan reason");
- }
+ WMA_LOGD("Host woken up because of extscan reason");
+ if (param_buf->wow_packet_buffer) {
+ wow_buf_pkt_len =
+ *(uint32_t *)param_buf->wow_packet_buffer;
+ WMA_LOGD("wow_packet_buffer dump");
+ vos_trace_hex_dump(VOS_MODULE_ID_WDA,
+ VOS_TRACE_LEVEL_DEBUG,
+ param_buf->wow_packet_buffer,
+ wow_buf_pkt_len);
+ wma_extscan_wow_event_callback(handle,
+ (u_int8_t *)(param_buf->wow_packet_buffer + 4),
+ wow_buf_pkt_len);
+ } else
+ WMA_LOGE("wow_packet_buffer is empty");
break;
#endif
case WOW_REASON_RSSI_BREACH_EVENT: