aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa.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/dsa.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/dsa.c')
-rw-r--r--net/dsa/dsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 6c314f300424..ce3b942dce76 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -294,6 +294,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
294 } 294 }
295 dst->cpu_switch = index; 295 dst->cpu_switch = index;
296 dst->cpu_port = i; 296 dst->cpu_port = i;
297 ds->cpu_port_mask |= 1 << i;
297 } else if (!strcmp(name, "dsa")) { 298 } else if (!strcmp(name, "dsa")) {
298 ds->dsa_port_mask |= 1 << i; 299 ds->dsa_port_mask |= 1 << i;
299 } else { 300 } else {
@@ -492,6 +493,10 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
492 if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) 493 if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
493 continue; 494 continue;
494 dsa_cpu_dsa_destroy(ds->ports[port].dn); 495 dsa_cpu_dsa_destroy(ds->ports[port].dn);
496
497 /* Clearing a bit which is not set does no harm */
498 ds->cpu_port_mask |= ~(1 << port);
499 ds->dsa_port_mask |= ~(1 << port);
495 } 500 }
496 501
497 if (ds->slave_mii_bus && ds->drv->phy_read) 502 if (ds->slave_mii_bus && ds->drv->phy_read)