RouterBoard RB2011UiAS has two switch devices, a AR8327 on eth0, and a
AG71xx on eth1:

[    0.900000] switch0: Atheros AR8327 rev. 4 switch registered on ag71xx-mdio.0
[    2.200000] libphy: ag71xx_mdio: probed
[    2.760000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00
[uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
[    2.770000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    3.330000] ag71xx-mdio.1: Found an AR934X built-in switch
[    4.360000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII

I can't configure the AR8327 switch using UCI.  For example, with the
following in /etc/config/network:

config switch 'eth0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan 'eth0_mgmt'
        option device 'eth0'
        option vlan '1'
        option ports '0t 1 2 3 4 5'

And then restarting the network service:

root@mika:/etc/config# /etc/init.d/network restart
Command failed: Not found
Failed to connect to the switch. Use the "list" command to see which
switches are available.

This seems to be because swconfig doesn't recognize 'eth0' as the name
of the switch:

root@mika:/etc/config# swconfig list
Found: switch1 - eth1
Found: switch0 - ag71xx-mdio.0

I can manually configure the switch just fine using 'switch0' or
'ag71xx-mdio.0' as the device names:

root@mika:/etc/config# swconfig dev switch0 vlan 1 show
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4 5
root@mika:/etc/config# swconfig dev ag71xx-mdio.0 vlan 1 show
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4 5

And I can also configure the network interfaces with iproute2, but
using the eth0 name:

root@mika:/etc/config# ip a s dev eth0.1
64: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP group default
    link/ether [MAC ADDRESS] brd ff:ff:ff:ff:ff:ff
    inet [IPV4 ADDRESS] brd 10.232.1.255 scope global eth0.1
       valid_lft forever preferred_lft forever
    inet6 [ULA]/64 scope global
       valid_lft forever preferred_lft forever
    inet6 [LINK LOCAL ADDRESS]/64 scope link
       valid_lft forever preferred_lft forever

So there's a lack of consistency in the device name used by swconfig
and the name used by iproute2/ifconfig that screws up UCI.

Is there some other way that I should be configuring the switch thru
UCI, or is there a some minor bug that's causing the kernel to name
the first switch device something other than eth0?

-- 
Soren Harward
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to