net: dsa: move VLAN handlers
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Fri, 19 May 2017 21:00:50 +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 handles VLAN objects 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 c2a595036746d66c8bf54ac895d889e0803df61a..16021a8910953c35ffdc5dde52186bc3477910c6 100644 (file)
@@ -84,6 +84,14 @@ int dsa_port_mdb_del(struct dsa_port *dp,
                     const struct switchdev_obj_port_mdb *mdb);
 int dsa_port_mdb_dump(struct dsa_port *dp, struct switchdev_obj_port_mdb *mdb,
                      switchdev_obj_dump_cb_t *cb);
+int dsa_port_vlan_add(struct dsa_port *dp,
+                     const struct switchdev_obj_port_vlan *vlan,
+                     struct switchdev_trans *trans);
+int dsa_port_vlan_del(struct dsa_port *dp,
+                     const struct switchdev_obj_port_vlan *vlan);
+int dsa_port_vlan_dump(struct dsa_port *dp,
+                      struct switchdev_obj_port_vlan *vlan,
+                      switchdev_obj_dump_cb_t *cb);
 
 /* slave.c */
 extern const struct dsa_device_ops notag_netdev_ops;
index 4ed0124a8d4bbee9486649f3dec8b2984817994a..f211b0dfb12d631032444821e0d8388513869b95 100644 (file)
@@ -247,3 +247,44 @@ int dsa_port_mdb_dump(struct dsa_port *dp, struct switchdev_obj_port_mdb *mdb,
 
        return -EOPNOTSUPP;
 }
+
+int dsa_port_vlan_add(struct dsa_port *dp,
+                     const struct switchdev_obj_port_vlan *vlan,
+                     struct switchdev_trans *trans)
+{
+       struct dsa_switch *ds = dp->ds;
+
+       if (switchdev_trans_ph_prepare(trans)) {
+               if (!ds->ops->port_vlan_prepare || !ds->ops->port_vlan_add)
+                       return -EOPNOTSUPP;
+
+               return ds->ops->port_vlan_prepare(ds, dp->index, vlan, trans);
+       }
+
+       ds->ops->port_vlan_add(ds, dp->index, vlan, trans);
+
+       return 0;
+}
+
+int dsa_port_vlan_del(struct dsa_port *dp,
+                     const struct switchdev_obj_port_vlan *vlan)
+{
+       struct dsa_switch *ds = dp->ds;
+
+       if (!ds->ops->port_vlan_del)
+               return -EOPNOTSUPP;
+
+       return ds->ops->port_vlan_del(ds, dp->index, vlan);
+}
+
+int dsa_port_vlan_dump(struct dsa_port *dp,
+                      struct switchdev_obj_port_vlan *vlan,
+                      switchdev_obj_dump_cb_t *cb)
+{
+       struct dsa_switch *ds = dp->ds;
+
+       if (ds->ops->port_vlan_dump)
+               return ds->ops->port_vlan_dump(ds, dp->index, vlan, cb);
+
+       return -EOPNOTSUPP;
+}
index 9adcb8267d9ac494bb8d71c8f9d4d3b5fd808825..887e2669551930701a9ac98d3bb2229595006e6e 100644 (file)
@@ -204,47 +204,6 @@ out:
        return 0;
 }
 
-static int dsa_port_vlan_add(struct dsa_port *dp,
-                            const struct switchdev_obj_port_vlan *vlan,
-                            struct switchdev_trans *trans)
-{
-       struct dsa_switch *ds = dp->ds;
-
-       if (switchdev_trans_ph_prepare(trans)) {
-               if (!ds->ops->port_vlan_prepare || !ds->ops->port_vlan_add)
-                       return -EOPNOTSUPP;
-
-               return ds->ops->port_vlan_prepare(ds, dp->index, vlan, trans);
-       }
-
-       ds->ops->port_vlan_add(ds, dp->index, vlan, trans);
-
-       return 0;
-}
-
-static int dsa_port_vlan_del(struct dsa_port *dp,
-                            const struct switchdev_obj_port_vlan *vlan)
-{
-       struct dsa_switch *ds = dp->ds;
-
-       if (!ds->ops->port_vlan_del)
-               return -EOPNOTSUPP;
-
-       return ds->ops->port_vlan_del(ds, dp->index, vlan);
-}
-
-static int dsa_port_vlan_dump(struct dsa_port *dp,
-                             struct switchdev_obj_port_vlan *vlan,
-                             switchdev_obj_dump_cb_t *cb)
-{
-       struct dsa_switch *ds = dp->ds;
-
-       if (ds->ops->port_vlan_dump)
-               return ds->ops->port_vlan_dump(ds, dp->index, vlan, cb);
-
-       return -EOPNOTSUPP;
-}
-
 static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
        struct dsa_slave_priv *p = netdev_priv(dev);