]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/net/dsa.h
Merge branch 'hpfs' (patches from Mikulas)
[karo-tx-linux.git] / include / net / dsa.h
index fbca63ba8f733fd37fa300bbbe33a300ab05fd49..b34d812bc5d056d47b7d39181668572cde4f53ca 100644 (file)
@@ -171,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_dsa_port(struct dsa_switch *ds, int p)
+{
+       return !!((ds->dsa_port_mask) & (1 << p));
+}
+
 static inline bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
 {
        return ds->phys_port_mask & (1 << p) && ds->ports[p];
@@ -296,12 +301,28 @@ struct dsa_switch_driver {
                                     u32 br_port_mask);
        int     (*port_stp_update)(struct dsa_switch *ds, int port,
                                   u8 state);
-       int     (*fdb_add)(struct dsa_switch *ds, int port,
-                          const unsigned char *addr, u16 vid);
-       int     (*fdb_del)(struct dsa_switch *ds, int port,
-                          const unsigned char *addr, u16 vid);
-       int     (*fdb_getnext)(struct dsa_switch *ds, int port,
-                              unsigned char *addr, bool *is_static);
+
+       /*
+        * VLAN support
+        */
+       int     (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid);
+       int     (*port_pvid_set)(struct dsa_switch *ds, int port, u16 pvid);
+       int     (*port_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
+                                bool untagged);
+       int     (*port_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
+       int     (*vlan_getnext)(struct dsa_switch *ds, u16 *vid,
+                               unsigned long *ports, unsigned long *untagged);
+
+       /*
+        * Forwarding database
+        */
+       int     (*port_fdb_add)(struct dsa_switch *ds, int port,
+                               const unsigned char *addr, u16 vid);
+       int     (*port_fdb_del)(struct dsa_switch *ds, int port,
+                               const unsigned char *addr, u16 vid);
+       int     (*port_fdb_getnext)(struct dsa_switch *ds, int port,
+                                   unsigned char *addr, u16 *vid,
+                                   bool *is_static);
 };
 
 void register_switch_driver(struct dsa_switch_driver *type);