OpenWrt Forum Archive

Topic: RB450 - using Five Ethernet Ports

The content of this topic has been archived between 6 Feb 2018 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

I didn't test the multi port config too thoroughly because our setup did not require separated Ethernet ports on the "lan" side but here is one config that I was playing with.

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   "eth1"
        option proto    dhcp

config switch_vlan
        option device   eth1
        option vlan 1
        option ports "0 1 2 3 4 5t"

config interface wan
        option ifname "eth0"
        option proto static
        option ipaddr 192.168.1.1
        option netmask 255.255.255.0
lorenzo.allegrucci wrote:
ceraldi wrote:
UrsusArctos wrote:

I have already extended the ip175c driver by Patrick Horn to handle the IP175D as well. I hope it will get merged to OpenWRT soon, as soon as it gets some testing other than on my RB450. If you are interested, feel free to ask me for a patch by e-mail to mj@ucw.cz.

Got this patch and just wanted to say THANKS! it works perfectly with the ip175d chip and also seams to work great on a ip178c please include this patch in the trunk or backfire releases.

-A

Hi, I can't find a way to configure my RB450 with separate ports

dmesg:
IP17xx: Found IP175D at ag71xx-mdio:00
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: connected to PHY at ag71xx-mdio:00 [uid=02430d80, driver=IC+ IP17xx]

root@OpenWrt:~# swconfig dev eth1 show
Global attributes:
        enable_vlan: 1
        name: IP175D
        phy: 0
        reg: 0
        val: 12544
Port 0:
        status: up, 100 Mbps, full duplex, auto-negotiate
        link: 100
        tagged: 0
        pvid: 5
Port 1:
        status: down, auto-negotiate (in progress)
        link: 0
        tagged: 0
        pvid: 4
Port 2:
        status: down, auto-negotiate (in progress)
        link: 0
        tagged: 0
        pvid: 3
Port 3:
        status: down, auto-negotiate (in progress)
        link: 0
        tagged: 0
        pvid: 2
Port 4:
        status: down, auto-negotiate (in progress)
        link: 0
        tagged: 0
        pvid: 0
Port 5:
        status: up, 100 Mbps, cpu port
        link: 100
        tagged: 0
        pvid: 5
VLAN 0:
        tag: 1
        ports:
VLAN 1:
        tag: 2
        ports:
VLAN 2:
        tag: 3
        ports: 3 5
VLAN 3:
        tag: 4
        ports: 2 5
VLAN 4:
        tag: 5
        ports: 1 5
VLAN 5:
        tag: 6
        ports: 0 5
VLAN 6:
        tag: 7
        ports:
VLAN 7:
        tag: 8
        ports:
VLAN 8:
        tag: 9
        ports:
VLAN 9:
        tag: 10
        ports:
VLAN 10:
        tag: 11
        ports:
VLAN 11:
        tag: 12
        ports:
VLAN 12:
        tag: 13
        ports:
VLAN 13:
        tag: 14
        ports:
VLAN 14:
        tag: 15
        ports:
VLAN 15:
        tag: 16
        ports:

root@OpenWrt:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DD
          inet addr:192.168.250.250  Bcast:192.168.250.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87dd/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3156 (3.0 KiB)  TX bytes:468 (468.0 B)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DE
          inet addr:192.168.1.254  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4264 (4.1 KiB)  TX bytes:3036 (2.9 KiB)
          Interrupt:4

eth1.2    Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DE
          inet addr:192.168.2.254  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:398 (398.0 B)

eth1.3    Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DE
          inet addr:192.168.3.254  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:492 (492.0 B)

eth1.4    Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DE
          inet addr:192.168.4.254  Bcast:192.168.4.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:492 (492.0 B)

