Adding OpenWrt Support for Netgear RAX120 (Nighthawk AX12)

Ok, thank you. I'll make some more tests. Have a good weekend.

@WiZaR5789 : I wasn't able to reliably test wifi, it crashes too often. I even tried with the firmware file from stock and it didn't change. Not sure what else to try.

To all: I created a patch (lots of copy-paste) for proper support of the Aquantia AQR111 5G lan interface my github repo. It involves adding the two IDs to the phy driver structure and creating a init method.

The firmware claims it supports 10G (if I understand the mdio output correct) and that messes with auto-negotiation.

$ mdio 900* mmd 7:1
...
SPEED(0x04): 0x6031
  capabilities: -100g -40g -10g/1g -10 +100 +1000 -10-ts -2-tl +10g
...
EXTABLE(0x0B): 0x40fc
  capabilities: -10g-cx4 -10g-lrm +10g-t +10g-kx4 +10g-kr +1000-t
                +1000-kx +100-tx -10-t +2.5g/5g-t

PKGID(0x0E/0x0F): 0x03a1b612

Would anyone with more knowledge (@robimarko again) than me be able to have a look at the patch and see if it make sense to them? Especially in the phy driver structure if all the (callbacks?) methods are useful. Like .*et_tunable, .suspend and .resume.

The patch is successfully tested with the RAX120v2 running from a initramfs, on a

  • QNAP QSW-M1204-4C, connected to a RJ45 10GbE port
    • speed set to 'auto', 5G, 2.5G and 1G
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on
  • again with the QNAP but using a MikroTik S+RJ10 on a SFP+ port (speed on the switch is alway 10G)
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on
  • MikroTik CSS610-8G-2S+, connected using the MikroTik S+RJ10 on a SFP+ port
    • speed set to 'auto' & on RAX120v2 using ethtool set to 5G FDX, 2.5G FDX, 1G FDX, 100M FDX & HDX and autoneg on

Addition: right now the 5G port is called 'lan5'. IMHO it would be more accurate to call it '5g-0' or '5g' since it can be used for either wan or lan.

Its weird to see 10G being advertised

It is indeed. Something similar was done for the AQCS109 (where I copied it from), in aqcs109_config_init(). They write:

    /* AQCS109 belongs to a chip family partially supporting 10G and 5G.
     * PMA speed ability bits are the same for all members of the family,
     * AQCS109 however supports speeds up to 2.5G only.
     */

The AQR111 family of chips don't support 10G at all according to the product brief. Sloppy firmware programming maybe.