net: dsa: move VLAN filtering setter
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Fri, 19 May 2017 21:00:46 +0000 (17:00 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 May 2017 23:37:32 +0000 (19:37 -0400)
Move the DSA port code which sets VLAN filtering on a port in port.c,
where it belongs.

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>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c

index f0b6cd3c8a655813c5df04d0ca5a50ccdcbec7b0..c145223247c5b953bb3ee47c4551db187fde477d 100644 (file)
@@ -66,6 +66,8 @@ int dsa_port_set_state(struct dsa_port *dp, u8 state,
 void dsa_port_set_state_now(struct dsa_port *dp, u8 state);
 int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br);
 void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br);
+int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
+                           struct switchdev_trans *trans);
 
 /* slave.c */
 extern const struct dsa_device_ops notag_netdev_ops;
index da8577fb3d0732a4ba81353f6eee9554431655cc..c9f95aaf25f1fc3c8a6bb187d0efd25906e1a32a 100644 (file)
@@ -111,3 +111,19 @@ void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br)
         */
        dsa_port_set_state_now(dp, BR_STATE_FORWARDING);
 }
+
+int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
+                           struct switchdev_trans *trans)
+{
+       struct dsa_switch *ds = dp->ds;
+
+       /* bridge skips -EOPNOTSUPP, so skip the prepare phase */
+       if (switchdev_trans_ph_prepare(trans))
+               return 0;
+
+       if (ds->ops->port_vlan_filtering)
+               return ds->ops->port_vlan_filtering(ds, dp->index,
+                                                   vlan_filtering);
+
+       return 0;
+}
index ab298c41b8e7cc699b2f0189d5fd8a99f1294393..32e7e78313ba3f86f8fd49bc09e26befae6fe41a 100644 (file)
@@ -338,22 +338,6 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        return -EOPNOTSUPP;
 }
 
-static int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
-                                  struct switchdev_trans *trans)
-{
-       struct dsa_switch *ds = dp->ds;
-
-       /* bridge skips -EOPNOTSUPP, so skip the prepare phase */
-       if (switchdev_trans_ph_prepare(trans))
-               return 0;
-
-       if (ds->ops->port_vlan_filtering)
-               return ds->ops->port_vlan_filtering(ds, dp->index,
-                                                   vlan_filtering);
-
-       return 0;
-}
-
 static unsigned int dsa_fastest_ageing_time(struct dsa_switch *ds,
                                            unsigned int ageing_time)
 {