mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
net: dsa: microchip: ksz8795: Don't use phy_port_cnt in VLAN table lookup
The magic number 4 in VLAN table lookup was the number of entries we
can read and write at once. Using phy_port_cnt here doesn't make
sense and presumably broke VLAN filtering for 3-port switches. Change
it back to 4.
Fixes: 4ce2a984ab
("net: dsa: microchip: ksz8795: use phy_port_cnt ...")
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
164844135a
commit
411d466d94
1 changed files with 4 additions and 4 deletions
|
@ -687,8 +687,8 @@ static void ksz8_r_vlan_entries(struct ksz_device *dev, u16 addr)
|
||||||
shifts = ksz8->shifts;
|
shifts = ksz8->shifts;
|
||||||
|
|
||||||
ksz8_r_table(dev, TABLE_VLAN, addr, &data);
|
ksz8_r_table(dev, TABLE_VLAN, addr, &data);
|
||||||
addr *= dev->phy_port_cnt;
|
addr *= 4;
|
||||||
for (i = 0; i < dev->phy_port_cnt; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
dev->vlan_cache[addr + i].table[0] = (u16)data;
|
dev->vlan_cache[addr + i].table[0] = (u16)data;
|
||||||
data >>= shifts[VLAN_TABLE];
|
data >>= shifts[VLAN_TABLE];
|
||||||
}
|
}
|
||||||
|
@ -702,7 +702,7 @@ static void ksz8_r_vlan_table(struct ksz_device *dev, u16 vid, u16 *vlan)
|
||||||
u64 buf;
|
u64 buf;
|
||||||
|
|
||||||
data = (u16 *)&buf;
|
data = (u16 *)&buf;
|
||||||
addr = vid / dev->phy_port_cnt;
|
addr = vid / 4;
|
||||||
index = vid & 3;
|
index = vid & 3;
|
||||||
ksz8_r_table(dev, TABLE_VLAN, addr, &buf);
|
ksz8_r_table(dev, TABLE_VLAN, addr, &buf);
|
||||||
*vlan = data[index];
|
*vlan = data[index];
|
||||||
|
@ -716,7 +716,7 @@ static void ksz8_w_vlan_table(struct ksz_device *dev, u16 vid, u16 vlan)
|
||||||
u64 buf;
|
u64 buf;
|
||||||
|
|
||||||
data = (u16 *)&buf;
|
data = (u16 *)&buf;
|
||||||
addr = vid / dev->phy_port_cnt;
|
addr = vid / 4;
|
||||||
index = vid & 3;
|
index = vid & 3;
|
||||||
ksz8_r_table(dev, TABLE_VLAN, addr, &buf);
|
ksz8_r_table(dev, TABLE_VLAN, addr, &buf);
|
||||||
data[index] = vlan;
|
data[index] = vlan;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue