changeset 451:04d9060b8b40

Add DAP-1350 ADAPTATION script.
author Aleksandr Rybalko <ray@ddteam.net>
date Thu, 20 Sep 2012 15:48:00 +0300
parents 6d906a5894cb
children 2a03323a2d95
files boards/D-Link/DAP-1350/files/etc/rc.d/ADAPTATION
diffstat 1 files changed, 75 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DAP-1350/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:48:00 2012 +0300
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# PROVIDE: ADAPTATION
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="ADAPTATION"
+start_cmd="adapt_start"
+start_precmd="adapt_prestart"
+start_postcmd="adapt_poststart"
+stop_cmd="adapt_stop"
+
+adapt_prestart()
+{
+	switchctl /dev/switch0 set vlan 0 vid 1
+	switchctl /dev/switch0 set vlan 0 add 0 u
+	switchctl /dev/switch0 set vlan 0 add 1 u
+	switchctl /dev/switch0 set vlan 0 add 2 u
+	switchctl /dev/switch0 set vlan 0 add 3 u
+	switchctl /dev/switch0 set vlan 0 del 4
+	switchctl /dev/switch0 set vlan 0 add 5 t
+	switchctl /dev/switch0 set vlan 0 add 6 t
+
+	switchctl /dev/switch0 set vlan 1 vid 2
+	switchctl /dev/switch0 set vlan 1 del 0
+	switchctl /dev/switch0 set vlan 1 del 1
+	switchctl /dev/switch0 set vlan 1 del 2
+	switchctl /dev/switch0 set vlan 1 del 3
+	switchctl /dev/switch0 set vlan 1 add 4 u
+	switchctl /dev/switch0 set vlan 1 add 5 t
+	switchctl /dev/switch0 set vlan 1 add 6 t
+
+	switchctl /dev/switch0 set port 0 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 1 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 2 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 3 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 4 pvid 2 flags Untag
+	switchctl /dev/switch0 set port 5 pvid 1 flags Tag
+	switchctl /dev/switch0 set port 6 pvid 1 flags Tag
+
+	gpioctl -f /dev/gpioc0 -c 10 IN II PU INT
+
+	# Import MAC addresses with known names
+	kenv LAN_MAC_ADDR=`kenv ethaddr`
+	kenv WAN_MAC_ADDR=`kenv wanmac`
+
+	ifconfig rt0 up
+	ifconfig vlan1 create vlan 1 vlandev rt0
+	ifconfig vlan1 name lan0
+	ifconfig vlan2 create vlan 2 vlandev rt0
+	ifconfig vlan2 name wan0
+
+	ifconfig lan0 ether `kenv LAN_MAC_ADDR`
+	ifconfig wan0 ether `kenv WAN_MAC_ADDR`
+
+	hostname `kenv HostName`
+
+}
+
+adapt_start()
+{
+}
+
+adapt_poststart()
+{
+}
+
+adapt_stop()
+{
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file