From 95d7901d006df50b007b4af7c25ea1bda06c284e Mon Sep 17 00:00:00 2001 From: logicog Date: Mon, 8 Sep 2025 08:22:15 +0200 Subject: [PATCH] Add STP control commands Adds stp on stp off control commands. --- cmd_parser.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd_parser.c b/cmd_parser.c index f976fe2..86fa251 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -14,6 +14,7 @@ #include "rtl837x_phy.h" #include "rtl837x_regs.h" #include "rtl837x_sfr.h" +#include "rtl837x_stp.h" #include "uip/uip.h" #pragma codeseg BANK1 @@ -23,6 +24,7 @@ extern __xdata uint8_t maxPort; extern __xdata uint8_t nSFPPorts; extern __xdata uint8_t isRTL8373; extern __xdata uint16_t mpos; +extern __xdata uint8_t stpEnabled; extern volatile __xdata uint32_t ticks; extern volatile __xdata uint8_t sfr_data[4]; @@ -574,6 +576,17 @@ void cmd_parser(void) __banked else port_l2_learned(); } + if (cmd_compare(0, "stp")) { + if (cmd_words_b[1] > 0 && cmd_compare(1, "on")) { + print_string("STP enabled\n"); + stpEnabled = 1; + stp_setup(); + } else { + print_string("STP disabled\n"); + stp_off(); + stpEnabled = 0; + } + } if (cmd_compare(0, "pvid") && cmd_words_b[1] > 0 && cmd_words_b[2] > 0) { __xdata uint16_t pvid; uint8_t port;