Initial commit
This commit is contained in:
77
package/kernel/lantiq/ltq-vdsl/Makefile
Normal file
77
package/kernel/lantiq/ltq-vdsl/Makefile
Normal file
@@ -0,0 +1,77 @@
|
||||
# Copyright (C) 2012 OpenWrt.org
|
||||
# Copyright (C) 2015-2016 Lantiq Beteiligungs GmbH & Co KG.
|
||||
#
|
||||
# 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:=ltq-vdsl-vr9
|
||||
PKG_VERSION:=4.17.18.6
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_BASE_NAME:=drv_dsl_cpe_api
|
||||
PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||
PKG_HASH:=b4966a60653acc49254b168c6cc9c49eb36c54548e763617788aa4f252a29f21
|
||||
PKG_LICENSE:=GPL-2.0 BSD-2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_ASLR_PIE:=0
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/ltq-vdsl-vr9
|
||||
TITLE:=vdsl driver
|
||||
SECTION:=sys
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei
|
||||
FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api)
|
||||
endef
|
||||
|
||||
define Package/ltq-vdsl-vr9/description
|
||||
This package contains the Lantiq DSL CPE API driver.
|
||||
|
||||
Supported Devices:
|
||||
- VRX200 Family
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
SHELL="$(BASH)"
|
||||
|
||||
CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
|
||||
--with-max-device="1" \
|
||||
--with-lines-per-device="1" \
|
||||
--with-channels-per-line="1" \
|
||||
--enable-vrx \
|
||||
--enable-vrx-device=vr9 \
|
||||
--enable-ifxos \
|
||||
--enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos" \
|
||||
--enable-driver-include="-I$(STAGING_DIR)/usr/include/vdsl" \
|
||||
--enable-add-drv-cflags="-DMODULE -DINCLUDE_DSL_ATM_PTM_INTERFACE_SUPPORT" \
|
||||
--enable-adsl-led=no \
|
||||
--enable-adsl-mib=no \
|
||||
--enable-dsl-ceoc=no \
|
||||
--enable-linux-26 \
|
||||
--enable-kernelbuild="$(LINUX_DIR)" \
|
||||
--enable-debug-prints=no \
|
||||
ARCH=mips
|
||||
|
||||
CONFIGURE_ARGS += --enable-model=full
|
||||
#CONFIGURE_ARGS += --enable-model=lite
|
||||
#CONFIGURE_ARGS += --enable-model=footprint
|
||||
#CONFIGURE_ARGS += --enable-model=typical
|
||||
#CONFIGURE_ARGS += --enable-model=debug
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/drv_vdsl_cpe_api
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/drv_dsl_cpe*.h $(1)/usr/include/drv_vdsl_cpe_api/
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,ltq-vdsl-vr9))
|
||||
12
package/kernel/lantiq/ltq-vdsl/patches/001-fix-compile.patch
Normal file
12
package/kernel/lantiq/ltq-vdsl/patches/001-fix-compile.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
--- a/src/include/drv_dsl_cpe_os_linux.h
|
||||
+++ b/src/include/drv_dsl_cpe_os_linux.h
|
||||
@@ -33,6 +33,9 @@
|
||||
#endif
|
||||
|
||||
#include <linux/sched.h>
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -244,10 +244,7 @@ else
|
||||
drv_dsl_cpe_api_common_mod_cflags =
|
||||
endif
|
||||
|
||||
-drv_dsl_cpe_api_common_cflags = -DLINUX -D__LINUX__ -D__KERNEL__ -DEXPORT_SYMTAB \
|
||||
- -pipe -Wall -Wformat -Wimplicit -Wunused -Wswitch -Wcomment -Winline \
|
||||
- -Wuninitialized -Wparentheses -Wsign-compare -Wreturn-type \
|
||||
- -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
|
||||
+drv_dsl_cpe_api_common_cflags = -DLINUX -D__LINUX__ -D__KERNEL__ -DEXPORT_SYMTAB
|
||||
|
||||
if DSL_DBG_MAX_LEVEL_SET
|
||||
drv_dsl_cpe_api_common_cflags += -DDSL_DBG_MAX_LEVEL=$(DSL_DBG_MAX_LEVEL_PRE)
|
||||
@@ -257,7 +254,7 @@ endif
|
||||
drv_dsl_cpe_api_target_cflags = $(ADD_DRV_CFLAGS)
|
||||
|
||||
# compile cflags
|
||||
-drv_dsl_cpe_api_compile_cflags = $(EXTRA_DRV_CFLAGS)
|
||||
+drv_dsl_cpe_api_compile_cflags =
|
||||
|
||||
if !KERNEL_2_6
|
||||
# the headerfile of linux kernels 2.6.x contain to much arithmetic
|
||||
@@ -311,7 +308,7 @@ drv_dsl_cpe_api.ko: $(drv_dsl_cpe_api_SO
|
||||
@echo -e "# drv_dsl_cpe_api: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
|
||||
@echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
|
||||
@echo -e "$(subst .ko,,$@)-y := $(drv_dsl_cpe_api_OBJS)" >> $(PWD)/Kbuild
|
||||
- @echo -e "EXTRA_CFLAGS := $(CFLAGS) -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild
|
||||
+ @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include" >> $(PWD)/Kbuild
|
||||
$(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
|
||||
|
||||
clean-generic:
|
||||
96
package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch
Normal file
96
package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch
Normal file
@@ -0,0 +1,96 @@
|
||||
--- a/src/Makefile.in
|
||||
+++ b/src/Makefile.in
|
||||
@@ -117,7 +117,7 @@ POST_UNINSTALL = :
|
||||
|
||||
# the headerfile of linux kernels 2.6.x contain to much arithmetic
|
||||
# with void pointers (which is allowed for gcc!)
|
||||
-@KERNEL_2_6_FALSE@am__append_6 = -Wpointer-arith
|
||||
+@KERNEL_2_6_FALSE@am__append_6 =
|
||||
subdir = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
--- a/src/common/drv_dsl_cpe_os_linux.c
|
||||
+++ b/src/common/drv_dsl_cpe_os_linux.c
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#define DSL_INTERN
|
||||
|
||||
+#include <linux/device.h>
|
||||
#include "drv_dsl_cpe_api.h"
|
||||
#include "drv_dsl_cpe_api_ioctl.h"
|
||||
|
||||
@@ -249,14 +250,7 @@ static DSL_long_t DSL_DRV_Ioctls(DSL_DRV
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
|
||||
- if (pFile->f_dentry != DSL_NULL)
|
||||
- {
|
||||
- pINode = pFile->f_dentry->d_inode;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- pINode = DSL_NULL;
|
||||
- }
|
||||
+ pINode = file_inode(pFile);
|
||||
#endif
|
||||
|
||||
if (pINode == DSL_NULL)
|
||||
@@ -1203,6 +1197,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
|
||||
}
|
||||
#endif
|
||||
|
||||
+static struct class *dsl_class;
|
||||
+static dev_t dsl_devt;
|
||||
+
|
||||
/* Entry point of driver */
|
||||
int __init DSL_ModuleInit(void)
|
||||
{
|
||||
@@ -1241,6 +1238,10 @@ int __init DSL_ModuleInit(void)
|
||||
|
||||
DSL_DRV_DevNodeInit();
|
||||
|
||||
+ dsl_class = class_create(THIS_MODULE, "dsl_cpe_api0");
|
||||
+ dsl_devt = MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0);
|
||||
+ device_create(dsl_class, NULL, dsl_devt, NULL, "dsl_cpe_api0");
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1248,6 +1249,11 @@ void __exit DSL_ModuleCleanup(void)
|
||||
{
|
||||
printk("Module will be unloaded"DSL_DRV_CRLF);
|
||||
|
||||
+ device_destroy(dsl_class, dsl_devt);
|
||||
+ dsl_devt = NULL;
|
||||
+ class_destroy(dsl_class);
|
||||
+ dsl_class = NULL;
|
||||
+
|
||||
unregister_chrdev(nMajorNum, DRV_DSL_CPE_API_DEV_NAME);
|
||||
|
||||
DSL_DRV_Cleanup();
|
||||
--- a/src/device/drv_dsl_cpe_device_vrx.c
|
||||
+++ b/src/device/drv_dsl_cpe_device_vrx.c
|
||||
@@ -5337,6 +5337,7 @@ DSL_Error_t DSL_DRV_DEV_HybridTypeGet(
|
||||
#undef DSL_DBG_BLOCK
|
||||
#define DSL_DBG_BLOCK DSL_DBG_NOTIFICATIONS
|
||||
|
||||
+#if 0
|
||||
DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
|
||||
(
|
||||
DSL_Context_t *pContext,
|
||||
@@ -5384,6 +5385,15 @@ DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignal
|
||||
|
||||
return nErrCode;
|
||||
}
|
||||
+#else
|
||||
+DSL_Error_t DSL_DRV_DEV_MeiTcLayerSignaling
|
||||
+(
|
||||
+ DSL_Context_t *pContext,
|
||||
+ DSL_TcLayerSelection_t nTcLayer)
|
||||
+{
|
||||
+ return DSL_SUCCESS;
|
||||
+}
|
||||
+#endif
|
||||
|
||||
DSL_Error_t DSL_DRV_DEV_MeiShowtimeSignaling
|
||||
(
|
||||
107
package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch
Normal file
107
package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch
Normal file
@@ -0,0 +1,107 @@
|
||||
--- a/src/include/drv_dsl_cpe_pm_core.h
|
||||
+++ b/src/include/drv_dsl_cpe_pm_core.h
|
||||
@@ -1510,9 +1510,9 @@ typedef struct
|
||||
/** Common PM module mutex*/
|
||||
DSL_DRV_Mutex_t pmMutex;
|
||||
/** PM module direction Near-End mutex*/
|
||||
- DSL_DRV_Mutex_t pmNeMutex;
|
||||
+ struct semaphore pmNeMutex;
|
||||
/** PM module direction Far-End mutex*/
|
||||
- DSL_DRV_Mutex_t pmFeMutex;
|
||||
+ struct semaphore pmFeMutex;
|
||||
/** PM module Near-End access mutex*/
|
||||
DSL_DRV_Mutex_t pmNeAccessMutex;
|
||||
/** PM module Far-End access mutex*/
|
||||
--- a/src/pm/drv_dsl_cpe_api_pm.c
|
||||
+++ b/src/pm/drv_dsl_cpe_api_pm.c
|
||||
@@ -220,9 +220,9 @@ DSL_Error_t DSL_DRV_PM_Start(
|
||||
/* init PM module common mutex */
|
||||
DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmMutex);
|
||||
/* init PM module direction Near-End mutex */
|
||||
- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex);
|
||||
+ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex),1);
|
||||
/* init PM module direction Far-End mutex */
|
||||
- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex);
|
||||
+ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex),1);
|
||||
/* init PM module Near-End access mutex */
|
||||
DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeAccessMutex);
|
||||
/* init PM module Far-End access mutex */
|
||||
@@ -592,7 +592,7 @@ DSL_Error_t DSL_DRV_PM_Stop(
|
||||
if( DSL_DRV_PM_CONTEXT(pContext)->pmThreadFe.bRun != DSL_TRUE )
|
||||
{
|
||||
DSL_DEBUG(DSL_DBG_WRN,
|
||||
- (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Near-End thread already stopped"
|
||||
+ (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Far-End thread already stopped"
|
||||
DSL_DRV_CRLF, DSL_DEV_NUM(pContext)));
|
||||
}
|
||||
else
|
||||
--- a/src/pm/drv_dsl_cpe_pm_core.c
|
||||
+++ b/src/pm/drv_dsl_cpe_pm_core.c
|
||||
@@ -1022,7 +1022,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon
|
||||
{
|
||||
if( bLock )
|
||||
{
|
||||
- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) )
|
||||
+ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)))
|
||||
{
|
||||
DSL_DEBUG( DSL_DBG_ERR,
|
||||
(pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!"
|
||||
@@ -1034,14 +1034,14 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon
|
||||
else
|
||||
{
|
||||
/* Unlock PM module NE Mutex*/
|
||||
- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex);
|
||||
+ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( bLock )
|
||||
{
|
||||
- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) )
|
||||
+ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)))
|
||||
{
|
||||
DSL_DEBUG( DSL_DBG_ERR,
|
||||
(pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!"
|
||||
@@ -1053,7 +1053,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon
|
||||
else
|
||||
{
|
||||
/* Unlock PM module FE Mutex*/
|
||||
- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex);
|
||||
+ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1139,7 +1139,7 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_
|
||||
if( !(DSL_DRV_PM_CONTEXT(pContext)->bPmLock) )
|
||||
{
|
||||
/* Lock PM module Near-End Mutex*/
|
||||
- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) )
|
||||
+ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)))
|
||||
{
|
||||
DSL_DEBUG( DSL_DBG_ERR,
|
||||
(pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!"
|
||||
@@ -1148,8 +1148,8 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_
|
||||
return DSL_ERR_SEMAPHORE_GET;
|
||||
}
|
||||
|
||||
- /* Lock PM module Near-End Mutex*/
|
||||
- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) )
|
||||
+ /* Lock PM module Far-End Mutex*/
|
||||
+ if( down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)) )
|
||||
{
|
||||
DSL_DEBUG( DSL_DBG_ERR,
|
||||
(pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!"
|
||||
@@ -1193,10 +1193,10 @@ DSL_Error_t DSL_DRV_PM_UnLock(DSL_Contex
|
||||
if( DSL_DRV_PM_CONTEXT(pContext)->bPmLock )
|
||||
{
|
||||
/* Unlock PM module NE Mutex*/
|
||||
- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex);
|
||||
+ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex));
|
||||
|
||||
/* Unlock PM module FE Mutex*/
|
||||
- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex);
|
||||
+ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex));
|
||||
|
||||
/* Clear bPmLock flag*/
|
||||
DSL_DRV_PM_CONTEXT(pContext)->bPmLock = DSL_FALSE;
|
||||
Reference in New Issue
Block a user