[lantiq voice]
[openwrt/svn-archive/archive.git] / package / ltq-tapi / patches / 001-portability.patch
1 --- a/src/Makefile.am
2 +++ b/src/Makefile.am
3 @@ -149,7 +149,7 @@ if KERNEL_2_6
4 drv_tapi_OBJS = "$(subst .c,.o, $(drv_tapi_SOURCES))"
5
6 drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA_DIST)
7 - @echo -e "Making Linux 2.6.x kernel object"
8 + @echo "Making Linux 2.6.x kernel object"
9 @for f in $(drv_tapi_SOURCES) ; do \
10 if test ! -e $(PWD)/$$f; then \
11 echo " LN $$f" ; \
12 @@ -157,10 +157,10 @@ drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA
13 ln -s @abs_srcdir@/$$f $(PWD)/$$f; \
14 fi; \
15 done;
16 - @echo -e "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
17 - @echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
18 - @echo -e "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
19 - @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
20 + @echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
21 + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
22 + @echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)" >> $(PWD)/Kbuild
23 + @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
24 $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
25
26 clean-generic:
27 --- a/configure.in
28 +++ b/configure.in
29 @@ -128,7 +128,7 @@ dnl Set kernel build path
30 AC_ARG_ENABLE(kernelbuild,
31 AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path),
32 [
33 - if test -r $enableval/include/linux/autoconf.h; then
34 + if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
35 AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
36 else
37 AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
38 --- a/src/drv_tapi_linux.h
39 +++ b/src/drv_tapi_linux.h
40 @@ -24,6 +24,7 @@
41 #include <linux/version.h>
42 #include <linux/interrupt.h> /* in_interrupt() */
43 #include <linux/delay.h> /* mdelay - udelay */
44 +#include <linux/workqueue.h> /* work_struct */
45 #include <asm/poll.h> /* POLLIN, POLLOUT */
46
47 #include "ifx_types.h" /* ifx type definitions */
48 --- a/src/drv_tapi_linux.c
49 +++ b/src/drv_tapi_linux.c
50 @@ -55,7 +55,7 @@
51 #include <linux/sched.h>
52 #undef CONFIG_DEVFS_FS
53 #ifndef UTS_RELEASE
54 - #include "linux/utsrelease.h"
55 + #include <utsrelease.h>
56 #endif /* UTC_RELEASE */
57 #else
58 #include <linux/tqueue.h>
59 --- a/src/drv_tapi_linux.c
60 +++ b/src/drv_tapi_linux.c
61 @@ -47,6 +47,7 @@
62 #include <linux/errno.h>
63 #include <asm/uaccess.h> /* copy_from_user(), ... */
64 #include <asm/byteorder.h>
65 +#include <linux/smp_lock.h> /* lock_kernel() */
66 #include <asm/io.h>
67
68 #ifdef LINUX_2_6
69 @@ -55,12 +56,11 @@
70 #include <linux/sched.h>
71 #undef CONFIG_DEVFS_FS
72 #ifndef UTS_RELEASE
73 - #include <utsrelease.h>
74 + #include <generated/utsrelease.h>
75 #endif /* UTC_RELEASE */
76 #else
77 #include <linux/tqueue.h>
78 #include <linux/sched.h>
79 - #include <linux/smp_lock.h> /* lock_kernel() */
80 #endif /* LINUX_2_6 */
81
82 #include "drv_tapi.h"
83 @@ -3600,7 +3600,11 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
84 flag and released after the down() call. */
85 lock_kernel();
86 mb();
87 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
88 kill_proc(pThrCntrl->tid, SIGKILL, 1);
89 +#else
90 + kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
91 +#endif
92 /* release the big kernel lock */
93 unlock_kernel();
94 wait_for_completion (&pThrCntrl->thrCompletion);