Re: [PATCH net-next 05/17] net: dsa: Add a ports structure and use it in the switch structure

2016-06-03 Thread Florian Fainelli
On 06/03/2016 09:44 AM, Andrew Lunn wrote:
> There are going to be more per-port members added to the switch
> structure. So add a port structure and move the netdev into it.
> 
> Signed-off-by: Andrew Lunn 

Reviewed-by: Florian Fainelli 
-- 
Florian


Re: [PATCH net-next 05/17] net: dsa: Add a ports structure and use it in the switch structure

2016-06-03 Thread Vivien Didelot
Andrew Lunn  writes:

> There are going to be more per-port members added to the switch
> structure. So add a port structure and move the netdev into it.
>
> Signed-off-by: Andrew Lunn 

Reviewed-by: Vivien Didelot 


[PATCH net-next 05/17] net: dsa: Add a ports structure and use it in the switch structure

2016-06-03 Thread Andrew Lunn
There are going to be more per-port members added to the switch
structure. So add a port structure and move the netdev into it.

Signed-off-by: Andrew Lunn 
---
 drivers/net/dsa/bcm_sf2.c   |  4 ++--
 drivers/net/dsa/mv88e6xxx.c | 27 ---
 include/net/dsa.h   |  8 ++--
 net/dsa/dsa.c   |  8 
 net/dsa/slave.c |  4 ++--
 net/dsa/tag_brcm.c  |  4 ++--
 net/dsa/tag_dsa.c   |  4 ++--
 net/dsa/tag_edsa.c  |  4 ++--
 net/dsa/tag_trailer.c   |  4 ++--
 9 files changed, 38 insertions(+), 29 deletions(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 10ddd5a5dfb6..73df91bb0466 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -804,7 +804,7 @@ static int bcm_sf2_sw_fdb_dump(struct dsa_switch *ds, int 
port,
   int (*cb)(struct switchdev_obj *obj))
 {
struct bcm_sf2_priv *priv = ds_to_priv(ds);
-   struct net_device *dev = ds->ports[port];
+   struct net_device *dev = ds->ports[port].netdev;
struct bcm_sf2_arl_entry results[2];
unsigned int count = 0;
int ret;
@@ -1248,7 +1248,7 @@ static void bcm_sf2_sw_fixed_link_update(struct 
dsa_switch *ds, int port,
 * state machine and make it go in PHY_FORCING state instead.
 */
if (!status->link)
-   netif_carrier_off(ds->ports[port]);
+   netif_carrier_off(ds->ports[port].netdev);
status->duplex = 1;
} else {
status->link = 1;
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index c361036e7f9c..85332d9a245a 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1327,7 +1327,7 @@ static int _mv88e6xxx_port_state(struct 
mv88e6xxx_priv_state *ps, int port,
if (ret)
return ret;
 
-   netdev_dbg(ds->ports[port], "PortState %s (was %s)\n",
+   netdev_dbg(ds->ports[port].netdev, "PortState %s (was %s)\n",
   mv88e6xxx_port_state_names[state],
   mv88e6xxx_port_state_names[oldstate]);
}
@@ -1405,7 +1405,8 @@ static void mv88e6xxx_port_stp_state_set(struct 
dsa_switch *ds, int port,
mutex_unlock(>smi_mutex);
 
if (err)
-   netdev_err(ds->ports[port], "failed to update state to %s\n",
+   netdev_err(ds->ports[port].netdev,
+  "failed to update state to %s\n",
   mv88e6xxx_port_state_names[stp_state]);
 }
 
@@ -1431,8 +1432,8 @@ static int _mv88e6xxx_port_pvid(struct 
mv88e6xxx_priv_state *ps, int port,
if (ret < 0)
return ret;
 
-   netdev_dbg(ds->ports[port], "DefaultVID %d (was %d)\n", *new,
-  pvid);
+   netdev_dbg(ds->ports[port].netdev,
+  "DefaultVID %d (was %d)\n", *new, pvid);
}
 
if (old)
@@ -1847,7 +1848,8 @@ static int _mv88e6xxx_port_fid(struct 
mv88e6xxx_priv_state *ps, int port,
if (ret < 0)
return ret;
 
-   netdev_dbg(ds->ports[port], "FID %d (was %d)\n", *new, fid);
+   netdev_dbg(ds->ports[port].netdev,
+  "FID %d (was %d)\n", *new, fid);
}
 
if (old)
@@ -2028,7 +2030,7 @@ static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch 
*ds, int port,
ps->ports[port].bridge_dev)
break; /* same bridge, check next VLAN */
 
-   netdev_warn(ds->ports[port],
+   netdev_warn(ds->ports[port].netdev,
"hardware VLAN %d already used by %s\n",
vlan.vid,
netdev_name(ps->ports[i].bridge_dev));
@@ -2078,7 +2080,7 @@ static int mv88e6xxx_port_vlan_filtering(struct 
dsa_switch *ds, int port,
if (ret < 0)
goto unlock;
 
-   netdev_dbg(ds->ports[port], "802.1Q Mode %s (was %s)\n",
+   netdev_dbg(ds->ports[port].netdev, "802.1Q Mode %s (was %s)\n",
   mv88e6xxx_port_8021q_mode_names[new],
   mv88e6xxx_port_8021q_mode_names[old]);
}
@@ -2147,11 +2149,12 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch 
*ds, int port,
 
for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid)
if (_mv88e6xxx_port_vlan_add(ps, port, vid, untagged))
-   netdev_err(ds->ports[port], "failed to add VLAN %d%c\n",
+   netdev_err(ds->ports[port].netdev,
+  "failed to add VLAN %d%c\n",
   vid, untagged ? 'u' : 't');
 
if (pvid