source: trunk/target/linux/atheros/base-files/etc/uci-defaults/network @ 22363

Last change on this file since 22363 was 22363, checked in by jow, 6 years ago

[atheros] renaming of the IP175C switch driver brioke switch detection on the Dir-300 and others, fix it

File size: 1.0 KB
Line 
1#!/bin/sh
2if [ -e "/sys/bus/mdio_bus/drivers/IC+ IP175C/0:00" -o \
3     -e "/sys/bus/mdio_bus/drivers/IC+ IP17xx/0:00" ] && \
4   [ -x /sbin/swconfig ];
5then
6        uci batch <<EOF
7set network.eth0=switch
8set network.eth0.name=eth0
9set network.eth0.reset=1
10set network.eth0.enable_vlan=1
11set network.eth0_1=switch_vlan
12set network.eth0_1.device=eth0
13set network.eth0_1.vlan=1
14set network.eth0_1.ports="0 1 2 3 5t"
15set network.eth0_2=switch_vlan
16set network.eth0_2.device=eth0
17set network.eth0_2.vlan=2
18set network.eth0_2.ports="4 5t"
19EOF
20        HAS_SWITCH=1
21fi
22
23if [ -n "$HAS_SWITCH" -o \
24        -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
25        -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
26        uci batch <<EOF
27set network.lan.ifname=eth0.1
28set network.wan=interface
29set network.wan.ifname=eth0.2
30set network.wan.proto=dhcp
31commit network
32EOF
33        HAS_SWITCH=1
34fi
35
36[ -z "$HAS_SWITCH" -a -d /sys/class/net/eth1 ] && {
37        uci batch <<EOF
38set network.wan=interface
39set network.wan.ifname=eth1
40set network.wan.proto=dhcp
41commit network
42EOF
43}
44
45uci commit network
Note: See TracBrowser for help on using the repository browser.