47715dcc28445cff034ab37637bf5fd7c2feb491
[openwrt/openwrt.git] / target / linux / generic / hack-4.9 / 700-swconfig_switch_drivers.patch
1 From 36e516290611e613aa92996cb4339561452695b4 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Fri, 7 Jul 2017 17:24:23 +0200
4 Subject: net: swconfig: adds openwrt switch layer
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8 drivers/net/phy/Kconfig | 83 +++++++++++++++++++++++++++++++++++++++++++++++
9 drivers/net/phy/Makefile | 15 +++++++++
10 include/uapi/linux/Kbuild | 1 +
11 3 files changed, 99 insertions(+)
12
13 diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
14 index 2651c8d8de2f..a920adb78fea 100644
15 --- a/drivers/net/phy/Kconfig
16 +++ b/drivers/net/phy/Kconfig
17 @@ -147,6 +147,89 @@ config MDIO_XGENE
18 This module provides a driver for the MDIO busses found in the
19 APM X-Gene SoC's.
20
21 +comment "Switch configuration API + drivers"
22 +
23 +config SWCONFIG
24 + tristate "Switch configuration API"
25 + ---help---
26 + Switch configuration API using netlink. This allows
27 + you to configure the VLAN features of certain switches.
28 +
29 +config SWCONFIG_LEDS
30 + bool "Switch LED trigger support"
31 + depends on (SWCONFIG && LEDS_TRIGGERS)
32 +
33 +config ADM6996_PHY
34 + tristate "Driver for ADM6996 switches"
35 + select SWCONFIG
36 + ---help---
37 + Currently supports the ADM6996FC and ADM6996M switches.
38 + Support for FC is very limited.
39 +
40 +config AR8216_PHY
41 + tristate "Driver for Atheros AR8216 switches"
42 + select ETHERNET_PACKET_MANGLE
43 + select SWCONFIG
44 +
45 +config AR8216_PHY_LEDS
46 + bool "Atheros AR8216 switch LED support"
47 + depends on (AR8216_PHY && LEDS_CLASS)
48 +
49 +source "drivers/net/phy/b53/Kconfig"
50 +
51 +config IP17XX_PHY
52 + tristate "Driver for IC+ IP17xx switches"
53 + select SWCONFIG
54 +
55 +config MVSWITCH_PHY
56 + tristate "Driver for Marvell 88E6060 switches"
57 + select ETHERNET_PACKET_MANGLE
58 +
59 +config MVSW61XX_PHY
60 + tristate "Driver for Marvell 88E6171/6172 switches"
61 + select SWCONFIG
62 +
63 +config PSB6970_PHY
64 + tristate "Lantiq XWAY Tantos (PSB6970) Ethernet switch"
65 + select SWCONFIG
66 + select ETHERNET_PACKET_MANGLE
67 +
68 +config RTL8306_PHY
69 + tristate "Driver for Realtek RTL8306S switches"
70 + select SWCONFIG
71 +
72 +config RTL8366_SMI
73 + tristate "Driver for the RTL8366 SMI interface"
74 + depends on GPIOLIB
75 + ---help---
76 + This module implements the SMI interface protocol which is used
77 + by some RTL8366 ethernet switch devices via the generic GPIO API.
78 +
79 +if RTL8366_SMI
80 +
81 +config RTL8366_SMI_DEBUG_FS
82 + bool "RTL8366 SMI interface debugfs support"
83 + depends on DEBUG_FS
84 + default n
85 +
86 +config RTL8366S_PHY
87 + tristate "Driver for the Realtek RTL8366S switch"
88 + select SWCONFIG
89 +
90 +config RTL8366RB_PHY
91 + tristate "Driver for the Realtek RTL8366RB switch"
92 + select SWCONFIG
93 +
94 +config RTL8367_PHY
95 + tristate "Driver for the Realtek RTL8367R/M switches"
96 + select SWCONFIG
97 +
98 +config RTL8367B_PHY
99 + tristate "Driver fot the Realtek RTL8367R-VB switch"
100 + select SWCONFIG
101 +
102 +endif # RTL8366_SMI
103 +
104 comment "MII PHY device drivers"
105
106 config AMD_PHY
107 diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
108 index e58667d111e7..542b6be8953a 100644
109 --- a/drivers/net/phy/Makefile
110 +++ b/drivers/net/phy/Makefile
111 @@ -5,6 +5,21 @@ libphy-$(CONFIG_SWPHY) += swphy.o
112
113 obj-$(CONFIG_PHYLIB) += libphy.o
114
115 +obj-$(CONFIG_SWCONFIG) += swconfig.o
116 +obj-$(CONFIG_ADM6996_PHY) += adm6996.o
117 +obj-$(CONFIG_AR8216_PHY) += ar8216.o ar8327.o
118 +obj-$(CONFIG_SWCONFIG_B53) += b53/
119 +obj-$(CONFIG_IP17XX_PHY) += ip17xx.o
120 +obj-$(CONFIG_MVSWITCH_PHY) += mvswitch.o
121 +obj-$(CONFIG_MVSW61XX_PHY) += mvsw61xx.o
122 +obj-$(CONFIG_PSB6970_PHY) += psb6970.o
123 +obj-$(CONFIG_RTL8306_PHY) += rtl8306.o
124 +obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o
125 +obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o
126 +obj-$(CONFIG_RTL8366RB_PHY) += rtl8366rb.o
127 +obj-$(CONFIG_RTL8367_PHY) += rtl8367.o
128 +obj-$(CONFIG_RTL8367B_PHY) += rtl8367b.o
129 +
130 obj-$(CONFIG_MDIO_BCM_IPROC) += mdio-bcm-iproc.o
131 obj-$(CONFIG_MDIO_BCM_UNIMAC) += mdio-bcm-unimac.o
132 obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o
133 diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
134 index cd2be1c8e9fb..ccdd8d586ab8 100644
135 --- a/include/uapi/linux/Kbuild
136 +++ b/include/uapi/linux/Kbuild
137 @@ -399,6 +399,7 @@ header-y += stddef.h
138 header-y += string.h
139 header-y += suspend_ioctls.h
140 header-y += swab.h
141 +header-y += switch.h
142 header-y += synclink.h
143 header-y += sync_file.h
144 header-y += sysctl.h
145 --
146 2.11.0
147