lantiq: ltq-ifxos: fix build warnings
authorJohn Crispin <john@openwrt.org>
Tue, 24 Nov 2015 20:39:59 +0000 (20:39 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 24 Nov 2015 20:39:59 +0000 (20:39 +0000)
This makes the build script use the same configure options as used by
Lantiq  UGW and fixes some warnings and cleans up some of the patches.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
SVN-Revision: 47630

package/kernel/lantiq/ltq-ifxos/Makefile
package/kernel/lantiq/ltq-ifxos/patches/001-warnings.patch [new file with mode: 0644]
package/kernel/lantiq/ltq-ifxos/patches/100-compat.patch

index 9919a9b088c721c2f348c466f3722c644bc05bc7..70fb4da1e082ccf9de87e758a1e8c9d976c3d06e 100644 (file)
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=lib_ifxos
 PKG_VERSION:=1.5.19
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/xdarklight/$(PKG_NAME)/archive/v$(PKG_VERSION)
@@ -31,12 +31,14 @@ define KernelPackage/ltq-ifxos
   AUTOLOAD:=$(call AutoLoad,10,drv_ifxos)
 endef
 
+MAKE_FLAGS+=-s
+
 CONFIGURE_ARGS += \
        ARCH=$(LINUX_KARCH) \
        --enable-linux-26 \
        --enable-kernelbuild="$(LINUX_DIR)" \
        --enable-kernelincl="$(LINUX_DIR)/include" \
-       --enable-add_drv_cflags="-fno-pic -mno-abicalls -mlong-calls -G 0"
+       --with-kernel-module
 
 ifdef CONFIG_TARGET_lantiq
   define Build/InstallDev
diff --git a/package/kernel/lantiq/ltq-ifxos/patches/001-warnings.patch b/package/kernel/lantiq/ltq-ifxos/patches/001-warnings.patch
new file mode 100644 (file)
index 0000000..7894064
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/src/include/linux/ifxos_linux_thread.h
++++ b/src/include/linux/ifxos_linux_thread.h
+@@ -206,7 +206,7 @@ typedef struct
+ /**
+    LINUX User Thread - map the Thread ID.
+ */
+-typedef int    IFXOS_thread_t;
++typedef pthread_t    IFXOS_thread_t;
+ /**
+    LINUX Kernel Process - map the Process ID.
+--- a/src/linux/ifxos_linux_socket_appl.c
++++ b/src/linux/ifxos_linux_socket_appl.c
+@@ -363,8 +363,8 @@ IFX_int_t IFXOS_SocketSendTo(
+    IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
+    IFXOS_RETURN_IF_ARG_LE_ZERO(bufSize_byte, IFX_ERROR);
+-   ret = (IFX_int_t)sendto((int)socFd, (const char*)pBuffer, 
+-              (int)bufSize_byte, 0, pSocAddr, sizeof(IFXOS_sockAddr_t));
++   ret = (IFX_int_t)sendto(socFd, pBuffer, 
++              bufSize_byte, 0, (struct sockaddr *)pSocAddr, sizeof(IFXOS_sockAddr_t));
+    return ret;
+ }
index dcd260ef3fa9b2b0683180e9e26a1644a30bd6b3..80275e6b112453d150a76593840444234ea4b69d 100644 (file)
  
     /* Enable signals in Kernel >= 2.6 */
     allow_signal(SIGKILL);
-@@ -221,9 +218,7 @@ IFX_int32_t IFXOS_ThreadInit(
+@@ -221,9 +218,11 @@ IFX_int32_t IFXOS_ThreadInit(
           init_completion(&pThrCntrl->thrCompletion);
  
           /* start kernel thread via the wrapper function */
 -         pThrCntrl->tid = kernel_thread( (IFXOS_KERNEL_THREAD_StartRoutine)IFXOS_KernelThreadStartup,
 -                        (void *)pThrCntrl,
 -                        IFXOS_DRV_THREAD_OPTIONS);
-+         pThrCntrl->tid = kthread_run(IFXOS_KernelThreadStartup, (void *)pThrCntrl, "ifxos");
++         pThrCntrl->tid = kthread_run(IFXOS_KernelThreadStartup, (void *)pThrCntrl, pThrCntrl->thrParams.pName);
++         if (IS_ERR(pThrCntrl->tid)) {
++            IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
++               ("IFXOS ERROR - Problem creating thread: %li" IFXOS_CRLF, PTR_ERR(pThrCntrl->tid)));
++         }
  
           pThrCntrl->bValid = IFX_TRUE;
  
---- a/src/include/ifxos_thread.h
-+++ b/src/include/ifxos_thread.h
-@@ -111,7 +111,7 @@ typedef struct IFXOS_ThreadParams_s
- /**
-    Function type of the user thread/task function.
- */
--typedef IFX_int32_t (*IFXOS_ThreadFunction_t)(IFXOS_ThreadParams_t *);
-+typedef int (*IFXOS_ThreadFunction_t)(void*);
- /** @} */
 --- a/src/include/linux/ifxos_linux_thread.h
 +++ b/src/include/linux/ifxos_linux_thread.h
 @@ -152,7 +152,7 @@ typedef struct