TL-WR1043: switch

Stefan Bethke stb at lassitu.de
Sun Dec 11 00:07:00 UTC 2011


Am 05.12.2011 um 00:22 schrieb Stefan Bethke:

> Limping along…
> 
> You can find a first version of a kernel driver at
>  http://www.lassitu.de/freebsd/rtl8366rb.c
>  http://www.lassitu.de/freebsd/rtl8366rbvar.h
> 
> It has no external interface, but it does set up a sensible VLAN config for the TL-WR1043RB.

Here's a much more complete interim version:
http://www.lassitu.de/freebsd/etherswitch-rtl8366rb.patch

This is how it looks like:
# kldload rtl8366rb
rtl8366rb0: <RTL8366RB Ethernet Switch Controller> at addr 0xa8 on iicbus0
rtl8366rb0: rev. 3
miibus0: <MII bus> on rtl8366rb0
ukphy0: <Generic IEEE 802.3u media interface> PHY 0 on miibus0
ukphy0: OUI 0x00e04c, model 0x0016, rev. 1
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy1: OUI 0x00e04c, model 0x0016, rev. 1
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
ukphy2: <Generic IEEE 802.3u media interface> PHY 2 on miibus0
ukphy2: OUI 0x00e04c, model 0x0016, rev. 1
ukphy2:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
ukphy3: <Generic IEEE 802.3u media interface> PHY 3 on miibus0
ukphy3: OUI 0x00e04c, model 0x0016, rev. 1
ukphy3:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
ukphy4: <Generic IEEE 802.3u media interface> PHY 4 on miibus0
ukphy4: OUI 0x00e04c, model 0x0016, rev. 1
ukphy4:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
etherswitch0: <Switch controller> on rtl8366rb0
# etherswitchcfg
etherswitch0: Realtek RTL8366RB with 6 ports and 16 VLAN groups
        port0: vlangroup=1
        port1: vlangroup=0
        port2: vlangroup=0
        port3: vlangroup=0
        port4: vlangroup=0
        port5: vlangroup=0
        vlangroup0: vid=1, member=1,2,3,4,5
        vlangroup1: vid=2, member=0,5t

Right now, it's only printing information, but I'm hoping to add VLAN configuration in the next couple of days.

The phys are attached to a pseudo interface.  I've yet to figure out which operations are useful on them (I tried successfully to power down a phy, which has the result of bringing down the link).

For the moment, I have decided to ignore Alexsandrs work, since I didn't manage to figure out how exactly the pieces attach to each other, and I wasn't happy with the ioctls and the modelling of the virtual switch.  But I'm sure that can be fixed in the next couple of iterations.


Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811





More information about the freebsd-embedded mailing list