aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-06-04 15:17:07 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-04 17:29:55 -0400
commit83c0afaec7b730b16c518aecc8e6246ec91b265e (patch)
tree5d675d5517efb9532cb4154ae982a3d3ecb2798e /net/dsa/slave.c
parentb516d453239551d7916d5e35bc68823ed5b55f98 (diff)
net: dsa: Add new binding implementation
The existing DSA binding has a number of limitations and problems. The main problem is that it cannot represent a switch as a linux device, hanging off some bus. It is limited to one CPU port. The DSA platform device is artificial, and does not really represent hardware. Implement a new binding which can be embedded into any type of node on a bus to represent one switch device, and its links to other switches. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 35e5f0f6688b..15a492261895 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1099,14 +1099,18 @@ int dsa_slave_resume(struct net_device *slave_dev)
1099} 1099}
1100 1100
1101int dsa_slave_create(struct dsa_switch *ds, struct device *parent, 1101int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
1102 int port, char *name) 1102 int port, const char *name)
1103{ 1103{
1104 struct net_device *master = ds->dst->master_netdev;
1105 struct dsa_switch_tree *dst = ds->dst; 1104 struct dsa_switch_tree *dst = ds->dst;
1105 struct net_device *master;
1106 struct net_device *slave_dev; 1106 struct net_device *slave_dev;
1107 struct dsa_slave_priv *p; 1107 struct dsa_slave_priv *p;
1108 int ret; 1108 int ret;
1109 1109
1110 master = ds->dst->master_netdev;
1111 if (ds->master_netdev)
1112 master = ds->master_netdev;
1113
1110 slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name, 1114 slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name,
1111 NET_NAME_UNKNOWN, ether_setup); 1115 NET_NAME_UNKNOWN, ether_setup);
1112 if (slave_dev == NULL) 1116 if (slave_dev == NULL)