diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-10-20 20:58:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-21 12:14:29 +0100 |
commit | 62a22bcbd30ed01a0f0331288aa0cca9d9aae23b (patch) | |
tree | 2cdc63aaf532b2e2c38665764d54e56a30fa16ff /drivers | |
parent | fq_codel: generalise ce_threshold marking for subset of traffic (diff) | |
download | linux-dev-62a22bcbd30ed01a0f0331288aa0cca9d9aae23b.tar.xz linux-dev-62a22bcbd30ed01a0f0331288aa0cca9d9aae23b.zip |
net: mscc: ocelot: add a type definition for REW_TAG_CFG_TAG_CFG
This is a cosmetic patch which clarifies what are the port tagging
options for Ocelot switches.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 520a75b57866..b09929970273 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -166,7 +166,7 @@ static void ocelot_port_set_native_vlan(struct ocelot *ocelot, int port, struct ocelot_vlan native_vlan) { struct ocelot_port *ocelot_port = ocelot->ports[port]; - u32 val = 0; + enum ocelot_port_tag_config tag_cfg; ocelot_port->native_vlan = native_vlan; @@ -176,16 +176,13 @@ static void ocelot_port_set_native_vlan(struct ocelot *ocelot, int port, if (ocelot_port->vlan_aware) { if (native_vlan.valid) - /* Tag all frames except when VID == DEFAULT_VLAN */ - val = REW_TAG_CFG_TAG_CFG(1); + tag_cfg = OCELOT_PORT_TAG_NATIVE; else - /* Tag all frames */ - val = REW_TAG_CFG_TAG_CFG(3); + tag_cfg = OCELOT_PORT_TAG_TRUNK; } else { - /* Port tagging disabled. */ - val = REW_TAG_CFG_TAG_CFG(0); + tag_cfg = OCELOT_PORT_TAG_DISABLED; } - ocelot_rmw_gix(ocelot, val, + ocelot_rmw_gix(ocelot, REW_TAG_CFG_TAG_CFG(tag_cfg), REW_TAG_CFG_TAG_CFG_M, REW_TAG_CFG, port); } |