Porting guide ar71xx to ath79?

@lucize I still don't perform the tcpdump tests, but I've already did the change in the 10-ath9k-eeprom file, the dmesg is the same, but now the wifi is working now, both wifi bands. Here is the part that change in the new dmesg

"tplink,tl-wr2543-v1")
	ath9k_eeprom_extract "art" 4096 2048

[   23.512447] ath9k 0000:00:00.0: Direct firmware load for ath9k-eeprom-pci-0000:00:00.0.bin failed with error -2
[   23.522673] ath9k 0000:00:00.0: Falling back to user helper
[   36.082138] ath: EEPROM regdomain: 0x0
[   36.082150] ath: EEPROM indicates default country code should be used
[   36.082156] ath: doing EEPROM country->regdmn map search
[   36.082174] ath: country maps to regdmn code: 0x3a
[   36.082181] ath: Country alpha2 being used: US
[   36.082187] ath: Regpair used: 0x3a
[   36.095914] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   36.101842] ieee80211 phy0: Atheros AR9300 Rev:3 mem=0xb0000000, irq=13

the only rare thing, is that the wifi interface have a generic mac address (00:22:33:44:55:66), Could this behavior be solved adding in the dts file, in "ath9k: wifi@0" section "mtd-mac-address = <&uboot 0x1fc00>;" ?

dmesg is not the same, now the user helper is working, is normal to see the first error.
yes, you could try like in the wdr4300.dtsi/wr740-v2.dts.
are the wifi leds working ?
for wire
&eth0 try to add
pll-data = <0x1a000000 0x13000a44 0x00441099>;
or maybe we need to add more initvals to the switch
add after gpio-sck
realtek,extif0 = <1 0 1 1 1 1 1 1 2>;
try the switch config first

Would that mean one can back up the settings, use sysupgrade -n, and restore settings? From e.g. the 18.06 branch to ath79?

@juppin: the images you're building now, are those built from master or from your own tree? I have quite a few tweaks in files/ so if you're building from what's in master I'll roll my own for the 1043 v2 :slight_smile: .

is not working..

on another topic I'm thinking if should be better to create a generic image for 8m with usb included, in ar71xx there are lots of devices that have usb2

you can use sysupgrade, but wifi is changed so you'll have to recreate or edit the file, till now only wr841n-v9 and mr3020 has the network changed

This are build from master.

If you want to use my ath79 package repo, you could include the two files in my files folder in generic folder.
You have to build your images / kernel with the option "CONFIG_ALL_KMODS=y" and it will only work if you have the same kernel version and hash!

1 Like

Mr @lucize here are the new results of your indications

	ath9k: wifi@0 {
		reg = <0x0000 0 0 0 0>;
		#gpio-cells = <2>;
		gpio-controller;
		qca,no-eeprom;
		mtd-mac-address = <&uboot 0x1fc00>;

This fix the incorrect mac address in the wifi interface

	rtl8367 {
		compatible = "realtek,rtl8367";
		gpio-sda = <&gpio 1 GPIO_ACTIVE_HIGH>;
		gpio-sck = <&gpio 6 GPIO_ACTIVE_HIGH>;
		realtek,extif0 = <1 0 1 1 1 1 1 1 2>;

This now enable the lan ports in the device, but the wan port it's not working, for now.

About the wifi leds, in the current ar71xx profile, the wifi leds works, but not as it should be. This is the behavior of the wifi leds in the current ar71xx profile. No matter if you configure the wifi interface in the 2.4 or 5 wifi band, always blink the 2.4 wifi led.
1

This is the behavior of the wifi leds in the testing ath79 profile
2
No matter if you configure the wifi interface in the 2.4 or 5 band, always blink both band leds.

The wifi interface of this device only supports one band at a time, the normal behavior of the wifi leds in stock firmware is, when you select that the device work on 2.4 band, blinks the 2.4 led and disable de 5 led, and when you select that the device work on the 5 band, blinks the 5 led and disable the 2.4 led.

yes, the problem is that there is only one interface and I don't know how we can determine what band are you using and to activate only that led, so or the ar71xx way or both of them
on wan port did you tried a tcpdump, ifconfig is showing some rx/tx packets ?

also did you tried to add another vlan to a port and configure that one as a wan, is it working ?
also maybe adding the pll reg to &eth0

The easiest way would be to parse it from iw.

yes, and then what's the echo for the gpio led ? :smiley:
and when should we run the script ?

Its probably too much trouble for a LED.

You only have to define the default trigger to "pyh1tpt" for the second wifi, the order for this naming is always the same... So if there are two pci wifi devices one will always be pyh0 and the other always phy1.

Check for available triggers with any led, eg.: cat /sys/class/leds/tp-link\:green\:lan4/trigger

it doesn't have 1, is the same adapter, not concurrent

1 Like

@Mynzer can you do a swconfig dev switch0 show ?
the default wan in 02_network is set to port 9 (from ar71xx), does it has 9 ? I think should be 5

Does this mean you can choose if one want 2.4g or 5g wifi at one time?

@lucize here is the output from the swconfig dev switch0 show command

Global attributes:
	enable_vlan: 1
	enable_vlan4k: 0
	max_length: 1
Port 0:
	mib: Port 0 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 2
	link: port:0 link:down
Port 1:
	mib: Port 1 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:1 link:down
Port 2:
	mib: Port 2 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:2 link:down
Port 3:
	mib: Port 3 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:3 link:down
Port 4:
	mib: Port 4 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:4 link:down
Port 5:
	mib: Port 5 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 0
	link: port:5 link:down
Port 6:
	mib: Port 6 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 0
	link: port:6 link:down
Port 7:
	mib: Port 7 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 0
	link: port:7 link:down
Port 8:
	mib: Port 8 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 0
	link: port:8 link:down
Port 9:
	mib: Port 9 MIB counters
IfInOctets                          : 38340
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 38340
EtherStatsUnderSizePkts             : 3
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 61
EtherStatsPkts128to255Octets        : 86
EtherStatsPkts256to511Octets        : 46
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 145
EtherStatsBroadcastPkts             : 51
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 196
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:9 link:up speed:1000baseT full-duplex txflow rxflow 
VLAN 1:
	info: VLAN 1: Ports: '12349t', members=021e, untag=001e, fid=0
	fid: 0
	ports: 1 2 3 4 9t 
VLAN 2:
	info: VLAN 2: Ports: '09t', members=0201, untag=0001, fid=0
	fid: 0
	ports: 0 9t 
VLAN 3:
	info: VLAN 3: Ports: '29', members=0204, untag=0204, fid=0
	fid: 0
	ports: 2 9 
VLAN 4:
	info: VLAN 4: Ports: '39', members=0208, untag=0208, fid=0
	fid: 0
	ports: 3 9 
VLAN 5:
	info: VLAN 5: Ports: '49', members=0210, untag=0210, fid=0
	fid: 0
	ports: 4 9 
VLAN 6:
	info: VLAN 6: Ports: '59', members=0220, untag=0220, fid=0
	fid: 0
	ports: 5 9 
VLAN 7:
	info: VLAN 7: Ports: '69', members=0240, untag=0240, fid=0
	fid: 0
	ports: 6 9 
VLAN 8:
	info: VLAN 8: Ports: '79', members=0280, untag=0280, fid=0
	fid: 0
	ports: 7 9 
VLAN 9:
	info: VLAN 9: Ports: '89', members=0300, untag=0300, fid=0
	fid: 0
	ports: 8 9 
VLAN 10:
	info: VLAN 10: Ports: '0123456789', members=03ff, untag=03ff, fid=0
	fid: 0
	ports: 0 1 2 3 4 5 6 7 8 9 

At this moment, only the wan port is connected to the device, to avoid confusion

There are only triggers related to the same wifi, so or one of them or both, but this only from dts, from userspace it could be by what band is active, but when sould we check that?
And then execute a gpio activate on the right number

Is seems to be port 9,but wow, the vlan output.. So complicated, I think you should try to make some changes in the network config file, the port seems to have traffic but is strange, the other realtek switches have a cpu port and a wan port, you have traffic only on one port

Don´t had seen a wifi router that has a wifi device on which you can choose on which band it should operate :roll_eyes:

@lucize, I've tried changing the 02_network file from the ath79 profile to

	"tplink,tl-wr2543-v1")
		ucidef_add_switch "switch0" \
			"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "9@eth0"

and

	"tplink,tl-wr2543-v1")
		ucidef_add_switch "switch0" \
			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"

