Permalink
Browse files

ndas:

 * use (a more recent) open-source driver for all boxes & kernel-versions
 * all kernel-versions have been compile-tested, versions 2.6.28 & 2.6.32 have also been tested at run-time (thanks to [http://www.ip-phone-forum.de/showthread.php?t=265339 RomMon] for that)
 * refs #465


git-svn-id: file:///var/svn/freetz/trunk@11464 149334a1-2f27-0410-a3b9-fc62619ac1e6
  • Loading branch information...
1 parent 927f78d commit fe02c9d05fbd0f152e884470bba908b5f04b5da5 er13 committed Dec 25, 2013
View
4 kernel/Config.in.modules
@@ -30,21 +30,17 @@ config FREETZ_MODULE_xvmalloc
default n
menu "ndas"
- depends on FREETZ_PACKAGE_NDAS_AVAILABLE
config FREETZ_MODULE_ndas_block
bool "ndas_block.ko"
- depends on FREETZ_PACKAGE_NDAS_AVAILABLE
default n
config FREETZ_MODULE_ndas_core
bool "ndas_core.ko"
- depends on FREETZ_PACKAGE_NDAS_AVAILABLE
default n
config FREETZ_MODULE_ndas_sal
bool "ndas_sal.ko"
- depends on FREETZ_PACKAGE_NDAS_AVAILABLE
default n
endmenu
View
11 make/ndas/Config.in
@@ -1,16 +1,5 @@
-config FREETZ_PACKAGE_NDAS_OPEN_SOURCE_AVAILABLE
- bool
- default y if FREETZ_KERNEL_VERSION_2_6_28_MIN
- default n
-
-config FREETZ_PACKAGE_NDAS_AVAILABLE
- bool
- default y if FREETZ_TARGET_ARCH_LE || FREETZ_PACKAGE_NDAS_OPEN_SOURCE_AVAILABLE
- default n
-
config FREETZ_PACKAGE_NDAS
bool "ndas (binary only)"
- depends on FREETZ_PACKAGE_NDAS_AVAILABLE
select FREETZ_MODULE_ndas_block
select FREETZ_MODULE_ndas_core
select FREETZ_MODULE_ndas_sal
View
29 make/ndas/ndas.mk
@@ -1,18 +1,11 @@
-ifeq ($(strip $(FREETZ_PACKAGE_NDAS_OPEN_SOURCE_AVAILABLE)),y)
$(call PKG_INIT_BIN, 1aaf88acd0)
$(PKG)_SOURCE:=$(pkg)-$($(PKG)_VERSION).tar.xz
$(PKG)_SITE:=git@https://github.com/iocellnetworks/ndas4linux.git
-$(PKG)_CONDITIONAL_PATCHES+=open_source
-$(PKG)_PRELIMINARY_BUILD_DIR:=$($(PKG)_DIR)/$(KERNEL_VERSION)
-$(PKG)_BUILD_DIR:=$($(PKG)_PRELIMINARY_BUILD_DIR)/build_freetz/ndas-$(KERNEL_VERSION)
-else
-$(call PKG_INIT_BIN, 1.1-22)
-$(PKG)_SOURCE:=$(pkg)-$($(PKG)_VERSION).mipsel.tar.bz2
-$(PKG)_SOURCE_MD5:=f6b5d28b638ac074f54d404e4c136d5e
-$(PKG)_SITE:=http://freetz.magenbrot.net
-$(PKG)_CONDITIONAL_PATCHES+=closed_source
-$(PKG)_BUILD_DIR:=$($(PKG)_DIR)
-endif
+
+$(PKG)_KERNEL_VERSION:=$(call GET_MAJOR_VERSION,$(KERNEL_VERSION),3)
+
+$(PKG)_PRELIMINARY_BUILD_DIR:=$($(PKG)_DIR)/2.6.32
+$(PKG)_BUILD_DIR:=$($(PKG)_PRELIMINARY_BUILD_DIR)/build_freetz/ndas-$($(PKG)_KERNEL_VERSION)
$(PKG)_BINARY_BUILD_DIR:=$($(PKG)_BUILD_DIR)/ndasadmin
$(PKG)_BINARY_TARGET_DIR:=$($(PKG)_DEST_DIR)/usr/bin/ndasadmin
@@ -25,11 +18,11 @@ $(PKG)_DEPENDS_ON := kernel
$(PKG)_REBUILD_SUBOPTS += FREETZ_KERNEL_VERSION
-NDAS_OPTIONS:= \
+$(PKG)_OPTIONS := \
NDAS_KERNEL_PATH="$(FREETZ_BASE_DIR)/$(KERNEL_SOURCE_DIR)" \
- NDAS_KERNEL_VERSION=$(strip $(FREETZ_KERNEL_VERSION)) \
+ NDAS_KERNEL_VERSION="$(NDAS_KERNEL_VERSION)" \
NDAS_KERNEL_ARCH=$(call qstrip,$(FREETZ_TARGET_ARCH)) \
- NDAS_VER_BUILD=$(word 3,$(subst .,$(_space),$(KERNEL_VERSION))) \
+ NDAS_VER_BUILD=$(word 3,$(subst .,$(_space),$(NDAS_KERNEL_VERSION))) \
NDAS_CROSS_COMPILE=$(TARGET_CROSS) \
NDAS_CROSS_COMPILE_UM=$(TARGET_CROSS) \
NDAS_EXTRA_CFLAGS="-mlong-calls -Wno-unused-but-set-variable -Wno-unused-function" \
@@ -42,8 +35,7 @@ $(PKG_UNPACKED)
$(PKG_CONFIGURED_NOP)
$($(PKG)_DIR)/.exported: $($(PKG)_DIR)/.configured
-ifeq ($(strip $(FREETZ_PACKAGE_NDAS_OPEN_SOURCE_AVAILABLE)),y)
- ln -sfT 2.6.32 $(NDAS_DIR)/2.6.28
+ $(RM) -r $(NDAS_PRELIMINARY_BUILD_DIR)/platform/linux/tarball-{linux,trunk}
touch $(NDAS_PRELIMINARY_BUILD_DIR)/arch/vendor/freetz.mk
$(SUBMAKE) -C $(NDAS_PRELIMINARY_BUILD_DIR) \
$(NDAS_OPTIONS) \
@@ -63,7 +55,6 @@ ifeq ($(strip $(FREETZ_PACKAGE_NDAS_OPEN_SOURCE_AVAILABLE)),y)
nxpo-sio=y \
nxpo-uni=y \
all
-endif
touch $@
$($(PKG)_BINARY_BUILD_DIR): $($(PKG)_DIR)/.configured | $($(PKG)_DIR)/.exported
@@ -92,7 +83,7 @@ $(pkg)-precompiled: $($(PKG)_BINARY_TARGET_DIR) $($(PKG)_MODULES_TARGET_DIR)
$(pkg)-clean:
-$(SUBMAKE) -C $(NDAS_BUILD_DIR) $(NDAS_OPTIONS) clean
- $(RM) $(NDAS_DIR)/.exported $(NDAS_DIR)/2.6.28
+ $(RM) $(NDAS_DIR)/.exported
$(pkg)-uninstall:
$(RM) $(NDAS_BINARY_TARGET_DIR) $(NDAS_MODULES_TARGET_DIR)
View
0 .../patches/open_source/050-SLOT_R_fix.patch → ...ches/010-SLOT_R_fix.backport-2.6.42.patch
File renamed without changes.
View
26 ...patches/open_source/040-local_mutex.patch → ...hes/020-local_mutex.backport-2.6.42.patch
@@ -1,39 +1,49 @@
--- 2.6.32/platform/linux/tarball-tag/sal/io.c
+++ 2.6.32/platform/linux/tarball-tag/sal/io.c
-@@ -41,7 +41,8 @@
+@@ -41,7 +41,11 @@
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/ide.h>
--#include <linux/smp_lock.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+#include <linux/mutex.h>
-+
++#else
+ #include <linux/smp_lock.h>
++#endif
#include <linux/time.h>
#include "sal/sync.h"
-@@ -54,6 +55,8 @@
+@@ -54,6 +58,10 @@
#include "linux_ver.h" // SAL_HZ
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+DEFINE_MUTEX(fs_mutex);
++#endif
+
NDAS_SAL_API sal_file sal_file_open(const char * filename, int flags, int mode)
{
int linux_flags = 0;
-@@ -95,7 +98,7 @@
+@@ -95,7 +103,11 @@
int size32;
#endif
-- lock_kernel();
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+ mutex_lock(&fs_mutex);
++#else
+ lock_kernel();
++#endif
if (filp->f_dentry &&
filp->f_dentry->d_inode &&
-@@ -158,7 +161,7 @@
+@@ -158,7 +170,11 @@
} else {
ret = FALSE;
}
-- unlock_kernel();
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+ mutex_unlock(&fs_mutex);
++#else
+ unlock_kernel();
++#endif
return ret;
}
View
0 ...v_register_signal_shutdown_failures.patch → ...l_shutdown_failures.backport-2.6.43.patch
File renamed without changes.
View
0 ...s/open_source/070-consistent_CFLAGS.patch → .../ndas/patches/100-consistent_CFLAGS.patch
File renamed without changes.
View
0 ...ches/open_source/010-nxp-ver-string.patch → make/ndas/patches/110-nxp-ver-string.patch
File renamed without changes.
View
0 ...tches/open_source/020-optional_scsi.patch → make/ndas/patches/120-optional_scsi.patch
File renamed without changes.
View
0 ...as/patches/open_source/030-no_debug.patch → make/ndas/patches/130-no_debug.patch
File renamed without changes.
View
0 ...pen_source/060-REVERSE_BYTES_32_fix.patch → ...as/patches/140-REVERSE_BYTES_32_fix.patch
File renamed without changes.
View
38 make/ndas/patches/150-class_device_create.patch
@@ -0,0 +1,38 @@
+--- 2.6.32/platform/linux/tarball-tag/inc/linux_ver.h
++++ 2.6.32/platform/linux/tarball-tag/inc/linux_ver.h
+@@ -199,6 +199,13 @@
+ sock_create(family, type, protocol, res)
+ #endif
+
++/* In 2.6.13 and 2.6.14 kernels class_device_create() had different prototype. */
++#if (KERNEL_VERSION(2,6,12) < LINUX_VERSION_CODE) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
++#define ndas_class_device_create(cls, parent, devt, device, fmt) class_device_create(cls, devt, device, fmt)
++#else
++#define ndas_class_device_create(cls, parent, devt, device, fmt) class_device_create(cls, parent, devt, device, fmt)
++#endif
++
+ #if LINUX_VERSION_25_ABOVE
+ #define GENDISK_MAX_DISKNAME sizeof(((struct gendisk*)0)->disk_name)
+ #define GENDISK_MAX_DDEVFSNAME sizeof(((struct gendisk*)0)->devfs_name)
+--- 2.6.32/platform/linux/tarball-tag/block/ctrldev.c
++++ 2.6.32/platform/linux/tarball-tag/block/ctrldev.c
+@@ -1151,7 +1151,7 @@
+ MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR),
+ NULL, "ndas");
+ #else
+- class_device_create(ndas_ctrldev_class, NULL,
++ ndas_class_device_create(ndas_ctrldev_class, NULL,
+ MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR),
+ NULL, "ndas");
+ #endif //#if LINUX_VERSION_HAS_DEVICE_CREATE
+--- 2.6.32/platform/linux/tarball-tag/scsi/ctrldev.c
++++ 2.6.32/platform/linux/tarball-tag/scsi/ctrldev.c
+@@ -1025,7 +1025,7 @@
+ MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR),
+ NULL, "ndas");
+ #else
+- class_device_create(ndas_ctrldev_class, NULL,
++ ndas_class_device_create(ndas_ctrldev_class, NULL,
+ MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR),
+ NULL, "ndas");
+ #endif //#if LINUX_VERSION_HAS_DEVICE_CREATE
View
30 make/ndas/patches/closed_source/010-class_device_create.patch
@@ -1,30 +0,0 @@
---- block/ctrldev.c
-+++ block/ctrldev.c
-@@ -1083,6 +1083,18 @@
- #endif
- #endif
-
-+/*
-+ * In 2.6.13 and 2.6.14 kernels class_device_create() had different prototype.
-+ */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && \
-+ LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)
-+#define ndas_class_device_create(cls, parent, devt, device, fmt) \
-+ class_device_create(cls, devt, device, fmt)
-+#else
-+#define ndas_class_device_create(cls, parent, devt, device, fmt) \
-+ class_device_create(cls, parent, devt, device, fmt)
-+#endif
-+
- int ndas_ctrldev_init(void)
- {
- int ret = 0;
-@@ -1118,7 +1130,7 @@
- return PTR_ERR(ndas_ctrldev_class);
- }
-
-- class_device_create(ndas_ctrldev_class, NULL,
-+ ndas_class_device_create(ndas_ctrldev_class, NULL,
- MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR),
- NULL, "ndas");
- #else

0 comments on commit fe02c9d

Please sign in to comment.