Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled

This commit is contained in:
domenico
2025-06-24 12:51:15 +02:00
commit 27c9d80f51
10493 changed files with 1885777 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
# Copyright (C) 2009-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ifxos
PKG_VERSION:=1.7.1
PKG_RELEASE:=4
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
PKG_EXTMOD_SUBDIRS:=src
PKG_FIXUP:=autoreconf
PKG_BUILD_FLAGS:=no-mold
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ltq-ifxos
SECTION:=sys
CATEGORY:=Kernel modules
SUBMENU:=Libraries
TITLE:=Lantiq OS abstraction library
URL:=http://www.lantiq.com/
DEPENDS:=@(TARGET_lantiq||TARGET_ipq40xx)
FILES:=$(PKG_BUILD_DIR)/src/drv_ifxos.ko
AUTOLOAD:=$(call AutoLoad,10,drv_ifxos)
endef
CONFIGURE_ARGS += \
ARCH=$(LINUX_KARCH) \
--enable-linux-26 \
--enable-kernelbuild="$(LINUX_DIR)" \
--enable-kernelincl="$(LINUX_DIR)/include" \
--with-kernel-module
define Build/InstallDev
$(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/.libs/libifxos.a $(1)/usr/lib/libifxos.a
endef
$(eval $(call KernelPackage,ltq-ifxos))

View File

@@ -0,0 +1,10 @@
--- 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>
/* ============================================================================

View File

@@ -0,0 +1,33 @@
--- 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_ipv6_drv.c
+++ b/src/linux/ifxos_linux_socket_ipv6_drv.c
@@ -25,7 +25,7 @@
#include <linux/version.h>
#include <linux/in.h>
#include <linux/net.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include "ifx_types.h"
#include "ifxos_rt_if_check.h"
--- a/src/include/linux/ifxos_linux_interrupt.h
+++ b/src/include/linux/ifxos_linux_interrupt.h
@@ -31,7 +31,7 @@
IFX Linux adaptation - Includes
========================================================================= */
#include "ifx_types.h"
-#include <asm/irq.h>
+#include <linux/interrupt.h>
/* ============================================================================
IFX Linux adaptation - supported features

View File

@@ -0,0 +1,19 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,8 +48,6 @@ endif !HAVE_GCC
if ENABLE_DEBUG
used_gcc_cflags += -O1 -g
-else
-used_gcc_cflags += -O3
endif
AM_CFLAGS = \
@@ -92,7 +90,6 @@ endif
drvifxos_additional_cflags=\
-DLINUX \
-D__LINUX__ \
- -O \
-D__KERNEL__ \
-DMODULE \
-DEXPORT_SYMTAB

View File

@@ -0,0 +1,106 @@
--- a/src/linux/ifxos_linux_memory_map_drv.c
+++ b/src/linux/ifxos_linux_memory_map_drv.c
@@ -25,6 +25,7 @@
IFX Linux adaptation - Global Includes - Kernel
========================================================================= */
+#include <linux/version.h>
#include <linux/kernel.h>
#ifdef MODULE
#include <linux/module.h>
@@ -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)
pVirtAddr = (IFX_uint8_t *)ioremap_nocache( physicalAddr,
addrRangeSize_byte );
+#else
+ pVirtAddr = (IFX_uint8_t *)ioremap(physicalAddr, addrRangeSize_byte);
+#endif
+
if (pVirtAddr == IFX_NULL)
{
IFXOS_PRN_USR_ERR_NL( IFXOS, IFXOS_PRN_LEVEL_ERR,
--- a/src/linux/ifxos_linux_socket_drv.c
+++ b/src/linux/ifxos_linux_socket_drv.c
@@ -165,8 +165,12 @@ IFX_int_t IFXOS_SocketRecvFrom(
IFXOS_sockAddr_t *pSocAddr)
{
struct msghdr msg;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
struct iovec iov;
mm_segment_t old_fs;
+#else
+ struct kvec iov;
+#endif
int ret;
IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
@@ -181,6 +185,8 @@ IFX_int_t IFXOS_SocketRecvFrom(
msg.msg_controllen = 0;
msg.msg_flags = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
@@ -200,6 +206,10 @@ IFX_int_t IFXOS_SocketRecvFrom(
#endif
set_fs(old_fs);
+#else
+ ret = kernel_recvmsg (socFd, &msg, &iov, 1, bufSize_byte, 0);
+#endif
+
return ret;
}
@@ -229,8 +239,12 @@ IFX_int_t IFXOS_SocketSendTo(
IFXOS_sockAddr_t *pSocAddr)
{
struct msghdr msg;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
struct iovec iov;
mm_segment_t old_fs;
+#else
+ struct kvec iov;
+#endif
int ret;
IFXOS_RETURN_IF_POINTER_NULL(pBuffer, IFX_ERROR);
@@ -245,6 +259,8 @@ IFX_int_t IFXOS_SocketSendTo(
msg.msg_controllen = 0;
msg.msg_flags = MSG_DONTWAIT;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
@@ -264,6 +280,10 @@ IFX_int_t IFXOS_SocketSendTo(
#endif
set_fs(old_fs);
+#else
+ ret = kernel_sendmsg(socFd, &msg, &iov, 1, bufSize_byte);
+#endif
+
return ret;
}
--- a/src/linux/ifxos_linux_thread_drv.c
+++ b/src/linux/ifxos_linux_thread_drv.c
@@ -154,7 +154,11 @@ IFXOS_STATIC int IFXOS_KernelThreadStart
retVal = pThrCntrl->pThrFct(&pThrCntrl->thrParams);
pThrCntrl->thrParams.bRunning = IFX_FALSE;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0))
+ kthread_complete_and_exit(&pThrCntrl->thrCompletion, (long)retVal);
+#else
complete_and_exit(&pThrCntrl->thrCompletion, (long)retVal);
+#endif
IFXOS_PRN_USR_DBG_NL( IFXOS, IFXOS_PRN_LEVEL_NORMAL,
("EXIT - Kernel Thread Startup <%s>" IFXOS_CRLF,