From bb17a19fcc7f7d10369eed7f6c8662f6e4df9d4b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 17:36:04 +0100 Subject: enable cfgfs and atm - make cfgfs work for ag241 - split mtd to separate package to control dependencies - update linux-atm package to latest upstream - enable atm kernel module building --- package/Config.in | 4 +- package/cfgfs/Config.in | 2 + package/cfgfs/Makefile | 9 +- package/cfgfs/src/mtd.c | 379 --------------------- package/iptables/Config.in | 10 - package/linux-atm/Config.in | 9 +- package/linux-atm/Config.in.lib | 10 + package/linux-atm/Makefile | 8 +- package/linux-atm/patches/patch-src_Makefile_in | 12 +- package/linux-atm/patches/patch-src_led_main_c | 11 - .../linux-atm/patches/patch-src_qgen_Makefile_in | 29 +- package/linux-atm/patches/patch-src_qgen_ql_l_c | 12 - .../linux-atm/patches/patch-src_sigd_Makefile_in | 7 +- package/linux-atm/patches/patch-src_sigd_cfg_l_c | 12 - package/linux-atm/patches/patch-src_sigd_cfg_l_l | 10 + .../linux-atm/patches/patch-src_switch_Makefile_in | 11 + package/linux-atm/patches/patch-src_switch_cfg_l_c | 12 - package/linux-atm/patches/patch-src_switch_cfg_l_l | 10 + .../patches/patch-src_switch_debug_Makefile_in | 7 +- .../patches/patch-src_switch_tcp_Makefile_in | 9 +- .../linux-atm/patches/patch-src_test_Makefile_in | 12 - package/linux-atm/patches/patch-src_test_ispl_l_c | 12 - package/linux-atm/patches/patch-src_test_ttcp_c | 21 -- package/mtd/Config.in | 9 + package/mtd/Makefile | 32 ++ package/mtd/src/mtd.c | 379 +++++++++++++++++++++ 26 files changed, 499 insertions(+), 539 deletions(-) delete mode 100644 package/cfgfs/src/mtd.c create mode 100644 package/linux-atm/Config.in.lib delete mode 100644 package/linux-atm/patches/patch-src_led_main_c delete mode 100644 package/linux-atm/patches/patch-src_qgen_ql_l_c delete mode 100644 package/linux-atm/patches/patch-src_sigd_cfg_l_c create mode 100644 package/linux-atm/patches/patch-src_sigd_cfg_l_l create mode 100644 package/linux-atm/patches/patch-src_switch_Makefile_in delete mode 100644 package/linux-atm/patches/patch-src_switch_cfg_l_c create mode 100644 package/linux-atm/patches/patch-src_switch_cfg_l_l delete mode 100644 package/linux-atm/patches/patch-src_test_Makefile_in delete mode 100644 package/linux-atm/patches/patch-src_test_ispl_l_c delete mode 100644 package/linux-atm/patches/patch-src_test_ttcp_c create mode 100644 package/mtd/Config.in create mode 100644 package/mtd/Makefile create mode 100644 package/mtd/src/mtd.c (limited to 'package') diff --git a/package/Config.in b/package/Config.in index 1cc29c402..c6f714d74 100644 --- a/package/Config.in +++ b/package/Config.in @@ -55,6 +55,7 @@ source "package/dosfstools/Config.in" source "package/e2fsprogs/Config.in" source "package/fuse/Config.in" source "package/mdadm/Config.in" +source "package/mtd/Config.in" source "package/lvm/Config.in" source "package/parted/Config.in" source "package/util-linux-ng/Config.in" @@ -236,6 +237,7 @@ endmenu menu "Firewall / Routing / Bridging" source "package/arpd/Config.in" source "package/bridge-utils/Config.in" +source "package/linux-atm/Config.in" source "package/cutter/Config.in" source "package/ebtables/Config.in" source "package/ether-wake/Config.in" @@ -243,7 +245,6 @@ source "package/iproute2/Config.in" source "package/ipset/Config.in" source "package/iptables/Config.in" source "package/knock/Config.in" -source "package/linux-atm/Config.in" source "package/macchanger/Config.in" source "package/netstat-nat/Config.in" source "package/quagga/Config.in" @@ -407,6 +408,7 @@ source "package/id3lib/Config.in" source "package/libao/Config.in" source "package/libaudiofile/Config.in" source "package/libart/Config.in" +source "package/linux-atm/Config.in.lib" source "package/libcli/Config.in" source "package/curl/Config.in.lib" source "package/libdaemon/Config.in" diff --git a/package/cfgfs/Config.in b/package/cfgfs/Config.in index fcda6c97e..911027433 100644 --- a/package/cfgfs/Config.in +++ b/package/cfgfs/Config.in @@ -5,11 +5,13 @@ config ADK_PACKAGE_CFGFS select BUSYBOX_MD5SUM select BUSYBOX_XARGS select BUSYBOX_FEATURE_SORT_BIG + select ADK_PACKAGE_MTD depends on \ ADK_LINUX_X86_ALIX1C || \ ADK_LINUX_X86_ALIX2D || \ ADK_LINUX_X86_WRAP || \ ADK_LINUX_CRIS_FOXBOARD || \ + ADK_LINUX_MIPS_AG241 || \ ADK_LINUX_MIPS_RB532 default y help diff --git a/package/cfgfs/Makefile b/package/cfgfs/Makefile index 50d571e90..17ab5e6a7 100644 --- a/package/cfgfs/Makefile +++ b/package/cfgfs/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= cfgfs PKG_VERSION:= 1.0.6 -PKG_RELEASE:= 3 +PKG_RELEASE:= 4 PKG_DESCR:= compressed config filesystem PKG_SECTION:= base @@ -21,14 +21,11 @@ BUILD_STYLE:= auto do-configure: mkdir -p ${WRKBUILD} ${CP} ./src/* ${WRKBUILD} - ${TARGET_CC} ${TCPPFLAGS} ${TCFLAGS} -o ${WRKBUILD}/mtd ${WRKBUILD}/mtd.c do-install: ${INSTALL_DIR} ${IDIR_CFGFS}/sbin ${INSTALL_BIN} ${WRKBUILD}/fwcf.sh ${IDIR_CFGFS}/sbin/cfgfs - ${INSTALL_BIN} ${WRKBUILD}/fwcf.helper.out ${IDIR_CFGFS}/sbin/cfgfs.helper -ifeq ($(ARCH),cris) - ${INSTALL_BIN} ${WRKBUILD}/mtd ${IDIR_CFGFS}/sbin/mtd -endif + ${INSTALL_BIN} ${WRKBUILD}/fwcf.helper.out \ + ${IDIR_CFGFS}/sbin/cfgfs.helper include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/cfgfs/src/mtd.c b/package/cfgfs/src/mtd.c deleted file mode 100644 index 6812c5e31..000000000 --- a/package/cfgfs/src/mtd.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * mtd - simple memory technology device manipulation tool - * - * Copyright (c) 2006, 2007 Thorsten Glaser - * Copyright (C) 2005 Waldemar Brodkorb , - * Felix Fietkau - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The code is based on the linux-mtd examples. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define BUFSIZE (16 * 1024) -#define MAX_ARGS 8 - -#define DEBUG - -int mtd_check(char *); -int mtd_unlock(const char *); -int mtd_open(const char *, int); -int mtd_erase(const char *); -int mtd_write(int, const char *, int, bool); -void usage(void) __attribute__((noreturn)); - -char buf[BUFSIZE]; -int buflen; - -int -mtd_check(char *mtd) -{ - struct mtd_info_user mtdInfo; - int fd; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - return 0; - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - return 0; - } - - close(fd); - return 1; -} - -int -mtd_unlock(const char *mtd) -{ - int fd; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdLockInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - mtdLockInfo.start = 0; - mtdLockInfo.length = mtdInfo.size; - if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) { - close(fd); - return 0; - } - - close(fd); - return 0; -} - -int -mtd_open(const char *mtd, int flags) -{ - FILE *fp; - char dev[PATH_MAX]; - int i; - - if ((fp = fopen("/proc/mtd", "r"))) { - while (fgets(dev, sizeof(dev), fp)) { - if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) { - snprintf(dev, sizeof(dev), "/dev/mtd%d", i); - fclose(fp); - return open(dev, flags); - } - } - fclose(fp); - } - - return open(mtd, flags); -} - -int -mtd_erase(const char *mtd) -{ - int fd; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdEraseInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - mtdEraseInfo.length = mtdInfo.erasesize; - - for (mtdEraseInfo.start = 0; - mtdEraseInfo.start < mtdInfo.size; - mtdEraseInfo.start += mtdInfo.erasesize) { - - ioctl(fd, MEMUNLOCK, &mtdEraseInfo); - if(ioctl(fd, MEMERASE, &mtdEraseInfo)) { - fprintf(stderr, "Could not erase MTD device: %s\n", mtd); - close(fd); - exit(1); - } - } - - close(fd); - return 0; - -} - -int -mtd_write(int imagefd, const char *mtd, int quiet, bool do_erase) -{ - int fd, result; - size_t r, w, e; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdEraseInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - r = w = e = 0; - if (!quiet) - fprintf(stderr, " [ ]"); - - for (;;) { - /* buffer may contain data already (from trx check) */ - r = buflen; - r += read(imagefd, buf + buflen, BUFSIZE - buflen); - w += r; - - /* EOF */ - if (r <= 0) break; - - /* need to erase the next block before writing data to it */ - while (do_erase && w > e) { - mtdEraseInfo.start = e; - mtdEraseInfo.length = mtdInfo.erasesize; - - if (!quiet) - fprintf(stderr, "\b\b\b[e]"); - /* erase the chunk */ - if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) { - fprintf(stderr, "Erasing mtd failed: %s\n", mtd); - exit(1); - } - e += mtdInfo.erasesize; - } - - if (!quiet) - fprintf(stderr, "\b\b\b[w]"); - - if ((result = write(fd, buf, r)) < (ssize_t)r) { - if (result < 0) { - fprintf(stderr, "Error writing image.\n"); - exit(1); - } else { - fprintf(stderr, "Insufficient space.\n"); - exit(1); - } - } - - buflen = 0; - } - if (!quiet) - fprintf(stderr, "\b\b\b\b"); - - close(fd); - return 0; -} - -void -usage(void) -{ - fprintf(stderr, "Usage: mtd [ ...] [ ...] \n\n" - "The device is in the format of mtdX (eg: mtd4) or its label.\n" - "mtd recognises these commands:\n" - " unlock unlock the device\n" - " erase erase all data on device\n" - " write |- write (use - for stdin) to device\n" - "Following options are available:\n" - " -q quiet mode (once: no [w] on writing,\n" - " twice: no status messages)\n" - " -e erase before executing the command\n\n" - "Example: To write linux.trx to mtd1 labeled as linux\n" - " mtd write linux.trx linux\n\n"); - exit(1); -} - -int -main(int argc, char **argv) -{ - int ch, i, imagefd = -1, quiet, unlocked; - char *erase[MAX_ARGS], *device; - const char *imagefile = NULL; - enum { - CMD_ERASE, - CMD_WRITE, - CMD_UNLOCK - } cmd; - - erase[0] = NULL; - buflen = 0; - quiet = 0; - - while ((ch = getopt(argc, argv, "Fqe:")) != -1) - switch (ch) { - case 'F': - quiet = 1; - /* FALLTHROUGH */ - case 'q': - quiet++; - break; - case 'e': - i = 0; - while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS)) - i++; - - erase[i++] = optarg; - erase[i] = NULL; - break; - - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc < 2) - usage(); - - if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) { - cmd = CMD_UNLOCK; - device = argv[1]; - } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) { - cmd = CMD_ERASE; - device = argv[1]; - } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) { - cmd = CMD_WRITE; - device = argv[2]; - - if (strcmp(argv[1], "-") == 0) { - imagefile = ""; - imagefd = 0; - } else { - imagefile = argv[1]; - if ((imagefd = open(argv[1], O_RDONLY)) < 0) { - fprintf(stderr, "Couldn't open image file: %s!\n", imagefile); - exit(1); - } - } - - if (!mtd_check(device)) { - fprintf(stderr, "Can't open device for writing!\n"); - exit(1); - } - } else { - usage(); - } - - sync(); - - i = 0; - unlocked = 0; - while (erase[i] != NULL) { - if (quiet < 2) - fprintf(stderr, "Unlocking %s ...\n", erase[i]); - mtd_unlock(erase[i]); - if (quiet < 2) - fprintf(stderr, "Erasing %s ...\n", erase[i]); - mtd_erase(erase[i]); - if (strcmp(erase[i], device) == 0) - /* this means that is unlocked and erased */ - unlocked = 1; - i++; - } - - if (!unlocked) { - if (quiet < 2) - fprintf(stderr, "Unlocking %s ...\n", device); - mtd_unlock(device); - } - - switch (cmd) { - case CMD_UNLOCK: - break; - case CMD_ERASE: - if (unlocked) { - fprintf(stderr, "Already erased: %s\n", device); - break; - } - if (quiet < 2) - fprintf(stderr, "Erasing %s ...\n", device); - mtd_erase(device); - break; - case CMD_WRITE: - if (quiet < 2) - fprintf(stderr, "Writing from %s to %s ... ", imagefile, device); - mtd_write(imagefd, device, quiet, (unlocked == 0)); - if (quiet < 2) - fprintf(stderr, "\n"); - break; - } - - sync(); - return 0; -} diff --git a/package/iptables/Config.in b/package/iptables/Config.in index 5b82599ad..56dd79cc9 100644 --- a/package/iptables/Config.in +++ b/package/iptables/Config.in @@ -21,16 +21,6 @@ config ADK_PACKAGE_IPTABLES http://www.iptables.org/ -config ADK_PACKAGE_IPTABLES_UTILS - prompt "iptables-utils.................. Save and restore utilities" - tristate - default n - depends on ADK_PACKAGE_IPTABLES - help - iptables-save and iptables-restore for Iptables (IPv4) - - http://www.iptables.org/ - config ADK_PACKAGE_IP6TABLES prompt "ip6tables......................... IPv6 firewall administration tool" tristate diff --git a/package/linux-atm/Config.in b/package/linux-atm/Config.in index e89db02d1..3991c679f 100644 --- a/package/linux-atm/Config.in +++ b/package/linux-atm/Config.in @@ -2,20 +2,13 @@ config ADK_COMPILE_LINUX_ATM bool default n help - -config ADK_PACKAGE_LIBATM - prompt "libatm............................. ATM Library for Linux" - tristate - default n - depends on !ADK_HOST_FREEBSD - help - ATM Library for linux config ADK_PACKAGE_BR2684CTL prompt "br2684ctl......................... RFC2684 bridging utility" tristate default n select ADK_PACKAGE_LIBATM + select ADK_COMPILE_LINUX_ATM depends on !ADK_HOST_FREEBSD help Utility for setting up ATM RFC2684 bridging mode. diff --git a/package/linux-atm/Config.in.lib b/package/linux-atm/Config.in.lib new file mode 100644 index 000000000..6c3e92d21 --- /dev/null +++ b/package/linux-atm/Config.in.lib @@ -0,0 +1,10 @@ +config ADK_PACKAGE_LIBATM + prompt "libatm............................ ATM Library for Linux" + tristate + default n + select ADK_COMPILE_LINUX_ATM + select ADK_KPACKAGE_KMOD_ATM + depends on !ADK_HOST_FREEBSD + help + ATM Library for linux. + diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile index edb277885..2f32e7aa8 100644 --- a/package/linux-atm/Makefile +++ b/package/linux-atm/Makefile @@ -4,14 +4,16 @@ include ${TOPDIR}/rules.mk PKG_NAME:= linux-atm -PKG_VERSION:= 2.5.0 +PKG_VERSION:= 2.5.1 PKG_RELEASE:= 1 -PKG_MD5SUM:= 0b45a0e801fac7093ce4b0cadf419965 -PKG_DESCR:= ATM library for linux +PKG_MD5SUM:= 9560b0e1f410a05b849dfdab465dd758 +PKG_DESCR:= ATM library and tools for Linux PKG_SECTION:= libs PKG_URL:= http://linux-atm.sourceforge.net PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=linux-atm/} +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz + PKG_DESCR_1:= br2684ctl PKG_DEPENDS_1:= libatm PKG_SECTION_1:= net diff --git a/package/linux-atm/patches/patch-src_Makefile_in b/package/linux-atm/patches/patch-src_Makefile_in index be1ca26b5..843577f7f 100644 --- a/package/linux-atm/patches/patch-src_Makefile_in +++ b/package/linux-atm/patches/patch-src_Makefile_in @@ -1,11 +1,11 @@ ---- linux-atm-2.5.0.orig/src/Makefile.in 2007-12-29 21:31:30.000000000 +0100 -+++ linux-atm-2.5.0/src/Makefile.in 2009-12-11 15:54:54.000000000 +0100 -@@ -179,7 +179,7 @@ target_os = @target_os@ - target_vendor = @target_vendor@ +--- linux-atm-2.5.1.orig/src/Makefile.in 2009-11-30 17:21:16.000000000 +0100 ++++ linux-atm-2.5.1/src/Makefile.in 2009-12-17 16:12:07.284420844 +0100 +@@ -214,7 +214,7 @@ target_vendor = @target_vendor@ + top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ --SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \ -+SUBDIRS = include lib debug qgen saal sigd maint arpd ilmid man led lane \ +-SUBDIRS = include lib test debug qgen q2931 saal sigd maint arpd ilmid man led lane \ ++SUBDIRS = include lib debug qgen q2931 saal sigd maint arpd ilmid man led lane \ mpoad oamd switch config extra br2684 all: all-recursive diff --git a/package/linux-atm/patches/patch-src_led_main_c b/package/linux-atm/patches/patch-src_led_main_c deleted file mode 100644 index 63c5b5e9b..000000000 --- a/package/linux-atm/patches/patch-src_led_main_c +++ /dev/null @@ -1,11 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/led/main.c 2005-10-06 19:27:50.000000000 +0200 -+++ linux-atm-2.5.0/src/led/main.c 2009-06-01 22:38:27.000000000 +0200 -@@ -31,6 +31,7 @@ - #endif - - /* Global includes */ -+#include - #include - #include - #include diff --git a/package/linux-atm/patches/patch-src_qgen_Makefile_in b/package/linux-atm/patches/patch-src_qgen_Makefile_in index 5c4bf490e..211ff90ff 100644 --- a/package/linux-atm/patches/patch-src_qgen_Makefile_in +++ b/package/linux-atm/patches/patch-src_qgen_Makefile_in @@ -1,33 +1,20 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/qgen/Makefile.in 2007-12-29 21:31:35.000000000 +0100 -+++ linux-atm-2.5.0/src/qgen/Makefile.in 2009-05-29 22:15:30.511416896 +0200 -@@ -92,9 +92,9 @@ AWK = @AWK@ - CC = @CC_FOR_BUILD@ - CCDEPMODE = @CCDEPMODE@ - CC_FOR_BUILD = @CC_FOR_BUILD@ --CFLAGS = @CFLAGS@ -+CFLAGS = -I../include +--- linux-atm-2.5.1.orig/src/qgen/Makefile.in 2009-11-30 17:21:18.000000000 +0100 ++++ linux-atm-2.5.1/src/qgen/Makefile.in 2009-12-17 16:17:11.216421967 +0100 +@@ -91,7 +91,7 @@ CC_FOR_BUILD = @CC_FOR_BUILD@ + CFLAGS = @CFLAGS_FOR_BUILD@ + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -+CPPFLAGS = ++CPPFLAGS = CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ -@@ -116,7 +116,7 @@ INSTALL_DATA = @INSTALL_DATA@ +@@ -114,7 +114,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -+LDFLAGS= ++LDFLAGS = LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -208,7 +208,7 @@ top_srcdir = @top_srcdir@ - qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \ - qgen.h second.c third.c - --qgen_LDADD = -lfl -+qgen_LDADD = - q_dump_SOURCES = common.c - q_dump_LDADD = qd.dump.standalone.o - # FIXME: paulsch: We don't really depend on qd.dump.o or q.out.o here, but this diff --git a/package/linux-atm/patches/patch-src_qgen_ql_l_c b/package/linux-atm/patches/patch-src_qgen_ql_l_c deleted file mode 100644 index ac01bebfb..000000000 --- a/package/linux-atm/patches/patch-src_qgen_ql_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/qgen/ql_l.c 2007-12-24 20:46:13.000000000 +0100 -+++ linux-atm-2.5.0/src/qgen/ql_l.c 2009-05-29 22:10:55.010199430 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_sigd_Makefile_in b/package/linux-atm/patches/patch-src_sigd_Makefile_in index d48ea25e7..faa5a1385 100644 --- a/package/linux-atm/patches/patch-src_sigd_Makefile_in +++ b/package/linux-atm/patches/patch-src_sigd_Makefile_in @@ -1,7 +1,6 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/sigd/Makefile.in 2007-12-29 21:31:36.000000000 +0100 -+++ linux-atm-2.5.0/src/sigd/Makefile.in 2009-05-29 22:17:18.374156943 +0200 -@@ -223,7 +223,7 @@ atmsigd_XTRAS = mess.o $(top_builddir)/s +--- linux-atm-2.5.1.orig/src/sigd/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/sigd/Makefile.in 2009-12-17 16:21:42.636433571 +0100 +@@ -244,7 +244,7 @@ atmsigd_XTRAS = mess.o $(top_builddir)/s $(top_builddir)/src/lib/libatm.la \ $(top_builddir)/src/saal/libsaal.a diff --git a/package/linux-atm/patches/patch-src_sigd_cfg_l_c b/package/linux-atm/patches/patch-src_sigd_cfg_l_c deleted file mode 100644 index 91ace0a91..000000000 --- a/package/linux-atm/patches/patch-src_sigd_cfg_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/sigd/cfg_l.c 2007-12-24 20:46:31.000000000 +0100 -+++ linux-atm-2.5.0/src/sigd/cfg_l.c 2009-05-29 22:21:00.552981945 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_sigd_cfg_l_l b/package/linux-atm/patches/patch-src_sigd_cfg_l_l new file mode 100644 index 000000000..38bde1e58 --- /dev/null +++ b/package/linux-atm/patches/patch-src_sigd_cfg_l_l @@ -0,0 +1,10 @@ +--- linux-atm-2.5.1.orig/src/sigd/cfg_l.l 2004-09-25 13:25:48.000000000 +0200 ++++ linux-atm-2.5.1/src/sigd/cfg_l.l 2009-12-17 16:26:08.528422011 +0100 +@@ -16,6 +16,7 @@ + + #include "cfg_y.h" + ++int yywrap(void) { return 1; } + + static int lineno = 1; + static int token; /* f@#%ing flex doesn't grok return after BEGIN */ diff --git a/package/linux-atm/patches/patch-src_switch_Makefile_in b/package/linux-atm/patches/patch-src_switch_Makefile_in new file mode 100644 index 000000000..4a2981839 --- /dev/null +++ b/package/linux-atm/patches/patch-src_switch_Makefile_in @@ -0,0 +1,11 @@ +--- linux-atm-2.5.1.orig/src/switch/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/Makefile.in 2009-12-17 16:30:47.392542123 +0100 +@@ -249,7 +249,7 @@ target_vendor = @target_vendor@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = . debug tcp ++SUBDIRS = . tcp + noinst_LIBRARIES = libsw.a + swc_SOURCES = swc.c swc.h + swc_LDADD = $(top_builddir)/src/lib/libatm.la diff --git a/package/linux-atm/patches/patch-src_switch_cfg_l_c b/package/linux-atm/patches/patch-src_switch_cfg_l_c deleted file mode 100644 index c0f08dc69..000000000 --- a/package/linux-atm/patches/patch-src_switch_cfg_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/cfg_l.c 2007-12-24 20:47:23.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/cfg_l.c 2009-05-29 22:27:33.024571460 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_switch_cfg_l_l b/package/linux-atm/patches/patch-src_switch_cfg_l_l new file mode 100644 index 000000000..ec00bc66b --- /dev/null +++ b/package/linux-atm/patches/patch-src_switch_cfg_l_l @@ -0,0 +1,10 @@ +--- linux-atm-2.5.1.orig/src/switch/cfg_l.l 2001-10-10 00:33:08.000000000 +0200 ++++ linux-atm-2.5.1/src/switch/cfg_l.l 2009-12-17 16:37:59.408538574 +0100 +@@ -15,6 +15,7 @@ + + #include "cfg_y.h" + ++int yywrap(void) { return 1; } + + static int lineno = 1; + static int token; /* f@#%ing flex doesn't grok return after BEGIN */ diff --git a/package/linux-atm/patches/patch-src_switch_debug_Makefile_in b/package/linux-atm/patches/patch-src_switch_debug_Makefile_in index 34f1db7da..2d8fa57d2 100644 --- a/package/linux-atm/patches/patch-src_switch_debug_Makefile_in +++ b/package/linux-atm/patches/patch-src_switch_debug_Makefile_in @@ -1,7 +1,6 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/debug/Makefile.in 2007-12-29 21:31:36.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/debug/Makefile.in 2009-05-29 22:23:13.656360541 +0200 -@@ -191,7 +191,7 @@ sw_debug_SOURCES = debug.c +--- linux-atm-2.5.1.orig/src/switch/debug/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/debug/Makefile.in 2009-12-17 16:28:31.520542232 +0100 +@@ -199,7 +199,7 @@ sw_debug_SOURCES = debug.c sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \ $(top_builddir)/src/lib/libatm.la diff --git a/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in b/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in index e40a65b23..f23a64405 100644 --- a/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in +++ b/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in @@ -1,12 +1,11 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/tcp/Makefile.in 2007-12-29 21:31:37.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/tcp/Makefile.in 2009-05-29 22:35:16.037506912 +0200 -@@ -191,7 +191,7 @@ sw_tcp_SOURCES = tcpsw.c +--- linux-atm-2.5.1.orig/src/switch/tcp/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/tcp/Makefile.in 2009-12-17 16:33:08.832418828 +0100 +@@ -199,7 +199,7 @@ sw_tcp_SOURCES = tcpsw.c sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \ $(top_builddir)/src/lib/libatm.la -sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl -+sw_tcp_LDADD = $(sw_tcp_XTRAS) ++sw_tcp_LDADD = $(sw_tcp_XTRAS) sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS) EXTRA_DIST = mkfiles README all: all-am diff --git a/package/linux-atm/patches/patch-src_test_Makefile_in b/package/linux-atm/patches/patch-src_test_Makefile_in deleted file mode 100644 index af972e59e..000000000 --- a/package/linux-atm/patches/patch-src_test_Makefile_in +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/Makefile.in 2007-12-29 21:31:37.000000000 +0100 -+++ linux-atm-2.5.0/src/test/Makefile.in 2009-05-29 21:38:58.834444157 +0200 -@@ -275,7 +275,7 @@ br_SOURCES = br.c - bw_SOURCES = bw.c - isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l - isp_XTRAS = $(LDADD) --isp_LDADD = $(isp_XTRAS) -lfl -+isp_LDADD = $(isp_XTRAS) - isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc - window_SOURCES = window.c - CLEANFILES = errnos.inc diff --git a/package/linux-atm/patches/patch-src_test_ispl_l_c b/package/linux-atm/patches/patch-src_test_ispl_l_c deleted file mode 100644 index e7a8af5f2..000000000 --- a/package/linux-atm/patches/patch-src_test_ispl_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/ispl_l.c 2007-12-24 20:46:06.000000000 +0100 -+++ linux-atm-2.5.0/src/test/ispl_l.c 2009-05-29 21:41:01.398113709 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_test_ttcp_c b/package/linux-atm/patches/patch-src_test_ttcp_c deleted file mode 100644 index e436e9d9d..000000000 --- a/package/linux-atm/patches/patch-src_test_ttcp_c +++ /dev/null @@ -1,21 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/ttcp.c 2005-04-18 18:18:28.000000000 +0200 -+++ linux-atm-2.5.0/src/test/ttcp.c 2009-05-29 21:27:32.488378268 +0200 -@@ -331,7 +331,7 @@ int no_check = 0; - /* xmitr */ - if (optind == argc) - goto usage; -- bzero((char *)&sinhim, sizeof(sinhim)); -+ memset((char *)&sinhim, 0, sizeof(sinhim)); - if (atoi(host) > 0 ) { - /* Numeric */ - sinhim.sin_family = AF_INET; -@@ -345,7 +345,7 @@ int no_check = 0; - if ((addr=gethostbyname(host)) == NULL) - err("bad hostname"); - sinhim.sin_family = addr->h_addrtype; -- bcopy(addr->h_addr,(char*)&addr_tmp, addr->h_length); -+ memcpy((char*)&addr_tmp, addr->h_addr, addr->h_length); - #if defined(cray) - sinhim.sin_addr = addr_tmp; - #else diff --git a/package/mtd/Config.in b/package/mtd/Config.in new file mode 100644 index 000000000..aacc297b5 --- /dev/null +++ b/package/mtd/Config.in @@ -0,0 +1,9 @@ +config ADK_PACKAGE_MTD + prompt "mtd................................ mtd utility" + tristate + depends on \ + ADK_LINUX_CRIS_FOXBOARD || \ + ADK_LINUX_MIPS_AG241 + default n + help + MTD utility. diff --git a/package/mtd/Makefile b/package/mtd/Makefile new file mode 100644 index 000000000..67aa1f30c --- /dev/null +++ b/package/mtd/Makefile @@ -0,0 +1,32 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= mtd +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= MTD utility +PKG_SECTION:= base + +WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION} +NO_DISTFILES:= 1 + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,MTD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +do-build: + mkdir -p ${WRKBUILD} + ${CP} ./src/* ${WRKBUILD} + ${TARGET_CC} ${TCPPFLAGS} ${TCFLAGS} -o ${WRKBUILD}/mtd \ + ${WRKBUILD}/mtd.c + +do-install: + ${INSTALL_DIR} ${IDIR_MTD}/sbin + ${INSTALL_BIN} ${WRKBUILD}/mtd ${IDIR_MTD}/sbin/mtd + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c new file mode 100644 index 000000000..6812c5e31 --- /dev/null +++ b/package/mtd/src/mtd.c @@ -0,0 +1,379 @@ +/* + * mtd - simple memory technology device manipulation tool + * + * Copyright (c) 2006, 2007 Thorsten Glaser + * Copyright (C) 2005 Waldemar Brodkorb , + * Felix Fietkau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The code is based on the linux-mtd examples. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define BUFSIZE (16 * 1024) +#define MAX_ARGS 8 + +#define DEBUG + +int mtd_check(char *); +int mtd_unlock(const char *); +int mtd_open(const char *, int); +int mtd_erase(const char *); +int mtd_write(int, const char *, int, bool); +void usage(void) __attribute__((noreturn)); + +char buf[BUFSIZE]; +int buflen; + +int +mtd_check(char *mtd) +{ + struct mtd_info_user mtdInfo; + int fd; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + return 0; + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + return 0; + } + + close(fd); + return 1; +} + +int +mtd_unlock(const char *mtd) +{ + int fd; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdLockInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + mtdLockInfo.start = 0; + mtdLockInfo.length = mtdInfo.size; + if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) { + close(fd); + return 0; + } + + close(fd); + return 0; +} + +int +mtd_open(const char *mtd, int flags) +{ + FILE *fp; + char dev[PATH_MAX]; + int i; + + if ((fp = fopen("/proc/mtd", "r"))) { + while (fgets(dev, sizeof(dev), fp)) { + if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) { + snprintf(dev, sizeof(dev), "/dev/mtd%d", i); + fclose(fp); + return open(dev, flags); + } + } + fclose(fp); + } + + return open(mtd, flags); +} + +int +mtd_erase(const char *mtd) +{ + int fd; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdEraseInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + mtdEraseInfo.length = mtdInfo.erasesize; + + for (mtdEraseInfo.start = 0; + mtdEraseInfo.start < mtdInfo.size; + mtdEraseInfo.start += mtdInfo.erasesize) { + + ioctl(fd, MEMUNLOCK, &mtdEraseInfo); + if(ioctl(fd, MEMERASE, &mtdEraseInfo)) { + fprintf(stderr, "Could not erase MTD device: %s\n", mtd); + close(fd); + exit(1); + } + } + + close(fd); + return 0; + +} + +int +mtd_write(int imagefd, const char *mtd, int quiet, bool do_erase) +{ + int fd, result; + size_t r, w, e; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdEraseInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + r = w = e = 0; + if (!quiet) + fprintf(stderr, " [ ]"); + + for (;;) { + /* buffer may contain data already (from trx check) */ + r = buflen; + r += read(imagefd, buf + buflen, BUFSIZE - buflen); + w += r; + + /* EOF */ + if (r <= 0) break; + + /* need to erase the next block before writing data to it */ + while (do_erase && w > e) { + mtdEraseInfo.start = e; + mtdEraseInfo.length = mtdInfo.erasesize; + + if (!quiet) + fprintf(stderr, "\b\b\b[e]"); + /* erase the chunk */ + if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) { + fprintf(stderr, "Erasing mtd failed: %s\n", mtd); + exit(1); + } + e += mtdInfo.erasesize; + } + + if (!quiet) + fprintf(stderr, "\b\b\b[w]"); + + if ((result = write(fd, buf, r)) < (ssize_t)r) { + if (result < 0) { + fprintf(stderr, "Error writing image.\n"); + exit(1); + } else { + fprintf(stderr, "Insufficient space.\n"); + exit(1); + } + } + + buflen = 0; + } + if (!quiet) + fprintf(stderr, "\b\b\b\b"); + + close(fd); + return 0; +} + +void +usage(void) +{ + fprintf(stderr, "Usage: mtd [ ...] [ ...] \n\n" + "The device is in the format of mtdX (eg: mtd4) or its label.\n" + "mtd recognises these commands:\n" + " unlock unlock the device\n" + " erase erase all data on device\n" + " write |- write (use - for stdin) to device\n" + "Following options are available:\n" + " -q quiet mode (once: no [w] on writing,\n" + " twice: no status messages)\n" + " -e erase before executing the command\n\n" + "Example: To write linux.trx to mtd1 labeled as linux\n" + " mtd write linux.trx linux\n\n"); + exit(1); +} + +int +main(int argc, char **argv) +{ + int ch, i, imagefd = -1, quiet, unlocked; + char *erase[MAX_ARGS], *device; + const char *imagefile = NULL; + enum { + CMD_ERASE, + CMD_WRITE, + CMD_UNLOCK + } cmd; + + erase[0] = NULL; + buflen = 0; + quiet = 0; + + while ((ch = getopt(argc, argv, "Fqe:")) != -1) + switch (ch) { + case 'F': + quiet = 1; + /* FALLTHROUGH */ + case 'q': + quiet++; + break; + case 'e': + i = 0; + while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS)) + i++; + + erase[i++] = optarg; + erase[i] = NULL; + break; + + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + if (argc < 2) + usage(); + + if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) { + cmd = CMD_UNLOCK; + device = argv[1]; + } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) { + cmd = CMD_ERASE; + device = argv[1]; + } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) { + cmd = CMD_WRITE; + device = argv[2]; + + if (strcmp(argv[1], "-") == 0) { + imagefile = ""; + imagefd = 0; + } else { + imagefile = argv[1]; + if ((imagefd = open(argv[1], O_RDONLY)) < 0) { + fprintf(stderr, "Couldn't open image file: %s!\n", imagefile); + exit(1); + } + } + + if (!mtd_check(device)) { + fprintf(stderr, "Can't open device for writing!\n"); + exit(1); + } + } else { + usage(); + } + + sync(); + + i = 0; + unlocked = 0; + while (erase[i] != NULL) { + if (quiet < 2) + fprintf(stderr, "Unlocking %s ...\n", erase[i]); + mtd_unlock(erase[i]); + if (quiet < 2) + fprintf(stderr, "Erasing %s ...\n", erase[i]); + mtd_erase(erase[i]); + if (strcmp(erase[i], device) == 0) + /* this means that is unlocked and erased */ + unlocked = 1; + i++; + } + + if (!unlocked) { + if (quiet < 2) + fprintf(stderr, "Unlocking %s ...\n", device); + mtd_unlock(device); + } + + switch (cmd) { + case CMD_UNLOCK: + break; + case CMD_ERASE: + if (unlocked) { + fprintf(stderr, "Already erased: %s\n", device); + break; + } + if (quiet < 2) + fprintf(stderr, "Erasing %s ...\n", device); + mtd_erase(device); + break; + case CMD_WRITE: + if (quiet < 2) + fprintf(stderr, "Writing from %s to %s ... ", imagefile, device); + mtd_write(imagefd, device, quiet, (unlocked == 0)); + if (quiet < 2) + fprintf(stderr, "\n"); + break; + } + + sync(); + return 0; +} -- cgit v1.2.3 From f9b8f27119a5fc811c2a0a25e686638c8b5680b8 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 20:17:21 +0100 Subject: add sangam-atm package - driver package for ag241 dsl modem, it loads, but we will see if it works.. --- package/Makefile | 1 + package/linux-atm/Makefile | 4 +- package/sangam-atm/Config.in | 23 + package/sangam-atm/Makefile | 41 ++ package/sangam-atm/patches/patch-Makefile | 29 + package/sangam-atm/patches/patch-cp_sar_reg_h | 8 + package/sangam-atm/patches/patch-cppi_cpaal5_c | 11 + .../sangam-atm/patches/patch-dev_host_interface_h | 11 + package/sangam-atm/patches/patch-dsl_hal_advcfg_c | 15 + package/sangam-atm/patches/patch-dsl_hal_api_c | 107 ++++ package/sangam-atm/patches/patch-dsl_hal_support_c | 52 ++ package/sangam-atm/patches/patch-dsl_hal_support_h | 11 + package/sangam-atm/patches/patch-tn7api_h | 17 + package/sangam-atm/patches/patch-tn7atm_c | 633 +++++++++++++++++++++ package/sangam-atm/patches/patch-tn7atm_h | 50 ++ package/sangam-atm/patches/patch-tn7dsl_c | 602 ++++++++++++++++++++ package/sangam-atm/patches/patch-tn7sar_c | 79 +++ 17 files changed, 1692 insertions(+), 2 deletions(-) create mode 100644 package/sangam-atm/Config.in create mode 100644 package/sangam-atm/Makefile create mode 100644 package/sangam-atm/patches/patch-Makefile create mode 100644 package/sangam-atm/patches/patch-cp_sar_reg_h create mode 100644 package/sangam-atm/patches/patch-cppi_cpaal5_c create mode 100644 package/sangam-atm/patches/patch-dev_host_interface_h create mode 100644 package/sangam-atm/patches/patch-dsl_hal_advcfg_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_api_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_support_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_support_h create mode 100644 package/sangam-atm/patches/patch-tn7api_h create mode 100644 package/sangam-atm/patches/patch-tn7atm_c create mode 100644 package/sangam-atm/patches/patch-tn7atm_h create mode 100644 package/sangam-atm/patches/patch-tn7dsl_c create mode 100644 package/sangam-atm/patches/patch-tn7sar_c (limited to 'package') diff --git a/package/Makefile b/package/Makefile index 994520726..ce92c1cb0 100644 --- a/package/Makefile +++ b/package/Makefile @@ -453,6 +453,7 @@ package-$(ADK_PACKAGE_ZSH) += zsh # kernel addon packages package-$(ADK_PACKAGE_KMOD_EM28XX) += em28xx package-$(ADK_PACKAGE_NTFS_3G) += ntfs-3g +package-$(ADK_PACKAGE_KMOD_SANGAM_ATM) += sangam-atm DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m)) COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile index 2f32e7aa8..1ebd2172b 100644 --- a/package/linux-atm/Makefile +++ b/package/linux-atm/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= linux-atm PKG_VERSION:= 2.5.1 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= 9560b0e1f410a05b849dfdab465dd758 PKG_DESCR:= ATM library and tools for Linux PKG_SECTION:= libs @@ -29,7 +29,7 @@ INSTALL_STYLE:= auto post-install: ${INSTALL_DIR} ${IDIR_LIBATM}/usr/lib - ${CP} ${WRKINST}/usr/lib/libatm.so.1 ${IDIR_LIBATM}/usr/lib + ${CP} ${WRKINST}/usr/lib/libatm.so* ${IDIR_LIBATM}/usr/lib ${INSTALL_DIR} ${IDIR_BR2684CTL}/usr/sbin ${CP} ${WRKINST}/usr/sbin/br2684ctl ${IDIR_BR2684CTL}/usr/sbin diff --git a/package/sangam-atm/Config.in b/package/sangam-atm/Config.in new file mode 100644 index 000000000..fb37f6431 --- /dev/null +++ b/package/sangam-atm/Config.in @@ -0,0 +1,23 @@ +config ADK_PACKAGE_KMOD_SANGAM_ATM + prompt "kmod-sangam-atm.......................... Driver for TI AR7 DSL modem" + tristate + select ADK_KPACKAGE_KMOD_FW_LOADER + default n + help + ATM driver for AR7 DSL modem. + +choice +prompt "Firmware type" +depends on ADK_PACKAGE_KMOD_SANGAM_ATM + +config ADK_PACKAGE_SANGAM_ATM_ANNEX_A + prompt "Annex A, ADSL over POTS" + boolean + help + +config ADK_PACKAGE_SANGAM_ATM_ANNEX_B + prompt "Annex B, ADSL over ISDN" + boolean + help + +endchoice diff --git a/package/sangam-atm/Makefile b/package/sangam-atm/Makefile new file mode 100644 index 000000000..e6c98e4c4 --- /dev/null +++ b/package/sangam-atm/Makefile @@ -0,0 +1,41 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= sangam-atm +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 3843f3e670967fe81561770ac960c1cd +PKG_DESCR:= sangam-atm DSL modem driver for TI AR7 boards +PKG_SECTION:= kernel +PKG_SITES:= http://openadk.org/distfiles/ + +include ${TOPDIR}/mk/package.mk +include ${TOPDIR}/mk/kernel-vars.mk + +$(eval $(call PKG_template,KMOD_SANGAM_ATM,kmod-sangam-atm,${KERNEL_VERSION}+${PKG_VERSION}-${ADK_TARGET}-${PKG_RELEASE},kernel ${KERNEL_VERSION}-${KERNEL_RELEASE},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +do-build: + $(MAKE) ${KERNEL_MAKE_OPTS} LDFLAGS="" SUBDIRS="${WRKBUILD}" modules + +do-install: + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/etc/modules.d/ + echo "tiatm" > ${IDIR_KMOD_SANGAM_ATM}/etc/modules.d/70-sangam-atm + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/lib/modules/${KERNEL_VERSION}/ + ${INSTALL_DATA} ${WRKBUILD}/tiatm.ko \ + ${IDIR_KMOD_SANGAM_ATM}/lib/modules/${KERNEL_VERSION} + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/lib/firmware +ifeq (${ADK_PACKAGE_SANGAM_ATM_ANNEX_A},y) + ${INSTALL_DATA} ${WRKBUILD}/ar0700mp.bin \ + ${IDIR_KMOD_SANGAM_ATM}/lib/firmware/ar0700xx.bin +endif +ifeq (${ADK_PACKAGE_SANGAM_ATM_ANNEX_B},y) + ${INSTALL_DATA} ${WRKBUILD}/ar0700db.bin \ + ${IDIR_KMOD_SANGAM_ATM}/lib/firmware/ar0700xx.bin +endif + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/sangam-atm/patches/patch-Makefile b/package/sangam-atm/patches/patch-Makefile new file mode 100644 index 000000000..4386b4a3f --- /dev/null +++ b/package/sangam-atm/patches/patch-Makefile @@ -0,0 +1,29 @@ +--- sangam-atm-1.0.orig/Makefile 2005-06-01 05:46:28.000000000 +0200 ++++ sangam-atm-1.0/Makefile 2009-12-17 19:10:13.456420379 +0100 +@@ -1,18 +1,11 @@ +-# File: drivers/atm/ti_evm3/Makefile +-# +-# Makefile for the Texas Instruments EVM3 ADSL/ATM driver. + # ++# Makefile for the TIATM device driver. + # +-# Copyright (c) 2000 Texas Instruments Incorporated. +-# Jeff Harrell (jharrell@telogy.com) +-# Viren Balar (vbalar@ti.com) +-# Victor Wells (vwells@telogy.com) +-# +-include $(TOPDIR)/Rules.make +- +- +- +- +- +- + ++CONFIG_SANGAM_ATM=m ++#EXTRA_CFLAGS += -DEL -I. -DPOST_SILICON -DCOMMON_NSP -DCONFIG_LED_MODULE -DDEREGISTER_LED -DNO_ACT ++#EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -DNO_ACT -D__NO__VOICE_PATCH__ -DEL ++#EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -D__NO__VOICE_PATCH__ -DEL ++EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -D__NO__VOICE_PATCH__ -DEL -DCPATM_TASKLET_MODE ++obj-$(CONFIG_SANGAM_ATM) := tiatm.o ++tiatm-objs += cpsar.o aal5sar.o tn7sar.o tn7atm.o tn7dsl.o dsl_hal_api.o dsl_hal_support.o dsl_hal_advcfg.o diff --git a/package/sangam-atm/patches/patch-cp_sar_reg_h b/package/sangam-atm/patches/patch-cp_sar_reg_h new file mode 100644 index 000000000..2452ff86d --- /dev/null +++ b/package/sangam-atm/patches/patch-cp_sar_reg_h @@ -0,0 +1,8 @@ +--- sangam-atm-1.0.orig/cp_sar_reg.h 2004-04-20 08:23:30.000000000 +0200 ++++ sangam-atm-1.0/cp_sar_reg.h 2009-12-17 19:25:17.702739456 +0100 +@@ -214,4 +214,4 @@ + + /* END OF FILE */ + +-#endif _INC_SAR_REG ++#endif diff --git a/package/sangam-atm/patches/patch-cppi_cpaal5_c b/package/sangam-atm/patches/patch-cppi_cpaal5_c new file mode 100644 index 000000000..a32408982 --- /dev/null +++ b/package/sangam-atm/patches/patch-cppi_cpaal5_c @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/cppi_cpaal5.c 2005-04-08 10:22:04.000000000 +0200 ++++ sangam-atm-1.0/cppi_cpaal5.c 2009-12-17 19:09:41.516423269 +0100 +@@ -352,7 +352,7 @@ static int halRxReturn(HAL_RECEIVEINFO * + { + /* malloc failed, add this RCB to Needs Buffer List */ + TempRcb->FragCount = 1; /*MJH+030417*/ +- (HAL_RCB *)TempRcb->Eop = TempRcb; /* GSG +030430 */ ++ TempRcb->Eop = TempRcb; /* GSG +030430 */ + + if(HalDev->NeedsCount < MAX_NEEDS) /* +MJH 030410 */ + { /* +MJH 030410 */ diff --git a/package/sangam-atm/patches/patch-dev_host_interface_h b/package/sangam-atm/patches/patch-dev_host_interface_h new file mode 100644 index 000000000..6927ab96b --- /dev/null +++ b/package/sangam-atm/patches/patch-dev_host_interface_h @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/dev_host_interface.h 2007-03-07 14:40:14.000000000 +0100 ++++ sangam-atm-1.0/dev_host_interface.h 2009-12-17 19:27:01.156438308 +0100 +@@ -1288,7 +1288,7 @@ typedef struct + + SINT16 devCodecRxdf4Coeff[12] ; // (BOTH) IIR Coefficients + SINT16 devCodecTxdf2aCoeff[64] ; // (BOTH) FIR filter coefficients +-#if OHIO_SUPPORT ++#if defined(OHIO_SUPPORT) + SINT16 devCodecTxdf2bCoeff[84] ; // (BOTH) FIR filter coefficients + #else + SINT16 devCodecTxdf2bCoeff[64] ; // (BOTH) FIR filter coefficients diff --git a/package/sangam-atm/patches/patch-dsl_hal_advcfg_c b/package/sangam-atm/patches/patch-dsl_hal_advcfg_c new file mode 100644 index 000000000..33149402d --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_advcfg_c @@ -0,0 +1,15 @@ +--- sangam-atm-1.0.orig/dsl_hal_advcfg.c 2005-08-09 09:20:46.000000000 +0200 ++++ sangam-atm-1.0/dsl_hal_advcfg.c 2009-12-17 19:09:58.440420854 +0100 +@@ -36,9 +36,9 @@ + * 05Jul05 0.00.09 CPH CQ9775: Change dslhal_advcfg_configDsTones input parameters & support for ADSL2+ + * 24Jul05 0.00.10 CPH Fixed comments in dslhal_advcfg_configDsTones function header + *******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + /*****************************************************************************/ + /* ACT API functions -- To be moved into their own independent module --RamP */ diff --git a/package/sangam-atm/patches/patch-dsl_hal_api_c b/package/sangam-atm/patches/patch-dsl_hal_api_c new file mode 100644 index 000000000..b88f4350f --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_api_c @@ -0,0 +1,107 @@ +--- sangam-atm-1.0.orig/dsl_hal_api.c 2007-03-07 04:13:06.000000000 +0100 ++++ sangam-atm-1.0/dsl_hal_api.c 2009-12-17 19:39:11.092420102 +0100 +@@ -254,15 +254,15 @@ + * of phyEnableDisableWord & phyControlWord to avoid changing API struct + * which may cause change required to application data structure. + ******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + #ifndef NO_ADV_STATS +-#include ++#include "dsl_hal_logtable.h" + #endif + +-#include ++#include "dsl_hal_version.h" + + // UR8_MERGE_START CQ11054 Jack Zhang + static unsigned int highprecision_selected = 0; //By default we use low precision for backward compt. +@@ -958,9 +958,6 @@ int dslhal_api_pollTrainingStatus(tidsl_ + + /*char *tmp;*/ + DEV_HOST_dspOamSharedInterface_t *pdspOamSharedInterface, dspOamSharedInterface; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + + dgprintf(5,"dslhal_api_pollTrainingStatus\n"); + pdspOamSharedInterface = (DEV_HOST_dspOamSharedInterface_t *) ptidsl->pmainAddr; +@@ -971,17 +968,6 @@ int dslhal_api_pollTrainingStatus(tidsl_ + dgprintf(1,"dslhal_support_blockRead failed\n"); + return DSLHAL_ERROR_BLOCK_READ; + } +-#if SWTC +- dspOamSharedInterface.tcHostComm_p =(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + + rc = dslhal_support_processTrainingState(ptidsl); + if(rc) +@@ -1025,9 +1011,6 @@ int dslhal_api_handleTrainingInterrupt(t + + /*char *tmp;*/ + DEV_HOST_dspOamSharedInterface_t *pdspOamSharedInterface, dspOamSharedInterface; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + dgprintf(6,"dslhal_api_handleTrainingInterrupt\n"); + pdspOamSharedInterface = (DEV_HOST_dspOamSharedInterface_t *) ptidsl->pmainAddr; + rc = dslhal_support_blockRead(pdspOamSharedInterface, &dspOamSharedInterface, +@@ -1037,17 +1020,6 @@ int dslhal_api_handleTrainingInterrupt(t + dgprintf(1,"dslhal_support_blockRead failed\n"); + return DSLHAL_ERROR_BLOCK_READ; + } +-#if SWTC +- dspOamSharedInterface.tcHostComm_p =(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + + if(intrSource & MASK_BITFIELD_INTERRUPTS) + { +@@ -1705,27 +1677,15 @@ void dslhal_api_gatherStatistics(tidsl_t + /* Get ATM Stats for both US and DS for Channel 0*/ + ptidsl->AppData.usAtm_count[0] = dslhal_support_byteSwap32(usAtmStats0.goodCount); + ptidsl->AppData.usIdle_count[0] = dslhal_support_byteSwap32(usAtmStats0.idleCount); +-#if SWTC +- ptidsl->AppData.usPdu_count[0] = dslhal_support_byteSwap32(usAtmStats0.pduCount); +-#endif + ptidsl->AppData.dsGood_count[0] = dslhal_support_byteSwap32(dsAtmStats0.goodCount); + ptidsl->AppData.dsIdle_count[0] = dslhal_support_byteSwap32(dsAtmStats0.idleCount); +-#if SWTC +- ptidsl->AppData.dsPdu_count[0] = dslhal_support_byteSwap32(dsAtmStats0.pduCount); +-#endif + ptidsl->AppData.dsBadHec_count[0] = dslhal_support_byteSwap32((dsAtmStats0.badHecCount)); + ptidsl->AppData.dsOVFDrop_count[0] = dslhal_support_byteSwap32((dsAtmStats0.ovflwDropCount)); + /* Get ATM Stats for both US and DS for Channel 1*/ + ptidsl->AppData.usAtm_count[1] = dslhal_support_byteSwap32(usAtmStats1.goodCount); + ptidsl->AppData.usIdle_count[1] = dslhal_support_byteSwap32(usAtmStats1.idleCount); +-#if SWTC +- ptidsl->AppData.usPdu_count[1] = dslhal_support_byteSwap32(usAtmStats1.pduCount); +-#endif + ptidsl->AppData.dsGood_count[1] = dslhal_support_byteSwap32(dsAtmStats1.goodCount); + ptidsl->AppData.dsIdle_count[1] = dslhal_support_byteSwap32(dsAtmStats1.idleCount); +-#if SWTC +- ptidsl->AppData.dsPdu_count[1] = dslhal_support_byteSwap32(dsAtmStats1.pduCount); +-#endif + ptidsl->AppData.dsBadHec_count[1] = dslhal_support_byteSwap32((dsAtmStats1.badHecCount)); + ptidsl->AppData.dsOVFDrop_count[1] = dslhal_support_byteSwap32((dsAtmStats1.ovflwDropCount)); + diff --git a/package/sangam-atm/patches/patch-dsl_hal_support_c b/package/sangam-atm/patches/patch-dsl_hal_support_c new file mode 100644 index 000000000..f1cdcd64a --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_support_c @@ -0,0 +1,52 @@ +--- sangam-atm-1.0.orig/dsl_hal_support.c 2007-05-18 09:47:33.000000000 +0200 ++++ sangam-atm-1.0/dsl_hal_support.c 2009-12-17 19:40:14.924421047 +0100 +@@ -140,9 +140,9 @@ + * oamFeature are overriden + // UR8_MERGE_END CQ10774 Ram + *******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + #define NUM_READ_RETRIES 3 + static unsigned int dslhal_support_adsl2ByteSwap32(unsigned int in32Bits); +@@ -1665,9 +1665,6 @@ int dslhal_support_hostDspCodeDownload(t + unsigned char * image; + char *tmp = (char *)DEV_HOST_DSP_OAM_POINTER_LOCATION; + DEV_HOST_dspVersionDef_t dspVersion; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + DEV_HOST_oamWrNegoParaDef_t OamWrNegoParaDef; + DEV_HOST_dspOamSharedInterface_t dspOamSharedInterface, *pdspOamSharedInterface; + DEV_HOST_olayDpDef_t olayDpParms; +@@ -2152,26 +2149,6 @@ int dslhal_support_hostDspCodeDownload(t + } + + /* table_dsp info */ +-#if SWTC +- dspOamSharedInterface.tcHostComm_p = (DEV_HOST_tcHostCommDef_t *)dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- rc = dslhal_support_blockRead(&pdspOamSharedInterface->tcHostComm_p, +- &pTCHostCommDef, 4); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +- +- pTCHostCommDef=(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)pTCHostCommDef); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + /* Select the Multimode Training */ + dspOamSharedInterface.oamWriteNegoParams_p = (DEV_HOST_oamWrNegoParaDef_t *)dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.oamWriteNegoParams_p); + rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.oamWriteNegoParams_p, &OamWrNegoParaDef, sizeof(DEV_HOST_oamWrNegoParaDef_t)); diff --git a/package/sangam-atm/patches/patch-dsl_hal_support_h b/package/sangam-atm/patches/patch-dsl_hal_support_h new file mode 100644 index 000000000..074953501 --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_support_h @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/dsl_hal_support.h 2005-11-11 09:07:04.000000000 +0100 ++++ sangam-atm-1.0/dsl_hal_support.h 2009-12-17 19:09:41.532422794 +0100 +@@ -49,7 +49,7 @@ + * 04Nov05 0.11.00 CPH Fixed T1413 mode got Zero DS/US rate when DSL_BIT_TMODE is set. + *******************************************************************************/ + +-#include ++#include "dsl_hal_api.h" + + #define virtual2Physical(a) (((int)a)&~0xe0000000) + /* External Function Prototype Declarations */ diff --git a/package/sangam-atm/patches/patch-tn7api_h b/package/sangam-atm/patches/patch-tn7api_h new file mode 100644 index 000000000..7688e20e0 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7api_h @@ -0,0 +1,17 @@ +--- sangam-atm-1.0.orig/tn7api.h 2006-12-11 15:36:54.000000000 +0100 ++++ sangam-atm-1.0/tn7api.h 2009-12-17 19:24:45.926721344 +0100 +@@ -107,7 +107,7 @@ int tn7dsl_proc_dbg_rmsgs4(char* buf, ch + + int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data); + int tn7dsl_proc_modem(char* buf, char **start, off_t offset, int count,int *eof, void *data); +-inline int tn7dsl_handle_interrupt(void); ++int tn7dsl_handle_interrupt(void); + + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -173,4 +173,4 @@ void tn7sar_get_sar_firmware_version(uns + int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data); + int tn7sar_proc_pvc_table(char* buf, char **start, off_t offset, int count,int *eof, void *data); + int tn7sar_tx_flush(void *privContext, int chan, int queue, int skip); +-#endif __SGAPI_H ++#endif diff --git a/package/sangam-atm/patches/patch-tn7atm_c b/package/sangam-atm/patches/patch-tn7atm_c new file mode 100644 index 000000000..744dec517 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7atm_c @@ -0,0 +1,633 @@ +--- sangam-atm-1.0.orig/tn7atm.c 2007-05-18 09:45:50.000000000 +0200 ++++ sangam-atm-1.0/tn7atm.c 2009-12-17 19:10:27.616421480 +0100 +@@ -61,7 +61,6 @@ + * UR8_MERGE_END CQ11057* + *********************************************************************************************/ + +-#include + #include + #include + #include +@@ -69,11 +68,20 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include ++#include ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif ++ + #include "dsl_hal_api.h" + #include "tn7atm.h" + #include "tn7api.h" +@@ -82,8 +90,149 @@ + #include "dsl_hal_register.h" + + #ifdef MODULE ++MODULE_LICENSE("GPL"); + MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver"); + MODULE_AUTHOR ("Zhicheng Tang"); ++ ++int mp_sar_ipacemax = -1; ++module_param_named(ipacemax, mp_sar_ipacemax, int, 0); ++MODULE_PARM_DESC(ipacemax, "Interrupt pacing"); ++ ++char *mp_macc = NULL; ++module_param_named(macc, mp_macc, charp, 0); ++MODULE_PARM_DESC(macc, "MAC address"); ++ ++int mp_dsp_noboost = -1; ++module_param_named(dsp_noboost, mp_dsp_noboost, int, 0); ++MODULE_PARM_DESC(dsp_noboost, "Suppress DSP frequency boost"); ++ ++int mp_dsp_freq = -1; ++module_param_named(dsp_freq, mp_dsp_freq, int, 0); ++MODULE_PARM_DESC(dsp_freq, "Frequency to boost the DSP to"); ++ ++char *mp_featctl0 = NULL; ++module_param_named(featctl0, mp_featctl0, charp, 0); ++MODULE_PARM_DESC(featctl0, "DSL feature control 0"); ++ ++char *mp_featctl1 = NULL; ++module_param_named(featctl1, mp_featctl1, charp, 0); ++MODULE_PARM_DESC(featctl1, "DSL feature control 1"); ++ ++char *mp_phyctl0 = NULL; ++module_param_named(phyctl0, mp_phyctl0, charp, 0); ++MODULE_PARM_DESC(phyctl0, "DSL PHY control 0"); ++ ++char *mp_phyctl1 = NULL; ++module_param_named(phyctl1, mp_phyctl1, charp, 0); ++MODULE_PARM_DESC(phyctl1, "DSL PHY control 1"); ++ ++int mp_turbodsl = -1; ++module_param_named(turbodsl, mp_turbodsl, int, 0); ++MODULE_PARM_DESC(turbodsl, "Enable TurboDSL"); ++ ++int mp_sar_rxbuf = -1; ++module_param_named(sar_rxbuf, mp_sar_rxbuf, int, 0); ++MODULE_PARM_DESC(sar_rxbuf, "SAR RxBuf size"); ++ ++int mp_sar_rxmax = -1; ++module_param_named(sar_rxmax, mp_sar_rxmax, int, 0); ++MODULE_PARM_DESC(sar_rxmax, "SAR RxMax size"); ++ ++int mp_sar_txbuf = -1; ++module_param_named(sar_txbuf, mp_sar_txbuf, int, 0); ++MODULE_PARM_DESC(sar_txbuf, "SAR TxBuf size"); ++ ++int mp_sar_txmax = -1; ++module_param_named(sar_txmax, mp_sar_txmax, int, 0); ++MODULE_PARM_DESC(sar_txmax, "SAR TxMax size"); ++ ++char *mp_modulation = NULL; ++module_param_named(modulation, mp_modulation, charp, 0); ++MODULE_PARM_DESC(modulation, "Modulation"); ++ ++int mp_fine_gain_control = -1; ++module_param_named(fine_gain_control, mp_fine_gain_control, int, 0); ++MODULE_PARM_DESC(fine_gain_control, "Fine gain control"); ++ ++int mp_fine_gain_value = -1; ++module_param_named(fine_gain_value, mp_fine_gain_value, int, 0); ++MODULE_PARM_DESC(fine_gain_value, "Fine gain value"); ++ ++int mp_enable_margin_retrain = -1; ++module_param_named(enable_margin_retrain, mp_enable_margin_retrain, int, 0); ++MODULE_PARM_DESC(enable_margin_retrain, "Enable margin retrain"); ++ ++int mp_margin_threshold = -1; ++module_param_named(margin_threshold, mp_margin_threshold, int, 0); ++MODULE_PARM_DESC(margin_threshold, "Margin retrain treshold"); ++ ++int mp_enable_rate_adapt = -1; ++module_param_named(enable_rate_adapt, mp_enable_rate_adapt, int, 0); ++MODULE_PARM_DESC(enable_rate_adapt, "Enable rate adaption"); ++ ++int mp_powercutback = -1; ++module_param_named(powercutback, mp_powercutback, int, 0); ++MODULE_PARM_DESC(powercutback, "Enable / disable powercutback"); ++ ++int mp_trellis = -1; ++module_param_named(trellis, mp_trellis, int, 0); ++MODULE_PARM_DESC(trellis, "Enable / disable trellis coding"); ++ ++int mp_bitswap = -1; ++module_param_named(bitswap, mp_bitswap, int, 0); ++MODULE_PARM_DESC(bitswap, "Enable / disable bitswap"); ++ ++int mp_maximum_bits_per_carrier = -1; ++module_param_named(maximum_bits_per_carrier, mp_maximum_bits_per_carrier, int, 0); ++MODULE_PARM_DESC(maximum_bits_per_carrier, "Maximum bits per carrier"); ++ ++int mp_maximum_interleave_depth = -1; ++module_param_named(maximum_interleave_depth, mp_maximum_interleave_depth, int, 0); ++MODULE_PARM_DESC(maximum_interleave_depth, "Maximum interleave depth"); ++ ++int mp_pair_selection = -1; ++module_param_named(pair_selection, mp_pair_selection, int, 0); ++MODULE_PARM_DESC(pair_selection, "Pair selection"); ++ ++int mp_dgas_polarity = -1; ++module_param_named(dgas_polarity, mp_dgas_polarity, int, 0); ++MODULE_PARM_DESC(dgas_polarity, "DGAS polarity"); ++ ++int mp_los_alarm = -1; ++module_param_named(los_alarm, mp_los_alarm, int, 0); ++MODULE_PARM_DESC(los_alarm, "LOS alarm"); ++ ++char *mp_eoc_vendor_id = NULL; ++module_param_named(eoc_vendor_id, mp_eoc_vendor_id, charp, 0); ++MODULE_PARM_DESC(eoc_vendor_id, "EOC vendor id"); ++ ++int mp_eoc_vendor_revision = -1; ++module_param_named(eoc_vendor_revision, mp_eoc_vendor_revision, int, 0); ++MODULE_PARM_DESC(eoc_vendor_revision, "EOC vendor revision"); ++ ++char *mp_eoc_vendor_serialnum = NULL; ++module_param_named(eoc_vendor_serialnum, mp_eoc_vendor_serialnum, charp, 0); ++MODULE_PARM_DESC(eoc_vendor_serialnum, "EOC vendor serial number"); ++ ++char *mp_invntry_vernum = NULL; ++module_param_named(invntry_vernum, mp_invntry_vernum, charp, 0); ++MODULE_PARM_DESC(invntry_vernum, "Inventory revision number"); ++ ++int mp_dsl_bit_tmode = -1; ++module_param_named(dsl_bit_tmode, mp_dsl_bit_tmode, int, 0); ++MODULE_PARM_DESC(dsl_bit_tmode, "DSL bit training mode"); ++ ++int mp_high_precision = -1; ++module_param_named(high_precision, mp_high_precision, int, 0); ++MODULE_PARM_DESC(high_precision, "High precision"); ++ ++int mp_autopvc_enable = -1; ++module_param_named(autopvc_enable, mp_autopvc_enable, int, 0); ++MODULE_PARM_DESC(autopvc_enable, "Enable / disable automatic PVC"); ++ ++int mp_oam_lb_timeout = -1; ++module_param_named(oam_lb_timeout, mp_oam_lb_timeout, int, 0); ++MODULE_PARM_DESC(oam_lb_timeout, "OAM LB timeout"); + #endif + + #ifndef TRUE +@@ -100,9 +249,9 @@ MODULE_AUTHOR ("Zhicheng Tang"); + + /*end of externs */ + +-#ifndef TI_STATIC_ALLOCATIONS +-#define TI_STATIC_ALLOCATIONS +-#endif ++//#ifndef TI_STATIC_ALLOCATIONS ++//#define TI_STATIC_ALLOCATIONS ++//#endif + + #define tn7atm_kfree_skb(x) dev_kfree_skb(x) + +@@ -114,7 +263,7 @@ static int EnableQoS = FALSE; + /* prototypes */ + static int tn7atm_set_can_support_adsl2 (int can); + +-static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci); ++static int tn7atm_open (struct atm_vcc *vcc); + + static void tn7atm_close (struct atm_vcc *vcc); + +@@ -257,13 +406,12 @@ static const struct atmdev_ops tn7atm_op + getsockopt: NULL, + setsockopt: NULL, + send: tn7atm_send, +- sg_send: NULL, + phy_put: NULL, + phy_get: NULL, + change_qos: tn7atm_change_qos, + }; + +-const char drv_proc_root_folder[] = "avalanche/"; ++const char drv_proc_root_folder[] = "avalanche"; + static struct proc_dir_entry *root_proc_dir_entry = NULL; + #define DRV_PROC_MODE 0644 + static int proc_root_already_exists = TRUE; +@@ -559,62 +707,12 @@ static int turbodsl_check_priority_type( + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * +- * Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci) +- * +- * Description: retrieve VPI/VCI for connection +- * +- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci) +-{ +- struct atm_vcc *walk; +- +- /* +- * find a free VPI +- */ +- if (*vpi == ATM_VPI_ANY) +- { +- +- for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) +- { +- +- if ((walk->vci == *vci) && (walk->vpi == *vpi)) +- { +- (*vpi)++; +- walk = vcc->dev->vccs; +- } +- } +- } +- +- /* +- * find a free VCI +- */ +- if (*vci == ATM_VCI_ANY) +- { +- +- for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; +- walk = walk->next) +- { +- +- if ((walk->vpi = *vpi) && (walk->vci == *vci)) +- { +- *vci = walk->vci + 1; +- walk = vcc->dev->vccs; +- } +- } +- } +- +- return 0; +-} +- +- +-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- * + * Function: int tn7atm_sar_irq(void) + * + * Description: tnetd73xx SAR interrupt. + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static void tn7atm_sar_irq (int irq, void *voiddev, struct pt_regs *regs) ++static irqreturn_t tn7atm_sar_irq (int irq, void *voiddev) + { + struct atm_dev *atmdev; + Tn7AtmPrivate *priv; +@@ -641,6 +739,7 @@ static void tn7atm_sar_irq (int irq, voi + #ifdef TIATM_INST_SUPP + psp_trace_par (ATM_DRV_SAR_ISR_EXIT, retval); + #endif ++ return IRQ_HANDLED; + } + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -650,7 +749,7 @@ static void tn7atm_sar_irq (int irq, voi + * Description: tnetd73xx DSL interrupt. + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static void tn7atm_dsl_irq (int irq, void *voiddev, struct pt_regs *regs) ++static irqreturn_t tn7atm_dsl_irq (int irq, void *voiddev) + { + struct atm_dev *atmdev; + Tn7AtmPrivate *priv; +@@ -672,6 +771,8 @@ static void tn7atm_dsl_irq (int irq, voi + #ifdef TIATM_INST_SUPP + psp_trace_par (ATM_DRV_DSL_ISR_EXIT, retval); + #endif ++ ++ return IRQ_HANDLED; + } + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -693,25 +794,25 @@ static int __init tn7atm_irq_request (st + * Register SAR interrupt + */ + priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ +- if (request_irq (priv->sar_irq, tn7atm_sar_irq, SA_INTERRUPT, "SAR ", dev)) ++ if (request_irq (priv->sar_irq, tn7atm_sar_irq, IRQF_DISABLED, "SAR ", dev)) + printk ("Could not register tn7atm_sar_irq\n"); + + /* + * interrupt pacing + */ + ptr = prom_getenv ("sar_ipacemax"); +- if (ptr) ++ if (ptr || mp_sar_ipacemax != -1) + { +- def_sar_inter_pace = os_atoi (ptr); ++ def_sar_inter_pace = mp_sar_ipacemax == -1 ? os_atoi (ptr) : mp_sar_ipacemax; + } +- avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, +- def_sar_inter_pace); ++/* avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, ++ def_sar_inter_pace);*/ + + /* + * Reigster Receive interrupt A + */ + priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ +- if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, SA_INTERRUPT, "DSL ", dev)) ++ if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, IRQF_DISABLED, "DSL ", dev)) + printk ("Could not register tn7atm_dsl_irq\n"); + + /***** VRB Tasklet Mode ****/ +@@ -842,7 +943,7 @@ static int __init tn7atm_get_ESI (struct + char esi_addr[ESI_LEN] = { 0x00, 0x00, 0x11, 0x22, 0x33, 0x44 }; + char *esiaddr_str = NULL; + +- esiaddr_str = prom_getenv ("maca"); ++ esiaddr_str = mp_macc ? mp_macc : prom_getenv ("maca"); + + if (!esiaddr_str) + { +@@ -875,11 +976,15 @@ static int __init tn7atm_get_ESI (struct + #define ATM_VBR_RT 5 + #endif + +-int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci) ++int tn7atm_open (struct atm_vcc *vcc) + { + tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm; + int rc; + //int flags; ++ tn7atm_activate_vc_parm.pcr = 0x20000; ++ tn7atm_activate_vc_parm.scr = 0x20000; ++ tn7atm_activate_vc_parm.mbs = 0x20000; ++ tn7atm_activate_vc_parm.cdvt = 10000; + + dgprintf(1, "tn7atm_open()\n"); + +@@ -891,24 +996,18 @@ int tn7atm_open (struct atm_vcc *vcc, sh + return -1; + } + +- MOD_INC_USE_COUNT; +- +- /* find a free VPI/VCI */ +- tn7atm_walk_vccs(vcc, &vpi, &vci); +- +- vcc->vpi = vpi; +- vcc->vci = vci; ++// MOD_INC_USE_COUNT; + +- if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC)) ++ if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC)) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + return -EBUSY; + } + +- tn7atm_activate_vc_parm.vpi = vpi; +- tn7atm_activate_vc_parm.vci = vci; ++ tn7atm_activate_vc_parm.vpi = vcc->vpi; ++ tn7atm_activate_vc_parm.vci = vcc->vci; + +- if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI)) ++ if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI)) + { + /* always use (max_dma_chan+1) for clear eoc */ + tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN; +@@ -916,7 +1015,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + /* check to see whether clear eoc is opened or not */ + if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan); + return -EBUSY; + } +@@ -925,7 +1024,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + if (rc) + { + printk("tn7atm_open: failed to setup clear_eoc\n"); +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + return -EBUSY; + } + tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan); +@@ -934,17 +1033,17 @@ int tn7atm_open (struct atm_vcc *vcc, sh + } + else /* PVC channel setup */ + { +- if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI)) ++ if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI)) + { + tn7atm_activate_vc_parm.chan = 14; /* always use chan 14 for MII PVC-base romote mgmt */ + } + else + { +- rc = tn7atm_lut_find(vpi, vci); ++ rc = tn7atm_lut_find(vcc->vpi, vcc->vci); + /* check to see whether PVC is opened or not */ + if(ATM_NO_DMA_CHAN != rc) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + printk("PVC already opened. dmachan = %d\n", rc); + return -EBUSY; + } +@@ -976,6 +1075,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + tn7atm_activate_vc_parm.priority = 2; + break; + ++#if 0 + case ATM_VBR: /* Variable Bit Rate-Non RealTime*/ + tn7atm_activate_vc_parm.qos = 1; + tn7atm_activate_vc_parm.priority = 1; +@@ -997,6 +1097,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr; + tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv; + break; ++#endif + + default: + tn7atm_activate_vc_parm.qos = 2; +@@ -1024,7 +1125,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + if (rc < 0) + { + printk("failed to activate hw channel\n"); +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan); + //spin_unlock_irqrestore(&chan_init_lock, flags); + return -EBUSY; +@@ -1114,7 +1215,7 @@ void tn7atm_close (struct atm_vcc *vcc) + tn7atm_lut_clear (vcc, dmachan); + //spin_unlock_irqrestore (&closeLock, closeFlag); + +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + + dgprintf (1, "Leave tn7atm_close\n"); + } +@@ -1528,8 +1629,7 @@ int tn7atm_receive (void *os_dev, int ch + * firewall is on */ + + dgprintf (3, "pushing the skb...\n"); +- +- skb->stamp = vcc->timestamp = xtime; ++ __net_timestamp(skb); + + xdump ((unsigned char *) skb->data, skb->len, 5); + +@@ -1725,8 +1825,7 @@ static void tn7atm_exit (void) + + kfree (dev->dev_data); + +- // atm_dev_deregister (dev); +- shutdown_atm_dev (dev); ++ atm_dev_deregister (dev); + + /* + * remove proc entries +@@ -1885,9 +1984,6 @@ static int __init tn7atm_detect (void) + /* + * Set up proc entry for atm stats + */ +- if (tn7atm_xlate_proc_name +- (drv_proc_root_folder, &root_proc_dir_entry, &residual)) +- { + printk ("Creating new root folder %s in the proc for the driver stats \n", + drv_proc_root_folder); + root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL); +@@ -1897,7 +1993,6 @@ static int __init tn7atm_detect (void) + return -ENOMEM; + } + proc_root_already_exists = FALSE; +- } + + /* + * AV: Clean-up. Moved all the definitions to the data structure. +@@ -1981,15 +2076,15 @@ static int tn7atm_autoDetectDspBoost (vo + //UR8_MERGE_END CQ10450* + + cp = prom_getenv ("dsp_noboost"); +- if (cp) ++ if (cp || mp_dsp_noboost != -1) + { +- dsp_noboost = os_atoi (cp); ++ dsp_noboost = mp_dsp_noboost == -1 ? os_atoi (cp) : mp_dsp_noboost; + } + + cp = (char *) prom_getenv ("dsp_freq"); +- if (cp) ++ if (cp || mp_dsp_freq != -1) + { +- dspfreq = os_atoi (cp); ++ dspfreq = mp_dsp_freq == -1 ? os_atoi (cp) : mp_dsp_freq; + if (dspfreq == 250) + { + boostDsp = 1; +@@ -2238,8 +2333,9 @@ static int __init tn7atm_init (struct at + // Inter-Op DSL phy Control + // Note the setting of _dsl_Feature_0 and _dsl_Feature_1 must before + // dslhal_api_dslStartup (in tn7dsl_init()). +- if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL) ++ if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL || mp_featctl0 != NULL) + { ++ if (mp_featctl0 != NULL) ptr = mp_featctl0; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2247,8 +2343,9 @@ static int __init tn7atm_init (struct at + _dsl_Feature_0_defined = 1; + } + +- if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL) ++ if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL || mp_featctl1 != NULL) + { ++ if (mp_featctl1 != NULL) ptr = mp_featctl1; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2260,8 +2357,9 @@ static int __init tn7atm_init (struct at + // DSL phy Feature Control + // Note the setting of _dsl_PhyControl_0 and _dsl_PhyControl_1 must before + // dslhal_api_dslStartup (in tn7dsl_init()). +- if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL) ++ if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL || mp_phyctl0 != NULL) + { ++ if (mp_phyctl0 != NULL) ptr = mp_phyctl0; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2269,8 +2367,9 @@ static int __init tn7atm_init (struct at + _dsl_PhyControl_0_defined = 1; + } + +- if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL) ++ if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL || mp_phyctl1 != NULL) + { ++ if (mp_phyctl1 != NULL) ptr = mp_phyctl1; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2298,9 +2397,9 @@ static int __init tn7atm_init (struct at + priv->bTurboDsl = 1; + // read config for turbo dsl + ptr = prom_getenv ("TurboDSL"); +- if (ptr) ++ if (ptr || mp_turbodsl != -1) + { +- priv->bTurboDsl = os_atoi (ptr); ++ priv->bTurboDsl = mp_turbodsl == -1 ? os_atoi (ptr) : mp_turbodsl; + } + + // @Added to make Rx buffer number & Service max configurable through +@@ -2308,30 +2407,30 @@ static int __init tn7atm_init (struct at + priv->sarRxBuf = RX_BUFFER_NUM; + ptr = NULL; + ptr = prom_getenv ("SarRxBuf"); +- if (ptr) ++ if (ptr || mp_sar_rxbuf != -1) + { +- priv->sarRxBuf = os_atoi (ptr); ++ priv->sarRxBuf = mp_sar_rxbuf == -1 ? os_atoi (ptr) : mp_sar_rxbuf; + } + priv->sarRxMax = RX_SERVICE_MAX; + ptr = NULL; + ptr = prom_getenv ("SarRxMax"); +- if (ptr) ++ if (ptr || mp_sar_rxmax != -1) + { +- priv->sarRxMax = os_atoi (ptr); ++ priv->sarRxMax = mp_sar_rxmax == -1 ? os_atoi (ptr) : mp_sar_rxmax; + } + priv->sarTxBuf = TX_BUFFER_NUM; + ptr = NULL; + ptr = prom_getenv ("SarTxBuf"); +- if (ptr) ++ if (ptr || mp_sar_txbuf != -1) + { +- priv->sarTxBuf = os_atoi (ptr); ++ priv->sarTxBuf = mp_sar_txbuf == -1 ? os_atoi (ptr) : mp_sar_txbuf; + } + priv->sarTxMax = TX_SERVICE_MAX; + ptr = NULL; + ptr = prom_getenv ("SarTxMax"); +- if (ptr) ++ if (ptr || mp_sar_txmax != -1) + { +- priv->sarTxMax = os_atoi (ptr); ++ priv->sarTxMax = mp_sar_txmax == -1 ? os_atoi (ptr) : mp_sar_txmax; + } + + return 0; +@@ -2479,7 +2578,5 @@ static int tn7atm_proc_qos_write(struct + return count; + } + +-#ifdef MODULE + module_init (tn7atm_detect); + module_exit (tn7atm_exit); +-#endif /* MODULE */ diff --git a/package/sangam-atm/patches/patch-tn7atm_h b/package/sangam-atm/patches/patch-tn7atm_h new file mode 100644 index 000000000..e26e0441a --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7atm_h @@ -0,0 +1,50 @@ +--- sangam-atm-1.0.orig/tn7atm.h 2006-04-05 07:33:06.000000000 +0200 ++++ sangam-atm-1.0/tn7atm.h 2009-12-17 19:15:08.310494800 +0100 +@@ -19,7 +19,8 @@ + //#include "mips_support.h" + #include + +-#include ++#define MIPS_EXCEPTION_OFFSET 8 ++#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET) + + #ifdef CONFIG_MODVERSIONS + #include +@@ -61,37 +62,6 @@ extern int avalanche_request_pacing(int + #include + #endif /* CONFIG_HAS_RELEASE_H_FILE */ + +-/* Base PSP 7.4 support */ +-#if ((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) +-#define TIATM_INST_SUPP /* Enable Instrumentation code. */ +-#define __NO__VOICE_PATCH__ /* Not required anymore. */ +- +-#if defined (CONFIG_MIPS_AVALANCHE_COLORED_LED) +-#include +- +-/* LED handles */ +-extern void *hnd_LED_0; +- +-#define MOD_ADSL 1 +-#define DEF_ADSL_IDLE 1 +-#define DEF_ADSL_TRAINING 2 +-#define DEF_ADSL_SYNC 3 +-#define DEF_ADSL_ACTIVITY 4 +- +-#define LED_NUM_1 0 +-#define LED_NUM_2 1 +- +-#endif /*defined (CONFIG_MIPS_AVALANCHE_COLORED_LED)*/ +- +-/* So as to not cause any confusion. */ +-#ifdef BASE_PSP_7X +-#undef BASE_PSP_7X +-#endif /*BASE_PSP_7X*/ +- +-#define TN7DSL_LED_ACTION(module_handle, module_name, state_id) led_manager_led_action(module_handle, state_id) +- +-#endif /*((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) */ +- + #ifdef CONFIG_LED_MODULE + #ifndef BASE_PSP_7X + #include diff --git a/package/sangam-atm/patches/patch-tn7dsl_c b/package/sangam-atm/patches/patch-tn7dsl_c new file mode 100644 index 000000000..8a06dcfe1 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7dsl_c @@ -0,0 +1,602 @@ +--- sangam-atm-1.0.orig/tn7dsl.c 2007-01-04 09:04:14.000000000 +0100 ++++ sangam-atm-1.0/tn7dsl.c 2009-12-17 19:22:19.372420289 +0100 +@@ -94,7 +94,6 @@ + * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance + * UR8_MERGE_END CQ11054* + *********************************************************************************************/ +-#include + #include + #include + #include +@@ -102,8 +101,6 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include +@@ -111,6 +108,18 @@ + #include + #include + #include ++#include ++#include ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif ++ + /* Modules specific header files */ + #include "tn7atm.h" + #include "tn7api.h" +@@ -133,6 +142,27 @@ + #define NEW_TRAINING_VAL_T1413 128 + #define NEW_TRAINING_VAL_MMODE 255 + ++extern char *mp_modulation; ++extern int mp_fine_gain_control; ++extern int mp_fine_gain_value; ++extern int mp_enable_margin_retrain; ++extern int mp_margin_threshold; ++extern int mp_enable_rate_adapt; ++extern int mp_powercutback; ++extern int mp_trellis; ++extern int mp_bitswap; ++extern int mp_maximum_bits_per_carrier; ++extern int mp_maximum_interleave_depth; ++extern int mp_pair_selection; ++extern int mp_dgas_polarity; ++extern int mp_los_alarm; ++extern char *mp_eoc_vendor_id; ++extern int mp_eoc_vendor_revision; ++extern char *mp_eoc_vendor_serialnum; ++extern char *mp_invntry_vernum; ++extern int mp_dsl_bit_tmode; ++extern int mp_high_precision; ++ + int testflag1 = 0; + extern int __guDbgLevel; + extern sar_stat_t sarStat; +@@ -173,7 +203,7 @@ led_reg_t ledreg[2]; + static struct led_funcs ledreg[2]; + #endif + +-#define DEV_DSLMOD 1 ++#define DEV_DSLMOD CTL_UNNUMBERED + #define MAX_STR_SIZE 256 + #define DSL_MOD_SIZE 256 + +@@ -299,7 +329,7 @@ static PITIDSLHW_T pIhw; + static volatile int bshutdown; + static char info[MAX_STR_SIZE]; + /* Used for DSL Polling enable */ +-static DECLARE_MUTEX_LOCKED (adsl_sem_overlay); ++static struct semaphore adsl_sem_overlay; + + //kthread_t overlay_thread; + /* end of module wide declars */ +@@ -323,6 +353,14 @@ static int tn7dsl_proc_snr_print (char * + #define gDot1(a) ((a>0)?(a%10):((-a)%10)) + // UR8_MERGE_END CQ11054* + ++int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num, ++ unsigned int pace_value) ++{ ++ printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value); ++ return 0; ++} ++ ++ + int os_atoi(const char *pStr) + { + int MulNeg = (*pStr == '-' ? -1 : 1); +@@ -359,39 +397,6 @@ void dprintf (int uDbgLevel, char *szFmt + #endif + } + +-int strcmp(const char *s1, const char *s2) +-{ +- +- int size = strlen(s1); +- +- return(strncmp(s1, s2, size)); +-} +- +-int strncmp(const char *s1, const char *s2, size_t size) +-{ +- int i = 0; +- int max_size = (int)size; +- +- while((s1[i] != 0) && i < max_size) +- { +- if(s2[i] == 0) +- { +- return -1; +- } +- if(s1[i] != s2[i]) +- { +- return 1; +- } +- i++; +- } +- if(s2[i] != 0) +- { +- return 1; +- } +- +- return 0; +-} +- + // * UR8_MERGE_START CQ10640 Jack Zhang + int tn7dsl_dump_dsp_memory(char *input_str) //cph99 + { +@@ -441,101 +446,79 @@ unsigned int shim_osGetCpuFrequency(void + return CpuFrequency; + } + +-int shim_osLoadFWImage(unsigned char *ptr) ++static void avsar_release(struct device *dev) + { +- unsigned int bytesRead; +- mm_segment_t oldfs; +- static struct file *filp; +- unsigned int imageLength=0x5ffff; +- +- +- dgprintf(4, "tn7dsl_read_dsp()\n"); +- +- dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH); +- +- filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); +- if(filp ==NULL) +- { +- printk("Failed: Could not open DSP binary file\n"); +- return -1; +- } +- +- if (filp->f_dentry != NULL) +- { +- if (filp->f_dentry->d_inode != NULL) +- { +- printk ("DSP binary filesize = %d bytes\n", +- (int) filp->f_dentry->d_inode->i_size); +- imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200; +- } +- } +- +- if (filp->f_op->read==NULL) +- return -1; /* File(system) doesn't allow reads */ +- +- /* +- * Disable parameter checking +- */ +- oldfs = get_fs(); +- set_fs(KERNEL_DS); +- +- /* +- * Now read bytes from postion "StartPos" +- */ +- filp->f_pos = 0; +- +- bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos); +- +- dgprintf(4,"file length = %d\n", bytesRead); +- +- set_fs(oldfs); +- +- /* +- * Close the file +- */ +- fput(filp); +- +- return bytesRead; ++ printk(KERN_DEBUG "avsar firmware released\n"); + } + ++static struct device avsar = { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) ++ .bus_id = "vlynq", ++#endif ++ .release = avsar_release, ++}; + +-unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset, +- unsigned int secLength) ++int shim_osLoadFWImage(unsigned char *ptr) + { +- unsigned int bytesRead; +- mm_segment_t oldfs; +- struct file *filp; +- +- dgprintf(4,"shim_read_overlay_page\n"); +- //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength); ++ const struct firmware *fw_entry; ++ size_t size; + +- filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); +- if(filp ==NULL) +- { +- printk("Failed: Could not open DSP binary file\n"); +- return -1; +- } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ++ dev_set_name(&avsar, "avsar"); ++#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); ++ if(device_register(&avsar) < 0) { ++ printk(KERN_ERR ++ "avsar: device_register fails\n"); ++ return -1; ++ } + +- if (filp->f_op->read==NULL) +- return -1; /* File(system) doesn't allow reads */ ++ if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { ++ printk(KERN_ERR ++ "avsar: Firmware not available\n"); ++ device_unregister(&avsar); ++ return -1; ++ } ++ size = fw_entry->size; ++ device_unregister(&avsar); ++ if(size > 0x5ffff) { ++ printk(KERN_ERR ++ "avsar: Firmware too big (%d bytes)\n", size); ++ release_firmware(fw_entry); ++ return -1; ++ } ++ memcpy(ptr, fw_entry->data, size); ++ release_firmware(fw_entry); ++ return size; ++} + +- /* +- * Now read bytes from postion "StartPos" +- */ ++unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength) ++{ ++ const struct firmware *fw_entry; + +- if(filp->f_op->llseek) +- filp->f_op->llseek(filp,secOffset, 0); +- oldfs = get_fs(); +- set_fs(KERNEL_DS); +- filp->f_pos = secOffset; +- bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos); ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); ++ if(device_register(&avsar) < 0) { ++ printk(KERN_ERR ++ "avsar: device_register fails\n"); ++ return -1; ++ } + +- set_fs(oldfs); +- /* +- * Close the file +- */ +- fput(filp); +- return bytesRead; ++ if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { ++ printk(KERN_ERR ++ "avsar: Firmware not available\n"); ++ device_unregister(&avsar); ++ return -1; ++ } ++ device_unregister(&avsar); ++ if(fw_entry->size > secLength) { ++ printk(KERN_ERR ++ "avsar: Firmware too big (%d bytes)\n", fw_entry->size); ++ release_firmware(fw_entry); ++ return -1; ++ } ++ memcpy(ptr + secOffset, fw_entry->data, secLength); ++ release_firmware(fw_entry); ++ return secLength; + } + + int shim_osLoadDebugFWImage(unsigned char *ptr) +@@ -2845,98 +2828,82 @@ static int tn7dsl_set_dsl(void) + (unsigned int *) &offset, + (unsigned char *) &oamFeature, 4); + +- /* Do only if we are in the new Base PSP 7.4.*/ +- #if ((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) +- /* Check to see if we are operating in the new bit mode. */ +- ptr = prom_getenv("DSL_BIT_TMODE"); +- if (ptr) +- { +- /* If we are see if this is the first time the user has upgraded. */ +- ptr = prom_getenv("DSL_UPG_DONE"); +- if(!ptr) +- { +- /* If it is the first time the user is upgrading, then make sure that +- we clear the modulation environment variable, as this could potentially +- not have the same meaning in the new mode. +- */ +- prom_unsetenv("modulation"); +- prom_setenv("DSL_UPG_DONE", "1"); +- } +- } +- #endif +- + // modulation + ptr = prom_getenv("modulation"); +- if (ptr) ++ if (ptr || mp_modulation != NULL) + { +- tn7dsl_set_modulation(ptr, FALSE); ++ tn7dsl_set_modulation(mp_modulation == NULL ? ptr : mp_modulation, FALSE); + } + + // Fine Gains + ptr = prom_getenv("fine_gain_control"); +- if (ptr) ++ if (ptr || mp_fine_gain_control != -1) + { +- value = os_atoi(ptr); ++ value = mp_fine_gain_control == -1 ? os_atoi(ptr) : mp_fine_gain_control; + tn7dsl_ctrl_fineGain(value); + } + ptr = NULL; + ptr = prom_getenv("fine_gain_value"); +- if(ptr) +- tn7dsl_set_fineGainValue(os_atoh(ptr)); ++ if(ptr || mp_fine_gain_value != -1) ++ tn7dsl_set_fineGainValue(mp_fine_gain_value == -1 ? os_atoh(ptr) : mp_fine_gain_value); + + // margin retrain + ptr = NULL; + ptr = prom_getenv("enable_margin_retrain"); +- if(ptr) ++ value = mp_enable_margin_retrain == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_enable_margin_retrain; ++ ++ if (value == 1) + { +- value = os_atoi(ptr); +- if(value == 1) ++ dslhal_api_setMarginMonitorFlags(pIhw, 0, 1); ++ bMarginRetrainEnable = 1; ++ //printk("enable showtime margin monitor.\n"); ++ ++ ptr = NULL; ++ ptr = prom_getenv("margin_threshold"); ++ value = mp_margin_threshold == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_margin_threshold; ++ ++ if(value >= 0) + { +- dslhal_api_setMarginMonitorFlags(pIhw, 0, 1); +- bMarginRetrainEnable = 1; +- //printk("enable showtime margin monitor.\n"); +- ptr = NULL; +- ptr = prom_getenv("margin_threshold"); +- if(ptr) +- { +- value = os_atoi(ptr); +- //printk("Set margin threshold to %d x 0.5 db\n",value); +- if(value >= 0) +- { +- dslhal_api_setMarginThreshold(pIhw, value); +- bMarginThConfig=1; +- } +- } ++ dslhal_api_setMarginThreshold(pIhw, value); ++ bMarginThConfig=1; + } + } + + // rate adapt + ptr = NULL; + ptr = prom_getenv("enable_rate_adapt"); +- if(ptr) ++ if(ptr || mp_enable_rate_adapt != -1) + { +- dslhal_api_setRateAdaptFlag(pIhw, os_atoi(ptr)); ++ dslhal_api_setRateAdaptFlag(pIhw, mp_enable_rate_adapt == -1 ? os_atoi(ptr) : mp_enable_rate_adapt); ++ } ++ ++ // set powercutback ++ ptr = NULL; ++ ptr = prom_getenv("powercutback"); ++ if(ptr || mp_powercutback != -1) ++ { ++ dslhal_advcfg_onOffPcb(pIhw, mp_powercutback == -1 ? os_atoi(ptr) : mp_powercutback); + } + + // trellis + ptr = NULL; + ptr = prom_getenv("trellis"); +- if(ptr) ++ if(ptr || mp_trellis != -1) + { +- dslhal_api_setTrellisFlag(pIhw, os_atoi(ptr)); +- trellis = os_atoi(ptr); ++ trellis = mp_trellis == -1 ? os_atoi(ptr) : mp_trellis; ++ dslhal_api_setTrellisFlag(pIhw, trellis); + //printk("trellis=%d\n"); + } + + // bitswap + ptr = NULL; + ptr = prom_getenv("bitswap"); +- if(ptr) ++ if(ptr || mp_bitswap != -1) + { + int offset[2] = {33, 0}; + unsigned int bitswap; + +- bitswap = os_atoi(ptr); ++ bitswap = mp_bitswap == -1 ? os_atoi(ptr) : mp_bitswap; + + tn7dsl_generic_read(2, offset); + dslReg &= dslhal_support_byteSwap32(0xFFFFFF00); +@@ -2954,46 +2921,47 @@ static int tn7dsl_set_dsl(void) + // maximum bits per carrier + ptr = NULL; + ptr = prom_getenv("maximum_bits_per_carrier"); +- if(ptr) ++ if(ptr || mp_maximum_bits_per_carrier != -1) + { +- dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, os_atoi(ptr)); ++ dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, mp_maximum_bits_per_carrier == -1 ? os_atoi(ptr) : mp_maximum_bits_per_carrier); + } + + // maximum interleave depth + ptr = NULL; + ptr = prom_getenv("maximum_interleave_depth"); +- if(ptr) ++ if(ptr || mp_maximum_interleave_depth != -1) + { +- dslhal_api_setMaxInterleaverDepth(pIhw, os_atoi(ptr)); ++ dslhal_api_setMaxInterleaverDepth(pIhw, mp_maximum_interleave_depth == -1 ? os_atoi(ptr) : mp_maximum_interleave_depth); + } + + // inner and outer pairs + ptr = NULL; + ptr = prom_getenv("pair_selection"); +- if(ptr) ++ if(ptr || mp_pair_selection != -1) + { +- dslhal_api_selectInnerOuterPair(pIhw, os_atoi(ptr)); ++ dslhal_api_selectInnerOuterPair(pIhw, mp_pair_selection == -1 ? os_atoi(ptr) : mp_pair_selection); + } + + ptr = NULL; + ptr = prom_getenv("dgas_polarity"); +- if(ptr) ++ if(ptr || mp_dgas_polarity != -1) + { + dslhal_api_configureDgaspLpr(pIhw, 1, 1); +- dslhal_api_configureDgaspLpr(pIhw, 0, os_atoi(ptr)); ++ dslhal_api_configureDgaspLpr(pIhw, 0, mp_dgas_polarity == -1 ? os_atoi(ptr) : mp_dgas_polarity); + } + + ptr = NULL; + ptr = prom_getenv("los_alarm"); +- if(ptr) ++ if(ptr || mp_los_alarm != -1) + { +- dslhal_api_disableLosAlarm(pIhw, os_atoi(ptr)); ++ dslhal_api_disableLosAlarm(pIhw, mp_los_alarm == -1 ? os_atoi(ptr) : mp_los_alarm); + } + + ptr = NULL; + ptr = prom_getenv("eoc_vendor_id"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_id != NULL) + { ++ ptr = mp_eoc_vendor_id == NULL ? ptr : mp_eoc_vendor_id; + for(i=0;i<8;i++) + { + tmp[0]=ptr[i*2]; +@@ -3018,26 +2986,26 @@ static int tn7dsl_set_dsl(void) + } + ptr = NULL; + ptr = prom_getenv("eoc_vendor_revision"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_revision != -1) + { +- value = os_atoi(ptr); ++ value = mp_eoc_vendor_revision == -1 ? os_atoi(ptr) : mp_eoc_vendor_revision; + //printk("eoc rev=%d\n", os_atoi(ptr)); + dslhal_api_setEocRevisionNumber(pIhw, (char *)&value); + + } + ptr = NULL; + ptr = prom_getenv("eoc_vendor_serialnum"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_serialnum != NULL) + { +- dslhal_api_setEocSerialNumber(pIhw, ptr); ++ dslhal_api_setEocSerialNumber(pIhw, mp_eoc_vendor_serialnum == NULL ? ptr : mp_eoc_vendor_serialnum); + } + + // CQ10037 Added invntry_vernum environment variable to be able to set version number in ADSL2, ADSL2+ modes. + ptr = NULL; + ptr = prom_getenv("invntry_vernum"); +- if(ptr) ++ if(ptr || mp_invntry_vernum != NULL) + { +- dslhal_api_setEocRevisionNumber(pIhw, ptr); ++ dslhal_api_setEocRevisionNumber(pIhw, mp_invntry_vernum == NULL ? ptr : mp_invntry_vernum); + } + + return 0; +@@ -3064,6 +3032,7 @@ int tn7dsl_init(void *priv) + int high_precision_selected = 0; + // UR8_MERGE_END CQ11054* + ++ sema_init(&adsl_sem_overlay, 0); + /* + * start dsl + */ +@@ -3081,7 +3050,7 @@ int tn7dsl_init(void *priv) + * backward compatibility. + */ + cp = prom_getenv("DSL_BIT_TMODE"); +- if (cp) ++ if (cp || mp_dsl_bit_tmode != -1) + { + printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__); + /* +@@ -3110,9 +3079,9 @@ int tn7dsl_init(void *priv) + + // UR8_MERGE_START CQ11054 Jack Zhang + cp = prom_getenv("high_precision"); +- if (cp) ++ if (cp || mp_high_precision != -1) + { +- high_precision_selected = os_atoi(cp); ++ high_precision_selected = mp_high_precision == -1 ? os_atoi(cp) : mp_high_precision; + } + if ( high_precision_selected) + { +@@ -3442,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, + */ + if(write) + { +- ret = proc_dostring(ctl, write, filp, buffer, lenp); ++ ret = proc_dostring(ctl, write, buffer, lenp, filp); + + switch (ctl->ctl_name) + { +@@ -3528,14 +3497,14 @@ static int dslmod_sysctl(ctl_table *ctl, + else + { + len += sprintf(info+len, mod_req); +- ret = proc_dostring(ctl, write, filp, buffer, lenp); ++ ret = proc_dostring(ctl, write, buffer, lenp, filp); + } + return ret; + } + + + ctl_table dslmod_table[] = { +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, &dslmod_sysctl} ++ {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + , + {0} + }; +@@ -3558,8 +3527,7 @@ void tn7dsl_dslmod_sysctl_register(void) + if (initialized == 1) + return; + +- dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1); +- dslmod_root_table->child->de->owner = THIS_MODULE; ++ dslmod_sysctl_header = register_sysctl_table(dslmod_root_table); + + /* + * set the defaults +@@ -4821,4 +4789,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** + } + #endif //NO_ADV_STATS + #endif //TR69_PMD_IN +-// * UR8_MERGE_END CQ11057 * +\ No newline at end of file ++// * UR8_MERGE_END CQ11057 * diff --git a/package/sangam-atm/patches/patch-tn7sar_c b/package/sangam-atm/patches/patch-tn7sar_c new file mode 100644 index 000000000..4f9f587e3 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7sar_c @@ -0,0 +1,79 @@ +--- sangam-atm-1.0.orig/tn7sar.c 2007-05-18 09:46:30.000000000 +0200 ++++ sangam-atm-1.0/tn7sar.c 2009-12-17 19:10:27.628421613 +0100 +@@ -42,7 +42,6 @@ + * UR8_MERGE_END CQ10700 + *******************************************************************************/ + +-#include + #include + #include + #include +@@ -50,12 +49,19 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include ++#include + ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif + + #define _CPHAL_AAL5 + #define _CPHAL_SAR +@@ -74,6 +80,8 @@ typedef void OS_SETUP; + /* PDSP Firmware files */ + #include "tnetd7300_sar_firm.h" + ++extern int mp_oam_lb_timeout; ++extern int mp_autopvc_enable; + + enum + { +@@ -103,10 +111,10 @@ enum + + #define RESERVED_OAM_CHANNEL 15 + +-#define AAL5_PARM "id=aal5, base = 0x03000000, offset = 0, int_line=15, ch0=[RxBufSize=1522; RxNumBuffers = 32; RxServiceMax = 50; TxServiceMax=50; TxNumBuffers=32; CpcsUU=0x5aa5; TxVc_CellRate=0x3000; TxVc_AtmHeader=0x00000640]" +-#define SAR_PARM "id=sar,base = 0x03000000, reset_bit = 9, offset = 0; UniNni = 0, PdspEnable = 1" ++#define CH0_PARM "RxBufSize=1522, RxNumBuffers=32, RxServiceMax=50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640" ++#define AAL5_PARM "id=aal5, base=0x03000000, offset=0, int_line=15, ch0=[" CH0_PARM "]" ++#define SAR_PARM "id=sar, base=0x03000000, reset_bit=9, offset=0; UniNni=0, PdspEnable=1, Debug=0xFFFFFFFF" + #define RESET_PARM "id=ResetControl, base=0xA8611600" +-#define CH0_PARM "RxBufSize=1522, RxNumBuffers = 32, RxServiceMax = 50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640" + + #define MAX_PVC_TABLE_ENTRY 16 + +@@ -817,9 +825,9 @@ int tn7sar_setup_oam_channel(Tn7AtmPriva + pHalDev = (HAL_DEVICE *)priv->pSarHalDev; + + pauto_pvc = prom_getenv("autopvc_enable"); +- if(pauto_pvc) //CQ10273 ++ if(pauto_pvc || mp_autopvc_enable != -1) //CQ10273 + { +- auto_pvc =tn7sar_strtoul(pauto_pvc, NULL, 10); ++ auto_pvc = mp_autopvc_enable == -1 ? tn7sar_strtoul(pauto_pvc, NULL, 10) : mp_autopvc_enable; + } + + memset(&chInfo, 0xff, sizeof(chInfo)); +@@ -985,9 +993,9 @@ int tn7sar_init(struct atm_dev *dev, Tn7 + + /* read in oam lb timeout value */ + pLbTimeout = prom_getenv("oam_lb_timeout"); +- if(pLbTimeout) ++ if(pLbTimeout || mp_oam_lb_timeout != -1) + { +- lbTimeout =tn7sar_strtoul(pLbTimeout, NULL, 10); ++ lbTimeout = mp_oam_lb_timeout == -1 ? tn7sar_strtoul(pLbTimeout, NULL, 10) : mp_oam_lb_timeout; + oamLbTimeout = lbTimeout; + pHalFunc->Control(pHalDev,"OamLbTimeout", "Set", &lbTimeout); + } -- cgit v1.2.3 From ae9865fdf285cd9176cca74d4f9592ed75a0a1c4 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 21:28:58 +0100 Subject: update to latest upstream version --- package/iptables/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'package') diff --git a/package/iptables/Makefile b/package/iptables/Makefile index 0548aad57..6be328253 100644 --- a/package/iptables/Makefile +++ b/package/iptables/Makefile @@ -4,9 +4,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= iptables -PKG_VERSION:= 1.4.5 -PKG_RELEASE:= 2 -PKG_MD5SUM:= 44f13990132c20299c1994cd6f425140 +PKG_VERSION:= 1.4.6 +PKG_RELEASE:= 1 +PKG_MD5SUM:= c67cf30e281a924def6426be0973df56 PKG_DESCR:= The netfilter firewalling software PKG_SECTION:= net PKG_URL:= http://www.netfilter.org -- cgit v1.2.3 From 29aeaabe6982746e79cdec6ce8975f1207c1a1dc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 21:29:56 +0100 Subject: cosmetic changes --- package/squid/Config.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'package') diff --git a/package/squid/Config.in b/package/squid/Config.in index c597986d8..61eb6ac75 100644 --- a/package/squid/Config.in +++ b/package/squid/Config.in @@ -32,7 +32,8 @@ config ADK_COMPILE_SQUID_WITH_UCLIBCXX endchoice -menu "squid............................. proxy and web cache modules" +menu "squid-modules...................... proxy and web cache modules" +depends on ADK_PACKAGE_SQUID config ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_GETPWNAM prompt "squid-mod-basic-auth-getpwnam....... getpwnam basic authentication helper" -- cgit v1.2.3 From ecccdfb45e27df5d9ee6deba57fb4fa28131a59d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 18 Dec 2009 08:44:40 +0100 Subject: enable pppoa and fix dsl driver - fix dsl driver crash, sync is now successful - add ppp ppp over atm --- package/ppp/Config.in | 12 +++--- package/ppp/Makefile | 6 +++ package/sangam-atm/patches/patch-tn7atm_h | 8 +++- package/sangam-atm/patches/patch-tn7dsl_c | 69 ++++++++++++++++++++++++------- 4 files changed, 72 insertions(+), 23 deletions(-) (limited to 'package') diff --git a/package/ppp/Config.in b/package/ppp/Config.in index 0969ae40a..68b5c4d66 100644 --- a/package/ppp/Config.in +++ b/package/ppp/Config.in @@ -5,12 +5,12 @@ config ADK_PACKAGE_PPP default n select ADK_KPACKAGE_KMOD_PPP -#config ADK_PACKAGE_PPP_MOD_PPPOA -# prompt "ppp-mod-pppoa................... PPPoA (PPP over ATM) plugin" -# tristate -# default n -# select ADK_KPACKAGE_KMOD_PPPOATM -# depends on ADK_PACKAGE_PPP +config ADK_PACKAGE_PPP_MOD_PPPOA + prompt "ppp-mod-pppoa................... PPPoA (PPP over ATM) plugin" + tristate + default n + select ADK_KPACKAGE_KMOD_PPPOATM + depends on ADK_PACKAGE_PPP config ADK_PACKAGE_PPP_MOD_PPPOE prompt "ppp-mod-pppoe................... PPPoE (PPP over Ethernet) plugin" diff --git a/package/ppp/Makefile b/package/ppp/Makefile index 295c19b0e..350095cb6 100644 --- a/package/ppp/Makefile +++ b/package/ppp/Makefile @@ -39,6 +39,7 @@ XAKE_FLAGS+= CC="${TARGET_CC}" \ SUB_INSTALLS-y:= SUB_INSTALLS-m:= SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPOE}+= mod-pppoe-install +SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPOA}+= mod-pppoa-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_RADIUS}+= mod-radius-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_CHAT}+= mod-chat-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPDUMP}+= mod-pppdump-install @@ -81,6 +82,11 @@ mod-pppoe-install: ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \ ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION) +mod-pppoa-install: + ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) + ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \ + ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) + mod-chat-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_CHAT}/usr/sbin ${CP} ${WRKINST}/usr/sbin/chat ${IDIR_PPP_MOD_CHAT}/usr/sbin/ diff --git a/package/sangam-atm/patches/patch-tn7atm_h b/package/sangam-atm/patches/patch-tn7atm_h index e26e0441a..fd9ca3db1 100644 --- a/package/sangam-atm/patches/patch-tn7atm_h +++ b/package/sangam-atm/patches/patch-tn7atm_h @@ -1,5 +1,5 @@ --- sangam-atm-1.0.orig/tn7atm.h 2006-04-05 07:33:06.000000000 +0200 -+++ sangam-atm-1.0/tn7atm.h 2009-12-17 19:15:08.310494800 +0100 ++++ sangam-atm-1.0/tn7atm.h 2009-12-17 23:42:04.069784991 +0100 @@ -19,7 +19,8 @@ //#include "mips_support.h" #include @@ -48,3 +48,9 @@ #ifdef CONFIG_LED_MODULE #ifndef BASE_PSP_7X #include +@@ -275,4 +245,4 @@ typedef struct + #define PHYS_TO_K1(X) (PHYS_ADDR(X)|K1BASE) + #endif + +-#endif __TN7ATM_H ++#endif diff --git a/package/sangam-atm/patches/patch-tn7dsl_c b/package/sangam-atm/patches/patch-tn7dsl_c index 8a06dcfe1..dfbc994ff 100644 --- a/package/sangam-atm/patches/patch-tn7dsl_c +++ b/package/sangam-atm/patches/patch-tn7dsl_c @@ -1,5 +1,5 @@ --- sangam-atm-1.0.orig/tn7dsl.c 2007-01-04 09:04:14.000000000 +0100 -+++ sangam-atm-1.0/tn7dsl.c 2009-12-17 19:22:19.372420289 +0100 ++++ sangam-atm-1.0/tn7dsl.c 2009-12-17 23:40:56.457448616 +0100 @@ -94,7 +94,6 @@ * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance * UR8_MERGE_END CQ11054* @@ -82,7 +82,17 @@ //kthread_t overlay_thread; /* end of module wide declars */ -@@ -323,6 +353,14 @@ static int tn7dsl_proc_snr_print (char * +@@ -309,8 +339,7 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -323,6 +352,14 @@ static int tn7dsl_proc_snr_print (char * #define gDot1(a) ((a>0)?(a%10):((-a)%10)) // UR8_MERGE_END CQ11054* @@ -97,7 +107,7 @@ int os_atoi(const char *pStr) { int MulNeg = (*pStr == '-' ? -1 : 1); -@@ -359,39 +397,6 @@ void dprintf (int uDbgLevel, char *szFmt +@@ -359,39 +396,6 @@ void dprintf (int uDbgLevel, char *szFmt #endif } @@ -137,7 +147,7 @@ // * UR8_MERGE_START CQ10640 Jack Zhang int tn7dsl_dump_dsp_memory(char *input_str) //cph99 { -@@ -441,101 +446,79 @@ unsigned int shim_osGetCpuFrequency(void +@@ -441,101 +445,79 @@ unsigned int shim_osGetCpuFrequency(void return CpuFrequency; } @@ -302,7 +312,15 @@ } int shim_osLoadDebugFWImage(unsigned char *ptr) -@@ -2845,98 +2828,82 @@ static int tn7dsl_set_dsl(void) +@@ -2834,7 +2816,6 @@ static int tn7dsl_set_dsl(void) + int value; + int i, offset[2]={4,11},oamFeature=0; + char tmp[4]; +- char dspVer[10]; + + // OAM Feature Configuration + dslhal_api_dspInterfaceRead (pIhw, (unsigned int) pIhw->pmainAddr, 2, +@@ -2845,98 +2826,82 @@ static int tn7dsl_set_dsl(void) (unsigned int *) &offset, (unsigned char *) &oamFeature, 4); @@ -436,7 +454,7 @@ tn7dsl_generic_read(2, offset); dslReg &= dslhal_support_byteSwap32(0xFFFFFF00); -@@ -2954,46 +2921,47 @@ static int tn7dsl_set_dsl(void) +@@ -2954,46 +2919,47 @@ static int tn7dsl_set_dsl(void) // maximum bits per carrier ptr = NULL; ptr = prom_getenv("maximum_bits_per_carrier"); @@ -495,7 +513,7 @@ for(i=0;i<8;i++) { tmp[0]=ptr[i*2]; -@@ -3018,26 +2986,26 @@ static int tn7dsl_set_dsl(void) +@@ -3018,26 +2984,26 @@ static int tn7dsl_set_dsl(void) } ptr = NULL; ptr = prom_getenv("eoc_vendor_revision"); @@ -528,7 +546,7 @@ } return 0; -@@ -3064,6 +3032,7 @@ int tn7dsl_init(void *priv) +@@ -3064,6 +3030,7 @@ int tn7dsl_init(void *priv) int high_precision_selected = 0; // UR8_MERGE_END CQ11054* @@ -536,7 +554,7 @@ /* * start dsl */ -@@ -3081,7 +3050,7 @@ int tn7dsl_init(void *priv) +@@ -3081,7 +3048,7 @@ int tn7dsl_init(void *priv) * backward compatibility. */ cp = prom_getenv("DSL_BIT_TMODE"); @@ -545,7 +563,7 @@ { printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__); /* -@@ -3110,9 +3079,9 @@ int tn7dsl_init(void *priv) +@@ -3110,9 +3077,9 @@ int tn7dsl_init(void *priv) // UR8_MERGE_START CQ11054 Jack Zhang cp = prom_getenv("high_precision"); @@ -557,21 +575,40 @@ } if ( high_precision_selected) { -@@ -3442,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3419,8 +3386,7 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3432,7 +3398,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (!*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3442,7 +3408,7 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { - ret = proc_dostring(ctl, write, filp, buffer, lenp); -+ ret = proc_dostring(ctl, write, buffer, lenp, filp); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); switch (ctl->ctl_name) { -@@ -3528,14 +3497,14 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3528,14 +3494,14 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); - ret = proc_dostring(ctl, write, filp, buffer, lenp); -+ ret = proc_dostring(ctl, write, buffer, lenp, filp); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } @@ -583,7 +620,7 @@ , {0} }; -@@ -3558,8 +3527,7 @@ void tn7dsl_dslmod_sysctl_register(void) +@@ -3558,8 +3524,7 @@ void tn7dsl_dslmod_sysctl_register(void) if (initialized == 1) return; @@ -593,7 +630,7 @@ /* * set the defaults -@@ -4821,4 +4789,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4821,4 +4786,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** } #endif //NO_ADV_STATS #endif //TR69_PMD_IN -- cgit v1.2.3 From 163e7965f05a281d653a9eaa72161172e35fd5fc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 18 Dec 2009 19:26:51 +0100 Subject: make pppoe over atm usable on ag241 - bridging nas0 and eth0 although works fine need to add pre-up scripts to automate.. --- package/linux-atm/Config.in | 1 + package/ppp/Makefile | 17 ++-- package/ppp/files/etc/ppp/filter | 23 ------ package/ppp/files/etc/ppp/ip-up.d/if-rename | 17 ---- package/ppp/files/etc/ppp/peers/dsl | 12 --- package/ppp/files/etc/ppp/templates/dsl | 9 --- package/ppp/files/etc/ppp/templates/pppoa | 5 ++ package/ppp/files/etc/ppp/templates/pppoe | 9 +++ package/ppp/files/poff | 26 +++--- package/ppp/files/pon | 6 -- package/ppp/files/ppp.pre-up | 119 ++++++++++++++++++++++++++++ package/ppp/patches/patch-pppd_ipv6cp_c | 10 +++ package/ppp/utils/pfc.c | 51 ------------ 13 files changed, 168 insertions(+), 137 deletions(-) delete mode 100644 package/ppp/files/etc/ppp/filter delete mode 100755 package/ppp/files/etc/ppp/ip-up.d/if-rename delete mode 100644 package/ppp/files/etc/ppp/peers/dsl delete mode 100644 package/ppp/files/etc/ppp/templates/dsl create mode 100644 package/ppp/files/etc/ppp/templates/pppoa create mode 100644 package/ppp/files/etc/ppp/templates/pppoe create mode 100644 package/ppp/patches/patch-pppd_ipv6cp_c delete mode 100644 package/ppp/utils/pfc.c (limited to 'package') diff --git a/package/linux-atm/Config.in b/package/linux-atm/Config.in index 3991c679f..06b2a9476 100644 --- a/package/linux-atm/Config.in +++ b/package/linux-atm/Config.in @@ -8,6 +8,7 @@ config ADK_PACKAGE_BR2684CTL tristate default n select ADK_PACKAGE_LIBATM + select ADK_KPACKAGE_KMOD_ATM_BR2684 select ADK_COMPILE_LINUX_ATM depends on !ADK_HOST_FREEBSD help diff --git a/package/ppp/Makefile b/package/ppp/Makefile index 350095cb6..322812d9c 100644 --- a/package/ppp/Makefile +++ b/package/ppp/Makefile @@ -5,9 +5,9 @@ include ${TOPDIR}/rules.mk PKG_NAME:= ppp PKG_VERSION:= 2.4.4 -PKG_RELEASE:= 17 +PKG_RELEASE:= 18 PKG_MD5SUM:= 183800762e266132218b204dfb428d29 -PKG_DESCR:= a PPP (Point-to-Point Protocol) software (with MPPE/MPPC support) +PKG_DESCR:= Point-to-Point Protocol software PKG_SECTION:= net PKG_DEPENDS:= kmod-ppp PKG_URL:= http://ppp.samba.org @@ -57,7 +57,6 @@ post-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y} ${INSTALL_FILTER} ${INSTALL_BIN} ./files/etc/ppp/ip-up ${IDIR_PPP}/etc/ppp/ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/ip-up.d - ${INSTALL_BIN} ./files/etc/ppp/ip-up.d/if-rename ${IDIR_PPP}/etc/ppp/ip-up.d/ ${INSTALL_BIN} ./files/etc/ppp/ip-down ${IDIR_PPP}/etc/ppp/ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/ip-down.d ${INSTALL_DIR} ${IDIR_PPP}/usr/sbin @@ -66,8 +65,10 @@ post-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y} ${INSTALL_BIN} ./files/pon ${IDIR_PPP}/usr/sbin/ ${INSTALL_BIN} ./files/poff ${IDIR_PPP}/usr/sbin/ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/peers - ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/templates - ${INSTALL_DATA} ./files/etc/ppp/templates/dsl ${IDIR_PPP}/etc/ppp/templates/ + $(INSTALL_DIR) ${IDIR_PPP}/etc/network/if-pre-up.d + $(INSTALL_BIN) ./files/ppp.pre-up \ + ${IDIR_PPP}/etc/network/if-pre-up.d/ppp + mod-radius-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient @@ -81,11 +82,17 @@ mod-pppoe-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION) ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \ ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION) + ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOE}/etc/ppp/templates + ${INSTALL_DATA} ./files/etc/ppp/templates/pppoe \ + ${IDIR_PPP_MOD_PPPOE}/etc/ppp/templates/ mod-pppoa-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \ ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) + ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOA}/etc/ppp/templates + ${INSTALL_DATA} ./files/etc/ppp/templates/pppoa \ + ${IDIR_PPP_MOD_PPPOA}/etc/ppp/templates/ mod-chat-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_CHAT}/usr/sbin diff --git a/package/ppp/files/etc/ppp/filter b/package/ppp/files/etc/ppp/filter deleted file mode 100644 index ec72a81a0..000000000 --- a/package/ppp/files/etc/ppp/filter +++ /dev/null @@ -1,23 +0,0 @@ -# -# Expression: outbound and not icmp[0] != 8 and not tcp[13] & 4 != 0 -# -19 -48 0 0 0 -21 0 16 1 -40 0 0 2 -21 0 13 33 -48 0 0 13 -21 0 5 1 -40 0 0 10 -69 9 0 8191 -177 0 0 4 -80 0 0 4 -21 6 7 8 -21 0 5 6 -40 0 0 10 -69 3 0 8191 -177 0 0 4 -80 0 0 17 -69 1 0 4 -6 0 0 4 -6 0 0 0 diff --git a/package/ppp/files/etc/ppp/ip-up.d/if-rename b/package/ppp/files/etc/ppp/ip-up.d/if-rename deleted file mode 100755 index 061fd8861..000000000 --- a/package/ppp/files/etc/ppp/ip-up.d/if-rename +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -exit 0 # This script breaks ppp accounting - -[ "$LINKNAME" ] || exit 0 - -PATH=/bin:/usr/sbin:$PATH -if ip link show dev $LINKNAME >/dev/null;then - logger "$0: interface '$LINKNAME' already exists, cannot rename '$IFNAME'." - exit 0 -fi - -if ip route | grep -qE "^default.*dev $IFNAME *$"; then DEFAULT_ROUTE=1; fi - -ip link set $IFNAME down -ip link set $IFNAME name $LINKNAME -ip link set $LINKNAME up -if [ -n "$DEFAULT_ROUTE" ]; then ip route add default via $IPREMOTE; fi diff --git a/package/ppp/files/etc/ppp/peers/dsl b/package/ppp/files/etc/ppp/peers/dsl deleted file mode 100644 index 7ffc38082..000000000 --- a/package/ppp/files/etc/ppp/peers/dsl +++ /dev/null @@ -1,12 +0,0 @@ -plugin rp-pppoe.so -ipcp-accept-remote -ipcp-accept-local -usepeerdns -defaultroute -lcp-echo-interval 10 -lcp-echo-failure 3 -persist -maxfail 0 - -user "user@t-online.de" -password "secret" diff --git a/package/ppp/files/etc/ppp/templates/dsl b/package/ppp/files/etc/ppp/templates/dsl deleted file mode 100644 index 2ad285ede..000000000 --- a/package/ppp/files/etc/ppp/templates/dsl +++ /dev/null @@ -1,9 +0,0 @@ -plugin rp-pppoe.so -defaultroute -usepeerdns -lcp-echo-interval 10 -lcp-echo-failure 3 -#IDLEOPTIONS# -user #USERNAME# -password #PASSWORD# -#DEVICE# diff --git a/package/ppp/files/etc/ppp/templates/pppoa b/package/ppp/files/etc/ppp/templates/pppoa new file mode 100644 index 000000000..f3a142791 --- /dev/null +++ b/package/ppp/files/etc/ppp/templates/pppoa @@ -0,0 +1,5 @@ +plugin pppoatm.so +#VPI#.#VCI# +#ENCAPS# +user #USERNAME# +password #PASSWORD# diff --git a/package/ppp/files/etc/ppp/templates/pppoe b/package/ppp/files/etc/ppp/templates/pppoe new file mode 100644 index 000000000..2ad285ede --- /dev/null +++ b/package/ppp/files/etc/ppp/templates/pppoe @@ -0,0 +1,9 @@ +plugin rp-pppoe.so +defaultroute +usepeerdns +lcp-echo-interval 10 +lcp-echo-failure 3 +#IDLEOPTIONS# +user #USERNAME# +password #PASSWORD# +#DEVICE# diff --git a/package/ppp/files/poff b/package/ppp/files/poff index 955cebe8c..d81dcac2e 100755 --- a/package/ppp/files/poff +++ b/package/ppp/files/poff @@ -1,14 +1,12 @@ -#!/bin/mksh -(busybox ps ww | grep "[ /]pppd call $1\( .*\)*\$") |& -found=0 -rv=0 -while read thepid rest; do - if ! kill $thepid; then - print -u2 "$0: kill $thepid failed" - rv=1 - fi - found=1 -done -[[ $found = 1 ]] && exit $rv -print -u2 "$0: I could not find a pppd process for provider '$1'." -exit 1 +#!/bin/sh +PID=`ps w | grep "[ /]pppd call $1\( .*\)*\$" | awk '{print $1}'` +if test -n "$PID" ; then + kill $PID || { + echo "$0: kill failed." + exit 1 + } +else + echo "$0: I could not find a pppd process for provider '$1'." + exit 1 +fi +exit 0 diff --git a/package/ppp/files/pon b/package/ppp/files/pon index 1c2e5c50c..831730d19 100755 --- a/package/ppp/files/pon +++ b/package/ppp/files/pon @@ -1,8 +1,2 @@ #!/bin/sh -insmod slhc.o 2>/dev/null -insmod ppp_generic.o 2>/dev/null -insmod pppox.o 2>/dev/null -insmod pppoe.o 2>/dev/null -insmod ppp_async.o 2>/dev/null - exec /usr/sbin/pppd call $@ >/dev/null 2>&1 diff --git a/package/ppp/files/ppp.pre-up b/package/ppp/files/ppp.pre-up index e69de29bb..ec6cc5a31 100755 --- a/package/ppp/files/ppp.pre-up +++ b/package/ppp/files/ppp.pre-up @@ -0,0 +1,119 @@ +#!/bin/sh + +[ "$METHOD" == "ppp" ] || exit 0 +[ "$IF_USE_TEMPLATE" ] || exit 0 + +[ -d /var/lock ] || mkdir /var/lock + +[ -f "/etc/ppp/templates/$IF_USE_TEMPLATE" ] || { + logger "$0: requested template '/etc/ppp/templates/$IF_USE_TEMPLATE' not found." + exit 1 +} + +IDLEOPTIONS="persist\nmaxfail 0" +if [ "$IF_PPP_IDLETIME" -gt 0 ]; then + IDLEOTPIONS="idletime $IF_PPP_IDLETIME" +fi + +if [ "$IF_PPP_MTU" -gt 0 ] ; then + NETWORKOPTIONS="mtu $IF_PPP_MTU\nmru $IF_PPP_MTU" +fi + +REPLACE=" + s,#IDLEOPTIONS#,$IDLEOPTIONS, + s,#ENCAPS#,$IF_PPP_ENCAPS, + s,#VPI#,$IF_PPP_VPI, + s,#VCI#,$IF_PPP_VCI, + s,#USERNAME#,$IF_PPP_USERNAME, + s,#PASSWORD#,$IF_PPP_PASSWORD, + s,#DEVICE#,$IF_PPP_DEVICE, + s,#MODEMIP#,$IF_PPP_MODEMIP, + s,#NETWORKOPTIONS#,$NETWORKOPTIONS, +" + +sed "$REPLACE" < /etc/ppp/templates/$IF_USE_TEMPLATE > /etc/ppp/peers/$IF_PROVIDER + +[ "$IF_PPP_ENCAPS" ] || encap=0 +[ "$IF_PPP_PAYLOAD" ] || payload=1 +[ "$IF_PPP_VPI" ] || $IF_PPP_VPI=1 +[ "$IF_PPP_PAYLOAD" ] || $IF_PPP_VCI=32 + +case "$IF_PPP_PAYLOAD" in +bridged) + payload=1 + ;; +routed) + payload=0 + ;; +*) + echo "Wrong payload, use either bridged or routed" + exit 1 + ;; +esac + +case "$IF_PPP_ENCAPS" in +llc) + encap=0 + ;; +vc) + encap=1 + ;; +*) + echo "Wrong Encapsulation use either llc or vc" + exit 1 + ;; +esac + +case "$IF_PPP_DEVICE" in +nas*) + count=$(echo $IF_PPP_DEVICE|sed -e "s/nas//") + br2684ctl -b -c $count -e $encap -p $payload -a $IF_PPP_VPI.$IF_PPP_VCI + ip link set up dev $IF_PPP_DEVICE + ;; +esac + +case "$IF_USE_TEMPLATE" in +umts) + # set UMTS-LED to green (bit 3) + LED=$(cat /proc/sys/diag) + echo $((LED | 8)) > /proc/sys/diag + + # wait for card to initialize + COUNT=0 + while [ $((COUNT++)) -lt 20 ]; do + [ -c "$IF_PPP_DEVICE" ] && break + [ $COUNT -eq 20 ] && { + logger "$0: '$IF_PPP_DEVICE' not found" + exit 1 + } + sleep 1 + done + + # wait till the SIM is ready + comgt -s /etc/comgt/waitready.comgt -d $IF_PPP_DEVICE || exit 1 + + # set pincode + if [ "$IF_UMTS_PINCODE" ]; then + COMGTPIN="$IF_UMTS_PINCODE" comgt PIN -d $IF_PPP_DEVICE || ERROR=1 + fi + + # set APN + COMGTAPN="$IF_UMTS_APN" comgt APN -d $IF_PPP_DEVICE || ERROR=1 + + # set umts/gprs mode if available (Option cards only) + case "$IF_UMTS_MODE" in + gprs_only) comgt 2G -d $IF_PPP_DEVICE ;; + umts_only) comgt 3G -d $IF_PPP_DEVICE ;; + umts_first) comgt 3G2G -d $IF_PPP_DEVICE ;; + "") ;; + *) echo "unknown umts-mode, exiting" + ERROR=1 + ;; + esac + + if [ "$ERROR" == "1" ]; then + echo "$LED" > /proc/sys/diag + exit 1 + fi + ;; +esac diff --git a/package/ppp/patches/patch-pppd_ipv6cp_c b/package/ppp/patches/patch-pppd_ipv6cp_c new file mode 100644 index 000000000..1d4123776 --- /dev/null +++ b/package/ppp/patches/patch-pppd_ipv6cp_c @@ -0,0 +1,10 @@ +--- ppp-2.4.4.orig/pppd/ipv6cp.c 2005-08-26 01:59:34.000000000 +0200 ++++ ppp-2.4.4/pppd/ipv6cp.c 2009-12-18 09:06:00.333449663 +0100 +@@ -151,6 +151,7 @@ + */ + + #include ++#include + #include + #include + #include diff --git a/package/ppp/utils/pfc.c b/package/ppp/utils/pfc.c deleted file mode 100644 index 2344d56ed..000000000 --- a/package/ppp/utils/pfc.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Taken from fli4l 3.0 - * Make sure you compile it against the same libpcap version used in OpenADK - */ - -#include -#include -#include -#include - -#include -#include - -#include -#include - -int main (int argc, char ** argv) -{ - pcap_t *pc; /* Fake struct pcap so we can compile expr */ - struct bpf_program filter; /* Filter program for link-active pkts */ - u_int32_t netmask=0; - - int dflag = 3; - if (argc == 4) - { - if (!strcmp (argv[1], "-d")) - { - dflag = atoi (argv[2]); - argv += 2; - argc -=2; - } - } - if (argc != 2) - { - printf ("usage; %s [ -d ] expression\n", argv[0]); - return 1; - } - - pc = pcap_open_dead(DLT_PPP_PPPD, PPP_HDRLEN); - if (pcap_compile(pc, &filter, argv[1], 1, netmask) == 0) - { - printf ("#\n# Expression: %s\n#\n", argv[1]); - bpf_dump (&filter, dflag); - return 0; - } - else - { - printf("error in active-filter expression: %s\n", pcap_geterr(pc)); - } - return 1; -} -- cgit v1.2.3 From 0e40c7b459f3803bb44bca20304389c6999a2770 Mon Sep 17 00:00:00 2001 From: Waldemar Date: Sat, 19 Dec 2009 14:25:32 +0059 Subject: add more mirbsd compatibility patches --- package/busybox/Makefile | 12 +++--- package/busybox/patches/patch-include_libbb_h | 18 +++++++++ package/busybox/patches/patch-include_platform_h | 47 ++++++++++++++++++++++++ package/uclibc/Makefile | 4 +- 4 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 package/busybox/patches/patch-include_libbb_h create mode 100644 package/busybox/patches/patch-include_platform_h (limited to 'package') diff --git a/package/busybox/Makefile b/package/busybox/Makefile index 6a0569428..78b741ca3 100644 --- a/package/busybox/Makefile +++ b/package/busybox/Makefile @@ -24,30 +24,30 @@ ifeq ($(ADK_NATIVE),y) yes '' | \ $(MAKE) V=1 \ IPKG_ARCH="$(ARCH)" \ - ARCH="$(ARCH)" -C $(WRKBUILD) oldconfig + ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) oldconfig else yes '' | \ $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \ EXTRA_CFLAGS="$(TARGET_CFLAGS)" IPKG_ARCH="$(ARCH)" \ - ARCH="$(ARCH)" -C $(WRKBUILD) oldconfig + ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) oldconfig endif do-build: ifeq ($(ADK_NATIVE),y) $(MAKE) V=1 \ - IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD) busybox + IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) busybox else $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \ - IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD) busybox + IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) busybox endif do-install: ${TOPDIR}/.config ifeq ($(ADK_NATIVE),y) $(MAKE) V=1 \ - IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD) install + IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) install else $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \ - IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD) install + IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) install endif ifeq ($(DEBUG),1) ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \ diff --git a/package/busybox/patches/patch-include_libbb_h b/package/busybox/patches/patch-include_libbb_h new file mode 100644 index 000000000..0087dbde5 --- /dev/null +++ b/package/busybox/patches/patch-include_libbb_h @@ -0,0 +1,18 @@ +--- busybox-1.15.2.orig/include/libbb.h Thu Oct 8 03:04:16 2009 ++++ busybox-1.15.2/include/libbb.h Sat Dec 19 12:42:57 2009 +@@ -48,6 +48,7 @@ + #define PATH_MAX 256 + #endif + ++#if !(defined __APPLE__ || defined __FreeBSD__ || defined __MirBSD__ ) + #ifdef HAVE_MNTENT_H + #include + #endif +@@ -61,6 +62,7 @@ + #include + #include + #include ++#endif + #endif + + #if ENABLE_LOCALE_SUPPORT diff --git a/package/busybox/patches/patch-include_platform_h b/package/busybox/patches/patch-include_platform_h new file mode 100644 index 000000000..7c5539efe --- /dev/null +++ b/package/busybox/patches/patch-include_platform_h @@ -0,0 +1,47 @@ +--- busybox-1.15.2.orig/include/platform.h Sat Sep 26 15:14:33 2009 ++++ busybox-1.15.2/include/platform.h Sat Dec 19 12:53:00 2009 +@@ -7,6 +7,8 @@ + #ifndef BB_PLATFORM_H + #define BB_PLATFORM_H 1 + ++#include ++ + /* Convenience macros to test the version of gcc. */ + #undef __GNUC_PREREQ + #if defined __GNUC__ && defined __GNUC_MINOR__ +@@ -133,7 +135,7 @@ char *strchrnul(const char *s, int c); + # define bswap_32 __bswap32 + # define bswap_16 __bswap16 + # define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN) +-#elif !defined __APPLE__ ++#elif !(defined __APPLE__ || defined BSD) + # include + # include + #endif +@@ -190,7 +192,7 @@ char *strchrnul(const char *s, int c); + + /* ---- Networking ------------------------------------------ */ + +-#ifndef __APPLE__ ++#if !(defined __APPLE__ || defined BSD) + # include + # if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) + typedef int socklen_t; +@@ -202,7 +204,7 @@ typedef int socklen_t; + /* ---- Compiler dependent settings ------------------------- */ + + #if (defined __digital__ && defined __unix__) \ +- || defined __APPLE__ || defined __FreeBSD__ ++ || defined __APPLE__ || defined __FreeBSD__ || defined BSD + # undef HAVE_MNTENT_H + # undef HAVE_SYS_STATFS_H + #else +@@ -231,7 +233,7 @@ typedef int socklen_t; + # define HAVE_FEATURES_H + # include + # define HAVE_STDINT_H +-#elif !defined __APPLE__ ++#elif !(defined __APPLE__ || defined BSD) + /* Largest integral types. */ + # if BB_BIG_ENDIAN + /* Looks BROKEN! */ diff --git a/package/uclibc/Makefile b/package/uclibc/Makefile index c89e20fe6..4d96eceae 100644 --- a/package/uclibc/Makefile +++ b/package/uclibc/Makefile @@ -39,7 +39,7 @@ do-install: HOSTCC="$(HOSTCC)" \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ install_headers - @find $(IDIR_UCLIBC_DEV) -name .install -delete - @find $(IDIR_UCLIBC_DEV) -name ..install.cmd -delete + @find $(IDIR_UCLIBC_DEV) -name .install -exec rm {} \; + @find $(IDIR_UCLIBC_DEV) -name ..install.cmd -exec rm {} \; include ${TOPDIR}/mk/pkg-bottom.mk -- cgit v1.2.3