Merge upstream/main into the Spanning Tree branch

cmd_parser.c conflicted twice: main rewrote the pvid command around the
new port-separator and atoi helpers, next to the line where this branch
delegates "stp" to stp_parse(). Both belong, so the STP delegation keeps
main's pvid body.

The linker caught what the merge could not see: main changed atoi_byte()
to return the digit count and leave the value in atoi_results_u8, where
it used to return non-zero on failure and write through a pointer. Note
the sense is inverted, so the three calls in rtl837x_stp.c are adjusted
rather than just re-arranged.
This commit is contained in:
d00f
2026-08-26 16:29:39 +02:00
11 changed files with 477 additions and 359 deletions
+3 -16
View File
@@ -404,10 +404,7 @@ void port_l2_learned(void) __banked
print_string("\tlearned\t");
port |= (sfr_data[3] & 0x3) << 2;
if (port < 9)
write_char(machine.log_to_phys_port[port] + '0');
else
print_string("CPU");
print_phys_port(port);
}
entry++;
@@ -466,7 +463,7 @@ void port_stats_print(void) __banked
{
print_string("\nPort\tState\tLink\tTxGood\t\tTxBad\t\tRxGood\t\tRxBad\n");
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) {
write_char('0' + machine.log_to_phys_port[i]); write_char('\t');
print_phys_port(i); write_char('\t');
if (!machine.is_sfp[i]) {
phy_read(i, PHY_MMD31, 0xa610);
@@ -641,7 +638,7 @@ void port_eee_disable(uint8_t port) __banked
void port_eee_status(uint8_t port) __banked
{
print_string("Port: "); write_char('0' + machine.log_to_phys_port[port]);
print_string("Port: "); print_phys_port(port);
print_string(": ");
if (machine.is_sfp[port]) {
print_string("SFP\n");
@@ -836,16 +833,6 @@ void print_port_ingress_filter_mode(vlan_ingress_mode_t mode) __banked
}
}
static void print_phys_port(uint8_t port) __banked
{
if (port >= machine.min_port && port <= machine.max_port)
write_char(machine.log_to_phys_port[port] + '0');
else if (port == 9)
write_char('9');
else
write_char('?');
}
void print_vlan_ingress_port(uint8_t log_port) __banked
{
print_phys_port(log_port);write_char('\t');