summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-06-04 21:17:03 +0200
committerDavid S. Miller <davem@davemloft.net>2016-06-04 14:29:54 -0700
commit39a7f2a4eb496c0c68cc93fcb403190b48605168 (patch)
tree4c9edb3b66b95a2a6215e2844c131ac618424b8b /include/net/dsa.h
parent5377b802fc9fde9442dcaba571edefcb73765056 (diff)
downloadtalos-obmc-linux-39a7f2a4eb496c0c68cc93fcb403190b48605168.tar.gz
talos-obmc-linux-39a7f2a4eb496c0c68cc93fcb403190b48605168.zip
net: dsa: Refactor selection of tag ops into a function
Replace the two switch statements with an array lookup, and store the result in the dsa tree structure. The drivers no longer need to know the selected tag protocol, so remove it from the dsa switch structure. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index b666f27b3daa..bd6ecaa0de96 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -26,6 +26,7 @@ enum dsa_tag_protocol {
DSA_TAG_PROTO_TRAILER,
DSA_TAG_PROTO_EDSA,
DSA_TAG_PROTO_BRCM,
+ DSA_TAG_LAST, /* MUST BE LAST */
};
#define DSA_MAX_SWITCHES 4
@@ -99,7 +100,6 @@ struct dsa_switch_tree {
struct net_device *dev,
struct packet_type *pt,
struct net_device *orig_dev);
- enum dsa_tag_protocol tag_protocol;
/*
* Original copy of the master netdev ethtool_ops
@@ -116,6 +116,12 @@ struct dsa_switch_tree {
* Data for the individual switch chips.
*/
struct dsa_switch *ds[DSA_MAX_SWITCHES];
+
+ /*
+ * Tagging protocol operations for adding and removing an
+ * encapsulation tag.
+ */
+ const struct dsa_device_ops *tag_ops;
};
struct dsa_port {
OpenPOWER on IntegriCloud