Merge tag 'gfs2-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux...
[sfrench/cifs-2.6.git] / include / net / dsa.h
index d628587e0bdec5dfea835293dae5749d655c4282..6aaaadd6a413c9bf1d8600325d171fb69006d3be 100644 (file)
@@ -43,6 +43,7 @@ struct phylink_link_state;
 #define DSA_TAG_PROTO_QCA_VALUE                        10
 #define DSA_TAG_PROTO_TRAILER_VALUE            11
 #define DSA_TAG_PROTO_8021Q_VALUE              12
+#define DSA_TAG_PROTO_SJA1105_VALUE            13
 
 enum dsa_tag_protocol {
        DSA_TAG_PROTO_NONE              = DSA_TAG_PROTO_NONE_VALUE,
@@ -58,6 +59,7 @@ enum dsa_tag_protocol {
        DSA_TAG_PROTO_QCA               = DSA_TAG_PROTO_QCA_VALUE,
        DSA_TAG_PROTO_TRAILER           = DSA_TAG_PROTO_TRAILER_VALUE,
        DSA_TAG_PROTO_8021Q             = DSA_TAG_PROTO_8021Q_VALUE,
+       DSA_TAG_PROTO_SJA1105           = DSA_TAG_PROTO_SJA1105_VALUE,
 };
 
 struct packet_type;
@@ -85,6 +87,7 @@ struct dsa_device_ops {
 
 struct dsa_skb_cb {
        struct sk_buff *clone;
+       bool deferred_xmit;
 };
 
 struct __dsa_skb_cb {
@@ -205,6 +208,16 @@ struct dsa_port {
        struct net_device       *bridge_dev;
        struct devlink_port     devlink_port;
        struct phylink          *pl;
+
+       struct work_struct      xmit_work;
+       struct sk_buff_head     xmit_queue;
+
+       /*
+        * Give the switch driver somewhere to hang its per-port private data
+        * structures (accessible from the tagger).
+        */
+       void *priv;
+
        /*
         * Original copy of the master netdev ethtool_ops
         */
@@ -539,6 +552,12 @@ struct dsa_switch_ops {
                                 struct sk_buff *clone, unsigned int type);
        bool    (*port_rxtstamp)(struct dsa_switch *ds, int port,
                                 struct sk_buff *skb, unsigned int type);
+
+       /*
+        * Deferred frame Tx
+        */
+       netdev_tx_t (*port_deferred_xmit)(struct dsa_switch *ds, int port,
+                                         struct sk_buff *skb);
 };
 
 struct dsa_switch_driver {
@@ -634,6 +653,7 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
 #define BRCM_TAG_GET_QUEUE(v)          ((v) & 0xff)
 
 
+netdev_tx_t dsa_enqueue_skb(struct sk_buff *skb, struct net_device *dev);
 int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data);
 int dsa_port_get_ethtool_phy_stats(struct dsa_port *dp, uint64_t *data);
 int dsa_port_get_phy_sset_count(struct dsa_port *dp);