Commit 6c49b5e2 authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-parsing-stage'

Vivien Didelot says:

====================
net: dsa: parsing stage

When registering a DSA switch, there is basically two stages.

The first stage is the parsing of the switch device, from either device
tree or platform data. It fetches the DSA tree to which it belongs, and
validates its ports. The switch device is then added to the tree, and
the second stage is called if this was the last switch of the tree.

The second stage is the setup of the tree, which validates that the tree
is complete, sets up the routing tables, the default CPU port for user
ports, sets up the switch drivers and finally the master interfaces,
which makes the whole switch fabric functional.

This patch series covers the first parsing stage. It fixes the type of
the switch and tree indexes to unsigned int, simplifies the tree
reference counting and the switch and CPU ports parsing.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 95248461 7354fcb0
...@@ -116,7 +116,7 @@ struct dsa_switch_tree { ...@@ -116,7 +116,7 @@ struct dsa_switch_tree {
struct raw_notifier_head nh; struct raw_notifier_head nh;
/* Tree identifier */ /* Tree identifier */
u32 tree; unsigned int index;
/* Number of switches attached to this tree */ /* Number of switches attached to this tree */
struct kref refcount; struct kref refcount;
...@@ -209,7 +209,7 @@ struct dsa_switch { ...@@ -209,7 +209,7 @@ struct dsa_switch {
* Parent switch tree, and switch index. * Parent switch tree, and switch index.
*/ */
struct dsa_switch_tree *dst; struct dsa_switch_tree *dst;
int index; unsigned int index;
/* Listener for switch fabric events */ /* Listener for switch fabric events */
struct notifier_block nb; struct notifier_block nb;
......
This diff is collapsed.
...@@ -55,7 +55,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds) ...@@ -55,7 +55,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
ds->slave_mii_bus->read = dsa_slave_phy_read; ds->slave_mii_bus->read = dsa_slave_phy_read;
ds->slave_mii_bus->write = dsa_slave_phy_write; ds->slave_mii_bus->write = dsa_slave_phy_write;
snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d", snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d.%d",
ds->dst->tree, ds->index); ds->dst->index, ds->index);
ds->slave_mii_bus->parent = ds->dev; ds->slave_mii_bus->parent = ds->dev;
ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment