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>
This commit is contained in:

committed by
David S. Miller

parent
1ae292a245
commit
7b314362a2
@@ -3924,6 +3924,11 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds)
|
||||
{
|
||||
return DSA_TAG_PROTO_EDSA;
|
||||
}
|
||||
|
||||
static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
|
||||
struct device *host_dev, int sw_addr,
|
||||
void **priv)
|
||||
@@ -3967,8 +3972,8 @@ free:
|
||||
}
|
||||
|
||||
static struct dsa_switch_driver mv88e6xxx_switch_driver = {
|
||||
.tag_protocol = DSA_TAG_PROTO_EDSA,
|
||||
.probe = mv88e6xxx_drv_probe,
|
||||
.get_tag_protocol = mv88e6xxx_get_tag_protocol,
|
||||
.setup = mv88e6xxx_setup,
|
||||
.set_addr = mv88e6xxx_set_addr,
|
||||
.adjust_link = mv88e6xxx_adjust_link,
|
||||
|
Reference in New Issue
Block a user