port: read a trunk's members through one function

The member mask of an aggregation group is decoded by hand in two places,
the lag command and the JSON behind the aggregation page, and every branch
that touches trunks adds another copy.

port_lag_members_get() sits next to port_lag_members_set() and both readers
call it. It answers from the hardware, so it covers a group configured with
lag and one a protocol brought up, without either having to say so.

It reads through reg_read() rather than reg_read_m(), so sfr_data is left
alone. Neither caller looked at it afterwards; both read the hash register
next.
This commit is contained in:
d00f
2026-08-15 20:55:56 +02:00
parent 787d593996
commit f2c6ac01d9
4 changed files with 16 additions and 4 deletions
+1 -2
View File
@@ -250,8 +250,7 @@ void parse_lag(void)
print_string("LAG status:\n");
for (uint8_t i = 0; i < 4; i++) {
write_char(' '); write_char('1' + i);
reg_read_m(RTL837X_TRK_MBR_CTRL_BASE + (i << 2));
members = ((uint16_t)sfr_data[2]) << 8 | sfr_data[3];
members = port_lag_members_get(i);
if (!members) {
print_string(" disabled\n");
continue;