aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_8021q.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-07-19 20:14:49 +0300
committerDavid S. Miller <davem@davemloft.net>2021-07-20 06:36:42 -0700
commit5da11eb407340233a6111c563419e19685a062a4 (patch)
tree5d38aff912ff78029a00d98619452c0abcd34364 /net/dsa/tag_8021q.c
parentnet: dsa: let the core manage the tag_8021q context (diff)
downloadlinux-dev-5da11eb407340233a6111c563419e19685a062a4.tar.xz
linux-dev-5da11eb407340233a6111c563419e19685a062a4.zip
net: dsa: make tag_8021q operations part of the core
Make tag_8021q a more central element of DSA and move the 2 driver specific operations outside of struct dsa_8021q_context (which is supposed to hold dynamic data and not really constant function pointers). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_8021q.c')
-rw-r--r--net/dsa/tag_8021q.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c
index de46a551a486..4a11c5004783 100644
--- a/net/dsa/tag_8021q.c
+++ b/net/dsa/tag_8021q.c
@@ -116,13 +116,12 @@ EXPORT_SYMBOL_GPL(vid_is_dsa_8021q);
static int dsa_8021q_vid_apply(struct dsa_switch *ds, int port, u16 vid,
u16 flags, bool enabled)
{
- struct dsa_8021q_context *ctx = ds->tag_8021q_ctx;
struct dsa_port *dp = dsa_to_port(ds, port);
if (enabled)
- return ctx->ops->vlan_add(ctx->ds, dp->index, vid, flags);
+ return ds->ops->tag_8021q_vlan_add(ds, dp->index, vid, flags);
- return ctx->ops->vlan_del(ctx->ds, dp->index, vid);
+ return ds->ops->tag_8021q_vlan_del(ds, dp->index, vid);
}
/* RX VLAN tagging (left) and TX VLAN tagging (right) setup shown for a single
@@ -413,9 +412,7 @@ int dsa_8021q_crosschip_bridge_leave(struct dsa_switch *ds, int port,
}
EXPORT_SYMBOL_GPL(dsa_8021q_crosschip_bridge_leave);
-int dsa_tag_8021q_register(struct dsa_switch *ds,
- const struct dsa_8021q_ops *ops,
- __be16 proto)
+int dsa_tag_8021q_register(struct dsa_switch *ds, __be16 proto)
{
struct dsa_8021q_context *ctx;
@@ -423,7 +420,6 @@ int dsa_tag_8021q_register(struct dsa_switch *ds,
if (!ctx)
return -ENOMEM;
- ctx->ops = ops;
ctx->proto = proto;
ctx->ds = ds;