Commit 8740fa3f authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-headers-cleanup'

Vivien Didelot says:

====================
net: dsa: headers cleanup

The DSA core files share a common private header file. Include the DSA
public header there instead of independently in each core source file.

DSA core and its drivers use switchdev, thus include switchdev.h in the
public DSA header. This allows us to get rid of the forward declaration
and use typedef defined by switchdev.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents de321ed3 438ff537
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/if_bridge.h> #include <linux/if_bridge.h>
#include <net/dsa.h> #include <net/dsa.h>
#include <net/switchdev.h>
#include "b53_regs.h" #include "b53_regs.h"
#include "b53_priv.h" #include "b53_priv.h"
...@@ -1056,7 +1055,7 @@ EXPORT_SYMBOL(b53_vlan_del); ...@@ -1056,7 +1055,7 @@ EXPORT_SYMBOL(b53_vlan_del);
int b53_vlan_dump(struct dsa_switch *ds, int port, int b53_vlan_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_vlan *vlan, struct switchdev_obj_port_vlan *vlan,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct b53_device *dev = ds->priv; struct b53_device *dev = ds->priv;
u16 vid, vid_start = 0, pvid; u16 vid, vid_start = 0, pvid;
...@@ -1285,7 +1284,7 @@ static void b53_arl_search_rd(struct b53_device *dev, u8 idx, ...@@ -1285,7 +1284,7 @@ static void b53_arl_search_rd(struct b53_device *dev, u8 idx,
static int b53_fdb_copy(struct net_device *dev, int port, static int b53_fdb_copy(struct net_device *dev, int port,
const struct b53_arl_entry *ent, const struct b53_arl_entry *ent,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
if (!ent->is_valid) if (!ent->is_valid)
return 0; return 0;
...@@ -1302,7 +1301,7 @@ static int b53_fdb_copy(struct net_device *dev, int port, ...@@ -1302,7 +1301,7 @@ static int b53_fdb_copy(struct net_device *dev, int port,
int b53_fdb_dump(struct dsa_switch *ds, int port, int b53_fdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct b53_device *priv = ds->priv; struct b53_device *priv = ds->priv;
struct net_device *dev = ds->ports[port].netdev; struct net_device *dev = ds->ports[port].netdev;
......
...@@ -395,7 +395,7 @@ int b53_vlan_del(struct dsa_switch *ds, int port, ...@@ -395,7 +395,7 @@ int b53_vlan_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan); const struct switchdev_obj_port_vlan *vlan);
int b53_vlan_dump(struct dsa_switch *ds, int port, int b53_vlan_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_vlan *vlan, struct switchdev_obj_port_vlan *vlan,
int (*cb)(struct switchdev_obj *obj)); switchdev_obj_dump_cb_t *cb);
int b53_fdb_prepare(struct dsa_switch *ds, int port, int b53_fdb_prepare(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_fdb *fdb, const struct switchdev_obj_port_fdb *fdb,
struct switchdev_trans *trans); struct switchdev_trans *trans);
...@@ -406,7 +406,7 @@ int b53_fdb_del(struct dsa_switch *ds, int port, ...@@ -406,7 +406,7 @@ int b53_fdb_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_fdb *fdb); const struct switchdev_obj_port_fdb *fdb);
int b53_fdb_dump(struct dsa_switch *ds, int port, int b53_fdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)); switchdev_obj_dump_cb_t *cb);
int b53_mirror_add(struct dsa_switch *ds, int port, int b53_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror, bool ingress); struct dsa_mall_mirror_tc_entry *mirror, bool ingress);
void b53_mirror_del(struct dsa_switch *ds, int port, void b53_mirror_del(struct dsa_switch *ds, int port,
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/if_bridge.h> #include <linux/if_bridge.h>
#include <linux/brcmphy.h> #include <linux/brcmphy.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <net/switchdev.h>
#include <linux/platform_data/b53.h> #include <linux/platform_data/b53.h>
#include "bcm_sf2.h" #include "bcm_sf2.h"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/if_bridge.h> #include <linux/if_bridge.h>
#include <net/switchdev.h>
#include <net/dsa.h> #include <net/dsa.h>
#include "dsa_loop.h" #include "dsa_loop.h"
...@@ -188,7 +187,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port, ...@@ -188,7 +187,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port, static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_vlan *vlan, struct switchdev_obj_port_vlan *vlan,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct dsa_loop_priv *ps = ds->priv; struct dsa_loop_priv *ps = ds->priv;
struct mii_bus *bus = ps->bus; struct mii_bus *bus = ps->bus;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <net/dsa.h> #include <net/dsa.h>
#include <net/switchdev.h>
#include "mt7530.h" #include "mt7530.h"
...@@ -854,7 +853,7 @@ mt7530_port_fdb_del(struct dsa_switch *ds, int port, ...@@ -854,7 +853,7 @@ mt7530_port_fdb_del(struct dsa_switch *ds, int port,
static int static int
mt7530_port_fdb_dump(struct dsa_switch *ds, int port, mt7530_port_fdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mt7530_priv *priv = ds->priv; struct mt7530_priv *priv = ds->priv;
struct mt7530_fdb _fdb = { 0 }; struct mt7530_fdb _fdb = { 0 };
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <net/dsa.h> #include <net/dsa.h>
#include <net/switchdev.h>
#include "mv88e6xxx.h" #include "mv88e6xxx.h"
#include "global1.h" #include "global1.h"
...@@ -1269,7 +1268,7 @@ static int mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip, ...@@ -1269,7 +1268,7 @@ static int mv88e6xxx_vtu_loadpurge(struct mv88e6xxx_chip *chip,
static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port, static int mv88e6xxx_port_vlan_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_vlan *vlan, struct switchdev_obj_port_vlan *vlan,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
struct mv88e6xxx_vtu_entry next = { struct mv88e6xxx_vtu_entry next = {
...@@ -1700,7 +1699,7 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, ...@@ -1700,7 +1699,7 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port,
static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip, static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip,
u16 fid, u16 vid, int port, u16 fid, u16 vid, int port,
struct switchdev_obj *obj, struct switchdev_obj *obj,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mv88e6xxx_atu_entry addr; struct mv88e6xxx_atu_entry addr;
int err; int err;
...@@ -1755,7 +1754,7 @@ static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip, ...@@ -1755,7 +1754,7 @@ static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip,
static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port, static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port,
struct switchdev_obj *obj, struct switchdev_obj *obj,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mv88e6xxx_vtu_entry vlan = { struct mv88e6xxx_vtu_entry vlan = {
.vid = chip->info->max_vid, .vid = chip->info->max_vid,
...@@ -1792,7 +1791,7 @@ static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port, ...@@ -1792,7 +1791,7 @@ static int mv88e6xxx_port_db_dump(struct mv88e6xxx_chip *chip, int port,
static int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port, static int mv88e6xxx_port_fdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
...@@ -4038,7 +4037,7 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, ...@@ -4038,7 +4037,7 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
static int mv88e6xxx_port_mdb_dump(struct dsa_switch *ds, int port, static int mv88e6xxx_port_mdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_mdb *mdb, struct switchdev_obj_port_mdb *mdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <net/dsa.h> #include <net/dsa.h>
#include <net/switchdev.h>
#include <linux/of_net.h> #include <linux/of_net.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/if_bridge.h> #include <linux/if_bridge.h>
...@@ -873,7 +872,7 @@ qca8k_port_fdb_del(struct dsa_switch *ds, int port, ...@@ -873,7 +872,7 @@ qca8k_port_fdb_del(struct dsa_switch *ds, int port,
static int static int
qca8k_port_fdb_dump(struct dsa_switch *ds, int port, qca8k_port_fdb_dump(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)) switchdev_obj_dump_cb_t *cb)
{ {
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
struct qca8k_fdb _fdb = { 0 }; struct qca8k_fdb _fdb = { 0 };
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <net/devlink.h> #include <net/devlink.h>
#include <net/switchdev.h>
struct tc_action; struct tc_action;
struct phy_device; struct phy_device;
...@@ -284,12 +285,6 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds) ...@@ -284,12 +285,6 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
return ds->rtable[dst->cpu_dp->ds->index]; return ds->rtable[dst->cpu_dp->ds->index];
} }
struct switchdev_trans;
struct switchdev_obj;
struct switchdev_obj_port_fdb;
struct switchdev_obj_port_mdb;
struct switchdev_obj_port_vlan;
#define DSA_NOTIFIER_BRIDGE_JOIN 1 #define DSA_NOTIFIER_BRIDGE_JOIN 1
#define DSA_NOTIFIER_BRIDGE_LEAVE 2 #define DSA_NOTIFIER_BRIDGE_LEAVE 2
...@@ -409,7 +404,7 @@ struct dsa_switch_ops { ...@@ -409,7 +404,7 @@ struct dsa_switch_ops {
const struct switchdev_obj_port_vlan *vlan); const struct switchdev_obj_port_vlan *vlan);
int (*port_vlan_dump)(struct dsa_switch *ds, int port, int (*port_vlan_dump)(struct dsa_switch *ds, int port,
struct switchdev_obj_port_vlan *vlan, struct switchdev_obj_port_vlan *vlan,
int (*cb)(struct switchdev_obj *obj)); switchdev_obj_dump_cb_t *cb);
/* /*
* Forwarding database * Forwarding database
...@@ -424,7 +419,7 @@ struct dsa_switch_ops { ...@@ -424,7 +419,7 @@ struct dsa_switch_ops {
const struct switchdev_obj_port_fdb *fdb); const struct switchdev_obj_port_fdb *fdb);
int (*port_fdb_dump)(struct dsa_switch *ds, int port, int (*port_fdb_dump)(struct dsa_switch *ds, int port,
struct switchdev_obj_port_fdb *fdb, struct switchdev_obj_port_fdb *fdb,
int (*cb)(struct switchdev_obj *obj)); switchdev_obj_dump_cb_t *cb);
/* /*
* Multicast database * Multicast database
...@@ -439,7 +434,7 @@ struct dsa_switch_ops { ...@@ -439,7 +434,7 @@ struct dsa_switch_ops {
const struct switchdev_obj_port_mdb *mdb); const struct switchdev_obj_port_mdb *mdb);
int (*port_mdb_dump)(struct dsa_switch *ds, int port, int (*port_mdb_dump)(struct dsa_switch *ds, int port,
struct switchdev_obj_port_mdb *mdb, struct switchdev_obj_port_mdb *mdb,
int (*cb)(struct switchdev_obj *obj)); switchdev_obj_dump_cb_t *cb);
/* /*
* RXNFC * RXNFC
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <linux/phy_fixed.h> #include <linux/phy_fixed.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
static struct sk_buff *dsa_slave_notag_xmit(struct sk_buff *skb, static struct sk_buff *dsa_slave_notag_xmit(struct sk_buff *skb,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_net.h> #include <linux/of_net.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
static LIST_HEAD(dsa_switch_trees); static LIST_HEAD(dsa_switch_trees);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/netpoll.h> #include <linux/netpoll.h>
#include <net/dsa.h>
struct dsa_device_ops { struct dsa_device_ops {
struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev); struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <linux/phy_fixed.h> #include <linux/phy_fixed.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
/* switch driver registration ***********************************************/ /* switch driver registration ***********************************************/
......
...@@ -17,13 +17,12 @@ ...@@ -17,13 +17,12 @@
#include <linux/of_mdio.h> #include <linux/of_mdio.h>
#include <linux/mdio.h> #include <linux/mdio.h>
#include <linux/list.h> #include <linux/list.h>
#include <net/dsa.h>
#include <net/rtnetlink.h> #include <net/rtnetlink.h>
#include <net/switchdev.h>
#include <net/pkt_cls.h> #include <net/pkt_cls.h>
#include <net/tc_act/tc_mirred.h> #include <net/tc_act/tc_mirred.h>
#include <linux/if_bridge.h> #include <linux/if_bridge.h>
#include <linux/netpoll.h> #include <linux/netpoll.h>
#include "dsa_priv.h" #include "dsa_priv.h"
static bool dsa_slave_dev_check(struct net_device *dev); static bool dsa_slave_dev_check(struct net_device *dev);
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <net/dsa.h>
#include "dsa_priv.h"
static int dsa_switch_bridge_join(struct dsa_switch *ds, static int dsa_switch_bridge_join(struct dsa_switch *ds,
struct dsa_notifier_bridge_info *info) struct dsa_notifier_bridge_info *info)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
/* This tag length is 4 bytes, older ones were 6 bytes, we do not /* This tag length is 4 bytes, older ones were 6 bytes, we do not
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
#define DSA_HLEN 4 #define DSA_HLEN 4
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
#define DSA_HLEN 4 #define DSA_HLEN 4
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
/* To define the outgoing port and to discover the incoming port a regular /* To define the outgoing port and to discover the incoming port a regular
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
*/ */
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
#define MTK_HDR_LEN 4 #define MTK_HDR_LEN 4
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
*/ */
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
#define QCA_HDR_LEN 2 #define QCA_HDR_LEN 2
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/dsa.h>
#include "dsa_priv.h" #include "dsa_priv.h"
static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device *dev) static struct sk_buff *trailer_xmit(struct sk_buff *skb, struct net_device *dev)
......
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