summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 21:24:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 21:24:39 -0400
commit496322bc91e35007ed754184dcd447a02b6dd685 (patch)
treef5298d0a74c0a6e65c0e98050b594b8d020904c1 /arch
parent2e17c5a97e231f3cb426f4b7895eab5be5c5442e (diff)
parent56e0ef527b184b3de2d7f88c6190812b2b2ac6bf (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "This is a re-do of the net-next pull request for the current merge window. The only difference from the one I made the other day is that this has Eliezer's interface renames and the timeout handling changes made based upon your feedback, as well as a few bug fixes that have trickeled in. Highlights: 1) Low latency device polling, eliminating the cost of interrupt handling and context switches. Allows direct polling of a network device from socket operations, such as recvmsg() and poll(). Currently ixgbe, mlx4, and bnx2x support this feature. Full high level description, performance numbers, and design in commit 0a4db187a999 ("Merge branch 'll_poll'") From Eliezer Tamir. 2) With the routing cache removed, ip_check_mc_rcu() gets exercised more than ever before in the case where we have lots of multicast addresses. Use a hash table instead of a simple linked list, from Eric Dumazet. 3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski, Marek Puzyniak, Michal Kazior, and Sujith Manoharan. 4) Support reporting the TUN device persist flag to userspace, from Pavel Emelyanov. 5) Allow controlling network device VF link state using netlink, from Rony Efraim. 6) Support GRE tunneling in openvswitch, from Pravin B Shelar. 7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from Daniel Borkmann and Eric Dumazet. 8) Allow controlling of TCP quickack behavior on a per-route basis, from Cong Wang. 9) Several bug fixes and improvements to vxlan from Stephen Hemminger, Pravin B Shelar, and Mike Rapoport. In particular, support receiving on multiple UDP ports. 10) Major cleanups, particular in the area of debugging and cookie lifetime handline, to the SCTP protocol code. From Daniel Borkmann. 11) Allow packets to cross network namespaces when traversing tunnel devices. From Nicolas Dichtel. 12) Allow monitoring netlink traffic via AF_PACKET sockets, in a manner akin to how we monitor real network traffic via ptype_all. From Daniel Borkmann. 13) Several bug fixes and improvements for the new alx device driver, from Johannes Berg. 14) Fix scalability issues in the netem packet scheduler's time queue, by using an rbtree. From Eric Dumazet. 15) Several bug fixes in TCP loss recovery handling, from Yuchung Cheng. 16) Add support for GSO segmentation of MPLS packets, from Simon Horman. 17) Make network notifiers have a real data type for the opaque pointer that's passed into them. Use this to properly handle network device flag changes in arp_netdev_event(). From Jiri Pirko and Timo Teräs. 18) Convert several drivers over to module_pci_driver(), from Peter Huewe. 19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a O(1) calculation instead. From Eric Dumazet. 20) Support setting of explicit tunnel peer addresses in ipv6, just like ipv4. From Nicolas Dichtel. 21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet. 22) Prevent a single high rate flow from overruning an individual cpu during RX packet processing via selective flow shedding. From Willem de Bruijn. 23) Don't use spinlocks in TCP md5 signing fast paths, from Eric Dumazet. 24) Don't just drop GSO packets which are above the TBF scheduler's burst limit, chop them up so they are in-bounds instead. Also from Eric Dumazet. 25) VLAN offloads are missed when configured on top of a bridge, fix from Vlad Yasevich. 26) Support IPV6 in ping sockets. From Lorenzo Colitti. 27) Receive flow steering targets should be updated at poll() time too, from David Majnemer. 28) Fix several corner case regressions in PMTU/redirect handling due to the routing cache removal, from Timo Teräs. 29) We have to be mindful of ipv4 mapped ipv6 sockets in upd_v6_push_pending_frames(). From Hannes Frederic Sowa. 30) Fix L2TP sequence number handling bugs, from James Chapman." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits) drivers/net: caif: fix wrong rtnl_is_locked() usage drivers/net: enic: release rtnl_lock on error-path vhost-net: fix use-after-free in vhost_net_flush net: mv643xx_eth: do not use port number as platform device id net: sctp: confirm route during forward progress virtio_net: fix race in RX VQ processing virtio: support unlocked queue poll net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit Documentation: Fix references to defunct linux-net@vger.kernel.org net/fs: change busy poll time accounting net: rename low latency sockets functions to busy poll bridge: fix some kernel warning in multicast timer sfc: Fix memory leak when discarding scattered packets sit: fix tunnel update via netlink dt:net:stmmac: Add dt specific phy reset callback support. dt:net:stmmac: Add support to dwmac version 3.610 and 3.710 dt:net:stmmac: Allocate platform data only if its NULL. net:stmmac: fix memleak in the open method ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available net: ipv6: fix wrong ping_v6_sendmsg return value ...
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/uapi/asm/socket.h2
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts2
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts2
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts10
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts12
-rw-r--r--arch/arm/boot/dts/sun4i-a10-cubieboard.dts15
-rw-r--r--arch/arm/boot/dts/sun4i-a10-hackberry.dts41
-rw-r--r--arch/arm/boot/dts/sun4i-a10.dtsi27
-rw-r--r--arch/arm/configs/omap2plus_defconfig1
-rw-r--r--arch/arm/mach-imx/Kconfig4
-rw-r--r--arch/arm/mach-imx/devices-imx25.h8
-rw-r--r--arch/arm/mach-imx/devices-imx35.h8
-rw-r--r--arch/arm/mach-imx/devices/Kconfig1
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h4
-rw-r--r--arch/arm/mach-imx/devices/platform-flexcan.c5
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c2
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c2
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c2
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c2
-rw-r--r--arch/arm/mach-mxs/Kconfig1
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c50
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c2
-rw-r--r--arch/arm/net/bpf_jit_32.c18
-rw-r--r--arch/avr32/include/uapi/asm/socket.h2
-rw-r--r--arch/cris/arch-v10/drivers/Kconfig4
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig4
-rw-r--r--arch/cris/include/uapi/asm/socket.h2
-rw-r--r--arch/frv/include/uapi/asm/socket.h2
-rw-r--r--arch/h8300/include/uapi/asm/socket.h2
-rw-r--r--arch/ia64/hp/sim/simeth.c2
-rw-r--r--arch/ia64/include/uapi/asm/socket.h2
-rw-r--r--arch/m32r/include/uapi/asm/socket.h2
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c4
-rw-r--r--arch/mips/bcm63xx/dev-enet.c181
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h7
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h122
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h93
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h2
-rw-r--r--arch/mips/include/uapi/asm/socket.h2
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c3
-rw-r--r--arch/mn10300/include/uapi/asm/socket.h2
-rw-r--r--arch/parisc/include/uapi/asm/socket.h2
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/include/uapi/asm/socket.h2
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c19
-rw-r--r--arch/s390/include/uapi/asm/socket.h2
-rw-r--r--arch/sh/boards/board-espt.c2
-rw-r--r--arch/sh/boards/board-sh7757lcr.c8
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c4
-rw-r--r--arch/sh/boards/mach-se/770x/setup.c8
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c4
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c2
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7734.c2
-rw-r--r--arch/sparc/include/uapi/asm/socket.h2
-rw-r--r--arch/sparc/net/bpf_jit_comp.c20
-rw-r--r--arch/x86/net/bpf_jit_comp.c61
-rw-r--r--arch/xtensa/include/uapi/asm/socket.h2
62 files changed, 619 insertions, 193 deletions
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index eee6ea76bdaf..4885825e498d 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46
85
84#endif /* _UAPI_ASM_SOCKET_H */ 86#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 04feaf8f1420..444b4ede0d60 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -214,10 +214,12 @@
214 214
215&cpsw_emac0 { 215&cpsw_emac0 {
216 phy_id = <&davinci_mdio>, <0>; 216 phy_id = <&davinci_mdio>, <0>;
217 phy-mode = "mii";
217}; 218};
218 219
219&cpsw_emac1 { 220&cpsw_emac1 {
220 phy_id = <&davinci_mdio>, <1>; 221 phy_id = <&davinci_mdio>, <1>;
222 phy-mode = "mii";
221}; 223};
222 224
223&mac { 225&mac {
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index a16bb9691cc6..904ba83ef66d 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -467,8 +467,10 @@
467 467
468&cpsw_emac0 { 468&cpsw_emac0 {
469 phy_id = <&davinci_mdio>, <0>; 469 phy_id = <&davinci_mdio>, <0>;
470 phy-mode = "rgmii-txid";
470}; 471};
471 472
472&cpsw_emac1 { 473&cpsw_emac1 {
473 phy_id = <&davinci_mdio>, <1>; 474 phy_id = <&davinci_mdio>, <1>;
475 phy-mode = "rgmii-txid";
474}; 476};
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 9e00eef9b74b..0c8ad173d2b0 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -392,3 +392,13 @@
392 pinctrl-0 = <&davinci_mdio_default>; 392 pinctrl-0 = <&davinci_mdio_default>;
393 pinctrl-1 = <&davinci_mdio_sleep>; 393 pinctrl-1 = <&davinci_mdio_sleep>;
394}; 394};
395
396&cpsw_emac0 {
397 phy_id = <&davinci_mdio>, <0>;
398 phy-mode = "rgmii-txid";
399};
400
401&cpsw_emac1 {
402 phy_id = <&davinci_mdio>, <1>;
403 phy-mode = "rgmii-txid";
404};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 3637bf3b1d59..1f0d38d7b16f 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -155,12 +155,14 @@
155 can0: can@80032000 { 155 can0: can@80032000 {
156 pinctrl-names = "default"; 156 pinctrl-names = "default";
157 pinctrl-0 = <&can0_pins_a>; 157 pinctrl-0 = <&can0_pins_a>;
158 xceiver-supply = <&reg_can_3v3>;
158 status = "okay"; 159 status = "okay";
159 }; 160 };
160 161
161 can1: can@80034000 { 162 can1: can@80034000 {
162 pinctrl-names = "default"; 163 pinctrl-names = "default";
163 pinctrl-0 = <&can1_pins_a>; 164 pinctrl-0 = <&can1_pins_a>;
165 xceiver-supply = <&reg_can_3v3>;
164 status = "okay"; 166 status = "okay";
165 }; 167 };
166 }; 168 };
@@ -319,6 +321,16 @@
319 gpio = <&gpio3 30 0>; 321 gpio = <&gpio3 30 0>;
320 enable-active-high; 322 enable-active-high;
321 }; 323 };
324
325 reg_can_3v3: can-3v3 {
326 compatible = "regulator-fixed";
327 regulator-name = "can-3v3";
328 regulator-min-microvolt = <3300000>;
329 regulator-max-microvolt = <3300000>;
330 gpio = <&gpio2 13 0>;
331 enable-active-high;
332 };
333
322 }; 334 };
323 335
324 sound { 336 sound {
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index 0e22a285dfe0..757c4cd900ee 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -27,6 +27,21 @@
27 }; 27 };
28 28
29 soc@01c20000 { 29 soc@01c20000 {
30 emac: ethernet@01c0b000 {
31 pinctrl-names = "default";
32 pinctrl-0 = <&emac_pins_a>;
33 phy = <&phy1>;
34 status = "okay";
35 };
36
37 mdio@01c0b080 {
38 status = "okay";
39
40 phy1: ethernet-phy@1 {
41 reg = <1>;
42 };
43 };
44
30 pinctrl@01c20800 { 45 pinctrl@01c20800 {
31 led_pins_cubieboard: led_pins@0 { 46 led_pins_cubieboard: led_pins@0 {
32 allwinner,pins = "PH20", "PH21"; 47 allwinner,pins = "PH20", "PH21";
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
index b9efac100c85..3514b37d66bc 100644
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -23,10 +23,51 @@
23 }; 23 };
24 24
25 soc@01c20000 { 25 soc@01c20000 {
26 emac: ethernet@01c0b000 {
27 pinctrl-names = "default";
28 pinctrl-0 = <&emac_pins_a>;
29 phy = <&phy0>;
30 status = "okay";
31 };
32
33 mdio@01c0b080 {
34 phy-supply = <&reg_emac_3v3>;
35 status = "okay";
36
37 phy0: ethernet-phy@0 {
38 reg = <0>;
39 };
40 };
41
42 pio: pinctrl@01c20800 {
43 pinctrl-names = "default";
44 pinctrl-0 = <&hackberry_hogs>;
45
46 hackberry_hogs: hogs@0 {
47 allwinner,pins = "PH19";
48 allwinner,function = "gpio_out";
49 allwinner,drive = <0>;
50 allwinner,pull = <0>;
51 };
52 };
53
26 uart0: serial@01c28000 { 54 uart0: serial@01c28000 {
27 pinctrl-names = "default"; 55 pinctrl-names = "default";
28 pinctrl-0 = <&uart0_pins_a>; 56 pinctrl-0 = <&uart0_pins_a>;
29 status = "okay"; 57 status = "okay";
30 }; 58 };
31 }; 59 };
60
61 regulators {
62 compatible = "simple-bus";
63
64 reg_emac_3v3: emac-3v3 {
65 compatible = "regulator-fixed";
66 regulator-name = "emac-3v3";
67 regulator-min-microvolt = <3300000>;
68 regulator-max-microvolt = <3300000>;
69 enable-active-high;
70 gpio = <&pio 7 19 0>;
71 };
72 };
32}; 73};
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 82e03d22f913..b2bd6e124250 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -167,6 +167,22 @@
167 reg = <0x01c20000 0x300000>; 167 reg = <0x01c20000 0x300000>;
168 ranges; 168 ranges;
169 169
170 emac: ethernet@01c0b000 {
171 compatible = "allwinner,sun4i-emac";
172 reg = <0x01c0b000 0x1000>;
173 interrupts = <55>;
174 clocks = <&ahb_gates 17>;
175 status = "disabled";
176 };
177
178 mdio@01c0b080 {
179 compatible = "allwinner,sun4i-mdio";
180 reg = <0x01c0b080 0x14>;
181 status = "disabled";
182 #address-cells = <1>;
183 #size-cells = <0>;
184 };
185
170 intc: interrupt-controller@01c20400 { 186 intc: interrupt-controller@01c20400 {
171 compatible = "allwinner,sun4i-ic"; 187 compatible = "allwinner,sun4i-ic";
172 reg = <0x01c20400 0x400>; 188 reg = <0x01c20400 0x400>;
@@ -226,6 +242,17 @@
226 allwinner,drive = <0>; 242 allwinner,drive = <0>;
227 allwinner,pull = <0>; 243 allwinner,pull = <0>;
228 }; 244 };
245
246 emac_pins_a: emac0@0 {
247 allwinner,pins = "PA0", "PA1", "PA2",
248 "PA3", "PA4", "PA5", "PA6",
249 "PA7", "PA8", "PA9", "PA10",
250 "PA11", "PA12", "PA13", "PA14",
251 "PA15", "PA16";
252 allwinner,function = "emac";
253 allwinner,drive = <0>;
254 allwinner,pull = <0>;
255 };
229 }; 256 };
230 257
231 timer@01c20c00 { 258 timer@01c20c00 {
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 2ac0ffb12f03..a24c02443920 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -286,3 +286,4 @@ CONFIG_SOC_OMAP5=y
286CONFIG_TI_DAVINCI_MDIO=y 286CONFIG_TI_DAVINCI_MDIO=y
287CONFIG_TI_DAVINCI_CPDMA=y 287CONFIG_TI_DAVINCI_CPDMA=y
288CONFIG_TI_CPSW=y 288CONFIG_TI_CPSW=y
289CONFIG_AT803X_PHY=y
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 60661a4b0e24..f54656091a9d 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -108,7 +108,6 @@ config SOC_IMX25
108 select ARCH_MXC_IOMUX_V3 108 select ARCH_MXC_IOMUX_V3
109 select COMMON_CLK 109 select COMMON_CLK
110 select CPU_ARM926T 110 select CPU_ARM926T
111 select HAVE_CAN_FLEXCAN if CAN
112 select MXC_AVIC 111 select MXC_AVIC
113 112
114config SOC_IMX27 113config SOC_IMX27
@@ -134,7 +133,6 @@ config SOC_IMX35
134 select ARCH_MXC_IOMUX_V3 133 select ARCH_MXC_IOMUX_V3
135 select COMMON_CLK 134 select COMMON_CLK
136 select CPU_V6K 135 select CPU_V6K
137 select HAVE_CAN_FLEXCAN if CAN
138 select HAVE_EPIT 136 select HAVE_EPIT
139 select MXC_AVIC 137 select MXC_AVIC
140 select SMP_ON_UP if SMP 138 select SMP_ON_UP if SMP
@@ -774,7 +772,6 @@ comment "Device tree only"
774 772
775config SOC_IMX53 773config SOC_IMX53
776 bool "i.MX53 support" 774 bool "i.MX53 support"
777 select HAVE_CAN_FLEXCAN if CAN
778 select HAVE_IMX_SRC 775 select HAVE_IMX_SRC
779 select IMX_HAVE_PLATFORM_IMX2_WDT 776 select IMX_HAVE_PLATFORM_IMX2_WDT
780 select PINCTRL 777 select PINCTRL
@@ -797,7 +794,6 @@ config SOC_IMX6Q
797 select CPU_V7 794 select CPU_V7
798 select HAVE_ARM_SCU if SMP 795 select HAVE_ARM_SCU if SMP
799 select HAVE_ARM_TWD if LOCAL_TIMERS 796 select HAVE_ARM_TWD if LOCAL_TIMERS
800 select HAVE_CAN_FLEXCAN if CAN
801 select HAVE_IMX_ANATOP 797 select HAVE_IMX_ANATOP
802 select HAVE_IMX_GPC 798 select HAVE_IMX_GPC
803 select HAVE_IMX_MMDC 799 select HAVE_IMX_MMDC
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index 0d2922bc575c..769563fdeaa0 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -13,10 +13,10 @@ extern const struct imx_fec_data imx25_fec_data;
13 imx_add_fec(&imx25_fec_data, pdata) 13 imx_add_fec(&imx25_fec_data, pdata)
14 14
15extern const struct imx_flexcan_data imx25_flexcan_data[]; 15extern const struct imx_flexcan_data imx25_flexcan_data[];
16#define imx25_add_flexcan(id, pdata) \ 16#define imx25_add_flexcan(id) \
17 imx_add_flexcan(&imx25_flexcan_data[id], pdata) 17 imx_add_flexcan(&imx25_flexcan_data[id])
18#define imx25_add_flexcan0(pdata) imx25_add_flexcan(0, pdata) 18#define imx25_add_flexcan0() imx25_add_flexcan(0)
19#define imx25_add_flexcan1(pdata) imx25_add_flexcan(1, pdata) 19#define imx25_add_flexcan1() imx25_add_flexcan(1)
20 20
21extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data; 21extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data;
22#define imx25_add_fsl_usb2_udc(pdata) \ 22#define imx25_add_fsl_usb2_udc(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx35.h b/arch/arm/mach-imx/devices-imx35.h
index e2675f1b141c..780d8240281b 100644
--- a/arch/arm/mach-imx/devices-imx35.h
+++ b/arch/arm/mach-imx/devices-imx35.h
@@ -17,10 +17,10 @@ extern const struct imx_fsl_usb2_udc_data imx35_fsl_usb2_udc_data;
17 imx_add_fsl_usb2_udc(&imx35_fsl_usb2_udc_data, pdata) 17 imx_add_fsl_usb2_udc(&imx35_fsl_usb2_udc_data, pdata)
18 18
19extern const struct imx_flexcan_data imx35_flexcan_data[]; 19extern const struct imx_flexcan_data imx35_flexcan_data[];
20#define imx35_add_flexcan(id, pdata) \ 20#define imx35_add_flexcan(id) \
21 imx_add_flexcan(&imx35_flexcan_data[id], pdata) 21 imx_add_flexcan(&imx35_flexcan_data[id])
22#define imx35_add_flexcan0(pdata) imx35_add_flexcan(0, pdata) 22#define imx35_add_flexcan0() imx35_add_flexcan(0)
23#define imx35_add_flexcan1(pdata) imx35_add_flexcan(1, pdata) 23#define imx35_add_flexcan1() imx35_add_flexcan(1)
24 24
25extern const struct imx_imx2_wdt_data imx35_imx2_wdt_data; 25extern const struct imx_imx2_wdt_data imx35_imx2_wdt_data;
26#define imx35_add_imx2_wdt() \ 26#define imx35_add_imx2_wdt() \
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index 3dd2b1b041d1..68c74fb0373c 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -4,7 +4,6 @@ config IMX_HAVE_PLATFORM_FEC
4 4
5config IMX_HAVE_PLATFORM_FLEXCAN 5config IMX_HAVE_PLATFORM_FLEXCAN
6 bool 6 bool
7 select HAVE_CAN_FLEXCAN if CAN
8 7
9config IMX_HAVE_PLATFORM_FSL_USB2_UDC 8config IMX_HAVE_PLATFORM_FSL_USB2_UDC
10 bool 9 bool
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index 453e20bc2657..c13b76b9f6b3 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -50,7 +50,6 @@ struct platform_device *__init imx_add_fec(
50 const struct imx_fec_data *data, 50 const struct imx_fec_data *data,
51 const struct fec_platform_data *pdata); 51 const struct fec_platform_data *pdata);
52 52
53#include <linux/can/platform/flexcan.h>
54struct imx_flexcan_data { 53struct imx_flexcan_data {
55 int id; 54 int id;
56 resource_size_t iobase; 55 resource_size_t iobase;
@@ -58,8 +57,7 @@ struct imx_flexcan_data {
58 resource_size_t irq; 57 resource_size_t irq;
59}; 58};
60struct platform_device *__init imx_add_flexcan( 59struct platform_device *__init imx_add_flexcan(
61 const struct imx_flexcan_data *data, 60 const struct imx_flexcan_data *data);
62 const struct flexcan_platform_data *pdata);
63 61
64#include <linux/fsl_devices.h> 62#include <linux/fsl_devices.h>
65struct imx_fsl_usb2_udc_data { 63struct imx_fsl_usb2_udc_data {
diff --git a/arch/arm/mach-imx/devices/platform-flexcan.c b/arch/arm/mach-imx/devices/platform-flexcan.c
index 1078bf0a94ef..55d61eaf63c6 100644
--- a/arch/arm/mach-imx/devices/platform-flexcan.c
+++ b/arch/arm/mach-imx/devices/platform-flexcan.c
@@ -38,8 +38,7 @@ const struct imx_flexcan_data imx35_flexcan_data[] __initconst = {
38#endif /* ifdef CONFIG_SOC_IMX35 */ 38#endif /* ifdef CONFIG_SOC_IMX35 */
39 39
40struct platform_device *__init imx_add_flexcan( 40struct platform_device *__init imx_add_flexcan(
41 const struct imx_flexcan_data *data, 41 const struct imx_flexcan_data *data)
42 const struct flexcan_platform_data *pdata)
43{ 42{
44 struct resource res[] = { 43 struct resource res[] = {
45 { 44 {
@@ -54,5 +53,5 @@ struct platform_device *__init imx_add_flexcan(
54 }; 53 };
55 54
56 return imx_add_platform_device("flexcan", data->id, 55 return imx_add_platform_device("flexcan", data->id,
57 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 56 res, ARRAY_SIZE(res), NULL, 0);
58} 57}
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index e2b70f4c1a2c..e77cc3af6db2 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -279,7 +279,7 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
279 imx25_add_imx_fb(&eukrea_mximxsd_fb_pdata); 279 imx25_add_imx_fb(&eukrea_mximxsd_fb_pdata);
280 imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); 280 imx25_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
281 281
282 imx25_add_flexcan1(NULL); 282 imx25_add_flexcan1();
283 imx25_add_sdhci_esdhc_imx(0, &sd1_pdata); 283 imx25_add_sdhci_esdhc_imx(0, &sd1_pdata);
284 284
285 gpio_request(GPIO_LED1, "LED1"); 285 gpio_request(GPIO_LED1, "LED1");
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index 5a2d5ef12dd5..14d6c8249b76 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -287,7 +287,7 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
287 287
288 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata); 288 imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
289 289
290 imx35_add_flexcan1(NULL); 290 imx35_add_flexcan1();
291 imx35_add_sdhci_esdhc_imx(0, &sd1_pdata); 291 imx35_add_sdhci_esdhc_imx(0, &sd1_pdata);
292 292
293 gpio_request(GPIO_LED1, "LED1"); 293 gpio_request(GPIO_LED1, "LED1");
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index 8bcda688a006..13490c203050 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -249,7 +249,7 @@ static void __init mx25pdk_init(void)
249 imx25_add_imx_i2c0(&mx25_3ds_i2c0_data); 249 imx25_add_imx_i2c0(&mx25_3ds_i2c0_data);
250 250
251 gpio_request_one(MX25PDK_CAN_PWDN, GPIOF_OUT_INIT_LOW, "can-pwdn"); 251 gpio_request_one(MX25PDK_CAN_PWDN, GPIOF_OUT_INIT_LOW, "can-pwdn");
252 imx25_add_flexcan0(NULL); 252 imx25_add_flexcan0();
253} 253}
254 254
255static void __init mx25pdk_timer_init(void) 255static void __init mx25pdk_timer_init(void)
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 8ed533f0f8ca..b726cb1c5fdd 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -385,7 +385,7 @@ static void __init pcm043_init(void)
385 if (!otg_mode_host) 385 if (!otg_mode_host)
386 imx35_add_fsl_usb2_udc(&otg_device_pdata); 386 imx35_add_fsl_usb2_udc(&otg_device_pdata);
387 387
388 imx35_add_flexcan1(NULL); 388 imx35_add_flexcan1();
389 imx35_add_sdhci_esdhc_imx(0, &sd1_pdata); 389 imx35_add_sdhci_esdhc_imx(0, &sd1_pdata);
390} 390}
391 391
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 616fe0210da1..8cde9e05b5d6 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -10,7 +10,6 @@ config SOC_IMX28
10 select ARM_AMBA 10 select ARM_AMBA
11 select ARM_CPU_SUSPEND if PM 11 select ARM_CPU_SUSPEND if PM
12 select CPU_ARM926T 12 select CPU_ARM926T
13 select HAVE_CAN_FLEXCAN if CAN
14 select PINCTRL_IMX28 13 select PINCTRL_IMX28
15 14
16config ARCH_MXS 15config ARCH_MXS
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 6298adb8d335..4ce27b536dc9 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -14,7 +14,6 @@
14#include <linux/clk/mxs.h> 14#include <linux/clk/mxs.h>
15#include <linux/clkdev.h> 15#include <linux/clkdev.h>
16#include <linux/clocksource.h> 16#include <linux/clocksource.h>
17#include <linux/can/platform/flexcan.h>
18#include <linux/delay.h> 17#include <linux/delay.h>
19#include <linux/err.h> 18#include <linux/err.h>
20#include <linux/gpio.h> 19#include <linux/gpio.h>
@@ -77,41 +76,6 @@ static inline void __mxs_togl(u32 mask, void __iomem *reg)
77 __raw_writel(mask, reg + MXS_TOG_ADDR); 76 __raw_writel(mask, reg + MXS_TOG_ADDR);
78} 77}
79 78
80/*
81 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
82 */
83#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
84
85static int flexcan0_en, flexcan1_en;
86
87static void mx28evk_flexcan_switch(void)
88{
89 if (flexcan0_en || flexcan1_en)
90 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
91 else
92 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
93}
94
95static void mx28evk_flexcan0_switch(int enable)
96{
97 flexcan0_en = enable;
98 mx28evk_flexcan_switch();
99}
100
101static void mx28evk_flexcan1_switch(int enable)
102{
103 flexcan1_en = enable;
104 mx28evk_flexcan_switch();
105}
106
107static struct flexcan_platform_data flexcan_pdata[2];
108
109static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
110 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
111 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
112 { /* sentinel */ }
113};
114
115#define OCOTP_WORD_OFFSET 0x20 79#define OCOTP_WORD_OFFSET 0x20
116#define OCOTP_WORD_COUNT 0x20 80#define OCOTP_WORD_COUNT 0x20
117 81
@@ -271,15 +235,6 @@ static void __init imx28_evk_init(void)
271 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); 235 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
272} 236}
273 237
274static void __init imx28_evk_post_init(void)
275{
276 if (!gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT,
277 "flexcan-switch")) {
278 flexcan_pdata[0].transceiver_switch = mx28evk_flexcan0_switch;
279 flexcan_pdata[1].transceiver_switch = mx28evk_flexcan1_switch;
280 }
281}
282
283static int apx4devkit_phy_fixup(struct phy_device *phy) 238static int apx4devkit_phy_fixup(struct phy_device *phy)
284{ 239{
285 phy->dev_flags |= MICREL_PHY_50MHZ_CLK; 240 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
@@ -485,13 +440,10 @@ static void __init mxs_machine_init(void)
485 crystalfontz_init(); 440 crystalfontz_init();
486 441
487 of_platform_populate(NULL, of_default_bus_match_table, 442 of_platform_populate(NULL, of_default_bus_match_table,
488 mxs_auxdata_lookup, parent); 443 NULL, parent);
489 444
490 if (of_machine_is_compatible("karo,tx28")) 445 if (of_machine_is_compatible("karo,tx28"))
491 tx28_post_init(); 446 tx28_post_init();
492
493 if (of_machine_is_compatible("fsl,imx28-evk"))
494 imx28_evk_post_init();
495} 447}
496 448
497#define MX23_CLKCTRL_RESET_OFFSET 0x120 449#define MX23_CLKCTRL_RESET_OFFSET 0x120
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 45221fd7e25d..e115f6742107 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -378,7 +378,7 @@ static struct resource sh_eth_resources[] = {
378}; 378};
379 379
380static struct platform_device sh_eth_device = { 380static struct platform_device sh_eth_device = {
381 .name = "sh-eth", 381 .name = "r8a7740-gether",
382 .id = -1, 382 .id = -1,
383 .dev = { 383 .dev = {
384 .platform_data = &sh_eth_platdata, 384 .platform_data = &sh_eth_platdata,
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index 7fd32d604e34..de10fd78bf2b 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -594,7 +594,7 @@ static struct clk_lookup lookups[] = {
594 CLKDEV_DEV_ID("e6860000.sdhi", &mstp_clks[MSTP313]), 594 CLKDEV_DEV_ID("e6860000.sdhi", &mstp_clks[MSTP313]),
595 CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), 595 CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]),
596 CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), 596 CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]),
597 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP309]), 597 CLKDEV_DEV_ID("r8a7740-gether", &mstp_clks[MSTP309]),
598 CLKDEV_DEV_ID("e9a00000.sh-eth", &mstp_clks[MSTP309]), 598 CLKDEV_DEV_ID("e9a00000.sh-eth", &mstp_clks[MSTP309]),
599 CLKDEV_DEV_ID("renesas_tpu_pwm", &mstp_clks[MSTP304]), 599 CLKDEV_DEV_ID("renesas_tpu_pwm", &mstp_clks[MSTP304]),
600 600
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 53798e5037d7..a0e9eb72e46d 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -145,7 +145,7 @@ static struct clk_lookup lookups[] = {
145 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */ 145 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
146 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ 146 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
147 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ 147 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
148 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */ 148 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */
149 CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 149 CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
150 CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 150 CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
151 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 151 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 9daeb8c37483..10340f5becbb 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -165,7 +165,7 @@ static struct clk_lookup lookups[] = {
165 CLKDEV_DEV_ID("rcar-pcie", &mstp_clks[MSTP116]), /* PCIe */ 165 CLKDEV_DEV_ID("rcar-pcie", &mstp_clks[MSTP116]), /* PCIe */
166 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */ 166 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */
167 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */ 167 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */
168 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */ 168 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */
169 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */ 169 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */
170 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 170 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
171 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 171 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 1a643ee8e082..f50d223a0bd3 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp)
900#endif 900#endif
901 901
902 alloc_size = 4 * ctx.idx; 902 alloc_size = 4 * ctx.idx;
903 ctx.target = module_alloc(max(sizeof(struct work_struct), 903 ctx.target = module_alloc(alloc_size);
904 alloc_size));
905 if (unlikely(ctx.target == NULL)) 904 if (unlikely(ctx.target == NULL))
906 goto out; 905 goto out;
907 906
@@ -927,19 +926,8 @@ out:
927 return; 926 return;
928} 927}
929 928
930static void bpf_jit_free_worker(struct work_struct *work)
931{
932 module_free(NULL, work);
933}
934
935void bpf_jit_free(struct sk_filter *fp) 929void bpf_jit_free(struct sk_filter *fp)
936{ 930{
937 struct work_struct *work; 931 if (fp->bpf_func != sk_run_filter)
938 932 module_free(NULL, fp->bpf_func);
939 if (fp->bpf_func != sk_run_filter) {
940 work = (struct work_struct *)fp->bpf_func;
941
942 INIT_WORK(work, bpf_jit_free_worker);
943 schedule_work(work);
944 }
945} 933}
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 37401f535126..79b61798ebf8 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46
78
77#endif /* __ASM_AVR32_SOCKET_H */ 79#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/arch-v10/drivers/Kconfig b/arch/cris/arch-v10/drivers/Kconfig
index 5f2cdb3e428c..daf5f19b61a1 100644
--- a/arch/cris/arch-v10/drivers/Kconfig
+++ b/arch/cris/arch-v10/drivers/Kconfig
@@ -2,9 +2,7 @@ if ETRAX_ARCH_V10
2 2
3config ETRAX_ETHERNET 3config ETRAX_ETHERNET
4 bool "Ethernet support" 4 bool "Ethernet support"
5 depends on ETRAX_ARCH_V10 5 depends on ETRAX_ARCH_V10 && NETDEVICES
6 select ETHERNET
7 select NET_CORE
8 select MII 6 select MII
9 help 7 help
10 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet 8 This option enables the ETRAX 100LX built-in 10/100Mbit Ethernet
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
index acff3df8c43f..1d866d3ee2f8 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -2,9 +2,7 @@ if ETRAX_ARCH_V32
2 2
3config ETRAX_ETHERNET 3config ETRAX_ETHERNET
4 bool "Ethernet support" 4 bool "Ethernet support"
5 depends on ETRAX_ARCH_V32 5 depends on ETRAX_ARCH_V32 && NETDEVICES
6 select ETHERNET
7 select NET_CORE
8 select MII 6 select MII
9 help 7 help
10 This option enables the ETRAX FS built-in 10/100Mbit Ethernet 8 This option enables the ETRAX FS built-in 10/100Mbit Ethernet
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index ba409c9947bc..47b1ec55092d 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -76,6 +76,8 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46
80
79#endif /* _ASM_SOCKET_H */ 81#endif /* _ASM_SOCKET_H */
80 82
81 83
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index 31dbb5d8e13d..dbc08520f22c 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -74,5 +74,7 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46
78
77#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
78 80
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h
index 5d1c6d0870e6..a38d38a6520b 100644
--- a/arch/h8300/include/uapi/asm/socket.h
+++ b/arch/h8300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46
78
77#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index c13064e422df..d1b04c4c95e3 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -268,7 +268,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev)
268static int 268static int
269simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr) 269simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
270{ 270{
271 struct net_device *dev = ptr; 271 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
272 struct simeth_local *local; 272 struct simeth_local *local;
273 struct in_device *in_dev; 273 struct in_device *in_dev;
274 struct in_ifaddr **ifap = NULL; 274 struct in_ifaddr **ifap = NULL;
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index 6b4329f18b29..d3358b760681 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -83,4 +83,6 @@
83 83
84#define SO_SELECT_ERR_QUEUE 45 84#define SO_SELECT_ERR_QUEUE 45
85 85
86#define SO_LL 46
87
86#endif /* _ASM_IA64_SOCKET_H */ 88#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 2a3b59e0e171..44aaf4639a4a 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46
78
77#endif /* _ASM_M32R_SOCKET_H */ 79#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index a9505c4867e8..9c0ddafafb6c 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -845,6 +845,10 @@ int __init board_register_devices(void)
845 !bcm63xx_nvram_get_mac_address(board.enet1.mac_addr)) 845 !bcm63xx_nvram_get_mac_address(board.enet1.mac_addr))
846 bcm63xx_enet_register(1, &board.enet1); 846 bcm63xx_enet_register(1, &board.enet1);
847 847
848 if (board.has_enetsw &&
849 !bcm63xx_nvram_get_mac_address(board.enetsw.mac_addr))
850 bcm63xx_enetsw_register(&board.enetsw);
851
848 if (board.has_usbd) 852 if (board.has_usbd)
849 bcm63xx_usbd_register(&board.usbd); 853 bcm63xx_usbd_register(&board.usbd);
850 854
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 39c23366c5c7..52bc01df9bfe 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -9,16 +9,60 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/export.h>
12#include <bcm63xx_dev_enet.h> 13#include <bcm63xx_dev_enet.h>
13#include <bcm63xx_io.h> 14#include <bcm63xx_io.h>
14#include <bcm63xx_regs.h> 15#include <bcm63xx_regs.h>
15 16
17#ifdef BCMCPU_RUNTIME_DETECT
18static const unsigned long bcm6348_regs_enetdmac[] = {
19 [ENETDMAC_CHANCFG] = ENETDMAC_CHANCFG_REG,
20 [ENETDMAC_IR] = ENETDMAC_IR_REG,
21 [ENETDMAC_IRMASK] = ENETDMAC_IRMASK_REG,
22 [ENETDMAC_MAXBURST] = ENETDMAC_MAXBURST_REG,
23};
24
25static const unsigned long bcm6345_regs_enetdmac[] = {
26 [ENETDMAC_CHANCFG] = ENETDMA_6345_CHANCFG_REG,
27 [ENETDMAC_IR] = ENETDMA_6345_IR_REG,
28 [ENETDMAC_IRMASK] = ENETDMA_6345_IRMASK_REG,
29 [ENETDMAC_MAXBURST] = ENETDMA_6345_MAXBURST_REG,
30 [ENETDMAC_BUFALLOC] = ENETDMA_6345_BUFALLOC_REG,
31 [ENETDMAC_RSTART] = ENETDMA_6345_RSTART_REG,
32 [ENETDMAC_FC] = ENETDMA_6345_FC_REG,
33 [ENETDMAC_LEN] = ENETDMA_6345_LEN_REG,
34};
35
36const unsigned long *bcm63xx_regs_enetdmac;
37EXPORT_SYMBOL(bcm63xx_regs_enetdmac);
38
39static __init void bcm63xx_enetdmac_regs_init(void)
40{
41 if (BCMCPU_IS_6345())
42 bcm63xx_regs_enetdmac = bcm6345_regs_enetdmac;
43 else
44 bcm63xx_regs_enetdmac = bcm6348_regs_enetdmac;
45}
46#else
47static __init void bcm63xx_enetdmac_regs_init(void) { }
48#endif
49
16static struct resource shared_res[] = { 50static struct resource shared_res[] = {
17 { 51 {
18 .start = -1, /* filled at runtime */ 52 .start = -1, /* filled at runtime */
19 .end = -1, /* filled at runtime */ 53 .end = -1, /* filled at runtime */
20 .flags = IORESOURCE_MEM, 54 .flags = IORESOURCE_MEM,
21 }, 55 },
56 {
57 .start = -1, /* filled at runtime */
58 .end = -1, /* filled at runtime */
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .start = -1, /* filled at runtime */
63 .end = -1, /* filled at runtime */
64 .flags = IORESOURCE_MEM,
65 },
22}; 66};
23 67
24static struct platform_device bcm63xx_enet_shared_device = { 68static struct platform_device bcm63xx_enet_shared_device = {
@@ -94,6 +138,71 @@ static struct platform_device bcm63xx_enet1_device = {
94 }, 138 },
95}; 139};
96 140
141static struct resource enetsw_res[] = {
142 {
143 /* start & end filled at runtime */
144 .flags = IORESOURCE_MEM,
145 },
146 {
147 /* start filled at runtime */
148 .flags = IORESOURCE_IRQ,
149 },
150 {
151 /* start filled at runtime */
152 .flags = IORESOURCE_IRQ,
153 },
154};
155
156static struct bcm63xx_enetsw_platform_data enetsw_pd;
157
158static struct platform_device bcm63xx_enetsw_device = {
159 .name = "bcm63xx_enetsw",
160 .num_resources = ARRAY_SIZE(enetsw_res),
161 .resource = enetsw_res,
162 .dev = {
163 .platform_data = &enetsw_pd,
164 },
165};
166
167static int __init register_shared(void)
168{
169 int ret, chan_count;
170
171 if (shared_device_registered)
172 return 0;
173
174 bcm63xx_enetdmac_regs_init();
175
176 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
177 shared_res[0].end = shared_res[0].start;
178 if (BCMCPU_IS_6345())
179 shared_res[0].end += (RSET_6345_ENETDMA_SIZE) - 1;
180 else
181 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
182
183 if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
184 chan_count = 32;
185 else if (BCMCPU_IS_6345())
186 chan_count = 8;
187 else
188 chan_count = 16;
189
190 shared_res[1].start = bcm63xx_regset_address(RSET_ENETDMAC);
191 shared_res[1].end = shared_res[1].start;
192 shared_res[1].end += RSET_ENETDMAC_SIZE(chan_count) - 1;
193
194 shared_res[2].start = bcm63xx_regset_address(RSET_ENETDMAS);
195 shared_res[2].end = shared_res[2].start;
196 shared_res[2].end += RSET_ENETDMAS_SIZE(chan_count) - 1;
197
198 ret = platform_device_register(&bcm63xx_enet_shared_device);
199 if (ret)
200 return ret;
201 shared_device_registered = 1;
202
203 return 0;
204}
205
97int __init bcm63xx_enet_register(int unit, 206int __init bcm63xx_enet_register(int unit,
98 const struct bcm63xx_enet_platform_data *pd) 207 const struct bcm63xx_enet_platform_data *pd)
99{ 208{
@@ -104,22 +213,12 @@ int __init bcm63xx_enet_register(int unit,
104 if (unit > 1) 213 if (unit > 1)
105 return -ENODEV; 214 return -ENODEV;
106 215
107 if (unit == 1 && BCMCPU_IS_6338()) 216 if (unit == 1 && (BCMCPU_IS_6338() || BCMCPU_IS_6345()))
108 return -ENODEV; 217 return -ENODEV;
109 218
110 if (!shared_device_registered) { 219 ret = register_shared();
111 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); 220 if (ret)
112 shared_res[0].end = shared_res[0].start; 221 return ret;
113 if (BCMCPU_IS_6338())
114 shared_res[0].end += (RSET_ENETDMA_SIZE / 2) - 1;
115 else
116 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
117
118 ret = platform_device_register(&bcm63xx_enet_shared_device);
119 if (ret)
120 return ret;
121 shared_device_registered = 1;
122 }
123 222
124 if (unit == 0) { 223 if (unit == 0) {
125 enet0_res[0].start = bcm63xx_regset_address(RSET_ENET0); 224 enet0_res[0].start = bcm63xx_regset_address(RSET_ENET0);
@@ -155,8 +254,62 @@ int __init bcm63xx_enet_register(int unit,
155 dpd->phy_interrupt = bcm63xx_get_irq_number(IRQ_ENET_PHY); 254 dpd->phy_interrupt = bcm63xx_get_irq_number(IRQ_ENET_PHY);
156 } 255 }
157 256
257 dpd->dma_chan_en_mask = ENETDMAC_CHANCFG_EN_MASK;
258 dpd->dma_chan_int_mask = ENETDMAC_IR_PKTDONE_MASK;
259 if (BCMCPU_IS_6345()) {
260 dpd->dma_chan_en_mask |= ENETDMAC_CHANCFG_CHAINING_MASK;
261 dpd->dma_chan_en_mask |= ENETDMAC_CHANCFG_WRAP_EN_MASK;
262 dpd->dma_chan_en_mask |= ENETDMAC_CHANCFG_FLOWC_EN_MASK;
263 dpd->dma_chan_int_mask |= ENETDMA_IR_BUFDONE_MASK;
264 dpd->dma_chan_int_mask |= ENETDMA_IR_NOTOWNER_MASK;
265 dpd->dma_chan_width = ENETDMA_6345_CHAN_WIDTH;
266 dpd->dma_desc_shift = ENETDMA_6345_DESC_SHIFT;
267 } else {
268 dpd->dma_has_sram = true;
269 dpd->dma_chan_width = ENETDMA_CHAN_WIDTH;
270 }
271
158 ret = platform_device_register(pdev); 272 ret = platform_device_register(pdev);
159 if (ret) 273 if (ret)
160 return ret; 274 return ret;
161 return 0; 275 return 0;
162} 276}
277
278int __init
279bcm63xx_enetsw_register(const struct bcm63xx_enetsw_platform_data *pd)
280{
281 int ret;
282
283 if (!BCMCPU_IS_6328() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
284 return -ENODEV;
285
286 ret = register_shared();
287 if (ret)
288 return ret;
289
290 enetsw_res[0].start = bcm63xx_regset_address(RSET_ENETSW);
291 enetsw_res[0].end = enetsw_res[0].start;
292 enetsw_res[0].end += RSET_ENETSW_SIZE - 1;
293 enetsw_res[1].start = bcm63xx_get_irq_number(IRQ_ENETSW_RXDMA0);
294 enetsw_res[2].start = bcm63xx_get_irq_number(IRQ_ENETSW_TXDMA0);
295 if (!enetsw_res[2].start)
296 enetsw_res[2].start = -1;
297
298 memcpy(bcm63xx_enetsw_device.dev.platform_data, pd, sizeof(*pd));
299
300 if (BCMCPU_IS_6328())
301 enetsw_pd.num_ports = ENETSW_PORTS_6328;
302 else if (BCMCPU_IS_6362() || BCMCPU_IS_6368())
303 enetsw_pd.num_ports = ENETSW_PORTS_6368;
304
305 enetsw_pd.dma_has_sram = true;
306 enetsw_pd.dma_chan_width = ENETDMA_CHAN_WIDTH;
307 enetsw_pd.dma_chan_en_mask = ENETDMAC_CHANCFG_EN_MASK;
308 enetsw_pd.dma_chan_int_mask = ENETDMAC_IR_PKTDONE_MASK;
309
310 ret = platform_device_register(&bcm63xx_enetsw_device);
311 if (ret)
312 return ret;
313
314 return 0;
315}
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index 336228990808..e6e65dc7d502 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -173,7 +173,10 @@ enum bcm63xx_regs_set {
173#define BCM_6358_RSET_SPI_SIZE 1804 173#define BCM_6358_RSET_SPI_SIZE 1804
174#define BCM_6368_RSET_SPI_SIZE 1804 174#define BCM_6368_RSET_SPI_SIZE 1804
175#define RSET_ENET_SIZE 2048 175#define RSET_ENET_SIZE 2048
176#define RSET_ENETDMA_SIZE 2048 176#define RSET_ENETDMA_SIZE 256
177#define RSET_6345_ENETDMA_SIZE 64
178#define RSET_ENETDMAC_SIZE(chans) (16 * (chans))
179#define RSET_ENETDMAS_SIZE(chans) (16 * (chans))
177#define RSET_ENETSW_SIZE 65536 180#define RSET_ENETSW_SIZE 65536
178#define RSET_UART_SIZE 24 181#define RSET_UART_SIZE 24
179#define RSET_UDC_SIZE 256 182#define RSET_UDC_SIZE 256
@@ -298,7 +301,7 @@ enum bcm63xx_regs_set {
298#define BCM_6345_USBDMA_BASE (0xfffe2800) 301#define BCM_6345_USBDMA_BASE (0xfffe2800)
299#define BCM_6345_ENET0_BASE (0xfffe1800) 302#define BCM_6345_ENET0_BASE (0xfffe1800)
300#define BCM_6345_ENETDMA_BASE (0xfffe2800) 303#define BCM_6345_ENETDMA_BASE (0xfffe2800)
301#define BCM_6345_ENETDMAC_BASE (0xfffe2900) 304#define BCM_6345_ENETDMAC_BASE (0xfffe2840)
302#define BCM_6345_ENETDMAS_BASE (0xfffe2a00) 305#define BCM_6345_ENETDMAS_BASE (0xfffe2a00)
303#define BCM_6345_ENETSW_BASE (0xdeadbeef) 306#define BCM_6345_ENETSW_BASE (0xdeadbeef)
304#define BCM_6345_PCMCIA_BASE (0xfffe2028) 307#define BCM_6345_PCMCIA_BASE (0xfffe2028)
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
index d53f611184b9..753953e86242 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
@@ -4,6 +4,8 @@
4#include <linux/if_ether.h> 4#include <linux/if_ether.h>
5#include <linux/init.h> 5#include <linux/init.h>
6 6
7#include <bcm63xx_regs.h>
8
7/* 9/*
8 * on board ethernet platform data 10 * on board ethernet platform data
9 */ 11 */
@@ -37,9 +39,129 @@ struct bcm63xx_enet_platform_data {
37 int phy_id, int reg), 39 int phy_id, int reg),
38 void (*mii_write)(struct net_device *dev, 40 void (*mii_write)(struct net_device *dev,
39 int phy_id, int reg, int val)); 41 int phy_id, int reg, int val));
42
43 /* DMA channel enable mask */
44 u32 dma_chan_en_mask;
45
46 /* DMA channel interrupt mask */
47 u32 dma_chan_int_mask;
48
49 /* DMA engine has internal SRAM */
50 bool dma_has_sram;
51
52 /* DMA channel register width */
53 unsigned int dma_chan_width;
54
55 /* DMA descriptor shift */
56 unsigned int dma_desc_shift;
57};
58
59/*
60 * on board ethernet switch platform data
61 */
62#define ENETSW_MAX_PORT 8
63#define ENETSW_PORTS_6328 5 /* 4 FE PHY + 1 RGMII */
64#define ENETSW_PORTS_6368 6 /* 4 FE PHY + 2 RGMII */
65
66#define ENETSW_RGMII_PORT0 4
67
68struct bcm63xx_enetsw_port {
69 int used;
70 int phy_id;
71
72 int bypass_link;
73 int force_speed;
74 int force_duplex_full;
75
76 const char *name;
77};
78
79struct bcm63xx_enetsw_platform_data {
80 char mac_addr[ETH_ALEN];
81 int num_ports;
82 struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT];
83
84 /* DMA channel enable mask */
85 u32 dma_chan_en_mask;
86
87 /* DMA channel interrupt mask */
88 u32 dma_chan_int_mask;
89
90 /* DMA channel register width */
91 unsigned int dma_chan_width;
92
93 /* DMA engine has internal SRAM */
94 bool dma_has_sram;
40}; 95};
41 96
42int __init bcm63xx_enet_register(int unit, 97int __init bcm63xx_enet_register(int unit,
43 const struct bcm63xx_enet_platform_data *pd); 98 const struct bcm63xx_enet_platform_data *pd);
44 99
100int bcm63xx_enetsw_register(const struct bcm63xx_enetsw_platform_data *pd);
101
102enum bcm63xx_regs_enetdmac {
103 ENETDMAC_CHANCFG,
104 ENETDMAC_IR,
105 ENETDMAC_IRMASK,
106 ENETDMAC_MAXBURST,
107 ENETDMAC_BUFALLOC,
108 ENETDMAC_RSTART,
109 ENETDMAC_FC,
110 ENETDMAC_LEN,
111};
112
113static inline unsigned long bcm63xx_enetdmacreg(enum bcm63xx_regs_enetdmac reg)
114{
115#ifdef BCMCPU_RUNTIME_DETECT
116 extern const unsigned long *bcm63xx_regs_enetdmac;
117
118 return bcm63xx_regs_enetdmac[reg];
119#else
120#ifdef CONFIG_BCM63XX_CPU_6345
121 switch (reg) {
122 case ENETDMAC_CHANCFG:
123 return ENETDMA_6345_CHANCFG_REG;
124 case ENETDMAC_IR:
125 return ENETDMA_6345_IR_REG;
126 case ENETDMAC_IRMASK:
127 return ENETDMA_6345_IRMASK_REG;
128 case ENETDMAC_MAXBURST:
129 return ENETDMA_6345_MAXBURST_REG;
130 case ENETDMAC_BUFALLOC:
131 return ENETDMA_6345_BUFALLOC_REG;
132 case ENETDMAC_RSTART:
133 return ENETDMA_6345_RSTART_REG;
134 case ENETDMAC_FC:
135 return ENETDMA_6345_FC_REG;
136 case ENETDMAC_LEN:
137 return ENETDMA_6345_LEN_REG;
138 }
139#endif
140#if defined(CONFIG_BCM63XX_CPU_6328) || \
141 defined(CONFIG_BCM63XX_CPU_6338) || \
142 defined(CONFIG_BCM63XX_CPU_6348) || \
143 defined(CONFIG_BCM63XX_CPU_6358) || \
144 defined(CONFIG_BCM63XX_CPU_6362) || \
145 defined(CONFIG_BCM63XX_CPU_6368)
146 switch (reg) {
147 case ENETDMAC_CHANCFG:
148 return ENETDMAC_CHANCFG_REG;
149 case ENETDMAC_IR:
150 return ENETDMAC_IR_REG;
151 case ENETDMAC_IRMASK:
152 return ENETDMAC_IRMASK_REG;
153 case ENETDMAC_MAXBURST:
154 return ENETDMAC_MAXBURST_REG;
155 case ENETDMAC_BUFALLOC:
156 case ENETDMAC_RSTART:
157 case ENETDMAC_FC:
158 case ENETDMAC_LEN:
159 return 0;
160 }
161#endif
162#endif
163 return 0;
164}
165
166
45#endif /* ! BCM63XX_DEV_ENET_H_ */ 167#endif /* ! BCM63XX_DEV_ENET_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index 3203fe49b34d..eff7ca7d12b0 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -727,6 +727,8 @@
727/************************************************************************* 727/*************************************************************************
728 * _REG relative to RSET_ENETDMA 728 * _REG relative to RSET_ENETDMA
729 *************************************************************************/ 729 *************************************************************************/
730#define ENETDMA_CHAN_WIDTH 0x10
731#define ENETDMA_6345_CHAN_WIDTH 0x40
730 732
731/* Controller Configuration Register */ 733/* Controller Configuration Register */
732#define ENETDMA_CFG_REG (0x0) 734#define ENETDMA_CFG_REG (0x0)
@@ -782,31 +784,56 @@
782/* State Ram Word 4 */ 784/* State Ram Word 4 */
783#define ENETDMA_SRAM4_REG(x) (0x20c + (x) * 0x10) 785#define ENETDMA_SRAM4_REG(x) (0x20c + (x) * 0x10)
784 786
787/* Broadcom 6345 ENET DMA definitions */
788#define ENETDMA_6345_CHANCFG_REG (0x00)
789
790#define ENETDMA_6345_MAXBURST_REG (0x40)
791
792#define ENETDMA_6345_RSTART_REG (0x08)
793
794#define ENETDMA_6345_LEN_REG (0x0C)
795
796#define ENETDMA_6345_IR_REG (0x14)
797
798#define ENETDMA_6345_IRMASK_REG (0x18)
799
800#define ENETDMA_6345_FC_REG (0x1C)
801
802#define ENETDMA_6345_BUFALLOC_REG (0x20)
803
804/* Shift down for EOP, SOP and WRAP bits */
805#define ENETDMA_6345_DESC_SHIFT (3)
785 806
786/************************************************************************* 807/*************************************************************************
787 * _REG relative to RSET_ENETDMAC 808 * _REG relative to RSET_ENETDMAC
788 *************************************************************************/ 809 *************************************************************************/
789 810
790/* Channel Configuration register */ 811/* Channel Configuration register */
791#define ENETDMAC_CHANCFG_REG(x) ((x) * 0x10) 812#define ENETDMAC_CHANCFG_REG (0x0)
792#define ENETDMAC_CHANCFG_EN_SHIFT 0 813#define ENETDMAC_CHANCFG_EN_SHIFT 0
793#define ENETDMAC_CHANCFG_EN_MASK (1 << ENETDMAC_CHANCFG_EN_SHIFT) 814#define ENETDMAC_CHANCFG_EN_MASK (1 << ENETDMAC_CHANCFG_EN_SHIFT)
794#define ENETDMAC_CHANCFG_PKTHALT_SHIFT 1 815#define ENETDMAC_CHANCFG_PKTHALT_SHIFT 1
795#define ENETDMAC_CHANCFG_PKTHALT_MASK (1 << ENETDMAC_CHANCFG_PKTHALT_SHIFT) 816#define ENETDMAC_CHANCFG_PKTHALT_MASK (1 << ENETDMAC_CHANCFG_PKTHALT_SHIFT)
796#define ENETDMAC_CHANCFG_BUFHALT_SHIFT 2 817#define ENETDMAC_CHANCFG_BUFHALT_SHIFT 2
797#define ENETDMAC_CHANCFG_BUFHALT_MASK (1 << ENETDMAC_CHANCFG_BUFHALT_SHIFT) 818#define ENETDMAC_CHANCFG_BUFHALT_MASK (1 << ENETDMAC_CHANCFG_BUFHALT_SHIFT)
819#define ENETDMAC_CHANCFG_CHAINING_SHIFT 2
820#define ENETDMAC_CHANCFG_CHAINING_MASK (1 << ENETDMAC_CHANCFG_CHAINING_SHIFT)
821#define ENETDMAC_CHANCFG_WRAP_EN_SHIFT 3
822#define ENETDMAC_CHANCFG_WRAP_EN_MASK (1 << ENETDMAC_CHANCFG_WRAP_EN_SHIFT)
823#define ENETDMAC_CHANCFG_FLOWC_EN_SHIFT 4
824#define ENETDMAC_CHANCFG_FLOWC_EN_MASK (1 << ENETDMAC_CHANCFG_FLOWC_EN_SHIFT)
798 825
799/* Interrupt Control/Status register */ 826/* Interrupt Control/Status register */
800#define ENETDMAC_IR_REG(x) (0x4 + (x) * 0x10) 827#define ENETDMAC_IR_REG (0x4)
801#define ENETDMAC_IR_BUFDONE_MASK (1 << 0) 828#define ENETDMAC_IR_BUFDONE_MASK (1 << 0)
802#define ENETDMAC_IR_PKTDONE_MASK (1 << 1) 829#define ENETDMAC_IR_PKTDONE_MASK (1 << 1)
803#define ENETDMAC_IR_NOTOWNER_MASK (1 << 2) 830#define ENETDMAC_IR_NOTOWNER_MASK (1 << 2)
804 831
805/* Interrupt Mask register */ 832/* Interrupt Mask register */
806#define ENETDMAC_IRMASK_REG(x) (0x8 + (x) * 0x10) 833#define ENETDMAC_IRMASK_REG (0x8)
807 834
808/* Maximum Burst Length */ 835/* Maximum Burst Length */
809#define ENETDMAC_MAXBURST_REG(x) (0xc + (x) * 0x10) 836#define ENETDMAC_MAXBURST_REG (0xc)
810 837
811 838
812/************************************************************************* 839/*************************************************************************
@@ -814,26 +841,76 @@
814 *************************************************************************/ 841 *************************************************************************/
815 842
816/* Ring Start Address register */ 843/* Ring Start Address register */
817#define ENETDMAS_RSTART_REG(x) ((x) * 0x10) 844#define ENETDMAS_RSTART_REG (0x0)
818 845
819/* State Ram Word 2 */ 846/* State Ram Word 2 */
820#define ENETDMAS_SRAM2_REG(x) (0x4 + (x) * 0x10) 847#define ENETDMAS_SRAM2_REG (0x4)
821 848
822/* State Ram Word 3 */ 849/* State Ram Word 3 */
823#define ENETDMAS_SRAM3_REG(x) (0x8 + (x) * 0x10) 850#define ENETDMAS_SRAM3_REG (0x8)
824 851
825/* State Ram Word 4 */ 852/* State Ram Word 4 */
826#define ENETDMAS_SRAM4_REG(x) (0xc + (x) * 0x10) 853#define ENETDMAS_SRAM4_REG (0xc)
827 854
828 855
829/************************************************************************* 856/*************************************************************************
830 * _REG relative to RSET_ENETSW 857 * _REG relative to RSET_ENETSW
831 *************************************************************************/ 858 *************************************************************************/
832 859
860/* Port traffic control */
861#define ENETSW_PTCTRL_REG(x) (0x0 + (x))
862#define ENETSW_PTCTRL_RXDIS_MASK (1 << 0)
863#define ENETSW_PTCTRL_TXDIS_MASK (1 << 1)
864
865/* Switch mode register */
866#define ENETSW_SWMODE_REG (0xb)
867#define ENETSW_SWMODE_FWD_EN_MASK (1 << 1)
868
869/* IMP override Register */
870#define ENETSW_IMPOV_REG (0xe)
871#define ENETSW_IMPOV_FORCE_MASK (1 << 7)
872#define ENETSW_IMPOV_TXFLOW_MASK (1 << 5)
873#define ENETSW_IMPOV_RXFLOW_MASK (1 << 4)
874#define ENETSW_IMPOV_1000_MASK (1 << 3)
875#define ENETSW_IMPOV_100_MASK (1 << 2)
876#define ENETSW_IMPOV_FDX_MASK (1 << 1)
877#define ENETSW_IMPOV_LINKUP_MASK (1 << 0)
878
879/* Port override Register */
880#define ENETSW_PORTOV_REG(x) (0x58 + (x))
881#define ENETSW_PORTOV_ENABLE_MASK (1 << 6)
882#define ENETSW_PORTOV_TXFLOW_MASK (1 << 5)
883#define ENETSW_PORTOV_RXFLOW_MASK (1 << 4)
884#define ENETSW_PORTOV_1000_MASK (1 << 3)
885#define ENETSW_PORTOV_100_MASK (1 << 2)
886#define ENETSW_PORTOV_FDX_MASK (1 << 1)
887#define ENETSW_PORTOV_LINKUP_MASK (1 << 0)
888
889/* MDIO control register */
890#define ENETSW_MDIOC_REG (0xb0)
891#define ENETSW_MDIOC_EXT_MASK (1 << 16)
892#define ENETSW_MDIOC_REG_SHIFT 20
893#define ENETSW_MDIOC_PHYID_SHIFT 25
894#define ENETSW_MDIOC_RD_MASK (1 << 30)
895#define ENETSW_MDIOC_WR_MASK (1 << 31)
896
897/* MDIO data register */
898#define ENETSW_MDIOD_REG (0xb4)
899
900/* Global Management Configuration Register */
901#define ENETSW_GMCR_REG (0x200)
902#define ENETSW_GMCR_RST_MIB_MASK (1 << 0)
903
833/* MIB register */ 904/* MIB register */
834#define ENETSW_MIB_REG(x) (0x2800 + (x) * 4) 905#define ENETSW_MIB_REG(x) (0x2800 + (x) * 4)
835#define ENETSW_MIB_REG_COUNT 47 906#define ENETSW_MIB_REG_COUNT 47
836 907
908/* Jumbo control register port mask register */
909#define ENETSW_JMBCTL_PORT_REG (0x4004)
910
911/* Jumbo control mib good frame register */
912#define ENETSW_JMBCTL_MAXSIZE_REG (0x4008)
913
837 914
838/************************************************************************* 915/*************************************************************************
839 * _REG relative to RSET_OHCI_PRIV 916 * _REG relative to RSET_OHCI_PRIV
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index 682bcf3b492a..d9aee1a833f3 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -24,6 +24,7 @@ struct board_info {
24 /* enabled feature/device */ 24 /* enabled feature/device */
25 unsigned int has_enet0:1; 25 unsigned int has_enet0:1;
26 unsigned int has_enet1:1; 26 unsigned int has_enet1:1;
27 unsigned int has_enetsw:1;
27 unsigned int has_pci:1; 28 unsigned int has_pci:1;
28 unsigned int has_pccard:1; 29 unsigned int has_pccard:1;
29 unsigned int has_ohci0:1; 30 unsigned int has_ohci0:1;
@@ -36,6 +37,7 @@ struct board_info {
36 /* ethernet config */ 37 /* ethernet config */
37 struct bcm63xx_enet_platform_data enet0; 38 struct bcm63xx_enet_platform_data enet0;
38 struct bcm63xx_enet_platform_data enet1; 39 struct bcm63xx_enet_platform_data enet1;
40 struct bcm63xx_enetsw_platform_data enetsw;
39 41
40 /* USB config */ 42 /* USB config */
41 struct bcm63xx_usbd_platform_data usbd; 43 struct bcm63xx_usbd_platform_data usbd;
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 3b211507be7f..6a07992ba6c6 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -92,4 +92,6 @@
92 92
93#define SO_SELECT_ERR_QUEUE 45 93#define SO_SELECT_ERR_QUEUE 45
94 94
95#define SO_LL 46
96
95#endif /* _UAPI_ASM_SOCKET_H */ 97#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index 729a50991780..b7eccbd17bf7 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -331,7 +331,8 @@ static int tx4939_netdev_event(struct notifier_block *this,
331 unsigned long event, 331 unsigned long event,
332 void *ptr) 332 void *ptr)
333{ 333{
334 struct net_device *dev = ptr; 334 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
335
335 if (event == NETDEV_CHANGE && netif_carrier_ok(dev)) { 336 if (event == NETDEV_CHANGE && netif_carrier_ok(dev)) {
336 __u64 bit = 0; 337 __u64 bit = 0;
337 if (dev->irq == TXX9_IRQ_BASE + TX4939_IR_ETH(0)) 338 if (dev->irq == TXX9_IRQ_BASE + TX4939_IR_ETH(0))
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index b4ce844c9391..db80fd3e398b 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46
78
77#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 70c512a386f7..f866fff9a004 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,6 +73,8 @@
73 73
74#define SO_SELECT_ERR_QUEUE 0x4026 74#define SO_SELECT_ERR_QUEUE 0x4026
75 75
76#define SO_LL 0x4027
77
76/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
77 * have to define SOCK_NONBLOCK to a different value here. 79 * have to define SOCK_NONBLOCK to a different value here.
78 */ 80 */
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index bc3a0ebf16a7..3bf72cd2c8fc 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -668,7 +668,6 @@ config SBUS
668 668
669config FSL_SOC 669config FSL_SOC
670 bool 670 bool
671 select HAVE_CAN_FLEXCAN if NET && CAN
672 671
673config FSL_PCI 672config FSL_PCI
674 bool 673 bool
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
index a36daf3c6f9a..405fb09bda94 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46
85
84#endif /* _ASM_POWERPC_SOCKET_H */ 86#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index c427ae36374a..bf56e33f8257 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -650,8 +650,7 @@ void bpf_jit_compile(struct sk_filter *fp)
650 650
651 proglen = cgctx.idx * 4; 651 proglen = cgctx.idx * 4;
652 alloclen = proglen + FUNCTION_DESCR_SIZE; 652 alloclen = proglen + FUNCTION_DESCR_SIZE;
653 image = module_alloc(max_t(unsigned int, alloclen, 653 image = module_alloc(alloclen);
654 sizeof(struct work_struct)));
655 if (!image) 654 if (!image)
656 goto out; 655 goto out;
657 656
@@ -688,20 +687,8 @@ out:
688 return; 687 return;
689} 688}
690 689
691static void jit_free_defer(struct work_struct *arg)
692{
693 module_free(NULL, arg);
694}
695
696/* run from softirq, we must use a work_struct to call
697 * module_free() from process context
698 */
699void bpf_jit_free(struct sk_filter *fp) 690void bpf_jit_free(struct sk_filter *fp)
700{ 691{
701 if (fp->bpf_func != sk_run_filter) { 692 if (fp->bpf_func != sk_run_filter)
702 struct work_struct *work = (struct work_struct *)fp->bpf_func; 693 module_free(NULL, fp->bpf_func);
703
704 INIT_WORK(work, jit_free_defer);
705 schedule_work(work);
706 }
707} 694}
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 2dacb306835c..0c5105fbaaf3 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -80,4 +80,6 @@
80 80
81#define SO_SELECT_ERR_QUEUE 45 81#define SO_SELECT_ERR_QUEUE 45
82 82
83#define SO_LL 46
84
83#endif /* _ASM_SOCKET_H */ 85#endif /* _ASM_SOCKET_H */
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
index d71a0bcf8145..4d94dff9015c 100644
--- a/arch/sh/boards/board-espt.c
+++ b/arch/sh/boards/board-espt.c
@@ -85,7 +85,7 @@ static struct sh_eth_plat_data sh7763_eth_pdata = {
85}; 85};
86 86
87static struct platform_device espt_eth_device = { 87static struct platform_device espt_eth_device = {
88 .name = "sh-eth", 88 .name = "sh7763-gether",
89 .resource = sh_eth_resources, 89 .resource = sh_eth_resources,
90 .num_resources = ARRAY_SIZE(sh_eth_resources), 90 .num_resources = ARRAY_SIZE(sh_eth_resources),
91 .dev = { 91 .dev = {
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 41f86702eb9f..4f114d1cd019 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -82,7 +82,7 @@ static struct sh_eth_plat_data sh7757_eth0_pdata = {
82}; 82};
83 83
84static struct platform_device sh7757_eth0_device = { 84static struct platform_device sh7757_eth0_device = {
85 .name = "sh-eth", 85 .name = "sh7757-ether",
86 .resource = sh_eth0_resources, 86 .resource = sh_eth0_resources,
87 .id = 0, 87 .id = 0,
88 .num_resources = ARRAY_SIZE(sh_eth0_resources), 88 .num_resources = ARRAY_SIZE(sh_eth0_resources),
@@ -111,7 +111,7 @@ static struct sh_eth_plat_data sh7757_eth1_pdata = {
111}; 111};
112 112
113static struct platform_device sh7757_eth1_device = { 113static struct platform_device sh7757_eth1_device = {
114 .name = "sh-eth", 114 .name = "sh7757-ether",
115 .resource = sh_eth1_resources, 115 .resource = sh_eth1_resources,
116 .id = 1, 116 .id = 1,
117 .num_resources = ARRAY_SIZE(sh_eth1_resources), 117 .num_resources = ARRAY_SIZE(sh_eth1_resources),
@@ -157,7 +157,7 @@ static struct sh_eth_plat_data sh7757_eth_giga0_pdata = {
157}; 157};
158 158
159static struct platform_device sh7757_eth_giga0_device = { 159static struct platform_device sh7757_eth_giga0_device = {
160 .name = "sh-eth", 160 .name = "sh7757-gether",
161 .resource = sh_eth_giga0_resources, 161 .resource = sh_eth_giga0_resources,
162 .id = 2, 162 .id = 2,
163 .num_resources = ARRAY_SIZE(sh_eth_giga0_resources), 163 .num_resources = ARRAY_SIZE(sh_eth_giga0_resources),
@@ -192,7 +192,7 @@ static struct sh_eth_plat_data sh7757_eth_giga1_pdata = {
192}; 192};
193 193
194static struct platform_device sh7757_eth_giga1_device = { 194static struct platform_device sh7757_eth_giga1_device = {
195 .name = "sh-eth", 195 .name = "sh7757-gether",
196 .resource = sh_eth_giga1_resources, 196 .resource = sh_eth_giga1_resources,
197 .id = 3, 197 .id = 3,
198 .num_resources = ARRAY_SIZE(sh_eth_giga1_resources), 198 .num_resources = ARRAY_SIZE(sh_eth_giga1_resources),
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 764530c85aa9..61fade0ffa96 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -165,8 +165,8 @@ static struct sh_eth_plat_data sh_eth_plat = {
165}; 165};
166 166
167static struct platform_device sh_eth_device = { 167static struct platform_device sh_eth_device = {
168 .name = "sh-eth", 168 .name = "sh7724-ether",
169 .id = 0, 169 .id = 0,
170 .dev = { 170 .dev = {
171 .platform_data = &sh_eth_plat, 171 .platform_data = &sh_eth_plat,
172 }, 172 },
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
index 9759d6ba7ffb..658326f44df8 100644
--- a/arch/sh/boards/mach-se/770x/setup.c
+++ b/arch/sh/boards/mach-se/770x/setup.c
@@ -128,8 +128,8 @@ static struct resource sh_eth0_resources[] = {
128}; 128};
129 129
130static struct platform_device sh_eth0_device = { 130static struct platform_device sh_eth0_device = {
131 .name = "sh-eth", 131 .name = "sh771x-ether",
132 .id = 0, 132 .id = 0,
133 .dev = { 133 .dev = {
134 .platform_data = PHY_ID, 134 .platform_data = PHY_ID,
135 }, 135 },
@@ -151,8 +151,8 @@ static struct resource sh_eth1_resources[] = {
151}; 151};
152 152
153static struct platform_device sh_eth1_device = { 153static struct platform_device sh_eth1_device = {
154 .name = "sh-eth", 154 .name = "sh771x-ether",
155 .id = 1, 155 .id = 1,
156 .dev = { 156 .dev = {
157 .platform_data = PHY_ID, 157 .platform_data = PHY_ID,
158 }, 158 },
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 4010e63e82d8..b70180ef3e29 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -380,8 +380,8 @@ static struct sh_eth_plat_data sh_eth_plat = {
380}; 380};
381 381
382static struct platform_device sh_eth_device = { 382static struct platform_device sh_eth_device = {
383 .name = "sh-eth", 383 .name = "sh7724-ether",
384 .id = 0, 384 .id = 0,
385 .dev = { 385 .dev = {
386 .platform_data = &sh_eth_plat, 386 .platform_data = &sh_eth_plat,
387 }, 387 },
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index b7c75298dfb5..50ba481fa240 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -93,7 +93,7 @@ static struct sh_eth_plat_data sh7763_eth_pdata = {
93}; 93};
94 94
95static struct platform_device sh7763rdp_eth_device = { 95static struct platform_device sh7763rdp_eth_device = {
96 .name = "sh-eth", 96 .name = "sh7763-gether",
97 .resource = sh_eth_resources, 97 .resource = sh_eth_resources,
98 .num_resources = ARRAY_SIZE(sh_eth_resources), 98 .num_resources = ARRAY_SIZE(sh_eth_resources),
99 .dev = { 99 .dev = {
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index e0b740c831c7..bb11e1925178 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -124,8 +124,8 @@ static struct resource eth_resources[] = {
124}; 124};
125 125
126static struct platform_device eth_device = { 126static struct platform_device eth_device = {
127 .name = "sh-eth", 127 .name = "sh7619-ether",
128 .id = -1, 128 .id = -1,
129 .dev = { 129 .dev = {
130 .platform_data = (void *)1, 130 .platform_data = (void *)1,
131 }, 131 },
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 5f30f805d2f2..0128af3399b7 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -329,7 +329,7 @@ static struct clk_lookup lookups[] = {
329 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]), 329 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[HWBLK_IIC0]),
330 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]), 330 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[HWBLK_IIC1]),
331 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[HWBLK_MMC]), 331 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[HWBLK_MMC]),
332 CLKDEV_DEV_ID("sh-eth.0", &mstp_clks[HWBLK_ETHER]), 332 CLKDEV_DEV_ID("sh7724-ether.0", &mstp_clks[HWBLK_ETHER]),
333 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]), 333 CLKDEV_CON_ID("atapi0", &mstp_clks[HWBLK_ATAPI]),
334 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]), 334 CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]),
335 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), 335 CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index deb683abacf0..ed9501519ab3 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -238,7 +238,7 @@ static struct clk_lookup lookups[] = {
238 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP313]), 238 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP313]),
239 CLKDEV_CON_ID("mtu0", &mstp_clks[MSTP312]), 239 CLKDEV_CON_ID("mtu0", &mstp_clks[MSTP312]),
240 CLKDEV_CON_ID("iebus0", &mstp_clks[MSTP304]), 240 CLKDEV_CON_ID("iebus0", &mstp_clks[MSTP304]),
241 CLKDEV_DEV_ID("sh-eth.0", &mstp_clks[MSTP114]), 241 CLKDEV_DEV_ID("sh7734-gether.0", &mstp_clks[MSTP114]),
242 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP303]), 242 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP303]),
243 CLKDEV_CON_ID("hif0", &mstp_clks[MSTP302]), 243 CLKDEV_CON_ID("hif0", &mstp_clks[MSTP302]),
244 CLKDEV_CON_ID("stif0", &mstp_clks[MSTP301]), 244 CLKDEV_CON_ID("stif0", &mstp_clks[MSTP301]),
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index 89f49b68a21c..b46c3fa0b265 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -70,6 +70,8 @@
70 70
71#define SO_SELECT_ERR_QUEUE 0x0029 71#define SO_SELECT_ERR_QUEUE 0x0029
72 72
73#define SO_LL 0x0030
74
73/* Security levels - as per NRL IPv6 - don't actually do anything */ 75/* Security levels - as per NRL IPv6 - don't actually do anything */
74#define SO_SECURITY_AUTHENTICATION 0x5001 76#define SO_SECURITY_AUTHENTICATION 0x5001
75#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 77#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index d36a85ebb5e0..9c7be59e6f5a 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -785,9 +785,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf];
785 break; 785 break;
786 } 786 }
787 if (proglen == oldproglen) { 787 if (proglen == oldproglen) {
788 image = module_alloc(max_t(unsigned int, 788 image = module_alloc(proglen);
789 proglen,
790 sizeof(struct work_struct)));
791 if (!image) 789 if (!image)
792 goto out; 790 goto out;
793 } 791 }
@@ -806,20 +804,8 @@ out:
806 return; 804 return;
807} 805}
808 806
809static void jit_free_defer(struct work_struct *arg)
810{
811 module_free(NULL, arg);
812}
813
814/* run from softirq, we must use a work_struct to call
815 * module_free() from process context
816 */
817void bpf_jit_free(struct sk_filter *fp) 807void bpf_jit_free(struct sk_filter *fp)
818{ 808{
819 if (fp->bpf_func != sk_run_filter) { 809 if (fp->bpf_func != sk_run_filter)
820 struct work_struct *work = (struct work_struct *)fp->bpf_func; 810 module_free(NULL, fp->bpf_func);
821
822 INIT_WORK(work, jit_free_defer);
823 schedule_work(work);
824 }
825} 811}
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index f66b54086ce5..79c216aa0e2b 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -12,6 +12,7 @@
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <linux/filter.h> 13#include <linux/filter.h>
14#include <linux/if_vlan.h> 14#include <linux/if_vlan.h>
15#include <linux/random.h>
15 16
16/* 17/*
17 * Conventions : 18 * Conventions :
@@ -144,6 +145,39 @@ static int pkt_type_offset(void)
144 return -1; 145 return -1;
145} 146}
146 147
148struct bpf_binary_header {
149 unsigned int pages;
150 /* Note : for security reasons, bpf code will follow a randomly
151 * sized amount of int3 instructions
152 */
153 u8 image[];
154};
155
156static struct bpf_binary_header *bpf_alloc_binary(unsigned int proglen,
157 u8 **image_ptr)
158{
159 unsigned int sz, hole;
160 struct bpf_binary_header *header;
161
162 /* Most of BPF filters are really small,
163 * but if some of them fill a page, allow at least
164 * 128 extra bytes to insert a random section of int3
165 */
166 sz = round_up(proglen + sizeof(*header) + 128, PAGE_SIZE);
167 header = module_alloc(sz);
168 if (!header)
169 return NULL;
170
171 memset(header, 0xcc, sz); /* fill whole space with int3 instructions */
172
173 header->pages = sz / PAGE_SIZE;
174 hole = sz - (proglen + sizeof(*header));
175
176 /* insert a random number of int3 instructions before BPF code */
177 *image_ptr = &header->image[prandom_u32() % hole];
178 return header;
179}
180
147void bpf_jit_compile(struct sk_filter *fp) 181void bpf_jit_compile(struct sk_filter *fp)
148{ 182{
149 u8 temp[64]; 183 u8 temp[64];
@@ -153,6 +187,7 @@ void bpf_jit_compile(struct sk_filter *fp)
153 int t_offset, f_offset; 187 int t_offset, f_offset;
154 u8 t_op, f_op, seen = 0, pass; 188 u8 t_op, f_op, seen = 0, pass;
155 u8 *image = NULL; 189 u8 *image = NULL;
190 struct bpf_binary_header *header = NULL;
156 u8 *func; 191 u8 *func;
157 int pc_ret0 = -1; /* bpf index of first RET #0 instruction (if any) */ 192 int pc_ret0 = -1; /* bpf index of first RET #0 instruction (if any) */
158 unsigned int cleanup_addr; /* epilogue code offset */ 193 unsigned int cleanup_addr; /* epilogue code offset */
@@ -693,7 +728,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
693 if (unlikely(proglen + ilen > oldproglen)) { 728 if (unlikely(proglen + ilen > oldproglen)) {
694 pr_err("bpb_jit_compile fatal error\n"); 729 pr_err("bpb_jit_compile fatal error\n");
695 kfree(addrs); 730 kfree(addrs);
696 module_free(NULL, image); 731 module_free(NULL, header);
697 return; 732 return;
698 } 733 }
699 memcpy(image + proglen, temp, ilen); 734 memcpy(image + proglen, temp, ilen);
@@ -717,10 +752,8 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
717 break; 752 break;
718 } 753 }
719 if (proglen == oldproglen) { 754 if (proglen == oldproglen) {
720 image = module_alloc(max_t(unsigned int, 755 header = bpf_alloc_binary(proglen, &image);
721 proglen, 756 if (!header)
722 sizeof(struct work_struct)));
723 if (!image)
724 goto out; 757 goto out;
725 } 758 }
726 oldproglen = proglen; 759 oldproglen = proglen;
@@ -730,7 +763,8 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
730 bpf_jit_dump(flen, proglen, pass, image); 763 bpf_jit_dump(flen, proglen, pass, image);
731 764
732 if (image) { 765 if (image) {
733 bpf_flush_icache(image, image + proglen); 766 bpf_flush_icache(header, image + proglen);
767 set_memory_ro((unsigned long)header, header->pages);
734 fp->bpf_func = (void *)image; 768 fp->bpf_func = (void *)image;
735 } 769 }
736out: 770out:
@@ -738,20 +772,13 @@ out:
738 return; 772 return;
739} 773}
740 774
741static void jit_free_defer(struct work_struct *arg)
742{
743 module_free(NULL, arg);
744}
745
746/* run from softirq, we must use a work_struct to call
747 * module_free() from process context
748 */
749void bpf_jit_free(struct sk_filter *fp) 775void bpf_jit_free(struct sk_filter *fp)
750{ 776{
751 if (fp->bpf_func != sk_run_filter) { 777 if (fp->bpf_func != sk_run_filter) {
752 struct work_struct *work = (struct work_struct *)fp->bpf_func; 778 unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
779 struct bpf_binary_header *header = (void *)addr;
753 780
754 INIT_WORK(work, jit_free_defer); 781 set_memory_rw(addr, header->pages);
755 schedule_work(work); 782 module_free(NULL, header);
756 } 783 }
757} 784}
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index a8f44f50e651..b21ace4fc9ba 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
85 85
86#define SO_SELECT_ERR_QUEUE 45 86#define SO_SELECT_ERR_QUEUE 45
87 87
88#define SO_LL 46
89
88#endif /* _XTENSA_SOCKET_H */ 90#endif /* _XTENSA_SOCKET_H */