From b41452026f6346461dae981408d825ec0574eb28 Mon Sep 17 00:00:00 2001 From: logicog Date: Sun, 14 Dec 2025 12:17:53 +0100 Subject: [PATCH] Make sure port is not called for an SFP module --- cmd_parser.c | 4 ++++ rtl837x_phy.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd_parser.c b/cmd_parser.c index 4d1e350..f59c427 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -415,6 +415,10 @@ void parse_port(void) uint8_t p = cmd_buffer[cmd_words_b[1]] - '1'; p = machine.phys_to_log_port[p]; print_byte(p); + if (machine.is_sfp[p]) { + print_string(" is SFP no PHY information available.\n"); + return; + } if (cmd_words_b[2] > 0 && cmd_compare(2, "10m")) { print_string(" 10M\n"); phy_set_speed(p, PHY_SPEED_10M); diff --git a/rtl837x_phy.c b/rtl837x_phy.c index a387ce1..a535a06 100644 --- a/rtl837x_phy.c +++ b/rtl837x_phy.c @@ -290,7 +290,6 @@ void phy_show(uint8_t port) __banked print_string("\nForced speed: "); print_short(v); write_char('\n'); uint8_t s1 = ((v & 0x40) ? 0x2 : 0x0) | ((v & 0x2000) ? 0x1 : 0x0); uint8_t s2 = (v >> 2) & 0xf; - print_string("s1, s2: "); print_byte(s1); write_char(' '); print_byte(s2); write_char('\n'); switch(s1) { case 0: print_string("10M\n");