summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin2011-09-23 16:48:05 -0500
committerLuis R. Rodriguez2011-09-23 16:49:44 -0500
commitebcc0426c50fe5f2ec28b64edca677a3c7d8b377 (patch)
tree59421b8133c84fad2fa027e3100219a02e797119
parent8331446ead4dd43ffffbe0c8db16c5103d8a8c28 (diff)
downloadcompat-ebcc0426c50fe5f2ec28b64edca677a3c7d8b377.tar.gz
compat-ebcc0426c50fe5f2ec28b64edca677a3c7d8b377.tar.xz
compat-ebcc0426c50fe5f2ec28b64edca677a3c7d8b377.zip
compat: provide INIT_WORK with 2 arguments for kernels before 2.6.20kernel-3.1
Also provide work_func_t. Originally implemented and tested in ndiswrapper. Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--include/linux/compat-2.6.20.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/compat-2.6.20.h b/include/linux/compat-2.6.20.h
new file mode 100644
index 0000000..14579e2
--- /dev/null
+++ b/include/linux/compat-2.6.20.h
@@ -0,0 +1,21 @@
1#ifndef LINUX_26_20_COMPAT_H
2#define LINUX_26_20_COMPAT_H
3
4#include <linux/version.h>
5
6/* Compat work for 2.6.20 */
7#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
8
9#include <linux/workqueue.h>
10
11typedef void (*work_func_t)(struct work_struct *work);
12typedef void (*compat_work_func_t)(void *work);
13static inline void (INIT_WORK)(struct work_struct *work, work_func_t func)
14{
15 INIT_WORK(work, (compat_work_func_t)func, work);
16}
17#undef INIT_WORK
18
19#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) */
20
21#endif /* LINUX_26_20_COMPAT_H */