summaryrefslogtreecommitdiff
path: root/xpp/initialize_registers
blob: 35386cef0052ef4689c19ee16e6d8b419e9e389c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh
# 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`"

INIT_DIR=`dirname $0`
BASE=/proc/xpp

SLICS="$BASE/$XPD_BUS/$XPD_NAME/slics"
FILE="$INIT_DIR/init_data_${XPD_TYPE}_${XPD_REVISION}.cmd"

if [ ! -f "$SLICS" ]; then
	$LOGGER "missing slics file '$SLICS'"
	exit 1
fi

if [ ! -f "$FILE" ]; then
	$LOGGER "missing register initialization file '$FILE'"
	exit 1
fi

case "$XPD_TYPE" in
3|4)
	cat "$FILE" > "$SLICS" 
	;;
*)
	$LOGGER "Unknown type '$XPD_TYPE'"
	exit 2
esac
$LOGGER "Wrote '$FILE' into '$SLICS'"

exit 0