summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorFlorian Fainelli2017-02-04 22:02:43 +0100
committerDavid S. Miller2017-02-07 16:51:45 +0100
commit71e0bbde0d88047f66b25721f69a441d46083748 (patch)
treee9ecf5d8c0662c3958ca74fa815a142e9cfdf739 /include/net/dsa.h
parentnet: dsa: Rename and export dev_to_net_device() (diff)
downloadkernel-qcow2-linux-71e0bbde0d88047f66b25721f69a441d46083748.tar.gz
kernel-qcow2-linux-71e0bbde0d88047f66b25721f69a441d46083748.tar.xz
kernel-qcow2-linux-71e0bbde0d88047f66b25721f69a441d46083748.zip
net: dsa: Add support for platform data
Allow drivers to use the new DSA API with platform data. Most of the code in net/dsa/dsa2.c does not rely so much on device_nodes and can get the same information from platform_data instead. We purposely do not support distributed configurations with platform data, so drivers should be providing a pointer to a 'struct dsa_chip_data' structure if they wish to communicate per-port layout. Multiple CPUs port could potentially be supported and dsa_chip_data is extended to receive up to one reference to an upstream network device per port described by a dsa_chip_data structure. dsa_dev_to_net_device() increments the network device's reference count, so we intentionally call dev_put() to be consistent with the DT-enabled path, until we have a generic notifier based solution. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 2a21fa80f898..b49b2004891e 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -45,6 +45,11 @@ struct dsa_chip_data {
struct device *host_dev;
int sw_addr;
+ /*
+ * Reference to network devices
+ */
+ struct device *netdev[DSA_MAX_PORTS];
+
/* set to size of eeprom if supported by the switch */
int eeprom_len;
@@ -170,6 +175,7 @@ struct dsa_mall_tc_entry {
struct dsa_port {
struct dsa_switch *ds;
unsigned int index;
+ const char *name;
struct net_device *netdev;
struct device_node *dn;
unsigned int ageing_time;