Browse Source

qcacmn: Add support to extract dfs events

Add support to extract dfs events.

Change-Id: I3e83d05f6e4eefb0784b54cd908ec84beb04294c
CRs-Fixed: 2017481
Arif Hussain 8 years ago
parent
commit
aa1b2abfb3
2 changed files with 113 additions and 0 deletions
  1. 57 0
      wmi/inc/wmi_unified_dfs_api.h
  2. 56 0
      wmi/src/wmi_unified_dfs_api.c

+ 57 - 0
wmi/inc/wmi_unified_dfs_api.h

@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: This file contains the API definitions for the Unified Wireless Module
+ * Interface (WMI) which are specific to DFS module.
+ */
+
+#ifndef _WMI_UNIFIED_DFS_API_H_
+#define _WMI_UNIFIED_DFS_API_H_
+
+#include <wlan_dfs_utils_api.h>
+
+/**
+ * wmi_extract_dfs_cac_complete_event() - function to handle cac complete event
+ * @handle: wma handle
+ * @event_buf: event buffer
+ * @vdev_id: vdev id
+ * @len: length of buffer
+ *
+ * Return: 0 for success or error code
+ */
+QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
+		uint8_t *evt_buf,
+		uint32_t *vdev_id,
+		uint32_t len);
+
+/**
+ * wmi_extract_dfs_radar_detection_event() - function to handle radar event
+ * @handle: wma handle
+ * @event_buf: event buffer
+ * @radar_found: radar found event info
+ * @vdev_id: vdev id
+ * @len: length of buffer
+ *
+ * Return: 0 for success or error code
+ */
+QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
+		uint8_t *evt_buf,
+		struct radar_found_info *radar_found,
+		uint32_t len);
+
+#endif /* _WMI_UNIFIED_DFS_API_H_ */

+ 56 - 0
wmi/src/wmi_unified_dfs_api.c

@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: Implement API's specific to DFS component.
+ */
+
+#include <qdf_status.h>
+#include <wmi_unified_api.h>
+#include <wmi_unified_priv.h>
+#include <wlan_dfs_utils_api.h>
+#include <wmi_unified_dfs_api.h>
+
+QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
+		uint8_t *evt_buf,
+		uint32_t *vdev_id,
+		uint32_t len)
+{
+	struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
+
+	if (wmi_handle->ops->extract_dfs_cac_complete_event)
+		return wmi_handle->ops->extract_dfs_cac_complete_event(
+				wmi_handle, evt_buf, vdev_id, len);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
+		uint8_t *evt_buf,
+		struct radar_found_info *radar_found,
+		uint32_t len)
+{
+	struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
+
+	if (wmi_handle->ops->extract_dfs_radar_detection_event)
+		return wmi_handle->ops->extract_dfs_radar_detection_event(
+				wmi_handle, evt_buf, radar_found, len);
+
+	return QDF_STATUS_E_FAILURE;
+}