stp: stop forcing the SFP port to forwarding in the CPU-port mask

The "do not block the CPU port" mask 0x0f covers bits 3:0 of MSTP_STATES
byte 1, which is ports 8 AND 9 - so stp_setup unconditionally forced
port 8 (a real front port, the SFP uplink on SWTGW218AS) into forwarding
and it could never be blocked. The CPU port alone is bits 3:2 = 0x0c.
This commit is contained in:
d00f
2026-08-04 03:20:07 +02:00
parent 115aa8d3f6
commit 886975d856
+3 -3
View File
@@ -271,8 +271,8 @@ void stp_setup(void) __banked
port_hello[i] = TIME_HELLO; port_hello[i] = TIME_HELLO;
port_timers[i] = 0x280; // 10 s in blocking state (at the ~64 Hz stp_timers rate) port_timers[i] = 0x280; // 10 s in blocking state (at the ~64 Hz stp_timers rate)
} }
sfr_data[1] |= 0x0f; // Do not block CPU-Port sfr_data[1] |= 0x0c; // Do not block the CPU port (bits 3:2 of byte 1 = port 9)
reg_write_m(RTL837X_MSTP_STATES); // R5310-000d555f reg_write_m(RTL837X_MSTP_STATES);
print_reg(RTL837X_MSTP_STATES); write_char('\n'); print_reg(RTL837X_MSTP_STATES); write_char('\n');
@@ -294,7 +294,7 @@ void stp_off(void) __banked
uint8_t bit_mask = 0b11 << ( (i << 1) & 0x7); uint8_t bit_mask = 0b11 << ( (i << 1) & 0x7);
sfr_data[3 - (i >> 2)] |= bit_mask; sfr_data[3 - (i >> 2)] |= bit_mask;
} }
sfr_data[1] |= 0x0f; // Do not block CPU-Port sfr_data[1] |= 0x0c; // Do not block the CPU port (bits 3:2 of byte 1 = port 9)
reg_write_m(RTL837X_MSTP_STATES); reg_write_m(RTL837X_MSTP_STATES);
/* Restore BPDU transparency: flood them again like an unmanaged switch. */ /* Restore BPDU transparency: flood them again like an unmanaged switch. */