In What Code is AR8327 Switch Config Done?

I'm trying to accomplish two general things related to configuration of the AR8327 switch in a TP-Link Archer C7 (ar71xx platform).

The first is to confirm the behavior of UCI parameters and how they translate to configuration. From "poking at" the switch and viewing the output of swconfig, it appears that as implemented:

  • vlan is limited to 127 (somewhat surprising as the AR8327 claims to support "4K VLAN entries")
  • The assigned PVID defaults to the value of vlan
  • The assigned VLAN tag defaults to the value of vlan
  • vid seems to set the VLAN tag properly; VLAN tag of 4095 is possible
  • pvid sometimes will set the PVID; "failure" conditions not determined yet

Seeing this in the code and how it flows from ubus call network reload through to deeper levels will let me properly update the OpenWRT documentation, rather than just guessing.

The second set of goals is to either be able to access, or to implement access to some of the features described in the Atheros AR8327/AR8327N Seven-port Gigabit Ethernet Switch Data Sheet, such as 802.1Q VLAN Security.

I didn't have much luck with grep and finding constants for the register names, at least as they are called out in the Atheros documentation.

Hi Jeff,

Take a look at the kernel driver for switch source code here
https://github.com/lede-project/source/tree/master/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx

The swconfig uses a generic interface to connect to underlying switch. Look in ag71xx_ar7240.c for
static const struct switch_dev_ops ar7240_ops = {

Hope it helps

Zer0_0ne

1 Like

:+1:
Knowing the "end point" makes finding the path there much easier!