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>
此提交包含在:
Andrew Lunn
2016-08-22 16:01:01 +02:00
提交者 David S. Miller
父節點 1ae292a245
當前提交 7b314362a2
共有 7 個檔案被更改,包括 34 行新增8 行删除

查看文件

@@ -239,14 +239,15 @@ struct switchdev_obj_port_vlan;
struct dsa_switch_driver {
struct list_head list;
enum dsa_tag_protocol tag_protocol;
/*
* Probing and setup.
*/
const char *(*probe)(struct device *dsa_dev,
struct device *host_dev, int sw_addr,
void **priv);
enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds);
int (*setup)(struct dsa_switch *ds);
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
u32 (*get_phy_flags)(struct dsa_switch *ds, int port);