aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-09-12 00:18:09 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-13 17:04:35 -0400
commitac7a04c33dd7f8e429df4b929ba3a3e8e729cc89 (patch)
tree5b1e76c258c08ef39fdcf5e469a05e0322ffb228 /net/dsa
parentc55542983e572bcac813fd9a393e725e158074be (diff)
net: dsa: change tag_protocol to an enum
Now that we introduced an additional multiplexing/demultiplexing layer with commit 3e8a72d1dae37 ("net: dsa: reduce number of protocol hooks") that lives within the DSA code, we no longer need to have a given switch driver tag_protocol be an actual ethertype value, instead, we can replace it with an enum: dsa_tag_protocol. Do this replacement in the drivers, which allows us to get rid of the cpu_to_be16()/htons() dance, and remove ETH_P_BRCMTAG since we do not need it anymore. Suggested-by: Alexander Duyck <alexander.duyck@gmail.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c8
-rw-r--r--net/dsa/tag_brcm.c1
2 files changed, 4 insertions, 5 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 7333a4aebb7d..809eeb13eb12 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -437,22 +437,22 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
437 437
438 switch (ds->dst->tag_protocol) { 438 switch (ds->dst->tag_protocol) {
439#ifdef CONFIG_NET_DSA_TAG_DSA 439#ifdef CONFIG_NET_DSA_TAG_DSA
440 case htons(ETH_P_DSA): 440 case DSA_TAG_PROTO_DSA:
441 ds->dst->ops = &dsa_netdev_ops; 441 ds->dst->ops = &dsa_netdev_ops;
442 break; 442 break;
443#endif 443#endif
444#ifdef CONFIG_NET_DSA_TAG_EDSA 444#ifdef CONFIG_NET_DSA_TAG_EDSA
445 case htons(ETH_P_EDSA): 445 case DSA_TAG_PROTO_EDSA:
446 ds->dst->ops = &edsa_netdev_ops; 446 ds->dst->ops = &edsa_netdev_ops;
447 break; 447 break;
448#endif 448#endif
449#ifdef CONFIG_NET_DSA_TAG_TRAILER 449#ifdef CONFIG_NET_DSA_TAG_TRAILER
450 case htons(ETH_P_TRAILER): 450 case DSA_TAG_PROTO_TRAILER:
451 ds->dst->ops = &trailer_netdev_ops; 451 ds->dst->ops = &trailer_netdev_ops;
452 break; 452 break;
453#endif 453#endif
454#ifdef CONFIG_NET_DSA_TAG_BRCM 454#ifdef CONFIG_NET_DSA_TAG_BRCM
455 case htons(ETH_P_BRCMTAG): 455 case DSA_TAG_PROTO_BRCM:
456 ds->dst->ops = &brcm_netdev_ops; 456 ds->dst->ops = &brcm_netdev_ops;
457 break; 457 break;
458#endif 458#endif
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index e0b759ec209e..8fbc21c0de78 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -91,7 +91,6 @@ static netdev_tx_t brcm_tag_xmit(struct sk_buff *skb, struct net_device *dev)
91 /* Queue the SKB for transmission on the parent interface, but 91 /* Queue the SKB for transmission on the parent interface, but
92 * do not modify its EtherType 92 * do not modify its EtherType
93 */ 93 */
94 skb->protocol = htons(ETH_P_BRCMTAG);
95 skb->dev = p->parent->dst->master_netdev; 94 skb->dev = p->parent->dst->master_netdev;
96 dev_queue_xmit(skb); 95 dev_queue_xmit(skb);
97 96