From fd058ea74dfa2af470cba040305ca9bb1e1b5d5c Mon Sep 17 00:00:00 2001 From: bloqaudio Date: Fri, 18 Sep 2026 14:59:47 -0500 Subject: [PATCH] port: name the port an eee command acted on the way the user wrote it port_eee_enable() and port_eee_disable() report the port with print_byte(), which prints the internal index in hex, so turning EEE off on port 5 answers "EEE off for 04". port_eee_status() in the same file already uses print_phys_port(), and the status listing it produces counts from one, so the two halves of the same command disagreed. Use print_phys_port() in all three messages. --- rtl837x_port.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtl837x_port.c b/rtl837x_port.c index 8ee105c6..0383aae3 100644 --- a/rtl837x_port.c +++ b/rtl837x_port.c @@ -590,12 +590,12 @@ void port_eee_enable(__xdata uint8_t port,__xdata uint8_t speed) __banked if (machine.is_sfp[port]) { - print_string("EEE can't be enabled for SFP port "); print_byte(port); print_string("\n"); + print_string("EEE can't be enabled for SFP port "); print_phys_port(port); print_string("\n"); return; } REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), EEE_RX_ENABLE | EEE_TX_ENABLE); - print_string("EEE on for "); print_byte(port); print_string(" speed "); + print_string("EEE on for "); print_phys_port(port); print_string(" speed "); // Enable all speeds up to the specified speed if (speed & EEE_100) { print_string("100m\n"); @@ -654,7 +654,7 @@ void port_eee_disable(uint8_t port) __banked if (machine.is_sfp[port]) return; - print_string("EEE off for "); print_byte(port); write_char('\n'); + print_string("EEE off for "); print_phys_port(port); write_char('\n'); REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), 0); // Disable EEE advertisement for 100/1000BASE-T via EEE Advertisement Reg phy_write(port, PHY_MMD_AN, PHY_EEE_ADV, 0);