diff --git a/cmd_parser.c b/cmd_parser.c index 3a8ae3e..21137a5 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -48,6 +48,7 @@ __xdata uint8_t hexvalue[4] = { 0 }; // Buffer for writing to flash 0x1fd000, copy to 0x1fe000 __xdata uint8_t cmd_buffer[SBUF_SIZE]; +__xdata uint8_t cmd_available; __xdata uint8_t l; __xdata uint8_t line_ptr; @@ -469,9 +470,16 @@ void cmd_parser(void) __banked print_string("Parsing command\n"); print_string_x(&cmd_buffer[0]); write_char('<'); write_char('\n'); + print_string("CMD-words: "); + print_byte(cmd_words_b[0]); write_char(' '); + print_byte(cmd_words_b[1]); write_char(' '); + print_byte(cmd_words_b[2]); write_char(' '); + print_byte(cmd_words_b[3]); write_char(' '); + print_byte(cmd_words_b[4]); write_char(' '); + print_byte(cmd_words_b[5]); write_char(' '); + print_byte(cmd_words_b[6]); write_char('\n'); #endif - signed char i = cmd_words_b[0]; - if (i >= 0 && cmd_words_b[1] >= 0) { + if (cmd_words_b[0] >= 0 && cmd_words_b[1] >= 0) { if (cmd_compare(0, "reset")) { print_string("\nRESET\n\n"); reset_chip(); @@ -636,23 +644,26 @@ void cmd_parser(void) __banked } if (cmd_compare(0, "eee")) { int8_t port = -1; - if (cmd_words_b[2] > 0) { + if (cmd_words_b[3] > 0) { port = cmd_buffer[cmd_words_b[2]] - '1'; if (!isRTL8373) port = phys_to_log_port[port]; } if (cmd_words_b[1] > 0 && cmd_compare(1, "on")) { - print_string("EEE enabled\n"); if (port >= 0) port_eee_enable(port); else port_eee_enable_all(); } else if (cmd_words_b[1] > 0 && cmd_compare(1, "off")) { - print_string("EEE disabled\n"); if (port >= 0) port_eee_disable(port); else port_eee_disable_all(); + } else if (cmd_words_b[1] > 0 && cmd_compare(1, "status")) { + if (port >= 0) + port_eee_status(port); + else + port_eee_status_all(); } } } diff --git a/cmd_parser.h b/cmd_parser.h index b19e186..2314eab 100644 --- a/cmd_parser.h +++ b/cmd_parser.h @@ -6,6 +6,7 @@ #include "rtl837x_common.h" extern __xdata uint8_t cmd_buffer[SBUF_SIZE]; +extern __xdata uint8_t cmd_available; uint8_t cmd_tokenize(void) __banked; void cmd_parser(void) __banked; diff --git a/html/eee.html b/html/eee.html new file mode 100644 index 0000000..5e2eb5e --- /dev/null +++ b/html/eee.html @@ -0,0 +1,26 @@ + + + + + +
| Advertising | Link-Partner advertises | ||||||
|---|---|---|---|---|---|---|---|
| Port | 2.5G | 1G | 100M | 2.5G | 1G | 100M | Active? |