mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Add STP control commands
Adds stp on stp off control commands.
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
#include "rtl837x_phy.h"
|
#include "rtl837x_phy.h"
|
||||||
#include "rtl837x_regs.h"
|
#include "rtl837x_regs.h"
|
||||||
#include "rtl837x_sfr.h"
|
#include "rtl837x_sfr.h"
|
||||||
|
#include "rtl837x_stp.h"
|
||||||
#include "uip/uip.h"
|
#include "uip/uip.h"
|
||||||
|
|
||||||
#pragma codeseg BANK1
|
#pragma codeseg BANK1
|
||||||
@@ -23,6 +24,7 @@ extern __xdata uint8_t maxPort;
|
|||||||
extern __xdata uint8_t nSFPPorts;
|
extern __xdata uint8_t nSFPPorts;
|
||||||
extern __xdata uint8_t isRTL8373;
|
extern __xdata uint8_t isRTL8373;
|
||||||
extern __xdata uint16_t mpos;
|
extern __xdata uint16_t mpos;
|
||||||
|
extern __xdata uint8_t stpEnabled;
|
||||||
|
|
||||||
extern volatile __xdata uint32_t ticks;
|
extern volatile __xdata uint32_t ticks;
|
||||||
extern volatile __xdata uint8_t sfr_data[4];
|
extern volatile __xdata uint8_t sfr_data[4];
|
||||||
@@ -574,6 +576,17 @@ void cmd_parser(void) __banked
|
|||||||
else
|
else
|
||||||
port_l2_learned();
|
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) {
|
if (cmd_compare(0, "pvid") && cmd_words_b[1] > 0 && cmd_words_b[2] > 0) {
|
||||||
__xdata uint16_t pvid;
|
__xdata uint16_t pvid;
|
||||||
uint8_t port;
|
uint8_t port;
|
||||||
|
|||||||
Reference in New Issue
Block a user