add better default config for ar7, add br2684ctl init script, add a missing setting...
authorFelix Fietkau <nbd@openwrt.org>
Sat, 21 Apr 2007 09:37:13 +0000 (09:37 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 21 Apr 2007 09:37:13 +0000 (09:37 +0000)
SVN-Revision: 7024

package/br2684ctl/Makefile
package/br2684ctl/files/br2684ctl [new file with mode: 0755]
package/ppp/files/pppoa.sh
target/linux/ar7-2.6/base-files/default/etc/config/network [new file with mode: 0644]

index 7c75c9499e241875bf504a30760759a9302c73a8..223f6f7c5fd6dd641ca4ecfd9eed0c50bc7750a7 100644 (file)
@@ -31,6 +31,8 @@ endef
 MAKE_FLAGS += CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)"
 
 define Package/$(PKG_NAME)/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/br2684ctl $(1)/etc/init.d/
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
 endef
diff --git a/package/br2684ctl/files/br2684ctl b/package/br2684ctl/files/br2684ctl
new file mode 100755 (executable)
index 0000000..b3ea34e
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh /etc/rc.common
+stop() {
+       killall br2684ctl 2>/dev/null >/dev/null
+       sleep 1
+       rmmod br2684
+}
+
+start_daemon() {
+       local cfg="$1"
+       config_get atmdev "$cfg" atmdev
+       config_get unit "$cfg" unit
+       config_get vpi "$cfg" vpi
+       config_get vci "$cfg" vci
+       config_get encaps "$cfg" encaps
+       case "$encaps" in
+               1|vc) encaps=1;;
+               *) encaps=0;;
+       esac
+       br2684ctl -b -c "$unit" -e "$encaps" -a "${atmdev:+$atmdev.}${vpi:-8}.${vci:-35}"
+}
+
+start() {
+       insmod br2684 >/dev/null 2>/dev/null
+       config_load network
+       config_foreach start_daemon atm-bridge
+}
index 9b8a919ac519265b5db4ada0a849419c5246197d..8c66250da5c9aa8d2dd038c013ff1800fa3eaf44 100644 (file)
@@ -13,10 +13,16 @@ setup_interface_pppoa() {
        for module in slhc ppp_generic pppoatm; do
                /sbin/insmod $module 2>&- >&-
        done
+       
+       config_get encaps "$config" encaps
+       case "$encaps" in
+               1|vc) ENCAPS="vc-encaps" ;;
+               *) ENCAPS="llc-encaps" ;;
+       esac
 
        config_get mtu "$cfg" mtu
        mtu=${mtu:-1500}
        start_pppd "$config" \
-               plugin pppoatm.so ${vpi:-8}.${vci:-35} \
+               plugin pppoatm.so ${vpi:-8}.${vci:-35} ${ENCAPS} \
                mtu $mtu mru $mtu
 }
diff --git a/target/linux/ar7-2.6/base-files/default/etc/config/network b/target/linux/ar7-2.6/base-files/default/etc/config/network
new file mode 100644 (file)
index 0000000..5fa112c
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2006 OpenWrt.org
+
+config interface loopback
+       option ifname   lo
+       option proto    static
+       option ipaddr   127.0.0.1
+       option netmask  255.0.0.0
+
+config interface lan
+       option ifname   eth0
+       option proto    static
+       option ipaddr   192.168.1.1
+       option netmask  255.255.255.0
+
+
+
+## Example for ATM bridging.
+## Useful for PPPoE or IP over ATM. Will create 'nas${unit}'
+#
+# config atm-bridge
+#      option unit     0
+#      option encaps   llc
+#      option vpi      8
+#      option vci      35
+
+
+# config interface wan
+##     PPPoE:
+#      option ifname   nas0
+#      option proto    pppoe
+
+##     PPPoA:
+#      option ifname   atm0
+#      option proto    pppoa
+#      option encaps   llc
+#      option vpi      8
+#      option vci      35
+
+##     Both:
+#      option username "my_username"
+#      option password "my_password"