summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorVivien Didelot2015-08-13 18:52:17 +0200
committerDavid S. Miller2015-08-14 06:31:12 +0200
commit111495361598205967f1be4e07d4726b0f762d60 (patch)
tree55f2a584cbd0811e64ccce8e904e67c33902db58 /include/net/dsa.h
parentnet: ipv6 sysctl option to ignore routes when nexthop link is down (diff)
downloadkernel-qcow2-linux-111495361598205967f1be4e07d4726b0f762d60.tar.gz
kernel-qcow2-linux-111495361598205967f1be4e07d4726b0f762d60.tar.xz
kernel-qcow2-linux-111495361598205967f1be4e07d4726b0f762d60.zip
net: dsa: add support for switchdev VLAN objects
Add new functions in DSA drivers to access hardware VLAN entries through SWITCHDEV_OBJ_PORT_VLAN objects: - port_pvid_get() and vlan_getnext() to dump a VLAN - port_vlan_del() to exclude a port from a VLAN - port_pvid_set() and port_vlan_add() to join a port to a VLAN The DSA infrastructure will ensure that each VLAN of the given range does not already belong to another bridge. If it does, it will fallback to software VLAN and won't program the hardware. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 6356f437e911..bd9b76502458 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -298,6 +298,17 @@ struct dsa_switch_driver {
u8 state);
/*
+ * 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,