ppp: synthesize a .device option to make ifup work on pppoa interfaces again
[oweals/openwrt.git] / package / ppp / files / pppoa.sh
1 scan_pppoa() {
2         config_set "$1" device "pppoa-$1"
3 }
4
5 coldplug_interface_pppoa() {
6         setup_interface_pppoa x "$1"
7 }
8
9 stop_interface_pppoa() {
10         stop_interface_ppp "$1"
11 }
12
13 setup_interface_pppoa() {
14         local config="$2"
15
16         local atmdev
17         config_get atmdev "$config" atmdev
18
19         local vpi
20         config_get vpi "$config" vpi
21
22         local vci
23         config_get vci "$config" vci
24
25         for module in slhc ppp_generic pppoatm; do
26                 /sbin/insmod $module 2>&- >&-
27         done
28
29         local encaps
30         config_get encaps "$config" encaps
31
32         case "$encaps" in
33                 1|vc) encaps="vc-encaps" ;;
34                 *) encaps="llc-encaps" ;;
35         esac
36
37         local mtu
38         config_get mtu "$config" mtu
39
40         start_pppd "$config" \
41                 plugin pppoatm.so ${atmdev:+$atmdev.}${vpi:-8}.${vci:-35} \
42                 ${encaps} ${mtu:+mtu $mtu mru $mtu}
43 }