1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-09-26 22:31:11 +02:00

ltq-ifxos: update to 1.7.1

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
[fix warnings, switch to tag tarball, update patches]
Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
Jan Hoffmann 2021-10-28 18:56:13 +02:00 committed by Hauke Mehrtens
parent 5ee1e04517
commit 9d878d8422
6 changed files with 34 additions and 234 deletions

View File

@ -6,13 +6,17 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=lib_ifxos
PKG_VERSION:=1.5.19
PKG_RELEASE:=4
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)
PKG_HASH:=ed7fe39311d7a4a13d23ed0ae2445c0d825b472b5a98da9b72bcaabcf5ed2d5f
PKG_NAME:=ifxos
PKG_VERSION:=1.7.1
PKG_RELEASE:=$(AUTORELEASE)
UGW_VERSION=8.5.2.10
UGW_BASENAME=$(PKG_NAME)-ugw_$(UGW_VERSION)
PKG_SOURCE:=$(UGW_BASENAME).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(UGW_BASENAME)
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/$(PKG_NAME)/-/archive/ugw_$(UGW_VERSION)/
PKG_HASH:=055a1f5eab0abfaac34ac7b1613b93ec341fe9ae8462cb11c36c2b0989ce0ca7
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0 BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
@ -45,7 +49,7 @@ ifdef CONFIG_TARGET_lantiq
$(INSTALL_DIR) $(1)/usr/{lib,include/ifxos}
$(CP) $(PKG_BUILD_DIR)/src/include/* $(1)/usr/include/ifxos
mkdir -p $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/libifxos.a $(1)/usr/lib/libifxos.a
$(CP) $(PKG_BUILD_DIR)/src/.libs/libifxos.a $(1)/usr/lib/libifxos.a
endef
endif

View File

@ -1,24 +1,10 @@
--- 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;
--- a/src/include/linux/ifxos_linux_common.h
+++ b/src/include/linux/ifxos_linux_common.h
@@ -49,6 +49,7 @@
IFX Linux adaptation - Includes (Linux Kernel)
========================================================================= */
#include <linux/kernel.h>
+#include <linux/version.h>
#include <asm/byteorder.h>
/**
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;
}
/* ============================================================================

View File

@ -1,18 +1,18 @@
--- a/src/linux/ifxos_linux_copy_user_space_drv.c
+++ b/src/linux/ifxos_linux_copy_user_space_drv.c
@@ -29,7 +29,7 @@
#ifdef MODULE
#include <linux/module.h>
#endif
--- a/src/linux/ifxos_linux_socket_drv.c
+++ b/src/linux/ifxos_linux_socket_drv.c
@@ -28,7 +28,7 @@
#include <linux/net.h>
#include <linux/fs.h>
#include <linux/inet.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include "ifx_types.h"
#include "ifxos_rt_if_check.h"
--- a/src/linux/ifxos_linux_socket_drv.c
+++ b/src/linux/ifxos_linux_socket_drv.c
--- a/src/linux/ifxos_linux_socket_ipv6_drv.c
+++ b/src/linux/ifxos_linux_socket_ipv6_drv.c
@@ -25,7 +25,7 @@
#endif
#include <linux/version.h>
#include <linux/in.h>
#include <linux/net.h>
-#include <asm/uaccess.h>

View File

@ -1,6 +1,6 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -45,8 +45,6 @@ endif !HAVE_GCC
@@ -48,8 +48,6 @@ endif !HAVE_GCC
if ENABLE_DEBUG
used_gcc_cflags += -O1 -g

View File

@ -1,119 +1,3 @@
--- a/src/linux/ifxos_linux_thread_drv.c
+++ b/src/linux/ifxos_linux_thread_drv.c
@@ -38,6 +38,7 @@
#include <linux/smp_lock.h>
#endif
#include <linux/signal.h>
+#include <linux/kthread.h>
#include "ifx_types.h"
@@ -70,10 +71,6 @@
#if ( defined(IFXOS_HAVE_THREAD) && (IFXOS_HAVE_THREAD == 1) )
-IFXOS_STATIC IFX_int32_t IFXOS_KernelThreadStartup(
- IFXOS_ThreadCtrl_t *pThrCntrl);
-
-
/* ============================================================================
IFX Linux adaptation - Kernel Thread handling
========================================================================= */
@@ -98,9 +95,9 @@ IFXOS_STATIC IFX_int32_t IFXOS_KernelThr
- IFX_SUCCESS on success
- IFX_ERROR on error
*/
-IFXOS_STATIC IFX_int32_t IFXOS_KernelThreadStartup(
- IFXOS_ThreadCtrl_t *pThrCntrl)
+int IFXOS_KernelThreadStartup(void *data)
{
+ IFXOS_ThreadCtrl_t *pThrCntrl = (IFXOS_ThreadCtrl_t*) data;
IFX_int32_t retVal = IFX_ERROR;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
struct task_struct *kthread = current;
@@ -141,7 +138,7 @@ IFXOS_STATIC IFX_int32_t IFXOS_KernelThr
/* let others run */
unlock_kernel();
#else
- daemonize(pThrCntrl->thrParams.pName);
+ //daemonize(pThrCntrl->thrParams.pName);
/* Enable signals in Kernel >= 2.6 */
allow_signal(SIGKILL);
@@ -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, 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/linux/ifxos_linux_thread.h
+++ b/src/include/linux/ifxos_linux_thread.h
@@ -152,7 +152,7 @@ typedef struct
IFXOS_ThreadFunction_t pThrFct;
/** Kernel thread process ID */
- IFX_int32_t tid;
+ struct task_struct *tid;
/** requested kernel thread priority */
IFX_int32_t nPriority;
--- a/src/linux/ifxos_linux_socket_drv.c
+++ b/src/linux/ifxos_linux_socket_drv.c
@@ -19,6 +19,7 @@
/* ============================================================================
IFX Linux adaptation - Global Includes - Kernel
========================================================================= */
+#include <linux/version.h>
#include <linux/kernel.h>
#ifdef MODULE
#include <linux/module.h>
@@ -166,23 +167,33 @@ IFX_int_t IFXOS_SocketSendTo(
IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
IFXOS_RETURN_IF_ARG_LE_ZERO(bufSize_byte, IFX_ERROR);
+ iov.iov_base = pBuffer;
+ iov.iov_len = (unsigned int) bufSize_byte;
+
msg.msg_name = (void *) pSocAddr;
msg.msg_namelen = sizeof(IFXOS_sockAddr_t);
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
msg.msg_control = IFX_NULL;
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
- msg.msg_iov->iov_base = pBuffer;
- msg.msg_iov->iov_len = (unsigned int) bufSize_byte;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+#else
+ iov_iter_init(&msg.msg_iter, WRITE, &iov, 1, bufSize_byte);
+#endif
/* Modify address limitation which is used if user space is calling
kernel space, otherwise sock_sendmsg() will fail.*/
old_fs = get_fs();
set_fs(KERNEL_DS);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
ret = sock_sendmsg((struct socket *) socFd, &msg, bufSize_byte);
+#else
+ ret = sock_sendmsg((struct socket *) socFd, &msg);
+#endif
+
set_fs(old_fs);
return ret;
--- a/src/linux/ifxos_linux_memory_map_drv.c
+++ b/src/linux/ifxos_linux_memory_map_drv.c
@@ -25,6 +25,7 @@
@ -124,28 +8,8 @@
#include <linux/kernel.h>
#ifdef MODULE
#include <linux/module.h>
@@ -87,6 +88,7 @@ IFX_int32_t IFXOS_Phy2VirtMap(
IFXOS_RETURN_IF_POINTER_NOT_NULL(*ppVirtAddr, IFX_ERROR);
IFXOS_RETURN_IF_ARG_LE_ZERO(addrRangeSize_byte, IFX_ERROR);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
if ( check_mem_region(physicalAddr, addrRangeSize_byte) )
{
IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
@@ -98,10 +100,25 @@ IFX_int32_t IFXOS_Phy2VirtMap(
/* can't fail */
request_mem_region(physicalAddr, addrRangeSize_byte, pName);
+#else
+ if ( !request_mem_region(physicalAddr, addrRangeSize_byte, pName) )
+ {
+ IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
+ ("IFXOS: ERROR Phy2Virt map, region request - addr 0x%08lX (size 0x%lX) not free" IFXOS_CRLF,
+ physicalAddr, addrRangeSize_byte));
+
+ return IFX_ERROR;
+ }
+#endif
@@ -97,8 +98,13 @@ IFX_int32_t IFXOS_Phy2VirtMap(
}
/* remap memory (not cache able): physical --> virtual */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
@ -157,4 +21,4 @@
+
if (pVirtAddr == IFX_NULL)
{
IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,

View File

@ -1,54 +0,0 @@
From 7d52945b0b261c54ec736ecc435936c5fb8b81a4 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Thu, 30 Nov 2017 11:07:12 +0800
Subject: [PATCH] Fix app compilation failure from inclusion of wrong headers
Compiling against glibc can fail with the following errors
In file included from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl-linux.h:321:0,
from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl.h:104,
from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/fcntl.h:35,
from linux/ifxos_linux_device_access_appl.c:30:
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:12:2: error: unknown type name '__s16'
__s16 l_type;
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:13:2: error: unknown type name '__s16'
__s16 l_whence;
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:14:2: error: unknown type name '__s64'
__s64 l_start;
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:15:2: error: unknown type name '__s64'
__s64 l_len; /* len == 0 means until end of file */
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:16:2: error: unknown type name '__s32'
__s32 l_sysid;
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:17:2: error: unknown type name '__u32'
__u32 l_pid;
^
/home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:18:2: error: unknown type name '__s32'
__s32 l_pad[4]; /* reserved area */
^
Makefile:1945: recipe for target 'libifxos_a-ifxos_linux_device_access_appl.o' failed
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1196
---
src/Makefile.am | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,11 +14,7 @@ lib_LIBRARIES = libifxos.a
AM_CPPFLAGS = \
-I@srcdir@\
- -I@srcdir@/include \
- -I@KERNEL_INCL_PATH@ \
- -I@KERNEL_BUILD_PATH@/include \
- -I@KERNEL_BUILD_PATH@/include2 \
- -I$(TARGET_INCL_PATH)
+ -I@srcdir@/include
if HAVE_GCC