linux-atm: Solos card requires explicit buffer size to br2684ctl
[openwrt/svn-archive/archive.git] / package / linux-atm / files / br2684ctl
1 #!/bin/sh /etc/rc.common
2 START=50
3
4 start_daemon() {
5 local cfg="$1"
6
7 local atmdev
8 config_get atmdev "$cfg" atmdev 0
9
10 local unit
11 config_get unit "$cfg" unit 0
12
13 local vpi
14 config_get vpi "$cfg" vpi 8
15
16 local vci
17 config_get vci "$cfg" vci 35
18
19 local encaps
20 config_get encaps "$cfg" encaps
21
22 case "$encaps" in
23 1|vc) encaps=1;;
24 *) encaps=0;;
25 esac
26
27 local payload
28 config_get payload "$cfg" payload
29
30 case "$payload" in
31 0|routed) payload=0;;
32 *) payload=1;;
33 esac
34
35 local qos
36 config_get qos "$cfg" qos
37
38 local sendsize
39 config_get sendsize "$cfg" sendsize
40
41 local circuit="$atmdev.$vpi.$vci"
42 local pid="/var/run/br2684ctl-$circuit.pid"
43
44 start-stop-daemon -S -b -x /usr/sbin/br2684ctl -m -p "$pid" -- \
45 -c "$unit" -e "$encaps" -p "$payload" \
46 -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"}
47 }
48
49 start() {
50 insmod br2684 >/dev/null 2>/dev/null
51 config_load network
52 config_foreach start_daemon atm-bridge
53 }
54
55 stop() {
56 local pid
57 for pid in /var/run/br2684ctl-*.pid; do
58 if [ -f "$pid" ]; then
59 service_kill br2684ctl "$pid"
60 rm -f "$pid"
61 fi
62 done
63 }