OSDN Git Service

net: dsa: mv88e6xxx: fix port egress flooding mode
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Sat, 11 Mar 2017 21:13:00 +0000 (16:13 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Mar 2017 06:54:07 +0000 (23:54 -0700)
commit601aeed371a36e6675f3c7f7f6cf8bc181f1f276
tree4f53e66efd4e74c3d7a122bca9a8e334cc8c9c60
parent4314557c6505a14043717de01036dc0e3a357010
net: dsa: mv88e6xxx: fix port egress flooding mode

The Marvell switch ports can be configured to allow or prevent egress of
frames with an unknown unicast or multicast destination address.

Some switch chips such as 88E6095 and 88E6185 have two disjoint bits in
Port Control Register (0x04) bit 2 "Forward Unknown" (for unicast) and
Port Control 2 Register (0x08) bit 6 "Default Forward" (for multicast).

Other chips such as 88E608588E612388E6352, and 88E6390 have a 2-bit
value in Port Control Register (0x04) bits 3:2 "EgressFloods".

The current code does not fully implement the disjoint bits variant and
assigns incorrect ones to some chip models. Fix that with two
implementation references (6185 and 6352 that I currently have) of a
port_set_egress_floods operation (as named in datasheets).

Old chips such as 88E6060 don't have egress flooding mode, so don't
error out if the operation is not provided.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
drivers/net/dsa/mv88e6xxx/port.c
drivers/net/dsa/mv88e6xxx/port.h