There is still a stray call in setup_serdes to read the current CMU
band. The only effect is that the current band is printed to the log, the
value itself isn't used for anything further. Drop this since it's not
needed.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The function 'rtpcs_931x_sds_init_leq_dfe' was taken over mostly as-is
from the SDK. After looking at what it actually does (by seeing which
register are written and how they are used elsewhere), it becomes clear
that 'init' isn't the correct term to describe what it does. It sets the
LEQ and DFE parameters to baseline values (mostly 0) and turns off auto
mode, switching to manual LEQ/DFE and forcing those baseline values.
This is rather a reset to a known state instead of an initialization.
Name the function accordingly.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add some comments to several register writes explaining what these
fields are. The information was extracted from the SDK. This allows to
understand much better what's going on there.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Currently, the CMU is configured after media specific settings have been
set. This seems to work however does not make that much sense. The
proper clock should be configured before the TX/RX channels are
configured. Thus, move the call to the CMU configuration above the media
handling.
While at it, handle the return code of the CMU config properly.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The SerDes setup for RTL931x relies on chip specifics in some cases,
Determining both usually requires some register operations. But we can
avoid to do this every time again and again since the information is
static anyway. Thus, move this to initialization for RTL93xx, only read
once and store it in the global control structure. Though not used for
RTL930x, it has the same registers and information.
While at it, give referenced defines a proper prefix.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
From the Realtek SDK we know that the chip type tell us whether a chip
is a normal chip or an engineering sample/testchip [1]. Such engineering
samples likely never reach any consumer device, only some initial
development boards. So far we haven't encountered any device with that,
thus the code paths handling this are practically dead and can hardly be
checked of they work properly. To focus on support for the devices we
actually have, drop support for such engineering samples/testchips. This
may be readded later if there's sufficient need for this.
[1] 3261cf2e61/sources/rtk-dms1250/system/drv/swcore/chip_probe.c (L345)
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Drop a register write sequence from the USXGMII setup for RTL931x in
favor of using a function that is already present. From the name, the
function initializes LEQ DFE. Though it's not yet clear what it exactly
does, this is already better then having a sequence with no explanation
somewhere in the code.
Apparently, when this code was added, the function wasn't present
but it's content was just added here as single usage.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21858
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Backport the PSE-PD (Power Sourcing Equipment - Powered Device)
framework updates from Linux 6.13 through 6.19. This brings modern
PoE (Power over Ethernet) controller support to OpenWrt, enabling
userspace control of PSE hardware via ethtool.
Key features:
- Enhanced ethtool integration for PSE status and configuration
- Power domain support with budget evaluation strategies
- PSE event reporting via netlink
- Port priority management for power budget allocation
- New Si3474 PSE controller driver
Backported commits:
v6.13 core framework and TPS23881 improvements:
- 6e56a6d47a7f net: pse-pd: Add power limit check
- 0b567519d115 net: pse-pd: tps23881: Simplify function returns
- 4c2bab507eb7 net: pse-pd: tps23881: Use helpers to calculate bit offset
- f3cb3c7bea0c net: pse-pd: tps23881: Add missing configuration register
- 3e9dbfec4998 net: pse-pd: Split ethtool_get_status
into multiple callbacks
- 4640a1f0d8f2 net: pse-pd: Remove is_enabled callback from drivers
- 7f076ce3f173 net: pse-pd: tps23881: Add power limit
and measurement features
- 10276f3e1c7e net: pse-pd: Fix missing PI of_node description
- 5385f1e1923c net: pse-pd: Clean ethtool header of PSE structures
v6.17 power domains and event support:
- fa2f0454174c net: pse-pd: Introduce attached_phydev to pse control
- fc0e6db30941 net: pse-pd: Add support for reporting events
- f5e7aecaa4ef net: pse-pd: tps23881: Add support for PSE events
- 50f8b341d268 net: pse-pd: Add support for PSE power domains
- 1176978ed851 net: ethtool: Add support for power domains index
- c394e757dedd net: pse-pd: Add helper to report hw enable status
- ffef61d6d273 net: pse-pd: Add support for budget evaluation strategies
- 359754013e6a net: pse-pd: pd692x0: Add PSE PI priority feature
- 24a4e3a05dd0 net: pse-pd: pd692x0: Add controller and manager power
- 56cfc97635e9 net: pse-pd: tps23881: Add static port priority feature
- d12b3dc10609 net: pse-pd: pd692x0: reduce stack usage
v6.18 Si3474 driver and fixes:
- 1c67f9c54cdc net: pse-pd: pd692x0: Fix power budget leak
- 7ef353879f71 net: pse-pd: pd692x0: Skip power budget when undefined
- a2317231df4b net: pse-pd: Add Si3474 PSE controller driver
v6.19 maintenance and TPS23881B support:
- 2c95a756e0cf net: pse-pd: tps23881: Fix current measurement scaling
- f197902cd21a net: pse-pd: pd692x0: Replace __free macro
- 6fa1f8b64a47 net: pse-pd: pd692x0: Separate configuration parsing
- 8f3d044b34fe net: pse-pd: pd692x0: Preserve PSE configuration
- 4d07797faaa1 net: pse-pd: tps23881: Add support for TPS23881B
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/21810
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add board support for the Xikestor SKS8300-12E2T2X switch.
Hardware specifications:
========================
-Realtek RTL9302C SoC, 1x MIPS-34Kc, 800 MHz
-512 MB DDR3 RAM
-32 MB SPI-NOR Flash
-12x 2.5GBASE-T Ports (RTL8224)
-2x 10GBASE-T Ports (RTL8261)
-2x 10G SPF+ Ports
-Reset Button on the front panel
-Power & SYS LED's
-UART (115200 8N1) via RJ45
Flash instruction:
==================
-Prepare TFTP server & connect to serial port
-Connect your computer to one of the RJ45 ports
-Power on and interrupt autoboot with Shift + A.
-Use Shift + Q to drop from vendor CLI to U-Boot CLI.
-Change U-Boot Bootcommand (needed for network functionality):
> setenv bootcmd 'rtk network on; boota'
> saveenv
-Start network:
> rtk network on
-Set switch IP and TFTP server IP:
> setenv ipaddr [IP-ADDRESS]
> setenv serverip [IP-ADDRESS]
-Load initramfs image from TFTP server:
> tftpboot 0x82000000 [IMAGEFILE]
-Boot with the downloaded image:
> bootm 0x82000000
-Backup the stock firmware if needed
-Perform sysupgrade with the sysupgrade image (in Luci or Terminal via scp & sysupgrade)
Back to stock firmware:
=======================
-In the Terminal enter:
> fw_setenv bootcmd 'boota'
-Write firmware with:
> sysupgrade -F [IMAGEFILE]
Signed-off-by: Michael Wagenhofer <michael@wagenhofer.de>
Link: https://github.com/openwrt/openwrt/pull/21773
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Looking at the Realtek mdio busses there are curently the following
root@OpenWrt:~# mdio
1b000000.switchcore:mdio-controller-mii
fixed-0
realtek-aux-mdio
realtek-serdes-mdio
rtldsa_mdio-0
The main mdio bus for the phys is named after the dts node it belongs
to (1b000000.switchcore:mdio-controller-mii). As it is attached to the
controller node it is even more confusing.
Align the naming to the other busses and use "realtek-mdio".
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21702
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The phy driver still uses the ancient unknown firmware file format
for the internal RTL8218B of the RTL838x. Get rid of that and
convert the initialization to the bare minimum.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21885
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The xrx200 ethernet driver falls back to a random MAC address on any
error from of_get_ethdev_address(), including -EPROBE_DEFER. When the
MAC address comes from an nvmem layout driver (such as u-boot-env on
NAND), the nvmem cell may not be available yet at first probe attempt.
Fix this by propagating EPROBE_DEFER so the driver probe is deferred
until the nvmem cell becomes available.
Tested on Zyxel P-2812HNU-F1 (NAND, u-boot-env nvmem layout).
Signed-off-by: Burak Aydos <byhexadecimal@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add a ucode API to hostapd and wpa_supplicant for external DPP frame
handling. This allows an external controller to intercept DPP frames
and handle the DPP protocol externally.
The API provides:
- RX callbacks (dpp_rx_action, dpp_rx_gas) called when DPP frames are
received, allowing external handling before internal processing
- TX methods (dpp_send_action, dpp_send_gas_resp/dpp_send_gas_req) for
transmitting DPP frames
- A ubus channel-based API (dpp_channel) for bidirectional communication
with exclusive hook registration per interface
- CCE control for hostapd (set_cce method)
The wpa_supplicant API mirrors hostapd but adapted for STA role:
- Uses tx_gas_req instead of tx_gas_resp
- GAS RX provides full frame instead of parsed query
- No CCE control (AP-only feature)
Both implementations include:
- Timeout handling with automatic channel disconnect after 3 failures
- Hook cleanup on interface removal
- Last-caller-wins semantics for hook registration
Signed-off-by: Felix Fietkau <nbd@nbd.name>
When storing device-level data, wdev_set_data() spread the entire wdev
object into handler_data. Since handler_config.data is set from the
previous handler_data[wdev.name] before each setup, this created
exponentially growing nesting with each reload, eventually causing
"nesting too deep" JSON parse errors.
Fix by initializing cur to a simple object containing only the device
name instead of the entire wdev object.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Add support for DPP (Device Provisioning Protocol) as both a primary
encryption type and as an optional addition to existing authentication.
Primary DPP mode (encryption=dpp):
- Sets WPA2 with key_mgmt=DPP
- Requires Management Frame Protection (ieee80211w=2)
- Supports dpp_connector, dpp_csign, dpp_netaccesskey options
Optional DPP mode (dpp=1 boolean on AP):
- Adds DPP to existing key management methods
- Allows AP to accept both DPP and other auth types
- Supports the same connector options
Both ucode and legacy shell implementations are updated for AP and STA
modes.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Allow callers of edit_create_destroy to pass additional named arguments
via info.named_args that get merged into the create command parameters.
Signed-off-by: John Crispin <john@phrozen.org>
When a remote peer's connection drops (device powered off, unetmsgd
crash, network failure), network_rx_cleanup_state silently removed
the remote publish/subscribe handles without notifying local
subscribers. This meant local clients had no way to detect that a
remote peer had disappeared.
Call handle_publish for each channel where a remote publish handle
is removed during connection cleanup, so local subscribers receive
the publisher change notification and can react accordingly.
Signed-off-by: John Crispin <john@phrozen.org>
handle_publish() notifies local subscribers about publisher state
changes. The publish/subscribe handler in network_socket_handle_request()
was calling it for both remote publish and subscribe changes, but
subscriber changes are not relevant to local subscribers.
Guard the handle_publish() calls with a msgtype == "publish" check,
matching the local client paths in unetmsgd-client.uc which already
have this guard.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
When both peers connect simultaneously, the RX side can authenticate
before the TX handshake completes. network_check_auth() was sending a
ping on the unauthenticated TX channel, which gets rejected by the
remote's pre-auth handler as "Auth failed", killing the connection and
triggering an endless reconnect cycle.
Check chan.auth before interacting with the TX channel. If TX auth
hasn't completed yet, just schedule a reconnect timer - auth_data_cb
already handles state sync when TX auth completes.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
network_close() only closed the listening socket without shutting down
established RX/TX connections. This left remote state in
core.remote_publish/core.remote_subscribe for hosts on the removed
network, causing stale entries in channel listings and failed routing
attempts.
Close all RX and TX channels before removing the network, which also
triggers remote state cleanup via network_rx_socket_close().
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The cleanup condition checked != instead of ==, inverting the logic.
This caused two problems:
When an authenticated RX connection disconnected, remote state for that
host was never cleaned up since the stored entry matched the one being
closed.
When a stale unauthenticated connection from a peer closed, any existing
authenticated connection from the same peer was incorrectly deleted and
its remote state wiped.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
When a remote peer's publish registrations arrive via RX before the
local TX connection is authenticated, handle_publish fires but the
subscriber can't reach the remote publisher yet since the TX channel
isn't ready.
Suppress publish notifications on the RX side when no authenticated TX
channel exists for the remote host. After TX authentication completes,
re-trigger handle_publish only for topics that the specific peer
publishes and that have local subscribers.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The condition checked !data.networks instead of !data.networks[name],
making it always false since data.networks was already validated earlier
in the function. Networks removed from unetd were never closed.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Check /var/run/uci/ before /etc/config/ so that overlay configs
also trigger service reload events.
The overlay directory takes precedence, and uci show already handles
merging overlay + base configuration correctly.
Signed-off-by: John Crispin <john@phrozen.org>
Changelog:
13701b5 libtraceevent: 1.9
6a3a815 libtraceevent: Add tep_load_modules() API
31fc91b libtraceevent: Add tep_parse_last_boot_info()
5e4ef1f libtraceevent: Add tep_btf_list_args()
aa49dce libtraceevent: Split out btf func init code from tep_btf_print_args()
239b063 libtraceevent: Do not change names of functions not of this library
c284dec libtraceevent: Handle __get_stacktrace()
1ba1262 libtraceevent: Move back to 1.8.99
263459e libtraceevent: Use BTF_INT_BITS/OFFSET() when parsing int parameters
0294b73 libtraceevent utest: Add simple test to test BTF parsing
38e03ac libtraceevent: Have BTF find functions with extra characters
b441fff libtraceevent: Add man page for the new BTF functions
87f30d9 libtraceevent: Add loading of BTF to the tep handle
3488dc9 libtraceevent: Move to 1.9 devel
Link: https://github.com/openwrt/openwrt/pull/21886
Signed-off-by: Nick Hainke <vincent@systemli.org>
Changelog:
6fad6a1 libtracefs: version 1.8.3
5505e14 libtracefs: Do not have utest fail debugfs/tracing not found
362574c libtracefs: Fix whitespace in enable_disable_all()
06c07be libtracefs: Make comm field a string
0a2a28f libtracefs/Documentation: Fix markup in the man page
57fcdc1 libtracefs: utest: Return non-zero exit code when something fails
ae03455 libtracefs: Fix tracefs_event_is_enabled() for all events
01a3fd3 libtracefs: Fix enum type in read_event_state
ef1656b libtracefs: Fix the /dev/null redirection compatibility in Makefile
Link: https://github.com/openwrt/openwrt/pull/21886
Signed-off-by: Nick Hainke <vincent@systemli.org>
The pattern '*-*cc-*' incorrectly matches these tools because their names
contain 'cc-'. This causes them to receive compiler CFLAGS, breaking
builds with 'ar: two different operation options specified'.
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Link: https://github.com/openwrt/openwrt/pull/21757
Signed-off-by: Robert Marko <robimarko@gmail.com>
Enabling and disabling in-band auto-negotation is already supported on
RTL93xx. However, so far the advertisement is left unchanged at the
default of 0x1a0 (full duplex + pause + asymmetric pause).
Instead, set the advertisement to reflect the current configuration for
1000Base-X and 2500Base-X. Nothing needs to be done for SGMII, as the
advertisement register is ignored in that case.
Testing shows that negotiation of flow control works for 1000Base-X and
2500Base-X (tested with RTL930x on both ends of the link).
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/21869
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a new SerDes operation for restarting in-band negotiation including
an implemenation for RTL93xx, and call it from .pcs_an_restart.
This is a prerequisite for configuration of the in-band advertisement,
as changing it requires triggering a restart of auto-negotiation.
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/21869
Signed-off-by: Robert Marko <robimarko@gmail.com>
Commit 78bf3a5f44 ("realtek: dsa: Fix rate control initialization") enabled
code setting up the "storm control" feature. This casued a speed regression
on rtl838x, reducing the effective max speed per port from line rate to around
500 Mbits/s.
Storm control is a policy feature with a number of input parameters depending
on use case and environment. It is not possible to define a meaningful static
policy in the driver. The problem isn't just the arbitrary limits in the
current code. Such features require userspace interfaces.
Drop this code for now. It wasn't missed while it was disabled.
Cc: Sven Eckelmann <se@simonwunderlich.de>
Fixes: 78bf3a5f44 ("realtek: dsa: Fix rate control initialization")
Link: https://github.com/openwrt/openwrt/issues/21692
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/21877
Signed-off-by: Robert Marko <robimarko@gmail.com>
Replace the following pending patches which have now been merged in
kernel v6.20:
- arm64: dts: qcom: ipq5018: Remove tsens v1 fallback compatible
- clk: qcom: gcc-ipq5018: flag sleep clock as critical
- arm64: dts: qcom: ipq5018: Correct USB DWC3 wrapper interrupts
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21883
Signed-off-by: Robert Marko <robimarko@gmail.com>
Update PWM patch set to v20 which resolves some bugs related to the
duty cycle / frequency calculation; and add missing config symbol
CONFIG_PWM.
Fixes: #21727
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/21889
Signed-off-by: Robert Marko <robimarko@gmail.com>
Uninitialized memory led to bogus, huge timestamps being set on files
downloaded with the wget backend. This caused odd issues like 'ls -l'
crashing busybox when attempting to list the .apk file afterwards.
Link: 42f159e67b
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/21874
Signed-off-by: Robert Marko <robimarko@gmail.com>
DSA tagging currently works with a tuned trailer tagging. That means:
- realtek target uses tag_trailer for tagging
- there is a patch for the trailer tagger to write the target port not
as a bitfield but as an integer
Make the tagging independent from upstream and hacky patches by providing
a new downstream driver. This can be aligned easier for future development.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21815
Signed-off-by: Robert Marko <robimarko@gmail.com>
The SoC specific configuration structure is currently manually
assigned depending on the family_id. This will be removed in
the future. Make use of device_get_match_data() instead.
While we are here rename the structure prefix.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21866
Signed-off-by: Robert Marko <robimarko@gmail.com>
Bit 15 of the rtl838x SMI_GLB_CTRL register is set early during mdio reset
and never cleared. There is no need to set it again.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/21868
Signed-off-by: Robert Marko <robimarko@gmail.com>
Commit 17f12695d0 ("realtek: mdio: rtl838x: activate combo PHY media detection")
dropped setting bit 15 of the SMI_GLB_CTRL register without any explanation. This
broke the Netgear GS108Tv3, causing phy patching to fail:
Firmware loaded. Size 1184, magic: 83808380
Realtek RTL8218B (internal) 1b000000.switchcore:mdio-controller-mii:08: patch
Realtek RTL8218B (internal) 1b000000.switchcore:mdio-controller-mii:08: package not ready for patch.
Realtek RTL8218B (internal) 1b000000.switchcore:mdio-controller-mii:0f: probe with driver Realtek RTL8218B (internal) failed with error -5
None of the internal phys was able to detect a link after this error.
Some rtl8380 devices, like the Zyxel GS1900-10HP A1, were not affected by the bug
because their boot loader always sets bit 15. The bug could also be worked around
on affected devices by running "rtk network on" before booting OpenWrt, setting
bit 15 as a side effect.
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
Cc: Robert Marko <robimarko@gmail.com>
Fixes: 17f12695d0 ("realtek: mdio: rtl838x: activate combo PHY media detection")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/21868
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit increases the SPI bus frequency from 20 to 52 MHz. Reduces boot
time by 2s. Below is a performance comparison.
spi-max-frequency = <20000000>
> time dd if=/dev/mtd4 of=/dev/null bs=10M count=1
> 1+0 records in
> 1+0 records out
> real 0m 1.86s
> user 0m 0.00s
> sys 0m 0.28s
spi-max-frequency = <52000000>
> time dd if=/dev/mtd4 of=/dev/null bs=10M count=1
> 1+0 records in
> 1+0 records out
> real 0m 1.04s
> user 0m 0.00s
> sys 0m 0.27s
Signed-off-by: st7105 <st7105@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21802
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The internal RTL8218B gets detected cleanly. No need for
additional checks of the bus address or the SoC type.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21857
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add everything that's needed to have a standalone setup of the XSGMII
mode without having to rely on previous U-boot setup. This includes
patch sequences for the SerDes and extensions of symbol error reset and
reading.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21762
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The XSGMII mode is special in several regards. The inband
autonegotiation for this mode is called 'XSG N-way'. It is controlled
using different bits and location, and using XSG operations.
Add support for this by enhancing the set_autoneg implementation shared
by RTL930x and RTL931x. This can stay shared since it works the same for
both variants.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21762
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Instead of having all kinds of SerDes-related operations in the global
pcs config structure, there's now a SerDes ops structure which is
intended to cover and separate this.
Move the set_autoneg hook to the SerDes ops to adhere to this desired
separation. Calling the operation is further encapsulated with a small
convenience helper.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21762
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>