diff options
Diffstat (limited to 'arch')
23 files changed, 72 insertions, 145 deletions
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 7d2f75be932e..0087d053b77f 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Socket filtering */ | 47 | /* Socket filtering */ |
48 | #define SO_ATTACH_FILTER 26 | 48 | #define SO_ATTACH_FILTER 26 |
49 | #define SO_DETACH_FILTER 27 | 49 | #define SO_DETACH_FILTER 27 |
50 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
50 | 51 | ||
51 | #define SO_PEERNAME 28 | 52 | #define SO_PEERNAME 28 |
52 | #define SO_TIMESTAMP 29 | 53 | #define SO_TIMESTAMP 29 |
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index f3990b04fecf..3290e61be3e1 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi | |||
@@ -580,6 +580,7 @@ | |||
580 | 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */ | 580 | 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */ |
581 | 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */ | 581 | 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */ |
582 | 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */ | 582 | 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */ |
583 | 1033 0x4001b0a8 /* MX6Q_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT*/ | ||
583 | >; | 584 | >; |
584 | }; | 585 | }; |
585 | 586 | ||
@@ -833,8 +834,8 @@ | |||
833 | compatible = "fsl,imx6q-fec"; | 834 | compatible = "fsl,imx6q-fec"; |
834 | reg = <0x02188000 0x4000>; | 835 | reg = <0x02188000 0x4000>; |
835 | interrupts = <0 118 0x04 0 119 0x04>; | 836 | interrupts = <0 118 0x04 0 119 0x04>; |
836 | clocks = <&clks 117>, <&clks 117>; | 837 | clocks = <&clks 117>, <&clks 117>, <&clks 177>; |
837 | clock-names = "ipg", "ahb"; | 838 | clock-names = "ipg", "ahb", "ptp"; |
838 | status = "disabled"; | 839 | status = "disabled"; |
839 | }; | 840 | }; |
840 | 841 | ||
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 043624219b55..92857683cb61 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -39,7 +39,6 @@ config SOC_AT91RM9200 | |||
39 | config SOC_AT91SAM9260 | 39 | config SOC_AT91SAM9260 |
40 | bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" | 40 | bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20" |
41 | select HAVE_AT91_DBGU0 | 41 | select HAVE_AT91_DBGU0 |
42 | select HAVE_NET_MACB | ||
43 | select SOC_AT91SAM9 | 42 | select SOC_AT91SAM9 |
44 | help | 43 | help |
45 | Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE | 44 | Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE |
@@ -57,7 +56,6 @@ config SOC_AT91SAM9263 | |||
57 | bool "AT91SAM9263" | 56 | bool "AT91SAM9263" |
58 | select HAVE_AT91_DBGU1 | 57 | select HAVE_AT91_DBGU1 |
59 | select HAVE_FB_ATMEL | 58 | select HAVE_FB_ATMEL |
60 | select HAVE_NET_MACB | ||
61 | select SOC_AT91SAM9 | 59 | select SOC_AT91SAM9 |
62 | 60 | ||
63 | config SOC_AT91SAM9RL | 61 | config SOC_AT91SAM9RL |
@@ -70,7 +68,6 @@ config SOC_AT91SAM9G45 | |||
70 | bool "AT91SAM9G45 or AT91SAM9M10 families" | 68 | bool "AT91SAM9G45 or AT91SAM9M10 families" |
71 | select HAVE_AT91_DBGU1 | 69 | select HAVE_AT91_DBGU1 |
72 | select HAVE_FB_ATMEL | 70 | select HAVE_FB_ATMEL |
73 | select HAVE_NET_MACB | ||
74 | select SOC_AT91SAM9 | 71 | select SOC_AT91SAM9 |
75 | help | 72 | help |
76 | Select this if you are using one of Atmel's AT91SAM9G45 family SoC. | 73 | Select this if you are using one of Atmel's AT91SAM9G45 family SoC. |
@@ -80,7 +77,6 @@ config SOC_AT91SAM9X5 | |||
80 | bool "AT91SAM9x5 family" | 77 | bool "AT91SAM9x5 family" |
81 | select HAVE_AT91_DBGU0 | 78 | select HAVE_AT91_DBGU0 |
82 | select HAVE_FB_ATMEL | 79 | select HAVE_FB_ATMEL |
83 | select HAVE_NET_MACB | ||
84 | select SOC_AT91SAM9 | 80 | select SOC_AT91SAM9 |
85 | help | 81 | help |
86 | Select this if you are using one of Atmel's AT91SAM9x5 family SoC. | 82 | Select this if you are using one of Atmel's AT91SAM9x5 family SoC. |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index 3e37437a7a61..aa9b320bad59 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
@@ -53,6 +53,8 @@ static void __init csb337_init_early(void) | |||
53 | static struct macb_platform_data __initdata csb337_eth_data = { | 53 | static struct macb_platform_data __initdata csb337_eth_data = { |
54 | .phy_irq_pin = AT91_PIN_PC2, | 54 | .phy_irq_pin = AT91_PIN_PC2, |
55 | .is_rmii = 0, | 55 | .is_rmii = 0, |
56 | /* The CSB337 bootloader stores the MAC the wrong-way around */ | ||
57 | .rev_eth_addr = 1, | ||
56 | }; | 58 | }; |
57 | 59 | ||
58 | static struct at91_usbh_data __initdata csb337_usbh_data = { | 60 | static struct at91_usbh_data __initdata csb337_usbh_data = { |
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200_emac.h b/arch/arm/mach-at91/include/mach/at91rm9200_emac.h deleted file mode 100644 index b8260cd8041c..000000000000 --- a/arch/arm/mach-at91/include/mach/at91rm9200_emac.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91rm9200_emac.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Ethernet MAC registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91RM9200_EMAC_H | ||
17 | #define AT91RM9200_EMAC_H | ||
18 | |||
19 | #define AT91_EMAC_CTL 0x00 /* Control Register */ | ||
20 | #define AT91_EMAC_LB (1 << 0) /* Loopback */ | ||
21 | #define AT91_EMAC_LBL (1 << 1) /* Loopback Local */ | ||
22 | #define AT91_EMAC_RE (1 << 2) /* Receive Enable */ | ||
23 | #define AT91_EMAC_TE (1 << 3) /* Transmit Enable */ | ||
24 | #define AT91_EMAC_MPE (1 << 4) /* Management Port Enable */ | ||
25 | #define AT91_EMAC_CSR (1 << 5) /* Clear Statistics Registers */ | ||
26 | #define AT91_EMAC_INCSTAT (1 << 6) /* Increment Statistics Registers */ | ||
27 | #define AT91_EMAC_WES (1 << 7) /* Write Enable for Statistics Registers */ | ||
28 | #define AT91_EMAC_BP (1 << 8) /* Back Pressure */ | ||
29 | |||
30 | #define AT91_EMAC_CFG 0x04 /* Configuration Register */ | ||
31 | #define AT91_EMAC_SPD (1 << 0) /* Speed */ | ||
32 | #define AT91_EMAC_FD (1 << 1) /* Full Duplex */ | ||
33 | #define AT91_EMAC_BR (1 << 2) /* Bit Rate */ | ||
34 | #define AT91_EMAC_CAF (1 << 4) /* Copy All Frames */ | ||
35 | #define AT91_EMAC_NBC (1 << 5) /* No Broadcast */ | ||
36 | #define AT91_EMAC_MTI (1 << 6) /* Multicast Hash Enable */ | ||
37 | #define AT91_EMAC_UNI (1 << 7) /* Unicast Hash Enable */ | ||
38 | #define AT91_EMAC_BIG (1 << 8) /* Receive 1522 Bytes */ | ||
39 | #define AT91_EMAC_EAE (1 << 9) /* External Address Match Enable */ | ||
40 | #define AT91_EMAC_CLK (3 << 10) /* MDC Clock Divisor */ | ||
41 | #define AT91_EMAC_CLK_DIV8 (0 << 10) | ||
42 | #define AT91_EMAC_CLK_DIV16 (1 << 10) | ||
43 | #define AT91_EMAC_CLK_DIV32 (2 << 10) | ||
44 | #define AT91_EMAC_CLK_DIV64 (3 << 10) | ||
45 | #define AT91_EMAC_RTY (1 << 12) /* Retry Test */ | ||
46 | #define AT91_EMAC_RMII (1 << 13) /* Reduce MII (RMII) */ | ||
47 | |||
48 | #define AT91_EMAC_SR 0x08 /* Status Register */ | ||
49 | #define AT91_EMAC_SR_LINK (1 << 0) /* Link */ | ||
50 | #define AT91_EMAC_SR_MDIO (1 << 1) /* MDIO pin */ | ||
51 | #define AT91_EMAC_SR_IDLE (1 << 2) /* PHY idle */ | ||
52 | |||
53 | #define AT91_EMAC_TAR 0x0c /* Transmit Address Register */ | ||
54 | |||
55 | #define AT91_EMAC_TCR 0x10 /* Transmit Control Register */ | ||
56 | #define AT91_EMAC_LEN (0x7ff << 0) /* Transmit Frame Length */ | ||
57 | #define AT91_EMAC_NCRC (1 << 15) /* No CRC */ | ||
58 | |||
59 | #define AT91_EMAC_TSR 0x14 /* Transmit Status Register */ | ||
60 | #define AT91_EMAC_TSR_OVR (1 << 0) /* Transmit Buffer Overrun */ | ||
61 | #define AT91_EMAC_TSR_COL (1 << 1) /* Collision Occurred */ | ||
62 | #define AT91_EMAC_TSR_RLE (1 << 2) /* Retry Limit Exceeded */ | ||
63 | #define AT91_EMAC_TSR_IDLE (1 << 3) /* Transmitter Idle */ | ||
64 | #define AT91_EMAC_TSR_BNQ (1 << 4) /* Transmit Buffer not Queued */ | ||
65 | #define AT91_EMAC_TSR_COMP (1 << 5) /* Transmit Complete */ | ||
66 | #define AT91_EMAC_TSR_UND (1 << 6) /* Transmit Underrun */ | ||
67 | |||
68 | #define AT91_EMAC_RBQP 0x18 /* Receive Buffer Queue Pointer */ | ||
69 | |||
70 | #define AT91_EMAC_RSR 0x20 /* Receive Status Register */ | ||
71 | #define AT91_EMAC_RSR_BNA (1 << 0) /* Buffer Not Available */ | ||
72 | #define AT91_EMAC_RSR_REC (1 << 1) /* Frame Received */ | ||
73 | #define AT91_EMAC_RSR_OVR (1 << 2) /* RX Overrun */ | ||
74 | |||
75 | #define AT91_EMAC_ISR 0x24 /* Interrupt Status Register */ | ||
76 | #define AT91_EMAC_DONE (1 << 0) /* Management Done */ | ||
77 | #define AT91_EMAC_RCOM (1 << 1) /* Receive Complete */ | ||
78 | #define AT91_EMAC_RBNA (1 << 2) /* Receive Buffer Not Available */ | ||
79 | #define AT91_EMAC_TOVR (1 << 3) /* Transmit Buffer Overrun */ | ||
80 | #define AT91_EMAC_TUND (1 << 4) /* Transmit Buffer Underrun */ | ||
81 | #define AT91_EMAC_RTRY (1 << 5) /* Retry Limit */ | ||
82 | #define AT91_EMAC_TBRE (1 << 6) /* Transmit Buffer Register Empty */ | ||
83 | #define AT91_EMAC_TCOM (1 << 7) /* Transmit Complete */ | ||
84 | #define AT91_EMAC_TIDLE (1 << 8) /* Transmit Idle */ | ||
85 | #define AT91_EMAC_LINK (1 << 9) /* Link */ | ||
86 | #define AT91_EMAC_ROVR (1 << 10) /* RX Overrun */ | ||
87 | #define AT91_EMAC_ABT (1 << 11) /* Abort */ | ||
88 | |||
89 | #define AT91_EMAC_IER 0x28 /* Interrupt Enable Register */ | ||
90 | #define AT91_EMAC_IDR 0x2c /* Interrupt Disable Register */ | ||
91 | #define AT91_EMAC_IMR 0x30 /* Interrupt Mask Register */ | ||
92 | |||
93 | #define AT91_EMAC_MAN 0x34 /* PHY Maintenance Register */ | ||
94 | #define AT91_EMAC_DATA (0xffff << 0) /* MDIO Data */ | ||
95 | #define AT91_EMAC_REGA (0x1f << 18) /* MDIO Register */ | ||
96 | #define AT91_EMAC_PHYA (0x1f << 23) /* MDIO PHY Address */ | ||
97 | #define AT91_EMAC_RW (3 << 28) /* Read/Write operation */ | ||
98 | #define AT91_EMAC_RW_W (1 << 28) | ||
99 | #define AT91_EMAC_RW_R (2 << 28) | ||
100 | #define AT91_EMAC_MAN_802_3 0x40020000 /* IEEE 802.3 value */ | ||
101 | |||
102 | /* | ||
103 | * Statistics Registers. | ||
104 | */ | ||
105 | #define AT91_EMAC_FRA 0x40 /* Frames Transmitted OK */ | ||
106 | #define AT91_EMAC_SCOL 0x44 /* Single Collision Frame */ | ||
107 | #define AT91_EMAC_MCOL 0x48 /* Multiple Collision Frame */ | ||
108 | #define AT91_EMAC_OK 0x4c /* Frames Received OK */ | ||
109 | #define AT91_EMAC_SEQE 0x50 /* Frame Check Sequence Error */ | ||
110 | #define AT91_EMAC_ALE 0x54 /* Alignmemt Error */ | ||
111 | #define AT91_EMAC_DTE 0x58 /* Deffered Transmission Frame */ | ||
112 | #define AT91_EMAC_LCOL 0x5c /* Late Collision */ | ||
113 | #define AT91_EMAC_ECOL 0x60 /* Excessive Collision */ | ||
114 | #define AT91_EMAC_TUE 0x64 /* Transmit Underrun Error */ | ||
115 | #define AT91_EMAC_CSE 0x68 /* Carrier Sense Error */ | ||
116 | #define AT91_EMAC_DRFC 0x6c /* Discard RX Frame */ | ||
117 | #define AT91_EMAC_ROV 0x70 /* Receive Overrun */ | ||
118 | #define AT91_EMAC_CDE 0x74 /* Code Error */ | ||
119 | #define AT91_EMAC_ELR 0x78 /* Excessive Length Error */ | ||
120 | #define AT91_EMAC_RJB 0x7c /* Receive Jabber */ | ||
121 | #define AT91_EMAC_USF 0x80 /* Undersize Frame */ | ||
122 | #define AT91_EMAC_SQEE 0x84 /* SQE Test Error */ | ||
123 | |||
124 | /* | ||
125 | * Address Registers. | ||
126 | */ | ||
127 | #define AT91_EMAC_HSL 0x90 /* Hash Address Low [31:0] */ | ||
128 | #define AT91_EMAC_HSH 0x94 /* Hash Address High [63:32] */ | ||
129 | #define AT91_EMAC_SA1L 0x98 /* Specific Address 1 Low, bytes 0-3 */ | ||
130 | #define AT91_EMAC_SA1H 0x9c /* Specific Address 1 High, bytes 4-5 */ | ||
131 | #define AT91_EMAC_SA2L 0xa0 /* Specific Address 2 Low, bytes 0-3 */ | ||
132 | #define AT91_EMAC_SA2H 0xa4 /* Specific Address 2 High, bytes 4-5 */ | ||
133 | #define AT91_EMAC_SA3L 0xa8 /* Specific Address 3 Low, bytes 0-3 */ | ||
134 | #define AT91_EMAC_SA3H 0xac /* Specific Address 3 High, bytes 4-5 */ | ||
135 | #define AT91_EMAC_SA4L 0xb0 /* Specific Address 4 Low, bytes 0-3 */ | ||
136 | #define AT91_EMAC_SA4H 0xb4 /* Specific Address 4 High, bytes 4-5 */ | ||
137 | |||
138 | #endif | ||
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 47c91f7185d2..38d69100398d 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -117,6 +117,17 @@ static void __init imx6q_sabrelite_init(void) | |||
117 | imx6q_sabrelite_cko1_setup(); | 117 | imx6q_sabrelite_cko1_setup(); |
118 | } | 118 | } |
119 | 119 | ||
120 | static void __init imx6q_1588_init(void) | ||
121 | { | ||
122 | struct regmap *gpr; | ||
123 | |||
124 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); | ||
125 | if (!IS_ERR(gpr)) | ||
126 | regmap_update_bits(gpr, 0x4, 1 << 21, 1 << 21); | ||
127 | else | ||
128 | pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); | ||
129 | |||
130 | } | ||
120 | static void __init imx6q_usb_init(void) | 131 | static void __init imx6q_usb_init(void) |
121 | { | 132 | { |
122 | struct regmap *anatop; | 133 | struct regmap *anatop; |
@@ -153,6 +164,7 @@ static void __init imx6q_init_machine(void) | |||
153 | 164 | ||
154 | imx6q_pm_init(); | 165 | imx6q_pm_init(); |
155 | imx6q_usb_init(); | 166 | imx6q_usb_init(); |
167 | imx6q_1588_init(); | ||
156 | } | 168 | } |
157 | 169 | ||
158 | static struct cpuidle_driver imx6q_cpuidle_driver = { | 170 | static struct cpuidle_driver imx6q_cpuidle_driver = { |
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 06e73bf665e9..09f9fa800b33 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig | |||
@@ -80,7 +80,6 @@ config PLATFORM_AT32AP | |||
80 | select ARCH_REQUIRE_GPIOLIB | 80 | select ARCH_REQUIRE_GPIOLIB |
81 | select GENERIC_ALLOCATOR | 81 | select GENERIC_ALLOCATOR |
82 | select HAVE_FB_ATMEL | 82 | select HAVE_FB_ATMEL |
83 | select HAVE_NET_MACB | ||
84 | 83 | ||
85 | # | 84 | # |
86 | # CPU types | 85 | # CPU types |
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h index a473f8c6a9aa..486df68abeec 100644 --- a/arch/avr32/include/uapi/asm/socket.h +++ b/arch/avr32/include/uapi/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h index ae52825021af..b681b043f6c8 100644 --- a/arch/cris/include/asm/socket.h +++ b/arch/cris/include/asm/socket.h | |||
@@ -42,6 +42,7 @@ | |||
42 | /* Socket filtering */ | 42 | /* Socket filtering */ |
43 | #define SO_ATTACH_FILTER 26 | 43 | #define SO_ATTACH_FILTER 26 |
44 | #define SO_DETACH_FILTER 27 | 44 | #define SO_DETACH_FILTER 27 |
45 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
45 | 46 | ||
46 | #define SO_PEERNAME 28 | 47 | #define SO_PEERNAME 28 |
47 | #define SO_TIMESTAMP 29 | 48 | #define SO_TIMESTAMP 29 |
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h index a5b1d7dbb205..871f89b7fbda 100644 --- a/arch/frv/include/uapi/asm/socket.h +++ b/arch/frv/include/uapi/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h index ec4554e7b04b..90a2e573c7e6 100644 --- a/arch/h8300/include/asm/socket.h +++ b/arch/h8300/include/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h index 41fc28a4a18a..23d6759bb57b 100644 --- a/arch/ia64/include/uapi/asm/socket.h +++ b/arch/ia64/include/uapi/asm/socket.h | |||
@@ -49,6 +49,7 @@ | |||
49 | /* Socket filtering */ | 49 | /* Socket filtering */ |
50 | #define SO_ATTACH_FILTER 26 | 50 | #define SO_ATTACH_FILTER 26 |
51 | #define SO_DETACH_FILTER 27 | 51 | #define SO_DETACH_FILTER 27 |
52 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
52 | 53 | ||
53 | #define SO_PEERNAME 28 | 54 | #define SO_PEERNAME 28 |
54 | #define SO_TIMESTAMP 29 | 55 | #define SO_TIMESTAMP 29 |
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h index a15f40b52783..5e7088a26726 100644 --- a/arch/m32r/include/asm/socket.h +++ b/arch/m32r/include/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/m68k/include/uapi/asm/socket.h b/arch/m68k/include/uapi/asm/socket.h index d1be684edf97..285da3b6ad92 100644 --- a/arch/m68k/include/uapi/asm/socket.h +++ b/arch/m68k/include/uapi/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h index c5ed59549cb8..17307ab90474 100644 --- a/arch/mips/include/uapi/asm/socket.h +++ b/arch/mips/include/uapi/asm/socket.h | |||
@@ -63,6 +63,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
63 | /* Socket filtering */ | 63 | /* Socket filtering */ |
64 | #define SO_ATTACH_FILTER 26 | 64 | #define SO_ATTACH_FILTER 26 |
65 | #define SO_DETACH_FILTER 27 | 65 | #define SO_DETACH_FILTER 27 |
66 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
66 | 67 | ||
67 | #define SO_PEERNAME 28 | 68 | #define SO_PEERNAME 28 |
68 | #define SO_TIMESTAMP 29 | 69 | #define SO_TIMESTAMP 29 |
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h index 820463a484b8..af5366bbfe62 100644 --- a/arch/mn10300/include/uapi/asm/socket.h +++ b/arch/mn10300/include/uapi/asm/socket.h | |||
@@ -40,6 +40,7 @@ | |||
40 | /* Socket filtering */ | 40 | /* Socket filtering */ |
41 | #define SO_ATTACH_FILTER 26 | 41 | #define SO_ATTACH_FILTER 26 |
42 | #define SO_DETACH_FILTER 27 | 42 | #define SO_DETACH_FILTER 27 |
43 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
43 | 44 | ||
44 | #define SO_PEERNAME 28 | 45 | #define SO_PEERNAME 28 |
45 | #define SO_TIMESTAMP 29 | 46 | #define SO_TIMESTAMP 29 |
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h index 1b52c2c31a7a..d9ff4731253b 100644 --- a/arch/parisc/include/uapi/asm/socket.h +++ b/arch/parisc/include/uapi/asm/socket.h | |||
@@ -48,6 +48,7 @@ | |||
48 | /* Socket filtering */ | 48 | /* Socket filtering */ |
49 | #define SO_ATTACH_FILTER 0x401a | 49 | #define SO_ATTACH_FILTER 0x401a |
50 | #define SO_DETACH_FILTER 0x401b | 50 | #define SO_DETACH_FILTER 0x401b |
51 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
51 | 52 | ||
52 | #define SO_ACCEPTCONN 0x401c | 53 | #define SO_ACCEPTCONN 0x401c |
53 | 54 | ||
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h index 3d5179bb122f..eb0b1864d400 100644 --- a/arch/powerpc/include/uapi/asm/socket.h +++ b/arch/powerpc/include/uapi/asm/socket.h | |||
@@ -47,6 +47,7 @@ | |||
47 | /* Socket filtering */ | 47 | /* Socket filtering */ |
48 | #define SO_ATTACH_FILTER 26 | 48 | #define SO_ATTACH_FILTER 26 |
49 | #define SO_DETACH_FILTER 27 | 49 | #define SO_DETACH_FILTER 27 |
50 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
50 | 51 | ||
51 | #define SO_PEERNAME 28 | 52 | #define SO_PEERNAME 28 |
52 | #define SO_TIMESTAMP 29 | 53 | #define SO_TIMESTAMP 29 |
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h index 69718cd6d635..436d07c23be8 100644 --- a/arch/s390/include/uapi/asm/socket.h +++ b/arch/s390/include/uapi/asm/socket.h | |||
@@ -46,6 +46,7 @@ | |||
46 | /* Socket filtering */ | 46 | /* Socket filtering */ |
47 | #define SO_ATTACH_FILTER 26 | 47 | #define SO_ATTACH_FILTER 26 |
48 | #define SO_DETACH_FILTER 27 | 48 | #define SO_DETACH_FILTER 27 |
49 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
49 | 50 | ||
50 | #define SO_PEERNAME 28 | 51 | #define SO_PEERNAME 28 |
51 | #define SO_TIMESTAMP 29 | 52 | #define SO_TIMESTAMP 29 |
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h index bea1568ae4af..c83a937ead00 100644 --- a/arch/sparc/include/uapi/asm/socket.h +++ b/arch/sparc/include/uapi/asm/socket.h | |||
@@ -41,6 +41,7 @@ | |||
41 | 41 | ||
42 | #define SO_ATTACH_FILTER 0x001a | 42 | #define SO_ATTACH_FILTER 0x001a |
43 | #define SO_DETACH_FILTER 0x001b | 43 | #define SO_DETACH_FILTER 0x001b |
44 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
44 | 45 | ||
45 | #define SO_PEERNAME 0x001c | 46 | #define SO_PEERNAME 0x001c |
46 | #define SO_TIMESTAMP 0x001d | 47 | #define SO_TIMESTAMP 0x001d |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 28368701ef79..3109ca684a99 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/netdevice.h> | 3 | #include <linux/netdevice.h> |
4 | #include <linux/filter.h> | 4 | #include <linux/filter.h> |
5 | #include <linux/cache.h> | 5 | #include <linux/cache.h> |
6 | #include <linux/if_vlan.h> | ||
6 | 7 | ||
7 | #include <asm/cacheflush.h> | 8 | #include <asm/cacheflush.h> |
8 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
@@ -312,6 +313,12 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \ | |||
312 | #define emit_addi(R1, IMM, R3) \ | 313 | #define emit_addi(R1, IMM, R3) \ |
313 | *prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3)) | 314 | *prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3)) |
314 | 315 | ||
316 | #define emit_and(R1, R2, R3) \ | ||
317 | *prog++ = (AND | RS1(R1) | RS2(R2) | RD(R3)) | ||
318 | |||
319 | #define emit_andi(R1, IMM, R3) \ | ||
320 | *prog++ = (AND | IMMED | RS1(R1) | S13(IMM) | RD(R3)) | ||
321 | |||
315 | #define emit_alloc_stack(SZ) \ | 322 | #define emit_alloc_stack(SZ) \ |
316 | *prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP)) | 323 | *prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP)) |
317 | 324 | ||
@@ -415,6 +422,8 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
415 | case BPF_S_ANC_IFINDEX: | 422 | case BPF_S_ANC_IFINDEX: |
416 | case BPF_S_ANC_MARK: | 423 | case BPF_S_ANC_MARK: |
417 | case BPF_S_ANC_RXHASH: | 424 | case BPF_S_ANC_RXHASH: |
425 | case BPF_S_ANC_VLAN_TAG: | ||
426 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
418 | case BPF_S_ANC_CPU: | 427 | case BPF_S_ANC_CPU: |
419 | case BPF_S_ANC_QUEUE: | 428 | case BPF_S_ANC_QUEUE: |
420 | case BPF_S_LD_W_ABS: | 429 | case BPF_S_LD_W_ABS: |
@@ -600,6 +609,16 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
600 | case BPF_S_ANC_RXHASH: | 609 | case BPF_S_ANC_RXHASH: |
601 | emit_skb_load32(rxhash, r_A); | 610 | emit_skb_load32(rxhash, r_A); |
602 | break; | 611 | break; |
612 | case BPF_S_ANC_VLAN_TAG: | ||
613 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
614 | emit_skb_load16(vlan_tci, r_A); | ||
615 | if (filter[i].code == BPF_S_ANC_VLAN_TAG) { | ||
616 | emit_andi(r_A, VLAN_VID_MASK, r_A); | ||
617 | } else { | ||
618 | emit_loadimm(VLAN_TAG_PRESENT, r_TMP); | ||
619 | emit_and(r_A, r_TMP, r_A); | ||
620 | } | ||
621 | break; | ||
603 | 622 | ||
604 | case BPF_S_LD_IMM: | 623 | case BPF_S_LD_IMM: |
605 | emit_loadimm(K, r_A); | 624 | emit_loadimm(K, r_A); |
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 520d2bd0b9c5..d11a47099d33 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <asm/cacheflush.h> | 11 | #include <asm/cacheflush.h> |
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 | 15 | ||
15 | /* | 16 | /* |
16 | * Conventions : | 17 | * Conventions : |
@@ -212,6 +213,8 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
212 | case BPF_S_ANC_MARK: | 213 | case BPF_S_ANC_MARK: |
213 | case BPF_S_ANC_RXHASH: | 214 | case BPF_S_ANC_RXHASH: |
214 | case BPF_S_ANC_CPU: | 215 | case BPF_S_ANC_CPU: |
216 | case BPF_S_ANC_VLAN_TAG: | ||
217 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
215 | case BPF_S_ANC_QUEUE: | 218 | case BPF_S_ANC_QUEUE: |
216 | case BPF_S_LD_W_ABS: | 219 | case BPF_S_LD_W_ABS: |
217 | case BPF_S_LD_H_ABS: | 220 | case BPF_S_LD_H_ABS: |
@@ -515,6 +518,24 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
515 | CLEAR_A(); | 518 | CLEAR_A(); |
516 | #endif | 519 | #endif |
517 | break; | 520 | break; |
521 | case BPF_S_ANC_VLAN_TAG: | ||
522 | case BPF_S_ANC_VLAN_TAG_PRESENT: | ||
523 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2); | ||
524 | if (is_imm8(offsetof(struct sk_buff, vlan_tci))) { | ||
525 | /* movzwl off8(%rdi),%eax */ | ||
526 | EMIT4(0x0f, 0xb7, 0x47, offsetof(struct sk_buff, vlan_tci)); | ||
527 | } else { | ||
528 | EMIT3(0x0f, 0xb7, 0x87); /* movzwl off32(%rdi),%eax */ | ||
529 | EMIT(offsetof(struct sk_buff, vlan_tci), 4); | ||
530 | } | ||
531 | BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000); | ||
532 | if (filter[i].code == BPF_S_ANC_VLAN_TAG) { | ||
533 | EMIT3(0x80, 0xe4, 0xef); /* and $0xef,%ah */ | ||
534 | } else { | ||
535 | EMIT3(0xc1, 0xe8, 0x0c); /* shr $0xc,%eax */ | ||
536 | EMIT3(0x83, 0xe0, 0x01); /* and $0x1,%eax */ | ||
537 | } | ||
538 | break; | ||
518 | case BPF_S_LD_W_ABS: | 539 | case BPF_S_LD_W_ABS: |
519 | func = CHOOSE_LOAD_FUNC(K, sk_load_word); | 540 | func = CHOOSE_LOAD_FUNC(K, sk_load_word); |
520 | common_load: seen |= SEEN_DATAREF; | 541 | common_load: seen |= SEEN_DATAREF; |
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h index e36c68184920..38079be1cf1e 100644 --- a/arch/xtensa/include/uapi/asm/socket.h +++ b/arch/xtensa/include/uapi/asm/socket.h | |||
@@ -52,6 +52,7 @@ | |||
52 | 52 | ||
53 | #define SO_ATTACH_FILTER 26 | 53 | #define SO_ATTACH_FILTER 26 |
54 | #define SO_DETACH_FILTER 27 | 54 | #define SO_DETACH_FILTER 27 |
55 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
55 | 56 | ||
56 | #define SO_PEERNAME 28 | 57 | #define SO_PEERNAME 28 |
57 | #define SO_TIMESTAMP 29 | 58 | #define SO_TIMESTAMP 29 |