From: <abe...@us...> - 2013-01-07 07:30:47
|
Revision: 5871 http://astlinux.svn.sourceforge.net/astlinux/?rev=5871&view=rev Author: abelbeck Date: 2013-01-07 07:30:40 +0000 (Mon, 07 Jan 2013) Log Message: ----------- prosody, add a prosody.init script and runlevels, script still needs some work luafilesystem, version bump to 1.6.2 Modified Paths: -------------- branches/1.0/package/luafilesystem/luafilesystem.mk branches/1.0/package/prosody/prosody.mk Added Paths: ----------- branches/1.0/package/prosody/prosody.init Modified: branches/1.0/package/luafilesystem/luafilesystem.mk =================================================================== --- branches/1.0/package/luafilesystem/luafilesystem.mk 2013-01-06 20:32:33 UTC (rev 5870) +++ branches/1.0/package/luafilesystem/luafilesystem.mk 2013-01-07 07:30:40 UTC (rev 5871) @@ -4,7 +4,7 @@ # ############################################################# -LUAFILESYSTEM_VERSION = 1.5.0 +LUAFILESYSTEM_VERSION = 1.6.2 LUAFILESYSTEM_SITE = http://github.com/downloads/keplerproject/luafilesystem LUAFILESYSTEM_DEPENDENCIES = lua Added: branches/1.0/package/prosody/prosody.init =================================================================== --- branches/1.0/package/prosody/prosody.init (rev 0) +++ branches/1.0/package/prosody/prosody.init 2013-01-07 07:30:40 UTC (rev 5871) @@ -0,0 +1,87 @@ +#!/bin/sh + +. /etc/rc.conf + +init () { + + if [ "$XMPP_ENABLE" != "yes" ]; then + exit + fi + + if [ ! -x /usr/bin/prosody ]; then + echo "prosody: XMPP Server Prosody not installed." + exit + fi + + if [ ! -d /mnt/kd/prosody ]; then + mkdir /mnt/kd/prosody + mkdir /mnt/kd/prosody/data + mkdir /mnt/kd/prosody/certs + cp /stat/etc/prosody/prosody.cfg.lua /mnt/kd/prosody/prosody.cfg.lua + find /mnt/kd/prosody -print0 | xargs -0 chown prosody:prosody + chmod 750 /mnt/kd/prosody/data + fi + ln -snf /mnt/kd/prosody /tmp/etc/prosody + chown prosody:prosody /tmp/etc/prosody + + if [ -f /mnt/kd/prosody/prosody.conf ]; then + echo "-- Autogenerated. Edit /mnt/kd/prosody/prosody.conf file. +" >/mnt/kd/prosody/prosody.cfg.lua + cat /mnt/kd/prosody/prosody.conf >>/mnt/kd/prosody/prosody.cfg.lua + else + : # Autogenerate /mnt/kd/prosody/prosody.cfg.lua + fi + chown prosody:prosody /mnt/kd/prosody/prosody.cfg.lua + + mkdir -p /var/run/prosody + chown prosody:prosody /var/run/prosody + + mkdir -p /var/log/prosody + chown prosody:prosody /var/log/prosody +} + +start () { + + if [ "$XMPP_ENABLE" = "yes" ] && grep -q '^[^-]*"posix"' /etc/prosody/prosody.cfg.lua; then + echo "Starting XMPP Server..." + + su -p -c "/usr/bin/prosody" prosody 2>/dev/null + fi +} + +stop () { + + if [ -f /var/run/prosody/prosody.pid ]; then + echo "Stopping XMPP Server..." + + kill $(cat /var/run/prosody/prosody.pid) >/dev/null 2>&1 + fi +} + +case $1 in + +start) + start + ;; + +stop) + stop + ;; + +init) + init + start + ;; + +restart) + stop + sleep 2 + start + ;; + +*) + echo "Usage: start|stop|restart" + ;; + +esac + Property changes on: branches/1.0/package/prosody/prosody.init ___________________________________________________________________ Added: svn:executable + * Modified: branches/1.0/package/prosody/prosody.mk =================================================================== --- branches/1.0/package/prosody/prosody.mk 2013-01-06 20:32:33 UTC (rev 5870) +++ branches/1.0/package/prosody/prosody.mk 2013-01-07 07:30:40 UTC (rev 5871) @@ -25,4 +25,29 @@ ) endef +define PROSODY_POST_INSTALL + mkdir -p $(TARGET_DIR)/stat/etc/prosody + cp $(TARGET_DIR)/etc/prosody/prosody.cfg.lua $(TARGET_DIR)/stat/etc/prosody/prosody.cfg.lua + rm -rf $(TARGET_DIR)/etc/prosody + $(INSTALL) -m 0755 -D package/prosody/prosody.init $(TARGET_DIR)/etc/init.d/prosody + ln -s /tmp/etc/prosody $(TARGET_DIR)/etc/prosody + ln -sf ../../init.d/prosody $(TARGET_DIR)/etc/runlevels/default/S58prosody + ln -sf ../../init.d/prosody $(TARGET_DIR)/etc/runlevels/default/K02prosody +endef + +PROSODY_POST_INSTALL_TARGET_HOOKS = PROSODY_POST_INSTALL + +PROSODY_UNINSTALL_STAGING_OPT = --version + +define PROSODY_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/bin/prosody + rm -f $(TARGET_DIR)/usr/bin/prosodyctl + rm -rf $(TARGET_DIR)/usr/lib/prosody + rm -rf $(TARGET_DIR)/stat/etc/prosody + rm -f $(TARGET_DIR)/etc/prosody + rm -f $(TARGET_DIR)/etc/init.d/prosody + rm -f $(TARGET_DIR)/etc/runlevels/default/S58prosody + rm -f $(TARGET_DIR)/etc/runlevels/default/K02prosody +endef + $(eval $(call AUTOTARGETS,package,prosody)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-01-08 05:37:02
|
Revision: 5874 http://astlinux.svn.sourceforge.net/astlinux/?rev=5874&view=rev Author: abelbeck Date: 2013-01-08 05:36:55 +0000 (Tue, 08 Jan 2013) Log Message: ----------- libidn, version bump to 1.26 icu (libicu), version bump to 4.8.1.1 libidn is *much* smaller, best choice to use with prosody Modified Paths: -------------- branches/1.0/package/icu/icu.mk branches/1.0/package/libidn/libidn.mk Removed Paths: ------------- branches/1.0/package/icu/icu-arm.patch branches/1.0/package/icu/icu-double-escape.patch branches/1.0/package/icu/icu-overflow.patch Deleted: branches/1.0/package/icu/icu-arm.patch =================================================================== --- branches/1.0/package/icu/icu-arm.patch 2013-01-08 00:37:56 UTC (rev 5873) +++ branches/1.0/package/icu/icu-arm.patch 2013-01-08 05:36:55 UTC (rev 5874) @@ -1,25 +0,0 @@ -https://bugs.icu-project.org/trac/ticket/7664 -https://bugs.icu-project.org/trac/changeset/28107 - ---- icu.orig/source/tools/toolutil/pkg_genc.c -+++ icu/source/tools/toolutil/pkg_genc.c -@@ -1,5 +1,5 @@ - /****************************************************************************** -- * Copyright (C) 2009, International Business Machines -+ * Copyright (C) 2009-2010, International Business Machines - * Corporation and others. All Rights Reserved. - ******************************************************************************* - */ -@@ -118,10 +118,10 @@ - } assemblyHeader[] = { - {"gcc", - ".globl %s\n" -- "\t.section .note.GNU-stack,\"\",@progbits\n" -+ "\t.section .note.GNU-stack,\"\",%%progbits\n" - "\t.section .rodata\n" - "\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */ -- "\t.type %s,@object\n" -+ "\t.type %s,%%object\n" - "%s:\n\n", - - ".long ","",HEX_0X Deleted: branches/1.0/package/icu/icu-double-escape.patch =================================================================== --- branches/1.0/package/icu/icu-double-escape.patch 2013-01-08 00:37:56 UTC (rev 5873) +++ branches/1.0/package/icu/icu-double-escape.patch 2013-01-08 05:36:55 UTC (rev 5874) @@ -1,17 +0,0 @@ -We need to double-escape CC & CXX since we've got --sysroot and thus a space -when cross-compiling. - -Signed-off-by: Gustavo Zacarias <gu...@za...> - -diff -Nura icu.orig/source/tools/icuinfo/Makefile.in icu/source/tools/icuinfo/Makefile.in ---- icu.orig/source/tools/icuinfo/Makefile.in 2010-09-29 15:37:26.000000000 -0300 -+++ icu/source/tools/icuinfo/Makefile.in 2010-12-21 13:36:45.393439756 -0300 -@@ -36,7 +36,7 @@ - - ICUINFO_OPTS=-i ../../data/out/build/$(ICUDATA_PLATFORM_NAME) - --CPPFLAGS+= -DU_PLATFORM=\"@platform@\" -DU_BUILD=\"@build@\" -DU_HOST=\"@host@\" -DU_CC=\"@CC@\" -DU_CXX=\"@CXX@\" -+CPPFLAGS+= -DU_PLATFORM=\"@platform@\" -DU_BUILD=\"@build@\" -DU_HOST=\"@host@\" -DU_CC=\""@CC@\"" -DU_CXX=\""@CXX@\"" - # -DENABLE_RELEASE=@ENABLE_RELEASE@ -DENABLE_DEBUG=@ENABLE_DEBUG@ " - - Deleted: branches/1.0/package/icu/icu-overflow.patch =================================================================== --- branches/1.0/package/icu/icu-overflow.patch 2013-01-08 00:37:56 UTC (rev 5873) +++ branches/1.0/package/icu/icu-overflow.patch 2013-01-08 05:36:55 UTC (rev 5874) @@ -1,93 +0,0 @@ - -A combination of issue & patches from... - -https://bugs.icu-project.org/trac/ticket/7680 -https://bugs.icu-project.org/trac/changeset/28002 -https://bugs.icu-project.org/trac/changeset/28124 - -Enlarged buffers more since include files for pkgdata can grow -significantly when cross-compiling. -This ONLY affects building. - -Signed-off-by: Gustavo Zacarias <gu...@za...> - -diff -Nura icu.orig/source/tools/pkgdata/pkgdata.cpp icu/source/tools/pkgdata/pkgdata.cpp ---- icu.orig/source/tools/pkgdata/pkgdata.cpp 2010-09-29 15:37:28.000000000 -0300 -+++ icu/source/tools/pkgdata/pkgdata.cpp 2010-12-21 15:53:30.252554924 -0300 -@@ -97,8 +97,9 @@ - #define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING - #endif - --#define LARGE_BUFFER_MAX_SIZE 2048 --#define SMALL_BUFFER_MAX_SIZE 512 -+#define LARGE_BUFFER_MAX_SIZE 8192 -+#define MEDIUM_BUFFER_MAX_SIZE 4096 -+#define SMALL_BUFFER_MAX_SIZE 2048 - - static void loadLists(UPKGOptions *o, UErrorCode *status); - -@@ -472,29 +473,48 @@ - } - - static int runCommand(const char* command, UBool specialHandling) { -- char cmd[SMALL_BUFFER_MAX_SIZE]; -+ char *cmd = NULL; -+ char cmdBuffer[SMALL_BUFFER_MAX_SIZE]; -+ int32_t len = strlen(command); -+ -+ if (len == 0) { -+ return 0; -+ } - - if (!specialHandling) { -+#if defined(USING_CYGWIN) || defined(OS400) -+#define CMD_PADDING_SIZE 20 -+ if ((len + CMD_PADDING_SIZE) >= SMALL_BUFFER_MAX_SIZE) { -+ cmd = (char *)uprv_malloc(len + CMD_PADDING_SIZE); -+ } else { -+ cmd = cmdBuffer; -+ } - #ifdef USING_CYGWIN - sprintf(cmd, "bash -c \"%s\"", command); - - #elif defined(OS400) - sprintf(cmd, "QSH CMD('%s')", command); -+#endif - #else - goto normal_command_mode; - #endif - } else { - normal_command_mode: -- sprintf(cmd, "%s", command); -+ cmd = (char *)command; - } -- -+ - printf("pkgdata: %s\n", cmd); - int result = system(cmd); -- if (result != 0) { -- printf("-- return status = %d\n", result); -+ if (result != 0) { -+ printf("-- return status = %d\n", result); -+ } -+ -+ if (cmd != cmdBuffer && cmd != command) { -+ uprv_free(cmd); - } -- return result; --} -+ -+ return result; -+} - - #define LN_CMD "ln -s" - #define RM_CMD "rm -f" -@@ -586,7 +606,7 @@ - pkgDataFlags = (char**)uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE); - if (pkgDataFlags != NULL) { - for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) { -- pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * SMALL_BUFFER_MAX_SIZE); -+ pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * MEDIUM_BUFFER_MAX_SIZE); - if (pkgDataFlags[i] != NULL) { - pkgDataFlags[i][0] = 0; - } else { Modified: branches/1.0/package/icu/icu.mk =================================================================== --- branches/1.0/package/icu/icu.mk 2013-01-08 00:37:56 UTC (rev 5873) +++ branches/1.0/package/icu/icu.mk 2013-01-08 05:36:55 UTC (rev 5874) @@ -4,7 +4,7 @@ # ############################################################# -ICU_VERSION = 4.4.2 +ICU_VERSION = 4.8.1.1 ICU_SOURCE = icu4c-$(subst .,_,$(ICU_VERSION))-src.tgz ICU_SITE = http://download.icu-project.org/files/icu4c/$(ICU_VERSION) ICU_DEPENDENCIES = host-icu Modified: branches/1.0/package/libidn/libidn.mk =================================================================== --- branches/1.0/package/libidn/libidn.mk 2013-01-08 00:37:56 UTC (rev 5873) +++ branches/1.0/package/libidn/libidn.mk 2013-01-08 05:36:55 UTC (rev 5874) @@ -4,8 +4,8 @@ # ############################################################# -LIBIDN_VERSION = 1.19 -LIBIDN_SITE = http://ftp.gnu.org/gnu/libidn/ +LIBIDN_VERSION = 1.26 +LIBIDN_SITE = http://ftp.gnu.org/gnu/libidn LIBIDN_INSTALL_STAGING = YES LIBIDN_CONF_ENV = EMACS="no" LIBIDN_CONF_OPT = --disable-java --enable-csharp=no This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-01-08 05:42:37
|
Revision: 5875 http://astlinux.svn.sourceforge.net/astlinux/?rev=5875&view=rev Author: abelbeck Date: 2013-01-08 05:42:31 +0000 (Tue, 08 Jan 2013) Log Message: ----------- lua, make lua depend on host-lua so the host Lua gets built automatically Modified Paths: -------------- branches/1.0/package/lua/lua.mk branches/1.0/package/prosody/prosody.mk Modified: branches/1.0/package/lua/lua.mk =================================================================== --- branches/1.0/package/lua/lua.mk 2013-01-08 05:36:55 UTC (rev 5874) +++ branches/1.0/package/lua/lua.mk 2013-01-08 05:42:31 UTC (rev 5875) @@ -7,6 +7,7 @@ LUA_VERSION = 5.1.5 LUA_SITE = http://www.lua.org/ftp LUA_INSTALL_STAGING = YES +LUA_DEPENDENCIES = host-lua LUA_CFLAGS = -Wall -fPIC -DLUA_USE_POSIX -DLUA_USE_DLOPEN LUA_MYLIBS += -ldl Modified: branches/1.0/package/prosody/prosody.mk =================================================================== --- branches/1.0/package/prosody/prosody.mk 2013-01-08 05:36:55 UTC (rev 5874) +++ branches/1.0/package/prosody/prosody.mk 2013-01-08 05:42:31 UTC (rev 5875) @@ -7,7 +7,7 @@ PROSODY_VERSION = 0.8.2 PROSODY_SOURCE = prosody-$(PROSODY_VERSION).tar.gz PROSODY_SITE = http://prosody.im/downloads/source -PROSODY_DEPENDENCIES = host-lua lua libidn openssl luafilesystem luaexpat luasocket luasec +PROSODY_DEPENDENCIES = lua libidn openssl luafilesystem luaexpat luasocket luasec define PROSODY_CONFIGURE_CMDS # this is *NOT* GNU autoconf stuff This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-01-08 18:55:58
|
Revision: 5878 http://astlinux.svn.sourceforge.net/astlinux/?rev=5878&view=rev Author: abelbeck Date: 2013-01-08 18:55:50 +0000 (Tue, 08 Jan 2013) Log Message: ----------- add to menuconfig: prosody luaexpat and luasec, disabled for now Modified Paths: -------------- branches/1.0/package/Config.in branches/1.0/package/luasec/Config.in branches/1.0/package/prosody/Config.in Modified: branches/1.0/package/Config.in =================================================================== --- branches/1.0/package/Config.in 2013-01-08 16:43:15 UTC (rev 5877) +++ branches/1.0/package/Config.in 2013-01-08 18:55:50 UTC (rev 5878) @@ -18,6 +18,7 @@ source "package/fonulator/Config.in" source "package/fbflash/Config.in" source "package/freeswitch/Config.in" +source "package/prosody/Config.in" source "package/rhino/Config.in" source "package/wanpipe/Config.in" endmenu @@ -249,7 +250,9 @@ source "package/cgilua/Config.in" source "package/copas/Config.in" source "package/coxpcall/Config.in" +source "package/luaexpat/Config.in" source "package/luafilesystem/Config.in" +source "package/luasec/Config.in" source "package/luasocket/Config.in" source "package/rings/Config.in" source "package/wsapi/Config.in" Modified: branches/1.0/package/luasec/Config.in =================================================================== --- branches/1.0/package/luasec/Config.in 2013-01-08 16:43:15 UTC (rev 5877) +++ branches/1.0/package/luasec/Config.in 2013-01-08 18:55:50 UTC (rev 5878) @@ -1,5 +1,7 @@ config BR2_PACKAGE_LUASEC bool "luasec" + select BR2_PACKAGE_LUASOCKET + depends on BR2_PACKAGE_OPENSSL help LuaSec is a binding for OpenSSL library to provide TLS/SSL communication. Modified: branches/1.0/package/prosody/Config.in =================================================================== --- branches/1.0/package/prosody/Config.in 2013-01-08 16:43:15 UTC (rev 5877) +++ branches/1.0/package/prosody/Config.in 2013-01-08 18:55:50 UTC (rev 5878) @@ -1,5 +1,12 @@ config BR2_PACKAGE_PROSODY bool "prosody" + depends on BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_LIBIDN + select BR2_PACKAGE_LUA + select BR2_PACKAGE_LUAFILESYSTEM + select BR2_PACKAGE_LUASOCKET + select BR2_PACKAGE_LUASEC + select BR2_PACKAGE_LUAEXPAT default n help Prosody is a modern flexible communications server for Jabber/XMPP written in Lua This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-01-14 20:04:16
|
Revision: 5898 http://astlinux.svn.sourceforge.net/astlinux/?rev=5898&view=rev Author: abelbeck Date: 2013-01-14 20:04:05 +0000 (Mon, 14 Jan 2013) Log Message: ----------- libical, new package, not hooked to menuconfig yet Added Paths: ----------- branches/1.0/package/libical/ branches/1.0/package/libical/Config.in branches/1.0/package/libical/libical.mk Added: branches/1.0/package/libical/Config.in =================================================================== --- branches/1.0/package/libical/Config.in (rev 0) +++ branches/1.0/package/libical/Config.in 2013-01-14 20:04:05 UTC (rev 5898) @@ -0,0 +1,12 @@ +config BR2_PACKAGE_LIBICAL + bool "libical" + depends on BR2_USE_WCHAR + help + libical is an Open Source (MPL/LGPL) implementation of the IETF's + iCalendar Calendaring and Scheduling protocols. + + http://www.citadel.org/doku.php/documentation:featured_projects:libical + +comment "libical requires a toolchain with WCHAR support" + depends on !BR2_USE_WCHAR + Added: branches/1.0/package/libical/libical.mk =================================================================== --- branches/1.0/package/libical/libical.mk (rev 0) +++ branches/1.0/package/libical/libical.mk 2013-01-14 20:04:05 UTC (rev 5898) @@ -0,0 +1,11 @@ +############################################################# +# +# libical +# +############################################################# + +LIBICAL_VERSION = 0.48 +LIBICAL_SITE = http://downloads.sourceforge.net/project/freeassociation/libical/libical-$(LIBICAL_VERSION) +LIBICAL_INSTALL_STAGING = YES + +$(eval $(call AUTOTARGETS,package,libical)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-02-13 22:41:28
|
Revision: 5954 http://astlinux.svn.sourceforge.net/astlinux/?rev=5954&view=rev Author: abelbeck Date: 2013-02-13 22:41:20 +0000 (Wed, 13 Feb 2013) Log Message: ----------- dnsmasq, with EXTDHCP=yes set 'ext,option:router' and 'ext,option:dns-server' to EXTGW, the others to EXTIP Modified Paths: -------------- branches/1.0/package/arnofw/arnofw.wrapper branches/1.0/package/dnsmasq/dnsmasq.init Modified: branches/1.0/package/arnofw/arnofw.wrapper =================================================================== --- branches/1.0/package/arnofw/arnofw.wrapper 2013-02-13 20:46:08 UTC (rev 5953) +++ branches/1.0/package/arnofw/arnofw.wrapper 2013-02-13 22:41:20 UTC (rev 5954) @@ -207,7 +207,7 @@ EXT_IF_DHCP_IP=1 fi -if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then +if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -n "$EXTGW" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then EXTERNAL_DHCP_SERVER=1 fi Modified: branches/1.0/package/dnsmasq/dnsmasq.init =================================================================== --- branches/1.0/package/dnsmasq/dnsmasq.init 2013-02-13 20:46:08 UTC (rev 5953) +++ branches/1.0/package/dnsmasq/dnsmasq.init 2013-02-13 22:41:20 UTC (rev 5954) @@ -36,18 +36,18 @@ trueDNSMASQnet() { # args: tag, IP, ip.dstart, ip.dend - local servername + local servername="$2" gateway="$2" if [ "$1" = "lan" ]; then servername="$HOSTNAME.$DOMAIN" - else - servername="$2" + elif [ "$1" = "ext" ]; then + gateway="$EXTGW" fi echo " dhcp-range=$1,$3,$4,24h -dhcp-option=$1,option:router,$2 -dhcp-option=$1,option:dns-server,$2 +dhcp-option=$1,option:router,$gateway +dhcp-option=$1,option:dns-server,$gateway dhcp-option=$1,option:tftp-server,\"$servername\" dhcp-option=$1,150,$2" @@ -176,7 +176,7 @@ { # Applies to static EXTIP address, no EXT2IF and no PPPoE - if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then + if [ "$EXTDHCP" = "yes" -a -n "$EXTIP" -a -n "$EXTGW" -a -z "$EXT2IF" -a -z "$PPPOEIF" ]; then if [ -n "$EXTIF" -a "$EXTIF" != "none" ] && isDHCPinterface $EXTIF; then return 0 fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-03-04 20:17:30
|
Revision: 5975 http://astlinux.svn.sourceforge.net/astlinux/?rev=5975&view=rev Author: abelbeck Date: 2013-03-04 20:17:21 +0000 (Mon, 04 Mar 2013) Log Message: ----------- libtool, install libltdl libs to target asterisk, fix unixodbc configure Modified Paths: -------------- branches/1.0/package/asterisk/asterisk.mk branches/1.0/package/libtool/libtool.mk Modified: branches/1.0/package/asterisk/asterisk.mk =================================================================== --- branches/1.0/package/asterisk/asterisk.mk 2013-03-01 17:38:20 UTC (rev 5974) +++ branches/1.0/package/asterisk/asterisk.mk 2013-03-04 20:17:21 UTC (rev 5975) @@ -118,7 +118,7 @@ ifeq ($(strip $(BR2_PACKAGE_UNIXODBC)),y) ASTERISK_EXTRAS+=unixodbc ASTERISK_CONFIGURE_ARGS+= \ - --with-odbc="$(STAGING_DIR)/usr" + --with-unixodbc="$(STAGING_DIR)/usr" endif ifeq ($(strip $(BR2_PACKAGE_ALSA_LIB)),y) Modified: branches/1.0/package/libtool/libtool.mk =================================================================== --- branches/1.0/package/libtool/libtool.mk 2013-03-01 17:38:20 UTC (rev 5974) +++ branches/1.0/package/libtool/libtool.mk 2013-03-04 20:17:21 UTC (rev 5975) @@ -7,13 +7,20 @@ LIBTOOL_SOURCE = libtool-$(LIBTOOL_VERSION).tar.gz LIBTOOL_SITE = $(BR2_GNU_MIRROR)/libtool LIBTOOL_INSTALL_STAGING = YES -LIBTOOL_INSTALL_TARGET = NO HOST_LIBTOOL_LIBTOOL_PATCH = NO +define LIBTOOL_INSTALL_TARGET_CMDS + cp -a $(STAGING_DIR)/usr/lib/libltdl.*so* $(TARGET_DIR)/usr/lib/ +endef + +define LIBTOOL_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/lib/libltdl.*so* +endef + $(eval $(call AUTOTARGETS,package,libtool)) $(eval $(call AUTOTARGETS,package,libtool,host)) # variables used by other packages -LIBTOOL:=$(HOST_DIR)/usr/bin/libtool -LIBTOOLIZE:=$(HOST_DIR)/usr/bin/libtoolize +LIBTOOL = $(HOST_DIR)/usr/bin/libtool +LIBTOOLIZE = $(HOST_DIR)/usr/bin/libtoolize This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-03-13 19:44:03
|
Revision: 5990 http://astlinux.svn.sourceforge.net/astlinux/?rev=5990&view=rev Author: abelbeck Date: 2013-03-13 19:43:54 +0000 (Wed, 13 Mar 2013) Log Message: ----------- add ODBC DSN 'asterisk-cdr' and automatically support Asterisk ODBC CDR using file /mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 Modified Paths: -------------- branches/1.0/package/asterisk/asterisk.init branches/1.0/package/unixodbc/unixodbc.init Modified: branches/1.0/package/asterisk/asterisk.init =================================================================== --- branches/1.0/package/asterisk/asterisk.init 2013-03-12 22:11:33 UTC (rev 5989) +++ branches/1.0/package/asterisk/asterisk.init 2013-03-13 19:43:54 UTC (rev 5990) @@ -66,8 +66,37 @@ make_symlink_or_dir "/mnt/kd/cdr-custom" "/var/log/asterisk/cdr-custom" + # Automatically create "/mnt/kd/cdr-sqlite3" directory if it doesn't exist + if [ ! -d /mnt/kd/cdr-sqlite3 ]; then + mkdir /mnt/kd/cdr-sqlite3 2>/dev/null # will fail on virgin RO filesystem, ignore stderr + fi if [ -d /mnt/kd/cdr-sqlite3 ]; then ln -sf /mnt/kd/cdr-sqlite3/master.db /var/log/asterisk/master.db + + if [ ! -f /mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 ]; then + sqlite3 -batch /mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 <<EOF +CREATE TABLE 'cdr' ( + 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + 'calldate' TEXT, + 'clid' TEXT, + 'src' TEXT, + 'dst' TEXT, + 'dcontext' TEXT, + 'channel' TEXT, + 'dstchannel' TEXT, + 'lastapp' TEXT, + 'lastdata' TEXT, + 'duration' REAL, + 'billsec' REAL, + 'disposition' TEXT, + 'amaflags' INTEGER, + 'accountcode' TEXT, + 'uniqueid' TEXT, + 'userfield' TEXT +); +CREATE VIEW 'standard' AS SELECT calldate, clid, dst, dcontext, billsec, userfield from cdr ORDER BY calldate DESC; +EOF + fi fi } Modified: branches/1.0/package/unixodbc/unixodbc.init =================================================================== --- branches/1.0/package/unixodbc/unixodbc.init 2013-03-12 22:11:33 UTC (rev 5989) +++ branches/1.0/package/unixodbc/unixodbc.init 2013-03-13 19:43:54 UTC (rev 5990) @@ -86,14 +86,22 @@ " install_odbc_driver "SQLite3" "$DATA" - # Install DSN + # Install DSN's DATA=" -Description=SQLite3 database +Description=Asterisk database Driver=SQLite3 Database=/mnt/kd/asterisk-odbc.sqlite3 Timeout=2000 " install_odbc_dsn "asterisk" "$DATA" + + DATA=" +Description=CDR ODBC database +Driver=SQLite3 +Database=/mnt/kd/cdr-sqlite3/cdr-odbc.sqlite3 +Timeout=2000 +" + install_odbc_dsn "asterisk-cdr" "$DATA" } stop () { @@ -101,8 +109,9 @@ # Remove Driver remove_odbc_driver "SQLite3" - # Remove DSN + # Remove DSN's remove_odbc_dsn "asterisk" + remove_odbc_dsn "asterisk-cdr" } case $1 in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-03-14 13:11:11
|
Revision: 5993 http://astlinux.svn.sourceforge.net/astlinux/?rev=5993&view=rev Author: abelbeck Date: 2013-03-14 13:11:02 +0000 (Thu, 14 Mar 2013) Log Message: ----------- dahdi-linux and dahdi-tools, version bump to 2.6.2 Modified Paths: -------------- branches/1.0/package/dahdi-linux/dahdi-linux.mk branches/1.0/package/dahdi-tools/dahdi-tools.mk Modified: branches/1.0/package/dahdi-linux/dahdi-linux.mk =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-03-13 23:49:08 UTC (rev 5992) +++ branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-03-14 13:11:02 UTC (rev 5993) @@ -4,12 +4,12 @@ # ############################################################## ifeq ($(BR2_PACKAGE_RHINO),y) -DAHDI_LINUX_VERSION := 2.6.1 +DAHDI_LINUX_VERSION := 2.6.2 else ifeq ($(BR2_PACKAGE_WANPIPE),y) -DAHDI_LINUX_VERSION := 2.6.1 +DAHDI_LINUX_VERSION := 2.6.2 else -DAHDI_LINUX_VERSION := 2.6.1 +DAHDI_LINUX_VERSION := 2.6.2 endif endif DAHDI_LINUX_SOURCE := dahdi-linux-$(DAHDI_LINUX_VERSION).tar.gz Modified: branches/1.0/package/dahdi-tools/dahdi-tools.mk =================================================================== --- branches/1.0/package/dahdi-tools/dahdi-tools.mk 2013-03-13 23:49:08 UTC (rev 5992) +++ branches/1.0/package/dahdi-tools/dahdi-tools.mk 2013-03-14 13:11:02 UTC (rev 5993) @@ -4,12 +4,12 @@ # ############################################################## ifeq ($(BR2_PACKAGE_RHINO),y) -DAHDI_TOOLS_VERSION := 2.6.1 +DAHDI_TOOLS_VERSION := 2.6.2 else ifeq ($(BR2_PACKAGE_WANPIPE),y) -DAHDI_TOOLS_VERSION := 2.6.1 +DAHDI_TOOLS_VERSION := 2.6.2 else -DAHDI_TOOLS_VERSION := 2.6.1 +DAHDI_TOOLS_VERSION := 2.6.2 endif endif DAHDI_TOOLS_SOURCE := dahdi-tools-$(DAHDI_TOOLS_VERSION).tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-03-25 23:23:44
|
Revision: 6015 http://astlinux.svn.sourceforge.net/astlinux/?rev=6015&view=rev Author: abelbeck Date: 2013-03-25 23:23:38 +0000 (Mon, 25 Mar 2013) Log Message: ----------- no functional change, but fix any annoying issue with 'su' -> 'prosody' that required ignoring /dev/null. The fix is to specify /bin/ash as the shell for 'su' since with our restrictive /etc/passwd's /bin/bash outputs the following error: 'shell-init: error retrieving current directory: getcwd: cannot access parent directories: Success' which is unique to bash, so we now use ash with 'su'. Modified Paths: -------------- branches/1.0/package/clix/sendxmpp branches/1.0/package/prosody/prosody.init Modified: branches/1.0/package/clix/sendxmpp =================================================================== --- branches/1.0/package/clix/sendxmpp 2013-03-25 18:55:40 UTC (rev 6014) +++ branches/1.0/package/clix/sendxmpp 2013-03-25 23:23:38 UTC (rev 6015) @@ -48,7 +48,7 @@ help() { - su -p -c "/usr/bin/clix" prosody 2>/dev/null + su -p -s /bin/ash -c /usr/bin/clix prosody 2>/dev/null usage } @@ -97,9 +97,9 @@ do_clix() { if [ $debug -eq 1 ]; then - su -p -c "/usr/bin/clix $CMDS" prosody 2>&1 | grep -v '^shell-init' + su -p -s /bin/ash -c "/usr/bin/clix $CMDS" prosody else - su -p -c "/usr/bin/clix $CMDS" prosody 2>/dev/null + su -p -s /bin/ash -c "/usr/bin/clix $CMDS" prosody 2>/dev/null fi } Modified: branches/1.0/package/prosody/prosody.init =================================================================== --- branches/1.0/package/prosody/prosody.init 2013-03-25 18:55:40 UTC (rev 6014) +++ branches/1.0/package/prosody/prosody.init 2013-03-25 23:23:38 UTC (rev 6015) @@ -224,7 +224,7 @@ if [ -f /etc/prosody/prosody.cfg.lua ] && grep -q '^[^-]*"posix"' /etc/prosody/prosody.cfg.lua; then echo "Starting XMPP Server..." - su -p -c "/usr/bin/prosody" prosody 2>/dev/null + su -p -s /bin/ash -c /usr/bin/prosody prosody fi } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-03-29 23:24:58
|
Revision: 6025 http://astlinux.svn.sourceforge.net/astlinux/?rev=6025&view=rev Author: abelbeck Date: 2013-03-29 23:24:47 +0000 (Fri, 29 Mar 2013) Log Message: ----------- build system, remove --program-prefix= since it is now set in the auto-target infrastructure Modified Paths: -------------- branches/1.0/package/dbus/dbus.mk branches/1.0/package/dbus-glib/dbus-glib.mk branches/1.0/package/directfb/directfb.mk branches/1.0/package/fakeroot/fakeroot.mk branches/1.0/package/fbdump/fbdump.mk branches/1.0/package/fuse/libfuse.mk branches/1.0/package/gamin/gamin.mk branches/1.0/package/jpeg/jpeg.mk branches/1.0/package/libargtable2/libargtable2.mk branches/1.0/package/lighttpd/lighttpd.mk branches/1.0/package/lzop/lzop.mk branches/1.0/package/multimedia/mpg123/mpg123.mk branches/1.0/package/multimedia/taglib/taglib.mk branches/1.0/package/mysql_client/mysql_client.mk branches/1.0/package/netcat/netcat.mk branches/1.0/package/ntfs-3g/ntfs-3g.mk branches/1.0/package/ntfsprogs/ntfsprogs.mk branches/1.0/package/php/php.mk branches/1.0/package/radvd/radvd.mk branches/1.0/package/sdl_sound/sdl_sound.mk branches/1.0/package/sylpheed/sylpheed.mk branches/1.0/package/tcpreplay/tcpreplay.mk Modified: branches/1.0/package/dbus/dbus.mk =================================================================== --- branches/1.0/package/dbus/dbus.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/dbus/dbus.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -12,8 +12,7 @@ DBUS_DEPENDENCIES = host-pkg-config DBUS_CONF_ENV = ac_cv_have_abstract_sockets=yes -DBUS_CONF_OPT = --program-prefix="" \ - --with-dbus-user=dbus \ +DBUS_CONF_OPT = --with-dbus-user=dbus \ --disable-tests \ --disable-asserts \ --enable-abstract-sockets \ Modified: branches/1.0/package/dbus-glib/dbus-glib.mk =================================================================== --- branches/1.0/package/dbus-glib/dbus-glib.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/dbus-glib/dbus-glib.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -13,7 +13,6 @@ have_abstract_sockets=yes DBUS_GLIB_CONF_OPT = --localstatedir=/var \ - --program-prefix="" \ --disable-tests \ --disable-xml-docs \ --with-introspect-xml=$(DBUS_HOST_INTROSPECT) \ Modified: branches/1.0/package/directfb/directfb.mk =================================================================== --- branches/1.0/package/directfb/directfb.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/directfb/directfb.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -12,7 +12,6 @@ DIRECTFB_CONF_OPT = \ --localstatedir=/var \ --disable-explicit-deps \ - --program-prefix='' \ --enable-zlib \ --enable-freetype \ --enable-fbdev \ Modified: branches/1.0/package/fakeroot/fakeroot.mk =================================================================== --- branches/1.0/package/fakeroot/fakeroot.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/fakeroot/fakeroot.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -6,7 +6,6 @@ FAKEROOT_VERSION = 1.18.2 FAKEROOT_SOURCE = fakeroot_$(FAKEROOT_VERSION).orig.tar.bz2 FAKEROOT_SITE = http://snapshot.debian.org/archive/debian/20111201T093630Z/pool/main/f/fakeroot -FAKEROOT_CONF_OPT = --program-prefix='' # The package for the target cannot be selected (build problems when # largefile is enabled), but is needed for the host package to work Modified: branches/1.0/package/fbdump/fbdump.mk =================================================================== --- branches/1.0/package/fbdump/fbdump.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/fbdump/fbdump.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -7,7 +7,6 @@ FBDUMP_SOURCE:=fbdump-$(FBDUMP_VERSION).tar.gz FBDUMP_SITE:=http://www.rcdrummond.net/fbdump FBDUMP_AUTORECONF = NO -FBDUMP_CONF_OPT = --program-prefix='' $(eval $(call AUTOTARGETS,package,fbdump)) Modified: branches/1.0/package/fuse/libfuse.mk =================================================================== --- branches/1.0/package/fuse/libfuse.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/fuse/libfuse.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -9,8 +9,7 @@ LIBFUSE_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/fuse/ LIBFUSE_INSTALL_STAGING = YES -LIBFUSE_CONF_OPT= --program-prefix="" \ - --disable-nls \ +LIBFUSE_CONF_OPT= --disable-nls \ --disable-example \ --disable-kernel-module \ --enable-lib \ Modified: branches/1.0/package/gamin/gamin.mk =================================================================== --- branches/1.0/package/gamin/gamin.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/gamin/gamin.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -9,7 +9,7 @@ GAMIN_AUTORECONF = YES GAMIN_INSTALL_STAGING = YES -GAMIN_CONF_OPT = --program-prefix="" --disable-debug +GAMIN_CONF_OPT = --disable-debug # python support broken GAMIN_CONF_OPT += --without-python Modified: branches/1.0/package/jpeg/jpeg.mk =================================================================== --- branches/1.0/package/jpeg/jpeg.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/jpeg/jpeg.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -8,7 +8,6 @@ JPEG_SOURCE = jpegsrc.v$(JPEG_VERSION).tar.gz JPEG_INSTALL_STAGING = YES JPEG_INSTALL_TARGET = YES -JPEG_CONF_OPT = --program-prefix= define JPEG_REMOVE_USELESS_TOOLS rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtrans rdjpgcom wrjpgcom) Modified: branches/1.0/package/libargtable2/libargtable2.mk =================================================================== --- branches/1.0/package/libargtable2/libargtable2.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/libargtable2/libargtable2.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -9,8 +9,7 @@ LIBARGTABLE2_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/argtable LIBARGTABLE2_INSTALL_STAGING = YES -LIBARGTABLE2_CONF_OPT= --program-prefix="" \ - --disable-example \ +LIBARGTABLE2_CONF_OPT= --disable-example \ --disable-kernel-module \ --enable-lib \ --enable-util Modified: branches/1.0/package/lighttpd/lighttpd.mk =================================================================== --- branches/1.0/package/lighttpd/lighttpd.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/lighttpd/lighttpd.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -11,7 +11,6 @@ --libdir=/usr/lib/lighttpd \ --libexecdir=/usr/lib \ --localstatedir=/var \ - --program-prefix="" \ $(if $(BR2_LARGEFILE),,--disable-lfs) ifeq ($(BR2_PACKAGE_LIGHTTPD_OPENSSL),y) Modified: branches/1.0/package/lzop/lzop.mk =================================================================== --- branches/1.0/package/lzop/lzop.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/lzop/lzop.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -6,7 +6,6 @@ LZOP_VERSION:=1.02rc1 LZOP_SOURCE:=lzop-$(LZOP_VERSION).tar.gz LZOP_SITE:=http://www.lzop.org/download/ -LZOP_CONF_OPT:=--program-prefix="" LZOP_DEPENDENCIES:=lzo $(eval $(call AUTOTARGETS,package,lzop)) Modified: branches/1.0/package/multimedia/mpg123/mpg123.mk =================================================================== --- branches/1.0/package/multimedia/mpg123/mpg123.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/multimedia/mpg123/mpg123.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -32,7 +32,7 @@ MPG123_CPU = x86-64 endif -MPG123_CONF_OPT += --program-prefix='' --with-cpu=$(MPG123_CPU) +MPG123_CONF_OPT += --with-cpu=$(MPG123_CPU) # Check if ALSA is built, then we should configure after alsa-lib so # ./configure can find alsa-lib. Modified: branches/1.0/package/multimedia/taglib/taglib.mk =================================================================== --- branches/1.0/package/multimedia/taglib/taglib.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/multimedia/taglib/taglib.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -14,7 +14,7 @@ ac_cv_header_cppunit_extensions_HelperMacros_h=no \ ac_cv_header_zlib_h=$(if $(BR2_PACKAGE_ZLIB),yes,no) -TAGLIB_CONF_OPT = --disable-libsuffix --program-prefix='' +TAGLIB_CONF_OPT = --disable-libsuffix define TAGLIB_REMOVE_DEVFILE rm -f $(TARGET_DIR)/usr/bin/taglib-config Modified: branches/1.0/package/mysql_client/mysql_client.mk =================================================================== --- branches/1.0/package/mysql_client/mysql_client.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/mysql_client/mysql_client.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -21,7 +21,6 @@ mysql_cv_new_rl_interface=yes MYSQL_CLIENT_CONF_OPT = \ - --program-prefix="" \ --without-ndb-binlog \ --without-server \ --without-docs \ Modified: branches/1.0/package/netcat/netcat.mk =================================================================== --- branches/1.0/package/netcat/netcat.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/netcat/netcat.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -10,6 +10,5 @@ NETCAT_AUTORECONF:=NO NETCAT_INSTALL_STAGING:=NO NETCAT_INSTALL_TARGET:=YES -NETCAT_CONF_OPT = --program-prefix='' $(eval $(call AUTOTARGETS,package,netcat)) Modified: branches/1.0/package/ntfs-3g/ntfs-3g.mk =================================================================== --- branches/1.0/package/ntfs-3g/ntfs-3g.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/ntfs-3g/ntfs-3g.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -7,7 +7,7 @@ NTFS_3G_VERSION = 2010.10.2 NTFS_3G_SOURCE = ntfs-3g-$(NTFS_3G_VERSION).tgz NTFS_3G_SITE = http://tuxera.com/opensource -NTFS_3G_CONF_OPT = --disable-ldconfig --program-prefix="" +NTFS_3G_CONF_OPT = --disable-ldconfig NTFS_3G_INSTALL_STAGING = YES $(eval $(call AUTOTARGETS,package,ntfs-3g)) Modified: branches/1.0/package/ntfsprogs/ntfsprogs.mk =================================================================== --- branches/1.0/package/ntfsprogs/ntfsprogs.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/ntfsprogs/ntfsprogs.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -6,7 +6,7 @@ NTFSPROGS_VERSION:=2.0.0 NTFSPROGS_SOURCE:=ntfsprogs-$(NTFSPROGS_VERSION).tar.gz NTFSPROGS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/linux-ntfs/ -NTFSPROGS_CONF_OPT:=--disable-gnome-vfs --program-prefix="" --disable-crypto +NTFSPROGS_CONF_OPT:=--disable-gnome-vfs --disable-crypto NTFSPROGS_INSTALL_STAGING:=yes NTFSPROGS_BIN:=ntfscat ntfscluster ntfscmp ntfsfix ntfsinfo ntfsls Modified: branches/1.0/package/php/php.mk =================================================================== --- branches/1.0/package/php/php.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/php/php.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -21,7 +21,6 @@ --enable-hash \ --enable-tokenizer \ --with-config-file-path=/etc \ - --program-prefix= \ --localstatedir=/var PHP_CFLAGS = $(TARGET_CFLAGS) Modified: branches/1.0/package/radvd/radvd.mk =================================================================== --- branches/1.0/package/radvd/radvd.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/radvd/radvd.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -8,9 +8,6 @@ RADVD_SITE = http://www.litech.org/radvd/dist/ RADVD_DEPENDENCIES:=flex libdaemon host-flex host-pkg-config -RADVD_CONF_OPT= \ - --program-prefix='' - define RADVD_INSTALL_INITSCRIPT $(INSTALL) -D -m 0755 package/radvd/radvd.init $(TARGET_DIR)/etc/init.d/radvd ln -sf /tmp/etc/radvd.conf $(TARGET_DIR)/etc/radvd.conf Modified: branches/1.0/package/sdl_sound/sdl_sound.mk =================================================================== --- branches/1.0/package/sdl_sound/sdl_sound.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/sdl_sound/sdl_sound.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -31,8 +31,7 @@ --with-sdl-prefix=$(STAGING_DIR)/usr \ --with-sdl-exec-prefix=$(STAGING_DIR)/usr \ --disable-sdltest \ - --enable-static \ - --program-prefix='' + --enable-static # enable mmx for newer x86's ifeq ($(BR2_i386)$(BR2_x86_i386)$(BR2_x86_i486)$(BR2_x86_i586)$(BR2_x86_pentiumpro)$(BR2_x86_geode),y) Modified: branches/1.0/package/sylpheed/sylpheed.mk =================================================================== --- branches/1.0/package/sylpheed/sylpheed.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/sylpheed/sylpheed.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -9,7 +9,7 @@ SYLPHEED_SOURCE = sylpheed-$(SYLPHEED_VERSION).tar.bz2 SYLPHEED_SITE = http://sylpheed.sraoss.jp/sylpheed/v$(SYLPHEED_VERSION_MAJOR) -SYLPHEED_CONF_OPT = --disable-gtkspell --program-prefix="" \ +SYLPHEED_CONF_OPT = --disable-gtkspell \ --includedir=$(STAGING_DIR)/usr/include SYLPHEED_DEPENDENCIES = host-pkg-config libgtk2 Modified: branches/1.0/package/tcpreplay/tcpreplay.mk =================================================================== --- branches/1.0/package/tcpreplay/tcpreplay.mk 2013-03-29 22:32:57 UTC (rev 6024) +++ branches/1.0/package/tcpreplay/tcpreplay.mk 2013-03-29 23:24:47 UTC (rev 6025) @@ -7,7 +7,7 @@ TCPREPLAY_VERSION = 3.4.3 TCPREPLAY_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/tcpreplay TCPREPLAY_CONF_ENV = tr_cv_libpcap_version=">= 0.7.0" -TCPREPLAY_CONF_OPT = --program-prefix="" --with-libpcap=$(STAGING_DIR)/usr +TCPREPLAY_CONF_OPT = --with-libpcap=$(STAGING_DIR)/usr TCPREPLAY_DEPENDENCIES = uclibc libpcap This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-04-22 14:22:52
|
Revision: 6052 http://sourceforge.net/p/astlinux/code/6052 Author: abelbeck Date: 2013-04-22 14:22:49 +0000 (Mon, 22 Apr 2013) Log Message: ----------- dnsmasq, minor build tweak from upstream Buildroot Modified Paths: -------------- branches/1.0/package/dnsmasq/dnsmasq.mk branches/1.0/package/libcurl/libcurl.mk Modified: branches/1.0/package/dnsmasq/dnsmasq.mk =================================================================== --- branches/1.0/package/dnsmasq/dnsmasq.mk 2013-04-20 18:20:05 UTC (rev 6051) +++ branches/1.0/package/dnsmasq/dnsmasq.mk 2013-04-22 14:22:49 UTC (rev 6052) @@ -69,7 +69,7 @@ $(DNSMASQ_FIX_PKGCONFIG) $(DNSMASQ_ENABLE_DBUS) $(DNSMASQ_ENABLE_IPSET) - $(DNSMASQ_MAKE_ENV) $(MAKE) -C $(@D) $(DNSMASQ_MAKE_OPT) + $(DNSMASQ_MAKE_ENV) $(MAKE1) -C $(@D) $(DNSMASQ_MAKE_OPT) endef define DNSMASQ_INSTALL_TARGET_CMDS Modified: branches/1.0/package/libcurl/libcurl.mk =================================================================== --- branches/1.0/package/libcurl/libcurl.mk 2013-04-20 18:20:05 UTC (rev 6051) +++ branches/1.0/package/libcurl/libcurl.mk 2013-04-22 14:22:49 UTC (rev 6052) @@ -17,8 +17,9 @@ # Fix it by setting LD_LIBRARY_PATH to something sensible so those libs # are found first. LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/lib:/usr/lib -LIBCURL_CONF_OPT += --with-ssl=$(STAGING_DIR)/usr --with-random=/dev/urandom -LIBCURL_CONF_OPT += --with-ca-path=/usr/lib/ssl/certs +LIBCURL_CONF_OPT += --with-ssl=$(STAGING_DIR)/usr \ + --with-random=/dev/urandom \ + --with-ca-path=/usr/lib/ssl/certs else LIBCURL_CONF_OPT += --without-ssl endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-05-05 01:47:42
|
Revision: 6073 http://sourceforge.net/p/astlinux/code/6073 Author: abelbeck Date: 2013-05-05 01:47:36 +0000 (Sun, 05 May 2013) Log Message: ----------- netsnmp, version bump to 5.7.2, enable Unix transport and agentx. asterisk, enable netsnmp for Asterisk 1.8 and 11 builds. Modified Paths: -------------- branches/1.0/package/asterisk/asterisk.mk branches/1.0/package/netsnmp/netsnmp.mk Removed Paths: ------------- branches/1.0/package/netsnmp/netsnmp-CVE-2012-2141.patch branches/1.0/package/netsnmp/netsnmp-swinst-crash.patch Modified: branches/1.0/package/asterisk/asterisk.mk =================================================================== --- branches/1.0/package/asterisk/asterisk.mk 2013-05-03 17:16:44 UTC (rev 6072) +++ branches/1.0/package/asterisk/asterisk.mk 2013-05-05 01:47:36 UTC (rev 6073) @@ -101,13 +101,19 @@ --with-imap="$(BUILD_DIR)/uw-imap-2007e" endif -#ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y) -#ASTERISK_EXTRAS+=netsnmp -#ASTERISK_CONFIGURE_ARGS+= \ -# --with-netsnmp="$(STAGING_DIR)/usr" -#endif +ifneq ($(ASTERISK_VERSION_TUPLE),1.4) + ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y) +ASTERISK_EXTRAS+=netsnmp ASTERISK_CONFIGURE_ARGS+= \ + --with-netsnmp="$(STAGING_DIR)/usr" + else +ASTERISK_CONFIGURE_ARGS+= \ --without-netsnmp + endif +else +ASTERISK_CONFIGURE_ARGS+= \ + --without-netsnmp +endif ifeq ($(strip $(BR2_PACKAGE_MYSQL_CLIENT)),y) ASTERISK_EXTRAS+=mysql_client Deleted: branches/1.0/package/netsnmp/netsnmp-CVE-2012-2141.patch =================================================================== --- branches/1.0/package/netsnmp/netsnmp-CVE-2012-2141.patch 2013-05-03 17:16:44 UTC (rev 6072) +++ branches/1.0/package/netsnmp/netsnmp-CVE-2012-2141.patch 2013-05-05 01:47:36 UTC (rev 6073) @@ -1,35 +0,0 @@ -From 4c5633f1603e4bd03ed05c37d782ec8911759c47 Mon Sep 17 00:00:00 2001 -From: Robert Story <rs...@fr...> -Date: Mon, 14 May 2012 11:40:06 -0400 -Subject: [PATCH] NEWS: snmp: BUG: 3526549: CVE-2012-2141 Array index error leading to crash - ---- - agent/mibgroup/agent/extend.c | 6 +++++- - 1 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c -index d00475f..1f8586a 100644 ---- a/agent/mibgroup/agent/extend.c -+++ b/agent/mibgroup/agent/extend.c -@@ -1126,7 +1126,7 @@ _extend_find_entry( netsnmp_request_info *request, - * ...and check the line requested is valid - */ - line_idx = *table_info->indexes->next_variable->val.integer; -- if (eptr->numlines < line_idx) -+ if (line_idx < 1 || line_idx > eptr->numlines) - return NULL; - } - return eptr; -@@ -1299,6 +1299,10 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler *handler, - * Determine which line we've been asked for.... - */ - line_idx = *table_info->indexes->next_variable->val.integer; -+ if (line_idx < 1 || line_idx > extension->numlines) { -+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE); -+ continue; -+ } - cp = extension->lines[line_idx-1]; - - /* --- -1.7.4.1 Deleted: branches/1.0/package/netsnmp/netsnmp-swinst-crash.patch =================================================================== --- branches/1.0/package/netsnmp/netsnmp-swinst-crash.patch 2013-05-03 17:16:44 UTC (rev 6072) +++ branches/1.0/package/netsnmp/netsnmp-swinst-crash.patch 2013-05-05 01:47:36 UTC (rev 6073) @@ -1,18 +0,0 @@ -Fixes runtime error with uClibc (and possibly others). - -Original patch and bug description: -http://sourceforge.net/tracker/?func=detail&aid=3436528&group_id=12694&atid=312694 - ---- net-snmp-5.7.1/agent/mibgroup/host/data_access/swinst_pkginfo.c -+++ /home/fabled//net-snmp-5.7.1.patched/agent/mibgroup/host/data_access/swinst_pkginfo.c -@@ -140,7 +140,8 @@ - memcpy( entry->swDate, cp, date_len ); - entry->swDate_len = date_len; - } -- closedir( d ); -+ if (d != NULL) -+ closedir( d ); - - DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n", - (int)CONTAINER_SIZE(container))); - Modified: branches/1.0/package/netsnmp/netsnmp.mk =================================================================== --- branches/1.0/package/netsnmp/netsnmp.mk 2013-05-03 17:16:44 UTC (rev 6072) +++ branches/1.0/package/netsnmp/netsnmp.mk 2013-05-05 01:47:36 UTC (rev 6073) @@ -4,8 +4,8 @@ # ############################################################# -NETSNMP_VERSION = 5.7.1 -NETSNMP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp +NETSNMP_VERSION = 5.7.2 +NETSNMP_SITE = http://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION) NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz NETSNMP_INSTALL_STAGING = YES NETSNMP_CONF_ENV = ac_cv_NETSNMP_CAN_USE_SYSCTL=yes @@ -18,9 +18,8 @@ --enable-silent-libtool --enable-mfd-rewrites \ --with-sys-contact="root@localhost" \ --with-sys-location="Unknown" \ - --with-mib-modules="host ucd-snmp/dlmod" \ - --with-out-mib-modules="disman/event disman/schedule utilities" \ - --with-out-transports="Unix" + --with-mib-modules="host ucd-snmp/dlmod agentx" \ + --with-out-mib-modules="disman/event disman/schedule utilities" NETSNMP_MAKE = $(MAKE1) NETSNMP_BLOAT_MIBS = BRIDGE DISMAN-EVENT DISMAN-SCHEDULE DISMAN-SCRIPT EtherLike RFC-1215 RFC1155-SMI RFC1213 SCTP SMUX This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-05-21 15:50:01
|
Revision: 6095 http://sourceforge.net/p/astlinux/code/6095 Author: abelbeck Date: 2013-05-21 15:49:59 +0000 (Tue, 21 May 2013) Log Message: ----------- sqlite, version bump to 3071601 - sqliteodbc version bump to 0.992 Modified Paths: -------------- branches/1.0/package/sqlite/sqlite.mk branches/1.0/package/sqliteodbc/sqliteodbc.mk Modified: branches/1.0/package/sqlite/sqlite.mk =================================================================== --- branches/1.0/package/sqlite/sqlite.mk 2013-05-18 22:11:56 UTC (rev 6094) +++ branches/1.0/package/sqlite/sqlite.mk 2013-05-21 15:49:59 UTC (rev 6095) @@ -4,9 +4,9 @@ # ############################################################# -SQLITE_VERSION = 3071502 +SQLITE_VERSION = 3071601 SQLITE_SOURCE = sqlite-autoconf-$(SQLITE_VERSION).tar.gz -SQLITE_SITE = http://www.sqlite.org +SQLITE_SITE = http://www.sqlite.org/2013 SQLITE_INSTALL_STAGING = YES ifneq ($(BR2_LARGEFILE),y) Modified: branches/1.0/package/sqliteodbc/sqliteodbc.mk =================================================================== --- branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-05-18 22:11:56 UTC (rev 6094) +++ branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-05-21 15:49:59 UTC (rev 6095) @@ -3,7 +3,7 @@ # sqliteodbc # ############################################################# -SQLITEODBC_VERSION = 0.99 +SQLITEODBC_VERSION = 0.992 SQLITEODBC_SOURCE = sqliteodbc-$(SQLITEODBC_VERSION).tar.gz SQLITEODBC_SITE = http://www.ch-werner.de/sqliteodbc SQLITEODBC_SUBDIR = sqliteodbc-$(SQLITEODBC_VERSION) @@ -16,6 +16,7 @@ --with-pic \ --with-sqlite="$(STAGING_DIR)/usr" \ --with-sqlite3="$(STAGING_DIR)/usr" \ + --with-sqlite4="$(STAGING_DIR)/usr" \ --with-odbc="$(STAGING_DIR)/usr" define SQLITEODBC_INSTALL_TARGET_CMDS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-05-23 19:52:45
|
Revision: 6101 http://sourceforge.net/p/astlinux/code/6101 Author: abelbeck Date: 2013-05-23 19:52:43 +0000 (Thu, 23 May 2013) Log Message: ----------- sqlite, version bump to 3071700 - sqliteodbc version bump to 0.993 Modified Paths: -------------- branches/1.0/package/sqlite/sqlite.mk branches/1.0/package/sqliteodbc/sqliteodbc.mk Modified: branches/1.0/package/sqlite/sqlite.mk =================================================================== --- branches/1.0/package/sqlite/sqlite.mk 2013-05-23 16:24:57 UTC (rev 6100) +++ branches/1.0/package/sqlite/sqlite.mk 2013-05-23 19:52:43 UTC (rev 6101) @@ -4,7 +4,7 @@ # ############################################################# -SQLITE_VERSION = 3071601 +SQLITE_VERSION = 3071700 SQLITE_SOURCE = sqlite-autoconf-$(SQLITE_VERSION).tar.gz SQLITE_SITE = http://www.sqlite.org/2013 SQLITE_INSTALL_STAGING = YES Modified: branches/1.0/package/sqliteodbc/sqliteodbc.mk =================================================================== --- branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-05-23 16:24:57 UTC (rev 6100) +++ branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-05-23 19:52:43 UTC (rev 6101) @@ -3,7 +3,7 @@ # sqliteodbc # ############################################################# -SQLITEODBC_VERSION = 0.992 +SQLITEODBC_VERSION = 0.993 SQLITEODBC_SOURCE = sqliteodbc-$(SQLITEODBC_VERSION).tar.gz SQLITEODBC_SITE = http://www.ch-werner.de/sqliteodbc SQLITEODBC_SUBDIR = sqliteodbc-$(SQLITEODBC_VERSION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-08-06 17:44:01
|
Revision: 6167 http://sourceforge.net/p/astlinux/code/6167 Author: abelbeck Date: 2013-08-06 17:43:59 +0000 (Tue, 06 Aug 2013) Log Message: ----------- logrotate, add logrotate.d rules for openvpn, lighttpd and prosody Modified Paths: -------------- branches/1.0/package/lighttpd/lighttpd.mk branches/1.0/package/openvpn/openvpn.mk branches/1.0/package/prosody/prosody.mk Added Paths: ----------- branches/1.0/package/lighttpd/lighttpd.logrotate branches/1.0/package/openvpn/openvpn.logrotate branches/1.0/package/prosody/prosody.logrotate Added: branches/1.0/package/lighttpd/lighttpd.logrotate =================================================================== --- branches/1.0/package/lighttpd/lighttpd.logrotate (rev 0) +++ branches/1.0/package/lighttpd/lighttpd.logrotate 2013-08-06 17:43:59 UTC (rev 6167) @@ -0,0 +1,14 @@ +# +/var/log/lighttpd/*.log { + missingok + size 100k + copytruncate + rotate 1 + sharedscripts + postrotate + if [ -f /var/run/lighttpd.pid ]; then + /bin/kill -HUP $(cat /var/run/lighttpd.pid) >/dev/null 2>&1 + fi + endscript +} + Modified: branches/1.0/package/lighttpd/lighttpd.mk =================================================================== --- branches/1.0/package/lighttpd/lighttpd.mk 2013-08-06 14:10:17 UTC (rev 6166) +++ branches/1.0/package/lighttpd/lighttpd.mk 2013-08-06 17:43:59 UTC (rev 6167) @@ -52,6 +52,7 @@ define LIGHTTPD_INSTALL_INITSCRIPT $(INSTALL) -D -m 0644 package/lighttpd/lighttpd.conf $(TARGET_DIR)/stat/etc/lighttpd.conf $(INSTALL) -D -m 0755 package/lighttpd/lighttpd.init $(TARGET_DIR)/etc/init.d/lighttpd + $(INSTALL) -D -m 0644 package/lighttpd/lighttpd.logrotate $(TARGET_DIR)/etc/logrotate.d/lighttpd ln -sf /tmp/etc/lighttpd.conf $(TARGET_DIR)/etc/lighttpd.conf endef Added: branches/1.0/package/openvpn/openvpn.logrotate =================================================================== --- branches/1.0/package/openvpn/openvpn.logrotate (rev 0) +++ branches/1.0/package/openvpn/openvpn.logrotate 2013-08-06 17:43:59 UTC (rev 6167) @@ -0,0 +1,8 @@ +# +/var/log/openvpn.log /var/log/openvpnclient.log { + missingok + size 100k + copytruncate + rotate 1 +} + Modified: branches/1.0/package/openvpn/openvpn.mk =================================================================== --- branches/1.0/package/openvpn/openvpn.mk 2013-08-06 14:10:17 UTC (rev 6166) +++ branches/1.0/package/openvpn/openvpn.mk 2013-08-06 17:43:59 UTC (rev 6167) @@ -32,6 +32,7 @@ define OPENVPN_INSTALL_TARGET_CMDS $(INSTALL) -m 755 $(@D)/src/openvpn/openvpn $(TARGET_DIR)/usr/sbin/openvpn $(INSTALL) -m 755 -D package/openvpn/openvpn.init $(TARGET_DIR)/etc/init.d/openvpn + $(INSTALL) -m 644 -D package/openvpn/openvpn.logrotate $(TARGET_DIR)/etc/logrotate.d/openvpn $(INSTALL) -m 755 -D package/openvpn/openvpnclient.init $(TARGET_DIR)/etc/init.d/openvpnclient $(INSTALL) -m 755 -D package/openvpn/tls-verify.sh $(TARGET_DIR)/usr/sbin/openvpn-tls-verify $(INSTALL) -m 755 -D package/openvpn/user-pass-verify.sh $(TARGET_DIR)/usr/sbin/openvpn-user-pass-verify Added: branches/1.0/package/prosody/prosody.logrotate =================================================================== --- branches/1.0/package/prosody/prosody.logrotate (rev 0) +++ branches/1.0/package/prosody/prosody.logrotate 2013-08-06 17:43:59 UTC (rev 6167) @@ -0,0 +1,13 @@ +# +/var/log/prosody/prosody.log /var/log/prosody/prosody.err { + missingok + size 100k + rotate 1 + sharedscripts + postrotate + if [ -f /var/run/prosody/prosody.pid ]; then + /bin/kill -HUP $(cat /var/run/prosody/prosody.pid) >/dev/null 2>&1 + fi + endscript +} + Modified: branches/1.0/package/prosody/prosody.mk =================================================================== --- branches/1.0/package/prosody/prosody.mk 2013-08-06 14:10:17 UTC (rev 6166) +++ branches/1.0/package/prosody/prosody.mk 2013-08-06 17:43:59 UTC (rev 6167) @@ -33,6 +33,7 @@ $(INSTALL) -m 0644 -D package/prosody/modules/mod_pinger.lua $(TARGET_DIR)/usr/lib/prosody/modules/ $(INSTALL) -m 0644 -D package/prosody/util/watchdog.lua $(TARGET_DIR)/usr/lib/prosody/util/ $(INSTALL) -m 0755 -D package/prosody/prosody.init $(TARGET_DIR)/etc/init.d/prosody + $(INSTALL) -m 0644 -D package/prosody/prosody.logrotate $(TARGET_DIR)/etc/logrotate.d/prosody $(INSTALL) -m 0755 -D package/prosody/prosodycmd $(TARGET_DIR)/usr/bin/prosodycmd ln -s /tmp/etc/prosody $(TARGET_DIR)/etc/prosody ln -sf ../../init.d/prosody $(TARGET_DIR)/etc/runlevels/default/S58prosody This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-08-22 19:00:30
|
Revision: 6175 http://sourceforge.net/p/astlinux/code/6175 Author: abelbeck Date: 2013-08-22 19:00:25 +0000 (Thu, 22 Aug 2013) Log Message: ----------- prosody, version bump to 0.9.0, IPv6 support, add log_auth for Adaptive Ban support Modified Paths: -------------- branches/1.0/package/luasec/luasec.mk branches/1.0/package/luasocket/luasocket.mk branches/1.0/package/prosody/modules/mod_listusers.lua branches/1.0/package/prosody/prosody.init branches/1.0/package/prosody/prosody.mk Added Paths: ----------- branches/1.0/package/prosody/modules/mod_log_auth.lua Removed Paths: ------------- branches/1.0/package/prosody/util/ Modified: branches/1.0/package/luasec/luasec.mk =================================================================== --- branches/1.0/package/luasec/luasec.mk 2013-08-20 22:37:44 UTC (rev 6174) +++ branches/1.0/package/luasec/luasec.mk 2013-08-22 19:00:25 UTC (rev 6175) @@ -4,24 +4,22 @@ # ############################################################# -LUASEC_VERSION = 0.4.1 -LUASEC_SOURCE = luasec-$(LUASEC_VERSION).tar.gz +LUASEC_VERSION = 0.5 +LUASEC_SOURCE = luasec-prosody-$(LUASEC_VERSION).tar.gz LUASEC_SITE = http://files.astlinux.org LUASEC_DEPENDENCIES = lua openssl luasocket define LUASEC_BUILD_CMDS - $(MAKE) -C $(@D)/src linux \ - INCDIR="-I$(STAGING_DIR)/usr/include/" \ - LIBDIR="-L$(STAGING_DIR)/usr/lib/" \ - CFLAGS="$(TARGET_CFLAGS) -fpic" \ + $(MAKE) -C $(@D) linux \ + LIBDIR="-L$(STAGING_DIR)/usr/lib/ -L$(@D)/src/luasocket" \ CC="$(TARGET_CC)" \ LD="$(TARGET_LD) -shared" endef define LUASEC_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D)/src \ + $(MAKE) -C $(@D) install \ LUACPATH="$(TARGET_DIR)/usr/lib/lua" \ - LUAPATH="$(TARGET_DIR)/usr/share/lua" install + LUAPATH="$(TARGET_DIR)/usr/share/lua" endef define LUASEC_UNINSTALL_TARGET_CMDS Modified: branches/1.0/package/luasocket/luasocket.mk =================================================================== --- branches/1.0/package/luasocket/luasocket.mk 2013-08-20 22:37:44 UTC (rev 6174) +++ branches/1.0/package/luasocket/luasocket.mk 2013-08-22 19:00:25 UTC (rev 6175) @@ -4,20 +4,21 @@ # ############################################################# -LUASOCKET_VERSION = 2.0.2 -LUASOCKET_SITE = http://luaforge.net/frs/download.php/2664 +LUASOCKET_VERSION = 3.0-rc1 +LUASOCKET_SOURCE = luasocket-$(LUASOCKET_VERSION).tar.gz +LUASOCKET_SITE = http://files.astlinux.org +#LUASOCKET_SITE = http://github.com/diegonehab/luasocket/archive LUASOCKET_DEPENDENCIES = lua define LUASOCKET_BUILD_CMDS $(MAKE) -C $(@D) -f makefile \ - CC="$(TARGET_CC)" LD="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -fPIC" + CC="$(TARGET_CC)" LD="$(TARGET_CC)" endef define LUASOCKET_INSTALL_TARGET_CMDS $(MAKE) -C $(@D) -f makefile \ - INSTALL_TOP_SHARE="$(TARGET_DIR)/usr/share/lua" \ - INSTALL_TOP_LIB="$(TARGET_DIR)/usr/lib/lua" install + INSTALL_TOP_LDIR="$(TARGET_DIR)/usr/share/lua" \ + INSTALL_TOP_CDIR="$(TARGET_DIR)/usr/lib/lua" install-unix endef define LUASOCKET_UNINSTALL_TARGET_CMDS Modified: branches/1.0/package/prosody/modules/mod_listusers.lua =================================================================== --- branches/1.0/package/prosody/modules/mod_listusers.lua 2013-08-20 22:37:44 UTC (rev 6174) +++ branches/1.0/package/prosody/modules/mod_listusers.lua 2013-08-22 19:00:25 UTC (rev 6175) @@ -1,27 +1,76 @@ -function module.command() +function module.command(args) + local action = table.remove(args, 1); + if not action then -- Default, list registered users + local data_path = CFG_DATADIR or "data"; + if not pcall(require, "luarocks.loader") then + pcall(require, "luarocks.require"); + end + local lfs = require "lfs"; + function decode(s) + return s:gsub("%%([a-fA-F0-9][a-fA-F0-9])", function (c) + return string.char(tonumber("0x"..c)); + end); + end + for host in lfs.dir(data_path) do + local accounts = data_path.."/"..host.."/accounts"; + if lfs.attributes(accounts, "mode") == "directory" then + for user in lfs.dir(accounts) do + if user:sub(1,1) ~= "." then + print(decode(user:gsub("%.dat$", "")).."@"..decode(host)); + end + end + end + end + elseif action == "--connected" then -- List connected users + local socket = require "socket"; + local default_local_interfaces = { }; + if socket.tcp6 and config.get("*", "use_ipv6") ~= false then + table.insert(default_local_interfaces, "::1"); + end + if config.get("*", "use_ipv4") ~= false then + table.insert(default_local_interfaces, "127.0.0.1"); + end - local data_path = CFG_DATADIR or "data"; - - if not pcall(require, "luarocks.loader") then - pcall(require, "luarocks.require"); - end - - local lfs = require "lfs"; - - function decode(s) - return s:gsub("%%([a-fA-F0-9][a-fA-F0-9])", function (c) - return string.char(tonumber("0x"..c)); - end); - end - - for host in lfs.dir(data_path) do - local accounts = data_path.."/"..host.."/accounts"; - if lfs.attributes(accounts, "mode") == "directory" then - for user in lfs.dir(accounts) do - if user:sub(1,1) ~= "." then - print(decode(user:gsub("%.dat$", "")).."@"..decode(host)); - end - end - end - end + local console_interfaces = config.get("*", "console_interfaces") + or config.get("*", "local_interfaces") + or default_local_interfaces + console_interfaces = type(console_interfaces)~="table" + and {console_interfaces} or console_interfaces; + + local console_ports = config.get("*", "console_ports") or 5582 + console_ports = type(console_ports) ~= "table" and { console_ports } or console_ports; + + local st, conn = pcall(assert,socket.connect(console_interfaces[1], console_ports[1])); + if (not st) then print("Error"..(conn and ": "..conn or "")); return 1; end + + local banner = config.get("*", "console_banner"); + if ( + (not banner) or + ( + (type(banner) == "string") and + (banner:match("^| (.+)$")) + ) + ) then + repeat + local rec_banner = conn:receive() + until + rec_banner == "" or + rec_banner == nil; -- skip banner + end + + conn:send("c2s:show()\n"); + conn:settimeout(1); -- Only hit in case of failure + + repeat local line = conn:receive() + if not line then break; end + local jid = line:match("^| (.+)$"); + if jid then + jid = jid:gsub(" %- (%w+%(%d+%))$", "\t%1"); + print(jid); + elseif line:match("^| OK:") then + return 0; + end + until false; + end + return 0; end Added: branches/1.0/package/prosody/modules/mod_log_auth.lua =================================================================== --- branches/1.0/package/prosody/modules/mod_log_auth.lua (rev 0) +++ branches/1.0/package/prosody/modules/mod_log_auth.lua 2013-08-22 19:00:25 UTC (rev 6175) @@ -0,0 +1,4 @@ + +module:hook("authentication-failure", function (event) + module:log("info", "Failed authentication attempt (%s) from IP: %s", event.condition or "unknown-condition", event.session.ip or "?"); +end); Modified: branches/1.0/package/prosody/prosody.init =================================================================== --- branches/1.0/package/prosody/prosody.init 2013-08-20 22:37:44 UTC (rev 6174) +++ branches/1.0/package/prosody/prosody.init 2013-08-22 19:00:25 UTC (rev 6175) @@ -5,7 +5,7 @@ DEFAULT_MODULES="roster saslauth tls disco \ private vcard \ legacyauth version uptime time ping pep register adhoc \ -admin_adhoc admin_telnet" +admin_adhoc admin_telnet log_auth" DEFAULT_MODULES_S2S="dialback" @@ -25,8 +25,8 @@ gen_xmpp_config() { - local m vh MODS ADD_MODS="" modules="" admins="" hostname cert key no_s2s log syslog error c2s_port s2s_port - local LOG_OK SYSLOG_OK ERROR_LOG GROUPS_OK IFS c2s_idle_timeout + local m vh MODS ADD_MODS="" modules="" admins="" hostname cert key log syslog error c2s_port s2s_port + local LOG_OK SYSLOG_OK ERROR_LOG GROUPS_OK IFS c2s_idle_timeout disable_core_mods="" no_s2s="" cert="${XMPP_CERT:-/etc/prosody/certs/server.crt}" key="${XMPP_KEY:-/etc/prosody/certs/server.key}" @@ -39,11 +39,10 @@ if [ "$XMPP_ENABLE_S2S" = "yes" ]; then MODS="$DEFAULT_MODULES $DEFAULT_MODULES_S2S" - no_s2s="false" s2s_port="${XMPP_S2S_PORT:-5269}" else MODS="$DEFAULT_MODULES" - no_s2s="true" + no_s2s="s2s" s2s_port="" fi @@ -74,6 +73,9 @@ modules="$modules${modules:+, }\"$m\"" fi done + for m in $no_s2s; do + disable_core_mods="$disable_core_mods${disable_core_mods:+, }\"$m\"" + done for m in $XMPP_ADMIN_USERS; do admins="$admins${admins:+, }\"$m\"" @@ -116,8 +118,6 @@ authentication = \"internal_plain\" -disallow_s2s = $no_s2s - c2s_require_encryption = true${c2s_idle_timeout:+ c2s_idle_timeout = $c2s_idle_timeout} @@ -143,7 +143,7 @@ modules_enabled = { \"posix\", $modules } -modules_disabled = { } +modules_disabled = { $disable_core_mods } " unset IFS Modified: branches/1.0/package/prosody/prosody.mk =================================================================== --- branches/1.0/package/prosody/prosody.mk 2013-08-20 22:37:44 UTC (rev 6174) +++ branches/1.0/package/prosody/prosody.mk 2013-08-22 19:00:25 UTC (rev 6175) @@ -4,7 +4,7 @@ # ############################################################# -PROSODY_VERSION = 0.8.2 +PROSODY_VERSION = 0.9.0 PROSODY_SOURCE = prosody-$(PROSODY_VERSION).tar.gz PROSODY_SITE = http://prosody.im/downloads/source PROSODY_DEPENDENCIES = lua libidn openssl luafilesystem luaexpat luasocket luasec @@ -30,8 +30,8 @@ cp $(TARGET_DIR)/etc/prosody/prosody.cfg.lua $(TARGET_DIR)/stat/etc/prosody/prosody.cfg.lua rm -rf $(TARGET_DIR)/etc/prosody $(INSTALL) -m 0644 -D package/prosody/modules/mod_listusers.lua $(TARGET_DIR)/usr/lib/prosody/modules/ + $(INSTALL) -m 0644 -D package/prosody/modules/mod_log_auth.lua $(TARGET_DIR)/usr/lib/prosody/modules/ $(INSTALL) -m 0644 -D package/prosody/modules/mod_pinger.lua $(TARGET_DIR)/usr/lib/prosody/modules/ - $(INSTALL) -m 0644 -D package/prosody/util/watchdog.lua $(TARGET_DIR)/usr/lib/prosody/util/ $(INSTALL) -m 0755 -D package/prosody/prosody.init $(TARGET_DIR)/etc/init.d/prosody $(INSTALL) -m 0644 -D package/prosody/prosody.logrotate $(TARGET_DIR)/etc/logrotate.d/prosody $(INSTALL) -m 0755 -D package/prosody/prosodycmd $(TARGET_DIR)/usr/bin/prosodycmd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-09-30 19:18:01
|
Revision: 6208 http://sourceforge.net/p/astlinux/code/6208 Author: abelbeck Date: 2013-09-30 19:17:57 +0000 (Mon, 30 Sep 2013) Log Message: ----------- sqlite3 and sqliteodbc version bumps to 3.8.0.2 and 0.995 Modified Paths: -------------- branches/1.0/package/sqlite/sqlite.mk branches/1.0/package/sqliteodbc/sqliteodbc.mk Modified: branches/1.0/package/sqlite/sqlite.mk =================================================================== --- branches/1.0/package/sqlite/sqlite.mk 2013-09-29 20:37:47 UTC (rev 6207) +++ branches/1.0/package/sqlite/sqlite.mk 2013-09-30 19:17:57 UTC (rev 6208) @@ -4,7 +4,7 @@ # ############################################################# -SQLITE_VERSION = 3071700 +SQLITE_VERSION = 3080002 SQLITE_SOURCE = sqlite-autoconf-$(SQLITE_VERSION).tar.gz SQLITE_SITE = http://www.sqlite.org/2013 SQLITE_INSTALL_STAGING = YES Modified: branches/1.0/package/sqliteodbc/sqliteodbc.mk =================================================================== --- branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-09-29 20:37:47 UTC (rev 6207) +++ branches/1.0/package/sqliteodbc/sqliteodbc.mk 2013-09-30 19:17:57 UTC (rev 6208) @@ -3,7 +3,7 @@ # sqliteodbc # ############################################################# -SQLITEODBC_VERSION = 0.993 +SQLITEODBC_VERSION = 0.995 SQLITEODBC_SOURCE = sqliteodbc-$(SQLITEODBC_VERSION).tar.gz SQLITEODBC_SITE = http://www.ch-werner.de/sqliteodbc SQLITEODBC_SUBDIR = sqliteodbc-$(SQLITEODBC_VERSION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-10-04 22:13:05
|
Revision: 6216 http://sourceforge.net/p/astlinux/code/6216 Author: abelbeck Date: 2013-10-04 22:13:02 +0000 (Fri, 04 Oct 2013) Log Message: ----------- slapd, revert attempt to use sql/odbc backend with sqlite3... it *almost* works as read-only but openldap's locking prevents external app SQL write access and sqlite3 is not feature rich enough to support openldap sql writes. The good news, moving to 'mdb' seems to work well. Modified Paths: -------------- branches/1.0/package/openldap/openldap.mk branches/1.0/package/openldap/slapd.init branches/1.0/package/unixodbc/unixodbc.init branches/1.0/package/webinterface/altweb/admin/phpliteadmin.php Modified: branches/1.0/package/openldap/openldap.mk =================================================================== --- branches/1.0/package/openldap/openldap.mk 2013-10-04 04:52:57 UTC (rev 6215) +++ branches/1.0/package/openldap/openldap.mk 2013-10-04 22:13:02 UTC (rev 6216) @@ -15,16 +15,15 @@ OPENLDAP_CONF_OPT = \ --enable-shared \ --disable-static \ - --enable-debug \ + --disable-debug \ --enable-syslog \ --enable-ipv6 \ --with-tls \ - --with-odbc=unixodbc \ --with-yielding_select=yes \ --without-fetch \ --without-cyrus-sasl \ --enable-slapd \ - --enable-sql \ + --enable-mdb \ --enable-null \ --disable-local \ --disable-bdb \ Modified: branches/1.0/package/openldap/slapd.init =================================================================== --- branches/1.0/package/openldap/slapd.init 2013-10-04 04:52:57 UTC (rev 6215) +++ branches/1.0/package/openldap/slapd.init 2013-10-04 22:13:02 UTC (rev 6216) @@ -2,52 +2,6 @@ . /etc/rc.conf -gen_sqlite3_schema() -{ - - sqlite3 -batch /mnt/kd/ldap-odbc.sqlite3 <<EOF -CREATE TABLE 'ldap_oc_mappings' ( - 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - 'name' TEXT NOT NULL, - 'keytbl' TEXT NOT NULL, - 'keycol' TEXT NOT NULL, - 'create_proc' TEXT, - 'delete_proc' TEXT, - 'expect_return' INTEGER NOT NULL -); - -CREATE TABLE 'ldap_attr_mappings' ( - 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - 'oc_map_id' INTEGER NOT NULL REFERENCES ldap_oc_mappings('id'), - 'name' TEXT NOT NULL, - 'sel_expr' TEXT NOT NULL, - 'sel_expr_u' TEXT, - 'from_tbls' TEXT NOT NULL, - 'join_where' TEXT, - 'add_proc' TEXT, - 'delete_proc' TEXT, - 'param_order' INTEGER NOT NULL, - 'expect_return' INTEGER NOT NULL -); - -CREATE TABLE 'ldap_entries' ( - 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - 'dn' TEXT NOT NULL, - 'oc_map_id' INTEGER NOT NULL REFERENCES ldap_oc_mappings('id'), - 'parent' INTEGER NOT NULL, - 'keyval' INTEGER NOT NULL, - UNIQUE ( oc_map_id, keyval ), - UNIQUE ( dn ) -); - -CREATE TABLE 'ldap_entry_objclasses' ( - 'entry_id' INTEGER NOT NULL REFERENCES ldap_entries('id'), - 'oc_name' TEXT -); - -EOF -} - gen_slapd_conf() { local cert key @@ -71,26 +25,26 @@ logger -t slapd -p kern.info "Try generating an Asterisk SIP-TLS Server Certificate, which LDAP Server will use by default." fi - echo "database sql -#suffix \"o=sql,c=RU\" -#rootdn \"cn=root,o=sql,c=RU\" + echo "disallow bind_anon +access to * + by self write + by anonymous auth + by users read +access to dn.subtree=\"ou=addressbook,dc=example,dc=com\" + by users write +" + + echo "database mdb suffix \"dc=example,dc=com\" -rootdn \"cn=root,dc=example,dc=com\" +rootdn \"cn=Manager,dc=example,dc=com\" rootpw astlinux -dbname ldap -dbuser unused -dbpasswd unused -insentry_stmt \"INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)\" -upper_func \"upper\" -concat_pattern \"?||?\" -has_ldapinfo_dn_ru no -" - echo "#database ldif -#suffix \"dc=example,dc=com\" -#rootdn \"cn=root,dc=example,dc=com\" -#rootpw astlinux -#directory /var/lib/ldap +directory /var/lib/ldap + +index objectClass eq,pres + +maxreaders 64 +maxsize 10485760 " } @@ -120,10 +74,12 @@ if [ ! -d /var/lib/ldap ]; then mkdir -m 0700 -p /var/lib/ldap fi - - if [ ! -f /mnt/kd/ldap-odbc.sqlite3 ]; then - gen_sqlite3_schema + if [ ! -d /mnt/kd/ldap ]; then + mkdir -m 0700 -p /mnt/kd/ldap fi + if [ -d /mnt/kd/ldap ]; then + ln -sf /mnt/kd/ldap/data.mdb /var/lib/ldap/data.mdb + fi } start () { Modified: branches/1.0/package/unixodbc/unixodbc.init =================================================================== --- branches/1.0/package/unixodbc/unixodbc.init 2013-10-04 04:52:57 UTC (rev 6215) +++ branches/1.0/package/unixodbc/unixodbc.init 2013-10-04 22:13:02 UTC (rev 6216) @@ -102,14 +102,6 @@ Timeout=2000 " install_odbc_dsn "asterisk-cdr" "$DATA" - - DATA=" -Description=LDAP database -Driver=SQLite3 -Database=/mnt/kd/ldap-odbc.sqlite3 -Timeout=2000 -" - install_odbc_dsn "ldap" "$DATA" } stop () { @@ -120,7 +112,6 @@ # Remove DSN's remove_odbc_dsn "asterisk" remove_odbc_dsn "asterisk-cdr" - remove_odbc_dsn "ldap" } case $1 in Modified: branches/1.0/package/webinterface/altweb/admin/phpliteadmin.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/phpliteadmin.php 2013-10-04 04:52:57 UTC (rev 6215) +++ branches/1.0/package/webinterface/altweb/admin/phpliteadmin.php 2013-10-04 22:13:02 UTC (rev 6216) @@ -99,9 +99,6 @@ if (is_file('/mnt/kd/cdr-sqlite3/master.db')) { $databases[] = array( "path"=> "/mnt/kd/cdr-sqlite3/master.db", "name"=> "CDR SQLite3" ); } -if (is_file('/mnt/kd/ldap-odbc.sqlite3')) { - $databases[] = array( "path"=> "/mnt/kd/ldap-odbc.sqlite3", "name"=> "LDAP" ); -} //AstLinux// end of define database files This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-11-02 15:57:23
|
Revision: 6259 http://sourceforge.net/p/astlinux/code/6259 Author: abelbeck Date: 2013-11-02 15:57:17 +0000 (Sat, 02 Nov 2013) Log Message: ----------- Add Dial Prefix option to LDAP-AB tab and vcard-export command Modified Paths: -------------- branches/1.0/package/openldap/vcard-export branches/1.0/package/webinterface/altweb/admin/ldapab.php branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php Modified: branches/1.0/package/openldap/vcard-export =================================================================== --- branches/1.0/package/openldap/vcard-export 2013-11-01 21:56:05 UTC (rev 6258) +++ branches/1.0/package/openldap/vcard-export 2013-11-02 15:57:17 UTC (rev 6259) @@ -6,6 +6,7 @@ //AstLinux// Default for 'ldap' format //AstLinux// Change -n option to -b for Base_DN //AstLinux// Add sanitize phone numbers option, -s and -S +//AstLinux// Add -P dialprefix option /* +-----------------------------------------------------------------------+ @@ -26,7 +27,7 @@ require_once '/stat/var/www/common/vcard-parse-convert.php'; $usage = <<<EOF -Usage: vcard-export [-himpsSv] [-d delimiter] [-b Base_DN] [-o output_file] [-f format] input_file +Usage: vcard-export [-himpsSv] [-P dialprefix] [-d delimiter] [-b Base_DN] [-o output_file] [-f format] input_file Options: -b Base LDAP identifier added to dn:, defaults to 'ou=addressbook,dc=ldap' @@ -48,7 +49,7 @@ die($usage); // read commandline arguments -$options = 'himpsSvd:b:o:f:'; +$options = 'himpsSvP:d:b:o:f:'; if (($opt = getopt($options)) === FALSE) { die($usage); } @@ -76,12 +77,20 @@ die("Not enough arguments!\n$usage"); // instantiate a parser object -$conv = new vcard_convert(array('mailonly' => isset($opt['m']), - 'phoneonly' => isset($opt['p']), - 'sanitize' => isset($opt['s']), - 'sanitize_dash' => isset($opt['S']))); +$opt_array = array( + 'mailonly' => isset($opt['m']), + 'phoneonly' => isset($opt['p']), + 'sanitize' => isset($opt['s']), + 'sanitize_dash' => isset($opt['S']) +); +if (isset($opt['P'])) { + if (($dialprefix = preg_replace('/[^0-9+-]/', '', $opt['P'])) !== '') { + $opt_array['dialprefix'] = $dialprefix; + } +} // parse a vCard file +$conv = new vcard_convert($opt_array); if ($conv->fromFile($file)) { if (isset($opt['v'])) Modified: branches/1.0/package/webinterface/altweb/admin/ldapab.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/ldapab.php 2013-11-01 21:56:05 UTC (rev 6258) +++ branches/1.0/package/webinterface/altweb/admin/ldapab.php 2013-11-02 15:57:17 UTC (rev 6259) @@ -174,6 +174,11 @@ 'sanitize' => isset($_POST['opt_s']), 'sanitize_dash' => isset($_POST['opt_S']) ); + if (isset($_POST['opt_dialprefix'])) { + if (($dialprefix = preg_replace('/[^0-9+-]/', '', $_POST['opt_dialprefix'])) !== '') { + $options['dialprefix'] = $dialprefix; + } + } // parse a vCard file $conv = new vcard_convert($options); @@ -386,6 +391,9 @@ putHtml('<input type="checkbox" value="opt_p" name="opt_p" /></td><td>Skip vCards without phone numbers</td></tr>'); putHtml('<tr><td class="dialogText" style="text-align: right;">'); putHtml('<input type="checkbox" value="opt_m" name="opt_m" /></td><td>Skip vCards without e-mail addresses</td></tr>'); + putHtml('<tr><td class="dialogText" style="text-align: right;">'); + putHtml('<input type="text" size="3" maxlength="8" name="opt_dialprefix" value="" />'); + putHtml('</td><td>Dial Prefix added to all phone numbers</td></tr>'); putHtml('<tr><td style="text-align: center;" colspan="2">'); putHtml('<input type="file" name="import_vcard" />'); putHtml('–'); Modified: branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php 2013-11-01 21:56:05 UTC (rev 6258) +++ branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php 2013-11-02 15:57:17 UTC (rev 6259) @@ -924,6 +924,7 @@ var $accesscode = null; var $sanitize = false; //AstLinux// var $sanitize_dash = false; //AstLinux// + var $dialprefix = ''; //AstLinux// /** @@ -1807,6 +1808,9 @@ $phone = preg_replace('/[^0-9+]+/', '-', $phone); $phone = preg_replace('/[^0-9+-]/', '', trim($phone, '-')); } + if ($this->dialprefix !== '') { + $phone = $this->dialprefix.$phone; + } //AstLinux// return $phone; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-11-05 17:48:42
|
Revision: 6263 http://sourceforge.net/p/astlinux/code/6263 Author: abelbeck Date: 2013-11-05 17:48:38 +0000 (Tue, 05 Nov 2013) Log Message: ----------- LDAP-AB tab and vcard-export, add Normalize International E.164 prefixes option Modified Paths: -------------- branches/1.0/package/openldap/vcard-export branches/1.0/package/webinterface/altweb/admin/ldapab.php branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php Modified: branches/1.0/package/openldap/vcard-export =================================================================== --- branches/1.0/package/openldap/vcard-export 2013-11-03 23:52:20 UTC (rev 6262) +++ branches/1.0/package/openldap/vcard-export 2013-11-05 17:48:38 UTC (rev 6263) @@ -6,6 +6,7 @@ //AstLinux// Default for 'ldap' format //AstLinux// Change -n option to -b for Base_DN //AstLinux// Add sanitize phone numbers option, -s and -S +//AstLinux// Add -n Normalize International E.164 prefixes option //AstLinux// Add -P dialprefix option /* @@ -27,7 +28,7 @@ require_once '/stat/var/www/common/vcard-parse-convert.php'; $usage = <<<EOF -Usage: vcard-export [-himpsSv] [-P dialprefix] [-d delimiter] [-b Base_DN] [-o output_file] [-f format] input_file +Usage: vcard-export [-himnpsSv] [-P dialprefix] [-d delimiter] [-b Base_DN] [-o output_file] [-f format] input_file Options: -b Base LDAP identifier added to dn:, defaults to 'ou=addressbook,dc=ldap' @@ -36,6 +37,7 @@ -h Include header line in CSV output -i Convert CSV output to ISO-8859-1 encoding -m Only convert cards with an e-mail address + -n Normalize International E.164 prefixes (using DIALING_PREFIX_NUMBERS) -o Output file (write to stdout by default) -p Only convert cards with phone numbers -s Sanitize phone numbers to only include "+0123456789" characters @@ -49,7 +51,7 @@ die($usage); // read commandline arguments -$options = 'himpsSvP:d:b:o:f:'; +$options = 'himnpsSvP:d:b:o:f:'; if (($opt = getopt($options)) === FALSE) { die($usage); } @@ -83,6 +85,12 @@ 'sanitize' => isset($opt['s']), 'sanitize_dash' => isset($opt['S']) ); +if (isset($opt['n']) && ($df = trim(shell_exec('. /etc/rc.conf; echo "$DIALING_PREFIX_NUMBERS"'))) !== '') { + $df_opts = explode('~', $df); + $opt_array['internationalprefix'] = isset($df_opts[0]) ? $df_opts[0] : ''; + $opt_array['nationalprefix'] = isset($df_opts[1]) ? $df_opts[1] : ''; + $opt_array['countryprefix'] = isset($df_opts[2]) ? $df_opts[2] : ''; +} if (isset($opt['P'])) { if (($dialprefix = preg_replace('/[^0-9+-]/', '', $opt['P'])) !== '') { $opt_array['dialprefix'] = $dialprefix; Modified: branches/1.0/package/webinterface/altweb/admin/ldapab.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/ldapab.php 2013-11-03 23:52:20 UTC (rev 6262) +++ branches/1.0/package/webinterface/altweb/admin/ldapab.php 2013-11-05 17:48:38 UTC (rev 6263) @@ -174,6 +174,12 @@ 'sanitize' => isset($_POST['opt_s']), 'sanitize_dash' => isset($_POST['opt_S']) ); + if (isset($_POST['opt_n'])) { + $df_opts = explode('~', $_POST['opt_n']); + $options['internationalprefix'] = isset($df_opts[0]) ? $df_opts[0] : ''; + $options['nationalprefix'] = isset($df_opts[1]) ? $df_opts[1] : ''; + $options['countryprefix'] = isset($df_opts[2]) ? $df_opts[2] : ''; + } if (isset($_POST['opt_dialprefix'])) { if (($dialprefix = preg_replace('/[^0-9+-]/', '', $_POST['opt_dialprefix'])) !== '') { $options['dialprefix'] = $dialprefix; @@ -387,6 +393,11 @@ putHtml('<input type="checkbox" value="opt_s" name="opt_s" /></td><td>Sanitize phone numbers to only<br />include "+0123456789" characters</td></tr>'); putHtml('<tr><td class="dialogText" style="text-align: right;">'); putHtml('<input type="checkbox" value="opt_S" name="opt_S" checked="checked" /></td><td>Sanitize as above but replace<br />sequential non-numbers with a dash "-"</td></tr>'); + if (($df = trim(shell_exec('. /etc/rc.conf; echo "$DIALING_PREFIX_NUMBERS"'))) !== '') { + putHtml('<tr><td class="dialogText" style="text-align: right;">'); + putHtml('<input type="checkbox" value="'.$df.'" name="opt_n" /></td><td>Normalize International E.164 prefixes'); + putHtml('</td></tr>'); + } putHtml('<tr><td class="dialogText" style="text-align: right;">'); putHtml('<input type="checkbox" value="opt_p" name="opt_p" /></td><td>Skip vCards without phone numbers</td></tr>'); putHtml('<tr><td class="dialogText" style="text-align: right;">'); Modified: branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php 2013-11-03 23:52:20 UTC (rev 6262) +++ branches/1.0/package/webinterface/altweb/common/vcard-parse-convert.php 2013-11-05 17:48:38 UTC (rev 6263) @@ -5,6 +5,7 @@ //AstLinux// Default for 'ldap' format //AstLinux// Change -n option to -b for Base_DN //AstLinux// Add sanitize phone numbers option, -s and -S +//AstLinux// Add internationalprefix, nationalprefix, countryprefix and dialprefix to normalize_phone() /* +-----------------------------------------------------------------------+ @@ -924,6 +925,9 @@ var $accesscode = null; var $sanitize = false; //AstLinux// var $sanitize_dash = false; //AstLinux// + var $internationalprefix = ''; //AstLinux// + var $nationalprefix = ''; //AstLinux// + var $countryprefix = ''; //AstLinux// var $dialprefix = ''; //AstLinux// @@ -1802,14 +1806,30 @@ if (strlen($this->accesscode)) $phone = preg_replace('/^[\+|00]+' . $this->accesscode . '[- ]*(\d+)/', '0\1', $phone); //AstLinux// + if ($this->nationalprefix !== '') { + $phone = preg_replace('/\('.$this->nationalprefix.'\)/', '', $phone); + } if ($this->sanitize) { $phone = preg_replace('/[^0-9+]/', '', $phone); } elseif ($this->sanitize_dash) { $phone = preg_replace('/[^0-9+]+/', '-', $phone); $phone = preg_replace('/[^0-9+-]/', '', trim($phone, '-')); } - if ($this->dialprefix !== '') { - $phone = $this->dialprefix.$phone; + if ($phone !== '') { + if ($this->countryprefix !== '') { + $match = '+'.$this->countryprefix; + if (strncmp($phone, $match, strlen($match)) == 0) { + $phone = $this->nationalprefix.substr($phone, strlen($match)); + } + } + if ($this->internationalprefix !== '') { + if (strncmp($phone, '+', 1) == 0) { + $phone = $this->internationalprefix.substr($phone, 1); + } + } + if ($this->dialprefix !== '') { + $phone = $this->dialprefix.$phone; + } } //AstLinux// return $phone; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-11-16 01:43:52
|
Revision: 6281 http://sourceforge.net/p/astlinux/code/6281 Author: abelbeck Date: 2013-11-16 01:43:48 +0000 (Sat, 16 Nov 2013) Log Message: ----------- libpcap / tcpdump version bumps to 1.4.0 / 4.4.0 Modified Paths: -------------- branches/1.0/package/libpcap/libpcap.mk branches/1.0/package/tcpdump/tcpdump.mk Added Paths: ----------- branches/1.0/package/libpcap/libpcap-remove-libnl-include-path.patch Removed Paths: ------------- branches/1.0/package/libpcap/libpcap-disable-canusb.patch Deleted: branches/1.0/package/libpcap/libpcap-disable-canusb.patch =================================================================== --- branches/1.0/package/libpcap/libpcap-disable-canusb.patch 2013-11-15 23:49:21 UTC (rev 6280) +++ branches/1.0/package/libpcap/libpcap-disable-canusb.patch 2013-11-16 01:43:48 UTC (rev 6281) @@ -1,16 +0,0 @@ ---- libpcap-1.3.0/configure.in.orig 2012-12-16 08:12:01.000000000 -0600 -+++ libpcap-1.3.0/configure.in 2012-12-16 08:15:17.000000000 -0600 -@@ -1395,10 +1395,10 @@ - fi - - AC_ARG_ENABLE([canusb], --[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])] --,enable_canusb=yes) -+[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=no, if support available@:>@])] -+,enable_canusb=no) - --if test "x$enable_canusb" != "xno" ; then -+if test "x$enable_canusb" = "xyes" ; then - dnl check for canusb support - case "$host_os" in - linux*) Added: branches/1.0/package/libpcap/libpcap-remove-libnl-include-path.patch =================================================================== --- branches/1.0/package/libpcap/libpcap-remove-libnl-include-path.patch (rev 0) +++ branches/1.0/package/libpcap/libpcap-remove-libnl-include-path.patch 2013-11-16 01:43:48 UTC (rev 6281) @@ -0,0 +1,16 @@ +Remove hardcoded path to libnl3 include directory + +Signed-off-by: Thomas Petazzoni <tho...@fr...> + +Index: b/configure.in +=================================================================== +--- a/configure.in ++++ b/configure.in +@@ -445,7 +445,6 @@ + AC_DEFINE(HAVE_LIBNL_3_x,1,[if libnl exists and is version 3.x]) + AC_DEFINE(HAVE_LIBNL_NLE,1,[libnl has NLE_FAILURE]) + AC_DEFINE(HAVE_LIBNL_SOCKETS,1,[libnl has new-style socket api]) +- V_INCLS="$V_INCLS -I/usr/include/libnl3" + have_any_nl="yes" + ]) + Modified: branches/1.0/package/libpcap/libpcap.mk =================================================================== --- branches/1.0/package/libpcap/libpcap.mk 2013-11-15 23:49:21 UTC (rev 6280) +++ branches/1.0/package/libpcap/libpcap.mk 2013-11-16 01:43:48 UTC (rev 6281) @@ -4,24 +4,37 @@ # ############################################################# -LIBPCAP_VERSION = 1.3.0 +LIBPCAP_VERSION = 1.4.0 LIBPCAP_SITE = http://www.tcpdump.org/release LIBPCAP_SOURCE = libpcap-$(LIBPCAP_VERSION).tar.gz LIBPCAP_INSTALL_STAGING = YES +LIBPCAP_DEPENDENCIES = zlib -# The configure.in file contains the necessary code to handle -# --enable-shared/--disable-shared properly, but the configure script -# bundled with the libpcap tarball is not up-to-date with the -# configure.in file. In order to get proper handling of -# --enable-shared/--disable-shared, which is needed when doing a -# static library build, we autoreconfigure this package. This can be -# removed when bumping libpcap, after checking that the bundled -# configure script correctly handles --enable-shared/--disable-shared. +# We're patching configure.in LIBPCAP_AUTORECONF = YES - -LIBPCAP_DEPENDENCIES = zlib LIBPCAP_CONF_ENV = ac_cv_linux_vers=2 \ - ac_cv_header_linux_wireless_h=yes # configure misdetects this + ac_cv_header_linux_wireless_h=yes \ + CFLAGS="$(LIBPCAP_CFLAGS)" +LIBPCAP_CFLAGS = $(TARGET_CFLAGS) LIBPCAP_CONF_OPT = --disable-yydebug --with-pcap=linux +ifeq ($(BR2_PACKAGE_LIBUSB),y) +LIBPCAP_CONF_OPT += --enable-canusb +LIBPCAP_DEPENDENCIES += libusb +else +LIBPCAP_CONF_OPT += --disable-canusb +endif + +ifeq ($(BR2_PACKAGE_LIBNL),y) +LIBPCAP_DEPENDENCIES += libnl +LIBPCAP_CFLAGS += "-I$(STAGING_DIR)/usr/include/libnl3" +else +LIBPCAP_CONF_OPT += --without-libnl +endif + +define LIBPCAP_STAGING_FIXUP_PCAP_CONFIG + $(SED) "s,prefix=\"/usr\",prefix=\"$(STAGING_DIR)/usr\",g" $(STAGING_DIR)/usr/bin/pcap-config +endef +LIBPCAP_POST_INSTALL_STAGING_HOOKS += LIBPCAP_STAGING_FIXUP_PCAP_CONFIG + $(eval $(call AUTOTARGETS,package,libpcap)) Modified: branches/1.0/package/tcpdump/tcpdump.mk =================================================================== --- branches/1.0/package/tcpdump/tcpdump.mk 2013-11-15 23:49:21 UTC (rev 6280) +++ branches/1.0/package/tcpdump/tcpdump.mk 2013-11-16 01:43:48 UTC (rev 6281) @@ -6,7 +6,7 @@ # Copyright (C) 2001-2003 by Erik Andersen <and...@co...> # Copyright (C) 2002 by Tim Riker <Ti...@Ri...> -TCPDUMP_VERSION = 4.3.0 +TCPDUMP_VERSION = 4.4.0 TCPDUMP_SITE = http://www.tcpdump.org/release TCPDUMP_SOURCE = tcpdump-$(TCPDUMP_VERSION).tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-11-19 16:43:26
|
Revision: 6292 http://sourceforge.net/p/astlinux/code/6292 Author: abelbeck Date: 2013-11-19 16:43:23 +0000 (Tue, 19 Nov 2013) Log Message: ----------- tweaks, more accurately match each service's state on whether it's .pid file exists Modified Paths: -------------- branches/1.0/package/asterisk/asterisk.init branches/1.0/package/dnsmasq/dnsmasq.init branches/1.0/package/ipsec-tools/racoon-ipsec branches/1.0/package/netsnmp/netsnmp.init branches/1.0/package/openldap/slapd.init branches/1.0/package/prosody/prosody.init Modified: branches/1.0/package/asterisk/asterisk.init =================================================================== --- branches/1.0/package/asterisk/asterisk.init 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/asterisk/asterisk.init 2013-11-19 16:43:23 UTC (rev 6292) @@ -146,6 +146,13 @@ else asterisk -p -I fi + + # Wait for asterisk to startup + cnt=10 + while [ $cnt -gt 0 ] && [ ! -f /var/run/asterisk/asterisk.pid ]; do + cnt=$((cnt - 1)) + sleep 1 + done fi if [ -n "$ASTVERBOSE" ]; then Modified: branches/1.0/package/dnsmasq/dnsmasq.init =================================================================== --- branches/1.0/package/dnsmasq/dnsmasq.init 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/dnsmasq/dnsmasq.init 2013-11-19 16:43:23 UTC (rev 6292) @@ -72,12 +72,12 @@ if [ -n "$1" -a "$1" != "none" -a -n "$2" -a -n "$3" ]; then if isDHCPinterface $1; then - eval `ipcalc -n "$2" "$3"` + eval $(ipcalc -n "$2" "$3") ipbase=$(_isdottedquad $NETWORK) if [ -n "$DHCPRANGE" ]; then - dstart=`echo $DHCPRANGE | cut -d: -f1` - dend=`echo $DHCPRANGE | cut -d: -f2` + dstart=$(echo $DHCPRANGE | cut -d: -f1) + dend=$(echo $DHCPRANGE | cut -d: -f2) else dstart=100 dend=220 @@ -295,7 +295,8 @@ stop () { if [ -f /var/run/dnsmasq.pid ]; then echo "Stopping dnsmasq..." - kill `cat /var/run/dnsmasq.pid` + kill $(cat /var/run/dnsmasq.pid) + rm -f /var/run/dnsmasq.pid fi } Modified: branches/1.0/package/ipsec-tools/racoon-ipsec =================================================================== --- branches/1.0/package/ipsec-tools/racoon-ipsec 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/ipsec-tools/racoon-ipsec 2013-11-19 16:43:23 UTC (rev 6292) @@ -691,6 +691,13 @@ echo "Starting racoon..." /tmp/etc/tunnel.sh + + # Wait for racoon to startup + cnt=10 + while [ $cnt -gt 0 ] && [ ! -f /var/run/racoon.pid ]; do + cnt=$((cnt - 1)) + sleep 1 + done } stop() @@ -718,6 +725,7 @@ if [ -f /var/run/racoon.pid ]; then kill $(cat /var/run/racoon.pid) + rm -f /var/run/racoon.pid fi setkey -F Modified: branches/1.0/package/netsnmp/netsnmp.init =================================================================== --- branches/1.0/package/netsnmp/netsnmp.init 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/netsnmp/netsnmp.init 2013-11-19 16:43:23 UTC (rev 6292) @@ -30,6 +30,7 @@ if [ -f /var/run/snmpd.pid ]; then echo "Stopping snmpd..." kill $(cat /var/run/snmpd.pid) + rm -f /var/run/snmpd.pid fi } Modified: branches/1.0/package/openldap/slapd.init =================================================================== --- branches/1.0/package/openldap/slapd.init 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/openldap/slapd.init 2013-11-19 16:43:23 UTC (rev 6292) @@ -253,6 +253,14 @@ if [ -f /var/run/slapd/slapd.pid ]; then echo "Stopping LDAP Server (slapd)..." kill $(cat /var/run/slapd/slapd.pid) >/dev/null 2>&1 + + # Wait for slapd to stop + cnt=5 + while [ $cnt -gt 0 ] && [ -f /var/run/slapd/slapd.pid ]; do + cnt=$((cnt - 1)) + sleep 1 + done + rm -f /var/run/slapd/slapd.pid fi } Modified: branches/1.0/package/prosody/prosody.init =================================================================== --- branches/1.0/package/prosody/prosody.init 2013-11-19 04:41:43 UTC (rev 6291) +++ branches/1.0/package/prosody/prosody.init 2013-11-19 16:43:23 UTC (rev 6292) @@ -253,6 +253,14 @@ echo "Stopping XMPP Server..." kill $(cat /var/run/prosody/prosody.pid) >/dev/null 2>&1 + + # Wait for prosody to stop + cnt=5 + while [ $cnt -gt 0 ] && [ -f /var/run/prosody/prosody.pid ]; do + cnt=$((cnt - 1)) + sleep 1 + done + rm -f /var/run/prosody/prosody.pid fi } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2013-12-10 22:04:15
|
Revision: 6304 http://sourceforge.net/p/astlinux/code/6304 Author: abelbeck Date: 2013-12-10 22:04:10 +0000 (Tue, 10 Dec 2013) Log Message: ----------- Add support for DAHDI 2.8.0, but only enabled if rhino and wanpipe and hfcs are all disabled Modified Paths: -------------- branches/1.0/package/dahdi-linux/dahdi-linux.mk branches/1.0/package/dahdi-tools/dahdi-tools.mk Added Paths: ----------- branches/1.0/package/dahdi-linux/dahdi-linux-2-wcfxo-international.patch branches/1.0/package/dahdi-linux/dahdi-linux-2.6-udev-rules.patch branches/1.0/package/dahdi-linux/hfcs-2.6/ branches/1.0/package/dahdi-linux/hfcs-2.6/Kbuild branches/1.0/package/dahdi-linux/hfcs-2.6/base.c branches/1.0/package/dahdi-linux/hfcs-2.6/dahdi_hfcs.h branches/1.0/package/dahdi-linux/hfcs-2.6/fifo.c branches/1.0/package/dahdi-linux/hfcs-2.6/fifo.h branches/1.0/package/dahdi-linux/hfcs-2.6-Kbuild.patch branches/1.0/package/dahdi-linux/oslec-2.6-echocan_oslec.patch branches/1.0/package/dahdi-tools/dahdi-tools-2.8-udev-rules.patch Removed Paths: ------------- branches/1.0/package/dahdi-linux/dahdi-linux-2.4.0-udev-rules.patch branches/1.0/package/dahdi-linux/dahdi-linux-wcfxo-international.patch branches/1.0/package/dahdi-linux/hfcs/ branches/1.0/package/dahdi-linux/hfcs-dahdi-2.6.0-Kbuild.patch branches/1.0/package/dahdi-linux/oslec-2.6.1-echocan_oslec.patch branches/1.0/package/dahdi-linux/oslec-pre2.6.1-echocan_oslec.patch Copied: branches/1.0/package/dahdi-linux/dahdi-linux-2-wcfxo-international.patch (from rev 6303, branches/1.0/package/dahdi-linux/dahdi-linux-wcfxo-international.patch) =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux-2-wcfxo-international.patch (rev 0) +++ branches/1.0/package/dahdi-linux/dahdi-linux-2-wcfxo-international.patch 2013-12-10 22:04:10 UTC (rev 6304) @@ -0,0 +1,16 @@ +--- dahdi-linux-2.6.1/drivers/dahdi/wcfxo.c.orig 2012-10-13 09:35:10.000000000 -0500 ++++ dahdi-linux-2.6.1/drivers/dahdi/wcfxo.c 2012-10-13 09:35:18.000000000 -0500 +@@ -239,6 +239,13 @@ + { "CTR21", 0, 0, 3, 0, 0, 3, 0 }, /* Austria, Belgium, Denmark, Finland, France, Germany, + Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands, + Norway, Portugal, Spain, Sweden, Switzerland, and UK */ ++ { "TBR21", 0, 1, 3, 0, 0, 3, 0 }, /* CTR21 with complex impedance */ ++ { "JATE", 0, 0, 1, 0, 0, 0, 0 }, /* Brazil, China, Egypt, Japan, Jordan, Kazakhstan, Malaysia, ++ Oman, Pakistan, Philipines, Russia, Syria, Taiwan, Thailand */ ++ { "AUST", 1, 1, 1, 0, 0, 0, 0 }, /* Australia */ ++ { "NZWL", 0, 1, 2, 0, 0, 0, 0 }, /* New Zealand */ ++ { "PLSV", 0, 0, 2, 1, 1, 0, 0 }, /* Poland, Slovenia */ ++ { "SAFR", 1, 0, 2, 1, 0, 0, 0 }, /* South Africa */ + }; + + static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) Deleted: branches/1.0/package/dahdi-linux/dahdi-linux-2.4.0-udev-rules.patch =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux-2.4.0-udev-rules.patch 2013-12-09 16:46:00 UTC (rev 6303) +++ branches/1.0/package/dahdi-linux/dahdi-linux-2.4.0-udev-rules.patch 2013-12-10 22:04:10 UTC (rev 6304) @@ -1,40 +0,0 @@ ---- dahdi-linux-2.4.1.1/build_tools/genudevrules.orig 2011-10-13 18:31:15.000000000 -0500 -+++ dahdi-linux-2.4.1.1/build_tools/genudevrules 2011-10-13 18:32:27.000000000 -0500 -@@ -1,17 +1,5 @@ - #!/bin/sh - --ver=`udevinfo -V | cut -f3 -d" "` -- --if [ -z "${ver}" ]; then -- # Not found - try udevadm -- ver=`udevadm info -V | cut -f3 -d" "` -- -- if [ -z "${ver}" ]; then -- # nobody has that old version, anyway. -- ver=54 -- fi --fi -- - # udev versions prior to 055 use a single '=' for matching key values - # udev versions 055 and later support '==' for that purpose, and versions - # beyond 092 will probably make it mandatory -@@ -19,11 +7,7 @@ - # very old versions of udev required naming rules and permissions rules to be - # in separate files, but it's not clear at what version number that changed - --if [ ${ver} -gt 54 ]; then -- match="==" --else -- match="=" --fi -+match="==" - - cat <<EOF - # udev rules to generate the /dev/dahdi device files (if not yet provided -@@ -36,5 +20,5 @@ - KERNEL${match}"dahdi[0-9]*", NAME="dahdi/%n" - - # DAHDI devices with ownership/permissions for running as non-root --SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660" -+#SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660" - EOF Copied: branches/1.0/package/dahdi-linux/dahdi-linux-2.6-udev-rules.patch (from rev 6303, branches/1.0/package/dahdi-linux/dahdi-linux-2.4.0-udev-rules.patch) =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux-2.6-udev-rules.patch (rev 0) +++ branches/1.0/package/dahdi-linux/dahdi-linux-2.6-udev-rules.patch 2013-12-10 22:04:10 UTC (rev 6304) @@ -0,0 +1,40 @@ +--- dahdi-linux-2.4.1.1/build_tools/genudevrules.orig 2011-10-13 18:31:15.000000000 -0500 ++++ dahdi-linux-2.4.1.1/build_tools/genudevrules 2011-10-13 18:32:27.000000000 -0500 +@@ -1,17 +1,5 @@ + #!/bin/sh + +-ver=`udevinfo -V | cut -f3 -d" "` +- +-if [ -z "${ver}" ]; then +- # Not found - try udevadm +- ver=`udevadm info -V | cut -f3 -d" "` +- +- if [ -z "${ver}" ]; then +- # nobody has that old version, anyway. +- ver=54 +- fi +-fi +- + # udev versions prior to 055 use a single '=' for matching key values + # udev versions 055 and later support '==' for that purpose, and versions + # beyond 092 will probably make it mandatory +@@ -19,11 +7,7 @@ + # very old versions of udev required naming rules and permissions rules to be + # in separate files, but it's not clear at what version number that changed + +-if [ ${ver} -gt 54 ]; then +- match="==" +-else +- match="=" +-fi ++match="==" + + cat <<EOF + # udev rules to generate the /dev/dahdi device files (if not yet provided +@@ -36,5 +20,5 @@ + KERNEL${match}"dahdi[0-9]*", NAME="dahdi/%n" + + # DAHDI devices with ownership/permissions for running as non-root +-SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660" ++#SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660" + EOF Deleted: branches/1.0/package/dahdi-linux/dahdi-linux-wcfxo-international.patch =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux-wcfxo-international.patch 2013-12-09 16:46:00 UTC (rev 6303) +++ branches/1.0/package/dahdi-linux/dahdi-linux-wcfxo-international.patch 2013-12-10 22:04:10 UTC (rev 6304) @@ -1,16 +0,0 @@ ---- dahdi-linux-2.6.1/drivers/dahdi/wcfxo.c.orig 2012-10-13 09:35:10.000000000 -0500 -+++ dahdi-linux-2.6.1/drivers/dahdi/wcfxo.c 2012-10-13 09:35:18.000000000 -0500 -@@ -239,6 +239,13 @@ - { "CTR21", 0, 0, 3, 0, 0, 3, 0 }, /* Austria, Belgium, Denmark, Finland, France, Germany, - Greece, Iceland, Ireland, Italy, Luxembourg, Netherlands, - Norway, Portugal, Spain, Sweden, Switzerland, and UK */ -+ { "TBR21", 0, 1, 3, 0, 0, 3, 0 }, /* CTR21 with complex impedance */ -+ { "JATE", 0, 0, 1, 0, 0, 0, 0 }, /* Brazil, China, Egypt, Japan, Jordan, Kazakhstan, Malaysia, -+ Oman, Pakistan, Philipines, Russia, Syria, Taiwan, Thailand */ -+ { "AUST", 1, 1, 1, 0, 0, 0, 0 }, /* Australia */ -+ { "NZWL", 0, 1, 2, 0, 0, 0, 0 }, /* New Zealand */ -+ { "PLSV", 0, 0, 2, 1, 1, 0, 0 }, /* Poland, Slovenia */ -+ { "SAFR", 1, 0, 2, 1, 0, 0, 0 }, /* South Africa */ - }; - - static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) Modified: branches/1.0/package/dahdi-linux/dahdi-linux.mk =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-12-09 16:46:00 UTC (rev 6303) +++ branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-12-10 22:04:10 UTC (rev 6304) @@ -3,13 +3,17 @@ # dahdi-linux # ############################################################## -ifeq ($(BR2_PACKAGE_RHINO),y) +ifeq ($(BR2_PACKAGE_DAHDI_HFCS),y) DAHDI_LINUX_VERSION := 2.6.2 else - ifeq ($(BR2_PACKAGE_WANPIPE),y) + ifeq ($(BR2_PACKAGE_RHINO),y) DAHDI_LINUX_VERSION := 2.6.2 else + ifeq ($(BR2_PACKAGE_WANPIPE),y) DAHDI_LINUX_VERSION := 2.6.2 + else +DAHDI_LINUX_VERSION := 2.8.0 + endif endif endif DAHDI_LINUX_SOURCE := dahdi-linux-$(DAHDI_LINUX_VERSION).tar.gz @@ -17,12 +21,21 @@ DAHDI_LINUX_DIR := $(BUILD_DIR)/dahdi-linux-$(DAHDI_LINUX_VERSION) DAHDI_LINUX_DRIVERS_DIR := $(DAHDI_LINUX_DIR)/drivers/dahdi DAHDI_LINUX_BINARY := dahdi.ko -DAHDI_LINUX_TARGET_BINARY := etc/udev/rules.d/dahdi.rules +DAHDI_LINUX_TARGET_BINARY := usr/share/dahdi/XppConfig.pm PERLLIBDIR := /usr/local/share/perl DAHDI_LINUX_PREREQS := linux libusb udev DAHDI_LINUX_CONFIGURE_ARGS := DEPMOD := $(HOST_DIR)/usr/sbin/depmod +# $(call ndots start,end,dotted-string) +dot:=. +empty:= +space:=$(empty) $(empty) +ndots = $(subst $(space),$(dot),$(wordlist $(1),$(2),$(subst $(dot),$(space),$3))) +## +DAHDI_LINUX_VERSION_SINGLE := $(call ndots,1,1,$(DAHDI_LINUX_VERSION)) +DAHDI_LINUX_VERSION_TUPLE := $(call ndots,1,2,$(DAHDI_LINUX_VERSION)) + $(DL_DIR)/$(DAHDI_LINUX_SOURCE): $(WGET) -P $(DL_DIR) $(DAHDI_LINUX_SITE)/$(DAHDI_LINUX_SOURCE) @@ -31,18 +44,15 @@ ifeq ($(strip $(BR2_PACKAGE_DAHDI_OSLEC)),y) mkdir -p $(DAHDI_LINUX_DIR)/drivers/staging/echo cp -a $(BUILD_DIR)/linux-$(LINUX_VERSION)/drivers/staging/echo/* $(DAHDI_LINUX_DIR)/drivers/staging/echo - ifeq ($(strip $(DAHDI_LINUX_VERSION)),2.5.0.2) - toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ oslec-pre2.6.1\*.patch - else - toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ oslec-2.6.1\*.patch - endif + toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ oslec-$(DAHDI_LINUX_VERSION_TUPLE)-\*.patch endif -ifeq ($(strip $(BR2_PACKAGE_DAHDI_HFCS)),y) +ifeq ($(BR2_PACKAGE_DAHDI_HFCS),y) mkdir -p $(DAHDI_LINUX_DIR)/drivers/dahdi/hfcs - cp -a package/dahdi-linux/hfcs/* $(DAHDI_LINUX_DIR)/drivers/dahdi/hfcs - toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ hfcs\*.patch + cp -a package/dahdi-linux/hfcs-$(DAHDI_LINUX_VERSION_TUPLE)/* $(DAHDI_LINUX_DIR)/drivers/dahdi/hfcs + toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ hfcs-$(DAHDI_LINUX_VERSION_TUPLE)-\*.patch endif - toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ dahdi-linux\*.patch + toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ dahdi-linux-$(DAHDI_LINUX_VERSION_SINGLE)-\*.patch + toolchain/patch-kernel.sh $(DAHDI_LINUX_DIR) package/dahdi-linux/ dahdi-linux-$(DAHDI_LINUX_VERSION_TUPLE)-\*.patch touch $@ $(DAHDI_LINUX_DRIVERS_DIR)/$(DAHDI_LINUX_BINARY): $(DAHDI_LINUX_DIR)/.source Added: branches/1.0/package/dahdi-linux/hfcs-2.6/Kbuild =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.6/Kbuild (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.6/Kbuild 2013-12-10 22:04:10 UTC (rev 6304) @@ -0,0 +1,10 @@ +obj-m += dahdi_hfcs.o + +EXTRA_CFLAGS := -I$(src)/.. -Wno-undef + +dahdi_hfcs-objs := base.o fifo.o + +$(obj)/base.o: $(src)/dahdi_hfcs.h +$(obj)/fifo.o: $(src)/fifo.h + + Added: branches/1.0/package/dahdi-linux/hfcs-2.6/base.c =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.6/base.c (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.6/base.c 2013-12-10 22:04:10 UTC (rev 6304) @@ -0,0 +1,1753 @@ +/* + * dahdi_hfcs.c - Dahdi driver for HFC-S PCI A based ISDN BRI cards + * + * Dahdi rewrite in hardhdlc mode + * Jose A. Deniz <od...@ho...> + * + * Copyright (C) 2011, Raoul Bönisch + * Copyright (C) 2009, Jose A. Deniz + * Copyright (C) 2006, headiisue GmbH; Jens Wilke + * Copyright (C) 2004 Daniele Orlandi + * Copyright (C) 2002, 2003, 2004, Junghanns.NET GmbH + * + * Jens Wilke <jw_...@he...> + * + * Original author of this code is + * Daniele "Vihai" Orlandi <da...@or...> + * + * Major rewrite of the driver made by + * Klaus-Peter Junghanns <kp...@ju...> + * + * This program is free software and may be modified and + * distributed under the terms of the GNU Public License. + * + * Please read the README file for important infos. + */ + +#include <linux/spinlock.h> +#include <linux/init.h> +#include <linux/pci.h> +#include <linux/interrupt.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/version.h> +#include <linux/kernel.h> +#include <linux/delay.h> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)) +#include <linux/sched.h> +#endif +#ifdef CONFIG_PROC_FS +#include <linux/proc_fs.h> +#endif /* CONFIG_PROC_FS */ +#include <linux/if_arp.h> + +#include <dahdi/kernel.h> + +#include "dahdi_hfcs.h" +#include "fifo.h" + +#if CONFIG_PCI + +#define DAHDI_B1 0 +#define DAHDI_B2 1 +#define DAHDI_D 2 + +#define D 0 +#define B1 1 +#define B2 2 + +/* + * Mode Te for all + */ +static int modes; +static int nt_modes[hfc_MAX_BOARDS]; +static int nt_modes_count; +static int force_l1_up; +#ifdef CONFIG_PROC_FS +static struct proc_dir_entry *hfc_proc_dahdi_hfcs_dir; +#endif /* CONFIG_PROC_FS */ + +#define DEBUG +#ifdef DEBUG +int debug_level; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +#define SET_PROC_DIRENTRY_OWNER(p) do { (p)->owner = THIS_MODULE; } while(0); +#else +#define SET_PROC_DIRENTRY_OWNER(p) do { } while(0); +#endif + +static DEFINE_PCI_DEVICE_TABLE(hfc_pci_ids) = { + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_2BD0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B000, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B006, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B007, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B008, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B009, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_A1T, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ANIGMA, PCI_DEVICE_ID_ANIGMA_MC145575, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ZOLTRIX, PCI_DEVICE_ID_ZOLTRIX_2BD0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_E, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_E, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_SITECOM, PCI_DEVICE_ID_SITECOM_3069, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0,} +}; + +MODULE_DEVICE_TABLE(pci, hfc_pci_ids); + +static int __devinit hfc_probe(struct pci_dev *dev + , const struct pci_device_id *ent); +static void __devexit hfc_remove(struct pci_dev *dev); + +static struct pci_driver hfc_driver = { + .name = hfc_DRIVER_NAME, + .id_table = hfc_pci_ids, + .probe = hfc_probe, + .remove = __devexit_p(hfc_remove), +}; + +/****************************************** + * HW routines + ******************************************/ + +static void hfc_softreset(struct hfc_card *card) +{ + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "resetting\n", + card->cardnum); + +/* + * Softreset procedure. Put it on, wait and off again + */ + hfc_outb(card, hfc_CIRM, hfc_CIRM_RESET); + udelay(6); + hfc_outb(card, hfc_CIRM, 0); + + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((hfc_RESET_DELAY * HZ) / 1000); +} + +static void hfc_resetCard(struct hfc_card *card) +{ + card->regs.m1 = 0; + hfc_outb(card, hfc_INT_M1, card->regs.m1); + + card->regs.m2 = 0; + hfc_outb(card, hfc_INT_M2, card->regs.m2); + + hfc_softreset(card); + + card->regs.trm = 0; + hfc_outb(card, hfc_TRM, card->regs.trm); + + /* + * Select the non-capacitive line mode for the S/T interface + */ + card->regs.sctrl = hfc_SCTRL_NONE_CAP; + + if (card->nt_mode) { + /* + * ST-Bit delay for NT-Mode + */ + hfc_outb(card, hfc_CLKDEL, hfc_CLKDEL_NT); + + card->regs.sctrl |= hfc_SCTRL_MODE_NT; + } else { + /* + * ST-Bit delay for TE-Mode + */ + hfc_outb(card, hfc_CLKDEL, hfc_CLKDEL_TE); + + card->regs.sctrl |= hfc_SCTRL_MODE_TE; + } + + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + + /* + * S/T Auto awake + */ + card->regs.sctrl_e = hfc_SCTRL_E_AUTO_AWAKE; + hfc_outb(card, hfc_SCTRL_E, card->regs.sctrl_e); + + /* + * No B-channel enabled at startup + */ + card->regs.sctrl_r = 0; + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + /* + * HFC Master Mode + */ + hfc_outb(card, hfc_MST_MODE, hfc_MST_MODE_MASTER); + + /* + * Connect internal blocks + */ + card->regs.connect = + hfc_CONNECT_B1_HFC_from_ST | + hfc_CONNECT_B1_ST_from_HFC | + hfc_CONNECT_B1_GCI_from_HFC | + hfc_CONNECT_B2_HFC_from_ST | + hfc_CONNECT_B2_ST_from_HFC | + hfc_CONNECT_B2_GCI_from_HFC; + hfc_outb(card, hfc_CONNECT, card->regs.connect); + + /* + * All bchans are HDLC by default, not useful, actually + * since mode is set during open() + */ + hfc_outb(card, hfc_CTMT, 0); + + /* + * bit order + */ + hfc_outb(card, hfc_CIRM, 0); + + /* + * Enable D-rx FIFO. At least one FIFO must be enabled (by specs) + */ + card->regs.fifo_en = hfc_FIFOEN_DRX; + hfc_outb(card, hfc_FIFO_EN, card->regs.fifo_en); + + card->late_irqs = 0; + + /* + * Clear already pending ints + */ + hfc_inb(card, hfc_INT_S1); + hfc_inb(card, hfc_INT_S2); + + /* + * Enable IRQ output + */ + card->regs.m1 = hfc_INTS_DREC | hfc_INTS_L1STATE | hfc_INTS_TIMER; + hfc_outb(card, hfc_INT_M1, card->regs.m1); + + card->regs.m2 = hfc_M2_IRQ_ENABLE; + hfc_outb(card, hfc_INT_M2, card->regs.m2); + + /* + * Unlocks the states machine + */ + hfc_outb(card, hfc_STATES, 0); + + /* + * There's no need to explicitly activate L1 now. + * Activation is managed inside the interrupt routine. + */ +} + +static void hfc_update_fifo_state(struct hfc_card *card) +{ + /* + * I'm not sure if irqsave is needed but there could be a race + * condition since hfc_update_fifo_state could be called from + * both the IRQ handler and the *_(open|close) functions + */ + + unsigned long flags; + spin_lock_irqsave(&card->chans[B1].lock, flags); + if (!card->fifo_suspended && + (card->chans[B1].status == open_framed || + card->chans[B1].status == open_voice)) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_B1RX)) { + card->regs.fifo_en |= hfc_FIFOEN_B1RX; + hfc_clear_fifo_rx(&card->chans[B1].rx); + } + + if (!(card->regs.fifo_en & hfc_FIFOEN_B1TX)) { + card->regs.fifo_en |= hfc_FIFOEN_B1TX; + hfc_clear_fifo_tx(&card->chans[B1].tx); + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + card->regs.fifo_en &= ~hfc_FIFOEN_B1RX; + if (card->regs.fifo_en & hfc_FIFOEN_B1TX) + card->regs.fifo_en &= ~hfc_FIFOEN_B1TX; + } + spin_unlock_irqrestore(&card->chans[B1].lock, flags); + + spin_lock_irqsave(&card->chans[B2].lock, flags); + if (!card->fifo_suspended && + (card->chans[B2].status == open_framed || + card->chans[B2].status == open_voice || + card->chans[B2].status == sniff_aux)) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_B2RX)) { + card->regs.fifo_en |= hfc_FIFOEN_B2RX; + hfc_clear_fifo_rx(&card->chans[B2].rx); + } + + if (!(card->regs.fifo_en & hfc_FIFOEN_B2TX)) { + card->regs.fifo_en |= hfc_FIFOEN_B2TX; + hfc_clear_fifo_tx(&card->chans[B2].tx); + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + card->regs.fifo_en &= ~hfc_FIFOEN_B2RX; + if (card->regs.fifo_en & hfc_FIFOEN_B2TX) + card->regs.fifo_en &= ~hfc_FIFOEN_B2TX; + } + spin_unlock_irqrestore(&card->chans[B2].lock, flags); + + spin_lock_irqsave(&card->chans[D].lock, flags); + if (!card->fifo_suspended && + card->chans[D].status == open_framed) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_DTX)) { + card->regs.fifo_en |= hfc_FIFOEN_DTX; + + card->chans[D].tx.ugly_framebuf_size = 0; + card->chans[D].tx.ugly_framebuf_off = 0; + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_DTX) + card->regs.fifo_en &= ~hfc_FIFOEN_DTX; + } + spin_unlock_irqrestore(&card->chans[D].lock, flags); + + hfc_outb(card, hfc_FIFO_EN, card->regs.fifo_en); +} + +static inline void hfc_suspend_fifo(struct hfc_card *card) +{ + card->fifo_suspended = TRUE; + + hfc_update_fifo_state(card); + + /* + * When L1 goes down D rx receives garbage; it is nice to + * clear it to avoid a CRC error on reactivation + * udelay is needed because the FIFO deactivation happens + * in 250us + */ + udelay(250); + hfc_clear_fifo_rx(&card->chans[D].rx); + +#ifdef DEBUG + if (debug_level >= 3) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "FIFOs suspended\n", + card->cardnum); + } +#endif +} + +static inline void hfc_resume_fifo(struct hfc_card *card) +{ + card->fifo_suspended = FALSE; + + hfc_update_fifo_state(card); + +#ifdef DEBUG + if (debug_level >= 3) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "FIFOs resumed\n", + card->cardnum); + } +#endif +} + +static void hfc_check_l1_up(struct hfc_card *card) +{ + if ((!card->nt_mode && card->l1_state != 7) + || (card->nt_mode && card->l1_state != 3)) { + + hfc_outb(card, hfc_STATES, hfc_STATES_DO_ACTION | + hfc_STATES_ACTIVATE| + hfc_STATES_NT_G2_G3); + + /* + * 0 because this is quite verbose when an inferface is unconnected, jaw + */ +#if 0 + if (debug_level >= 1) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "L1 is down, bringing up L1.\n", + card->cardnum); + } +#endif + } +} + + +/******************* + * Dahdi interface * + *******************/ + +static int hfc_dahdi_open(struct dahdi_chan *dahdi_chan) +{ + struct hfc_chan_duplex *chan = dahdi_chan->pvt; + struct hfc_card *card = chan->card; + + spin_lock(&chan->lock); + + switch (chan->number) { + case D: + if (chan->status != free && + chan->status != open_framed) { + spin_unlock(&chan->lock); + return -EBUSY; + } + chan->status = open_framed; + break; + + case B1: + case B2: + if (chan->status != free) { + spin_unlock(&chan->lock); + return -EBUSY; + } + chan->status = open_voice; + break; + } + + chan->open_by_dahdi = TRUE; + try_module_get(THIS_MODULE); + spin_unlock(&chan->lock); + + switch (chan->number) { + case D: + break; + + case B1: + card->regs.m2 |= hfc_M2_PROC_TRANS; + /* + * Enable transparent mode + */ + card->regs.ctmt |= hfc_CTMT_TRANSB1; + /* + * Reversed bit order + */ + card->regs.cirm |= hfc_CIRM_B1_REV; + /* + * Enable transmission + */ + card->regs.sctrl |= hfc_SCTRL_B1_ENA; + /* + * Enable reception + */ + card->regs.sctrl_r |= hfc_SCTRL_R_B1_ENA; + break; + + case B2: + card->regs.m2 |= hfc_M2_PROC_TRANS; + card->regs.ctmt |= hfc_CTMT_TRANSB2; + card->regs.cirm |= hfc_CIRM_B2_REV; + card->regs.sctrl |= hfc_SCTRL_B2_ENA; + card->regs.sctrl_r |= hfc_SCTRL_R_B2_ENA; + break; + + } + + /* + * If not already enabled, enable processing transition (8KHz) + * interrupt + */ + hfc_outb(card, hfc_INT_M2, card->regs.m2); + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + hfc_outb(card, hfc_CIRM, card->regs.cirm); + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + hfc_update_fifo_state(card); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "chan %s opened as %s.\n", + card->cardnum, + chan->name, + dahdi_chan->name); + + return 0; +} + +static int hfc_dahdi_close(struct dahdi_chan *dahdi_chan) +{ + struct hfc_chan_duplex *chan = dahdi_chan->pvt; + struct hfc_card *card = chan->card; + + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "hfc_dahdi_close called with NULL card\n"); + return -1; + } + + spin_lock(&chan->lock); + + if (chan->status == free) { + spin_unlock(&chan->lock); + return -EINVAL; + } + + chan->status = free; + chan->open_by_dahdi = FALSE; + + spin_unlock(&chan->lock); + + switch (chan->number) { + case D: + break; + + case B1: + card->regs.ctmt &= ~hfc_CTMT_TRANSB1; + card->regs.cirm &= ~hfc_CIRM_B1_REV; + card->regs.sctrl &= ~hfc_SCTRL_B1_ENA; + card->regs.sctrl_r &= ~hfc_SCTRL_R_B1_ENA; + break; + + case B2: + card->regs.ctmt &= ~hfc_CTMT_TRANSB2; + card->regs.cirm &= ~hfc_CIRM_B2_REV; + card->regs.sctrl &= ~hfc_SCTRL_B2_ENA; + card->regs.sctrl_r &= ~hfc_SCTRL_R_B2_ENA; + break; + } + + if (card->chans[B1].status == free && + card->chans[B2].status == free) + card->regs.m2 &= ~hfc_M2_PROC_TRANS; + + hfc_outb(card, hfc_INT_M2, card->regs.m2); + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + hfc_outb(card, hfc_CIRM, card->regs.cirm); + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + hfc_update_fifo_state(card); + + module_put(THIS_MODULE); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "chan %s closed as %s.\n", + card->cardnum, + chan->name, + dahdi_chan->name); + + return 0; +} + +static int hfc_dahdi_rbsbits(struct dahdi_chan *chan, int bits) +{ + return 0; +} + +static int hfc_dahdi_ioctl(struct dahdi_chan *chan, + unsigned int cmd, unsigned long data) +{ + switch (cmd) { + + default: + return -ENOTTY; + } + + return 0; +} + +static void hfc_hdlc_hard_xmit(struct dahdi_chan *d_chan) +{ + struct hfc_chan_duplex *chan = d_chan->pvt; + struct hfc_card *card = chan->card; + struct dahdi_hfc *hfccard = card->dahdi_dev; + + atomic_inc(&hfccard->hdlc_pending); + +} + +static int hfc_dahdi_startup(struct file *file, struct dahdi_span *span) +{ + struct dahdi_hfc *dahdi_hfcs = dahdi_hfc_from_span(span); + struct hfc_card *hfctmp = dahdi_hfcs->card; + int alreadyrunning; + + if (!hfctmp) { + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "no card for span at startup!\n", + hfctmp->cardnum); + } + + alreadyrunning = span->flags & DAHDI_FLAG_RUNNING; + + if (!alreadyrunning) + span->flags |= DAHDI_FLAG_RUNNING; + + return 0; +} + +static int hfc_dahdi_shutdown(struct dahdi_span *span) +{ + return 0; +} + +static int hfc_dahdi_maint(struct dahdi_span *span, int cmd) +{ + return 0; +} + +static int hfc_dahdi_chanconfig(struct file *file, struct dahdi_chan *d_chan, int sigtype) +{ + struct hfc_chan_duplex *chan = d_chan->pvt; + struct hfc_card *card = chan->card; + struct dahdi_hfc *hfccard = card->dahdi_dev; + + if ((sigtype == DAHDI_SIG_HARDHDLC) && (hfccard->sigchan == d_chan)) { + hfccard->sigactive = 0; + atomic_set(&hfccard->hdlc_pending, 0); + } + + return 0; +} + +static int hfc_dahdi_spanconfig(struct file *file, struct dahdi_span *span, + struct dahdi_lineconfig *lc) +{ + span->lineconfig = lc->lineconfig; + + return 0; +} + +static const struct dahdi_span_ops hfc_dahdi_span_ops = { + .owner = THIS_MODULE, + .chanconfig = hfc_dahdi_chanconfig, + .spanconfig = hfc_dahdi_spanconfig, + .startup = hfc_dahdi_startup, + .shutdown = hfc_dahdi_shutdown, + .maint = hfc_dahdi_maint, + .rbsbits = hfc_dahdi_rbsbits, + .open = hfc_dahdi_open, + .close = hfc_dahdi_close, + .ioctl = hfc_dahdi_ioctl, + .hdlc_hard_xmit = hfc_hdlc_hard_xmit +}; + +static int hfc_dahdi_initialize(struct dahdi_hfc *hfccard) +{ + struct hfc_card *hfctmp = hfccard->card; + int i; + + hfccard->ddev = dahdi_create_device(); + if (!hfccard->ddev) + return -ENOMEM; + + memset(&hfccard->span, 0x0, sizeof(struct dahdi_span)); + + /* + * ZTHFC + * + * Cards' and channels' names shall contain "ZTHFC" + * as the dahdi-tools look for this string to guess framing. + * We don't want to modify dahdi-tools only in order to change this. + * + * So we choose for a span name: DAHDI HFC-S formerly known as ZTHFC. :-) + */ + + sprintf(hfccard->span.name, "DAHDI_HFCS_FKA_ZTHFC%d", hfctmp->cardnum + 1); + sprintf(hfccard->span.desc, + "HFC-S PCI A ISDN card %d [%s] ", + hfctmp->cardnum, + hfctmp->nt_mode ? "NT" : "TE"); + hfccard->span.spantype = hfctmp->nt_mode ? "NT" : "TE"; + hfccard->ddev->manufacturer = "Cologne Chips"; + hfccard->span.flags = 0; + hfccard->span.ops = &hfc_dahdi_span_ops; + hfccard->ddev->devicetype = kasprintf(GFP_KERNEL, "HFC-S PCI-A ISDN"); + hfccard->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d", + hfctmp->pcidev->bus->number, + PCI_SLOT(hfctmp->pcidev->devfn) + 1); + hfccard->span.chans = hfccard->_chans; + hfccard->span.channels = 3; + for (i = 0; i < hfccard->span.channels; i++) + hfccard->_chans[i] = &hfccard->chans[i]; + hfccard->span.deflaw = DAHDI_LAW_ALAW; + hfccard->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; + hfccard->span.offset = 0; + + for (i = 0; i < hfccard->span.channels; i++) { + memset(&hfccard->chans[i], 0x0, sizeof(struct dahdi_chan)); + + sprintf(hfccard->chans[i].name, + "DAHDI_HFCS_FKA_ZTHFC%d/%d/%d", + hfctmp->cardnum + 1, 0, i + 1); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "registered %s\n", + hfctmp->cardnum, + hfccard->chans[i].name); + + if (i == hfccard->span.channels - 1) { + hfccard->chans[i].sigcap = DAHDI_SIG_HARDHDLC; + hfccard->sigchan = &hfccard->chans[DAHDI_D]; + hfccard->sigactive = 0; + atomic_set(&hfccard->hdlc_pending, 0); + } else { + hfccard->chans[i].sigcap = + DAHDI_SIG_CLEAR | DAHDI_SIG_DACS; + } + + hfccard->chans[i].chanpos = i + 1; + } + + hfccard->chans[DAHDI_D].readchunk = + hfctmp->chans[D].rx.dahdi_buffer; + + hfccard->chans[DAHDI_D].writechunk = + hfctmp->chans[D].tx.dahdi_buffer; + + hfccard->chans[DAHDI_D].pvt = &hfctmp->chans[D]; + + hfccard->chans[DAHDI_B1].readchunk = + hfctmp->chans[B1].rx.dahdi_buffer; + + hfccard->chans[DAHDI_B1].writechunk = + hfctmp->chans[B1].tx.dahdi_buffer; + + hfccard->chans[DAHDI_B1].pvt = &hfctmp->chans[B1]; + + hfccard->chans[DAHDI_B2].readchunk = + hfctmp->chans[B2].rx.dahdi_buffer; + + hfccard->chans[DAHDI_B2].writechunk = + hfctmp->chans[B2].tx.dahdi_buffer; + + hfccard->chans[DAHDI_B2].pvt = &hfctmp->chans[B2]; + + list_add_tail(&hfccard->span.device_node, &hfccard->ddev->spans); + if (dahdi_register_device(hfccard->ddev, &hfccard->card->pcidev->dev)) { + printk(KERN_NOTICE "Unable to register device with DAHDI\n"); + return -1; + } + + return 0; +} + +static void hfc_dahdi_transmit(struct hfc_chan_simplex *chan) +{ + hfc_fifo_put(chan, chan->dahdi_buffer, DAHDI_CHUNKSIZE); +} + +static void hfc_dahdi_receive(struct hfc_chan_simplex *chan) +{ + hfc_fifo_get(chan, chan->dahdi_buffer, DAHDI_CHUNKSIZE); +} + +/****************************************** + * Interrupt Handler + ******************************************/ + +static void hfc_handle_timer_interrupt(struct hfc_card *card); +static void hfc_handle_state_interrupt(struct hfc_card *card); +static void hfc_handle_processing_interrupt(struct hfc_card *card); +static void hfc_frame_arrived(struct hfc_chan_duplex *chan); +static void hfc_handle_voice(struct hfc_card *card); + +#if (KERNEL_VERSION(2, 6, 24) < LINUX_VERSION_CODE) +static irqreturn_t hfc_interrupt(int irq, void *dev_id) +#else +static irqreturn_t hfc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +#endif +{ + struct hfc_card *card = dev_id; + unsigned long flags; + u8 status, s1, s2; + + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "spurious interrupt (IRQ %d)\n", + irq); + return IRQ_NONE; + } + + spin_lock_irqsave(&card->lock, flags); + status = hfc_inb(card, hfc_STATUS); + if (!(status & hfc_STATUS_ANYINT)) { + /* + * maybe we are sharing the irq + */ + spin_unlock_irqrestore(&card->lock, flags); + return IRQ_NONE; + } + + /* We used to ingore the IRQ when the card was in processing + * state but apparently there is no restriction to access the + * card in such state: + * + * Joerg Ciesielski wrote: + * > There is no restriction for the IRQ handler to access + * > HFC-S PCI during processing phase. A IRQ latency of 375 us + * > is also no problem since there are no interrupt sources in + * > HFC-S PCI which must be handled very fast. + * > Due to its deep fifos the IRQ latency can be several ms with + * > out the risk of loosing data. Even the S/T state interrupts + * > must not be handled with a latency less than <5ms. + * > + * > The processing phase only indicates that HFC-S PCI is + * > processing the Fifos as PCI master so that data is read and + * > written in the 32k memory window. But there is no restriction + * > to access data in the memory window during this time. + * + * // if (status & hfc_STATUS_PCI_PROC) { + * // return IRQ_HANDLED; + * // } + */ + + s1 = hfc_inb(card, hfc_INT_S1); + s2 = hfc_inb(card, hfc_INT_S2); + + if (s1 != 0) { + if (s1 & hfc_INTS_TIMER) { + /* + * timer (bit 7) + */ + hfc_handle_timer_interrupt(card); + } + + if (s1 & hfc_INTS_L1STATE) { + /* + * state machine (bit 6) + */ + hfc_handle_state_interrupt(card); + } + + if (s1 & hfc_INTS_DREC) { + /* + * D chan RX (bit 5) + */ + hfc_frame_arrived(&card->chans[D]); + } + + if (s1 & hfc_INTS_B1REC) { + /* + * B1 chan RX (bit 3) + */ + hfc_frame_arrived(&card->chans[B1]); + } + + if (s1 & hfc_INTS_B2REC) { + /* + * B2 chan RX (bit 4) + */ + hfc_frame_arrived(&card->chans[B2]); + } + + if (s1 & hfc_INTS_DTRANS) { + /* + * D chan TX (bit 2) + */ + } + + if (s1 & hfc_INTS_B1TRANS) { + /* + * B1 chan TX (bit 0) + */ + } + + if (s1 & hfc_INTS_B2TRANS) { + /* + * B2 chan TX (bit 1) + */ + } + + } + + if (s2 != 0) { + if (s2 & hfc_M2_PMESEL) { + /* + * kaboom irq (bit 7) + * + * CologneChip says: + * + * the meaning of this fatal error bit is that HFC-S + * PCI as PCI master could not access the PCI bus + * within 125us to finish its data processing. If this + * happens only very seldom it does not cause big + * problems but of course some B-channel or D-channel + * data will be corrupted due to this event. + * + * Unfortunately this bit is only set once after the + * problem occurs and can only be reseted by a + * software reset. That means it is not easily + * possible to check how often this fatal error + * happens. + * + */ + + if (!card->sync_loss_reported) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "sync lost, pci performance too low!\n", + card->cardnum); + + card->sync_loss_reported = TRUE; + } + } + + if (s2 & hfc_M2_GCI_MON_REC) { + /* + * RxR monitor channel (bit 2) + */ + } + + if (s2 & hfc_M2_GCI_I_CHG) { + /* + * GCI I-change (bit 1) + */ + } + + if (s2 & hfc_M2_PROC_TRANS) { + /* + * processing/non-processing transition (bit 0) + */ + hfc_handle_processing_interrupt(card); + } + + } + + spin_unlock_irqrestore(&card->lock, flags); + + return IRQ_HANDLED; +} + +static void hfc_handle_timer_interrupt(struct hfc_card *card) +{ + if (card->ignore_first_timer_interrupt) { + card->ignore_first_timer_interrupt = FALSE; + return; + } + + if ((card->nt_mode && card->l1_state == 3) || + (!card->nt_mode && card->l1_state == 7)) { + + card->regs.ctmt &= ~hfc_CTMT_TIMER_MASK; + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + + hfc_resume_fifo(card); + } +} + +static void hfc_handle_state_interrupt(struct hfc_card *card) +{ + u8 new_state = hfc_inb(card, hfc_STATES) & hfc_STATES_STATE_MASK; + +#ifdef DEBUG + if (debug_level >= 1) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "layer 1 state = %c%d\n", + card->cardnum, + card->nt_mode ? 'G' : 'F', + new_state); + } +#endif + + if (card->nt_mode) { + /* + * NT mode + */ + + if (new_state == 3) { + /* + * fix to G3 state (see specs) + */ + hfc_outb(card, hfc_STATES, hfc_STATES_LOAD_STATE | 3); + } + + if (new_state == 3 && card->l1_state != 3) + hfc_resume_fifo(card); + + if (new_state != 3 && card->l1_state == 3) + hfc_suspend_fifo(card); + + } else { + if (new_state == 3) { + /* + * Keep L1 up... zaptel & libpri expects + * a always up L1... + * Enable only when using an unpatched libpri + * + * Are we still using unpatched libpri? Is this tested at runtime??? + * Does it only affect zaptel or DAHDI, too? + */ + + if (force_l1_up) { + hfc_outb(card, hfc_STATES, + hfc_STATES_DO_ACTION | + hfc_STATES_ACTIVATE| + hfc_STATES_NT_G2_G3); + } + } + + if (new_state == 7 && card->l1_state != 7) { + /* + * TE is now active, schedule FIFO activation after + * some time, otherwise the first frames are lost + */ + + card->regs.ctmt |= hfc_CTMT_TIMER_50 | + hfc_CTMT_TIMER_CLEAR; + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + + /* + * Activating the timer firest an + * interrupt immediately, we + * obviously need to ignore it + */ + card->ignore_first_timer_interrupt = TRUE; + } + + if (new_state != 7 && card->l1_state == 7) { + /* + * TE has become inactive, disable FIFO + */ + hfc_suspend_fifo(card); + } + } + + card->l1_state = new_state; +} + +static void hfc_handle_processing_interrupt(struct hfc_card *card) +{ + int available_bytes = 0; + + /* + * Synchronize with the first enabled channel + */ + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + available_bytes = hfc_fifo_used_rx(&card->chans[B1].rx); + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + available_bytes = hfc_fifo_used_rx(&card->chans[B2].rx); + else + available_bytes = -1; + + if ((available_bytes == -1 && card->ticks == 8) || + available_bytes >= DAHDI_CHUNKSIZE + hfc_RX_FIFO_PRELOAD) { + card->ticks = 0; + + if (available_bytes > DAHDI_CHUNKSIZE*2 + hfc_RX_FIFO_PRELOAD) { + card->late_irqs++; + /* + * we are out of sync, clear fifos, jaw + */ + hfc_clear_fifo_rx(&card->chans[B1].rx); + hfc_clear_fifo_tx(&card->chans[B1].tx); + hfc_clear_fifo_rx(&card->chans[B2].rx); + hfc_clear_fifo_tx(&card->chans[B2].tx); + +#ifdef DEBUG + if (debug_level >= 4) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "late IRQ, %d bytes late\n", + card->cardnum, + available_bytes - + (DAHDI_CHUNKSIZE + + hfc_RX_FIFO_PRELOAD)); + } +#endif + } else { + hfc_handle_voice(card); + } + } + + card->ticks++; +} + + +static void hfc_handle_voice(struct hfc_card *card) +{ + struct dahdi_hfc *hfccard = card->dahdi_dev; + int frame_left, res; + unsigned char buf[hfc_HDLC_BUF_LEN]; + unsigned int size = sizeof(buf) / sizeof(buf[0]); + + + if (card->chans[B1].status != open_voice && + card->chans[B2].status != open_voice) + return; + + dahdi_transmit(&hfccard->span); + + if (card->regs.fifo_en & hfc_FIFOEN_B1TX) + hfc_dahdi_transmit(&card->chans[B1].tx); + if (card->regs.fifo_en & hfc_FIFOEN_B2TX) + hfc_dahdi_transmit(&card->chans[B2].tx); + + /* + * dahdi hdlc frame tx + */ + + if (atomic_read(&hfccard->hdlc_pending)) { + hfc_check_l1_up(card); + res = dahdi_hdlc_getbuf(hfccard->sigchan, buf, &size); + if (size > 0) { + hfccard->sigactive = 1; + memcpy(card->chans[D].tx.ugly_framebuf + + card->chans[D].tx.ugly_framebuf_size, + buf, size); + card->chans[D].tx.ugly_framebuf_size += size; + if (res != 0) { + hfc_fifo_put_frame(&card->chans[D].tx, + card->chans[D].tx.ugly_framebuf, + card->chans[D].tx.ugly_framebuf_size); + ++hfccard->frames_out; + hfccard->sigactive = 0; + card->chans[D].tx.ugly_framebuf_size + = 0; + atomic_dec(&hfccard->hdlc_pending); + } + } + } + /* + * dahdi hdlc frame tx done + */ + + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + hfc_dahdi_receive(&card->chans[B1].rx); + else + memset(&card->chans[B1].rx.dahdi_buffer, 0x7f, + sizeof(card->chans[B1].rx.dahdi_buffer)); + + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + hfc_dahdi_receive(&card->chans[B2].rx); + else + memset(&card->chans[B2].rx.dahdi_buffer, 0x7f, + sizeof(card->chans[B1].rx.dahdi_buffer)); + + /* + * Echo cancellation + */ + dahdi_ec_chunk(&hfccard->chans[DAHDI_B1], + card->chans[B1].rx.dahdi_buffer, + card->chans[B1].tx.dahdi_buffer); + dahdi_ec_chunk(&hfccard->chans[DAHDI_B2], + card->chans[B2].rx.dahdi_buffer, + card->chans[B2].tx.dahdi_buffer); + + /* + * dahdi hdlc frame rx + */ + if (hfc_fifo_has_frames(&card->chans[D].rx)) + hfc_frame_arrived(&card->chans[D]); + + if (card->chans[D].rx.ugly_framebuf_size) { + frame_left = card->chans[D].rx.ugly_framebuf_size - + card->chans[D].rx.ugly_framebuf_off ; + if (frame_left > hfc_HDLC_BUF_LEN) { + dahdi_hdlc_putbuf(hfccard->sigchan, + card->chans[D].rx.ugly_framebuf + + card->chans[D].rx.ugly_framebuf_off, + hfc_HDLC_BUF_LEN); + card->chans[D].rx.ugly_framebuf_off += + hfc_HDLC_BUF_LEN; + } else { + dahdi_hdlc_putbuf(hfccard->sigchan, + card->chans[D].rx.ugly_framebuf + + card->chans[D].rx.ugly_framebuf_off, + frame_left); + dahdi_hdlc_finish(hfccard->sigchan); + card->chans[D].rx.ugly_framebuf_size = 0; + card->chans[D].rx.ugly_framebuf_off = 0; + } + } + /* + * dahdi hdlc frame rx done + */ + + if (hfccard->span.flags & DAHDI_FLAG_RUNNING) + dahdi_receive(&hfccard->span); + +} + +static void hfc_frame_arrived(struct hfc_chan_duplex *chan) +{ + struct hfc_card *card = chan->card; + int antiloop = 16; + struct sk_buff *skb; + + while (hfc_fifo_has_frames(&chan->rx) && --antiloop) { + int frame_size = hfc_fifo_get_frame_size(&chan->rx); + + if (frame_size < 3) { +#ifdef DEBUG + if (debug_level >= 2) + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "invalid frame received, " + "just %d bytes\n", + card->cardnum, + chan->name, + frame_size); +#endif + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } else if (frame_size == 3) { +#ifdef DEBUG + if (debug_level >= 2) + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "empty frame received\n", + card->cardnum, + chan->name); +#endif + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } + + if (chan->open_by_dahdi && + card->chans[D].rx.ugly_framebuf_size) { + + /* + * We have to wait for Dahdi to transmit the + * frame... wait for next time + */ + + break; + } + + skb = dev_alloc_skb(frame_size - 3); + + if (!skb) { + printk(KERN_ERR hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "cannot allocate skb: frame dropped\n", + card->cardnum, + chan->name); + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } + + + /* + * HFC does the checksum + */ +#ifndef CHECKSUM_HW + skb->ip_summed = CHECKSUM_COMPLETE; +#else + skb->ip_summed = CHECKSUM_HW; +#endif + + if (chan->open_by_dahdi) { + card->chans[D].rx.ugly_framebuf_size = frame_size - 1; + + if (hfc_fifo_get_frame(&card->chans[D].rx, + card->chans[D].rx.ugly_framebuf, + frame_size - 1) == -1) { + dev_kfree_skb(skb); + continue; + } + + memcpy(skb_put(skb, frame_size - 3), + card->chans[D].rx.ugly_framebuf, + frame_size - 3); + } else { + if (hfc_fifo_get_frame(&chan->rx, + skb_put(skb, frame_size - 3), + frame_size - 3) == -1) { + dev_kfree_skb(skb); + continue; + } + } + } + + if (!antiloop) + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "Infinite loop detected\n", + card->cardnum); +} + +/****************************************** + * Module initialization and cleanup + ******************************************/ + +static int __devinit hfc_probe(struct pci_dev *pci_dev, + const struct pci_device_id *ent) +{ + static int cardnum; + int err; + int i; + + struct hfc_card *card = NULL; + struct dahdi_hfc *dahdi_hfcs = NULL; + card = kmalloc(sizeof(struct hfc_card), GFP_KERNEL); + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "unable to kmalloc!\n"); + err = -ENOMEM; + goto err_alloc_hfccard; + } + + memset(card, 0x00, sizeof(struct hfc_card)); + card->cardnum = cardnum; + card->pcidev = pci_dev; + spin_lock_init(&card->lock); + + pci_set_drvdata(pci_dev, card); + + err = pci_enable_device(pci_dev); + if (err) + goto err_pci_enable_device; + + err = pci_set_dma_mask(pci_dev, PCI_DMA_32BIT); + if (err) { + printk(KERN_ERR hfc_DRIVER_PREFIX + "card %d: " + "No suitable DMA configuration available.\n", + card->cardnum); + goto err_pci_set_dma_mask; + } + + pci_write_config_word(pci_dev, PCI_COMMAND, PCI_COMMAND_MEMORY); + err = pci_request_regions(pci_dev, hfc_DRIVER_NAME); + if (err) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "cannot request I/O memory region\n", + card->cardnum); + goto err_pci_request_regions; + } + + pci_set_master(pci_dev); + + if (!pci_dev->irq) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "no irq!\n", + card->cardnum); + err = -ENODEV; + goto err_noirq; + } + + card->io_bus_mem = pci_resource_start(pci_dev, 1); + if (!card->io_bus_mem) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "no iomem!\n", + card->cardnum); + err = -ENODEV; + goto err_noiobase; + } + + card->io_mem = ioremap(card->io_bus_mem, hfc_PCI_MEM_SIZE); + if (!(card->io_mem)) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "cannot ioremap I/O memory\n", + card->cardnum); + err = -ENODEV; + goto err_ioremap; + } + + /* + * pci_alloc_consistent guarantees alignment + * (Documentation/DMA-mapping.txt) + */ + card->fifo_mem = pci_alloc_consistent(pci_dev, + hfc_FIFO_SIZE, &card->fifo_bus_mem); + if (!card->fifo_mem) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "unable to allocate FIFO DMA memory!\n", + card->cardnum); + err = -ENOMEM; + goto err_alloc_fifo; + } + + memset(card->fifo_mem, 0x00, hfc_FIFO_SIZE); + + card->fifos = card->fifo_mem; + + pci_write_config_dword(card->pcidev, hfc_PCI_MWBA, card->fifo_bus_mem); + + err = request_irq(card->pcidev->irq, &hfc_interrupt, + +#if (KERNEL_VERSION(2, 6, 23) < LINUX_VERSION_CODE) + IRQF_SHARED, hfc_DRIVER_NAME, card); +#else + SA_SHIRQ, hfc_DRIVER_NAME, card); +#endif + + if (err) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "unable to register irq\n", + card->cardnum); + goto err_request_irq; + } + + card->nt_mode = FALSE; + + if (modes & (1 << card->cardnum)) + card->nt_mode = TRUE; + + for (i = 0; i < nt_modes_count; i++) { + if (nt_modes[i] == card->cardnum) + card->nt_mode = TRUE; + } + + /* + * D Channel + */ + card->chans[D].card = card; + card->chans[D].name = "D"; + card->chans[D].status = free; + card->chans[D].number = D; + spin_lock_init(&card->chans[D].lock); + + card->chans[D].rx.chan = &card->chans[D]; + card->chans[D].rx.fifo_base = card->fifos + 0x4000; + card->chans[D].rx.z_base = card->fifos + 0x4000; + card->chans[D].rx.z1_base = card->fifos + 0x6080; + card->chans[D].rx.z2_base = card->fifos + 0x6082; + card->chans[D].rx.z_min = 0x0000; + card->chans[D].rx.z_max = 0x01FF; + card->chans[D].rx.f_min = 0x10; + card->chans[D].rx.f_max = 0x1F; + card->chans[D].rx.f1 = card->fifos + 0x60a0; + card->chans[D].rx.f2 = card->fifos + 0x60a1; + card->chans[D].rx.fifo_size = card->chans[D].rx.z_max + - card->chans[D].rx.z_min + 1; + card->chans[D].rx.f_num = card->chans[D].rx.f_max + - card->chans[D].rx.f_min + 1; + + card->chans[D].tx.chan = &card->chans[D]; + card->chans[D].tx.fifo_base = card->fifos + 0x0000; + card->chans[D].tx.z_base = card->fifos + 0x0000; + card->chans[D].tx.z1_base = card->fifos + 0x2080; + card->chans[D].tx.z2_base = card->fifos + 0x2082; + card->chans[D].tx.z_min = 0x0000; + card->chans[D].tx.z_max = 0x01FF; + card->chans[D].tx.f_min = 0x10; + card->chans[D].tx.f_max = 0x1F; + card->chans[D].tx.f1 = card->fifos + 0x20a0; + card->chans[D].tx.f2 = card->fifos + 0x20a1; + card->chans[D].tx.fifo_size = card->chans[D].tx.z_max - + card->chans[D].tx.z_min + 1; + card->chans[D].tx.f_num = card->chans[D].tx.f_max - + card->chans[D].tx.f_min + 1; + + /* + * B1 Channel + */ + card->chans[B1].card = card; + card->chans[B1].name = "B1"; + card->chans[B1].status = free; + card->chans[B1].number = B1; + card->chans[B1].protocol = 0; + spin_lock_init(&card->chans[B1].lock); + + card->chans[B1].rx.chan = &card->chans[B1]; + card->chans[B1].rx.fifo_base = card->fifos + 0x4200; + card->chans[B1].rx.z_base = card->fifos + 0x4000; + card->chans[B1].rx.z1_base = card->fifos + 0x6000; + card->chans[B1].rx.z2_base = card->fifos + 0x6002; + card->chans[B1].rx.z_min = 0x0200; + card->chans[B1].rx.z_max = 0x1FFF; + card->chans[B1].rx.f_min = 0x00; + card->chans[B1].rx.f_max = 0x1F; + card->chans[B1].rx.f1 = card->fifos + 0x6080; + card->chans[B1].rx.f2 = card->fifos + 0x6081; + card->chans[B1].rx.fifo_size = card->chans[B1].rx.z_max - + card->chans[B1].rx.z_min + 1; + card->chans[B1].rx.f_num = card->chans[B1].rx.f_max - + card->chans[B1].rx.f_min + 1; + + card->chans[B1].tx.chan = &card->chans[B1]; + card->chans[B1].tx.fifo_base = card->fifos + 0x0200; + card->chans[B1].tx.z_base = card->fifos + 0x0000; + card->chans[B1].tx.z1_base = card->fifos + 0x2000; + card->chans[B1].tx.z2_base = card->fifos + 0x2002; + card->chans[B1].tx.z_min = 0x0200; + card->chans[B1].tx.z_max = 0x1FFF; + card->chans[B1].tx.f_min = 0x00; + card->chans[B1].tx.f_max = 0x1F; + card->chans[B1].tx.f1 = card->fifos + 0x2080; + card->chans[B1].tx.f2 = card->fifos + 0x2081; + card->chans[B1].tx.fifo_size = card->chans[B1].tx.z_max - + card->chans[B1].tx.z_min + 1; + card->chans[B1].tx.f_num = card->chans[B1].tx.f_max - + card->chans[B1].tx.f_min + 1; + + /* + * B2 Channel + */ + card->chans[B2].card = card; + card->chans[B2].name = "B2"; + card->chans[B2].status = free; + card->chans[B2].number = B2; + card->chans[B2].protocol = 0; + spin_lock_init(&card->chans[B2].lock); + + card->chans[B2].rx.chan = &card->chans[B2]; + card->chans[B2].rx.fifo_base = card->fifos + 0x6200, + card->chans[B2].rx.z_base = card->fifos + 0x6000; + card->chans[B2].rx.z1_base = card->fifos + 0x6100; + card->chans[B2].rx.z2_base = card->fifos + 0x6102; + card->chans[B2].rx.z_min = 0x0200; + card->chans[B2].rx.z_max = 0x1FFF; + card->chans[B2].rx.f_min = 0x00; + card->chans[B2].rx.f_max = 0x1F; + card->chans[B2].rx.f1 = card->fifos + 0x6180; + card->chans[B2].rx.f2 = card->fifos + 0x6181; + card->chans[B2].rx.fifo_size = card->chans[B2].rx.z_max - + card->chans[B2].rx.z_min + 1; + card->chans[B2].rx.f_num = card->chans[B2].rx.f_max - + card->chans[B2].rx.f_min + 1; + + card->chans[B2].tx.chan = &card->chans[B2]; + card->chans[B2].tx.fifo_base = card->fifos + 0x2200; + card->chans[B2].tx.z_base = card->fifos + 0x2000; + card->chans[B2].tx.z1_base = card->fifos + 0x2100; + card->chans[B2].tx.z2_base = card->fifos + 0x2102; + card->chans[B2].tx.z_min = 0x0200; + card->chans[B2].tx.z_max = 0x1FFF; + card->chans[B2].tx.f_min = 0x00; + card->chans[B2].tx.f_max = 0x1F; + card->chans[B2].tx.f1 = card->fifos + 0x2180; + card->chans[B2].tx.f2 = card->fifos + 0x2181; + card->chans[B2].tx.fifo_size = card->chans[B2].tx.z_max - + card->chans[B2].tx.z_min + 1; + card->chans[B2].tx.f_num = card->chans[B2].tx.f_max - + card->chans[B2].tx.f_min + 1; + + /* + * All done + */ + + dahdi_hfcs = kmalloc(sizeof(struct dahdi_hfc), GFP_KERNEL); + if (!dahdi_hfcs) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "unable to kmalloc!\n"); + goto err_request_irq; + } + memset(dahdi_hfcs, 0x0, sizeof(struct dahdi_hfc)); + + dahdi_hfcs->card = card; + hfc_dahdi_initialize(dahdi_hfcs); + card->dahdi_dev = dahdi_hfcs; + +#ifdef CONFIG_PROC_FS + snprintf(card->proc_dir_name, + sizeof(card->proc_dir_name), + "%d", card->cardnum); + card->proc_dir = proc_mkdir(card->proc_dir_name, hfc_proc_dahdi_hfcs_dir); + SET_PROC_DIRENTRY_OWNER(card->proc_dir); +#endif /* CONFIG_PROC_FS */ + + hfc_resetCard(card); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d configured for %s mode at mem %#lx (0x%p) IRQ %u\n", + card->cardnum, + card->nt_mode ? "NT" : "TE", + card->io_bus_mem, + card->io_mem, + card->pcidev->irq); + + cardnum++; + + return 0; + +err_request_irq: + pci_free_consistent(pci_dev, hfc_FIFO_SIZE, + card->fifo_mem, card->fifo_bus_mem); +err_alloc_fifo: + iounmap(card->io_mem); +err_ioremap: +err_noiobase: +err_noirq: + pci_release_regions(pci_dev); +err_pci_request_regions: +err_pci_set_dma_mask: +err_pci_enable_device: + kfree(card); +err_alloc_hfccard: + return err; +} + +static void __devexit hfc_remove(struct pci_dev *pci_dev) +{ + struct hfc_card *card = pci_get_drvdata(pci_dev); + + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "shutting down card at %p.\n", + card->cardnum, + card->io_mem); + + if (!card) { + return; + } + + hfc_softreset(card); + + dahdi_unregister_device(card->dahdi_dev->ddev); + + + /* + * disable memio and bustmaster + */ + pci_write_config_word(pci_dev, PCI_COMMAND, 0); + +#ifdef CONFIG_PROC_FS +/* +BUG: these proc entries just cause Call traces, so removed. + remove_proc_entry("bufs", card->proc_dir); + remove_proc_entry("fifos", card->proc_dir); + remove_proc_entry("info", card->proc_dir); +*/ + remove_proc_entry(card->proc_dir_name, hfc_proc_dahdi_hfcs_dir); +#endif /* CONFIG_PROC_FS */ + + free_irq(pci_dev->irq, card); + + pci_free_consistent(pci_dev, hfc_FIFO_SIZE, + card->fifo_mem, card->fifo_bus_mem); + + iounmap(card->io_mem); + + pci_release_regions(pci_dev); + + pci_disable_device(pci_dev); + + kfree(card); +} + +/****************************************** + * Module stuff + ******************************************/ + +static int __init hfc_init_module(void) +{ + int ret; + + printk(KERN_INFO hfc_DRIVER_PREFIX + hfc_DRIVER_STRING " loading\n"); +#ifdef DEBUG +printk(KERN_INFO hfc_DRIVER_PREFIX "Check /var/log/kern-debug.log for debugging output level %d.", debug_level); +printk(KERN_DEBUG hfc_DRIVER_PREFIX "base.c is debugging."); +#endif + +#ifdef CONFIG_PROC_FS +#if (KERNEL_VERSION(2, 6, 26) <= LINUX_VERSION_CODE) + hfc_proc_dahdi_hfcs_dir = proc_mkdir(hfc_DRIVER_NAME, NULL); +#else + hfc_proc_dahdi_hfcs_dir = proc_mkdir(hfc_DRIVER_NAME, proc_root_driver); +#endif +#endif /* CONFIG_PROC_FS */ + + ret = dahdi_pci_module(&hfc_driver); + return ret; +} + +module_init(hfc_init_module); + +static void __exit hfc_module_exit(void) +{ + pci_unregister_driver(&hfc_driver); + +#ifdef CONFIG_PROC_FS +#if (KERNEL_VERSION(2, 6, 26) <= LINUX_VERSION_CODE) + remove_proc_entry(hfc_DRIVER_NAME, NULL); +#else + remove_proc_entry(hfc_DRIVER_NAME, proc_root_driver); +#endif +#endif /* CONFIG_PROC_FS */ + + printk(KERN_INFO hfc_DRIVER_PREFIX + hfc_DRIVER_STRING " unloaded\n"); +} + +module_exit(hfc_module_exit); + +#endif + +MODULE_DESCRIPTION(hfc_DRIVER_DESCR); +MODULE_AUTHOR("Jens Wilke <jw_...@he...>, " + "Daniele (Vihai) Orlandi <da...@or...>, " + "Jose A. Deniz <od...@ho...>"); +MODULE_ALIAS("dahdi_hfcs"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif + + +module_param(modes, int, 0444); + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) +module_param_array(nt_modes, int, &nt_modes_count, 0444); +#else +module_param_array(nt_modes, int, nt_modes_count, 0444); +#endif + +module_param(force_l1_up, int, 0444); +#ifdef DEBUG +module_param(debug_level, int, 0444); +#endif + +MODULE_PARM_DESC(modes, "[Deprecated] bit-mask to configure NT mode"); +MODULE_PARM_DESC(nt_modes, + "Comma-separated list of card IDs to configure in NT mode"); +MODULE_PARM_DESC(force_l1_up, "Don't allow L1 to go down"); +#ifdef DEBUG +MODULE_PARM_DESC(debug_level, "Debug verbosity level"); +#endif Added: branches/1.0/package/dahdi-linux/hfcs-2.6/dahdi_hfcs.h =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.6/dahdi_hfcs.h (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.6/dahdi_hfcs.h 2013-12-10 22:04:10 UTC (rev 6304) @@ -0,0 +1,424 @@ +/* + * dahdi_hfcs.h - Dahdi driver for HFC-S PCI A based ISDN BRI cards + * + * Dahdi port by Jose A. Deniz <od...@ho...> + * + * Copyright (C) 2009 Jose A. Deniz + * Copyright (C) 2006 headissue GmbH; Jens Wilke + * Copyright (C) 2004 Daniele Orlandi + * Copyright (C) 2002, 2003, 2004, Junghanns.NET GmbH + * + * Jens Wilke <jw_...@he...> + * + * Orginal author of this code is + * Daniele "Vihai" Orlandi <da...@or...> + * + * Major rewrite of the driver made by + * Klaus-Peter Junghanns <kp...@ju...> + * + * This program is free software and may be modified and + * distributed under the terms of the GNU Public License. + * + */ + +#ifndef _HFC_ZAPHFC_H +#define _HFC_ZAPHFC_H + +#include <asm/io.h> + +#define hfc_DRIVER_NAME "dahdi_hfcs" +#define hfc_DRIVER_PREFIX hfc_DRIVER_NAME ": " +#define hfc_DRIVER_DESCR "HFC-S PCI A ISDN" +#define hfc_DRIVER_VERSION "1.42" +#define hfc_DRIVER_STRING hfc_DRIVER_DESCR " (V" hfc_DRIVER_VERSION ")" + +#define hfc_MAX_BOARDS 32 + +#ifndef PCI_DMA_32BIT +#define PCI_DMA_32BIT 0x00000000ffffffffULL +#endif + +#ifndef PCI_VENDOR_ID_SITECOM +#define PCI_VENDOR_ID_SITECOM 0x182D +#endif + +#ifndef PCI_DEVICE_ID_SITECOM_3069 +#define PCI_DEVICE_ID_SITECOM_3069 0x3069 +#endif + +#define hfc_RESET_DELAY 20 + +#define hfc_CLKDEL_TE 0x0f /* CLKDEL in TE mode */ +#define hfc_CLKDEL_NT 0x6c /* CLKDEL in NT mode */ + +/* PCI memory mapped I/O */ + +#define hfc_PCI_MEM_SIZE 0x0100 +#define hfc_PCI_MWBA 0x80 + +/* GCI/IOM bus monitor registers */ + +#define hfc_C_I 0x08 +#define hfc_TRxR 0x0C +#define hfc_MON1_D 0x28 +#define hfc_MON2_D 0x2C + + +/* GCI/IOM bus timeslot registers */ + +#define hfc_B1_SSL 0x80 +#define hfc_B2_SSL 0x84 +#define hfc_AUX1_SSL 0x88 +#define hfc_AUX2_SSL 0x8C +#define hfc_B1_RSL 0x90 +#define hfc_B2_RSL 0x94 +#define hfc_AUX1_RSL 0x98 +#define hfc_AUX2_RSL 0x9C + +/* GCI/IOM bus data registers */ + +#define hfc_B1_D 0xA0 +#define hfc_B2_D 0xA4 +#define hfc_AUX1_D 0xA8 +#define hfc_AUX2_D 0xAC + +/* GCI/IOM bus configuration registers */ + +#define hfc_MST_EMOD 0xB4 +#define hfc_MST_MODE 0xB8 +#define hfc_CONNECT 0xBC + + +/* Interrupt and status registers */ + +#define hfc_FIFO_EN 0x44 +#define hfc_TRM 0x48 +#define hfc_B_MODE 0x4C +#define hfc_CHIP_ID 0x58 +#define hfc_CIRM 0x60 +#define hfc_CTMT 0x64 +#define hfc_INT_M1 0x68 +#define hfc_INT_M2 0x6C +#define hfc_INT_S1 0x78 +#define hfc_INT_S2 0x7C +#define hfc_STATUS 0x70 + +/* S/T section registers */ + +#define hfc_STATES 0xC0 +#define hfc_SCTRL 0xC4 +#define hfc_SCTRL_E 0xC8 +#define hfc_SCTRL_R 0xCC +#define hfc_SQ 0xD0 +#define hfc_CLKDEL 0xDC +#define hfc_B1_REC 0xF0 +#define hfc_B1_SEND 0xF0 +#define hfc_B2_REC 0xF4 +#define hfc_B2_SEND 0xF4 +#define hfc_D_REC 0xF8 +#define hfc_D_SEND 0xF8 +#define hfc_E_REC 0xFC + +/* Bits and values in various HFC PCI registers */ + +/* bits in status register (READ) */ +#define hfc_STATUS_PCI_PROC 0x02 +#define hfc_STATUS_NBUSY 0x04 +#define hfc_STATUS_TIMER_ELAP 0x10 +#define hfc_STATUS_STATINT 0x20 +#define hfc_STATUS_FRAMEINT 0x40 +#define hfc_STATUS_ANYINT 0x80 + +/* bits in CTMT (Write) */ +#define hfc_CTMT_TRANSB1 0x01 +#define hfc_CTMT_TRANSB2 0x02 +#define hfc_CTMT_TIMER_CLEAR 0x80 +#define hfc_CTMT_TIMER_MASK 0x1C +#define hfc_CTMT_TIMER_3_125 (0x01 << 2) +#define hfc_CTMT_TIMER_6_25 (0x02 << 2) +#define hfc_CTMT_TIMER_12_5 (0x03 << 2) +#define hfc_CTMT_TIMER_25 (0x04 << 2) +#define hfc_CTMT_TIMER_50 (0x05 << 2) +#define hfc_CTMT_TIMER_400 (0x06 << 2) +#define hfc_CTMT_TIMER_800 (0x07 << 2) +#define hfc_CTMT_AUTO_TIMER 0x20 + +/* bits in CIRM (Write) */ +#define hfc_CIRM_AUX_MSK 0x07 +#define hfc_CIRM_RESET 0x08 +#define hfc_CIRM_B1_REV 0x40 +#define hfc_CIRM_B2_REV 0x80 + +/* bits in INT_M1 and INT_S1 */ +#define hfc_INTS_B1TRANS 0x01... [truncated message content] |
From: <abe...@us...> - 2013-12-11 23:01:20
|
Revision: 6307 http://sourceforge.net/p/astlinux/code/6307 Author: abelbeck Date: 2013-12-11 23:01:17 +0000 (Wed, 11 Dec 2013) Log Message: ----------- DAHDI hfcs, add support for DAHDI 2.8, hfcs now works with both DAHDI 2.6 and 2.8 Modified Paths: -------------- branches/1.0/package/dahdi-linux/dahdi-linux.mk branches/1.0/package/dahdi-tools/dahdi-tools.mk Added Paths: ----------- branches/1.0/package/dahdi-linux/hfcs-2.8/ branches/1.0/package/dahdi-linux/hfcs-2.8/Kbuild branches/1.0/package/dahdi-linux/hfcs-2.8/base.c branches/1.0/package/dahdi-linux/hfcs-2.8/dahdi_hfcs.h branches/1.0/package/dahdi-linux/hfcs-2.8/fifo.c branches/1.0/package/dahdi-linux/hfcs-2.8/fifo.h branches/1.0/package/dahdi-linux/hfcs-2.8-Kbuild.patch Modified: branches/1.0/package/dahdi-linux/dahdi-linux.mk =================================================================== --- branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-12-11 18:21:24 UTC (rev 6306) +++ branches/1.0/package/dahdi-linux/dahdi-linux.mk 2013-12-11 23:01:17 UTC (rev 6307) @@ -3,17 +3,13 @@ # dahdi-linux # ############################################################## -ifeq ($(BR2_PACKAGE_DAHDI_HFCS),y) +ifeq ($(BR2_PACKAGE_RHINO),y) DAHDI_LINUX_VERSION := 2.6.2 else - ifeq ($(BR2_PACKAGE_RHINO),y) + ifeq ($(BR2_PACKAGE_WANPIPE),y) DAHDI_LINUX_VERSION := 2.6.2 else - ifeq ($(BR2_PACKAGE_WANPIPE),y) -DAHDI_LINUX_VERSION := 2.6.2 - else DAHDI_LINUX_VERSION := 2.8.0 - endif endif endif DAHDI_LINUX_SOURCE := dahdi-linux-$(DAHDI_LINUX_VERSION).tar.gz Added: branches/1.0/package/dahdi-linux/hfcs-2.8/Kbuild =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.8/Kbuild (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.8/Kbuild 2013-12-11 23:01:17 UTC (rev 6307) @@ -0,0 +1,10 @@ +obj-m += dahdi_hfcs.o + +EXTRA_CFLAGS := -I$(src)/.. -Wno-undef + +dahdi_hfcs-objs := base.o fifo.o + +$(obj)/base.o: $(src)/dahdi_hfcs.h +$(obj)/fifo.o: $(src)/fifo.h + + Added: branches/1.0/package/dahdi-linux/hfcs-2.8/base.c =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.8/base.c (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.8/base.c 2013-12-11 23:01:17 UTC (rev 6307) @@ -0,0 +1,1753 @@ +/* + * dahdi_hfcs.c - Dahdi driver for HFC-S PCI A based ISDN BRI cards + * + * Dahdi rewrite in hardhdlc mode + * Jose A. Deniz <od...@ho...> + * + * Copyright (C) 2011, Raoul Bönisch + * Copyright (C) 2009, Jose A. Deniz + * Copyright (C) 2006, headiisue GmbH; Jens Wilke + * Copyright (C) 2004 Daniele Orlandi + * Copyright (C) 2002, 2003, 2004, Junghanns.NET GmbH + * + * Jens Wilke <jw_...@he...> + * + * Original author of this code is + * Daniele "Vihai" Orlandi <da...@or...> + * + * Major rewrite of the driver made by + * Klaus-Peter Junghanns <kp...@ju...> + * + * This program is free software and may be modified and + * distributed under the terms of the GNU Public License. + * + * Please read the README file for important infos. + */ + +#include <linux/spinlock.h> +#include <linux/init.h> +#include <linux/pci.h> +#include <linux/interrupt.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/version.h> +#include <linux/kernel.h> +#include <linux/delay.h> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)) +#include <linux/sched.h> +#endif +#ifdef CONFIG_PROC_FS +#include <linux/proc_fs.h> +#endif /* CONFIG_PROC_FS */ +#include <linux/if_arp.h> + +#include <dahdi/kernel.h> + +#include "dahdi_hfcs.h" +#include "fifo.h" + +#if CONFIG_PCI + +#define DAHDI_B1 0 +#define DAHDI_B2 1 +#define DAHDI_D 2 + +#define D 0 +#define B1 1 +#define B2 2 + +/* + * Mode Te for all + */ +static int modes; +static int nt_modes[hfc_MAX_BOARDS]; +static int nt_modes_count; +static int force_l1_up; +#ifdef CONFIG_PROC_FS +static struct proc_dir_entry *hfc_proc_dahdi_hfcs_dir; +#endif /* CONFIG_PROC_FS */ + +#define DEBUG +#ifdef DEBUG +int debug_level; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) +#define SET_PROC_DIRENTRY_OWNER(p) do { (p)->owner = THIS_MODULE; } while(0); +#else +#define SET_PROC_DIRENTRY_OWNER(p) do { } while(0); +#endif + +static DEFINE_PCI_DEVICE_TABLE(hfc_pci_ids) = { + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_2BD0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B000, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B006, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B007, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B008, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B009, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_A1T, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ANIGMA, PCI_DEVICE_ID_ANIGMA_MC145575, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_ZOLTRIX, PCI_DEVICE_ID_ZOLTRIX_2BD0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_E, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_E, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {PCI_VENDOR_ID_SITECOM, PCI_DEVICE_ID_SITECOM_3069, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0,} +}; + +MODULE_DEVICE_TABLE(pci, hfc_pci_ids); + +static int __devinit hfc_probe(struct pci_dev *dev + , const struct pci_device_id *ent); +static void __devexit hfc_remove(struct pci_dev *dev); + +static struct pci_driver hfc_driver = { + .name = hfc_DRIVER_NAME, + .id_table = hfc_pci_ids, + .probe = hfc_probe, + .remove = __devexit_p(hfc_remove), +}; + +/****************************************** + * HW routines + ******************************************/ + +static void hfc_softreset(struct hfc_card *card) +{ + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "resetting\n", + card->cardnum); + +/* + * Softreset procedure. Put it on, wait and off again + */ + hfc_outb(card, hfc_CIRM, hfc_CIRM_RESET); + udelay(6); + hfc_outb(card, hfc_CIRM, 0); + + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout((hfc_RESET_DELAY * HZ) / 1000); +} + +static void hfc_resetCard(struct hfc_card *card) +{ + card->regs.m1 = 0; + hfc_outb(card, hfc_INT_M1, card->regs.m1); + + card->regs.m2 = 0; + hfc_outb(card, hfc_INT_M2, card->regs.m2); + + hfc_softreset(card); + + card->regs.trm = 0; + hfc_outb(card, hfc_TRM, card->regs.trm); + + /* + * Select the non-capacitive line mode for the S/T interface + */ + card->regs.sctrl = hfc_SCTRL_NONE_CAP; + + if (card->nt_mode) { + /* + * ST-Bit delay for NT-Mode + */ + hfc_outb(card, hfc_CLKDEL, hfc_CLKDEL_NT); + + card->regs.sctrl |= hfc_SCTRL_MODE_NT; + } else { + /* + * ST-Bit delay for TE-Mode + */ + hfc_outb(card, hfc_CLKDEL, hfc_CLKDEL_TE); + + card->regs.sctrl |= hfc_SCTRL_MODE_TE; + } + + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + + /* + * S/T Auto awake + */ + card->regs.sctrl_e = hfc_SCTRL_E_AUTO_AWAKE; + hfc_outb(card, hfc_SCTRL_E, card->regs.sctrl_e); + + /* + * No B-channel enabled at startup + */ + card->regs.sctrl_r = 0; + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + /* + * HFC Master Mode + */ + hfc_outb(card, hfc_MST_MODE, hfc_MST_MODE_MASTER); + + /* + * Connect internal blocks + */ + card->regs.connect = + hfc_CONNECT_B1_HFC_from_ST | + hfc_CONNECT_B1_ST_from_HFC | + hfc_CONNECT_B1_GCI_from_HFC | + hfc_CONNECT_B2_HFC_from_ST | + hfc_CONNECT_B2_ST_from_HFC | + hfc_CONNECT_B2_GCI_from_HFC; + hfc_outb(card, hfc_CONNECT, card->regs.connect); + + /* + * All bchans are HDLC by default, not useful, actually + * since mode is set during open() + */ + hfc_outb(card, hfc_CTMT, 0); + + /* + * bit order + */ + hfc_outb(card, hfc_CIRM, 0); + + /* + * Enable D-rx FIFO. At least one FIFO must be enabled (by specs) + */ + card->regs.fifo_en = hfc_FIFOEN_DRX; + hfc_outb(card, hfc_FIFO_EN, card->regs.fifo_en); + + card->late_irqs = 0; + + /* + * Clear already pending ints + */ + hfc_inb(card, hfc_INT_S1); + hfc_inb(card, hfc_INT_S2); + + /* + * Enable IRQ output + */ + card->regs.m1 = hfc_INTS_DREC | hfc_INTS_L1STATE | hfc_INTS_TIMER; + hfc_outb(card, hfc_INT_M1, card->regs.m1); + + card->regs.m2 = hfc_M2_IRQ_ENABLE; + hfc_outb(card, hfc_INT_M2, card->regs.m2); + + /* + * Unlocks the states machine + */ + hfc_outb(card, hfc_STATES, 0); + + /* + * There's no need to explicitly activate L1 now. + * Activation is managed inside the interrupt routine. + */ +} + +static void hfc_update_fifo_state(struct hfc_card *card) +{ + /* + * I'm not sure if irqsave is needed but there could be a race + * condition since hfc_update_fifo_state could be called from + * both the IRQ handler and the *_(open|close) functions + */ + + unsigned long flags; + spin_lock_irqsave(&card->chans[B1].lock, flags); + if (!card->fifo_suspended && + (card->chans[B1].status == open_framed || + card->chans[B1].status == open_voice)) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_B1RX)) { + card->regs.fifo_en |= hfc_FIFOEN_B1RX; + hfc_clear_fifo_rx(&card->chans[B1].rx); + } + + if (!(card->regs.fifo_en & hfc_FIFOEN_B1TX)) { + card->regs.fifo_en |= hfc_FIFOEN_B1TX; + hfc_clear_fifo_tx(&card->chans[B1].tx); + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + card->regs.fifo_en &= ~hfc_FIFOEN_B1RX; + if (card->regs.fifo_en & hfc_FIFOEN_B1TX) + card->regs.fifo_en &= ~hfc_FIFOEN_B1TX; + } + spin_unlock_irqrestore(&card->chans[B1].lock, flags); + + spin_lock_irqsave(&card->chans[B2].lock, flags); + if (!card->fifo_suspended && + (card->chans[B2].status == open_framed || + card->chans[B2].status == open_voice || + card->chans[B2].status == sniff_aux)) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_B2RX)) { + card->regs.fifo_en |= hfc_FIFOEN_B2RX; + hfc_clear_fifo_rx(&card->chans[B2].rx); + } + + if (!(card->regs.fifo_en & hfc_FIFOEN_B2TX)) { + card->regs.fifo_en |= hfc_FIFOEN_B2TX; + hfc_clear_fifo_tx(&card->chans[B2].tx); + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + card->regs.fifo_en &= ~hfc_FIFOEN_B2RX; + if (card->regs.fifo_en & hfc_FIFOEN_B2TX) + card->regs.fifo_en &= ~hfc_FIFOEN_B2TX; + } + spin_unlock_irqrestore(&card->chans[B2].lock, flags); + + spin_lock_irqsave(&card->chans[D].lock, flags); + if (!card->fifo_suspended && + card->chans[D].status == open_framed) { + + if (!(card->regs.fifo_en & hfc_FIFOEN_DTX)) { + card->regs.fifo_en |= hfc_FIFOEN_DTX; + + card->chans[D].tx.ugly_framebuf_size = 0; + card->chans[D].tx.ugly_framebuf_off = 0; + } + } else { + if (card->regs.fifo_en & hfc_FIFOEN_DTX) + card->regs.fifo_en &= ~hfc_FIFOEN_DTX; + } + spin_unlock_irqrestore(&card->chans[D].lock, flags); + + hfc_outb(card, hfc_FIFO_EN, card->regs.fifo_en); +} + +static inline void hfc_suspend_fifo(struct hfc_card *card) +{ + card->fifo_suspended = TRUE; + + hfc_update_fifo_state(card); + + /* + * When L1 goes down D rx receives garbage; it is nice to + * clear it to avoid a CRC error on reactivation + * udelay is needed because the FIFO deactivation happens + * in 250us + */ + udelay(250); + hfc_clear_fifo_rx(&card->chans[D].rx); + +#ifdef DEBUG + if (debug_level >= 3) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "FIFOs suspended\n", + card->cardnum); + } +#endif +} + +static inline void hfc_resume_fifo(struct hfc_card *card) +{ + card->fifo_suspended = FALSE; + + hfc_update_fifo_state(card); + +#ifdef DEBUG + if (debug_level >= 3) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "FIFOs resumed\n", + card->cardnum); + } +#endif +} + +static void hfc_check_l1_up(struct hfc_card *card) +{ + if ((!card->nt_mode && card->l1_state != 7) + || (card->nt_mode && card->l1_state != 3)) { + + hfc_outb(card, hfc_STATES, hfc_STATES_DO_ACTION | + hfc_STATES_ACTIVATE| + hfc_STATES_NT_G2_G3); + + /* + * 0 because this is quite verbose when an inferface is unconnected, jaw + */ +#if 0 + if (debug_level >= 1) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "L1 is down, bringing up L1.\n", + card->cardnum); + } +#endif + } +} + + +/******************* + * Dahdi interface * + *******************/ + +static int hfc_dahdi_open(struct dahdi_chan *dahdi_chan) +{ + struct hfc_chan_duplex *chan = dahdi_chan->pvt; + struct hfc_card *card = chan->card; + + spin_lock(&chan->lock); + + switch (chan->number) { + case D: + if (chan->status != free && + chan->status != open_framed) { + spin_unlock(&chan->lock); + return -EBUSY; + } + chan->status = open_framed; + break; + + case B1: + case B2: + if (chan->status != free) { + spin_unlock(&chan->lock); + return -EBUSY; + } + chan->status = open_voice; + break; + } + + chan->open_by_dahdi = TRUE; + try_module_get(THIS_MODULE); + spin_unlock(&chan->lock); + + switch (chan->number) { + case D: + break; + + case B1: + card->regs.m2 |= hfc_M2_PROC_TRANS; + /* + * Enable transparent mode + */ + card->regs.ctmt |= hfc_CTMT_TRANSB1; + /* + * Reversed bit order + */ + card->regs.cirm |= hfc_CIRM_B1_REV; + /* + * Enable transmission + */ + card->regs.sctrl |= hfc_SCTRL_B1_ENA; + /* + * Enable reception + */ + card->regs.sctrl_r |= hfc_SCTRL_R_B1_ENA; + break; + + case B2: + card->regs.m2 |= hfc_M2_PROC_TRANS; + card->regs.ctmt |= hfc_CTMT_TRANSB2; + card->regs.cirm |= hfc_CIRM_B2_REV; + card->regs.sctrl |= hfc_SCTRL_B2_ENA; + card->regs.sctrl_r |= hfc_SCTRL_R_B2_ENA; + break; + + } + + /* + * If not already enabled, enable processing transition (8KHz) + * interrupt + */ + hfc_outb(card, hfc_INT_M2, card->regs.m2); + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + hfc_outb(card, hfc_CIRM, card->regs.cirm); + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + hfc_update_fifo_state(card); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "chan %s opened as %s.\n", + card->cardnum, + chan->name, + dahdi_chan->name); + + return 0; +} + +static int hfc_dahdi_close(struct dahdi_chan *dahdi_chan) +{ + struct hfc_chan_duplex *chan = dahdi_chan->pvt; + struct hfc_card *card = chan->card; + + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "hfc_dahdi_close called with NULL card\n"); + return -1; + } + + spin_lock(&chan->lock); + + if (chan->status == free) { + spin_unlock(&chan->lock); + return -EINVAL; + } + + chan->status = free; + chan->open_by_dahdi = FALSE; + + spin_unlock(&chan->lock); + + switch (chan->number) { + case D: + break; + + case B1: + card->regs.ctmt &= ~hfc_CTMT_TRANSB1; + card->regs.cirm &= ~hfc_CIRM_B1_REV; + card->regs.sctrl &= ~hfc_SCTRL_B1_ENA; + card->regs.sctrl_r &= ~hfc_SCTRL_R_B1_ENA; + break; + + case B2: + card->regs.ctmt &= ~hfc_CTMT_TRANSB2; + card->regs.cirm &= ~hfc_CIRM_B2_REV; + card->regs.sctrl &= ~hfc_SCTRL_B2_ENA; + card->regs.sctrl_r &= ~hfc_SCTRL_R_B2_ENA; + break; + } + + if (card->chans[B1].status == free && + card->chans[B2].status == free) + card->regs.m2 &= ~hfc_M2_PROC_TRANS; + + hfc_outb(card, hfc_INT_M2, card->regs.m2); + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + hfc_outb(card, hfc_CIRM, card->regs.cirm); + hfc_outb(card, hfc_SCTRL, card->regs.sctrl); + hfc_outb(card, hfc_SCTRL_R, card->regs.sctrl_r); + + hfc_update_fifo_state(card); + + module_put(THIS_MODULE); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "chan %s closed as %s.\n", + card->cardnum, + chan->name, + dahdi_chan->name); + + return 0; +} + +static int hfc_dahdi_rbsbits(struct dahdi_chan *chan, int bits) +{ + return 0; +} + +static int hfc_dahdi_ioctl(struct dahdi_chan *chan, + unsigned int cmd, unsigned long data) +{ + switch (cmd) { + + default: + return -ENOTTY; + } + + return 0; +} + +static void hfc_hdlc_hard_xmit(struct dahdi_chan *d_chan) +{ + struct hfc_chan_duplex *chan = d_chan->pvt; + struct hfc_card *card = chan->card; + struct dahdi_hfc *hfccard = card->dahdi_dev; + + atomic_inc(&hfccard->hdlc_pending); + +} + +static int hfc_dahdi_startup(struct file *file, struct dahdi_span *span) +{ + struct dahdi_hfc *dahdi_hfcs = dahdi_hfc_from_span(span); + struct hfc_card *hfctmp = dahdi_hfcs->card; + int alreadyrunning; + + if (!hfctmp) { + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "no card for span at startup!\n", + hfctmp->cardnum); + } + + alreadyrunning = span->flags & DAHDI_FLAG_RUNNING; + + if (!alreadyrunning) + span->flags |= DAHDI_FLAG_RUNNING; + + return 0; +} + +static int hfc_dahdi_shutdown(struct dahdi_span *span) +{ + return 0; +} + +static int hfc_dahdi_maint(struct dahdi_span *span, int cmd) +{ + return 0; +} + +static int hfc_dahdi_chanconfig(struct file *file, struct dahdi_chan *d_chan, int sigtype) +{ + struct hfc_chan_duplex *chan = d_chan->pvt; + struct hfc_card *card = chan->card; + struct dahdi_hfc *hfccard = card->dahdi_dev; + + if ((sigtype == DAHDI_SIG_HARDHDLC) && (hfccard->sigchan == d_chan)) { + hfccard->sigactive = 0; + atomic_set(&hfccard->hdlc_pending, 0); + } + + return 0; +} + +static int hfc_dahdi_spanconfig(struct file *file, struct dahdi_span *span, + struct dahdi_lineconfig *lc) +{ + span->lineconfig = lc->lineconfig; + + return 0; +} + +static const struct dahdi_span_ops hfc_dahdi_span_ops = { + .owner = THIS_MODULE, + .chanconfig = hfc_dahdi_chanconfig, + .spanconfig = hfc_dahdi_spanconfig, + .startup = hfc_dahdi_startup, + .shutdown = hfc_dahdi_shutdown, + .maint = hfc_dahdi_maint, + .rbsbits = hfc_dahdi_rbsbits, + .open = hfc_dahdi_open, + .close = hfc_dahdi_close, + .ioctl = hfc_dahdi_ioctl, + .hdlc_hard_xmit = hfc_hdlc_hard_xmit +}; + +static int hfc_dahdi_initialize(struct dahdi_hfc *hfccard) +{ + struct hfc_card *hfctmp = hfccard->card; + int i; + + hfccard->ddev = dahdi_create_device(); + if (!hfccard->ddev) + return -ENOMEM; + + memset(&hfccard->span, 0x0, sizeof(struct dahdi_span)); + + /* + * ZTHFC + * + * Cards' and channels' names shall contain "ZTHFC" + * as the dahdi-tools look for this string to guess framing. + * We don't want to modify dahdi-tools only in order to change this. + * + * So we choose for a span name: DAHDI HFC-S formerly known as ZTHFC. :-) + */ + + sprintf(hfccard->span.name, "DAHDI_HFCS_FKA_ZTHFC%d", hfctmp->cardnum + 1); + sprintf(hfccard->span.desc, + "HFC-S PCI A ISDN card %d [%s] ", + hfctmp->cardnum, + hfctmp->nt_mode ? "NT" : "TE"); + hfccard->span.spantype = hfctmp->nt_mode ? SPANTYPE_DIGITAL_BRI_NT : SPANTYPE_DIGITAL_BRI_TE; + hfccard->ddev->manufacturer = "Cologne Chips"; + hfccard->span.flags = 0; + hfccard->span.ops = &hfc_dahdi_span_ops; + hfccard->ddev->devicetype = kasprintf(GFP_KERNEL, "HFC-S PCI-A ISDN"); + hfccard->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d", + hfctmp->pcidev->bus->number, + PCI_SLOT(hfctmp->pcidev->devfn) + 1); + hfccard->span.chans = hfccard->_chans; + hfccard->span.channels = 3; + for (i = 0; i < hfccard->span.channels; i++) + hfccard->_chans[i] = &hfccard->chans[i]; + hfccard->span.deflaw = DAHDI_LAW_ALAW; + hfccard->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; + hfccard->span.offset = 0; + + for (i = 0; i < hfccard->span.channels; i++) { + memset(&hfccard->chans[i], 0x0, sizeof(struct dahdi_chan)); + + sprintf(hfccard->chans[i].name, + "DAHDI_HFCS_FKA_ZTHFC%d/%d/%d", + hfctmp->cardnum + 1, 0, i + 1); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "registered %s\n", + hfctmp->cardnum, + hfccard->chans[i].name); + + if (i == hfccard->span.channels - 1) { + hfccard->chans[i].sigcap = DAHDI_SIG_HARDHDLC; + hfccard->sigchan = &hfccard->chans[DAHDI_D]; + hfccard->sigactive = 0; + atomic_set(&hfccard->hdlc_pending, 0); + } else { + hfccard->chans[i].sigcap = + DAHDI_SIG_CLEAR | DAHDI_SIG_DACS; + } + + hfccard->chans[i].chanpos = i + 1; + } + + hfccard->chans[DAHDI_D].readchunk = + hfctmp->chans[D].rx.dahdi_buffer; + + hfccard->chans[DAHDI_D].writechunk = + hfctmp->chans[D].tx.dahdi_buffer; + + hfccard->chans[DAHDI_D].pvt = &hfctmp->chans[D]; + + hfccard->chans[DAHDI_B1].readchunk = + hfctmp->chans[B1].rx.dahdi_buffer; + + hfccard->chans[DAHDI_B1].writechunk = + hfctmp->chans[B1].tx.dahdi_buffer; + + hfccard->chans[DAHDI_B1].pvt = &hfctmp->chans[B1]; + + hfccard->chans[DAHDI_B2].readchunk = + hfctmp->chans[B2].rx.dahdi_buffer; + + hfccard->chans[DAHDI_B2].writechunk = + hfctmp->chans[B2].tx.dahdi_buffer; + + hfccard->chans[DAHDI_B2].pvt = &hfctmp->chans[B2]; + + list_add_tail(&hfccard->span.device_node, &hfccard->ddev->spans); + if (dahdi_register_device(hfccard->ddev, &hfccard->card->pcidev->dev)) { + printk(KERN_NOTICE "Unable to register device with DAHDI\n"); + return -1; + } + + return 0; +} + +static void hfc_dahdi_transmit(struct hfc_chan_simplex *chan) +{ + hfc_fifo_put(chan, chan->dahdi_buffer, DAHDI_CHUNKSIZE); +} + +static void hfc_dahdi_receive(struct hfc_chan_simplex *chan) +{ + hfc_fifo_get(chan, chan->dahdi_buffer, DAHDI_CHUNKSIZE); +} + +/****************************************** + * Interrupt Handler + ******************************************/ + +static void hfc_handle_timer_interrupt(struct hfc_card *card); +static void hfc_handle_state_interrupt(struct hfc_card *card); +static void hfc_handle_processing_interrupt(struct hfc_card *card); +static void hfc_frame_arrived(struct hfc_chan_duplex *chan); +static void hfc_handle_voice(struct hfc_card *card); + +#if (KERNEL_VERSION(2, 6, 24) < LINUX_VERSION_CODE) +static irqreturn_t hfc_interrupt(int irq, void *dev_id) +#else +static irqreturn_t hfc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +#endif +{ + struct hfc_card *card = dev_id; + unsigned long flags; + u8 status, s1, s2; + + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "spurious interrupt (IRQ %d)\n", + irq); + return IRQ_NONE; + } + + spin_lock_irqsave(&card->lock, flags); + status = hfc_inb(card, hfc_STATUS); + if (!(status & hfc_STATUS_ANYINT)) { + /* + * maybe we are sharing the irq + */ + spin_unlock_irqrestore(&card->lock, flags); + return IRQ_NONE; + } + + /* We used to ingore the IRQ when the card was in processing + * state but apparently there is no restriction to access the + * card in such state: + * + * Joerg Ciesielski wrote: + * > There is no restriction for the IRQ handler to access + * > HFC-S PCI during processing phase. A IRQ latency of 375 us + * > is also no problem since there are no interrupt sources in + * > HFC-S PCI which must be handled very fast. + * > Due to its deep fifos the IRQ latency can be several ms with + * > out the risk of loosing data. Even the S/T state interrupts + * > must not be handled with a latency less than <5ms. + * > + * > The processing phase only indicates that HFC-S PCI is + * > processing the Fifos as PCI master so that data is read and + * > written in the 32k memory window. But there is no restriction + * > to access data in the memory window during this time. + * + * // if (status & hfc_STATUS_PCI_PROC) { + * // return IRQ_HANDLED; + * // } + */ + + s1 = hfc_inb(card, hfc_INT_S1); + s2 = hfc_inb(card, hfc_INT_S2); + + if (s1 != 0) { + if (s1 & hfc_INTS_TIMER) { + /* + * timer (bit 7) + */ + hfc_handle_timer_interrupt(card); + } + + if (s1 & hfc_INTS_L1STATE) { + /* + * state machine (bit 6) + */ + hfc_handle_state_interrupt(card); + } + + if (s1 & hfc_INTS_DREC) { + /* + * D chan RX (bit 5) + */ + hfc_frame_arrived(&card->chans[D]); + } + + if (s1 & hfc_INTS_B1REC) { + /* + * B1 chan RX (bit 3) + */ + hfc_frame_arrived(&card->chans[B1]); + } + + if (s1 & hfc_INTS_B2REC) { + /* + * B2 chan RX (bit 4) + */ + hfc_frame_arrived(&card->chans[B2]); + } + + if (s1 & hfc_INTS_DTRANS) { + /* + * D chan TX (bit 2) + */ + } + + if (s1 & hfc_INTS_B1TRANS) { + /* + * B1 chan TX (bit 0) + */ + } + + if (s1 & hfc_INTS_B2TRANS) { + /* + * B2 chan TX (bit 1) + */ + } + + } + + if (s2 != 0) { + if (s2 & hfc_M2_PMESEL) { + /* + * kaboom irq (bit 7) + * + * CologneChip says: + * + * the meaning of this fatal error bit is that HFC-S + * PCI as PCI master could not access the PCI bus + * within 125us to finish its data processing. If this + * happens only very seldom it does not cause big + * problems but of course some B-channel or D-channel + * data will be corrupted due to this event. + * + * Unfortunately this bit is only set once after the + * problem occurs and can only be reseted by a + * software reset. That means it is not easily + * possible to check how often this fatal error + * happens. + * + */ + + if (!card->sync_loss_reported) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "sync lost, pci performance too low!\n", + card->cardnum); + + card->sync_loss_reported = TRUE; + } + } + + if (s2 & hfc_M2_GCI_MON_REC) { + /* + * RxR monitor channel (bit 2) + */ + } + + if (s2 & hfc_M2_GCI_I_CHG) { + /* + * GCI I-change (bit 1) + */ + } + + if (s2 & hfc_M2_PROC_TRANS) { + /* + * processing/non-processing transition (bit 0) + */ + hfc_handle_processing_interrupt(card); + } + + } + + spin_unlock_irqrestore(&card->lock, flags); + + return IRQ_HANDLED; +} + +static void hfc_handle_timer_interrupt(struct hfc_card *card) +{ + if (card->ignore_first_timer_interrupt) { + card->ignore_first_timer_interrupt = FALSE; + return; + } + + if ((card->nt_mode && card->l1_state == 3) || + (!card->nt_mode && card->l1_state == 7)) { + + card->regs.ctmt &= ~hfc_CTMT_TIMER_MASK; + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + + hfc_resume_fifo(card); + } +} + +static void hfc_handle_state_interrupt(struct hfc_card *card) +{ + u8 new_state = hfc_inb(card, hfc_STATES) & hfc_STATES_STATE_MASK; + +#ifdef DEBUG + if (debug_level >= 1) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "layer 1 state = %c%d\n", + card->cardnum, + card->nt_mode ? 'G' : 'F', + new_state); + } +#endif + + if (card->nt_mode) { + /* + * NT mode + */ + + if (new_state == 3) { + /* + * fix to G3 state (see specs) + */ + hfc_outb(card, hfc_STATES, hfc_STATES_LOAD_STATE | 3); + } + + if (new_state == 3 && card->l1_state != 3) + hfc_resume_fifo(card); + + if (new_state != 3 && card->l1_state == 3) + hfc_suspend_fifo(card); + + } else { + if (new_state == 3) { + /* + * Keep L1 up... zaptel & libpri expects + * a always up L1... + * Enable only when using an unpatched libpri + * + * Are we still using unpatched libpri? Is this tested at runtime??? + * Does it only affect zaptel or DAHDI, too? + */ + + if (force_l1_up) { + hfc_outb(card, hfc_STATES, + hfc_STATES_DO_ACTION | + hfc_STATES_ACTIVATE| + hfc_STATES_NT_G2_G3); + } + } + + if (new_state == 7 && card->l1_state != 7) { + /* + * TE is now active, schedule FIFO activation after + * some time, otherwise the first frames are lost + */ + + card->regs.ctmt |= hfc_CTMT_TIMER_50 | + hfc_CTMT_TIMER_CLEAR; + hfc_outb(card, hfc_CTMT, card->regs.ctmt); + + /* + * Activating the timer firest an + * interrupt immediately, we + * obviously need to ignore it + */ + card->ignore_first_timer_interrupt = TRUE; + } + + if (new_state != 7 && card->l1_state == 7) { + /* + * TE has become inactive, disable FIFO + */ + hfc_suspend_fifo(card); + } + } + + card->l1_state = new_state; +} + +static void hfc_handle_processing_interrupt(struct hfc_card *card) +{ + int available_bytes = 0; + + /* + * Synchronize with the first enabled channel + */ + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + available_bytes = hfc_fifo_used_rx(&card->chans[B1].rx); + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + available_bytes = hfc_fifo_used_rx(&card->chans[B2].rx); + else + available_bytes = -1; + + if ((available_bytes == -1 && card->ticks == 8) || + available_bytes >= DAHDI_CHUNKSIZE + hfc_RX_FIFO_PRELOAD) { + card->ticks = 0; + + if (available_bytes > DAHDI_CHUNKSIZE*2 + hfc_RX_FIFO_PRELOAD) { + card->late_irqs++; + /* + * we are out of sync, clear fifos, jaw + */ + hfc_clear_fifo_rx(&card->chans[B1].rx); + hfc_clear_fifo_tx(&card->chans[B1].tx); + hfc_clear_fifo_rx(&card->chans[B2].rx); + hfc_clear_fifo_tx(&card->chans[B2].tx); + +#ifdef DEBUG + if (debug_level >= 4) { + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "late IRQ, %d bytes late\n", + card->cardnum, + available_bytes - + (DAHDI_CHUNKSIZE + + hfc_RX_FIFO_PRELOAD)); + } +#endif + } else { + hfc_handle_voice(card); + } + } + + card->ticks++; +} + + +static void hfc_handle_voice(struct hfc_card *card) +{ + struct dahdi_hfc *hfccard = card->dahdi_dev; + int frame_left, res; + unsigned char buf[hfc_HDLC_BUF_LEN]; + unsigned int size = sizeof(buf) / sizeof(buf[0]); + + + if (card->chans[B1].status != open_voice && + card->chans[B2].status != open_voice) + return; + + dahdi_transmit(&hfccard->span); + + if (card->regs.fifo_en & hfc_FIFOEN_B1TX) + hfc_dahdi_transmit(&card->chans[B1].tx); + if (card->regs.fifo_en & hfc_FIFOEN_B2TX) + hfc_dahdi_transmit(&card->chans[B2].tx); + + /* + * dahdi hdlc frame tx + */ + + if (atomic_read(&hfccard->hdlc_pending)) { + hfc_check_l1_up(card); + res = dahdi_hdlc_getbuf(hfccard->sigchan, buf, &size); + if (size > 0) { + hfccard->sigactive = 1; + memcpy(card->chans[D].tx.ugly_framebuf + + card->chans[D].tx.ugly_framebuf_size, + buf, size); + card->chans[D].tx.ugly_framebuf_size += size; + if (res != 0) { + hfc_fifo_put_frame(&card->chans[D].tx, + card->chans[D].tx.ugly_framebuf, + card->chans[D].tx.ugly_framebuf_size); + ++hfccard->frames_out; + hfccard->sigactive = 0; + card->chans[D].tx.ugly_framebuf_size + = 0; + atomic_dec(&hfccard->hdlc_pending); + } + } + } + /* + * dahdi hdlc frame tx done + */ + + if (card->regs.fifo_en & hfc_FIFOEN_B1RX) + hfc_dahdi_receive(&card->chans[B1].rx); + else + memset(&card->chans[B1].rx.dahdi_buffer, 0x7f, + sizeof(card->chans[B1].rx.dahdi_buffer)); + + if (card->regs.fifo_en & hfc_FIFOEN_B2RX) + hfc_dahdi_receive(&card->chans[B2].rx); + else + memset(&card->chans[B2].rx.dahdi_buffer, 0x7f, + sizeof(card->chans[B1].rx.dahdi_buffer)); + + /* + * Echo cancellation + */ + dahdi_ec_chunk(&hfccard->chans[DAHDI_B1], + card->chans[B1].rx.dahdi_buffer, + card->chans[B1].tx.dahdi_buffer); + dahdi_ec_chunk(&hfccard->chans[DAHDI_B2], + card->chans[B2].rx.dahdi_buffer, + card->chans[B2].tx.dahdi_buffer); + + /* + * dahdi hdlc frame rx + */ + if (hfc_fifo_has_frames(&card->chans[D].rx)) + hfc_frame_arrived(&card->chans[D]); + + if (card->chans[D].rx.ugly_framebuf_size) { + frame_left = card->chans[D].rx.ugly_framebuf_size - + card->chans[D].rx.ugly_framebuf_off ; + if (frame_left > hfc_HDLC_BUF_LEN) { + dahdi_hdlc_putbuf(hfccard->sigchan, + card->chans[D].rx.ugly_framebuf + + card->chans[D].rx.ugly_framebuf_off, + hfc_HDLC_BUF_LEN); + card->chans[D].rx.ugly_framebuf_off += + hfc_HDLC_BUF_LEN; + } else { + dahdi_hdlc_putbuf(hfccard->sigchan, + card->chans[D].rx.ugly_framebuf + + card->chans[D].rx.ugly_framebuf_off, + frame_left); + dahdi_hdlc_finish(hfccard->sigchan); + card->chans[D].rx.ugly_framebuf_size = 0; + card->chans[D].rx.ugly_framebuf_off = 0; + } + } + /* + * dahdi hdlc frame rx done + */ + + if (hfccard->span.flags & DAHDI_FLAG_RUNNING) + dahdi_receive(&hfccard->span); + +} + +static void hfc_frame_arrived(struct hfc_chan_duplex *chan) +{ + struct hfc_card *card = chan->card; + int antiloop = 16; + struct sk_buff *skb; + + while (hfc_fifo_has_frames(&chan->rx) && --antiloop) { + int frame_size = hfc_fifo_get_frame_size(&chan->rx); + + if (frame_size < 3) { +#ifdef DEBUG + if (debug_level >= 2) + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "invalid frame received, " + "just %d bytes\n", + card->cardnum, + chan->name, + frame_size); +#endif + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } else if (frame_size == 3) { +#ifdef DEBUG + if (debug_level >= 2) + printk(KERN_DEBUG hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "empty frame received\n", + card->cardnum, + chan->name); +#endif + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } + + if (chan->open_by_dahdi && + card->chans[D].rx.ugly_framebuf_size) { + + /* + * We have to wait for Dahdi to transmit the + * frame... wait for next time + */ + + break; + } + + skb = dev_alloc_skb(frame_size - 3); + + if (!skb) { + printk(KERN_ERR hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "cannot allocate skb: frame dropped\n", + card->cardnum, + chan->name); + + hfc_fifo_drop_frame(&chan->rx); + + + continue; + } + + + /* + * HFC does the checksum + */ +#ifndef CHECKSUM_HW + skb->ip_summed = CHECKSUM_COMPLETE; +#else + skb->ip_summed = CHECKSUM_HW; +#endif + + if (chan->open_by_dahdi) { + card->chans[D].rx.ugly_framebuf_size = frame_size - 1; + + if (hfc_fifo_get_frame(&card->chans[D].rx, + card->chans[D].rx.ugly_framebuf, + frame_size - 1) == -1) { + dev_kfree_skb(skb); + continue; + } + + memcpy(skb_put(skb, frame_size - 3), + card->chans[D].rx.ugly_framebuf, + frame_size - 3); + } else { + if (hfc_fifo_get_frame(&chan->rx, + skb_put(skb, frame_size - 3), + frame_size - 3) == -1) { + dev_kfree_skb(skb); + continue; + } + } + } + + if (!antiloop) + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "Infinite loop detected\n", + card->cardnum); +} + +/****************************************** + * Module initialization and cleanup + ******************************************/ + +static int __devinit hfc_probe(struct pci_dev *pci_dev, + const struct pci_device_id *ent) +{ + static int cardnum; + int err; + int i; + + struct hfc_card *card = NULL; + struct dahdi_hfc *dahdi_hfcs = NULL; + card = kmalloc(sizeof(struct hfc_card), GFP_KERNEL); + if (!card) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "unable to kmalloc!\n"); + err = -ENOMEM; + goto err_alloc_hfccard; + } + + memset(card, 0x00, sizeof(struct hfc_card)); + card->cardnum = cardnum; + card->pcidev = pci_dev; + spin_lock_init(&card->lock); + + pci_set_drvdata(pci_dev, card); + + err = pci_enable_device(pci_dev); + if (err) + goto err_pci_enable_device; + + err = pci_set_dma_mask(pci_dev, PCI_DMA_32BIT); + if (err) { + printk(KERN_ERR hfc_DRIVER_PREFIX + "card %d: " + "No suitable DMA configuration available.\n", + card->cardnum); + goto err_pci_set_dma_mask; + } + + pci_write_config_word(pci_dev, PCI_COMMAND, PCI_COMMAND_MEMORY); + err = pci_request_regions(pci_dev, hfc_DRIVER_NAME); + if (err) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "cannot request I/O memory region\n", + card->cardnum); + goto err_pci_request_regions; + } + + pci_set_master(pci_dev); + + if (!pci_dev->irq) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "no irq!\n", + card->cardnum); + err = -ENODEV; + goto err_noirq; + } + + card->io_bus_mem = pci_resource_start(pci_dev, 1); + if (!card->io_bus_mem) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "no iomem!\n", + card->cardnum); + err = -ENODEV; + goto err_noiobase; + } + + card->io_mem = ioremap(card->io_bus_mem, hfc_PCI_MEM_SIZE); + if (!(card->io_mem)) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "cannot ioremap I/O memory\n", + card->cardnum); + err = -ENODEV; + goto err_ioremap; + } + + /* + * pci_alloc_consistent guarantees alignment + * (Documentation/DMA-mapping.txt) + */ + card->fifo_mem = pci_alloc_consistent(pci_dev, + hfc_FIFO_SIZE, &card->fifo_bus_mem); + if (!card->fifo_mem) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "unable to allocate FIFO DMA memory!\n", + card->cardnum); + err = -ENOMEM; + goto err_alloc_fifo; + } + + memset(card->fifo_mem, 0x00, hfc_FIFO_SIZE); + + card->fifos = card->fifo_mem; + + pci_write_config_dword(card->pcidev, hfc_PCI_MWBA, card->fifo_bus_mem); + + err = request_irq(card->pcidev->irq, &hfc_interrupt, + +#if (KERNEL_VERSION(2, 6, 23) < LINUX_VERSION_CODE) + IRQF_SHARED, hfc_DRIVER_NAME, card); +#else + SA_SHIRQ, hfc_DRIVER_NAME, card); +#endif + + if (err) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "unable to register irq\n", + card->cardnum); + goto err_request_irq; + } + + card->nt_mode = FALSE; + + if (modes & (1 << card->cardnum)) + card->nt_mode = TRUE; + + for (i = 0; i < nt_modes_count; i++) { + if (nt_modes[i] == card->cardnum) + card->nt_mode = TRUE; + } + + /* + * D Channel + */ + card->chans[D].card = card; + card->chans[D].name = "D"; + card->chans[D].status = free; + card->chans[D].number = D; + spin_lock_init(&card->chans[D].lock); + + card->chans[D].rx.chan = &card->chans[D]; + card->chans[D].rx.fifo_base = card->fifos + 0x4000; + card->chans[D].rx.z_base = card->fifos + 0x4000; + card->chans[D].rx.z1_base = card->fifos + 0x6080; + card->chans[D].rx.z2_base = card->fifos + 0x6082; + card->chans[D].rx.z_min = 0x0000; + card->chans[D].rx.z_max = 0x01FF; + card->chans[D].rx.f_min = 0x10; + card->chans[D].rx.f_max = 0x1F; + card->chans[D].rx.f1 = card->fifos + 0x60a0; + card->chans[D].rx.f2 = card->fifos + 0x60a1; + card->chans[D].rx.fifo_size = card->chans[D].rx.z_max + - card->chans[D].rx.z_min + 1; + card->chans[D].rx.f_num = card->chans[D].rx.f_max + - card->chans[D].rx.f_min + 1; + + card->chans[D].tx.chan = &card->chans[D]; + card->chans[D].tx.fifo_base = card->fifos + 0x0000; + card->chans[D].tx.z_base = card->fifos + 0x0000; + card->chans[D].tx.z1_base = card->fifos + 0x2080; + card->chans[D].tx.z2_base = card->fifos + 0x2082; + card->chans[D].tx.z_min = 0x0000; + card->chans[D].tx.z_max = 0x01FF; + card->chans[D].tx.f_min = 0x10; + card->chans[D].tx.f_max = 0x1F; + card->chans[D].tx.f1 = card->fifos + 0x20a0; + card->chans[D].tx.f2 = card->fifos + 0x20a1; + card->chans[D].tx.fifo_size = card->chans[D].tx.z_max - + card->chans[D].tx.z_min + 1; + card->chans[D].tx.f_num = card->chans[D].tx.f_max - + card->chans[D].tx.f_min + 1; + + /* + * B1 Channel + */ + card->chans[B1].card = card; + card->chans[B1].name = "B1"; + card->chans[B1].status = free; + card->chans[B1].number = B1; + card->chans[B1].protocol = 0; + spin_lock_init(&card->chans[B1].lock); + + card->chans[B1].rx.chan = &card->chans[B1]; + card->chans[B1].rx.fifo_base = card->fifos + 0x4200; + card->chans[B1].rx.z_base = card->fifos + 0x4000; + card->chans[B1].rx.z1_base = card->fifos + 0x6000; + card->chans[B1].rx.z2_base = card->fifos + 0x6002; + card->chans[B1].rx.z_min = 0x0200; + card->chans[B1].rx.z_max = 0x1FFF; + card->chans[B1].rx.f_min = 0x00; + card->chans[B1].rx.f_max = 0x1F; + card->chans[B1].rx.f1 = card->fifos + 0x6080; + card->chans[B1].rx.f2 = card->fifos + 0x6081; + card->chans[B1].rx.fifo_size = card->chans[B1].rx.z_max - + card->chans[B1].rx.z_min + 1; + card->chans[B1].rx.f_num = card->chans[B1].rx.f_max - + card->chans[B1].rx.f_min + 1; + + card->chans[B1].tx.chan = &card->chans[B1]; + card->chans[B1].tx.fifo_base = card->fifos + 0x0200; + card->chans[B1].tx.z_base = card->fifos + 0x0000; + card->chans[B1].tx.z1_base = card->fifos + 0x2000; + card->chans[B1].tx.z2_base = card->fifos + 0x2002; + card->chans[B1].tx.z_min = 0x0200; + card->chans[B1].tx.z_max = 0x1FFF; + card->chans[B1].tx.f_min = 0x00; + card->chans[B1].tx.f_max = 0x1F; + card->chans[B1].tx.f1 = card->fifos + 0x2080; + card->chans[B1].tx.f2 = card->fifos + 0x2081; + card->chans[B1].tx.fifo_size = card->chans[B1].tx.z_max - + card->chans[B1].tx.z_min + 1; + card->chans[B1].tx.f_num = card->chans[B1].tx.f_max - + card->chans[B1].tx.f_min + 1; + + /* + * B2 Channel + */ + card->chans[B2].card = card; + card->chans[B2].name = "B2"; + card->chans[B2].status = free; + card->chans[B2].number = B2; + card->chans[B2].protocol = 0; + spin_lock_init(&card->chans[B2].lock); + + card->chans[B2].rx.chan = &card->chans[B2]; + card->chans[B2].rx.fifo_base = card->fifos + 0x6200, + card->chans[B2].rx.z_base = card->fifos + 0x6000; + card->chans[B2].rx.z1_base = card->fifos + 0x6100; + card->chans[B2].rx.z2_base = card->fifos + 0x6102; + card->chans[B2].rx.z_min = 0x0200; + card->chans[B2].rx.z_max = 0x1FFF; + card->chans[B2].rx.f_min = 0x00; + card->chans[B2].rx.f_max = 0x1F; + card->chans[B2].rx.f1 = card->fifos + 0x6180; + card->chans[B2].rx.f2 = card->fifos + 0x6181; + card->chans[B2].rx.fifo_size = card->chans[B2].rx.z_max - + card->chans[B2].rx.z_min + 1; + card->chans[B2].rx.f_num = card->chans[B2].rx.f_max - + card->chans[B2].rx.f_min + 1; + + card->chans[B2].tx.chan = &card->chans[B2]; + card->chans[B2].tx.fifo_base = card->fifos + 0x2200; + card->chans[B2].tx.z_base = card->fifos + 0x2000; + card->chans[B2].tx.z1_base = card->fifos + 0x2100; + card->chans[B2].tx.z2_base = card->fifos + 0x2102; + card->chans[B2].tx.z_min = 0x0200; + card->chans[B2].tx.z_max = 0x1FFF; + card->chans[B2].tx.f_min = 0x00; + card->chans[B2].tx.f_max = 0x1F; + card->chans[B2].tx.f1 = card->fifos + 0x2180; + card->chans[B2].tx.f2 = card->fifos + 0x2181; + card->chans[B2].tx.fifo_size = card->chans[B2].tx.z_max - + card->chans[B2].tx.z_min + 1; + card->chans[B2].tx.f_num = card->chans[B2].tx.f_max - + card->chans[B2].tx.f_min + 1; + + /* + * All done + */ + + dahdi_hfcs = kmalloc(sizeof(struct dahdi_hfc), GFP_KERNEL); + if (!dahdi_hfcs) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "unable to kmalloc!\n"); + goto err_request_irq; + } + memset(dahdi_hfcs, 0x0, sizeof(struct dahdi_hfc)); + + dahdi_hfcs->card = card; + hfc_dahdi_initialize(dahdi_hfcs); + card->dahdi_dev = dahdi_hfcs; + +#ifdef CONFIG_PROC_FS + snprintf(card->proc_dir_name, + sizeof(card->proc_dir_name), + "%d", card->cardnum); + card->proc_dir = proc_mkdir(card->proc_dir_name, hfc_proc_dahdi_hfcs_dir); + SET_PROC_DIRENTRY_OWNER(card->proc_dir); +#endif /* CONFIG_PROC_FS */ + + hfc_resetCard(card); + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d configured for %s mode at mem %#lx (0x%p) IRQ %u\n", + card->cardnum, + card->nt_mode ? "NT" : "TE", + card->io_bus_mem, + card->io_mem, + card->pcidev->irq); + + cardnum++; + + return 0; + +err_request_irq: + pci_free_consistent(pci_dev, hfc_FIFO_SIZE, + card->fifo_mem, card->fifo_bus_mem); +err_alloc_fifo: + iounmap(card->io_mem); +err_ioremap: +err_noiobase: +err_noirq: + pci_release_regions(pci_dev); +err_pci_request_regions: +err_pci_set_dma_mask: +err_pci_enable_device: + kfree(card); +err_alloc_hfccard: + return err; +} + +static void __devexit hfc_remove(struct pci_dev *pci_dev) +{ + struct hfc_card *card = pci_get_drvdata(pci_dev); + + + printk(KERN_INFO hfc_DRIVER_PREFIX + "card %d: " + "shutting down card at %p.\n", + card->cardnum, + card->io_mem); + + if (!card) { + return; + } + + hfc_softreset(card); + + dahdi_unregister_device(card->dahdi_dev->ddev); + + + /* + * disable memio and bustmaster + */ + pci_write_config_word(pci_dev, PCI_COMMAND, 0); + +#ifdef CONFIG_PROC_FS +/* +BUG: these proc entries just cause Call traces, so removed. + remove_proc_entry("bufs", card->proc_dir); + remove_proc_entry("fifos", card->proc_dir); + remove_proc_entry("info", card->proc_dir); +*/ + remove_proc_entry(card->proc_dir_name, hfc_proc_dahdi_hfcs_dir); +#endif /* CONFIG_PROC_FS */ + + free_irq(pci_dev->irq, card); + + pci_free_consistent(pci_dev, hfc_FIFO_SIZE, + card->fifo_mem, card->fifo_bus_mem); + + iounmap(card->io_mem); + + pci_release_regions(pci_dev); + + pci_disable_device(pci_dev); + + kfree(card); +} + +/****************************************** + * Module stuff + ******************************************/ + +static int __init hfc_init_module(void) +{ + int ret; + + printk(KERN_INFO hfc_DRIVER_PREFIX + hfc_DRIVER_STRING " loading\n"); +#ifdef DEBUG +printk(KERN_INFO hfc_DRIVER_PREFIX "Check /var/log/kern-debug.log for debugging output level %d.", debug_level); +printk(KERN_DEBUG hfc_DRIVER_PREFIX "base.c is debugging."); +#endif + +#ifdef CONFIG_PROC_FS +#if (KERNEL_VERSION(2, 6, 26) <= LINUX_VERSION_CODE) + hfc_proc_dahdi_hfcs_dir = proc_mkdir(hfc_DRIVER_NAME, NULL); +#else + hfc_proc_dahdi_hfcs_dir = proc_mkdir(hfc_DRIVER_NAME, proc_root_driver); +#endif +#endif /* CONFIG_PROC_FS */ + + ret = dahdi_pci_module(&hfc_driver); + return ret; +} + +module_init(hfc_init_module); + +static void __exit hfc_module_exit(void) +{ + pci_unregister_driver(&hfc_driver); + +#ifdef CONFIG_PROC_FS +#if (KERNEL_VERSION(2, 6, 26) <= LINUX_VERSION_CODE) + remove_proc_entry(hfc_DRIVER_NAME, NULL); +#else + remove_proc_entry(hfc_DRIVER_NAME, proc_root_driver); +#endif +#endif /* CONFIG_PROC_FS */ + + printk(KERN_INFO hfc_DRIVER_PREFIX + hfc_DRIVER_STRING " unloaded\n"); +} + +module_exit(hfc_module_exit); + +#endif + +MODULE_DESCRIPTION(hfc_DRIVER_DESCR); +MODULE_AUTHOR("Jens Wilke <jw_...@he...>, " + "Daniele (Vihai) Orlandi <da...@or...>, " + "Jose A. Deniz <od...@ho...>"); +MODULE_ALIAS("dahdi_hfcs"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif + + +module_param(modes, int, 0444); + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) +module_param_array(nt_modes, int, &nt_modes_count, 0444); +#else +module_param_array(nt_modes, int, nt_modes_count, 0444); +#endif + +module_param(force_l1_up, int, 0444); +#ifdef DEBUG +module_param(debug_level, int, 0444); +#endif + +MODULE_PARM_DESC(modes, "[Deprecated] bit-mask to configure NT mode"); +MODULE_PARM_DESC(nt_modes, + "Comma-separated list of card IDs to configure in NT mode"); +MODULE_PARM_DESC(force_l1_up, "Don't allow L1 to go down"); +#ifdef DEBUG +MODULE_PARM_DESC(debug_level, "Debug verbosity level"); +#endif Added: branches/1.0/package/dahdi-linux/hfcs-2.8/dahdi_hfcs.h =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.8/dahdi_hfcs.h (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.8/dahdi_hfcs.h 2013-12-11 23:01:17 UTC (rev 6307) @@ -0,0 +1,424 @@ +/* + * dahdi_hfcs.h - Dahdi driver for HFC-S PCI A based ISDN BRI cards + * + * Dahdi port by Jose A. Deniz <od...@ho...> + * + * Copyright (C) 2009 Jose A. Deniz + * Copyright (C) 2006 headissue GmbH; Jens Wilke + * Copyright (C) 2004 Daniele Orlandi + * Copyright (C) 2002, 2003, 2004, Junghanns.NET GmbH + * + * Jens Wilke <jw_...@he...> + * + * Orginal author of this code is + * Daniele "Vihai" Orlandi <da...@or...> + * + * Major rewrite of the driver made by + * Klaus-Peter Junghanns <kp...@ju...> + * + * This program is free software and may be modified and + * distributed under the terms of the GNU Public License. + * + */ + +#ifndef _HFC_ZAPHFC_H +#define _HFC_ZAPHFC_H + +#include <asm/io.h> + +#define hfc_DRIVER_NAME "dahdi_hfcs" +#define hfc_DRIVER_PREFIX hfc_DRIVER_NAME ": " +#define hfc_DRIVER_DESCR "HFC-S PCI A ISDN" +#define hfc_DRIVER_VERSION "1.42" +#define hfc_DRIVER_STRING hfc_DRIVER_DESCR " (V" hfc_DRIVER_VERSION ")" + +#define hfc_MAX_BOARDS 32 + +#ifndef PCI_DMA_32BIT +#define PCI_DMA_32BIT 0x00000000ffffffffULL +#endif + +#ifndef PCI_VENDOR_ID_SITECOM +#define PCI_VENDOR_ID_SITECOM 0x182D +#endif + +#ifndef PCI_DEVICE_ID_SITECOM_3069 +#define PCI_DEVICE_ID_SITECOM_3069 0x3069 +#endif + +#define hfc_RESET_DELAY 20 + +#define hfc_CLKDEL_TE 0x0f /* CLKDEL in TE mode */ +#define hfc_CLKDEL_NT 0x6c /* CLKDEL in NT mode */ + +/* PCI memory mapped I/O */ + +#define hfc_PCI_MEM_SIZE 0x0100 +#define hfc_PCI_MWBA 0x80 + +/* GCI/IOM bus monitor registers */ + +#define hfc_C_I 0x08 +#define hfc_TRxR 0x0C +#define hfc_MON1_D 0x28 +#define hfc_MON2_D 0x2C + + +/* GCI/IOM bus timeslot registers */ + +#define hfc_B1_SSL 0x80 +#define hfc_B2_SSL 0x84 +#define hfc_AUX1_SSL 0x88 +#define hfc_AUX2_SSL 0x8C +#define hfc_B1_RSL 0x90 +#define hfc_B2_RSL 0x94 +#define hfc_AUX1_RSL 0x98 +#define hfc_AUX2_RSL 0x9C + +/* GCI/IOM bus data registers */ + +#define hfc_B1_D 0xA0 +#define hfc_B2_D 0xA4 +#define hfc_AUX1_D 0xA8 +#define hfc_AUX2_D 0xAC + +/* GCI/IOM bus configuration registers */ + +#define hfc_MST_EMOD 0xB4 +#define hfc_MST_MODE 0xB8 +#define hfc_CONNECT 0xBC + + +/* Interrupt and status registers */ + +#define hfc_FIFO_EN 0x44 +#define hfc_TRM 0x48 +#define hfc_B_MODE 0x4C +#define hfc_CHIP_ID 0x58 +#define hfc_CIRM 0x60 +#define hfc_CTMT 0x64 +#define hfc_INT_M1 0x68 +#define hfc_INT_M2 0x6C +#define hfc_INT_S1 0x78 +#define hfc_INT_S2 0x7C +#define hfc_STATUS 0x70 + +/* S/T section registers */ + +#define hfc_STATES 0xC0 +#define hfc_SCTRL 0xC4 +#define hfc_SCTRL_E 0xC8 +#define hfc_SCTRL_R 0xCC +#define hfc_SQ 0xD0 +#define hfc_CLKDEL 0xDC +#define hfc_B1_REC 0xF0 +#define hfc_B1_SEND 0xF0 +#define hfc_B2_REC 0xF4 +#define hfc_B2_SEND 0xF4 +#define hfc_D_REC 0xF8 +#define hfc_D_SEND 0xF8 +#define hfc_E_REC 0xFC + +/* Bits and values in various HFC PCI registers */ + +/* bits in status register (READ) */ +#define hfc_STATUS_PCI_PROC 0x02 +#define hfc_STATUS_NBUSY 0x04 +#define hfc_STATUS_TIMER_ELAP 0x10 +#define hfc_STATUS_STATINT 0x20 +#define hfc_STATUS_FRAMEINT 0x40 +#define hfc_STATUS_ANYINT 0x80 + +/* bits in CTMT (Write) */ +#define hfc_CTMT_TRANSB1 0x01 +#define hfc_CTMT_TRANSB2 0x02 +#define hfc_CTMT_TIMER_CLEAR 0x80 +#define hfc_CTMT_TIMER_MASK 0x1C +#define hfc_CTMT_TIMER_3_125 (0x01 << 2) +#define hfc_CTMT_TIMER_6_25 (0x02 << 2) +#define hfc_CTMT_TIMER_12_5 (0x03 << 2) +#define hfc_CTMT_TIMER_25 (0x04 << 2) +#define hfc_CTMT_TIMER_50 (0x05 << 2) +#define hfc_CTMT_TIMER_400 (0x06 << 2) +#define hfc_CTMT_TIMER_800 (0x07 << 2) +#define hfc_CTMT_AUTO_TIMER 0x20 + +/* bits in CIRM (Write) */ +#define hfc_CIRM_AUX_MSK 0x07 +#define hfc_CIRM_RESET 0x08 +#define hfc_CIRM_B1_REV 0x40 +#define hfc_CIRM_B2_REV 0x80 + +/* bits in INT_M1 and INT_S1 */ +#define hfc_INTS_B1TRANS 0x01 +#define hfc_INTS_B2TRANS 0x02 +#define hfc_INTS_DTRANS 0x04 +#define hfc_INTS_B1REC 0x08 +#define hfc_INTS_B2REC 0x10 +#define hfc_INTS_DREC 0x20 +#define hfc_INTS_L1STATE 0x40 +#define hfc_INTS_TIMER 0x80 + +/* bits in INT_M2 */ +#define hfc_M2_PROC_TRANS 0x01 +#define hfc_M2_GCI_I_CHG 0x02 +#define hfc_M2_GCI_MON_REC 0x04 +#define hfc_M2_IRQ_ENABLE 0x08 +#define hfc_M2_PMESEL 0x80 + +/* bits in STATES */ +#define hfc_STATES_STATE_MASK 0x0F +#define hfc_STATES_LOAD_STATE 0x10 +#define hfc_STATES_ACTIVATE 0x20 +#define hfc_STATES_DO_ACTION 0x40 +#define hfc_STATES_NT_G2_G3 0x80 + +/* bits in HFCD_MST_MODE */ +#define hfc_MST_MODE_MASTER 0x01 +#define hfc_MST_MODE_SLAVE 0x00 +/* remaining bits are for codecs control */ + +/* bits in HFCD_SCTRL */ +#define hfc_SCTRL_B1_ENA 0x01 +#define hfc_SCTRL_B2_ENA 0x02 +#define hfc_SCTRL_MODE_TE 0x00 +#define hfc_SCTRL_MODE_NT 0x04 +#define hfc_SCTRL_LOW_PRIO 0x08 +#define hfc_SCTRL_SQ_ENA 0x10 +#define hfc_SCTRL_TEST 0x20 +#define hfc_SCTRL_NONE_CAP 0x40 +#define hfc_SCTRL_PWR_DOWN 0x80 + +/* bits in SCTRL_E */ +#define hfc_SCTRL_E_AUTO_AWAKE 0x01 +#define hfc_SCTRL_E_DBIT_1 0x04 +#define hfc_SCTRL_E_IGNORE_COL 0x08 +#define hfc_SCTRL_E_CHG_B1_B2 0x80 + +/* bits in SCTRL_R */ +#define hfc_SCTRL_R_B1_ENA 0x01 +#define hfc_SCTRL_R_B2_ENA 0x02 + +/* bits in FIFO_EN register */ +#define hfc_FIFOEN_B1TX 0x01 +#define hfc_FIFOEN_B1RX 0x02 +#define hfc_FIFOEN_B2TX 0x04 +#define hfc_FIFOEN_B2RX 0x08 +#define hfc_FIFOEN_DTX 0x10 +#define hfc_FIFOEN_DRX 0x20 + +#define hfc_FIFOEN_B1 (hfc_FIFOEN_B1TX|hfc_FIFOEN_B1RX) +#define hfc_FIFOEN_B2 (hfc_FIFOEN_B2TX|hfc_FIFOEN_B2RX) +#define hfc_FIFOEN_D (hfc_FIFOEN_DTX|hfc_FIFOEN_DRX) + +/* bits in the CONNECT register */ +#define hfc_CONNECT_B1_HFC_from_ST 0x00 +#define hfc_CONNECT_B1_HFC_from_GCI 0x01 +#define hfc_CONNECT_B1_ST_from_HFC 0x00 +#define hfc_CONNECT_B1_ST_from_GCI 0x02 +#define hfc_CONNECT_B1_GCI_from_HFC 0x00 +#define hfc_CONNECT_B1_GCI_from_ST 0x04 + +#define hfc_CONNECT_B2_HFC_from_ST 0x00 +#define hfc_CONNECT_B2_HFC_from_GCI 0x08 +#define hfc_CONNECT_B2_ST_from_HFC 0x00 +#define hfc_CONNECT_B2_ST_from_GCI 0x10 +#define hfc_CONNECT_B2_GCI_from_HFC 0x00 +#define hfc_CONNECT_B2_GCI_from_ST 0x20 + +/* bits in the TRM register */ +#define hfc_TRM_TRANS_INT_00 0x00 +#define hfc_TRM_TRANS_INT_01 0x01 +#define hfc_TRM_TRANS_INT_10 0x02 +#define hfc_TRM_TRANS_INT_11 0x04 +#define hfc_TRM_ECHO 0x20 +#define hfc_TRM_B1_PLUS_B2 0x40 +#define hfc_TRM_IOM_TEST_LOOP 0x80 + +/* bits in the __SSL and __RSL registers */ +#define hfc_SRSL_STIO 0x40 +#define hfc_SRSL_ENABLE 0x80 +#define hfc_SRCL_SLOT_MASK 0x1f + +/* FIFO memory definitions */ + +#define hfc_FIFO_SIZE 0x8000 + +#define hfc_UGLY_FRAMEBUF 0x2000 + +#define hfc_TX_FIFO_PRELOAD (DAHDI_CHUNKSIZE + 2) +#define hfc_RX_FIFO_PRELOAD 4 + +/* HDLC STUFF */ +#define hfc_HDLC_BUF_LEN 32 +/* arbitrary, just the max # of byts we will send to DAHDI per call */ + + +/* NOTE: FIFO pointers are not declared volatile because accesses to the + * FIFOs are inherently safe. + */ + +#ifdef DEBUG +extern int debug_level; +#endif + +struct hfc_chan; + +struct hfc_chan_simplex { + struct hfc_chan_duplex *chan; + + u8 dahdi_buffer[DAHDI_CHUNKSIZE]; + + u8 ugly_framebuf[hfc_UGLY_FRAMEBUF]; + int ugly_framebuf_size; + u16 ugly_framebuf_off; + + void *z1_base, *z2_base; + void *fifo_base; + void *z_base; + u16 z_min; + u16 z_max; + u16 fifo_size; + + u8 *f1, *f2; + u8 f_min; + u8 f_max; + u8 f_num; + + unsigned long long frames; + unsigned long long bytes; + unsigned long long fifo_full; + unsigned long long crc; + unsigned long long fifo_underrun; +}; + +enum hfc_chan_status { + free, + open_framed, + open_voice, + sniff_aux, + loopback, +}; + +struct hfc_chan_duplex { + struct hfc_card *card; + + char *name; + int number; + + enum hfc_chan_status status; + int open_by_netdev; + int open_by_dahdi; + + unsigned short protocol; + + spinlock_t lock; + + struct hfc_chan_simplex rx; + struct hfc_chan_simplex tx; + +}; + +typedef struct hfc_card { + int cardnum; + struct pci_dev *pcidev; + struct dahdi_hfc *dahdi_dev; +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *proc_dir; + char proc_dir_name[32]; + +/* +BUG: These have been removed. + struct proc_dir_entry *proc_info; + struct proc_dir_entry *proc_fifos; + struct proc_dir_entry *proc_bufs; +*/ +#endif /* CONFIG_PROC_FS */ + + unsigned long io_bus_mem; + void __iomem *io_mem; + + dma_addr_t fifo_bus_mem; + void *fifo_mem; + void *fifos; + + int nt_mode; + int sync_loss_reported; + int late_irqs; + + u8 l1_state; + int fifo_suspended; + int ignore_first_timer_interrupt; + + struct { + u8 m1; + u8 m2; + u8 fifo_en; + u8 trm; + u8 connect; + u8 sctrl; + u8 sctrl_r; + u8 sctrl_e; + u8 ctmt; + u8 cirm; + } regs; + + struct hfc_chan_duplex chans[3]; + int echo_enabled; + + + + int debug_event; + + spinlock_t lock; + unsigned int irq; + unsigned int iomem; + int ticks; + int clicks; + unsigned char *pci_io; + void *fifomem; /* start of the shared mem */ + + unsigned int pcibus; + unsigned int pcidevfn; + + int drecinframe; + + unsigned char cardno; + struct hfc_card *next; + +} hfc_card; + +typedef struct dahdi_hfc { + unsigned int usecount; + struct dahdi_device *ddev; + struct dahdi_span span; + struct dahdi_chan chans[3]; + struct dahdi_chan *_chans[3]; + struct hfc_card *card; + + /* pointer to the signalling channel for this span */ + struct dahdi_chan *sigchan; + /* nonzero means we're in the middle of sending an HDLC frame */ + int sigactive; + /* hdlc_hard_xmit() increments, hdlc_tx_frame() decrements */ + atomic_t hdlc_pending; + int frames_out; + int frames_in; + +} dahdi_hfc; + +static inline struct dahdi_hfc* dahdi_hfc_from_span(struct dahdi_span *span) { + return container_of(span, struct dahdi_hfc, span); +} + +static inline u8 hfc_inb(struct hfc_card *card, int offset) +{ + return readb(card->io_mem + offset); +} + +static inline void hfc_outb(struct hfc_card *card, int offset, u8 value) +{ + writeb(value, card->io_mem + offset); +} + +#endif Added: branches/1.0/package/dahdi-linux/hfcs-2.8/fifo.c =================================================================== --- branches/1.0/package/dahdi-linux/hfcs-2.8/fifo.c (rev 0) +++ branches/1.0/package/dahdi-linux/hfcs-2.8/fifo.c 2013-12-11 23:01:17 UTC (rev 6307) @@ -0,0 +1,380 @@ +/* + * fifo.c - HFC FIFO management routines + * + * Copyright (C) 2006 headissue GmbH; Jens Wilke + * Copyright (C) 2004 Daniele Orlandi + * Copyright (C) 2002, 2003, 2004, Junghanns.NET GmbH + * + * Original author of this code is + * Daniele "Vihai" Orlandi <da...@or...> + * + * This program is free software and may be modified and + * distributed under the terms of the GNU Public License. + * + */ + +#define DEBUG +#ifdef DEBUG +extern int debug_level; +#endif + +#include <linux/kernel.h> + +#include <dahdi/kernel.h> + +#include "fifo.h" + +static void hfc_fifo_mem_read(struct hfc_chan_simplex *chan, + int z_start, + void *data, int size) +{ + int bytes_to_boundary = chan->z_max - z_start + 1; + if (bytes_to_boundary >= size) { + memcpy(data, + chan->z_base + z_start, + size); + } else { + /* + * Buffer wrap + */ + memcpy(data, + chan->z_base + z_start, + bytes_to_boundary); + + memcpy(data + bytes_to_boundary, + chan->fifo_base, + size - bytes_to_boundary); + } +} + +static void hfc_fifo_mem_write(struct hfc_chan_simplex *chan, + void *data, int size) +{ + int bytes_to_boundary = chan->z_max - *Z1_F1(chan) + 1; + if (bytes_to_boundary >= size) { + memcpy(chan->z_base + *Z1_F1(chan), + data, + size); + } else { + /* + * FIFO wrap + */ + + memcpy(chan->z_base + *Z1_F1(chan), + data, + bytes_to_boundary); + + memcpy(chan->fifo_base, + data + bytes_to_boundary, + size - bytes_to_boundary); + } +} + +int hfc_fifo_get(struct hfc_chan_simplex *chan, + void *data, int size) +{ + int available_bytes; + + /* + * Some useless statistic + */ + chan->bytes += size; + + available_bytes = hfc_fifo_used_rx(chan); + + if (available_bytes < size && !chan->fifo_underrun++) { + /* + * print the warning only once + */ + printk(KERN_WARNING hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "RX FIFO not enough (%d) bytes to receive!\n", + chan->chan->card->cardnum, + chan->chan->name, + available_bytes); + return -1; + } + + hfc_fifo_mem_read(chan, *Z2_F2(chan), data, size); + *Z2_F2(chan) = Z_inc(chan, *Z2_F2(chan), size); + return available_bytes - size; +} + +void hfc_fifo_put(struct hfc_chan_simplex *chan, + void *data, int size) +{ + struct hfc_card *card = chan->chan->card; + int used_bytes = hfc_fifo_used_tx(chan); + int free_bytes = hfc_fifo_free_tx(chan); + + if (!used_bytes && !chan->fifo_underrun++) { + /* + * print warning only once, to make timing not worse + */ + printk(KERN_WARNING hfc_DRIVER_PREFIX + "card %d: " + "chan %s: " + "TX FIFO has become empty\n", + card->cardnum, + chan->chan->name); + } + if (free_bytes < size) { + printk(KERN_CRIT hfc_DRIVER_PREFIX + "card %d: " + "chan... [truncated message content] |