diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-01-15 18:06:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-17 14:31:24 -0500 |
commit | ecfc937210e5fdc6554e49b2a735ff22e72ae3f0 (patch) | |
tree | 4f85d9b964ab0864fec2f9c6139f9a1198f80b28 /include/net/dsa.h | |
parent | 905b464ad9008905db099f90ae20f373c7051804 (diff) |
net: dsa: Split platform data to header file
Instead of having net/dsa.h contain both the internal switch tree/driver
structures, split the relevant platform_data parts into
include/linux/platform_data/dsa.h and make that header be included by
net/dsa.h in order not to break any setup. A subsequent set of patches
will update code including net/dsa.h to include only the platform_data
header.
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.h | 61 |
1 files changed, 1 insertions, 60 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index 2f1daf29131a..7f2a668ef2cc 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/ethtool.h> | 21 | #include <linux/ethtool.h> |
22 | #include <linux/net_tstamp.h> | 22 | #include <linux/net_tstamp.h> |
23 | #include <linux/phy.h> | 23 | #include <linux/phy.h> |
24 | #include <linux/platform_data/dsa.h> | ||
24 | #include <net/devlink.h> | 25 | #include <net/devlink.h> |
25 | #include <net/switchdev.h> | 26 | #include <net/switchdev.h> |
26 | 27 | ||
@@ -44,66 +45,6 @@ enum dsa_tag_protocol { | |||
44 | DSA_TAG_LAST, /* MUST BE LAST */ | 45 | DSA_TAG_LAST, /* MUST BE LAST */ |
45 | }; | 46 | }; |
46 | 47 | ||
47 | #define DSA_MAX_SWITCHES 4 | ||
48 | #define DSA_MAX_PORTS 12 | ||
49 | |||
50 | #define DSA_RTABLE_NONE -1 | ||
51 | |||
52 | struct dsa_chip_data { | ||
53 | /* | ||
54 | * How to access the switch configuration registers. | ||
55 | */ | ||
56 | struct device *host_dev; | ||
57 | int sw_addr; | ||
58 | |||
59 | /* | ||
60 | * Reference to network devices | ||
61 | */ | ||
62 | struct device *netdev[DSA_MAX_PORTS]; | ||
63 | |||
64 | /* set to size of eeprom if supported by the switch */ | ||
65 | int eeprom_len; | ||
66 | |||
67 | /* Device tree node pointer for this specific switch chip | ||
68 | * used during switch setup in case additional properties | ||
69 | * and resources needs to be used | ||
70 | */ | ||
71 | struct device_node *of_node; | ||
72 | |||
73 | /* | ||
74 | * The names of the switch's ports. Use "cpu" to | ||
75 | * designate the switch port that the cpu is connected to, | ||
76 | * "dsa" to indicate that this port is a DSA link to | ||
77 | * another switch, NULL to indicate the port is unused, | ||
78 | * or any other string to indicate this is a physical port. | ||
79 | */ | ||
80 | char *port_names[DSA_MAX_PORTS]; | ||
81 | struct device_node *port_dn[DSA_MAX_PORTS]; | ||
82 | |||
83 | /* | ||
84 | * An array of which element [a] indicates which port on this | ||
85 | * switch should be used to send packets to that are destined | ||
86 | * for switch a. Can be NULL if there is only one switch chip. | ||
87 | */ | ||
88 | s8 rtable[DSA_MAX_SWITCHES]; | ||
89 | }; | ||
90 | |||
91 | struct dsa_platform_data { | ||
92 | /* | ||
93 | * Reference to a Linux network interface that connects | ||
94 | * to the root switch chip of the tree. | ||
95 | */ | ||
96 | struct device *netdev; | ||
97 | struct net_device *of_netdev; | ||
98 | |||
99 | /* | ||
100 | * Info structs describing each of the switch chips | ||
101 | * connected via this network interface. | ||
102 | */ | ||
103 | int nr_chips; | ||
104 | struct dsa_chip_data *chip; | ||
105 | }; | ||
106 | |||
107 | struct packet_type; | 48 | struct packet_type; |
108 | struct dsa_switch; | 49 | struct dsa_switch; |
109 | 50 | ||