aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index b34d812bc5d0..82a4c6011173 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -197,6 +197,11 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
197 return ds->pd->rtable[dst->cpu_switch]; 197 return ds->pd->rtable[dst->cpu_switch];
198} 198}
199 199
200struct switchdev_trans;
201struct switchdev_obj;
202struct switchdev_obj_port_fdb;
203struct switchdev_obj_port_vlan;
204
200struct dsa_switch_driver { 205struct dsa_switch_driver {
201 struct list_head list; 206 struct list_head list;
202 207
@@ -305,24 +310,32 @@ struct dsa_switch_driver {
305 /* 310 /*
306 * VLAN support 311 * VLAN support
307 */ 312 */
313 int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
314 const struct switchdev_obj_port_vlan *vlan,
315 struct switchdev_trans *trans);
316 int (*port_vlan_add)(struct dsa_switch *ds, int port,
317 const struct switchdev_obj_port_vlan *vlan,
318 struct switchdev_trans *trans);
319 int (*port_vlan_del)(struct dsa_switch *ds, int port,
320 const struct switchdev_obj_port_vlan *vlan);
308 int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid); 321 int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid);
309 int (*port_pvid_set)(struct dsa_switch *ds, int port, u16 pvid);
310 int (*port_vlan_add)(struct dsa_switch *ds, int port, u16 vid,
311 bool untagged);
312 int (*port_vlan_del)(struct dsa_switch *ds, int port, u16 vid);
313 int (*vlan_getnext)(struct dsa_switch *ds, u16 *vid, 322 int (*vlan_getnext)(struct dsa_switch *ds, u16 *vid,
314 unsigned long *ports, unsigned long *untagged); 323 unsigned long *ports, unsigned long *untagged);
315 324
316 /* 325 /*
317 * Forwarding database 326 * Forwarding database
318 */ 327 */
328 int (*port_fdb_prepare)(struct dsa_switch *ds, int port,
329 const struct switchdev_obj_port_fdb *fdb,
330 struct switchdev_trans *trans);
319 int (*port_fdb_add)(struct dsa_switch *ds, int port, 331 int (*port_fdb_add)(struct dsa_switch *ds, int port,
320 const unsigned char *addr, u16 vid); 332 const struct switchdev_obj_port_fdb *fdb,
333 struct switchdev_trans *trans);
321 int (*port_fdb_del)(struct dsa_switch *ds, int port, 334 int (*port_fdb_del)(struct dsa_switch *ds, int port,
322 const unsigned char *addr, u16 vid); 335 const struct switchdev_obj_port_fdb *fdb);
323 int (*port_fdb_getnext)(struct dsa_switch *ds, int port, 336 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
324 unsigned char *addr, u16 *vid, 337 struct switchdev_obj_port_fdb *fdb,
325 bool *is_static); 338 int (*cb)(struct switchdev_obj *obj));
326}; 339};
327 340
328void register_switch_driver(struct dsa_switch_driver *type); 341void register_switch_driver(struct dsa_switch_driver *type);