diff mbox series

[RFC,v1,228/256] cl8k: add utils/timer.h

Message ID 20210617160223.160998-229-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, 4:01 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>
---
 .../net/wireless/celeno/cl8k/utils/timer.h    | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 drivers/net/wireless/celeno/cl8k/utils/timer.h

--
2.30.0
diff mbox series

Patch

diff --git a/drivers/net/wireless/celeno/cl8k/utils/timer.h b/drivers/net/wireless/celeno/cl8k/utils/timer.h
new file mode 100644
index 000000000000..1481d8d78db4
--- /dev/null
+++ b/drivers/net/wireless/celeno/cl8k/utils/timer.h
@@ -0,0 +1,30 @@ 
+/* SPDX-License-Identifier: MIT */
+/* Copyright(c) 2019-2021, Celeno Communications Ltd. */
+
+#ifndef CL_TIMER_H
+#define CL_TIMER_H
+
+#include <linux/timer.h>
+
+struct cl_timer {
+       struct timer_list obj;
+       void (*f)(unsigned long data);
+       unsigned long data;
+       atomic_t period;
+       bool periodic;
+       bool enable;
+};
+
+void cl_timer_init(struct cl_timer *timer,
+                  void (*f)(unsigned long data),
+                  unsigned long data,
+                  unsigned long period,
+                  bool periodic);
+void cl_timer_period_set(struct cl_timer *timer, unsigned long period);
+void cl_timer_enable(struct cl_timer *timer);
+void cl_timer_disable(struct cl_timer *timer);
+void cl_timer_disable_sync(struct cl_timer *timer);
+void cl_timer_rearm(struct cl_timer *timer);
+int cl_timer_rearm_offset(struct cl_timer *timer, unsigned long time_offset);
+
+#endif /* CL_TIMER_H */