aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2019-01-15 18:06:11 -0500
committerDavid S. Miller <davem@davemloft.net>2019-01-17 14:31:24 -0500
commitecfc937210e5fdc6554e49b2a735ff22e72ae3f0 (patch)
tree4f85d9b964ab0864fec2f9c6139f9a1198f80b28 /include/linux/platform_data
parent905b464ad9008905db099f90ae20f373c7051804 (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/linux/platform_data')
-rw-r--r--include/linux/platform_data/dsa.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/linux/platform_data/dsa.h b/include/linux/platform_data/dsa.h
new file mode 100644
index 000000000000..d4d9bf2060a6
--- /dev/null
+++ b/include/linux/platform_data/dsa.h
@@ -0,0 +1,68 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __DSA_PDATA_H
3#define __DSA_PDATA_H
4
5struct device;
6struct net_device;
7
8#define DSA_MAX_SWITCHES 4
9#define DSA_MAX_PORTS 12
10#define DSA_RTABLE_NONE -1
11
12struct dsa_chip_data {
13 /*
14 * How to access the switch configuration registers.
15 */
16 struct device *host_dev;
17 int sw_addr;
18
19 /*
20 * Reference to network devices
21 */
22 struct device *netdev[DSA_MAX_PORTS];
23
24 /* set to size of eeprom if supported by the switch */
25 int eeprom_len;
26
27 /* Device tree node pointer for this specific switch chip
28 * used during switch setup in case additional properties
29 * and resources needs to be used
30 */
31 struct device_node *of_node;
32
33 /*
34 * The names of the switch's ports. Use "cpu" to
35 * designate the switch port that the cpu is connected to,
36 * "dsa" to indicate that this port is a DSA link to
37 * another switch, NULL to indicate the port is unused,
38 * or any other string to indicate this is a physical port.
39 */
40 char *port_names[DSA_MAX_PORTS];
41 struct device_node *port_dn[DSA_MAX_PORTS];
42
43 /*
44 * An array of which element [a] indicates which port on this
45 * switch should be used to send packets to that are destined
46 * for switch a. Can be NULL if there is only one switch chip.
47 */
48 s8 rtable[DSA_MAX_SWITCHES];
49};
50
51struct dsa_platform_data {
52 /*
53 * Reference to a Linux network interface that connects
54 * to the root switch chip of the tree.
55 */
56 struct device *netdev;
57 struct net_device *of_netdev;
58
59 /*
60 * Info structs describing each of the switch chips
61 * connected via this network interface.
62 */
63 int nr_chips;
64 struct dsa_chip_data *chip;
65};
66
67
68#endif /* __DSA_PDATA_H */