summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-09-15 17:24:29 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-15 17:24:29 -0400
commit0486b60a8c62d3a9470374601dbd2f5f03afb1dd (patch)
tree348e36396eda758e021a8473b330c19cd571e76f /include
parent6cca9adb786184be21f30be0982e3ea0281f75cb (diff)
parentb4d2394d01bc642e95b2cba956d908423c1bef77 (diff)
Merge branch 'dsa-next'
Alexander Duyck says: ==================== DSA Cleanups This patch series does two things, first it cleans up the tag_protocol and protocol ops being configured seperately. Second it addresses the desire to split DSA away from relying on a MII bus. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h7
-rw-r--r--include/net/dsa.h19
2 files changed, 11 insertions, 15 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f9e81d10a3b9..28d4378615e5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1928,13 +1928,6 @@ struct udp_offload {
struct offload_callbacks callbacks;
};
-struct dsa_device_ops {
- netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
- int (*rcv)(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *pt, struct net_device *orig_dev);
-};
-
-
/* often modified stats are per cpu, other are shared (netdev->stats) */
struct pcpu_sw_netstats {
u64 rx_packets;
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 8a8a5d976f97..c779e9bba1b3 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -34,7 +34,7 @@ struct dsa_chip_data {
/*
* How to access the switch configuration registers.
*/
- struct device *mii_bus;
+ struct device *host_dev;
int sw_addr;
/* Device tree node pointer for this specific switch chip
@@ -77,7 +77,7 @@ struct dsa_platform_data {
struct dsa_chip_data *chip;
};
-struct dsa_device_ops;
+struct packet_type;
struct dsa_switch_tree {
/*
@@ -91,7 +91,10 @@ struct dsa_switch_tree {
* protocol to use.
*/
struct net_device *master_netdev;
- const struct dsa_device_ops *ops;
+ int (*rcv)(struct sk_buff *skb,
+ struct net_device *dev,
+ struct packet_type *pt,
+ struct net_device *orig_dev);
enum dsa_tag_protocol tag_protocol;
/*
@@ -131,9 +134,9 @@ struct dsa_switch {
struct dsa_switch_driver *drv;
/*
- * Reference to mii bus to use.
+ * Reference to host device to use.
*/
- struct mii_bus *master_mii_bus;
+ struct device *master_dev;
/*
* Slave mii_bus and devices for the individual ports.
@@ -175,7 +178,7 @@ struct dsa_switch_driver {
/*
* Probing and setup.
*/
- char *(*probe)(struct mii_bus *bus, int sw_addr);
+ char *(*probe)(struct device *host_dev, int sw_addr);
int (*setup)(struct dsa_switch *ds);
int (*set_addr)(struct dsa_switch *ds, u8 *addr);
@@ -210,6 +213,7 @@ struct dsa_switch_driver {
void register_switch_driver(struct dsa_switch_driver *type);
void unregister_switch_driver(struct dsa_switch_driver *type);
+struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
static inline void *ds_to_priv(struct dsa_switch *ds)
{
@@ -218,7 +222,6 @@ static inline void *ds_to_priv(struct dsa_switch *ds)
static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
{
- return dst->tag_protocol != DSA_TAG_PROTO_NONE;
+ return dst->rcv != NULL;
}
-
#endif