eth1.5    Link encap:Ethernet  HWaddr 00:0C:42:5B:87:DE
          inet addr:192.168.5.254  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:42ff:fe5b:87de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:906 (906.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1008 (1008.0 B)  TX bytes:1008 (1008.0 B)


root@OpenWrt:~# cat /etc/config/network
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface wan
        option ifname   eth0
        option proto    static
        option ipaddr   192.168.250.250
        option netmask  255.255.255.0

config interface port3
        option ifname   "eth1.2"
        option proto    static
        option ipaddr   192.168.2.254
        option netmask  255.255.255.0

config interface port2
        option ifname   "eth1.3"
        option proto    static
        option ipaddr   192.168.3.254
        option netmask  255.255.255.0

config interface port1
        option ifname   "eth1.4"
        option proto    static
        option ipaddr   192.168.4.254
        option netmask  255.255.255.0

config interface port0
        option ifname   "eth1.5"
        option proto    static
        option ipaddr   192.168.5.254
        option netmask  255.255.255.0

config switch eth1
        option name     eth1
        option reset    1
        option enable_vlan 1

config switch_vlan
        option device   eth1
        option vlan     2
        option ports    "5 3"

config switch_vlan
        option device   eth1
        option vlan     3
        option ports    "5 2"

config switch_vlan
        option device   eth1
        option vlan     4
        option ports    "5 1"

config switch_vlan
        option device   eth1
        option vlan     5
        option ports    "5 0"

I can't ping any eth1.X, just eth1 and eth0

Am I missing something?

ceraldi, can you please port your configuration?
Thank you.

(Last edited by ceraldi on 27 Apr 2010, 20:56)

Where is the patches to IP175D ?

There is too much information for now, so I create a RB450G page to hold all information on one place (There was an empty link on ) so RB450G users can more easily help us:

http://wiki.openwrt.org/toh/mikrotik/rb450g

Hi,
I've updated UrsusArctos's patches to the latest trunk revision and posted them here: http://inst.eecs.berkeley.edu/~pathorn/ip175c/

Please test it out if you have any IC+ switch (to make sure it didn't break old ones) or if you have a 175D to check test out the new code.

Beware: These changes are completely untested! There's a chance that they may disable the switch, requiring you reflash to an older revision, so be prepared with a backup firmware in case that happens and let me know. I did kind of a rush job on rebasing them to the latest revision, so they possibly may not even compile. I'll try to get around to compiling it this weekend, but I can't test it myself for another week or so.

Also, the "Avoid auto negotiation" change should hopefully fix the link autonegotiation bug some people had.

(Last edited by phorn on 7 May 2010, 09:22)

phorn wrote:

Hi,
I've updated UrsusArctos's patches to the latest trunk revision and posted them here: http://inst.eecs.berkeley.edu/~pathorn/ip175c/

Please test it out if you have any IC+ switch (to make sure it didn't break old ones) or if you have a 175D to check test out the new code.

Beware: These changes are completely untested! There's a chance that they may disable the switch, requiring you reflash to an older revision, so be prepared with a backup firmware in case that happens and let me know. I did kind of a rush job on rebasing them to the latest revision, so they possibly may not even compile. I'll try to get around to compiling it this weekend, but I can't test it myself for another week or so.

Also, the "Avoid auto negotiation" change should hopefully fix the link autonegotiation bug some people had.

Thank you very much!
I read this mail(RB450 - using Five Ethernet Ports) all most one weeks for find the way to drive ic+ switch,but yesterday i found i am in the wrong way,because my rb450 use a 175D chip.
Fortunately,you update new patch for ip175d.
hope i can drive it these days.
I will post my result the fist time.

Hi phorn,
Maybe i found a little wrong in your patch
[670-phy_ip175c.patch]
++obj-$(CONFIG_IP175C_PHY)    += ip17xx.o   i think it need instead of this(++obj-$(CONFIG_IP17XX_PHY)    += ip17xx.o)
[ip17xx.c]
int __init ip175c_init(void)------------>ip17xx
void __exit ip175c_exit(void)------------->ip17xx

(Last edited by pulsetang on 8 May 2010, 21:27)

do i need to patch #5193?
now i just patch ip175d patch in 10.03,but i can't drive any eth

IP17xx: Found IP175D at ag71xx-mdio:00
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters

i think i can patch ip175d successful,but i can't use eth1 as before.
i am only use up175d patch and backfire 10.03 only,haven't use any patch as switch.
i only want to use it like lan+wan?who can help me.

thanks ceraldi,he give me the 175d path old than http://inst.eecs.berkeley.edu/~pathorn/ … -05-06.zip
ip175d-2010-05-06.zip,this patch have something bug,when i intead of ip175xx that ceraldi give me,it's ok!!
i can ping anying five port,no vlan,no switch config.just wlan and lan,it's my wanted.
everyone who want to drive 175d,can ask me or ceraldi.
pulsetang@gmail.com

I have no luck on a RB433UAH.
I applied the patches one by one, taken care of the things written in #181, and added CONFIG_IP17XX_PHY=y to target/linux/ar71xx/config-2.6.32
Everything is compiled, but what I see in dmesg is:

ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=ICPlus IP175C]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters

And of course:

root@OpenWrt:/# swconfig dev eth0 show
Failed to connect to the switch
root@OpenWrt:/# swconfig dev eth1 show
Failed to connect to the switch

What am I doing wrong?

duvi wrote:

I have no luck on a RB433UAH.
I applied the patches one by one, taken care of the things written in #181, and added CONFIG_IP17XX_PHY=y to target/linux/ar71xx/config-2.6.32
Everything is compiled, but what I see in dmesg is:

ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=ICPlus IP175C]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters

And of course:

root@OpenWrt:/# swconfig dev eth0 show
Failed to connect to the switch
root@OpenWrt:/# swconfig dev eth1 show
Failed to connect to the switch

What am I doing wrong?

I tampered with swlib.c to activate DEBUG and got this:
root@OpenWrt:/# swconfig dev eth1 show
swlib_priv_init(537): swlib_priv_init called.
swlib_connect(630): swlib_connect - after priv_init.
swlib_call(89): 1.
swlib_call(96): 2. data=(nil)   arg.head=(nil)
swlib_call(106): 3.
swlib_call(113): 4.
swlib_call(119): 5. call=0x40242c  data=(nil)  arg.head=(nil)
swlib_call(131): 5.5. data=(nil)  arg.head=(nil)   finished=0
swlib_call(136): 6. data=(nil)  arg.head=(nil), finished=1
swlib_call(140): 7. err=0
Failed to connect to the switch

Hi,

If you're seeing "ICPlus IP175C", that means you're on the old ip175c.c kernel module, which doesn't support IP175D. So I would make sure your patches actually got applied. You're supposed to see [IC+ IP17xx] In the phy name

I realized that there was a bug with the makefile that caused the ip17xx.c never to get built. I uploaded a fixed zip file here:
http://www-inst.eecs.berkeley.edu/~path … latest.zip

If you want to test from scratch, using

git checkout 4267c24c

Then, I applied them with:

for x in 00*.patch; do git am $x; done

If you're using svn, make sure you're on revision 21390 or later (the patches apply cleanly to trunk at 21642). These patches may work on a later revision, but just to make sure, try this revision. Also, make sure the ip17xx.c file exists in target/linux/generic-2.6/files/drivers/net/phy

And finally, I don't think the patch adds CONFIG_IP17XX=y to the ar71xx architecture, so you might need to add that for the kernel version you're using (I believe the default in this revision is 2.6.32)

Let me know if you still have problems, and please paste the relevant parts of dmesg--maybe look for mentions of IP17xx or IP175D.

Unfortunately, while it builds for me, I still don't have any hardware to test with, so you're on your own.

Also, note that the final packages now build in bin/atheros or bin/ar71xx, *NOT* directly inside bin. There were some stale files I had in bin from several months ago, and they threw me off. Make sure to check the modification date of the files you just built, and you can run:

It also compiles an uncompressed version of the kernel, so you can do:

strings "openwrt-atheros-vmlinux.elf" | grep IP175D

to make sure it supports it and has the module compiled in.

(Last edited by phorn on 31 May 2010, 11:44)

Here we go:

trunk$ strings "bin/ar71xx/openwrt-ar71xx-nand-vmlinux.elf" | grep IP175D
VLAN tag (0-4095) [IP175D only]
IP175D

also got:

trunk$ strings "bin/ar71xx/openwrt-ar71xx-nand-vmlinux.elf" | grep 17xx
<4>IP17xx: Unable to get MII register %d,%d: error %d
<4>IP17xx: Unable to write MII register %d,%d: error %d
<6>IP17xx: Identified oui=%06x model=%02x rev=%X
<6>IP17xx: Chip ID register reads %04x
<4>IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.
<6>IP17xx: Found %s at %s
IC+ IP17xx

(note the I use ar71xx-nand kernel)

from dmesg:
...
Atheros AR71xx SPI Controller driver version 0.2.4
IP17xx: Identified oui=0090c3 model=18 rev=0
IP17xx: Chip ID register reads 175d
IP17xx: Found IP175D at ag71xx-mdio:00
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=ICPlus IP175C]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters
...

