summaryrefslogtreecommitdiff
path: root/xpp/initialize_registers
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-11-06 18:12:16 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-11-06 18:12:16 +0000
commit656bad10aaace557f6f7ace71f5b71be299d81c2 (patch)
tree749baed4f3096aead30e28dc320b880e1f023a91 /xpp/initialize_registers
parentc5cffae7b33823d655bffd2f373f8df7c1caf71b (diff)
Merging xpp driver release 1.2 (rev. 2569), originally team/tzafrir/xpp_1.2
* Should build well. Almost final. * genzaptelconf: Also work when zap_autoreg=0 * README.Astribank updated for rev. 1.2. * xpp/utils/Makefile: Use $< with cc -c * Get xpp/utils configuration from autoconf (without changesin top dir) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@1557 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/initialize_registers')
-rwxr-xr-xxpp/initialize_registers77
1 files changed, 0 insertions, 77 deletions
diff --git a/xpp/initialize_registers b/xpp/initialize_registers
deleted file mode 100755
index 6c07e94..0000000
--- a/xpp/initialize_registers
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /bin/sh
-#
-# $Id$
-#
-# This script is run from the xpp kernel module upon detection
-# of a new XPD.
-#
-# Expects the following environment variables to be set:
-# XPD_BUS - bus name
-# XPD_NAME - xpd name
-# XPD_TYPE - xpd type number (from protocol reply):
-# 3 - FXS
-# 4 - FXO
-# XPD_REVISION - xpd revision number
-
-set -e
-
-LOGGER="logger -i -t `basename $0`"
-opermode='FCC'
-INIT_DIR=`dirname $0`
-XPP_BASE=/proc/xpp
-
-if [ -r /etc/default/zaptel ]
-then . /etc/default/zaptel
-fi
-
-export XPP_BASE
-
-SLICS="$XPP_BASE/$XPD_BUS/$XPD_NAME/slics"
-FILE="$INIT_DIR/init_data_${XPD_TYPE}_${XPD_REVISION}.cmd"
-set_daa_country_params() {
- # based on fxo_modes from wctdm.c . TODO: more decent calculation?
- reg16=00; reg26=00; reg30=00; reg31=A3; ring_osc=; ring_x=;
- mode="$1"
- # TODO: a saner fall-back in case of an unknown mode
- if [ "$mode" = '' ]; then mode='FCC'; fi
- if [ -r $INIT_DIR/init_fxo_modes ]; then
- . $INIT_DIR/init_fxo_modes
- fi
- cat <<EOF >$SLICS
-FF FF 00 00 WD 10 $reg16
-FF FF 00 00 WD 1A $reg26
-FF FF 00 00 WD 1E $reg30
-FF FF 00 00 WD 1F $reg31
-EOF
- # for the FXS:
- #if [ "$ring_osc" != '' ]; then
- # /bin/echo "31 WI __ $ring_osc" >$SLICS
- #fi
- #if [ "$ring_x" != '' ]; then
- # /bin/echo "31 WI __ $ring_x" >$SLICS
- #fi
-}
-
-if [ ! -f "$SLICS" ]; then
- $LOGGER "missing register file '$SLICS'"
- exit 1
-fi
-
-if [ ! -f "$FILE" ]; then
- $LOGGER "missing register initialization file '$FILE'"
- exit 1
-fi
-
-case "$XPD_TYPE" in
-3|4)
- if [ "$XPD_TYPE" = 3 ]; then "$INIT_DIR/calibrate_slics"; fi
- cat "$FILE" > "$SLICS"
- if [ "$XPD_TYPE" = 4 ]; then set_daa_country_params "$opermode"; fi
- ;;
-*)
- $LOGGER "Unknown type '$XPD_TYPE'"
- exit 2
-esac
-$LOGGER "Wrote '$FILE' into '$SLICS'"
-
-exit 0