summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/bcm_sf2.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-08-22 16:01:01 +0200
committerDavid S. Miller <davem@davemloft.net>2016-08-22 21:08:08 -0700
commit7b314362a2344feaafbdf6aa8f3d57077728e37a (patch)
tree348a762b9bcfb4bb4adc2d0648dcd44e3d04865c /drivers/net/dsa/bcm_sf2.c
parent1ae292a2457cd692828da2be87cb967260993ad0 (diff)
downloadlwn-7b314362a2344feaafbdf6aa8f3d57077728e37a.tar.gz
lwn-7b314362a2344feaafbdf6aa8f3d57077728e37a.zip
net: dsa: Allow the DSA driver to indicate the tag protocol
DSA drivers may drive different families of switches which need different tag protocol. Rather than hard code the tag protocol in the driver structure, have a callback for the DSA core to call. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.c')
-rw-r--r--drivers/net/dsa/bcm_sf2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 8e6fe13dbec3..b47a74b37a42 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -136,6 +136,11 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds)
return BCM_SF2_STATS_SIZE;
}
+static enum dsa_tag_protocol bcm_sf2_sw_get_tag_protocol(struct dsa_switch *ds)
+{
+ return DSA_TAG_PROTO_BRCM;
+}
+
static void bcm_sf2_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)
{
struct bcm_sf2_priv *priv = ds_to_priv(ds);
@@ -1577,8 +1582,8 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
}
static struct dsa_switch_driver bcm_sf2_switch_driver = {
- .tag_protocol = DSA_TAG_PROTO_BRCM,
.setup = bcm_sf2_sw_setup,
+ .get_tag_protocol = bcm_sf2_sw_get_tag_protocol,
.set_addr = bcm_sf2_sw_set_addr,
.get_phy_flags = bcm_sf2_sw_get_phy_flags,
.get_strings = bcm_sf2_sw_get_strings,