net: dsa: add MDB support
[linux-2.6-microblaze.git] / include / net / dsa.h
index d00c392..e3eb230 100644 (file)
@@ -165,9 +165,9 @@ struct dsa_switch {
        struct dsa_chip_data    *cd;
 
        /*
-        * The used switch driver.
+        * The switch operations.
         */
-       struct dsa_switch_driver        *drv;
+       struct dsa_switch_ops   *ops;
 
        /*
         * An array of which element [a] indicates which port on this
@@ -234,19 +234,21 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
 struct switchdev_trans;
 struct switchdev_obj;
 struct switchdev_obj_port_fdb;
+struct switchdev_obj_port_mdb;
 struct switchdev_obj_port_vlan;
 
-struct dsa_switch_driver {
+struct dsa_switch_ops {
        struct list_head        list;
 
-       enum dsa_tag_protocol   tag_protocol;
-
        /*
         * Probing and setup.
         */
        const char      *(*probe)(struct device *dsa_dev,
                                  struct device *host_dev, int sw_addr,
                                  void **priv);
+
+       enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds);
+
        int     (*setup)(struct dsa_switch *ds);
        int     (*set_addr)(struct dsa_switch *ds, u8 *addr);
        u32     (*get_phy_flags)(struct dsa_switch *ds, int port);
@@ -368,10 +370,25 @@ struct dsa_switch_driver {
        int     (*port_fdb_dump)(struct dsa_switch *ds, int port,
                                 struct switchdev_obj_port_fdb *fdb,
                                 int (*cb)(struct switchdev_obj *obj));
+
+       /*
+        * Multicast database
+        */
+       int     (*port_mdb_prepare)(struct dsa_switch *ds, int port,
+                                   const struct switchdev_obj_port_mdb *mdb,
+                                   struct switchdev_trans *trans);
+       void    (*port_mdb_add)(struct dsa_switch *ds, int port,
+                               const struct switchdev_obj_port_mdb *mdb,
+                               struct switchdev_trans *trans);
+       int     (*port_mdb_del)(struct dsa_switch *ds, int port,
+                               const struct switchdev_obj_port_mdb *mdb);
+       int     (*port_mdb_dump)(struct dsa_switch *ds, int port,
+                                struct switchdev_obj_port_mdb *mdb,
+                                int (*cb)(struct switchdev_obj *obj));
 };
 
-void register_switch_driver(struct dsa_switch_driver *type);
-void unregister_switch_driver(struct dsa_switch_driver *type);
+void register_switch_driver(struct dsa_switch_ops *type);
+void unregister_switch_driver(struct dsa_switch_ops *type);
 struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
 
 static inline void *ds_to_priv(struct dsa_switch *ds)