As you can see "ICPlus IP175C" is still there. How can this be possible if driver says it found a 175D  just above?
What should I read if the things were right??

I just don´t know were it came from. I forced "state->regs = &IP175D" instead IP175C in ip17xx.c just to see what happen. And nothing new happened :-(

eth1 has no message connecting it to a PHY. Instead it say it is "using fixed link parameters"

BTW, hardware is RB450 (not RB450G).

Anything else I can send you?

there are 2 versions of RB450 .... one shipped with IP175C and other with IP175D.

what is your version ??? Easy way .... just check how much RAM does the unit have. If you have 32Mb, its a IP175C one. If you have 64Mb, you have a IP175D one.

root@anapolis:~# free
             total       used       free     shared    buffers     cached
Mem:         29880      27792       2088          0          0       8660
root@saneago-obra718:~# free
             total       used       free     shared    buffers     cached
Mem:         62124      26208      35916          0          0      11888

Ok this may make sense to the experts.
I undefined CONFIG_ICPLUS_PHY
(I read somewhere it conflicts with IP175C_PHY. IS THAT CORRECT?)) 

Now I get:

IP17xx: Identified oui=0090c3 model=18 rev=0
IP17xx: Chip ID register reads 175d
IP17xx: Found an IC+ switch model 18, revision 0, driver IP175D.
IP17xx: Found IP175D at ag71xx-mdio:00
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters

