Fixed shift arithmetic bug reported by airjinkela

This commit is contained in:
logicog
2025-07-21 21:59:20 +02:00
parent fa4a80c291
commit 6be1124ecf
+1 -1
View File
@@ -94,7 +94,7 @@ void vlan_create(register uint16_t vlan, register uint16_t members, register uin
uint16_t a = members ^ tagged; uint16_t a = members ^ tagged;
// Initialize VLAN table with VLAN 1 // Initialize VLAN table with VLAN 1
REG_WRITE(RTL837x_TBL_DATA_IN_A, 0x02, (a >> 8) & 0x0f, (a << 2) | (tagged >> 8), tagged); REG_WRITE(RTL837x_TBL_DATA_IN_A, 0x02, (a >> 6) & 0x0f, (a << 2) | (tagged >> 8), tagged);
REG_WRITE(RTL837X_TBL_CTRL, vlan >> 8, vlan, TBL_VLAN, TBL_WRITE | TBL_EXECUTE); REG_WRITE(RTL837X_TBL_CTRL, vlan >> 8, vlan, TBL_VLAN, TBL_WRITE | TBL_EXECUTE);
do { do {
reg_read_m(RTL837X_TBL_CTRL); reg_read_m(RTL837X_TBL_CTRL);