source: trunk/package/ltq-tapi/patches/001-portability.patch @ 25275

Last change on this file since 25275 was 25275, checked in by blogic, 6 years ago

[lantiq voice]

  • rename voice package
  • sync with lantiqs release
  • make it work on lantiq kernel
File size: 3.6 KB
  • src/Makefile.am

    a b if KERNEL_2_6 
    149149drv_tapi_OBJS = "$(subst .c,.o, $(drv_tapi_SOURCES))" 
    150150 
    151151drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA_DIST) 
    152         @echo -e "Making Linux 2.6.x kernel object" 
     152        @echo "Making Linux 2.6.x kernel object" 
    153153        @for f in $(drv_tapi_SOURCES) ; do \ 
    154154                if test ! -e $(PWD)/$$f; then \ 
    155155                        echo "  LN      $$f" ; \ 
    drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA 
    157157                        ln -s @abs_srcdir@/$$f $(PWD)/$$f; \ 
    158158                fi; \ 
    159159        done; 
    160         @echo -e "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild 
    161         @echo -e "obj-m := $(subst .ko,.o,$@)"                  >> $(PWD)/Kbuild 
    162         @echo -e "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)"       >> $(PWD)/Kbuild 
    163         @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H  $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)"    >> $(PWD)/Kbuild 
     160        @echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild 
     161        @echo "obj-m := $(subst .ko,.o,$@)"                     >> $(PWD)/Kbuild 
     162        @echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)"  >> $(PWD)/Kbuild 
     163        @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H  $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)"       >> $(PWD)/Kbuild 
    164164        $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules 
    165165 
    166166clean-generic: 
  • configure.in

    a b dnl Set kernel build path 
    128128AC_ARG_ENABLE(kernelbuild, 
    129129        AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path), 
    130130        [ 
    131                 if test -r $enableval/include/linux/autoconf.h; then 
     131                if test -e $enableval/include/linux/autoconf.h  -o -e $enableval/include/generated/autoconf.h; then 
    132132                        AC_SUBST([KERNEL_BUILD_PATH],[$enableval]) 
    133133                else 
    134134                        AC_MSG_ERROR([The kernel build directory is not valid or not configured!]) 
  • src/drv_tapi_linux.h

    a b  
    2424#include <linux/version.h> 
    2525#include <linux/interrupt.h>           /* in_interrupt() */ 
    2626#include <linux/delay.h>               /* mdelay - udelay */ 
     27#include <linux/workqueue.h>           /* work_struct */ 
    2728#include <asm/poll.h>                  /* POLLIN, POLLOUT */ 
    2829 
    2930#include "ifx_types.h"                 /* ifx type definitions */ 
  • src/drv_tapi_linux.c

    a b  
    5555   #include <linux/sched.h> 
    5656   #undef   CONFIG_DEVFS_FS 
    5757   #ifndef UTS_RELEASE 
    58       #include "linux/utsrelease.h" 
     58      #include <utsrelease.h> 
    5959   #endif /* UTC_RELEASE */ 
    6060#else 
    6161   #include <linux/tqueue.h> 
  • src/drv_tapi_linux.c

    a b  
    4747#include <linux/errno.h> 
    4848#include <asm/uaccess.h>               /* copy_from_user(), ... */ 
    4949#include <asm/byteorder.h> 
     50#include <linux/smp_lock.h>         /* lock_kernel() */ 
    5051#include <asm/io.h> 
    5152 
    5253#ifdef LINUX_2_6 
     
    5556   #include <linux/sched.h> 
    5657   #undef   CONFIG_DEVFS_FS 
    5758   #ifndef UTS_RELEASE 
    58       #include <utsrelease.h> 
     59      #include <generated/utsrelease.h> 
    5960   #endif /* UTC_RELEASE */ 
    6061#else 
    6162   #include <linux/tqueue.h> 
    6263   #include <linux/sched.h> 
    63    #include <linux/smp_lock.h>         /* lock_kernel() */ 
    6464#endif /* LINUX_2_6 */ 
    6565 
    6666#include "drv_tapi.h" 
    IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre 
    36003600            flag and released after the down() call. */ 
    36013601         lock_kernel(); 
    36023602         mb(); 
     3603#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) 
    36033604         kill_proc(pThrCntrl->tid, SIGKILL, 1); 
     3605#else 
     3606         kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1); 
     3607#endif 
    36043608         /* release the big kernel lock */ 
    36053609         unlock_kernel(); 
    36063610         wait_for_completion (&pThrCntrl->thrCompletion); 
Note: See TracBrowser for help on using the repository browser.