diff options
author | Marek BehĂșn <kabel@kernel.org> | 2021-03-17 14:46:43 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-17 14:44:19 -0700 |
commit | 6584b26020fc5bb586d6e9f621eb8a7343a6ed33 (patch) | |
tree | 97e37ec40185dc24012abbca06e960f48885fd5d /drivers/net/dsa/mv88e6xxx/port.h | |
parent | net: dsa: mv88e6xxx: add support for mv88e6393x family (diff) | |
download | linux-dev-6584b26020fc5bb586d6e9f621eb8a7343a6ed33.tar.xz linux-dev-6584b26020fc5bb586d6e9f621eb8a7343a6ed33.zip |
net: dsa: mv88e6xxx: implement .port_set_policy for Amethyst
The 16-bit Port Policy CTL register from older chips is on 6393x changed
to Port Policy MGMT CTL, which can access more data, but indirectly and
via 8-bit registers.
The original 16-bit value is divided into first two 8-bit register in
the Port Policy MGMT CTL.
We can therefore use the previous code to compute the mask and shift,
and then
- if 0 <= shift < 8, we access register 0 in Port Policy MGMT CTL
- if 8 <= shift < 16, we access register 1 in Port Policy MGMT CTL
There are in fact other possible policy settings for Amethyst which
could be added here, but this can be done in the future.
Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Pavana Sharma <pavana.sharma@digi.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/port.h')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/port.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h index 948ba577a159..921d54969dad 100644 --- a/drivers/net/dsa/mv88e6xxx/port.h +++ b/drivers/net/dsa/mv88e6xxx/port.h @@ -386,6 +386,9 @@ int mv88e6352_port_set_mcast_flood(struct mv88e6xxx_chip *chip, int port, int mv88e6352_port_set_policy(struct mv88e6xxx_chip *chip, int port, enum mv88e6xxx_policy_mapping mapping, enum mv88e6xxx_policy_action action); +int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port, + enum mv88e6xxx_policy_mapping mapping, + enum mv88e6xxx_policy_action action); int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port, u16 etype); int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip, |