diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2017-09-20 12:28:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-21 18:15:58 -0400 |
commit | 0abfd494deefdbab66ac03c1181a614285e7d90c (patch) | |
tree | 303df476c86a75a7b3d7a162a681039a97014c8c | |
parent | 6e617de84e87d626d1e976fc30e1322239fd4d2d (diff) |
net: dsa: use dedicated CPU port
Each port in DSA has its own dedicated CPU port currently available in
its parent switch's ds->ports[port].cpu_dp. Use it instead of getting
the unique tree CPU port, which will be deprecated soon.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 6 | ||||
-rw-r--r-- | drivers/net/dsa/mt7530.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6060.c | 2 | ||||
-rw-r--r-- | drivers/net/dsa/qca8k.c | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index a9f2a5b55a5e..d4ce092def83 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c | |||
@@ -1336,7 +1336,7 @@ EXPORT_SYMBOL(b53_fdb_dump); | |||
1336 | int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br) | 1336 | int b53_br_join(struct dsa_switch *ds, int port, struct net_device *br) |
1337 | { | 1337 | { |
1338 | struct b53_device *dev = ds->priv; | 1338 | struct b53_device *dev = ds->priv; |
1339 | s8 cpu_port = ds->dst->cpu_dp->index; | 1339 | s8 cpu_port = ds->ports[port].cpu_dp->index; |
1340 | u16 pvlan, reg; | 1340 | u16 pvlan, reg; |
1341 | unsigned int i; | 1341 | unsigned int i; |
1342 | 1342 | ||
@@ -1382,7 +1382,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br) | |||
1382 | { | 1382 | { |
1383 | struct b53_device *dev = ds->priv; | 1383 | struct b53_device *dev = ds->priv; |
1384 | struct b53_vlan *vl = &dev->vlans[0]; | 1384 | struct b53_vlan *vl = &dev->vlans[0]; |
1385 | s8 cpu_port = ds->dst->cpu_dp->index; | 1385 | s8 cpu_port = ds->ports[port].cpu_dp->index; |
1386 | unsigned int i; | 1386 | unsigned int i; |
1387 | u16 pvlan, reg, pvid; | 1387 | u16 pvlan, reg, pvid; |
1388 | 1388 | ||
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 0072a959db5b..898d5642b516 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
@@ -661,7 +661,7 @@ static int bcm_sf2_sw_resume(struct dsa_switch *ds) | |||
661 | static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port, | 661 | static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port, |
662 | struct ethtool_wolinfo *wol) | 662 | struct ethtool_wolinfo *wol) |
663 | { | 663 | { |
664 | struct net_device *p = ds->dst->cpu_dp->netdev; | 664 | struct net_device *p = ds->ports[port].cpu_dp->netdev; |
665 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); | 665 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
666 | struct ethtool_wolinfo pwol; | 666 | struct ethtool_wolinfo pwol; |
667 | 667 | ||
@@ -684,9 +684,9 @@ static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port, | |||
684 | static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port, | 684 | static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port, |
685 | struct ethtool_wolinfo *wol) | 685 | struct ethtool_wolinfo *wol) |
686 | { | 686 | { |
687 | struct net_device *p = ds->dst->cpu_dp->netdev; | 687 | struct net_device *p = ds->ports[port].cpu_dp->netdev; |
688 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); | 688 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
689 | s8 cpu_port = ds->dst->cpu_dp->index; | 689 | s8 cpu_port = ds->ports[port].cpu_dp->index; |
690 | struct ethtool_wolinfo pwol; | 690 | struct ethtool_wolinfo pwol; |
691 | 691 | ||
692 | p->ethtool_ops->get_wol(p, &pwol); | 692 | p->ethtool_ops->get_wol(p, &pwol); |
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index c142b97add2c..faa3b88d2206 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c | |||
@@ -928,11 +928,11 @@ mt7530_setup(struct dsa_switch *ds) | |||
928 | struct device_node *dn; | 928 | struct device_node *dn; |
929 | struct mt7530_dummy_poll p; | 929 | struct mt7530_dummy_poll p; |
930 | 930 | ||
931 | /* The parent node of cpu_dp->netdev which holds the common system | 931 | /* The parent node of master netdev which holds the common system |
932 | * controller also is the container for two GMACs nodes representing | 932 | * controller also is the container for two GMACs nodes representing |
933 | * as two netdev instances. | 933 | * as two netdev instances. |
934 | */ | 934 | */ |
935 | dn = ds->dst->cpu_dp->netdev->dev.of_node->parent; | 935 | dn = ds->ports[MT7530_CPU_PORT].netdev->dev.of_node->parent; |
936 | priv->ethernet = syscon_node_to_regmap(dn); | 936 | priv->ethernet = syscon_node_to_regmap(dn); |
937 | if (IS_ERR(priv->ethernet)) | 937 | if (IS_ERR(priv->ethernet)) |
938 | return PTR_ERR(priv->ethernet); | 938 | return PTR_ERR(priv->ethernet); |
diff --git a/drivers/net/dsa/mv88e6060.c b/drivers/net/dsa/mv88e6060.c index dce7fa57eb55..621cdc46ad81 100644 --- a/drivers/net/dsa/mv88e6060.c +++ b/drivers/net/dsa/mv88e6060.c | |||
@@ -176,7 +176,7 @@ static int mv88e6060_setup_port(struct dsa_switch *ds, int p) | |||
176 | ((p & 0xf) << PORT_VLAN_MAP_DBNUM_SHIFT) | | 176 | ((p & 0xf) << PORT_VLAN_MAP_DBNUM_SHIFT) | |
177 | (dsa_is_cpu_port(ds, p) ? | 177 | (dsa_is_cpu_port(ds, p) ? |
178 | ds->enabled_port_mask : | 178 | ds->enabled_port_mask : |
179 | BIT(ds->dst->cpu_dp->index))); | 179 | BIT(ds->ports[p].cpu_dp->index))); |
180 | 180 | ||
181 | /* Port Association Vector: when learning source addresses | 181 | /* Port Association Vector: when learning source addresses |
182 | * of packets, add the address to the address database using | 182 | * of packets, add the address to the address database using |
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 5ada7a41449c..82f09711ac1a 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c | |||
@@ -506,7 +506,7 @@ qca8k_setup(struct dsa_switch *ds) | |||
506 | pr_warn("regmap initialization failed"); | 506 | pr_warn("regmap initialization failed"); |
507 | 507 | ||
508 | /* Initialize CPU port pad mode (xMII type, delays...) */ | 508 | /* Initialize CPU port pad mode (xMII type, delays...) */ |
509 | phy_mode = of_get_phy_mode(ds->dst->cpu_dp->dn); | 509 | phy_mode = of_get_phy_mode(ds->ports[QCA8K_CPU_PORT].dn); |
510 | if (phy_mode < 0) { | 510 | if (phy_mode < 0) { |
511 | pr_err("Can't find phy-mode for master device\n"); | 511 | pr_err("Can't find phy-mode for master device\n"); |
512 | return phy_mode; | 512 | return phy_mode; |