Commit 056eed2f authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

dsa: Add TAG protocol to tag ops



In order that we can match the tagging protocol a switch driver
request to the tagger, we need to know what protocol the tagger
supports. Add this information to the ops structure.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>

v2
More tag protocol to end of structure to keep hot members at the beginning.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f18bba50
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ struct dsa_device_ops {
			    int *offset);
	unsigned int overhead;
	const char *name;
	enum dsa_tag_protocol proto;
};

#define DSA_TAG_DRIVER_ALIAS "dsa_tag-"
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ static struct sk_buff *dsa_slave_notag_xmit(struct sk_buff *skb,

static const struct dsa_device_ops none_ops = {
	.name	= "none",
	.proto	= DSA_TAG_PROTO_NONE,
	.xmit	= dsa_slave_notag_xmit,
	.rcv	= NULL,
};
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,

const struct dsa_device_ops brcm_netdev_ops = {
	.name	= "brcm",
	.proto	= DSA_TAG_PROTO_BRCM,
	.xmit	= brcm_tag_xmit,
	.rcv	= brcm_tag_rcv,
	.overhead = BRCM_TAG_LEN,
@@ -195,6 +196,7 @@ static struct sk_buff *brcm_tag_rcv_prepend(struct sk_buff *skb,

const struct dsa_device_ops brcm_prepend_netdev_ops = {
	.name	= "brcm-prepend",
	.proto	= DSA_TAG_PROTO_BRCM_PREPEND,
	.xmit	= brcm_tag_xmit_prepend,
	.rcv	= brcm_tag_rcv_prepend,
	.overhead = BRCM_TAG_LEN,
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ static int dsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,

const struct dsa_device_ops dsa_netdev_ops = {
	.name	= "dsa",
	.proto	= DSA_TAG_PROTO_DSA,
	.xmit	= dsa_xmit,
	.rcv	= dsa_rcv,
	.flow_dissect   = dsa_tag_flow_dissect,
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ static int edsa_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,

const struct dsa_device_ops edsa_netdev_ops = {
	.name	= "edsa",
	.proto	= DSA_TAG_PROTO_EDSA,
	.xmit	= edsa_xmit,
	.rcv	= edsa_rcv,
	.flow_dissect   = edsa_tag_flow_dissect,
Loading