Generic PHY??? Why not "IC+ IP17xx"??

I remember some problem about linking order.
ip17xx.o must be linked before what object??

Yes, that's correct. CONFIG_ICPLUS_PHY should be disabled. All of the switches actually have the same oui id, so it's kind of random which one the kernel will pick if it has both.

The reason you see Generic PHY is you have two ethernet ports: eth0 is just a single port ("mdio:04"), and eth1 is the rest of the ports, and the driver specifically only talks to eth1, which by accident doesn't print out which driver it's using.

So given your output it actually looks like everything is working properly (the IP17xx driver recognized a IP175D), and due to a missing debug statement in the code, eth1 doesn't print the name of the switch it's using.

If you want to add in this debugging information, it could help. Basically, open up target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c
and you will want to add a print statement like the following to all cases, even if it connects to multiple switches.

printk(KERN_DEBUG "%s: connected to PHY at %s "
                            "[uid=%08x, driver=%s]\n",
                            dev->name, phydev->dev.bus_id,
                            phydev->phy_id, phydev->drv->name);

You might need to put this into a for loop so it prints once for each of the 5 ethernet ports--and one of them should say IC+.
It's up to you if you want to do this, but it might help diagnose the problem.

Also, does swconfig work at all?

-Patrick

(Last edited by phorn on 31 May 2010, 21:04)

Patrick

You mean like this:

for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++)
{
        if((phydev = ag->mii_bus->phy_map[phy_addr])!=NULL)
        printk(KERN_DEBUG "%s: connected to PHY at %s [uid=%08x, driver=%s]\n",
                dev->name, dev_name(&phydev->dev),
                phydev->phy_id, phydev->drv->name);
}
I added this to the very end of ag71xx_phy_connect_multi.
Despite the fact it only prints "eth0" as the interface I got:

eth0: PHY found at ag71xx-mdio:04, uid=02430d80 and mask=00000010
eth0: connected to PHY at ag71xx-mdio:00 [uid=02430d80, driver=IC+ IP17xx]
eth0: connected to PHY at ag71xx-mdio:01 [uid=02430d80, driver=IC+ IP17xx]
eth0: connected to PHY at ag71xx-mdio:02 [uid=02430d80, driver=IC+ IP17xx]
eth0: connected to PHY at ag71xx-mdio:03 [uid=02430d80, driver=IC+ IP17xx]
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters

But even thus swconfig does not connect to the switch:
# swconfig dev eth1 show
swlib_priv_init(537): swlib_priv_init called.
swlib_connect(630): swlib_connect - after priv_init.
swlib_call(89): 1.
swlib_call(96): 2. data=(nil)   arg.head=(nil)
swlib_call(106): 3.
swlib_call(113): 4.
swlib_call(119): 5. call=0x40242c  data=(nil)  arg.head=(nil)
swlib_call(131): 5.5. data=(nil)  arg.head=(nil)   finished=0
swlib_call(136): 6. data=(nil)  arg.head=(nil), finished=1
swlib_call(140): 7. err=0
Failed to connect to the switch

same output for eth0.

The same thing on RB433UAH as before.
CONFIG_ICPLUS_PHY undefined, CONFIG_IP17XX=y added, all patches correctly applied, and still no sign of IP17XX or IP175D messages in dmesg.

...
Atheros AR71xx SPI Controller driver version 0.2.4
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters
Atheros AR71xx hardware watchdog driver version 0.1.0
...


Maybe some things are different on RB433UAH than RB450? How do I check?

I use initramfs.elf image, should that be a problem? I don't think so.

(Last edited by duvi on 31 May 2010, 23:49)

All your output is saying that things are working. I've been tracing through the code, and I can't come up with many reasons, aside from out of memory errors, that you would be getting those prints but the switch is never connecting.

I think the problem is how you are invoking the swconfig command.

From what I remember, the switch IDs are actually numbers: 0, 1, 2, ...
I would try "swconfig dev 0 show" or "swconfig dev 1 show".
It's strange that it doesn't give you an error for typing a name instead of a number.

(I'm really not sure about this--I see a lot of conflicting examples on google. I don't really have any routers with IC+ switches to test with at the moment, so I'm just guessing.)

If it still doesn't work, it might be time to add print statements to every other line :-p The fact that it recognized your switch as IP175D means all the hard parts should be working, and it's probably a silly error.

(Last edited by phorn on 1 Jun 2010, 08:12)

And what about RB433UAH?

My output says things are _not_ working. There is nothing about 'IP17xx' or 'IP175D'.
root@OpenWrt:/# dmesg |grep IP17
root@OpenWrt:/# dmesg |grep ip17
root@OpenWrt:/#

And also:
root@OpenWrt:/# swconfig dev 0 show
Failed to connect to the switch
root@OpenWrt:/# swconfig dev 1 show
Failed to connect to the switch

(Last edited by duvi on 1 Jun 2010, 08:17)

Hmm, I think I was wrong about the numbering, since the code seems to use devname, which I think is something like "eth0" or "eth1", etc.

It sounds like in both of your cases, you should be using eth0, so "swconfig dev eth0 show"

One possibility is that multiple switches are added, all named "eth0". And so the last one happens to be "Generic phy".

BitBrusher, since you already added some debug statements to swconfig, would it be possible to add another debug statement after line 572, where it has "name" for each switch, and print it out?

If it turns out that there are no switches in swconfig, I'm worried that there's some peculiarity with how the ag71xx network driver talks to the switch drivers (which had a major change about 2 months ago). Like maybe it's calling ip17xx_probe(), but not ip17xx_config_init(), which means it prints out everything but never calls "register_switch"

@duvi, it sounds like the ip17xx driver may have not been properly compiled into the kernel. Did you make sure to make clean after applying my fixed patch? If not, openwrt won't automatically rebuild the kernel, so it's an easy mistake to make:
TOPDIR=$PWD make -C target/linux clean

You can tell whether you properly compiled your kernel by doing:
strings "openwrt-ar71xx-vmlinux.elf" | grep IP175D

Also, make sure you looked in bin/ar71xx, *NOT* directly inside bin. I found I had some stale kernel files directly inside bin which were a few months old!

I'm pretty sure RB433UAH has IP175D, same as the other RB450s. I just did a google image search and I saw that chip on the board: http://www.katalita.lt/products/RB433UAH.jpg

(Last edited by phorn on 1 Jun 2010, 08:34)

phorn wrote:

Hmm, I think I was wrong about the numbering, since the code seems to use devname, which I think is something like "eth0" or "eth1", etc.

It sounds like in both of your cases, you should be using eth0, so "swconfig dev eth0 show"

One possibility is that multiple switches are added, all named "eth0". And so the last one happens to be "Generic phy".

BitBrusher, since you already added some debug statements to swconfig, would it be possible to add another debug statement after line 572, where it has "name" for each switch, and print it out?

If it turns out that there are no switches in swconfig, I'm worried that there's some peculiarity with how the ag71xx network driver talks to the switch drivers (which had a major change about 2 months ago). Like maybe it's calling ip17xx_probe(), but not ip17xx_config_init(), which means it prints out everything but never calls "register_switch"

Patrick

These debug lines from swconfig are inside swlib.c (package/swconfig/src/swlib.c).
The line you refer (572) is in what file??

About register_switch, I added these lines inside ip17xx_config_init:

        err = register_switch(&state->dev, dev);
        pr_info("IP17xx: Trying to register switch %s: ", dev->name);
        if (err < 0)
        {
                pr_info("ERROR=%x\n", err);
                return err;
        }
        pr_info("SUCCCESS\n");

and got NOTHING. Seems like your suspects are real.

BitBrusher

duvi wrote:

And what about RB433UAH?

My output says things are _not_ working. There is nothing about 'IP17xx' or 'IP175D'.
root@OpenWrt:/# dmesg |grep IP17
root@OpenWrt:/# dmesg |grep ip17
root@OpenWrt:/#

And also:
root@OpenWrt:/# swconfig dev 0 show
Failed to connect to the switch
root@OpenWrt:/# swconfig dev 1 show
Failed to connect to the switch

duvi

try this on you RB433:

# strings /proc/kcore |grep IP17

You should see something like (among lots of garbage):

root@OpenWrt:/# strings /proc/kcore |grep IP17
<4>IP17xx: Unable to get MII register %d,%d: error %d
<4>IP17xx: Unable to write MII register %d,%d: error %d
<4>IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.
IC+ IP17xx
IC+ IP175A
VLAN tag (0-4095) [IP175D only]
IP178C
IP175D
...

NOTE: your "garbage" will be a little bit different from mine.
what is important here is the IP17* strings look like mine.

If you do not see these IP17* strings you do not have the correct driver compiled in.
Back to the drawing board!

phorn: I grabbed a clean trunk with git, applied the patches, added CONFIG_IP17XX=y, removed CONFIG_ICPLUS_PHY from the kernel config, made menuconfig, than compiled.

 $ strings openwrt-ar71xx-generic-vmlinux-initramfs.elf | grep IP17
<4>IP17xx: Unable to get MII register %d,%d: error %d
<4>IP17xx: Unable to write MII register %d,%d: error %d
<4>IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.
<6>IP17xx: Found %s at %s
IC+ IP17xx
IC+ IP175A
VLAN tag (0-4095) [IP175D only]
IP175C
IP178C
IP175D

BirBrusher: of course the same thing within openwrt

root@OpenWrt:/# strings /proc/kcore | grep IP17
<4>IP17xx: Unable to get MII register %d,%d: error %d
<4>IP17xx: Unable to write MII register %d,%d: error %d
<4>IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.
<6>IP17xx: Found %s at %s
IC+ IP17xx
IC+ IP175A
VLAN tag (0-4095) [IP175D only]
IP175C
IP178C
IP175D

Yet, nothing about IP17XX in dmesg, and no success with swconfig.