diff mbox series

[RFC,v1,063/256] cl8k: add dfs/radar.h

Message ID 20210617160223.160998-64-viktor.barna@celeno.com
State New
Headers show
Series wireless: cl8k driver for Celeno IEEE 802.11ax devices | expand

Commit Message

Viktor Barna June 17, 2021, 3:59 p.m. UTC
From: Viktor Barna <viktor.barna@celeno.com>

(Part of the split. Please, take a look at the cover letter for more
details).

Signed-off-by: Viktor Barna <viktor.barna@celeno.com>
---
 drivers/net/wireless/celeno/cl8k/dfs/radar.h | 55 ++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 drivers/net/wireless/celeno/cl8k/dfs/radar.h

--
2.30.0
diff mbox series

Patch

diff --git a/drivers/net/wireless/celeno/cl8k/dfs/radar.h b/drivers/net/wireless/celeno/cl8k/dfs/radar.h
new file mode 100644
index 000000000000..bed037cce624
--- /dev/null
+++ b/drivers/net/wireless/celeno/cl8k/dfs/radar.h
@@ -0,0 +1,55 @@ 
+/* SPDX-License-Identifier: MIT */
+/* Copyright(c) 2019-2021, Celeno Communications Ltd. */
+
+#ifndef CL_RADAR_H
+#define CL_RADAR_H
+
+  #include <linux/types.h>
+
+/* Number of pulses in a radar event structure */
+#define RADAR_PULSE_MAX 4
+
+/*
+ * Structure used to store information regarding
+ * E2A radar events in the driver
+ */
+struct cl_radar_elem {
+       struct cl_radar_pulse_array *radarbuf_ptr;
+       dma_addr_t dma_addr;
+};
+
+/* Bit mapping inside a radar pulse element */
+struct cl_radar_pulse {
+       u64 freq        : 8;
+       u64 fom         : 8;
+       u64 len         : 8;  /* Pulse length timer */
+       u64 measure_cnt : 2;  /* Measure count */
+       u64 rsv1        : 6;  /* Reserve1 */
+       u64 rep         : 16; /* PRI */
+       u64 rsv2        : 16; /* Reserve2 */
+};
+
+/* Definition of an array of radar pulses */
+struct cl_radar_pulse_array {
+       /* Buffer containing the radar pulses */
+       u64 pulse[RADAR_PULSE_MAX];
+       /* Number of valid pulses in the buffer */
+       u32 cnt;
+};
+
+struct cl_radar_queue_elem {
+       struct list_head list;
+       struct cl_hw *cl_hw;
+       struct cl_radar_elem radar_elem;
+       unsigned long time;
+};
+
+struct cl_hw;
+
+void cl_radar_init(struct cl_hw *cl_hw);
+void cl_radar_push(struct cl_hw *cl_hw, struct cl_radar_elem *radar_elem);
+void cl_radar_tasklet_schedule(struct cl_hw *cl_hw);
+void cl_radar_flush(struct cl_hw *cl_hw);
+void cl_radar_close(struct cl_hw *cl_hw);
+
+#endif /* CL_RADAR_H */