diff --git a/cmd_parser.c b/cmd_parser.c index bd2fc544..4fc2b0cf 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -395,7 +395,7 @@ void parse_lag(void) return; } - if (cmd_words_len < 2) + if (cmd_words_len < 3) goto err; // Parse group, expect only one number 0-9; @@ -406,10 +406,13 @@ void parse_lag(void) if (group > 3) goto err; + if (cmd_compare(2, "d")) { + port_lag_members_set(group, 0); + return; + } + uint8_t w = 2; while (w < cmd_words_len) { -// write_char('|'); print_byte(w); write_char(':'); write_char(cmd_buffer[cmd_words_b[w]]); write_char('-'); - // Parse port. if (cmd_parse_port_separator(cmd_words_b[w++]) == 0) goto err; @@ -419,7 +422,7 @@ void parse_lag(void) port_lag_members_set(group, members); return; err: - print_string("Error: lag <1-4> [port]...\n"); + print_string("Error: lag (show | <1-4> (d | ...))\n"); } diff --git a/doc/link_aggregation.md b/doc/link_aggregation.md index 6bde787e..b725e419 100644 --- a/doc/link_aggregation.md +++ b/doc/link_aggregation.md @@ -48,9 +48,11 @@ void port_lag_hash_set(__xdata uint8_t lag, __xdata uint8_t hash_bits) __banked; ## LAG configuration on the Serial Console For testing the following commands are provided on the serial console: ``` -> lag [p1] [p2]... - Create or set a LAG. Trunk-ID is 1 or 2. Ports are physical ports - If only the LAG-ID is given but no members, the LAG is deleted +> lag [p2]... + Create or set a LAG. LAG-ID is 1 to 4. Ports are physical ports. + +> lag d + Delete the LAG. > lag show Shows information on all 4 lags diff --git a/html/lag.js b/html/lag.js index 2c56d1a5..2a4e4f26 100644 --- a/html/lag.js +++ b/html/lag.js @@ -57,7 +57,7 @@ function fetchLag() { sendXHTTP(xhttp); } async function lagSub(l) { - var cmd = "lag " + l; + var cmd = "lag " + (l + 1); for (let i = 1; i <= numPorts; i++) { if (document.getElementById("p_mLAG"+l+"_"+i).checked) cmd = cmd + ` ${i}`;