without success, so I've decide flash back again the current ar71xx build and see the swconfig dev switch0 show output (only wan port is connected again)

Global attributes:
	enable_vlan: 1
	enable_vlan4k: 0
	max_length: 1
Port 0:
	mib: Port 0 MIB counters
IfInOctets                          : 2420722
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 2360
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 2662955
EtherStatsUnderSizePkts             : 45
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 260
EtherStatsPkts65to127Octets         : 2364
EtherStatsPkts128to255Octets        : 201
EtherStatsPkts256to511Octets        : 263
EtherStatsPkts512to1023Octets       : 87
EtherStatsPkts1024to1518Octets      : 1554
EtherStatsMulticastPkts             : 187
EtherStatsBroadcastPkts             : 265
IfOutOctets                         : 242233
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 63
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 1962
IfOutMulticastPkts                  : 22
IfOutBroadcastPkts                  : 3
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 2
	link: port:0 link:up speed:100baseT full-duplex txflow rxflow auto
Port 1:
	mib: Port 1 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:1 link:down
Port 2:
	mib: Port 2 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:2 link:down
Port 3:
	mib: Port 3 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:3 link:down
Port 4:
	mib: Port 4 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:4 link:down
Port 5:
	mib: Port 5 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:5 link:down
Port 6:
	mib: Port 6 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:6 link:down
Port 7:
	mib: Port 7 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:7 link:down
Port 8:
	mib: Port 8 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:8 link:down
Port 9:
	mib: Port 9 MIB counters
IfInOctets                          : 291923
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 1962
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 2723793
EtherStatsUnderSizePkts             : 53
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 260
EtherStatsPkts65to127Octets         : 2447
EtherStatsPkts128to255Octets        : 346
EtherStatsPkts256to511Octets        : 275
EtherStatsPkts512to1023Octets       : 87
EtherStatsPkts1024to1518Octets      : 1554
EtherStatsMulticastPkts             : 388
EtherStatsBroadcastPkts             : 312
IfOutOctets                         : 2431870
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 4
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 248
IfOutUcastPkts                      : 2360
IfOutMulticastPkts                  : 165
IfOutBroadcastPkts                  : 262
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:9 link:up speed:1000baseT full-duplex txflow rxflow 
VLAN 1:
	info: VLAN 1: Ports: '12349t', members=021e, untag=001e, fid=0
	fid: 0
	ports: 1 2 3 4 9t 
VLAN 2:
	info: VLAN 2: Ports: '09t', members=0201, untag=0001, fid=0
	fid: 0
	ports: 0 9t 

It seems that the port 9 is the one that is conected to the cpu and port 0 is the wan port, so in theory, your initial config should be the correct one

	"tplink,tl-wr2543-v1")
		ucidef_add_switch "switch0" \
			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"