wanpipe-3.2.2.tgz
This commit is contained in:
parent
c04d3f94e9
commit
d814cbc161
|
@ -4,9 +4,65 @@ WANPIPE
|
|||
Linux Voice TDM/WAN Router Package
|
||||
------------------------------------------------------------------------------
|
||||
Author: Nenad Corbic <ncorbic@sangoma.com>
|
||||
Copyright (c) 1995-2007 Sangoma Technologies Inc.
|
||||
Copyright (c) 1995-2008 Sangoma Technologies Inc.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Thu Jan 18 2008 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.2
|
||||
========================================================================
|
||||
|
||||
- AFT Maxim Front end update
|
||||
Implemented graceful recovery on short circuit.
|
||||
|
||||
- AFT Driver update
|
||||
Added a check for TDM IRQ timeout.
|
||||
On some machines its possible for TDM IRQ to timeout.
|
||||
|
||||
- SMG updated
|
||||
Fixed wancfg_smg
|
||||
MTU not properly set on ports 2 and up
|
||||
Voice only ports were not being added to startup sequence
|
||||
Updated for callweaver
|
||||
|
||||
- Added Zaptel 1.4 HW HDLC Support
|
||||
No Sangoma zaptel patch needed with Zaptel 1.4
|
||||
|
||||
- Added HWEC Noise flag in wanpipe config file
|
||||
|
||||
- Updated SMG
|
||||
- Updated E1 Unframed on Maxim Cards
|
||||
|
||||
- Updates for AFT PMC and MAXIM framers
|
||||
PMC - lowered LOS sensitivity
|
||||
Fixes fake up/down state changes on
|
||||
started inactive lines.
|
||||
|
||||
MAXIM - lowered sensistivy
|
||||
Fixes cable cross talk on 8 port cards.
|
||||
- Enabled Unframed E1
|
||||
- Enabled Tri-State Mode
|
||||
- Fixed loopback commands
|
||||
|
||||
- Fixed HWEC_PERSIST_DISABLE
|
||||
This option was broken in previous release
|
||||
This option lets Asterisk control HWEC
|
||||
on each call start/stop.
|
||||
By default all hwec channels are enabled on
|
||||
device startup.
|
||||
|
||||
- Updated SMG/SS7
|
||||
- Updated loopback commands for AFT Maxim cards
|
||||
|
||||
- Updated for AstLinux
|
||||
The make file can now build all WAN and Voice Protocols
|
||||
|
||||
- Fixed add_timer warnings for ALL AFT cards
|
||||
Caused when a port is left in unconnected state.
|
||||
|
||||
- Updated legacy protocols for new front end architecture
|
||||
|
||||
- Updated Setup script
|
||||
|
||||
|
||||
* Wed Oct 6 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.1
|
||||
=====================================================================
|
||||
|
||||
|
|
34
Makefile
34
Makefile
|
@ -59,19 +59,25 @@ EXTRA_UTIL_FLAGS = -I$(PWD)/$(WINCLUDE) -I$(KDIR)/include/ -I$(INSTALLPREFIX)/in
|
|||
EXTRA_UTIL_FLAGS += -I$(PWD)/patches/kdrivers/wanec -I$(PWD)/patches/kdrivers/wanec/oct6100_api/include
|
||||
|
||||
ENABLE_WANPIPEMON_ZAP=NO
|
||||
ZAPHDLC_PRIV=/etc/wanpipe/.zaphdlc
|
||||
|
||||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
||||
#Check if zaptel exists
|
||||
ifneq (,$(wildcard $(ZAPDIR)/zaptel.h))
|
||||
ZAPDIR_PRIV=$(ZAPDIR)
|
||||
ENABLE_WANPIPEMON_ZAP=YES
|
||||
EXTRA_CFLGS+= -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE
|
||||
ZAP_OPTS= --zaptel-path=$(ZAPDIR)
|
||||
ZAP_PROT=TDM
|
||||
else
|
||||
ZAP_OPTS=
|
||||
ZAP_PROT=
|
||||
ZAPDIR_PRIV=
|
||||
ENABLE_WANPIPEMON_ZAP=NO
|
||||
endif
|
||||
|
||||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
||||
|
||||
# First pass, kernel Makefile reads module objects
|
||||
|
@ -83,11 +89,25 @@ else
|
|||
|
||||
#This will check for zaptel, kenrel source and build utilites and kernel modules
|
||||
#within local directory structure
|
||||
all: _checkzap _checksrc all_util all_kmod
|
||||
|
||||
#Build with all binaries
|
||||
all: _checkzap _checksrc all_bin_kmod all_util
|
||||
|
||||
#Build only source (NO WAN protocols)
|
||||
all_src: _checkzap _checksrc all_kmod all_util
|
||||
|
||||
|
||||
#Build only kernel modules
|
||||
all_kmod: _checkzap _checksrc _cleanoldwanpipe _check_kver
|
||||
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $(KDIR) SUBDIRS=$(WAN_DIR) EXTRA_FLAGS="$(EXTRA_CFLAGS) $(shell cat ./patches/kfeatures)" ZAPDIR=$(ZAPDIR_PRIV) HOMEDIR=$(PWD) modules
|
||||
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $(KDIR) SUBDIRS=$(WAN_DIR) EXTRA_FLAGS="$(EXTRA_CFLAGS) $(shell cat ./patches/kfeatures)" ZAPDIR=$(ZAPDIR_PRIV) ZAPHDLC=$(ZAPHDLC_PRIV) HOMEDIR=$(PWD) modules
|
||||
|
||||
all_bin_kmod: _checkzap _checksrc _cleanoldwanpipe _check_kver
|
||||
@if [ -e $(PWD)/ast_build_dir ]; then \
|
||||
rm -rf $(PWD)/ast_build_dir; \
|
||||
fi
|
||||
@mkdir -p $(PWD)/ast_build_dir
|
||||
./Setup drivers --builddir=$(PWD)/ast_build_dir --with-linux=$(KDIR) $(ZAP_OPTS) --usr-cc=$(CC) --protocol=DEF-$(ZAP_PROT) --no-zaptel-compile --noautostart --arch=$(ARCH) --silent
|
||||
@eval "./patches/copy_modules.sh $(PWD)/ast_build_dir $(WAN_DIR)"
|
||||
|
||||
|
||||
#Clean utilites and kernel modules
|
||||
|
@ -163,11 +183,13 @@ install_kmod:
|
|||
install -m 644 -D $(WAN_DIR)/sdladrv.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/sdladrv.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe.${MODTYPE}
|
||||
@rm -f $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe_syncppp.${MODTYPE}
|
||||
@if [ -f $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} ]; then \
|
||||
@if [ -e $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} ]; then \
|
||||
echo "install -m 644 -D $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe_syncppp.${MODTYPE}"; \
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe_syncppp.${MODTYPE}; \
|
||||
fi
|
||||
@rm -f $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE};
|
||||
@if [ -f $(WAN_DIR)/wanpipe_lip.${MODTYPE} ]; then \
|
||||
@if [ -e $(WAN_DIR)/wanpipe_lip.${MODTYPE} ]; then \
|
||||
echo "install -m 644 -D $(WAN_DIR)/wanpipe_lip.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE}"; \
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe_lip.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE}; \
|
||||
fi
|
||||
@eval "./patches/rundepmod.sh"
|
||||
|
|
|
@ -0,0 +1,225 @@
|
|||
#
|
||||
# Makefile WANPIPE WAN Router Installation/Removal Makefile
|
||||
#
|
||||
# Copyright (c) 2007, Sangoma Technologies Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version
|
||||
# 2 of the License, or (at your option) any later version.
|
||||
# ----------------------------------------------------------------------------
|
||||
# Author: Nenad Corbic <ncorbic@sangoma.com>
|
||||
#
|
||||
|
||||
PWD=$(shell pwd)
|
||||
KBUILD_VERBOSE=0
|
||||
|
||||
#Default zaptel directory to be overwritten by user
|
||||
ifndef ZAPDIR
|
||||
ZAPDIR=/usr/src/zaptel
|
||||
endif
|
||||
|
||||
#Kernel version and location
|
||||
ifndef KVER
|
||||
KVER=$(shell uname -r)
|
||||
endif
|
||||
ifndef KMOD
|
||||
KMOD=/lib/modules/$(KVER)
|
||||
endif
|
||||
ifndef KDIR
|
||||
KDIR=$(KMOD)/build
|
||||
endif
|
||||
ifndef KINSTDIR
|
||||
KINSTDIR=$(KMOD)/kernel
|
||||
endif
|
||||
|
||||
ifndef ARCH
|
||||
ARCH=$(shell uname -m)
|
||||
endif
|
||||
|
||||
INSTALLPREFIX=
|
||||
|
||||
#Local wanpipe includes
|
||||
WINCLUDE=patches/kdrivers/include
|
||||
HWECINC=patches/kdrivers/wanec/oct6100_api
|
||||
KMODDIR=patches/kdrivers
|
||||
|
||||
#Location of wanpipe source in release
|
||||
WAN_DIR=$(PWD)/$(KMODDIR)/src/net
|
||||
WANEC_DIR=$(PWD)/$(KMODDIR)/wanec
|
||||
MODTYPE=ko
|
||||
|
||||
#Setup include path and extra cflags
|
||||
EXTRA_CFLAGS := -I$(PWD)/$(WINCLUDE) -I$(PWD)/$(WINCLUDE)/annexg -I$(PWD)/patches/kdrivers/wanec -D__LINUX__
|
||||
EXTRA_CFLAGS += -I$(WANEC_DIR) -I$(WANEC_DIR)/oct6100_api -I$(WANEC_DIR)/oct6100_api/include
|
||||
EXTRA_CFLAGS += -I$(KDIR)/include/linux -I$(ZAPDIR)
|
||||
|
||||
#Setup utility extra flags and include path
|
||||
EXTRA_UTIL_FLAGS = -I$(PWD)/$(WINCLUDE) -I$(KDIR)/include/ -I$(INSTALLPREFIX)/include -I$(INSTALLPREFIX)/usr/include
|
||||
EXTRA_UTIL_FLAGS += -I$(PWD)/patches/kdrivers/wanec -I$(PWD)/patches/kdrivers/wanec/oct6100_api/include
|
||||
|
||||
ENABLE_WANPIPEMON_ZAP=NO
|
||||
|
||||
#Check if zaptel exists
|
||||
ifneq (,$(wildcard $(ZAPDIR)/zaptel.h))
|
||||
ZAPDIR_PRIV=$(ZAPDIR)
|
||||
ENABLE_WANPIPEMON_ZAP=YES
|
||||
EXTRA_CFLGS+= -DSTANDALONE_ZAPATA -DBUILDING_TONEZONE
|
||||
else
|
||||
ZAPDIR_PRIV=
|
||||
ENABLE_WANPIPEMON_ZAP=NO
|
||||
endif
|
||||
|
||||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
||||
|
||||
# First pass, kernel Makefile reads module objects
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
obj-m := sdladrv.o wanrouter.o wanpipe.o wanpipe_syncppp.o wanec.o
|
||||
|
||||
# Second pass, the actual build.
|
||||
else
|
||||
|
||||
#This will check for zaptel, kenrel source and build utilites and kernel modules
|
||||
#within local directory structure
|
||||
all: _checkzap _checksrc all_util all_kmod
|
||||
|
||||
#Build only kernel modules
|
||||
all_kmod: _checkzap _checksrc _cleanoldwanpipe _check_kver
|
||||
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $(KDIR) SUBDIRS=$(WAN_DIR) EXTRA_FLAGS="$(EXTRA_CFLAGS) $(shell cat ./patches/kfeatures)" ZAPDIR=$(ZAPDIR_PRIV) HOMEDIR=$(PWD) modules
|
||||
|
||||
|
||||
#Clean utilites and kernel modules
|
||||
clean: clean_util _cleanoldwanpipe
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(WAN_DIR) clean
|
||||
@find patches/kdrivers -name '.*.cmd' | xargs rm -f
|
||||
|
||||
|
||||
#Clean old wanpipe headers from linux include
|
||||
_cleanoldwanpipe: _checksrc
|
||||
@eval "./patches/build_links.sh"
|
||||
@eval "./patches/clean_old_wanpipe.sh $(WINCLUDE) $(KDIR)/include/linux"
|
||||
|
||||
|
||||
#Check for linux headers
|
||||
_checksrc:
|
||||
@if [ ! -e $(KDIR) ]; then \
|
||||
echo " Error linux headers/source not found: $(KDIR) !"; \
|
||||
echo ; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if [ ! -e $(KDIR)/.config ]; then \
|
||||
echo " Error linux headers/source not configured: missing $(KDIR)/.config !"; \
|
||||
echo ; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if [ ! -e $(KDIR)/include ]; then \
|
||||
echo " Error linux headers/source incomplete: missing $(KDIR)/include dir !"; \
|
||||
echo ; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
_check_kver:
|
||||
@eval "./patches/kern_i_private_check.sh $(KDIR)"
|
||||
@echo > ./patches/kfeatures;
|
||||
@if [ -e ./patches/i_private_found ]; then \
|
||||
echo "-DWANPIPE_USE_I_PRIVATE " >> ./patches/kfeatures; \
|
||||
fi
|
||||
|
||||
#Check for zaptel
|
||||
_checkzap:
|
||||
@echo
|
||||
@echo " +--------- Wanpipe Build Info --------------+"
|
||||
@echo
|
||||
@if [ ! -e $(ZAPDIR)/zaptel.h ]; then \
|
||||
echo " Compiling Wanpipe without ZAPTEL Support!"; \
|
||||
ZAPDIR_PRIV=; \
|
||||
ENABLE_WANPIPEMON_ZAP=NO; \
|
||||
else \
|
||||
echo " Compiling Wanpipe with ZAPTEL Support!"; \
|
||||
echo " Zaptel Dir: $(ZAPDIR)"; \
|
||||
echo; \
|
||||
eval "$(PWD)/patches/sangoma-zaptel-patch.sh $(ZAPDIR)"; \
|
||||
ZAPDIR_PRIV=$(ZAPDIR); \
|
||||
ENABLE_WANPIPEMON_ZAP=YES; \
|
||||
echo ; \
|
||||
echo "Please recompile and reinstall ZAPTEL after installation"; \
|
||||
fi
|
||||
@echo
|
||||
@echo " +-------------------------------------------+"
|
||||
@echo
|
||||
@sleep 2;
|
||||
|
||||
#Install all utilities etc and modules
|
||||
install: install_util install_etc install_kmod install_inc
|
||||
|
||||
#Install kernel modules only
|
||||
install_kmod:
|
||||
install -m 644 -D $(WAN_DIR)/wanrouter.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanrouter.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/af_wanpipe.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/af_wanpipe.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/wanec.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanec.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/wan_aften.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wan_aften.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/sdladrv.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/sdladrv.${MODTYPE}
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe.${MODTYPE}
|
||||
@rm -f $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe_syncppp.${MODTYPE}
|
||||
@if [ -f $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} ]; then \
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe_syncppp.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/wanpipe_syncppp.${MODTYPE}; \
|
||||
fi
|
||||
@rm -f $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE};
|
||||
@if [ -f $(WAN_DIR)/wanpipe_lip.${MODTYPE} ]; then \
|
||||
install -m 644 -D $(WAN_DIR)/wanpipe_lip.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE}; \
|
||||
fi
|
||||
@eval "./patches/rundepmod.sh"
|
||||
|
||||
endif
|
||||
|
||||
#Compile utilities only
|
||||
all_util:
|
||||
$(MAKE) -C util all EXTRA_FLAGS="$(EXTRA_UTIL_FLAGS)" SYSINC="$(PWD)/$(WINCLUDE) -I $(PWD)/api/libsangoma/include" CC=$(CC) \
|
||||
PREFIX=$(INSTALLPREFIX) HOSTCFLAGS="$(EXTRA_UTIL_FLAGS)" ARCH=$(ARCH)
|
||||
$(MAKE) -C util all_wancfg EXTRA_FLAGS="$(EXTRA_UTIL_FLAGS)" SYSINC="$(PWD)/$(WINCLUDE) -I$(PWD)/api/libsangoma/include" CC=$(CC) \
|
||||
PREFIX=$(INSTALLPREFIX) HOSTCFLAGS="$(EXTRA_UTIL_FLAGS)" HOSTCFLAGS="$(EXTRA_UTIL_FLAGS)" ARCH=$(ARCH)
|
||||
|
||||
#Clean utilities only
|
||||
clean_util:
|
||||
$(MAKE) -C util clean SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) PREFIX=$(INSTALLPREFIX)
|
||||
|
||||
#Install utilities only
|
||||
install_util:
|
||||
$(MAKE) -C util install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) PREFIX=$(INSTALLPREFIX)
|
||||
|
||||
#Install etc files
|
||||
install_etc:
|
||||
@if [ ! -e $(INSTALLPREFIX)/etc/wanpipe ]; then \
|
||||
mkdir -p $(INSTALLPREFIX)/etc/wanpipe; \
|
||||
fi
|
||||
@if [ ! -e $(INSTALLPREFIX)/etc/wanpipe/wanrouter.rc ]; then \
|
||||
install -D -m 644 samples/wanrouter.rc $(INSTALLPREFIX)/etc/wanpipe/wanrouter.rc; \
|
||||
fi
|
||||
@if [ ! -e $(INSTALLPREFIX)/etc/wanpipe/lib ]; then \
|
||||
mkdir -p $(INSTALLPREFIX)/etc/wanpipe/lib; \
|
||||
fi
|
||||
@\cp -f util/wancfg_legacy/lib/* $(INSTALLPREFIX)/etc/wanpipe/lib/
|
||||
@\cp -rf firmware $(INSTALLPREFIX)/etc/wanpipe/
|
||||
@if [ ! -f $(INSTALLPREFIX)/etc/wanpipe/interfaces ]; then \
|
||||
mkdir -p $(INSTALLPREFIX)/etc/wanpipe/interfaces; \
|
||||
fi
|
||||
@\cp -rf samples $(INSTALLPREFIX)/etc/wanpipe
|
||||
@if [ ! -d $(INSTALLPREFIX)/etc/wanpipe/scripts ]; then \
|
||||
mkdir -p $(INSTALLPREFIX)/etc/wanpipe/scripts; \
|
||||
fi
|
||||
@\cp -rf wan_ec $(INSTALLPREFIX)/etc/wanpipe/
|
||||
@install -D -m 755 samples/wanrouter $(INSTALLPREFIX)/usr/sbin/wanrouter
|
||||
@echo
|
||||
@echo "Wanpipe etc installed in $(INSTALLPREFIX)/etc/wanpipe";
|
||||
@echo
|
||||
|
||||
install_inc:
|
||||
@if [ -e $(INSTALLPREFIX)/usr/include/wanpipe ]; then \
|
||||
\rm -rf $(INSTALLPREFIX)/usr/include/wanpipe; \
|
||||
fi
|
||||
@\mkdir -p $(INSTALLPREFIX)/usr/include/wanpipe
|
||||
@\cp -f $(PWD)/patches/kdrivers/include/*.h $(INSTALLPREFIX)/usr/include/wanpipe/
|
||||
@\cp -rf $(PWD)/patches/kdrivers/wanec/oct6100_api/include/ $(INSTALLPREFIX)/usr/include/wanpipe/oct6100_api
|
||||
@\cp -rf $(PWD)/patches/kdrivers/wanec/*.h $(INSTALLPREFIX)/usr/include/wanpipe/
|
233
Setup
233
Setup
|
@ -9,6 +9,7 @@
|
|||
# as published by the Free Software Foundation; either version
|
||||
# 2 of the License, or (at your option) any later version.
|
||||
# ----------------------------------------------------------------------------
|
||||
# Oct 26, 2007 Konrad Hammel Updated minor start script bug
|
||||
# Nov 27, 2005 David Rokhvarg Added Echo Debugging option
|
||||
# Mar 18, 2002 Nenad Corbic Added BSCSTRM protocol
|
||||
# Mar 01, 2002 Nenad Corbic Added option to split rpm build into
|
||||
|
@ -268,7 +269,7 @@ banner()
|
|||
clearscr
|
||||
echo -e "\t----------------------------------------------------------"
|
||||
echo -e "\t WANPIPE v$PROD_VER Installation Script"
|
||||
echo -e "\t Copyright (c) 1995-2007, Sangoma Technologies Inc."
|
||||
echo -e "\t Copyright (c) 1995-2008, Sangoma Technologies Inc."
|
||||
echo -e "\t----------------------------------------------------------"
|
||||
echo ""
|
||||
return 0
|
||||
|
@ -538,8 +539,6 @@ prepare()
|
|||
missing_packages=$missing_packages"libtermcap-devel "
|
||||
fi
|
||||
|
||||
echo -n "Checking for yacc..."
|
||||
|
||||
echo -n "Checking for yacc..."
|
||||
eval "type yacc 2> /dev/null > /dev/null"
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -1456,7 +1455,7 @@ create_mataconf()
|
|||
fi
|
||||
|
||||
|
||||
if [ -f /etc/wanpipe/wanrouter.rc ]; then
|
||||
if [ -f $ROOT/etc/wanpipe/wanrouter.rc ]; then
|
||||
. /etc/wanpipe/wanrouter.rc
|
||||
fi
|
||||
|
||||
|
@ -1570,12 +1569,65 @@ ENDOFTEXT
|
|||
# ----------------------------------------------------------------------------
|
||||
# Install initialization scripts.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
install_init()
|
||||
{
|
||||
if [ "$PKG_NAME" = "wanpipe-lite" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ $NO_AUTO_START -eq 1 ]; then
|
||||
return 0;
|
||||
fi
|
||||
banner
|
||||
cat << ENDOFTEXT
|
||||
|
||||
WANPIPE BOOTSTRAP CONFIGURATION
|
||||
|
||||
Your system uses System V -style initialization scripts. You have an option
|
||||
to add router start-up script to those scripts so that the router will start
|
||||
automatically when system enters multi-user mode and shut down when it enters
|
||||
single-user mode or when it is halted.
|
||||
|
||||
i.e. By selecting this option WANPIPE will startup on system bootup and
|
||||
stop on system shutdown.
|
||||
|
||||
ENDOFTEXT
|
||||
|
||||
getyn "Would you like to install WANPIPE start-up scripts?" || return 0
|
||||
|
||||
cd $PROD_HOME/util/wancfg_zaptel
|
||||
eval "./wancfg_zaptel.pl --silent --install_boot_script"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to install boot scripts"
|
||||
fi
|
||||
|
||||
if [ "$TDM_PROT" = "YES" ]; then
|
||||
getyn "Would you like to auto-execute ztcfg after wanrouter start?" || return 0
|
||||
if [ ! -d $WAN_CONF_DIR/scripts ]; then
|
||||
eval "\mkdir -p $WAN_CONF_DIR/scripts >/dev/null 2>/dev/null"
|
||||
fi
|
||||
eval "\cp -f $PROD_HOME/samples/wanpipe_zaptel_start $WAN_CONF_DIR/scripts/start > /dev/null 2> /dev/null"
|
||||
if [ ! -f $WAN_CONF_DIR/scripts/start ]; then
|
||||
echo "Error: Could not copy auto-ztcfg script"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $PROD_HOME
|
||||
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Old Install initialization scripts.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
install_init_old()
|
||||
{
|
||||
if [ "$PKG_NAME" = "wanpipe-lite" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ $NO_AUTO_START -eq 1 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
@ -1922,8 +1974,15 @@ WARNING: The Linux source in $SOURCEDIR has not been configured.
|
|||
|
||||
cd $PROD_HOME/api
|
||||
|
||||
if [ $superuser = "YES" ] && [ -z $ROOT ]; then
|
||||
eval "find /usr/local/lib -name 'libsangoma*' > /dev/null 2>/dev/null"
|
||||
if [ $? -eq 0 ]; then
|
||||
eval "find /usr/local/lib -name 'libsangoma*' | xargs rm > /dev/null 2>/dev/null"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd libsangoma
|
||||
eval "./configure --prefix=$ROOT/usr/include >> $CMP_LOG 2>> $CMP_LOG"
|
||||
eval "./configure --prefix=$ROOT/usr >> $CMP_LOG 2>> $CMP_LOG"
|
||||
eval "make clean >> $CMP_LOG 2>> $CMP_LOG"
|
||||
eval "make CC=$CC SYSINC=$SOURCEDIR/include >> $CMP_LOG 2>> $CMP_LOG"
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -1934,31 +1993,8 @@ WARNING: The Linux source in $SOURCEDIR has not been configured.
|
|||
fi
|
||||
eval "make install >> $CMP_LOG 2>> $CMP_LOG"
|
||||
|
||||
|
||||
if [ $superuser = "YES" ]; then
|
||||
if [ -d /etc/ld.so.conf.d ]; then
|
||||
if [ ! -e $ROOT/etc/ld.so.conf.d/ ]; then
|
||||
\mkdir -p $ROOT/etc/ld.so.conf.d/
|
||||
fi
|
||||
\cp -f libsangoma.so.conf $ROOT/etc/ld.so.conf.d/
|
||||
|
||||
if [ $superuser = "YES" ]; then
|
||||
eval "ldconfig"
|
||||
fi
|
||||
elif [ -f /etc/ld.so.conf ]; then
|
||||
if [ $superuser = "YES" ]; then
|
||||
cat /etc/ld.so.conf libsangoma.so.conf > ldconf.$$
|
||||
mv ldconf.$$ /etc/ld.so.conf
|
||||
eval "ldconfig"
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "Warning: LD Conf files not found in /etc directory"
|
||||
echo "Please add /usr/local/lib to the LD_LIBRARY_PATH"
|
||||
echo
|
||||
eval "ldconfig"
|
||||
pause
|
||||
fi
|
||||
if [ $superuser = "YES" ] && [ -z $ROOT ]; then
|
||||
eval "ldconfig > /dev/null 2> /dev/null"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
@ -2240,12 +2276,12 @@ function build_kernel_module()
|
|||
local_link=$local_link" $file.o "
|
||||
done
|
||||
|
||||
echo "make MODULE_NAME=$modname OBJS=\"$ofiles\" CC=$CC KDIR=$SOURCEDIR \
|
||||
echo "make MODULE_NAME=$modname OBJS=\"$ofiles\" SUBDIRS=$PWD CC=$CC KDIR=$SOURCEDIR \
|
||||
EXTRA_CFLAGS=\"-D__LINUX__ $PROTOCOL_DEFINES $extra_flags \"" >> $CMP_BUILD
|
||||
|
||||
chmod 755 $CMP_BUILD
|
||||
|
||||
make MODULE_NAME=$modname OBJS="$ofiles" CC=$CC KBUILD_VERBOSE=$KBUILD_VERBOSE KDIR=$SOURCEDIR \
|
||||
make MODULE_NAME=$modname OBJS="$ofiles" CC=$CC SUBDIRS=$PWD KBUILD_VERBOSE=$KBUILD_VERBOSE KDIR=$SOURCEDIR \
|
||||
EXTRA_CFLAGS="-D__LINUX__ $PROTOCOL_DEFINES $extra_flags " >> $CMP_LOG 2>> $CMP_LOG
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -2345,7 +2381,7 @@ function build_wanec_module ()
|
|||
local files="wanec_iface wanec_cmd wanec_utils wanec_dev $BTDIR/octapi_bt0 $LARGMATHDIR/octapi_largmath $LLMANDIR/octapi_llman $OCTAPIMIDIR/oct6100_mask_interrupts $OCTAPIDIR/oct6100_adpcm_chan $OCTAPIDIR/oct6100_channel $OCTAPIDIR/oct6100_chip_open $OCTAPIDIR/oct6100_chip_stats $OCTAPIDIR/oct6100_conf_bridge $OCTAPIDIR/oct6100_debug $OCTAPIDIR/oct6100_events $OCTAPIDIR/oct6100_interrupts $OCTAPIDIR/oct6100_memory $OCTAPIDIR/oct6100_miscellaneous $OCTAPIDIR/oct6100_mixer $OCTAPIDIR/oct6100_phasing_tsst $OCTAPIDIR/oct6100_playout_buf $OCTAPIDIR/oct6100_remote_debug $OCTAPIDIR/oct6100_tlv $OCTAPIDIR/oct6100_tone_detection $OCTAPIDIR/oct6100_tsi_cnct $OCTAPIDIR/oct6100_tsst $OCTAPIDIR/oct6100_user "
|
||||
|
||||
|
||||
eval "make clean > /dev/null 2> /dev/null"
|
||||
eval "make SUBDIRS=$PWD clean >> $CMP_BUILD 2>> $CMP_BUILD"
|
||||
|
||||
if [ $KERN_VER -eq 24 ]; then
|
||||
if [ -e wanectmp ]; then
|
||||
|
@ -2496,10 +2532,10 @@ function select_compilation_mode()
|
|||
|
||||
3. TDM Voice (Zaptel) + WAN Protocol Support
|
||||
|
||||
4. SMG (SS7) (Default for Asterisk SMG/SS7 install)
|
||||
4. SMG (SS7) (Default for Asterisk/CallWeaver SMG/SS7 install)
|
||||
|
||||
5. SMG (SS7) + TDM Voice (Zaptel)
|
||||
Default for: Asterisk SS7 + PRI
|
||||
Default for: Asterisk/CallWeaver SS7 + PRI
|
||||
|
||||
6. TDM API
|
||||
Protocols: TDM API on AFT adapters:
|
||||
|
@ -3197,6 +3233,13 @@ ENDOFTEXT
|
|||
#Find out our processor type. This is needed to properly
|
||||
#compile our modules.
|
||||
echo -n "Checking current processor type ..."
|
||||
if [ -e $SOURCEDIR/include/linux/autoconf.h ]; then
|
||||
grep "CONFIG_ARCH \"" $SOURCEDIR/include/linux/autoconf.h > /dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
ARCH=`grep "CONFIG_ARCH \"" $SOURCEDIR/include/linux/autoconf.h | cut -d '"' -f2`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $ARCH ]; then
|
||||
ARCH=`uname -m`
|
||||
fi
|
||||
|
@ -4371,94 +4414,49 @@ function install_ssmg ()
|
|||
|
||||
echo "Installing Sangoma Media Gateway Daemon..."
|
||||
cd lib/libteletone/
|
||||
eval "./configure; make clean; make; make install " > /dev/null
|
||||
eval "./configure --prefix=$ROOT/usr; make clean; make CC=$CC; make install " > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "FAILED"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $superuser = "YES" ]; then
|
||||
eval "ldconfig"
|
||||
|
||||
cd $PROD_HOME/$SSMG_DIR
|
||||
|
||||
# Let smg install script install SMG components
|
||||
#=======================================================
|
||||
|
||||
# cd sangoma_mgd.trunk
|
||||
#
|
||||
# eval "make clean > /dev/null; make > /dev/null "
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "FAILED"
|
||||
# return 1
|
||||
# fi
|
||||
# eval "make install > /dev/null "
|
||||
#
|
||||
# echo "Installing Sangoma Media Gateway Daemon...DONE"
|
||||
|
||||
# eval "type asterisk > /dev/null 2> /dev/null"
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: Asterisk not installed!"
|
||||
# echo "Please install Asterisk first then retry SSMG installation!"
|
||||
# return 1
|
||||
# fi
|
||||
|
||||
# echo
|
||||
# echo "Installing Chan Woomera into Asterisk..."
|
||||
# echo
|
||||
# install_chan_woomera
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "Error: Failed to install chan_woomera into Asterisk!"
|
||||
# echo "Check that Asterisk is installed or Call Sangoma Tech Support"
|
||||
# echo
|
||||
# return 1
|
||||
# fi
|
||||
#=========================================================
|
||||
fi
|
||||
|
||||
cd $PROD_HOME/$SSMG_DIR
|
||||
cd sangoma_mgd.trunk
|
||||
|
||||
if [ ! -f /etc/asterisk/woomera.conf ]; then
|
||||
cp woomera.conf /etc/asterisk
|
||||
fi
|
||||
|
||||
echo "Installing Chan Woomera into Asterisk...DONE"
|
||||
echo
|
||||
|
||||
if [ ! -f /usr/sbin/smgss7_ctrl ]; then
|
||||
cp smgss7_ctrl /usr/sbin/
|
||||
fi
|
||||
|
||||
getyn "Add Woomera config in Asterisk Extensions and Iax Conf"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -f /etc/asterisk/extensions.conf ]; then
|
||||
eval "grep -i woomera /etc/asterisk/extensions.conf 2> /dev/null > /dev/null"
|
||||
if [ -f $ROOT/etc/asterisk/extensions.conf ]; then
|
||||
eval "grep -i woomera $ROOT/etc/asterisk/extensions.conf 2> /dev/null > /dev/null"
|
||||
if [ $? -ne 0 ]; then
|
||||
cat /etc/asterisk/extensions.conf ./conf/woomera_ext.conf > conf.$$
|
||||
mv conf.$$ /etc/asterisk/extensions.conf
|
||||
cat $ROOT/etc/asterisk/extensions.conf ./conf/woomera_ext.conf > conf.$$
|
||||
mv conf.$$ $ROOT/etc/asterisk/extensions.conf
|
||||
echo "Asterisk extensions.conf file updated with woomera config"
|
||||
else
|
||||
echo "Asterisk extensions.conf already updated"
|
||||
|
||||
fi
|
||||
else
|
||||
echo "Warning: Asterisk extensions.conf file not found!"
|
||||
fi
|
||||
|
||||
if [ -f /etc/asterisk/iax.conf ]; then
|
||||
eval "grep -i ss7 /etc/asterisk/iax.conf 2> /dev/null > /dev/null"
|
||||
if [ -f $ROOT/etc/asterisk/iax.conf ]; then
|
||||
eval "grep -i ss7 $ROOT/etc/asterisk/iax.conf 2> /dev/null > /dev/null"
|
||||
if [ $? -ne 0 ]; then
|
||||
cat /etc/asterisk/iax.conf ./conf/woomera_iax.conf > conf.$$
|
||||
mv conf.$$ /etc/asterisk/iax.conf
|
||||
cat $ROOT/etc/asterisk/iax.conf ./conf/woomera_iax.conf > conf.$$
|
||||
mv conf.$$ $ROOT/etc/asterisk/iax.conf
|
||||
echo "Asterisk iax.conf file updated with ss7 guest config"
|
||||
else
|
||||
echo "Asterisk iax.conf already updated"
|
||||
fi
|
||||
else
|
||||
echo "Warning: Asterisk extensions.conf file not found!"
|
||||
fi
|
||||
|
||||
|
||||
pause
|
||||
|
||||
return 0
|
||||
|
@ -4512,6 +4510,7 @@ function install_all ()
|
|||
echo "Installing sample api code in $ROOT/etc/wanpipe/api"
|
||||
\cp -rf api $ROOT/etc/wanpipe
|
||||
\cp -rf samples $ROOT/etc/wanpipe
|
||||
\cp -rf util/wanec_apilib /etc/wanpipe/api
|
||||
|
||||
|
||||
if [ ! -d $ROOT/etc/wanpipe/scripts ]; then
|
||||
|
@ -5374,8 +5373,13 @@ function find_zap_dirs ()
|
|||
echo
|
||||
echo "Looking for zaptel directory in /usr/src ..."
|
||||
echo "-------------------------------------------"
|
||||
|
||||
if [ "$zapdirs" = "" ]; then
|
||||
zapdirs=`find /usr/src -maxdepth 2 -name 'zaptel*' | xargs `
|
||||
if [ -d "/usr/src/zaptel" ]; then
|
||||
zapdirs="/usr/src/zaptel "$zapdirs
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
unset zapdir_array;
|
||||
|
@ -5383,7 +5387,6 @@ function find_zap_dirs ()
|
|||
if [ -f $PROD_HOME/zaptel/zaptel.path ]; then
|
||||
zapextradir=`cat $PROD_HOME/zaptel/zaptel.path`
|
||||
fi
|
||||
|
||||
cnt=1
|
||||
for dir in $zapdirs
|
||||
do
|
||||
|
@ -5395,12 +5398,17 @@ function find_zap_dirs ()
|
|||
continue;
|
||||
fi
|
||||
|
||||
if [ "$dir" = "/usr/src/zaptel" ] && [ $cnt -ne 1 ]; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
zapdir_array[$cnt]=$dir;
|
||||
echo "$cnt : $dir "
|
||||
|
||||
cnt=$((cnt+1))
|
||||
done
|
||||
|
||||
|
||||
if [ $cnt -eq 1 ]; then
|
||||
echo
|
||||
echo "No zaptel dirs found in /usr/src "
|
||||
|
@ -5432,7 +5440,8 @@ function find_zap_dirs ()
|
|||
# echo "d2: Download Latest 1.2"
|
||||
# echo "d4: Download Latest 1.4"
|
||||
echo "(ctrl-c to Exit)"
|
||||
echo -n "Please select working zaptel directory [1-9][m]: "
|
||||
echo -n "Please select working zaptel directory [1-$((cnt-1))][m]: "
|
||||
|
||||
|
||||
response=1
|
||||
|
||||
|
@ -5859,13 +5868,28 @@ ENDOFTEXT
|
|||
fi
|
||||
|
||||
|
||||
#Check for new zaptel hw hdlc option
|
||||
if [ -f $ZAPTEL_INSTALL_DIR/zaptel-base.c ]; then
|
||||
eval "grep hdlc_hard_xmit $ZAPTEL_INSTALL_DIR/zaptel-base.c > /dev/null 2> /dev/null"
|
||||
if [ $? -eq 0 ] ; then
|
||||
echo "Native Zaptel HW HDLC Support Detected - No patch required"
|
||||
echo "Zaptel source unmodified"
|
||||
|
||||
TDM_DCHAN="(DCHAN)"
|
||||
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL "
|
||||
fi
|
||||
fi
|
||||
|
||||
#Check if dchan patch is already enabled
|
||||
if [ "$TDM_DCHAN" = "" ]; then
|
||||
eval "grep ZT_DCHAN_TX_V2 $ZAPTEL_INSTALL_DIR/* 2> /dev/null > /dev/null"
|
||||
if [ $? -eq 0 ]; then
|
||||
TDM_DCHAN="(DCHAN)"
|
||||
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN"
|
||||
echo "Sangoma DCHAN Patch detected in zaptel"
|
||||
zaptel_modified=1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$TDM_DCHAN" = "" ]; then
|
||||
echo
|
||||
|
@ -5881,9 +5905,11 @@ ENDOFTEXT
|
|||
TDM_DCHAN="(DCHAN)"
|
||||
echo " Zaptel DCHAN Patch successful"
|
||||
echo
|
||||
zaptel_modified=1
|
||||
elif [ $result -eq 1 ]; then
|
||||
TDM_DCHAN="(DCHAN)"
|
||||
echo
|
||||
zaptel_modified=1
|
||||
else
|
||||
echo "Zaptel Update Failed!"
|
||||
echo
|
||||
|
@ -5959,7 +5985,6 @@ ENDOFTEXT
|
|||
fi
|
||||
|
||||
TDM_PROT=YES
|
||||
zaptel_modified=1;
|
||||
if [ $zaptel_modified ] && [ $zaptel_modified -eq 1 ] && [ "$ZAPTEL_COMPILE_DISABLE" = "NO" ]; then
|
||||
echo
|
||||
getyn "Recompile/reinstall Zaptel (recommended) ?"
|
||||
|
@ -6296,11 +6321,11 @@ KERNEL_UNAME=`uname -r`
|
|||
PKG_NAME=wanpipe
|
||||
DISTR_NAME="WANPIPE"
|
||||
PROD=wanrouter
|
||||
PROD_VER=3.2.1
|
||||
PROD_VER=3.2.2
|
||||
PROD_HOME=`pwd`
|
||||
META_CONF=$PROD_HOME/$PROD.rc
|
||||
WAN_CONF_DIR=/etc/wanpipe
|
||||
META_CONF=$WAN_CONF_DIR/$PROD.rc
|
||||
WAN_INTR_DIR=$PROD_HOME/interfaces
|
||||
WAN_CONF_DIR=$PROD_HOME
|
||||
PROD_CONF=$WAN_CONF_DIR/wanpipe1.conf
|
||||
PROD_PATCH=$PROD_HOME/patches
|
||||
PROD_INIT=/usr/sbin/
|
||||
|
@ -6919,15 +6944,17 @@ you know what you are doing :)
|
|||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
$PROD_HOME/Setup install --silent --builddir=$PROD_HOME/$build_dir --with-linux=$SOURCEDIR --arch=$ARCH --protocol=$PROTS --ss7_user_id=$SS7_USER_ID --noautostart --no-zaptel-compile --zaptel-path=$ZAPTEL_INSTALL_DIR
|
||||
if [ $TDM_PROT = "YES" ]; then
|
||||
$PROD_HOME/Setup install --silent --builddir=$PROD_HOME/$build_dir --with-linux=$SOURCEDIR --arch=$ARCH --protocol=$PROTS --ss7_user_id=$SS7_USER_ID --noautostart --no-zaptel-compile --zaptel-path=$ZAPTEL_INSTALL_DIR --usr-cc=$CC
|
||||
else
|
||||
$PROD_HOME/Setup install --silent --builddir=$PROD_HOME/$build_dir --with-linux=$SOURCEDIR --arch=$ARCH --protocol=$PROTS --ss7_user_id=$SS7_USER_ID --noautostart --usr-cc=$CC
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: WANPIPE Installation Failed!"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
if [ "$setup_cmd" = "buildrpm" ]; then
|
||||
compile_aft_firmware_util
|
||||
detect_rpm_build_utility
|
||||
|
|
|
@ -26,6 +26,6 @@ clean:
|
|||
make -C fr clean
|
||||
make -C bitstrm clean
|
||||
make -C bisync clean
|
||||
make -C tdm_api clean
|
||||
make -C tdmapi clean
|
||||
make -C lib/hdlc clean
|
||||
# make -C ss7 clean
|
||||
|
|
|
@ -16,7 +16,7 @@ SYSINC=/usr/src/linux/include
|
|||
endif
|
||||
VPATH = $(SYSINC)
|
||||
|
||||
DIR_EC_APILIB=/common/wantools/wanec_apilib
|
||||
DIR_EC_APILIB=../wanec_apilib
|
||||
SRC_EC_APILIB=$(DIR_EC_APILIB)/wanec_api.c $(DIR_EC_APILIB)/wanec_api_lib.c
|
||||
INC_EC_APILIB=-I/usr/include/wanpipe/oct6100_api -I$(DIR_EC_APILIB)
|
||||
|
||||
|
@ -26,6 +26,8 @@ CFLAGS += -I/usr/include/wanpipe
|
|||
|
||||
TARGETS=aft_api
|
||||
TARGETS+= aft_api_events
|
||||
TARGETS+= aft_integrity
|
||||
TARGETS+= aft_echo
|
||||
#TARGETS+= aft_api_ss7
|
||||
#TARGETS+= aft_api_check
|
||||
#TARGETS+= aft_tdm_api
|
||||
|
@ -50,5 +52,11 @@ aft_tdm_api: aft_tdm_api.c ../lib/lib_api.c
|
|||
aft_api_ss7: aft_api_ss7.c ../lib/lib_api.c
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
aft_integrity: aft_integrity.c ../lib/lib_api.c
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
aft_echo: aft_echo.c ../lib/lib_api.c
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(TARGETS)
|
||||
|
|
Binary file not shown.
|
@ -90,8 +90,8 @@ int MakeConnection(void)
|
|||
|
||||
printf("\nConnecting to card %s, interface %s prot %x\n", card_name, if_name,htons(PVC_PROT));
|
||||
|
||||
strcpy( sa.sll_device, if_name);
|
||||
strcpy( sa.sll_card, card_name);
|
||||
strcpy( (char*)sa.sll_device, if_name);
|
||||
strcpy( (char*)sa.sll_card, card_name);
|
||||
sa.sll_protocol = htons(PVC_PROT);
|
||||
sa.sll_family=AF_WANPIPE;
|
||||
|
||||
|
@ -543,7 +543,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -85,8 +85,8 @@ int MakeConnection(void)
|
|||
|
||||
printf("\nConnecting to card %s, interface %s prot %x\n", card_name, if_name,htons(PVC_PROT));
|
||||
|
||||
strcpy( sa.sll_device, if_name);
|
||||
strcpy( sa.sll_card, card_name);
|
||||
strcpy( (char*)sa.sll_device, if_name);
|
||||
strcpy( (char*)sa.sll_card, card_name);
|
||||
sa.sll_protocol = htons(PVC_PROT);
|
||||
sa.sll_family=AF_WANPIPE;
|
||||
|
||||
|
@ -234,6 +234,7 @@ tone_try_again:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int ringdetect_event_ctrl(u_int8_t mode, int channel, int tone)
|
||||
{
|
||||
api_tx_hdr_t api_tx_hdr;
|
||||
|
@ -258,6 +259,7 @@ ringdetect_try_again:
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int event_decode(api_rx_hdr_t *rx_hdr)
|
||||
{
|
||||
|
@ -727,7 +729,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,316 @@
|
|||
/*****************************************************************************
|
||||
* chdlc_api.c CHDLC API: Receive Module
|
||||
*
|
||||
* Author(s): Gideon Hack & Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright: (c) 1995-2001 Sangoma Technologies Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
* Description:
|
||||
*
|
||||
* The chdlc_api.c utility will bind to a socket to a chdlc network
|
||||
* interface, and continously tx and rx packets to an from the sockets.
|
||||
*
|
||||
* This example has been written for a single interface in mind,
|
||||
* where the same process handles tx and rx data.
|
||||
*
|
||||
* A real world example, should use different processes to handle
|
||||
* tx and rx spearately.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_wanpipe.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/wanpipe.h>
|
||||
#include <linux/sdla_aft_te1.h>
|
||||
#include "lib_api.h"
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define LGTH_CRC_BYTES 0
|
||||
#define MAX_TX_DATA 5000 /* Size of tx data */
|
||||
#define MAX_RX_DATA MAX_TX_DATA
|
||||
|
||||
|
||||
#define SOCK_TIMEOUT 1
|
||||
|
||||
|
||||
/*===================================================
|
||||
* Golobal data
|
||||
*==================================================*/
|
||||
|
||||
unsigned char HDLC_streaming = FALSE;
|
||||
unsigned short Rx_lgth;
|
||||
|
||||
unsigned char Rx_data[MAX_RX_DATA];
|
||||
unsigned char Tx_data[MAX_TX_DATA];
|
||||
int sock;
|
||||
|
||||
|
||||
/*===================================================
|
||||
* Function Prototypes
|
||||
*==================================================*/
|
||||
int MakeConnection(void);
|
||||
void handle_socket( void);
|
||||
|
||||
|
||||
|
||||
|
||||
/*===================================================
|
||||
* MakeConnection
|
||||
*
|
||||
* o Create a Socket
|
||||
* o Bind a socket to a wanpipe network interface
|
||||
* (Interface name is supplied by the user)
|
||||
*==================================================*/
|
||||
|
||||
int MakeConnection(void)
|
||||
{
|
||||
struct wan_sockaddr_ll sa;
|
||||
|
||||
memset(&sa,0,sizeof(struct wan_sockaddr_ll));
|
||||
errno = 0;
|
||||
sock = socket(AF_WANPIPE, SOCK_RAW, 0);
|
||||
if( sock < 0 ) {
|
||||
perror("Socket");
|
||||
return(FALSE);
|
||||
} /* if */
|
||||
|
||||
printf("\nConnecting to router %s, interface %s\n", card_name, if_name);
|
||||
|
||||
strcpy( (char*)sa.sll_device, if_name);
|
||||
strcpy( (char*)sa.sll_card, card_name);
|
||||
sa.sll_protocol = htons(PVC_PROT);
|
||||
sa.sll_family=AF_WANPIPE;
|
||||
|
||||
if(bind(sock, (struct sockaddr *)&sa, sizeof(struct wan_sockaddr_ll)) < 0){
|
||||
perror("bind");
|
||||
printf("Failed to bind a socket to %s interface\n",if_name);
|
||||
exit(0);
|
||||
}
|
||||
printf("Socket bound to %s\n\n",if_name);
|
||||
|
||||
return(TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================
|
||||
* handle_socket
|
||||
*
|
||||
* o Tx/Rx data to and from the socket
|
||||
* o Cast received data to an api_rx_element_t data type
|
||||
* o The received packet contains 16 bytes header
|
||||
*
|
||||
* ------------------------------------------
|
||||
* | 16 bytes | X bytes ...
|
||||
* ------------------------------------------
|
||||
* Header Data
|
||||
*
|
||||
* RX DATA:
|
||||
* --------
|
||||
* Each rx data packet contains the 16 byte header!
|
||||
*
|
||||
* o Rx 16 byte data structure:
|
||||
*
|
||||
* typedef struct {
|
||||
* unsigned char error_flag PACKED;
|
||||
* unsigned short time_stamp PACKED;
|
||||
* unsigned char reserved[13] PACKED;
|
||||
* } api_rx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* api_rx_hdr_t api_rx_hdr PACKED;
|
||||
* void * data PACKED;
|
||||
* } api_rx_element_t;
|
||||
*
|
||||
* error_flag:
|
||||
* bit 0: incoming frame was aborted
|
||||
* bit 1: incoming frame has a CRC error
|
||||
* bit 2: incoming frame has an overrun eror
|
||||
*
|
||||
* time_stamp:
|
||||
* absolute time value in ms.
|
||||
*
|
||||
* TX_DATA:
|
||||
* --------
|
||||
* Each tx data packet MUST contain a 16 byte header!
|
||||
*
|
||||
* o Tx 16 byte data structure
|
||||
*
|
||||
* typedef struct {
|
||||
* unsigned char attr PACKED;
|
||||
* unsigned char reserved[15] PACKED;
|
||||
* } api_tx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* api_tx_hdr_t api_tx_hdr PACKED;
|
||||
* void * data PACKED;
|
||||
* } api_tx_element_t;
|
||||
*
|
||||
* Currently the chdlc device driver doesn't use any of
|
||||
* the above fields. Thus, the user can set the 16 bytes
|
||||
* to ZERO.
|
||||
*
|
||||
*/
|
||||
|
||||
void handle_socket(void)
|
||||
{
|
||||
unsigned int Rx_count,Tx_count,Tx_length;
|
||||
api_tx_element_t * api_tx_el;
|
||||
fd_set ready,write,oob;
|
||||
int err;
|
||||
struct timeval tv;
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = SOCK_TIMEOUT;
|
||||
|
||||
|
||||
Rx_count = 0;
|
||||
Tx_count = 0;
|
||||
Tx_length = tx_size;
|
||||
|
||||
printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i RxCnt=%i\n",
|
||||
read_enable,write_enable,tx_cnt,tx_size,tx_delay,rx_cnt);
|
||||
|
||||
/* If running HDLC_STREAMING then the received CRC bytes
|
||||
* will be passed to the application as part of the
|
||||
* received data.
|
||||
*/
|
||||
|
||||
api_tx_el = (api_tx_element_t*)&Tx_data[0];
|
||||
memset(&Tx_data[0],0,MAX_TX_DATA);
|
||||
|
||||
while (1) {
|
||||
err = ioctl(sock,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Interface %s state is %s (%d)\n",
|
||||
if_name,
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING",err);
|
||||
|
||||
if (err < 0) {
|
||||
printf("Error interface down %s sock disconnected! (%s)\n",
|
||||
if_name,strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
if (err > 0) {
|
||||
printf("Waiting for interface %s to come up!\n",if_name);
|
||||
sleep(10);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
FD_ZERO(&ready);
|
||||
FD_ZERO(&write);
|
||||
FD_ZERO(&oob);
|
||||
FD_SET(sock,&oob);
|
||||
FD_SET(sock,&ready);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = SOCK_TIMEOUT;
|
||||
|
||||
if (write_enable){
|
||||
FD_SET(sock,&write);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
err= select(sock + 1,&ready, NULL, &oob, NULL);
|
||||
|
||||
if (err < 0) {
|
||||
printf("Error: inteface down: %s socket disconnected %s\n",
|
||||
if_name,strerror(errno));
|
||||
break;
|
||||
|
||||
} else if (err == 0) {
|
||||
/* Timeout do something */
|
||||
|
||||
} else {
|
||||
|
||||
if (FD_ISSET(sock,&oob)){
|
||||
|
||||
err = recv(sock, Rx_data, MAX_RX_DATA, MSG_OOB);
|
||||
|
||||
if(err < 0 ) {
|
||||
printf("Failed to receive OOB %i , %i\n", Rx_count, err);
|
||||
err = ioctl(sock,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Sock state is %s\n",
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Got OOB exception: Link Down !\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (FD_ISSET(sock,&ready)){
|
||||
|
||||
err = recv(sock, Rx_data, MAX_RX_DATA, 0);
|
||||
|
||||
/* err indicates bytes received */
|
||||
if (err > 0){
|
||||
Rx_count++;
|
||||
err = send(sock, Rx_data, err, 0);
|
||||
Tx_count++;
|
||||
printf("Rx Len=%i Rx=%i Tx=%i : Echo Ok\r",
|
||||
err-sizeof(api_rx_hdr_t), Tx_count,Rx_count);
|
||||
} else {
|
||||
printf("\nError receiving data\n");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close (sock);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Main:
|
||||
*
|
||||
* o Make a socket connection to the driver.
|
||||
* o Call handle_socket() to read/write the socket
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int proceed;
|
||||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
proceed = MakeConnection();
|
||||
if(proceed == WAN_TRUE){
|
||||
handle_socket();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
};
|
Binary file not shown.
|
@ -0,0 +1,421 @@
|
|||
/*****************************************************************************
|
||||
* chdlc_api.c CHDLC API: Receive Module
|
||||
*
|
||||
* Author(s): Gideon Hack & Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright: (c) 1995-2001 Sangoma Technologies Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
* Description:
|
||||
*
|
||||
* The chdlc_api.c utility will bind to a socket to a chdlc network
|
||||
* interface, and continously tx and rx packets to an from the sockets.
|
||||
*
|
||||
* This example has been written for a single interface in mind,
|
||||
* where the same process handles tx and rx data.
|
||||
*
|
||||
* A real world example, should use different processes to handle
|
||||
* tx and rx spearately.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_wanpipe.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/wanpipe.h>
|
||||
#include <linux/sdla_aft_te1.h>
|
||||
#include "lib_api.h"
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define LGTH_CRC_BYTES 0
|
||||
#define MAX_TX_DATA 5000 /* Size of tx data */
|
||||
#define MAX_RX_DATA MAX_TX_DATA
|
||||
|
||||
|
||||
#define SOCK_TIMEOUT 1
|
||||
|
||||
|
||||
/*===================================================
|
||||
* Golobal data
|
||||
*==================================================*/
|
||||
|
||||
unsigned char HDLC_streaming = FALSE;
|
||||
unsigned short Rx_lgth;
|
||||
|
||||
unsigned char Rx_data[MAX_RX_DATA];
|
||||
unsigned char Tx_data[MAX_TX_DATA];
|
||||
int sock;
|
||||
|
||||
|
||||
/*===================================================
|
||||
* Function Prototypes
|
||||
*==================================================*/
|
||||
int MakeConnection(void);
|
||||
void handle_socket( void);
|
||||
|
||||
static unsigned char test_data[]={0x00,0x5A, 0xAA, 0xA5, 0xFF};
|
||||
static unsigned char tx_index=0;
|
||||
|
||||
|
||||
|
||||
/*===================================================
|
||||
* MakeConnection
|
||||
*
|
||||
* o Create a Socket
|
||||
* o Bind a socket to a wanpipe network interface
|
||||
* (Interface name is supplied by the user)
|
||||
*==================================================*/
|
||||
|
||||
int MakeConnection(void)
|
||||
{
|
||||
struct wan_sockaddr_ll sa;
|
||||
|
||||
memset(&sa,0,sizeof(struct wan_sockaddr_ll));
|
||||
errno = 0;
|
||||
sock = socket(AF_WANPIPE, SOCK_RAW, 0);
|
||||
if( sock < 0 ) {
|
||||
perror("Socket");
|
||||
return(FALSE);
|
||||
} /* if */
|
||||
|
||||
printf("\nConnecting to router %s, interface %s\n", card_name, if_name);
|
||||
|
||||
strcpy( (char*)sa.sll_device, if_name);
|
||||
strcpy( (char*)sa.sll_card, card_name);
|
||||
sa.sll_protocol = htons(PVC_PROT);
|
||||
sa.sll_family=AF_WANPIPE;
|
||||
|
||||
if(bind(sock, (struct sockaddr *)&sa, sizeof(struct wan_sockaddr_ll)) < 0){
|
||||
perror("bind");
|
||||
printf("Failed to bind a socket to %s interface\n",if_name);
|
||||
exit(0);
|
||||
}
|
||||
printf("Socket bound to %s\n\n",if_name);
|
||||
|
||||
return(TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void init_tx_pattern(void)
|
||||
{
|
||||
api_tx_element_t * api_tx_el;
|
||||
unsigned char *data;
|
||||
int i;
|
||||
|
||||
memset(&Tx_data[0],0,MAX_TX_DATA);
|
||||
|
||||
/* Initialize the tx packet. The 16 byte header must
|
||||
* be inserted before tx data. In CHDLC protocol,
|
||||
* the tx x25 header is not used, thus it can be
|
||||
* set to zero */
|
||||
api_tx_el = (api_tx_element_t*)&Tx_data[0];
|
||||
data = (unsigned char *)api_tx_el->data;
|
||||
|
||||
for (i=0;i<tx_size;i++){
|
||||
data[i] = test_data[tx_index];
|
||||
|
||||
tx_index++;
|
||||
if (tx_index >= sizeof(test_data)){
|
||||
tx_index=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================
|
||||
* handle_socket
|
||||
*
|
||||
* o Tx/Rx data to and from the socket
|
||||
* o Cast received data to an api_rx_element_t data type
|
||||
* o The received packet contains 16 bytes header
|
||||
*
|
||||
* ------------------------------------------
|
||||
* | 16 bytes | X bytes ...
|
||||
* ------------------------------------------
|
||||
* Header Data
|
||||
*
|
||||
* RX DATA:
|
||||
* --------
|
||||
* Each rx data packet contains the 16 byte header!
|
||||
*
|
||||
* o Rx 16 byte data structure:
|
||||
*
|
||||
* typedef struct {
|
||||
* unsigned char error_flag PACKED;
|
||||
* unsigned short time_stamp PACKED;
|
||||
* unsigned char reserved[13] PACKED;
|
||||
* } api_rx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* api_rx_hdr_t api_rx_hdr PACKED;
|
||||
* void * data PACKED;
|
||||
* } api_rx_element_t;
|
||||
*
|
||||
* error_flag:
|
||||
* bit 0: incoming frame was aborted
|
||||
* bit 1: incoming frame has a CRC error
|
||||
* bit 2: incoming frame has an overrun eror
|
||||
*
|
||||
* time_stamp:
|
||||
* absolute time value in ms.
|
||||
*
|
||||
* TX_DATA:
|
||||
* --------
|
||||
* Each tx data packet MUST contain a 16 byte header!
|
||||
*
|
||||
* o Tx 16 byte data structure
|
||||
*
|
||||
* typedef struct {
|
||||
* unsigned char attr PACKED;
|
||||
* unsigned char reserved[15] PACKED;
|
||||
* } api_tx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* api_tx_hdr_t api_tx_hdr PACKED;
|
||||
* void * data PACKED;
|
||||
* } api_tx_element_t;
|
||||
*
|
||||
* Currently the chdlc device driver doesn't use any of
|
||||
* the above fields. Thus, the user can set the 16 bytes
|
||||
* to ZERO.
|
||||
*
|
||||
*/
|
||||
|
||||
void handle_socket(void)
|
||||
{
|
||||
unsigned int Rx_count,Tx_count,Tx_length;
|
||||
api_rx_element_t* api_rx_el;
|
||||
api_tx_element_t * api_tx_el;
|
||||
fd_set ready,write,oob;
|
||||
int err,i;
|
||||
int no_CRC_bytes_Rx = LGTH_CRC_BYTES;
|
||||
struct timeval tv;
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = SOCK_TIMEOUT;
|
||||
|
||||
|
||||
Rx_count = 0;
|
||||
Tx_count = 0;
|
||||
Tx_length = tx_size;
|
||||
|
||||
printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i RxCnt=%i\n",
|
||||
read_enable,write_enable,tx_cnt,tx_size,tx_delay,rx_cnt);
|
||||
|
||||
/* If running HDLC_STREAMING then the received CRC bytes
|
||||
* will be passed to the application as part of the
|
||||
* received data.
|
||||
*/
|
||||
|
||||
api_tx_el = (api_tx_element_t*)&Tx_data[0];
|
||||
memset(&Tx_data[0],0,MAX_TX_DATA);
|
||||
|
||||
init_tx_pattern();
|
||||
|
||||
while (1) {
|
||||
err = ioctl(sock,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Interface %s state is %s (%d)\n",
|
||||
if_name,
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING",err);
|
||||
|
||||
if (err < 0) {
|
||||
printf("Error interface down %s sock disconnected! (%s)\n",
|
||||
if_name,strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
if (err > 0) {
|
||||
printf("Waiting for interface %s to come up!\n",if_name);
|
||||
sleep(10);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
FD_ZERO(&ready);
|
||||
FD_ZERO(&write);
|
||||
FD_ZERO(&oob);
|
||||
FD_SET(sock,&oob);
|
||||
FD_SET(sock,&ready);
|
||||
|
||||
tv.tv_usec = 0;
|
||||
tv.tv_sec = SOCK_TIMEOUT;
|
||||
|
||||
if (write_enable){
|
||||
FD_SET(sock,&write);
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
err= select(sock + 1,&ready, &write, &oob, &tv);
|
||||
|
||||
if (err < 0) {
|
||||
printf("Error: inteface down: %s socket disconnected %s\n",
|
||||
if_name,strerror(errno));
|
||||
break;
|
||||
|
||||
} else if (err == 0) {
|
||||
/* Timeout do someting if you like */
|
||||
|
||||
} else {
|
||||
|
||||
if (FD_ISSET(sock,&oob)){
|
||||
|
||||
err = recv(sock, Rx_data, MAX_RX_DATA, MSG_OOB);
|
||||
|
||||
if(err < 0 ) {
|
||||
printf("Failed to receive OOB %i , %i\n", Rx_count, err);
|
||||
err = ioctl(sock,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Sock state is %s\n",
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Got OOB exception: Link Down !\n");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (FD_ISSET(sock,&ready)){
|
||||
|
||||
err = recv(sock, Rx_data, MAX_RX_DATA, 0);
|
||||
|
||||
/* err indicates bytes received */
|
||||
if (err > 0){
|
||||
|
||||
api_rx_el = (api_rx_element_t*)&Rx_data[0];
|
||||
|
||||
/* Check the packet length */
|
||||
Rx_lgth = err - sizeof(api_rx_hdr_t)-no_CRC_bytes_Rx;
|
||||
if(Rx_lgth<=0) {
|
||||
printf("\nShort frame received (%d)\n",
|
||||
Rx_lgth);
|
||||
Rx_count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
++Rx_count;
|
||||
|
||||
if (Rx_lgth != Tx_length){
|
||||
printf("Rx Error cnt %i: Rx length %i not equal to %i\n",
|
||||
Rx_count,Rx_lgth,Tx_length);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0;i<Rx_lgth;i++){
|
||||
if (((unsigned char*)api_rx_el->data)[i] !=
|
||||
((unsigned char*)api_tx_el->data)[i]){
|
||||
printf("Rx Error cnt=%i: Packet corruption on offset %i\n",
|
||||
Rx_count,i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
printf("Tx Len=%i Tx=%i Rx=%i : Data Ok\r",
|
||||
Tx_length, Tx_count,Rx_count);
|
||||
}
|
||||
|
||||
if (Rx_count == tx_cnt){
|
||||
init_tx_pattern();
|
||||
Rx_count=0;
|
||||
write_enable=1;
|
||||
}
|
||||
|
||||
} else {
|
||||
printf("\nError receiving data\n");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (FD_ISSET(sock,&write)){
|
||||
|
||||
err = send(sock,Tx_data, Tx_length + sizeof(api_tx_hdr_t), 0);
|
||||
|
||||
if (err <= 0){
|
||||
if (errno == EBUSY){
|
||||
/* Socket busy try sending again !*/
|
||||
}else{
|
||||
/* Check socket state */
|
||||
err = ioctl(sock,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Sock state is %s\n",
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING");
|
||||
|
||||
printf("Failed to send %i \n",errno);
|
||||
perror("Send: ");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
++Tx_count;
|
||||
if (verbose && Rx_count < 1) {
|
||||
printf("Tx Len=%i Tx=%i Rx=%i : Data Ok\r",
|
||||
Tx_length, Tx_count,Rx_count);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (tx_delay){
|
||||
sleep(tx_delay);
|
||||
}
|
||||
|
||||
if (tx_size && Tx_count == tx_cnt){
|
||||
write_enable=0;
|
||||
Tx_count=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close (sock);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Main:
|
||||
*
|
||||
* o Make a socket connection to the driver.
|
||||
* o Call handle_socket() to read/write the socket
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int proceed;
|
||||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
proceed = MakeConnection();
|
||||
if(proceed == WAN_TRUE){
|
||||
handle_socket();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
};
|
Binary file not shown.
Binary file not shown.
|
@ -50,18 +50,18 @@ int tx_data=-1;
|
|||
int tx_ss7_type=0;
|
||||
int rx_ss7_timer=0;
|
||||
|
||||
unsigned char card_name[WAN_IFNAME_SZ];
|
||||
unsigned char if_name[WAN_IFNAME_SZ];
|
||||
char card_name[WAN_IFNAME_SZ];
|
||||
char if_name[WAN_IFNAME_SZ];
|
||||
|
||||
unsigned char sw_if_name[WAN_IFNAME_SZ];
|
||||
unsigned char sw_card_name[WAN_IFNAME_SZ];
|
||||
char sw_if_name[WAN_IFNAME_SZ];
|
||||
char sw_card_name[WAN_IFNAME_SZ];
|
||||
|
||||
unsigned char tx_file[WAN_IFNAME_SZ];
|
||||
unsigned char rx_file[WAN_IFNAME_SZ];
|
||||
char tx_file[WAN_IFNAME_SZ];
|
||||
char rx_file[WAN_IFNAME_SZ];
|
||||
|
||||
unsigned char daddr[TX_ADDR_STR_SZ];
|
||||
unsigned char saddr[TX_ADDR_STR_SZ];
|
||||
unsigned char udata[TX_ADDR_STR_SZ];
|
||||
char daddr[TX_ADDR_STR_SZ];
|
||||
char saddr[TX_ADDR_STR_SZ];
|
||||
char udata[TX_ADDR_STR_SZ];
|
||||
|
||||
int files_used=0;
|
||||
int verbose=0;
|
||||
|
|
|
@ -38,14 +38,14 @@ extern int cause;
|
|||
extern int card_cnt;
|
||||
extern int i_cnt;
|
||||
|
||||
extern unsigned char tx_file[WAN_IFNAME_SZ];
|
||||
extern unsigned char rx_file[WAN_IFNAME_SZ];
|
||||
extern char tx_file[WAN_IFNAME_SZ];
|
||||
extern char rx_file[WAN_IFNAME_SZ];
|
||||
|
||||
#define TX_ADDR_STR_SZ 100
|
||||
|
||||
extern unsigned char daddr[TX_ADDR_STR_SZ];
|
||||
extern unsigned char saddr[TX_ADDR_STR_SZ];
|
||||
extern unsigned char udata[TX_ADDR_STR_SZ];
|
||||
extern char daddr[TX_ADDR_STR_SZ];
|
||||
extern char saddr[TX_ADDR_STR_SZ];
|
||||
extern char udata[TX_ADDR_STR_SZ];
|
||||
|
||||
|
||||
#define TX_FILE_USED 1
|
||||
|
@ -58,8 +58,8 @@ extern int init_args(int argc, char *argv[]);
|
|||
extern void usage(unsigned char *api_name);
|
||||
extern void u_delay(int usec);
|
||||
|
||||
extern unsigned char card_name[WAN_IFNAME_SZ];
|
||||
extern unsigned char if_name[WAN_IFNAME_SZ];
|
||||
extern char card_name[WAN_IFNAME_SZ];
|
||||
extern char if_name[WAN_IFNAME_SZ];
|
||||
|
||||
extern unsigned char sw_if_name[WAN_IFNAME_SZ];
|
||||
extern unsigned char sw_card_name[WAN_IFNAME_SZ];
|
||||
extern char sw_if_name[WAN_IFNAME_SZ];
|
||||
extern char sw_card_name[WAN_IFNAME_SZ];
|
||||
|
|
|
@ -25,21 +25,21 @@ libsangoma_la-libsangoma.lo libsangoma_la-libsangoma.o: libsangoma.c \
|
|||
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/limits.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \
|
||||
/usr/include/bits/sockaddr.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/socket.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/sockios.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/socket.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/sockios.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/ioctls.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/ioctl.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/ioctl.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/ioctls.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/ioctl.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/ioctl.h \
|
||||
/usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \
|
||||
/usr/include/sys/signal.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/sigcontext.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/compiler.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/sigcontext.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/compiler.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/sys/ucontext.h \
|
||||
/usr/include/bits/sigthread.h /usr/include/sys/wait.h \
|
||||
/usr/include/sys/resource.h /usr/include/bits/resource.h \
|
||||
|
@ -47,25 +47,25 @@ libsangoma_la-libsangoma.lo libsangoma_la-libsangoma.o: libsangoma.c \
|
|||
/usr/include/bits/byteswap.h /usr/include/string.h \
|
||||
/usr/include/bits/string.h /usr/include/bits/string2.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/errno.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/errno.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/errno.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/errno-base.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/errno.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/errno.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/errno.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/errno-base.h \
|
||||
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/stat.h \
|
||||
/usr/include/bits/stat.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/if.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/types.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/posix_types.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/stddef.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/posix_types.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/types.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/socket.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/hdlc/ioctl.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/if.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/types.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/posix_types.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/stddef.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/posix_types.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/types.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/socket.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/hdlc/ioctl.h \
|
||||
/usr/include/poll.h /usr/include/sys/poll.h /usr/include/bits/poll.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_defines.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_version.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_kernel.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/version.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/version.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_cfg.h \
|
||||
../../patches/kdrivers/include/linux/sdla_56k.h \
|
||||
../../patches/kdrivers/include/linux/sdla_te1.h \
|
||||
|
@ -81,7 +81,7 @@ libsangoma_la-libsangoma.lo libsangoma_la-libsangoma.o: libsangoma.c \
|
|||
../../patches/kdrivers/include/linux/wanpipe_tdm_api.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_includes.h \
|
||||
../../patches/kdrivers/include/linux/if_wanpipe.h \
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/sockios.h \
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/sockios.h \
|
||||
../../patches/kdrivers/include/linux/wanpipe_codec_iface.h
|
||||
|
||||
libsangoma.h:
|
||||
|
@ -184,7 +184,7 @@ libsangoma.h:
|
|||
|
||||
/usr/include/bits/local_lim.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/limits.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/limits.h:
|
||||
|
||||
/usr/include/bits/posix2_lim.h:
|
||||
|
||||
|
@ -192,19 +192,19 @@ libsangoma.h:
|
|||
|
||||
/usr/include/bits/sockaddr.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/socket.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/socket.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/sockios.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/sockios.h:
|
||||
|
||||
/usr/include/sys/ioctl.h:
|
||||
|
||||
/usr/include/bits/ioctls.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/ioctls.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/ioctls.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/ioctl.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/ioctl.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/ioctl.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/ioctl.h:
|
||||
|
||||
/usr/include/bits/ioctl-types.h:
|
||||
|
||||
|
@ -222,9 +222,9 @@ libsangoma.h:
|
|||
|
||||
/usr/include/bits/sigcontext.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/sigcontext.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/sigcontext.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/compiler.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/compiler.h:
|
||||
|
||||
/usr/include/bits/sigstack.h:
|
||||
|
||||
|
@ -256,13 +256,13 @@ libsangoma.h:
|
|||
|
||||
/usr/include/bits/errno.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/errno.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/errno.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/errno.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/errno.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/errno.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/errno.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm-generic/errno-base.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm-generic/errno-base.h:
|
||||
|
||||
/usr/include/fcntl.h:
|
||||
|
||||
|
@ -272,21 +272,21 @@ libsangoma.h:
|
|||
|
||||
/usr/include/bits/stat.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/if.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/if.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/types.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/types.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/posix_types.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/posix_types.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/stddef.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/stddef.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/posix_types.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/posix_types.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/asm/types.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/asm/types.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/socket.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/socket.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/hdlc/ioctl.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/hdlc/ioctl.h:
|
||||
|
||||
/usr/include/poll.h:
|
||||
|
||||
|
@ -300,7 +300,7 @@ libsangoma.h:
|
|||
|
||||
../../patches/kdrivers/include/linux/wanpipe_kernel.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/version.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/version.h:
|
||||
|
||||
../../patches/kdrivers/include/linux/wanpipe_cfg.h:
|
||||
|
||||
|
@ -332,6 +332,6 @@ libsangoma.h:
|
|||
|
||||
../../patches/kdrivers/include/linux/if_wanpipe.h:
|
||||
|
||||
/lib/modules/2.6.18-8.el5/build/include/linux/sockios.h:
|
||||
/lib/modules/2.6.18-8.1.15.el5/build/include/linux/sockios.h:
|
||||
|
||||
../../patches/kdrivers/include/linux/wanpipe_codec_iface.h:
|
||||
|
|
|
@ -205,7 +205,7 @@ localstatedir = ${prefix}/var
|
|||
mandir = ${prefix}/man
|
||||
mkdir_p = mkdir -p --
|
||||
oldincludedir = /usr/include
|
||||
prefix = /usr/include
|
||||
prefix = /usr
|
||||
program_transform_name = s,x,x,
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
|
|
|
@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake.
|
|||
It was created by libsangoma configure 1.0.0, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
$ ./configure --prefix=/usr/include
|
||||
$ ./configure --prefix=/usr
|
||||
|
||||
## --------- ##
|
||||
## Platform. ##
|
||||
|
@ -12,9 +12,9 @@ generated by GNU Autoconf 2.59. Invocation command line was
|
|||
|
||||
hostname = tesla
|
||||
uname -m = i686
|
||||
uname -r = 2.6.18-8.el5
|
||||
uname -r = 2.6.18-8.1.15.el5
|
||||
uname -s = Linux
|
||||
uname -v = #1 SMP Thu Mar 15 19:57:35 EDT 2007
|
||||
uname -v = #1 SMP Mon Oct 22 08:32:04 EDT 2007
|
||||
|
||||
/usr/bin/uname -p = unknown
|
||||
/bin/uname -X = unknown
|
||||
|
@ -38,6 +38,7 @@ PATH: /usr/sbin
|
|||
PATH: /usr/bin
|
||||
PATH: /usr/sbin/scripts
|
||||
PATH: /root/bin
|
||||
PATH: /usr/sbin/scripts
|
||||
PATH: /bin
|
||||
PATH: /sbin
|
||||
PATH: /usr/bin
|
||||
|
@ -1031,7 +1032,7 @@ localstatedir='${prefix}/var'
|
|||
mandir='${prefix}/man'
|
||||
mkdir_p='mkdir -p --'
|
||||
oldincludedir='/usr/include'
|
||||
prefix='/usr/include'
|
||||
prefix='/usr'
|
||||
program_transform_name='s,x,x,'
|
||||
sbindir='${exec_prefix}/sbin'
|
||||
sharedstatedir='${prefix}/com'
|
||||
|
|
|
@ -298,7 +298,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
|||
ac_cs_version="\
|
||||
libsangoma config.status 1.0.0
|
||||
configured by ./configure, generated by GNU Autoconf 2.59,
|
||||
with options \"'--prefix=/usr/include'\"
|
||||
with options \"'--prefix=/usr'\"
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
This config.status script is free software; the Free Software Foundation
|
||||
|
@ -377,8 +377,8 @@ if $ac_cs_silent; then
|
|||
fi
|
||||
|
||||
if $ac_cs_recheck; then
|
||||
echo "running /bin/sh ./configure " '--prefix=/usr/include' $ac_configure_extra_args " --no-create --no-recursion" >&6
|
||||
exec /bin/sh ./configure '--prefix=/usr/include' $ac_configure_extra_args --no-create --no-recursion
|
||||
echo "running /bin/sh ./configure " '--prefix=/usr' $ac_configure_extra_args " --no-create --no-recursion" >&6
|
||||
exec /bin/sh ./configure '--prefix=/usr' $ac_configure_extra_args --no-create --no-recursion
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -452,7 +452,7 @@ s,@PACKAGE_VERSION@,1.0.0,;t t
|
|||
s,@PACKAGE_STRING@,libsangoma 1.0.0,;t t
|
||||
s,@PACKAGE_BUGREPORT@,anthmct@yahoo.com,;t t
|
||||
s,@exec_prefix@,${prefix},;t t
|
||||
s,@prefix@,/usr/include,;t t
|
||||
s,@prefix@,/usr,;t t
|
||||
s,@program_transform_name@,s,x,x,,;t t
|
||||
s,@bindir@,${exec_prefix}/bin,;t t
|
||||
s,@sbindir@,${exec_prefix}/sbin,;t t
|
||||
|
|
|
@ -24,14 +24,23 @@
|
|||
|
||||
|
||||
#ifndef WP_TDM_EVENT_FE_ALARM
|
||||
#warning "Warning: TDM FE ALARM not supported by driver"
|
||||
#warning "Note: TDM FE ALARM not supported by driver"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef WP_TDMAPI_EVENT_DTMF
|
||||
#warning "Warning: TDM EVENTS not supported by driver"
|
||||
#warning "Note: TDM DTMF EVENTS not supported by driver"
|
||||
#endif
|
||||
|
||||
#ifndef WP_TDMAPI_EVENT_RING
|
||||
#warning "Note: TDM RING EVENTS not supported by driver"
|
||||
#endif
|
||||
|
||||
#ifndef WP_TDMAPI_EVENT_RXHOOK
|
||||
#warning "Note: TDM RXHOOK EVENTS not supported by driver"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(WIN32)
|
||||
|
@ -912,6 +921,11 @@ int sangoma_tdm_disable_rm_dtmf_events(sng_fd_t fd, wanpipe_tdm_api_t *tdm_api)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WP_TDMAPI_EVENT_RXHOOK
|
||||
|
||||
int sangoma_tdm_enable_rxhook_events(sng_fd_t fd, wanpipe_tdm_api_t *tdm_api)
|
||||
{
|
||||
int err;
|
||||
|
@ -944,6 +958,10 @@ int sangoma_tdm_disable_rxhook_events(sng_fd_t fd, wanpipe_tdm_api_t *tdm_api)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef WP_TDMAPI_EVENT_RING
|
||||
|
||||
int sangoma_tdm_enable_ring_events(sng_fd_t fd, wanpipe_tdm_api_t *tdm_api) {
|
||||
|
||||
int err;
|
||||
|
|
|
@ -22,9 +22,9 @@ CFLAGS = -Wall -O2 -D$(OS_TYPE) -D_DEBUG_=$(DEBUG) -D_GNUC_ -I../lib/hdlc -I../l
|
|||
TARGETS = aft_tdm_voice_api
|
||||
TARGETS += aft_tdm_hdlc_test
|
||||
TARGETS += aft_tdm_voice_api_rbs
|
||||
TARGETS += aft_tdm_voice_api_dtmf
|
||||
TARGETS += aft_tdm_voice_api_rm_dtmf
|
||||
TARGETS += aft_tdm_voice_api_rxhook
|
||||
#TARGETS += aft_tdm_voice_api_dtmf
|
||||
#TARGETS += aft_tdm_voice_api_rm_dtmf
|
||||
#TARGETS += aft_tdm_voice_api_rxhook
|
||||
|
||||
####### RULES ################################################################
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -414,7 +414,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,254 +0,0 @@
|
|||
/*****************************************************************************
|
||||
* aft_api.c AFT T1/E1: HDLC API Sample Code
|
||||
*
|
||||
* Author(s): Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright: (c) 2003-2004 Sangoma Technologies Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_wanpipe.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/wanpipe_defines.h>
|
||||
#include <linux/wanpipe_cfg.h>
|
||||
#include <linux/wanpipe.h>
|
||||
#include <libsangoma.h>
|
||||
#include "lib_api.h"
|
||||
|
||||
#define MAX_TX_DATA 5000 /* Size of tx data */
|
||||
#define MAX_FRAMES 5000 /* Number of frames to transmit */
|
||||
|
||||
#define MAX_RX_DATA 5000
|
||||
|
||||
unsigned short Rx_lgth;
|
||||
|
||||
unsigned char Rx_data[MAX_RX_DATA];
|
||||
unsigned char Tx_data[MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t)];
|
||||
|
||||
/* Prototypes */
|
||||
int MakeConnection(void);
|
||||
void handle_span_chan( void);
|
||||
void sig_end(int sigid);
|
||||
|
||||
int dev_fd;
|
||||
FILE *tx_fd=NULL,*rx_fd=NULL;
|
||||
wanpipe_tdm_api_t tdm_api;
|
||||
|
||||
|
||||
/***************************************************
|
||||
* HANDLE SOCKET
|
||||
*
|
||||
* o Read a socket
|
||||
* o Cast data received to api_rx_element_t data type
|
||||
* o The received packet contains 16 bytes header
|
||||
*
|
||||
* ------------------------------------------
|
||||
* | 16 bytes | X bytes ...
|
||||
* ------------------------------------------
|
||||
* Header Data
|
||||
*
|
||||
* o Data structures:
|
||||
* ------------------
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _event_type;
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_event;
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_rx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_rx_hdr_u;
|
||||
* #define wp_api_event_type wp_rx_hdr_u.wp_event._event_type
|
||||
* #define wp_api_event_rbs_rx_bits wp_rx_hdr_u.wp_event._rbs_rx_bits
|
||||
* #define wp_api_event_time_stamp wp_rx_hdr_u.wp_event._time_stamp
|
||||
* } wp_tdm_api_rx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_rx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_rx_element_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_tx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_tx_hdr_u;
|
||||
* #define wp_api_time_stamp wp_tx_hdr_u.wp_tx._time_stamp
|
||||
* } wp_tdm_api_tx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_tx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_tx_element_t;
|
||||
*
|
||||
* #define WPTDM_A_BIT 0x08
|
||||
* #define WPTDM_B_BIT 0x04
|
||||
* #define WPTDM_C_BIT 0x02
|
||||
* #define WPTDM_D_BIT 0x01
|
||||
*
|
||||
*/
|
||||
|
||||
void handle_span_chan(void)
|
||||
{
|
||||
unsigned int Rx_count,Tx_count,Tx_length;
|
||||
int err;
|
||||
|
||||
#if 0
|
||||
int rlen;
|
||||
int stream_sync=0;
|
||||
#endif
|
||||
|
||||
Rx_count = 0;
|
||||
Tx_count = 0;
|
||||
|
||||
if (tdm_api.wp_tdm_cmd.hdlc) {
|
||||
Tx_length = tx_size;
|
||||
} else {
|
||||
Tx_length = tdm_api.wp_tdm_cmd.usr_mtu_mru;
|
||||
}
|
||||
|
||||
printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i\n",
|
||||
read_enable,write_enable,tx_cnt,tx_size,tx_delay);
|
||||
|
||||
sangoma_tdm_enable_dtmf_events(dev_fd, &tdm_api);
|
||||
|
||||
/* Main Rx Tx OOB routine */
|
||||
for(;;) {
|
||||
|
||||
err = sangoma_socket_waitfor(dev_fd, 1000, POLLPRI);
|
||||
printf("ret:%d\n", err);
|
||||
if (err){
|
||||
err=sangoma_tdm_read_event(dev_fd,&tdm_api);
|
||||
if(err < 0 ) {
|
||||
printf("Failed to receive EVENT %d\n", err);
|
||||
break;
|
||||
}
|
||||
|
||||
printf("GOT OOB EXCEPTION CMD Exiting\n");
|
||||
}
|
||||
|
||||
if (++Rx_count >= rx_cnt){
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sangoma_tdm_disable_dtmf_events(dev_fd, &tdm_api);
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
close (dev_fd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int dtmf_event (int fd, unsigned char digit, unsigned char type, unsigned char port)
|
||||
{
|
||||
printf("%d: DTMV Event: %c (%s:%s)!\n",
|
||||
fd,
|
||||
digit,
|
||||
(port == WAN_EC_CHANNEL_PORT_ROUT)?"ROUT":"SOUT",
|
||||
(type == WAN_EC_TONE_PRESENT)?"PRESET":"STOP");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************
|
||||
* Main:
|
||||
*
|
||||
* o Make a socket connection to the driver.
|
||||
* o Call handle_span_chan() to read the socket
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int proceed;
|
||||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
signal(SIGINT,&sig_end);
|
||||
memset(&tdm_api,0,sizeof(tdm_api));
|
||||
tdm_api.wp_tdm_event.wp_dtmf_event = &dtmf_event;
|
||||
|
||||
printf("TDM DTMF PTR = %p\n",tdm_api.wp_tdm_event.wp_dtmf_event);
|
||||
|
||||
dev_fd =-1;
|
||||
|
||||
dev_fd = sangoma_open_tdmapi_span_chan(atoi(card_name),atoi(if_name));
|
||||
if( dev_fd < 0){
|
||||
printf("Failed to open span chan(%s:%d,%s:%d)\n",
|
||||
card_name,atoi(card_name),if_name,atoi(if_name));
|
||||
exit (1);
|
||||
}
|
||||
printf("HANDLING SPAN %i CHAN %i FD=%i\n",
|
||||
atoi(card_name),atoi(if_name),dev_fd);
|
||||
|
||||
sangoma_tdm_set_codec(dev_fd,&tdm_api,WP_NONE);
|
||||
sangoma_get_full_cfg(dev_fd, &tdm_api);
|
||||
|
||||
handle_span_chan();
|
||||
close(dev_fd);
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
void sig_end(int sigid)
|
||||
{
|
||||
|
||||
printf("Got Signal %i\n",sigid);
|
||||
|
||||
sangoma_tdm_disable_dtmf_events(dev_fd, &tdm_api);
|
||||
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
|
||||
if (dev_fd){
|
||||
close (dev_fd);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
|
@ -449,7 +449,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
usage((unsigned char*)argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,445 +0,0 @@
|
|||
/*****************************************************************************
|
||||
* aft_api.c AFT T1/E1: HDLC API Sample Code
|
||||
*
|
||||
* Author(s): Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright: (c) 2003-2004 Sangoma Technologies Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_wanpipe.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/wanpipe_defines.h>
|
||||
#include <linux/wanpipe_cfg.h>
|
||||
#include <linux/wanpipe.h>
|
||||
#include <libsangoma.h>
|
||||
#include "lib_api.h"
|
||||
|
||||
#define MAX_TX_DATA 5000 /* Size of tx data */
|
||||
#define MAX_FRAMES 5000 /* Number of frames to transmit */
|
||||
|
||||
#define MAX_RX_DATA 5000
|
||||
|
||||
unsigned short Rx_lgth;
|
||||
|
||||
unsigned char Rx_data[MAX_RX_DATA];
|
||||
unsigned char Tx_data[MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t)];
|
||||
|
||||
/* Prototypes */
|
||||
int MakeConnection(void);
|
||||
void handle_span_chan( void);
|
||||
void sig_end(int sigid);
|
||||
|
||||
int dev_fd;
|
||||
FILE *tx_fd=NULL,*rx_fd=NULL;
|
||||
wanpipe_tdm_api_t tdm_api;
|
||||
|
||||
|
||||
/***************************************************
|
||||
* HANDLE SOCKET
|
||||
*
|
||||
* o Read a socket
|
||||
* o Cast data received to api_rx_element_t data type
|
||||
* o The received packet contains 16 bytes header
|
||||
*
|
||||
* ------------------------------------------
|
||||
* | 16 bytes | X bytes ...
|
||||
* ------------------------------------------
|
||||
* Header Data
|
||||
*
|
||||
* o Data structures:
|
||||
* ------------------
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _event_type;
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_event;
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_rx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_rx_hdr_u;
|
||||
* #define wp_api_event_type wp_rx_hdr_u.wp_event._event_type
|
||||
* #define wp_api_event_rbs_rx_bits wp_rx_hdr_u.wp_event._rbs_rx_bits
|
||||
* #define wp_api_event_time_stamp wp_rx_hdr_u.wp_event._time_stamp
|
||||
* } wp_tdm_api_rx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_rx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_rx_element_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_tx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_tx_hdr_u;
|
||||
* #define wp_api_time_stamp wp_tx_hdr_u.wp_tx._time_stamp
|
||||
* } wp_tdm_api_tx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_tx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_tx_element_t;
|
||||
*
|
||||
* #define WPTDM_A_BIT 0x08
|
||||
* #define WPTDM_B_BIT 0x04
|
||||
* #define WPTDM_C_BIT 0x02
|
||||
* #define WPTDM_D_BIT 0x01
|
||||
*
|
||||
*/
|
||||
|
||||
void handle_span_chan(void)
|
||||
{
|
||||
unsigned int Rx_count,Tx_count,Tx_length;
|
||||
wp_tdm_api_rx_element_t* api_rx_el;
|
||||
wp_tdm_api_tx_element_t * api_tx_el;
|
||||
fd_set ready,write,oob;
|
||||
int err,i;
|
||||
|
||||
#if 0
|
||||
int rlen;
|
||||
int stream_sync=0;
|
||||
#endif
|
||||
|
||||
Rx_count = 0;
|
||||
Tx_count = 0;
|
||||
|
||||
if (tdm_api.wp_tdm_cmd.hdlc) {
|
||||
Tx_length = tx_size;
|
||||
} else {
|
||||
Tx_length = tdm_api.wp_tdm_cmd.usr_mtu_mru;
|
||||
}
|
||||
|
||||
printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i\n",
|
||||
read_enable,write_enable,tx_cnt,tx_size,tx_delay);
|
||||
|
||||
/* Initialize the Tx Data buffer */
|
||||
memset(&Tx_data[0],0,MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t));
|
||||
|
||||
/* Cast the Tx data packet with the tx element
|
||||
* structure. We must insert a 16 byte
|
||||
* driver header, which driver will remove
|
||||
* before passing packet out the physical port */
|
||||
api_tx_el = (wp_tdm_api_tx_element_t*)&Tx_data[0];
|
||||
|
||||
|
||||
/* Create a Tx packet based on user info, or
|
||||
* by deafult incrementing number starting from 0 */
|
||||
for (i=0;i<Tx_length;i++){
|
||||
if (tx_data == -1){
|
||||
api_tx_el->data[i] = (unsigned char)i;
|
||||
}else{
|
||||
#if 0
|
||||
api_tx_el->data[i] = (unsigned char)tx_data+(i%4);
|
||||
#else
|
||||
api_tx_el->data[i] = (unsigned char)tx_data;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
sangoma_tdm_enable_rm_dtmf_events(dev_fd, &tdm_api);
|
||||
|
||||
/* Main Rx Tx OOB routine */
|
||||
for(;;) {
|
||||
|
||||
/* Initialize all select() descriptors */
|
||||
FD_ZERO(&ready);
|
||||
FD_ZERO(&write);
|
||||
FD_ZERO(&oob);
|
||||
FD_SET(dev_fd,&oob);
|
||||
FD_SET(dev_fd,&ready);
|
||||
|
||||
if (write_enable){
|
||||
FD_SET(dev_fd,&write);
|
||||
}
|
||||
|
||||
/* Select will block, until:
|
||||
* 1: OOB event, link level change
|
||||
* 2: Rx data available
|
||||
* 3: Interface able to Tx */
|
||||
|
||||
if(select(dev_fd + 1,&ready, &write, &oob, NULL)){
|
||||
|
||||
fflush(stdout);
|
||||
if (FD_ISSET(dev_fd,&oob)){
|
||||
|
||||
/* An OOB event is pending, usually indicating
|
||||
* a link level change */
|
||||
|
||||
err=sangoma_tdm_read_event(dev_fd,&tdm_api);
|
||||
|
||||
if(err < 0 ) {
|
||||
printf("Failed to receive OOB %i , %i\n", Rx_count, err);
|
||||
err = ioctl(dev_fd,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Sock state is %s\n",
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("GOT OOB EXCEPTION CMD Exiting\n");
|
||||
}
|
||||
|
||||
|
||||
if (FD_ISSET(dev_fd,&ready)){
|
||||
|
||||
/* An Rx packet is pending
|
||||
* 1: Read the rx packet into the Rx_data
|
||||
* buffer. Confirm len > 0
|
||||
*
|
||||
* 2: Cast Rx_data to the api_rx_element.
|
||||
* Thus, removing a 16 byte header
|
||||
* attached by the driver.
|
||||
*
|
||||
* 3. Check error_flag:
|
||||
* CRC,Abort..etc
|
||||
*/
|
||||
|
||||
memset(Rx_data, 0, sizeof(Rx_data));
|
||||
|
||||
err = sangoma_readmsg_tdm(dev_fd,
|
||||
Rx_data,
|
||||
sizeof(wp_tdm_api_rx_hdr_t),
|
||||
&Rx_data[sizeof(wp_tdm_api_rx_hdr_t)],
|
||||
MAX_RX_DATA, 0);
|
||||
|
||||
|
||||
if (!read_enable){
|
||||
goto bitstrm_skip_read;
|
||||
}
|
||||
|
||||
/* err indicates bytes received */
|
||||
if(err <= 0) {
|
||||
printf("\nError receiving data\n");
|
||||
break;
|
||||
}
|
||||
|
||||
api_rx_el = (wp_tdm_api_rx_element_t*)&Rx_data[0];
|
||||
|
||||
/* Check the packet length */
|
||||
Rx_lgth = err;
|
||||
if(Rx_lgth<=0) {
|
||||
printf("\nShort frame received (%d)\n",
|
||||
Rx_lgth);
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (api_rx_el->data[0] == tx_data && api_rx_el->data[1] == (tx_data+1)){
|
||||
if (!stream_sync){
|
||||
printf("GOT SYNC %x\n",api_rx_el->data[0]);
|
||||
}
|
||||
stream_sync=1;
|
||||
}else{
|
||||
if (stream_sync){
|
||||
printf("OUT OF SYNC: %x\n",api_rx_el->data[0]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
++Rx_count;
|
||||
|
||||
if (verbose){
|
||||
printf("Received %i Length = %i\n",
|
||||
Rx_count,Rx_lgth);
|
||||
#if 1
|
||||
printf("Data: ");
|
||||
for(i=0;i<Rx_lgth; i ++) {
|
||||
printf("0x%02X ", api_rx_el->data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
}else{
|
||||
//putchar('R');
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
switch(api_rx_el->hdr.wp_api_event_type){
|
||||
case WP_TDM_EVENT_DTMF:
|
||||
printf("DTMV Event: %c (%s:%s)!\n",
|
||||
api_rx_el->hdr.wp_api_event_dtmf_digit,
|
||||
(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_ROUT)?"ROUT":"SOUT",
|
||||
(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_PRESET)?"PRESET":"STOP");
|
||||
break;
|
||||
case WP_TDM_EVENT_RXHOOK:
|
||||
printf("RXHOOK Event: %s!\n",
|
||||
(api_rx_el->hdr.wp_api_event_rxhook_state&WP_TDM_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
|
||||
break;
|
||||
case WP_TDM_EVENT_RING:
|
||||
printf("RING Event: %s!\n",
|
||||
(api_rx_el->hdr.wp_api_event_ring_state&WP_TDM_EVENT_RING_PRESENT)?"PRESENT":"STOP");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (rx_cnt > 0 && Rx_count >= rx_cnt){
|
||||
break;
|
||||
}
|
||||
bitstrm_skip_read:
|
||||
;
|
||||
}
|
||||
|
||||
if (FD_ISSET(dev_fd,&write)){
|
||||
|
||||
|
||||
err = sangoma_writemsg_tdm(dev_fd,
|
||||
Tx_data,16,
|
||||
&Tx_data[16], Tx_length,
|
||||
0);
|
||||
if (err <= 0){
|
||||
if (errno == EBUSY){
|
||||
if (verbose){
|
||||
printf("Sock busy try again!\n");
|
||||
}
|
||||
/* Socket busy try sending again !*/
|
||||
}else{
|
||||
printf("Faild to send %i \n",errno);
|
||||
perror("Send: ");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
|
||||
++Tx_count;
|
||||
|
||||
if (verbose){
|
||||
printf("Packet sent: Sent %i : %i\n",
|
||||
err,Tx_count);
|
||||
}else{
|
||||
//putchar('T');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tx_delay){
|
||||
usleep(tx_delay);
|
||||
}
|
||||
|
||||
if (tx_cnt && tx_size && Tx_count >= tx_cnt && !(files_used & TX_FILE_USED)){
|
||||
|
||||
write_enable=0;
|
||||
if (rx_cnt > 0){
|
||||
/* Dont break let rx finish */
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sangoma_tdm_disable_rm_dtmf_events(dev_fd, &tdm_api);
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
close (dev_fd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int dtmf_event (int fd, unsigned char digit, unsigned char type, unsigned char port)
|
||||
{
|
||||
printf("%d: DTMV Event: %c (%s:%s)!\n",
|
||||
fd,
|
||||
digit,
|
||||
(port == WAN_EC_CHANNEL_PORT_ROUT)?"ROUT":"SOUT",
|
||||
(type == WAN_EC_TONE_PRESENT)?"PRESET":"STOP");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Main:
|
||||
*
|
||||
* o Make a socket connection to the driver.
|
||||
* o Call handle_span_chan() to read the socket
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int proceed;
|
||||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
signal(SIGINT,&sig_end);
|
||||
memset(&tdm_api,0,sizeof(tdm_api));
|
||||
tdm_api.wp_tdm_event.wp_dtmf_event = &dtmf_event;
|
||||
|
||||
printf("TDM DTMF PTR = %p\n",tdm_api.wp_tdm_event.wp_dtmf_event);
|
||||
|
||||
dev_fd =-1;
|
||||
|
||||
dev_fd = sangoma_open_tdmapi_span_chan(1,1/*atoi(card_name),atoi(if_name)*/);
|
||||
if( dev_fd < 0){
|
||||
printf("Failed to open span chan:%s:%s\n",card_name,if_name);
|
||||
exit (1);
|
||||
}
|
||||
printf("HANDLING SPAN %i CHAN %i FD=%i\n",
|
||||
atoi(card_name),atoi(if_name),dev_fd);
|
||||
|
||||
sangoma_tdm_set_codec(dev_fd,&tdm_api,WP_NONE);
|
||||
sangoma_get_full_cfg(dev_fd, &tdm_api);
|
||||
|
||||
handle_span_chan();
|
||||
close(dev_fd);
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
void sig_end(int sigid)
|
||||
{
|
||||
|
||||
printf("Got Signal %i\n",sigid);
|
||||
|
||||
sangoma_tdm_disable_rm_dtmf_events(dev_fd, &tdm_api);
|
||||
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
|
||||
if (dev_fd){
|
||||
close (dev_fd);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
|
@ -1,448 +0,0 @@
|
|||
/*****************************************************************************
|
||||
* aft_api.c AFT T1/E1: HDLC API Sample Code
|
||||
*
|
||||
* Author(s): Nenad Corbic <ncorbic@sangoma.com>
|
||||
*
|
||||
* Copyright: (c) 2003-2004 Sangoma Technologies Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <linux/if_wanpipe.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/wanpipe_defines.h>
|
||||
#include <linux/wanpipe_cfg.h>
|
||||
#include <linux/wanpipe.h>
|
||||
#include <libsangoma.h>
|
||||
#include "lib_api.h"
|
||||
|
||||
#define MAX_TX_DATA 5000 /* Size of tx data */
|
||||
#define MAX_FRAMES 5000 /* Number of frames to transmit */
|
||||
|
||||
#define MAX_RX_DATA 5000
|
||||
|
||||
unsigned short Rx_lgth;
|
||||
|
||||
unsigned char Rx_data[MAX_RX_DATA];
|
||||
unsigned char Tx_data[MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t)];
|
||||
|
||||
/* Prototypes */
|
||||
int MakeConnection(void);
|
||||
void handle_span_chan( void);
|
||||
void sig_end(int sigid);
|
||||
|
||||
int dev_fd;
|
||||
FILE *tx_fd=NULL,*rx_fd=NULL;
|
||||
wanpipe_tdm_api_t tdm_api;
|
||||
|
||||
|
||||
/***************************************************
|
||||
* HANDLE SOCKET
|
||||
*
|
||||
* o Read a socket
|
||||
* o Cast data received to api_rx_element_t data type
|
||||
* o The received packet contains 16 bytes header
|
||||
*
|
||||
* ------------------------------------------
|
||||
* | 16 bytes | X bytes ...
|
||||
* ------------------------------------------
|
||||
* Header Data
|
||||
*
|
||||
* o Data structures:
|
||||
* ------------------
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _event_type;
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_event;
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_rx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_rx_hdr_u;
|
||||
* #define wp_api_event_type wp_rx_hdr_u.wp_event._event_type
|
||||
* #define wp_api_event_rbs_rx_bits wp_rx_hdr_u.wp_event._rbs_rx_bits
|
||||
* #define wp_api_event_time_stamp wp_rx_hdr_u.wp_event._time_stamp
|
||||
* } wp_tdm_api_rx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_rx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_rx_element_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* union {
|
||||
* struct {
|
||||
* unsigned char _rbs_rx_bits;
|
||||
* unsigned int _time_stamp;
|
||||
* }wp_tx;
|
||||
* unsigned char reserved[16];
|
||||
* }wp_tx_hdr_u;
|
||||
* #define wp_api_time_stamp wp_tx_hdr_u.wp_tx._time_stamp
|
||||
* } wp_tdm_api_tx_hdr_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* wp_tdm_api_tx_hdr_t hdr;
|
||||
* unsigned char data[1];
|
||||
* } wp_tdm_api_tx_element_t;
|
||||
*
|
||||
* #define WPTDM_A_BIT 0x08
|
||||
* #define WPTDM_B_BIT 0x04
|
||||
* #define WPTDM_C_BIT 0x02
|
||||
* #define WPTDM_D_BIT 0x01
|
||||
*
|
||||
*/
|
||||
|
||||
void handle_span_chan(void)
|
||||
{
|
||||
unsigned int Rx_count,Tx_count,Tx_length;
|
||||
wp_tdm_api_rx_element_t* api_rx_el;
|
||||
wp_tdm_api_tx_element_t * api_tx_el;
|
||||
fd_set ready,write,oob;
|
||||
int err,i;
|
||||
|
||||
#if 0
|
||||
int rlen;
|
||||
int stream_sync=0;
|
||||
#endif
|
||||
|
||||
Rx_count = 0;
|
||||
Tx_count = 0;
|
||||
|
||||
if (tdm_api.wp_tdm_cmd.hdlc) {
|
||||
Tx_length = tx_size;
|
||||
} else {
|
||||
Tx_length = tdm_api.wp_tdm_cmd.usr_mtu_mru;
|
||||
}
|
||||
|
||||
printf("\n\nSocket Handler: Rx=%d Tx=%i TxCnt=%i TxLen=%i TxDelay=%i\n",
|
||||
read_enable,write_enable,tx_cnt,tx_size,tx_delay);
|
||||
|
||||
/* Initialize the Tx Data buffer */
|
||||
memset(&Tx_data[0],0,MAX_TX_DATA + sizeof(wp_tdm_api_rx_hdr_t));
|
||||
|
||||
/* Cast the Tx data packet with the tx element
|
||||
* structure. We must insert a 16 byte
|
||||
* driver header, which driver will remove
|
||||
* before passing packet out the physical port */
|
||||
api_tx_el = (wp_tdm_api_tx_element_t*)&Tx_data[0];
|
||||
|
||||
|
||||
/* Create a Tx packet based on user info, or
|
||||
* by deafult incrementing number starting from 0 */
|
||||
for (i=0;i<Tx_length;i++){
|
||||
if (tx_data == -1){
|
||||
api_tx_el->data[i] = (unsigned char)i;
|
||||
}else{
|
||||
#if 0
|
||||
api_tx_el->data[i] = (unsigned char)tx_data+(i%4);
|
||||
#else
|
||||
api_tx_el->data[i] = (unsigned char)tx_data;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
sangoma_tdm_enable_rxhook_events(dev_fd, &tdm_api);
|
||||
|
||||
/* Main Rx Tx OOB routine */
|
||||
for(;;) {
|
||||
|
||||
/* Initialize all select() descriptors */
|
||||
FD_ZERO(&ready);
|
||||
FD_ZERO(&write);
|
||||
FD_ZERO(&oob);
|
||||
FD_SET(dev_fd,&oob);
|
||||
FD_SET(dev_fd,&ready);
|
||||
|
||||
if (write_enable){
|
||||
FD_SET(dev_fd,&write);
|
||||
}
|
||||
|
||||
/* Select will block, until:
|
||||
* 1: OOB event, link level change
|
||||
* 2: Rx data available
|
||||
* 3: Interface able to Tx */
|
||||
|
||||
if(select(dev_fd + 1,&ready, &write, &oob, NULL)){
|
||||
|
||||
fflush(stdout);
|
||||
if (FD_ISSET(dev_fd,&oob)){
|
||||
|
||||
/* An OOB event is pending, usually indicating
|
||||
* a link level change */
|
||||
|
||||
err=sangoma_tdm_read_event(dev_fd,&tdm_api);
|
||||
|
||||
if(err < 0 ) {
|
||||
printf("Failed to receive OOB %i , %i\n", Rx_count, err);
|
||||
err = ioctl(dev_fd,SIOC_WANPIPE_SOCK_STATE,0);
|
||||
printf("Sock state is %s\n",
|
||||
(err == 0) ? "CONNECTED" :
|
||||
(err == 1) ? "DISCONNECTED" :
|
||||
"CONNECTING");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("GOT OOB EXCEPTION CMD Exiting\n");
|
||||
}
|
||||
|
||||
|
||||
if (FD_ISSET(dev_fd,&ready)){
|
||||
|
||||
/* An Rx packet is pending
|
||||
* 1: Read the rx packet into the Rx_data
|
||||
* buffer. Confirm len > 0
|
||||
*
|
||||
* 2: Cast Rx_data to the api_rx_element.
|
||||
* Thus, removing a 16 byte header
|
||||
* attached by the driver.
|
||||
*
|
||||
* 3. Check error_flag:
|
||||
* CRC,Abort..etc
|
||||
*/
|
||||
|
||||
memset(Rx_data, 0, sizeof(Rx_data));
|
||||
|
||||
err = sangoma_readmsg_tdm(dev_fd,
|
||||
Rx_data,
|
||||
sizeof(wp_tdm_api_rx_hdr_t),
|
||||
&Rx_data[sizeof(wp_tdm_api_rx_hdr_t)],
|
||||
MAX_RX_DATA, 0);
|
||||
|
||||
|
||||
if (!read_enable){
|
||||
goto bitstrm_skip_read;
|
||||
}
|
||||
|
||||
/* err indicates bytes received */
|
||||
if(err <= 0) {
|
||||
printf("\nError receiving data\n");
|
||||
break;
|
||||
}
|
||||
|
||||
api_rx_el = (wp_tdm_api_rx_element_t*)&Rx_data[0];
|
||||
|
||||
/* Check the packet length */
|
||||
Rx_lgth = err;
|
||||
if(Rx_lgth<=0) {
|
||||
printf("\nShort frame received (%d)\n",
|
||||
Rx_lgth);
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (api_rx_el->data[0] == tx_data && api_rx_el->data[1] == (tx_data+1)){
|
||||
if (!stream_sync){
|
||||
printf("GOT SYNC %x\n",api_rx_el->data[0]);
|
||||
}
|
||||
stream_sync=1;
|
||||
}else{
|
||||
if (stream_sync){
|
||||
printf("OUT OF SYNC: %x\n",api_rx_el->data[0]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
++Rx_count;
|
||||
|
||||
if (verbose){
|
||||
#if 0
|
||||
printf("Received %i Length = %i\n",
|
||||
Rx_count,Rx_lgth);
|
||||
|
||||
printf("Data: ");
|
||||
for(i=0;i<Rx_lgth; i ++) {
|
||||
printf("0x%02X ", api_rx_el->data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
}else{
|
||||
//putchar('R');
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
switch(api_rx_el->hdr.wp_api_event_type){
|
||||
case WP_TDM_EVENT_DTMF:
|
||||
printf("DTMV Event: %c (%s:%s)!\n",
|
||||
api_rx_el->hdr.wp_api_event_dtmf_digit,
|
||||
(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_ROUT)?"ROUT":"SOUT",
|
||||
(api_rx_el->hdr.wp_api_event_dtmf_type&WP_TDM_EVENT_DTMF_PRESET)?"PRESET":"STOP");
|
||||
break;
|
||||
case WP_TDM_EVENT_RXHOOK:
|
||||
printf("RXHOOK Event: %s!\n",
|
||||
(api_rx_el->hdr.wp_api_event_rxhook_state&WP_TDM_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
|
||||
break;
|
||||
case WP_TDM_EVENT_RING:
|
||||
printf("RING Event: %s!\n",
|
||||
(api_rx_el->hdr.wp_api_event_ring_state&WP_TDM_EVENT_RING_PRESENT)?"PRESENT":"STOP");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rx_cnt > 0 && Rx_count >= rx_cnt){
|
||||
break;
|
||||
}
|
||||
bitstrm_skip_read:
|
||||
;
|
||||
}
|
||||
|
||||
if (FD_ISSET(dev_fd,&write)){
|
||||
|
||||
|
||||
err = sangoma_writemsg_tdm(dev_fd,
|
||||
Tx_data,16,
|
||||
&Tx_data[16], Tx_length,
|
||||
0);
|
||||
if (err <= 0){
|
||||
if (errno == EBUSY){
|
||||
if (verbose){
|
||||
printf("Sock busy try again!\n");
|
||||
}
|
||||
/* Socket busy try sending again !*/
|
||||
}else{
|
||||
printf("Faild to send %i \n",errno);
|
||||
perror("Send: ");
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
|
||||
++Tx_count;
|
||||
|
||||
if (verbose){
|
||||
//printf("Packet sent: Sent %i : %i\n",
|
||||
// err,Tx_count);
|
||||
}else{
|
||||
//putchar('T');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tx_delay){
|
||||
usleep(tx_delay);
|
||||
}
|
||||
|
||||
if (tx_cnt && tx_size && Tx_count >= tx_cnt && !(files_used & TX_FILE_USED)){
|
||||
|
||||
write_enable=0;
|
||||
if (rx_cnt > 0){
|
||||
/* Dont break let rx finish */
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
close (dev_fd);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
int rxhook_event (int fd, unsigned char state)
|
||||
{
|
||||
printf("%d: RXHOOK Event: %s!\n",
|
||||
fd, (state & WAN_EVENT_RXHOOK_OFF)?"OFF-HOOK":"ON-HOOK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
* Main:
|
||||
*
|
||||
* o Make a socket connection to the driver.
|
||||
* o Call handle_span_chan() to read the socket
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int proceed;
|
||||
|
||||
proceed=init_args(argc,argv);
|
||||
if (proceed != WAN_TRUE){
|
||||
usage(argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
signal(SIGINT,&sig_end);
|
||||
memset(&tdm_api,0,sizeof(tdm_api));
|
||||
tdm_api.wp_tdm_event.wp_rxhook_event = &rxhook_event;
|
||||
|
||||
printf("TDM RXHOOK PTR = %p\n",tdm_api.wp_tdm_event.wp_rxhook_event);
|
||||
|
||||
dev_fd =-1;
|
||||
|
||||
dev_fd = sangoma_open_tdmapi_span_chan(atoi(card_name),atoi(if_name));
|
||||
if( dev_fd < 0){
|
||||
printf("Failed to open span chan (%s:%s:%d:%d)\n",
|
||||
card_name, if_name,
|
||||
atoi(card_name),atoi(if_name));
|
||||
exit (1);
|
||||
}
|
||||
printf("HANDLING SPAN %i CHAN %i FD=%i\n",
|
||||
atoi(card_name),atoi(if_name),dev_fd);
|
||||
|
||||
sangoma_tdm_set_codec(dev_fd,&tdm_api,WP_NONE);
|
||||
sangoma_get_full_cfg(dev_fd, &tdm_api);
|
||||
|
||||
handle_span_chan();
|
||||
close(dev_fd);
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
void sig_end(int sigid)
|
||||
{
|
||||
|
||||
printf("Got Signal %i\n",sigid);
|
||||
|
||||
sangoma_tdm_disable_rxhook_events(dev_fd, &tdm_api);
|
||||
|
||||
if (tx_fd){
|
||||
fclose(tx_fd);
|
||||
}
|
||||
if (rx_fd){
|
||||
fclose(rx_fd);
|
||||
}
|
||||
|
||||
if (dev_fd){
|
||||
close (dev_fd);
|
||||
}
|
||||
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
../util/wanec_apilib
|
|
@ -1,5 +1,5 @@
|
|||
Package: wanpipe
|
||||
Version: 3.2.1-0
|
||||
Version: 3.2.2-0
|
||||
Section: networking
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
|
|
|
@ -12,6 +12,7 @@ MODULE_NAME =
|
|||
EXTRA_CFLAGS =
|
||||
KDIR =
|
||||
$(MODULE_NAME)-objs = $(OBJS)
|
||||
SUBDIRS=$(PWD)
|
||||
|
||||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
@ -29,16 +30,16 @@ PWD := $(shell pwd)
|
|||
KBUILD_VERBOSE=
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) clean
|
||||
|
||||
distclean: clean
|
||||
$(RM) $(JUNK) $(OBJS)
|
||||
|
||||
help:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) help
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) help
|
||||
|
||||
|
||||
# Indents the kernel source the way linux/Documentation/CodingStyle.txt
|
||||
|
@ -47,6 +48,6 @@ indent:
|
|||
indent -kr -i8 $($(MODULE_NAME)-objs:.o=.c)
|
||||
|
||||
install:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
|
||||
$(MAKE) -C $(KDIR) M=$(SUBDIRS) modules_install
|
||||
|
||||
endif
|
||||
|
|
|
@ -16,6 +16,8 @@ $(MODULE_NAME)-objs = $(OBJS)
|
|||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
||||
PWD := $(shell pwd)
|
||||
SUBDIRS=$(PWD)
|
||||
|
||||
# First pass, kernel Makefile reads module objects
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
|
@ -29,19 +31,19 @@ PWD := $(shell pwd)
|
|||
KBUILD_VERBOSE=
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
|
||||
clean:
|
||||
$(shell find . -name '*.*o' | xargs rm)
|
||||
$(shell find . -name '.*.o.cmd' | xargs rm)
|
||||
$(shell find $(SUBDIRS) -name '*.*o' | xargs rm)
|
||||
$(shell find $(SUBDIRS) -name '.*.o.cmd' | xargs rm)
|
||||
$(shell rm -f build.sh)
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) clean
|
||||
|
||||
distclean: clean
|
||||
$(RM) $(JUNK) $(OBJS)
|
||||
|
||||
help:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) help
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) help
|
||||
|
||||
|
||||
# Indents the kernel source the way linux/Documentation/CodingStyle.txt
|
||||
|
@ -50,6 +52,6 @@ indent:
|
|||
indent -kr -i8 $($(MODULE_NAME)-objs:.o=.c)
|
||||
|
||||
install:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
|
||||
$(MAKE) -C $(KDIR) M=$(SUBDIRS) modules_install
|
||||
|
||||
endif
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
from=$1
|
||||
to=$2
|
||||
echo "Coping $from to $to"
|
||||
|
||||
eval "cp $(find $from -name '*.ko' | xargs) $to"
|
||||
exit $?
|
|
@ -734,7 +734,7 @@ aft_dmachain_enable_tdmv_and_mtu_size(u32 *reg, int size)
|
|||
# define AFT_TXDMA_LO_ALIGN_MASK 0x03
|
||||
# define AFT_TXDMA_LO_ALIGN_SHIFT 0
|
||||
|
||||
# define AFT_TXDMA_HI_DMA_LENGTH_MASK 0x3FF
|
||||
# define AFT_TXDMA_HI_DMA_LENGTH_MASK 0xFFF
|
||||
# define AFT_TXDMA_HI_DMA_LENGTH_SHIFT 0
|
||||
|
||||
# define AFT_TXDMA_HI_DMA_STATUS_MASK 0x0F
|
||||
|
@ -759,7 +759,7 @@ aft_dmachain_enable_tdmv_and_mtu_size(u32 *reg, int size)
|
|||
# define AFT_RXDMA_LO_ALIGN_MASK 0x03
|
||||
# define AFT_RXDMA_LO_ALIGN_SHIFT 0
|
||||
|
||||
# define AFT_RXDMA_HI_DMA_LENGTH_MASK 0x3FF
|
||||
# define AFT_RXDMA_HI_DMA_LENGTH_MASK 0xFFF
|
||||
# define AFT_RXDMA_HI_DMA_LENGTH_SHIFT 0
|
||||
|
||||
# define AFT_RXDMA_HI_DMA_STATUS_MASK 0x0F
|
||||
|
@ -962,17 +962,17 @@ enum {
|
|||
static __inline unsigned short aft_valid_mtu(unsigned short mtu)
|
||||
{
|
||||
if (mtu <= 128){
|
||||
return 128;
|
||||
}else if (mtu <= 256){
|
||||
return 256;
|
||||
}else if (mtu <= 512){
|
||||
}else if (mtu <= 256){
|
||||
return 512;
|
||||
}else if (mtu <= 1024){
|
||||
}else if (mtu <= 512){
|
||||
return 1024;
|
||||
}else if (mtu <= 2048){
|
||||
}else if (mtu <= 1024){
|
||||
return 2048;
|
||||
}else if (mtu <= 4096){
|
||||
}else if (mtu <= 2048){
|
||||
return 4096;
|
||||
}else if (mtu <= 4096){
|
||||
return 8188;
|
||||
}else if (mtu <= 8188){
|
||||
return 8188;
|
||||
}else{
|
||||
|
|
|
@ -88,8 +88,10 @@
|
|||
#define WAN_FE_ALARM_NONE 0x00
|
||||
#define WAN_FE_ALARM_READ 0x01
|
||||
#define WAN_FE_ALARM_PRINT 0x02
|
||||
#define WAN_FE_ALARM_UPDATE 0x04
|
||||
#define IS_FE_ALARM_READ(action) ((action) & WAN_FE_ALARM_READ)
|
||||
#define IS_FE_ALARM_PRINT(action) ((action) & WAN_FE_ALARM_PRINT)
|
||||
#define IS_FE_ALARM_UPDATE(action) ((action) & WAN_FE_ALARM_UPDATE)
|
||||
|
||||
/* Read pmon flag */
|
||||
#define WAN_FE_PMON_UPDATE 0x01
|
||||
|
@ -385,6 +387,7 @@ typedef struct sdla_fe_timer_event_ {
|
|||
WAN_LIST_ENTRY(sdla_fe_timer_event_) next;
|
||||
} sdla_fe_timer_event_t;
|
||||
|
||||
#define WAN_FE_MAX_QEVENT_LEN 20
|
||||
typedef struct {
|
||||
char *name;
|
||||
void *card;
|
||||
|
@ -412,6 +415,7 @@ typedef struct {
|
|||
wan_spinlock_t lock;
|
||||
wan_timer_t timer;
|
||||
WAN_LIST_HEAD(, sdla_fe_timer_event_) event;
|
||||
unsigned int event_map;
|
||||
|
||||
int (*write_cpld)(void*, unsigned short, unsigned char);
|
||||
int (*read_cpld)(void*, unsigned short, unsigned char);
|
||||
|
|
|
@ -147,6 +147,22 @@
|
|||
#define WAN_T1_399_533 0x10
|
||||
#define WAN_T1_533_655 0x11
|
||||
|
||||
/* T1/E1: Recever */
|
||||
#define WAN_TE1_RX_SLEVEL_43_DB 430 /* 43 dB E1, RMONEN=0 */
|
||||
#define WAN_TE1_RX_SLEVEL_36_DB 360 /* 36 dB T1, RMONEN=0 */
|
||||
#define WAN_TE1_RX_SLEVEL_30_DB 300 /* 30 dB RMONEN=0 | 1 */
|
||||
#define WAN_TE1_RX_SLEVEL_225_DB 225 /* 22.5 dB RMONEN=1 */
|
||||
#define WAN_TE1_RX_SLEVEL_18_DB 180 /* 18 dB RMONEN=0 */
|
||||
#define WAN_TE1_RX_SLEVEL_175_DB 175 /* 17.5 dB RMONEN=1 */
|
||||
#define WAN_TE1_RX_SLEVEL_12_DB 120 /* 12 dB RMONEN=0 | 1 */
|
||||
#define WAN_TE1_RX_SLEVEL_DECODE(slevel) \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_43_DB) ? "43dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_36_DB) ? "36dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_30_DB) ? "30dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_225_DB) ? "22.5dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_18_DB) ? "18dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_175_DB) ? "17.5dB" : \
|
||||
((slevel) == WAN_TE1_RX_SLEVEL_12_DB) ? "12dB" : "0dB"
|
||||
|
||||
/* For T1 only (long or short haul) */
|
||||
#define WAN_T1_LONG_HAUL 0x01
|
||||
|
@ -260,6 +276,7 @@
|
|||
#define TE_POLL_CONFIG 0x0B
|
||||
#define TE_POLL_READ 0x0C
|
||||
#define TE_POLL_WRITE 0x0D
|
||||
#define TE_LINKCRIT_TIMER 0x0F
|
||||
|
||||
/* TE1 T1/E1 interrupt setting delay */
|
||||
#define INTR_TE1_TIMER 150 /* 50 ms */
|
||||
|
@ -322,7 +339,7 @@
|
|||
(FE_LBO(fe_cfg) == WAN_T1_133_266) ? "133-266ft" : \
|
||||
(FE_LBO(fe_cfg) == WAN_T1_266_399) ? "266-399ft" : \
|
||||
(FE_LBO(fe_cfg) == WAN_T1_399_533) ? "399-533ft" : \
|
||||
(FE_LBO(fe_cfg) == WAN_T1_533_655) ? "5330-599ft": \
|
||||
(FE_LBO(fe_cfg) == WAN_T1_533_655) ? "533-599ft": \
|
||||
(FE_LBO(fe_cfg) == WAN_E1_120) ? "120OH" : \
|
||||
(FE_LBO(fe_cfg) == WAN_E1_75) ? "75OH" : \
|
||||
"Unknown"
|
||||
|
@ -361,6 +378,7 @@ typedef struct sdla_te_cfg {
|
|||
u_int32_t active_ch;
|
||||
u_int32_t te_rbs_ch;
|
||||
u_int8_t high_impedance_mode;
|
||||
int rx_slevel;
|
||||
u_int8_t te_ref_clock;
|
||||
u_int8_t sig_mode;
|
||||
} sdla_te_cfg_t;
|
||||
|
@ -545,6 +563,8 @@ typedef struct {
|
|||
|
||||
u_int16_t status_cnt;
|
||||
|
||||
wan_ticks_t crit_alarm_start;
|
||||
unsigned int lb_mode;
|
||||
} sdla_te_param_t;
|
||||
|
||||
|
||||
|
|
|
@ -419,6 +419,16 @@
|
|||
#define REG_RCICE4 0xD3
|
||||
|
||||
/* TX Framer Register Definitions */
|
||||
#define REG_E1TSACR 0x114
|
||||
#define BIT_E1TSACR_SiAF 0x80
|
||||
#define BIT_E1TSACR_SiNAF 0x40
|
||||
#define BIT_E1TSACR_RA 0x20
|
||||
#define BIT_E1TSACR_Sa4 0x10
|
||||
#define BIT_E1TSACR_Sa5 0x08
|
||||
#define BIT_E1TSACR_Sa6 0x04
|
||||
#define BIT_E1TSACR_Sa7 0x02
|
||||
#define BIT_E1TSACR_Sa8 0x01
|
||||
|
||||
#define REG_SSIE1 0x118
|
||||
#define BITS_SSIE1_ALL 0xFF
|
||||
#define BIT_SSIE1_CH1 0x80
|
||||
|
@ -495,6 +505,12 @@
|
|||
|
||||
#define REG_E1TNAF 0x165
|
||||
|
||||
#define REG_E1TSa4 0x169
|
||||
#define REG_E1TSa5 0x16A
|
||||
#define REG_E1TSa6 0x16B
|
||||
#define REG_E1TSa7 0x16C
|
||||
#define REG_E1TSa8 0x16D
|
||||
|
||||
#define REG_TMMR 0x180
|
||||
#define BIT_TMMR_FRM_EN 0x80
|
||||
#define BIT_TMMR_INIT_DONE 0x40
|
||||
|
|
|
@ -312,8 +312,12 @@ typedef struct sfm /* SDLA firmware file structire */
|
|||
(adptr_subtype == AFT_SUBTYPE_NORMAL) ? "" : \
|
||||
(adptr_subtype == AFT_SUBTYPE_SHARK) ? "SHARK" : ""
|
||||
|
||||
#define AFT_PCIEXPRESS_DECODE(hwcard) \
|
||||
((hwcard)->pci_bridge_dev) ? " PCI-Express" : ""
|
||||
#define AFT_PCITYPE_DECODE(hwcard) \
|
||||
((hwcard)->pci_bridge_dev) ? "PCIe" : "PCI"
|
||||
|
||||
#define AFT_PCIEXPRESS_DECODE AFT_PCITYPE_DECODE
|
||||
|
||||
|
||||
|
||||
#endif /* _SDLASFM_H */
|
||||
|
||||
|
|
|
@ -915,6 +915,10 @@ typedef struct sdla
|
|||
u_long oerrors, ierrors;
|
||||
u_long opackets, ipackets;
|
||||
#endif /* __FreeBSD__ */
|
||||
|
||||
/* This value is used for detecting TDM Voice
|
||||
* rsync timeout, it should be long */
|
||||
unsigned long rsync_timeout;
|
||||
} sdla_t;
|
||||
|
||||
/****** Public Functions ****************************************************/
|
||||
|
|
|
@ -889,6 +889,7 @@ typedef struct wan_hwec_conf_
|
|||
{
|
||||
unsigned int clk_src; /* Octasic Clock Source Port */
|
||||
unsigned int persist_disable;/* HW EC Persist */
|
||||
unsigned int noise_reduction;/* Noise Reduction control */
|
||||
|
||||
} wan_hwec_conf_t;
|
||||
|
||||
|
|
|
@ -578,6 +578,7 @@ void wanpipe_debugging (void* data, int pending);
|
|||
#else
|
||||
void wanpipe_debugging (unsigned long data);
|
||||
#endif
|
||||
static __inline int wan_skb_tailroom(void* skb);
|
||||
|
||||
/****************************************************************************
|
||||
** I N L I N E F U N C T I O N S
|
||||
|
@ -1417,7 +1418,7 @@ static __inline void wan_skb_copyback(void* skb, int off, int len, caddr_t cp)
|
|||
struct sk_buff* sk = (struct sk_buff*)skb;
|
||||
unsigned char* data = NULL;
|
||||
if (off == wan_skb_len(skb)){
|
||||
if (sk->tail + len > sk->end){
|
||||
if (len > wan_skb_tailroom(sk)){
|
||||
DEBUG_EVENT("wan_skb_copyback: Internal Error (off=%d,len=%d,skb_len=%d)!\n",
|
||||
off, len, wan_skb_len(skb));
|
||||
return;
|
||||
|
@ -1458,7 +1459,7 @@ static __inline int wan_skb_copyback_user(void* skb, int off, int len, caddr_t c
|
|||
struct sk_buff* sk = (struct sk_buff*)skb;
|
||||
unsigned char* data = NULL;
|
||||
if (off == wan_skb_len(skb)){
|
||||
if (sk->tail + len > sk->end){
|
||||
if (len > wan_skb_tailroom(sk)) {
|
||||
DEBUG_EVENT("wan_skb_copyback_user: Internal Error (off=%d,len=%d,skb_len=%d)!\n",
|
||||
off, len, wan_skb_len(skb));
|
||||
return -EINVAL;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -50,6 +50,7 @@
|
|||
# define DEBUG_NONE if (0) DbgPrint
|
||||
# define PRINT OutputLogString
|
||||
# define DEBUG_PRINT DbgPrint
|
||||
# define DEBUG_LIMIT DbgPrint
|
||||
# define _DEBUG_PRINT DbgPrint
|
||||
|
||||
# define DEBUG_KERNEL DEBUG_NONE
|
||||
|
@ -239,11 +240,14 @@
|
|||
# if (defined __FreeBSD__) || (defined __OpenBSD__) || defined(__NetBSD__)
|
||||
|
||||
# define DEBUG_PRINT(format,msg...) log(LOG_INFO, format, ##msg)
|
||||
# define DEBUG_LIMIT(format,msg...) log(LOG_INFO, format, ##msg)
|
||||
# define _DEBUG_PRINT(format,msg...) log(LOG_INFO, format, ##msg)
|
||||
|
||||
# else /* !__FreeBSD__ && !__OpenBSD__ */
|
||||
|
||||
# define DEBUG_PRINT(format,msg...) printk(KERN_INFO format, ##msg)
|
||||
# define DEBUG_LIMIT(format,msg...) printk(KERN_INFO format, ##msg)
|
||||
//# define DEBUG_LIMIT(format,msg...) if (WAN_NET_RATELIMIT()) printk(KERN_INFO format, ##msg)
|
||||
# define _DEBUG_PRINT(format,msg...) printk(format,##msg)
|
||||
|
||||
# endif /* __FreeBSD__ || __OpenBSD__ */
|
||||
|
|
|
@ -659,6 +659,7 @@ typedef struct wan_udp_hdr{
|
|||
# define WP_DELAY DELAY
|
||||
# define WP_SCHEDULE(arg,name) tsleep(&(arg),PPAUSE,(name),(arg))
|
||||
# define SYSTEM_TICKS ticks
|
||||
typedef int wan_ticks_t;
|
||||
# define HZ hz
|
||||
# define RW_LOCK_UNLOCKED 0
|
||||
# define ETH_P_IP AF_INET
|
||||
|
@ -675,6 +676,7 @@ typedef struct wan_udp_hdr{
|
|||
# define WP_DELAY DELAY
|
||||
# define WP_SCHEDULE(arg,name) tsleep(&(arg),PPAUSE,(name),(arg))
|
||||
# define SYSTEM_TICKS ticks
|
||||
typedef int wan_ticks_t;
|
||||
# define HZ hz
|
||||
# define RW_LOCK_UNLOCKED 0
|
||||
# define ETH_P_IP AF_INET
|
||||
|
@ -690,6 +692,7 @@ typedef struct wan_udp_hdr{
|
|||
# define WAN_MOD_UNLOAD LKM_E_UNLOAD
|
||||
# define WP_DELAY DELAY
|
||||
# define SYSTEM_TICKS tick
|
||||
typedef int wan_ticks_t;
|
||||
# define HZ hz
|
||||
# define RW_LOCK_UNLOCKED 0
|
||||
# define WAN_IFT_OTHER IFT_OTHER
|
||||
|
@ -701,6 +704,7 @@ typedef struct wan_udp_hdr{
|
|||
# define WP_DELAY(usecs) udelay(usecs)
|
||||
# define atomic_set_int(name, val) atomic_set(name, val)
|
||||
# define SYSTEM_TICKS jiffies
|
||||
typedef unsigned long wan_ticks_t;
|
||||
# define WP_SCHEDULE(arg,name) schedule()
|
||||
# define wan_atomic_read atomic_read
|
||||
# define wan_atomic_set atomic_set
|
||||
|
|
|
@ -166,7 +166,7 @@ enum {
|
|||
/*#define MAX_TX_BUF 10*/
|
||||
#define MAX_TX_BUF 10
|
||||
#define MAX_ATM_TX_BUF 35
|
||||
#define MAX_RX_Q 32
|
||||
#define MAX_RX_Q 128
|
||||
|
||||
#define WPLIP_MAGIC_LINK 0xDAFE1234
|
||||
#define WPLIP_MAGIC_DEV 0xDAFE4321
|
||||
|
|
|
@ -0,0 +1,684 @@
|
|||
/* $Header: /usr/local/cvsroot/wanpipe_common/include/wanpipe_lip.h,v 1.38 2007/02/21 18:46:09 sangoma Exp $ */
|
||||
|
||||
#ifndef _WANPIPE_LIP_HEADER_
|
||||
#define _WANPIPE_LIP_HEADER_
|
||||
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
# include <wanpipe_includes.h>
|
||||
# include <wanpipe_defines.h>
|
||||
# include <wanpipe_debug.h>
|
||||
# include <wanpipe_common.h>
|
||||
# include <wanpipe_abstr.h>
|
||||
# include <wanpipe_snmp.h>
|
||||
# include <wanproc.h>
|
||||
# include <wanpipe.h>
|
||||
# include <wanpipe_cfg.h>
|
||||
# include <if_wanpipe_common.h>
|
||||
# include <wanpipe_iface.h>
|
||||
# include <wanpipe_lip_kernel.h>
|
||||
# include <wanpipe_fr_iface.h>
|
||||
# include <wanpipe_sppp_iface.h>
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_LAPB) || defined(CONFIG_PRODUCT_WANPIPE_LIP_LAPD)
|
||||
# include <wanpipe_lapb_iface.h>
|
||||
# endif
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_XDLC)
|
||||
# include <wanpipe_xdlc_iface.h>
|
||||
# endif
|
||||
#else
|
||||
# include <linux/wanpipe_includes.h>
|
||||
# include <linux/wanpipe_defines.h>
|
||||
# include <linux/wanpipe_debug.h>
|
||||
# include <linux/wanpipe_common.h>
|
||||
# include <linux/wanpipe_abstr.h>
|
||||
# include <linux/wanpipe_snmp.h>
|
||||
# include <linux/wanproc.h>
|
||||
# include <linux/wanpipe.h>
|
||||
# include <linux/wanpipe_cfg.h>
|
||||
# include <linux/if_wanpipe.h>
|
||||
# include <linux/if_wanpipe_common.h>
|
||||
# include <linux/wanpipe_fr_iface.h>
|
||||
# include <linux/wanpipe_lip_atm_iface.h>
|
||||
# include <linux/wanpipe_sppp_iface.h>
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_LAPB) || defined(CONFIG_PRODUCT_WANPIPE_LIP_LAPD)
|
||||
# include <linux/wanpipe_lapb_iface.h>
|
||||
# endif
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_LIP_KATM)
|
||||
# include <linux/wanpipe_katm_iface.h>
|
||||
# endif
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_XDLC)
|
||||
# include <linux/wanpipe_xdlc_iface.h>
|
||||
# endif
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_XMTP2)
|
||||
# include <linux/wanpipe_xmtp2_iface.h>
|
||||
# endif
|
||||
# include <linux/wanpipe_lip_kernel.h>
|
||||
# include <linux/wanpipe_iface.h>
|
||||
|
||||
# ifdef WPLIP_TTY_SUPPORT
|
||||
# include <linux/tty.h>
|
||||
# include <linux/tty_driver.h>
|
||||
# include <linux/tty_flip.h>
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef WAN_KERNEL
|
||||
|
||||
/*
|
||||
***********************************************************************************
|
||||
* *
|
||||
* X25HDR.C is the 'C' header file for the Sangoma X.25 code for the S508 adapter. *
|
||||
* *
|
||||
***********************************************************************************
|
||||
*/
|
||||
|
||||
#define LIP_OK 0
|
||||
#define TCPIP 0
|
||||
|
||||
#define MAX_CALL_REQ_ASYNC_PKT 512
|
||||
|
||||
#define NON_D_OPT 3
|
||||
#define D_OPT 2
|
||||
|
||||
#define FLOW_CONTROL_MASK 0x1F
|
||||
|
||||
#define ONE_BYTE 1
|
||||
#define MAX_TOKENS 31
|
||||
|
||||
#define MODNAME "wanpipe_lip"
|
||||
|
||||
#define MAX_LINK_RX_Q_LEN 10
|
||||
#define MAX_TAIL_ROOM 16
|
||||
#define MAX_LIP_LINKS 255
|
||||
|
||||
#if 0
|
||||
/* This option defaults the inital network
|
||||
* interface state to STOPPED/DISABLED.
|
||||
*
|
||||
* In this case, all traffic will be blocked
|
||||
* and data pushed back up the protocol stack.
|
||||
* This can cause memory starvation if there are
|
||||
* many interfaces running, because each interface
|
||||
* queue can be up to 100 packets, and fames will
|
||||
* only be dropped once the queue is overfilled
|
||||
*
|
||||
* By disabling this option, all packets received
|
||||
* by the interface in disconnected state, will be
|
||||
* silently discarded with carrier stat incremented.
|
||||
*/
|
||||
#define WANPIPE_LIP_IFNET_QUEUE_POLICY_INIT_OFF
|
||||
#endif
|
||||
|
||||
/* BH flags */
|
||||
enum{
|
||||
WPLIP_BH_RUNNING,
|
||||
WPLIP_RX_FSM_RUNNING,
|
||||
WPLIP_SMP_CONFLICT,
|
||||
WPLIP_BH_AWAITING_KICK,
|
||||
WPLIP_LINK_TIMER_EXPIRED,
|
||||
WPLIP_MORE_LINK_TX,
|
||||
WPLIP_LINK_DOWN,
|
||||
WPLIP_KICK,
|
||||
WPLIP_TTY_BUSY
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* LIP DEV Critical */
|
||||
enum {
|
||||
WPLIP_TX_WINDOW_CLOSED,
|
||||
WPLIP_SEND_AWAITING_KICK,
|
||||
WPLIP_TIMER_EXPIRED,
|
||||
WPLIP_DEV_DOWN,
|
||||
WPLIP_DEV_UNREGISTER,
|
||||
WPLIP_RX,
|
||||
WPLIP_IOCTL_SMP,
|
||||
WPLIP_DEV_SENDING
|
||||
};
|
||||
|
||||
#define MAX_RX_FACIL_CODE 30
|
||||
|
||||
#define BH_DEBUG 0
|
||||
|
||||
#define SOFT_INIT 0
|
||||
#define HARD_INIT 1
|
||||
#define MAX_SOFTIRQ_TIMEOUT 2
|
||||
|
||||
/*
|
||||
* Physical X25 Link
|
||||
* Each Link can support multiple logical
|
||||
* channels (svc).
|
||||
*/
|
||||
#define MAX_LCN 255
|
||||
#define MAX_DECODE_BUF_SZ 1000
|
||||
#define MAX_PROC_NAME 10
|
||||
|
||||
#ifndef MAX_PROC_EVENTS
|
||||
#define MAX_PROC_EVENTS 20
|
||||
#endif
|
||||
#define MAX_PROC_EVENT_SIZE X25_CALL_STR_SZ+200+1
|
||||
|
||||
|
||||
/*#define MAX_TX_BUF 10*/
|
||||
#define MAX_TX_BUF 32
|
||||
#define MAX_ATM_TX_BUF 35
|
||||
#define MAX_RX_Q 128
|
||||
|
||||
#define WPLIP_MAGIC_LINK 0xDAFE1234
|
||||
#define WPLIP_MAGIC_DEV 0xDAFE4321
|
||||
#define WPLIP_MAGIC_DEV_EL 0xDAFE4444
|
||||
|
||||
#define WPLIP_ASSERT_MAGIC(ptr,magic,ret) \
|
||||
if ((*(unsigned long*)ptr) != magic) { \
|
||||
DEBUG_EVENT("%s:%d: Error Invalid Magic number in Link dev!\n", \
|
||||
__FUNCTION__,__LINE__); \
|
||||
return ret ; \
|
||||
}
|
||||
#define WPLIP_ASSERT_MAGIC_VOID(ptr,magic) \
|
||||
if ((*(unsigned long*)ptr) != magic) { \
|
||||
DEBUG_EVENT("%s:%d: Error Invalid Magic number in Link dev!\n", \
|
||||
__FUNCTION__,__LINE__); \
|
||||
return; \
|
||||
}
|
||||
|
||||
struct wplip_dev;
|
||||
|
||||
WAN_LIST_HEAD(wplip_link_list,wplip_link);
|
||||
|
||||
typedef struct wplip_link
|
||||
{
|
||||
unsigned long magic;
|
||||
WAN_LIST_ENTRY(wplip_link) list_entry;
|
||||
|
||||
/* List of all Logic channel
|
||||
* devices attached to the link
|
||||
*
|
||||
* Packet direction UP
|
||||
* */
|
||||
WAN_LIST_HEAD(,wplip_dev) list_head_ifdev;
|
||||
unsigned int dev_cnt;
|
||||
wan_rwlock_t dev_list_lock;
|
||||
|
||||
|
||||
/* List of Tx Devices attached
|
||||
* to the Link.
|
||||
*
|
||||
* Packet direction DOWN
|
||||
*
|
||||
* Eg. Load balancing over multiple
|
||||
* links */
|
||||
|
||||
WAN_LIST_HEAD(,wplip_dev_list) list_head_tx_ifdev;
|
||||
unsigned int tx_dev_cnt;
|
||||
wan_rwlock_t tx_dev_list_lock;
|
||||
|
||||
|
||||
unsigned char state;
|
||||
unsigned char carrier_state;
|
||||
unsigned char prot_state;
|
||||
|
||||
void *prot;
|
||||
wan_timer_t prot_timer;
|
||||
|
||||
unsigned char protocol;
|
||||
|
||||
|
||||
/* Internal control information */
|
||||
wan_timer_info_t timer;
|
||||
|
||||
unsigned long tq_working;
|
||||
|
||||
wan_rwlock_t map_lock;
|
||||
void *api_sk_id;
|
||||
|
||||
wan_spinlock_t bh_lock;
|
||||
|
||||
unsigned char name [MAX_PROC_NAME];
|
||||
#if 0
|
||||
struct proc_dir_entry *proc_dir;
|
||||
unsigned char *proc_event_log [MAX_PROC_EVENTS];
|
||||
atomic_t proc_event_offset;
|
||||
#endif
|
||||
|
||||
wan_skb_queue_t tx_queue;
|
||||
wan_skb_queue_t rx_queue;
|
||||
wan_tasklet_t task;
|
||||
|
||||
struct wplip_dev *cur_tx;
|
||||
|
||||
int link_num;
|
||||
|
||||
atomic_t refcnt;
|
||||
|
||||
unsigned char tty_opt;
|
||||
|
||||
#ifdef WPLIP_TTY_SUPPORT
|
||||
struct tty_struct *tty;
|
||||
unsigned int tty_minor;
|
||||
unsigned int tty_open;
|
||||
unsigned char *tty_buf;
|
||||
wan_skb_queue_t tty_rx;
|
||||
wan_taskq_t tty_task_queue;
|
||||
unsigned char async_mode;
|
||||
#endif
|
||||
|
||||
wan_taskq_t prot_task;
|
||||
u32 latency_qlen;
|
||||
|
||||
} wplip_link_t;
|
||||
|
||||
|
||||
#define CALL_REQUEST_INFO_SZ 512
|
||||
|
||||
|
||||
/*
|
||||
* The logic channel per link connection control structure.
|
||||
*/
|
||||
typedef struct wplip_dev{
|
||||
|
||||
wanpipe_common_t common;
|
||||
|
||||
unsigned long magic;
|
||||
WAN_LIST_ENTRY(wplip_dev) list_entry;
|
||||
|
||||
unsigned short critical;
|
||||
|
||||
/* Internal control information */
|
||||
wan_skb_queue_t tx_queue;
|
||||
|
||||
/* The link we are part of */
|
||||
wplip_link_t *lip_link;
|
||||
|
||||
void *sk_id;
|
||||
unsigned char api_state;
|
||||
#if defined(__LINUX__)
|
||||
struct proc_dir_entry *dent;
|
||||
#endif
|
||||
struct net_device_stats ifstats;
|
||||
|
||||
unsigned char used;
|
||||
unsigned char protocol;
|
||||
|
||||
unsigned char name[MAX_PROC_NAME];
|
||||
|
||||
unsigned char udp_pkt_data[sizeof(wan_udp_pkt_t)+10];
|
||||
unsigned int udp_pkt_len;
|
||||
|
||||
unsigned long ipx_net_num;
|
||||
|
||||
unsigned int prot_addr;
|
||||
|
||||
unsigned int max_mtu_sz;
|
||||
unsigned int max_mtu_sz_orig;
|
||||
|
||||
atomic_t refcnt;
|
||||
pid_t pid;
|
||||
|
||||
unsigned int interface_down;
|
||||
wan_taskq_t if_task;
|
||||
|
||||
} wplip_dev_t;
|
||||
|
||||
typedef struct wplip_dev_list
|
||||
{
|
||||
unsigned long magic;
|
||||
netdevice_t *dev;
|
||||
WAN_LIST_ENTRY(wplip_dev_list) list_entry;
|
||||
}wplip_dev_list_t;
|
||||
|
||||
|
||||
typedef struct wplip_prot_iface
|
||||
{
|
||||
unsigned int init;
|
||||
wplip_prot_reg_t reg;
|
||||
void*(*prot_link_register)(void *link_ptr,
|
||||
char *devname,
|
||||
void *cfg,
|
||||
wplip_prot_reg_t *reg);
|
||||
|
||||
int (*prot_link_unregister)(void *prot_ptr);
|
||||
|
||||
void*(*prot_chan_register)(void *if_ptr,
|
||||
void *prot_ptr,
|
||||
char *devname,
|
||||
void *cfg,
|
||||
unsigned char type);
|
||||
|
||||
int (*prot_chan_unregister)(void *chan_ptr);
|
||||
|
||||
int (*open_chan) (void *chan_ptr);
|
||||
int (*close_chan)(void *chan_ptr);
|
||||
|
||||
int (*tx) (void *chan_ptr, void *skb, int type);
|
||||
int (*ioctl) (void *chan_ptr, int cmd, void *arg);
|
||||
int (*pipemon)(void *chan,
|
||||
int cmd,
|
||||
int dlci,
|
||||
unsigned char* data,
|
||||
unsigned int *len);
|
||||
|
||||
int (*rx) (void *prot_ptr, void *rx_pkt);
|
||||
int (*timer) (void *prot_ptr, unsigned int *period, unsigned int);
|
||||
int (*bh) (void *);
|
||||
int (*snmp) (void *, void *);
|
||||
int (*task) (void *prot_ptr);
|
||||
|
||||
}wplip_prot_iface_t;
|
||||
|
||||
#define MAX_LIP_PROTOCOLS 255
|
||||
|
||||
#define WPLIP_PROT_ASSERT(prot,ret) \
|
||||
if (prot >= MAX_LIP_PROTOCOLS){ \
|
||||
DEBUG_EVENT("%s:%d: Lip Error: Invalid Protocol 0x%X\n",\
|
||||
__FUNCTION__,__LINE__,prot);\
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define WPLIP_PROT_FUNC_ASSERT(prot,func,ret) \
|
||||
if (prot->func == NULL){ \
|
||||
DEBUG_EVENT("%s:%d: Lip Error: Protocol function not supported\n",\
|
||||
__FUNCTION__,__LINE__);\
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define WPLIP_PROT_EXIST(prot,ret) \
|
||||
if (wplip_prot_ops[prot] == NULL){ \
|
||||
DEBUG_EVENT("%s:%d: Lip Error: Unsupported/UnCompiled Protocol 0x%X\n",\
|
||||
__FUNCTION__,__LINE__,prot);\
|
||||
return ret; \
|
||||
}
|
||||
|
||||
|
||||
#define wplip_hold(_dev) wan_atomic_inc(&(_dev)->refcnt)
|
||||
#define wplip_put(_dev) wan_atomic_dec(&(_dev)->refcnt)
|
||||
|
||||
#define wplip_get_link(_reg) (_reg)->wplip_link
|
||||
#define wplip_get_lipdev(_dev) (wplip_dev_t*)wan_netif_priv((_dev))
|
||||
|
||||
#define wplip_liplink_magic(_link) ((_link)->magic == WPLIP_MAGIC_LINK)
|
||||
#define wplip_lipdev_magic(_lipdev) ((_lipdev)->magic == WPLIP_MAGIC_DEV)
|
||||
|
||||
|
||||
/* Function Prototypes */
|
||||
|
||||
/* wanpipe_lip_iface.c */
|
||||
extern unsigned char wplip_link_num[];
|
||||
extern wan_rwlock_t wplip_link_lock;
|
||||
extern struct wplip_link_list list_head_link;
|
||||
extern int wplip_data_rx_up(wplip_dev_t* lip_dev, void *skb);
|
||||
extern int wplip_data_tx_down(wplip_link_t *lip_link, void *skb);
|
||||
extern int wplip_callback_tx_down(void *lip_dev, void *skb);
|
||||
extern int wplip_link_callback_tx_down(void *lip_link, void *skb);
|
||||
extern int wplip_callback_kick_prot_task(void *lip_link);
|
||||
extern int wplip_set_hw_idle_frame (void *liplink_ptr, unsigned char *data, int len);
|
||||
|
||||
/* wanpipe_lip_sub.c */
|
||||
extern wplip_link_t* wplip_create_link(char *devname);
|
||||
extern void wplip_remove_link(wplip_link_t *lip_link);
|
||||
extern void wplip_insert_link(wplip_link_t *lip_link);
|
||||
extern int wplip_link_exists(wplip_link_t *lip_link);
|
||||
extern void wplip_free_link(wplip_link_t *lip_link);
|
||||
extern int wplip_lipdev_latency_change(wplip_link_t *lip_link);
|
||||
|
||||
|
||||
#if 1
|
||||
extern wplip_dev_t* wplip_create_lipdev(char *dev_name,int);
|
||||
#else
|
||||
extern wplip_dev_t* wplip_create_lipdev(char *dev_name);
|
||||
#endif
|
||||
extern void wplip_free_lipdev(wplip_dev_t *lip_dev);
|
||||
extern int wplip_lipdev_exists(wplip_link_t *lip_link, char *dev_name);
|
||||
extern void wplip_remove_lipdev(wplip_link_t *lip_link,
|
||||
wplip_dev_t *lip_dev);
|
||||
extern void wplip_insert_lipdev(wplip_link_t *wplip_link,
|
||||
wplip_dev_t *wplip_dev);
|
||||
|
||||
extern unsigned int dec_to_uint (unsigned char* str, int len);
|
||||
|
||||
/* wanpipe_lip_netdev.c */
|
||||
extern int wplip_open_dev(netdevice_t *dev);
|
||||
extern int wplip_stop_dev(netdevice_t *dev);
|
||||
extern struct net_device_stats * wplip_ifstats (netdevice_t *dev);
|
||||
extern int wplip_if_send (netskb_t *skb, netdevice_t *dev);
|
||||
extern int wplip_if_init(netdevice_t *dev);
|
||||
extern void wplip_kick(void *wplip_id,int reason);
|
||||
|
||||
|
||||
# ifdef WPLIP_TTY_SUPPORT
|
||||
/* wanpipe_lip_tty.c */
|
||||
extern int wplip_reg_tty(wplip_link_t *lip_link, wanif_conf_t *conf);
|
||||
extern int wplip_unreg_tty(wplip_link_t *lip_link);
|
||||
extern int wanpipe_tty_trigger_poll(wplip_link_t *lip_link);
|
||||
extern void wplip_tty_receive(wplip_link_t *lip_link, void *skb);
|
||||
#endif
|
||||
|
||||
/* wanpipe_lip_prot.c */
|
||||
extern int wplip_init_prot(void);
|
||||
extern int wplip_free_prot(void);
|
||||
extern int wplip_reg_link_prot(wplip_link_t *lip_link, wanif_conf_t *conf);
|
||||
extern int wplip_unreg_link_prot(wplip_link_t *lip_link);
|
||||
extern int wplip_reg_lipdev_prot(wplip_dev_t *lip_dev, wanif_conf_t *conf);
|
||||
extern int wplip_unreg_lipdev_prot(wplip_dev_t *lip_dev);
|
||||
extern int wplip_open_lipdev_prot(wplip_dev_t *lip_dev);
|
||||
extern int wplip_close_lipdev_prot(wplip_dev_t *lip_dev);
|
||||
extern int wplip_prot_rx(wplip_link_t *lip_link, netskb_t *skb);
|
||||
|
||||
#if 0
|
||||
extern void wplip_prot_rx_kick(wplip_dev_t *lip_dev);
|
||||
#endif
|
||||
extern int wplip_prot_kick(wplip_link_t *lip_link, wplip_dev_t *lip_dev);
|
||||
extern int wplip_prot_tx(wplip_dev_t *lip_dev, wan_api_tx_hdr_t *api_tx_hdr, netskb_t *skb, int type);
|
||||
extern int wplip_prot_oob(wplip_dev_t *lip_dev, unsigned char*, int reason);
|
||||
extern int wplip_prot_ioctl(wplip_dev_t *lip_dev, int cmd, void *arg);
|
||||
extern int wplip_prot_udp_mgmt_pkt(wplip_dev_t * lip_dev, wan_udp_pkt_t *wan_udp_pkt);
|
||||
extern int wplip_prot_udp_snmp_pkt(wplip_dev_t * lip_dev, int cmd, struct ifreq* ifr);
|
||||
|
||||
|
||||
extern int wplip_link_prot_change_state(void *wplip_id,
|
||||
int state,
|
||||
unsigned char*,int);
|
||||
extern int wplip_lipdev_prot_change_state(void *wplip_id,
|
||||
int state,
|
||||
unsigned char*,int);
|
||||
|
||||
|
||||
extern unsigned int wplip_get_ipv4_addr (void *wplip_id, int type);
|
||||
extern int wplip_set_ipv4_addr (void *wplip_id,
|
||||
unsigned int,
|
||||
unsigned int,
|
||||
unsigned int,
|
||||
unsigned int);
|
||||
extern void wplip_add_gateway(void *wplip_id);
|
||||
extern void wplip_trigger_if_task(wplip_dev_t *lip_dev);
|
||||
|
||||
void wplip_ipxwan_switch_net_num(unsigned char *sendpacket,
|
||||
unsigned long network_number,
|
||||
unsigned long *orig_dnet,
|
||||
unsigned long *orig_snet,
|
||||
unsigned char incoming);
|
||||
|
||||
|
||||
void wplip_ipxwan_restore_net_num(unsigned char *sendpacke,
|
||||
unsigned long orig_dnet,
|
||||
unsigned long orig_snet);
|
||||
|
||||
|
||||
int wplip_handle_ipxwan(wplip_dev_t *lip_dev, void *skb);
|
||||
|
||||
#if 0
|
||||
extern int gdbg_flag;
|
||||
#endif
|
||||
|
||||
static __inline int wplip_trigger_bh(wplip_link_t *lip_link)
|
||||
{
|
||||
if (wan_test_bit(WPLIP_LINK_DOWN,&lip_link->tq_working)){
|
||||
return -ENETDOWN;
|
||||
}
|
||||
|
||||
if (wan_skb_queue_len(&lip_link->rx_queue)){
|
||||
WAN_TASKLET_SCHEDULE((&lip_link->task));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wan_test_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working)){
|
||||
#if 0
|
||||
if (gdbg_flag){
|
||||
DEBUG_EVENT("%s: Waiting for kick!\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
#endif
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
#if 0
|
||||
gdbg_flag=0;
|
||||
#endif
|
||||
WAN_TASKLET_SCHEDULE((&lip_link->task));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline int wplip_kick_trigger_bh(wplip_link_t *lip_link)
|
||||
{
|
||||
wan_clear_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working);
|
||||
WAN_TASKLET_SCHEDULE((&lip_link->task));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline int wplip_decode_protocol(wplip_dev_t *lip_dev, void *ptr)
|
||||
{
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
struct sockaddr *sa = (struct sockaddr *)ptr;
|
||||
|
||||
|
||||
switch (sa->sa_family){
|
||||
|
||||
case AF_INET:
|
||||
return WPLIP_IP;
|
||||
case AF_INET6:
|
||||
return WPLIP_IPV6;
|
||||
case AF_IPX:
|
||||
return WPLIP_IPX;
|
||||
default:
|
||||
return WPLIP_IP;
|
||||
}
|
||||
|
||||
#elif defined(__LINUX__)
|
||||
struct sk_buff *skb=(struct sk_buff*)ptr;
|
||||
|
||||
if (lip_dev->common.usedby == BRIDGE ||
|
||||
lip_dev->common.usedby == BRIDGE_NODE){
|
||||
return WPLIP_ETH;
|
||||
|
||||
}
|
||||
|
||||
if (lip_dev->common.lip_prot == WANCONFIG_LAPD) {
|
||||
return WPLIP_LAPD;
|
||||
}
|
||||
|
||||
if (lip_dev->common.usedby == STACK){
|
||||
switch (lip_dev->common.lip_prot){
|
||||
case WANCONFIG_PPP:
|
||||
case WANCONFIG_TTY:
|
||||
return WPLIP_PPP;
|
||||
case WANCONFIG_FR:
|
||||
return WPLIP_FR;
|
||||
}
|
||||
/* Break out down */
|
||||
}
|
||||
|
||||
switch (htons(skb->protocol)){
|
||||
|
||||
case ETH_P_IP:
|
||||
return WPLIP_IP;
|
||||
case ETH_P_IPV6:
|
||||
return WPLIP_IPV6;
|
||||
case ETH_P_IPX:
|
||||
return WPLIP_IPX;
|
||||
}
|
||||
|
||||
return WPLIP_IP;
|
||||
#else
|
||||
# error ("wplip_decode_protocol: Unknown Protocol!\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if defined(__LINUX__)
|
||||
static __inline void wp_lip_config_bridge_mode(wplip_dev_t *lip_dev)
|
||||
{
|
||||
netdevice_t * dev = lip_dev->common.dev;
|
||||
/* Setup the interface for Bridging */
|
||||
int hw_addr=0;
|
||||
ether_setup(dev);
|
||||
|
||||
/* Use a random number to generate the MAC address */
|
||||
memcpy(dev->dev_addr, "\xFE\xFC\x00\x00\x00\x00", 6);
|
||||
get_random_bytes(&hw_addr, sizeof(hw_addr));
|
||||
*(int *)(dev->dev_addr + 2) += hw_addr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*__KERNEL__*/
|
||||
#endif
|
||||
|
||||
/*_WANPIPE_X25_HEADER_*/
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define WPLIP_ASSERT(reg,ret) if (!(reg)) {\
|
||||
DEBUG_EVENT("%s:%d Assert Error!\n", \
|
||||
__FUNCTION__,__LINE__); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define WPLIP_ASSERT_VOID(reg) if (!(reg)) {\
|
||||
DEBUG_EVENT("%s:%d Assert Error!\n", \
|
||||
__FUNCTION__,__LINE__); \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define FUNC_BEGIN() DEBUG_EVENT("%s:%d ---Begin---\n",__FUNCTION__,__LINE__);
|
||||
#define FUNC_END() DEBUG_EVENT("%s:%d ---End---\n\n",__FUNCTION__,__LINE__);
|
||||
|
||||
|
||||
#define X25_DEBUG_MEM
|
||||
|
||||
#ifdef X25_DEBUG_MEM
|
||||
|
||||
#define X25_SKB_DEC(x) atomic_sub(x,&x25_skb_alloc)
|
||||
#define X25_SKB_INC(x) atomic_add(x,&x25_skb_alloc)
|
||||
|
||||
#define ALLOC_SKB(skb,len) { skb = dev_alloc_skb(len); \
|
||||
if (skb != NULL){ X25_SKB_INC(skb->truesize);}else{ WAN_MEM_ASSERT("X25");} }
|
||||
#define KFREE_SKB(skb) { X25_SKB_DEC(skb->truesize); dev_kfree_skb_any(skb); }
|
||||
|
||||
|
||||
#define X25_MEM_DEC(x) atomic_sub(x,&x25_mem_alloc)
|
||||
#define X25_MEM_INC(x) atomic_add(x,&x25_mem_alloc)
|
||||
|
||||
#define KMALLOC(ptr,len,flag) { ptr=kmalloc(len, flag); \
|
||||
if (ptr != NULL){ X25_MEM_INC(len);} else {WAN_MEM_ASSERT("X25");}}
|
||||
#define KFREE(ptr) {X25_MEM_DEC(sizeof(*ptr)); kfree(ptr);}
|
||||
|
||||
#else
|
||||
#define KMALLOC(ptr,len,flag) ptr=kmalloc(len, flag)
|
||||
#define KFREE(ptr) kfree(ptr)
|
||||
|
||||
#define ALLOC_SKB(new_skb,len, dsp) new_skb = dev_alloc_skb(len)
|
||||
#define KFREE_SKB(skb) dev_kfree_skb_any(skb)
|
||||
|
||||
#define X25_SKB_DEC(x)
|
||||
#define X25_SKB_INC(x)
|
||||
#define X25_MEM_DEC(x)
|
||||
#define X25_MEM_INC(x)
|
||||
#endif
|
||||
|
||||
#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
|
|
@ -2,13 +2,13 @@
|
|||
#define __WANPIPE_VERSION__
|
||||
|
||||
|
||||
#define WANPIPE_COPYRIGHT_DATES "(c) 1994-2007"
|
||||
#define WANPIPE_COPYRIGHT_DATES "(c) 1994-2008"
|
||||
#define WANPIPE_COMPANY "Sangoma Technologies Inc"
|
||||
|
||||
/********** LINUX **********/
|
||||
#define WANPIPE_VERSION "3.2.1"
|
||||
#define WANPIPE_VERSION "3.2.2"
|
||||
#define WANPIPE_SUB_VERSION "0"
|
||||
#define WANPIPE_VERSION_BETA 1
|
||||
#define WANPIPE_VERSION_BETA 0
|
||||
#define WANPIPE_LITE_VERSION "1.1.1"
|
||||
|
||||
/********** FreeBSD **********/
|
||||
|
|
|
@ -402,6 +402,8 @@ typedef struct wan_device
|
|||
unsigned char (*read_ec)(void*, unsigned short);
|
||||
int (*hwec_reset)(void* card_id, int);
|
||||
int (*hwec_enable)(void* card_id, int, int);
|
||||
|
||||
void (*critical_event) (void *, int);
|
||||
} wan_device_t;
|
||||
|
||||
WAN_LIST_HEAD(wan_devlist_, wan_device);
|
||||
|
|
|
@ -123,7 +123,6 @@ static int wplip_bh_transmit(wplip_link_t *lip_link)
|
|||
|
||||
if (WAN_NETIF_QUEUE_STOPPED(lip_dev->common.dev)){
|
||||
if (lip_dev->common.usedby == API){
|
||||
DEBUG_TEST("%s: Api waking stack!\n",lip_dev->name);
|
||||
WAN_NETIF_START_QUEUE(lip_dev->common.dev);
|
||||
#if defined(__LINUX__)
|
||||
wan_wakeup_api(lip_dev);
|
||||
|
|
|
@ -0,0 +1,237 @@
|
|||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
# include <wanpipe_lip.h>
|
||||
#else
|
||||
#include <linux/wanpipe_lip.h>
|
||||
#endif
|
||||
|
||||
#if defined(__LINUX__)
|
||||
void wplip_link_bh(unsigned long data);
|
||||
#else
|
||||
void wplip_link_bh(void* data, int pending);
|
||||
#endif
|
||||
|
||||
static int wplip_bh_receive(wplip_link_t *lip_link)
|
||||
{
|
||||
netskb_t *skb;
|
||||
unsigned long timeout_cnt = 2000;
|
||||
int err;
|
||||
|
||||
while((skb=wan_skb_dequeue(&lip_link->rx_queue)) != NULL){
|
||||
|
||||
err=wplip_prot_rx(lip_link,skb);
|
||||
if (err){
|
||||
wan_skb_free(skb);
|
||||
}
|
||||
|
||||
if (--timeout_cnt == 0){
|
||||
DEBUG_EVENT("%s: Link RxBH Time squeeze\n",lip_link->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wplip_bh_transmit(wplip_link_t *lip_link)
|
||||
{
|
||||
netskb_t *skb;
|
||||
wplip_dev_t *lip_dev=NULL;
|
||||
int err=0;
|
||||
unsigned int timeout_cnt=1000;
|
||||
|
||||
if (wan_test_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working)){
|
||||
if (wan_test_bit(WPLIP_KICK,&lip_link->tq_working)){
|
||||
DEBUG_TEST("%s: KICK but await still set!\n",
|
||||
lip_link->name);
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
wan_clear_bit(WPLIP_KICK,&lip_link->tq_working);
|
||||
wan_clear_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working);
|
||||
|
||||
wan_clear_bit(WPLIP_MORE_LINK_TX,&lip_link->tq_working);
|
||||
|
||||
while((skb=wan_skb_dequeue(&lip_link->tx_queue))){
|
||||
err=wplip_data_tx_down(lip_link,skb);
|
||||
if (err != 0){
|
||||
wan_skb_queue_head(&lip_link->tx_queue,skb);
|
||||
wan_set_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working);
|
||||
goto wplip_bh_link_transmit_exit;
|
||||
}
|
||||
|
||||
if (--timeout_cnt == 0){
|
||||
DEBUG_EVENT("%s: Link TxBH Time squeeze\n",lip_link->name);
|
||||
goto wplip_bh_link_transmit_exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ((lip_dev=lip_link->cur_tx) != NULL){
|
||||
|
||||
if (lip_dev->magic != WPLIP_MAGIC_DEV){
|
||||
DEBUG_EVENT("%s: Error1: Invalid Dev Magic dev=%p Magic=0x%lX\n",
|
||||
lip_link->name,
|
||||
lip_dev,
|
||||
lip_dev->magic);
|
||||
goto wplip_bh_transmit_exit;
|
||||
}
|
||||
|
||||
}else{
|
||||
lip_dev=WAN_LIST_FIRST(&lip_link->list_head_ifdev);
|
||||
if (!lip_dev){
|
||||
goto wplip_bh_transmit_exit;
|
||||
}
|
||||
|
||||
if (lip_dev->magic != WPLIP_MAGIC_DEV){
|
||||
DEBUG_EVENT("%s: Error2: Invalid Dev Magic dev=%p Magic=0x%lX\n",
|
||||
lip_link->name,
|
||||
lip_dev,
|
||||
lip_dev->magic);
|
||||
goto wplip_bh_transmit_exit;
|
||||
}
|
||||
|
||||
lip_link->cur_tx=lip_dev;
|
||||
}
|
||||
|
||||
for (;;){
|
||||
|
||||
if (--timeout_cnt == 0){
|
||||
DEBUG_EVENT("%s: LipDev TxBH Time squeeze\n",lip_link->name);
|
||||
goto wplip_bh_transmit_exit;
|
||||
}
|
||||
|
||||
if (wan_test_bit(WPLIP_DEV_UNREGISTER,&lip_dev->critical)){
|
||||
goto wplip_bh_transmit_skip;
|
||||
}
|
||||
|
||||
skb=wan_skb_dequeue(&lip_dev->tx_queue);
|
||||
if (skb){
|
||||
int len=wan_skb_len(skb);
|
||||
|
||||
err=wplip_data_tx_down(lip_link,skb);
|
||||
if (err != 0){
|
||||
wan_skb_queue_head(&lip_dev->tx_queue,skb);
|
||||
wan_set_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working);
|
||||
goto wplip_bh_transmit_exit;
|
||||
}
|
||||
|
||||
lip_dev->ifstats.tx_packets++;
|
||||
lip_dev->ifstats.tx_bytes += len;
|
||||
|
||||
}
|
||||
|
||||
if (WAN_NETIF_QUEUE_STOPPED(lip_dev->common.dev)){
|
||||
if (lip_dev->common.usedby == API){
|
||||
#warning "NENAD"
|
||||
DEBUG_EVENT("%s: Api waking stack!\n",lip_dev->name);
|
||||
WAN_NETIF_START_QUEUE(lip_dev->common.dev);
|
||||
#if defined(__LINUX__)
|
||||
wan_wakeup_api(lip_dev);
|
||||
#endif
|
||||
}else if (lip_dev->common.lip){ /*STACK*/
|
||||
WAN_NETIF_START_QUEUE(lip_dev->common.dev);
|
||||
wplip_kick(lip_dev->common.lip,0);
|
||||
|
||||
}else{
|
||||
WAN_NETIF_WAKE_QUEUE (lip_dev->common.dev);
|
||||
}
|
||||
}
|
||||
|
||||
if (wan_skb_queue_len(&lip_dev->tx_queue)){
|
||||
wan_set_bit(WPLIP_MORE_LINK_TX,&lip_link->tq_working);
|
||||
}
|
||||
|
||||
wplip_prot_kick(lip_link,lip_dev);
|
||||
|
||||
wplip_bh_transmit_skip:
|
||||
|
||||
lip_dev=WAN_LIST_NEXT(lip_dev,list_entry);
|
||||
if (lip_dev == NULL){
|
||||
lip_dev=WAN_LIST_FIRST(&lip_link->list_head_ifdev);
|
||||
}
|
||||
|
||||
if (lip_dev == lip_link->cur_tx){
|
||||
/* We went through the whole list */
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wplip_bh_transmit_exit:
|
||||
|
||||
lip_link->cur_tx=lip_dev;
|
||||
|
||||
wplip_bh_link_transmit_exit:
|
||||
|
||||
if (wan_skb_queue_len(&lip_link->tx_queue)){
|
||||
wan_set_bit(WPLIP_MORE_LINK_TX,&lip_link->tq_working);
|
||||
}
|
||||
|
||||
if (wan_test_bit(WPLIP_MORE_LINK_TX,&lip_link->tq_working)){
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static int wplip_retrigger_bh(wplip_link_t *lip_link)
|
||||
{
|
||||
if (wan_test_bit(WPLIP_MORE_LINK_TX, &lip_link->tq_working) ||
|
||||
wan_skb_queue_len(&lip_link->rx_queue)){
|
||||
return wplip_trigger_bh(lip_link);
|
||||
}
|
||||
#if 0
|
||||
if (gdbg_flag){
|
||||
DEBUG_EVENT("%s: Not triggered\n", __FUNCTION__);
|
||||
}
|
||||
#endif
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__LINUX__)
|
||||
void wplip_link_bh(unsigned long data)
|
||||
#else
|
||||
void wplip_link_bh(void* data, int pending)
|
||||
#endif
|
||||
{
|
||||
wplip_link_t *lip_link = (wplip_link_t *)data;
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
wan_smp_flag_t s;
|
||||
#endif
|
||||
|
||||
DEBUG_TEST("%s: Link BH\n",__FUNCTION__);
|
||||
|
||||
if (wan_test_bit(WPLIP_LINK_DOWN,&lip_link->tq_working)){
|
||||
DEBUG_EVENT("%s: Link down in BH\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(__LINUX__)
|
||||
wan_spin_lock(&lip_link->bh_lock);
|
||||
#else
|
||||
wan_spin_lock_irq(NULL, &s);
|
||||
#endif
|
||||
wan_set_bit(WPLIP_BH_RUNNING,&lip_link->tq_working);
|
||||
|
||||
wplip_bh_receive(lip_link);
|
||||
|
||||
wplip_bh_transmit(lip_link);
|
||||
|
||||
wan_clear_bit(WPLIP_BH_RUNNING,&lip_link->tq_working);
|
||||
|
||||
WAN_TASKLET_END((&lip_link->task));
|
||||
|
||||
wplip_retrigger_bh(lip_link);
|
||||
|
||||
#if defined(__LINUX__)
|
||||
wan_spin_unlock(&lip_link->bh_lock);
|
||||
#else
|
||||
wan_spin_unlock_irq(NULL, &s);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -833,13 +833,14 @@ int wplip_lipdev_prot_change_state(void *wplip_id,int state,
|
|||
lip_dev->common.state = state;
|
||||
WAN_NETIF_CARRIER_ON(lip_dev->common.dev);
|
||||
WAN_NETIF_START_QUEUE(lip_dev->common.dev);
|
||||
wan_update_api_state(lip_dev);
|
||||
}else{
|
||||
lip_dev->common.state = state;
|
||||
WAN_NETIF_CARRIER_OFF(lip_dev->common.dev);
|
||||
WAN_NETIF_STOP_QUEUE(lip_dev->common.dev);
|
||||
}
|
||||
|
||||
wan_update_api_state(lip_dev);
|
||||
|
||||
wplip_trigger_bh(lip_dev->lip_link);
|
||||
|
||||
}else if (lip_dev->common.lip) { /*STACK*/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,612 @@
|
|||
/*************************************************************
|
||||
* wanpipe_lip_netdev.c WANPIPE Link Interface Protocol Layer (LIP)
|
||||
*
|
||||
*
|
||||
*
|
||||
* ===========================================================
|
||||
*
|
||||
* Mar 30 2004 Nenad Corbic Initial Driver
|
||||
*/
|
||||
|
||||
|
||||
/*=============================================================
|
||||
* Includes
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
# include <wanpipe_lip.h>
|
||||
#else
|
||||
# include <linux/wanpipe_lip.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*=============================================================
|
||||
* Definitions
|
||||
*/
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
int wplip_if_output (netdevice_t* dev,netskb_t* skb,struct sockaddr* sa, struct rtentry* rt);
|
||||
#endif
|
||||
|
||||
char* get_master_dev_name(wplip_link_t *lip_link);
|
||||
|
||||
/*==============================================================
|
||||
* wplip_open_dev
|
||||
*
|
||||
* Description:
|
||||
* This function enables the svc network device, and
|
||||
* sets it up for data transfer.
|
||||
*
|
||||
* It is called by the kernel during interfaces
|
||||
* startup via ifconfig:
|
||||
* ex: ifconfig wp1_svc up
|
||||
*
|
||||
* If the network device contains IP data, its
|
||||
* operation mode is set to TCP/IP otherwise,
|
||||
* the opteration mode is API.
|
||||
*
|
||||
* Usedby:
|
||||
* Kernel during ifconfig system call.
|
||||
*/
|
||||
|
||||
int wplip_open_dev(netdevice_t *dev)
|
||||
{
|
||||
wplip_dev_t *lip_dev = (wplip_dev_t *)wan_netif_priv(dev);
|
||||
|
||||
if (!lip_dev || !lip_dev->lip_link){
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#if defined(__LINUX__)
|
||||
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
|
||||
if (netif_running(dev))
|
||||
return -EBUSY;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/* Done in if register now, do it interface up down
|
||||
* feature on 2.4 kernels */
|
||||
err=wplip_open_lipdev_prot(lip_dev);
|
||||
if (err){
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(WANPIPE_LIP_IFNET_QUEUE_POLICY_INIT_OFF)
|
||||
if (lip_dev->lip_link->state == WAN_CONNECTED){
|
||||
WAN_NETIF_CARRIER_ON(dev);
|
||||
WAN_NETIF_WAKE_QUEUE(dev);
|
||||
}
|
||||
#else
|
||||
if (lip_dev->lip_link->state == WAN_CONNECTED){
|
||||
WAN_NETIF_CARRIER_ON(dev);
|
||||
}
|
||||
WAN_NETIF_WAKE_QUEUE(dev);
|
||||
#endif
|
||||
|
||||
if (!wan_test_bit(WAN_DEV_READY,&lip_dev->interface_down)) {
|
||||
wan_set_bit(WAN_DEV_READY,&lip_dev->interface_down);
|
||||
wplip_trigger_if_task(lip_dev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*==============================================================
|
||||
* wplip_stop_dev
|
||||
*
|
||||
* Description:
|
||||
* This function disables the svc network device.
|
||||
*
|
||||
* It is called by the kernel during interfaces
|
||||
* shutdown via ifconfig:
|
||||
* ex: ifconfig wp1_svc down
|
||||
*
|
||||
* If the svc is in connected state, the call
|
||||
* will be disconnected.
|
||||
*
|
||||
* Usedby:
|
||||
* Kernel during ifconfig system call.
|
||||
*/
|
||||
|
||||
int wplip_stop_dev(netdevice_t *dev)
|
||||
{
|
||||
|
||||
wplip_dev_t *lip_dev = (wplip_dev_t *)wan_netif_priv(dev);
|
||||
|
||||
if (!lip_dev || !lip_dev->lip_link){
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WPLIP_TTY_SUPPORT
|
||||
if (lip_dev->lip_link->tty_opt && lip_dev->lip_link->tty_open){
|
||||
tty_hangup(lip_dev->lip_link->tty);
|
||||
return -EBUSY;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* Done in if register now, do it interface up down
|
||||
* feature on 2.4 kernels */
|
||||
wplip_close_lipdev_prot(lip_dev);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*==============================================================
|
||||
* wplip_ifstats
|
||||
*
|
||||
* Description:
|
||||
* This fucntion interfaces the /proc file system
|
||||
* to the svc device. The svc keeps protocol and
|
||||
* packet statistcs. This function passes these
|
||||
* statistics to the /proc file system.
|
||||
*
|
||||
* Usedby:
|
||||
* Kernel /proc/net/dev file system
|
||||
*/
|
||||
static struct net_device_stats gstats;
|
||||
struct net_device_stats* wplip_ifstats (netdevice_t *dev)
|
||||
{
|
||||
wplip_dev_t *lip_dev = (wplip_dev_t *)wan_netif_priv(dev);
|
||||
|
||||
DEBUG_TEST("%s: LIP %s()\n",
|
||||
wan_netif_name(dev),__FUNCTION__);
|
||||
|
||||
if (lip_dev){
|
||||
return &lip_dev->ifstats;
|
||||
}
|
||||
|
||||
return &gstats;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*==============================================================
|
||||
* wplip_if_send
|
||||
*
|
||||
* Description:
|
||||
* Call back function used by the kernel or the
|
||||
* upper protocol layer to transmit data for each
|
||||
* svc withing the x25 link.
|
||||
*
|
||||
* Data can only be tranmsitted if the svc state
|
||||
* is connected.
|
||||
*
|
||||
* If state != CONNECTED && If svc mode=TCP/IP
|
||||
* place an x25 call and try to establish
|
||||
* connection.
|
||||
*
|
||||
* If state != CONNECTED && If svc mode=API
|
||||
* refuse the packet, and indicate to
|
||||
* the upper layer that the connection has
|
||||
* not been made.
|
||||
*
|
||||
*
|
||||
* Usedby:
|
||||
* Kernel TCP/IP stack or upper layers to transmit data.
|
||||
*/
|
||||
|
||||
#if defined(__LINUX__)
|
||||
int wplip_if_send (netskb_t* skb, netdevice_t* dev)
|
||||
#else
|
||||
int wplip_if_output (netdevice_t* dev,netskb_t* skb,struct sockaddr* sa, struct rtentry* rt)
|
||||
#endif
|
||||
{
|
||||
wplip_dev_t *lip_dev =wplip_get_lipdev(dev);
|
||||
wan_api_tx_hdr_t *api_tx_hdr =NULL;
|
||||
int err, type;
|
||||
|
||||
if (!lip_dev || !lip_dev->lip_link){
|
||||
WAN_NETIF_STOP_QUEUE(dev);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#if 1
|
||||
if (lip_dev->common.state != WAN_CONNECTED){
|
||||
#else
|
||||
if (lip_dev->lip_link->carrier_state != WAN_CONNECTED ||
|
||||
lip_dev->common.state != WAN_CONNECTED){
|
||||
#endif
|
||||
|
||||
#if defined(WANPIPE_LIP_IFNET_QUEUE_POLICY_INIT_OFF)
|
||||
/* This causes a buffer starvations on some
|
||||
* applications like OSPF, since packets are
|
||||
* trapped in the Interface TX queue */
|
||||
|
||||
WAN_NETIF_STOP_QUEUE(dev);
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
++lip_dev->ifstats.tx_carrier_errors;
|
||||
return 1;
|
||||
#else
|
||||
wan_skb_free(skb);
|
||||
lip_dev->ifstats.tx_carrier_errors++;
|
||||
WAN_NETIF_START_QUEUE(dev);
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*if (wan_skb_check(skb)){
|
||||
** if (wan_skb2buffer((void**)&skb)){
|
||||
** wan_skb_free(skb);
|
||||
** lip_dev->ifstats.tx_errors++;
|
||||
** WAN_NETIF_START_QUEUE(dev);
|
||||
** wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
** return 0;
|
||||
**
|
||||
** }
|
||||
**} */
|
||||
|
||||
if (lip_dev->common.usedby == API){
|
||||
if (wan_skb_len(skb) <= sizeof(wan_api_tx_hdr_t)){
|
||||
wan_skb_free(skb);
|
||||
lip_dev->ifstats.tx_errors++;
|
||||
WAN_NETIF_START_QUEUE(dev);
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
return 0;
|
||||
}
|
||||
api_tx_hdr=(wan_api_tx_hdr_t*)wan_skb_pull(skb,sizeof(wan_api_tx_hdr_t));
|
||||
|
||||
type = WPLIP_RAW;
|
||||
}else{
|
||||
#if defined(__LINUX__)
|
||||
type = wplip_decode_protocol(lip_dev,skb);
|
||||
#else
|
||||
type = wplip_decode_protocol(lip_dev,sa);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
err=wplip_prot_tx(lip_dev, api_tx_hdr, skb, type);
|
||||
switch (err){
|
||||
|
||||
case 0:
|
||||
/* Packet queued ok */
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
WAN_NETIF_START_QUEUE(dev);
|
||||
err=0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
/* Packet failed to queue layer busy */
|
||||
#warning "NENAD"
|
||||
DEBUG_EVENT("%s: Api Dev BUSY!\n",lip_dev->name);
|
||||
WAN_NETIF_STOP_QUEUE(dev);
|
||||
err=1;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Packet dropped due to error */
|
||||
WAN_NETIF_START_QUEUE(dev);
|
||||
lip_dev->ifstats.tx_errors++;
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
wan_skb_free(skb);
|
||||
err=0;
|
||||
break;
|
||||
}
|
||||
|
||||
wplip_trigger_bh(lip_dev->lip_link);
|
||||
|
||||
#if defined(__LINUX__)
|
||||
if (lip_dev->protocol != WANCONFIG_LIP_ATM) {
|
||||
if (dev->tx_queue_len < lip_dev->max_mtu_sz &&
|
||||
dev->tx_queue_len > 0) {
|
||||
DEBUG_EVENT("%s: Resizing Tx Queue Len to %li\n",
|
||||
lip_dev->name,dev->tx_queue_len);
|
||||
lip_dev->max_mtu_sz = dev->tx_queue_len;
|
||||
wplip_lipdev_latency_change(lip_dev->lip_link);
|
||||
|
||||
} else if (dev->tx_queue_len > lip_dev->max_mtu_sz &&
|
||||
lip_dev->max_mtu_sz != lip_dev->max_mtu_sz_orig) {
|
||||
DEBUG_EVENT("%s: Resizing Tx Queue Len to %i\n",
|
||||
lip_dev->name,lip_dev->max_mtu_sz_orig);
|
||||
lip_dev->max_mtu_sz = lip_dev->max_mtu_sz_orig;
|
||||
wplip_lipdev_latency_change(lip_dev->lip_link);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#if defined(__LINUX__)
|
||||
static void wplip_tx_timeout (netdevice_t *dev)
|
||||
{
|
||||
wplip_dev_t *lip_dev = (wplip_dev_t *)wan_netif_priv(dev);
|
||||
wplip_link_t *lip_link = lip_dev->lip_link;
|
||||
|
||||
/* If our device stays busy for at least 5 seconds then we will
|
||||
* kick start the device by making dev->tbusy = 0. We expect
|
||||
* that our device never stays busy more than 5 seconds. So this
|
||||
* is only used as a last resort.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
gdbg_flag=1;
|
||||
#endif
|
||||
wan_clear_bit(WPLIP_BH_AWAITING_KICK,&lip_link->tq_working);
|
||||
wplip_kick_trigger_bh(lip_link);
|
||||
|
||||
WAN_NETIF_WAKE_QUEUE (dev);
|
||||
|
||||
if (lip_dev->common.usedby == API){
|
||||
wan_update_api_state(lip_dev);
|
||||
}
|
||||
|
||||
wan_netif_set_ticks(dev, SYSTEM_TICKS);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int wplip_ioctl (netdevice_t *dev, struct ifreq *ifr, int cmd)
|
||||
{
|
||||
|
||||
wplip_dev_t *lip_dev= wplip_get_lipdev(dev);
|
||||
wplip_link_t *lip_link;
|
||||
wan_smp_flag_t flags;
|
||||
int err=0;
|
||||
wan_udp_pkt_t *wan_udp_pkt;
|
||||
|
||||
if (!lip_dev || !lip_dev->lip_link){
|
||||
DEBUG_EVENT("%s:%d: Assertion Error on lip_dev (%s)!\n",
|
||||
__FUNCTION__,__LINE__, wan_netif_name(dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
lip_link = lip_dev->lip_link;
|
||||
if (lip_link == NULL){
|
||||
DEBUG_EVENT("%s:%d: Assertion Error on lip_dev (%s)!\n",
|
||||
__FUNCTION__,__LINE__, wan_netif_name(dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (cmd){
|
||||
|
||||
#if defined(__LINUX__)
|
||||
case SIOC_WANPIPE_BIND_SK:
|
||||
if (ifr == NULL){
|
||||
err= -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
wan_spin_lock_irq(&lip_link->bh_lock,&flags);
|
||||
|
||||
if (lip_dev->common.usedby == API){
|
||||
dev->watchdog_timeo=HZ*60;
|
||||
}
|
||||
|
||||
err=wan_bind_api_to_svc(lip_dev,ifr->ifr_data);
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
break;
|
||||
|
||||
case SIOC_WANPIPE_UNBIND_SK:
|
||||
if (ifr == NULL){
|
||||
err= -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
wan_spin_lock_irq(&lip_link->bh_lock,&flags);
|
||||
err=wan_unbind_api_from_svc(lip_dev,ifr->ifr_data);
|
||||
if (lip_dev->common.usedby == API &&
|
||||
lip_dev->protocol == WANCONFIG_XDLC){
|
||||
wplip_close_lipdev_prot(lip_dev);
|
||||
}
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
break;
|
||||
|
||||
case SIOC_WANPIPE_CHECK_TX:
|
||||
case SIOC_ANNEXG_CHECK_TX:
|
||||
err=0;
|
||||
break;
|
||||
|
||||
case SIOC_WANPIPE_DEV_STATE:
|
||||
err = lip_dev->common.state;
|
||||
break;
|
||||
|
||||
case SIOC_ANNEXG_KICK:
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIOC_WANPIPE_PIPEMON:
|
||||
|
||||
wan_spin_lock_irq(&lip_link->bh_lock,&flags);
|
||||
if (lip_dev->udp_pkt_len != 0){
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
return -EBUSY;
|
||||
}
|
||||
lip_dev->udp_pkt_len = sizeof(wan_udp_hdr_t);
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
|
||||
wan_udp_pkt=(wan_udp_pkt_t*)&lip_dev->udp_pkt_data;
|
||||
if (WAN_COPY_FROM_USER(&wan_udp_pkt->wan_udp_hdr,ifr->ifr_data,sizeof(wan_udp_hdr_t))){
|
||||
lip_dev->udp_pkt_len=0;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
wan_spin_lock_irq(&lip_link->bh_lock,&flags);
|
||||
|
||||
if(wan_udp_pkt->wan_udp_command == WAN_GET_MASTER_DEV_NAME){
|
||||
char* master_dev_name;
|
||||
|
||||
master_dev_name = get_master_dev_name(lip_link);
|
||||
if(master_dev_name == NULL){
|
||||
|
||||
wan_udp_pkt->wan_udp_return_code = 1;
|
||||
wan_udp_pkt->wan_udp_data_len = 1;
|
||||
}else{
|
||||
strncpy(&wan_udp_pkt->wan_udp_data[0],
|
||||
master_dev_name,
|
||||
strlen(master_dev_name));
|
||||
wan_udp_pkt->wan_udp_return_code = 0;
|
||||
wan_udp_pkt->wan_udp_data_len = strlen(master_dev_name);
|
||||
}
|
||||
}else{
|
||||
if (wplip_prot_udp_mgmt_pkt(lip_dev,wan_udp_pkt) <= 0){
|
||||
lip_dev->udp_pkt_len=0;
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (lip_dev->udp_pkt_len > sizeof(wan_udp_pkt_t)){
|
||||
DEBUG_EVENT("%s: Error: Pipemon buf too bit on the way up! %i\n",
|
||||
lip_dev->name,lip_dev->udp_pkt_len);
|
||||
lip_dev->udp_pkt_len=0;
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
|
||||
/* This area will still be critical to other
|
||||
* PIPEMON commands due to udp_pkt_len
|
||||
* thus we can release the irq */
|
||||
|
||||
if (WAN_COPY_TO_USER(ifr->ifr_data,&wan_udp_pkt->wan_udp_hdr,sizeof(wan_udp_hdr_t))){
|
||||
lip_dev->udp_pkt_len=0;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
lip_dev->udp_pkt_len=0;
|
||||
return 0;
|
||||
|
||||
case SIOC_WANPIPE_SNMP:
|
||||
wplip_prot_udp_snmp_pkt(lip_dev,cmd,ifr);
|
||||
return 0;
|
||||
|
||||
case SIOC_WANPIPE_SNMP_IFSPEED:
|
||||
DEBUG_EVENT("%s: SNMP Speed not supported on protocol interface!\n",
|
||||
lip_dev->name);
|
||||
return -1;
|
||||
|
||||
default:
|
||||
|
||||
#if defined(__LINUX__)
|
||||
if (cmd >= SIOC_WANPIPE_DEVPRIVATE)
|
||||
{
|
||||
|
||||
wan_spin_lock_irq(&lip_link->bh_lock,&flags);
|
||||
cmd-=SIOC_WANPIPE_DEVPRIVATE;
|
||||
if (ifr == NULL){
|
||||
err=wplip_prot_ioctl(lip_dev,cmd,NULL);
|
||||
}else{
|
||||
err=wplip_prot_ioctl(lip_dev,cmd,ifr->ifr_data);
|
||||
}
|
||||
wan_spin_unlock_irq(&lip_link->bh_lock,&flags);
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
# if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
|
||||
return 1;
|
||||
#else
|
||||
DEBUG_TEST("%s: Command %x not supported!\n",
|
||||
lip_link->name,cmd);
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
}
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
char* get_master_dev_name(wplip_link_t *lip_link)
|
||||
{
|
||||
wplip_dev_list_t *lip_dev_list_el;
|
||||
netdevice_t *dev;
|
||||
|
||||
if (!lip_link->tx_dev_cnt){
|
||||
DEBUG_EVENT("%s: %s: Tx Dev List empty!\n",
|
||||
__FUNCTION__,lip_link->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lip_dev_list_el=WAN_LIST_FIRST(&lip_link->list_head_tx_ifdev);
|
||||
if (!lip_dev_list_el){
|
||||
DEBUG_EVENT("%s: %s: Tx Dev List empty!\n",
|
||||
__FUNCTION__,lip_link->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (lip_dev_list_el->magic != WPLIP_MAGIC_DEV_EL){
|
||||
DEBUG_EVENT("%s: %s: Error: Invalid dev magic number!\n",
|
||||
__FUNCTION__,lip_link->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dev=lip_dev_list_el->dev;
|
||||
if (!dev){
|
||||
DEBUG_EVENT("%s: %s: Error: No dev!\n",
|
||||
__FUNCTION__,lip_link->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return wan_netif_name(dev);
|
||||
}
|
||||
|
||||
/*==============================================================
|
||||
* wplip_if_init
|
||||
*
|
||||
* Description:
|
||||
* During device registration, this function is
|
||||
* called to fill in the call back functions
|
||||
* used in nework device setup and operation.
|
||||
*
|
||||
* The kernel interfaces the driver, using the
|
||||
* call back functions below.
|
||||
*
|
||||
* Usedby:
|
||||
* Kernel during register_netdevice() in x25_register
|
||||
* function.
|
||||
*/
|
||||
int wplip_if_init(netdevice_t *dev)
|
||||
{
|
||||
wplip_dev_t* lip_dev= wplip_get_lipdev(dev);
|
||||
|
||||
#if defined(__LINUX__)
|
||||
lip_dev->common.is_netdev = 1;
|
||||
lip_dev->common.iface.open = &wplip_open_dev;
|
||||
lip_dev->common.iface.close = &wplip_stop_dev;
|
||||
lip_dev->common.iface.send = &wplip_if_send;
|
||||
lip_dev->common.iface.ioctl = &wplip_ioctl;
|
||||
lip_dev->common.iface.tx_timeout= &wplip_tx_timeout;
|
||||
lip_dev->common.iface.get_stats = &wplip_ifstats;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
DEBUG_EVENT("%s: Initialize network interface...\n",
|
||||
wan_netif_name(dev));
|
||||
|
||||
lip_dev->common.is_netdev = 1;
|
||||
lip_dev->common.iface.open = &wplip_open_dev;
|
||||
lip_dev->common.iface.close = &wplip_stop_dev;
|
||||
lip_dev->common.iface.output = &wplip_if_output;
|
||||
lip_dev->common.iface.ioctl = &wplip_ioctl;
|
||||
|
||||
dev->if_type = IFT_PPP;
|
||||
dev->if_mtu = 1500;
|
||||
#if 0
|
||||
/* Remove this later (wanpipe_bsd_iface.c doing this) */
|
||||
dev->if_output = NULL;
|
||||
dev->if_start = &wplip_if_start;
|
||||
dev->if_ioctl = NULL; /* &wplip_ioctl; */
|
||||
|
||||
/* Initialize media-specific parameters */
|
||||
dev->if_flags |= IFF_POINTOPOINT;
|
||||
dev->if_flags |= IFF_NOARP;
|
||||
|
||||
dev->if_mtu = 1500;
|
||||
WAN_IFQ_SET_MAXLEN(&dev->if_snd, 100);
|
||||
dev->if_snd.ifq_len = 0;
|
||||
dev->if_type = IFT_PPP;
|
||||
#endif
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +28,12 @@ wanpipe-y := sdlamain.o
|
|||
ifneq (,$(ZAPDIR))
|
||||
PRODUCT_DEFINES += -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE
|
||||
wanpipe-y += sdla_tdmv.o sdla_remora_tdmv.o
|
||||
|
||||
ifneq (,$(wildcard $(ZAPHDLC)))
|
||||
PRODUCT_DEFINES+= -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
wanpipe-y += sdla_ft1.o sdla_te1.o sdla_te3.o sdla_56k.o sdla_8te1.o
|
||||
wanpipe-y += wanpipe_tdm_api.o
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
0xf7567a8a wanpipe_api_buf_check /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xf27fa082 wanpipe_lip_connect /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x3000ad78 sdla_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0xc0ef42f1 wp_sppp_input /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x57e6ed60 wanpipe_api_sock_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x5f97184e wanrouter_proc_add_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xc8a15fa6 sdla_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0xf7b65505 wp_sppp_input /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0xf08131ff wanpipe_api_sock_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xeb489e63 wanrouter_proc_add_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x59fb2682 sdla_hw_probe /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0x9a7a6658 wanpipe_lip_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x8f31cdeb proc_router /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x580596c4 proc_router /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x94be524d register_wanec_iface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x1036a1ab bind_api_listen_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xde2890ff bind_api_listen_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x524e2f20 register_wanpipe_fw_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x457621b6 register_wan_device /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xdad88768 wanrouter_proc_add_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xc9b2c3fb wp_sppp_attach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x90a9f616 wp_sppp_detach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x6eee717c register_wan_device net/wanrouter/wanrouter EXPORT_SYMBOL
|
||||
0xd3eaa2bd wanrouter_proc_add_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x43891608 wp_sppp_attach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0xf03004fc wp_sppp_detach /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x56712648 wanpipe_ec_event_ctrl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x7cd3c2bc wanpipe_ec_poll /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xf35baa74 wanrouter_proc_delete_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xf8093f70 wanrouter_proc_delete_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xdfd0f6c6 sdla_get_hw_adptr_cnt /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0x10723cdb wanpipe_ec_register /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x1e82f485 wp_sppp_change_mtu /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x02364d27 wanrouter_encapsulate /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x136b2537 wan_skb_destructor /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xfa083e32 register_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xa49dc980 wp_sppp_change_mtu /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0xd981a1fc wanrouter_encapsulate net/wanrouter/wanrouter EXPORT_SYMBOL
|
||||
0xecdb7fad wan_skb_destructor /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x563e1e4c register_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xade2d0d7 sdla_get_hw_probe /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0xef48df91 proc_add_line /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x53c87809 proc_add_line /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x22a2999f sdla_unregister /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/sdladrv EXPORT_SYMBOL
|
||||
0x85c05713 wanrouter_type_trans /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xc98aebe6 wan_get_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xfd74fadb wan_set_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xd6fdd720 wanrouter_type_trans net/wanrouter/wanrouter EXPORT_SYMBOL
|
||||
0x8506b552 wan_get_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x5de7fb30 wan_set_ip_address /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x7d68ed07 protocol_disconnected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xc5224c15 bind_api_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xfabc999d bind_api_to_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x38eb6851 unregister_wanpipe_api_socket /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xaac011d2 wanpipe_lip_kick /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x3b604364 unbind_api_listen_from_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
|
@ -39,18 +39,18 @@
|
|||
0x04df932b unregister_wanec_iface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x19823ac0 wanpipe_ec_isr /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x13405f6b unregister_wanpipe_fw_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xe72f44cb wanpipe_api_listen_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xe6bc2d6d wp_sppp_open /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x238f240b wp_sppp_reopen /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x72ddd010 wp_sppp_do_ioctl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x85e65535 wanpipe_api_listen_rx /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x2bcba8b7 wp_sppp_open /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x656c1338 wp_sppp_reopen /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0xd6eb126f wp_sppp_do_ioctl /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x5b7efb57 wanpipe_api_poll_wake /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x651a840a wan_add_gateway /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x805cbe1e wp_sppp_close /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x29d0266f wanrouter_proc_delete_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x02fd3230 wan_add_gateway /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x03229b9c wp_sppp_close /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanpipe_syncppp EXPORT_SYMBOL
|
||||
0x77bcb76a wanrouter_proc_delete_interface /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x2f21a326 unregister_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x0ebe03d1 unregister_wan_device /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x0ebe03d1 unregister_wan_device net/wanrouter/wanrouter EXPORT_SYMBOL
|
||||
0x22317d82 wanpipe_lip_disconnect /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xed6a48f7 protocol_connected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x0af8ffa5 protocol_connected /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x53350bd4 wanpipe_ec_unregister /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x49a433d4 register_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0x00525339 protocol_connecting /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xab182e38 register_wanpipe_lip_protocol /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
0xd9baedd9 protocol_connecting /hda5/wanpipe/3.1.X/wanpipe-3.1.0.p7/patches/kdrivers/src/net/wanrouter EXPORT_SYMBOL
|
||||
|
|
|
@ -1731,8 +1731,12 @@ static int aft_hwec_reset(void *pcard, int reset)
|
|||
DEBUG_EVENT("%s: Clear Echo Canceller chip reset.\n",
|
||||
card->devname);
|
||||
|
||||
if (card->u.aft.firm_id == AFT_DS_FE_CORE_ID/*card->adptr_type == A108_ADPTR_8TE1*/) {
|
||||
if (card->u.aft.firm_id == AFT_DS_FE_CORE_ID) {
|
||||
if(card->adptr_type == A108_ADPTR_8TE1){
|
||||
aft_te1_write_cpld(card,0x00,0x0F);
|
||||
} else {
|
||||
aft_te1_write_cpld(card,0x00,0x07);
|
||||
}
|
||||
}else{
|
||||
|
||||
if (IS_T1_CARD(card)){
|
||||
|
|
|
@ -81,6 +81,11 @@
|
|||
/******************************************************************************
|
||||
* DEFINES AND MACROS
|
||||
******************************************************************************/
|
||||
#undef WANPIPE_IGNORE_T1_YELLOW
|
||||
/* Dec 14, 2007
|
||||
** Disable all FE interrupt if Short Circuit condition detected! */
|
||||
#undef WAN_FE_SC_DISABLE_INTR
|
||||
|
||||
#define CLEAR_REG(sreg,ereg) { \
|
||||
unsigned short reg; \
|
||||
for(reg = sreg; reg < ereg; reg++){ \
|
||||
|
@ -165,7 +170,7 @@
|
|||
|
||||
|
||||
#define WAN_TE1_FRAMED_ALARMS (WAN_TE_BIT_RED_ALARM | WAN_TE_BIT_OOF_ALARM)
|
||||
#define WAN_TE1_UNFRAMED_ALARMS (WAN_TE_BIT_RED_ALARM)
|
||||
#define WAN_TE1_UNFRAMED_ALARMS (WAN_TE_BIT_RED_ALARM | WAN_TE_BIT_LOS_ALARM)
|
||||
|
||||
#define IS_T1_ALARM(alarm) \
|
||||
(alarm & \
|
||||
|
@ -693,8 +698,13 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
WRITE_REG(REG_TMMR, 0x00);
|
||||
/* Enable Rx Framer */
|
||||
WRITE_REG(REG_RMMR, BIT_RMMR_FRM_EN);
|
||||
if (IS_FE_TXTRISTATE(fe)){
|
||||
DEBUG_EVENT("%s: Tx Disabled (tri-state mode)\n",
|
||||
fe->name);
|
||||
}else{
|
||||
/* Enable Tx Framer */
|
||||
WRITE_REG(REG_TMMR, BIT_TMMR_FRM_EN);
|
||||
}
|
||||
}else{
|
||||
/* Clear Rx Framer soft reset */
|
||||
WRITE_REG(REG_RMMR, BIT_RMMR_T1E1);
|
||||
|
@ -702,9 +712,14 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
WRITE_REG(REG_TMMR, BIT_TMMR_T1E1);
|
||||
/* Enable Rx Framer */
|
||||
WRITE_REG(REG_RMMR, (BIT_RMMR_FRM_EN | BIT_RMMR_T1E1));
|
||||
if (IS_FE_TXTRISTATE(fe)){
|
||||
DEBUG_EVENT("%s: Tx Disabled (tri-state mode)\n",
|
||||
fe->name);
|
||||
}else{
|
||||
/* Enable Tx Framer */
|
||||
WRITE_REG(REG_TMMR, (BIT_TMMR_FRM_EN | BIT_TMMR_T1E1));
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_T1_FEMEDIA(fe)){
|
||||
WRITE_REG(REG_RCR1, BIT_RCR1_T1_SYNCT);
|
||||
|
@ -740,6 +755,15 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
WRITE_REG(REG_RCR1, value | BIT_RCR1_E1_RCRC4);
|
||||
value = READ_REG(REG_TCR1);
|
||||
WRITE_REG(REG_TCR1, value | BIT_TCR1_E1_TCRC4);
|
||||
value = READ_REG(REG_TCR2);
|
||||
WRITE_REG(REG_TCR2, value | BIT_TCR2_E1_AEBE);
|
||||
break;
|
||||
case WAN_FR_UNFRAMED:
|
||||
/* Nov 23, 2007 UNFRM */
|
||||
value = READ_REG(REG_TCR1);
|
||||
WRITE_REG(REG_TCR1, value | BIT_TCR1_E1_TTPT);
|
||||
value = READ_REG(REG_RCR1);
|
||||
WRITE_REG(REG_RCR1, value | BIT_RCR1_E1_SYNCE);
|
||||
break;
|
||||
default:
|
||||
DEBUG_EVENT("%s: Unsupported DS Frame mode (%X)\n",
|
||||
|
@ -747,15 +771,6 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (IS_E1_FEMEDIA(fe)){
|
||||
switch(WAN_FE_FRAME(fe)){
|
||||
case WAN_FR_CRC4:
|
||||
value = READ_REG(REG_TCR2);
|
||||
WRITE_REG(REG_TCR2, value | BIT_TCR2_E1_AEBE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_E1_FEMEDIA(fe)){
|
||||
sdla_ds_e1_set_sig_mode(fe, 0);
|
||||
}
|
||||
|
@ -821,16 +836,33 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
}
|
||||
#endif
|
||||
if (IS_E1_FEMEDIA(fe)){
|
||||
//WRITE_REG(REG_E1TAF, 0x1B);
|
||||
//WRITE_REG(REG_E1TNAF, 0x40);
|
||||
WRITE_REG(REG_E1TAF, 0x1B);
|
||||
WRITE_REG(REG_E1TNAF, 0x40);
|
||||
WRITE_REG(REG_E1TNAF, 0x5F);
|
||||
WRITE_REG(REG_E1TSa4, 0x00);
|
||||
WRITE_REG(REG_E1TSa5, 0x00);
|
||||
WRITE_REG(REG_E1TSa6, 0x00);
|
||||
WRITE_REG(REG_E1TSa7, 0x00);
|
||||
WRITE_REG(REG_E1TSa8, 0x00);
|
||||
WRITE_REG(REG_E1TSACR, 0x00);
|
||||
if (WAN_FE_FRAME(fe) == WAN_FR_CRC4){
|
||||
WRITE_REG(REG_E1TSa4, 0xFF);
|
||||
WRITE_REG(REG_E1TSa5, 0xFF);
|
||||
WRITE_REG(REG_E1TSa6, 0xFF);
|
||||
WRITE_REG(REG_E1TSa7, 0xFF);
|
||||
WRITE_REG(REG_E1TSa8, 0xFF);
|
||||
WRITE_REG(REG_E1TSACR, 0x1F);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set INIT_DONE */
|
||||
if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
/* Set INIT_DONE (not unframed mode) */
|
||||
value = READ_REG(REG_RMMR);
|
||||
WRITE_REG(REG_RMMR, value | BIT_RMMR_INIT_DONE);
|
||||
/* Set INIT_DONE */
|
||||
value = READ_REG(REG_TMMR);
|
||||
WRITE_REG(REG_TMMR, value | BIT_TMMR_INIT_DONE);
|
||||
}
|
||||
|
||||
/* T1/J1 or E1 */
|
||||
if (IS_T1_FEMEDIA(fe)){
|
||||
|
@ -858,15 +890,19 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
value = 0x00;
|
||||
break;
|
||||
case WAN_T1_133_266:
|
||||
case WAN_T1_110_220:
|
||||
value = BIT_LTITSR_L0;
|
||||
break;
|
||||
case WAN_T1_266_399:
|
||||
case WAN_T1_220_330:
|
||||
value = BIT_LTITSR_L1;
|
||||
break;
|
||||
case WAN_T1_399_533:
|
||||
case WAN_T1_330_440:
|
||||
value = BIT_LTITSR_L1 | BIT_LTITSR_L0;
|
||||
break;
|
||||
case WAN_T1_533_655:
|
||||
case WAN_T1_550_660:
|
||||
value = BIT_LTITSR_L2;
|
||||
break;
|
||||
case WAN_E1_120:
|
||||
|
@ -893,10 +929,51 @@ static int sdla_ds_te1_chip_config(void* pfe)
|
|||
value | BIT_LTITSR_TIMPL0);
|
||||
}
|
||||
|
||||
value = BIT_LRISMR_RSMS1 | BIT_LRISMR_RSMS0;
|
||||
value = 0x00;
|
||||
if (WAN_TE1_HI_MODE(fe)){
|
||||
value |= BIT_LRISMR_RMONEN;
|
||||
switch(fe->fe_cfg.cfg.te_cfg.rx_slevel){
|
||||
case WAN_TE1_RX_SLEVEL_30_DB:
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_225_DB:
|
||||
value |= BIT_LRISMR_RSMS0;
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_175_DB:
|
||||
value |= BIT_LRISMR_RSMS1;
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_12_DB:
|
||||
value |= (BIT_LRISMR_RSMS1 | BIT_LRISMR_RSMS0);
|
||||
break;
|
||||
default: /* set default value */
|
||||
fe->fe_cfg.cfg.te_cfg.rx_slevel = WAN_TE1_RX_SLEVEL_30_DB;
|
||||
break;
|
||||
}
|
||||
DEBUG_EVENT("%s: Rx Sensitivity Gain %s (High Impedence mode).\n",
|
||||
fe->name,
|
||||
WAN_TE1_RX_SLEVEL_DECODE(fe->fe_cfg.cfg.te_cfg.rx_slevel));
|
||||
}else{
|
||||
switch(fe->fe_cfg.cfg.te_cfg.rx_slevel){
|
||||
case WAN_TE1_RX_SLEVEL_12_DB:
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_18_DB:
|
||||
value |= BIT_LRISMR_RSMS0;
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_30_DB:
|
||||
value |= BIT_LRISMR_RSMS1;
|
||||
break;
|
||||
case WAN_TE1_RX_SLEVEL_36_DB:
|
||||
case WAN_TE1_RX_SLEVEL_43_DB:
|
||||
value |= (BIT_LRISMR_RSMS1 | BIT_LRISMR_RSMS0);
|
||||
break;
|
||||
default: /* set default value */
|
||||
fe->fe_cfg.cfg.te_cfg.rx_slevel = WAN_TE1_RX_SLEVEL_12_DB;
|
||||
break;
|
||||
}
|
||||
DEBUG_EVENT("%s: Rx Sensitivity Gain %s.\n",
|
||||
fe->name,
|
||||
WAN_TE1_RX_SLEVEL_DECODE(fe->fe_cfg.cfg.te_cfg.rx_slevel));
|
||||
}
|
||||
|
||||
if (IS_T1_FEMEDIA(fe)){
|
||||
WRITE_REG(REG_LRISMR, value | BIT_LRISMR_RIMPM0);
|
||||
}else{
|
||||
|
@ -1043,7 +1120,7 @@ static int sdla_ds_te1_config(void* pfe)
|
|||
wan_set_bit(TE_CONFIGURED,(void*)&fe->te_param.critical);
|
||||
|
||||
/* Enable interrupts */
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_ENABLE, 0x00);
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_GLOBAL, WAN_FE_INTR_ENABLE, 0x00);
|
||||
/* Enable manual update pmon counter */
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00);
|
||||
return 0;
|
||||
|
@ -1215,32 +1292,47 @@ sdla_ds_te1_sigctrl(sdla_fe_t *fe, int sig_mode, unsigned long ch_map, int mode)
|
|||
|
||||
|
||||
/******************************************************************************
|
||||
** sdla_ds_t1_is_connected()
|
||||
** sdla_ds_t1_is_alarm()
|
||||
**
|
||||
** Description: Verify T1 status.
|
||||
** Arguments:
|
||||
** Returns: 1 - the port is connected
|
||||
** 0 - the port is disconnected
|
||||
******************************************************************************/
|
||||
static int sdla_ds_t1_is_connected(sdla_fe_t *fe, unsigned long alarms)
|
||||
static int sdla_ds_t1_is_alarm(sdla_fe_t *fe, unsigned long alarms)
|
||||
{
|
||||
|
||||
if (alarms & WAN_TE1_FRAMED_ALARMS) return 0;
|
||||
/* NC: Bring the link down if we re in SC mode */
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
return 1;
|
||||
}
|
||||
return (alarms & WAN_TE1_FRAMED_ALARMS);
|
||||
}
|
||||
/******************************************************************************
|
||||
** sdla_ds_e1_is_connected()
|
||||
** sdla_ds_e1_is_alarm()
|
||||
**
|
||||
** Description: Verify E1 status.
|
||||
** Arguments:
|
||||
** Returns: 1 - the port is connected
|
||||
** 0 - the port is disconnected
|
||||
******************************************************************************/
|
||||
static int sdla_ds_e1_is_connected(sdla_fe_t *fe, unsigned long alarms)
|
||||
static int sdla_ds_e1_is_alarm(sdla_fe_t *fe, unsigned long alarms)
|
||||
{
|
||||
if (alarms & WAN_TE1_FRAMED_ALARMS) return 0;
|
||||
if (WAN_FE_FRAME(fe) == WAN_FR_UNFRAMED){
|
||||
if (!fe->te_param.lb_mode &&
|
||||
(fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_OC ||
|
||||
fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC ||
|
||||
fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_LOS)){
|
||||
return 1;
|
||||
}
|
||||
return (alarms & WAN_TE1_UNFRAMED_ALARMS);
|
||||
}
|
||||
|
||||
/* NC: Bring the link down if we re in SC mode */
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
return 1;
|
||||
}
|
||||
return (alarms & WAN_TE1_FRAMED_ALARMS);
|
||||
}
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
|
@ -1259,8 +1351,31 @@ static void sdla_ds_te1_set_status(sdla_fe_t* fe, unsigned long alarms)
|
|||
|
||||
if (IS_T1_FEMEDIA(fe)){
|
||||
|
||||
if (sdla_ds_t1_is_connected(fe, alarms)){
|
||||
if (sdla_ds_t1_is_alarm(fe, alarms)){
|
||||
if (fe->fe_status != FE_DISCONNECTED){
|
||||
fe->fe_status = FE_DISCONNECTED;
|
||||
}
|
||||
}else{
|
||||
|
||||
#ifdef WANPIPE_IGNORE_T1_YELLOW
|
||||
#warning "AFT IGNORING YELLOW ALARM!"
|
||||
/* If we ignore yellow alarm, we will pass it up
|
||||
to zaptel. We will be in connected state where
|
||||
zaptel will be in alarm. Its a deadlock
|
||||
condition
|
||||
|
||||
This option can be compiled using Setup
|
||||
script in case of some users that
|
||||
have yellow alarm issues.
|
||||
|
||||
Should never be used in ZAPTEL mode!
|
||||
*/
|
||||
if (fe->fe_status != FE_CONNECTED){
|
||||
sdla_ds_te1_clear_alarms(fe, WAN_TE_BIT_YEL_ALARM);
|
||||
fe->fe_status = FE_CONNECTED;
|
||||
}
|
||||
#else
|
||||
//sdla_ds_te1_clear_alarms(fe, WAN_TE_BIT_YEL_ALARM);
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_YEL_ALARM)){
|
||||
if (fe->fe_status != FE_CONNECTED){
|
||||
fe->fe_status = FE_CONNECTED;
|
||||
|
@ -1272,21 +1387,17 @@ static void sdla_ds_te1_set_status(sdla_fe_t* fe, unsigned long alarms)
|
|||
}
|
||||
fe->fe_status = FE_DISCONNECTED;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
if (sdla_ds_e1_is_alarm(fe, alarms)){
|
||||
if (fe->fe_status != FE_DISCONNECTED){
|
||||
fe->fe_status = FE_DISCONNECTED;
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
if (sdla_ds_e1_is_connected(fe, alarms)){
|
||||
if (fe->fe_status != FE_CONNECTED){
|
||||
fe->fe_status = FE_CONNECTED;
|
||||
}
|
||||
} else {
|
||||
if (fe->fe_status != FE_DISCONNECTED){
|
||||
fe->fe_status = FE_DISCONNECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1334,6 +1445,14 @@ static void sdla_ds_te1_set_status(sdla_fe_t* fe, unsigned long alarms)
|
|||
fe->te_param.status_cnt);
|
||||
}
|
||||
|
||||
#if defined(WAN_FE_SC_DISABLE_INTR)
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
if (card->wandev.critical_event){
|
||||
card->wandev.critical_event(card, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1402,132 +1521,178 @@ static int sdla_ds_te1_print_alarms(sdla_fe_t* fe, unsigned int alarms)
|
|||
** Arguments:
|
||||
** Returns:
|
||||
*/
|
||||
static unsigned int sdla_ds_te1_read_alarms(sdla_fe_t *fe, int action)
|
||||
static unsigned int sdla_ds_te1_read_frame_alarms(sdla_fe_t *fe)
|
||||
{
|
||||
|
||||
if (IS_FE_ALARM_READ(action)){
|
||||
unsigned int fr_alarm = fe->fe_alarm;
|
||||
unsigned char rrts1 = READ_REG(REG_RRTS1);
|
||||
unsigned char lrsr = READ_REG(REG_LRSR);
|
||||
|
||||
DEBUG_TE1("%s: Alarm status = %02X (%X)\n",
|
||||
fe->name, rrts1, fe->fe_alarm);
|
||||
DEBUG_TE1("%s: Framer Alarm status = %02X (%X)\n",
|
||||
fe->name, rrts1, fr_alarm);
|
||||
/* Framer alarms */
|
||||
//if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
if (rrts1 & BIT_RRTS1_RRAI){
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_RAI_ALARM)){
|
||||
if (!(fr_alarm & WAN_TE_BIT_RAI_ALARM)){
|
||||
DEBUG_EVENT("%s: RAI alarm is ON\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm |= WAN_TE_BIT_RAI_ALARM;
|
||||
fr_alarm |= WAN_TE_BIT_RAI_ALARM;
|
||||
}else{
|
||||
if (fe->fe_alarm & WAN_TE_BIT_RAI_ALARM){
|
||||
if (fr_alarm & WAN_TE_BIT_RAI_ALARM){
|
||||
DEBUG_EVENT("%s: RAI alarm is OFF\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm &= ~WAN_TE_BIT_RAI_ALARM;
|
||||
fr_alarm &= ~WAN_TE_BIT_RAI_ALARM;
|
||||
}
|
||||
//}
|
||||
if (rrts1 & BIT_RRTS1_RAIS){
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_AIS_ALARM)){
|
||||
if (!(fr_alarm & WAN_TE_BIT_AIS_ALARM)){
|
||||
DEBUG_EVENT("%s: AIS alarm is ON\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm |= WAN_TE_BIT_AIS_ALARM;
|
||||
fr_alarm |= WAN_TE_BIT_AIS_ALARM;
|
||||
}else{
|
||||
if (fe->fe_alarm & WAN_TE_BIT_AIS_ALARM){
|
||||
if (fr_alarm & WAN_TE_BIT_AIS_ALARM){
|
||||
DEBUG_EVENT("%s: AIS alarm is OFF\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm &= ~WAN_TE_BIT_AIS_ALARM;
|
||||
fr_alarm &= ~WAN_TE_BIT_AIS_ALARM;
|
||||
}
|
||||
if (rrts1 & BIT_RRTS1_RLOS){
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_LOS_ALARM)){
|
||||
if (!(fr_alarm & WAN_TE_BIT_LOS_ALARM)){
|
||||
DEBUG_EVENT("%s: LOS alarm is ON\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm |= WAN_TE_BIT_LOS_ALARM;
|
||||
fr_alarm |= WAN_TE_BIT_LOS_ALARM;
|
||||
}else{
|
||||
if (fe->fe_alarm & WAN_TE_BIT_LOS_ALARM){
|
||||
if (fr_alarm & WAN_TE_BIT_LOS_ALARM){
|
||||
DEBUG_EVENT("%s: LOS alarm is OFF\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm &= ~WAN_TE_BIT_LOS_ALARM;
|
||||
fr_alarm &= ~WAN_TE_BIT_LOS_ALARM;
|
||||
}
|
||||
if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
if (rrts1 & BIT_RRTS1_RLOF){
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_OOF_ALARM)){
|
||||
if (!(fr_alarm & WAN_TE_BIT_OOF_ALARM)){
|
||||
DEBUG_EVENT("%s: OOF alarm is ON\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm |= WAN_TE_BIT_OOF_ALARM;
|
||||
fr_alarm |= WAN_TE_BIT_OOF_ALARM;
|
||||
}else{
|
||||
if (fe->fe_alarm & WAN_TE_BIT_OOF_ALARM){
|
||||
if (fr_alarm & WAN_TE_BIT_OOF_ALARM){
|
||||
DEBUG_EVENT("%s: OOF alarm is OFF\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm &= ~WAN_TE_BIT_OOF_ALARM;
|
||||
fr_alarm &= ~WAN_TE_BIT_OOF_ALARM;
|
||||
}
|
||||
}
|
||||
/* Aug 30, 2006
|
||||
** Red alarm is either LOS or OOF alarms */
|
||||
if (IS_TE_OOF_ALARM(fe->fe_alarm) ||
|
||||
IS_TE_LOS_ALARM(fe->fe_alarm)){
|
||||
if (!(fe->fe_alarm & WAN_TE_BIT_RED_ALARM)){
|
||||
if (IS_TE_OOF_ALARM(fr_alarm) ||
|
||||
IS_TE_LOS_ALARM(fr_alarm)){
|
||||
if (!(fr_alarm & WAN_TE_BIT_RED_ALARM)){
|
||||
DEBUG_EVENT("%s: RED alarm is ON\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm |= WAN_TE_BIT_RED_ALARM;
|
||||
fr_alarm |= WAN_TE_BIT_RED_ALARM;
|
||||
}else{
|
||||
if (fe->fe_alarm & WAN_TE_BIT_RED_ALARM){
|
||||
if (fr_alarm & WAN_TE_BIT_RED_ALARM){
|
||||
DEBUG_EVENT("%s: RED alarm is OFF\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->fe_alarm &= ~WAN_TE_BIT_RED_ALARM;
|
||||
fr_alarm &= ~WAN_TE_BIT_RED_ALARM;
|
||||
}
|
||||
return fr_alarm;
|
||||
}
|
||||
|
||||
static unsigned int sdla_ds_te1_read_liu_alarms(sdla_fe_t *fe)
|
||||
{
|
||||
unsigned int alarm = fe->liu_alarm;
|
||||
unsigned char lrsr = READ_REG(REG_LRSR);
|
||||
|
||||
DEBUG_TE1("%s: LIU Alarm status = %02X (%X)\n",
|
||||
fe->name, lrsr1, alarm);
|
||||
|
||||
/* LIU alarms */
|
||||
if (lrsr & BIT_LRSR_OCS){
|
||||
if (!(fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_OC)){
|
||||
if (!(alarm & WAN_TE_BIT_LIU_ALARM_OC)){
|
||||
DEBUG_EVENT("%s: Open Circuit is detected!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm |= WAN_TE_BIT_LIU_ALARM_OC;
|
||||
alarm |= WAN_TE_BIT_LIU_ALARM_OC;
|
||||
}else{
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_OC){
|
||||
if (alarm & WAN_TE_BIT_LIU_ALARM_OC){
|
||||
DEBUG_EVENT("%s: Open Circuit is cleared!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm &= ~WAN_TE_BIT_LIU_ALARM_OC;
|
||||
alarm &= ~WAN_TE_BIT_LIU_ALARM_OC;
|
||||
}
|
||||
if (lrsr & BIT_LRSR_SCS){
|
||||
if (!(fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC)){
|
||||
if (!(alarm & WAN_TE_BIT_LIU_ALARM_SC)){
|
||||
DEBUG_EVENT("%s: Short Circuit is detected!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm |= WAN_TE_BIT_LIU_ALARM_SC;
|
||||
alarm |= WAN_TE_BIT_LIU_ALARM_SC;
|
||||
}else{
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
if (alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
DEBUG_EVENT("%s: Short Circuit is cleared!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm &= ~WAN_TE_BIT_LIU_ALARM_SC;
|
||||
alarm &= ~WAN_TE_BIT_LIU_ALARM_SC;
|
||||
}
|
||||
if (lrsr & BIT_LRSR_LOSS){
|
||||
if (!(fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_LOS)){
|
||||
if (!(alarm & WAN_TE_BIT_LIU_ALARM_LOS)){
|
||||
DEBUG_EVENT("%s: Lost of Signal is detected!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm |= WAN_TE_BIT_LIU_ALARM_LOS;
|
||||
alarm |= WAN_TE_BIT_LIU_ALARM_LOS;
|
||||
}else{
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_LOS){
|
||||
if (alarm & WAN_TE_BIT_LIU_ALARM_LOS){
|
||||
DEBUG_EVENT("%s: Lost of Signal is cleared!\n",
|
||||
fe->name);
|
||||
}
|
||||
fe->liu_alarm &= ~WAN_TE_BIT_LIU_ALARM_LOS;
|
||||
alarm &= ~WAN_TE_BIT_LIU_ALARM_LOS;
|
||||
}
|
||||
|
||||
return alarm;
|
||||
}
|
||||
|
||||
static unsigned int sdla_ds_te1_read_alarms(sdla_fe_t *fe, int action)
|
||||
{
|
||||
unsigned int fr_alarm = fe->fe_alarm;
|
||||
unsigned int alarm = fe->liu_alarm;
|
||||
|
||||
if (IS_FE_ALARM_READ(action)){
|
||||
|
||||
fr_alarm = sdla_ds_te1_read_frame_alarms(fe);
|
||||
alarm = sdla_ds_te1_read_liu_alarms(fe);
|
||||
}
|
||||
if (IS_FE_ALARM_PRINT(action)){
|
||||
sdla_ds_te1_print_alarms(fe, fe->fe_alarm);
|
||||
sdla_ds_te1_print_alarms(fe, fr_alarm);
|
||||
}
|
||||
if (IS_FE_ALARM_UPDATE(action)){
|
||||
fe->fe_alarm = fr_alarm;
|
||||
fe->liu_alarm = alarm;
|
||||
}
|
||||
return fe->fe_alarm;
|
||||
}
|
||||
|
||||
#define WAN_TE_CRIT_ALARM_TIMEOUT 30000 /* 30 sec */
|
||||
static int sdla_ds_te1_read_crit_alarms(sdla_fe_t *fe)
|
||||
{
|
||||
|
||||
fe->liu_alarm = sdla_ds_te1_read_liu_alarms(fe);
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
fe->te_param.crit_alarm_start = SYSTEM_TICKS;
|
||||
}else{
|
||||
if((SYSTEM_TICKS - fe->te_param.crit_alarm_start) > ((WAN_TE_CRIT_ALARM_TIMEOUT * HZ)/1000)) {
|
||||
/* The link was stable for 30 sec, let try to go back */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* we are still in critical alarm state */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
*******************************************************************************
|
||||
** sdla_ds_te1_set_alarms()
|
||||
|
@ -2057,11 +2222,17 @@ sdla_ds_te1_intr_ctrl(sdla_fe_t *fe, int dummy, int type, int mode, unsigned int
|
|||
|
||||
case WAN_TE_INTR_BASIC:
|
||||
if (mode == WAN_FE_INTR_ENABLE){
|
||||
WRITE_REG(REG_RIM1,
|
||||
BIT_RIM1_RRAIC | BIT_RIM1_RRAID |
|
||||
BIT_RIM1_RAISC | BIT_RIM1_RAISD |
|
||||
BIT_RIM1_RLOSC | BIT_RIM1_RLOSD |
|
||||
BIT_RIM1_RLOFC | BIT_RIM1_RLOFD);
|
||||
unsigned char mask = 0x00;
|
||||
|
||||
mask = BIT_RIM1_RAISC | BIT_RIM1_RAISD |
|
||||
BIT_RIM1_RRAIC | BIT_RIM1_RRAID;
|
||||
if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
mask |= (BIT_RIM1_RLOFC | BIT_RIM1_RLOFD);
|
||||
}
|
||||
#if defined(FE_LOS_ENABLE)
|
||||
mask |= (BIT_RIM1_RLOSC | BIT_RIM1_RLOSD);
|
||||
#endif
|
||||
WRITE_REG(REG_RIM1, mask);
|
||||
/*WRITE_REG(REG_RIM4, BIT_RIM4_TIMER);*/
|
||||
WRITE_REG(REG_LSIMR,
|
||||
BIT_LSIMR_OCCIM | BIT_LSIMR_OCDIM |
|
||||
|
@ -2147,6 +2318,7 @@ static int sdla_ds_te1_framer_rx_intr(sdla_fe_t *fe)
|
|||
|
||||
DEBUG_TE1("%s: RX Latched Status Register 1 %02X\n",
|
||||
fe->name, rls1);
|
||||
//if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
if (rls1 & (BIT_RLS1_RRAIC|BIT_RLS1_RRAID)){
|
||||
if (rrts1 & BIT_RRTS1_RRAI){
|
||||
fe->fe_alarm |= WAN_TE_BIT_RAI_ALARM;
|
||||
|
@ -2158,6 +2330,7 @@ static int sdla_ds_te1_framer_rx_intr(sdla_fe_t *fe)
|
|||
fe->name);
|
||||
}
|
||||
}
|
||||
//}
|
||||
if (rls1 & (BIT_RLS1_RAISC|BIT_RLS1_RAISD)){
|
||||
if (rrts1 & BIT_RRTS1_RAIS){
|
||||
fe->fe_alarm |= WAN_TE_BIT_AIS_ALARM;
|
||||
|
@ -2180,6 +2353,7 @@ static int sdla_ds_te1_framer_rx_intr(sdla_fe_t *fe)
|
|||
fe->name);
|
||||
}
|
||||
}
|
||||
if (WAN_FE_FRAME(fe) != WAN_FR_UNFRAMED){
|
||||
if (rls1 & (BIT_RLS1_RLOFC|BIT_RLS1_RLOFD)){
|
||||
if (rrts1 & BIT_RRTS1_RLOF){
|
||||
fe->fe_alarm |= WAN_TE_BIT_OOF_ALARM;
|
||||
|
@ -2191,6 +2365,7 @@ static int sdla_ds_te1_framer_rx_intr(sdla_fe_t *fe)
|
|||
fe->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
WRITE_REG(REG_RLS1, rls1);
|
||||
if (IS_T1_FEMEDIA(fe)){
|
||||
if (IS_TE_OOF_ALARM(fe->fe_alarm) &&
|
||||
|
@ -2491,9 +2666,9 @@ static int sdla_ds_te1_liu_intr(sdla_fe_t *fe)
|
|||
|
||||
static int sdla_ds_te1_check_intr(sdla_fe_t *fe)
|
||||
{
|
||||
unsigned char framer_istatus;
|
||||
unsigned char liu_istatus;
|
||||
unsigned char bert_istatus;
|
||||
unsigned char framer_istatus, framer_imask;
|
||||
unsigned char liu_istatus, liu_imask;
|
||||
unsigned char bert_istatus, bert_imask;
|
||||
|
||||
WAN_ASSERT(fe->write_fe_reg == NULL);
|
||||
WAN_ASSERT(fe->read_fe_reg == NULL);
|
||||
|
@ -2502,6 +2677,10 @@ static int sdla_ds_te1_check_intr(sdla_fe_t *fe)
|
|||
liu_istatus = __READ_REG(REG_GLISR);
|
||||
bert_istatus = __READ_REG(REG_GBISR);
|
||||
|
||||
framer_imask = __READ_REG(REG_GFIMR);
|
||||
liu_imask = __READ_REG(REG_GLIMR);
|
||||
bert_imask = __READ_REG(REG_GBIMR);
|
||||
|
||||
//if (framer_istatus & (1 << WAN_FE_LINENO(fe))){
|
||||
if (framer_istatus & (1 << WAN_DS_REGBITMAP(fe))){
|
||||
DEBUG_ISR("%s: Interrupt for line %d (framer)\n",
|
||||
|
@ -2509,17 +2688,27 @@ static int sdla_ds_te1_check_intr(sdla_fe_t *fe)
|
|||
return 1;
|
||||
}
|
||||
//if (liu_istatus & (1 << WAN_FE_LINENO(fe))){
|
||||
if (liu_istatus & (1 << WAN_DS_REGBITMAP(fe))){
|
||||
DEBUG_ISR("%s: Interrupt for line %d (liu)\n",
|
||||
if ((framer_istatus & (1 << WAN_DS_REGBITMAP(fe))) &&
|
||||
(framer_imask & (1 << WAN_DS_REGBITMAP(fe)))) {
|
||||
DEBUG_ISR("%s: Interrupt for line %d (FRAMER)\n",
|
||||
fe->name, WAN_FE_LINENO(fe));
|
||||
return 1;
|
||||
}
|
||||
//if (liu_istatus & (1 << WAN_FE_LINENO(fe))){
|
||||
if ((liu_istatus & (1 << WAN_DS_REGBITMAP(fe))) &&
|
||||
(liu_imask & (1 << WAN_DS_REGBITMAP(fe)))) {
|
||||
DEBUG_ISR("%s: Interrupt for line %d (LIU)\n",
|
||||
fe->name, WAN_FE_LINENO(fe));
|
||||
return 1;
|
||||
}
|
||||
//if (bert_istatus & (1 << WAN_FE_LINENO(fe))){
|
||||
if (bert_istatus & (1 << WAN_DS_REGBITMAP(fe))){
|
||||
DEBUG_ISR("%s: Interrupt for line %d (bert)\n",
|
||||
if ((bert_istatus & (1 << WAN_DS_REGBITMAP(fe))) &&
|
||||
(bert_imask & (1 << WAN_DS_REGBITMAP(fe)))) {
|
||||
DEBUG_ISR("%s: Interrupt for line %d (BERT)\n",
|
||||
fe->name, WAN_FE_LINENO(fe));
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEBUG_ISR("%s: This interrupt not for this port %d\n",
|
||||
fe->name,
|
||||
WAN_FE_LINENO(fe)+1);
|
||||
|
@ -2563,6 +2752,27 @@ static int sdla_ds_te1_intr(sdla_fe_t *fe)
|
|||
DEBUG_TE1("%s: FE Interrupt Alarms=0x%X\n",
|
||||
fe->name,fe->fe_alarm);
|
||||
|
||||
#if 1
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
sdla_fe_timer_event_t event;
|
||||
/* AL: March 1, 2006: Mask global FE intr */
|
||||
sdla_ds_te1_intr_ctrl(
|
||||
fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_MASK, 0x00);
|
||||
/* Disable automatic update */
|
||||
sdla_ds_te1_intr_ctrl(
|
||||
fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00);
|
||||
/* Start LINKDOWN poll */
|
||||
event.type = TE_LINKCRIT_TIMER;
|
||||
event.delay = POLLING_TE1_TIMER*5;
|
||||
sdla_ds_te1_add_event(fe, &event);
|
||||
|
||||
//if (card->wandev.critical_event){
|
||||
// card->wandev.critical_event(card, 0);
|
||||
//}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
sdla_ds_te1_set_status(fe, fe->fe_alarm);
|
||||
if (status != fe->fe_status){
|
||||
if (fe->fe_status != FE_CONNECTED){
|
||||
|
@ -2570,7 +2780,7 @@ static int sdla_ds_te1_intr(sdla_fe_t *fe)
|
|||
/* AL: March 1, 2006: Mask global FE intr */
|
||||
sdla_ds_te1_intr_ctrl(
|
||||
fe, 0,
|
||||
WAN_TE_INTR_GLOBAL,
|
||||
WAN_TE_INTR_BASIC,
|
||||
WAN_FE_INTR_MASK,
|
||||
0x00);
|
||||
/* Disable automatic update */
|
||||
|
@ -2656,7 +2866,15 @@ static void sdla_ds_te1_timer(unsigned long pfe)
|
|||
*/
|
||||
static int sdla_ds_te1_add_timer(sdla_fe_t* fe, unsigned long delay)
|
||||
{
|
||||
int err;
|
||||
int err=0;
|
||||
|
||||
if (wan_test_bit(TE_TIMER_KILL,(void*)&fe->te_param.critical)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wan_test_bit(TE_TIMER_RUNNING,(void*)&fe->te_param.critical)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = wan_add_timer(&fe->timer, delay * HZ / 1000);
|
||||
if (err){
|
||||
|
@ -2707,18 +2925,39 @@ sdla_ds_te1_add_event(sdla_fe_t *fe, sdla_fe_timer_event_t *event)
|
|||
fe->name, __FUNCTION__,__LINE__);
|
||||
#endif
|
||||
wan_spin_lock_irq(&fe->lock,&smp_flags);
|
||||
/* Set event from pending event map */
|
||||
if (wan_test_and_set_bit(event->type,(void*)&fe->event_map)){
|
||||
DEBUG_EVENT("%s: WARNING: Event type %d is already pending!\n",
|
||||
fe->name, event->type);
|
||||
wan_spin_unlock_irq(&fe->lock, &smp_flags);
|
||||
wan_free(tevent);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (WAN_LIST_EMPTY(&fe->event)){
|
||||
WAN_LIST_INSERT_HEAD(&fe->event, tevent, next);
|
||||
}else{
|
||||
sdla_fe_timer_event_t *tmp;
|
||||
int cnt = 0;
|
||||
WAN_LIST_FOREACH(tmp, &fe->event, next){
|
||||
if (!WAN_LIST_NEXT(tmp, next)) break;
|
||||
cnt ++;
|
||||
}
|
||||
if (tmp == NULL){
|
||||
DEBUG_EVENT("%s: Internal Error!!!\n", fe->name);
|
||||
wan_clear_bit(event->type,(void*)&fe->event_map);
|
||||
wan_spin_unlock_irq(&fe->lock, &smp_flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (cnt > WAN_FE_MAX_QEVENT_LEN){
|
||||
DEBUG_EVENT("%s: ERROR: Too many events in event queue!\n",
|
||||
fe->name);
|
||||
DEBUG_EVENT("%s: ERROR: Dropping new event type %d!\n",
|
||||
fe->name, event->type);
|
||||
wan_clear_bit(event->type,(void*)&fe->event_map);
|
||||
wan_spin_unlock_irq(&fe->lock, &smp_flags);
|
||||
wan_free(tevent);
|
||||
return -EINVAL;
|
||||
}
|
||||
WAN_LIST_INSERT_AFTER(tmp, tevent, next);
|
||||
}
|
||||
wan_spin_unlock_irq(&fe->lock, &smp_flags);
|
||||
|
@ -2765,13 +3004,32 @@ static int sdla_ds_te1_polling(sdla_fe_t* fe)
|
|||
}
|
||||
event = WAN_LIST_FIRST(&fe->event);
|
||||
WAN_LIST_REMOVE(event, next);
|
||||
/* Clear event from pending event map */
|
||||
wan_clear_bit(event->type,(void*)&fe->event_map);
|
||||
wan_spin_unlock_irq(&fe->lock,&smp_flags);
|
||||
|
||||
DEBUG_TE1("%s: TE1 Polling State=%s Event=%X!\n",
|
||||
fe->name, WAN_FE_STATUS_DECODE(fe), event->type);
|
||||
switch(event->type){
|
||||
case TE_LINKCRIT_TIMER:
|
||||
if (!sdla_ds_te1_read_crit_alarms(fe)){
|
||||
event->type = TE_LINKDOWN_TIMER;
|
||||
}else{
|
||||
event->type = TE_LINKCRIT_TIMER;
|
||||
}
|
||||
event->delay = POLLING_TE1_TIMER;
|
||||
pending = 1;
|
||||
break;
|
||||
|
||||
case TE_LINKDOWN_TIMER:
|
||||
sdla_ds_te1_read_alarms(fe, WAN_FE_ALARM_READ);
|
||||
sdla_ds_te1_read_alarms(fe, WAN_FE_ALARM_READ|WAN_FE_ALARM_UPDATE);
|
||||
if (fe->liu_alarm & WAN_TE_BIT_LIU_ALARM_SC){
|
||||
/* Short circuit detected, go to LINKCRIT state */
|
||||
event->type = TE_LINKCRIT_TIMER;
|
||||
event->delay = POLLING_TE1_TIMER;
|
||||
pending = 1;
|
||||
break;
|
||||
}
|
||||
sdla_ds_te1_pmon(fe, WAN_FE_PMON_UPDATE|WAN_FE_PMON_READ);
|
||||
sdla_ds_te1_set_status(fe, fe->fe_alarm);
|
||||
if (fe->fe_status == FE_CONNECTED){
|
||||
|
@ -2793,7 +3051,7 @@ static int sdla_ds_te1_polling(sdla_fe_t* fe)
|
|||
if (fe->fe_status == FE_CONNECTED){
|
||||
/* Enable Basic Interrupt */
|
||||
sdla_ds_te1_intr_ctrl( fe, 0,
|
||||
WAN_TE_INTR_GLOBAL,
|
||||
WAN_TE_INTR_BASIC,
|
||||
WAN_FE_INTR_ENABLE,
|
||||
0x00);
|
||||
/* Enable automatic update pmon counters */
|
||||
|
@ -2884,7 +3142,7 @@ static int sdla_ds_te1_polling(sdla_fe_t* fe)
|
|||
/* Enable interrupts */
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_BASIC, WAN_FE_INTR_ENABLE, 0x00);
|
||||
/* Enable manual update pmon counter */
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_MASK, 0x00);
|
||||
sdla_ds_te1_intr_ctrl(fe, 0, WAN_TE_INTR_PMON, WAN_FE_INTR_ENABLE, 0x00);
|
||||
event->type = TE_LINKDOWN_TIMER;
|
||||
event->delay = POLLING_TE1_TIMER;
|
||||
pending = 1;
|
||||
|
@ -3206,6 +3464,7 @@ static int sdla_ds_te1_fr_plb(sdla_fe_t* fe, unsigned char mode)
|
|||
static int
|
||||
sdla_ds_te1_set_lbmode(sdla_fe_t *fe, unsigned char type, unsigned char mode)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
WAN_ASSERT(fe->write_fe_reg == NULL);
|
||||
WAN_ASSERT(fe->read_fe_reg == NULL);
|
||||
|
@ -3214,27 +3473,42 @@ sdla_ds_te1_set_lbmode(sdla_fe_t *fe, unsigned char type, unsigned char mode)
|
|||
WAN_TE1_LB_MODE_DECODE(mode),
|
||||
WAN_TE1_LB_TYPE_DECODE(type));
|
||||
switch(type){
|
||||
case WAN_TE1_DDLB_MODE:
|
||||
case WAN_TE1_LIU_ALB_MODE:
|
||||
sdla_ds_te1_liu_alb(fe, mode);
|
||||
err = sdla_ds_te1_liu_alb(fe, mode);
|
||||
break;
|
||||
case WAN_TE1_LIU_LLB_MODE:
|
||||
sdla_ds_te1_liu_llb(fe, mode);
|
||||
err = sdla_ds_te1_liu_llb(fe, mode);
|
||||
break;
|
||||
case WAN_TE1_LINELB_MODE:
|
||||
case WAN_TE1_LIU_RLB_MODE:
|
||||
sdla_ds_te1_liu_rlb(fe, mode);
|
||||
err = sdla_ds_te1_liu_rlb(fe, mode);
|
||||
break;
|
||||
case WAN_TE1_LIU_DLB_MODE:
|
||||
sdla_ds_te1_liu_llb(fe, mode);
|
||||
sdla_ds_te1_liu_rlb(fe, mode);
|
||||
if (!sdla_ds_te1_liu_llb(fe, mode)){
|
||||
err = sdla_ds_te1_liu_rlb(fe, mode);
|
||||
}
|
||||
break;
|
||||
case WAN_TE1_FR_FLB_MODE:
|
||||
sdla_ds_te1_fr_flb(fe, mode);
|
||||
err = sdla_ds_te1_fr_flb(fe, mode);
|
||||
break;
|
||||
case WAN_TE1_PAYLB_MODE:
|
||||
case WAN_TE1_FR_PLB_MODE:
|
||||
sdla_ds_te1_fr_plb(fe, mode);
|
||||
err = sdla_ds_te1_fr_plb(fe, mode);
|
||||
break;
|
||||
case WAN_TE1_FR_RLB_MODE:
|
||||
break;
|
||||
default:
|
||||
DEBUG_EVENT("%s: Unsupport loopback mode (%s)!\n",
|
||||
fe->name,
|
||||
WAN_TE1_LB_MODE_DECODE(mode));
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!err){
|
||||
if (mode == WAN_TE1_ACTIVATE_LB){
|
||||
wan_set_bit(type, &fe->te_param.lb_mode);
|
||||
}else{
|
||||
wan_clear_bit(type, &fe->te_param.lb_mode);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -3288,7 +3562,7 @@ static int sdla_ds_te1_udp(sdla_fe_t *fe, void* p_udp_cmd, unsigned char* data)
|
|||
DEBUG_EVENT("%s: Force to read Front-End alarms\n",
|
||||
fe->name);
|
||||
fe->fe_stats.alarms =
|
||||
sdla_ds_te1_read_alarms(fe, WAN_FE_ALARM_READ);
|
||||
sdla_ds_te1_read_alarms(fe, WAN_FE_ALARM_READ|WAN_FE_ALARM_UPDATE);
|
||||
}
|
||||
sdla_ds_te1_rxlevel(fe);
|
||||
memcpy(&data[0], &fe->fe_stats, sizeof(sdla_fe_stats_t));
|
||||
|
|
|
@ -217,7 +217,8 @@ enum {
|
|||
AFT_FE_POLL,
|
||||
AFT_FE_TDM_RBS,
|
||||
AFT_FE_LED,
|
||||
AFT_FE_EC_POLL
|
||||
AFT_FE_EC_POLL,
|
||||
AFT_FE_RESTART
|
||||
};
|
||||
|
||||
#define MAX_IP_ERRORS 10
|
||||
|
@ -472,6 +473,7 @@ static int aft_write_hdlc_frame(void *chan_ptr, netskb_t *skb);
|
|||
#endif
|
||||
static int aft_tdm_ring_rsync(sdla_t *card);
|
||||
static void aft_critical_shutdown(sdla_t *card);
|
||||
static void aft_critical_event(void *arg, int type);
|
||||
|
||||
/* API VoIP event */
|
||||
#if defined(AFT_API_SUPPORT)
|
||||
|
@ -759,6 +761,7 @@ int wp_aft_te1_init (sdla_t* card, wandev_conf_t* conf)
|
|||
conf->interface =
|
||||
IS_T1_CARD(card) ? WANOPT_V35 : WANOPT_RS232;
|
||||
|
||||
card->wandev.critical_event = aft_critical_event;
|
||||
if (card->wandev.comm_port == WANOPT_PRI){
|
||||
conf->clocking = WANOPT_EXTERNAL;
|
||||
}
|
||||
|
@ -5372,6 +5375,20 @@ static void wp_aft_wdt_per_port_isr(sdla_t *card, int wdt_intr)
|
|||
|
||||
aft_wdt_reset(card);
|
||||
|
||||
if (card->rsync_timeout){
|
||||
if (SYSTEM_TICKS - card->rsync_timeout > 3*HZ) {
|
||||
card->rsync_timeout=0;
|
||||
if (card->fe.fe_status == FE_CONNECTED) {
|
||||
DEBUG_EVENT("%s: TDM IRQ Timeout \n",
|
||||
card->devname);
|
||||
wan_set_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd);
|
||||
WAN_TASKQ_SCHEDULE((&card->u.aft.port_task));
|
||||
}
|
||||
}
|
||||
aft_wdt_set(card,timeout);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<card->u.aft.num_of_time_slots;i++){
|
||||
|
||||
private_area_t *chan;
|
||||
|
@ -6599,6 +6616,7 @@ static void enable_data_error_intr(sdla_t *card)
|
|||
|
||||
#endif
|
||||
card->hw_iface.bus_write_4(card->hw,AFT_CHIP_CFG_REG,reg);
|
||||
card->rsync_timeout=SYSTEM_TICKS;
|
||||
|
||||
DEBUG_EVENT("%s: AFT Global TDM Intr\n",
|
||||
card->devname);
|
||||
|
@ -8992,6 +9010,21 @@ static void aft_port_task (void * card_ptr, int arg)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (wan_test_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd)){
|
||||
wan_clear_bit(AFT_FE_RESTART,&card->u.aft.port_task_cmd);
|
||||
if (card->fe.fe_status == FE_CONNECTED) {
|
||||
DEBUG_EVENT("%s: TDM IRQ Restart\n",
|
||||
card->devname);
|
||||
wan_spin_lock_irq(&card->wandev.lock,&smp_flags);
|
||||
card->fe.fe_status = FE_DISCONNECTED;
|
||||
handle_front_end_state(card);
|
||||
card->fe.fe_status = FE_CONNECTED;
|
||||
handle_front_end_state(card);
|
||||
wan_spin_unlock_irq(&card->wandev.lock,&smp_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __aft_fe_intr_ctrl(sdla_t *card, int status)
|
||||
|
@ -10546,6 +10579,7 @@ static int aft_tdm_ring_rsync(sdla_t *card)
|
|||
card->u.aft.tdm_tx_dma_toggle = 0;
|
||||
}
|
||||
|
||||
card->rsync_timeout=0;
|
||||
DEBUG_EVENT("%s: Card TDM Rsync Rx=%i Tx=%i\n",
|
||||
card->devname,
|
||||
card->u.aft.tdm_rx_dma_toggle,
|
||||
|
@ -10556,6 +10590,15 @@ static int aft_tdm_ring_rsync(sdla_t *card)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void aft_critical_event (void *arg, int type)
|
||||
{
|
||||
sdla_t *card = (sdla_t*)arg;
|
||||
DEBUG_EVENT("%s: Error: Card Critically Shutdown: Short Circuit Detected!\n",
|
||||
card->devname);
|
||||
aft_critical_shutdown(card);
|
||||
return;
|
||||
}
|
||||
|
||||
static void aft_critical_shutdown (sdla_t *card)
|
||||
{
|
||||
DEBUG_EVENT("%s: Error: Card Critically Shutdown!\n",
|
||||
|
@ -10624,6 +10667,7 @@ static int aft_hwec_config (sdla_t *card, private_area_t *chan, wanif_conf_t *co
|
|||
}
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1285,7 +1285,8 @@ static int if_open (netdevice_t* dev)
|
|||
* how long has the interface been up */
|
||||
wan_getcurrenttime(&chan->router_start_time, NULL);
|
||||
|
||||
WAN_NETIF_START_QUEUE(dev);
|
||||
WAN_NETIF_STOP_QUEUE(dev);
|
||||
WAN_NETIF_CARRIER_OFF(dev);
|
||||
|
||||
/* If FRONT End is down, it means that the DMA
|
||||
* is disabled. In this case don't try to
|
||||
|
|
|
@ -1654,6 +1654,11 @@ static int if_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
|
|||
card->u.b.cfg.max_length_tx_data_block = 682;//divisible by 31
|
||||
card->u.b.time_slots = NO_ACTIVE_RX_TIME_SLOTS_E1;
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -1985,6 +1990,9 @@ static void disable_comm (sdla_t *card)
|
|||
|
||||
/* TE1 - Unconfiging */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -5049,7 +5057,9 @@ static int config_bstrm (sdla_t *card)
|
|||
(IS_T1_CARD(card))?"T1":"E1");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -5066,6 +5076,9 @@ static int config_bstrm (sdla_t *card)
|
|||
card->devname);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
if (card->u.b.serial){
|
||||
|
|
|
@ -1392,6 +1392,10 @@ static void disable_comm (sdla_t *card)
|
|||
|
||||
/* TE1 - Unconfiging, only on shutdown */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -1902,6 +1906,10 @@ static int chdlc_disable_comm_shutdown (sdla_t *card)
|
|||
|
||||
/* TE1 - Unconfiging, only on shutdown */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -4255,6 +4263,10 @@ static int config_chdlc (sdla_t *card, netdevice_t *dev)
|
|||
(IS_T1_CARD(card))?"T1":"E1");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -4271,6 +4283,9 @@ static int config_chdlc (sdla_t *card, netdevice_t *dev)
|
|||
card->devname);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -846,6 +846,10 @@ int wpf_init(sdla_t *card, wandev_conf_t *conf)
|
|||
(IS_T1_CARD(card))?"T1":"E1");
|
||||
return -EIO;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
|
||||
|
||||
}else if (IS_56K_CARD(card)) {
|
||||
int err = -EINVAL;
|
||||
|
@ -860,6 +864,9 @@ int wpf_init(sdla_t *card, wandev_conf_t *conf)
|
|||
card->devname);
|
||||
return -EIO;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1424,6 +1431,10 @@ static void disable_comm (sdla_t *card)
|
|||
|
||||
/* TE1 unconfiging */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
|
|
@ -865,6 +865,10 @@ static void disable_comm (sdla_t *card)
|
|||
|
||||
/* TE1 unconfiging */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -3817,6 +3821,9 @@ static int config_ppp (sdla_t *card)
|
|||
(IS_T1_CARD(card))?"T1":"E1");
|
||||
return 0;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
|
||||
}else if (IS_56K_CARD(card)) {
|
||||
int err = -EINVAL;
|
||||
|
@ -3831,6 +3838,9 @@ static int config_ppp (sdla_t *card)
|
|||
card->devname);
|
||||
return 0;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,6 +77,20 @@
|
|||
#define WP_TDMV_ENABLE 0x01
|
||||
#define WP_TDMV_DISABLE 0x02
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
# define IS_CHAN_HARDHDLC(chan) (((chan)->flags & ZT_FLAG_NOSTDTXRX) || ((chan)->flags & ZT_FLAG_HDLC))
|
||||
#else
|
||||
# define IS_CHAN_HARDHDLC(chan) ((chan)->flags & ZT_FLAG_HDLC)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
# if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
# undef ZT_DCHAN_TX
|
||||
# endif
|
||||
#else
|
||||
#warning "TDM VOICE DCHAN DISABLED"
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
extern short *__zt_mulaw;
|
||||
#endif
|
||||
|
@ -218,6 +232,9 @@ static int wp_tdmv_ioctl(struct zt_chan*, unsigned int, unsigned long);
|
|||
#endif
|
||||
|
||||
static int wp_tdmv_hwec(struct zt_chan *chan, int enable);
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
static void wp_tdmv_tx_hdlc_hard(struct zt_chan *chan);
|
||||
#endif
|
||||
|
||||
static int wp_tdmv_state(void* pcard, int state);
|
||||
static int wp_tdmv_running(void* pcard);
|
||||
|
@ -238,8 +255,10 @@ static int wp_tdmv_rx_tx_span(void *pcard);
|
|||
static int wp_tdmv_span_buf_rotate(void *pcard, u32, unsigned long);
|
||||
static int wp_tdmv_ec_span(void *pcard);
|
||||
static int wp_tdmv_rx_chan(wan_tdmv_t*, int, unsigned char*, unsigned char*);
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(ZT_DCHAN_TX)
|
||||
static int wp_tdmv_tx_dchan(struct zt_chan *chan, int len);
|
||||
#endif
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
static int wp_tdmv_rx_dchan(wan_tdmv_t*, int, unsigned char*, unsigned int);
|
||||
#endif
|
||||
static int wp_tdmv_rxcopy(wan_tdmv_t *wan_tdmv, unsigned char* rxbuf, int max_len);
|
||||
|
@ -1047,20 +1066,29 @@ static int wp_tdmv_software_init(wan_tdmv_t *wan_tdmv)
|
|||
wp->span.channels = wp->max_timeslots;
|
||||
wp->span.chans = wp->chans;
|
||||
wp->span.flags = ZT_FLAG_RBS;
|
||||
wp->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
|
||||
|
||||
wp->span.ioctl = wp_tdmv_ioctl;
|
||||
/* Set this pointer only if card has hw echo canceller module */
|
||||
if (wp->hwec == WANOPT_YES && card->wandev.ec_dev){
|
||||
/* Initialize it only if HWEC option is enabled */
|
||||
wp->span.echocan = wp_tdmv_hwec;
|
||||
}
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
if (wp->dchan_map){
|
||||
DEBUG_EVENT("%s: Enable Zaptel HW DCHAN interface\n",
|
||||
wp->devname);
|
||||
wp->span.hdlc_hard_xmit = wp_tdmv_tx_hdlc_hard;
|
||||
}
|
||||
#endif
|
||||
wp->span.pvt = wp;
|
||||
if (wp->ise1){
|
||||
wp->span.deflaw = ZT_LAW_ALAW;
|
||||
card->fe.fe_cfg.tdmv_law = WAN_TDMV_ALAW;
|
||||
wp->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
|
||||
}else{
|
||||
wp->span.deflaw = ZT_LAW_MULAW;
|
||||
card->fe.fe_cfg.tdmv_law = WAN_TDMV_MULAW;
|
||||
wp->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
|
||||
}
|
||||
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||
init_waitqueue_head(&wp->span.maintq);
|
||||
|
@ -1077,7 +1105,11 @@ static int wp_tdmv_software_init(wan_tdmv_t *wan_tdmv)
|
|||
ZT_SIG_FXSLS | ZT_SIG_FXSGS |
|
||||
ZT_SIG_FXSKS | ZT_SIG_FXOLS |
|
||||
ZT_SIG_FXOGS | ZT_SIG_FXOKS |
|
||||
ZT_SIG_CAS | ZT_SIG_DACS_RBS;
|
||||
ZT_SIG_CAS | ZT_SIG_DACS_RBS
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
| ZT_SIG_HARDHDLC
|
||||
#endif
|
||||
;
|
||||
}else{
|
||||
wp->chans[x].sigcap = ZT_SIG_NONE;
|
||||
}
|
||||
|
@ -1516,9 +1548,10 @@ static int wp_tdmv_rbsbits(struct zt_chan *chan, int bits)
|
|||
if (bits & ZT_CBIT) ABCD_bits |= WAN_RBS_SIG_C;
|
||||
if (bits & ZT_DBIT) ABCD_bits |= WAN_RBS_SIG_D;
|
||||
|
||||
if (chan->flags & ZT_FLAG_HDLC){
|
||||
if (IS_CHAN_HARDHDLC(chan)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUG_TDMV(
|
||||
"[TDMV] %s: %s:%02d(%d) TX RBS: A:%1d B:%1d C:%1d D:%1d\n",
|
||||
wp->devname,
|
||||
|
@ -1755,17 +1788,19 @@ wp_tdmv_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data)
|
|||
#endif
|
||||
{
|
||||
int err = -ENOTTY;
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
wp_tdmv_softc_t *wp=NULL;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PRODUCT_WANPIPE_TDM_VOICE_ECHOMASTER
|
||||
wp_tdmv_softc_t *echo_detect_wp = NULL;
|
||||
int echo_detect_chan = 0;
|
||||
#endif
|
||||
|
||||
wp = chan->pvt;
|
||||
|
||||
switch(cmd)
|
||||
{
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(ZT_DCHAN_TX)
|
||||
case ZT_DCHAN_TX:
|
||||
|
||||
WAN_ASSERT(chan == NULL || chan->pvt == NULL);
|
||||
|
@ -1859,7 +1894,7 @@ static int wp_tdmv_hwec(struct zt_chan *chan, int enable)
|
|||
* echo cancellation is enabled regardless of
|
||||
* asterisk. In persist mode off asterisk
|
||||
* controls hardware echo cancellation */
|
||||
if (card->hwec_conf.persist_disable || chan->flags & ZT_FLAG_HDLC) {
|
||||
if (card->hwec_conf.persist_disable || IS_CHAN_HARDHDLC(chan)) {
|
||||
err = card->wandev.ec_enable(card, enable, channel);
|
||||
} else {
|
||||
err = 0;
|
||||
|
@ -1989,7 +2024,8 @@ static int wp_tdmv_rx_dchan(wan_tdmv_t *wan_tdmv, int channo,
|
|||
wp->devname);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!(ms->flags & ZT_FLAG_HDLC)){
|
||||
|
||||
if (!IS_CHAN_HARDHDLC(ms)){
|
||||
DEBUG_TDMV("%s: ERROR: %s not defined as D-CHAN!\n",
|
||||
wp->devname, ms->name);
|
||||
return -EINVAL;
|
||||
|
@ -2060,7 +2096,41 @@ static int wp_tdmv_rx_dchan(wan_tdmv_t *wan_tdmv, int channo,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN)
|
||||
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL)
|
||||
static void wp_tdmv_tx_hdlc_hard(struct zt_chan *chan)
|
||||
{
|
||||
wp_tdmv_softc_t *wp = NULL;
|
||||
netskb_t *skb = NULL;
|
||||
unsigned char *data = NULL;
|
||||
int size = 0, err = 0, res = 0;
|
||||
|
||||
WAN_ASSERT_VOID(chan == NULL);
|
||||
WAN_ASSERT_VOID(chan->pvt == NULL);
|
||||
wp = chan->pvt;
|
||||
WAN_ASSERT_VOID(wp->dchan_dev == NULL);
|
||||
|
||||
size = chan->writen[chan->outwritebuf] - chan->writeidx[chan->outwritebuf]-2;
|
||||
skb = wan_skb_alloc(size+1);
|
||||
if (skb == NULL){
|
||||
return;
|
||||
}
|
||||
data = wan_skb_put(skb, size);
|
||||
res = zt_hdlc_getbuf(chan, data, &size);
|
||||
if (res == 0){
|
||||
DEBUG_EVENT("%s: ERROR: TX HW DCHAN %d bytes (res %d)\n",
|
||||
wp->devname, size, res);
|
||||
}
|
||||
err = wp->dchan_dev->hard_start_xmit(skb, wp->dchan_dev);
|
||||
if (err){
|
||||
wan_skb_free(skb);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN) && defined(ZT_DCHAN_TX)
|
||||
static int wp_tdmv_tx_dchan(struct zt_chan *chan, int len)
|
||||
{
|
||||
wp_tdmv_softc_t *wp = NULL;
|
||||
|
@ -2074,10 +2144,12 @@ static int wp_tdmv_tx_dchan(struct zt_chan *chan, int len)
|
|||
wp = chan->pvt;
|
||||
WAN_ASSERT(wp->dchan_dev == NULL);
|
||||
|
||||
|
||||
if (len <= 2){
|
||||
return -EINVAL;
|
||||
}
|
||||
len -= 2; /* Remove checksum */
|
||||
|
||||
skb = wan_skb_alloc(len+1);
|
||||
if (skb == NULL){
|
||||
return -ENOMEM;
|
||||
|
@ -2108,6 +2180,7 @@ static int wp_tdmv_tx_dchan(struct zt_chan *chan, int len)
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** wp_tdmv_rx_chan() -
|
||||
**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -84,6 +84,8 @@
|
|||
/******************************************************************************
|
||||
* DEFINES AND MACROS
|
||||
******************************************************************************/
|
||||
#define WAN_TE1_IGNORE_RLPS_ALOS
|
||||
|
||||
#define FIRST_SAMPLE 0
|
||||
#define LAST_SAMPLE 23
|
||||
#define FIRST_UI 0
|
||||
|
@ -197,7 +199,7 @@ static int te_reg_verify = 0;
|
|||
|
||||
|
||||
#define WAN_TE1_FRAMED_ALARMS (WAN_TE_BIT_RED_ALARM | WAN_TE_BIT_OOF_ALARM)
|
||||
#define WAN_TE1_UNFRAMED_ALARMS (WAN_TE_BIT_RED_ALARM)
|
||||
#define WAN_TE1_UNFRAMED_ALARMS (WAN_TE_BIT_RED_ALARM | WAN_TE_BIT_LOS_ALARM)
|
||||
|
||||
#if 0
|
||||
#define TE1_FRAME_ALARM (\
|
||||
|
@ -3617,9 +3619,17 @@ static int sdla_pmc4351_te_config(sdla_fe_t *fe, u16 adapter_type)
|
|||
}
|
||||
|
||||
/* RLPS Configuration and Status (Reg 0xF8) */
|
||||
/* AF Nov 2007
|
||||
** Set SQUELCHE to 1. This forces RLPS to stop sending pulses
|
||||
** to CDRC during ALOS conditions */
|
||||
#if defined (WAN_TE1_IGNORE_RLPS_ALOS)
|
||||
WRITE_REG(REG_RLPS_CFG_STATUS,
|
||||
BIT_RLPS_CFG_STATUS_LONGE/* |
|
||||
BIT_RLPS_CFG_STATUS_SQUELCHE*/);
|
||||
BIT_RLPS_CFG_STATUS_LONGE |
|
||||
BIT_RLPS_CFG_STATUS_SQUELCHE);
|
||||
#else
|
||||
WRITE_REG(REG_RLPS_CFG_STATUS,
|
||||
BIT_RLPS_CFG_STATUS_LONGE);
|
||||
#endif
|
||||
|
||||
/* RLPS ALOS Detection/Clearance Thresholds (Reg 0xF9) */
|
||||
/* NC: Aug 20 2003:
|
||||
|
@ -3922,9 +3932,17 @@ static int sdla_pmc4354_te_config(sdla_fe_t *fe, u16 adapter_type)
|
|||
}
|
||||
|
||||
/* RLPS Configuration and Status (Reg 0xQF8) */
|
||||
/* AF Nov 2007
|
||||
** Set SQUELCHE to 1. This forces RLPS to stop sending pulses
|
||||
** to CDRC during ALOS conditions */
|
||||
#if defined (WAN_TE1_IGNORE_RLPS_ALOS)
|
||||
WRITE_REG(REG_RLPS_CFG_STATUS,
|
||||
BIT_RLPS_CFG_STATUS_LONGE/* |
|
||||
BIT_RLPS_CFG_STATUS_SQUELCHE*/);
|
||||
BIT_RLPS_CFG_STATUS_LONGE |
|
||||
BIT_RLPS_CFG_STATUS_SQUELCHE);
|
||||
#else
|
||||
WRITE_REG(REG_RLPS_CFG_STATUS,
|
||||
BIT_RLPS_CFG_STATUS_LONGE);
|
||||
#endif
|
||||
|
||||
/* RLPS ALOS Detection/Clearance Thresholds (Reg 0xQF9) */
|
||||
/* NC: Aug 20 2003:
|
||||
|
@ -6404,7 +6422,15 @@ sdla_te_add_event(sdla_fe_t *fe, sdla_fe_timer_event_t *fe_event)
|
|||
*/
|
||||
static int sdla_te_add_timer(sdla_fe_t* fe, unsigned long delay)
|
||||
{
|
||||
int err;
|
||||
int err=0;
|
||||
|
||||
if (wan_test_bit(TE_TIMER_KILL,(void*)&fe->te_param.critical)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (wan_test_bit(TE_TIMER_RUNNING,(void*)&fe->te_param.critical)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = wan_add_timer(&fe->timer, delay * HZ / 1000);
|
||||
if (err){
|
||||
|
|
|
@ -398,6 +398,7 @@ static int aft_tdmv_free(sdla_t *card);
|
|||
static int aft_tdmv_if_init(sdla_t *card, private_area_t *chan, wanif_conf_t *conf);
|
||||
static int aft_tdmv_if_free(sdla_t *card, private_area_t *chan);
|
||||
static void aft_critical_shutdown (sdla_t *card);
|
||||
static int digital_loop_test(sdla_t* card,wan_udp_pkt_t* wan_udp_pkt);
|
||||
|
||||
#ifdef AFT_TDM_API_SUPPORT
|
||||
static int aft_read_rbs_bits(void *chan_ptr, u32 ch, u8 *rbs_bits);
|
||||
|
@ -5151,11 +5152,10 @@ static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
|
|||
break;
|
||||
|
||||
case DIGITAL_LOOPTEST:
|
||||
wan_udp_pkt->wan_udp_return_code = 0;
|
||||
DEBUG_EVENT("Ready to send some data!!!\n");
|
||||
wan_udp_pkt->wan_udp_return_code =
|
||||
digital_loop_test(card,wan_udp_pkt);
|
||||
break;
|
||||
|
||||
|
||||
case AFT_MODEM_STATUS:
|
||||
wan_udp_pkt->wan_udp_return_code = 0;
|
||||
if (card->wandev.state == WAN_CONNECTED){
|
||||
|
@ -7583,5 +7583,75 @@ static void aft_critical_shutdown (sdla_t *card)
|
|||
|
||||
|
||||
|
||||
static int digital_loop_test(sdla_t* card,wan_udp_pkt_t* wan_udp_pkt)
|
||||
{
|
||||
netskb_t* skb;
|
||||
netdevice_t* dev;
|
||||
char* buf;
|
||||
private_area_t *chan;
|
||||
|
||||
dev = WAN_DEVLE2DEV(WAN_LIST_FIRST(&card->wandev.dev_head));
|
||||
if (dev == NULL) {
|
||||
return 1;
|
||||
}
|
||||
chan = wan_netif_priv(dev);
|
||||
if (chan == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (chan->common.state != WAN_CONNECTED) {
|
||||
DEBUG_EVENT("%s: Loop test failed: dev not connected!\n",
|
||||
card->devname);
|
||||
return 2;
|
||||
}
|
||||
|
||||
skb = wan_skb_alloc(wan_udp_pkt->wan_udp_data_len+100);
|
||||
if (skb == NULL) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
switch (chan->common.usedby) {
|
||||
|
||||
case API:
|
||||
wan_skb_push(skb, sizeof(api_rx_hdr_t));
|
||||
break;
|
||||
|
||||
case STACK:
|
||||
case WANPIPE:
|
||||
break;
|
||||
|
||||
case TDM_VOICE:
|
||||
case TDM_VOICE_API:
|
||||
case TDM_VOICE_DCHAN:
|
||||
if (card->u.aft.tdmv_dchan) {
|
||||
break;
|
||||
} else {
|
||||
DEBUG_EVENT("%s: Loop test failed: no dchan in TDMV mode!\n",
|
||||
card->devname);
|
||||
}
|
||||
/* Fall into the default case */
|
||||
|
||||
default:
|
||||
DEBUG_EVENT("%s: Loop test failed: invalid operation mode!\n",
|
||||
card->devname);
|
||||
wan_skb_free(skb);
|
||||
return 4;
|
||||
}
|
||||
|
||||
buf = wan_skb_put(skb, wan_udp_pkt->wan_udp_data_len);
|
||||
memcpy(buf, wan_udp_pkt->wan_udp_data, wan_udp_pkt->wan_udp_data_len);
|
||||
|
||||
|
||||
skb->next = skb->prev = NULL;
|
||||
skb->dev = dev;
|
||||
skb->protocol = htons(ETH_P_IP);
|
||||
wan_skb_reset_mac_header(skb);
|
||||
dev_queue_xmit(skb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****** End ****************************************************************/
|
||||
|
|
|
@ -620,6 +620,9 @@ static void
|
|||
sdla_save_hw_probe (sdlahw_t* hw, int port)
|
||||
{
|
||||
sdla_hw_probe_t *tmp_hw_probe, *tmp;
|
||||
unsigned char id_str[50];
|
||||
|
||||
memset(id_str,0,sizeof(id_str));
|
||||
|
||||
tmp_hw_probe = wan_malloc(sizeof(sdla_hw_probe_t));
|
||||
if (!tmp_hw_probe)
|
||||
|
@ -656,6 +659,17 @@ sdla_save_hw_probe (sdlahw_t* hw, int port)
|
|||
port ? "SEC" : "PRI",
|
||||
hw->hwcard->core_rev);
|
||||
}
|
||||
|
||||
if (hw->hwcard->core_id == AFT_DS_FE_CORE_ID) {
|
||||
strcpy(id_str,"DS26521");
|
||||
} else {
|
||||
strcpy(id_str,"PMC4351");
|
||||
}
|
||||
sprintf(&tmp_hw_probe->hw_info_verbose[0], "\n+%02d:%s:%s",
|
||||
port+1, id_str,
|
||||
AFT_PCITYPE_DECODE(hw->hwcard));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case A104_ADPTR_4TE1:
|
||||
|
@ -685,6 +699,20 @@ sdla_save_hw_probe (sdlahw_t* hw, int port)
|
|||
hw->hwcard->core_rev
|
||||
); /* line_no */
|
||||
}
|
||||
|
||||
if (hw->hwcard->core_id == AFT_DS_FE_CORE_ID) {
|
||||
if (hw->hwcard->adptr_type == A108_ADPTR_8TE1) {
|
||||
strcpy(id_str,"DS26528");
|
||||
} else {
|
||||
strcpy(id_str,"DS26524");
|
||||
}
|
||||
} else {
|
||||
strcpy(id_str,"PMC4354");
|
||||
}
|
||||
|
||||
sprintf(&tmp_hw_probe->hw_info_verbose[0], "\n+%02d:%s:%s",
|
||||
port+1, id_str,
|
||||
AFT_PCITYPE_DECODE(hw->hwcard));
|
||||
break;
|
||||
|
||||
case A200_ADPTR_ANALOG:
|
||||
|
@ -838,9 +866,9 @@ static int sdla_save_Remora_hw_probe_verbose(sdlahw_t* hw, int port)
|
|||
for(mod_no = 0; mod_no < MAX_REMORA_MODULES; mod_no ++){
|
||||
|
||||
if (hw->hwcard->rm_mod_type[mod_no] == MOD_TYPE_FXS){
|
||||
sprintf(str, "\n+%02d:FXS", mod_no+1);
|
||||
sprintf(str, "\n+%02d:FXS:%s", mod_no+1,AFT_PCITYPE_DECODE(hw->hwcard));
|
||||
}else if (hw->hwcard->rm_mod_type[mod_no] == MOD_TYPE_FXO){
|
||||
sprintf(str, "\n+%02d:FXO", mod_no+1);
|
||||
sprintf(str, "\n+%02d:FXO:%s", mod_no+1,AFT_PCITYPE_DECODE(hw->hwcard));
|
||||
}else{
|
||||
sprintf(str, "\n+%02d:EMPTY", mod_no+1);
|
||||
}
|
||||
|
|
|
@ -756,13 +756,11 @@ static u_int8_t __sdla_shark_rm_read_fe (void* phw, ...)
|
|||
}
|
||||
sdla_bus_write_4(hw, SPI_INTERFACE_REG, data);
|
||||
#endif
|
||||
#if 0
|
||||
DEBUG_EVENT("%s: %s: Module %d - Execute SPI command %08X\n",
|
||||
DEBUG_TEST("%s: %s: Module %d - Execute SPI command %08X\n",
|
||||
hw->devname,
|
||||
__FUNCTION__,
|
||||
mod_no,
|
||||
data);
|
||||
#endif
|
||||
for (i=0;i<10;i++){
|
||||
WP_DELAY(10);
|
||||
sdla_bus_read_4(hw, SPI_INTERFACE_REG, &data);
|
||||
|
@ -772,9 +770,9 @@ static u_int8_t __sdla_shark_rm_read_fe (void* phw, ...)
|
|||
}
|
||||
|
||||
if (data & MOD_SPI_BUSY){
|
||||
DEBUG_EVENT("%s: Module %d: Critical Error (%s:%d)!\n",
|
||||
DEBUG_EVENT("%s: Module %d: Critical Error (%s:%d) Data=0x%0X!\n",
|
||||
hw->devname, mod_no,
|
||||
__FUNCTION__,__LINE__);
|
||||
__FUNCTION__,__LINE__,data);
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
|
|
|
@ -996,6 +996,11 @@ static int del_if (wan_device_t* wandev, netdevice_t* dev)
|
|||
|
||||
/* TE1 - Unconfiging, only on shutdown */
|
||||
if (IS_TE1_CARD(card)) {
|
||||
|
||||
if (card->wandev.fe_iface.pre_release){
|
||||
card->wandev.fe_iface.pre_release(&card->fe);
|
||||
}
|
||||
|
||||
if (card->wandev.fe_iface.unconfig){
|
||||
card->wandev.fe_iface.unconfig(&card->fe);
|
||||
}
|
||||
|
@ -3206,6 +3211,9 @@ static int config_chdlc (sdla_t *card)
|
|||
(IS_T1_CARD(card))?"T1":"E1");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_56K_CARD(card)) {
|
||||
|
@ -3220,6 +3228,9 @@ static int config_chdlc (sdla_t *card)
|
|||
card->devname);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (card->wandev.fe_iface.post_init){
|
||||
err=card->wandev.fe_iface.post_init(&card->fe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,157 +0,0 @@
|
|||
af_wanpipe_src.o: \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/src/net/../wanrouter/af_wanpipe_src.c \
|
||||
include/linux/autoconf.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_includes.h \
|
||||
include/linux/init.h include/linux/compiler.h \
|
||||
include/linux/compiler-gcc4.h include/linux/compiler-gcc.h \
|
||||
include/linux/version.h include/linux/module.h include/linux/sched.h \
|
||||
include/linux/auxvec.h include/asm/auxvec.h include/asm/param.h \
|
||||
include/linux/capability.h include/linux/types.h \
|
||||
include/linux/posix_types.h include/linux/stddef.h \
|
||||
include/asm/posix_types.h include/asm/types.h include/linux/spinlock.h \
|
||||
include/linux/preempt.h include/linux/thread_info.h \
|
||||
include/linux/bitops.h include/asm/bitops.h include/asm/alternative.h \
|
||||
include/asm-generic/bitops/sched.h include/asm-generic/bitops/hweight.h \
|
||||
include/asm-generic/bitops/fls64.h \
|
||||
include/asm-generic/bitops/ext2-non-atomic.h \
|
||||
include/asm-generic/bitops/le.h include/asm/byteorder.h \
|
||||
include/linux/byteorder/little_endian.h include/linux/byteorder/swab.h \
|
||||
include/linux/byteorder/generic.h include/asm-generic/bitops/minix.h \
|
||||
include/asm/thread_info.h include/asm/page.h \
|
||||
include/asm-generic/memory_model.h include/asm-generic/page.h \
|
||||
include/asm/processor.h include/asm/vm86.h include/asm/math_emu.h \
|
||||
include/asm/sigcontext.h include/asm/segment.h include/asm/cpufeature.h \
|
||||
include/asm/msr.h include/asm/system.h include/linux/kernel.h \
|
||||
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h \
|
||||
include/linux/linkage.h include/asm/linkage.h include/asm/bug.h \
|
||||
include/asm-generic/bug.h include/linux/irqflags.h \
|
||||
include/asm/irqflags.h include/linux/cache.h include/asm/cache.h \
|
||||
include/linux/threads.h include/asm/percpu.h \
|
||||
include/asm-generic/percpu.h include/linux/cpumask.h \
|
||||
include/linux/bitmap.h include/linux/string.h include/asm/string.h \
|
||||
include/linux/stringify.h include/linux/spinlock_types.h \
|
||||
include/linux/lockdep.h include/linux/list.h include/linux/poison.h \
|
||||
include/linux/prefetch.h include/linux/debug_locks.h \
|
||||
include/linux/stacktrace.h include/asm/spinlock_types.h \
|
||||
include/asm/spinlock.h include/asm/atomic.h \
|
||||
include/asm-generic/atomic.h include/asm/rwlock.h \
|
||||
include/linux/spinlock_api_smp.h include/asm/current.h \
|
||||
include/linux/timex.h include/linux/time.h include/linux/seqlock.h \
|
||||
include/asm/timex.h include/asm/tsc.h include/linux/jiffies.h \
|
||||
include/linux/calc64.h include/asm/div64.h include/linux/rbtree.h \
|
||||
include/linux/errno.h include/asm/errno.h include/asm-generic/errno.h \
|
||||
include/asm-generic/errno-base.h include/linux/nodemask.h \
|
||||
include/linux/numa.h include/asm/semaphore.h include/linux/wait.h \
|
||||
include/linux/rwsem.h include/asm/rwsem.h include/asm/ptrace.h \
|
||||
include/asm/mmu.h include/asm/cputime.h include/asm-generic/cputime.h \
|
||||
include/linux/smp.h include/asm/smp.h include/asm/fixmap.h \
|
||||
include/asm/acpi.h include/acpi/pdc_intel.h include/asm/apicdef.h \
|
||||
include/asm/kmap_types.h include/asm/mpspec.h include/asm/mpspec_def.h \
|
||||
include/asm-i386/mach-generic/mach_mpspec.h include/asm/io_apic.h \
|
||||
include/asm/apic.h include/linux/pm.h \
|
||||
include/asm-i386/mach-generic/mach_apicdef.h include/asm/genapic.h \
|
||||
include/linux/sem.h include/linux/ipc.h include/asm/ipcbuf.h \
|
||||
include/asm/sembuf.h include/linux/signal.h include/asm/signal.h \
|
||||
include/asm-generic/signal.h include/asm/siginfo.h \
|
||||
include/asm-generic/siginfo.h include/linux/securebits.h \
|
||||
include/linux/fs_struct.h include/linux/completion.h \
|
||||
include/linux/pid.h include/linux/rcupdate.h include/linux/percpu.h \
|
||||
include/linux/slab.h include/linux/gfp.h include/linux/mmzone.h \
|
||||
include/linux/memory_hotplug.h include/linux/notifier.h \
|
||||
include/linux/mutex.h include/linux/topology.h include/asm/topology.h \
|
||||
include/asm-generic/topology.h include/linux/kmalloc_sizes.h \
|
||||
include/linux/seccomp.h include/linux/futex.h include/linux/rtmutex.h \
|
||||
include/linux/plist.h include/linux/param.h include/linux/resource.h \
|
||||
include/asm/resource.h include/asm-generic/resource.h \
|
||||
include/linux/timer.h include/linux/hrtimer.h include/linux/ktime.h \
|
||||
include/linux/aio.h include/linux/workqueue.h include/linux/aio_abi.h \
|
||||
include/linux/sysdev.h include/linux/kobject.h include/linux/sysfs.h \
|
||||
include/linux/kref.h include/linux/stat.h include/asm/stat.h \
|
||||
include/linux/kmod.h include/linux/elf.h include/linux/elf-em.h \
|
||||
include/asm/elf.h include/asm/user.h include/linux/utsname.h \
|
||||
include/asm/desc.h include/asm/ldt.h include/linux/moduleparam.h \
|
||||
include/asm/local.h include/asm/module.h include/linux/mm.h \
|
||||
include/linux/prio_tree.h include/linux/fs.h include/linux/limits.h \
|
||||
include/linux/ioctl.h include/asm/ioctl.h include/asm-generic/ioctl.h \
|
||||
include/linux/kdev_t.h include/linux/dcache.h \
|
||||
include/linux/radix-tree.h include/linux/quota.h \
|
||||
include/linux/dqblk_xfs.h include/linux/dqblk_v1.h \
|
||||
include/linux/dqblk_v2.h include/linux/nfs_fs_i.h include/linux/nfs.h \
|
||||
include/linux/sunrpc/msg_prot.h include/linux/fcntl.h \
|
||||
include/asm/fcntl.h include/asm-generic/fcntl.h include/linux/err.h \
|
||||
include/linux/backing-dev.h include/asm/pgtable.h \
|
||||
include/asm/pgtable-2level-defs.h include/asm/pgtable-2level.h \
|
||||
include/asm-generic/pgtable-nopmd.h include/asm-generic/pgtable-nopud.h \
|
||||
include/asm-generic/pgtable.h include/linux/page-flags.h \
|
||||
include/linux/vmstat.h include/linux/ctype.h include/net/ip.h \
|
||||
include/linux/ip.h include/linux/in.h include/linux/socket.h \
|
||||
include/asm/socket.h include/asm/sockios.h include/linux/sockios.h \
|
||||
include/linux/uio.h include/net/inet_sock.h include/net/flow.h \
|
||||
include/linux/in6.h include/net/sock.h include/linux/netdevice.h \
|
||||
include/linux/if.h include/linux/hdlc/ioctl.h include/linux/if_ether.h \
|
||||
include/linux/skbuff.h include/linux/highmem.h include/asm/cacheflush.h \
|
||||
include/asm/highmem.h include/linux/interrupt.h \
|
||||
include/linux/irqreturn.h include/linux/hardirq.h \
|
||||
include/linux/smp_lock.h include/asm/hardirq.h include/linux/irq.h \
|
||||
include/asm/irq.h include/asm-i386/mach-default/irq_vectors.h \
|
||||
include/asm-i386/mach-default/irq_vectors_limits.h include/asm/hw_irq.h \
|
||||
include/linux/profile.h include/asm/sections.h \
|
||||
include/asm-generic/sections.h include/linux/irq_cpustat.h \
|
||||
include/asm/tlbflush.h include/linux/poll.h include/asm/poll.h \
|
||||
include/asm/uaccess.h include/linux/net.h include/linux/sysctl.h \
|
||||
include/linux/textsearch.h include/net/checksum.h \
|
||||
include/asm/checksum.h include/linux/dmaengine.h include/linux/device.h \
|
||||
include/linux/ioport.h include/linux/klist.h include/linux/if_packet.h \
|
||||
include/linux/security.h include/linux/binfmts.h include/linux/shm.h \
|
||||
include/asm/shmparam.h include/asm/shmbuf.h include/linux/msg.h \
|
||||
include/asm/msgbuf.h include/linux/key.h include/linux/xfrm.h \
|
||||
include/linux/filter.h include/net/dst.h include/linux/rtnetlink.h \
|
||||
include/linux/netlink.h include/net/neighbour.h \
|
||||
include/linux/seq_file.h include/net/request_sock.h include/net/snmp.h \
|
||||
include/linux/snmp.h include/linux/ipv6.h include/linux/icmpv6.h \
|
||||
include/linux/tcp.h include/net/inet_connection_sock.h \
|
||||
include/net/inet_timewait_sock.h include/net/tcp_states.h \
|
||||
include/net/timewait_sock.h include/linux/udp.h include/net/if_inet6.h \
|
||||
include/net/protocol.h include/net/route.h include/net/inetpeer.h \
|
||||
include/linux/in_route.h include/linux/route.h include/linux/wireless.h \
|
||||
include/linux/inet.h include/asm/io.h include/asm-generic/iomap.h \
|
||||
include/linux/vmalloc.h include/asm/delay.h include/linux/pci.h \
|
||||
include/linux/pci_regs.h include/linux/pci_ids.h \
|
||||
include/linux/mod_devicetable.h include/linux/dmapool.h \
|
||||
include/asm/scatterlist.h include/asm/pci.h \
|
||||
include/asm-generic/pci-dma-compat.h include/linux/dma-mapping.h \
|
||||
include/asm/dma-mapping.h include/asm-generic/pci.h \
|
||||
include/linux/if_arp.h include/linux/pkt_sched.h \
|
||||
include/linux/etherdevice.h include/linux/random.h \
|
||||
include/linux/inetdevice.h include/net/inet_common.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_defines.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_version.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_kernel.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_debug.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_common.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_events.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_cfg.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_56k.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_te1.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_te3.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_remora.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_remora_proslic.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_front_end.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanrouter.h \
|
||||
include/linux/proc_fs.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdla_tdmv.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdlasfm.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/sdladrv.h \
|
||||
include/linux/serial.h include/linux/serialP.h include/linux/termios.h \
|
||||
include/asm/termios.h include/asm/termbits.h include/asm/ioctls.h \
|
||||
include/linux/circ_buf.h include/linux/serial_reg.h \
|
||||
include/asm/serial.h include/linux/tty.h include/linux/major.h \
|
||||
include/linux/tty_driver.h include/linux/cdev.h \
|
||||
include/linux/tty_ldisc.h include/linux/tty_flip.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/if_wanpipe_kernel.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/if_wanpipe.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/if_wanpipe_common.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_x25_kernel.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_dsp_kernel.h \
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/include/linux/wanpipe_x25_kernel.h
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,2 +1,2 @@
|
|||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/wanec.ko
|
||||
/root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/wanec_iface.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/wanec_cmd.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/wanec_utils.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/wanec_dev.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/apilib/bt/octapi_bt0.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/apilib/largmath/octapi_largmath.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/apilib/llman/octapi_llman.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_apimi/oct6100_mask_interrupts.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_events.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o /root/development/3.2/wanpipe-3.2.1/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_user.o
|
||||
/root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/wanec.ko
|
||||
/root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/wanec_iface.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/wanec_cmd.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/wanec_utils.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/wanec_dev.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/apilib/bt/octapi_bt0.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/apilib/largmath/octapi_largmath.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/apilib/llman/octapi_llman.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_apimi/oct6100_mask_interrupts.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_events.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o /root/development/3.2/wanpipe-3.2.2/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_user.o
|
||||
|
|
|
@ -16,6 +16,8 @@ $(MODULE_NAME)-objs = $(OBJS)
|
|||
RM = @rm -rf
|
||||
JUNK = *~ *.bak DEADJOE
|
||||
|
||||
PWD := $(shell pwd)
|
||||
SUBDIRS=$(PWD)
|
||||
|
||||
# First pass, kernel Makefile reads module objects
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
|
@ -29,19 +31,19 @@ PWD := $(shell pwd)
|
|||
KBUILD_VERBOSE=
|
||||
|
||||
all:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) CC=$(CC) KBUILD_VERBOSE=$(KBUILD_VERBOSE) modules
|
||||
|
||||
clean:
|
||||
$(shell find . -name '*.*o' | xargs rm)
|
||||
$(shell find . -name '.*.o.cmd' | xargs rm)
|
||||
$(shell find $(SUBDIRS) -name '*.*o' | xargs rm)
|
||||
$(shell find $(SUBDIRS) -name '.*.o.cmd' | xargs rm)
|
||||
$(shell rm -f build.sh)
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) clean
|
||||
|
||||
distclean: clean
|
||||
$(RM) $(JUNK) $(OBJS)
|
||||
|
||||
help:
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) help
|
||||
$(MAKE) -C $(KDIR) SUBDIRS=$(SUBDIRS) help
|
||||
|
||||
|
||||
# Indents the kernel source the way linux/Documentation/CodingStyle.txt
|
||||
|
@ -50,6 +52,6 @@ indent:
|
|||
indent -kr -i8 $($(MODULE_NAME)-objs:.o=.c)
|
||||
|
||||
install:
|
||||
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
|
||||
$(MAKE) -C $(KDIR) M=$(SUBDIRS) modules_install
|
||||
|
||||
endif
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/vermagic.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
MODULE_INFO(vermagic, VERMAGIC_STRING);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,6) || defined(WANPIPE_MOD_266_FORCE_UPDATE)
|
||||
#undef unix
|
||||
struct module __this_module
|
||||
__attribute__((section(".gnu.linkonce.this_module"))) = {
|
||||
.name = __stringify(KBUILD_MODNAME),
|
||||
.init = init_module,
|
||||
#ifdef CONFIG_MODULE_UNLOAD
|
||||
.exit = cleanup_module,
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct modversion_info ____versions[]
|
||||
__attribute__((section("__versions"))) = {
|
||||
|
||||
};
|
||||
|
||||
static const char __module_depends[]
|
||||
__attribute_used__
|
||||
__attribute__((section(".modinfo"))) =
|
||||
"depends=wanrouter";
|
||||
|
|
@ -51,4 +51,4 @@ __attribute__((section(".modinfo"))) =
|
|||
"depends=";
|
||||
|
||||
|
||||
MODULE_INFO(srcversion, "3287EDB9893E2DC512577FD");
|
||||
MODULE_INFO(srcversion, "4B81F8CBCF0FE7DE2D1F612");
|
||||
|
|
|
@ -829,6 +829,9 @@ int wanec_ChannelOpen(wan_ec_dev_t *ec_dev, wan_ec_api_t *ec_api)
|
|||
(pcm_law_type == cOCT6100_PCM_U_LAW) ?
|
||||
"MULAW":"ALAW");
|
||||
|
||||
DEBUG_EVENT("%s: Opening HW Echo Canceller (NoiseRed=%s)\n",
|
||||
ec->name,card->hwec_conf.noise_reduction?"On":"Off");
|
||||
|
||||
for(channel = 0; channel < ec->max_channels; channel++){
|
||||
Oct6100ChannelOpenDef( &EchoChannelOpen );
|
||||
|
||||
|
@ -871,12 +874,12 @@ int wanec_ChannelOpen(wan_ec_dev_t *ec_dev, wan_ec_api_t *ec_api)
|
|||
EchoChannelOpen.VqeConfig.fAcousticEcho = TRUE;
|
||||
#endif
|
||||
|
||||
#if defined(WANEC_ENABLE_NOISE_REDUCTION)
|
||||
#warning "WAN HWEC NOISE Reduction Enabled"
|
||||
if (card->hwec_conf.noise_reduction) {
|
||||
EchoChannelOpen.VqeConfig.fSoutAdaptiveNoiseReduction = TRUE;
|
||||
#else
|
||||
} else {
|
||||
EchoChannelOpen.VqeConfig.fSoutAdaptiveNoiseReduction = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
EchoChannelOpen.VqeConfig.ulComfortNoiseMode =
|
||||
cOCT6100_COMFORT_NOISE_NORMAL;
|
||||
/* cOCT6100_COMFORT_NOISE_NORMAL
|
||||
|
|
|
@ -113,7 +113,26 @@ if [ "$ZAPTEL_DIR" == "" ]; then
|
|||
ZAPTEL_DIR=/usr/src/zaptel
|
||||
fi
|
||||
|
||||
cd $ZAPTEL_DIR
|
||||
if [ -e $ZAPTEL_DIR/zaptel-base.c ]; then
|
||||
ZAPTEL_C_FILE=zaptel-base.c
|
||||
fi
|
||||
|
||||
|
||||
eval "grep hdlc_hard_xmit $ZAPTEL_C_FILE > /dev/null 2> /dev/null"
|
||||
if [ $? -eq 0 ] ; then
|
||||
touch /etc/wanpipe/.zaphdlc
|
||||
echo "Zaptel HW HDLC support detected"
|
||||
exit 10
|
||||
else
|
||||
if [ -e /etc/wanpipe/.zaphdlc ]; then
|
||||
eval "rm -f /etc/wanpipe/.zaphdlc 2> /dev/null"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Applying Sangoma DCHAN patch to $ZAPTEL_DIR"
|
||||
echo " "
|
||||
tdmv_apply_zaptel_dchan_patch
|
||||
|
||||
exit $?
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
%define WANPIPE_VER wanpipe-modules
|
||||
%define name %{WANPIPE_VER}
|
||||
%define version 3.2.1
|
||||
%define version 3.2.2
|
||||
%define release 0
|
||||
%define serial 1
|
||||
%define MODULES_DIR /lib/modules
|
||||
|
@ -50,6 +50,114 @@ echo "Wanpipe Modules located in %{MODULES_DIR}/%{KVERSION}"
|
|||
|
||||
|
||||
%changelog
|
||||
* Thu Jan 18 2008 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.2
|
||||
========================================================================
|
||||
|
||||
- AFT Maxim Front end update
|
||||
Implemented graceful recovery on short circuit.
|
||||
|
||||
- AFT Driver update
|
||||
Added a check for TDM IRQ timeout.
|
||||
On some machines its possible for TDM IRQ to timeout.
|
||||
|
||||
- SMG updated
|
||||
Fixed wancfg_smg
|
||||
MTU not properly set on ports 2 and up
|
||||
Voice only ports were not being added to startup sequence
|
||||
Updated for callweaver
|
||||
|
||||
- Added Zaptel 1.4 HW HDLC Support
|
||||
No Sangoma zaptel patch needed with Zaptel 1.4
|
||||
|
||||
- Added HWEC Noise flag in wanpipe config file
|
||||
|
||||
- Updated SMG
|
||||
- Updated E1 Unframed on Maxim Cards
|
||||
|
||||
- Updates for AFT PMC and MAXIM framers
|
||||
PMC - lowered LOS sensitivity
|
||||
Fixes fake up/down state changes on
|
||||
started inactive lines.
|
||||
|
||||
MAXIM - lowered sensistivy
|
||||
Fixes cable cross talk on 8 port cards.
|
||||
- Enabled Unframed E1
|
||||
- Enabled Tri-State Mode
|
||||
- Fixed loopback commands
|
||||
|
||||
- Fixed HWEC_PERSIST_DISABLE
|
||||
This option was broken in previous release
|
||||
This option lets Asterisk control HWEC
|
||||
on each call start/stop.
|
||||
By default all hwec channels are enabled on
|
||||
device startup.
|
||||
|
||||
- Updated SMG/SS7
|
||||
- Updated loopback commands for AFT Maxim cards
|
||||
|
||||
- Updated for AstLinux
|
||||
The make file can now build all WAN and Voice Protocols
|
||||
|
||||
- Fixed add_timer warnings for ALL AFT cards
|
||||
Caused when a port is left in unconnected state.
|
||||
|
||||
- Updated legacy protocols for new front end architecture
|
||||
|
||||
- Updated Setup script
|
||||
|
||||
|
||||
* Wed Oct 6 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.1
|
||||
=====================================================================
|
||||
|
||||
- Setup Zap Chunk Size Patch updated for Zaptel 1.4
|
||||
Patch allows running zaptel in 8,16,40,80 chunk size.
|
||||
However wct drivers must be removed from compilation :)
|
||||
Patch is now fixed for Zaptel 1.4
|
||||
|
||||
- Update to All AFT drivers for 64bit 2.6.22 kernel.
|
||||
Updated affects: AFT A101/2/4/8/200/400 (all cards)
|
||||
The major 2.6.20+ updates extend to 64bit as well.
|
||||
Previous drivers segfaulted under 2.6.22 64bit
|
||||
kernels. This does not affect you if you are running
|
||||
kennels lower than 2.6.22.
|
||||
|
||||
- Updated legacy drivers for 2.6.22 kernel
|
||||
|
||||
|
||||
|
||||
* Wed Oct 3 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.0
|
||||
=====================================================================
|
||||
|
||||
- The Beta 3.1.X releases has now been declared as STABLE 3.2.X
|
||||
|
||||
- Fixed AMI/D4 on MAXIM (A101/2/4/8D) cards
|
||||
- Fixed A200/A400 tip/ring no dial tone issues.
|
||||
- Fixed 2.6.22 support and above
|
||||
- Fixed RPM Build post install issue
|
||||
- Updated Setup install script
|
||||
Option to build for zaptel: ./Setup zaptel
|
||||
- Working E&M/RBS/CAS Channel Bank support for MAXIM (A101/2/4/8) cards.
|
||||
- Fixed wanpipe crashing on system shutdown on some machines.
|
||||
Caused by RedHat /var/lock/subsys mandatory lock file.
|
||||
- New Firmware for all MAXIM Cards (A101/2/4/8D)
|
||||
Firmware V33: Fixes EC Chip Security errors that can cause
|
||||
PRI to go down on some computers. Firmware is backward compatible
|
||||
to any previous release.
|
||||
- Faxes/Modems working through hardware echo canceler.
|
||||
Tested at 56K from one port to another.
|
||||
New octasic update.
|
||||
- Analog Network SYNC Feature for Fax Support
|
||||
Analog cards can be synced to T1/E1 clock
|
||||
from adjacent A101/2/4/8 cards for flawless faxing
|
||||
from FXO/FXS to T1/E1.
|
||||
|
||||
- Known Issues:
|
||||
T1/E1 High Impedance Tap for MAXIM (A101/2/4/8D) cards.
|
||||
It works on original PMC A101/2/4 cards
|
||||
|
||||
For more info: http://wiki.sangoma.com
|
||||
|
||||
|
||||
* Mon Oct 1 2007 Nenad Corbic <ncorbic@sangoma.com> - Beta - 3.1.4.6
|
||||
====================================================================
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
%define KERNEL_VERSION %{?kern_ver}
|
||||
%define WANPIPE_VER wanpipe-util
|
||||
%define name %{WANPIPE_VER}
|
||||
%define version 3.2.1
|
||||
%define version 3.2.2
|
||||
%define release 0
|
||||
%define serial 1
|
||||
%define ETC_DIR /etc
|
||||
%define USR_DIR /usr
|
||||
%define UTILS_DIR /usr/sbin
|
||||
%define UTILS_LOCAL_DIR /usr/local/sbin
|
||||
%define PROD_HOME /etc/wanpipe
|
||||
%define WANCFG_LIBS_DIR /etc/wanpipe/wancfg/lib
|
||||
%define API_DIR /etc/wanpipe/api
|
||||
|
@ -237,13 +238,122 @@ install_init;
|
|||
|
||||
|
||||
%files
|
||||
%{ETC_DIR}
|
||||
%{USR_DIR}
|
||||
%{UTILS_DIR}
|
||||
%{UTILS_LOCAL_DIR}
|
||||
%{PROD_HOME}
|
||||
%{DOCS_DIR}
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jan 18 2008 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.2
|
||||
========================================================================
|
||||
|
||||
- AFT Maxim Front end update
|
||||
Implemented graceful recovery on short circuit.
|
||||
|
||||
- AFT Driver update
|
||||
Added a check for TDM IRQ timeout.
|
||||
On some machines its possible for TDM IRQ to timeout.
|
||||
|
||||
- SMG updated
|
||||
Fixed wancfg_smg
|
||||
MTU not properly set on ports 2 and up
|
||||
Voice only ports were not being added to startup sequence
|
||||
Updated for callweaver
|
||||
|
||||
- Added Zaptel 1.4 HW HDLC Support
|
||||
No Sangoma zaptel patch needed with Zaptel 1.4
|
||||
|
||||
- Added HWEC Noise flag in wanpipe config file
|
||||
|
||||
- Updated SMG
|
||||
- Updated E1 Unframed on Maxim Cards
|
||||
|
||||
- Updates for AFT PMC and MAXIM framers
|
||||
PMC - lowered LOS sensitivity
|
||||
Fixes fake up/down state changes on
|
||||
started inactive lines.
|
||||
|
||||
MAXIM - lowered sensistivy
|
||||
Fixes cable cross talk on 8 port cards.
|
||||
- Enabled Unframed E1
|
||||
- Enabled Tri-State Mode
|
||||
- Fixed loopback commands
|
||||
|
||||
- Fixed HWEC_PERSIST_DISABLE
|
||||
This option was broken in previous release
|
||||
This option lets Asterisk control HWEC
|
||||
on each call start/stop.
|
||||
By default all hwec channels are enabled on
|
||||
device startup.
|
||||
|
||||
- Updated SMG/SS7
|
||||
- Updated loopback commands for AFT Maxim cards
|
||||
|
||||
- Updated for AstLinux
|
||||
The make file can now build all WAN and Voice Protocols
|
||||
|
||||
- Fixed add_timer warnings for ALL AFT cards
|
||||
Caused when a port is left in unconnected state.
|
||||
|
||||
- Updated legacy protocols for new front end architecture
|
||||
|
||||
- Updated Setup script
|
||||
|
||||
|
||||
* Wed Oct 6 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.1
|
||||
=====================================================================
|
||||
|
||||
- Setup Zap Chunk Size Patch updated for Zaptel 1.4
|
||||
Patch allows running zaptel in 8,16,40,80 chunk size.
|
||||
However wct drivers must be removed from compilation :)
|
||||
Patch is now fixed for Zaptel 1.4
|
||||
|
||||
- Update to All AFT drivers for 64bit 2.6.22 kernel.
|
||||
Updated affects: AFT A101/2/4/8/200/400 (all cards)
|
||||
The major 2.6.20+ updates extend to 64bit as well.
|
||||
Previous drivers segfaulted under 2.6.22 64bit
|
||||
kernels. This does not affect you if you are running
|
||||
kennels lower than 2.6.22.
|
||||
|
||||
- Updated legacy drivers for 2.6.22 kernel
|
||||
|
||||
|
||||
|
||||
* Wed Oct 3 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.0
|
||||
=====================================================================
|
||||
|
||||
- The Beta 3.1.X releases has now been declared as STABLE 3.2.X
|
||||
|
||||
- Fixed AMI/D4 on MAXIM (A101/2/4/8D) cards
|
||||
- Fixed A200/A400 tip/ring no dial tone issues.
|
||||
- Fixed 2.6.22 support and above
|
||||
- Fixed RPM Build post install issue
|
||||
- Updated Setup install script
|
||||
Option to build for zaptel: ./Setup zaptel
|
||||
- Working E&M/RBS/CAS Channel Bank support for MAXIM (A101/2/4/8) cards.
|
||||
- Fixed wanpipe crashing on system shutdown on some machines.
|
||||
Caused by RedHat /var/lock/subsys mandatory lock file.
|
||||
- New Firmware for all MAXIM Cards (A101/2/4/8D)
|
||||
Firmware V33: Fixes EC Chip Security errors that can cause
|
||||
PRI to go down on some computers. Firmware is backward compatible
|
||||
to any previous release.
|
||||
- Faxes/Modems working through hardware echo canceler.
|
||||
Tested at 56K from one port to another.
|
||||
New octasic update.
|
||||
- Analog Network SYNC Feature for Fax Support
|
||||
Analog cards can be synced to T1/E1 clock
|
||||
from adjacent A101/2/4/8 cards for flawless faxing
|
||||
from FXO/FXS to T1/E1.
|
||||
|
||||
- Known Issues:
|
||||
T1/E1 High Impedance Tap for MAXIM (A101/2/4/8D) cards.
|
||||
It works on original PMC A101/2/4 cards
|
||||
|
||||
For more info: http://wiki.sangoma.com
|
||||
|
||||
|
||||
* Mon Oct 1 2007 Nenad Corbic <ncorbic@sangoma.com> - Beta - 3.1.4.6
|
||||
====================================================================
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
%define KERNEL_VERSION %{?kern_ver}
|
||||
%define WANPIPE_VER wanpipe
|
||||
%define name %{WANPIPE_VER}
|
||||
%define version 3.2.1
|
||||
%define version 3.2.2
|
||||
%define release 0
|
||||
%define serial 1
|
||||
%define UTILS_DIR /usr/sbin
|
||||
%define UTILS_LOCAL_DIR /usr/local/sbin
|
||||
%define ETC_DIR /etc
|
||||
%define USR_DIR /usr
|
||||
%define PROD_HOME /etc/wanpipe
|
||||
%define WANCFG_LIBS_DIR /etc/wanpipe/lib
|
||||
%define API_DIR /etc/wanpipe/api
|
||||
|
@ -244,15 +245,123 @@ install_init;
|
|||
|
||||
%files
|
||||
%{UTILS_DIR}
|
||||
%{UTILS_LOCAL_DIR}
|
||||
%{ETC_DIR}
|
||||
%{USR_DIR}
|
||||
%{PROD_HOME}
|
||||
%{DOCS_DIR}
|
||||
%{MODULES_DIR}
|
||||
%{USR_INCLUDE_DIR}
|
||||
%{LIBSANGOMA_CONF}
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Jan 18 2008 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.2
|
||||
========================================================================
|
||||
|
||||
- AFT Maxim Front end update
|
||||
Implemented graceful recovery on short circuit.
|
||||
|
||||
- AFT Driver update
|
||||
Added a check for TDM IRQ timeout.
|
||||
On some machines its possible for TDM IRQ to timeout.
|
||||
|
||||
- SMG updated
|
||||
Fixed wancfg_smg
|
||||
MTU not properly set on ports 2 and up
|
||||
Voice only ports were not being added to startup sequence
|
||||
Updated for callweaver
|
||||
|
||||
- Added Zaptel 1.4 HW HDLC Support
|
||||
No Sangoma zaptel patch needed with Zaptel 1.4
|
||||
|
||||
- Added HWEC Noise flag in wanpipe config file
|
||||
|
||||
- Updated SMG
|
||||
- Updated E1 Unframed on Maxim Cards
|
||||
|
||||
- Updates for AFT PMC and MAXIM framers
|
||||
PMC - lowered LOS sensitivity
|
||||
Fixes fake up/down state changes on
|
||||
started inactive lines.
|
||||
|
||||
MAXIM - lowered sensistivy
|
||||
Fixes cable cross talk on 8 port cards.
|
||||
- Enabled Unframed E1
|
||||
- Enabled Tri-State Mode
|
||||
- Fixed loopback commands
|
||||
|
||||
- Fixed HWEC_PERSIST_DISABLE
|
||||
This option was broken in previous release
|
||||
This option lets Asterisk control HWEC
|
||||
on each call start/stop.
|
||||
By default all hwec channels are enabled on
|
||||
device startup.
|
||||
|
||||
- Updated SMG/SS7
|
||||
- Updated loopback commands for AFT Maxim cards
|
||||
|
||||
- Updated for AstLinux
|
||||
The make file can now build all WAN and Voice Protocols
|
||||
|
||||
- Fixed add_timer warnings for ALL AFT cards
|
||||
Caused when a port is left in unconnected state.
|
||||
|
||||
- Updated legacy protocols for new front end architecture
|
||||
|
||||
- Updated Setup script
|
||||
|
||||
|
||||
* Wed Oct 6 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.1
|
||||
=====================================================================
|
||||
|
||||
- Setup Zap Chunk Size Patch updated for Zaptel 1.4
|
||||
Patch allows running zaptel in 8,16,40,80 chunk size.
|
||||
However wct drivers must be removed from compilation :)
|
||||
Patch is now fixed for Zaptel 1.4
|
||||
|
||||
- Update to All AFT drivers for 64bit 2.6.22 kernel.
|
||||
Updated affects: AFT A101/2/4/8/200/400 (all cards)
|
||||
The major 2.6.20+ updates extend to 64bit as well.
|
||||
Previous drivers segfaulted under 2.6.22 64bit
|
||||
kernels. This does not affect you if you are running
|
||||
kennels lower than 2.6.22.
|
||||
|
||||
- Updated legacy drivers for 2.6.22 kernel
|
||||
|
||||
|
||||
|
||||
* Wed Oct 3 2007 Nenad Corbic <ncorbic@sangoma.com> - Stable - 3.2.0
|
||||
=====================================================================
|
||||
|
||||
- The Beta 3.1.X releases has now been declared as STABLE 3.2.X
|
||||
|
||||
- Fixed AMI/D4 on MAXIM (A101/2/4/8D) cards
|
||||
- Fixed A200/A400 tip/ring no dial tone issues.
|
||||
- Fixed 2.6.22 support and above
|
||||
- Fixed RPM Build post install issue
|
||||
- Updated Setup install script
|
||||
Option to build for zaptel: ./Setup zaptel
|
||||
- Working E&M/RBS/CAS Channel Bank support for MAXIM (A101/2/4/8) cards.
|
||||
- Fixed wanpipe crashing on system shutdown on some machines.
|
||||
Caused by RedHat /var/lock/subsys mandatory lock file.
|
||||
- New Firmware for all MAXIM Cards (A101/2/4/8D)
|
||||
Firmware V33: Fixes EC Chip Security errors that can cause
|
||||
PRI to go down on some computers. Firmware is backward compatible
|
||||
to any previous release.
|
||||
- Faxes/Modems working through hardware echo canceler.
|
||||
Tested at 56K from one port to another.
|
||||
New octasic update.
|
||||
- Analog Network SYNC Feature for Fax Support
|
||||
Analog cards can be synced to T1/E1 clock
|
||||
from adjacent A101/2/4/8 cards for flawless faxing
|
||||
from FXO/FXS to T1/E1.
|
||||
|
||||
- Known Issues:
|
||||
T1/E1 High Impedance Tap for MAXIM (A101/2/4/8D) cards.
|
||||
It works on original PMC A101/2/4 cards
|
||||
|
||||
For more info: http://wiki.sangoma.com
|
||||
|
||||
|
||||
* Mon Oct 1 2007 Nenad Corbic <ncorbic@sangoma.com> - Beta - 3.1.4.6
|
||||
====================================================================
|
||||
|
||||
|
|
1007
samples/diff
1007
samples/diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash -p
|
||||
# chkconfig: 2345 7 9
|
||||
# wanrouter WANPIPE WAN Router Initialization Script.
|
||||
# description: Starts and stop Wanpipe devices
|
||||
#
|
||||
# copyright (c) 1999-2002, Sangoma Technologies Inc.
|
||||
#
|
||||
|
@ -730,6 +730,7 @@ interf_down()
|
|||
for i in $INTERFACES
|
||||
do
|
||||
int_file=${i%%=*}
|
||||
wanrouter_script stop $device $int_file #excutes interface stop script
|
||||
echo "Shutting down $device interface: $int_file"
|
||||
ifconfig $int_file down
|
||||
done
|
||||
|
@ -807,6 +808,7 @@ unconfig_devices()
|
|||
|
||||
#If we are starting ft1 device there are no
|
||||
#interfaces.
|
||||
wanrouter_script stop $dev
|
||||
if [ $ft1_or_wanpipe -gt 0 ]; then
|
||||
echo "Shutting down device: $dev, FT1 config mode"
|
||||
echo "Shutting down device: $dev, FT1 config mode" >> $WAN_LOG
|
||||
|
@ -830,18 +832,6 @@ unconfig_devices()
|
|||
remove_cdev
|
||||
unload_module
|
||||
|
||||
for dev in $devices; do
|
||||
WAN_CONF=$WAN_CONF_DIR/$dev.conf
|
||||
|
||||
INTERFACES=`grep ".*=.*$dev" -i $WAN_CONF | cut -d' ' -f1 2> /dev/null`
|
||||
for ifname in $INTERFACES; do
|
||||
ifname=${ifname%%=*}
|
||||
wanrouter_script stop $dev $ifname
|
||||
done
|
||||
wanrouter_script stop $dev
|
||||
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -2116,7 +2106,7 @@ WANPIPE_IS_RUNNING=/var/run/wanpipe_is_running
|
|||
RUGGEDCOM=No
|
||||
|
||||
if [ $OSYSTEM = "Linux" ]; then
|
||||
ROUTER_VERSION=3.2.1
|
||||
ROUTER_VERSION=3.2.2
|
||||
IFCONFIG_LIST=ifconfig
|
||||
MODULE_STAT=lsmod
|
||||
WAN_DRIVERS="wanpipe"
|
||||
|
@ -2523,11 +2513,12 @@ case "$1" in
|
|||
WAN_DEVICES=$tmp_dev_list
|
||||
fi
|
||||
|
||||
wanrouter_script stop
|
||||
|
||||
unconfig_interfaces $WAN_DEVICES
|
||||
|
||||
unconfig_devices $WAN_DEVICES
|
||||
|
||||
wanrouter_script stop
|
||||
|
||||
elif [ -z $3 ]; then
|
||||
#WANROUTER STOP WANPIPE
|
||||
|
@ -2587,6 +2578,8 @@ case "$1" in
|
|||
|
||||
check_file $WAN_CONF || cleanup 1
|
||||
|
||||
wanrouter_script stop $dev $if_name
|
||||
|
||||
eval "$IFCONFIG_LIST | grep -w $if_name > /dev/null 2> /dev/null"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Interface $if_name down"
|
||||
|
@ -2609,7 +2602,6 @@ case "$1" in
|
|||
echo -e "No devices running, Unloading Modules"
|
||||
unload_module
|
||||
|
||||
wanrouter_script stop $dev $if_name
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,25 +1,13 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 34
|
||||
/svn/sangoma_mgd/!svn/ver/24/trunk
|
||||
/svn/sangoma_mgd/!svn/ver/58/trunk
|
||||
END
|
||||
sigboost.h
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 45
|
||||
/svn/sangoma_mgd/!svn/ver/22/trunk/sigboost.h
|
||||
END
|
||||
sound.raw
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 43
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/sound.raw
|
||||
END
|
||||
sangoma_mgd.conf.sample
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/sangoma_mgd/!svn/ver/22/trunk/sangoma_mgd.conf.sample
|
||||
/svn/sangoma_mgd/!svn/ver/36/trunk/sigboost.h
|
||||
END
|
||||
switch_buffer.h
|
||||
K 25
|
||||
|
@ -27,6 +15,18 @@ svn:wc:ra_dav:version-url
|
|||
V 49
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/switch_buffer.h
|
||||
END
|
||||
sangoma_mgd.conf.sample
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 58
|
||||
/svn/sangoma_mgd/!svn/ver/25/trunk/sangoma_mgd.conf.sample
|
||||
END
|
||||
sound.raw
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 43
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/sound.raw
|
||||
END
|
||||
callgettest.sh
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
|
@ -39,35 +39,29 @@ svn:wc:ra_dav:version-url
|
|||
V 40
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/ss7box
|
||||
END
|
||||
Changelog
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 43
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/Changelog
|
||||
END
|
||||
call_signal.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 47
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/call_signal.c
|
||||
END
|
||||
re-sync.sh
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 45
|
||||
/svn/sangoma_mgd/!svn/ver/20/trunk/re-sync.sh
|
||||
END
|
||||
woomera.conf
|
||||
call_signal.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 46
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/woomera.conf
|
||||
V 48
|
||||
/svn/sangoma_mgd/!svn/ver/42/trunk/call_signal.c
|
||||
END
|
||||
sangoma_mgd.c
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 48
|
||||
/svn/sangoma_mgd/!svn/ver/24/trunk/sangoma_mgd.c
|
||||
/svn/sangoma_mgd/!svn/ver/57/trunk/sangoma_mgd.c
|
||||
END
|
||||
woomera.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 46
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/woomera.conf
|
||||
END
|
||||
call_signal.h
|
||||
K 25
|
||||
|
@ -79,7 +73,13 @@ sangoma_mgd.h
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 48
|
||||
/svn/sangoma_mgd/!svn/ver/22/trunk/sangoma_mgd.h
|
||||
/svn/sangoma_mgd/!svn/ver/58/trunk/sangoma_mgd.h
|
||||
END
|
||||
Changelog.sangoma_mgd
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 56
|
||||
/svn/sangoma_mgd/!svn/ver/55/trunk/Changelog.sangoma_mgd
|
||||
END
|
||||
q931_cause.h
|
||||
K 25
|
||||
|
@ -97,13 +97,13 @@ install
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 42
|
||||
/svn/sangoma_mgd/!svn/ver/20/trunk/install
|
||||
/svn/sangoma_mgd/!svn/ver/51/trunk/install
|
||||
END
|
||||
smg_ctrl
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 42
|
||||
/svn/sangoma_mgd/!svn/ver/1/trunk/smg_ctrl
|
||||
V 43
|
||||
/svn/sangoma_mgd/!svn/ver/56/trunk/smg_ctrl
|
||||
END
|
||||
switch_buffer.c
|
||||
K 25
|
||||
|
@ -115,5 +115,5 @@ Makefile
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 43
|
||||
/svn/sangoma_mgd/!svn/ver/21/trunk/Makefile
|
||||
/svn/sangoma_mgd/!svn/ver/48/trunk/Makefile
|
||||
END
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
8
|
||||
|
||||
dir
|
||||
24
|
||||
58
|
||||
https://www.sangomapbx.com:/svn/sangoma_mgd/trunk
|
||||
https://www.sangomapbx.com:/svn/sangoma_mgd
|
||||
|
||||
|
||||
|
||||
2007-10-03T19:40:43.713609Z
|
||||
24
|
||||
2008-01-18T23:17:38.335382Z
|
||||
58
|
||||
ncorbic
|
||||
|
||||
|
||||
|
@ -32,10 +32,10 @@ file
|
|||
|
||||
|
||||
|
||||
2007-10-03T19:44:50.000000Z
|
||||
efa9458b6df577c673d9275d4eab1a6d
|
||||
2007-10-02T16:32:47.773679Z
|
||||
22
|
||||
2007-11-26T01:25:46.000000Z
|
||||
d2023784f5d89a5623927a366705e22a
|
||||
2007-11-24T22:45:32.820698Z
|
||||
36
|
||||
ncorbic
|
||||
|
||||
app
|
||||
|
@ -60,10 +60,10 @@ file
|
|||
|
||||
|
||||
|
||||
2007-10-03T19:44:50.000000Z
|
||||
bf66f72830158267cef4cfa0fc72cfb6
|
||||
2007-10-02T16:32:47.773679Z
|
||||
22
|
||||
2007-10-18T17:51:26.000000Z
|
||||
6f5866feb746caa979c0c4df03517326
|
||||
2007-10-16T22:33:32.246854Z
|
||||
25
|
||||
ncorbic
|
||||
|
||||
switch_buffer.h
|
||||
|
@ -100,7 +100,7 @@ file
|
|||
|
||||
|
||||
|
||||
2007-09-21T20:55:42.000000Z
|
||||
2007-12-21T21:08:30.000000Z
|
||||
f20dab977386b2508903e24a307ca2d6
|
||||
2007-09-21T20:53:51.260136Z
|
||||
1
|
||||
|
@ -113,29 +113,17 @@ svn:special
|
|||
scripts
|
||||
dir
|
||||
|
||||
Changelog
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2007-09-21T20:55:42.000000Z
|
||||
e882d77b92b36e5878240af27f94d36f
|
||||
2007-09-21T20:53:51.260136Z
|
||||
1
|
||||
root
|
||||
|
||||
call_signal.c
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2007-09-21T20:55:42.000000Z
|
||||
b77f050a0ef676f8f1a558d07b48f11a
|
||||
2007-09-21T20:53:51.260136Z
|
||||
1
|
||||
root
|
||||
2007-11-28T21:14:37.000000Z
|
||||
bcf6ba51a26281d7a0963c364f8610f1
|
||||
2007-11-28T21:12:42.416435Z
|
||||
42
|
||||
ncorbic
|
||||
|
||||
re-sync.sh
|
||||
file
|
||||
|
@ -156,10 +144,10 @@ file
|
|||
|
||||
|
||||
|
||||
2007-10-03T19:44:50.000000Z
|
||||
b7dd5f313c998033b1d50cc444053f32
|
||||
2007-10-03T19:40:43.713609Z
|
||||
24
|
||||
2008-01-18T23:23:07.000000Z
|
||||
0dd2e3aad304bc37895c78f158afb0a3
|
||||
2008-01-18T23:01:23.237257Z
|
||||
57
|
||||
ncorbic
|
||||
|
||||
woomera.conf
|
||||
|
@ -192,10 +180,22 @@ file
|
|||
|
||||
|
||||
|
||||
2007-10-03T19:44:50.000000Z
|
||||
ee879b15f742bdeb502b3265e2dd7b2c
|
||||
2007-10-02T16:32:47.773679Z
|
||||
22
|
||||
2008-01-18T23:23:07.000000Z
|
||||
980fdef03b9982e8411a1e3a0d45a57d
|
||||
2008-01-18T23:17:38.335382Z
|
||||
58
|
||||
ncorbic
|
||||
|
||||
Changelog.sangoma_mgd
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2008-01-18T21:45:09.000000Z
|
||||
c7ac5bb8faff69307d9e2739737a50b1
|
||||
2008-01-18T20:46:37.372416Z
|
||||
55
|
||||
ncorbic
|
||||
|
||||
q931_cause.h
|
||||
|
@ -231,10 +231,10 @@ file
|
|||
|
||||
|
||||
|
||||
2007-09-25T02:05:45.000000Z
|
||||
01bc4e56da44f0619c948fa36799c0a3
|
||||
2007-09-25T02:04:57.936973Z
|
||||
20
|
||||
2007-12-20T17:31:41.000000Z
|
||||
0e00003cd276e523b9b6e6df6a2f823f
|
||||
2007-12-20T00:59:56.095828Z
|
||||
51
|
||||
ncorbic
|
||||
has-props
|
||||
|
||||
|
@ -244,11 +244,11 @@ file
|
|||
|
||||
|
||||
|
||||
2007-09-25T00:59:32.000000Z
|
||||
387bbb12c7561cc036617e5ce9b4cab5
|
||||
2007-09-21T20:53:51.260136Z
|
||||
1
|
||||
root
|
||||
2008-01-18T21:45:09.000000Z
|
||||
305c8fe9341c230ec32af102688736fd
|
||||
2008-01-18T20:47:52.049290Z
|
||||
56
|
||||
ncorbic
|
||||
has-props
|
||||
|
||||
switch_buffer.c
|
||||
|
@ -269,9 +269,9 @@ file
|
|||
|
||||
|
||||
|
||||
2007-09-25T02:17:36.000000Z
|
||||
3e70402d7a99c4e8a60224063a9037a0
|
||||
2007-09-25T02:15:46.259214Z
|
||||
21
|
||||
2007-12-05T19:56:32.000000Z
|
||||
7f772a76025b629be3915375ccbf5034
|
||||
2007-12-05T18:26:50.890720Z
|
||||
48
|
||||
ncorbic
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue