Merge branch 'ipv6_stable_privacy_address'
[firefly-linux-kernel-4.4.55.git] / include / net / dsa.h
index ed3c34bbb67ab89f1570acf3daf3d93aaf06a34c..47917e5e1e12ab8d9a69d71b21287ebbc3a87172 100644 (file)
@@ -72,6 +72,7 @@ struct dsa_platform_data {
         * to the root switch chip of the tree.
         */
        struct device   *netdev;
+       struct net_device *of_netdev;
 
        /*
         * Info structs describing each of the switch chips
@@ -127,6 +128,11 @@ struct dsa_switch {
        struct dsa_switch_tree  *dst;
        int                     index;
 
+       /*
+        * Tagging protocol understood by this switch
+        */
+       enum dsa_tag_protocol   tag_protocol;
+
        /*
         * Configuration data for this switch.
         */
@@ -165,6 +171,11 @@ static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
        return !!(ds->index == ds->dst->cpu_switch && p == ds->dst->cpu_port);
 }
 
+static inline bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
+{
+       return ds->phys_port_mask & (1 << p) && ds->ports[p];
+}
+
 static inline u8 dsa_upstream_port(struct dsa_switch *ds)
 {
        struct dsa_switch_tree *dst = ds->dst;
@@ -275,6 +286,16 @@ struct dsa_switch_driver {
        int     (*get_regs_len)(struct dsa_switch *ds, int port);
        void    (*get_regs)(struct dsa_switch *ds, int port,
                            struct ethtool_regs *regs, void *p);
+
+       /*
+        * Bridge integration
+        */
+       int     (*port_join_bridge)(struct dsa_switch *ds, int port,
+                                   u32 br_port_mask);
+       int     (*port_leave_bridge)(struct dsa_switch *ds, int port,
+                                    u32 br_port_mask);
+       int     (*port_stp_update)(struct dsa_switch *ds, int port,
+                                  u8 state);
 };
 
 void register_switch_driver(struct dsa_switch_driver *type);