From d3e8698e407f8cf3582d1f2c44f0dbb050a4a88f Mon Sep 17 00:00:00 2001
From: donbernhardo <87759236+donbernhardo@users.noreply.github.com>
Date: Wed, 17 Jun 2026 21:16:21 +0200
Subject: [PATCH 001/126] Fix KP-9000-6XHML-X2 LED mux mapping
---
machine.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/machine.c b/machine.c
index 04db39a1..b7351676 100644
--- a/machine.c
+++ b/machine.c
@@ -40,6 +40,17 @@ __code const struct machine machine = {
LEDS_1G | LEDS_LINK,
0 },
},
+ .led_mux_custom = 1,
+ /* Measured front-panel LED pads:
+ * P1 amber/green: 9/10, P2: 12/15, P3: 18/21, P4: 24/25, left SFP: 26.
+ */
+ .led_mux = {
+ 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
+ 0x3f, 0x10, 0x12, 0x3f,
+ 0x14, 0x3f, 0x3f, 0x16, 0x3f, 0x3f,
+ 0x18, 0x3f, 0x3f, 0x1a, 0x3f, 0x3f,
+ 0x1c, 0x1e, 0x0c, 0x20
+ },
};
void machine_custom_init(void) { }
From 64a1d252cd4cb199b2f7b1227fcddadb0c60bdc4 Mon Sep 17 00:00:00 2001
From: donbernhardo <87759236+donbernhardo@users.noreply.github.com>
Date: Mon, 29 Jun 2026 13:54:47 +0200
Subject: [PATCH 002/126] Split KP-9000 6XH targets by PCB revision
---
Makefile | 2 +-
doc/devices/KP-9000-6XH-X2.md | 40 ++++++++++++++++++++++++++++++-----
doc/supported_devices.md | 4 ++--
machine.c | 14 ++++++++++--
machine.h | 3 +++
5 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 3b8027b9..ada70cf5 100644
--- a/Makefile
+++ b/Makefile
@@ -96,7 +96,7 @@ $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin: $(BUILDDIR)/rtlplayground.i
machine_check:
@mkdir -p $(BUILDDIR)/tmp
@set -eo pipefail; \
- for MACHINE in `grep -e ' MACHINE_' machine.c | sed -e 's%^.* MACHINE_%%' -e 's%[ ]*//.*$$%%' | sort -u`; \
+ for MACHINE in `grep -E '^[[:space:]]*(//[[:space:]]*)?#define MACHINE_' machine.h | sed -E 's%^[[:space:]]*(//[[:space:]]*)?#define MACHINE_%%' | awk '{print $$1}' | sort -u`; \
do \
echo "Checking $${MACHINE}"; \
$(CC) $(CC_FLAGS) -DMACHINE_$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine.c; \
diff --git a/doc/devices/KP-9000-6XH-X2.md b/doc/devices/KP-9000-6XH-X2.md
index 4cc21d71..b1c8fdc3 100644
--- a/doc/devices/KP-9000-6XH-X2.md
+++ b/doc/devices/KP-9000-6XH-X2.md
@@ -1,17 +1,32 @@
-# Keeplink KP-9000-6XH-X2
+# Keeplink KP-9000-6XH-X2 / KP-9000-6XHML-X2
-Following is documentation for unmanaged switch marked as `KP-9000-6XH-X2`.
+Following is documentation for switches marked as `KP-9000-6XH-X2` or
+`KP-9000-6XHML-X2`.
Using SPI clamp in-board is the only method for initial installation.
### Label specifications
- **Name**: 4X 2.5G RJ45 Port + 2 X 10G SFP+ Port
-- **Model**: KP-9000-6XH-X2
+- **Model**: KP-9000-6XH-X2 / KP-9000-6XHML-X2
- **Ports**:
- 4 × RJ45: 10/100/1000/2500 Mbps
- 2 × SFP+: 1000 / 2500 / 10000 Mbps
+### Machine target
+
+These devices exist with different PCB revisions. Select the machine target by
+the PCB silkscreen, not only by the label on the case.
+
+| PCB silkscreen | Known labels | Recommended machine target | Legacy target |
+| --- | --- | --- | --- |
+| `2M-PCB43-V1.2` | `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XHML_X2_V1_2` | `MACHINE_KP_9000_6XHML_X2` |
+| `2M-PCB43-V2.1` | `KP-9000-6XH-X2`, `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XH_X2_V2_1` or `MACHINE_KP_9000_6XHML_X2_V2_1` | `MACHINE_KP_9000_6XH_X2` |
+
+The V1.2 and V2.1 boards use different GPIO, SFP, port and LED mappings.
+The unmanaged and managed labels are firmware/SKU differences and do not by
+themselves identify the PCB wiring.
+
### What works
- All four 2.5GBASE-T RJ45 ports at 10/100/1000/2500 Mbps
@@ -19,7 +34,7 @@ Using SPI clamp in-board is the only method for initial installation.
- LEDs
- untested due to missing Hardware: SFP+ ports equipped with 1G or 2.5G SFPs.
-### Hardware overview
+### Hardware overview: 2M-PCB43-V2.1
Front side:
@@ -44,6 +59,22 @@ Bottom
+### Hardware overview: 2M-PCB43-V1.2
+
+The V1.2 board has been seen in managed `KP-9000-6XHML-X2` devices.
+
+Label:
+
+
+
+Top side:
+
+
+
+Bottom:
+
+
+
## Reset Button
There's an unpopulated Reset button on the front left side of the PCB.
@@ -54,4 +85,3 @@ The front case has already the hole in the metal case, you just have to punch a
## Power supply
Input power is delivered via barell plug, `12V 1A` adapter was provided.
-
diff --git a/doc/supported_devices.md b/doc/supported_devices.md
index 59e54d8a..c1b3f9a3 100644
--- a/doc/supported_devices.md
+++ b/doc/supported_devices.md
@@ -1,8 +1,8 @@
# Supported Hardware
The following devices have been tested and are fully working:
- Horaco ZX_SG4T2
-- keepLINK kp-9000-6hx-x2 (RTL8372: 4x 2.5GBit + 2x 10GBit SFP+)
-- keepLINK KP-9000-6XHML-X2, same as above, but Managed
+- keepLINK KP-9000-6XH-X2 / KP-9000-6XHML-X2 (RTL8372: 4x 2.5GBit + 2x 10GBit SFP+);
+ select the machine target by PCB revision, see [KP-9000-6XH-X2](devices/KP-9000-6XH-X2.md)
- keepLINK kp-9000-6hx-x (RTL8372 + RTL8221B 2.5GBit PHY: 5 x 2.5GBit + 1x 10GBit SFP+)
- keepLINK kp-9000-9xh-x-eu (1 x RTL8373 + RTL8224: 8x 2.5GBit + 1x 10GBit SFP+)
- Lianguo LG-SWTGW218AS (RTL8373 + RTL8224 PHY: 8x 2.5GBit + 1x 10GBit SFP+)
diff --git a/machine.c b/machine.c
index b7351676..96c6f0b2 100644
--- a/machine.c
+++ b/machine.c
@@ -5,9 +5,13 @@
#include "rtl837x_regs.h"
#include "rtl837x_common.h"
-#ifdef MACHINE_KP_9000_6XHML_X2
+#if defined(MACHINE_KP_9000_6XHML_X2) || defined(MACHINE_KP_9000_6XHML_X2_V1_2)
__code const struct machine machine = {
+#if defined(MACHINE_KP_9000_6XHML_X2_V1_2)
+ .machine_name = "keepLink KP-9000-6XHML V1.2",
+#else
.machine_name = "keepLink KP-9000-6XHML-X2",
+#endif
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
@@ -85,9 +89,15 @@ __code const struct machine machine = {
void machine_custom_init(void) { }
-#elif defined MACHINE_KP_9000_6XH_X2
+#elif defined(MACHINE_KP_9000_6XH_X2) || defined(MACHINE_KP_9000_6XH_X2_V2_1) || defined(MACHINE_KP_9000_6XHML_X2_V2_1)
__code const struct machine machine = {
+#if defined(MACHINE_KP_9000_6XHML_X2_V2_1)
+ .machine_name = "keepLink KP-9000-6XHML V2.1",
+#elif defined(MACHINE_KP_9000_6XH_X2_V2_1)
+ .machine_name = "keepLink KP-9000-6XH-X2 V2.1",
+#else
.machine_name = "keepLink KP-9000-6XH-X2",
+#endif
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
diff --git a/machine.h b/machine.h
index 931a17ee..3483f2e2 100644
--- a/machine.h
+++ b/machine.h
@@ -7,8 +7,11 @@
* Select your machine type below
*/
// #define MACHINE_KP_9000_6XHML_X2
+// #define MACHINE_KP_9000_6XHML_X2_V1_2
+// #define MACHINE_KP_9000_6XHML_X2_V2_1
// #define MACHINE_KP_9000_6XH_X
// #define MACHINE_KP_9000_6XH_X2
+// #define MACHINE_KP_9000_6XH_X2_V2_1
// #define MACHINE_KP_9000_9XH_X_EU
// #define MACHINE_KP_9000_9XHML_X_V2_2
// #define MACHINE_KP_9000_9XHML_X_V3_1
From dd52e8e85e077870a0e675f6894eb3b675934b43 Mon Sep 17 00:00:00 2001
From: donbernhardo <87759236+donbernhardo@users.noreply.github.com>
Date: Mon, 29 Jun 2026 14:12:31 +0200
Subject: [PATCH 003/126] Discard incorrect KP-9000 V1.2 LED mux override
---
machine.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/machine.c b/machine.c
index a25fe98f..d54998b7 100644
--- a/machine.c
+++ b/machine.c
@@ -44,17 +44,6 @@ __code const struct machine machine = {
LEDS_1G | LEDS_LINK,
0 },
},
- .led_mux_custom = 1,
- /* Measured front-panel LED pads:
- * P1 amber/green: 9/10, P2: 12/15, P3: 18/21, P4: 24/25, left SFP: 26.
- */
- .led_mux = {
- 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
- 0x3f, 0x10, 0x12, 0x3f,
- 0x14, 0x3f, 0x3f, 0x16, 0x3f, 0x3f,
- 0x18, 0x3f, 0x3f, 0x1a, 0x3f, 0x3f,
- 0x1c, 0x1e, 0x0c, 0x20
- },
};
void machine_custom_init(void) { }
From 457f117216818b588ab01d397222b4e835135ab9 Mon Sep 17 00:00:00 2001
From: donbernhardo <87759236+donbernhardo@users.noreply.github.com>
Date: Mon, 29 Jun 2026 20:59:28 +0200
Subject: [PATCH 004/126] Add PCB43 V1.1 and symmetric KP-9000 6XH targets
---
doc/devices/KP-9000-6XH-X2.md | 26 ++++++++++++++++----------
doc/supported_devices.md | 8 +++++---
machine.c | 14 ++++++++++++--
machine.h | 13 ++++++++++---
4 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/doc/devices/KP-9000-6XH-X2.md b/doc/devices/KP-9000-6XH-X2.md
index b1c8fdc3..d0f19b96 100644
--- a/doc/devices/KP-9000-6XH-X2.md
+++ b/doc/devices/KP-9000-6XH-X2.md
@@ -16,16 +16,20 @@ Using SPI clamp in-board is the only method for initial installation.
### Machine target
These devices exist with different PCB revisions. Select the machine target by
-the PCB silkscreen, not only by the label on the case.
+the PCB silkscreen, not by the label on the case. The `6XH` / `6XHML`
+distinction appears to be a stock firmware, SKU or label difference, not a
+reliable indicator of PCB wiring. The PCB revision defines the hardware layout.
-| PCB silkscreen | Known labels | Recommended machine target | Legacy target |
-| --- | --- | --- | --- |
-| `2M-PCB43-V1.2` | `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XHML_X2_V1_2` | `MACHINE_KP_9000_6XHML_X2` |
-| `2M-PCB43-V2.1` | `KP-9000-6XH-X2`, `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XH_X2_V2_1` or `MACHINE_KP_9000_6XHML_X2_V2_1` | `MACHINE_KP_9000_6XH_X2` |
+| PCB silkscreen | Known labels / devices | Recommended machine target | Equivalent target | Legacy target |
+| --- | --- | --- | --- | --- |
+| `2M-PCB43-V1.1` | Mokerlink 2G040210GSM web-managed 4+2 switch | `MACHINE_KP_9000_6XHML_X2_V1_1` | `MACHINE_KP_9000_6XH_X2_V1_1` | `MACHINE_KP_9000_6XHML_X2` |
+| `2M-PCB43-V1.2` | `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XHML_X2_V1_2` | `MACHINE_KP_9000_6XH_X2_V1_2` | `MACHINE_KP_9000_6XHML_X2` |
+| `2M-PCB43-V2.1` | `KP-9000-6XH-X2`, `KP-9000-6XHML-X2` | `MACHINE_KP_9000_6XH_X2_V2_1` or `MACHINE_KP_9000_6XHML_X2_V2_1` | same V2.1 layout | `MACHINE_KP_9000_6XH_X2` |
-The V1.2 and V2.1 boards use different GPIO, SFP, port and LED mappings.
-The unmanaged and managed labels are firmware/SKU differences and do not by
-themselves identify the PCB wiring.
+The V1.1 and V1.2 boards currently use the same V1.x GPIO, SFP, port and LED
+layout. The V2.1 board uses a different V2.1 layout with custom LED muxing.
+Legacy targets are preserved for compatibility with already-tested devices, but
+new builds should prefer the explicit PCB-revision targets.
### What works
@@ -59,9 +63,11 @@ Bottom
-### Hardware overview: 2M-PCB43-V1.2
+### Hardware overview: 2M-PCB43-V1.1 / V1.2
-The V1.2 board has been seen in managed `KP-9000-6XHML-X2` devices.
+The V1.1 board has been reported in the Mokerlink 2G040210GSM web-managed 4+2
+switch. The V1.2 board has been seen in managed `KP-9000-6XHML-X2` devices.
+Both use the same V1.x layout.
Label:
diff --git a/doc/supported_devices.md b/doc/supported_devices.md
index b367c1e7..bdb21c23 100644
--- a/doc/supported_devices.md
+++ b/doc/supported_devices.md
@@ -13,7 +13,8 @@ The following devices have been tested and are fully working:
| Horaco | ZX310S-4T2XH | Yes | [PCB-SL310S-4T1T1X-V1.0.1-24107](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/ZX310S-4T2XH.md) | 2M | 5 + 1 |
| Horaco | ZX310S-4T2XT | Yes | [PCB-SL310S-4T2XT-V1.0.0-22273](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/ZX310S-4T2XT.md) | 2M | 6 |
| Horaco | ZX-SWTG124AS | Yes | [SWTG024AS-v2.0](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/SWTG024AS.md) | | 4 + 2 |
-| Keeplink | KP-9000-6XH-X2 / KP-9000-6XHML-X2 | No/Yes | [2M-PCB43-V1.2 / V2.1](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/KP-9000-6XH-X2.md) | | 4 + 2 |
+| Keeplink | KP-9000-6XH-X2 / KP-9000-6XHML-X2 | No/Yes | [2M-PCB43-V1.2 / V2.1](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/KP-9000-6XH-X2.md) | | 4 + 2 |
+| Mokerlink | 2G040210GSM | Yes | [2M-PCB43-V1.1](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/KP-9000-6XH-X2.md) | | 4 + 2 |
| keepLINK | KP-9000-9XHML-X | Yes | [2M-PCB23-V2.2](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/2M-PCB23-V2_2.md) | 2M | 8 + 1 |
| keepLINK | KP-9000-9XHML-X | Yes | [2M-PCB23-V3.1](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/2M-PCB23-V3_1.md) | 2M | 8 + 1 |
| LIANGUO | SWTG024AS | No | [SWTG024AS-v2.0-17452](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/SWTG024AS.md) | 0.5M | 4 + 2 |
@@ -26,8 +27,9 @@ The following devices have been tested and are fully working:
| XikeStor | SKS3200-8E1X | Yes | [SWTG118AS-V2.1-17462](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/SWTGW218AS.md) | 2M | 8 + 1 |
| Ztyuav | Z-QWYT0402 | No | [PCB-K0402WS-V3.0](https://github.com/logicog/RTLPlayground/blob/main/doc/devices/PCB-K0402WS-V3.0.md) | | 4 + 2 |
-For KP-9000-6XH-X2 / KP-9000-6XHML-X2 devices, select the machine target by PCB
-revision. The managed/unmanaged label alone does not identify the wiring.
+For KP-9000-6XH-X2 / KP-9000-6XHML-X2 / Mokerlink 2G040210GSM devices, select
+the machine target by PCB revision. The ML/non-ML or managed/unmanaged label
+alone does not identify the wiring.
Other device based on RTL8272/3 that may work are described here: [Up-N-Atoms 2.5 GBit RTL Switch hacking guide](https://github.com/up-n-atom/SWTG118AS)
diff --git a/machine.c b/machine.c
index d54998b7..35b545db 100644
--- a/machine.c
+++ b/machine.c
@@ -5,9 +5,19 @@
#include "rtl837x_regs.h"
#include "rtl837x_common.h"
-#if defined(MACHINE_KP_9000_6XHML_X2) || defined(MACHINE_KP_9000_6XHML_X2_V1_2)
+#if defined(MACHINE_KP_9000_6XHML_X2) || \
+ defined(MACHINE_KP_9000_6XH_X2_V1_1) || \
+ defined(MACHINE_KP_9000_6XHML_X2_V1_1) || \
+ defined(MACHINE_KP_9000_6XH_X2_V1_2) || \
+ defined(MACHINE_KP_9000_6XHML_X2_V1_2)
__code const struct machine machine = {
-#if defined(MACHINE_KP_9000_6XHML_X2_V1_2)
+#if defined(MACHINE_KP_9000_6XH_X2_V1_1)
+ .machine_name = "keepLink KP-9000-6XH V1.1",
+#elif defined(MACHINE_KP_9000_6XHML_X2_V1_1)
+ .machine_name = "keepLink KP-9000-6XHML V1.1",
+#elif defined(MACHINE_KP_9000_6XH_X2_V1_2)
+ .machine_name = "keepLink KP-9000-6XH V1.2",
+#elif defined(MACHINE_KP_9000_6XHML_X2_V1_2)
.machine_name = "keepLink KP-9000-6XHML V1.2",
#else
.machine_name = "keepLink KP-9000-6XHML-X2",
diff --git a/machine.h b/machine.h
index 5ae75c9d..1da0458c 100644
--- a/machine.h
+++ b/machine.h
@@ -6,12 +6,19 @@
/*
* Select your machine type below
*/
+// Legacy KP-9000 4+2 targets. Prefer the PCB-revision-specific targets below.
// #define MACHINE_KP_9000_6XHML_X2
-// #define MACHINE_KP_9000_6XHML_X2_V1_2
-// #define MACHINE_KP_9000_6XHML_X2_V2_1
-// #define MACHINE_KP_9000_6XH_X
// #define MACHINE_KP_9000_6XH_X2
+
+// KP-9000 4+2 targets by PCB silkscreen revision.
+// #define MACHINE_KP_9000_6XH_X2_V1_1
+// #define MACHINE_KP_9000_6XHML_X2_V1_1
+// #define MACHINE_KP_9000_6XH_X2_V1_2
+// #define MACHINE_KP_9000_6XHML_X2_V1_2
// #define MACHINE_KP_9000_6XH_X2_V2_1
+// #define MACHINE_KP_9000_6XHML_X2_V2_1
+
+// #define MACHINE_KP_9000_6XH_X
// #define MACHINE_KP_9000_9XH_X_EU
// #define MACHINE_KP_9000_9XHML_X_V2_2
// #define MACHINE_KP_9000_9XHML_X_V3_1
From d405dd77765b3573ba2aea3d59e688d2fc0be3ee Mon Sep 17 00:00:00 2001
From: d00f <8052722+DrDoof@users.noreply.github.com>
Date: Sun, 16 Aug 2026 01:52:03 +0200
Subject: [PATCH 005/126] port: let a pvid name an aggregation group
VLAN membership, PVID, egress tagging, isolation and MTU are all per
physical port in this ASIC, so nothing stopped a member of a working
aggregation group being given a different PVID from its peers. The group
then forwards asymmetrically depending on which member the hash picks,
and no part of the firmware says a word about it.
port_lag_of() answers which group a port belongs to, reading the
membership through the shared reader rather than a fourth private copy.
port_pvid_set() expands to the whole group when the port it is given is
a member, and ports outside a group keep the path they had.
This is the second and third of the three steps set out in #347. I said
there that the lookup would come when something needed it, which had it
the wrong way round: nothing in the tree asks which group a port is in,
so the lookup only earns its place alongside a caller. PVID is the
smallest such caller, and the rest of the per port settings can follow
the same shape once this one is agreed.
Built for SWTGW218AS and KP_9000_6XHML_X2 on sdcc 4.5.0.
---
rtl837x_port.c | 27 +++++++++++++++++++++++++--
rtl837x_port.h | 2 ++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/rtl837x_port.c b/rtl837x_port.c
index 9388cc60..0a7cabf5 100644
--- a/rtl837x_port.c
+++ b/rtl837x_port.c
@@ -87,10 +87,9 @@ vlan_ingress_mode_t port_ingress_filter_get(__xdata uint8_t port) __banked
/*
* Define a Primary VLAN ID for a port
*/
-void port_pvid_set(uint8_t port, __xdata uint16_t pvid) __banked
+static void port_pvid_write(uint8_t port, __xdata uint16_t pvid)
{
// r4e1c:00001001 R4e1c-000017d0 r6738:00000000 R6738-00000000 (no filtering)
- print_string("\nport_pvid_set called \n");
uint16_t reg = RTL837x_PVID_BASE_REG + ((port >> 1) << 2);
reg_read_m(reg);
@@ -101,6 +100,22 @@ void port_pvid_set(uint8_t port, __xdata uint16_t pvid) __banked
}
}
+void port_pvid_set(uint8_t port, __xdata uint16_t pvid) __banked
+{
+ uint8_t lag = port_lag_of(port);
+
+ print_string("\nport_pvid_set called \n");
+ if (lag == PORT_LAG_NONE) {
+ port_pvid_write(port, pvid);
+ return;
+ }
+
+ uint16_t members = port_lag_members_get(lag);
+ for (uint8_t i = 0; i < 10; i++)
+ if ((members >> i) & 1)
+ port_pvid_write(i, pvid);
+}
+
uint16_t port_pvid_get(uint8_t port) __banked
{
uint16_t reg = RTL837x_PVID_BASE_REG + ((port >> 1) << 2);
@@ -745,6 +760,14 @@ uint16_t port_lag_members_get(uint8_t lag) __banked
return ((uint16_t)SFR_DATA_8 << 8) | SFR_DATA_0;
}
+uint8_t port_lag_of(uint8_t port) __banked
+{
+ for (uint8_t lag = 0; lag < 4; lag++)
+ if ((port_lag_members_get(lag) >> port) & 1)
+ return lag;
+ return PORT_LAG_NONE;
+}
+
/*
* Configure LAGs
diff --git a/rtl837x_port.h b/rtl837x_port.h
index b4598321..c0185a1d 100644
--- a/rtl837x_port.h
+++ b/rtl837x_port.h
@@ -62,6 +62,8 @@ void port_mirror_del(void) __banked;
bool port_ingress_filter(__xdata uint8_t port, __xdata vlan_ingress_mode_t type) __banked;
void port_l2_setup(void) __banked;
uint16_t port_lag_members_get(uint8_t lag) __banked;
+#define PORT_LAG_NONE 0xff
+uint8_t port_lag_of(uint8_t port) __banked;
void port_lag_members_set(__xdata uint8_t lag, __xdata uint16_t members) __banked;
void port_lag_hash_set(__xdata uint8_t lag, __xdata uint8_t hash) __banked;
void port_eee_enable_all(__xdata uint8_t speed) __banked;
From 8c3df643d0e0f3b161a539735b0a3b4b1da1ea20 Mon Sep 17 00:00:00 2001
From: bloqaudio
Date: Thu, 13 Aug 2026 17:18:04 -0500
Subject: [PATCH 006/126] ports: show the devices connected behind each port
Adds a Connected devices column to the Port Configuration table, fed by
the shared walkL2() helper. A port with a single MAC behind it shows the
MAC directly; several are shown as a count with the full list in the
cell tooltip, since picking one of many to display would suggest it was
"the" device. The walk restarts 15 seconds after each completion and
starts 3 seconds after page load to stay clear of the initial status and
MTU requests. A walk that ends without ok keeps the previous cells,
since an incomplete table would blank ports that have devices behind
them. Translations for the three languages included.
---
html/i18n.js | 6 ++++++
html/ports.html | 2 +-
html/ports.js | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/html/i18n.js b/html/i18n.js
index 850d9ac1..de874763 100644
--- a/html/i18n.js
+++ b/html/i18n.js
@@ -37,6 +37,8 @@ var LANG = {
port_col_speed: 'Current Link Speed',
port_col_set_speed: 'Set Speed',
port_col_disabled: 'Disabled',
+ port_col_devices: 'Connected devices',
+ port_devices: 'devices',
port_col_apply: 'Apply',
port_mtu_heading: 'Configure Maximum Frame Size (MTU) forwarded at Port',
port_auto: 'Auto',
@@ -224,6 +226,8 @@ var LANG = {
port_col_speed: '現在のリンク速度',
port_col_set_speed: '速度設定',
port_col_disabled: '無効',
+ port_col_devices: '接続デバイス',
+ port_devices: 'デバイス',
port_col_apply: '適用',
port_mtu_heading: 'ポートの最大フレームサイズ (MTU) 設定',
port_auto: '自動',
@@ -411,6 +415,8 @@ var LANG = {
port_col_speed: '当前链路速率',
port_col_set_speed: '设置速率',
port_col_disabled: '禁用',
+ port_col_devices: '已连接设备',
+ port_devices: '台设备',
port_col_apply: '应用',
port_mtu_heading: '配置端口转发的最大帧大小 (MTU)',
port_auto: '自动',
diff --git a/html/ports.html b/html/ports.html
index 8d9409f2..986921e5 100644
--- a/html/ports.html
+++ b/html/ports.html
@@ -12,7 +12,7 @@
Port Configuration