source: branches/backfire/package/ltq-tapi/patches/000-portability.patch @ 27547

Last change on this file since 27547 was 27547, checked in by blogic, 5 years ago

adds lantiq packages/drivers

File size: 3.2 KB
  • src/Makefile.am

    a b if KERNEL_2_6 
    154154drv_tapi_OBJS = "$(subst .c,.o, $(drv_tapi_SOURCES))" 
    155155 
    156156drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA_DIST) 
    157         @echo -e "Making Linux 2.6.x kernel object" 
     157        @echo "Making Linux 2.6.x kernel object" 
    158158        @for f in $(drv_tapi_SOURCES) ; do \ 
    159159                if test ! -e $(PWD)/$$f; then \ 
    160160                        echo "  LN      $$f" ; \ 
    drv_tapi.ko: $(drv_tapi_SOURCES) $(EXTRA 
    162162                        ln -s @abs_srcdir@/$$f $(PWD)/$$f; \ 
    163163                fi; \ 
    164164        done; 
    165         @echo -e "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild 
    166         @echo -e "obj-m := $(subst .ko,.o,$@)"                  >> $(PWD)/Kbuild 
    167         @echo -e "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)"       >> $(PWD)/Kbuild 
    168         @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H  $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)"    >> $(PWD)/Kbuild 
     165        @echo "# drv_tapi: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild 
     166        @echo "obj-m := $(subst .ko,.o,$@)"                     >> $(PWD)/Kbuild 
     167        @echo "$(subst .ko,,$@)-y := $(drv_tapi_OBJS)"  >> $(PWD)/Kbuild 
     168        @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H  $(CFLAGS) $(drv_tapi_CFLAGS) $(INCLUDES)"       >> $(PWD)/Kbuild 
    169169        $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules 
    170170 
    171171clean-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  
    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 "linux/utsrelease.h" 
     59#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) 
     60#   include <linux/utsrelease.h> 
     61#else 
     62#   include <generated/utsrelease.h> 
     63#endif 
    5964   #endif /* UTC_RELEASE */ 
    6065#else 
    6166   #include <linux/tqueue.h> 
    IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre 
    37183723            flag and released after the down() call. */ 
    37193724         lock_kernel(); 
    37203725         mb(); 
     3726#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) 
    37213727         kill_proc(pThrCntrl->tid, SIGKILL, 1); 
     3728#else 
     3729         kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1); 
     3730#endif 
    37223731         /* release the big kernel lock */ 
    37233732         unlock_kernel(); 
    37243733         wait_for_completion (&pThrCntrl->thrCompletion); 
Note: See TracBrowser for help on using the repository browser.