[Solved] Swconfig router and switch gl.inet ar150

Hi,

my big mistake was working with trunk

remade the patching after downloding the right openwrt last stable release: v18.06.1 (is it right?)

Worked fine.

EDITED: working on trunk with target system as Atheros ATH79 too

Bests

P.

Hi to whoever is listening:

recap so far:

normal gl-ar150 soc ar9330/9331, setup openwrt 18.06.1 4.9 kernel :

mydiffconfig:

CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_generic=y
CONFIG_TARGET_ar71xx_generic_DEVICE_gl-ar150=y

kernel boot-up:

[    0.911395] libphy: Fixed MDIO Bus: probed
[    0.934519] libphy: ag71xx_mdio: probed
[    1.564501] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[    1.573311] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    2.204269] ag71xx-mdio.1: Found an AR7240/AR9330 built-in switch
[    2.246422] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII

devices loaded

root@OpenWrt:/# ls -l /sys/class/net 
lrwxrwxrwx    1 root     root             0 Aug 16 07:51 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> ../../devices/platform/ag71xx.0/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth1 -> ../../devices/platform/ag71xx.1/net/eth1
lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Aug 16 08:01 wlan0 -> ../../devices/platform/ar933x_wmac/net/wlan0

swconfig output

root@OpenWrt:/# swconfig dev eth1 show
Global attributes:
        enable_vlan: 0
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:2 link:down
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:4 link:down
VLAN 0:
        vid: 0
        ports: 0 1 2 3 4 

modified by me trying to copy airgateway pro in mach-ubnt-xm.c setup

myfdiffconfig is the same

kernel boot-up:

[    0.768925] libphy: Fixed MDIO Bus: probed
[    0.794232] libphy: ag71xx_mdio: probed
[    1.425525] ag71xx-mdio.1: Found an AR7240/AR9330 built-in switch
[    1.467726] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII

devices loaded

root@OpenWrt:/# ls -l sys/class/net/
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> ../../devices/platform/ag71xx.1/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Aug 16 07:54 wlan0 -> ../../devices/platform/ar933x_wmac/net/wlan0

swconfig output

root@OpenWrt:/# swconfig dev eth0 show
Global attributes:
	enable_vlan: 1
	mirror_monitor_port: 15
Port 0:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:2 link:down
Port 3:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:3 link:down
Port 4:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:4 link:down
VLAN 0:
	vid: 0
	ports: 0 1 2 3 4 

Its like I lost a PHY in between the two set ups, see kernel boot logs, and following airgateway-pro setup its

like I am using mdio1 to connect gemac0 to the router and the speed is not GMII1000 nbt seems like 100 !!?? The router seems to work fine

in fact eth0 is displayed as 1000

[  783.878291] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  783.883478] br-lan: port 1(wlan0) entered blocking state
[  783.888606] br-lan: port 1(wlan0) entered forwarding state
[  783.910666] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
root@OpenWrt:/# [  832.624377] eth0: link down
[  838.235268] eth0: link up (1000Mbps/Full duplex)

I can use both serial or ssh throught eth0 but its like I cannot get the second rj45 socket to work.

I tried different switch config options in etc/config/network but I cannot get them to work.

What Am I missing ??

I noticed that openwrt/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c

contains references to ar934x but I wasnt able to figure out how to trigger them for my soc9330.

could be this one the problem or should I try some different special

etc/config/network/ switch config lines or some particular uci setup in etc/board.d/02_network ?

when I connect to router through eth0 (lan) dmesg gives:

[  857.471148] device eth0 entered promiscuous mode
[  857.475277] br-lan: port 2(eth0) entered blocking state
[  857.480299] br-lan: port 2(eth0) entered forwarding state

but swconfig dev eth0 show gives:

root@OpenWrt:/# swconfig dev eth0 show
Global attributes:
        enable_vlan: 0
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:2 link:down

ok port2 in br-lan refers to the br-lan itself connectiong to router by wifi gives

[ 1983.439870] device wlan0 entered promiscuous mode
[ 1984.281387] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1984.286683] br-lan: port 1(wlan0) entered blocking state
[ 1984.291605] br-lan: port 1(wlan0) entered forwarding state

So what about the switch and his ports ?? Any insight appreciated.

Updates

using iperf3 I verified that the actual spped of my rj45 plug is mii

iperf3-openwrt-s-c

Making some really random change to

openwrt/target/lunix/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c-

I ended up having

lrwxrwxrwx    1 root     root             0 Aug 16 08:15 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> ../../devices/platform/ag71xx.1/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Aug 16 08:15 wlan0 -> ../../devices/platform/ar933x_wmac/net/wlan0

but when attacching cable to second rj45 plug I get

root@OpenWrt:/# root@OpenWrt:/# swconfig dev eth0 show
Global attributes:
	enable_vlan: 0
	mirror_monitor_port: 15
Port 0:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:2 link:down
Port 3:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:3 link:down
Port 4:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:4 link:down
Port 5:
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	pvid: 0
	link: port:5 link:up speed:100baseT full-duplex auto
VLAN 0:
	vid: 0
	ports: 0 1 2 3 4 5 

Everything seems to me out of synch with the openwrt wiki and everything above ? any insight ?

Its like I got a bonus 5 port on the switch that at this point I don't know if its a real one or just software ?

I'll try to see if I can get the swconfig tool to set the two interfaces and have the router working as a dumb AP as per my initial idea.

Updates

modified a bit more the openwrt/target/lunix/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c

strange that having in my openwrt build a premade etc/config/wireless configuration file

was giving me strange boot up problems, a new thing to investigate

I am not sure about ethernet working right now. So far I can reach the router by wifi

but what is strange to me is :slightly_smiling_face:

root@OpenWrt:/# dmesg | grep eth0
[    1.478990] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    4.948986] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.008374] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   22.020986] br-lan: port 1(eth0) entered blocking state
[   22.024775] br-lan: port 1(eth0) entered disabled state
[   22.030708] device eth0 entered promiscuous mode
[ 1529.486406] eth0: link up (1000Mbps/Full duplex)
[ 1529.489652] br-lan: port 1(eth0) entered blocking state
[ 1529.494798] br-lan: port 1(eth0) entered forwarding state
root@OpenWrt:/# dmesg | grep wlan0
[   26.249954] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   26.271149] br-lan: port 2(wlan0) entered blocking state
[   26.275187] br-lan: port 2(wlan0) entered disabled state
[   26.280960] device wlan0 entered promiscuous mode
[   27.595191] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   27.600466] br-lan: port 2(wlan0) entered blocking state
[   27.605551] br-lan: port 2(wlan0) entered forwarding state
[ 1007.561313] br-lan: port 2(wlan0) entered disabled state
[ 4366.679637] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

[ 22.020986] br-lan: port 1(eth0) entered blocking state

[ 26.275187] br-lan: port 2(wlan0) entered disabled state

I just wanted to mirror eth0 plug to second available (not sure yet !!) Rj45 plug
Now I have strange ports on bridged interface !!

Let's see what happen next.

In the meanwhile if aybody working with ar934x platform could/would share his experience I would really appreciate it

I think I'll mark this topic as closed. The rewiring seems to work and I am able to mirror traffic
solution is here: Swconfig versus etc/config/network

2 Questions remain open

1st Swconfig versus etc/config/network
its about how to have the righ UCI and Luci config for this setting

2nd [Solved] Router-set-up advertising
its about how to set up router advertising or enabling answer to arp request by this
configuration SOLVED was bad switch configuration file

Both question have their own topic open at the moment

Help is needed

Thanks to everyone

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.