Add a 10-second timeout for outgoing auth requests to prevent connections from getting stuck when the remote peer goes silent after the hello handshake but before responding to auth.
Signed-off-by: Felix Fietkau <nbd@nbd.name> (commit: 8a304d0)
wifi-scripts: move the "disabled" option to the wifi-iface section
This helps for setups where the wifi interfaces are added dynamically via procd data by avoiding automatically bringing up interfaces with the default config. Internally, they are treated pretty much the same by netifd.
Signed-off-by: Felix Fietkau <nbd@nbd.name> (commit: 79a0aeb)
kernel: net: phy: realtek: replace hack with proper fix
RealTek's 2.5G PHYs suffer from an up to now inexplicable problem which results in the SerDes mode not being properly setup and disabling in-band AN leading to a timeout waiting for a busy-bit to clear. Up to now there has been a crude work-around: resetting the PHY and trying another time.
The cause has now been found as a wrong access to register PHYCR1 on MDIO_MMD_VEND1 instead of MDIO_MMD_VEND2 when setting up ALDPS as well as disabling the MDIO broadcast address 0.
In order to access MDIO_MMD_VEND2 on Clause-22-only busses a custom .read_mmd and .write_mmd ops are implemented, mapping MDIO_MMD_VEND2 to paged access as this is required.
Also, as ALDPS by design disables the SerDes PCS of the PHY in case the link has been down for a while, move enabling ALDPS to the end of the config_init function to not face problems when configuring the interface mode and in-band AN.
Signed-off-by: Daniel Golle <daniel@makrotopia.org> (commit: 5652b98)
kernel: net: phy: realtek: replace in-band AN hack
Replace downstream hack for RealTek PHYs with a more clean solution which could make it upstream.
As SGMII in-band AN is broken on some platforms, or simply expected to be disabled by default in phy/sgmii mode (ie. on-board PHYs with MDIO for out-of-band configuration and status), a hack for the RealTek PHY driver was introduced to unconditionally disable SGMII in-band autonegotiation.
Meanwhile the kernel has gained a proper interface for PHY and PCS to report in-band AN capabilities and enable/disable in-band, matching PHY and PCS capabilities.
Thanks to Bevan Weiss' knowledge about how RealTek PHY SerDes registers are being handled in RealTek's SDK this can now be greatly improved: - report in-band capabilties - let phylink set in-band matching PCS and PHY capabilities - properly abstracted indirect access of SerDes registers
Signed-off-by: Daniel Golle <daniel@makrotopia.org> (commit: dfce21d)
kernel: net: phy: c45: check validity of 10GbE LPA
Only use link-partner advertisement bits for 10GbE modes if they are actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes unless both of them are set.
Signed-off-by: Daniel Golle <daniel@makrotopia.org> (commit: 96ff31b)
I have contributed quite a lot changes recently and should be made responsible for most of the code that has been added to the PCS driver after it has been introduced by Markus.
FWIW, add myself as another module author so anything I produced here doesn't fall back to someone else, i.e. Markus as currently the single module author.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21410 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: fe0f6f8)
In kernel coding style, it is highly disregarded to hide structures behind typedefs ([1]). The PCS driver still contains a typedef for the sds_config which was taken over from the PHY driver.
- drop the typedef, just declaring it as a struct - give it the common 'rtpcs_' prefix - adjust all usage locations
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21410 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7aa7e97)
In the RTL931X configuration code, the array size of configuration arrays was still calculated with 'sizeof(...) / sizeof(...)'. There's a dedicated macro in the kernel for exactly that usecase. Use that instead to avoid possible errors and make the line shorter. The RTL930X code is already doing it the good way.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21410 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 3753805)
realtek: pcs: fix naming of RTL931X sds config data
Those config arrays still do not lineup with common conventions in the driver in terms of naming. They are missing the driver and variant prefix. Thus, line that up with how RTL930X code looks like.
- add 'rtpcs_' prefix since it's part of the PCS driver - add '931x_' prefix because it's for RTL931X - use 'cfg' instead of 'config' to shorten that a bit
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21410 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 84f2ecb)
realtek: pcs: drop some unneeded unused attributes
Drop the '__always_unused' tags from two functions which are actually used. This was missed during the big transition before.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21410 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: b435b5b)
The Realtek SDK includes a lot of code around specific port media, usually having quite some differences between 10G fiber, 1G fiber and DAC cables. For each type, several magic values are set which in the end usually make different kinds of links work optimal.
While there is currently no way to get that media information from the kernel, add some fields as an enum to have a notion of different media kinds. In additional steps, code for the subtargets can be taken over from the SDK to handle different media.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21385 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: b4bd85d)
SFP modules still do not work that well across different devices. One missing piece seems to be the bunch of magic values and bits set by the SDK depending on which media is used on a port.
Take over code from the SDK for port media handling [1]. This applies different sequences depending on whether it's 10G fiber, 1G fiber or DAC cables to make it work best for each variant. Place the call to that code below the configuration of a SerDes mode but before actually activating that mode and powering on the SerDes. The SDK and our code for RTL930x do that similarly.
Though we do not have any notion of media in pcs_config right now, do similar to some SDK versions and set an appropriate media type for fiber modes and SGMII (otherwise it doesn't work).
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21385 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7971386)
realtek: pcs: rtl931x: improve port media handling
The port media handling introduced before was to some extent just taken over from the SDK. As a second step, improve that code now. Some code can be deduplicated, a few statements removed and improved in general.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21385 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: b94c3ba)
qualcommax: ipq50xx: Add support for Zyxel SCR50AXE
This is tri-band WiFi6E capable router. Also Zyxel Nebula managed so no real local GUI. To open device 4 screws must be located uder the label. Four latches are on front and two on each side. Better start from ethernet port side where 3 small latches are easy to handle. FCC shows It's identical to WSQ65 sold as Zyxel Multy M6E but that's nowhare to be found yet. WSQ65 is not covered by this PR
Speficiations: * SoC: Qualcomm IPQ5018 * RAM: 1GB DDR3 * Flash: Winbond W25N02KWZEIR 256MB * UART: PCB "J3" is located left from front LED strip (VCC/TX/RX/ /GND) 3.3V 115200n8 * Wi-Fi1: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax) * Wi-Fi2: QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax) * Wi-Fi3: QCN6122 (2x2:2 6 Ghz 802.11an/ac/ax) * Ethernet: QCA8337 4xLAN 1Gbit / 1xWAN 1Gbit * Buttons: WPS , Reset * LEDs: 13 in total RGB power, RGB wan, RGB status (cloud), RGB wifi, Green wps * FCCID: I8803891
*Flash Instructions starts with getting root: connect uart to J3 connector next to the front LEDs go to failsafe when this shows up in log: "Press the [f] key and hit [enter] to enter failsafe mode" execute: mount_root passwd -d root reboot
logon as root: look for 'Please press Enter to activate this console.' login is root password is empty execute: fw_setenv DebugFlag=0x1 fw_setenv bootdelay=0x2 passwd -d root backup ubi partition "rootfs" into safe space reboot
or: tftpboot *-initramfs-uImage.itb bootm use sysupgrade as usual
*restore OEM from backup stop uboot and execute: setenv ipaddr 192.168.1.1 setenv serverip 192.168.1.10 tftpboot *-initramfs-uImage.itb bootm transfer rootfs.bin backup and execute: ubiformat /dev/mtd16 -y -f /tmp/rootfs.bin
Signed-off-by: Robert Senderek <robert.senderek@10g.pl> Link: https://github.com/openwrt/openwrt/pull/21042 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: f948f71)