* [PATCH] backports: provide backport for setup_deferrable_timer()
@ 2017-03-10 10:01 Arend van Spriel
2017-03-31 7:30 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Arend van Spriel @ 2017-03-10 10:01 UTC (permalink / raw)
To: Johannes Berg; +Cc: backports, Arend van Spriel
Since commit f8f118ceaa56 ("mac80211: Use setup_timer instead of
init_timer") mac80211 needs setup_deferrable_timer() which is not
available in older kernels. Provide a backport in linux/timer.h.
Really need two flavors of backport to support up to 3.0 kernel.
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
Hit another one last night so here it is.
Regards,
Arend
---
backport/backport-include/linux/timer.h | 35 +++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 backport/backport-include/linux/timer.h
diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
new file mode 100644
index 0000000..df560a2
--- /dev/null
+++ b/backport/backport-include/linux/timer.h
@@ -0,0 +1,35 @@
+#ifndef _BACKPORT_TIMER_H
+#define _BACKPORT_TIMER_H
+
+#include_next <linux/timer.h>
+
+#ifndef setup_deferrable_timer
+/*
+ * The TIMER_DEFERRABLE flag has not been around since 3.0 so
+ * two different backports are needed here.
+ */
+#ifdef TIMER_DEFERRABLE
+#define setup_deferrable_timer(timer, fn, data) \
+ __setup_timer((timer), (fn), (data), TIMER_DEFERRABLE)
+#else
+static inline void setup_deferrable_timer_key(struct timer_list *timer,
+ const char *name,
+ struct lock_class_key *key,
+ void (*func)(unsigned long),
+ unsigned long data)
+{
+ timer->function = func;
+ timer->data = data;
+ init_timer_deferrable_key(timer, name, key);
+}
+#define setup_deferrable_timer(timer, fn, data) \
+ do { \
+ static struct lock_class_key __key; \
+ setup_deferrable_timer_key((timer), #timer, &__key, \
+ (fn), (data)); \
+ } while (0)
+#endif
+
+#endif
+
+#endif /* _BACKPORT_TIMER_H */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] backports: provide backport for setup_deferrable_timer()
2017-03-10 10:01 [PATCH] backports: provide backport for setup_deferrable_timer() Arend van Spriel
@ 2017-03-31 7:30 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2017-03-31 7:30 UTC (permalink / raw)
To: Arend van Spriel; +Cc: backports
On Fri, 2017-03-10 at 10:01 +0000, Arend van Spriel wrote:
> Since commit f8f118ceaa56 ("mac80211: Use setup_timer instead of
> init_timer") mac80211 needs setup_deferrable_timer() which is not
> available in older kernels. Provide a backport in linux/timer.h.
> Really need two flavors of backport to support up to 3.0 kernel.
>
Applied.
johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-31 7:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10 10:01 [PATCH] backports: provide backport for setup_deferrable_timer() Arend van Spriel
2017-03-31 7:30 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox