OpenWrt Forum Archive

Topic: RB433: IP175C port numbers and kmod-switch problems

The content of this topic has been archived on 22 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Using phorn's switch-ip175c.c I was able to add support for the IP175C of the RB433 to kmod-switch. I figured out the port numbers of the three ethernet jacks (looking onto the front):

[port4]  (serial)  [port1] [port2]

where eth0 seems to be connected to port4 and eth1 to port1.

Remaining problem is that port2 is kind of unconnected to any netdevice and also a

cat /proc/switch/0/port/2/status

doesn't show any information (neither "down" or "up"). I guess that's due to the fact that port2 is the _second_ PHY on MII0 and not properly enumerated on this mdio bus.

I added more verbose logging in the new version.  If you load it, you should see information about which phy devices it found in dmesg. Could you post those lines?  Also I think if you do a #define DEBUG at the top, all of those pr_debug lines shold be activated... though I'm now a bit afraid to set off the watchdog timer as I managed to do that once by printing out too much.

Also added your patch to allow direct access... though it's a bit messy to have those 4 files in /proc/switch/0.

Does it work differently from the old switch system or just the port link status does not work correctly?  What happens if you try to read the link status from the appropriate registers (like phy 2, reg 0 or reg 1)?

phorn wrote:

I added more verbose logging in the new version.  If you load it, you should see information about which phy devices it found in dmesg. Could you post those lines?  Also I think if you do a #define DEBUG at the top, all of those pr_debug lines shold be activated... though I'm now a bit afraid to set off the watchdog timer as I managed to do that once by printing out too much.

The missing port 2 may be due to a buggy phy/mdio_mask in the platform data of the RB433. Currently compiling ...

Also added your patch to allow direct access... though it's a bit messy to have those 4 files in /proc/switch/0.

This was the fastest way to add them. A separate directory would be nicer, but probably needs changes in the switch-core.c.

Does it work differently from the old switch system or just the port link status does not work correctly?

Port 2 never worked for me.

What happens if you try to read the link status from the appropriate registers (like phy 2, reg 0 or reg 1)?

It works. I found out the mapping between port numbers and ethernet jacks that way.

jal2 wrote:

Remaining problem is that port2 is kind of unconnected to any netdevice and also a

cat /proc/switch/0/port/2/status

doesn't show any information (neither "down" or "up").

This was caused by an incorrect phy mask in the platform data. See the ticket 4185 for a patch to fix the status display. [s]Port 2 still isn't connected to eth1.[/s] Port 2 works with eth1 - it just takes quite some seconds if you plug the ethernet cable from port1 into port2.

(Last edited by jal2 on 10 Nov 2008, 11:08)

jal2 wrote:

Port 2 never worked for me.

Port2 (the rightmost jack) works even without kmod-switch and the patch to mach-rb4xx.c. I just didn't wait long enough after plugging the cable from port1 into port2 (Do some switches flush address table entries on "link down" from the PHY? At least not the IP175C).

In order to connect port1 and port2 (the two rightmost ethernet jacks) to a two-port switch you need to execute:

uci set network.0.vlan1="1 2 5*u"
/etc/init.d/network restart

(don't forget to commit for making it permanent).

IMHO there is no hardware-only way to put all three ports together in one switch, as the left jack is connected to a different MAC in the AR71xx.
Only the PHY of the IP175C is used. For a software solution you may put eth0 and eth1 into a bridge.

The discussion might have continued from here.