diff options
author | Paul Mackerras <paulus@samba.org> | 2006-12-03 23:59:07 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-03 23:59:07 -0500 |
commit | 79acbb3ff2d8095b692e1502b9eb2ccec348de26 (patch) | |
tree | 6ab773e5a8f9de2cd6443362b21d0d6fffe3b35e /include | |
parent | 19a79859e168640f8e16d7b216d211c1c52b687a (diff) | |
parent | 2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2 (diff) |
Merge branch 'linux-2.6' into for-linus
Diffstat (limited to 'include')
424 files changed, 5640 insertions, 2973 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f338e40bd544..fdd10953b2b6 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -357,7 +357,7 @@ struct device *acpi_get_physical_device(acpi_handle); | |||
357 | /* helper */ | 357 | /* helper */ |
358 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); | 358 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); |
359 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 359 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
360 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) | 360 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
361 | 361 | ||
362 | #endif /* CONFIG_ACPI */ | 362 | #endif /* CONFIG_ACPI */ |
363 | 363 | ||
diff --git a/include/asm-alpha/checksum.h b/include/asm-alpha/checksum.h index a5c9f08447fb..d3854bbf0a9e 100644 --- a/include/asm-alpha/checksum.h +++ b/include/asm-alpha/checksum.h | |||
@@ -7,21 +7,20 @@ | |||
7 | * This is a version of ip_compute_csum() optimized for IP headers, | 7 | * This is a version of ip_compute_csum() optimized for IP headers, |
8 | * which always checksum on 4 octet boundaries. | 8 | * which always checksum on 4 octet boundaries. |
9 | */ | 9 | */ |
10 | extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl); | 10 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * computes the checksum of the TCP/UDP pseudo-header | 13 | * computes the checksum of the TCP/UDP pseudo-header |
14 | * returns a 16-bit checksum, already complemented | 14 | * returns a 16-bit checksum, already complemented |
15 | */ | 15 | */ |
16 | extern unsigned short int csum_tcpudp_magic(unsigned long saddr, | 16 | extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
17 | unsigned long daddr, | ||
18 | unsigned short len, | 17 | unsigned short len, |
19 | unsigned short proto, | 18 | unsigned short proto, |
20 | unsigned int sum); | 19 | __wsum sum); |
21 | 20 | ||
22 | unsigned int csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 21 | __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
23 | unsigned short len, unsigned short proto, | 22 | unsigned short len, unsigned short proto, |
24 | unsigned int sum); | 23 | __wsum sum); |
25 | 24 | ||
26 | /* | 25 | /* |
27 | * computes the checksum of a memory block at buff, length len, | 26 | * computes the checksum of a memory block at buff, length len, |
@@ -35,7 +34,7 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
35 | * | 34 | * |
36 | * it's best to have buff aligned on a 32-bit boundary | 35 | * it's best to have buff aligned on a 32-bit boundary |
37 | */ | 36 | */ |
38 | extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 37 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
39 | 38 | ||
40 | /* | 39 | /* |
41 | * the same as csum_partial, but copies from src while it | 40 | * the same as csum_partial, but copies from src while it |
@@ -44,9 +43,9 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i | |||
44 | * here even more important to align src and dst on a 32-bit (or even | 43 | * here even more important to align src and dst on a 32-bit (or even |
45 | * better 64-bit) boundary | 44 | * better 64-bit) boundary |
46 | */ | 45 | */ |
47 | unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, int len, unsigned int sum, int *errp); | 46 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp); |
48 | 47 | ||
49 | unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum); | 48 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); |
50 | 49 | ||
51 | 50 | ||
52 | /* | 51 | /* |
@@ -54,24 +53,23 @@ unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, unsi | |||
54 | * in icmp.c | 53 | * in icmp.c |
55 | */ | 54 | */ |
56 | 55 | ||
57 | extern unsigned short ip_compute_csum(unsigned char * buff, int len); | 56 | extern __sum16 ip_compute_csum(const void *buff, int len); |
58 | 57 | ||
59 | /* | 58 | /* |
60 | * Fold a partial checksum without adding pseudo headers | 59 | * Fold a partial checksum without adding pseudo headers |
61 | */ | 60 | */ |
62 | 61 | ||
63 | static inline unsigned short csum_fold(unsigned int sum) | 62 | static inline __sum16 csum_fold(__wsum csum) |
64 | { | 63 | { |
64 | u32 sum = (__force u32)csum; | ||
65 | sum = (sum & 0xffff) + (sum >> 16); | 65 | sum = (sum & 0xffff) + (sum >> 16); |
66 | sum = (sum & 0xffff) + (sum >> 16); | 66 | sum = (sum & 0xffff) + (sum >> 16); |
67 | return ~sum; | 67 | return (__force __sum16)~sum; |
68 | } | 68 | } |
69 | 69 | ||
70 | #define _HAVE_ARCH_IPV6_CSUM | 70 | #define _HAVE_ARCH_IPV6_CSUM |
71 | extern unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 71 | extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
72 | struct in6_addr *daddr, | 72 | const struct in6_addr *daddr, |
73 | __u32 len, | 73 | __u32 len, unsigned short proto, |
74 | unsigned short proto, | 74 | __wsum sum); |
75 | unsigned int sum); | ||
76 | |||
77 | #endif | 75 | #endif |
diff --git a/include/asm-alpha/device.h b/include/asm-alpha/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-alpha/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h index ae048441c9ed..722c5e086285 100644 --- a/include/asm-arm/arch-ebsa110/io.h +++ b/include/asm-arm/arch-ebsa110/io.h | |||
@@ -27,9 +27,9 @@ void __outw(u16 val, unsigned int port); | |||
27 | u32 __inl(unsigned int port); | 27 | u32 __inl(unsigned int port); |
28 | void __outl(u32 val, unsigned int port); | 28 | void __outl(u32 val, unsigned int port); |
29 | 29 | ||
30 | u8 __readb(void __iomem *addr); | 30 | u8 __readb(const volatile void __iomem *addr); |
31 | u16 __readw(void __iomem *addr); | 31 | u16 __readw(const volatile void __iomem *addr); |
32 | u32 __readl(void __iomem *addr); | 32 | u32 __readl(const volatile void __iomem *addr); |
33 | 33 | ||
34 | void __writeb(u8 val, void __iomem *addr); | 34 | void __writeb(u8 val, void __iomem *addr); |
35 | void __writew(u16 val, void __iomem *addr); | 35 | void __writew(u16 val, void __iomem *addr); |
@@ -64,8 +64,14 @@ void __writel(u32 val, void __iomem *addr); | |||
64 | #define writew(v,b) __writew(v,b) | 64 | #define writew(v,b) __writew(v,b) |
65 | #define writel(v,b) __writel(v,b) | 65 | #define writel(v,b) __writel(v,b) |
66 | 66 | ||
67 | #define __arch_ioremap(cookie,sz,c) ((void __iomem *)(cookie)) | 67 | static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size, |
68 | #define __arch_iounmap(cookie) do { } while (0) | 68 | unsigned int flags) |
69 | { | ||
70 | return (void __iomem *)cookie; | ||
71 | } | ||
72 | |||
73 | #define __arch_ioremap __arch_ioremap | ||
74 | #define __arch_iounmap(cookie) do { } while (0) | ||
69 | 75 | ||
70 | extern void insb(unsigned int port, void *buf, int sz); | 76 | extern void insb(unsigned int port, void *buf, int sz); |
71 | extern void insw(unsigned int port, void *buf, int sz); | 77 | extern void insw(unsigned int port, void *buf, int sz); |
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h index f3bc70eee35b..67ed43674c63 100644 --- a/include/asm-arm/arch-pxa/irqs.h +++ b/include/asm-arm/arch-pxa/irqs.h | |||
@@ -73,7 +73,7 @@ | |||
73 | #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) | 73 | #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) |
74 | 74 | ||
75 | #if defined(CONFIG_PXA25x) | 75 | #if defined(CONFIG_PXA25x) |
76 | #define PXA_LAST_GPIO 80 | 76 | #define PXA_LAST_GPIO 84 |
77 | #elif defined(CONFIG_PXA27x) | 77 | #elif defined(CONFIG_PXA27x) |
78 | #define PXA_LAST_GPIO 127 | 78 | #define PXA_LAST_GPIO 127 |
79 | #endif | 79 | #endif |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index f5cc65dd7d0d..cff752f35230 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -1681,6 +1681,7 @@ | |||
1681 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | 1681 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ |
1682 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | 1682 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ |
1683 | 1683 | ||
1684 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
1684 | #define SSPSP_DMYSTOP(x) (x << 23) /* Dummy Stop */ | 1685 | #define SSPSP_DMYSTOP(x) (x << 23) /* Dummy Stop */ |
1685 | #define SSPSP_SFRMWDTH(x) (x << 16) /* Serial Frame Width */ | 1686 | #define SSPSP_SFRMWDTH(x) (x << 16) /* Serial Frame Width */ |
1686 | #define SSPSP_SFRMDLY(x) (x << 9) /* Serial Frame Delay */ | 1687 | #define SSPSP_SFRMDLY(x) (x << 9) /* Serial Frame Delay */ |
@@ -2241,7 +2242,7 @@ | |||
2241 | 2242 | ||
2242 | #define CICR1_TBIT (1 << 31) /* Transparency bit */ | 2243 | #define CICR1_TBIT (1 << 31) /* Transparency bit */ |
2243 | #define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */ | 2244 | #define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */ |
2244 | #define CICR1_PPL (0x3f << 15) /* Pixels per line mask */ | 2245 | #define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */ |
2245 | #define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */ | 2246 | #define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */ |
2246 | #define CICR1_RGB_F (1 << 11) /* RGB format */ | 2247 | #define CICR1_RGB_F (1 << 11) /* RGB format */ |
2247 | #define CICR1_YCBCR_F (1 << 10) /* YCbCr format */ | 2248 | #define CICR1_YCBCR_F (1 << 10) /* YCbCr format */ |
@@ -2267,7 +2268,7 @@ | |||
2267 | #define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */ | 2268 | #define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */ |
2268 | #define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock | 2269 | #define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock |
2269 | wait count mask */ | 2270 | wait count mask */ |
2270 | #define CICR3_LPF (0x3ff << 0) /* Lines per frame mask */ | 2271 | #define CICR3_LPF (0x7ff << 0) /* Lines per frame mask */ |
2271 | 2272 | ||
2272 | #define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */ | 2273 | #define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */ |
2273 | #define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */ | 2274 | #define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */ |
@@ -2288,8 +2289,8 @@ | |||
2288 | #define CISR_EOL (1 << 8) /* End of line */ | 2289 | #define CISR_EOL (1 << 8) /* End of line */ |
2289 | #define CISR_PAR_ERR (1 << 7) /* Parity error */ | 2290 | #define CISR_PAR_ERR (1 << 7) /* Parity error */ |
2290 | #define CISR_CQD (1 << 6) /* Camera interface quick disable */ | 2291 | #define CISR_CQD (1 << 6) /* Camera interface quick disable */ |
2291 | #define CISR_SOF (1 << 5) /* Start of frame */ | 2292 | #define CISR_CDD (1 << 5) /* Camera interface disable done */ |
2292 | #define CISR_CDD (1 << 4) /* Camera interface disable done */ | 2293 | #define CISR_SOF (1 << 4) /* Start of frame */ |
2293 | #define CISR_EOF (1 << 3) /* End of frame */ | 2294 | #define CISR_EOF (1 << 3) /* End of frame */ |
2294 | #define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */ | 2295 | #define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */ |
2295 | #define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */ | 2296 | #define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */ |
diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h index 121cd241115d..646480d37256 100644 --- a/include/asm-arm/arch-pxa/udc.h +++ b/include/asm-arm/arch-pxa/udc.h | |||
@@ -4,23 +4,8 @@ | |||
4 | * This supports machine-specific differences in how the PXA2xx | 4 | * This supports machine-specific differences in how the PXA2xx |
5 | * USB Device Controller (UDC) is wired. | 5 | * USB Device Controller (UDC) is wired. |
6 | * | 6 | * |
7 | * It is set in linux/arch/arm/mach-pxa/<machine>.c and used in | ||
8 | * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c | ||
9 | */ | 7 | */ |
10 | struct pxa2xx_udc_mach_info { | 8 | #include <asm/mach/udc_pxa2xx.h> |
11 | int (*udc_is_connected)(void); /* do we see host? */ | ||
12 | void (*udc_command)(int cmd); | ||
13 | #define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */ | ||
14 | #define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */ | ||
15 | |||
16 | /* Boards following the design guidelines in the developer's manual, | ||
17 | * with on-chip GPIOs not Lubbock's wierd hardware, can have a sane | ||
18 | * VBUS IRQ and omit the methods above. Store the GPIO number | ||
19 | * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits. | ||
20 | */ | ||
21 | u16 gpio_vbus; /* high == vbus present */ | ||
22 | u16 gpio_pullup; /* high == pullup activated */ | ||
23 | }; | ||
24 | 9 | ||
25 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); | 10 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); |
26 | 11 | ||
diff --git a/include/asm-arm/arch-sa1100/jornada720.h b/include/asm-arm/arch-sa1100/jornada720.h index 1b8e8a304800..3f37ca07806d 100644 --- a/include/asm-arm/arch-sa1100/jornada720.h +++ b/include/asm-arm/arch-sa1100/jornada720.h | |||
@@ -19,6 +19,20 @@ | |||
19 | #define GPIO_JORNADA720_KEYBOARD_IRQ IRQ_GPIO0 | 19 | #define GPIO_JORNADA720_KEYBOARD_IRQ IRQ_GPIO0 |
20 | #define GPIO_JORNADA720_MOUSE_IRQ IRQ_GPIO9 | 20 | #define GPIO_JORNADA720_MOUSE_IRQ IRQ_GPIO9 |
21 | 21 | ||
22 | /* MCU COMMANDS */ | ||
23 | #define MCU_GetBatteryData 0xc0 | ||
24 | #define MCU_GetScanKeyCode 0x90 | ||
25 | #define MCU_GetTouchSamples 0xa0 | ||
26 | #define MCU_GetContrast 0xD0 | ||
27 | #define MCU_SetContrast 0xD1 | ||
28 | #define MCU_GetBrightness 0xD2 | ||
29 | #define MCU_SetBrightness 0xD3 | ||
30 | #define MCU_ContrastOff 0xD8 | ||
31 | #define MCU_BrightnessOff 0xD9 | ||
32 | #define MCU_PWMOFF 0xDF | ||
33 | #define MCU_TxDummy 0x11 | ||
34 | #define MCU_ErrorCode 0x00 | ||
35 | |||
22 | #ifndef __ASSEMBLY__ | 36 | #ifndef __ASSEMBLY__ |
23 | 37 | ||
24 | void jornada720_mcu_init(void); | 38 | void jornada720_mcu_init(void); |
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h index 747bdd31a74b..8c0bb5bb14ee 100644 --- a/include/asm-arm/checksum.h +++ b/include/asm-arm/checksum.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * | 23 | * |
24 | * it's best to have buff aligned on a 32-bit boundary | 24 | * it's best to have buff aligned on a 32-bit boundary |
25 | */ | 25 | */ |
26 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 26 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * the same as csum_partial, but copies from src while it | 29 | * the same as csum_partial, but copies from src while it |
@@ -33,26 +33,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
33 | * better 64-bit) boundary | 33 | * better 64-bit) boundary |
34 | */ | 34 | */ |
35 | 35 | ||
36 | unsigned int | 36 | __wsum |
37 | csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum); | 37 | csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); |
38 | 38 | ||
39 | unsigned int | 39 | __wsum |
40 | csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr); | 40 | csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); |
41 | |||
42 | /* | ||
43 | * This is the old (and unsafe) way of doing checksums, a warning message will | ||
44 | * be printed if it is used and an exception occurs. | ||
45 | * | ||
46 | * this functions should go away after some time. | ||
47 | */ | ||
48 | #define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum) | ||
49 | 41 | ||
50 | /* | 42 | /* |
51 | * This is a version of ip_compute_csum() optimized for IP headers, | 43 | * This is a version of ip_compute_csum() optimized for IP headers, |
52 | * which always checksum on 4 octet boundaries. | 44 | * which always checksum on 4 octet boundaries. |
53 | */ | 45 | */ |
54 | static inline unsigned short | 46 | static inline __sum16 |
55 | ip_fast_csum(unsigned char * iph, unsigned int ihl) | 47 | ip_fast_csum(const void *iph, unsigned int ihl) |
56 | { | 48 | { |
57 | unsigned int sum, tmp1; | 49 | unsigned int sum, tmp1; |
58 | 50 | ||
@@ -78,14 +70,13 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl) | |||
78 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) | 70 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) |
79 | : "1" (iph), "2" (ihl) | 71 | : "1" (iph), "2" (ihl) |
80 | : "cc", "memory"); | 72 | : "cc", "memory"); |
81 | return sum; | 73 | return (__force __sum16)sum; |
82 | } | 74 | } |
83 | 75 | ||
84 | /* | 76 | /* |
85 | * Fold a partial checksum without adding pseudo headers | 77 | * Fold a partial checksum without adding pseudo headers |
86 | */ | 78 | */ |
87 | static inline unsigned int | 79 | static inline __sum16 csum_fold(__wsum sum) |
88 | csum_fold(unsigned int sum) | ||
89 | { | 80 | { |
90 | __asm__( | 81 | __asm__( |
91 | "adds %0, %1, %1, lsl #16 @ csum_fold \n\ | 82 | "adds %0, %1, %1, lsl #16 @ csum_fold \n\ |
@@ -93,21 +84,25 @@ csum_fold(unsigned int sum) | |||
93 | : "=r" (sum) | 84 | : "=r" (sum) |
94 | : "r" (sum) | 85 | : "r" (sum) |
95 | : "cc"); | 86 | : "cc"); |
96 | return (~sum) >> 16; | 87 | return (__force __sum16)(~(__force u32)sum >> 16); |
97 | } | 88 | } |
98 | 89 | ||
99 | static inline unsigned int | 90 | static inline __wsum |
100 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 91 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
101 | unsigned int proto, unsigned int sum) | 92 | unsigned short proto, __wsum sum) |
102 | { | 93 | { |
103 | __asm__( | 94 | __asm__( |
104 | "adds %0, %1, %2 @ csum_tcpudp_nofold \n\ | 95 | "adds %0, %1, %2 @ csum_tcpudp_nofold \n\ |
105 | adcs %0, %0, %3 \n\ | 96 | adcs %0, %0, %3 \n" |
106 | adcs %0, %0, %4 \n\ | 97 | #ifdef __ARMEB__ |
107 | adcs %0, %0, %5 \n\ | 98 | "adcs %0, %0, %4 \n" |
99 | #else | ||
100 | "adcs %0, %0, %4, lsl #8 \n" | ||
101 | #endif | ||
102 | "adcs %0, %0, %5 \n\ | ||
108 | adc %0, %0, #0" | 103 | adc %0, %0, #0" |
109 | : "=&r"(sum) | 104 | : "=&r"(sum) |
110 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto)) | 105 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto)) |
111 | : "cc"); | 106 | : "cc"); |
112 | return sum; | 107 | return sum; |
113 | } | 108 | } |
@@ -115,23 +110,27 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
115 | * computes the checksum of the TCP/UDP pseudo-header | 110 | * computes the checksum of the TCP/UDP pseudo-header |
116 | * returns a 16-bit checksum, already complemented | 111 | * returns a 16-bit checksum, already complemented |
117 | */ | 112 | */ |
118 | static inline unsigned short int | 113 | static inline __sum16 |
119 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 114 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
120 | unsigned int proto, unsigned int sum) | 115 | unsigned short proto, __wsum sum) |
121 | { | 116 | { |
122 | __asm__( | 117 | __asm__( |
123 | "adds %0, %1, %2 @ csum_tcpudp_magic \n\ | 118 | "adds %0, %1, %2 @ csum_tcpudp_magic \n\ |
124 | adcs %0, %0, %3 \n\ | 119 | adcs %0, %0, %3 \n" |
125 | adcs %0, %0, %4 \n\ | 120 | #ifdef __ARMEB__ |
126 | adcs %0, %0, %5 \n\ | 121 | "adcs %0, %0, %4 \n" |
122 | #else | ||
123 | "adcs %0, %0, %4, lsl #8 \n" | ||
124 | #endif | ||
125 | "adcs %0, %0, %5 \n\ | ||
127 | adc %0, %0, #0 \n\ | 126 | adc %0, %0, #0 \n\ |
128 | adds %0, %0, %0, lsl #16 \n\ | 127 | adds %0, %0, %0, lsl #16 \n\ |
129 | addcs %0, %0, #0x10000 \n\ | 128 | addcs %0, %0, #0x10000 \n\ |
130 | mvn %0, %0" | 129 | mvn %0, %0" |
131 | : "=&r"(sum) | 130 | : "=&r"(sum) |
132 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto)) | 131 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto)) |
133 | : "cc"); | 132 | : "cc"); |
134 | return sum >> 16; | 133 | return (__force __sum16)((__force u32)sum >> 16); |
135 | } | 134 | } |
136 | 135 | ||
137 | 136 | ||
@@ -139,20 +138,20 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
139 | * this routine is used for miscellaneous IP-like checksums, mainly | 138 | * this routine is used for miscellaneous IP-like checksums, mainly |
140 | * in icmp.c | 139 | * in icmp.c |
141 | */ | 140 | */ |
142 | static inline unsigned short | 141 | static inline __sum16 |
143 | ip_compute_csum(unsigned char * buff, int len) | 142 | ip_compute_csum(const void *buff, int len) |
144 | { | 143 | { |
145 | return csum_fold(csum_partial(buff, len, 0)); | 144 | return csum_fold(csum_partial(buff, len, 0)); |
146 | } | 145 | } |
147 | 146 | ||
148 | #define _HAVE_ARCH_IPV6_CSUM | 147 | #define _HAVE_ARCH_IPV6_CSUM |
149 | extern unsigned long | 148 | extern __wsum |
150 | __csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len, | 149 | __csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len, |
151 | __u32 proto, unsigned int sum); | 150 | __be32 proto, __wsum sum); |
152 | 151 | ||
153 | static inline unsigned short int | 152 | static inline __sum16 |
154 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len, | 153 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len, |
155 | unsigned short proto, unsigned int sum) | 154 | unsigned short proto, __wsum sum) |
156 | { | 155 | { |
157 | return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len), | 156 | return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len), |
158 | htonl(proto), sum)); | 157 | htonl(proto), sum)); |
diff --git a/include/asm-arm/device.h b/include/asm-arm/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-arm/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index 55eb4dc3253d..666617711c81 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
@@ -12,6 +12,10 @@ | |||
12 | * uncached, unwrite-buffered mapped memory space for use with DMA | 12 | * uncached, unwrite-buffered mapped memory space for use with DMA |
13 | * devices. This is the "generic" version. The PCI specific version | 13 | * devices. This is the "generic" version. The PCI specific version |
14 | * is in pci.h | 14 | * is in pci.h |
15 | * | ||
16 | * Note: Drivers should NOT use this function directly, as it will break | ||
17 | * platforms with CONFIG_DMABOUNCE. | ||
18 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) | ||
15 | */ | 19 | */ |
16 | extern void consistent_sync(void *kaddr, size_t size, int rw); | 20 | extern void consistent_sync(void *kaddr, size_t size, int rw); |
17 | 21 | ||
diff --git a/include/asm-arm/mach/udc_pxa2xx.h b/include/asm-arm/mach/udc_pxa2xx.h new file mode 100644 index 000000000000..ff0a95715a07 --- /dev/null +++ b/include/asm-arm/mach/udc_pxa2xx.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/mach/udc_pxa2xx.h | ||
3 | * | ||
4 | * This supports machine-specific differences in how the PXA2xx | ||
5 | * USB Device Controller (UDC) is wired. | ||
6 | * | ||
7 | * It is set in linux/arch/arm/mach-pxa/<machine>.c or in | ||
8 | * linux/arch/mach-ixp4xx/<machine>.c and used in | ||
9 | * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c | ||
10 | */ | ||
11 | |||
12 | struct pxa2xx_udc_mach_info { | ||
13 | int (*udc_is_connected)(void); /* do we see host? */ | ||
14 | void (*udc_command)(int cmd); | ||
15 | #define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */ | ||
16 | #define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */ | ||
17 | |||
18 | /* Boards following the design guidelines in the developer's manual, | ||
19 | * with on-chip GPIOs not Lubbock's wierd hardware, can have a sane | ||
20 | * VBUS IRQ and omit the methods above. Store the GPIO number | ||
21 | * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits. | ||
22 | */ | ||
23 | u16 gpio_vbus; /* high == vbus present */ | ||
24 | u16 gpio_pullup; /* high == pullup activated */ | ||
25 | }; | ||
26 | |||
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index 09ad0cab9014..5f420a0149f1 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h | |||
@@ -383,19 +383,19 @@ do { \ | |||
383 | 383 | ||
384 | 384 | ||
385 | #ifdef CONFIG_MMU | 385 | #ifdef CONFIG_MMU |
386 | extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); | 386 | extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n); |
387 | extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); | 387 | extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n); |
388 | extern unsigned long __clear_user(void __user *addr, unsigned long n); | 388 | extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n); |
389 | #else | 389 | #else |
390 | #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) | 390 | #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) |
391 | #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) | 391 | #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) |
392 | #define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) | 392 | #define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) |
393 | #endif | 393 | #endif |
394 | 394 | ||
395 | extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); | 395 | extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count); |
396 | extern unsigned long __strnlen_user(const char __user *s, long n); | 396 | extern unsigned long __must_check __strnlen_user(const char __user *s, long n); |
397 | 397 | ||
398 | static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) | 398 | static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) |
399 | { | 399 | { |
400 | if (access_ok(VERIFY_READ, from, n)) | 400 | if (access_ok(VERIFY_READ, from, n)) |
401 | n = __copy_from_user(to, from, n); | 401 | n = __copy_from_user(to, from, n); |
@@ -404,7 +404,7 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un | |||
404 | return n; | 404 | return n; |
405 | } | 405 | } |
406 | 406 | ||
407 | static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) | 407 | static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) |
408 | { | 408 | { |
409 | if (access_ok(VERIFY_WRITE, to, n)) | 409 | if (access_ok(VERIFY_WRITE, to, n)) |
410 | n = __copy_to_user(to, from, n); | 410 | n = __copy_to_user(to, from, n); |
@@ -414,14 +414,14 @@ static inline unsigned long copy_to_user(void __user *to, const void *from, unsi | |||
414 | #define __copy_to_user_inatomic __copy_to_user | 414 | #define __copy_to_user_inatomic __copy_to_user |
415 | #define __copy_from_user_inatomic __copy_from_user | 415 | #define __copy_from_user_inatomic __copy_from_user |
416 | 416 | ||
417 | static inline unsigned long clear_user(void __user *to, unsigned long n) | 417 | static inline unsigned long __must_check clear_user(void __user *to, unsigned long n) |
418 | { | 418 | { |
419 | if (access_ok(VERIFY_WRITE, to, n)) | 419 | if (access_ok(VERIFY_WRITE, to, n)) |
420 | n = __clear_user(to, n); | 420 | n = __clear_user(to, n); |
421 | return n; | 421 | return n; |
422 | } | 422 | } |
423 | 423 | ||
424 | static inline long strncpy_from_user(char *dst, const char __user *src, long count) | 424 | static inline long __must_check strncpy_from_user(char *dst, const char __user *src, long count) |
425 | { | 425 | { |
426 | long res = -EFAULT; | 426 | long res = -EFAULT; |
427 | if (access_ok(VERIFY_READ, src, 1)) | 427 | if (access_ok(VERIFY_READ, src, 1)) |
@@ -431,7 +431,7 @@ static inline long strncpy_from_user(char *dst, const char __user *src, long cou | |||
431 | 431 | ||
432 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) | 432 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) |
433 | 433 | ||
434 | static inline long strnlen_user(const char __user *s, long n) | 434 | static inline long __must_check strnlen_user(const char __user *s, long n) |
435 | { | 435 | { |
436 | unsigned long res = 0; | 436 | unsigned long res = 0; |
437 | 437 | ||
diff --git a/include/asm-arm26/checksum.h b/include/asm-arm26/checksum.h index d4256d5f3a7c..f2b4b0a403bd 100644 --- a/include/asm-arm26/checksum.h +++ b/include/asm-arm26/checksum.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * | 23 | * |
24 | * it's best to have buff aligned on a 32-bit boundary | 24 | * it's best to have buff aligned on a 32-bit boundary |
25 | */ | 25 | */ |
26 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 26 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * the same as csum_partial, but copies from src while it | 29 | * the same as csum_partial, but copies from src while it |
@@ -33,26 +33,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
33 | * better 64-bit) boundary | 33 | * better 64-bit) boundary |
34 | */ | 34 | */ |
35 | 35 | ||
36 | unsigned int | 36 | __wsum |
37 | csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum); | 37 | csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); |
38 | 38 | ||
39 | unsigned int | 39 | __wsum |
40 | csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr); | 40 | csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr); |
41 | |||
42 | /* | ||
43 | * This is the old (and unsafe) way of doing checksums, a warning message will | ||
44 | * be printed if it is used and an exception occurs. | ||
45 | * | ||
46 | * this functions should go away after some time. | ||
47 | */ | ||
48 | #define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum) | ||
49 | 41 | ||
50 | /* | 42 | /* |
51 | * This is a version of ip_compute_csum() optimized for IP headers, | 43 | * This is a version of ip_compute_csum() optimized for IP headers, |
52 | * which always checksum on 4 octet boundaries. | 44 | * which always checksum on 4 octet boundaries. |
53 | */ | 45 | */ |
54 | static inline unsigned short | 46 | static inline __sum16 |
55 | ip_fast_csum(unsigned char * iph, unsigned int ihl) | 47 | ip_fast_csum(const void *iph, unsigned int ihl) |
56 | { | 48 | { |
57 | unsigned int sum, tmp1; | 49 | unsigned int sum, tmp1; |
58 | 50 | ||
@@ -78,14 +70,13 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl) | |||
78 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) | 70 | : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) |
79 | : "1" (iph), "2" (ihl) | 71 | : "1" (iph), "2" (ihl) |
80 | : "cc"); | 72 | : "cc"); |
81 | return sum; | 73 | return (__force __sum16)sum; |
82 | } | 74 | } |
83 | 75 | ||
84 | /* | 76 | /* |
85 | * Fold a partial checksum without adding pseudo headers | 77 | * Fold a partial checksum without adding pseudo headers |
86 | */ | 78 | */ |
87 | static inline unsigned int | 79 | static inline __sum16 csum_fold(__wsum sum) |
88 | csum_fold(unsigned int sum) | ||
89 | { | 80 | { |
90 | __asm__( | 81 | __asm__( |
91 | "adds %0, %1, %1, lsl #16 @ csum_fold \n\ | 82 | "adds %0, %1, %1, lsl #16 @ csum_fold \n\ |
@@ -93,12 +84,12 @@ csum_fold(unsigned int sum) | |||
93 | : "=r" (sum) | 84 | : "=r" (sum) |
94 | : "r" (sum) | 85 | : "r" (sum) |
95 | : "cc"); | 86 | : "cc"); |
96 | return (~sum) >> 16; | 87 | return (__force __sum16)(~(__force u32)sum >> 16); |
97 | } | 88 | } |
98 | 89 | ||
99 | static inline unsigned int | 90 | static inline __wsum |
100 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 91 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
101 | unsigned int proto, unsigned int sum) | 92 | unsigned short proto, __wsum sum) |
102 | { | 93 | { |
103 | __asm__( | 94 | __asm__( |
104 | "adds %0, %1, %2 @ csum_tcpudp_nofold \n\ | 95 | "adds %0, %1, %2 @ csum_tcpudp_nofold \n\ |
@@ -107,7 +98,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
107 | adcs %0, %0, %5 \n\ | 98 | adcs %0, %0, %5 \n\ |
108 | adc %0, %0, #0" | 99 | adc %0, %0, #0" |
109 | : "=&r"(sum) | 100 | : "=&r"(sum) |
110 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto)) | 101 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto)) |
111 | : "cc"); | 102 | : "cc"); |
112 | return sum; | 103 | return sum; |
113 | } | 104 | } |
@@ -115,9 +106,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
115 | * computes the checksum of the TCP/UDP pseudo-header | 106 | * computes the checksum of the TCP/UDP pseudo-header |
116 | * returns a 16-bit checksum, already complemented | 107 | * returns a 16-bit checksum, already complemented |
117 | */ | 108 | */ |
118 | static inline unsigned short int | 109 | static inline __sum16 |
119 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 110 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
120 | unsigned int proto, unsigned int sum) | 111 | unsigned short proto, __wsum sum) |
121 | { | 112 | { |
122 | __asm__( | 113 | __asm__( |
123 | "adds %0, %1, %2 @ csum_tcpudp_magic \n\ | 114 | "adds %0, %1, %2 @ csum_tcpudp_magic \n\ |
@@ -129,9 +120,9 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
129 | addcs %0, %0, #0x10000 \n\ | 120 | addcs %0, %0, #0x10000 \n\ |
130 | mvn %0, %0" | 121 | mvn %0, %0" |
131 | : "=&r"(sum) | 122 | : "=&r"(sum) |
132 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto)) | 123 | : "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto)) |
133 | : "cc"); | 124 | : "cc"); |
134 | return sum >> 16; | 125 | return (__force __sum16)((__force u32)sum >> 16); |
135 | } | 126 | } |
136 | 127 | ||
137 | 128 | ||
@@ -139,20 +130,20 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
139 | * this routine is used for miscellaneous IP-like checksums, mainly | 130 | * this routine is used for miscellaneous IP-like checksums, mainly |
140 | * in icmp.c | 131 | * in icmp.c |
141 | */ | 132 | */ |
142 | static inline unsigned short | 133 | static inline __sum16 |
143 | ip_compute_csum(unsigned char * buff, int len) | 134 | ip_compute_csum(const void *buff, int len) |
144 | { | 135 | { |
145 | return csum_fold(csum_partial(buff, len, 0)); | 136 | return csum_fold(csum_partial(buff, len, 0)); |
146 | } | 137 | } |
147 | 138 | ||
148 | #define _HAVE_ARCH_IPV6_CSUM | 139 | #define _HAVE_ARCH_IPV6_CSUM |
149 | extern unsigned long | 140 | extern __wsum |
150 | __csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len, | 141 | __csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len, |
151 | __u32 proto, unsigned int sum); | 142 | __be32 proto, __wsum sum); |
152 | 143 | ||
153 | static inline unsigned short int | 144 | static inline __sum16 |
154 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len, | 145 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len, |
155 | unsigned short proto, unsigned int sum) | 146 | unsigned short proto, __wsum sum) |
156 | { | 147 | { |
157 | return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len), | 148 | return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len), |
158 | htonl(proto), sum)); | 149 | htonl(proto), sum)); |
diff --git a/include/asm-arm26/device.h b/include/asm-arm26/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-arm26/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-avr32/atomic.h b/include/asm-avr32/atomic.h index e0b9c44c126c..c40b6032c480 100644 --- a/include/asm-avr32/atomic.h +++ b/include/asm-avr32/atomic.h | |||
@@ -41,7 +41,7 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
41 | " stcond %1, %0\n" | 41 | " stcond %1, %0\n" |
42 | " brne 1b" | 42 | " brne 1b" |
43 | : "=&r"(result), "=o"(v->counter) | 43 | : "=&r"(result), "=o"(v->counter) |
44 | : "m"(v->counter), "ir"(i) | 44 | : "m"(v->counter), "rKs21"(i) |
45 | : "cc"); | 45 | : "cc"); |
46 | 46 | ||
47 | return result; | 47 | return result; |
@@ -58,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v) | |||
58 | { | 58 | { |
59 | int result; | 59 | int result; |
60 | 60 | ||
61 | if (__builtin_constant_p(i)) | 61 | if (__builtin_constant_p(i) && (i >= -1048575) && (i <= 1048576)) |
62 | result = atomic_sub_return(-i, v); | 62 | result = atomic_sub_return(-i, v); |
63 | else | 63 | else |
64 | asm volatile( | 64 | asm volatile( |
@@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u) | |||
101 | " mov %1, 1\n" | 101 | " mov %1, 1\n" |
102 | "1:" | 102 | "1:" |
103 | : "=&r"(tmp), "=&r"(result), "=o"(v->counter) | 103 | : "=&r"(tmp), "=&r"(result), "=o"(v->counter) |
104 | : "m"(v->counter), "ir"(a), "ir"(u) | 104 | : "m"(v->counter), "rKs21"(a), "rKs21"(u) |
105 | : "cc", "memory"); | 105 | : "cc", "memory"); |
106 | 106 | ||
107 | return result; | 107 | return result; |
@@ -121,7 +121,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
121 | { | 121 | { |
122 | int tmp, result; | 122 | int tmp, result; |
123 | 123 | ||
124 | if (__builtin_constant_p(a)) | 124 | if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576)) |
125 | result = atomic_sub_unless(v, -a, u); | 125 | result = atomic_sub_unless(v, -a, u); |
126 | else { | 126 | else { |
127 | result = 0; | 127 | result = 0; |
diff --git a/include/asm-avr32/checksum.h b/include/asm-avr32/checksum.h index 41b7af09edc4..af9d53f0f5d2 100644 --- a/include/asm-avr32/checksum.h +++ b/include/asm-avr32/checksum.h | |||
@@ -20,8 +20,7 @@ | |||
20 | * | 20 | * |
21 | * it's best to have buff aligned on a 32-bit boundary | 21 | * it's best to have buff aligned on a 32-bit boundary |
22 | */ | 22 | */ |
23 | unsigned int csum_partial(const unsigned char * buff, int len, | 23 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
24 | unsigned int sum); | ||
25 | 24 | ||
26 | /* | 25 | /* |
27 | * the same as csum_partial, but copies from src while it | 26 | * the same as csum_partial, but copies from src while it |
@@ -30,8 +29,8 @@ unsigned int csum_partial(const unsigned char * buff, int len, | |||
30 | * here even more important to align src and dst on a 32-bit (or even | 29 | * here even more important to align src and dst on a 32-bit (or even |
31 | * better 64-bit) boundary | 30 | * better 64-bit) boundary |
32 | */ | 31 | */ |
33 | unsigned int csum_partial_copy_generic(const char *src, char *dst, int len, | 32 | __wsum csum_partial_copy_generic(const void *src, void *dst, int len, |
34 | int sum, int *src_err_ptr, | 33 | __wsum sum, int *src_err_ptr, |
35 | int *dst_err_ptr); | 34 | int *dst_err_ptr); |
36 | 35 | ||
37 | /* | 36 | /* |
@@ -42,17 +41,17 @@ unsigned int csum_partial_copy_generic(const char *src, char *dst, int len, | |||
42 | * verify_area(). | 41 | * verify_area(). |
43 | */ | 42 | */ |
44 | static inline | 43 | static inline |
45 | unsigned int csum_partial_copy_nocheck(const char *src, char *dst, | 44 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
46 | int len, int sum) | 45 | int len, __wsum sum) |
47 | { | 46 | { |
48 | return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); | 47 | return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); |
49 | } | 48 | } |
50 | 49 | ||
51 | static inline | 50 | static inline |
52 | unsigned int csum_partial_copy_from_user (const char __user *src, char *dst, | 51 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
53 | int len, int sum, int *err_ptr) | 52 | int len, __wsum sum, int *err_ptr) |
54 | { | 53 | { |
55 | return csum_partial_copy_generic((const char __force *)src, dst, len, | 54 | return csum_partial_copy_generic((const void __force *)src, dst, len, |
56 | sum, err_ptr, NULL); | 55 | sum, err_ptr, NULL); |
57 | } | 56 | } |
58 | 57 | ||
@@ -60,8 +59,7 @@ unsigned int csum_partial_copy_from_user (const char __user *src, char *dst, | |||
60 | * This is a version of ip_compute_csum() optimized for IP headers, | 59 | * This is a version of ip_compute_csum() optimized for IP headers, |
61 | * which always checksum on 4 octet boundaries. | 60 | * which always checksum on 4 octet boundaries. |
62 | */ | 61 | */ |
63 | static inline unsigned short ip_fast_csum(unsigned char *iph, | 62 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
64 | unsigned int ihl) | ||
65 | { | 63 | { |
66 | unsigned int sum, tmp; | 64 | unsigned int sum, tmp; |
67 | 65 | ||
@@ -90,14 +88,14 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, | |||
90 | : "=r"(sum), "=r"(iph), "=r"(ihl), "=r"(tmp) | 88 | : "=r"(sum), "=r"(iph), "=r"(ihl), "=r"(tmp) |
91 | : "1"(iph), "2"(ihl) | 89 | : "1"(iph), "2"(ihl) |
92 | : "memory", "cc"); | 90 | : "memory", "cc"); |
93 | return sum; | 91 | return (__force __sum16)sum; |
94 | } | 92 | } |
95 | 93 | ||
96 | /* | 94 | /* |
97 | * Fold a partial checksum | 95 | * Fold a partial checksum |
98 | */ | 96 | */ |
99 | 97 | ||
100 | static inline unsigned int csum_fold(unsigned int sum) | 98 | static inline __sum16 csum_fold(__wsum sum) |
101 | { | 99 | { |
102 | unsigned int tmp; | 100 | unsigned int tmp; |
103 | 101 | ||
@@ -109,21 +107,20 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
109 | : "=&r"(sum), "=&r"(tmp) | 107 | : "=&r"(sum), "=&r"(tmp) |
110 | : "0"(sum)); | 108 | : "0"(sum)); |
111 | 109 | ||
112 | return ~sum; | 110 | return (__force __sum16)~sum; |
113 | } | 111 | } |
114 | 112 | ||
115 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 113 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
116 | unsigned long daddr, | ||
117 | unsigned short len, | 114 | unsigned short len, |
118 | unsigned short proto, | 115 | unsigned short proto, |
119 | unsigned int sum) | 116 | __wsum sum) |
120 | { | 117 | { |
121 | asm(" add %0, %1\n" | 118 | asm(" add %0, %1\n" |
122 | " adc %0, %0, %2\n" | 119 | " adc %0, %0, %2\n" |
123 | " adc %0, %0, %3\n" | 120 | " adc %0, %0, %3\n" |
124 | " acr %0" | 121 | " acr %0" |
125 | : "=r"(sum) | 122 | : "=r"(sum) |
126 | : "r"(daddr), "r"(saddr), "r"(ntohs(len) | (proto << 16)), | 123 | : "r"(daddr), "r"(saddr), "r"(len + proto), |
127 | "0"(sum) | 124 | "0"(sum) |
128 | : "cc"); | 125 | : "cc"); |
129 | 126 | ||
@@ -134,11 +131,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
134 | * computes the checksum of the TCP/UDP pseudo-header | 131 | * computes the checksum of the TCP/UDP pseudo-header |
135 | * returns a 16-bit checksum, already complemented | 132 | * returns a 16-bit checksum, already complemented |
136 | */ | 133 | */ |
137 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 134 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
138 | unsigned long daddr, | ||
139 | unsigned short len, | 135 | unsigned short len, |
140 | unsigned short proto, | 136 | unsigned short proto, |
141 | unsigned int sum) | 137 | __wsum sum) |
142 | { | 138 | { |
143 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 139 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
144 | } | 140 | } |
@@ -148,7 +144,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
148 | * in icmp.c | 144 | * in icmp.c |
149 | */ | 145 | */ |
150 | 146 | ||
151 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 147 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
152 | { | 148 | { |
153 | return csum_fold(csum_partial(buff, len, 0)); | 149 | return csum_fold(csum_partial(buff, len, 0)); |
154 | } | 150 | } |
diff --git a/include/asm-avr32/device.h b/include/asm-avr32/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-avr32/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h index 2fc8f111dce9..eec47500fa66 100644 --- a/include/asm-avr32/io.h +++ b/include/asm-avr32/io.h | |||
@@ -76,6 +76,39 @@ static inline unsigned int readl(const volatile void __iomem *addr) | |||
76 | #define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l) | 76 | #define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l) |
77 | #define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l) | 77 | #define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l) |
78 | 78 | ||
79 | |||
80 | /* | ||
81 | * io{read,write}{8,16,32} macros in both le (for PCI style consumers) and native be | ||
82 | */ | ||
83 | #ifndef ioread8 | ||
84 | |||
85 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) | ||
86 | |||
87 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; }) | ||
88 | #define ioread16be(p) ({ unsigned int __v = be16_to_cpu(__raw_readw(p)); __v; }) | ||
89 | |||
90 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; }) | ||
91 | #define ioread32be(p) ({ unsigned int __v = be32_to_cpu(__raw_readl(p)); __v; }) | ||
92 | |||
93 | #define iowrite8(v,p) __raw_writeb(v, p) | ||
94 | |||
95 | #define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p) | ||
96 | #define iowrite16be(v,p) __raw_writew(cpu_to_be16(v), p) | ||
97 | |||
98 | #define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p) | ||
99 | #define iowrite32be(v,p) __raw_writel(cpu_to_be32(v), p) | ||
100 | |||
101 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | ||
102 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | ||
103 | #define ioread32_rep(p,d,c) __raw_readsl(p,d,c) | ||
104 | |||
105 | #define iowrite8_rep(p,s,c) __raw_writesb(p,s,c) | ||
106 | #define iowrite16_rep(p,s,c) __raw_writesw(p,s,c) | ||
107 | #define iowrite32_rep(p,s,c) __raw_writesl(p,s,c) | ||
108 | |||
109 | #endif | ||
110 | |||
111 | |||
79 | /* | 112 | /* |
80 | * These two are only here because ALSA _thinks_ it needs them... | 113 | * These two are only here because ALSA _thinks_ it needs them... |
81 | */ | 114 | */ |
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index a50e5004550c..56ed1f9d348a 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h | |||
@@ -280,9 +280,10 @@ | |||
280 | #define __NR_sync_file_range 262 | 280 | #define __NR_sync_file_range 262 |
281 | #define __NR_tee 263 | 281 | #define __NR_tee 263 |
282 | #define __NR_vmsplice 264 | 282 | #define __NR_vmsplice 264 |
283 | #define __NR_epoll_pwait 265 | ||
283 | 284 | ||
284 | #ifdef __KERNEL__ | 285 | #ifdef __KERNEL__ |
285 | #define NR_syscalls 265 | 286 | #define NR_syscalls 266 |
286 | 287 | ||
287 | 288 | ||
288 | #define __ARCH_WANT_IPC_PARSE_VERSION | 289 | #define __ARCH_WANT_IPC_PARSE_VERSION |
diff --git a/include/asm-cris/arch-v10/checksum.h b/include/asm-cris/arch-v10/checksum.h index 633f234f336b..b8000c5d7fe1 100644 --- a/include/asm-cris/arch-v10/checksum.h +++ b/include/asm-cris/arch-v10/checksum.h | |||
@@ -8,11 +8,11 @@ | |||
8 | * to split all of those into 16-bit components, then add. | 8 | * to split all of those into 16-bit components, then add. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | static inline unsigned int | 11 | static inline __wsum |
12 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 12 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
13 | unsigned short proto, unsigned int sum) | 13 | unsigned short proto, __wsum sum) |
14 | { | 14 | { |
15 | int res; | 15 | __wsum res; |
16 | __asm__ ("add.d %2, %0\n\t" | 16 | __asm__ ("add.d %2, %0\n\t" |
17 | "ax\n\t" | 17 | "ax\n\t" |
18 | "add.d %3, %0\n\t" | 18 | "add.d %3, %0\n\t" |
@@ -21,7 +21,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
21 | "ax\n\t" | 21 | "ax\n\t" |
22 | "addq 0, %0\n" | 22 | "addq 0, %0\n" |
23 | : "=r" (res) | 23 | : "=r" (res) |
24 | : "0" (sum), "r" (daddr), "r" (saddr), "r" ((ntohs(len) << 16) + (proto << 8))); | 24 | : "0" (sum), "r" (daddr), "r" (saddr), "r" ((len + proto) << 8)); |
25 | 25 | ||
26 | return res; | 26 | return res; |
27 | } | 27 | } |
diff --git a/include/asm-cris/arch-v32/checksum.h b/include/asm-cris/arch-v32/checksum.h index 97ef89efea62..e5dcfce6e0dc 100644 --- a/include/asm-cris/arch-v32/checksum.h +++ b/include/asm-cris/arch-v32/checksum.h | |||
@@ -9,11 +9,11 @@ | |||
9 | * checksum. Which means it would be necessary to split all those into | 9 | * checksum. Which means it would be necessary to split all those into |
10 | * 16-bit components and then add. | 10 | * 16-bit components and then add. |
11 | */ | 11 | */ |
12 | static inline unsigned int | 12 | static inline __wsum |
13 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 13 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
14 | unsigned short len, unsigned short proto, unsigned int sum) | 14 | unsigned short len, unsigned short proto, __wsum sum) |
15 | { | 15 | { |
16 | int res; | 16 | __wsum res; |
17 | 17 | ||
18 | __asm__ __volatile__ ("add.d %2, %0\n\t" | 18 | __asm__ __volatile__ ("add.d %2, %0\n\t" |
19 | "addc %3, %0\n\t" | 19 | "addc %3, %0\n\t" |
@@ -21,7 +21,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
21 | "addc 0, %0\n\t" | 21 | "addc 0, %0\n\t" |
22 | : "=r" (res) | 22 | : "=r" (res) |
23 | : "0" (sum), "r" (daddr), "r" (saddr), \ | 23 | : "0" (sum), "r" (daddr), "r" (saddr), \ |
24 | "r" ((ntohs(len) << 16) + (proto << 8))); | 24 | "r" ((len + proto) << 8)); |
25 | 25 | ||
26 | return res; | 26 | return res; |
27 | } | 27 | } |
diff --git a/include/asm-cris/checksum.h b/include/asm-cris/checksum.h index 26a7719bbb84..180dbf2757b0 100644 --- a/include/asm-cris/checksum.h +++ b/include/asm-cris/checksum.h | |||
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | * it's best to have buff aligned on a 32-bit boundary | 18 | * it's best to have buff aligned on a 32-bit boundary |
19 | */ | 19 | */ |
20 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 20 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * the same as csum_partial, but copies from src while it | 23 | * the same as csum_partial, but copies from src while it |
@@ -27,26 +27,23 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
27 | * better 64-bit) boundary | 27 | * better 64-bit) boundary |
28 | */ | 28 | */ |
29 | 29 | ||
30 | unsigned int csum_partial_copy_nocheck(const char *src, char *dst, | 30 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
31 | int len, unsigned int sum); | 31 | int len, __wsum sum); |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * Fold a partial checksum into a word | 34 | * Fold a partial checksum into a word |
35 | */ | 35 | */ |
36 | 36 | ||
37 | static inline unsigned int csum_fold(unsigned int sum) | 37 | static inline __sum16 csum_fold(__wsum csum) |
38 | { | 38 | { |
39 | /* the while loop is unnecessary really, it's always enough with two | 39 | u32 sum = (__force u32)csum; |
40 | iterations */ | 40 | sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */ |
41 | 41 | sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */ | |
42 | while(sum >> 16) | 42 | return (__force __sum16)~sum; |
43 | sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */ | ||
44 | |||
45 | return ~sum; | ||
46 | } | 43 | } |
47 | 44 | ||
48 | extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, | 45 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
49 | int len, unsigned int sum, | 46 | int len, __wsum sum, |
50 | int *errptr); | 47 | int *errptr); |
51 | 48 | ||
52 | /* | 49 | /* |
@@ -55,8 +52,7 @@ extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, | |||
55 | * | 52 | * |
56 | */ | 53 | */ |
57 | 54 | ||
58 | static inline unsigned short ip_fast_csum(unsigned char * iph, | 55 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
59 | unsigned int ihl) | ||
60 | { | 56 | { |
61 | return csum_fold(csum_partial(iph, ihl * 4, 0)); | 57 | return csum_fold(csum_partial(iph, ihl * 4, 0)); |
62 | } | 58 | } |
@@ -66,11 +62,10 @@ static inline unsigned short ip_fast_csum(unsigned char * iph, | |||
66 | * returns a 16-bit checksum, already complemented | 62 | * returns a 16-bit checksum, already complemented |
67 | */ | 63 | */ |
68 | 64 | ||
69 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 65 | static inline __sum16 int csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
70 | unsigned long daddr, | ||
71 | unsigned short len, | 66 | unsigned short len, |
72 | unsigned short proto, | 67 | unsigned short proto, |
73 | unsigned int sum) | 68 | __wsum sum) |
74 | { | 69 | { |
75 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 70 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
76 | } | 71 | } |
@@ -80,7 +75,8 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
80 | * in icmp.c | 75 | * in icmp.c |
81 | */ | 76 | */ |
82 | 77 | ||
83 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) { | 78 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
79 | { | ||
84 | return csum_fold (csum_partial(buff, len, 0)); | 80 | return csum_fold (csum_partial(buff, len, 0)); |
85 | } | 81 | } |
86 | 82 | ||
diff --git a/include/asm-cris/device.h b/include/asm-cris/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-cris/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-frv/checksum.h b/include/asm-frv/checksum.h index 42bf0db2287a..9b1689850187 100644 --- a/include/asm-frv/checksum.h +++ b/include/asm-frv/checksum.h | |||
@@ -26,7 +26,7 @@ | |||
26 | * | 26 | * |
27 | * it's best to have buff aligned on a 32-bit boundary | 27 | * it's best to have buff aligned on a 32-bit boundary |
28 | */ | 28 | */ |
29 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 29 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * the same as csum_partial, but copies from src while it | 32 | * the same as csum_partial, but copies from src while it |
@@ -35,7 +35,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
35 | * here even more important to align src and dst on a 32-bit (or even | 35 | * here even more important to align src and dst on a 32-bit (or even |
36 | * better 64-bit) boundary | 36 | * better 64-bit) boundary |
37 | */ | 37 | */ |
38 | unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); | 38 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * the same as csum_partial_copy, but copies from user space. | 41 | * the same as csum_partial_copy, but copies from user space. |
@@ -43,11 +43,8 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); | |||
43 | * here even more important to align src and dst on a 32-bit (or even | 43 | * here even more important to align src and dst on a 32-bit (or even |
44 | * better 64-bit) boundary | 44 | * better 64-bit) boundary |
45 | */ | 45 | */ |
46 | extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, | 46 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
47 | int len, int sum, int *csum_err); | 47 | int len, __wsum sum, int *csum_err); |
48 | |||
49 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | ||
50 | csum_partial_copy((src), (dst), (len), (sum)) | ||
51 | 48 | ||
52 | /* | 49 | /* |
53 | * This is a version of ip_compute_csum() optimized for IP headers, | 50 | * This is a version of ip_compute_csum() optimized for IP headers, |
@@ -55,7 +52,7 @@ extern unsigned int csum_partial_copy_from_user(const char __user *src, char *ds | |||
55 | * | 52 | * |
56 | */ | 53 | */ |
57 | static inline | 54 | static inline |
58 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | 55 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
59 | { | 56 | { |
60 | unsigned int tmp, inc, sum = 0; | 57 | unsigned int tmp, inc, sum = 0; |
61 | 58 | ||
@@ -81,13 +78,13 @@ unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
81 | : "icc0", "icc1" | 78 | : "icc0", "icc1" |
82 | ); | 79 | ); |
83 | 80 | ||
84 | return ~sum; | 81 | return (__force __sum16)~sum; |
85 | } | 82 | } |
86 | 83 | ||
87 | /* | 84 | /* |
88 | * Fold a partial checksum | 85 | * Fold a partial checksum |
89 | */ | 86 | */ |
90 | static inline unsigned int csum_fold(unsigned int sum) | 87 | static inline __sum16 csum_fold(__wsum sum) |
91 | { | 88 | { |
92 | unsigned int tmp; | 89 | unsigned int tmp; |
93 | 90 | ||
@@ -100,16 +97,16 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
100 | : "0"(sum) | 97 | : "0"(sum) |
101 | ); | 98 | ); |
102 | 99 | ||
103 | return ~sum; | 100 | return (__force __sum16)~sum; |
104 | } | 101 | } |
105 | 102 | ||
106 | /* | 103 | /* |
107 | * computes the checksum of the TCP/UDP pseudo-header | 104 | * computes the checksum of the TCP/UDP pseudo-header |
108 | * returns a 16-bit checksum, already complemented | 105 | * returns a 16-bit checksum, already complemented |
109 | */ | 106 | */ |
110 | static inline unsigned int | 107 | static inline __wsum |
111 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 108 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
112 | unsigned short proto, unsigned int sum) | 109 | unsigned short proto, __wsum sum) |
113 | { | 110 | { |
114 | asm(" addcc %1,%0,%0,icc0 \n" | 111 | asm(" addcc %1,%0,%0,icc0 \n" |
115 | " addxcc %2,%0,%0,icc0 \n" | 112 | " addxcc %2,%0,%0,icc0 \n" |
@@ -122,9 +119,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
122 | return sum; | 119 | return sum; |
123 | } | 120 | } |
124 | 121 | ||
125 | static inline unsigned short int | 122 | static inline __sum16 |
126 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 123 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
127 | unsigned short proto, unsigned int sum) | 124 | unsigned short proto, __wsum sum) |
128 | { | 125 | { |
129 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 126 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
130 | } | 127 | } |
@@ -133,12 +130,12 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
133 | * this routine is used for miscellaneous IP-like checksums, mainly | 130 | * this routine is used for miscellaneous IP-like checksums, mainly |
134 | * in icmp.c | 131 | * in icmp.c |
135 | */ | 132 | */ |
136 | extern unsigned short ip_compute_csum(const unsigned char * buff, int len); | 133 | extern __sum16 ip_compute_csum(const void *buff, int len); |
137 | 134 | ||
138 | #define _HAVE_ARCH_IPV6_CSUM | 135 | #define _HAVE_ARCH_IPV6_CSUM |
139 | static inline unsigned short int | 136 | static inline __sum16 |
140 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | 137 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, |
141 | __u32 len, unsigned short proto, unsigned int sum) | 138 | __u32 len, unsigned short proto, __wsum sum) |
142 | { | 139 | { |
143 | unsigned long tmp, tmp2; | 140 | unsigned long tmp, tmp2; |
144 | 141 | ||
@@ -177,7 +174,7 @@ csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | |||
177 | : "icc0" | 174 | : "icc0" |
178 | ); | 175 | ); |
179 | 176 | ||
180 | return ~sum; | 177 | return (__force __sum16)~sum; |
181 | } | 178 | } |
182 | 179 | ||
183 | #endif /* _ASM_CHECKSUM_H */ | 180 | #endif /* _ASM_CHECKSUM_H */ |
diff --git a/include/asm-frv/device.h b/include/asm-frv/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-frv/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-frv/highmem.h b/include/asm-frv/highmem.h index e2247c22a638..0f390f41f816 100644 --- a/include/asm-frv/highmem.h +++ b/include/asm-frv/highmem.h | |||
@@ -82,11 +82,11 @@ extern struct page *kmap_atomic_to_page(void *ptr); | |||
82 | dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ | 82 | dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ |
83 | \ | 83 | \ |
84 | if (type != __KM_CACHE) \ | 84 | if (type != __KM_CACHE) \ |
85 | asm volatile("movgs %0,dampr"#ampr :: "r"(dampr)); \ | 85 | asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ |
86 | else \ | 86 | else \ |
87 | asm volatile("movgs %0,iampr"#ampr"\n" \ | 87 | asm volatile("movgs %0,iampr"#ampr"\n" \ |
88 | "movgs %0,dampr"#ampr"\n" \ | 88 | "movgs %0,dampr"#ampr"\n" \ |
89 | :: "r"(dampr) \ | 89 | :: "r"(dampr) : "memory" \ |
90 | ); \ | 90 | ); \ |
91 | \ | 91 | \ |
92 | asm("movsg damlr"#ampr",%0" : "=r"(damlr)); \ | 92 | asm("movsg damlr"#ampr",%0" : "=r"(damlr)); \ |
@@ -104,7 +104,7 @@ extern struct page *kmap_atomic_to_page(void *ptr); | |||
104 | asm volatile("movgs %0,tplr \n" \ | 104 | asm volatile("movgs %0,tplr \n" \ |
105 | "movgs %1,tppr \n" \ | 105 | "movgs %1,tppr \n" \ |
106 | "tlbpr %0,gr0,#2,#1" \ | 106 | "tlbpr %0,gr0,#2,#1" \ |
107 | : : "r"(damlr), "r"(dampr)); \ | 107 | : : "r"(damlr), "r"(dampr) : "memory"); \ |
108 | \ | 108 | \ |
109 | /*printk("TLB: SECN sl=%d L=%08lx P=%08lx\n", slot, damlr, dampr);*/ \ | 109 | /*printk("TLB: SECN sl=%d L=%08lx P=%08lx\n", slot, damlr, dampr);*/ \ |
110 | \ | 110 | \ |
@@ -115,7 +115,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) | |||
115 | { | 115 | { |
116 | unsigned long paddr; | 116 | unsigned long paddr; |
117 | 117 | ||
118 | preempt_disable(); | 118 | inc_preempt_count(); |
119 | paddr = page_to_phys(page); | 119 | paddr = page_to_phys(page); |
120 | 120 | ||
121 | switch (type) { | 121 | switch (type) { |
@@ -138,16 +138,16 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) | |||
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | #define __kunmap_atomic_primary(type, ampr) \ | 141 | #define __kunmap_atomic_primary(type, ampr) \ |
142 | do { \ | 142 | do { \ |
143 | asm volatile("movgs gr0,dampr"#ampr"\n"); \ | 143 | asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ |
144 | if (type == __KM_CACHE) \ | 144 | if (type == __KM_CACHE) \ |
145 | asm volatile("movgs gr0,iampr"#ampr"\n"); \ | 145 | asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ |
146 | } while(0) | 146 | } while(0) |
147 | 147 | ||
148 | #define __kunmap_atomic_secondary(slot, vaddr) \ | 148 | #define __kunmap_atomic_secondary(slot, vaddr) \ |
149 | do { \ | 149 | do { \ |
150 | asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr)); \ | 150 | asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ |
151 | } while(0) | 151 | } while(0) |
152 | 152 | ||
153 | static inline void kunmap_atomic(void *kvaddr, enum km_type type) | 153 | static inline void kunmap_atomic(void *kvaddr, enum km_type type) |
@@ -170,7 +170,8 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) | |||
170 | default: | 170 | default: |
171 | BUG(); | 171 | BUG(); |
172 | } | 172 | } |
173 | preempt_enable(); | 173 | dec_preempt_count(); |
174 | preempt_check_resched(); | ||
174 | } | 175 | } |
175 | 176 | ||
176 | #endif /* !__ASSEMBLY__ */ | 177 | #endif /* !__ASSEMBLY__ */ |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 1d9573cf4a0b..c92ae0f166ff 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -37,7 +37,10 @@ | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #ifndef HAVE_ARCH_WARN_ON | 39 | #ifndef HAVE_ARCH_WARN_ON |
40 | #define WARN_ON(condition) unlikely((condition)) | 40 | #define WARN_ON(condition) ({ \ |
41 | typeof(condition) __ret_warn_on = (condition); \ | ||
42 | unlikely(__ret_warn_on); \ | ||
43 | }) | ||
41 | #endif | 44 | #endif |
42 | #endif | 45 | #endif |
43 | 46 | ||
diff --git a/include/asm-generic/device.h b/include/asm-generic/device.h new file mode 100644 index 000000000000..c17c9600f220 --- /dev/null +++ b/include/asm-generic/device.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_GENERIC_DEVICE_H | ||
7 | #define _ASM_GENERIC_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | }; | ||
11 | |||
12 | #endif /* _ASM_GENERIC_DEVICE_H */ | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 69240b52f8e1..e60d6f21fa62 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -125,6 +125,10 @@ | |||
125 | *(__param) \ | 125 | *(__param) \ |
126 | VMLINUX_SYMBOL(__stop___param) = .; \ | 126 | VMLINUX_SYMBOL(__stop___param) = .; \ |
127 | } \ | 127 | } \ |
128 | \ | ||
129 | /* Unwind data binary search table */ \ | ||
130 | EH_FRAME_HDR \ | ||
131 | \ | ||
128 | __end_rodata = .; \ | 132 | __end_rodata = .; \ |
129 | . = ALIGN(4096); | 133 | . = ALIGN(4096); |
130 | 134 | ||
@@ -157,6 +161,18 @@ | |||
157 | *(.kprobes.text) \ | 161 | *(.kprobes.text) \ |
158 | VMLINUX_SYMBOL(__kprobes_text_end) = .; | 162 | VMLINUX_SYMBOL(__kprobes_text_end) = .; |
159 | 163 | ||
164 | #ifdef CONFIG_STACK_UNWIND | ||
165 | /* Unwind data binary search table */ | ||
166 | #define EH_FRAME_HDR \ | ||
167 | .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \ | ||
168 | VMLINUX_SYMBOL(__start_unwind_hdr) = .; \ | ||
169 | *(.eh_frame_hdr) \ | ||
170 | VMLINUX_SYMBOL(__end_unwind_hdr) = .; \ | ||
171 | } | ||
172 | #else | ||
173 | #define EH_FRAME_HDR | ||
174 | #endif | ||
175 | |||
160 | /* DWARF debug sections. | 176 | /* DWARF debug sections. |
161 | Symbols in the DWARF debugging sections are relative to | 177 | Symbols in the DWARF debugging sections are relative to |
162 | the beginning of the section so we begin them at 0. */ | 178 | the beginning of the section so we begin them at 0. */ |
@@ -197,3 +213,22 @@ | |||
197 | 213 | ||
198 | #define NOTES \ | 214 | #define NOTES \ |
199 | .notes : { *(.note.*) } :note | 215 | .notes : { *(.note.*) } :note |
216 | |||
217 | #define INITCALLS \ | ||
218 | *(.initcall0.init) \ | ||
219 | *(.initcall0s.init) \ | ||
220 | *(.initcall1.init) \ | ||
221 | *(.initcall1s.init) \ | ||
222 | *(.initcall2.init) \ | ||
223 | *(.initcall2s.init) \ | ||
224 | *(.initcall3.init) \ | ||
225 | *(.initcall3s.init) \ | ||
226 | *(.initcall4.init) \ | ||
227 | *(.initcall4s.init) \ | ||
228 | *(.initcall5.init) \ | ||
229 | *(.initcall5s.init) \ | ||
230 | *(.initcall6.init) \ | ||
231 | *(.initcall6s.init) \ | ||
232 | *(.initcall7.init) \ | ||
233 | *(.initcall7s.init) | ||
234 | |||
diff --git a/include/asm-h8300/checksum.h b/include/asm-h8300/checksum.h index 3051931dd301..98724e12508c 100644 --- a/include/asm-h8300/checksum.h +++ b/include/asm-h8300/checksum.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * | 13 | * |
14 | * it's best to have buff aligned on a 32-bit boundary | 14 | * it's best to have buff aligned on a 32-bit boundary |
15 | */ | 15 | */ |
16 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 16 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * the same as csum_partial, but copies from src while it | 19 | * the same as csum_partial, but copies from src while it |
@@ -23,7 +23,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
23 | * better 64-bit) boundary | 23 | * better 64-bit) boundary |
24 | */ | 24 | */ |
25 | 25 | ||
26 | unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); | 26 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum); |
27 | 27 | ||
28 | 28 | ||
29 | /* | 29 | /* |
@@ -33,20 +33,17 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); | |||
33 | * better 64-bit) boundary | 33 | * better 64-bit) boundary |
34 | */ | 34 | */ |
35 | 35 | ||
36 | extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, | 36 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
37 | int len, int sum, int *csum_err); | 37 | int len, __wsum sum, int *csum_err); |
38 | 38 | ||
39 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 39 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
40 | csum_partial_copy((src), (dst), (len), (sum)) | ||
41 | |||
42 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl); | ||
43 | 40 | ||
44 | 41 | ||
45 | /* | 42 | /* |
46 | * Fold a partial checksum | 43 | * Fold a partial checksum |
47 | */ | 44 | */ |
48 | 45 | ||
49 | static inline unsigned int csum_fold(unsigned int sum) | 46 | static inline __sum16 csum_fold(__wsum sum) |
50 | { | 47 | { |
51 | __asm__("mov.l %0,er0\n\t" | 48 | __asm__("mov.l %0,er0\n\t" |
52 | "add.w e0,r0\n\t" | 49 | "add.w e0,r0\n\t" |
@@ -58,7 +55,7 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
58 | : "=r"(sum) | 55 | : "=r"(sum) |
59 | : "0"(sum) | 56 | : "0"(sum) |
60 | : "er0"); | 57 | : "er0"); |
61 | return ~sum; | 58 | return (__force __sum16)~sum; |
62 | } | 59 | } |
63 | 60 | ||
64 | 61 | ||
@@ -67,9 +64,9 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
67 | * returns a 16-bit checksum, already complemented | 64 | * returns a 16-bit checksum, already complemented |
68 | */ | 65 | */ |
69 | 66 | ||
70 | static inline unsigned int | 67 | static inline __wsum |
71 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 68 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
72 | unsigned short proto, unsigned int sum) | 69 | unsigned short proto, __wsum sum) |
73 | { | 70 | { |
74 | __asm__ ("sub.l er0,er0\n\t" | 71 | __asm__ ("sub.l er0,er0\n\t" |
75 | "add.l %2,%0\n\t" | 72 | "add.l %2,%0\n\t" |
@@ -88,9 +85,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
88 | return sum; | 85 | return sum; |
89 | } | 86 | } |
90 | 87 | ||
91 | static inline unsigned short int | 88 | static inline __sum16 |
92 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 89 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
93 | unsigned short proto, unsigned int sum) | 90 | unsigned short proto, __wsum sum) |
94 | { | 91 | { |
95 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 92 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
96 | } | 93 | } |
@@ -100,6 +97,6 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
100 | * in icmp.c | 97 | * in icmp.c |
101 | */ | 98 | */ |
102 | 99 | ||
103 | extern unsigned short ip_compute_csum(const unsigned char * buff, int len); | 100 | extern __sum16 ip_compute_csum(const void *buff, int len); |
104 | 101 | ||
105 | #endif /* _H8300_CHECKSUM_H */ | 102 | #endif /* _H8300_CHECKSUM_H */ |
diff --git a/include/asm-h8300/device.h b/include/asm-h8300/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-h8300/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 6016632d032f..c80b3a94511a 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h | |||
@@ -132,6 +132,7 @@ extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); | |||
132 | 132 | ||
133 | #ifdef CONFIG_X86_IO_APIC | 133 | #ifdef CONFIG_X86_IO_APIC |
134 | extern int acpi_skip_timer_override; | 134 | extern int acpi_skip_timer_override; |
135 | extern int acpi_use_timer_override; | ||
135 | #endif | 136 | #endif |
136 | 137 | ||
137 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } | 138 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } |
diff --git a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h index 67d3630c4e89..75194abbe8ee 100644 --- a/include/asm-i386/checksum.h +++ b/include/asm-i386/checksum.h | |||
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | * it's best to have buff aligned on a 32-bit boundary | 18 | * it's best to have buff aligned on a 32-bit boundary |
19 | */ | 19 | */ |
20 | asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 20 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * the same as csum_partial, but copies from src while it | 23 | * the same as csum_partial, but copies from src while it |
@@ -27,8 +27,8 @@ asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsign | |||
27 | * better 64-bit) boundary | 27 | * better 64-bit) boundary |
28 | */ | 28 | */ |
29 | 29 | ||
30 | asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsigned char *dst, | 30 | asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, |
31 | int len, int sum, int *src_err_ptr, int *dst_err_ptr); | 31 | int len, __wsum sum, int *src_err_ptr, int *dst_err_ptr); |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * Note: when you get a NULL pointer exception here this means someone | 34 | * Note: when you get a NULL pointer exception here this means someone |
@@ -38,18 +38,18 @@ asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsi | |||
38 | * access_ok(). | 38 | * access_ok(). |
39 | */ | 39 | */ |
40 | static __inline__ | 40 | static __inline__ |
41 | unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, | 41 | __wsum csum_partial_copy_nocheck (const void *src, void *dst, |
42 | int len, int sum) | 42 | int len, __wsum sum) |
43 | { | 43 | { |
44 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); | 44 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); |
45 | } | 45 | } |
46 | 46 | ||
47 | static __inline__ | 47 | static __inline__ |
48 | unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, | 48 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
49 | int len, int sum, int *err_ptr) | 49 | int len, __wsum sum, int *err_ptr) |
50 | { | 50 | { |
51 | might_sleep(); | 51 | might_sleep(); |
52 | return csum_partial_copy_generic((__force unsigned char *)src, dst, | 52 | return csum_partial_copy_generic((__force void *)src, dst, |
53 | len, sum, err_ptr, NULL); | 53 | len, sum, err_ptr, NULL); |
54 | } | 54 | } |
55 | 55 | ||
@@ -60,8 +60,7 @@ unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsign | |||
60 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by | 60 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by |
61 | * Arnt Gulbrandsen. | 61 | * Arnt Gulbrandsen. |
62 | */ | 62 | */ |
63 | static inline unsigned short ip_fast_csum(unsigned char * iph, | 63 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
64 | unsigned int ihl) | ||
65 | { | 64 | { |
66 | unsigned int sum; | 65 | unsigned int sum; |
67 | 66 | ||
@@ -89,29 +88,29 @@ static inline unsigned short ip_fast_csum(unsigned char * iph, | |||
89 | : "=r" (sum), "=r" (iph), "=r" (ihl) | 88 | : "=r" (sum), "=r" (iph), "=r" (ihl) |
90 | : "1" (iph), "2" (ihl) | 89 | : "1" (iph), "2" (ihl) |
91 | : "memory"); | 90 | : "memory"); |
92 | return(sum); | 91 | return (__force __sum16)sum; |
93 | } | 92 | } |
94 | 93 | ||
95 | /* | 94 | /* |
96 | * Fold a partial checksum | 95 | * Fold a partial checksum |
97 | */ | 96 | */ |
98 | 97 | ||
99 | static inline unsigned int csum_fold(unsigned int sum) | 98 | static inline __sum16 csum_fold(__wsum sum) |
100 | { | 99 | { |
101 | __asm__( | 100 | __asm__( |
102 | "addl %1, %0 ;\n" | 101 | "addl %1, %0 ;\n" |
103 | "adcl $0xffff, %0 ;\n" | 102 | "adcl $0xffff, %0 ;\n" |
104 | : "=r" (sum) | 103 | : "=r" (sum) |
105 | : "r" (sum << 16), "0" (sum & 0xffff0000) | 104 | : "r" ((__force u32)sum << 16), |
105 | "0" ((__force u32)sum & 0xffff0000) | ||
106 | ); | 106 | ); |
107 | return (~sum) >> 16; | 107 | return (__force __sum16)(~(__force u32)sum >> 16); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 110 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
111 | unsigned long daddr, | 111 | unsigned short len, |
112 | unsigned short len, | 112 | unsigned short proto, |
113 | unsigned short proto, | 113 | __wsum sum) |
114 | unsigned int sum) | ||
115 | { | 114 | { |
116 | __asm__( | 115 | __asm__( |
117 | "addl %1, %0 ;\n" | 116 | "addl %1, %0 ;\n" |
@@ -119,7 +118,7 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
119 | "adcl %3, %0 ;\n" | 118 | "adcl %3, %0 ;\n" |
120 | "adcl $0, %0 ;\n" | 119 | "adcl $0, %0 ;\n" |
121 | : "=r" (sum) | 120 | : "=r" (sum) |
122 | : "g" (daddr), "g"(saddr), "g"((ntohs(len)<<16)+proto*256), "0"(sum)); | 121 | : "g" (daddr), "g"(saddr), "g"((len + proto) << 8), "0"(sum)); |
123 | return sum; | 122 | return sum; |
124 | } | 123 | } |
125 | 124 | ||
@@ -127,11 +126,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
127 | * computes the checksum of the TCP/UDP pseudo-header | 126 | * computes the checksum of the TCP/UDP pseudo-header |
128 | * returns a 16-bit checksum, already complemented | 127 | * returns a 16-bit checksum, already complemented |
129 | */ | 128 | */ |
130 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 129 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
131 | unsigned long daddr, | ||
132 | unsigned short len, | 130 | unsigned short len, |
133 | unsigned short proto, | 131 | unsigned short proto, |
134 | unsigned int sum) | 132 | __wsum sum) |
135 | { | 133 | { |
136 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 134 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
137 | } | 135 | } |
@@ -141,17 +139,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
141 | * in icmp.c | 139 | * in icmp.c |
142 | */ | 140 | */ |
143 | 141 | ||
144 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 142 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
145 | { | 143 | { |
146 | return csum_fold (csum_partial(buff, len, 0)); | 144 | return csum_fold (csum_partial(buff, len, 0)); |
147 | } | 145 | } |
148 | 146 | ||
149 | #define _HAVE_ARCH_IPV6_CSUM | 147 | #define _HAVE_ARCH_IPV6_CSUM |
150 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 148 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
151 | struct in6_addr *daddr, | 149 | const struct in6_addr *daddr, |
152 | __u32 len, | 150 | __u32 len, unsigned short proto, |
153 | unsigned short proto, | 151 | __wsum sum) |
154 | unsigned int sum) | ||
155 | { | 152 | { |
156 | __asm__( | 153 | __asm__( |
157 | "addl 0(%1), %0 ;\n" | 154 | "addl 0(%1), %0 ;\n" |
@@ -176,19 +173,19 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
176 | * Copy and checksum to user | 173 | * Copy and checksum to user |
177 | */ | 174 | */ |
178 | #define HAVE_CSUM_COPY_USER | 175 | #define HAVE_CSUM_COPY_USER |
179 | static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src, | 176 | static __inline__ __wsum csum_and_copy_to_user(const void *src, |
180 | unsigned char __user *dst, | 177 | void __user *dst, |
181 | int len, int sum, | 178 | int len, __wsum sum, |
182 | int *err_ptr) | 179 | int *err_ptr) |
183 | { | 180 | { |
184 | might_sleep(); | 181 | might_sleep(); |
185 | if (access_ok(VERIFY_WRITE, dst, len)) | 182 | if (access_ok(VERIFY_WRITE, dst, len)) |
186 | return csum_partial_copy_generic(src, (__force unsigned char *)dst, len, sum, NULL, err_ptr); | 183 | return csum_partial_copy_generic(src, (__force void *)dst, len, sum, NULL, err_ptr); |
187 | 184 | ||
188 | if (len) | 185 | if (len) |
189 | *err_ptr = -EFAULT; | 186 | *err_ptr = -EFAULT; |
190 | 187 | ||
191 | return -1; /* invalid checksum */ | 188 | return (__force __wsum)-1; /* invalid checksum */ |
192 | } | 189 | } |
193 | 190 | ||
194 | #endif | 191 | #endif |
diff --git a/include/asm-i386/device.h b/include/asm-i386/device.h new file mode 100644 index 000000000000..849604c70e6b --- /dev/null +++ b/include/asm-i386/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_I386_DEVICE_H | ||
7 | #define _ASM_I386_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_I386_DEVICE_H */ | ||
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 276ea7e8144a..059a9ff28b4d 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h | |||
@@ -12,10 +12,6 @@ | |||
12 | 12 | ||
13 | #ifdef CONFIG_X86_IO_APIC | 13 | #ifdef CONFIG_X86_IO_APIC |
14 | 14 | ||
15 | #define IO_APIC_BASE(idx) \ | ||
16 | ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \ | ||
17 | + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK))) | ||
18 | |||
19 | /* | 15 | /* |
20 | * The structure of the IO-APIC: | 16 | * The structure of the IO-APIC: |
21 | */ | 17 | */ |
@@ -119,31 +115,8 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; | |||
119 | /* non-0 if default (table-less) MP configuration */ | 115 | /* non-0 if default (table-less) MP configuration */ |
120 | extern int mpc_default_type; | 116 | extern int mpc_default_type; |
121 | 117 | ||
122 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) | 118 | /* Older SiS APIC requires we rewrite the index register */ |
123 | { | ||
124 | *IO_APIC_BASE(apic) = reg; | ||
125 | return *(IO_APIC_BASE(apic)+4); | ||
126 | } | ||
127 | |||
128 | static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) | ||
129 | { | ||
130 | *IO_APIC_BASE(apic) = reg; | ||
131 | *(IO_APIC_BASE(apic)+4) = value; | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * Re-write a value: to be used for read-modify-write | ||
136 | * cycles where the read already set up the index register. | ||
137 | * | ||
138 | * Older SiS APIC requires we rewrite the index regiser | ||
139 | */ | ||
140 | extern int sis_apic_bug; | 119 | extern int sis_apic_bug; |
141 | static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) | ||
142 | { | ||
143 | if (sis_apic_bug) | ||
144 | *IO_APIC_BASE(apic) = reg; | ||
145 | *(IO_APIC_BASE(apic)+4) = value; | ||
146 | } | ||
147 | 120 | ||
148 | /* 1 if "noapic" boot option passed */ | 121 | /* 1 if "noapic" boot option passed */ |
149 | extern int skip_ioapic_setup; | 122 | extern int skip_ioapic_setup; |
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h index ef0671e5d5c5..43e5bd8f4a19 100644 --- a/include/asm-i386/mach-summit/mach_apic.h +++ b/include/asm-i386/mach-summit/mach_apic.h | |||
@@ -88,7 +88,11 @@ static inline void clustered_apic_check(void) | |||
88 | 88 | ||
89 | static inline int apicid_to_node(int logical_apicid) | 89 | static inline int apicid_to_node(int logical_apicid) |
90 | { | 90 | { |
91 | #ifdef CONFIG_SMP | ||
91 | return apicid_2_node[hard_smp_processor_id()]; | 92 | return apicid_2_node[hard_smp_processor_id()]; |
93 | #else | ||
94 | return 0; | ||
95 | #endif | ||
92 | } | 96 | } |
93 | 97 | ||
94 | /* Mapping from cpu number to logical apicid */ | 98 | /* Mapping from cpu number to logical apicid */ |
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h deleted file mode 100644 index 21cd696d4d0f..000000000000 --- a/include/asm-i386/mach-visws/do_timer.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* defines for inline arch setup functions */ | ||
2 | |||
3 | #include <asm/fixmap.h> | ||
4 | #include <asm/i8259.h> | ||
5 | #include "cobalt.h" | ||
6 | |||
7 | static inline void do_timer_interrupt_hook(void) | ||
8 | { | ||
9 | /* Clear the interrupt */ | ||
10 | co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR); | ||
11 | |||
12 | do_timer(1); | ||
13 | #ifndef CONFIG_SMP | ||
14 | update_process_times(user_mode_vm(irq_regs)); | ||
15 | #endif | ||
16 | /* | ||
17 | * In the SMP case we use the local APIC timer interrupt to do the | ||
18 | * profiling, except when we simulate SMP mode on a uniprocessor | ||
19 | * system, in that case we have to call the local interrupt handler. | ||
20 | */ | ||
21 | #ifndef CONFIG_X86_LOCAL_APIC | ||
22 | profile_tick(CPU_PROFILING); | ||
23 | #else | ||
24 | if (!using_apic_timer) | ||
25 | smp_local_timer_interrupt(); | ||
26 | #endif | ||
27 | } | ||
28 | |||
29 | static inline int do_timer_overflow(int count) | ||
30 | { | ||
31 | int i; | ||
32 | |||
33 | spin_lock(&i8259A_lock); | ||
34 | /* | ||
35 | * This is tricky when I/O APICs are used; | ||
36 | * see do_timer_interrupt(). | ||
37 | */ | ||
38 | i = inb(0x20); | ||
39 | spin_unlock(&i8259A_lock); | ||
40 | |||
41 | /* assumption about timer being IRQ0 */ | ||
42 | if (i & 0x01) { | ||
43 | /* | ||
44 | * We cannot detect lost timer interrupts ... | ||
45 | * well, that's why we call them lost, don't we? :) | ||
46 | * [hmm, on the Pentium and Alpha we can ... sort of] | ||
47 | */ | ||
48 | count -= LATCH; | ||
49 | } else { | ||
50 | printk("do_slow_gettimeoffset(): hardware timer problem?\n"); | ||
51 | } | ||
52 | return count; | ||
53 | } | ||
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h index de438c7147a8..18afe6b6fc4d 100644 --- a/include/asm-i386/mach-visws/mach_apic.h +++ b/include/asm-i386/mach-visws/mach_apic.h | |||
@@ -51,6 +51,11 @@ static inline void clustered_apic_check(void) | |||
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline int apicid_to_node(int logical_apicid) | ||
55 | { | ||
56 | return 0; | ||
57 | } | ||
58 | |||
54 | /* Mapping from cpu number to logical apicid */ | 59 | /* Mapping from cpu number to logical apicid */ |
55 | static inline int cpu_to_logical_apicid(int cpu) | 60 | static inline int cpu_to_logical_apicid(int cpu) |
56 | { | 61 | { |
diff --git a/include/asm-ia64/checksum.h b/include/asm-ia64/checksum.h index 1f230ff8ea81..bd40f4756ce1 100644 --- a/include/asm-ia64/checksum.h +++ b/include/asm-ia64/checksum.h | |||
@@ -10,23 +10,21 @@ | |||
10 | * This is a version of ip_compute_csum() optimized for IP headers, | 10 | * This is a version of ip_compute_csum() optimized for IP headers, |
11 | * which always checksum on 4 octet boundaries. | 11 | * which always checksum on 4 octet boundaries. |
12 | */ | 12 | */ |
13 | extern unsigned short ip_fast_csum (unsigned char * iph, unsigned int ihl); | 13 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Computes the checksum of the TCP/UDP pseudo-header returns a 16-bit | 16 | * Computes the checksum of the TCP/UDP pseudo-header returns a 16-bit |
17 | * checksum, already complemented | 17 | * checksum, already complemented |
18 | */ | 18 | */ |
19 | extern unsigned short int csum_tcpudp_magic (unsigned long saddr, | 19 | extern __sum16 csum_tcpudp_magic (__be32 saddr, __be32 daddr, |
20 | unsigned long daddr, | ||
21 | unsigned short len, | 20 | unsigned short len, |
22 | unsigned short proto, | 21 | unsigned short proto, |
23 | unsigned int sum); | 22 | __wsum sum); |
24 | 23 | ||
25 | extern unsigned int csum_tcpudp_nofold (unsigned long saddr, | 24 | extern __wsum csum_tcpudp_nofold (__be32 saddr, __be32 daddr, |
26 | unsigned long daddr, | ||
27 | unsigned short len, | 25 | unsigned short len, |
28 | unsigned short proto, | 26 | unsigned short proto, |
29 | unsigned int sum); | 27 | __wsum sum); |
30 | 28 | ||
31 | /* | 29 | /* |
32 | * Computes the checksum of a memory block at buff, length len, | 30 | * Computes the checksum of a memory block at buff, length len, |
@@ -40,8 +38,7 @@ extern unsigned int csum_tcpudp_nofold (unsigned long saddr, | |||
40 | * | 38 | * |
41 | * it's best to have buff aligned on a 32-bit boundary | 39 | * it's best to have buff aligned on a 32-bit boundary |
42 | */ | 40 | */ |
43 | extern unsigned int csum_partial (const unsigned char * buff, int len, | 41 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
44 | unsigned int sum); | ||
45 | 42 | ||
46 | /* | 43 | /* |
47 | * Same as csum_partial, but copies from src while it checksums. | 44 | * Same as csum_partial, but copies from src while it checksums. |
@@ -49,28 +46,28 @@ extern unsigned int csum_partial (const unsigned char * buff, int len, | |||
49 | * Here it is even more important to align src and dst on a 32-bit (or | 46 | * Here it is even more important to align src and dst on a 32-bit (or |
50 | * even better 64-bit) boundary. | 47 | * even better 64-bit) boundary. |
51 | */ | 48 | */ |
52 | extern unsigned int csum_partial_copy_from_user (const char *src, char *dst, | 49 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
53 | int len, unsigned int sum, | 50 | int len, __wsum sum, |
54 | int *errp); | 51 | int *errp); |
55 | 52 | ||
56 | extern unsigned int csum_partial_copy_nocheck (const char *src, char *dst, | 53 | extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
57 | int len, unsigned int sum); | 54 | int len, __wsum sum); |
58 | 55 | ||
59 | /* | 56 | /* |
60 | * This routine is used for miscellaneous IP-like checksums, mainly in | 57 | * This routine is used for miscellaneous IP-like checksums, mainly in |
61 | * icmp.c | 58 | * icmp.c |
62 | */ | 59 | */ |
63 | extern unsigned short ip_compute_csum (unsigned char *buff, int len); | 60 | extern __sum16 ip_compute_csum(const void *buff, int len); |
64 | 61 | ||
65 | /* | 62 | /* |
66 | * Fold a partial checksum without adding pseudo headers. | 63 | * Fold a partial checksum without adding pseudo headers. |
67 | */ | 64 | */ |
68 | static inline unsigned short | 65 | static inline __sum16 csum_fold(__wsum csum) |
69 | csum_fold (unsigned int sum) | ||
70 | { | 66 | { |
67 | u32 sum = (__force u32)csum; | ||
71 | sum = (sum & 0xffff) + (sum >> 16); | 68 | sum = (sum & 0xffff) + (sum >> 16); |
72 | sum = (sum & 0xffff) + (sum >> 16); | 69 | sum = (sum & 0xffff) + (sum >> 16); |
73 | return ~sum; | 70 | return (__force __sum16)~sum; |
74 | } | 71 | } |
75 | 72 | ||
76 | #endif /* _ASM_IA64_CHECKSUM_H */ | 73 | #endif /* _ASM_IA64_CHECKSUM_H */ |
diff --git a/include/asm-ia64/device.h b/include/asm-ia64/device.h new file mode 100644 index 000000000000..3db6daf7f251 --- /dev/null +++ b/include/asm-ia64/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_IA64_DEVICE_H | ||
7 | #define _ASM_IA64_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_IA64_DEVICE_H */ | ||
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 43bfff6c6b87..6311e168cd34 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h | |||
@@ -32,7 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | #define IO_SPACE_LIMIT 0xffffffffffffffffUL | 33 | #define IO_SPACE_LIMIT 0xffffffffffffffffUL |
34 | 34 | ||
35 | #define MAX_IO_SPACES_BITS 4 | 35 | #define MAX_IO_SPACES_BITS 8 |
36 | #define MAX_IO_SPACES (1UL << MAX_IO_SPACES_BITS) | 36 | #define MAX_IO_SPACES (1UL << MAX_IO_SPACES_BITS) |
37 | #define IO_SPACE_BITS 24 | 37 | #define IO_SPACE_BITS 24 |
38 | #define IO_SPACE_SIZE (1UL << IO_SPACE_BITS) | 38 | #define IO_SPACE_SIZE (1UL << IO_SPACE_BITS) |
@@ -417,6 +417,8 @@ __writeq (unsigned long val, volatile void __iomem *addr) | |||
417 | # define outl_p outl | 417 | # define outl_p outl |
418 | #endif | 418 | #endif |
419 | 419 | ||
420 | # ifdef __KERNEL__ | ||
421 | |||
420 | extern void __iomem * ioremap(unsigned long offset, unsigned long size); | 422 | extern void __iomem * ioremap(unsigned long offset, unsigned long size); |
421 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 423 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
422 | 424 | ||
@@ -430,8 +432,6 @@ iounmap (volatile void __iomem *addr) | |||
430 | #define dmi_iounmap(x,l) iounmap(x) | 432 | #define dmi_iounmap(x,l) iounmap(x) |
431 | #define dmi_alloc(l) kmalloc(l, GFP_ATOMIC) | 433 | #define dmi_alloc(l) kmalloc(l, GFP_ATOMIC) |
432 | 434 | ||
433 | # ifdef __KERNEL__ | ||
434 | |||
435 | /* | 435 | /* |
436 | * String version of IO memory access ops: | 436 | * String version of IO memory access ops: |
437 | */ | 437 | */ |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 7ffbddf5306f..8f784f8e45b0 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -36,6 +36,7 @@ typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val, | |||
36 | typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, | 36 | typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, |
37 | u8 size); | 37 | u8 size); |
38 | typedef void ia64_mv_migrate_t(struct task_struct * task); | 38 | typedef void ia64_mv_migrate_t(struct task_struct * task); |
39 | typedef void ia64_mv_pci_fixup_bus_t (struct pci_bus *); | ||
39 | 40 | ||
40 | /* DMA-mapping interface: */ | 41 | /* DMA-mapping interface: */ |
41 | typedef void ia64_mv_dma_init (void); | 42 | typedef void ia64_mv_dma_init (void); |
@@ -95,6 +96,11 @@ machvec_noop_task (struct task_struct *task) | |||
95 | { | 96 | { |
96 | } | 97 | } |
97 | 98 | ||
99 | static inline void | ||
100 | machvec_noop_bus (struct pci_bus *bus) | ||
101 | { | ||
102 | } | ||
103 | |||
98 | extern void machvec_setup (char **); | 104 | extern void machvec_setup (char **); |
99 | extern void machvec_timer_interrupt (int, void *); | 105 | extern void machvec_timer_interrupt (int, void *); |
100 | extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); | 106 | extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); |
@@ -159,6 +165,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
159 | # define platform_migrate ia64_mv.migrate | 165 | # define platform_migrate ia64_mv.migrate |
160 | # define platform_setup_msi_irq ia64_mv.setup_msi_irq | 166 | # define platform_setup_msi_irq ia64_mv.setup_msi_irq |
161 | # define platform_teardown_msi_irq ia64_mv.teardown_msi_irq | 167 | # define platform_teardown_msi_irq ia64_mv.teardown_msi_irq |
168 | # define platform_pci_fixup_bus ia64_mv.pci_fixup_bus | ||
162 | # endif | 169 | # endif |
163 | 170 | ||
164 | /* __attribute__((__aligned__(16))) is required to make size of the | 171 | /* __attribute__((__aligned__(16))) is required to make size of the |
@@ -210,6 +217,7 @@ struct ia64_machine_vector { | |||
210 | ia64_mv_migrate_t *migrate; | 217 | ia64_mv_migrate_t *migrate; |
211 | ia64_mv_setup_msi_irq_t *setup_msi_irq; | 218 | ia64_mv_setup_msi_irq_t *setup_msi_irq; |
212 | ia64_mv_teardown_msi_irq_t *teardown_msi_irq; | 219 | ia64_mv_teardown_msi_irq_t *teardown_msi_irq; |
220 | ia64_mv_pci_fixup_bus_t *pci_fixup_bus; | ||
213 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ | 221 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ |
214 | 222 | ||
215 | #define MACHVEC_INIT(name) \ | 223 | #define MACHVEC_INIT(name) \ |
@@ -257,6 +265,7 @@ struct ia64_machine_vector { | |||
257 | platform_migrate, \ | 265 | platform_migrate, \ |
258 | platform_setup_msi_irq, \ | 266 | platform_setup_msi_irq, \ |
259 | platform_teardown_msi_irq, \ | 267 | platform_teardown_msi_irq, \ |
268 | platform_pci_fixup_bus, \ | ||
260 | } | 269 | } |
261 | 270 | ||
262 | extern struct ia64_machine_vector ia64_mv; | 271 | extern struct ia64_machine_vector ia64_mv; |
@@ -416,5 +425,8 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size | |||
416 | #ifndef platform_teardown_msi_irq | 425 | #ifndef platform_teardown_msi_irq |
417 | # define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL) | 426 | # define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL) |
418 | #endif | 427 | #endif |
428 | #ifndef platform_pci_fixup_bus | ||
429 | # define platform_pci_fixup_bus machvec_noop_bus | ||
430 | #endif | ||
419 | 431 | ||
420 | #endif /* _ASM_IA64_MACHVEC_H */ | 432 | #endif /* _ASM_IA64_MACHVEC_H */ |
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index c54b165b1c17..83325f6db03e 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h | |||
@@ -69,6 +69,7 @@ extern ia64_mv_dma_supported sn_dma_supported; | |||
69 | extern ia64_mv_migrate_t sn_migrate; | 69 | extern ia64_mv_migrate_t sn_migrate; |
70 | extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq; | 70 | extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq; |
71 | extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq; | 71 | extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq; |
72 | extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus; | ||
72 | 73 | ||
73 | 74 | ||
74 | /* | 75 | /* |
@@ -127,6 +128,7 @@ extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq; | |||
127 | #define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL) | 128 | #define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL) |
128 | #define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL) | 129 | #define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL) |
129 | #endif | 130 | #endif |
131 | #define platform_pci_fixup_bus sn_pci_fixup_bus | ||
130 | 132 | ||
131 | #include <asm/sn/io.h> | 133 | #include <asm/sn/io.h> |
132 | 134 | ||
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index 2c8fd92d0ece..4283ddcc25fb 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h | |||
@@ -764,7 +764,7 @@ struct ia64_pal_retval { | |||
764 | * (generally 0) MUST be passed. Reserved parameters are not optional | 764 | * (generally 0) MUST be passed. Reserved parameters are not optional |
765 | * parameters. | 765 | * parameters. |
766 | */ | 766 | */ |
767 | extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64, u64); | 767 | extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64); |
768 | extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64); | 768 | extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64); |
769 | extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64); | 769 | extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64); |
770 | extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64); | 770 | extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64); |
@@ -774,14 +774,7 @@ extern void ia64_load_scratch_fpregs (struct ia64_fpreg *); | |||
774 | #define PAL_CALL(iprv,a0,a1,a2,a3) do { \ | 774 | #define PAL_CALL(iprv,a0,a1,a2,a3) do { \ |
775 | struct ia64_fpreg fr[6]; \ | 775 | struct ia64_fpreg fr[6]; \ |
776 | ia64_save_scratch_fpregs(fr); \ | 776 | ia64_save_scratch_fpregs(fr); \ |
777 | iprv = ia64_pal_call_static(a0, a1, a2, a3, 0); \ | 777 | iprv = ia64_pal_call_static(a0, a1, a2, a3); \ |
778 | ia64_load_scratch_fpregs(fr); \ | ||
779 | } while (0) | ||
780 | |||
781 | #define PAL_CALL_IC_OFF(iprv,a0,a1,a2,a3) do { \ | ||
782 | struct ia64_fpreg fr[6]; \ | ||
783 | ia64_save_scratch_fpregs(fr); \ | ||
784 | iprv = ia64_pal_call_static(a0, a1, a2, a3, 1); \ | ||
785 | ia64_load_scratch_fpregs(fr); \ | 778 | ia64_load_scratch_fpregs(fr); \ |
786 | } while (0) | 779 | } while (0) |
787 | 780 | ||
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index ef616fd4cb1b..825eb7d882e6 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h | |||
@@ -26,16 +26,18 @@ void pcibios_config_init(void); | |||
26 | struct pci_dev; | 26 | struct pci_dev; |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct correspondence | 29 | * PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct |
30 | * between device bus addresses and CPU physical addresses. Platforms with a hardware I/O | 30 | * correspondence between device bus addresses and CPU physical addresses. |
31 | * MMU _must_ turn this off to suppress the bounce buffer handling code in the block and | 31 | * Platforms with a hardware I/O MMU _must_ turn this off to suppress the |
32 | * network device layers. Platforms with separate bus address spaces _must_ turn this off | 32 | * bounce buffer handling code in the block and network device layers. |
33 | * and provide a device DMA mapping implementation that takes care of the necessary | 33 | * Platforms with separate bus address spaces _must_ turn this off and provide |
34 | * a device DMA mapping implementation that takes care of the necessary | ||
34 | * address translation. | 35 | * address translation. |
35 | * | 36 | * |
36 | * For now, the ia64 platforms which may have separate/multiple bus address spaces all | 37 | * For now, the ia64 platforms which may have separate/multiple bus address |
37 | * have I/O MMUs which support the merging of physically discontiguous buffers, so we can | 38 | * spaces all have I/O MMUs which support the merging of physically |
38 | * use that as the sole factor to determine the setting of PCI_DMA_BUS_IS_PHYS. | 39 | * discontiguous buffers, so we can use that as the sole factor to determine |
40 | * the setting of PCI_DMA_BUS_IS_PHYS. | ||
39 | */ | 41 | */ |
40 | extern unsigned long ia64_max_iommu_merge_mask; | 42 | extern unsigned long ia64_max_iommu_merge_mask; |
41 | #define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL) | 43 | #define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL) |
@@ -52,9 +54,6 @@ pcibios_penalize_isa_irq (int irq, int active) | |||
52 | /* We don't do dynamic PCI IRQ allocation */ | 54 | /* We don't do dynamic PCI IRQ allocation */ |
53 | } | 55 | } |
54 | 56 | ||
55 | #define HAVE_ARCH_PCI_MWI 1 | ||
56 | extern int pcibios_prep_mwi (struct pci_dev *); | ||
57 | |||
58 | #include <asm-generic/pci-dma-compat.h> | 57 | #include <asm-generic/pci-dma-compat.h> |
59 | 58 | ||
60 | /* pci_unmap_{single,page} is not a nop, thus... */ | 59 | /* pci_unmap_{single,page} is not a nop, thus... */ |
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 0b210abbe003..d000689d9142 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h | |||
@@ -659,6 +659,7 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second, | |||
659 | } | 659 | } |
660 | 660 | ||
661 | extern s64 ia64_sal_cache_flush (u64 cache_type); | 661 | extern s64 ia64_sal_cache_flush (u64 cache_type); |
662 | extern void __init check_sal_cache_flush (void); | ||
662 | 663 | ||
663 | /* Initialize all the processor and platform level instruction and data caches */ | 664 | /* Initialize all the processor and platform level instruction and data caches */ |
664 | static inline s64 | 665 | static inline s64 |
diff --git a/include/asm-ia64/sn/acpi.h b/include/asm-ia64/sn/acpi.h new file mode 100644 index 000000000000..2850a7ef5e71 --- /dev/null +++ b/include/asm-ia64/sn/acpi.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Silicon Graphics, Inc. All rights reserved. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_IA64_SN_ACPI_H | ||
10 | #define _ASM_IA64_SN_ACPI_H | ||
11 | |||
12 | #include "acpi/acglobal.h" | ||
13 | |||
14 | #define SN_ACPI_BASE_SUPPORT() (acpi_gbl_DSDT->oem_revision >= 0x20101) | ||
15 | |||
16 | #endif /* _ASM_IA64_SN_ACPI_H */ | ||
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h index 1d9efe541662..e715c794b186 100644 --- a/include/asm-ia64/sn/addrs.h +++ b/include/asm-ia64/sn/addrs.h | |||
@@ -136,9 +136,13 @@ | |||
136 | */ | 136 | */ |
137 | #define TO_PHYS(x) (TO_PHYS_MASK & (x)) | 137 | #define TO_PHYS(x) (TO_PHYS_MASK & (x)) |
138 | #define TO_CAC(x) (CAC_BASE | TO_PHYS(x)) | 138 | #define TO_CAC(x) (CAC_BASE | TO_PHYS(x)) |
139 | #ifdef CONFIG_SGI_SN | ||
139 | #define TO_AMO(x) (AMO_BASE | TO_PHYS(x)) | 140 | #define TO_AMO(x) (AMO_BASE | TO_PHYS(x)) |
140 | #define TO_GET(x) (GET_BASE | TO_PHYS(x)) | 141 | #define TO_GET(x) (GET_BASE | TO_PHYS(x)) |
141 | 142 | #else | |
143 | #define TO_AMO(x) ({ BUG(); x; }) | ||
144 | #define TO_GET(x) ({ BUG(); x; }) | ||
145 | #endif | ||
142 | 146 | ||
143 | /* | 147 | /* |
144 | * Covert from processor physical address to II/TIO physical address: | 148 | * Covert from processor physical address to II/TIO physical address: |
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h index eac3561574be..9fe89a93d880 100644 --- a/include/asm-ia64/sn/pcidev.h +++ b/include/asm-ia64/sn/pcidev.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | #ifndef _ASM_IA64_SN_PCI_PCIDEV_H | 8 | #ifndef _ASM_IA64_SN_PCI_PCIDEV_H |
9 | #define _ASM_IA64_SN_PCI_PCIDEV_H | 9 | #define _ASM_IA64_SN_PCI_PCIDEV_H |
@@ -12,31 +12,29 @@ | |||
12 | 12 | ||
13 | /* | 13 | /* |
14 | * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to | 14 | * In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to |
15 | * the pcidev_info structs for all devices under a controller, we extend the | 15 | * the pcidev_info structs for all devices under a controller, we keep a |
16 | * definition of pci_controller, via sn_pci_controller, to include a list | 16 | * list of pcidev_info under pci_controller->platform_data. |
17 | * of pcidev_info. | ||
18 | */ | 17 | */ |
19 | struct sn_pci_controller { | 18 | struct sn_platform_data { |
20 | struct pci_controller pci_controller; | 19 | void *provider_soft; |
21 | struct list_head pcidev_info; | 20 | struct list_head pcidev_info; |
22 | }; | 21 | }; |
23 | 22 | ||
24 | #define SN_PCI_CONTROLLER(dev) ((struct sn_pci_controller *) dev->sysdata) | 23 | #define SN_PLATFORM_DATA(busdev) \ |
24 | ((struct sn_platform_data *)(PCI_CONTROLLER(busdev)->platform_data)) | ||
25 | 25 | ||
26 | #define SN_PCIDEV_INFO(dev) sn_pcidev_info_get(dev) | 26 | #define SN_PCIDEV_INFO(dev) sn_pcidev_info_get(dev) |
27 | 27 | ||
28 | #define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \ | ||
29 | (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) | ||
30 | /* | 28 | /* |
31 | * Given a pci_bus, return the sn pcibus_bussoft struct. Note that | 29 | * Given a pci_bus, return the sn pcibus_bussoft struct. Note that |
32 | * this only works for root busses, not for busses represented by PPB's. | 30 | * this only works for root busses, not for busses represented by PPB's. |
33 | */ | 31 | */ |
34 | 32 | ||
35 | #define SN_PCIBUS_BUSSOFT(pci_bus) \ | 33 | #define SN_PCIBUS_BUSSOFT(pci_bus) \ |
36 | ((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) | 34 | ((struct pcibus_bussoft *)(SN_PLATFORM_DATA(pci_bus)->provider_soft)) |
37 | 35 | ||
38 | #define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \ | 36 | #define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \ |
39 | (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) | 37 | ((struct pcibus_info *)(SN_PLATFORM_DATA(pci_bus)->provider_soft)) |
40 | /* | 38 | /* |
41 | * Given a struct pci_dev, return the sn pcibus_bussoft struct. Note | 39 | * Given a struct pci_dev, return the sn pcibus_bussoft struct. Note |
42 | * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due | 40 | * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due |
@@ -72,8 +70,6 @@ extern void sn_irq_fixup(struct pci_dev *pci_dev, | |||
72 | struct sn_irq_info *sn_irq_info); | 70 | struct sn_irq_info *sn_irq_info); |
73 | extern void sn_irq_unfixup(struct pci_dev *pci_dev); | 71 | extern void sn_irq_unfixup(struct pci_dev *pci_dev); |
74 | extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *); | 72 | extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *); |
75 | extern void sn_pci_controller_fixup(int segment, int busnum, | ||
76 | struct pci_bus *bus); | ||
77 | extern void sn_bus_store_sysdata(struct pci_dev *dev); | 73 | extern void sn_bus_store_sysdata(struct pci_dev *dev); |
78 | extern void sn_bus_free_sysdata(void); | 74 | extern void sn_bus_free_sysdata(void); |
79 | extern void sn_generate_path(struct pci_bus *pci_bus, char *address); | 75 | extern void sn_generate_path(struct pci_bus *pci_bus, char *address); |
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h index 30dcfa442e53..bfdc36273ed4 100644 --- a/include/asm-ia64/sn/sn_feature_sets.h +++ b/include/asm-ia64/sn/sn_feature_sets.h | |||
@@ -44,8 +44,14 @@ extern int sn_prom_feature_available(int id); | |||
44 | * Once enabled, a feature cannot be disabled. | 44 | * Once enabled, a feature cannot be disabled. |
45 | * | 45 | * |
46 | * By default, features are disabled unless explicitly enabled. | 46 | * By default, features are disabled unless explicitly enabled. |
47 | * | ||
48 | * These defines must be kept in sync with the corresponding | ||
49 | * PROM definitions in feature_sets.h. | ||
47 | */ | 50 | */ |
48 | #define OSF_MCA_SLV_TO_OS_INIT_SLV 0 | 51 | #define OSF_MCA_SLV_TO_OS_INIT_SLV 0 |
49 | #define OSF_FEAT_LOG_SBES 1 | 52 | #define OSF_FEAT_LOG_SBES 1 |
53 | #define OSF_ACPI_ENABLE 2 | ||
54 | #define OSF_PCISEGMENT_ENABLE 3 | ||
55 | |||
50 | 56 | ||
51 | #endif /* _ASM_IA64_SN_FEATURE_SETS_H */ | 57 | #endif /* _ASM_IA64_SN_FEATURE_SETS_H */ |
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index ba826b3f75bb..be5d83ad7cb1 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -77,6 +77,7 @@ | |||
77 | #define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058 // deprecated | 77 | #define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058 // deprecated |
78 | #define SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST 0x0200005a | 78 | #define SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST 0x0200005a |
79 | 79 | ||
80 | #define SN_SAL_IOIF_INIT 0x0200005f | ||
80 | #define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060 | 81 | #define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060 |
81 | #define SN_SAL_BTE_RECOVER 0x02000061 | 82 | #define SN_SAL_BTE_RECOVER 0x02000061 |
82 | #define SN_SAL_RESERVED_DO_NOT_USE 0x02000062 | 83 | #define SN_SAL_RESERVED_DO_NOT_USE 0x02000062 |
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h index 9adb51211c22..449c8c0fa2bd 100644 --- a/include/asm-ia64/uaccess.h +++ b/include/asm-ia64/uaccess.h | |||
@@ -389,7 +389,7 @@ xlate_dev_kmem_ptr (char * p) | |||
389 | struct page *page; | 389 | struct page *page; |
390 | char * ptr; | 390 | char * ptr; |
391 | 391 | ||
392 | page = virt_to_page((unsigned long)p >> PAGE_SHIFT); | 392 | page = virt_to_page((unsigned long)p); |
393 | if (PageUncached(page)) | 393 | if (PageUncached(page)) |
394 | ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET; | 394 | ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET; |
395 | else | 395 | else |
diff --git a/include/asm-m32r/checksum.h b/include/asm-m32r/checksum.h index 877ebf46e9ff..a7a7c4f44abe 100644 --- a/include/asm-m32r/checksum.h +++ b/include/asm-m32r/checksum.h | |||
@@ -31,8 +31,7 @@ | |||
31 | * | 31 | * |
32 | * it's best to have buff aligned on a 32-bit boundary | 32 | * it's best to have buff aligned on a 32-bit boundary |
33 | */ | 33 | */ |
34 | asmlinkage unsigned int csum_partial(const unsigned char *buff, | 34 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
35 | int len, unsigned int sum); | ||
36 | 35 | ||
37 | /* | 36 | /* |
38 | * The same as csum_partial, but copies from src while it checksums. | 37 | * The same as csum_partial, but copies from src while it checksums. |
@@ -40,24 +39,22 @@ asmlinkage unsigned int csum_partial(const unsigned char *buff, | |||
40 | * Here even more important to align src and dst on a 32-bit (or even | 39 | * Here even more important to align src and dst on a 32-bit (or even |
41 | * better 64-bit) boundary | 40 | * better 64-bit) boundary |
42 | */ | 41 | */ |
43 | extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, | 42 | extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
44 | unsigned char *dst, | 43 | int len, __wsum sum); |
45 | int len, unsigned int sum); | ||
46 | 44 | ||
47 | /* | 45 | /* |
48 | * This is a new version of the above that records errors it finds in *errp, | 46 | * This is a new version of the above that records errors it finds in *errp, |
49 | * but continues and zeros thre rest of the buffer. | 47 | * but continues and zeros thre rest of the buffer. |
50 | */ | 48 | */ |
51 | extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | 49 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
52 | unsigned char *dst, | 50 | int len, __wsum sum, |
53 | int len, unsigned int sum, | ||
54 | int *err_ptr); | 51 | int *err_ptr); |
55 | 52 | ||
56 | /* | 53 | /* |
57 | * Fold a partial checksum | 54 | * Fold a partial checksum |
58 | */ | 55 | */ |
59 | 56 | ||
60 | static inline unsigned int csum_fold(unsigned int sum) | 57 | static inline __sum16 csum_fold(__wsum sum) |
61 | { | 58 | { |
62 | unsigned long tmpreg; | 59 | unsigned long tmpreg; |
63 | __asm__( | 60 | __asm__( |
@@ -72,16 +69,17 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
72 | : "0" (sum) | 69 | : "0" (sum) |
73 | : "cbit" | 70 | : "cbit" |
74 | ); | 71 | ); |
75 | return sum; | 72 | return (__force __sum16)sum; |
76 | } | 73 | } |
77 | 74 | ||
78 | /* | 75 | /* |
79 | * This is a version of ip_compute_csum() optimized for IP headers, | 76 | * This is a version of ip_compute_csum() optimized for IP headers, |
80 | * which always checksum on 4 octet boundaries. | 77 | * which always checksum on 4 octet boundaries. |
81 | */ | 78 | */ |
82 | static inline unsigned short ip_fast_csum(unsigned char * iph, | 79 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
83 | unsigned int ihl) { | 80 | { |
84 | unsigned long sum, tmpreg0, tmpreg1; | 81 | unsigned long tmpreg0, tmpreg1; |
82 | __wsum sum; | ||
85 | 83 | ||
86 | __asm__ __volatile__( | 84 | __asm__ __volatile__( |
87 | " ld %0, @%1+ \n" | 85 | " ld %0, @%1+ \n" |
@@ -115,16 +113,15 @@ static inline unsigned short ip_fast_csum(unsigned char * iph, | |||
115 | return csum_fold(sum); | 113 | return csum_fold(sum); |
116 | } | 114 | } |
117 | 115 | ||
118 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 116 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
119 | unsigned long daddr, | ||
120 | unsigned short len, | 117 | unsigned short len, |
121 | unsigned short proto, | 118 | unsigned short proto, |
122 | unsigned int sum) | 119 | __wsum sum) |
123 | { | 120 | { |
124 | #if defined(__LITTLE_ENDIAN) | 121 | #if defined(__LITTLE_ENDIAN) |
125 | unsigned long len_proto = (ntohs(len)<<16)+proto*256; | 122 | unsigned long len_proto = (proto + len) << 8; |
126 | #else | 123 | #else |
127 | unsigned long len_proto = (proto<<16)+len; | 124 | unsigned long len_proto = proto + len; |
128 | #endif | 125 | #endif |
129 | unsigned long tmpreg; | 126 | unsigned long tmpreg; |
130 | 127 | ||
@@ -147,11 +144,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
147 | * computes the checksum of the TCP/UDP pseudo-header | 144 | * computes the checksum of the TCP/UDP pseudo-header |
148 | * returns a 16-bit checksum, already complemented | 145 | * returns a 16-bit checksum, already complemented |
149 | */ | 146 | */ |
150 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 147 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
151 | unsigned long daddr, | ||
152 | unsigned short len, | 148 | unsigned short len, |
153 | unsigned short proto, | 149 | unsigned short proto, |
154 | unsigned int sum) | 150 | __wsum sum) |
155 | { | 151 | { |
156 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 152 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
157 | } | 153 | } |
@@ -161,16 +157,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
161 | * in icmp.c | 157 | * in icmp.c |
162 | */ | 158 | */ |
163 | 159 | ||
164 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) { | 160 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
161 | { | ||
165 | return csum_fold (csum_partial(buff, len, 0)); | 162 | return csum_fold (csum_partial(buff, len, 0)); |
166 | } | 163 | } |
167 | 164 | ||
168 | #define _HAVE_ARCH_IPV6_CSUM | 165 | #define _HAVE_ARCH_IPV6_CSUM |
169 | static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 166 | static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
170 | struct in6_addr *daddr, | 167 | const struct in6_addr *daddr, |
171 | __u16 len, | 168 | __u32 len, unsigned short proto, |
172 | unsigned short proto, | 169 | __wsum sum) |
173 | unsigned int sum) | ||
174 | { | 170 | { |
175 | unsigned long tmpreg0, tmpreg1, tmpreg2, tmpreg3; | 171 | unsigned long tmpreg0, tmpreg1, tmpreg2, tmpreg3; |
176 | __asm__( | 172 | __asm__( |
@@ -197,7 +193,7 @@ static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
197 | : "=&r" (sum), "=&r" (tmpreg0), "=&r" (tmpreg1), | 193 | : "=&r" (sum), "=&r" (tmpreg0), "=&r" (tmpreg1), |
198 | "=&r" (tmpreg2), "=&r" (tmpreg3) | 194 | "=&r" (tmpreg2), "=&r" (tmpreg3) |
199 | : "r" (saddr), "r" (daddr), | 195 | : "r" (saddr), "r" (daddr), |
200 | "r" (htonl((__u32) (len))), "r" (htonl(proto)), "0" (sum) | 196 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) |
201 | : "cbit" | 197 | : "cbit" |
202 | ); | 198 | ); |
203 | 199 | ||
diff --git a/include/asm-m32r/device.h b/include/asm-m32r/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m32r/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h index 17280ef719f5..494f9aec37ea 100644 --- a/include/asm-m68k/checksum.h +++ b/include/asm-m68k/checksum.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * it's best to have buff aligned on a 32-bit boundary | 16 | * it's best to have buff aligned on a 32-bit boundary |
17 | */ | 17 | */ |
18 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 18 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * the same as csum_partial, but copies from src while it | 21 | * the same as csum_partial, but copies from src while it |
@@ -25,22 +25,21 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
25 | * better 64-bit) boundary | 25 | * better 64-bit) boundary |
26 | */ | 26 | */ |
27 | 27 | ||
28 | extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | 28 | extern __wsum csum_partial_copy_from_user(const void __user *src, |
29 | unsigned char *dst, | 29 | void *dst, |
30 | int len, int sum, | 30 | int len, __wsum sum, |
31 | int *csum_err); | 31 | int *csum_err); |
32 | 32 | ||
33 | extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, | 33 | extern __wsum csum_partial_copy_nocheck(const void *src, |
34 | unsigned char *dst, int len, | 34 | void *dst, int len, |
35 | int sum); | 35 | __wsum sum); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * This is a version of ip_compute_csum() optimized for IP headers, | 38 | * This is a version of ip_compute_csum() optimized for IP headers, |
39 | * which always checksum on 4 octet boundaries. | 39 | * which always checksum on 4 octet boundaries. |
40 | * | 40 | * |
41 | */ | 41 | */ |
42 | static inline unsigned short | 42 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
43 | ip_fast_csum(unsigned char *iph, unsigned int ihl) | ||
44 | { | 43 | { |
45 | unsigned int sum = 0; | 44 | unsigned int sum = 0; |
46 | unsigned long tmp; | 45 | unsigned long tmp; |
@@ -58,29 +57,29 @@ ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
58 | : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp) | 57 | : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp) |
59 | : "0" (sum), "1" (iph), "2" (ihl) | 58 | : "0" (sum), "1" (iph), "2" (ihl) |
60 | : "memory"); | 59 | : "memory"); |
61 | return ~sum; | 60 | return (__force __sum16)~sum; |
62 | } | 61 | } |
63 | 62 | ||
64 | /* | 63 | /* |
65 | * Fold a partial checksum | 64 | * Fold a partial checksum |
66 | */ | 65 | */ |
67 | 66 | ||
68 | static inline unsigned int csum_fold(unsigned int sum) | 67 | static inline __sum16 csum_fold(__wsum sum) |
69 | { | 68 | { |
70 | unsigned int tmp = sum; | 69 | unsigned int tmp = (__force u32)sum; |
71 | __asm__("swap %1\n\t" | 70 | __asm__("swap %1\n\t" |
72 | "addw %1, %0\n\t" | 71 | "addw %1, %0\n\t" |
73 | "clrw %1\n\t" | 72 | "clrw %1\n\t" |
74 | "addxw %1, %0" | 73 | "addxw %1, %0" |
75 | : "=&d" (sum), "=&d" (tmp) | 74 | : "=&d" (sum), "=&d" (tmp) |
76 | : "0" (sum), "1" (tmp)); | 75 | : "0" (sum), "1" (tmp)); |
77 | return ~sum; | 76 | return (__force __sum16)~sum; |
78 | } | 77 | } |
79 | 78 | ||
80 | 79 | ||
81 | static inline unsigned int | 80 | static inline __wsum |
82 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 81 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
83 | unsigned short proto, unsigned int sum) | 82 | unsigned short proto, __wsum sum) |
84 | { | 83 | { |
85 | __asm__ ("addl %2,%0\n\t" | 84 | __asm__ ("addl %2,%0\n\t" |
86 | "addxl %3,%0\n\t" | 85 | "addxl %3,%0\n\t" |
@@ -98,9 +97,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
98 | * computes the checksum of the TCP/UDP pseudo-header | 97 | * computes the checksum of the TCP/UDP pseudo-header |
99 | * returns a 16-bit checksum, already complemented | 98 | * returns a 16-bit checksum, already complemented |
100 | */ | 99 | */ |
101 | static inline unsigned short int | 100 | static inline __sum16 |
102 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 101 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
103 | unsigned short proto, unsigned int sum) | 102 | unsigned short proto, __wsum sum) |
104 | { | 103 | { |
105 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 104 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
106 | } | 105 | } |
@@ -110,16 +109,15 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
110 | * in icmp.c | 109 | * in icmp.c |
111 | */ | 110 | */ |
112 | 111 | ||
113 | static inline unsigned short | 112 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
114 | ip_compute_csum(unsigned char * buff, int len) | ||
115 | { | 113 | { |
116 | return csum_fold (csum_partial(buff, len, 0)); | 114 | return csum_fold (csum_partial(buff, len, 0)); |
117 | } | 115 | } |
118 | 116 | ||
119 | #define _HAVE_ARCH_IPV6_CSUM | 117 | #define _HAVE_ARCH_IPV6_CSUM |
120 | static __inline__ unsigned short int | 118 | static __inline__ __sum16 |
121 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | 119 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, |
122 | __u32 len, unsigned short proto, unsigned int sum) | 120 | __u32 len, unsigned short proto, __wsum sum) |
123 | { | 121 | { |
124 | register unsigned long tmp; | 122 | register unsigned long tmp; |
125 | __asm__("addl %2@,%0\n\t" | 123 | __asm__("addl %2@,%0\n\t" |
diff --git a/include/asm-m68k/device.h b/include/asm-m68k/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m68k/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68knommu/checksum.h b/include/asm-m68knommu/checksum.h index 294ec7583ac9..81883482ffb1 100644 --- a/include/asm-m68knommu/checksum.h +++ b/include/asm-m68knommu/checksum.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * it's best to have buff aligned on a 32-bit boundary | 16 | * it's best to have buff aligned on a 32-bit boundary |
17 | */ | 17 | */ |
18 | unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 18 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * the same as csum_partial, but copies from src while it | 21 | * the same as csum_partial, but copies from src while it |
@@ -25,8 +25,8 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
25 | * better 64-bit) boundary | 25 | * better 64-bit) boundary |
26 | */ | 26 | */ |
27 | 27 | ||
28 | unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | 28 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
29 | int len, int sum); | 29 | int len, __wsum sum); |
30 | 30 | ||
31 | 31 | ||
32 | /* | 32 | /* |
@@ -36,33 +36,31 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst, | |||
36 | * better 64-bit) boundary | 36 | * better 64-bit) boundary |
37 | */ | 37 | */ |
38 | 38 | ||
39 | extern unsigned int csum_partial_copy_from_user(const unsigned char *src, | 39 | extern __wsum csum_partial_copy_from_user(const void __user *src, |
40 | unsigned char *dst, int len, int sum, int *csum_err); | 40 | void *dst, int len, __wsum sum, int *csum_err); |
41 | 41 | ||
42 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 42 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
43 | csum_partial_copy((src), (dst), (len), (sum)) | ||
44 | |||
45 | unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl); | ||
46 | 43 | ||
47 | /* | 44 | /* |
48 | * Fold a partial checksum | 45 | * Fold a partial checksum |
49 | */ | 46 | */ |
50 | 47 | ||
51 | static inline unsigned int csum_fold(unsigned int sum) | 48 | static inline __sum16 csum_fold(__wsum sum) |
52 | { | 49 | { |
50 | unsigned int tmp = (__force u32)sum; | ||
53 | #ifdef CONFIG_COLDFIRE | 51 | #ifdef CONFIG_COLDFIRE |
54 | sum = (sum & 0xffff) + (sum >> 16); | 52 | tmp = (tmp & 0xffff) + (tmp >> 16); |
55 | sum = (sum & 0xffff) + (sum >> 16); | 53 | tmp = (tmp & 0xffff) + (tmp >> 16); |
54 | return (__force __sum16)~tmp; | ||
56 | #else | 55 | #else |
57 | unsigned int tmp = sum; | ||
58 | __asm__("swap %1\n\t" | 56 | __asm__("swap %1\n\t" |
59 | "addw %1, %0\n\t" | 57 | "addw %1, %0\n\t" |
60 | "clrw %1\n\t" | 58 | "clrw %1\n\t" |
61 | "addxw %1, %0" | 59 | "addxw %1, %0" |
62 | : "=&d" (sum), "=&d" (tmp) | 60 | : "=&d" (sum), "=&d" (tmp) |
63 | : "0" (sum), "1" (sum)); | 61 | : "0" (sum), "1" (sum)); |
62 | return (__force __sum16)~sum; | ||
64 | #endif | 63 | #endif |
65 | return ~sum; | ||
66 | } | 64 | } |
67 | 65 | ||
68 | 66 | ||
@@ -71,9 +69,9 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
71 | * returns a 16-bit checksum, already complemented | 69 | * returns a 16-bit checksum, already complemented |
72 | */ | 70 | */ |
73 | 71 | ||
74 | static inline unsigned int | 72 | static inline __wsum |
75 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | 73 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
76 | unsigned short proto, unsigned int sum) | 74 | unsigned short proto, __wsum sum) |
77 | { | 75 | { |
78 | __asm__ ("addl %1,%0\n\t" | 76 | __asm__ ("addl %1,%0\n\t" |
79 | "addxl %4,%0\n\t" | 77 | "addxl %4,%0\n\t" |
@@ -86,9 +84,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
86 | return sum; | 84 | return sum; |
87 | } | 85 | } |
88 | 86 | ||
89 | static inline unsigned short int | 87 | static inline __sum16 |
90 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | 88 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, |
91 | unsigned short proto, unsigned int sum) | 89 | unsigned short proto, __wsum sum) |
92 | { | 90 | { |
93 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 91 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
94 | } | 92 | } |
@@ -98,12 +96,12 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, | |||
98 | * in icmp.c | 96 | * in icmp.c |
99 | */ | 97 | */ |
100 | 98 | ||
101 | extern unsigned short ip_compute_csum(const unsigned char * buff, int len); | 99 | extern __sum16 ip_compute_csum(const void *buff, int len); |
102 | 100 | ||
103 | #define _HAVE_ARCH_IPV6_CSUM | 101 | #define _HAVE_ARCH_IPV6_CSUM |
104 | static __inline__ unsigned short int | 102 | static __inline__ __sum16 |
105 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | 103 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, |
106 | __u32 len, unsigned short proto, unsigned int sum) | 104 | __u32 len, unsigned short proto, __wsum sum) |
107 | { | 105 | { |
108 | register unsigned long tmp; | 106 | register unsigned long tmp; |
109 | __asm__("addl %2@,%0\n\t" | 107 | __asm__("addl %2@,%0\n\t" |
diff --git a/include/asm-m68knommu/device.h b/include/asm-m68knommu/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m68knommu/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68knommu/irq_regs.h b/include/asm-m68knommu/irq_regs.h new file mode 100644 index 000000000000..3dd9c0b70270 --- /dev/null +++ b/include/asm-m68knommu/irq_regs.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/irq_regs.h> | |||
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h index a2503dfc554c..6132a9858b52 100644 --- a/include/asm-m68knommu/irqnode.h +++ b/include/asm-m68knommu/irqnode.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * interrupt source (if it supports chaining). | 8 | * interrupt source (if it supports chaining). |
9 | */ | 9 | */ |
10 | typedef struct irq_node { | 10 | typedef struct irq_node { |
11 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 11 | irq_handler_t handler; |
12 | unsigned long flags; | 12 | unsigned long flags; |
13 | void *dev_id; | 13 | void *dev_id; |
14 | const char *devname; | 14 | const char *devname; |
@@ -18,12 +18,12 @@ typedef struct irq_node { | |||
18 | /* | 18 | /* |
19 | * This structure has only 4 elements for speed reasons | 19 | * This structure has only 4 elements for speed reasons |
20 | */ | 20 | */ |
21 | typedef struct irq_handler { | 21 | struct irq_entry { |
22 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 22 | irq_handler_t handler; |
23 | unsigned long flags; | 23 | unsigned long flags; |
24 | void *dev_id; | 24 | void *dev_id; |
25 | const char *devname; | 25 | const char *devname; |
26 | } irq_handler_t; | 26 | }; |
27 | 27 | ||
28 | /* count of spurious interrupts */ | 28 | /* count of spurious interrupts */ |
29 | extern volatile unsigned int num_spurious; | 29 | extern volatile unsigned int num_spurious; |
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h index 27c90afd3339..6ce28f8e0ead 100644 --- a/include/asm-m68knommu/machdep.h +++ b/include/asm-m68knommu/machdep.h | |||
@@ -18,7 +18,7 @@ extern int (*mach_kbdrate) (struct kbd_repeat *); | |||
18 | extern void (*mach_kbd_leds) (unsigned int); | 18 | extern void (*mach_kbd_leds) (unsigned int); |
19 | /* machine dependent irq functions */ | 19 | /* machine dependent irq functions */ |
20 | extern void (*mach_init_IRQ) (void); | 20 | extern void (*mach_init_IRQ) (void); |
21 | extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); | 21 | extern irq_handler_t mach_default_handler; |
22 | extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), | 22 | extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), |
23 | unsigned long flags, const char *devname, void *dev_id); | 23 | unsigned long flags, const char *devname, void *dev_id); |
24 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); | 24 | extern void (*mach_free_irq) (unsigned int irq, void *dev_id); |
diff --git a/include/asm-m68knommu/mcfmbus.h b/include/asm-m68knommu/mcfmbus.h index 13df9d41bd1a..319899c47a2c 100644 --- a/include/asm-m68knommu/mcfmbus.h +++ b/include/asm-m68knommu/mcfmbus.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/ | 37 | #define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/ |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Define bit flags in Controll Register | 40 | * Define bit flags in Control Register |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */ | 43 | #define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */ |
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 45c706e34df1..c6275088cf65 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -19,12 +19,16 @@ | |||
19 | #define _ATYPE_ | 19 | #define _ATYPE_ |
20 | #define _ATYPE32_ | 20 | #define _ATYPE32_ |
21 | #define _ATYPE64_ | 21 | #define _ATYPE64_ |
22 | #define _LLCONST_(x) x | 22 | #define _CONST64_(x) x |
23 | #else | 23 | #else |
24 | #define _ATYPE_ __PTRDIFF_TYPE__ | 24 | #define _ATYPE_ __PTRDIFF_TYPE__ |
25 | #define _ATYPE32_ int | 25 | #define _ATYPE32_ int |
26 | #define _ATYPE64_ long long | 26 | #define _ATYPE64_ __s64 |
27 | #define _LLCONST_(x) x ## LL | 27 | #ifdef CONFIG_64BIT |
28 | #define _CONST64_(x) x ## L | ||
29 | #else | ||
30 | #define _CONST64_(x) x ## LL | ||
31 | #endif | ||
28 | #endif | 32 | #endif |
29 | 33 | ||
30 | /* | 34 | /* |
@@ -48,7 +52,7 @@ | |||
48 | */ | 52 | */ |
49 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) | 53 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) |
50 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ | 54 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ |
51 | _LLCONST_(0x000000ffffffffff)) | 55 | _CONST64_(0x000000ffffffffff)) |
52 | 56 | ||
53 | #ifdef CONFIG_64BIT | 57 | #ifdef CONFIG_64BIT |
54 | 58 | ||
@@ -57,14 +61,14 @@ | |||
57 | * The compatibility segments use the full 64-bit sign extended value. Note | 61 | * The compatibility segments use the full 64-bit sign extended value. Note |
58 | * the R8000 doesn't have them so don't reference these in generic MIPS code. | 62 | * the R8000 doesn't have them so don't reference these in generic MIPS code. |
59 | */ | 63 | */ |
60 | #define XKUSEG _LLCONST_(0x0000000000000000) | 64 | #define XKUSEG _CONST64_(0x0000000000000000) |
61 | #define XKSSEG _LLCONST_(0x4000000000000000) | 65 | #define XKSSEG _CONST64_(0x4000000000000000) |
62 | #define XKPHYS _LLCONST_(0x8000000000000000) | 66 | #define XKPHYS _CONST64_(0x8000000000000000) |
63 | #define XKSEG _LLCONST_(0xc000000000000000) | 67 | #define XKSEG _CONST64_(0xc000000000000000) |
64 | #define CKSEG0 _LLCONST_(0xffffffff80000000) | 68 | #define CKSEG0 _CONST64_(0xffffffff80000000) |
65 | #define CKSEG1 _LLCONST_(0xffffffffa0000000) | 69 | #define CKSEG1 _CONST64_(0xffffffffa0000000) |
66 | #define CKSSEG _LLCONST_(0xffffffffc0000000) | 70 | #define CKSSEG _CONST64_(0xffffffffc0000000) |
67 | #define CKSEG3 _LLCONST_(0xffffffffe0000000) | 71 | #define CKSEG3 _CONST64_(0xffffffffe0000000) |
68 | 72 | ||
69 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) | 73 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) |
70 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) | 74 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) |
@@ -122,7 +126,7 @@ | |||
122 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) | 126 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) |
123 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) | 127 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) |
124 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) | 128 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) |
125 | #define PHYS_TO_XKPHYS(cm,a) (_LLCONST_(0x8000000000000000) | \ | 129 | #define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \ |
126 | ((cm)<<59) | (a)) | 130 | ((cm)<<59) | (a)) |
127 | 131 | ||
128 | #if defined (CONFIG_CPU_R4300) \ | 132 | #if defined (CONFIG_CPU_R4300) \ |
@@ -132,20 +136,20 @@ | |||
132 | || defined (CONFIG_CPU_NEVADA) \ | 136 | || defined (CONFIG_CPU_NEVADA) \ |
133 | || defined (CONFIG_CPU_TX49XX) \ | 137 | || defined (CONFIG_CPU_TX49XX) \ |
134 | || defined (CONFIG_CPU_MIPS64) | 138 | || defined (CONFIG_CPU_MIPS64) |
135 | #define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */ | 139 | #define TO_PHYS_MASK _CONST64_(0x0000000fffffffff) /* 2^^36 - 1 */ |
136 | #endif | 140 | #endif |
137 | 141 | ||
138 | #if defined (CONFIG_CPU_R8000) | 142 | #if defined (CONFIG_CPU_R8000) |
139 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ | 143 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ |
140 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ | 144 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ |
141 | #endif | 145 | #endif |
142 | 146 | ||
143 | #if defined (CONFIG_CPU_R10000) | 147 | #if defined (CONFIG_CPU_R10000) |
144 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ | 148 | #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */ |
145 | #endif | 149 | #endif |
146 | 150 | ||
147 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) | 151 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) |
148 | #define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */ | 152 | #define TO_PHYS_MASK _CONST64_(0x00000fffffffffff) /* 2^^44 - 1 */ |
149 | #endif | 153 | #endif |
150 | 154 | ||
151 | #ifndef CONFIG_CPU_R8000 | 155 | #ifndef CONFIG_CPU_R8000 |
@@ -155,7 +159,7 @@ | |||
155 | * in order to catch bugs in the source code. | 159 | * in order to catch bugs in the source code. |
156 | */ | 160 | */ |
157 | 161 | ||
158 | #define COMPAT_K1BASE32 _LLCONST_(0xffffffffa0000000) | 162 | #define COMPAT_K1BASE32 _CONST64_(0xffffffffa0000000) |
159 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ | 163 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ |
160 | 164 | ||
161 | #endif | 165 | #endif |
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h index e3038a4599ee..838eb3144d81 100644 --- a/include/asm-mips/asm.h +++ b/include/asm-mips/asm.h | |||
@@ -344,6 +344,7 @@ symbol = value | |||
344 | #define PTR_L lw | 344 | #define PTR_L lw |
345 | #define PTR_S sw | 345 | #define PTR_S sw |
346 | #define PTR_LA la | 346 | #define PTR_LA la |
347 | #define PTR_LI li | ||
347 | #define PTR_SLL sll | 348 | #define PTR_SLL sll |
348 | #define PTR_SLLV sllv | 349 | #define PTR_SLLV sllv |
349 | #define PTR_SRL srl | 350 | #define PTR_SRL srl |
@@ -368,6 +369,7 @@ symbol = value | |||
368 | #define PTR_L ld | 369 | #define PTR_L ld |
369 | #define PTR_S sd | 370 | #define PTR_S sd |
370 | #define PTR_LA dla | 371 | #define PTR_LA dla |
372 | #define PTR_LI dli | ||
371 | #define PTR_SLL dsll | 373 | #define PTR_SLL dsll |
372 | #define PTR_SLLV dsllv | 374 | #define PTR_SLLV dsllv |
373 | #define PTR_SRL dsrl | 375 | #define PTR_SRL dsrl |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index e64abc0d8221..7978d8e11647 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -9,16 +9,8 @@ | |||
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | 10 | * for more details. |
11 | * | 11 | * |
12 | * Copyright (C) 1996, 97, 99, 2000, 03, 04 by Ralf Baechle | 12 | * Copyright (C) 1996, 97, 99, 2000, 03, 04, 06 by Ralf Baechle |
13 | */ | 13 | */ |
14 | |||
15 | /* | ||
16 | * As workaround for the ATOMIC_DEC_AND_LOCK / atomic_dec_and_lock mess in | ||
17 | * <linux/spinlock.h> we have to include <linux/spinlock.h> outside the | ||
18 | * main big wrapper ... | ||
19 | */ | ||
20 | #include <linux/spinlock.h> | ||
21 | |||
22 | #ifndef _ASM_ATOMIC_H | 14 | #ifndef _ASM_ATOMIC_H |
23 | #define _ASM_ATOMIC_H | 15 | #define _ASM_ATOMIC_H |
24 | 16 | ||
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 1bb89c5a10ee..b9007411b60f 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -10,31 +10,26 @@ | |||
10 | #define _ASM_BITOPS_H | 10 | #define _ASM_BITOPS_H |
11 | 11 | ||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
13 | #include <linux/irqflags.h> | ||
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
14 | #include <asm/bug.h> | 15 | #include <asm/bug.h> |
15 | #include <asm/byteorder.h> /* sigh ... */ | 16 | #include <asm/byteorder.h> /* sigh ... */ |
16 | #include <asm/cpu-features.h> | 17 | #include <asm/cpu-features.h> |
18 | #include <asm/sgidefs.h> | ||
19 | #include <asm/war.h> | ||
17 | 20 | ||
18 | #if (_MIPS_SZLONG == 32) | 21 | #if (_MIPS_SZLONG == 32) |
19 | #define SZLONG_LOG 5 | 22 | #define SZLONG_LOG 5 |
20 | #define SZLONG_MASK 31UL | 23 | #define SZLONG_MASK 31UL |
21 | #define __LL "ll " | 24 | #define __LL "ll " |
22 | #define __SC "sc " | 25 | #define __SC "sc " |
23 | #define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) | ||
24 | #elif (_MIPS_SZLONG == 64) | 26 | #elif (_MIPS_SZLONG == 64) |
25 | #define SZLONG_LOG 6 | 27 | #define SZLONG_LOG 6 |
26 | #define SZLONG_MASK 63UL | 28 | #define SZLONG_MASK 63UL |
27 | #define __LL "lld " | 29 | #define __LL "lld " |
28 | #define __SC "scd " | 30 | #define __SC "scd " |
29 | #define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) | ||
30 | #endif | 31 | #endif |
31 | 32 | ||
32 | #ifdef __KERNEL__ | ||
33 | |||
34 | #include <linux/irqflags.h> | ||
35 | #include <asm/sgidefs.h> | ||
36 | #include <asm/war.h> | ||
37 | |||
38 | /* | 33 | /* |
39 | * clear_bit() doesn't provide any barrier for the compiler. | 34 | * clear_bit() doesn't provide any barrier for the compiler. |
40 | */ | 35 | */ |
@@ -42,20 +37,6 @@ | |||
42 | #define smp_mb__after_clear_bit() smp_mb() | 37 | #define smp_mb__after_clear_bit() smp_mb() |
43 | 38 | ||
44 | /* | 39 | /* |
45 | * Only disable interrupt for kernel mode stuff to keep usermode stuff | ||
46 | * that dares to use kernel include files alive. | ||
47 | */ | ||
48 | |||
49 | #define __bi_flags unsigned long flags | ||
50 | #define __bi_local_irq_save(x) local_irq_save(x) | ||
51 | #define __bi_local_irq_restore(x) local_irq_restore(x) | ||
52 | #else | ||
53 | #define __bi_flags | ||
54 | #define __bi_local_irq_save(x) | ||
55 | #define __bi_local_irq_restore(x) | ||
56 | #endif /* __KERNEL__ */ | ||
57 | |||
58 | /* | ||
59 | * set_bit - Atomically set a bit in memory | 40 | * set_bit - Atomically set a bit in memory |
60 | * @nr: the bit to set | 41 | * @nr: the bit to set |
61 | * @addr: the address to start counting from | 42 | * @addr: the address to start counting from |
@@ -93,13 +74,13 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
93 | } else { | 74 | } else { |
94 | volatile unsigned long *a = addr; | 75 | volatile unsigned long *a = addr; |
95 | unsigned long mask; | 76 | unsigned long mask; |
96 | __bi_flags; | 77 | unsigned long flags; |
97 | 78 | ||
98 | a += nr >> SZLONG_LOG; | 79 | a += nr >> SZLONG_LOG; |
99 | mask = 1UL << (nr & SZLONG_MASK); | 80 | mask = 1UL << (nr & SZLONG_MASK); |
100 | __bi_local_irq_save(flags); | 81 | local_irq_save(flags); |
101 | *a |= mask; | 82 | *a |= mask; |
102 | __bi_local_irq_restore(flags); | 83 | local_irq_restore(flags); |
103 | } | 84 | } |
104 | } | 85 | } |
105 | 86 | ||
@@ -141,13 +122,13 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
141 | } else { | 122 | } else { |
142 | volatile unsigned long *a = addr; | 123 | volatile unsigned long *a = addr; |
143 | unsigned long mask; | 124 | unsigned long mask; |
144 | __bi_flags; | 125 | unsigned long flags; |
145 | 126 | ||
146 | a += nr >> SZLONG_LOG; | 127 | a += nr >> SZLONG_LOG; |
147 | mask = 1UL << (nr & SZLONG_MASK); | 128 | mask = 1UL << (nr & SZLONG_MASK); |
148 | __bi_local_irq_save(flags); | 129 | local_irq_save(flags); |
149 | *a &= ~mask; | 130 | *a &= ~mask; |
150 | __bi_local_irq_restore(flags); | 131 | local_irq_restore(flags); |
151 | } | 132 | } |
152 | } | 133 | } |
153 | 134 | ||
@@ -191,13 +172,13 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
191 | } else { | 172 | } else { |
192 | volatile unsigned long *a = addr; | 173 | volatile unsigned long *a = addr; |
193 | unsigned long mask; | 174 | unsigned long mask; |
194 | __bi_flags; | 175 | unsigned long flags; |
195 | 176 | ||
196 | a += nr >> SZLONG_LOG; | 177 | a += nr >> SZLONG_LOG; |
197 | mask = 1UL << (nr & SZLONG_MASK); | 178 | mask = 1UL << (nr & SZLONG_MASK); |
198 | __bi_local_irq_save(flags); | 179 | local_irq_save(flags); |
199 | *a ^= mask; | 180 | *a ^= mask; |
200 | __bi_local_irq_restore(flags); | 181 | local_irq_restore(flags); |
201 | } | 182 | } |
202 | } | 183 | } |
203 | 184 | ||
@@ -258,14 +239,14 @@ static inline int test_and_set_bit(unsigned long nr, | |||
258 | volatile unsigned long *a = addr; | 239 | volatile unsigned long *a = addr; |
259 | unsigned long mask; | 240 | unsigned long mask; |
260 | int retval; | 241 | int retval; |
261 | __bi_flags; | 242 | unsigned long flags; |
262 | 243 | ||
263 | a += nr >> SZLONG_LOG; | 244 | a += nr >> SZLONG_LOG; |
264 | mask = 1UL << (nr & SZLONG_MASK); | 245 | mask = 1UL << (nr & SZLONG_MASK); |
265 | __bi_local_irq_save(flags); | 246 | local_irq_save(flags); |
266 | retval = (mask & *a) != 0; | 247 | retval = (mask & *a) != 0; |
267 | *a |= mask; | 248 | *a |= mask; |
268 | __bi_local_irq_restore(flags); | 249 | local_irq_restore(flags); |
269 | 250 | ||
270 | return retval; | 251 | return retval; |
271 | } | 252 | } |
@@ -330,14 +311,14 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
330 | volatile unsigned long *a = addr; | 311 | volatile unsigned long *a = addr; |
331 | unsigned long mask; | 312 | unsigned long mask; |
332 | int retval; | 313 | int retval; |
333 | __bi_flags; | 314 | unsigned long flags; |
334 | 315 | ||
335 | a += nr >> SZLONG_LOG; | 316 | a += nr >> SZLONG_LOG; |
336 | mask = 1UL << (nr & SZLONG_MASK); | 317 | mask = 1UL << (nr & SZLONG_MASK); |
337 | __bi_local_irq_save(flags); | 318 | local_irq_save(flags); |
338 | retval = (mask & *a) != 0; | 319 | retval = (mask & *a) != 0; |
339 | *a &= ~mask; | 320 | *a &= ~mask; |
340 | __bi_local_irq_restore(flags); | 321 | local_irq_restore(flags); |
341 | 322 | ||
342 | return retval; | 323 | return retval; |
343 | } | 324 | } |
@@ -399,23 +380,19 @@ static inline int test_and_change_bit(unsigned long nr, | |||
399 | } else { | 380 | } else { |
400 | volatile unsigned long *a = addr; | 381 | volatile unsigned long *a = addr; |
401 | unsigned long mask, retval; | 382 | unsigned long mask, retval; |
402 | __bi_flags; | 383 | unsigned long flags; |
403 | 384 | ||
404 | a += nr >> SZLONG_LOG; | 385 | a += nr >> SZLONG_LOG; |
405 | mask = 1UL << (nr & SZLONG_MASK); | 386 | mask = 1UL << (nr & SZLONG_MASK); |
406 | __bi_local_irq_save(flags); | 387 | local_irq_save(flags); |
407 | retval = (mask & *a) != 0; | 388 | retval = (mask & *a) != 0; |
408 | *a ^= mask; | 389 | *a ^= mask; |
409 | __bi_local_irq_restore(flags); | 390 | local_irq_restore(flags); |
410 | 391 | ||
411 | return retval; | 392 | return retval; |
412 | } | 393 | } |
413 | } | 394 | } |
414 | 395 | ||
415 | #undef __bi_flags | ||
416 | #undef __bi_local_irq_save | ||
417 | #undef __bi_local_irq_restore | ||
418 | |||
419 | #include <asm-generic/bitops/non-atomic.h> | 396 | #include <asm-generic/bitops/non-atomic.h> |
420 | 397 | ||
421 | /* | 398 | /* |
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h index 7b4739dc8f3f..4d560a533940 100644 --- a/include/asm-mips/bug.h +++ b/include/asm-mips/bug.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_BUG_H | 1 | #ifndef __ASM_BUG_H |
2 | #define __ASM_BUG_H | 2 | #define __ASM_BUG_H |
3 | 3 | ||
4 | #include <asm/sgidefs.h> | ||
4 | 5 | ||
5 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
6 | 7 | ||
@@ -13,6 +14,17 @@ do { \ | |||
13 | 14 | ||
14 | #define HAVE_ARCH_BUG | 15 | #define HAVE_ARCH_BUG |
15 | 16 | ||
17 | #if (_MIPS_ISA > _MIPS_ISA_MIPS1) | ||
18 | |||
19 | #define BUG_ON(condition) \ | ||
20 | do { \ | ||
21 | __asm__ __volatile__("tne $0, %0" : : "r" (condition)); \ | ||
22 | } while (0) | ||
23 | |||
24 | #define HAVE_ARCH_BUG_ON | ||
25 | |||
26 | #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */ | ||
27 | |||
16 | #endif | 28 | #endif |
17 | 29 | ||
18 | #include <asm-generic/bug.h> | 30 | #include <asm-generic/bug.h> |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 9ab59e2bb233..e3c9925876a3 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end); | |||
55 | #define flush_cache_vmap(start, end) flush_cache_all() | 55 | #define flush_cache_vmap(start, end) flush_cache_all() |
56 | #define flush_cache_vunmap(start, end) flush_cache_all() | 56 | #define flush_cache_vunmap(start, end) flush_cache_all() |
57 | 57 | ||
58 | static inline void copy_to_user_page(struct vm_area_struct *vma, | 58 | extern void copy_to_user_page(struct vm_area_struct *vma, |
59 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 59 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
60 | unsigned long len) | 60 | unsigned long len); |
61 | { | ||
62 | if (cpu_has_dc_aliases) | ||
63 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
64 | memcpy(dst, src, len); | ||
65 | __flush_icache_page(vma, page); | ||
66 | } | ||
67 | 61 | ||
68 | static inline void copy_from_user_page(struct vm_area_struct *vma, | 62 | extern void copy_from_user_page(struct vm_area_struct *vma, |
69 | struct page *page, unsigned long vaddr, void *dst, const void *src, | 63 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
70 | unsigned long len) | 64 | unsigned long len); |
71 | { | ||
72 | if (cpu_has_dc_aliases) | ||
73 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
74 | memcpy(dst, src, len); | ||
75 | } | ||
76 | 65 | ||
77 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 66 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
78 | extern void (*flush_icache_all)(void); | 67 | extern void (*flush_icache_all)(void); |
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index a5e6050ec0f3..9b768c3b96b3 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h | |||
@@ -27,23 +27,22 @@ | |||
27 | * | 27 | * |
28 | * it's best to have buff aligned on a 32-bit boundary | 28 | * it's best to have buff aligned on a 32-bit boundary |
29 | */ | 29 | */ |
30 | unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum); | 30 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * this is a new version of the above that records errors it finds in *errp, | 33 | * this is a new version of the above that records errors it finds in *errp, |
34 | * but continues and zeros the rest of the buffer. | 34 | * but continues and zeros the rest of the buffer. |
35 | */ | 35 | */ |
36 | unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | 36 | __wsum csum_partial_copy_from_user(const void __user *src, |
37 | unsigned char *dst, int len, | 37 | void *dst, int len, |
38 | unsigned int sum, int *errp); | 38 | __wsum sum, int *errp); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Copy and checksum to user | 41 | * Copy and checksum to user |
42 | */ | 42 | */ |
43 | #define HAVE_CSUM_COPY_USER | 43 | #define HAVE_CSUM_COPY_USER |
44 | static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | 44 | static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst, |
45 | unsigned char __user *dst, | 45 | int len, __wsum sum, |
46 | int len, int sum, | ||
47 | int *err_ptr) | 46 | int *err_ptr) |
48 | { | 47 | { |
49 | might_sleep(); | 48 | might_sleep(); |
@@ -51,7 +50,7 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | |||
51 | 50 | ||
52 | if (copy_to_user(dst, src, len)) { | 51 | if (copy_to_user(dst, src, len)) { |
53 | *err_ptr = -EFAULT; | 52 | *err_ptr = -EFAULT; |
54 | return -1; | 53 | return (__force __wsum)-1; |
55 | } | 54 | } |
56 | 55 | ||
57 | return sum; | 56 | return sum; |
@@ -61,13 +60,13 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src, | |||
61 | * the same as csum_partial, but copies from user space (but on MIPS | 60 | * the same as csum_partial, but copies from user space (but on MIPS |
62 | * we have just one address space, so this is identical to the above) | 61 | * we have just one address space, so this is identical to the above) |
63 | */ | 62 | */ |
64 | unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, | 63 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
65 | int len, unsigned int sum); | 64 | int len, __wsum sum); |
66 | 65 | ||
67 | /* | 66 | /* |
68 | * Fold a partial checksum without adding pseudo headers | 67 | * Fold a partial checksum without adding pseudo headers |
69 | */ | 68 | */ |
70 | static inline unsigned short int csum_fold(unsigned int sum) | 69 | static inline __sum16 csum_fold(__wsum sum) |
71 | { | 70 | { |
72 | __asm__( | 71 | __asm__( |
73 | " .set push # csum_fold\n" | 72 | " .set push # csum_fold\n" |
@@ -82,7 +81,7 @@ static inline unsigned short int csum_fold(unsigned int sum) | |||
82 | : "=r" (sum) | 81 | : "=r" (sum) |
83 | : "0" (sum)); | 82 | : "0" (sum)); |
84 | 83 | ||
85 | return sum; | 84 | return (__force __sum16)sum; |
86 | } | 85 | } |
87 | 86 | ||
88 | /* | 87 | /* |
@@ -92,10 +91,10 @@ static inline unsigned short int csum_fold(unsigned int sum) | |||
92 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by | 91 | * By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by |
93 | * Arnt Gulbrandsen. | 92 | * Arnt Gulbrandsen. |
94 | */ | 93 | */ |
95 | static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | 94 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
96 | { | 95 | { |
97 | unsigned int *word = (unsigned int *) iph; | 96 | const unsigned int *word = iph; |
98 | unsigned int *stop = word + ihl; | 97 | const unsigned int *stop = word + ihl; |
99 | unsigned int csum; | 98 | unsigned int csum; |
100 | int carry; | 99 | int carry; |
101 | 100 | ||
@@ -123,9 +122,9 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
123 | return csum_fold(csum); | 122 | return csum_fold(csum); |
124 | } | 123 | } |
125 | 124 | ||
126 | static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | 125 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, |
127 | unsigned long daddr, unsigned short len, unsigned short proto, | 126 | __be32 daddr, unsigned short len, unsigned short proto, |
128 | unsigned int sum) | 127 | __wsum sum) |
129 | { | 128 | { |
130 | __asm__( | 129 | __asm__( |
131 | " .set push # csum_tcpudp_nofold\n" | 130 | " .set push # csum_tcpudp_nofold\n" |
@@ -155,9 +154,9 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | |||
155 | : "=r" (sum) | 154 | : "=r" (sum) |
156 | : "0" (daddr), "r"(saddr), | 155 | : "0" (daddr), "r"(saddr), |
157 | #ifdef __MIPSEL__ | 156 | #ifdef __MIPSEL__ |
158 | "r" (((unsigned long)htons(len)<<16) + proto*256), | 157 | "r" ((proto + len) << 8), |
159 | #else | 158 | #else |
160 | "r" (((unsigned long)(proto)<<16) + len), | 159 | "r" (proto + len), |
161 | #endif | 160 | #endif |
162 | "r" (sum)); | 161 | "r" (sum)); |
163 | 162 | ||
@@ -168,11 +167,10 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | |||
168 | * computes the checksum of the TCP/UDP pseudo-header | 167 | * computes the checksum of the TCP/UDP pseudo-header |
169 | * returns a 16-bit checksum, already complemented | 168 | * returns a 16-bit checksum, already complemented |
170 | */ | 169 | */ |
171 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 170 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
172 | unsigned long daddr, | ||
173 | unsigned short len, | 171 | unsigned short len, |
174 | unsigned short proto, | 172 | unsigned short proto, |
175 | unsigned int sum) | 173 | __wsum sum) |
176 | { | 174 | { |
177 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); | 175 | return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); |
178 | } | 176 | } |
@@ -181,17 +179,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
181 | * this routine is used for miscellaneous IP-like checksums, mainly | 179 | * this routine is used for miscellaneous IP-like checksums, mainly |
182 | * in icmp.c | 180 | * in icmp.c |
183 | */ | 181 | */ |
184 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 182 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
185 | { | 183 | { |
186 | return csum_fold(csum_partial(buff, len, 0)); | 184 | return csum_fold(csum_partial(buff, len, 0)); |
187 | } | 185 | } |
188 | 186 | ||
189 | #define _HAVE_ARCH_IPV6_CSUM | 187 | #define _HAVE_ARCH_IPV6_CSUM |
190 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 188 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
191 | struct in6_addr *daddr, | 189 | const struct in6_addr *daddr, |
192 | __u32 len, | 190 | __u32 len, unsigned short proto, |
193 | unsigned short proto, | 191 | __wsum sum) |
194 | unsigned int sum) | ||
195 | { | 192 | { |
196 | __asm__( | 193 | __asm__( |
197 | " .set push # csum_ipv6_magic\n" | 194 | " .set push # csum_ipv6_magic\n" |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index a2f0c8ea9160..610d0cdeaa9e 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -22,12 +22,12 @@ | |||
22 | * Descriptor for a cache | 22 | * Descriptor for a cache |
23 | */ | 23 | */ |
24 | struct cache_desc { | 24 | struct cache_desc { |
25 | unsigned short linesz; /* Size of line in bytes */ | ||
26 | unsigned short ways; /* Number of ways */ | ||
27 | unsigned short sets; /* Number of lines per set */ | ||
28 | unsigned int waysize; /* Bytes per way */ | 25 | unsigned int waysize; /* Bytes per way */ |
29 | unsigned int waybit; /* Bits to select in a cache set */ | 26 | unsigned short sets; /* Number of lines per set */ |
30 | unsigned int flags; /* Flags describing cache properties */ | 27 | unsigned char ways; /* Number of ways */ |
28 | unsigned char linesz; /* Size of line in bytes */ | ||
29 | unsigned char waybit; /* Bits to select in a cache set */ | ||
30 | unsigned char flags; /* Flags describing cache properties */ | ||
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* | 33 | /* |
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h index 8319ad77b250..93430b5f4724 100644 --- a/include/asm-mips/dec/kn02.h +++ b/include/asm-mips/dec/kn02.h | |||
@@ -82,11 +82,9 @@ | |||
82 | 82 | ||
83 | #ifndef __ASSEMBLY__ | 83 | #ifndef __ASSEMBLY__ |
84 | 84 | ||
85 | #include <linux/spinlock.h> | ||
86 | #include <linux/types.h> | 85 | #include <linux/types.h> |
87 | 86 | ||
88 | extern u32 cached_kn02_csr; | 87 | extern u32 cached_kn02_csr; |
89 | extern spinlock_t kn02_lock; | ||
90 | extern void init_kn02_irqs(int base); | 88 | extern void init_kn02_irqs(int base); |
91 | #endif | 89 | #endif |
92 | 90 | ||
diff --git a/include/asm-mips/device.h b/include/asm-mips/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-mips/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h index 5f7dcf5452e7..d107832de1b6 100644 --- a/include/asm-mips/div64.h +++ b/include/asm-mips/div64.h | |||
@@ -83,27 +83,6 @@ | |||
83 | #if (_MIPS_SZLONG == 64) | 83 | #if (_MIPS_SZLONG == 64) |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Don't use this one in new code | ||
87 | */ | ||
88 | #define do_div64_32(res, high, low, base) ({ \ | ||
89 | unsigned int __quot, __mod; \ | ||
90 | unsigned long __div; \ | ||
91 | unsigned int __low, __high, __base; \ | ||
92 | \ | ||
93 | __high = (high); \ | ||
94 | __low = (low); \ | ||
95 | __div = __high; \ | ||
96 | __div = __div << 32 | __low; \ | ||
97 | __base = (base); \ | ||
98 | \ | ||
99 | __mod = __div % __base; \ | ||
100 | __div = __div / __base; \ | ||
101 | \ | ||
102 | __quot = __div; \ | ||
103 | (res) = __quot; \ | ||
104 | __mod; }) | ||
105 | |||
106 | /* | ||
107 | * Hey, we're already 64-bit, no | 86 | * Hey, we're already 64-bit, no |
108 | * need to play games.. | 87 | * need to play games.. |
109 | */ | 88 | */ |
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h index e85849ac165f..23f789c80845 100644 --- a/include/asm-mips/dma.h +++ b/include/asm-mips/dma.h | |||
@@ -74,7 +74,9 @@ | |||
74 | * | 74 | * |
75 | */ | 75 | */ |
76 | 76 | ||
77 | #ifndef GENERIC_ISA_DMA_SUPPORT_BROKEN | ||
77 | #define MAX_DMA_CHANNELS 8 | 78 | #define MAX_DMA_CHANNELS 8 |
79 | #endif | ||
78 | 80 | ||
79 | /* | 81 | /* |
80 | * The maximum address in KSEG0 that we can perform a DMA transfer to on this | 82 | * The maximum address in KSEG0 that we can perform a DMA transfer to on this |
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h index 6959bdb59310..02c8a13fc894 100644 --- a/include/asm-mips/fixmap.h +++ b/include/asm-mips/fixmap.h | |||
@@ -45,8 +45,16 @@ | |||
45 | * fix-mapped? | 45 | * fix-mapped? |
46 | */ | 46 | */ |
47 | enum fixed_addresses { | 47 | enum fixed_addresses { |
48 | #define FIX_N_COLOURS 8 | ||
49 | FIX_CMAP_BEGIN, | ||
50 | #ifdef CONFIG_MIPS_MT_SMTC | ||
51 | FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS), | ||
52 | #else | ||
53 | FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS, | ||
54 | #endif | ||
48 | #ifdef CONFIG_HIGHMEM | 55 | #ifdef CONFIG_HIGHMEM |
49 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ | 56 | /* reserved pte's for temporary kernel mappings */ |
57 | FIX_KMAP_BEGIN = FIX_CMAP_END + 1, | ||
50 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | 58 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, |
51 | #endif | 59 | #endif |
52 | __end_of_fixed_addresses | 60 | __end_of_fixed_addresses |
@@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx, | |||
70 | * at the top of mem.. | 78 | * at the top of mem.. |
71 | */ | 79 | */ |
72 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) | 80 | #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) |
73 | #define FIXADDR_TOP (0xff000000UL - 0x2000) | 81 | #define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000)) |
74 | #else | 82 | #else |
75 | #define FIXADDR_TOP (0xffffe000UL) | 83 | #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) |
76 | #endif | 84 | #endif |
77 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | 85 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) |
78 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) | 86 | #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
diff --git a/include/asm-mips/gt64120.h b/include/asm-mips/gt64120.h index 2edd171bb6cd..4bf8e28f8850 100644 --- a/include/asm-mips/gt64120.h +++ b/include/asm-mips/gt64120.h | |||
@@ -451,6 +451,13 @@ | |||
451 | #define GT_SDRAM_OPMODE_OP_MODE 3 | 451 | #define GT_SDRAM_OPMODE_OP_MODE 3 |
452 | #define GT_SDRAM_OPMODE_OP_CBR 4 | 452 | #define GT_SDRAM_OPMODE_OP_CBR 4 |
453 | 453 | ||
454 | #define GT_TC_CONTROL_ENTC0_SHF 0 | ||
455 | #define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF) | ||
456 | #define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK | ||
457 | #define GT_TC_CONTROL_SELTC0_SHF 1 | ||
458 | #define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF) | ||
459 | #define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK | ||
460 | |||
454 | 461 | ||
455 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0 | 462 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0 |
456 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF) | 463 | #define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF) |
@@ -523,6 +530,13 @@ | |||
523 | #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF) | 530 | #define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF) |
524 | #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK | 531 | #define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK |
525 | 532 | ||
533 | #define GT_INTR_T0EXP_SHF 8 | ||
534 | #define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF) | ||
535 | #define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK | ||
536 | #define GT_INTR_RETRYCTR0_SHF 20 | ||
537 | #define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF) | ||
538 | #define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK | ||
539 | |||
526 | /* | 540 | /* |
527 | * Misc | 541 | * Misc |
528 | */ | 542 | */ |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index c2d124badbe5..d77b657c09c7 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -113,7 +113,7 @@ static inline void set_io_port_base(unsigned long base) | |||
113 | * almost all conceivable cases a device driver should not be using | 113 | * almost all conceivable cases a device driver should not be using |
114 | * this function | 114 | * this function |
115 | */ | 115 | */ |
116 | static inline unsigned long virt_to_phys(volatile void * address) | 116 | static inline unsigned long virt_to_phys(volatile const void *address) |
117 | { | 117 | { |
118 | return (unsigned long)address - PAGE_OFFSET; | 118 | return (unsigned long)address - PAGE_OFFSET; |
119 | } | 119 | } |
@@ -172,7 +172,7 @@ extern unsigned long isa_slot_offset; | |||
172 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) | 172 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) |
173 | 173 | ||
174 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); | 174 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); |
175 | extern void __iounmap(volatile void __iomem *addr); | 175 | extern void __iounmap(const volatile void __iomem *addr); |
176 | 176 | ||
177 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | 177 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, |
178 | unsigned long flags) | 178 | unsigned long flags) |
@@ -279,7 +279,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, | |||
279 | #define ioremap_uncached_accelerated(offset, size) \ | 279 | #define ioremap_uncached_accelerated(offset, size) \ |
280 | __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED) | 280 | __ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED) |
281 | 281 | ||
282 | static inline void iounmap(volatile void __iomem *addr) | 282 | static inline void iounmap(const volatile void __iomem *addr) |
283 | { | 283 | { |
284 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) | 284 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
285 | 285 | ||
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 0ce2a80b689e..67657089efa7 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
@@ -24,8 +24,6 @@ static inline int irq_canonicalize(int irq) | |||
24 | #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ | 24 | #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | extern asmlinkage unsigned int do_IRQ(unsigned int irq); | ||
28 | |||
29 | #ifdef CONFIG_MIPS_MT_SMTC | 27 | #ifdef CONFIG_MIPS_MT_SMTC |
30 | /* | 28 | /* |
31 | * Clear interrupt mask handling "backstop" if irq_hwmask | 29 | * Clear interrupt mask handling "backstop" if irq_hwmask |
@@ -43,8 +41,6 @@ do { \ | |||
43 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) | 41 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) |
44 | #endif | 42 | #endif |
45 | 43 | ||
46 | #ifdef CONFIG_PREEMPT | ||
47 | |||
48 | /* | 44 | /* |
49 | * do_IRQ handles all normal device IRQ's (the special | 45 | * do_IRQ handles all normal device IRQ's (the special |
50 | * SMP cross-CPU interrupts have their own specific | 46 | * SMP cross-CPU interrupts have their own specific |
@@ -57,12 +53,10 @@ do { \ | |||
57 | do { \ | 53 | do { \ |
58 | irq_enter(); \ | 54 | irq_enter(); \ |
59 | __DO_IRQ_SMTC_HOOK(); \ | 55 | __DO_IRQ_SMTC_HOOK(); \ |
60 | __do_IRQ((irq)); \ | 56 | generic_handle_irq(irq); \ |
61 | irq_exit(); \ | 57 | irq_exit(); \ |
62 | } while (0) | 58 | } while (0) |
63 | 59 | ||
64 | #endif | ||
65 | |||
66 | extern void arch_init_irq(void); | 60 | extern void arch_init_irq(void); |
67 | extern void spurious_interrupt(void); | 61 | extern void spurious_interrupt(void); |
68 | 62 | ||
@@ -74,4 +68,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, | |||
74 | unsigned long hwmask); | 68 | unsigned long hwmask); |
75 | #endif /* CONFIG_MIPS_MT_SMTC */ | 69 | #endif /* CONFIG_MIPS_MT_SMTC */ |
76 | 70 | ||
71 | extern int allocate_irqno(void); | ||
72 | extern void alloc_legacy_irqno(void); | ||
73 | extern void free_irqno(unsigned int irq); | ||
74 | |||
77 | #endif /* _ASM_IRQ_H */ | 75 | #endif /* _ASM_IRQ_H */ |
diff --git a/include/asm-mips/kexec.h b/include/asm-mips/kexec.h new file mode 100644 index 000000000000..b25267ebcb09 --- /dev/null +++ b/include/asm-mips/kexec.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * kexec.h for kexec | ||
3 | * Created by <nschichan@corp.free.fr> on Thu Oct 12 14:59:34 2006 | ||
4 | * | ||
5 | * This source code is licensed under the GNU General Public License, | ||
6 | * Version 2. See the file COPYING for more details. | ||
7 | */ | ||
8 | |||
9 | #ifndef _MIPS_KEXEC | ||
10 | # define _MIPS_KEXEC | ||
11 | |||
12 | /* Maximum physical address we can use pages from */ | ||
13 | #define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000) | ||
14 | /* Maximum address we can reach in physical address mode */ | ||
15 | #define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000) | ||
16 | /* Maximum address we can use for the control code buffer */ | ||
17 | #define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000) | ||
18 | |||
19 | #define KEXEC_CONTROL_CODE_SIZE 4096 | ||
20 | |||
21 | /* The native architecture */ | ||
22 | #define KEXEC_ARCH KEXEC_ARCH_MIPS | ||
23 | |||
24 | #define MAX_NOTE_BYTES 1024 | ||
25 | |||
26 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
27 | struct pt_regs *oldregs) | ||
28 | { | ||
29 | /* Dummy implementation for now */ | ||
30 | } | ||
31 | |||
32 | #endif /* !_MIPS_KEXEC */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h index 301e71300779..e9fa252f8a3f 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -170,10 +170,8 @@ int __init auide_probe(void); | |||
170 | static int auide_dma_host_on(ide_drive_t *drive); | 170 | static int auide_dma_host_on(ide_drive_t *drive); |
171 | static int auide_dma_lostirq(ide_drive_t *drive); | 171 | static int auide_dma_lostirq(ide_drive_t *drive); |
172 | static int auide_dma_on(ide_drive_t *drive); | 172 | static int auide_dma_on(ide_drive_t *drive); |
173 | static void auide_ddma_tx_callback(int irq, void *param, | 173 | static void auide_ddma_tx_callback(int irq, void *param); |
174 | struct pt_regs *regs); | 174 | static void auide_ddma_rx_callback(int irq, void *param); |
175 | static void auide_ddma_rx_callback(int irq, void *param, | ||
176 | struct pt_regs *regs); | ||
177 | static int auide_dma_off_quietly(ide_drive_t *drive); | 175 | static int auide_dma_off_quietly(ide_drive_t *drive); |
178 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ | 176 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ |
179 | 177 | ||
diff --git a/include/asm-mips/mach-cobalt/cobalt.h b/include/asm-mips/mach-cobalt/cobalt.h index b3c5ecbec03c..00b0fc68d5cb 100644 --- a/include/asm-mips/mach-cobalt/cobalt.h +++ b/include/asm-mips/mach-cobalt/cobalt.h | |||
@@ -67,34 +67,9 @@ | |||
67 | #define COBALT_BRD_ID_QUBE2 0x5 | 67 | #define COBALT_BRD_ID_QUBE2 0x5 |
68 | #define COBALT_BRD_ID_RAQ2 0x6 | 68 | #define COBALT_BRD_ID_RAQ2 0x6 |
69 | 69 | ||
70 | /* | ||
71 | * Galileo chipset access macros for the Cobalt. The base address for | ||
72 | * the GT64111 chip is 0x14000000 | ||
73 | * | ||
74 | * Most of this really should go into a separate GT64111 header file. | ||
75 | */ | ||
76 | #define GT64111_IO_BASE 0x10000000UL | ||
77 | #define GT64111_IO_END 0x11ffffffUL | ||
78 | #define GT64111_MEM_BASE 0x12000000UL | ||
79 | #define GT64111_MEM_END 0x13ffffffUL | ||
80 | #define GT64111_BASE 0x14000000UL | ||
81 | #define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs)) | ||
82 | |||
83 | #define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) | ||
84 | #define GALILEO_OUTL(val, port) \ | ||
85 | do { \ | ||
86 | *(volatile unsigned int *) GALILEO_REG(port) = (val); \ | ||
87 | } while (0) | ||
88 | |||
89 | #define GALILEO_INTR_T0EXP (1 << 8) | ||
90 | #define GALILEO_INTR_RETRY_CTR (1 << 20) | ||
91 | |||
92 | #define GALILEO_ENTC0 0x01 | ||
93 | #define GALILEO_SELTC0 0x02 | ||
94 | |||
95 | #define PCI_CFG_SET(devfn,where) \ | 70 | #define PCI_CFG_SET(devfn,where) \ |
96 | GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ | 71 | GT_WRITE(GT_PCI0_CFGADDR_OFS, (0x80000000 | (PCI_SLOT (devfn) << 11) | \ |
97 | (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) | 72 | (PCI_FUNC (devfn) << 8) | (where))) |
98 | 73 | ||
99 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) | 74 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) |
100 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ | 75 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ |
diff --git a/include/asm-mips/mach-cobalt/mach-gt64120.h b/include/asm-mips/mach-cobalt/mach-gt64120.h index 587fc4378f44..ae9c5523c7ef 100644 --- a/include/asm-mips/mach-cobalt/mach-gt64120.h +++ b/include/asm-mips/mach-cobalt/mach-gt64120.h | |||
@@ -1 +1,27 @@ | |||
1 | /* there's something here ... in the dark */ | 1 | /* |
2 | * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | #ifndef _COBALT_MACH_GT64120_H | ||
19 | #define _COBALT_MACH_GT64120_H | ||
20 | |||
21 | /* | ||
22 | * Cobalt uses GT64111. GT64111 is almost the same as GT64120. | ||
23 | */ | ||
24 | |||
25 | #define GT64120_BASE CKSEG1ADDR(GT_DEF_BASE) | ||
26 | |||
27 | #endif /* _COBALT_MACH_GT64120_H */ | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h index f637ce70758f..3e9468f424f4 100644 --- a/include/asm-mips/mipsmtregs.h +++ b/include/asm-mips/mipsmtregs.h | |||
@@ -352,6 +352,8 @@ do { \ | |||
352 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) | 352 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) |
353 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) | 353 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) |
354 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) | 354 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) |
355 | #define read_vpe_c0_count() mftc0(9, 0) | ||
356 | #define write_vpe_c0_count(val) mttc0(9, 0, val) | ||
355 | #define read_vpe_c0_status() mftc0(12, 0) | 357 | #define read_vpe_c0_status() mftc0(12, 0) |
356 | #define write_vpe_c0_status(val) mttc0(12, 0, val) | 358 | #define write_vpe_c0_status(val) mttc0(12, 0, val) |
357 | #define read_vpe_c0_cause() mftc0(13, 0) | 359 | #define read_vpe_c0_cause() mftc0(13, 0) |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 1f318d707998..9985cb7c16e7 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -545,62 +545,6 @@ | |||
545 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) | 545 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) |
546 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) | 546 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) |
547 | 547 | ||
548 | /* | ||
549 | * R10000 performance counter definitions. | ||
550 | * | ||
551 | * FIXME: The R10000 performance counter opens a nice way to implement CPU | ||
552 | * time accounting with a precission of one cycle. I don't have | ||
553 | * R10000 silicon but just a manual, so ... | ||
554 | */ | ||
555 | |||
556 | /* | ||
557 | * Events counted by counter #0 | ||
558 | */ | ||
559 | #define CE0_CYCLES 0 | ||
560 | #define CE0_INSN_ISSUED 1 | ||
561 | #define CE0_LPSC_ISSUED 2 | ||
562 | #define CE0_S_ISSUED 3 | ||
563 | #define CE0_SC_ISSUED 4 | ||
564 | #define CE0_SC_FAILED 5 | ||
565 | #define CE0_BRANCH_DECODED 6 | ||
566 | #define CE0_QW_WB_SECONDARY 7 | ||
567 | #define CE0_CORRECTED_ECC_ERRORS 8 | ||
568 | #define CE0_ICACHE_MISSES 9 | ||
569 | #define CE0_SCACHE_I_MISSES 10 | ||
570 | #define CE0_SCACHE_I_WAY_MISSPREDICTED 11 | ||
571 | #define CE0_EXT_INTERVENTIONS_REQ 12 | ||
572 | #define CE0_EXT_INVALIDATE_REQ 13 | ||
573 | #define CE0_VIRTUAL_COHERENCY_COND 14 | ||
574 | #define CE0_INSN_GRADUATED 15 | ||
575 | |||
576 | /* | ||
577 | * Events counted by counter #1 | ||
578 | */ | ||
579 | #define CE1_CYCLES 0 | ||
580 | #define CE1_INSN_GRADUATED 1 | ||
581 | #define CE1_LPSC_GRADUATED 2 | ||
582 | #define CE1_S_GRADUATED 3 | ||
583 | #define CE1_SC_GRADUATED 4 | ||
584 | #define CE1_FP_INSN_GRADUATED 5 | ||
585 | #define CE1_QW_WB_PRIMARY 6 | ||
586 | #define CE1_TLB_REFILL 7 | ||
587 | #define CE1_BRANCH_MISSPREDICTED 8 | ||
588 | #define CE1_DCACHE_MISS 9 | ||
589 | #define CE1_SCACHE_D_MISSES 10 | ||
590 | #define CE1_SCACHE_D_WAY_MISSPREDICTED 11 | ||
591 | #define CE1_EXT_INTERVENTION_HITS 12 | ||
592 | #define CE1_EXT_INVALIDATE_REQ 13 | ||
593 | #define CE1_SP_HINT_TO_CEXCL_SC_BLOCKS 14 | ||
594 | #define CE1_SP_HINT_TO_SHARED_SC_BLOCKS 15 | ||
595 | |||
596 | /* | ||
597 | * These flags define in which privilege mode the counters count events | ||
598 | */ | ||
599 | #define CEB_USER 8 /* Count events in user mode, EXL = ERL = 0 */ | ||
600 | #define CEB_SUPERVISOR 4 /* Count events in supvervisor mode EXL = ERL = 0 */ | ||
601 | #define CEB_KERNEL 2 /* Count events in kernel mode EXL = ERL = 0 */ | ||
602 | #define CEB_EXL 1 /* Count events with EXL = 1, ERL = 0 */ | ||
603 | |||
604 | #ifndef __ASSEMBLY__ | 548 | #ifndef __ASSEMBLY__ |
605 | 549 | ||
606 | /* | 550 | /* |
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 85b258ee7090..0dc1a45c27ed 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -34,7 +34,9 @@ | |||
34 | 34 | ||
35 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
36 | 36 | ||
37 | #include <linux/pfn.h> | ||
37 | #include <asm/cpu-features.h> | 38 | #include <asm/cpu-features.h> |
39 | #include <asm/io.h> | ||
38 | 40 | ||
39 | extern void clear_page(void * page); | 41 | extern void clear_page(void * page); |
40 | extern void copy_page(void * to, void * from); | 42 | extern void copy_page(void * to, void * from); |
@@ -134,8 +136,14 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
134 | /* to align the pointer to the (next) page boundary */ | 136 | /* to align the pointer to the (next) page boundary */ |
135 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | 137 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) |
136 | 138 | ||
137 | #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) | 139 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
138 | #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) | 140 | #define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0) |
141 | #else | ||
142 | #define __pa_page_offset(x) PAGE_OFFSET | ||
143 | #endif | ||
144 | #define __pa(x) ((unsigned long)(x) - __pa_page_offset(x)) | ||
145 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0)) | ||
146 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) | ||
139 | 147 | ||
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 148 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | 149 | ||
@@ -160,8 +168,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
160 | 168 | ||
161 | #endif | 169 | #endif |
162 | 170 | ||
163 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 171 | #define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr))) |
164 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 172 | #define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr))) |
165 | 173 | ||
166 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 174 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
167 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 175 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index 582c1fe6cc4a..af121c67dc71 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
48 | 48 | ||
49 | ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); | 49 | ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); |
50 | if (ret) { | 50 | if (ret) { |
51 | init = pgd_offset(&init_mm, 0); | 51 | init = pgd_offset(&init_mm, 0UL); |
52 | pgd_init((unsigned long)ret); | 52 | pgd_init((unsigned long)ret); |
53 | memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, | 53 | memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, |
54 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); | 54 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index d05fb6f38aa7..b9b1e86493ee 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/addrspace.h> | 14 | #include <asm/addrspace.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | #include <asm/cachectl.h> | 16 | #include <asm/cachectl.h> |
17 | #include <asm/fixmap.h> | ||
17 | 18 | ||
18 | #include <asm-generic/pgtable-nopud.h> | 19 | #include <asm-generic/pgtable-nopud.h> |
19 | 20 | ||
@@ -103,6 +104,13 @@ | |||
103 | #define VMALLOC_START MAP_BASE | 104 | #define VMALLOC_START MAP_BASE |
104 | #define VMALLOC_END \ | 105 | #define VMALLOC_END \ |
105 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
107 | #if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64) && \ | ||
108 | VMALLOC_START != CKSSEG | ||
109 | /* Load modules into 32bit-compatible segment. */ | ||
110 | #define MODULE_START CKSSEG | ||
111 | #define MODULE_END (FIXADDR_START-2*PAGE_SIZE) | ||
112 | extern pgd_t module_pg_dir[PTRS_PER_PGD]; | ||
113 | #endif | ||
106 | 114 | ||
107 | #define pte_ERROR(e) \ | 115 | #define pte_ERROR(e) \ |
108 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) | 116 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) |
@@ -174,7 +182,12 @@ static inline void pud_clear(pud_t *pudp) | |||
174 | #define __pmd_offset(address) pmd_index(address) | 182 | #define __pmd_offset(address) pmd_index(address) |
175 | 183 | ||
176 | /* to find an entry in a kernel page-table-directory */ | 184 | /* to find an entry in a kernel page-table-directory */ |
177 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) | 185 | #ifdef MODULE_START |
186 | #define pgd_offset_k(address) \ | ||
187 | ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL)) | ||
188 | #else | ||
189 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0UL) | ||
190 | #endif | ||
178 | 191 | ||
179 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 192 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
180 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 193 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 1ca4d1e185c7..f2e1325fec6c 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -67,7 +67,7 @@ extern unsigned long empty_zero_page; | |||
67 | extern unsigned long zero_page_mask; | 67 | extern unsigned long zero_page_mask; |
68 | 68 | ||
69 | #define ZERO_PAGE(vaddr) \ | 69 | #define ZERO_PAGE(vaddr) \ |
70 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) | 70 | (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) |
71 | 71 | ||
72 | #define __HAVE_ARCH_MOVE_PTE | 72 | #define __HAVE_ARCH_MOVE_PTE |
73 | #define move_pte(pte, prot, old_addr, new_addr) \ | 73 | #define move_pte(pte, prot, old_addr, new_addr) \ |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 5f3a9075cd28..30bf555faeaa 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -80,8 +80,6 @@ struct pt_regs { | |||
80 | #define instruction_pointer(regs) ((regs)->cp0_epc) | 80 | #define instruction_pointer(regs) ((regs)->cp0_epc) |
81 | #define profile_pc(regs) instruction_pointer(regs) | 81 | #define profile_pc(regs) instruction_pointer(regs) |
82 | 82 | ||
83 | extern void show_regs(struct pt_regs *); | ||
84 | |||
85 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | 83 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); |
86 | 84 | ||
87 | #endif | 85 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h index b09e16c93ca0..2ba6988ddc8e 100644 --- a/include/asm-mips/sibyte/sb1250.h +++ b/include/asm-mips/sibyte/sb1250.h | |||
@@ -51,8 +51,8 @@ extern void sb1250_mask_irq(int cpu, int irq); | |||
51 | extern void sb1250_unmask_irq(int cpu, int irq); | 51 | extern void sb1250_unmask_irq(int cpu, int irq); |
52 | extern void sb1250_smp_finish(void); | 52 | extern void sb1250_smp_finish(void); |
53 | 53 | ||
54 | extern void bcm1480_hpt_setup(void); | ||
54 | extern void bcm1480_time_init(void); | 55 | extern void bcm1480_time_init(void); |
55 | extern unsigned long bcm1480_gettimeoffset(void); | ||
56 | extern void bcm1480_mask_irq(int cpu, int irq); | 56 | extern void bcm1480_mask_irq(int cpu, int irq); |
57 | extern void bcm1480_unmask_irq(int cpu, int irq); | 57 | extern void bcm1480_unmask_irq(int cpu, int irq); |
58 | extern void bcm1480_smp_finish(void); | 58 | extern void bcm1480_smp_finish(void); |
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index dcb4701d5728..3056feed5a36 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -392,7 +392,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, | |||
392 | { | 392 | { |
393 | __u64 retval; | 393 | __u64 retval; |
394 | 394 | ||
395 | if (cpu_has_llsc) { | 395 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
396 | __asm__ __volatile__( | 396 | __asm__ __volatile__( |
397 | " .set push \n" | 397 | " .set push \n" |
398 | " .set noat \n" | 398 | " .set noat \n" |
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h index 28512ba2266e..a632cef830a2 100644 --- a/include/asm-mips/time.h +++ b/include/asm-mips/time.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/clocksource.h> | ||
24 | 25 | ||
25 | extern spinlock_t rtc_lock; | 26 | extern spinlock_t rtc_lock; |
26 | 27 | ||
@@ -44,11 +45,10 @@ extern int (*mips_timer_state)(void); | |||
44 | extern void (*mips_timer_ack)(void); | 45 | extern void (*mips_timer_ack)(void); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * High precision timer functions. | 48 | * High precision timer clocksource. |
48 | * If mips_hpt_read is NULL, an R4k-compatible timer setup is attempted. | 49 | * If .read is NULL, an R4k-compatible timer setup is attempted. |
49 | */ | 50 | */ |
50 | extern unsigned int (*mips_hpt_read)(void); | 51 | extern struct clocksource clocksource_mips; |
51 | extern void (*mips_hpt_init)(unsigned int); | ||
52 | 52 | ||
53 | /* | 53 | /* |
54 | * to_tm() converts system time back to (year, mon, day, hour, min, sec). | 54 | * to_tm() converts system time back to (year, mon, day, hour, min, sec). |
@@ -58,13 +58,6 @@ extern void (*mips_hpt_init)(unsigned int); | |||
58 | extern void to_tm(unsigned long tim, struct rtc_time *tm); | 58 | extern void to_tm(unsigned long tim, struct rtc_time *tm); |
59 | 59 | ||
60 | /* | 60 | /* |
61 | * do_gettimeoffset(). By default, this func pointer points to | ||
62 | * do_null_gettimeoffset(), which leads to the same resolution as HZ. | ||
63 | * Higher resolution versions are available, which give ~1us resolution. | ||
64 | */ | ||
65 | extern unsigned long (*do_gettimeoffset)(void); | ||
66 | |||
67 | /* | ||
68 | * high-level timer interrupt routines. | 61 | * high-level timer interrupt routines. |
69 | */ | 62 | */ |
70 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); | 63 | extern irqreturn_t timer_interrupt(int irq, void *dev_id); |
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 685c91467e63..ec56aa52f669 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -331,16 +331,19 @@ | |||
331 | #define __NR_move_pages (__NR_Linux + 308) | 331 | #define __NR_move_pages (__NR_Linux + 308) |
332 | #define __NR_set_robust_list (__NR_Linux + 309) | 332 | #define __NR_set_robust_list (__NR_Linux + 309) |
333 | #define __NR_get_robust_list (__NR_Linux + 310) | 333 | #define __NR_get_robust_list (__NR_Linux + 310) |
334 | #define __NR_kexec_load (__NR_Linux + 311) | ||
335 | #define __NR_getcpu (__NR_Linux + 312) | ||
336 | #define __NR_epoll_pwait (__NR_Linux + 313) | ||
334 | 337 | ||
335 | /* | 338 | /* |
336 | * Offset of the last Linux o32 flavoured syscall | 339 | * Offset of the last Linux o32 flavoured syscall |
337 | */ | 340 | */ |
338 | #define __NR_Linux_syscalls 310 | 341 | #define __NR_Linux_syscalls 313 |
339 | 342 | ||
340 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 343 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
341 | 344 | ||
342 | #define __NR_O32_Linux 4000 | 345 | #define __NR_O32_Linux 4000 |
343 | #define __NR_O32_Linux_syscalls 310 | 346 | #define __NR_O32_Linux_syscalls 313 |
344 | 347 | ||
345 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 348 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
346 | 349 | ||
@@ -618,16 +621,19 @@ | |||
618 | #define __NR_move_pages (__NR_Linux + 267) | 621 | #define __NR_move_pages (__NR_Linux + 267) |
619 | #define __NR_set_robust_list (__NR_Linux + 268) | 622 | #define __NR_set_robust_list (__NR_Linux + 268) |
620 | #define __NR_get_robust_list (__NR_Linux + 269) | 623 | #define __NR_get_robust_list (__NR_Linux + 269) |
624 | #define __NR_kexec_load (__NR_Linux + 270) | ||
625 | #define __NR_getcpu (__NR_Linux + 271) | ||
626 | #define __NR_epoll_pwait (__NR_Linux + 272) | ||
621 | 627 | ||
622 | /* | 628 | /* |
623 | * Offset of the last Linux 64-bit flavoured syscall | 629 | * Offset of the last Linux 64-bit flavoured syscall |
624 | */ | 630 | */ |
625 | #define __NR_Linux_syscalls 269 | 631 | #define __NR_Linux_syscalls 272 |
626 | 632 | ||
627 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 633 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
628 | 634 | ||
629 | #define __NR_64_Linux 5000 | 635 | #define __NR_64_Linux 5000 |
630 | #define __NR_64_Linux_syscalls 269 | 636 | #define __NR_64_Linux_syscalls 272 |
631 | 637 | ||
632 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 638 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
633 | 639 | ||
@@ -909,16 +915,19 @@ | |||
909 | #define __NR_move_pages (__NR_Linux + 271) | 915 | #define __NR_move_pages (__NR_Linux + 271) |
910 | #define __NR_set_robust_list (__NR_Linux + 272) | 916 | #define __NR_set_robust_list (__NR_Linux + 272) |
911 | #define __NR_get_robust_list (__NR_Linux + 273) | 917 | #define __NR_get_robust_list (__NR_Linux + 273) |
918 | #define __NR_kexec_load (__NR_Linux + 274) | ||
919 | #define __NR_getcpu (__NR_Linux + 275) | ||
920 | #define __NR_epoll_pwait (__NR_Linux + 276) | ||
912 | 921 | ||
913 | /* | 922 | /* |
914 | * Offset of the last N32 flavoured syscall | 923 | * Offset of the last N32 flavoured syscall |
915 | */ | 924 | */ |
916 | #define __NR_Linux_syscalls 273 | 925 | #define __NR_Linux_syscalls 276 |
917 | 926 | ||
918 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 927 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
919 | 928 | ||
920 | #define __NR_N32_Linux 6000 | 929 | #define __NR_N32_Linux 6000 |
921 | #define __NR_N32_Linux_syscalls 273 | 930 | #define __NR_N32_Linux_syscalls 276 |
922 | 931 | ||
923 | #ifdef __KERNEL__ | 932 | #ifdef __KERNEL__ |
924 | 933 | ||
@@ -1186,6 +1195,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ | |||
1186 | #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ | 1195 | #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ |
1187 | 1196 | ||
1188 | 1197 | ||
1198 | #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 | ||
1189 | #define __ARCH_WANT_IPC_PARSE_VERSION | 1199 | #define __ARCH_WANT_IPC_PARSE_VERSION |
1190 | #define __ARCH_WANT_OLD_READDIR | 1200 | #define __ARCH_WANT_OLD_READDIR |
1191 | #define __ARCH_WANT_SYS_ALARM | 1201 | #define __ARCH_WANT_SYS_ALARM |
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index dd3eb3dc5886..88b492f6ea9c 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h | |||
@@ -75,7 +75,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); | |||
75 | * Interrupt Control Unit | 75 | * Interrupt Control Unit |
76 | */ | 76 | */ |
77 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); | 77 | extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); |
78 | extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); | 78 | extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)); |
79 | 79 | ||
80 | #define PIUINT_COMMAND 0x0040 | 80 | #define PIUINT_COMMAND 0x0040 |
81 | #define PIUINT_DATA 0x0020 | 81 | #define PIUINT_DATA 0x0020 |
diff --git a/include/asm-parisc/checksum.h b/include/asm-parisc/checksum.h index 229cb56fdb7a..cc3ec1bd8919 100644 --- a/include/asm-parisc/checksum.h +++ b/include/asm-parisc/checksum.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * | 15 | * |
16 | * it's best to have buff aligned on a 32-bit boundary | 16 | * it's best to have buff aligned on a 32-bit boundary |
17 | */ | 17 | */ |
18 | extern unsigned int csum_partial(const unsigned char *, int, unsigned int); | 18 | extern __wsum csum_partial(const void *, int, __wsum); |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * The same as csum_partial, but copies from src while it checksums. | 21 | * The same as csum_partial, but copies from src while it checksums. |
@@ -23,15 +23,14 @@ extern unsigned int csum_partial(const unsigned char *, int, unsigned int); | |||
23 | * Here even more important to align src and dst on a 32-bit (or even | 23 | * Here even more important to align src and dst on a 32-bit (or even |
24 | * better 64-bit) boundary | 24 | * better 64-bit) boundary |
25 | */ | 25 | */ |
26 | extern unsigned int csum_partial_copy_nocheck(const unsigned char *, unsigned char *, | 26 | extern __wsum csum_partial_copy_nocheck(const void *, void *, int, __wsum); |
27 | int, unsigned int); | ||
28 | 27 | ||
29 | /* | 28 | /* |
30 | * this is a new version of the above that records errors it finds in *errp, | 29 | * this is a new version of the above that records errors it finds in *errp, |
31 | * but continues and zeros the rest of the buffer. | 30 | * but continues and zeros the rest of the buffer. |
32 | */ | 31 | */ |
33 | extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | 32 | extern __wsum csum_partial_copy_from_user(const void __user *src, |
34 | unsigned char *dst, int len, unsigned int sum, int *errp); | 33 | void *dst, int len, __wsum sum, int *errp); |
35 | 34 | ||
36 | /* | 35 | /* |
37 | * Optimized for IP headers, which always checksum on 4 octet boundaries. | 36 | * Optimized for IP headers, which always checksum on 4 octet boundaries. |
@@ -39,11 +38,10 @@ extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, | |||
39 | * Written by Randolph Chung <tausq@debian.org>, and then mucked with by | 38 | * Written by Randolph Chung <tausq@debian.org>, and then mucked with by |
40 | * LaMont Jones <lamont@debian.org> | 39 | * LaMont Jones <lamont@debian.org> |
41 | */ | 40 | */ |
42 | static inline unsigned short ip_fast_csum(unsigned char * iph, | 41 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
43 | unsigned int ihl) { | 42 | { |
44 | unsigned int sum; | 43 | unsigned int sum; |
45 | 44 | ||
46 | |||
47 | __asm__ __volatile__ ( | 45 | __asm__ __volatile__ ( |
48 | " ldws,ma 4(%1), %0\n" | 46 | " ldws,ma 4(%1), %0\n" |
49 | " addib,<= -4, %2, 2f\n" | 47 | " addib,<= -4, %2, 2f\n" |
@@ -69,27 +67,27 @@ static inline unsigned short ip_fast_csum(unsigned char * iph, | |||
69 | : "1" (iph), "2" (ihl) | 67 | : "1" (iph), "2" (ihl) |
70 | : "r19", "r20", "r21" ); | 68 | : "r19", "r20", "r21" ); |
71 | 69 | ||
72 | return(sum); | 70 | return (__force __sum16)sum; |
73 | } | 71 | } |
74 | 72 | ||
75 | /* | 73 | /* |
76 | * Fold a partial checksum | 74 | * Fold a partial checksum |
77 | */ | 75 | */ |
78 | static inline unsigned int csum_fold(unsigned int sum) | 76 | static inline __sum16 csum_fold(__wsum csum) |
79 | { | 77 | { |
78 | u32 sum = (__force u32)csum; | ||
80 | /* add the swapped two 16-bit halves of sum, | 79 | /* add the swapped two 16-bit halves of sum, |
81 | a possible carry from adding the two 16-bit halves, | 80 | a possible carry from adding the two 16-bit halves, |
82 | will carry from the lower half into the upper half, | 81 | will carry from the lower half into the upper half, |
83 | giving us the correct sum in the upper half. */ | 82 | giving us the correct sum in the upper half. */ |
84 | sum += (sum << 16) + (sum >> 16); | 83 | sum += (sum << 16) + (sum >> 16); |
85 | return (~sum) >> 16; | 84 | return (__force __sum16)(~sum >> 16); |
86 | } | 85 | } |
87 | 86 | ||
88 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 87 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
89 | unsigned long daddr, | ||
90 | unsigned short len, | 88 | unsigned short len, |
91 | unsigned short proto, | 89 | unsigned short proto, |
92 | unsigned int sum) | 90 | __wsum sum) |
93 | { | 91 | { |
94 | __asm__( | 92 | __asm__( |
95 | " add %1, %0, %0\n" | 93 | " add %1, %0, %0\n" |
@@ -97,19 +95,18 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
97 | " addc %3, %0, %0\n" | 95 | " addc %3, %0, %0\n" |
98 | " addc %%r0, %0, %0\n" | 96 | " addc %%r0, %0, %0\n" |
99 | : "=r" (sum) | 97 | : "=r" (sum) |
100 | : "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum)); | 98 | : "r" (daddr), "r"(saddr), "r"(proto+len), "0"(sum)); |
101 | return sum; | 99 | return sum; |
102 | } | 100 | } |
103 | 101 | ||
104 | /* | 102 | /* |
105 | * computes the checksum of the TCP/UDP pseudo-header | 103 | * computes the checksum of the TCP/UDP pseudo-header |
106 | * returns a 16-bit checksum, already complemented | 104 | * returns a 16-bit checksum, already complemented |
107 | */ | 105 | */ |
108 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 106 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
109 | unsigned long daddr, | ||
110 | unsigned short len, | 107 | unsigned short len, |
111 | unsigned short proto, | 108 | unsigned short proto, |
112 | unsigned int sum) | 109 | __wsum sum) |
113 | { | 110 | { |
114 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 111 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
115 | } | 112 | } |
@@ -118,17 +115,17 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
118 | * this routine is used for miscellaneous IP-like checksums, mainly | 115 | * this routine is used for miscellaneous IP-like checksums, mainly |
119 | * in icmp.c | 116 | * in icmp.c |
120 | */ | 117 | */ |
121 | static inline unsigned short ip_compute_csum(unsigned char * buf, int len) { | 118 | static inline __sum16 ip_compute_csum(const void *buf, int len) |
119 | { | ||
122 | return csum_fold (csum_partial(buf, len, 0)); | 120 | return csum_fold (csum_partial(buf, len, 0)); |
123 | } | 121 | } |
124 | 122 | ||
125 | 123 | ||
126 | #define _HAVE_ARCH_IPV6_CSUM | 124 | #define _HAVE_ARCH_IPV6_CSUM |
127 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 125 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
128 | struct in6_addr *daddr, | 126 | const struct in6_addr *daddr, |
129 | __u16 len, | 127 | __u32 len, unsigned short proto, |
130 | unsigned short proto, | 128 | __wsum sum) |
131 | unsigned int sum) | ||
132 | { | 129 | { |
133 | __asm__ __volatile__ ( | 130 | __asm__ __volatile__ ( |
134 | 131 | ||
@@ -193,9 +190,9 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
193 | * Copy and checksum to user | 190 | * Copy and checksum to user |
194 | */ | 191 | */ |
195 | #define HAVE_CSUM_COPY_USER | 192 | #define HAVE_CSUM_COPY_USER |
196 | static __inline__ unsigned int csum_and_copy_to_user (const unsigned char *src, | 193 | static __inline__ __wsum csum_and_copy_to_user(const void *src, |
197 | unsigned char __user *dst, | 194 | void __user *dst, |
198 | int len, int sum, | 195 | int len, __wsum sum, |
199 | int *err_ptr) | 196 | int *err_ptr) |
200 | { | 197 | { |
201 | /* code stolen from include/asm-mips64 */ | 198 | /* code stolen from include/asm-mips64 */ |
@@ -203,7 +200,7 @@ static __inline__ unsigned int csum_and_copy_to_user (const unsigned char *src, | |||
203 | 200 | ||
204 | if (copy_to_user(dst, src, len)) { | 201 | if (copy_to_user(dst, src, len)) { |
205 | *err_ptr = -EFAULT; | 202 | *err_ptr = -EFAULT; |
206 | return -1; | 203 | return (__force __wsum)-1; |
207 | } | 204 | } |
208 | 205 | ||
209 | return sum; | 206 | return sum; |
diff --git a/include/asm-parisc/device.h b/include/asm-parisc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-parisc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-parisc/dma.h b/include/asm-parisc/dma.h index da2cf373e31c..31ad0f05af3d 100644 --- a/include/asm-parisc/dma.h +++ b/include/asm-parisc/dma.h | |||
@@ -17,10 +17,10 @@ | |||
17 | 17 | ||
18 | /* | 18 | /* |
19 | ** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up | 19 | ** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up |
20 | ** (or rather not merge) DMA's into managable chunks. | 20 | ** (or rather not merge) DMAs into manageable chunks. |
21 | ** On parisc, this is more of the software/tuning constraint | 21 | ** On parisc, this is more of the software/tuning constraint |
22 | ** rather than the HW. I/O MMU allocation alogorithms can be | 22 | ** rather than the HW. I/O MMU allocation algorithms can be |
23 | ** faster with smaller size is (to some degree). | 23 | ** faster with smaller sizes (to some degree). |
24 | */ | 24 | */ |
25 | #define DMA_CHUNK_SIZE (BITS_PER_LONG*PAGE_SIZE) | 25 | #define DMA_CHUNK_SIZE (BITS_PER_LONG*PAGE_SIZE) |
26 | 26 | ||
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index 7b8ad118d2fe..7b3be9ac0dda 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -149,7 +149,7 @@ extern int parisc_bus_is_phys; /* in arch/parisc/kernel/setup.c */ | |||
149 | /* | 149 | /* |
150 | ** Most PCI devices (eg Tulip, NCR720) also export the same registers | 150 | ** Most PCI devices (eg Tulip, NCR720) also export the same registers |
151 | ** to both MMIO and I/O port space. Due to poor performance of I/O Port | 151 | ** to both MMIO and I/O port space. Due to poor performance of I/O Port |
152 | ** access under HP PCI bus adapters, strongly reccomend use of MMIO | 152 | ** access under HP PCI bus adapters, strongly recommend the use of MMIO |
153 | ** address space. | 153 | ** address space. |
154 | ** | 154 | ** |
155 | ** While I'm at it more PA programming notes: | 155 | ** While I'm at it more PA programming notes: |
diff --git a/include/asm-parisc/ropes.h b/include/asm-parisc/ropes.h index 5542dd00472b..007a880615eb 100644 --- a/include/asm-parisc/ropes.h +++ b/include/asm-parisc/ropes.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | /* | 16 | /* |
17 | ** The number of pdir entries to "free" before issueing | 17 | ** The number of pdir entries to "free" before issuing |
18 | ** a read to PCOM register to flush out PCOM writes. | 18 | ** a read to PCOM register to flush out PCOM writes. |
19 | ** Interacts with allocation granularity (ie 4 or 8 entries | 19 | ** Interacts with allocation granularity (ie 4 or 8 entries |
20 | ** allocated and free'd/purged at a time might make this | 20 | ** allocated and free'd/purged at a time might make this |
diff --git a/include/asm-parisc/semaphore.h b/include/asm-parisc/semaphore.h index c9ee41cd0707..d45827a21f94 100644 --- a/include/asm-parisc/semaphore.h +++ b/include/asm-parisc/semaphore.h | |||
@@ -115,7 +115,8 @@ extern __inline__ int down_interruptible(struct semaphore * sem) | |||
115 | */ | 115 | */ |
116 | extern __inline__ int down_trylock(struct semaphore * sem) | 116 | extern __inline__ int down_trylock(struct semaphore * sem) |
117 | { | 117 | { |
118 | int flags, count; | 118 | unsigned long flags; |
119 | int count; | ||
119 | 120 | ||
120 | spin_lock_irqsave(&sem->sentry, flags); | 121 | spin_lock_irqsave(&sem->sentry, flags); |
121 | count = sem->count - 1; | 122 | count = sem->count - 1; |
@@ -131,7 +132,8 @@ extern __inline__ int down_trylock(struct semaphore * sem) | |||
131 | */ | 132 | */ |
132 | extern __inline__ void up(struct semaphore * sem) | 133 | extern __inline__ void up(struct semaphore * sem) |
133 | { | 134 | { |
134 | int flags; | 135 | unsigned long flags; |
136 | |||
135 | spin_lock_irqsave(&sem->sentry, flags); | 137 | spin_lock_irqsave(&sem->sentry, flags); |
136 | if (sem->count < 0) { | 138 | if (sem->count < 0) { |
137 | __up(sem); | 139 | __up(sem); |
diff --git a/include/asm-powerpc/asm-compat.h b/include/asm-powerpc/asm-compat.h index 8e64be0cc47d..c89bd58ee283 100644 --- a/include/asm-powerpc/asm-compat.h +++ b/include/asm-powerpc/asm-compat.h | |||
@@ -14,6 +14,58 @@ | |||
14 | # define ASM_CONST(x) __ASM_CONST(x) | 14 | # define ASM_CONST(x) __ASM_CONST(x) |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | |||
18 | /* | ||
19 | * Feature section common macros | ||
20 | * | ||
21 | * Note that the entries now contain offsets between the table entry | ||
22 | * and the code rather than absolute code pointers in order to be | ||
23 | * useable with the vdso shared library. There is also an assumption | ||
24 | * that values will be negative, that is, the fixup table has to be | ||
25 | * located after the code it fixes up. | ||
26 | */ | ||
27 | #ifdef CONFIG_PPC64 | ||
28 | #ifdef __powerpc64__ | ||
29 | /* 64 bits kernel, 64 bits code */ | ||
30 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | ||
31 | 99: \ | ||
32 | .section sect,"a"; \ | ||
33 | .align 3; \ | ||
34 | 98: \ | ||
35 | .llong msk; \ | ||
36 | .llong val; \ | ||
37 | .llong label##b-98b; \ | ||
38 | .llong 99b-98b; \ | ||
39 | .previous | ||
40 | #else /* __powerpc64__ */ | ||
41 | /* 64 bits kernel, 32 bits code (ie. vdso32) */ | ||
42 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | ||
43 | 99: \ | ||
44 | .section sect,"a"; \ | ||
45 | .align 3; \ | ||
46 | 98: \ | ||
47 | .llong msk; \ | ||
48 | .llong val; \ | ||
49 | .long 0xffffffff; \ | ||
50 | .long label##b-98b; \ | ||
51 | .long 0xffffffff; \ | ||
52 | .long 99b-98b; \ | ||
53 | .previous | ||
54 | #endif /* !__powerpc64__ */ | ||
55 | #else /* CONFIG_PPC64 */ | ||
56 | /* 32 bits kernel, 32 bits code */ | ||
57 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | ||
58 | 99: \ | ||
59 | .section sect,"a"; \ | ||
60 | .align 2; \ | ||
61 | 98: \ | ||
62 | .long msk; \ | ||
63 | .long val; \ | ||
64 | .long label##b-98b; \ | ||
65 | .long 99b-98b; \ | ||
66 | .previous | ||
67 | #endif /* !CONFIG_PPC64 */ | ||
68 | |||
17 | #ifdef __powerpc64__ | 69 | #ifdef __powerpc64__ |
18 | 70 | ||
19 | /* operations for longs and pointers */ | 71 | /* operations for longs and pointers */ |
diff --git a/include/asm-powerpc/checksum.h b/include/asm-powerpc/checksum.h index 609ecbbd7210..7cdf358337cf 100644 --- a/include/asm-powerpc/checksum.h +++ b/include/asm-powerpc/checksum.h | |||
@@ -14,17 +14,16 @@ | |||
14 | * which always checksum on 4 octet boundaries. ihl is the number | 14 | * which always checksum on 4 octet boundaries. ihl is the number |
15 | * of 32-bit words and is always >= 5. | 15 | * of 32-bit words and is always >= 5. |
16 | */ | 16 | */ |
17 | extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl); | 17 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * computes the checksum of the TCP/UDP pseudo-header | 20 | * computes the checksum of the TCP/UDP pseudo-header |
21 | * returns a 16-bit checksum, already complemented | 21 | * returns a 16-bit checksum, already complemented |
22 | */ | 22 | */ |
23 | extern unsigned short csum_tcpudp_magic(unsigned long saddr, | 23 | extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
24 | unsigned long daddr, | ||
25 | unsigned short len, | 24 | unsigned short len, |
26 | unsigned short proto, | 25 | unsigned short proto, |
27 | unsigned int sum); | 26 | __wsum sum); |
28 | 27 | ||
29 | /* | 28 | /* |
30 | * computes the checksum of a memory block at buff, length len, | 29 | * computes the checksum of a memory block at buff, length len, |
@@ -38,8 +37,7 @@ extern unsigned short csum_tcpudp_magic(unsigned long saddr, | |||
38 | * | 37 | * |
39 | * it's best to have buff aligned on a 32-bit boundary | 38 | * it's best to have buff aligned on a 32-bit boundary |
40 | */ | 39 | */ |
41 | extern unsigned int csum_partial(const unsigned char * buff, int len, | 40 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
42 | unsigned int sum); | ||
43 | 41 | ||
44 | /* | 42 | /* |
45 | * Computes the checksum of a memory block at src, length len, | 43 | * Computes the checksum of a memory block at src, length len, |
@@ -51,20 +49,15 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, | |||
51 | * Like csum_partial, this must be called with even lengths, | 49 | * Like csum_partial, this must be called with even lengths, |
52 | * except for the last fragment. | 50 | * except for the last fragment. |
53 | */ | 51 | */ |
54 | extern unsigned int csum_partial_copy_generic(const char *src, char *dst, | 52 | extern __wsum csum_partial_copy_generic(const void *src, void *dst, |
55 | int len, unsigned int sum, | 53 | int len, __wsum sum, |
56 | int *src_err, int *dst_err); | 54 | int *src_err, int *dst_err); |
57 | /* | 55 | /* |
58 | * the same as csum_partial, but copies from src to dst while it | 56 | * the same as csum_partial, but copies from src to dst while it |
59 | * checksums. | 57 | * checksums. |
60 | */ | 58 | */ |
61 | unsigned int csum_partial_copy_nocheck(const char *src, | ||
62 | char *dst, | ||
63 | int len, | ||
64 | unsigned int sum); | ||
65 | |||
66 | #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ | 59 | #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ |
67 | csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL) | 60 | csum_partial_copy_generic((__force const void *)(src), (dst), (len), (sum), (errp), NULL) |
68 | 61 | ||
69 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 62 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ |
70 | csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL) | 63 | csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL) |
@@ -74,7 +67,7 @@ unsigned int csum_partial_copy_nocheck(const char *src, | |||
74 | * turns a 32-bit partial checksum (e.g. from csum_partial) into a | 67 | * turns a 32-bit partial checksum (e.g. from csum_partial) into a |
75 | * 1's complement 16-bit checksum. | 68 | * 1's complement 16-bit checksum. |
76 | */ | 69 | */ |
77 | static inline unsigned int csum_fold(unsigned int sum) | 70 | static inline __sum16 csum_fold(__wsum sum) |
78 | { | 71 | { |
79 | unsigned int tmp; | 72 | unsigned int tmp; |
80 | 73 | ||
@@ -83,41 +76,32 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
83 | /* if there is a carry from adding the two 16-bit halves, | 76 | /* if there is a carry from adding the two 16-bit halves, |
84 | it will carry from the lower half into the upper half, | 77 | it will carry from the lower half into the upper half, |
85 | giving us the correct sum in the upper half. */ | 78 | giving us the correct sum in the upper half. */ |
86 | sum = ~(sum + tmp) >> 16; | 79 | return (__force __sum16)(~((__force u32)sum + tmp) >> 16); |
87 | return sum; | ||
88 | } | 80 | } |
89 | 81 | ||
90 | /* | 82 | /* |
91 | * this routine is used for miscellaneous IP-like checksums, mainly | 83 | * this routine is used for miscellaneous IP-like checksums, mainly |
92 | * in icmp.c | 84 | * in icmp.c |
93 | */ | 85 | */ |
94 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 86 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
95 | { | 87 | { |
96 | return csum_fold(csum_partial(buff, len, 0)); | 88 | return csum_fold(csum_partial(buff, len, 0)); |
97 | } | 89 | } |
98 | 90 | ||
99 | #ifdef __powerpc64__ | 91 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
100 | static inline u32 csum_tcpudp_nofold(u32 saddr, | ||
101 | u32 daddr, | ||
102 | unsigned short len, | 92 | unsigned short len, |
103 | unsigned short proto, | 93 | unsigned short proto, |
104 | unsigned int sum) | 94 | __wsum sum) |
105 | { | 95 | { |
106 | unsigned long s = sum; | 96 | #ifdef __powerpc64__ |
97 | unsigned long s = (__force u32)sum; | ||
107 | 98 | ||
108 | s += saddr; | 99 | s += (__force u32)saddr; |
109 | s += daddr; | 100 | s += (__force u32)daddr; |
110 | s += (proto << 16) + len; | 101 | s += proto + len; |
111 | s += (s >> 32); | 102 | s += (s >> 32); |
112 | return (u32) s; | 103 | return (__force __wsum) s; |
113 | } | ||
114 | #else | 104 | #else |
115 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | ||
116 | unsigned long daddr, | ||
117 | unsigned short len, | ||
118 | unsigned short proto, | ||
119 | unsigned int sum) | ||
120 | { | ||
121 | __asm__("\n\ | 105 | __asm__("\n\ |
122 | addc %0,%0,%1 \n\ | 106 | addc %0,%0,%1 \n\ |
123 | adde %0,%0,%2 \n\ | 107 | adde %0,%0,%2 \n\ |
@@ -125,10 +109,9 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
125 | addze %0,%0 \n\ | 109 | addze %0,%0 \n\ |
126 | " | 110 | " |
127 | : "=r" (sum) | 111 | : "=r" (sum) |
128 | : "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum)); | 112 | : "r" (daddr), "r"(saddr), "r"(proto + len), "0"(sum)); |
129 | return sum; | 113 | return sum; |
130 | } | ||
131 | |||
132 | #endif | 114 | #endif |
115 | } | ||
133 | #endif /* __KERNEL__ */ | 116 | #endif /* __KERNEL__ */ |
134 | #endif | 117 | #endif |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 12707ab9dc98..a9a40149a7c0 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -89,8 +89,11 @@ struct cpu_spec { | |||
89 | 89 | ||
90 | extern struct cpu_spec *cur_cpu_spec; | 90 | extern struct cpu_spec *cur_cpu_spec; |
91 | 91 | ||
92 | extern void identify_cpu(unsigned long offset, unsigned long cpu); | 92 | extern unsigned int __start___ftr_fixup, __stop___ftr_fixup; |
93 | extern void do_cpu_ftr_fixups(unsigned long offset); | 93 | |
94 | extern struct cpu_spec *identify_cpu(unsigned long offset); | ||
95 | extern void do_feature_fixups(unsigned long value, void *fixup_start, | ||
96 | void *fixup_end); | ||
94 | 97 | ||
95 | #endif /* __ASSEMBLY__ */ | 98 | #endif /* __ASSEMBLY__ */ |
96 | 99 | ||
@@ -144,6 +147,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
144 | #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) | 147 | #define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) |
145 | #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) | 148 | #define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) |
146 | #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) | 149 | #define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) |
150 | #define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) | ||
147 | 151 | ||
148 | #ifndef __ASSEMBLY__ | 152 | #ifndef __ASSEMBLY__ |
149 | 153 | ||
@@ -332,7 +336,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
332 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 336 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
333 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 337 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
334 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 338 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
335 | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE) | 339 | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG) |
336 | #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 340 | #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
337 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 341 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
338 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ | 342 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ |
@@ -431,29 +435,12 @@ static inline int cpu_has_feature(unsigned long feature) | |||
431 | 435 | ||
432 | #ifdef __ASSEMBLY__ | 436 | #ifdef __ASSEMBLY__ |
433 | 437 | ||
434 | #define BEGIN_FTR_SECTION 98: | 438 | #define BEGIN_FTR_SECTION_NESTED(label) label: |
435 | 439 | #define BEGIN_FTR_SECTION BEGIN_FTR_SECTION_NESTED(97) | |
436 | #ifndef __powerpc64__ | 440 | #define END_FTR_SECTION_NESTED(msk, val, label) \ |
441 | MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup) | ||
437 | #define END_FTR_SECTION(msk, val) \ | 442 | #define END_FTR_SECTION(msk, val) \ |
438 | 99: \ | 443 | END_FTR_SECTION_NESTED(msk, val, 97) |
439 | .section __ftr_fixup,"a"; \ | ||
440 | .align 2; \ | ||
441 | .long msk; \ | ||
442 | .long val; \ | ||
443 | .long 98b; \ | ||
444 | .long 99b; \ | ||
445 | .previous | ||
446 | #else /* __powerpc64__ */ | ||
447 | #define END_FTR_SECTION(msk, val) \ | ||
448 | 99: \ | ||
449 | .section __ftr_fixup,"a"; \ | ||
450 | .align 3; \ | ||
451 | .llong msk; \ | ||
452 | .llong val; \ | ||
453 | .llong 98b; \ | ||
454 | .llong 99b; \ | ||
455 | .previous | ||
456 | #endif /* __powerpc64__ */ | ||
457 | 444 | ||
458 | #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) | 445 | #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) |
459 | #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) | 446 | #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) |
diff --git a/include/asm-powerpc/current.h b/include/asm-powerpc/current.h index 1938d6abd255..b8708aedf925 100644 --- a/include/asm-powerpc/current.h +++ b/include/asm-powerpc/current.h | |||
@@ -14,7 +14,17 @@ struct task_struct; | |||
14 | #ifdef __powerpc64__ | 14 | #ifdef __powerpc64__ |
15 | #include <asm/paca.h> | 15 | #include <asm/paca.h> |
16 | 16 | ||
17 | #define current (get_paca()->__current) | 17 | static inline struct task_struct *get_current(void) |
18 | { | ||
19 | struct task_struct *task; | ||
20 | |||
21 | __asm__ __volatile__("ld %0,%1(13)" | ||
22 | : "=r" (task) | ||
23 | : "i" (offsetof(struct paca_struct, __current))); | ||
24 | |||
25 | return task; | ||
26 | } | ||
27 | #define current get_current() | ||
18 | 28 | ||
19 | #else | 29 | #else |
20 | 30 | ||
diff --git a/include/asm-powerpc/device.h b/include/asm-powerpc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-powerpc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h index 1022737f4f34..fdf9aff71150 100644 --- a/include/asm-powerpc/firmware.h +++ b/include/asm-powerpc/firmware.h | |||
@@ -96,19 +96,16 @@ extern void machine_check_fwnmi(void); | |||
96 | /* This is true if we are using the firmware NMI handler (typically LPAR) */ | 96 | /* This is true if we are using the firmware NMI handler (typically LPAR) */ |
97 | extern int fwnmi_active; | 97 | extern int fwnmi_active; |
98 | 98 | ||
99 | #else /* __ASSEMBLY__ */ | 99 | extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup; |
100 | 100 | ||
101 | #define BEGIN_FW_FTR_SECTION 96: | 101 | #else /* __ASSEMBLY__ */ |
102 | 102 | ||
103 | #define BEGIN_FW_FTR_SECTION_NESTED(label) label: | ||
104 | #define BEGIN_FW_FTR_SECTION BEGIN_FW_FTR_SECTION_NESTED(97) | ||
105 | #define END_FW_FTR_SECTION_NESTED(msk, val, label) \ | ||
106 | MAKE_FTR_SECTION_ENTRY(msk, val, label, __fw_ftr_fixup) | ||
103 | #define END_FW_FTR_SECTION(msk, val) \ | 107 | #define END_FW_FTR_SECTION(msk, val) \ |
104 | 97: \ | 108 | END_FW_FTR_SECTION_NESTED(msk, val, 97) |
105 | .section __fw_ftr_fixup,"a"; \ | ||
106 | .align 3; \ | ||
107 | .llong msk; \ | ||
108 | .llong val; \ | ||
109 | .llong 96b; \ | ||
110 | .llong 97b; \ | ||
111 | .previous | ||
112 | 109 | ||
113 | #define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk)) | 110 | #define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk)) |
114 | #define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0) | 111 | #define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0) |
diff --git a/include/asm-powerpc/i8259.h b/include/asm-powerpc/i8259.h index 78489fb8d140..db1362f8c603 100644 --- a/include/asm-powerpc/i8259.h +++ b/include/asm-powerpc/i8259.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #ifdef CONFIG_PPC_MERGE | 7 | #ifdef CONFIG_PPC_MERGE |
8 | extern void i8259_init(struct device_node *node, unsigned long intack_addr); | 8 | extern void i8259_init(struct device_node *node, unsigned long intack_addr); |
9 | extern unsigned int i8259_irq(void); | 9 | extern unsigned int i8259_irq(void); |
10 | extern struct irq_host *i8259_get_host(void); | ||
10 | #else | 11 | #else |
11 | extern void i8259_init(unsigned long intack_addr, int offset); | 12 | extern void i8259_init(unsigned long intack_addr, int offset); |
12 | extern int i8259_irq(void); | 13 | extern int i8259_irq(void); |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 3baff8b0fd5a..c2c5f14b5f5f 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -163,8 +163,11 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count); | |||
163 | 163 | ||
164 | static inline void mmiowb(void) | 164 | static inline void mmiowb(void) |
165 | { | 165 | { |
166 | __asm__ __volatile__ ("sync" : : : "memory"); | 166 | unsigned long tmp; |
167 | get_paca()->io_sync = 0; | 167 | |
168 | __asm__ __volatile__("sync; li %0,0; stb %0,%1(13)" | ||
169 | : "=&r" (tmp) : "i" (offsetof(struct paca_struct, io_sync)) | ||
170 | : "memory"); | ||
168 | } | 171 | } |
169 | 172 | ||
170 | /* | 173 | /* |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index 264ed6242771..19e6f7e0a607 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -22,17 +22,35 @@ | |||
22 | #define _ASM_IOMMU_H | 22 | #define _ASM_IOMMU_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | #include <asm/types.h> | 25 | #include <linux/compiler.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/dma-mapping.h> | 28 | #include <linux/dma-mapping.h> |
29 | #include <asm/types.h> | ||
30 | #include <asm/bitops.h> | ||
31 | |||
32 | #define IOMMU_PAGE_SHIFT 12 | ||
33 | #define IOMMU_PAGE_SIZE (ASM_CONST(1) << IOMMU_PAGE_SHIFT) | ||
34 | #define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) | ||
35 | #define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) | ||
36 | |||
37 | #ifndef __ASSEMBLY__ | ||
38 | |||
39 | /* Pure 2^n version of get_order */ | ||
40 | static __inline__ __attribute_const__ int get_iommu_order(unsigned long size) | ||
41 | { | ||
42 | return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1; | ||
43 | } | ||
44 | |||
45 | #endif /* __ASSEMBLY__ */ | ||
46 | |||
29 | 47 | ||
30 | /* | 48 | /* |
31 | * IOMAP_MAX_ORDER defines the largest contiguous block | 49 | * IOMAP_MAX_ORDER defines the largest contiguous block |
32 | * of dma space we can get. IOMAP_MAX_ORDER = 13 | 50 | * of dma space we can get. IOMAP_MAX_ORDER = 13 |
33 | * allows up to 2**12 pages (4096 * 4096) = 16 MB | 51 | * allows up to 2**12 pages (4096 * 4096) = 16 MB |
34 | */ | 52 | */ |
35 | #define IOMAP_MAX_ORDER 13 | 53 | #define IOMAP_MAX_ORDER 13 |
36 | 54 | ||
37 | struct iommu_table { | 55 | struct iommu_table { |
38 | unsigned long it_busno; /* Bus number this table belongs to */ | 56 | unsigned long it_busno; /* Bus number this table belongs to */ |
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h index 5b33994cd488..07a10e590c1d 100644 --- a/include/asm-powerpc/oprofile_impl.h +++ b/include/asm-powerpc/oprofile_impl.h | |||
@@ -42,7 +42,7 @@ struct op_powerpc_model { | |||
42 | void (*reg_setup) (struct op_counter_config *, | 42 | void (*reg_setup) (struct op_counter_config *, |
43 | struct op_system_config *, | 43 | struct op_system_config *, |
44 | int num_counters); | 44 | int num_counters); |
45 | void (*cpu_setup) (void *); | 45 | void (*cpu_setup) (struct op_counter_config *); |
46 | void (*start) (struct op_counter_config *); | 46 | void (*start) (struct op_counter_config *); |
47 | void (*stop) (void); | 47 | void (*stop) (void); |
48 | void (*handle_interrupt) (struct pt_regs *, | 48 | void (*handle_interrupt) (struct pt_regs *, |
@@ -121,7 +121,90 @@ static inline void ctr_write(unsigned int i, unsigned int val) | |||
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | } | 123 | } |
124 | #endif /* !CONFIG_FSL_BOOKE */ | 124 | #else /* CONFIG_FSL_BOOKE */ |
125 | static inline u32 get_pmlca(int ctr) | ||
126 | { | ||
127 | u32 pmlca; | ||
128 | |||
129 | switch (ctr) { | ||
130 | case 0: | ||
131 | pmlca = mfpmr(PMRN_PMLCA0); | ||
132 | break; | ||
133 | case 1: | ||
134 | pmlca = mfpmr(PMRN_PMLCA1); | ||
135 | break; | ||
136 | case 2: | ||
137 | pmlca = mfpmr(PMRN_PMLCA2); | ||
138 | break; | ||
139 | case 3: | ||
140 | pmlca = mfpmr(PMRN_PMLCA3); | ||
141 | break; | ||
142 | default: | ||
143 | panic("Bad ctr number\n"); | ||
144 | } | ||
145 | |||
146 | return pmlca; | ||
147 | } | ||
148 | |||
149 | static inline void set_pmlca(int ctr, u32 pmlca) | ||
150 | { | ||
151 | switch (ctr) { | ||
152 | case 0: | ||
153 | mtpmr(PMRN_PMLCA0, pmlca); | ||
154 | break; | ||
155 | case 1: | ||
156 | mtpmr(PMRN_PMLCA1, pmlca); | ||
157 | break; | ||
158 | case 2: | ||
159 | mtpmr(PMRN_PMLCA2, pmlca); | ||
160 | break; | ||
161 | case 3: | ||
162 | mtpmr(PMRN_PMLCA3, pmlca); | ||
163 | break; | ||
164 | default: | ||
165 | panic("Bad ctr number\n"); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | static inline unsigned int ctr_read(unsigned int i) | ||
170 | { | ||
171 | switch(i) { | ||
172 | case 0: | ||
173 | return mfpmr(PMRN_PMC0); | ||
174 | case 1: | ||
175 | return mfpmr(PMRN_PMC1); | ||
176 | case 2: | ||
177 | return mfpmr(PMRN_PMC2); | ||
178 | case 3: | ||
179 | return mfpmr(PMRN_PMC3); | ||
180 | default: | ||
181 | return 0; | ||
182 | } | ||
183 | } | ||
184 | |||
185 | static inline void ctr_write(unsigned int i, unsigned int val) | ||
186 | { | ||
187 | switch(i) { | ||
188 | case 0: | ||
189 | mtpmr(PMRN_PMC0, val); | ||
190 | break; | ||
191 | case 1: | ||
192 | mtpmr(PMRN_PMC1, val); | ||
193 | break; | ||
194 | case 2: | ||
195 | mtpmr(PMRN_PMC2, val); | ||
196 | break; | ||
197 | case 3: | ||
198 | mtpmr(PMRN_PMC3, val); | ||
199 | break; | ||
200 | default: | ||
201 | break; | ||
202 | } | ||
203 | } | ||
204 | |||
205 | |||
206 | #endif /* CONFIG_FSL_BOOKE */ | ||
207 | |||
125 | 208 | ||
126 | extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); | 209 | extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); |
127 | 210 | ||
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h index 051694f14c3e..c77286051496 100644 --- a/include/asm-powerpc/pci.h +++ b/include/asm-powerpc/pci.h | |||
@@ -62,19 +62,13 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
62 | } | 62 | } |
63 | 63 | ||
64 | #ifdef CONFIG_PPC64 | 64 | #ifdef CONFIG_PPC64 |
65 | #define HAVE_ARCH_PCI_MWI 1 | 65 | |
66 | static inline int pcibios_prep_mwi(struct pci_dev *dev) | 66 | /* |
67 | { | 67 | * We want to avoid touching the cacheline size or MWI bit. |
68 | /* | 68 | * pSeries firmware sets the cacheline size (which is not the cpu cacheline |
69 | * We would like to avoid touching the cacheline size or MWI bit | 69 | * size in all cases) and hardware treats MWI the same as memory write. |
70 | * but we cant do that with the current pcibios_prep_mwi | 70 | */ |
71 | * interface. pSeries firmware sets the cacheline size (which is not | 71 | #define PCI_DISABLE_MWI |
72 | * the cpu cacheline size in all cases) and hardware treats MWI | ||
73 | * the same as memory write. So we dont touch the cacheline size | ||
74 | * here and allow the generic code to set the MWI bit. | ||
75 | */ | ||
76 | return 0; | ||
77 | } | ||
78 | 72 | ||
79 | extern struct dma_mapping_ops pci_dma_ops; | 73 | extern struct dma_mapping_ops pci_dma_ops; |
80 | 74 | ||
diff --git a/include/asm-powerpc/pmc.h b/include/asm-powerpc/pmc.h index 07d6a4279319..8588be68e0ad 100644 --- a/include/asm-powerpc/pmc.h +++ b/include/asm-powerpc/pmc.h | |||
@@ -32,18 +32,5 @@ void release_pmc_hardware(void); | |||
32 | void power4_enable_pmcs(void); | 32 | void power4_enable_pmcs(void); |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #ifdef CONFIG_FSL_BOOKE | ||
36 | void init_pmc_stop(int ctr); | ||
37 | void set_pmc_event(int ctr, int event); | ||
38 | void set_pmc_user_kernel(int ctr, int user, int kernel); | ||
39 | void set_pmc_marked(int ctr, int mark0, int mark1); | ||
40 | void pmc_start_ctr(int ctr, int enable); | ||
41 | void pmc_start_ctrs(int enable); | ||
42 | void pmc_stop_ctrs(void); | ||
43 | void dump_pmcs(void); | ||
44 | |||
45 | extern struct op_powerpc_model op_model_fsl_booke; | ||
46 | #endif | ||
47 | |||
48 | #endif /* __KERNEL__ */ | 35 | #endif /* __KERNEL__ */ |
49 | #endif /* _POWERPC_PMC_H */ | 36 | #endif /* _POWERPC_PMC_H */ |
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index a940cfe040da..fa083d8e4663 100644 --- a/include/asm-powerpc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
@@ -30,9 +30,9 @@ BEGIN_FTR_SECTION; \ | |||
30 | mfspr ra,SPRN_PURR; /* get processor util. reg */ \ | 30 | mfspr ra,SPRN_PURR; /* get processor util. reg */ \ |
31 | END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ | 31 | END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ |
32 | BEGIN_FTR_SECTION; \ | 32 | BEGIN_FTR_SECTION; \ |
33 | mftb ra; /* or get TB if no PURR */ \ | 33 | MFTB(ra); /* or get TB if no PURR */ \ |
34 | END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ | 34 | END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ |
35 | ld rb,PACA_STARTPURR(r13); \ | 35 | ld rb,PACA_STARTPURR(r13); \ |
36 | std ra,PACA_STARTPURR(r13); \ | 36 | std ra,PACA_STARTPURR(r13); \ |
37 | subf rb,rb,ra; /* subtract start value */ \ | 37 | subf rb,rb,ra; /* subtract start value */ \ |
38 | ld ra,PACA_USER_TIME(r13); \ | 38 | ld ra,PACA_USER_TIME(r13); \ |
@@ -45,9 +45,9 @@ BEGIN_FTR_SECTION; \ | |||
45 | mfspr ra,SPRN_PURR; /* get processor util. reg */ \ | 45 | mfspr ra,SPRN_PURR; /* get processor util. reg */ \ |
46 | END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ | 46 | END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ |
47 | BEGIN_FTR_SECTION; \ | 47 | BEGIN_FTR_SECTION; \ |
48 | mftb ra; /* or get TB if no PURR */ \ | 48 | MFTB(ra); /* or get TB if no PURR */ \ |
49 | END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ | 49 | END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ |
50 | ld rb,PACA_STARTPURR(r13); \ | 50 | ld rb,PACA_STARTPURR(r13); \ |
51 | std ra,PACA_STARTPURR(r13); \ | 51 | std ra,PACA_STARTPURR(r13); \ |
52 | subf rb,rb,ra; /* subtract start value */ \ | 52 | subf rb,rb,ra; /* subtract start value */ \ |
53 | ld ra,PACA_SYSTEM_TIME(r13); \ | 53 | ld ra,PACA_SYSTEM_TIME(r13); \ |
@@ -274,6 +274,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) | |||
274 | #define ISYNC_601 | 274 | #define ISYNC_601 |
275 | #endif | 275 | #endif |
276 | 276 | ||
277 | #ifdef CONFIG_PPC_CELL | ||
278 | #define MFTB(dest) \ | ||
279 | 90: mftb dest; \ | ||
280 | BEGIN_FTR_SECTION_NESTED(96); \ | ||
281 | cmpwi dest,0; \ | ||
282 | beq- 90b; \ | ||
283 | END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96) | ||
284 | #else | ||
285 | #define MFTB(dest) mftb dest | ||
286 | #endif | ||
277 | 287 | ||
278 | #ifndef CONFIG_SMP | 288 | #ifndef CONFIG_SMP |
279 | #define TLBSYNC | 289 | #define TLBSYNC |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 1fd7a2253e3a..0afee17f33b4 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -135,7 +135,7 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev); | |||
135 | extern struct device_node *of_get_parent(const struct device_node *node); | 135 | extern struct device_node *of_get_parent(const struct device_node *node); |
136 | extern struct device_node *of_get_next_child(const struct device_node *node, | 136 | extern struct device_node *of_get_next_child(const struct device_node *node, |
137 | struct device_node *prev); | 137 | struct device_node *prev); |
138 | extern struct property *of_find_property(struct device_node *np, | 138 | extern struct property *of_find_property(const struct device_node *np, |
139 | const char *name, | 139 | const char *name, |
140 | int *lenp); | 140 | int *lenp); |
141 | extern struct device_node *of_node_get(struct device_node *node); | 141 | extern struct device_node *of_node_get(struct device_node *node); |
@@ -159,10 +159,12 @@ extern void of_detach_node(const struct device_node *); | |||
159 | extern void finish_device_tree(void); | 159 | extern void finish_device_tree(void); |
160 | extern void unflatten_device_tree(void); | 160 | extern void unflatten_device_tree(void); |
161 | extern void early_init_devtree(void *); | 161 | extern void early_init_devtree(void *); |
162 | extern int device_is_compatible(struct device_node *device, const char *); | 162 | extern int device_is_compatible(const struct device_node *device, |
163 | const char *); | ||
163 | extern int machine_is_compatible(const char *compat); | 164 | extern int machine_is_compatible(const char *compat); |
164 | extern const void *get_property(struct device_node *node, const char *name, | 165 | extern const void *get_property(const struct device_node *node, |
165 | int *lenp); | 166 | const char *name, |
167 | int *lenp); | ||
166 | extern void print_properties(struct device_node *node); | 168 | extern void print_properties(struct device_node *node); |
167 | extern int prom_n_addr_cells(struct device_node* np); | 169 | extern int prom_n_addr_cells(struct device_node* np); |
168 | extern int prom_n_size_cells(struct device_node* np); | 170 | extern int prom_n_size_cells(struct device_node* np); |
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index 8fb96811b55d..6faae7b14d55 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -591,6 +591,7 @@ | |||
591 | #define PV_630 0x0040 | 591 | #define PV_630 0x0040 |
592 | #define PV_630p 0x0041 | 592 | #define PV_630p 0x0041 |
593 | #define PV_970MP 0x0044 | 593 | #define PV_970MP 0x0044 |
594 | #define PV_970GX 0x0045 | ||
594 | #define PV_BE 0x0070 | 595 | #define PV_BE 0x0070 |
595 | #define PV_PA6T 0x0090 | 596 | #define PV_PA6T 0x0090 |
596 | 597 | ||
@@ -618,10 +619,35 @@ | |||
618 | : "=r" (rval)); rval;}) | 619 | : "=r" (rval)); rval;}) |
619 | #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) | 620 | #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) |
620 | 621 | ||
622 | #ifdef __powerpc64__ | ||
623 | #ifdef CONFIG_PPC_CELL | ||
624 | #define mftb() ({unsigned long rval; \ | ||
625 | asm volatile( \ | ||
626 | "90: mftb %0;\n" \ | ||
627 | "97: cmpwi %0,0;\n" \ | ||
628 | " beq- 90b;\n" \ | ||
629 | "99:\n" \ | ||
630 | ".section __ftr_fixup,\"a\"\n" \ | ||
631 | ".align 3\n" \ | ||
632 | "98:\n" \ | ||
633 | " .llong %1\n" \ | ||
634 | " .llong %1\n" \ | ||
635 | " .llong 97b-98b\n" \ | ||
636 | " .llong 99b-98b\n" \ | ||
637 | ".previous" \ | ||
638 | : "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;}) | ||
639 | #else | ||
621 | #define mftb() ({unsigned long rval; \ | 640 | #define mftb() ({unsigned long rval; \ |
622 | asm volatile("mftb %0" : "=r" (rval)); rval;}) | 641 | asm volatile("mftb %0" : "=r" (rval)); rval;}) |
642 | #endif /* !CONFIG_PPC_CELL */ | ||
643 | |||
644 | #else /* __powerpc64__ */ | ||
645 | |||
623 | #define mftbl() ({unsigned long rval; \ | 646 | #define mftbl() ({unsigned long rval; \ |
624 | asm volatile("mftbl %0" : "=r" (rval)); rval;}) | 647 | asm volatile("mftbl %0" : "=r" (rval)); rval;}) |
648 | #define mftbu() ({unsigned long rval; \ | ||
649 | asm volatile("mftbu %0" : "=r" (rval)); rval;}) | ||
650 | #endif /* !__powerpc64__ */ | ||
625 | 651 | ||
626 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) | 652 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) |
627 | #define mttbu(v) asm volatile("mttbu %0":: "r"(v)) | 653 | #define mttbu(v) asm volatile("mttbu %0":: "r"(v)) |
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h index eac85ce101b6..97b435484177 100644 --- a/include/asm-powerpc/systbl.h +++ b/include/asm-powerpc/systbl.h | |||
@@ -261,7 +261,7 @@ SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64) | |||
261 | PPC_SYS_SPU(rtas) | 261 | PPC_SYS_SPU(rtas) |
262 | OLDSYS(debug_setcontext) | 262 | OLDSYS(debug_setcontext) |
263 | SYSCALL(ni_syscall) | 263 | SYSCALL(ni_syscall) |
264 | SYSCALL(ni_syscall) | 264 | COMPAT_SYS(migrate_pages) |
265 | COMPAT_SYS(mbind) | 265 | COMPAT_SYS(mbind) |
266 | COMPAT_SYS(get_mempolicy) | 266 | COMPAT_SYS(get_mempolicy) |
267 | COMPAT_SYS(set_mempolicy) | 267 | COMPAT_SYS(set_mempolicy) |
@@ -304,3 +304,4 @@ SYSCALL_SPU(fchmodat) | |||
304 | SYSCALL_SPU(faccessat) | 304 | SYSCALL_SPU(faccessat) |
305 | COMPAT_SYS_SPU(get_robust_list) | 305 | COMPAT_SYS_SPU(get_robust_list) |
306 | COMPAT_SYS_SPU(set_robust_list) | 306 | COMPAT_SYS_SPU(set_robust_list) |
307 | COMPAT_SYS(move_pages) | ||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 43627596003b..f7b1227d6454 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -25,8 +25,8 @@ | |||
25 | * | 25 | * |
26 | * We have to use the sync instructions for mb(), since lwsync doesn't | 26 | * We have to use the sync instructions for mb(), since lwsync doesn't |
27 | * order loads with respect to previous stores. Lwsync is fine for | 27 | * order loads with respect to previous stores. Lwsync is fine for |
28 | * rmb(), though. Note that lwsync is interpreted as sync by | 28 | * rmb(), though. Note that rmb() actually uses a sync on 32-bit |
29 | * 32-bit and older 64-bit CPUs. | 29 | * architectures. |
30 | * | 30 | * |
31 | * For wmb(), we use sync since wmb is used in drivers to order | 31 | * For wmb(), we use sync since wmb is used in drivers to order |
32 | * stores to system memory with respect to writes to the device. | 32 | * stores to system memory with respect to writes to the device. |
@@ -34,7 +34,7 @@ | |||
34 | * SMP since it is only used to order updates to system memory. | 34 | * SMP since it is only used to order updates to system memory. |
35 | */ | 35 | */ |
36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") | 36 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") |
37 | #define rmb() __asm__ __volatile__ ("lwsync" : : : "memory") | 37 | #define rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory") |
38 | #define wmb() __asm__ __volatile__ ("sync" : : : "memory") | 38 | #define wmb() __asm__ __volatile__ ("sync" : : : "memory") |
39 | #define read_barrier_depends() do { } while(0) | 39 | #define read_barrier_depends() do { } while(0) |
40 | 40 | ||
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h index c9483adbf599..f663634cccc9 100644 --- a/include/asm-powerpc/tce.h +++ b/include/asm-powerpc/tce.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define _ASM_POWERPC_TCE_H | 22 | #define _ASM_POWERPC_TCE_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | #include <asm/iommu.h> | ||
26 | |||
25 | /* | 27 | /* |
26 | * Tces come in two formats, one for the virtual bus and a different | 28 | * Tces come in two formats, one for the virtual bus and a different |
27 | * format for PCI | 29 | * format for PCI |
@@ -33,7 +35,6 @@ | |||
33 | 35 | ||
34 | #define TCE_SHIFT 12 | 36 | #define TCE_SHIFT 12 |
35 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | 37 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) |
36 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | ||
37 | 38 | ||
38 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ | 39 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ |
39 | 40 | ||
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index b051d4c88c3b..4cff977ad526 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
@@ -39,10 +39,6 @@ extern void generic_calibrate_decr(void); | |||
39 | extern void wakeup_decrementer(void); | 39 | extern void wakeup_decrementer(void); |
40 | extern void snapshot_timebase(void); | 40 | extern void snapshot_timebase(void); |
41 | 41 | ||
42 | #ifdef CONFIG_RTC_CLASS | ||
43 | extern int __init rtc_class_hookup(void); | ||
44 | #endif | ||
45 | |||
46 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | 42 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ |
47 | extern unsigned long ppc_proc_freq; | 43 | extern unsigned long ppc_proc_freq; |
48 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | 44 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) |
@@ -82,30 +78,35 @@ struct div_result { | |||
82 | #define __USE_RTC() 0 | 78 | #define __USE_RTC() 0 |
83 | #endif | 79 | #endif |
84 | 80 | ||
85 | /* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */ | 81 | #ifdef CONFIG_PPC64 |
82 | |||
83 | /* For compatibility, get_tbl() is defined as get_tb() on ppc64 */ | ||
84 | #define get_tbl get_tb | ||
85 | |||
86 | #else | ||
87 | |||
86 | static inline unsigned long get_tbl(void) | 88 | static inline unsigned long get_tbl(void) |
87 | { | 89 | { |
88 | unsigned long tbl; | ||
89 | |||
90 | #if defined(CONFIG_403GCX) | 90 | #if defined(CONFIG_403GCX) |
91 | unsigned long tbl; | ||
91 | asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); | 92 | asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); |
93 | return tbl; | ||
92 | #else | 94 | #else |
93 | asm volatile("mftb %0" : "=r" (tbl)); | 95 | return mftbl(); |
94 | #endif | 96 | #endif |
95 | return tbl; | ||
96 | } | 97 | } |
97 | 98 | ||
98 | static inline unsigned int get_tbu(void) | 99 | static inline unsigned int get_tbu(void) |
99 | { | 100 | { |
101 | #ifdef CONFIG_403GCX | ||
100 | unsigned int tbu; | 102 | unsigned int tbu; |
101 | |||
102 | #if defined(CONFIG_403GCX) | ||
103 | asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); | 103 | asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); |
104 | return tbu; | ||
104 | #else | 105 | #else |
105 | asm volatile("mftbu %0" : "=r" (tbu)); | 106 | return mftbu(); |
106 | #endif | 107 | #endif |
107 | return tbu; | ||
108 | } | 108 | } |
109 | #endif /* !CONFIG_PPC64 */ | ||
109 | 110 | ||
110 | static inline unsigned int get_rtcl(void) | 111 | static inline unsigned int get_rtcl(void) |
111 | { | 112 | { |
@@ -131,7 +132,7 @@ static inline u64 get_tb(void) | |||
131 | { | 132 | { |
132 | return mftb(); | 133 | return mftb(); |
133 | } | 134 | } |
134 | #else | 135 | #else /* CONFIG_PPC64 */ |
135 | static inline u64 get_tb(void) | 136 | static inline u64 get_tb(void) |
136 | { | 137 | { |
137 | unsigned int tbhi, tblo, tbhi2; | 138 | unsigned int tbhi, tblo, tbhi2; |
@@ -144,7 +145,7 @@ static inline u64 get_tb(void) | |||
144 | 145 | ||
145 | return ((u64)tbhi << 32) | tblo; | 146 | return ((u64)tbhi << 32) | tblo; |
146 | } | 147 | } |
147 | #endif | 148 | #endif /* !CONFIG_PPC64 */ |
148 | 149 | ||
149 | static inline void set_tb(unsigned int upper, unsigned int lower) | 150 | static inline void set_tb(unsigned int upper, unsigned int lower) |
150 | { | 151 | { |
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h index 3b9a8e786806..92dedde761d1 100644 --- a/include/asm-powerpc/timex.h +++ b/include/asm-powerpc/timex.h | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm/cputable.h> | 10 | #include <asm/cputable.h> |
11 | #include <asm/reg.h> | ||
11 | 12 | ||
12 | #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ | 13 | #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ |
13 | 14 | ||
@@ -15,13 +16,11 @@ typedef unsigned long cycles_t; | |||
15 | 16 | ||
16 | static inline cycles_t get_cycles(void) | 17 | static inline cycles_t get_cycles(void) |
17 | { | 18 | { |
18 | cycles_t ret; | ||
19 | |||
20 | #ifdef __powerpc64__ | 19 | #ifdef __powerpc64__ |
21 | 20 | return mftb(); | |
22 | __asm__ __volatile__("mftb %0" : "=r" (ret) : ); | ||
23 | |||
24 | #else | 21 | #else |
22 | cycles_t ret; | ||
23 | |||
25 | /* | 24 | /* |
26 | * For the "cycle" counter we use the timebase lower half. | 25 | * For the "cycle" counter we use the timebase lower half. |
27 | * Currently only used on SMP. | 26 | * Currently only used on SMP. |
@@ -30,18 +29,19 @@ static inline cycles_t get_cycles(void) | |||
30 | ret = 0; | 29 | ret = 0; |
31 | 30 | ||
32 | __asm__ __volatile__( | 31 | __asm__ __volatile__( |
33 | "98: mftb %0\n" | 32 | "97: mftb %0\n" |
34 | "99:\n" | 33 | "99:\n" |
35 | ".section __ftr_fixup,\"a\"\n" | 34 | ".section __ftr_fixup,\"a\"\n" |
35 | ".align 2\n" | ||
36 | "98:\n" | ||
36 | " .long %1\n" | 37 | " .long %1\n" |
37 | " .long 0\n" | 38 | " .long 0\n" |
38 | " .long 98b\n" | 39 | " .long 97b-98b\n" |
39 | " .long 99b\n" | 40 | " .long 99b-98b\n" |
40 | ".previous" | 41 | ".previous" |
41 | : "=r" (ret) : "i" (CPU_FTR_601)); | 42 | : "=r" (ret) : "i" (CPU_FTR_601)); |
42 | #endif | ||
43 | |||
44 | return ret; | 43 | return ret; |
44 | #endif | ||
45 | } | 45 | } |
46 | 46 | ||
47 | #endif /* __KERNEL__ */ | 47 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 8f7ee16781a4..9fe7894ee035 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -96,7 +96,13 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev, | |||
96 | 96 | ||
97 | #ifdef CONFIG_SMP | 97 | #ifdef CONFIG_SMP |
98 | #include <asm/cputable.h> | 98 | #include <asm/cputable.h> |
99 | #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) | 99 | #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) |
100 | |||
101 | #ifdef CONFIG_PPC64 | ||
102 | #include <asm/smp.h> | ||
103 | |||
104 | #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) | ||
105 | #endif | ||
100 | #endif | 106 | #endif |
101 | 107 | ||
102 | #endif /* __KERNEL__ */ | 108 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 464a48cce7f5..0e4ea37f6466 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -276,7 +276,7 @@ | |||
276 | #define __NR_rtas 255 | 276 | #define __NR_rtas 255 |
277 | #define __NR_sys_debug_setcontext 256 | 277 | #define __NR_sys_debug_setcontext 256 |
278 | /* Number 257 is reserved for vserver */ | 278 | /* Number 257 is reserved for vserver */ |
279 | /* 258 currently unused */ | 279 | #define __NR_migrate_pages 258 |
280 | #define __NR_mbind 259 | 280 | #define __NR_mbind 259 |
281 | #define __NR_get_mempolicy 260 | 281 | #define __NR_get_mempolicy 260 |
282 | #define __NR_set_mempolicy 261 | 282 | #define __NR_set_mempolicy 261 |
@@ -323,10 +323,11 @@ | |||
323 | #define __NR_faccessat 298 | 323 | #define __NR_faccessat 298 |
324 | #define __NR_get_robust_list 299 | 324 | #define __NR_get_robust_list 299 |
325 | #define __NR_set_robust_list 300 | 325 | #define __NR_set_robust_list 300 |
326 | #define __NR_move_pages 301 | ||
326 | 327 | ||
327 | #ifdef __KERNEL__ | 328 | #ifdef __KERNEL__ |
328 | 329 | ||
329 | #define __NR_syscalls 301 | 330 | #define __NR_syscalls 302 |
330 | 331 | ||
331 | #define __NR__exit __NR_exit | 332 | #define __NR__exit __NR_exit |
332 | #define NR_syscalls __NR_syscalls | 333 | #define NR_syscalls __NR_syscalls |
diff --git a/include/asm-ppc/device.h b/include/asm-ppc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-ppc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h index 37c362d89fad..0a3cd7ec8451 100644 --- a/include/asm-s390/checksum.h +++ b/include/asm-s390/checksum.h | |||
@@ -27,8 +27,8 @@ | |||
27 | * | 27 | * |
28 | * it's best to have buff aligned on a 32-bit boundary | 28 | * it's best to have buff aligned on a 32-bit boundary |
29 | */ | 29 | */ |
30 | static inline unsigned int | 30 | static inline __wsum |
31 | csum_partial(const unsigned char * buff, int len, unsigned int sum) | 31 | csum_partial(const void *buff, int len, __wsum sum) |
32 | { | 32 | { |
33 | register unsigned long reg2 asm("2") = (unsigned long) buff; | 33 | register unsigned long reg2 asm("2") = (unsigned long) buff; |
34 | register unsigned long reg3 asm("3") = (unsigned long) len; | 34 | register unsigned long reg3 asm("3") = (unsigned long) len; |
@@ -49,9 +49,9 @@ csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
49 | * Copy from userspace and compute checksum. If we catch an exception | 49 | * Copy from userspace and compute checksum. If we catch an exception |
50 | * then zero the rest of the buffer. | 50 | * then zero the rest of the buffer. |
51 | */ | 51 | */ |
52 | static inline unsigned int | 52 | static inline __wsum |
53 | csum_partial_copy_from_user(const char __user *src, char *dst, | 53 | csum_partial_copy_from_user(const void __user *src, void *dst, |
54 | int len, unsigned int sum, | 54 | int len, __wsum sum, |
55 | int *err_ptr) | 55 | int *err_ptr) |
56 | { | 56 | { |
57 | int missing; | 57 | int missing; |
@@ -66,8 +66,8 @@ csum_partial_copy_from_user(const char __user *src, char *dst, | |||
66 | } | 66 | } |
67 | 67 | ||
68 | 68 | ||
69 | static inline unsigned int | 69 | static inline __wsum |
70 | csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum) | 70 | csum_partial_copy_nocheck (const void *src, void *dst, int len, __wsum sum) |
71 | { | 71 | { |
72 | memcpy(dst,src,len); | 72 | memcpy(dst,src,len); |
73 | return csum_partial(dst, len, sum); | 73 | return csum_partial(dst, len, sum); |
@@ -76,8 +76,7 @@ csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum | |||
76 | /* | 76 | /* |
77 | * Fold a partial checksum without adding pseudo headers | 77 | * Fold a partial checksum without adding pseudo headers |
78 | */ | 78 | */ |
79 | static inline unsigned short | 79 | static inline __sum16 csum_fold(__wsum sum) |
80 | csum_fold(unsigned int sum) | ||
81 | { | 80 | { |
82 | #ifndef __s390x__ | 81 | #ifndef __s390x__ |
83 | register_pair rp; | 82 | register_pair rp; |
@@ -100,7 +99,7 @@ csum_fold(unsigned int sum) | |||
100 | " srl %0,16\n" /* %0 = H+L+C */ | 99 | " srl %0,16\n" /* %0 = H+L+C */ |
101 | : "+&d" (sum) : : "cc", "2", "3"); | 100 | : "+&d" (sum) : : "cc", "2", "3"); |
102 | #endif /* __s390x__ */ | 101 | #endif /* __s390x__ */ |
103 | return ((unsigned short) ~sum); | 102 | return (__force __sum16) ~sum; |
104 | } | 103 | } |
105 | 104 | ||
106 | /* | 105 | /* |
@@ -108,8 +107,7 @@ csum_fold(unsigned int sum) | |||
108 | * which always checksum on 4 octet boundaries. | 107 | * which always checksum on 4 octet boundaries. |
109 | * | 108 | * |
110 | */ | 109 | */ |
111 | static inline unsigned short | 110 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
112 | ip_fast_csum(unsigned char *iph, unsigned int ihl) | ||
113 | { | 111 | { |
114 | return csum_fold(csum_partial(iph, ihl*4, 0)); | 112 | return csum_fold(csum_partial(iph, ihl*4, 0)); |
115 | } | 113 | } |
@@ -118,10 +116,10 @@ ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
118 | * computes the checksum of the TCP/UDP pseudo-header | 116 | * computes the checksum of the TCP/UDP pseudo-header |
119 | * returns a 32-bit checksum | 117 | * returns a 32-bit checksum |
120 | */ | 118 | */ |
121 | static inline unsigned int | 119 | static inline __wsum |
122 | csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 120 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
123 | unsigned short len, unsigned short proto, | 121 | unsigned short len, unsigned short proto, |
124 | unsigned int sum) | 122 | __wsum sum) |
125 | { | 123 | { |
126 | #ifndef __s390x__ | 124 | #ifndef __s390x__ |
127 | asm volatile( | 125 | asm volatile( |
@@ -137,12 +135,12 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
137 | "1:" | 135 | "1:" |
138 | : "+&d" (sum) : "d" (daddr) : "cc"); | 136 | : "+&d" (sum) : "d" (daddr) : "cc"); |
139 | asm volatile( | 137 | asm volatile( |
140 | " alr %0,%1\n" /* sum += (len<<16) + (proto<<8) */ | 138 | " alr %0,%1\n" /* sum += len + proto */ |
141 | " brc 12,2f\n" | 139 | " brc 12,2f\n" |
142 | " ahi %0,1\n" /* add carry */ | 140 | " ahi %0,1\n" /* add carry */ |
143 | "2:" | 141 | "2:" |
144 | : "+&d" (sum) | 142 | : "+&d" (sum) |
145 | : "d" (((unsigned int) len<<16) + (unsigned int) proto) | 143 | : "d" (len + proto) |
146 | : "cc"); | 144 | : "cc"); |
147 | #else /* __s390x__ */ | 145 | #else /* __s390x__ */ |
148 | asm volatile( | 146 | asm volatile( |
@@ -153,7 +151,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
153 | "0: algr %0,%2\n" /* sum += daddr */ | 151 | "0: algr %0,%2\n" /* sum += daddr */ |
154 | " brc 12,1f\n" | 152 | " brc 12,1f\n" |
155 | " aghi %0,1\n" /* add carry */ | 153 | " aghi %0,1\n" /* add carry */ |
156 | "1: algfr %0,%3\n" /* sum += (len<<16) + proto */ | 154 | "1: algfr %0,%3\n" /* sum += len + proto */ |
157 | " brc 12,2f\n" | 155 | " brc 12,2f\n" |
158 | " aghi %0,1\n" /* add carry */ | 156 | " aghi %0,1\n" /* add carry */ |
159 | "2: srlg 0,%0,32\n" | 157 | "2: srlg 0,%0,32\n" |
@@ -163,7 +161,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
163 | "3: llgfr %0,%0" | 161 | "3: llgfr %0,%0" |
164 | : "+&d" (sum) | 162 | : "+&d" (sum) |
165 | : "d" (saddr), "d" (daddr), | 163 | : "d" (saddr), "d" (daddr), |
166 | "d" (((unsigned int) len<<16) + (unsigned int) proto) | 164 | "d" (len + proto) |
167 | : "cc", "0"); | 165 | : "cc", "0"); |
168 | #endif /* __s390x__ */ | 166 | #endif /* __s390x__ */ |
169 | return sum; | 167 | return sum; |
@@ -174,10 +172,10 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | |||
174 | * returns a 16-bit checksum, already complemented | 172 | * returns a 16-bit checksum, already complemented |
175 | */ | 173 | */ |
176 | 174 | ||
177 | static inline unsigned short int | 175 | static inline __sum16 |
178 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, | 176 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
179 | unsigned short len, unsigned short proto, | 177 | unsigned short len, unsigned short proto, |
180 | unsigned int sum) | 178 | __wsum sum) |
181 | { | 179 | { |
182 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 180 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
183 | } | 181 | } |
@@ -187,8 +185,7 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, | |||
187 | * in icmp.c | 185 | * in icmp.c |
188 | */ | 186 | */ |
189 | 187 | ||
190 | static inline unsigned short | 188 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
191 | ip_compute_csum(unsigned char * buff, int len) | ||
192 | { | 189 | { |
193 | return csum_fold(csum_partial(buff, len, 0)); | 190 | return csum_fold(csum_partial(buff, len, 0)); |
194 | } | 191 | } |
diff --git a/include/asm-s390/device.h b/include/asm-s390/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-s390/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 519f0a5ff181..36bb6dacf008 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -200,18 +200,45 @@ extern char empty_zero_page[PAGE_SIZE]; | |||
200 | */ | 200 | */ |
201 | 201 | ||
202 | /* Hardware bits in the page table entry */ | 202 | /* Hardware bits in the page table entry */ |
203 | #define _PAGE_RO 0x200 /* HW read-only */ | 203 | #define _PAGE_RO 0x200 /* HW read-only bit */ |
204 | #define _PAGE_INVALID 0x400 /* HW invalid */ | 204 | #define _PAGE_INVALID 0x400 /* HW invalid bit */ |
205 | #define _PAGE_SWT 0x001 /* SW pte type bit t */ | ||
206 | #define _PAGE_SWX 0x002 /* SW pte type bit x */ | ||
205 | 207 | ||
206 | /* Mask and six different types of pages. */ | 208 | /* Six different types of pages. */ |
207 | #define _PAGE_TYPE_MASK 0x601 | ||
208 | #define _PAGE_TYPE_EMPTY 0x400 | 209 | #define _PAGE_TYPE_EMPTY 0x400 |
209 | #define _PAGE_TYPE_NONE 0x401 | 210 | #define _PAGE_TYPE_NONE 0x401 |
210 | #define _PAGE_TYPE_SWAP 0x600 | 211 | #define _PAGE_TYPE_SWAP 0x403 |
211 | #define _PAGE_TYPE_FILE 0x601 | 212 | #define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */ |
212 | #define _PAGE_TYPE_RO 0x200 | 213 | #define _PAGE_TYPE_RO 0x200 |
213 | #define _PAGE_TYPE_RW 0x000 | 214 | #define _PAGE_TYPE_RW 0x000 |
214 | 215 | ||
216 | /* | ||
217 | * PTE type bits are rather complicated. handle_pte_fault uses pte_present, | ||
218 | * pte_none and pte_file to find out the pte type WITHOUT holding the page | ||
219 | * table lock. ptep_clear_flush on the other hand uses ptep_clear_flush to | ||
220 | * invalidate a given pte. ipte sets the hw invalid bit and clears all tlbs | ||
221 | * for the page. The page table entry is set to _PAGE_TYPE_EMPTY afterwards. | ||
222 | * This change is done while holding the lock, but the intermediate step | ||
223 | * of a previously valid pte with the hw invalid bit set can be observed by | ||
224 | * handle_pte_fault. That makes it necessary that all valid pte types with | ||
225 | * the hw invalid bit set must be distinguishable from the four pte types | ||
226 | * empty, none, swap and file. | ||
227 | * | ||
228 | * irxt ipte irxt | ||
229 | * _PAGE_TYPE_EMPTY 1000 -> 1000 | ||
230 | * _PAGE_TYPE_NONE 1001 -> 1001 | ||
231 | * _PAGE_TYPE_SWAP 1011 -> 1011 | ||
232 | * _PAGE_TYPE_FILE 11?1 -> 11?1 | ||
233 | * _PAGE_TYPE_RO 0100 -> 1100 | ||
234 | * _PAGE_TYPE_RW 0000 -> 1000 | ||
235 | * | ||
236 | * pte_none is true for bits combinations 1000, 1100 | ||
237 | * pte_present is true for bits combinations 0000, 0010, 0100, 0110, 1001 | ||
238 | * pte_file is true for bits combinations 1101, 1111 | ||
239 | * swap pte is 1011 and 0001, 0011, 0101, 0111, 1010 and 1110 are invalid. | ||
240 | */ | ||
241 | |||
215 | #ifndef __s390x__ | 242 | #ifndef __s390x__ |
216 | 243 | ||
217 | /* Bits in the segment table entry */ | 244 | /* Bits in the segment table entry */ |
@@ -365,18 +392,21 @@ static inline int pmd_bad(pmd_t pmd) | |||
365 | 392 | ||
366 | static inline int pte_none(pte_t pte) | 393 | static inline int pte_none(pte_t pte) |
367 | { | 394 | { |
368 | return (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_EMPTY; | 395 | return (pte_val(pte) & _PAGE_INVALID) && !(pte_val(pte) & _PAGE_SWT); |
369 | } | 396 | } |
370 | 397 | ||
371 | static inline int pte_present(pte_t pte) | 398 | static inline int pte_present(pte_t pte) |
372 | { | 399 | { |
373 | return !(pte_val(pte) & _PAGE_INVALID) || | 400 | unsigned long mask = _PAGE_RO | _PAGE_INVALID | _PAGE_SWT | _PAGE_SWX; |
374 | (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_NONE; | 401 | return (pte_val(pte) & mask) == _PAGE_TYPE_NONE || |
402 | (!(pte_val(pte) & _PAGE_INVALID) && | ||
403 | !(pte_val(pte) & _PAGE_SWT)); | ||
375 | } | 404 | } |
376 | 405 | ||
377 | static inline int pte_file(pte_t pte) | 406 | static inline int pte_file(pte_t pte) |
378 | { | 407 | { |
379 | return (pte_val(pte) & _PAGE_TYPE_MASK) == _PAGE_TYPE_FILE; | 408 | unsigned long mask = _PAGE_RO | _PAGE_INVALID | _PAGE_SWT; |
409 | return (pte_val(pte) & mask) == _PAGE_TYPE_FILE; | ||
380 | } | 410 | } |
381 | 411 | ||
382 | #define pte_same(a,b) (pte_val(a) == pte_val(b)) | 412 | #define pte_same(a,b) (pte_val(a) == pte_val(b)) |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index a19238cbcffa..71d3c21b84f0 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -249,8 +249,9 @@ | |||
249 | #define __NR_vmsplice 309 | 249 | #define __NR_vmsplice 309 |
250 | /* Number 310 is reserved for new sys_move_pages */ | 250 | /* Number 310 is reserved for new sys_move_pages */ |
251 | #define __NR_getcpu 311 | 251 | #define __NR_getcpu 311 |
252 | #define __NR_epoll_pwait 312 | ||
252 | 253 | ||
253 | #define NR_syscalls 312 | 254 | #define NR_syscalls 313 |
254 | 255 | ||
255 | /* | 256 | /* |
256 | * There are some system calls that are not present on 64 bit, some | 257 | * There are some system calls that are not present on 64 bit, some |
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h index 08168afe6746..d44344c88e73 100644 --- a/include/asm-sh/checksum.h +++ b/include/asm-sh/checksum.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * | 23 | * |
24 | * it's best to have buff aligned on a 32-bit boundary | 24 | * it's best to have buff aligned on a 32-bit boundary |
25 | */ | 25 | */ |
26 | asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 26 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * the same as csum_partial, but copies from src while it | 29 | * the same as csum_partial, but copies from src while it |
@@ -33,8 +33,8 @@ asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsign | |||
33 | * better 64-bit) boundary | 33 | * better 64-bit) boundary |
34 | */ | 34 | */ |
35 | 35 | ||
36 | asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsigned char *dst, | 36 | asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, |
37 | int len, int sum, int *src_err_ptr, int *dst_err_ptr); | 37 | int len, __wsum sum, int *src_err_ptr, int *dst_err_ptr); |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Note: when you get a NULL pointer exception here this means someone | 40 | * Note: when you get a NULL pointer exception here this means someone |
@@ -44,24 +44,25 @@ asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsi | |||
44 | * access_ok(). | 44 | * access_ok(). |
45 | */ | 45 | */ |
46 | static __inline__ | 46 | static __inline__ |
47 | unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, | 47 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
48 | int len, int sum) | 48 | int len, __wsum sum) |
49 | { | 49 | { |
50 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); | 50 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); |
51 | } | 51 | } |
52 | 52 | ||
53 | static __inline__ | 53 | static __inline__ |
54 | unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, | 54 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
55 | int len, int sum, int *err_ptr) | 55 | int len, __wsum sum, int *err_ptr) |
56 | { | 56 | { |
57 | return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL); | 57 | return csum_partial_copy_generic((__force const void *)src, dst, |
58 | len, sum, err_ptr, NULL); | ||
58 | } | 59 | } |
59 | 60 | ||
60 | /* | 61 | /* |
61 | * Fold a partial checksum | 62 | * Fold a partial checksum |
62 | */ | 63 | */ |
63 | 64 | ||
64 | static __inline__ unsigned int csum_fold(unsigned int sum) | 65 | static __inline__ __sum16 csum_fold(__wsum sum) |
65 | { | 66 | { |
66 | unsigned int __dummy; | 67 | unsigned int __dummy; |
67 | __asm__("swap.w %0, %1\n\t" | 68 | __asm__("swap.w %0, %1\n\t" |
@@ -74,7 +75,7 @@ static __inline__ unsigned int csum_fold(unsigned int sum) | |||
74 | : "=r" (sum), "=&r" (__dummy) | 75 | : "=r" (sum), "=&r" (__dummy) |
75 | : "0" (sum) | 76 | : "0" (sum) |
76 | : "t"); | 77 | : "t"); |
77 | return sum; | 78 | return (__force __sum16)sum; |
78 | } | 79 | } |
79 | 80 | ||
80 | /* | 81 | /* |
@@ -84,7 +85,7 @@ static __inline__ unsigned int csum_fold(unsigned int sum) | |||
84 | * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted | 85 | * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted |
85 | * for linux by * Arnt Gulbrandsen. | 86 | * for linux by * Arnt Gulbrandsen. |
86 | */ | 87 | */ |
87 | static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) | 88 | static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
88 | { | 89 | { |
89 | unsigned int sum, __dummy0, __dummy1; | 90 | unsigned int sum, __dummy0, __dummy1; |
90 | 91 | ||
@@ -112,16 +113,15 @@ static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int | |||
112 | return csum_fold(sum); | 113 | return csum_fold(sum); |
113 | } | 114 | } |
114 | 115 | ||
115 | static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, | 116 | static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
116 | unsigned long daddr, | ||
117 | unsigned short len, | 117 | unsigned short len, |
118 | unsigned short proto, | 118 | unsigned short proto, |
119 | unsigned int sum) | 119 | __wsum sum) |
120 | { | 120 | { |
121 | #ifdef __LITTLE_ENDIAN__ | 121 | #ifdef __LITTLE_ENDIAN__ |
122 | unsigned long len_proto = (ntohs(len)<<16)+proto*256; | 122 | unsigned long len_proto = (proto + len) << 8; |
123 | #else | 123 | #else |
124 | unsigned long len_proto = (proto<<16)+len; | 124 | unsigned long len_proto = proto + len; |
125 | #endif | 125 | #endif |
126 | __asm__("clrt\n\t" | 126 | __asm__("clrt\n\t" |
127 | "addc %0, %1\n\t" | 127 | "addc %0, %1\n\t" |
@@ -139,11 +139,10 @@ static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
139 | * computes the checksum of the TCP/UDP pseudo-header | 139 | * computes the checksum of the TCP/UDP pseudo-header |
140 | * returns a 16-bit checksum, already complemented | 140 | * returns a 16-bit checksum, already complemented |
141 | */ | 141 | */ |
142 | static __inline__ unsigned short int csum_tcpudp_magic(unsigned long saddr, | 142 | static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
143 | unsigned long daddr, | ||
144 | unsigned short len, | 143 | unsigned short len, |
145 | unsigned short proto, | 144 | unsigned short proto, |
146 | unsigned int sum) | 145 | __wsum sum) |
147 | { | 146 | { |
148 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 147 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
149 | } | 148 | } |
@@ -153,18 +152,17 @@ static __inline__ unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
153 | * in icmp.c | 152 | * in icmp.c |
154 | */ | 153 | */ |
155 | 154 | ||
156 | static __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len) | 155 | static __inline__ __sum16 ip_compute_csum(const void *buff, int len) |
157 | { | 156 | { |
158 | return csum_fold (csum_partial(buff, len, 0)); | 157 | return csum_fold (csum_partial(buff, len, 0)); |
159 | } | 158 | } |
160 | 159 | ||
161 | #define _HAVE_ARCH_IPV6_CSUM | 160 | #define _HAVE_ARCH_IPV6_CSUM |
162 | #ifdef CONFIG_IPV6 | 161 | #ifdef CONFIG_IPV6 |
163 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 162 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
164 | struct in6_addr *daddr, | 163 | const struct in6_addr *daddr, |
165 | __u32 len, | 164 | __u32 len, unsigned short proto, |
166 | unsigned short proto, | 165 | __wsum sum) |
167 | unsigned int sum) | ||
168 | { | 166 | { |
169 | unsigned int __dummy; | 167 | unsigned int __dummy; |
170 | __asm__("clrt\n\t" | 168 | __asm__("clrt\n\t" |
@@ -201,17 +199,18 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
201 | * Copy and checksum to user | 199 | * Copy and checksum to user |
202 | */ | 200 | */ |
203 | #define HAVE_CSUM_COPY_USER | 201 | #define HAVE_CSUM_COPY_USER |
204 | static __inline__ unsigned int csum_and_copy_to_user (const unsigned char *src, | 202 | static __inline__ __wsum csum_and_copy_to_user (const void *src, |
205 | unsigned char __user *dst, | 203 | void __user *dst, |
206 | int len, int sum, | 204 | int len, __wsum sum, |
207 | int *err_ptr) | 205 | int *err_ptr) |
208 | { | 206 | { |
209 | if (access_ok(VERIFY_WRITE, dst, len)) | 207 | if (access_ok(VERIFY_WRITE, dst, len)) |
210 | return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr); | 208 | return csum_partial_copy_generic((__force const void *)src, |
209 | dst, len, sum, NULL, err_ptr); | ||
211 | 210 | ||
212 | if (len) | 211 | if (len) |
213 | *err_ptr = -EFAULT; | 212 | *err_ptr = -EFAULT; |
214 | 213 | ||
215 | return -1; /* invalid checksum */ | 214 | return (__force __wsum)-1; /* invalid checksum */ |
216 | } | 215 | } |
217 | #endif /* __ASM_SH_CHECKSUM_H */ | 216 | #endif /* __ASM_SH_CHECKSUM_H */ |
diff --git a/include/asm-sh/device.h b/include/asm-sh/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sh/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sh/edosk7705/io.h b/include/asm-sh/edosk7705.h index a1089a65bc36..a1089a65bc36 100644 --- a/include/asm-sh/edosk7705/io.h +++ b/include/asm-sh/edosk7705.h | |||
diff --git a/include/asm-sh/hp6xx/hp6xx.h b/include/asm-sh/hp6xx.h index f35134c159dd..f35134c159dd 100644 --- a/include/asm-sh/hp6xx/hp6xx.h +++ b/include/asm-sh/hp6xx.h | |||
diff --git a/include/asm-sh/hp6xx/ide.h b/include/asm-sh/hp6xx/ide.h deleted file mode 100644 index 570395a5ebe5..000000000000 --- a/include/asm-sh/hp6xx/ide.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH_HP6XX_IDE_H | ||
2 | #define __ASM_SH_HP6XX_IDE_H | ||
3 | |||
4 | #define IRQ_CFCARD 93 | ||
5 | #define IRQ_PCMCIA 94 | ||
6 | |||
7 | #endif /* __ASM_SH_HP6XX_IDE_H */ | ||
8 | |||
diff --git a/include/asm-sh/hp6xx/io.h b/include/asm-sh/hp6xx/io.h deleted file mode 100644 index 2044476ab199..000000000000 --- a/include/asm-sh/hp6xx/io.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef __ASM_SH_HP6XX_IO_H | ||
2 | #define __ASM_SH_HP6XX_IO_H | ||
3 | |||
4 | /* | ||
5 | * Nothing special here.. just use the generic cchip io routines. | ||
6 | */ | ||
7 | #include <asm/hd64461.h> | ||
8 | |||
9 | #endif /* __ASM_SH_HP6XX_IO_H */ | ||
10 | |||
diff --git a/include/asm-sh/hs7751rvoip/hs7751rvoip.h b/include/asm-sh/hs7751rvoip.h index c4cff9d33927..c4cff9d33927 100644 --- a/include/asm-sh/hs7751rvoip/hs7751rvoip.h +++ b/include/asm-sh/hs7751rvoip.h | |||
diff --git a/include/asm-sh/hs7751rvoip/ide.h b/include/asm-sh/hs7751rvoip/ide.h deleted file mode 100644 index 65ad1d0f763b..000000000000 --- a/include/asm-sh/hs7751rvoip/ide.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH_HS7751RVOIP_IDE_H | ||
2 | #define __ASM_SH_HS7751RVOIP_IDE_H | ||
3 | |||
4 | /* Nothing to see here.. */ | ||
5 | #include <asm/hs7751rvoip/hs7751rvoip.h> | ||
6 | |||
7 | #endif /* __ASM_SH_HS7751RVOIP_IDE_H */ | ||
8 | |||
diff --git a/include/asm-sh/irq-sh7780.h b/include/asm-sh/irq-sh7780.h index 895c5780e454..19912ae6a7f7 100644 --- a/include/asm-sh/irq-sh7780.h +++ b/include/asm-sh/irq-sh7780.h | |||
@@ -6,16 +6,6 @@ | |||
6 | * | 6 | * |
7 | * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp> | 7 | * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp> |
8 | */ | 8 | */ |
9 | |||
10 | #ifdef CONFIG_IDE | ||
11 | # ifndef IRQ_CFCARD | ||
12 | # define IRQ_CFCARD 14 | ||
13 | # endif | ||
14 | # ifndef IRQ_PCMCIA | ||
15 | # define IRQ_PCMCIA 15 | ||
16 | # endif | ||
17 | #endif | ||
18 | |||
19 | #define INTC_BASE 0xffd00000 | 9 | #define INTC_BASE 0xffd00000 |
20 | #define INTC_ICR0 (INTC_BASE+0x0) | 10 | #define INTC_ICR0 (INTC_BASE+0x0) |
21 | #define INTC_ICR1 (INTC_BASE+0x1c) | 11 | #define INTC_ICR1 (INTC_BASE+0x1c) |
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 28996f9c58cc..6cd3e9e2a76a 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -14,16 +14,6 @@ | |||
14 | #include <asm/machvec.h> | 14 | #include <asm/machvec.h> |
15 | #include <asm/ptrace.h> /* for pt_regs */ | 15 | #include <asm/ptrace.h> /* for pt_regs */ |
16 | 16 | ||
17 | #if defined(CONFIG_SH_HP6XX) || \ | ||
18 | defined(CONFIG_SH_RTS7751R2D) || \ | ||
19 | defined(CONFIG_SH_HS7751RVOIP) || \ | ||
20 | defined(CONFIG_SH_HS7751RVOIP) || \ | ||
21 | defined(CONFIG_SH_SH03) || \ | ||
22 | defined(CONFIG_SH_R7780RP) || \ | ||
23 | defined(CONFIG_SH_LANDISK) | ||
24 | #include <asm/mach/ide.h> | ||
25 | #endif | ||
26 | |||
27 | #ifndef CONFIG_CPU_SUBTYPE_SH7780 | 17 | #ifndef CONFIG_CPU_SUBTYPE_SH7780 |
28 | 18 | ||
29 | #define INTC_DMAC0_MSK 0 | 19 | #define INTC_DMAC0_MSK 0 |
@@ -38,15 +28,6 @@ | |||
38 | #define INTC_IPRD 0xffd00010UL | 28 | #define INTC_IPRD 0xffd00010UL |
39 | #endif | 29 | #endif |
40 | 30 | ||
41 | #ifdef CONFIG_IDE | ||
42 | # ifndef IRQ_CFCARD | ||
43 | # define IRQ_CFCARD 14 | ||
44 | # endif | ||
45 | # ifndef IRQ_PCMCIA | ||
46 | # define IRQ_PCMCIA 15 | ||
47 | # endif | ||
48 | #endif | ||
49 | |||
50 | #define TIMER_IRQ 16 | 31 | #define TIMER_IRQ 16 |
51 | #define TIMER_IPR_ADDR INTC_IPRA | 32 | #define TIMER_IPR_ADDR INTC_IPRA |
52 | #define TIMER_IPR_POS 3 | 33 | #define TIMER_IPR_POS 3 |
@@ -346,11 +327,17 @@ extern unsigned short *irq_mask_register; | |||
346 | */ | 327 | */ |
347 | void init_IRQ_pint(void); | 328 | void init_IRQ_pint(void); |
348 | 329 | ||
330 | struct ipr_data { | ||
331 | unsigned int irq; | ||
332 | unsigned int addr; /* Address of Interrupt Priority Register */ | ||
333 | int shift; /* Shifts of the 16-bit data */ | ||
334 | int priority; /* The priority */ | ||
335 | }; | ||
336 | |||
349 | /* | 337 | /* |
350 | * Function for "on chip support modules". | 338 | * Function for "on chip support modules". |
351 | */ | 339 | */ |
352 | extern void make_ipr_irq(unsigned int irq, unsigned int addr, | 340 | extern void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs); |
353 | int pos, int priority); | ||
354 | extern void make_imask_irq(unsigned int irq); | 341 | extern void make_imask_irq(unsigned int irq); |
355 | 342 | ||
356 | #if defined(CONFIG_CPU_SUBTYPE_SH7300) | 343 | #if defined(CONFIG_CPU_SUBTYPE_SH7300) |
@@ -704,7 +691,7 @@ struct intc2_data { | |||
704 | unsigned char priority; | 691 | unsigned char priority; |
705 | }; | 692 | }; |
706 | 693 | ||
707 | void make_intc2_irq(struct intc2_data *); | 694 | void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs); |
708 | void init_IRQ_intc2(void); | 695 | void init_IRQ_intc2(void); |
709 | #endif | 696 | #endif |
710 | 697 | ||
diff --git a/include/asm-sh/landisk/ide.h b/include/asm-sh/landisk/ide.h deleted file mode 100644 index 6490e28415ed..000000000000 --- a/include/asm-sh/landisk/ide.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | /* | ||
2 | * modifed by kogiidena | ||
3 | * 2005.03.03 | ||
4 | */ | ||
5 | |||
6 | #ifndef __ASM_SH_LANDISK_IDE_H | ||
7 | #define __ASM_SH_LANDISK_IDE_H | ||
8 | |||
9 | /* Nothing to see here.. */ | ||
10 | #include <asm/landisk/iodata_landisk.h> | ||
11 | #define IRQ_CFCARD IRQ_FATA /* CF Card IRQ */ | ||
12 | #define IRQ_PCMCIA IRQ_ATA /* PCMCIA IRQ */ | ||
13 | |||
14 | #endif /* __ASM_SH_LANDISK_IDE_H */ | ||
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index 474773853cd1..45bb74e35d32 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
@@ -255,6 +255,8 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); | |||
255 | */ | 255 | */ |
256 | #define thread_saved_pc(tsk) (tsk->thread.pc) | 256 | #define thread_saved_pc(tsk) (tsk->thread.pc) |
257 | 257 | ||
258 | void show_trace(struct task_struct *tsk, unsigned long *sp, | ||
259 | struct pt_regs *regs); | ||
258 | extern unsigned long get_wchan(struct task_struct *p); | 260 | extern unsigned long get_wchan(struct task_struct *p); |
259 | 261 | ||
260 | #define KSTK_EIP(tsk) ((tsk)->thread.pc) | 262 | #define KSTK_EIP(tsk) ((tsk)->thread.pc) |
diff --git a/include/asm-sh/r7780rp/r7780rp.h b/include/asm-sh/r7780rp.h index f95d9dba31a2..c18f648a7995 100644 --- a/include/asm-sh/r7780rp/r7780rp.h +++ b/include/asm-sh/r7780rp.h | |||
@@ -72,8 +72,6 @@ | |||
72 | 72 | ||
73 | #define PA_AX88796L 0xa4100400 /* AX88796L Area */ | 73 | #define PA_AX88796L 0xa4100400 /* AX88796L Area */ |
74 | #define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ | 74 | #define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ |
75 | #define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */ | ||
76 | #define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */ | ||
77 | #define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ | 75 | #define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ |
78 | #define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ | 76 | #define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ |
79 | 77 | ||
@@ -83,7 +81,6 @@ | |||
83 | #define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */ | 81 | #define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */ |
84 | #define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */ | 82 | #define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */ |
85 | #define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */ | 83 | #define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */ |
86 | #define IRQ_CFCARD 1 /* CF Card IRQ */ | ||
87 | // #define IRQ_CFINST 0 /* CF Card Insert IRQ */ | 84 | // #define IRQ_CFINST 0 /* CF Card Insert IRQ */ |
88 | #define IRQ_TP 2 /* Touch Panel IRQ */ | 85 | #define IRQ_TP 2 /* Touch Panel IRQ */ |
89 | #define IRQ_SCI1 3 /* SCI1 IRQ */ | 86 | #define IRQ_SCI1 3 /* SCI1 IRQ */ |
@@ -146,8 +143,6 @@ | |||
146 | 143 | ||
147 | #define PA_AX88796L 0xa5800400 /* AX88796L Area */ | 144 | #define PA_AX88796L 0xa5800400 /* AX88796L Area */ |
148 | #define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ | 145 | #define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ |
149 | #define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */ | ||
150 | #define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */ | ||
151 | #define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ | 146 | #define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ |
152 | #define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ | 147 | #define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ |
153 | 148 | ||
@@ -157,7 +152,6 @@ | |||
157 | #define IRQ_PCISLOT2 1 /* PCI Slot #2 IRQ */ | 152 | #define IRQ_PCISLOT2 1 /* PCI Slot #2 IRQ */ |
158 | #define IRQ_PCISLOT3 2 /* PCI Slot #3 IRQ */ | 153 | #define IRQ_PCISLOT3 2 /* PCI Slot #3 IRQ */ |
159 | #define IRQ_PCISLOT4 3 /* PCI Slot #4 IRQ */ | 154 | #define IRQ_PCISLOT4 3 /* PCI Slot #4 IRQ */ |
160 | #define IRQ_CFCARD 4 /* CF Card IRQ */ | ||
161 | #define IRQ_CFINST 5 /* CF Card Insert IRQ */ | 155 | #define IRQ_CFINST 5 /* CF Card Insert IRQ */ |
162 | #define IRQ_M66596 6 /* M66596 IRQ */ | 156 | #define IRQ_M66596 6 /* M66596 IRQ */ |
163 | #define IRQ_SDCARD 7 /* SD Card IRQ */ | 157 | #define IRQ_SDCARD 7 /* SD Card IRQ */ |
diff --git a/include/asm-sh/r7780rp/ide.h b/include/asm-sh/r7780rp/ide.h deleted file mode 100644 index a1ed78e0f617..000000000000 --- a/include/asm-sh/r7780rp/ide.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH_R7780RP_IDE_H | ||
2 | #define __ASM_SH_R7780RP_IDE_H | ||
3 | |||
4 | /* Nothing to see here.. */ | ||
5 | #include <asm/mach/r7780rp.h> | ||
6 | |||
7 | #endif /* __ASM_SH_R7780RP_IDE_H */ | ||
8 | |||
diff --git a/include/asm-sh/rts7751r2d/rts7751r2d.h b/include/asm-sh/rts7751r2d.h index 796b8fcb81a8..796b8fcb81a8 100644 --- a/include/asm-sh/rts7751r2d/rts7751r2d.h +++ b/include/asm-sh/rts7751r2d.h | |||
diff --git a/include/asm-sh/rts7751r2d/ide.h b/include/asm-sh/rts7751r2d/ide.h deleted file mode 100644 index 416f96b407cb..000000000000 --- a/include/asm-sh/rts7751r2d/ide.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ASM_SH_RTS7751R2D_IDE_H | ||
2 | #define __ASM_SH_RTS7751R2D_IDE_H | ||
3 | |||
4 | /* Nothing to see here.. */ | ||
5 | #include <asm/rts7751r2d/rts7751r2d.h> | ||
6 | |||
7 | #endif /* __ASM_SH_RTS7751R2D_IDE_H */ | ||
8 | |||
diff --git a/include/asm-sh/sh03/ide.h b/include/asm-sh/sh03/ide.h deleted file mode 100644 index 73ee92e5c79e..000000000000 --- a/include/asm-sh/sh03/ide.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_SH_SH03_IDE_H | ||
2 | #define __ASM_SH_SH03_IDE_H | ||
3 | |||
4 | #define IRQ_CFCARD 8 | ||
5 | #define IRQ_PCMCIA 8 | ||
6 | |||
7 | #endif /* __ASM_SH_SH03_IDE_H */ | ||
diff --git a/include/asm-sh/shmin/shmin.h b/include/asm-sh/shmin.h index 36ba138a81fb..36ba138a81fb 100644 --- a/include/asm-sh/shmin/shmin.h +++ b/include/asm-sh/shmin.h | |||
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 6c1f8fde5ac4..3340126f4e0f 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -353,6 +353,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, | |||
353 | (unsigned long)_n_, sizeof(*(ptr))); \ | 353 | (unsigned long)_n_, sizeof(*(ptr))); \ |
354 | }) | 354 | }) |
355 | 355 | ||
356 | extern void *set_exception_table_vec(unsigned int vec, void *handler); | ||
357 | |||
358 | static inline void *set_exception_table_evt(unsigned int evt, void *handler) | ||
359 | { | ||
360 | return set_exception_table_vec(evt >> 5, handler); | ||
361 | } | ||
362 | |||
356 | /* XXX | 363 | /* XXX |
357 | * disable hlt during certain critical i/o operations | 364 | * disable hlt during certain critical i/o operations |
358 | */ | 365 | */ |
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index f1a0cbc966be..1c2abde122cd 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -324,8 +324,11 @@ | |||
324 | #define __NR_sync_file_range 314 | 324 | #define __NR_sync_file_range 314 |
325 | #define __NR_tee 315 | 325 | #define __NR_tee 315 |
326 | #define __NR_vmsplice 316 | 326 | #define __NR_vmsplice 316 |
327 | #define __NR_move_pages 317 | ||
328 | #define __NR_getcpu 318 | ||
329 | #define __NR_epoll_pwait 319 | ||
327 | 330 | ||
328 | #define NR_syscalls 317 | 331 | #define NR_syscalls 320 |
329 | 332 | ||
330 | #ifdef __KERNEL__ | 333 | #ifdef __KERNEL__ |
331 | 334 | ||
diff --git a/include/asm-sh64/checksum.h b/include/asm-sh64/checksum.h index fd034e9ae6e3..ba594ccb42e5 100644 --- a/include/asm-sh64/checksum.h +++ b/include/asm-sh64/checksum.h | |||
@@ -26,8 +26,7 @@ | |||
26 | * | 26 | * |
27 | * it's best to have buff aligned on a 32-bit boundary | 27 | * it's best to have buff aligned on a 32-bit boundary |
28 | */ | 28 | */ |
29 | asmlinkage unsigned int csum_partial(const unsigned char *buff, int len, | 29 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
30 | unsigned int sum); | ||
31 | 30 | ||
32 | /* | 31 | /* |
33 | * Note: when you get a NULL pointer exception here this means someone | 32 | * Note: when you get a NULL pointer exception here this means someone |
@@ -38,46 +37,34 @@ asmlinkage unsigned int csum_partial(const unsigned char *buff, int len, | |||
38 | */ | 37 | */ |
39 | 38 | ||
40 | 39 | ||
41 | unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, | 40 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, |
42 | unsigned int sum); | 41 | __wsum sum); |
43 | 42 | ||
44 | unsigned int csum_partial_copy_from_user(const char *src, char *dst, | 43 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
45 | int len, int sum, int *err_ptr); | 44 | int len, __wsum sum, int *err_ptr); |
46 | 45 | ||
47 | /* | 46 | static inline __sum16 csum_fold(__wsum csum) |
48 | * These are the old (and unsafe) way of doing checksums, a warning message will be | ||
49 | * printed if they are used and an exeption occurs. | ||
50 | * | ||
51 | * these functions should go away after some time. | ||
52 | */ | ||
53 | |||
54 | #define csum_partial_copy_fromuser csum_partial_copy | ||
55 | |||
56 | unsigned int csum_partial_copy(const char *src, char *dst, int len, | ||
57 | unsigned int sum); | ||
58 | |||
59 | static inline unsigned short csum_fold(unsigned int sum) | ||
60 | { | 47 | { |
48 | u32 sum = (__force u32)csum; | ||
61 | sum = (sum & 0xffff) + (sum >> 16); | 49 | sum = (sum & 0xffff) + (sum >> 16); |
62 | sum = (sum & 0xffff) + (sum >> 16); | 50 | sum = (sum & 0xffff) + (sum >> 16); |
63 | return ~(sum); | 51 | return (__force __sum16)~sum; |
64 | } | 52 | } |
65 | 53 | ||
66 | unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl); | 54 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
67 | 55 | ||
68 | unsigned long csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 56 | __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
69 | unsigned short len, unsigned short proto, | 57 | unsigned short len, unsigned short proto, |
70 | unsigned int sum); | 58 | __wsum sum); |
71 | 59 | ||
72 | /* | 60 | /* |
73 | * computes the checksum of the TCP/UDP pseudo-header | 61 | * computes the checksum of the TCP/UDP pseudo-header |
74 | * returns a 16-bit checksum, already complemented | 62 | * returns a 16-bit checksum, already complemented |
75 | */ | 63 | */ |
76 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 64 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
77 | unsigned long daddr, | ||
78 | unsigned short len, | 65 | unsigned short len, |
79 | unsigned short proto, | 66 | unsigned short proto, |
80 | unsigned int sum) | 67 | __wsum sum) |
81 | { | 68 | { |
82 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 69 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
83 | } | 70 | } |
@@ -86,7 +73,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
86 | * this routine is used for miscellaneous IP-like checksums, mainly | 73 | * this routine is used for miscellaneous IP-like checksums, mainly |
87 | * in icmp.c | 74 | * in icmp.c |
88 | */ | 75 | */ |
89 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 76 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
90 | { | 77 | { |
91 | return csum_fold(csum_partial(buff, len, 0)); | 78 | return csum_fold(csum_partial(buff, len, 0)); |
92 | } | 79 | } |
diff --git a/include/asm-sh64/device.h b/include/asm-sh64/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sh64/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h index 286158108974..267e631e9bbc 100644 --- a/include/asm-sparc/checksum.h +++ b/include/asm-sparc/checksum.h | |||
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * it's best to have buff aligned on a 32-bit boundary | 31 | * it's best to have buff aligned on a 32-bit boundary |
32 | */ | 32 | */ |
33 | extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 33 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
34 | 34 | ||
35 | /* the same as csum_partial, but copies from fs:src while it | 35 | /* the same as csum_partial, but copies from fs:src while it |
36 | * checksums | 36 | * checksums |
@@ -41,9 +41,8 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i | |||
41 | 41 | ||
42 | extern unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *); | 42 | extern unsigned int __csum_partial_copy_sparc_generic (const unsigned char *, unsigned char *); |
43 | 43 | ||
44 | static inline unsigned int | 44 | static inline __wsum |
45 | csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, int len, | 45 | csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) |
46 | unsigned int sum) | ||
47 | { | 46 | { |
48 | register unsigned int ret asm("o0") = (unsigned int)src; | 47 | register unsigned int ret asm("o0") = (unsigned int)src; |
49 | register char *d asm("o1") = dst; | 48 | register char *d asm("o1") = dst; |
@@ -57,42 +56,36 @@ csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst, int len | |||
57 | : "o2", "o3", "o4", "o5", "o7", | 56 | : "o2", "o3", "o4", "o5", "o7", |
58 | "g2", "g3", "g4", "g5", "g7", | 57 | "g2", "g3", "g4", "g5", "g7", |
59 | "memory", "cc"); | 58 | "memory", "cc"); |
60 | return ret; | 59 | return (__force __wsum)ret; |
61 | } | 60 | } |
62 | 61 | ||
63 | static inline unsigned int | 62 | static inline __wsum |
64 | csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, int len, | 63 | csum_partial_copy_from_user(const void __user *src, void *dst, int len, |
65 | unsigned int sum, int *err) | 64 | __wsum sum, int *err) |
66 | { | 65 | { |
67 | if (!access_ok (VERIFY_READ, src, len)) { | 66 | register unsigned long ret asm("o0") = (unsigned long)src; |
68 | *err = -EFAULT; | 67 | register char *d asm("o1") = dst; |
69 | memset (dst, 0, len); | 68 | register int l asm("g1") = len; |
70 | return sum; | 69 | register __wsum s asm("g7") = sum; |
71 | } else { | ||
72 | register unsigned long ret asm("o0") = (unsigned long)src; | ||
73 | register char *d asm("o1") = dst; | ||
74 | register int l asm("g1") = len; | ||
75 | register unsigned int s asm("g7") = sum; | ||
76 | 70 | ||
77 | __asm__ __volatile__ ( | 71 | __asm__ __volatile__ ( |
78 | ".section __ex_table,#alloc\n\t" | 72 | ".section __ex_table,#alloc\n\t" |
79 | ".align 4\n\t" | 73 | ".align 4\n\t" |
80 | ".word 1f,2\n\t" | 74 | ".word 1f,2\n\t" |
81 | ".previous\n" | 75 | ".previous\n" |
82 | "1:\n\t" | 76 | "1:\n\t" |
83 | "call __csum_partial_copy_sparc_generic\n\t" | 77 | "call __csum_partial_copy_sparc_generic\n\t" |
84 | " st %8, [%%sp + 64]\n" | 78 | " st %8, [%%sp + 64]\n" |
85 | : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s) | 79 | : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s) |
86 | : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err) | 80 | : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err) |
87 | : "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5", | 81 | : "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5", |
88 | "cc", "memory"); | 82 | "cc", "memory"); |
89 | return ret; | 83 | return (__force __wsum)ret; |
90 | } | 84 | } |
91 | } | ||
92 | 85 | ||
93 | static inline unsigned int | 86 | static inline __wsum |
94 | csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, int len, | 87 | csum_partial_copy_to_user(const void *src, void __user *dst, int len, |
95 | unsigned int sum, int *err) | 88 | __wsum sum, int *err) |
96 | { | 89 | { |
97 | if (!access_ok (VERIFY_WRITE, dst, len)) { | 90 | if (!access_ok (VERIFY_WRITE, dst, len)) { |
98 | *err = -EFAULT; | 91 | *err = -EFAULT; |
@@ -101,7 +94,7 @@ csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, i | |||
101 | register unsigned long ret asm("o0") = (unsigned long)src; | 94 | register unsigned long ret asm("o0") = (unsigned long)src; |
102 | register char __user *d asm("o1") = dst; | 95 | register char __user *d asm("o1") = dst; |
103 | register int l asm("g1") = len; | 96 | register int l asm("g1") = len; |
104 | register unsigned int s asm("g7") = sum; | 97 | register __wsum s asm("g7") = sum; |
105 | 98 | ||
106 | __asm__ __volatile__ ( | 99 | __asm__ __volatile__ ( |
107 | ".section __ex_table,#alloc\n\t" | 100 | ".section __ex_table,#alloc\n\t" |
@@ -116,7 +109,7 @@ csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, i | |||
116 | : "o2", "o3", "o4", "o5", "o7", | 109 | : "o2", "o3", "o4", "o5", "o7", |
117 | "g2", "g3", "g4", "g5", | 110 | "g2", "g3", "g4", "g5", |
118 | "cc", "memory"); | 111 | "cc", "memory"); |
119 | return ret; | 112 | return (__force __wsum)ret; |
120 | } | 113 | } |
121 | } | 114 | } |
122 | 115 | ||
@@ -126,10 +119,9 @@ csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, i | |||
126 | /* ihl is always 5 or greater, almost always is 5, and iph is word aligned | 119 | /* ihl is always 5 or greater, almost always is 5, and iph is word aligned |
127 | * the majority of the time. | 120 | * the majority of the time. |
128 | */ | 121 | */ |
129 | static inline unsigned short ip_fast_csum(const unsigned char *iph, | 122 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
130 | unsigned int ihl) | ||
131 | { | 123 | { |
132 | unsigned short sum; | 124 | __sum16 sum; |
133 | 125 | ||
134 | /* Note: We must read %2 before we touch %0 for the first time, | 126 | /* Note: We must read %2 before we touch %0 for the first time, |
135 | * because GCC can legitimately use the same register for | 127 | * because GCC can legitimately use the same register for |
@@ -164,7 +156,7 @@ static inline unsigned short ip_fast_csum(const unsigned char *iph, | |||
164 | } | 156 | } |
165 | 157 | ||
166 | /* Fold a partial checksum without adding pseudo headers. */ | 158 | /* Fold a partial checksum without adding pseudo headers. */ |
167 | static inline unsigned int csum_fold(unsigned int sum) | 159 | static inline __sum16 csum_fold(__wsum sum) |
168 | { | 160 | { |
169 | unsigned int tmp; | 161 | unsigned int tmp; |
170 | 162 | ||
@@ -173,23 +165,22 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
173 | "addx\t%1, %%g0, %1\n\t" | 165 | "addx\t%1, %%g0, %1\n\t" |
174 | "xnor\t%%g0, %1, %0" | 166 | "xnor\t%%g0, %1, %0" |
175 | : "=&r" (sum), "=r" (tmp) | 167 | : "=&r" (sum), "=r" (tmp) |
176 | : "0" (sum), "1" (sum<<16) | 168 | : "0" (sum), "1" ((__force u32)sum<<16) |
177 | : "cc"); | 169 | : "cc"); |
178 | return sum; | 170 | return (__force __sum16)sum; |
179 | } | 171 | } |
180 | 172 | ||
181 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 173 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
182 | unsigned long daddr, | 174 | unsigned short len, |
183 | unsigned int len, | ||
184 | unsigned short proto, | 175 | unsigned short proto, |
185 | unsigned int sum) | 176 | __wsum sum) |
186 | { | 177 | { |
187 | __asm__ __volatile__("addcc\t%1, %0, %0\n\t" | 178 | __asm__ __volatile__("addcc\t%1, %0, %0\n\t" |
188 | "addxcc\t%2, %0, %0\n\t" | 179 | "addxcc\t%2, %0, %0\n\t" |
189 | "addxcc\t%3, %0, %0\n\t" | 180 | "addxcc\t%3, %0, %0\n\t" |
190 | "addx\t%0, %%g0, %0\n\t" | 181 | "addx\t%0, %%g0, %0\n\t" |
191 | : "=r" (sum), "=r" (saddr) | 182 | : "=r" (sum), "=r" (saddr) |
192 | : "r" (daddr), "r" ((proto<<16)+len), "0" (sum), | 183 | : "r" (daddr), "r" (proto + len), "0" (sum), |
193 | "1" (saddr) | 184 | "1" (saddr) |
194 | : "cc"); | 185 | : "cc"); |
195 | return sum; | 186 | return sum; |
@@ -199,22 +190,20 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
199 | * computes the checksum of the TCP/UDP pseudo-header | 190 | * computes the checksum of the TCP/UDP pseudo-header |
200 | * returns a 16-bit checksum, already complemented | 191 | * returns a 16-bit checksum, already complemented |
201 | */ | 192 | */ |
202 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 193 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
203 | unsigned long daddr, | ||
204 | unsigned short len, | 194 | unsigned short len, |
205 | unsigned short proto, | 195 | unsigned short proto, |
206 | unsigned int sum) | 196 | __wsum sum) |
207 | { | 197 | { |
208 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 198 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
209 | } | 199 | } |
210 | 200 | ||
211 | #define _HAVE_ARCH_IPV6_CSUM | 201 | #define _HAVE_ARCH_IPV6_CSUM |
212 | 202 | ||
213 | static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 203 | static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
214 | struct in6_addr *daddr, | 204 | const struct in6_addr *daddr, |
215 | __u32 len, | 205 | __u32 len, unsigned short proto, |
216 | unsigned short proto, | 206 | __wsum sum) |
217 | unsigned int sum) | ||
218 | { | 207 | { |
219 | __asm__ __volatile__ ( | 208 | __asm__ __volatile__ ( |
220 | "addcc %3, %4, %%g4\n\t" | 209 | "addcc %3, %4, %%g4\n\t" |
@@ -245,7 +234,7 @@ static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
245 | } | 234 | } |
246 | 235 | ||
247 | /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ | 236 | /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ |
248 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 237 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
249 | { | 238 | { |
250 | return csum_fold(csum_partial(buff, len, 0)); | 239 | return csum_fold(csum_partial(buff, len, 0)); |
251 | } | 240 | } |
diff --git a/include/asm-sparc/device.h b/include/asm-sparc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sparc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h index 83a3dd15a6ed..aaf6ef40ee2f 100644 --- a/include/asm-sparc/elf.h +++ b/include/asm-sparc/elf.h | |||
@@ -8,11 +8,6 @@ | |||
8 | 8 | ||
9 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
10 | 10 | ||
11 | #ifdef __KERNEL__ | ||
12 | #include <asm/mbus.h> | ||
13 | #include <asm/uaccess.h> | ||
14 | #endif | ||
15 | |||
16 | /* | 11 | /* |
17 | * Sparc section types | 12 | * Sparc section types |
18 | */ | 13 | */ |
@@ -77,6 +72,23 @@ typedef unsigned long elf_greg_t; | |||
77 | #define ELF_NGREG 38 | 72 | #define ELF_NGREG 38 |
78 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 73 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
79 | 74 | ||
75 | typedef struct { | ||
76 | union { | ||
77 | unsigned long pr_regs[32]; | ||
78 | double pr_dregs[16]; | ||
79 | } pr_fr; | ||
80 | unsigned long __unused; | ||
81 | unsigned long pr_fsr; | ||
82 | unsigned char pr_qcnt; | ||
83 | unsigned char pr_q_entrysize; | ||
84 | unsigned char pr_en; | ||
85 | unsigned int pr_q[64]; | ||
86 | } elf_fpregset_t; | ||
87 | |||
88 | #ifdef __KERNEL__ | ||
89 | #include <asm/mbus.h> | ||
90 | #include <asm/uaccess.h> | ||
91 | |||
80 | /* Format is: | 92 | /* Format is: |
81 | * G0 --> G7 | 93 | * G0 --> G7 |
82 | * O0 --> O7 | 94 | * O0 --> O7 |
@@ -99,20 +111,7 @@ do { unsigned long *dest = &(__elf_regs[0]); \ | |||
99 | dest[34] = src->npc; \ | 111 | dest[34] = src->npc; \ |
100 | dest[35] = src->y; \ | 112 | dest[35] = src->y; \ |
101 | dest[36] = dest[37] = 0; /* XXX */ \ | 113 | dest[36] = dest[37] = 0; /* XXX */ \ |
102 | } while(0); /* Janitors: Don't touch this colon. */ | 114 | } while(0); /* Janitors: Don't touch this semicolon. */ |
103 | |||
104 | typedef struct { | ||
105 | union { | ||
106 | unsigned long pr_regs[32]; | ||
107 | double pr_dregs[16]; | ||
108 | } pr_fr; | ||
109 | unsigned long __unused; | ||
110 | unsigned long pr_fsr; | ||
111 | unsigned char pr_qcnt; | ||
112 | unsigned char pr_q_entrysize; | ||
113 | unsigned char pr_en; | ||
114 | unsigned int pr_q[64]; | ||
115 | } elf_fpregset_t; | ||
116 | 115 | ||
117 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ | 116 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ |
118 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; }) | 117 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; }) |
@@ -165,8 +164,8 @@ typedef struct { | |||
165 | 164 | ||
166 | #define ELF_PLATFORM (NULL) | 165 | #define ELF_PLATFORM (NULL) |
167 | 166 | ||
168 | #ifdef __KERNEL__ | ||
169 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | 167 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) |
170 | #endif | 168 | |
169 | #endif /* __KERNEL__ */ | ||
171 | 170 | ||
172 | #endif /* !(__ASMSPARC_ELF_H) */ | 171 | #endif /* !(__ASMSPARC_ELF_H) */ |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index c7a495afc82e..f7827fa4cd5e 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -318,12 +318,15 @@ | |||
318 | #define __NR_unshare 299 | 318 | #define __NR_unshare 299 |
319 | #define __NR_set_robust_list 300 | 319 | #define __NR_set_robust_list 300 |
320 | #define __NR_get_robust_list 301 | 320 | #define __NR_get_robust_list 301 |
321 | #define __NR_migrate_pages 302 | ||
322 | |||
323 | #define NR_SYSCALLS 303 | ||
321 | 324 | ||
322 | #ifdef __KERNEL__ | 325 | #ifdef __KERNEL__ |
323 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since | 326 | /* WARNING: You MAY NOT add syscall numbers larger than 302, since |
324 | * all of the syscall tables in the Sparc kernel are | 327 | * all of the syscall tables in the Sparc kernel are |
325 | * sized to have 301 entries (starting at zero). Therefore | 328 | * sized to have 302 entries (starting at zero). Therefore |
326 | * find a free slot in the 0-301 range. | 329 | * find a free slot in the 0-302 range. |
327 | */ | 330 | */ |
328 | 331 | ||
329 | #define _syscall0(type,name) \ | 332 | #define _syscall0(type,name) \ |
diff --git a/include/asm-sparc64/checksum.h b/include/asm-sparc64/checksum.h index dc8bed246fc9..70a006da7634 100644 --- a/include/asm-sparc64/checksum.h +++ b/include/asm-sparc64/checksum.h | |||
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * it's best to have buff aligned on a 32-bit boundary | 31 | * it's best to have buff aligned on a 32-bit boundary |
32 | */ | 32 | */ |
33 | extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 33 | extern __wsum csum_partial(const void * buff, int len, __wsum sum); |
34 | 34 | ||
35 | /* the same as csum_partial, but copies from user space while it | 35 | /* the same as csum_partial, but copies from user space while it |
36 | * checksums | 36 | * checksums |
@@ -38,52 +38,50 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i | |||
38 | * here even more important to align src and dst on a 32-bit (or even | 38 | * here even more important to align src and dst on a 32-bit (or even |
39 | * better 64-bit) boundary | 39 | * better 64-bit) boundary |
40 | */ | 40 | */ |
41 | extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, | 41 | extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
42 | unsigned char *dst, | 42 | int len, __wsum sum); |
43 | int len, unsigned int sum); | 43 | |
44 | 44 | extern long __csum_partial_copy_from_user(const void __user *src, | |
45 | extern long __csum_partial_copy_from_user(const unsigned char __user *src, | 45 | void *dst, int len, |
46 | unsigned char *dst, int len, | 46 | __wsum sum); |
47 | unsigned int sum); | 47 | |
48 | 48 | static inline __wsum | |
49 | static inline unsigned int | 49 | csum_partial_copy_from_user(const void __user *src, |
50 | csum_partial_copy_from_user(const unsigned char __user *src, | 50 | void *dst, int len, |
51 | unsigned char *dst, int len, | 51 | __wsum sum, int *err) |
52 | unsigned int sum, int *err) | ||
53 | { | 52 | { |
54 | long ret = __csum_partial_copy_from_user(src, dst, len, sum); | 53 | long ret = __csum_partial_copy_from_user(src, dst, len, sum); |
55 | if (ret < 0) | 54 | if (ret < 0) |
56 | *err = -EFAULT; | 55 | *err = -EFAULT; |
57 | return (unsigned int) ret; | 56 | return (__force __wsum) ret; |
58 | } | 57 | } |
59 | 58 | ||
60 | /* | 59 | /* |
61 | * Copy and checksum to user | 60 | * Copy and checksum to user |
62 | */ | 61 | */ |
63 | #define HAVE_CSUM_COPY_USER | 62 | #define HAVE_CSUM_COPY_USER |
64 | extern long __csum_partial_copy_to_user(const unsigned char *src, | 63 | extern long __csum_partial_copy_to_user(const void *src, |
65 | unsigned char __user *dst, int len, | 64 | void __user *dst, int len, |
66 | unsigned int sum); | 65 | __wsum sum); |
67 | 66 | ||
68 | static inline unsigned int | 67 | static inline __wsum |
69 | csum_and_copy_to_user(const unsigned char *src, | 68 | csum_and_copy_to_user(const void *src, |
70 | unsigned char __user *dst, int len, | 69 | void __user *dst, int len, |
71 | unsigned int sum, int *err) | 70 | __wsum sum, int *err) |
72 | { | 71 | { |
73 | long ret = __csum_partial_copy_to_user(src, dst, len, sum); | 72 | long ret = __csum_partial_copy_to_user(src, dst, len, sum); |
74 | if (ret < 0) | 73 | if (ret < 0) |
75 | *err = -EFAULT; | 74 | *err = -EFAULT; |
76 | return (unsigned int) ret; | 75 | return (__force __wsum) ret; |
77 | } | 76 | } |
78 | 77 | ||
79 | /* ihl is always 5 or greater, almost always is 5, and iph is word aligned | 78 | /* ihl is always 5 or greater, almost always is 5, and iph is word aligned |
80 | * the majority of the time. | 79 | * the majority of the time. |
81 | */ | 80 | */ |
82 | extern unsigned short ip_fast_csum(__const__ unsigned char *iph, | 81 | extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
83 | unsigned int ihl); | ||
84 | 82 | ||
85 | /* Fold a partial checksum without adding pseudo headers. */ | 83 | /* Fold a partial checksum without adding pseudo headers. */ |
86 | static inline unsigned short csum_fold(unsigned int sum) | 84 | static inline __sum16 csum_fold(__wsum sum) |
87 | { | 85 | { |
88 | unsigned int tmp; | 86 | unsigned int tmp; |
89 | 87 | ||
@@ -93,16 +91,15 @@ static inline unsigned short csum_fold(unsigned int sum) | |||
93 | " addc %1, %%g0, %1\n" | 91 | " addc %1, %%g0, %1\n" |
94 | " xnor %%g0, %1, %0\n" | 92 | " xnor %%g0, %1, %0\n" |
95 | : "=&r" (sum), "=r" (tmp) | 93 | : "=&r" (sum), "=r" (tmp) |
96 | : "0" (sum), "1" (sum<<16) | 94 | : "0" (sum), "1" ((__force u32)sum<<16) |
97 | : "cc"); | 95 | : "cc"); |
98 | return (sum & 0xffff); | 96 | return (__force __sum16)sum; |
99 | } | 97 | } |
100 | 98 | ||
101 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | 99 | static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
102 | unsigned long daddr, | ||
103 | unsigned int len, | 100 | unsigned int len, |
104 | unsigned short proto, | 101 | unsigned short proto, |
105 | unsigned int sum) | 102 | __wsum sum) |
106 | { | 103 | { |
107 | __asm__ __volatile__( | 104 | __asm__ __volatile__( |
108 | " addcc %1, %0, %0\n" | 105 | " addcc %1, %0, %0\n" |
@@ -110,7 +107,7 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
110 | " addccc %3, %0, %0\n" | 107 | " addccc %3, %0, %0\n" |
111 | " addc %0, %%g0, %0\n" | 108 | " addc %0, %%g0, %0\n" |
112 | : "=r" (sum), "=r" (saddr) | 109 | : "=r" (sum), "=r" (saddr) |
113 | : "r" (daddr), "r" ((proto<<16)+len), "0" (sum), "1" (saddr) | 110 | : "r" (daddr), "r" (proto + len), "0" (sum), "1" (saddr) |
114 | : "cc"); | 111 | : "cc"); |
115 | return sum; | 112 | return sum; |
116 | } | 113 | } |
@@ -119,22 +116,20 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
119 | * computes the checksum of the TCP/UDP pseudo-header | 116 | * computes the checksum of the TCP/UDP pseudo-header |
120 | * returns a 16-bit checksum, already complemented | 117 | * returns a 16-bit checksum, already complemented |
121 | */ | 118 | */ |
122 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 119 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
123 | unsigned long daddr, | ||
124 | unsigned short len, | 120 | unsigned short len, |
125 | unsigned short proto, | 121 | unsigned short proto, |
126 | unsigned int sum) | 122 | __wsum sum) |
127 | { | 123 | { |
128 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 124 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
129 | } | 125 | } |
130 | 126 | ||
131 | #define _HAVE_ARCH_IPV6_CSUM | 127 | #define _HAVE_ARCH_IPV6_CSUM |
132 | 128 | ||
133 | static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 129 | static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
134 | struct in6_addr *daddr, | 130 | const struct in6_addr *daddr, |
135 | __u32 len, | 131 | __u32 len, unsigned short proto, |
136 | unsigned short proto, | 132 | __wsum sum) |
137 | unsigned int sum) | ||
138 | { | 133 | { |
139 | __asm__ __volatile__ ( | 134 | __asm__ __volatile__ ( |
140 | " addcc %3, %4, %%g7\n" | 135 | " addcc %3, %4, %%g7\n" |
@@ -165,7 +160,7 @@ static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
165 | } | 160 | } |
166 | 161 | ||
167 | /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ | 162 | /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ |
168 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 163 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
169 | { | 164 | { |
170 | return csum_fold(csum_partial(buff, len, 0)); | 165 | return csum_fold(csum_partial(buff, len, 0)); |
171 | } | 166 | } |
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index c73935dc7ba1..36511ca51416 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h | |||
@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | |||
164 | return (u32)(unsigned long)uptr; | 164 | return (u32)(unsigned long)uptr; |
165 | } | 165 | } |
166 | 166 | ||
167 | static __inline__ void __user *compat_alloc_user_space(long len) | 167 | static inline void __user *compat_alloc_user_space(long len) |
168 | { | 168 | { |
169 | struct pt_regs *regs = current_thread_info()->kregs; | 169 | struct pt_regs *regs = current_thread_info()->kregs; |
170 | unsigned long usp = regs->u_regs[UREG_I6]; | 170 | unsigned long usp = regs->u_regs[UREG_I6]; |
@@ -174,7 +174,10 @@ static __inline__ void __user *compat_alloc_user_space(long len) | |||
174 | else | 174 | else |
175 | usp &= 0xffffffffUL; | 175 | usp &= 0xffffffffUL; |
176 | 176 | ||
177 | return (void __user *) (usp - len); | 177 | usp -= len; |
178 | usp &= ~0x7UL; | ||
179 | |||
180 | return (void __user *) usp; | ||
178 | } | 181 | } |
179 | 182 | ||
180 | struct compat_ipc64_perm { | 183 | struct compat_ipc64_perm { |
diff --git a/include/asm-sparc64/device.h b/include/asm-sparc64/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sparc64/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h index dee40206b221..7392fc4a954e 100644 --- a/include/asm-sparc64/futex.h +++ b/include/asm-sparc64/futex.h | |||
@@ -87,24 +87,22 @@ static inline int | |||
87 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 87 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) |
88 | { | 88 | { |
89 | __asm__ __volatile__( | 89 | __asm__ __volatile__( |
90 | "\n1: lduwa [%2] %%asi, %0\n" | 90 | "\n1: casa [%3] %%asi, %2, %0\n" |
91 | "2: casa [%2] %%asi, %0, %1\n" | 91 | "2:\n" |
92 | "3:\n" | ||
93 | " .section .fixup,#alloc,#execinstr\n" | 92 | " .section .fixup,#alloc,#execinstr\n" |
94 | " .align 4\n" | 93 | " .align 4\n" |
95 | "4: ba 3b\n" | 94 | "3: ba 2b\n" |
96 | " mov %3, %0\n" | 95 | " mov %4, %0\n" |
97 | " .previous\n" | 96 | " .previous\n" |
98 | " .section __ex_table,\"a\"\n" | 97 | " .section __ex_table,\"a\"\n" |
99 | " .align 4\n" | 98 | " .align 4\n" |
100 | " .word 1b, 4b\n" | 99 | " .word 1b, 3b\n" |
101 | " .word 2b, 4b\n" | ||
102 | " .previous\n" | 100 | " .previous\n" |
103 | : "=&r" (oldval) | 101 | : "=r" (newval) |
104 | : "r" (newval), "r" (uaddr), "i" (-EFAULT) | 102 | : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT) |
105 | : "memory"); | 103 | : "memory"); |
106 | 104 | ||
107 | return oldval; | 105 | return newval; |
108 | } | 106 | } |
109 | 107 | ||
110 | #endif /* !(_SPARC64_FUTEX_H) */ | 108 | #endif /* !(_SPARC64_FUTEX_H) */ |
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index e1ea67bc32f2..ca6560288ae8 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #define PCI_IRQ_NONE 0xffffffff | 19 | #define PCI_IRQ_NONE 0xffffffff |
20 | 20 | ||
21 | #define PCI_CACHE_LINE_BYTES 64 | ||
22 | |||
21 | static inline void pcibios_set_master(struct pci_dev *dev) | 23 | static inline void pcibios_set_master(struct pci_dev *dev) |
22 | { | 24 | { |
23 | /* No special bus mastering setup handling */ | 25 | /* No special bus mastering setup handling */ |
@@ -291,10 +293,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
291 | enum pci_mmap_state mmap_state, | 293 | enum pci_mmap_state mmap_state, |
292 | int write_combine); | 294 | int write_combine); |
293 | 295 | ||
294 | /* Platform specific MWI support. */ | ||
295 | #define HAVE_ARCH_PCI_MWI | ||
296 | extern int pcibios_prep_mwi(struct pci_dev *dev); | ||
297 | |||
298 | extern void | 296 | extern void |
299 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 297 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
300 | struct resource *res); | 298 | struct resource *res); |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 124cf076717f..63669dad0d72 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -320,12 +320,16 @@ | |||
320 | #define __NR_unshare 299 | 320 | #define __NR_unshare 299 |
321 | #define __NR_set_robust_list 300 | 321 | #define __NR_set_robust_list 300 |
322 | #define __NR_get_robust_list 301 | 322 | #define __NR_get_robust_list 301 |
323 | #define __NR_migrate_pages 302 | ||
324 | |||
325 | #define NR_SYSCALLS 303 | ||
323 | 326 | ||
324 | #ifdef __KERNEL__ | 327 | #ifdef __KERNEL__ |
325 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since | 328 | |
329 | /* WARNING: You MAY NOT add syscall numbers larger than 302, since | ||
326 | * all of the syscall tables in the Sparc kernel are | 330 | * all of the syscall tables in the Sparc kernel are |
327 | * sized to have 301 entries (starting at zero). Therefore | 331 | * sized to have 302 entries (starting at zero). Therefore |
328 | * find a free slot in the 0-301 range. | 332 | * find a free slot in the 0-302 range. |
329 | */ | 333 | */ |
330 | 334 | ||
331 | #define _syscall0(type,name) \ | 335 | #define _syscall0(type,name) \ |
diff --git a/include/asm-um/archparam-ppc.h b/include/asm-um/archparam-ppc.h index 172cd6ffacc4..4269d8a37b4f 100644 --- a/include/asm-um/archparam-ppc.h +++ b/include/asm-um/archparam-ppc.h | |||
@@ -1,15 +1,6 @@ | |||
1 | #ifndef __UM_ARCHPARAM_PPC_H | 1 | #ifndef __UM_ARCHPARAM_PPC_H |
2 | #define __UM_ARCHPARAM_PPC_H | 2 | #define __UM_ARCHPARAM_PPC_H |
3 | 3 | ||
4 | /********* Bits for asm-um/hw_irq.h **********/ | ||
5 | |||
6 | struct hw_interrupt_type; | ||
7 | |||
8 | /********* Bits for asm-um/hardirq.h **********/ | ||
9 | |||
10 | #define irq_enter(cpu, irq) hardirq_enter(cpu) | ||
11 | #define irq_exit(cpu, irq) hardirq_exit(cpu) | ||
12 | |||
13 | /********* Bits for asm-um/string.h **********/ | 4 | /********* Bits for asm-um/string.h **********/ |
14 | 5 | ||
15 | #define __HAVE_ARCH_STRRCHR | 6 | #define __HAVE_ARCH_STRRCHR |
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S index 1010153faaf9..f0454516dd31 100644 --- a/include/asm-um/common.lds.S +++ b/include/asm-um/common.lds.S | |||
@@ -42,13 +42,7 @@ | |||
42 | 42 | ||
43 | __initcall_start = .; | 43 | __initcall_start = .; |
44 | .initcall.init : { | 44 | .initcall.init : { |
45 | *(.initcall1.init) | 45 | INITCALLS |
46 | *(.initcall2.init) | ||
47 | *(.initcall3.init) | ||
48 | *(.initcall4.init) | ||
49 | *(.initcall5.init) | ||
50 | *(.initcall6.init) | ||
51 | *(.initcall7.init) | ||
52 | } | 46 | } |
53 | __initcall_end = .; | 47 | __initcall_end = .; |
54 | 48 | ||
diff --git a/include/asm-um/device.h b/include/asm-um/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-um/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-v850/checksum.h b/include/asm-v850/checksum.h index 4df5e71098f9..d1dddd938262 100644 --- a/include/asm-v850/checksum.h +++ b/include/asm-v850/checksum.h | |||
@@ -26,8 +26,7 @@ | |||
26 | * | 26 | * |
27 | * it's best to have buff aligned on a 32-bit boundary | 27 | * it's best to have buff aligned on a 32-bit boundary |
28 | */ | 28 | */ |
29 | extern unsigned int csum_partial (const unsigned char * buff, int len, | 29 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
30 | unsigned int sum); | ||
31 | 30 | ||
32 | /* | 31 | /* |
33 | * the same as csum_partial, but copies from src while it | 32 | * the same as csum_partial, but copies from src while it |
@@ -36,8 +35,8 @@ extern unsigned int csum_partial (const unsigned char * buff, int len, | |||
36 | * here even more important to align src and dst on a 32-bit (or even | 35 | * here even more important to align src and dst on a 32-bit (or even |
37 | * better 64-bit) boundary | 36 | * better 64-bit) boundary |
38 | */ | 37 | */ |
39 | extern unsigned csum_partial_copy (const unsigned char *src, | 38 | extern __wsum csum_partial_copy_nocheck(const void *src, |
40 | unsigned char *dst, int len, unsigned sum); | 39 | void *dst, int len, __wsum sum); |
41 | 40 | ||
42 | 41 | ||
43 | /* | 42 | /* |
@@ -46,20 +45,17 @@ extern unsigned csum_partial_copy (const unsigned char *src, | |||
46 | * here even more important to align src and dst on a 32-bit (or even | 45 | * here even more important to align src and dst on a 32-bit (or even |
47 | * better 64-bit) boundary | 46 | * better 64-bit) boundary |
48 | */ | 47 | */ |
49 | extern unsigned csum_partial_copy_from_user (const unsigned char *src, | 48 | extern __wsum csum_partial_copy_from_user (const void *src, |
50 | unsigned char *dst, | 49 | void *dst, |
51 | int len, unsigned sum, | 50 | int len, __wsum sum, |
52 | int *csum_err); | 51 | int *csum_err); |
53 | 52 | ||
54 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 53 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
55 | csum_partial_copy ((src), (dst), (len), (sum)) | ||
56 | |||
57 | unsigned short ip_fast_csum (unsigned char *iph, unsigned int ihl); | ||
58 | 54 | ||
59 | /* | 55 | /* |
60 | * Fold a partial checksum | 56 | * Fold a partial checksum |
61 | */ | 57 | */ |
62 | static inline unsigned int csum_fold (unsigned long sum) | 58 | static inline __sum16 csum_fold (__wsum sum) |
63 | { | 59 | { |
64 | unsigned int result; | 60 | unsigned int result; |
65 | /* | 61 | /* |
@@ -68,7 +64,7 @@ static inline unsigned int csum_fold (unsigned long sum) | |||
68 | add %1, %0 H L H+L+C H+L | 64 | add %1, %0 H L H+L+C H+L |
69 | */ | 65 | */ |
70 | asm ("hsw %1, %0; add %1, %0" : "=&r" (result) : "r" (sum)); | 66 | asm ("hsw %1, %0; add %1, %0" : "=&r" (result) : "r" (sum)); |
71 | return (~result) >> 16; | 67 | return (__force __sum16)(~result >> 16); |
72 | } | 68 | } |
73 | 69 | ||
74 | 70 | ||
@@ -76,10 +72,10 @@ static inline unsigned int csum_fold (unsigned long sum) | |||
76 | * computes the checksum of the TCP/UDP pseudo-header | 72 | * computes the checksum of the TCP/UDP pseudo-header |
77 | * returns a 16-bit checksum, already complemented | 73 | * returns a 16-bit checksum, already complemented |
78 | */ | 74 | */ |
79 | static inline unsigned int | 75 | static inline __wsum |
80 | csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, | 76 | csum_tcpudp_nofold (__be32 saddr, __be32 daddr, |
81 | unsigned short len, | 77 | unsigned short len, |
82 | unsigned short proto, unsigned int sum) | 78 | unsigned short proto, __wsum sum) |
83 | { | 79 | { |
84 | int __carry; | 80 | int __carry; |
85 | __asm__ ("add %2, %0;" | 81 | __asm__ ("add %2, %0;" |
@@ -93,15 +89,15 @@ csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, | |||
93 | "add %1, %0" | 89 | "add %1, %0" |
94 | : "=&r" (sum), "=&r" (__carry) | 90 | : "=&r" (sum), "=&r" (__carry) |
95 | : "r" (daddr), "r" (saddr), | 91 | : "r" (daddr), "r" (saddr), |
96 | "r" (ntohs (len) + (proto << 8)), | 92 | "r" ((len + proto) << 8), |
97 | "0" (sum)); | 93 | "0" (sum)); |
98 | return sum; | 94 | return sum; |
99 | } | 95 | } |
100 | 96 | ||
101 | static inline unsigned short int | 97 | static inline __sum16 |
102 | csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, | 98 | csum_tcpudp_magic (__be32 saddr, __be32 daddr, |
103 | unsigned short len, | 99 | unsigned short len, |
104 | unsigned short proto, unsigned int sum) | 100 | unsigned short proto, __wsum sum) |
105 | { | 101 | { |
106 | return csum_fold (csum_tcpudp_nofold (saddr, daddr, len, proto, sum)); | 102 | return csum_fold (csum_tcpudp_nofold (saddr, daddr, len, proto, sum)); |
107 | } | 103 | } |
@@ -110,7 +106,7 @@ csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, | |||
110 | * this routine is used for miscellaneous IP-like checksums, mainly | 106 | * this routine is used for miscellaneous IP-like checksums, mainly |
111 | * in icmp.c | 107 | * in icmp.c |
112 | */ | 108 | */ |
113 | extern unsigned short ip_compute_csum (const unsigned char * buff, int len); | 109 | extern __sum16 ip_compute_csum(const void *buff, int len); |
114 | 110 | ||
115 | 111 | ||
116 | #endif /* __V850_CHECKSUM_H__ */ | 112 | #endif /* __V850_CHECKSUM_H__ */ |
diff --git a/include/asm-v850/device.h b/include/asm-v850/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-v850/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index ed59aa4c6ff9..9d1916e59c04 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h | |||
@@ -163,6 +163,7 @@ extern u8 x86_acpiid_to_apicid[]; | |||
163 | #define ARCH_HAS_POWER_INIT 1 | 163 | #define ARCH_HAS_POWER_INIT 1 |
164 | 164 | ||
165 | extern int acpi_skip_timer_override; | 165 | extern int acpi_skip_timer_override; |
166 | extern int acpi_use_timer_override; | ||
166 | 167 | ||
167 | #endif /*__KERNEL__*/ | 168 | #endif /*__KERNEL__*/ |
168 | 169 | ||
diff --git a/include/asm-x86_64/checksum.h b/include/asm-x86_64/checksum.h index 989469e8e0b7..419fe88a0342 100644 --- a/include/asm-x86_64/checksum.h +++ b/include/asm-x86_64/checksum.h | |||
@@ -19,15 +19,16 @@ | |||
19 | * the last step before putting a checksum into a packet. | 19 | * the last step before putting a checksum into a packet. |
20 | * Make sure not to mix with 64bit checksums. | 20 | * Make sure not to mix with 64bit checksums. |
21 | */ | 21 | */ |
22 | static inline unsigned int csum_fold(unsigned int sum) | 22 | static inline __sum16 csum_fold(__wsum sum) |
23 | { | 23 | { |
24 | __asm__( | 24 | __asm__( |
25 | " addl %1,%0\n" | 25 | " addl %1,%0\n" |
26 | " adcl $0xffff,%0" | 26 | " adcl $0xffff,%0" |
27 | : "=r" (sum) | 27 | : "=r" (sum) |
28 | : "r" (sum << 16), "0" (sum & 0xffff0000) | 28 | : "r" ((__force u32)sum << 16), |
29 | "0" ((__force u32)sum & 0xffff0000) | ||
29 | ); | 30 | ); |
30 | return (~sum) >> 16; | 31 | return (__force __sum16)(~(__force u32)sum >> 16); |
31 | } | 32 | } |
32 | 33 | ||
33 | /* | 34 | /* |
@@ -43,7 +44,7 @@ static inline unsigned int csum_fold(unsigned int sum) | |||
43 | * iph: ipv4 header | 44 | * iph: ipv4 header |
44 | * ihl: length of header / 4 | 45 | * ihl: length of header / 4 |
45 | */ | 46 | */ |
46 | static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | 47 | static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
47 | { | 48 | { |
48 | unsigned int sum; | 49 | unsigned int sum; |
49 | 50 | ||
@@ -70,7 +71,7 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
70 | : "=r" (sum), "=r" (iph), "=r" (ihl) | 71 | : "=r" (sum), "=r" (iph), "=r" (ihl) |
71 | : "1" (iph), "2" (ihl) | 72 | : "1" (iph), "2" (ihl) |
72 | : "memory"); | 73 | : "memory"); |
73 | return(sum); | 74 | return (__force __sum16)sum; |
74 | } | 75 | } |
75 | 76 | ||
76 | /** | 77 | /** |
@@ -84,16 +85,17 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl) | |||
84 | * Returns the pseudo header checksum the input data. Result is | 85 | * Returns the pseudo header checksum the input data. Result is |
85 | * 32bit unfolded. | 86 | * 32bit unfolded. |
86 | */ | 87 | */ |
87 | static inline unsigned long | 88 | static inline __wsum |
88 | csum_tcpudp_nofold(unsigned saddr, unsigned daddr, unsigned short len, | 89 | csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, |
89 | unsigned short proto, unsigned int sum) | 90 | unsigned short proto, __wsum sum) |
90 | { | 91 | { |
91 | asm(" addl %1, %0\n" | 92 | asm(" addl %1, %0\n" |
92 | " adcl %2, %0\n" | 93 | " adcl %2, %0\n" |
93 | " adcl %3, %0\n" | 94 | " adcl %3, %0\n" |
94 | " adcl $0, %0\n" | 95 | " adcl $0, %0\n" |
95 | : "=r" (sum) | 96 | : "=r" (sum) |
96 | : "g" (daddr), "g" (saddr), "g" ((ntohs(len)<<16)+proto*256), "0" (sum)); | 97 | : "g" (daddr), "g" (saddr), |
98 | "g" ((len + proto)<<8), "0" (sum)); | ||
97 | return sum; | 99 | return sum; |
98 | } | 100 | } |
99 | 101 | ||
@@ -109,9 +111,9 @@ csum_tcpudp_nofold(unsigned saddr, unsigned daddr, unsigned short len, | |||
109 | * Returns the 16bit pseudo header checksum the input data already | 111 | * Returns the 16bit pseudo header checksum the input data already |
110 | * complemented and ready to be filled in. | 112 | * complemented and ready to be filled in. |
111 | */ | 113 | */ |
112 | static inline unsigned short int | 114 | static inline __sum16 |
113 | csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, | 115 | csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
114 | unsigned short len, unsigned short proto, unsigned int sum) | 116 | unsigned short len, unsigned short proto, __wsum sum) |
115 | { | 117 | { |
116 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 118 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
117 | } | 119 | } |
@@ -126,25 +128,25 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, | |||
126 | * Before filling it in it needs to be csum_fold()'ed. | 128 | * Before filling it in it needs to be csum_fold()'ed. |
127 | * buff should be aligned to a 64bit boundary if possible. | 129 | * buff should be aligned to a 64bit boundary if possible. |
128 | */ | 130 | */ |
129 | extern unsigned int csum_partial(const unsigned char *buff, unsigned len, unsigned int sum); | 131 | extern __wsum csum_partial(const void *buff, int len, __wsum sum); |
130 | 132 | ||
131 | #define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER 1 | 133 | #define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER 1 |
132 | #define HAVE_CSUM_COPY_USER 1 | 134 | #define HAVE_CSUM_COPY_USER 1 |
133 | 135 | ||
134 | 136 | ||
135 | /* Do not call this directly. Use the wrappers below */ | 137 | /* Do not call this directly. Use the wrappers below */ |
136 | extern unsigned long csum_partial_copy_generic(const unsigned char *src, const unsigned char *dst, | 138 | extern __wsum csum_partial_copy_generic(const void *src, const void *dst, |
137 | unsigned len, | 139 | int len, |
138 | unsigned sum, | 140 | __wsum sum, |
139 | int *src_err_ptr, int *dst_err_ptr); | 141 | int *src_err_ptr, int *dst_err_ptr); |
140 | 142 | ||
141 | 143 | ||
142 | extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, | 144 | extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
143 | int len, unsigned int isum, int *errp); | 145 | int len, __wsum isum, int *errp); |
144 | extern unsigned int csum_partial_copy_to_user(const unsigned char *src, unsigned char __user *dst, | 146 | extern __wsum csum_partial_copy_to_user(const void *src, void __user *dst, |
145 | int len, unsigned int isum, int *errp); | 147 | int len, __wsum isum, int *errp); |
146 | extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, | 148 | extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, |
147 | unsigned int sum); | 149 | __wsum sum); |
148 | 150 | ||
149 | /* Old names. To be removed. */ | 151 | /* Old names. To be removed. */ |
150 | #define csum_and_copy_to_user csum_partial_copy_to_user | 152 | #define csum_and_copy_to_user csum_partial_copy_to_user |
@@ -158,7 +160,7 @@ extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned | |||
158 | * Returns the 16bit folded/inverted checksum of the passed buffer. | 160 | * Returns the 16bit folded/inverted checksum of the passed buffer. |
159 | * Ready to fill in. | 161 | * Ready to fill in. |
160 | */ | 162 | */ |
161 | extern unsigned short ip_compute_csum(unsigned char * buff, int len); | 163 | extern __sum16 ip_compute_csum(const void *buff, int len); |
162 | 164 | ||
163 | /** | 165 | /** |
164 | * csum_ipv6_magic - Compute checksum of an IPv6 pseudo header. | 166 | * csum_ipv6_magic - Compute checksum of an IPv6 pseudo header. |
@@ -176,9 +178,9 @@ extern unsigned short ip_compute_csum(unsigned char * buff, int len); | |||
176 | struct in6_addr; | 178 | struct in6_addr; |
177 | 179 | ||
178 | #define _HAVE_ARCH_IPV6_CSUM 1 | 180 | #define _HAVE_ARCH_IPV6_CSUM 1 |
179 | extern unsigned short | 181 | extern __sum16 |
180 | csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, | 182 | csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, |
181 | __u32 len, unsigned short proto, unsigned int sum); | 183 | __u32 len, unsigned short proto, __wsum sum); |
182 | 184 | ||
183 | static inline unsigned add32_with_carry(unsigned a, unsigned b) | 185 | static inline unsigned add32_with_carry(unsigned a, unsigned b) |
184 | { | 186 | { |
diff --git a/include/asm-x86_64/device.h b/include/asm-x86_64/device.h new file mode 100644 index 000000000000..3afa03f33a36 --- /dev/null +++ b/include/asm-x86_64/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_X86_64_DEVICE_H | ||
7 | #define _ASM_X86_64_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_X86_64_DEVICE_H */ | ||
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 792dd52fcd70..179cce755aa7 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #ifndef __ASSEMBLY__ | 76 | #ifndef __ASSEMBLY__ |
77 | typedef int vector_irq_t[NR_VECTORS]; | 77 | typedef int vector_irq_t[NR_VECTORS]; |
78 | DECLARE_PER_CPU(vector_irq_t, vector_irq); | 78 | DECLARE_PER_CPU(vector_irq_t, vector_irq); |
79 | extern void __setup_vector_irq(int cpu); | ||
80 | extern spinlock_t vector_lock; | ||
79 | 81 | ||
80 | /* | 82 | /* |
81 | * Various low-level irq details needed by irq.c, process.c, | 83 | * Various low-level irq details needed by irq.c, process.c, |
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index 171ec2dc8c04..561ecbfd4cb5 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h | |||
@@ -12,10 +12,6 @@ | |||
12 | 12 | ||
13 | #define APIC_MISMATCH_DEBUG | 13 | #define APIC_MISMATCH_DEBUG |
14 | 14 | ||
15 | #define IO_APIC_BASE(idx) \ | ||
16 | ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \ | ||
17 | + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK))) | ||
18 | |||
19 | /* | 15 | /* |
20 | * The structure of the IO-APIC: | 16 | * The structure of the IO-APIC: |
21 | */ | 17 | */ |
@@ -119,36 +115,6 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; | |||
119 | /* non-0 if default (table-less) MP configuration */ | 115 | /* non-0 if default (table-less) MP configuration */ |
120 | extern int mpc_default_type; | 116 | extern int mpc_default_type; |
121 | 117 | ||
122 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) | ||
123 | { | ||
124 | *IO_APIC_BASE(apic) = reg; | ||
125 | return *(IO_APIC_BASE(apic)+4); | ||
126 | } | ||
127 | |||
128 | static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) | ||
129 | { | ||
130 | *IO_APIC_BASE(apic) = reg; | ||
131 | *(IO_APIC_BASE(apic)+4) = value; | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * Re-write a value: to be used for read-modify-write | ||
136 | * cycles where the read already set up the index register. | ||
137 | */ | ||
138 | static inline void io_apic_modify(unsigned int apic, unsigned int value) | ||
139 | { | ||
140 | *(IO_APIC_BASE(apic)+4) = value; | ||
141 | } | ||
142 | |||
143 | /* | ||
144 | * Synchronize the IO-APIC and the CPU by doing | ||
145 | * a dummy read from the IO-APIC | ||
146 | */ | ||
147 | static inline void io_apic_sync(unsigned int apic) | ||
148 | { | ||
149 | (void) *(IO_APIC_BASE(apic)+4); | ||
150 | } | ||
151 | |||
152 | /* 1 if "noapic" boot option passed */ | 118 | /* 1 if "noapic" boot option passed */ |
153 | extern int skip_ioapic_setup; | 119 | extern int skip_ioapic_setup; |
154 | 120 | ||
diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index 14996d962bac..5642634843c4 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h | |||
@@ -109,6 +109,15 @@ extern struct x8664_pda _proxy_pda; | |||
109 | #define sub_pda(field,val) pda_to_op("sub",field,val) | 109 | #define sub_pda(field,val) pda_to_op("sub",field,val) |
110 | #define or_pda(field,val) pda_to_op("or",field,val) | 110 | #define or_pda(field,val) pda_to_op("or",field,val) |
111 | 111 | ||
112 | /* This is not atomic against other CPUs -- CPU preemption needs to be off */ | ||
113 | #define test_and_clear_bit_pda(bit,field) ({ \ | ||
114 | int old__; \ | ||
115 | asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \ | ||
116 | : "=r" (old__), "+m" (_proxy_pda.field) \ | ||
117 | : "dIr" (bit), "i" (pda_offset(field)) : "memory"); \ | ||
118 | old__; \ | ||
119 | }) | ||
120 | |||
112 | #endif | 121 | #endif |
113 | 122 | ||
114 | #define PDA_STACKOFFSET (5*8) | 123 | #define PDA_STACKOFFSET (5*8) |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 6899e770b173..0555c1c4d8fa 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot) | |||
366 | { | 366 | { |
367 | pte_t pte; | 367 | pte_t pte; |
368 | pte_val(pte) = physpage | pgprot_val(pgprot); | 368 | pte_val(pte) = physpage | pgprot_val(pgprot); |
369 | pte_val(pte) &= __supported_pte_mask; | ||
369 | return pte; | 370 | return pte; |
370 | } | 371 | } |
371 | 372 | ||
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index c181fef786e4..e72cfcdf5344 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -122,6 +122,8 @@ extern int fix_aperture; | |||
122 | extern int reboot_force; | 122 | extern int reboot_force; |
123 | extern int notsc_setup(char *); | 123 | extern int notsc_setup(char *); |
124 | 124 | ||
125 | extern int timer_over_8254; | ||
126 | |||
125 | extern int gsi_irq_sharing(int gsi); | 127 | extern int gsi_irq_sharing(int gsi); |
126 | 128 | ||
127 | extern void smp_local_timer_interrupt(void); | 129 | extern void smp_local_timer_interrupt(void); |
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h index fd452fc2c037..01d1c17e2849 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86_64/vsyscall.h | |||
@@ -59,8 +59,6 @@ extern seqlock_t xtime_lock; | |||
59 | 59 | ||
60 | extern int sysctl_vsyscall; | 60 | extern int sysctl_vsyscall; |
61 | 61 | ||
62 | extern void vsyscall_set_cpu(int cpu); | ||
63 | |||
64 | #define ARCH_HAVE_XTIME_LOCK 1 | 62 | #define ARCH_HAVE_XTIME_LOCK 1 |
65 | 63 | ||
66 | #endif /* __KERNEL__ */ | 64 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index 03114f8d1e18..5435aff9a4b7 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h | |||
@@ -26,7 +26,7 @@ | |||
26 | * | 26 | * |
27 | * it's best to have buff aligned on a 32-bit boundary | 27 | * it's best to have buff aligned on a 32-bit boundary |
28 | */ | 28 | */ |
29 | asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); | 29 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * the same as csum_partial, but copies from src while it | 32 | * the same as csum_partial, but copies from src while it |
@@ -36,7 +36,7 @@ asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsign | |||
36 | * better 64-bit) boundary | 36 | * better 64-bit) boundary |
37 | */ | 37 | */ |
38 | 38 | ||
39 | asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, int len, int sum, | 39 | asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, int len, __wsum sum, |
40 | int *src_err_ptr, int *dst_err_ptr); | 40 | int *src_err_ptr, int *dst_err_ptr); |
41 | 41 | ||
42 | /* | 42 | /* |
@@ -46,34 +46,25 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i | |||
46 | * If you use these functions directly please don't forget the access_ok(). | 46 | * If you use these functions directly please don't forget the access_ok(). |
47 | */ | 47 | */ |
48 | static inline | 48 | static inline |
49 | unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, | 49 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
50 | int len, int sum) | 50 | int len, __wsum sum) |
51 | { | 51 | { |
52 | return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); | 52 | return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline | 55 | static inline |
56 | unsigned int csum_partial_copy_from_user ( const char *src, char *dst, | 56 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
57 | int len, int sum, int *err_ptr) | 57 | int len, __wsum sum, int *err_ptr) |
58 | { | 58 | { |
59 | return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL); | 59 | return csum_partial_copy_generic((__force const void *)src, dst, |
60 | len, sum, err_ptr, NULL); | ||
60 | } | 61 | } |
61 | 62 | ||
62 | /* | 63 | /* |
63 | * These are the old (and unsafe) way of doing checksums, a warning message will be | ||
64 | * printed if they are used and an exeption occurs. | ||
65 | * | ||
66 | * these functions should go away after some time. | ||
67 | */ | ||
68 | |||
69 | #define csum_partial_copy_fromuser csum_partial_copy | ||
70 | unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum); | ||
71 | |||
72 | /* | ||
73 | * Fold a partial checksum | 64 | * Fold a partial checksum |
74 | */ | 65 | */ |
75 | 66 | ||
76 | static __inline__ unsigned int csum_fold(unsigned int sum) | 67 | static __inline__ __sum16 csum_fold(__wsum sum) |
77 | { | 68 | { |
78 | unsigned int __dummy; | 69 | unsigned int __dummy; |
79 | __asm__("extui %1, %0, 16, 16\n\t" | 70 | __asm__("extui %1, %0, 16, 16\n\t" |
@@ -87,14 +78,14 @@ static __inline__ unsigned int csum_fold(unsigned int sum) | |||
87 | "extui %0, %0, 0, 16\n\t" | 78 | "extui %0, %0, 0, 16\n\t" |
88 | : "=r" (sum), "=&r" (__dummy) | 79 | : "=r" (sum), "=&r" (__dummy) |
89 | : "0" (sum)); | 80 | : "0" (sum)); |
90 | return sum; | 81 | return (__force __sum16)sum; |
91 | } | 82 | } |
92 | 83 | ||
93 | /* | 84 | /* |
94 | * This is a version of ip_compute_csum() optimized for IP headers, | 85 | * This is a version of ip_compute_csum() optimized for IP headers, |
95 | * which always checksum on 4 octet boundaries. | 86 | * which always checksum on 4 octet boundaries. |
96 | */ | 87 | */ |
97 | static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) | 88 | static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl) |
98 | { | 89 | { |
99 | unsigned int sum, tmp, endaddr; | 90 | unsigned int sum, tmp, endaddr; |
100 | 91 | ||
@@ -127,17 +118,16 @@ static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int | |||
127 | return csum_fold(sum); | 118 | return csum_fold(sum); |
128 | } | 119 | } |
129 | 120 | ||
130 | static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, | 121 | static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
131 | unsigned long daddr, | ||
132 | unsigned short len, | 122 | unsigned short len, |
133 | unsigned short proto, | 123 | unsigned short proto, |
134 | unsigned int sum) | 124 | __wsum sum) |
135 | { | 125 | { |
136 | 126 | ||
137 | #ifdef __XTENSA_EL__ | 127 | #ifdef __XTENSA_EL__ |
138 | unsigned long len_proto = (ntohs(len)<<16)+proto*256; | 128 | unsigned long len_proto = (len + proto) << 8; |
139 | #elif defined(__XTENSA_EB__) | 129 | #elif defined(__XTENSA_EB__) |
140 | unsigned long len_proto = (proto<<16)+len; | 130 | unsigned long len_proto = len + proto; |
141 | #else | 131 | #else |
142 | # error processor byte order undefined! | 132 | # error processor byte order undefined! |
143 | #endif | 133 | #endif |
@@ -162,11 +152,10 @@ static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, | |||
162 | * computes the checksum of the TCP/UDP pseudo-header | 152 | * computes the checksum of the TCP/UDP pseudo-header |
163 | * returns a 16-bit checksum, already complemented | 153 | * returns a 16-bit checksum, already complemented |
164 | */ | 154 | */ |
165 | static __inline__ unsigned short int csum_tcpudp_magic(unsigned long saddr, | 155 | static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
166 | unsigned long daddr, | ||
167 | unsigned short len, | 156 | unsigned short len, |
168 | unsigned short proto, | 157 | unsigned short proto, |
169 | unsigned int sum) | 158 | __wsum sum) |
170 | { | 159 | { |
171 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 160 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
172 | } | 161 | } |
@@ -176,17 +165,16 @@ static __inline__ unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
176 | * in icmp.c | 165 | * in icmp.c |
177 | */ | 166 | */ |
178 | 167 | ||
179 | static __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len) | 168 | static __inline__ __sum16 ip_compute_csum(const void *buff, int len) |
180 | { | 169 | { |
181 | return csum_fold (csum_partial(buff, len, 0)); | 170 | return csum_fold (csum_partial(buff, len, 0)); |
182 | } | 171 | } |
183 | 172 | ||
184 | #define _HAVE_ARCH_IPV6_CSUM | 173 | #define _HAVE_ARCH_IPV6_CSUM |
185 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 174 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
186 | struct in6_addr *daddr, | 175 | const struct in6_addr *daddr, |
187 | __u32 len, | 176 | __u32 len, unsigned short proto, |
188 | unsigned short proto, | 177 | __wsum sum) |
189 | unsigned int sum) | ||
190 | { | 178 | { |
191 | unsigned int __dummy; | 179 | unsigned int __dummy; |
192 | __asm__("l32i %1, %2, 0\n\t" | 180 | __asm__("l32i %1, %2, 0\n\t" |
@@ -248,8 +236,8 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
248 | * Copy and checksum to user | 236 | * Copy and checksum to user |
249 | */ | 237 | */ |
250 | #define HAVE_CSUM_COPY_USER | 238 | #define HAVE_CSUM_COPY_USER |
251 | static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst, | 239 | static __inline__ __wsum csum_and_copy_to_user(const void *src, void __user *dst, |
252 | int len, int sum, int *err_ptr) | 240 | int len, __wsum sum, int *err_ptr) |
253 | { | 241 | { |
254 | if (access_ok(VERIFY_WRITE, dst, len)) | 242 | if (access_ok(VERIFY_WRITE, dst, len)) |
255 | return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr); | 243 | return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr); |
@@ -257,6 +245,6 @@ static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst | |||
257 | if (len) | 245 | if (len) |
258 | *err_ptr = -EFAULT; | 246 | *err_ptr = -EFAULT; |
259 | 247 | ||
260 | return -1; /* invalid checksum */ | 248 | return (__force __wsum)-1; /* invalid checksum */ |
261 | } | 249 | } |
262 | #endif | 250 | #endif |
diff --git a/include/asm-xtensa/device.h b/include/asm-xtensa/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-xtensa/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 5114ff18101d..d7e04689304c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -120,6 +120,7 @@ header-y += netrom.h | |||
120 | header-y += nfs2.h | 120 | header-y += nfs2.h |
121 | header-y += nfs4_mount.h | 121 | header-y += nfs4_mount.h |
122 | header-y += nfs_mount.h | 122 | header-y += nfs_mount.h |
123 | header-y += oom.h | ||
123 | header-y += param.h | 124 | header-y += param.h |
124 | header-y += pci_ids.h | 125 | header-y += pci_ids.h |
125 | header-y += pci_regs.h | 126 | header-y += pci_regs.h |
@@ -192,7 +193,6 @@ unifdef-y += cuda.h | |||
192 | unifdef-y += cyclades.h | 193 | unifdef-y += cyclades.h |
193 | unifdef-y += dccp.h | 194 | unifdef-y += dccp.h |
194 | unifdef-y += dirent.h | 195 | unifdef-y += dirent.h |
195 | unifdef-y += divert.h | ||
196 | unifdef-y += dlm.h | 196 | unifdef-y += dlm.h |
197 | unifdef-y += elfcore.h | 197 | unifdef-y += elfcore.h |
198 | unifdef-y += errno.h | 198 | unifdef-y += errno.h |
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h index 24f82338f59a..ee108f9e9cb7 100644 --- a/include/linux/atmarp.h +++ b/include/linux/atmarp.h | |||
@@ -37,7 +37,7 @@ enum atmarp_ctrl_type { | |||
37 | struct atmarp_ctrl { | 37 | struct atmarp_ctrl { |
38 | enum atmarp_ctrl_type type; /* message type */ | 38 | enum atmarp_ctrl_type type; /* message type */ |
39 | int itf_num;/* interface number (if present) */ | 39 | int itf_num;/* interface number (if present) */ |
40 | uint32_t ip; /* IP address (act_need only) */ | 40 | __be32 ip; /* IP address (act_need only) */ |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h index 7981b733f1ef..969fb6c9e1cc 100644 --- a/include/linux/atmbr2684.h +++ b/include/linux/atmbr2684.h | |||
@@ -86,8 +86,8 @@ struct atm_backend_br2684 { | |||
86 | * efficient per-if in/out filters, this support will be removed | 86 | * efficient per-if in/out filters, this support will be removed |
87 | */ | 87 | */ |
88 | struct br2684_filter { | 88 | struct br2684_filter { |
89 | __u32 prefix; /* network byte order */ | 89 | __be32 prefix; /* network byte order */ |
90 | __u32 netmask; /* 0 = disable filter */ | 90 | __be32 netmask; /* 0 = disable filter */ |
91 | }; | 91 | }; |
92 | 92 | ||
93 | struct br2684_filter_set { | 93 | struct br2684_filter_set { |
diff --git a/include/linux/atmmpc.h b/include/linux/atmmpc.h index 5fbfa68136d3..ea1650425a12 100644 --- a/include/linux/atmmpc.h +++ b/include/linux/atmmpc.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | struct atmmpc_ioc { | 14 | struct atmmpc_ioc { |
15 | int dev_num; | 15 | int dev_num; |
16 | uint32_t ipaddr; /* the IP address of the shortcut */ | 16 | __be32 ipaddr; /* the IP address of the shortcut */ |
17 | int type; /* ingress or egress */ | 17 | int type; /* ingress or egress */ |
18 | }; | 18 | }; |
19 | 19 | ||
@@ -21,8 +21,8 @@ typedef struct in_ctrl_info { | |||
21 | uint8_t Last_NHRP_CIE_code; | 21 | uint8_t Last_NHRP_CIE_code; |
22 | uint8_t Last_Q2931_cause_value; | 22 | uint8_t Last_Q2931_cause_value; |
23 | uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN]; | 23 | uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN]; |
24 | uint32_t tag; | 24 | __be32 tag; |
25 | uint32_t in_dst_ip; /* IP address this ingress MPC sends packets to */ | 25 | __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */ |
26 | uint16_t holding_time; | 26 | uint16_t holding_time; |
27 | uint32_t request_id; | 27 | uint32_t request_id; |
28 | } in_ctrl_info; | 28 | } in_ctrl_info; |
@@ -30,10 +30,10 @@ typedef struct in_ctrl_info { | |||
30 | typedef struct eg_ctrl_info { | 30 | typedef struct eg_ctrl_info { |
31 | uint8_t DLL_header[256]; | 31 | uint8_t DLL_header[256]; |
32 | uint8_t DH_length; | 32 | uint8_t DH_length; |
33 | uint32_t cache_id; | 33 | __be32 cache_id; |
34 | uint32_t tag; | 34 | __be32 tag; |
35 | uint32_t mps_ip; | 35 | __be32 mps_ip; |
36 | uint32_t eg_dst_ip; /* IP address to which ingress MPC sends packets */ | 36 | __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */ |
37 | uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN]; | 37 | uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN]; |
38 | uint16_t holding_time; | 38 | uint16_t holding_time; |
39 | } eg_ctrl_info; | 39 | } eg_ctrl_info; |
@@ -49,7 +49,7 @@ struct mpc_parameters { | |||
49 | 49 | ||
50 | struct k_message { | 50 | struct k_message { |
51 | uint16_t type; | 51 | uint16_t type; |
52 | uint32_t ip_mask; | 52 | __be32 ip_mask; |
53 | uint8_t MPS_ctrl[ATM_ESA_LEN]; | 53 | uint8_t MPS_ctrl[ATM_ESA_LEN]; |
54 | union { | 54 | union { |
55 | in_ctrl_info in_info; | 55 | in_ctrl_info in_info; |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index f7a1390d67f5..7011d6255593 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -10,6 +10,8 @@ | |||
10 | 10 | ||
11 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
12 | 12 | ||
13 | struct page; | ||
14 | |||
13 | /* | 15 | /* |
14 | * Bits in backing_dev_info.state | 16 | * Bits in backing_dev_info.state |
15 | */ | 17 | */ |
@@ -88,6 +90,11 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
88 | (1 << BDI_write_congested)); | 90 | (1 << BDI_write_congested)); |
89 | } | 91 | } |
90 | 92 | ||
93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | ||
94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | ||
95 | long congestion_wait(int rw, long timeout); | ||
96 | void congestion_end(int rw); | ||
97 | |||
91 | #define bdi_cap_writeback_dirty(bdi) \ | 98 | #define bdi_cap_writeback_dirty(bdi) \ |
92 | (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) | 99 | (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) |
93 | 100 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d370d2cfe138..e1c7286165ff 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -651,6 +651,26 @@ extern void blk_recount_segments(request_queue_t *, struct bio *); | |||
651 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 651 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); |
652 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | 652 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, |
653 | struct gendisk *, struct scsi_ioctl_command __user *); | 653 | struct gendisk *, struct scsi_ioctl_command __user *); |
654 | |||
655 | /* | ||
656 | * A queue has just exitted congestion. Note this in the global counter of | ||
657 | * congested queues, and wake up anyone who was waiting for requests to be | ||
658 | * put back. | ||
659 | */ | ||
660 | static inline void blk_clear_queue_congested(request_queue_t *q, int rw) | ||
661 | { | ||
662 | clear_bdi_congested(&q->backing_dev_info, rw); | ||
663 | } | ||
664 | |||
665 | /* | ||
666 | * A queue has just entered congestion. Flag that in the queue's VM-visible | ||
667 | * state flags and increment the global gounter of congested queues. | ||
668 | */ | ||
669 | static inline void blk_set_queue_congested(request_queue_t *q, int rw) | ||
670 | { | ||
671 | set_bdi_congested(&q->backing_dev_info, rw); | ||
672 | } | ||
673 | |||
654 | extern void blk_start_queue(request_queue_t *q); | 674 | extern void blk_start_queue(request_queue_t *q); |
655 | extern void blk_stop_queue(request_queue_t *q); | 675 | extern void blk_stop_queue(request_queue_t *q); |
656 | extern void blk_sync_queue(struct request_queue *q); | 676 | extern void blk_sync_queue(struct request_queue *q); |
@@ -658,10 +678,11 @@ extern void __blk_stop_queue(request_queue_t *q); | |||
658 | extern void blk_run_queue(request_queue_t *); | 678 | extern void blk_run_queue(request_queue_t *); |
659 | extern void blk_start_queueing(request_queue_t *); | 679 | extern void blk_start_queueing(request_queue_t *); |
660 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 680 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
661 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 681 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); |
662 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 682 | extern int blk_rq_unmap_user(struct request *); |
663 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); | 683 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); |
664 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); | 684 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, |
685 | struct sg_iovec *, int, unsigned int); | ||
665 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, | 686 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, |
666 | struct request *, int); | 687 | struct request *, int); |
667 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, | 688 | extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, |
@@ -765,10 +786,8 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *); | |||
765 | extern void blk_queue_free_tags(request_queue_t *); | 786 | extern void blk_queue_free_tags(request_queue_t *); |
766 | extern int blk_queue_resize_tags(request_queue_t *, int); | 787 | extern int blk_queue_resize_tags(request_queue_t *, int); |
767 | extern void blk_queue_invalidate_tags(request_queue_t *); | 788 | extern void blk_queue_invalidate_tags(request_queue_t *); |
768 | extern long blk_congestion_wait(int rw, long timeout); | ||
769 | extern struct blk_queue_tag *blk_init_tags(int); | 789 | extern struct blk_queue_tag *blk_init_tags(int); |
770 | extern void blk_free_tags(struct blk_queue_tag *); | 790 | extern void blk_free_tags(struct blk_queue_tag *); |
771 | extern void blk_congestion_end(int rw); | ||
772 | 791 | ||
773 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | 792 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, |
774 | int tag) | 793 | int tag) |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index b99a714fcac6..3680ff9a30ed 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -50,6 +50,15 @@ enum blktrace_act { | |||
50 | }; | 50 | }; |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * Notify events. | ||
54 | */ | ||
55 | enum blktrace_notify { | ||
56 | __BLK_TN_PROCESS = 0, /* establish pid/name mapping */ | ||
57 | __BLK_TN_TIMESTAMP, /* include system clock */ | ||
58 | }; | ||
59 | |||
60 | |||
61 | /* | ||
53 | * Trace actions in full. Additionally, read or write is masked | 62 | * Trace actions in full. Additionally, read or write is masked |
54 | */ | 63 | */ |
55 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) | 64 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) |
@@ -68,6 +77,9 @@ enum blktrace_act { | |||
68 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | 77 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
69 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | 78 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
70 | 79 | ||
80 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
81 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
82 | |||
71 | #define BLK_IO_TRACE_MAGIC 0x65617400 | 83 | #define BLK_IO_TRACE_MAGIC 0x65617400 |
72 | #define BLK_IO_TRACE_VERSION 0x07 | 84 | #define BLK_IO_TRACE_VERSION 0x07 |
73 | 85 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 131ffd37e716..5d9fb0e94156 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -69,6 +69,8 @@ struct buffer_head { | |||
69 | bh_end_io_t *b_end_io; /* I/O completion */ | 69 | bh_end_io_t *b_end_io; /* I/O completion */ |
70 | void *b_private; /* reserved for b_end_io */ | 70 | void *b_private; /* reserved for b_end_io */ |
71 | struct list_head b_assoc_buffers; /* associated with another mapping */ | 71 | struct list_head b_assoc_buffers; /* associated with another mapping */ |
72 | struct address_space *b_assoc_map; /* mapping this buffer is | ||
73 | associated with */ | ||
72 | atomic_t b_count; /* users using this buffer_head */ | 74 | atomic_t b_count; /* users using this buffer_head */ |
73 | }; | 75 | }; |
74 | 76 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index f4ebf96f5308..80b17f440ec1 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -196,7 +196,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
196 | #define BITS_TO_COMPAT_LONGS(bits) \ | 196 | #define BITS_TO_COMPAT_LONGS(bits) \ |
197 | (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) | 197 | (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) |
198 | 198 | ||
199 | long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, | 199 | long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, |
200 | unsigned long bitmap_size); | 200 | unsigned long bitmap_size); |
201 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | 201 | long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, |
202 | unsigned long bitmap_size); | 202 | unsigned long bitmap_size); |
@@ -230,5 +230,9 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | |||
230 | extern int compat_printk(const char *fmt, ...); | 230 | extern int compat_printk(const char *fmt, ...); |
231 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | 231 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); |
232 | 232 | ||
233 | asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | ||
234 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, | ||
235 | const compat_ulong_t __user *new_nodes); | ||
236 | |||
233 | #endif /* CONFIG_COMPAT */ | 237 | #endif /* CONFIG_COMPAT */ |
234 | #endif /* _LINUX_COMPAT_H */ | 238 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index cfdb4f6a89d4..c26c3adcfacf 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -131,6 +131,7 @@ COMPATIBLE_IOCTL(RUN_ARRAY) | |||
131 | COMPATIBLE_IOCTL(STOP_ARRAY) | 131 | COMPATIBLE_IOCTL(STOP_ARRAY) |
132 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) | 132 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) |
133 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) | 133 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) |
134 | COMPATIBLE_IOCTL(GET_BITMAP_FILE) | ||
134 | ULONG_IOCTL(SET_BITMAP_FILE) | 135 | ULONG_IOCTL(SET_BITMAP_FILE) |
135 | /* DM */ | 136 | /* DM */ |
136 | COMPATIBLE_IOCTL(DM_VERSION_32) | 137 | COMPATIBLE_IOCTL(DM_VERSION_32) |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 8f2ffa4caabf..6485e9716b36 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -245,7 +245,7 @@ int crypto_alg_available(const char *name, u32 flags) | |||
245 | __deprecated_for_modules; | 245 | __deprecated_for_modules; |
246 | int crypto_has_alg(const char *name, u32 type, u32 mask); | 246 | int crypto_has_alg(const char *name, u32 type, u32 mask); |
247 | #else | 247 | #else |
248 | static int crypto_alg_available(const char *name, u32 flags); | 248 | static int crypto_alg_available(const char *name, u32 flags) |
249 | __deprecated_for_modules; | 249 | __deprecated_for_modules; |
250 | static inline int crypto_alg_available(const char *name, u32 flags) | 250 | static inline int crypto_alg_available(const char *name, u32 flags) |
251 | { | 251 | { |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 53553c99cad6..ed6cc8962d87 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -30,7 +30,7 @@ struct dccp_hdr { | |||
30 | #else | 30 | #else |
31 | #error "Adjust your <asm/byteorder.h> defines" | 31 | #error "Adjust your <asm/byteorder.h> defines" |
32 | #endif | 32 | #endif |
33 | __u16 dccph_checksum; | 33 | __sum16 dccph_checksum; |
34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
35 | __u8 dccph_x:1, | 35 | __u8 dccph_x:1, |
36 | dccph_type:4, | 36 | dccph_type:4, |
@@ -175,17 +175,21 @@ enum { | |||
175 | DCCPC_CCID3 = 3, | 175 | DCCPC_CCID3 = 3, |
176 | }; | 176 | }; |
177 | 177 | ||
178 | /* DCCP features */ | 178 | /* DCCP features (RFC 4340 section 6.4) */ |
179 | enum { | 179 | enum { |
180 | DCCPF_RESERVED = 0, | 180 | DCCPF_RESERVED = 0, |
181 | DCCPF_CCID = 1, | 181 | DCCPF_CCID = 1, |
182 | DCCPF_SEQUENCE_WINDOW = 3, | 182 | DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ |
183 | DCCPF_ACK_RATIO = 5, | 183 | DCCPF_SEQUENCE_WINDOW = 3, |
184 | DCCPF_SEND_ACK_VECTOR = 6, | 184 | DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ |
185 | DCCPF_SEND_NDP_COUNT = 7, | 185 | DCCPF_ACK_RATIO = 5, |
186 | /* 10-127 reserved */ | 186 | DCCPF_SEND_ACK_VECTOR = 6, |
187 | DCCPF_MIN_CCID_SPECIFIC = 128, | 187 | DCCPF_SEND_NDP_COUNT = 7, |
188 | DCCPF_MAX_CCID_SPECIFIC = 255, | 188 | DCCPF_MIN_CSUM_COVER = 8, |
189 | DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ | ||
190 | /* 10-127 reserved */ | ||
191 | DCCPF_MIN_CCID_SPECIFIC = 128, | ||
192 | DCCPF_MAX_CCID_SPECIFIC = 255, | ||
189 | }; | 193 | }; |
190 | 194 | ||
191 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ | 195 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ |
@@ -196,13 +200,16 @@ struct dccp_so_feat { | |||
196 | }; | 200 | }; |
197 | 201 | ||
198 | /* DCCP socket options */ | 202 | /* DCCP socket options */ |
199 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | 203 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ |
200 | #define DCCP_SOCKOPT_SERVICE 2 | 204 | #define DCCP_SOCKOPT_SERVICE 2 |
201 | #define DCCP_SOCKOPT_CHANGE_L 3 | 205 | #define DCCP_SOCKOPT_CHANGE_L 3 |
202 | #define DCCP_SOCKOPT_CHANGE_R 4 | 206 | #define DCCP_SOCKOPT_CHANGE_R 4 |
207 | #define DCCP_SOCKOPT_SEND_CSCOV 10 | ||
208 | #define DCCP_SOCKOPT_RECV_CSCOV 11 | ||
203 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 209 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
204 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 210 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
205 | 211 | ||
212 | /* maximum number of services provided on the same listening port */ | ||
206 | #define DCCP_SERVICE_LIST_MAX_LEN 32 | 213 | #define DCCP_SERVICE_LIST_MAX_LEN 32 |
207 | 214 | ||
208 | #ifdef __KERNEL__ | 215 | #ifdef __KERNEL__ |
@@ -256,6 +263,13 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | |||
256 | return (struct dccp_hdr *)skb->h.raw; | 263 | return (struct dccp_hdr *)skb->h.raw; |
257 | } | 264 | } |
258 | 265 | ||
266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) | ||
267 | { | ||
268 | skb->h.raw = skb_push(skb, headlen); | ||
269 | memset(skb->h.raw, 0, headlen); | ||
270 | return dccp_hdr(skb); | ||
271 | } | ||
272 | |||
259 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) | 273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) |
260 | { | 274 | { |
261 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); | 275 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); |
@@ -342,6 +356,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
342 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) | 356 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) |
343 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) | 357 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) |
344 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) | 358 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) |
359 | * @dccpms_ack_ratio - Ack Ratio Feature (section 11.3) | ||
360 | * @dccpms_pending - List of features being negotiated | ||
361 | * @dccpms_conf - | ||
345 | */ | 362 | */ |
346 | struct dccp_minisock { | 363 | struct dccp_minisock { |
347 | __u64 dccpms_sequence_window; | 364 | __u64 dccpms_sequence_window; |
@@ -439,12 +456,25 @@ struct dccp_ackvec; | |||
439 | * @dccps_gss - greatest sequence number sent | 456 | * @dccps_gss - greatest sequence number sent |
440 | * @dccps_gsr - greatest valid sequence number received | 457 | * @dccps_gsr - greatest valid sequence number received |
441 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss | 458 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss |
459 | * @dccps_service - first (passive sock) or unique (active sock) service code | ||
460 | * @dccps_service_list - second .. last service code on passive socket | ||
442 | * @dccps_timestamp_time - time of latest TIMESTAMP option | 461 | * @dccps_timestamp_time - time of latest TIMESTAMP option |
443 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option | 462 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option |
444 | * @dccps_packet_size - Set thru setsockopt | 463 | * @dccps_l_ack_ratio - |
445 | * @dccps_role - Role of this sock, one of %dccp_role | 464 | * @dccps_r_ack_ratio - |
465 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) | ||
466 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) | ||
446 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 467 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
468 | * @dccps_mss_cache - | ||
469 | * @dccps_minisock - | ||
447 | * @dccps_hc_rx_ackvec - rx half connection ack vector | 470 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
471 | * @dccps_hc_rx_ccid - | ||
472 | * @dccps_hc_tx_ccid - | ||
473 | * @dccps_options_received - | ||
474 | * @dccps_epoch - | ||
475 | * @dccps_role - Role of this sock, one of %dccp_role | ||
476 | * @dccps_hc_rx_insert_options - | ||
477 | * @dccps_hc_tx_insert_options - | ||
448 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 478 | * @dccps_xmit_timer - timer for when CCID is not ready to send |
449 | */ | 479 | */ |
450 | struct dccp_sock { | 480 | struct dccp_sock { |
@@ -464,9 +494,10 @@ struct dccp_sock { | |||
464 | struct dccp_service_list *dccps_service_list; | 494 | struct dccp_service_list *dccps_service_list; |
465 | struct timeval dccps_timestamp_time; | 495 | struct timeval dccps_timestamp_time; |
466 | __u32 dccps_timestamp_echo; | 496 | __u32 dccps_timestamp_echo; |
467 | __u32 dccps_packet_size; | ||
468 | __u16 dccps_l_ack_ratio; | 497 | __u16 dccps_l_ack_ratio; |
469 | __u16 dccps_r_ack_ratio; | 498 | __u16 dccps_r_ack_ratio; |
499 | __u16 dccps_pcslen; | ||
500 | __u16 dccps_pcrlen; | ||
470 | unsigned long dccps_ndp_count; | 501 | unsigned long dccps_ndp_count; |
471 | __u32 dccps_mss_cache; | 502 | __u32 dccps_mss_cache; |
472 | struct dccp_minisock dccps_minisock; | 503 | struct dccp_minisock dccps_minisock; |
diff --git a/include/linux/device.h b/include/linux/device.h index 662e6a10144e..583a341e016c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/pm.h> | 21 | #include <linux/pm.h> |
22 | #include <asm/semaphore.h> | 22 | #include <asm/semaphore.h> |
23 | #include <asm/atomic.h> | 23 | #include <asm/atomic.h> |
24 | #include <asm/device.h> | ||
24 | 25 | ||
25 | #define DEVICE_NAME_SIZE 50 | 26 | #define DEVICE_NAME_SIZE 50 |
26 | #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ | 27 | #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ |
@@ -42,6 +43,8 @@ struct bus_type { | |||
42 | struct klist klist_devices; | 43 | struct klist klist_devices; |
43 | struct klist klist_drivers; | 44 | struct klist klist_drivers; |
44 | 45 | ||
46 | struct blocking_notifier_head bus_notifier; | ||
47 | |||
45 | struct bus_attribute * bus_attrs; | 48 | struct bus_attribute * bus_attrs; |
46 | struct device_attribute * dev_attrs; | 49 | struct device_attribute * dev_attrs; |
47 | struct driver_attribute * drv_attrs; | 50 | struct driver_attribute * drv_attrs; |
@@ -75,6 +78,29 @@ int __must_check bus_for_each_drv(struct bus_type *bus, | |||
75 | struct device_driver *start, void *data, | 78 | struct device_driver *start, void *data, |
76 | int (*fn)(struct device_driver *, void *)); | 79 | int (*fn)(struct device_driver *, void *)); |
77 | 80 | ||
81 | /* | ||
82 | * Bus notifiers: Get notified of addition/removal of devices | ||
83 | * and binding/unbinding of drivers to devices. | ||
84 | * In the long run, it should be a replacement for the platform | ||
85 | * notify hooks. | ||
86 | */ | ||
87 | struct notifier_block; | ||
88 | |||
89 | extern int bus_register_notifier(struct bus_type *bus, | ||
90 | struct notifier_block *nb); | ||
91 | extern int bus_unregister_notifier(struct bus_type *bus, | ||
92 | struct notifier_block *nb); | ||
93 | |||
94 | /* All 4 notifers below get called with the target struct device * | ||
95 | * as an argument. Note that those functions are likely to be called | ||
96 | * with the device semaphore held in the core, so be careful. | ||
97 | */ | ||
98 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ | ||
99 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ | ||
100 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | ||
101 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | ||
102 | unbound */ | ||
103 | |||
78 | /* driverfs interface for exporting bus attributes */ | 104 | /* driverfs interface for exporting bus attributes */ |
79 | 105 | ||
80 | struct bus_attribute { | 106 | struct bus_attribute { |
@@ -343,8 +369,6 @@ struct device { | |||
343 | void *driver_data; /* data private to the driver */ | 369 | void *driver_data; /* data private to the driver */ |
344 | void *platform_data; /* Platform specific data, device | 370 | void *platform_data; /* Platform specific data, device |
345 | core doesn't touch it */ | 371 | core doesn't touch it */ |
346 | void *firmware_data; /* Firmware specific data (e.g. ACPI, | ||
347 | BIOS data),reserved for device core*/ | ||
348 | struct dev_pm_info power; | 372 | struct dev_pm_info power; |
349 | 373 | ||
350 | u64 *dma_mask; /* dma mask (if dma'able device) */ | 374 | u64 *dma_mask; /* dma mask (if dma'able device) */ |
@@ -358,6 +382,8 @@ struct device { | |||
358 | 382 | ||
359 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 383 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
360 | override */ | 384 | override */ |
385 | /* arch specific additions */ | ||
386 | struct dev_archdata archdata; | ||
361 | 387 | ||
362 | /* class_device migration path */ | 388 | /* class_device migration path */ |
363 | struct list_head node; | 389 | struct list_head node; |
@@ -393,9 +419,12 @@ extern void device_unregister(struct device * dev); | |||
393 | extern void device_initialize(struct device * dev); | 419 | extern void device_initialize(struct device * dev); |
394 | extern int __must_check device_add(struct device * dev); | 420 | extern int __must_check device_add(struct device * dev); |
395 | extern void device_del(struct device * dev); | 421 | extern void device_del(struct device * dev); |
396 | extern int __must_check device_for_each_child(struct device *, void *, | 422 | extern int device_for_each_child(struct device *, void *, |
397 | int (*fn)(struct device *, void *)); | 423 | int (*fn)(struct device *, void *)); |
424 | extern struct device *device_find_child(struct device *, void *data, | ||
425 | int (*match)(struct device *, void *)); | ||
398 | extern int device_rename(struct device *dev, char *new_name); | 426 | extern int device_rename(struct device *dev, char *new_name); |
427 | extern int device_move(struct device *dev, struct device *new_parent); | ||
399 | 428 | ||
400 | /* | 429 | /* |
401 | * Manual binding of a device to driver. See drivers/base/bus.c | 430 | * Manual binding of a device to driver. See drivers/base/bus.c |
@@ -415,8 +444,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
415 | __attribute__((format(printf,4,5))); | 444 | __attribute__((format(printf,4,5))); |
416 | extern void device_destroy(struct class *cls, dev_t devt); | 445 | extern void device_destroy(struct class *cls, dev_t devt); |
417 | 446 | ||
418 | extern int virtual_device_parent(struct device *dev); | ||
419 | |||
420 | /* | 447 | /* |
421 | * Platform "fixup" functions - allow the platform to have their say | 448 | * Platform "fixup" functions - allow the platform to have their say |
422 | * about devices and actions that the general device layer doesn't | 449 | * about devices and actions that the general device layer doesn't |
diff --git a/include/linux/divert.h b/include/linux/divert.h deleted file mode 100644 index 8fb4e9de6843..000000000000 --- a/include/linux/divert.h +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | /* | ||
2 | * Frame Diversion, Benoit Locher <Benoit.Locher@skf.com> | ||
3 | * | ||
4 | * Changes: | ||
5 | * 06/09/2000 BL: initial version | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_DIVERT_H | ||
10 | #define _LINUX_DIVERT_H | ||
11 | |||
12 | #include <asm/types.h> | ||
13 | |||
14 | #define MAX_DIVERT_PORTS 8 /* Max number of ports to divert (tcp, udp) */ | ||
15 | |||
16 | /* Divertable protocols */ | ||
17 | #define DIVERT_PROTO_NONE 0x0000 | ||
18 | #define DIVERT_PROTO_IP 0x0001 | ||
19 | #define DIVERT_PROTO_ICMP 0x0002 | ||
20 | #define DIVERT_PROTO_TCP 0x0004 | ||
21 | #define DIVERT_PROTO_UDP 0x0008 | ||
22 | |||
23 | /* | ||
24 | * This is an Ethernet Frame Diverter option block | ||
25 | */ | ||
26 | struct divert_blk | ||
27 | { | ||
28 | int divert; /* are we active */ | ||
29 | unsigned int protos; /* protocols */ | ||
30 | __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ | ||
31 | __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ | ||
32 | __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ | ||
33 | __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ | ||
34 | }; | ||
35 | |||
36 | /* | ||
37 | * Diversion control block, for configuration with the userspace tool | ||
38 | * divert | ||
39 | */ | ||
40 | |||
41 | typedef union _divert_cf_arg | ||
42 | { | ||
43 | __s16 int16; | ||
44 | __u16 uint16; | ||
45 | __s32 int32; | ||
46 | __u32 uint32; | ||
47 | __s64 int64; | ||
48 | __u64 uint64; | ||
49 | void __user *ptr; | ||
50 | } divert_cf_arg; | ||
51 | |||
52 | |||
53 | struct divert_cf | ||
54 | { | ||
55 | int cmd; /* Command */ | ||
56 | divert_cf_arg arg1, | ||
57 | arg2, | ||
58 | arg3; | ||
59 | int dev_index; /* device index (eth0=0, etc...) */ | ||
60 | }; | ||
61 | |||
62 | |||
63 | /* Diversion commands */ | ||
64 | #define DIVCMD_DIVERT 1 /* ENABLE/DISABLE diversion */ | ||
65 | #define DIVCMD_IP 2 /* ENABLE/DISABLE whold IP diversion */ | ||
66 | #define DIVCMD_TCP 3 /* ENABLE/DISABLE whold TCP diversion */ | ||
67 | #define DIVCMD_TCPDST 4 /* ADD/REMOVE TCP DST port for diversion */ | ||
68 | #define DIVCMD_TCPSRC 5 /* ADD/REMOVE TCP SRC port for diversion */ | ||
69 | #define DIVCMD_UDP 6 /* ENABLE/DISABLE whole UDP diversion */ | ||
70 | #define DIVCMD_UDPDST 7 /* ADD/REMOVE UDP DST port for diversion */ | ||
71 | #define DIVCMD_UDPSRC 8 /* ADD/REMOVE UDP SRC port for diversion */ | ||
72 | #define DIVCMD_ICMP 9 /* ENABLE/DISABLE whole ICMP diversion */ | ||
73 | #define DIVCMD_GETSTATUS 10 /* GET the status of the diverter */ | ||
74 | #define DIVCMD_RESET 11 /* Reset the diverter on the specified dev */ | ||
75 | #define DIVCMD_GETVERSION 12 /* Retrieve the diverter code version (char[32]) */ | ||
76 | |||
77 | /* General syntax of the commands: | ||
78 | * | ||
79 | * DIVCMD_xxxxxx(arg1, arg2, arg3, dev_index) | ||
80 | * | ||
81 | * SIOCSIFDIVERT: | ||
82 | * DIVCMD_DIVERT(DIVARG1_ENABLE|DIVARG1_DISABLE, , ,ifindex) | ||
83 | * DIVCMD_IP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex) | ||
84 | * DIVCMD_TCP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex) | ||
85 | * DIVCMD_TCPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex) | ||
86 | * DIVCMD_TCPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex) | ||
87 | * DIVCMD_UDP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex) | ||
88 | * DIVCMD_UDPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex) | ||
89 | * DIVCMD_UDPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex) | ||
90 | * DIVCMD_ICMP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex) | ||
91 | * DIVCMD_RESET(, , , ifindex) | ||
92 | * | ||
93 | * SIOGIFDIVERT: | ||
94 | * DIVCMD_GETSTATUS(divert_blk, , , ifindex) | ||
95 | * DIVCMD_GETVERSION(string[3]) | ||
96 | */ | ||
97 | |||
98 | |||
99 | /* Possible values for arg1 */ | ||
100 | #define DIVARG1_ENABLE 0 /* ENABLE something */ | ||
101 | #define DIVARG1_DISABLE 1 /* DISABLE something */ | ||
102 | #define DIVARG1_ADD 2 /* ADD something */ | ||
103 | #define DIVARG1_REMOVE 3 /* REMOVE something */ | ||
104 | |||
105 | |||
106 | #ifdef __KERNEL__ | ||
107 | |||
108 | /* diverter functions */ | ||
109 | #include <linux/skbuff.h> | ||
110 | |||
111 | #ifdef CONFIG_NET_DIVERT | ||
112 | #include <linux/netdevice.h> | ||
113 | |||
114 | int alloc_divert_blk(struct net_device *); | ||
115 | void free_divert_blk(struct net_device *); | ||
116 | int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg); | ||
117 | void divert_frame(struct sk_buff *skb); | ||
118 | static inline void handle_diverter(struct sk_buff *skb) | ||
119 | { | ||
120 | /* if diversion is supported on device, then divert */ | ||
121 | if (skb->dev->divert && skb->dev->divert->divert) | ||
122 | divert_frame(skb); | ||
123 | } | ||
124 | |||
125 | #else | ||
126 | # define alloc_divert_blk(dev) (0) | ||
127 | # define free_divert_blk(dev) do {} while (0) | ||
128 | # define divert_ioctl(cmd, arg) (-ENOPKG) | ||
129 | # define handle_diverter(skb) do {} while (0) | ||
130 | #endif | ||
131 | #endif | ||
132 | #endif /* _LINUX_DIVERT_H */ | ||
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 38dc403be70b..904bf3d2d90b 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_device(int type, const char *name, | |||
69 | struct dmi_device *from); | 69 | struct dmi_device *from); |
70 | extern void dmi_scan_machine(void); | 70 | extern void dmi_scan_machine(void); |
71 | extern int dmi_get_year(int field); | 71 | extern int dmi_get_year(int field); |
72 | extern int dmi_name_in_vendors(char *str); | ||
72 | 73 | ||
73 | #else | 74 | #else |
74 | 75 | ||
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info(int field) { return NULL; } | |||
77 | static inline struct dmi_device * dmi_find_device(int type, const char *name, | 78 | static inline struct dmi_device * dmi_find_device(int type, const char *name, |
78 | struct dmi_device *from) { return NULL; } | 79 | struct dmi_device *from) { return NULL; } |
79 | static inline int dmi_get_year(int year) { return 0; } | 80 | static inline int dmi_get_year(int year) { return 0; } |
81 | static inline int dmi_name_in_vendors(char *s) { return 0; } | ||
80 | 82 | ||
81 | #endif | 83 | #endif |
82 | 84 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 2fa9f1144228..a24931d24404 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -21,11 +21,11 @@ typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | |||
21 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); | 21 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); |
22 | 22 | ||
23 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); | 23 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); |
24 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 24 | typedef void (elevator_put_req_fn) (struct request *); |
25 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 25 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); |
26 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 26 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
27 | 27 | ||
28 | typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *); | 28 | typedef void *(elevator_init_fn) (request_queue_t *); |
29 | typedef void (elevator_exit_fn) (elevator_t *); | 29 | typedef void (elevator_exit_fn) (elevator_t *); |
30 | 30 | ||
31 | struct elevator_ops | 31 | struct elevator_ops |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 3e69241e6a81..fa23e0671bb3 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -774,8 +774,8 @@ struct fb_info { | |||
774 | #endif | 774 | #endif |
775 | 775 | ||
776 | struct fb_ops *fbops; | 776 | struct fb_ops *fbops; |
777 | struct device *device; | 777 | struct device *device; /* This is the parent */ |
778 | struct class_device *class_device; /* sysfs per device attrs */ | 778 | struct device *dev; /* This is this fb device */ |
779 | int class_flag; /* private sysfs flags */ | 779 | int class_flag; /* private sysfs flags */ |
780 | #ifdef CONFIG_FB_TILEBLITTING | 780 | #ifdef CONFIG_FB_TILEBLITTING |
781 | struct fb_tile_ops *tileops; /* Tile Blitting */ | 781 | struct fb_tile_ops *tileops; /* Tile Blitting */ |
@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | |||
910 | /* drivers/video/fbsysfs.c */ | 910 | /* drivers/video/fbsysfs.c */ |
911 | extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); | 911 | extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); |
912 | extern void framebuffer_release(struct fb_info *info); | 912 | extern void framebuffer_release(struct fb_info *info); |
913 | extern int fb_init_class_device(struct fb_info *fb_info); | 913 | extern int fb_init_device(struct fb_info *fb_info); |
914 | extern void fb_cleanup_class_device(struct fb_info *head); | 914 | extern void fb_cleanup_device(struct fb_info *head); |
915 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); | 915 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); |
916 | 916 | ||
917 | /* drivers/video/fbmon.c */ | 917 | /* drivers/video/fbmon.c */ |
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h index 4418c8d9d479..8270aac2aa5d 100644 --- a/include/linux/fib_rules.h +++ b/include/linux/fib_rules.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | /* rule is permanent, and cannot be deleted */ | 7 | /* rule is permanent, and cannot be deleted */ |
8 | #define FIB_RULE_PERMANENT 1 | 8 | #define FIB_RULE_PERMANENT 1 |
9 | #define FIB_RULE_INVERT 2 | ||
9 | 10 | ||
10 | struct fib_rule_hdr | 11 | struct fib_rule_hdr |
11 | { | 12 | { |
@@ -34,7 +35,7 @@ enum | |||
34 | FRA_UNUSED3, | 35 | FRA_UNUSED3, |
35 | FRA_UNUSED4, | 36 | FRA_UNUSED4, |
36 | FRA_UNUSED5, | 37 | FRA_UNUSED5, |
37 | FRA_FWMARK, /* netfilter mark */ | 38 | FRA_FWMARK, /* mark */ |
38 | FRA_FLOW, /* flow/class id */ | 39 | FRA_FLOW, /* flow/class id */ |
39 | FRA_UNUSED6, | 40 | FRA_UNUSED6, |
40 | FRA_UNUSED7, | 41 | FRA_UNUSED7, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 34406ed467c3..2fe6e3f900ba 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -623,6 +623,9 @@ enum inode_i_mutex_lock_class | |||
623 | I_MUTEX_QUOTA | 623 | I_MUTEX_QUOTA |
624 | }; | 624 | }; |
625 | 625 | ||
626 | extern void inode_double_lock(struct inode *inode1, struct inode *inode2); | ||
627 | extern void inode_double_unlock(struct inode *inode1, struct inode *inode2); | ||
628 | |||
626 | /* | 629 | /* |
627 | * NOTE: in a 32bit arch with a preemptable kernel and | 630 | * NOTE: in a 32bit arch with a preemptable kernel and |
628 | * an UP compile the i_size_read/write must be atomic | 631 | * an UP compile the i_size_read/write must be atomic |
@@ -656,7 +659,11 @@ static inline loff_t i_size_read(struct inode *inode) | |||
656 | #endif | 659 | #endif |
657 | } | 660 | } |
658 | 661 | ||
659 | 662 | /* | |
663 | * NOTE: unlike i_size_read(), i_size_write() does need locking around it | ||
664 | * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount | ||
665 | * can be lost, resulting in subsequent i_size_read() calls spinning forever. | ||
666 | */ | ||
660 | static inline void i_size_write(struct inode *inode, loff_t i_size) | 667 | static inline void i_size_write(struct inode *inode, loff_t i_size) |
661 | { | 668 | { |
662 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 669 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
@@ -1705,6 +1712,8 @@ extern void __iget(struct inode * inode); | |||
1705 | extern void clear_inode(struct inode *); | 1712 | extern void clear_inode(struct inode *); |
1706 | extern void destroy_inode(struct inode *); | 1713 | extern void destroy_inode(struct inode *); |
1707 | extern struct inode *new_inode(struct super_block *); | 1714 | extern struct inode *new_inode(struct super_block *); |
1715 | extern int __remove_suid(struct dentry *, int); | ||
1716 | extern int should_remove_suid(struct dentry *); | ||
1708 | extern int remove_suid(struct dentry *); | 1717 | extern int remove_suid(struct dentry *); |
1709 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | 1718 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); |
1710 | 1719 | ||
@@ -1751,6 +1760,8 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |||
1751 | struct pipe_inode_info *, size_t, unsigned int); | 1760 | struct pipe_inode_info *, size_t, unsigned int); |
1752 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | 1761 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, |
1753 | struct file *, loff_t *, size_t, unsigned int); | 1762 | struct file *, loff_t *, size_t, unsigned int); |
1763 | extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *, | ||
1764 | struct file *, loff_t *, size_t, unsigned int); | ||
1754 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 1765 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
1755 | struct file *out, loff_t *, size_t len, unsigned int flags); | 1766 | struct file *out, loff_t *, size_t len, unsigned int flags); |
1756 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | 1767 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, |
diff --git a/include/linux/htirq.h b/include/linux/htirq.h index 1f15ce279a23..c96ea46737d0 100644 --- a/include/linux/htirq.h +++ b/include/linux/htirq.h | |||
@@ -1,15 +1,23 @@ | |||
1 | #ifndef LINUX_HTIRQ_H | 1 | #ifndef LINUX_HTIRQ_H |
2 | #define LINUX_HTIRQ_H | 2 | #define LINUX_HTIRQ_H |
3 | 3 | ||
4 | struct ht_irq_msg { | ||
5 | u32 address_lo; /* low 32 bits of the ht irq message */ | ||
6 | u32 address_hi; /* high 32 bits of the it irq message */ | ||
7 | }; | ||
8 | |||
4 | /* Helper functions.. */ | 9 | /* Helper functions.. */ |
5 | void write_ht_irq_low(unsigned int irq, u32 data); | 10 | void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); |
6 | void write_ht_irq_high(unsigned int irq, u32 data); | 11 | void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg); |
7 | u32 read_ht_irq_low(unsigned int irq); | ||
8 | u32 read_ht_irq_high(unsigned int irq); | ||
9 | void mask_ht_irq(unsigned int irq); | 12 | void mask_ht_irq(unsigned int irq); |
10 | void unmask_ht_irq(unsigned int irq); | 13 | void unmask_ht_irq(unsigned int irq); |
11 | 14 | ||
12 | /* The arch hook for getting things started */ | 15 | /* The arch hook for getting things started */ |
13 | int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev); | 16 | int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev); |
14 | 17 | ||
18 | /* For drivers of buggy hardware */ | ||
19 | typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq, | ||
20 | struct ht_irq_msg *msg); | ||
21 | int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update); | ||
22 | |||
15 | #endif /* LINUX_HTIRQ_H */ | 23 | #endif /* LINUX_HTIRQ_H */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5081d27bfa27..ace64e57e17f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -60,8 +60,11 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | |||
60 | * If the arch doesn't supply something else, assume that hugepage | 60 | * If the arch doesn't supply something else, assume that hugepage |
61 | * size aligned regions are ok without further preparation. | 61 | * size aligned regions are ok without further preparation. |
62 | */ | 62 | */ |
63 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | 63 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len, |
64 | pgoff_t pgoff) | ||
64 | { | 65 | { |
66 | if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT)) | ||
67 | return -EINVAL; | ||
65 | if (len & ~HPAGE_MASK) | 68 | if (len & ~HPAGE_MASK) |
66 | return -EINVAL; | 69 | return -EINVAL; |
67 | if (addr & ~HPAGE_MASK) | 70 | if (addr & ~HPAGE_MASK) |
@@ -69,7 +72,8 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | |||
69 | return 0; | 72 | return 0; |
70 | } | 73 | } |
71 | #else | 74 | #else |
72 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 75 | int prepare_hugepage_range(unsigned long addr, unsigned long len, |
76 | pgoff_t pgoff); | ||
73 | #endif | 77 | #endif |
74 | 78 | ||
75 | #ifndef ARCH_HAS_SETCLEAR_HUGE_PTE | 79 | #ifndef ARCH_HAS_SETCLEAR_HUGE_PTE |
@@ -107,7 +111,7 @@ static inline unsigned long hugetlb_total_pages(void) | |||
107 | #define hugetlb_report_meminfo(buf) 0 | 111 | #define hugetlb_report_meminfo(buf) 0 |
108 | #define hugetlb_report_node_meminfo(n, buf) 0 | 112 | #define hugetlb_report_node_meminfo(n, buf) 0 |
109 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 113 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
110 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 114 | #define prepare_hugepage_range(addr,len,pgoff) (-EINVAL) |
111 | #define pmd_huge(x) 0 | 115 | #define pmd_huge(x) 0 |
112 | #define is_hugepage_only_range(mm, addr, len) 0 | 116 | #define is_hugepage_only_range(mm, addr, len) 0 |
113 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 117 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index 878cfe4e587f..24da4fbc1a2f 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
@@ -68,7 +68,7 @@ | |||
68 | struct icmphdr { | 68 | struct icmphdr { |
69 | __u8 type; | 69 | __u8 type; |
70 | __u8 code; | 70 | __u8 code; |
71 | __be16 checksum; | 71 | __sum16 checksum; |
72 | union { | 72 | union { |
73 | struct { | 73 | struct { |
74 | __be16 id; | 74 | __be16 id; |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index c771a7db9871..68d3526c3a05 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -7,17 +7,17 @@ struct icmp6hdr { | |||
7 | 7 | ||
8 | __u8 icmp6_type; | 8 | __u8 icmp6_type; |
9 | __u8 icmp6_code; | 9 | __u8 icmp6_code; |
10 | __u16 icmp6_cksum; | 10 | __sum16 icmp6_cksum; |
11 | 11 | ||
12 | 12 | ||
13 | union { | 13 | union { |
14 | __u32 un_data32[1]; | 14 | __be32 un_data32[1]; |
15 | __u16 un_data16[2]; | 15 | __be16 un_data16[2]; |
16 | __u8 un_data8[4]; | 16 | __u8 un_data8[4]; |
17 | 17 | ||
18 | struct icmpv6_echo { | 18 | struct icmpv6_echo { |
19 | __u16 identifier; | 19 | __be16 identifier; |
20 | __u16 sequence; | 20 | __be16 sequence; |
21 | } u_echo; | 21 | } u_echo; |
22 | 22 | ||
23 | struct icmpv6_nd_advt { | 23 | struct icmpv6_nd_advt { |
@@ -53,7 +53,7 @@ struct icmp6hdr { | |||
53 | #else | 53 | #else |
54 | #error "Please fix <asm/byteorder.h>" | 54 | #error "Please fix <asm/byteorder.h>" |
55 | #endif | 55 | #endif |
56 | __u16 rt_lifetime; | 56 | __be16 rt_lifetime; |
57 | } u_nd_ra; | 57 | } u_nd_ra; |
58 | 58 | ||
59 | } icmp6_dataun; | 59 | } icmp6_dataun; |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index b92558549d27..99393ef3af39 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -1,17 +1,19 @@ | |||
1 | #ifndef __LINUX_IF_PACKET_H | 1 | #ifndef __LINUX_IF_PACKET_H |
2 | #define __LINUX_IF_PACKET_H | 2 | #define __LINUX_IF_PACKET_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | struct sockaddr_pkt | 6 | struct sockaddr_pkt |
5 | { | 7 | { |
6 | unsigned short spkt_family; | 8 | unsigned short spkt_family; |
7 | unsigned char spkt_device[14]; | 9 | unsigned char spkt_device[14]; |
8 | unsigned short spkt_protocol; | 10 | __be16 spkt_protocol; |
9 | }; | 11 | }; |
10 | 12 | ||
11 | struct sockaddr_ll | 13 | struct sockaddr_ll |
12 | { | 14 | { |
13 | unsigned short sll_family; | 15 | unsigned short sll_family; |
14 | unsigned short sll_protocol; | 16 | __be16 sll_protocol; |
15 | int sll_ifindex; | 17 | int sll_ifindex; |
16 | unsigned short sll_hatype; | 18 | unsigned short sll_hatype; |
17 | unsigned char sll_pkttype; | 19 | unsigned char sll_pkttype; |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index bef9f8fd93b3..8de079ba1107 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -19,10 +19,10 @@ struct ip_tunnel_parm | |||
19 | { | 19 | { |
20 | char name[IFNAMSIZ]; | 20 | char name[IFNAMSIZ]; |
21 | int link; | 21 | int link; |
22 | __u16 i_flags; | 22 | __be16 i_flags; |
23 | __u16 o_flags; | 23 | __be16 o_flags; |
24 | __u32 i_key; | 24 | __be32 i_key; |
25 | __u32 o_key; | 25 | __be32 o_key; |
26 | struct iphdr iph; | 26 | struct iphdr iph; |
27 | }; | 27 | }; |
28 | 28 | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 03f43e2893a4..6e7ea2f0a57c 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -30,7 +30,7 @@ struct igmphdr | |||
30 | { | 30 | { |
31 | __u8 type; | 31 | __u8 type; |
32 | __u8 code; /* For newer IGMP */ | 32 | __u8 code; /* For newer IGMP */ |
33 | __be16 csum; | 33 | __sum16 csum; |
34 | __be32 group; | 34 | __be32 group; |
35 | }; | 35 | }; |
36 | 36 | ||
@@ -191,7 +191,7 @@ struct ip_mc_list | |||
191 | #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) | 191 | #define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) |
192 | #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ | 192 | #define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ |
193 | ((value) < (thresh) ? (value) : \ | 193 | ((value) < (thresh) ? (value) : \ |
194 | ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ | 194 | ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \ |
195 | (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) | 195 | (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) |
196 | 196 | ||
197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) | 197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) |
diff --git a/include/linux/in.h b/include/linux/in.h index 2619859f6e1b..1912e7c0bc26 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -45,6 +45,7 @@ enum { | |||
45 | 45 | ||
46 | IPPROTO_COMP = 108, /* Compression Header protocol */ | 46 | IPPROTO_COMP = 108, /* Compression Header protocol */ |
47 | IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ | 47 | IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ |
48 | IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */ | ||
48 | 49 | ||
49 | IPPROTO_RAW = 255, /* Raw IP packets */ | 50 | IPPROTO_RAW = 255, /* Raw IP packets */ |
50 | IPPROTO_MAX | 51 | IPPROTO_MAX |
diff --git a/include/linux/in6.h b/include/linux/in6.h index 9be6a4756f0b..4e8350ae8869 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -54,7 +54,7 @@ extern const struct in6_addr in6addr_loopback; | |||
54 | struct sockaddr_in6 { | 54 | struct sockaddr_in6 { |
55 | unsigned short int sin6_family; /* AF_INET6 */ | 55 | unsigned short int sin6_family; /* AF_INET6 */ |
56 | __be16 sin6_port; /* Transport layer port # */ | 56 | __be16 sin6_port; /* Transport layer port # */ |
57 | __u32 sin6_flowinfo; /* IPv6 flow information */ | 57 | __be32 sin6_flowinfo; /* IPv6 flow information */ |
58 | struct in6_addr sin6_addr; /* IPv6 address */ | 58 | struct in6_addr sin6_addr; /* IPv6 address */ |
59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ | 59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ |
60 | }; | 60 | }; |
@@ -72,7 +72,7 @@ struct ipv6_mreq { | |||
72 | struct in6_flowlabel_req | 72 | struct in6_flowlabel_req |
73 | { | 73 | { |
74 | struct in6_addr flr_dst; | 74 | struct in6_addr flr_dst; |
75 | __u32 flr_label; | 75 | __be32 flr_label; |
76 | __u8 flr_action; | 76 | __u8 flr_action; |
77 | __u8 flr_share; | 77 | __u8 flr_share; |
78 | __u16 flr_flags; | 78 | __u16 flr_flags; |
@@ -225,7 +225,7 @@ struct in6_flowlabel_req | |||
225 | #endif | 225 | #endif |
226 | 226 | ||
227 | /* | 227 | /* |
228 | * Netfilter | 228 | * Netfilter (1) |
229 | * | 229 | * |
230 | * Following socket options are used in ip6_tables; | 230 | * Following socket options are used in ip6_tables; |
231 | * see include/linux/netfilter_ipv6/ip6_tables.h. | 231 | * see include/linux/netfilter_ipv6/ip6_tables.h. |
@@ -240,4 +240,14 @@ struct in6_flowlabel_req | |||
240 | #define IPV6_RECVTCLASS 66 | 240 | #define IPV6_RECVTCLASS 66 |
241 | #define IPV6_TCLASS 67 | 241 | #define IPV6_TCLASS 67 |
242 | 242 | ||
243 | /* | ||
244 | * Netfilter (2) | ||
245 | * | ||
246 | * Following socket options are used in ip6_tables; | ||
247 | * see include/linux/netfilter_ipv6/ip6_tables.h. | ||
248 | * | ||
249 | * IP6T_SO_GET_REVISION_MATCH 68 | ||
250 | * IP6T_SO_GET_REVISION_TARGET 69 | ||
251 | */ | ||
252 | |||
243 | #endif | 253 | #endif |
diff --git a/include/linux/inet.h b/include/linux/inet.h index b7c6da7d6d32..675a7dbe86f8 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/types.h> | 46 | #include <linux/types.h> |
47 | 47 | ||
48 | extern __be32 in_aton(const char *str); | 48 | extern __be32 in_aton(const char *str); |
49 | extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | 49 | extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); |
50 | extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); | 50 | extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); |
51 | #endif | 51 | #endif |
52 | #endif /* _LINUX_INET_H */ | 52 | #endif /* _LINUX_INET_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 5a0ab04627bc..c0f7aec331c2 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -124,12 +124,13 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) | |||
124 | * Check if a mask is acceptable. | 124 | * Check if a mask is acceptable. |
125 | */ | 125 | */ |
126 | 126 | ||
127 | static __inline__ int bad_mask(u32 mask, u32 addr) | 127 | static __inline__ int bad_mask(__be32 mask, __be32 addr) |
128 | { | 128 | { |
129 | __u32 hmask; | ||
129 | if (addr & (mask = ~mask)) | 130 | if (addr & (mask = ~mask)) |
130 | return 1; | 131 | return 1; |
131 | mask = ntohl(mask); | 132 | hmask = ntohl(mask); |
132 | if (mask & (mask+1)) | 133 | if (hmask & (hmask+1)) |
133 | return 1; | 134 | return 1; |
134 | return 0; | 135 | return 0; |
135 | } | 136 | } |
@@ -190,11 +191,12 @@ static __inline__ __be32 inet_make_mask(int logmask) | |||
190 | return 0; | 191 | return 0; |
191 | } | 192 | } |
192 | 193 | ||
193 | static __inline__ int inet_mask_len(__u32 mask) | 194 | static __inline__ int inet_mask_len(__be32 mask) |
194 | { | 195 | { |
195 | if (!(mask = ntohl(mask))) | 196 | __u32 hmask = ntohl(mask); |
197 | if (!hmask) | ||
196 | return 0; | 198 | return 0; |
197 | return 32 - ffz(~mask); | 199 | return 32 - ffz(~hmask); |
198 | } | 200 | } |
199 | 201 | ||
200 | 202 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index e92b1455d7af..5eb5d24b7680 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -84,19 +84,37 @@ extern void setup_arch(char **); | |||
84 | * by link order. | 84 | * by link order. |
85 | * For backwards compatibility, initcall() puts the call in | 85 | * For backwards compatibility, initcall() puts the call in |
86 | * the device init subsection. | 86 | * the device init subsection. |
87 | * | ||
88 | * The `id' arg to __define_initcall() is needed so that multiple initcalls | ||
89 | * can point at the same handler without causing duplicate-symbol build errors. | ||
87 | */ | 90 | */ |
88 | 91 | ||
89 | #define __define_initcall(level,fn) \ | 92 | #define __define_initcall(level,fn,id) \ |
90 | static initcall_t __initcall_##fn __attribute_used__ \ | 93 | static initcall_t __initcall_##fn##id __attribute_used__ \ |
91 | __attribute__((__section__(".initcall" level ".init"))) = fn | 94 | __attribute__((__section__(".initcall" level ".init"))) = fn |
92 | 95 | ||
93 | #define core_initcall(fn) __define_initcall("1",fn) | 96 | /* |
94 | #define postcore_initcall(fn) __define_initcall("2",fn) | 97 | * A "pure" initcall has no dependencies on anything else, and purely |
95 | #define arch_initcall(fn) __define_initcall("3",fn) | 98 | * initializes variables that couldn't be statically initialized. |
96 | #define subsys_initcall(fn) __define_initcall("4",fn) | 99 | * |
97 | #define fs_initcall(fn) __define_initcall("5",fn) | 100 | * This only exists for built-in code, not for modules. |
98 | #define device_initcall(fn) __define_initcall("6",fn) | 101 | */ |
99 | #define late_initcall(fn) __define_initcall("7",fn) | 102 | #define pure_initcall(fn) __define_initcall("0",fn,1) |
103 | |||
104 | #define core_initcall(fn) __define_initcall("1",fn,1) | ||
105 | #define core_initcall_sync(fn) __define_initcall("1s",fn,1s) | ||
106 | #define postcore_initcall(fn) __define_initcall("2",fn,2) | ||
107 | #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) | ||
108 | #define arch_initcall(fn) __define_initcall("3",fn,3) | ||
109 | #define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) | ||
110 | #define subsys_initcall(fn) __define_initcall("4",fn,4) | ||
111 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) | ||
112 | #define fs_initcall(fn) __define_initcall("5",fn,5) | ||
113 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) | ||
114 | #define device_initcall(fn) __define_initcall("6",fn,6) | ||
115 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) | ||
116 | #define late_initcall(fn) __define_initcall("7",fn,7) | ||
117 | #define late_initcall_sync(fn) __define_initcall("7s",fn,7s) | ||
100 | 118 | ||
101 | #define __initcall(fn) device_initcall(fn) | 119 | #define __initcall(fn) device_initcall(fn) |
102 | 120 | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index d42c83399071..cf8696d4a138 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -89,6 +89,7 @@ struct resource_list { | |||
89 | #define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ | 89 | #define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ |
90 | #define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */ | 90 | #define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */ |
91 | #define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ | 91 | #define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ |
92 | #define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */ | ||
92 | 93 | ||
93 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ | 94 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ |
94 | extern struct resource ioport_resource; | 95 | extern struct resource ioport_resource; |
diff --git a/include/linux/ip.h b/include/linux/ip.h index ecee9bb27d0e..1d36b971a8b5 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -98,7 +98,7 @@ struct iphdr { | |||
98 | __be16 frag_off; | 98 | __be16 frag_off; |
99 | __u8 ttl; | 99 | __u8 ttl; |
100 | __u8 protocol; | 100 | __u8 protocol; |
101 | __be16 check; | 101 | __sum16 check; |
102 | __be32 saddr; | 102 | __be32 saddr; |
103 | __be32 daddr; | 103 | __be32 daddr; |
104 | /*The options start here. */ | 104 | /*The options start here. */ |
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h index 5c23aeb104ca..af3f4a70f3df 100644 --- a/include/linux/ip6_tunnel.h +++ b/include/linux/ip6_tunnel.h | |||
@@ -25,7 +25,7 @@ struct ip6_tnl_parm { | |||
25 | __u8 proto; /* tunnel protocol */ | 25 | __u8 proto; /* tunnel protocol */ |
26 | __u8 encap_limit; /* encapsulation limit for tunnel */ | 26 | __u8 encap_limit; /* encapsulation limit for tunnel */ |
27 | __u8 hop_limit; /* hop limit for tunnel */ | 27 | __u8 hop_limit; /* hop limit for tunnel */ |
28 | __u32 flowinfo; /* traffic class and flowlabel for tunnel */ | 28 | __be32 flowinfo; /* traffic class and flowlabel for tunnel */ |
29 | __u32 flags; /* tunnel flags */ | 29 | __u32 flags; /* tunnel flags */ |
30 | struct in6_addr laddr; /* local tunnel end-point address */ | 30 | struct in6_addr laddr; /* local tunnel end-point address */ |
31 | struct in6_addr raddr; /* remote tunnel end-point address */ | 31 | struct in6_addr raddr; /* remote tunnel end-point address */ |
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h index 22f5e2afda4f..4d04d8b58a0a 100644 --- a/include/linux/ipmi_msgdefs.h +++ b/include/linux/ipmi_msgdefs.h | |||
@@ -75,6 +75,8 @@ | |||
75 | #define IPMI_INVALID_COMMAND_ERR 0xc1 | 75 | #define IPMI_INVALID_COMMAND_ERR 0xc1 |
76 | #define IPMI_ERR_MSG_TRUNCATED 0xc6 | 76 | #define IPMI_ERR_MSG_TRUNCATED 0xc6 |
77 | #define IPMI_LOST_ARBITRATION_ERR 0x81 | 77 | #define IPMI_LOST_ARBITRATION_ERR 0x81 |
78 | #define IPMI_BUS_ERR 0x82 | ||
79 | #define IPMI_NAK_ON_WRITE_ERR 0x83 | ||
78 | #define IPMI_ERR_UNSPECIFIED 0xff | 80 | #define IPMI_ERR_UNSPECIFIED 0xff |
79 | 81 | ||
80 | #define IPMI_CHANNEL_PROTOCOL_IPMB 1 | 82 | #define IPMI_CHANNEL_PROTOCOL_IPMB 1 |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 4f435c59de06..f8241130f5ea 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -274,7 +274,7 @@ struct ipv6_pinfo { | |||
274 | struct in6_addr *saddr_cache; | 274 | struct in6_addr *saddr_cache; |
275 | #endif | 275 | #endif |
276 | 276 | ||
277 | __u32 flow_label; | 277 | __be32 flow_label; |
278 | __u32 frag_size; | 278 | __u32 frag_size; |
279 | __s16 hop_limit; | 279 | __s16 hop_limit; |
280 | __s16 mcast_hops; | 280 | __s16 mcast_hops; |
diff --git a/include/linux/ipx.h b/include/linux/ipx.h index 4f29c60964c4..eb19b4ea84f4 100644 --- a/include/linux/ipx.h +++ b/include/linux/ipx.h | |||
@@ -7,8 +7,8 @@ | |||
7 | 7 | ||
8 | struct sockaddr_ipx { | 8 | struct sockaddr_ipx { |
9 | sa_family_t sipx_family; | 9 | sa_family_t sipx_family; |
10 | __u16 sipx_port; | 10 | __be16 sipx_port; |
11 | __u32 sipx_network; | 11 | __be32 sipx_network; |
12 | unsigned char sipx_node[IPX_NODE_LEN]; | 12 | unsigned char sipx_node[IPX_NODE_LEN]; |
13 | __u8 sipx_type; | 13 | __u8 sipx_type; |
14 | unsigned char sipx_zero; /* 16 byte fill */ | 14 | unsigned char sipx_zero; /* 16 byte fill */ |
@@ -23,13 +23,13 @@ struct sockaddr_ipx { | |||
23 | #define IPX_CRTITF 1 | 23 | #define IPX_CRTITF 1 |
24 | 24 | ||
25 | struct ipx_route_definition { | 25 | struct ipx_route_definition { |
26 | __u32 ipx_network; | 26 | __be32 ipx_network; |
27 | __u32 ipx_router_network; | 27 | __be32 ipx_router_network; |
28 | unsigned char ipx_router_node[IPX_NODE_LEN]; | 28 | unsigned char ipx_router_node[IPX_NODE_LEN]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct ipx_interface_definition { | 31 | struct ipx_interface_definition { |
32 | __u32 ipx_network; | 32 | __be32 ipx_network; |
33 | unsigned char ipx_device[16]; | 33 | unsigned char ipx_device[16]; |
34 | unsigned char ipx_dlink_type; | 34 | unsigned char ipx_dlink_type; |
35 | #define IPX_FRAME_NONE 0 | 35 | #define IPX_FRAME_NONE 0 |
@@ -55,8 +55,8 @@ struct ipx_config_data { | |||
55 | */ | 55 | */ |
56 | 56 | ||
57 | struct ipx_route_def { | 57 | struct ipx_route_def { |
58 | __u32 ipx_network; | 58 | __be32 ipx_network; |
59 | __u32 ipx_router_network; | 59 | __be32 ipx_router_network; |
60 | #define IPX_ROUTE_NO_ROUTER 0 | 60 | #define IPX_ROUTE_NO_ROUTER 0 |
61 | unsigned char ipx_router_node[IPX_NODE_LEN]; | 61 | unsigned char ipx_router_node[IPX_NODE_LEN]; |
62 | unsigned char ipx_device[16]; | 62 | unsigned char ipx_device[16]; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index c64f3cc7e870..52fc4052a0ae 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -141,6 +141,7 @@ struct irq_chip { | |||
141 | * @pending_mask: pending rebalanced interrupts | 141 | * @pending_mask: pending rebalanced interrupts |
142 | * @dir: /proc/irq/ procfs entry | 142 | * @dir: /proc/irq/ procfs entry |
143 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP | 143 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP |
144 | * @name: flow handler name for /proc/interrupts output | ||
144 | * | 145 | * |
145 | * Pad this out to 32 bytes for cache and indexing reasons. | 146 | * Pad this out to 32 bytes for cache and indexing reasons. |
146 | */ | 147 | */ |
@@ -165,8 +166,9 @@ struct irq_desc { | |||
165 | cpumask_t pending_mask; | 166 | cpumask_t pending_mask; |
166 | #endif | 167 | #endif |
167 | #ifdef CONFIG_PROC_FS | 168 | #ifdef CONFIG_PROC_FS |
168 | struct proc_dir_entry *dir; | 169 | struct proc_dir_entry *dir; |
169 | #endif | 170 | #endif |
171 | const char *name; | ||
170 | } ____cacheline_aligned; | 172 | } ____cacheline_aligned; |
171 | 173 | ||
172 | extern struct irq_desc irq_desc[NR_IRQS]; | 174 | extern struct irq_desc irq_desc[NR_IRQS]; |
@@ -272,12 +274,6 @@ extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc); | |||
272 | extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); | 274 | extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); |
273 | 275 | ||
274 | /* | 276 | /* |
275 | * Get a descriptive string for the highlevel handler, for | ||
276 | * /proc/interrupts output: | ||
277 | */ | ||
278 | extern const char *handle_irq_name(irq_flow_handler_t handle); | ||
279 | |||
280 | /* | ||
281 | * Monolithic do_IRQ implementation. | 277 | * Monolithic do_IRQ implementation. |
282 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) | 278 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) |
283 | */ | 279 | */ |
@@ -329,7 +325,12 @@ extern void | |||
329 | set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, | 325 | set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, |
330 | irq_flow_handler_t handle); | 326 | irq_flow_handler_t handle); |
331 | extern void | 327 | extern void |
332 | __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained); | 328 | set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip, |
329 | irq_flow_handler_t handle, const char *name); | ||
330 | |||
331 | extern void | ||
332 | __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, | ||
333 | const char *name); | ||
333 | 334 | ||
334 | /* | 335 | /* |
335 | * Set a highlevel flow handler for a given IRQ: | 336 | * Set a highlevel flow handler for a given IRQ: |
@@ -337,7 +338,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained); | |||
337 | static inline void | 338 | static inline void |
338 | set_irq_handler(unsigned int irq, irq_flow_handler_t handle) | 339 | set_irq_handler(unsigned int irq, irq_flow_handler_t handle) |
339 | { | 340 | { |
340 | __set_irq_handler(irq, handle, 0); | 341 | __set_irq_handler(irq, handle, 0, NULL); |
341 | } | 342 | } |
342 | 343 | ||
343 | /* | 344 | /* |
@@ -349,7 +350,7 @@ static inline void | |||
349 | set_irq_chained_handler(unsigned int irq, | 350 | set_irq_chained_handler(unsigned int irq, |
350 | irq_flow_handler_t handle) | 351 | irq_flow_handler_t handle) |
351 | { | 352 | { |
352 | __set_irq_handler(irq, handle, 1); | 353 | __set_irq_handler(irq, handle, 1, NULL); |
353 | } | 354 | } |
354 | 355 | ||
355 | /* Handle dynamic irq creation and destruction */ | 356 | /* Handle dynamic irq creation and destruction */ |
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h index fd1756d3a47e..88b45895746d 100644 --- a/include/linux/ixjuser.h +++ b/include/linux/ixjuser.h | |||
@@ -315,7 +315,7 @@ typedef struct { | |||
315 | * structures. If the freq0 variable is non-zero, the tone table contents | 315 | * structures. If the freq0 variable is non-zero, the tone table contents |
316 | * for the tone_index are updated to the frequencies and gains defined. It | 316 | * for the tone_index are updated to the frequencies and gains defined. It |
317 | * should be noted that DTMF tones cannot be reassigned, so if DTMF tone | 317 | * should be noted that DTMF tones cannot be reassigned, so if DTMF tone |
318 | * table indexs are used in a cadence the frequency and gain variables will | 318 | * table indexes are used in a cadence the frequency and gain variables will |
319 | * be ignored. | 319 | * be ignored. |
320 | * | 320 | * |
321 | * If the array elements contain frequency parameters the driver will | 321 | * If the array elements contain frequency parameters the driver will |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index c8d5f207c3d4..0ec6e28bccd2 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -74,7 +74,7 @@ | |||
74 | #define __jiffy_data __attribute__((section(".data"))) | 74 | #define __jiffy_data __attribute__((section(".data"))) |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * The 64-bit value is not volatile - you MUST NOT read it | 77 | * The 64-bit value is not atomic - you MUST NOT read it |
78 | * without sampling the sequence number in xtime_lock. | 78 | * without sampling the sequence number in xtime_lock. |
79 | * get_jiffies_64() will do this for you as appropriate. | 79 | * get_jiffies_64() will do this for you as appropriate. |
80 | */ | 80 | */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 80f39cab470a..6738283ac385 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -30,8 +30,10 @@ extern const char linux_banner[]; | |||
30 | 30 | ||
31 | #define STACK_MAGIC 0xdeadbeef | 31 | #define STACK_MAGIC 0xdeadbeef |
32 | 32 | ||
33 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | ||
34 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | ||
35 | |||
33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 36 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
34 | #define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL)) | ||
35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 37 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
36 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 38 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
37 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 39 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
@@ -63,7 +65,7 @@ struct user; | |||
63 | * context (spinlock, irq-handler, ...). | 65 | * context (spinlock, irq-handler, ...). |
64 | * | 66 | * |
65 | * This is a useful debugging help to be able to catch problems early and not | 67 | * This is a useful debugging help to be able to catch problems early and not |
66 | * be biten later when the calling function happens to sleep when it is not | 68 | * be bitten later when the calling function happens to sleep when it is not |
67 | * supposed to. | 69 | * supposed to. |
68 | */ | 70 | */ |
69 | #ifdef CONFIG_PREEMPT_VOLUNTARY | 71 | #ifdef CONFIG_PREEMPT_VOLUNTARY |
@@ -171,6 +173,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x) | |||
171 | 173 | ||
172 | extern int printk_ratelimit(void); | 174 | extern int printk_ratelimit(void); |
173 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | 175 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); |
176 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
177 | unsigned int interval_msec); | ||
174 | 178 | ||
175 | static inline void console_silent(void) | 179 | static inline void console_silent(void) |
176 | { | 180 | { |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 6427949ddf99..a4ede62b339d 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -122,6 +122,8 @@ extern struct kimage *kexec_crash_image; | |||
122 | #define KEXEC_ARCH_IA_64 (50 << 16) | 122 | #define KEXEC_ARCH_IA_64 (50 << 16) |
123 | #define KEXEC_ARCH_S390 (22 << 16) | 123 | #define KEXEC_ARCH_S390 (22 << 16) |
124 | #define KEXEC_ARCH_SH (42 << 16) | 124 | #define KEXEC_ARCH_SH (42 << 16) |
125 | #define KEXEC_ARCH_MIPS_LE (10 << 16) | ||
126 | #define KEXEC_ARCH_MIPS ( 8 << 16) | ||
125 | 127 | ||
126 | #define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ | 128 | #define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ |
127 | 129 | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bcd9cd173c2c..d1c8d28fa92e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -47,6 +47,7 @@ enum kobject_action { | |||
47 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ | 47 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ |
48 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ | 48 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ |
49 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ | 49 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ |
50 | KOBJ_MOVE = (__force kobject_action_t) 0x08, /* device move */ | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | struct kobject { | 53 | struct kobject { |
@@ -76,6 +77,7 @@ extern int __must_check kobject_add(struct kobject *); | |||
76 | extern void kobject_del(struct kobject *); | 77 | extern void kobject_del(struct kobject *); |
77 | 78 | ||
78 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 79 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
80 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | ||
79 | 81 | ||
80 | extern int __must_check kobject_register(struct kobject *); | 82 | extern int __must_check kobject_register(struct kobject *); |
81 | extern void kobject_unregister(struct kobject *); | 83 | extern void kobject_unregister(struct kobject *); |
@@ -264,6 +266,8 @@ extern int __must_check subsys_create_file(struct subsystem * , | |||
264 | 266 | ||
265 | #if defined(CONFIG_HOTPLUG) | 267 | #if defined(CONFIG_HOTPLUG) |
266 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 268 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
269 | void kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | ||
270 | char *envp[]); | ||
267 | 271 | ||
268 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 272 | int add_uevent_var(char **envp, int num_envp, int *cur_index, |
269 | char *buffer, int buffer_size, int *cur_len, | 273 | char *buffer, int buffer_size, int *cur_len, |
@@ -271,6 +275,10 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index, | |||
271 | __attribute__((format (printf, 7, 8))); | 275 | __attribute__((format (printf, 7, 8))); |
272 | #else | 276 | #else |
273 | static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } | 277 | static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } |
278 | static inline void kobject_uevent_env(struct kobject *kobj, | ||
279 | enum kobject_action action, | ||
280 | char *envp[]) | ||
281 | { } | ||
274 | 282 | ||
275 | static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, | 283 | static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, |
276 | char *buffer, int buffer_size, int *cur_len, | 284 | char *buffer, int buffer_size, int *cur_len, |
diff --git a/include/linux/libata.h b/include/linux/libata.h index d0a7ad5ed518..abd2debebca2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -143,7 +143,7 @@ enum { | |||
143 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 143 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
144 | 144 | ||
145 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 145 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
146 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* devied limited to non-NCQ mode */ | 146 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ |
147 | ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ | 147 | ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ |
148 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 148 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
149 | 149 | ||
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_port *ap); | |||
702 | extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); | 702 | extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); |
703 | extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); | 703 | extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); |
704 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | 704 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); |
705 | extern int ata_dev_revalidate(struct ata_device *dev, int post_reset); | ||
706 | extern void ata_port_disable(struct ata_port *); | 705 | extern void ata_port_disable(struct ata_port *); |
707 | extern void ata_std_ports(struct ata_ioports *ioaddr); | 706 | extern void ata_std_ports(struct ata_ioports *ioaddr); |
708 | #ifdef CONFIG_PCI | 707 | #ifdef CONFIG_PCI |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 81e3a185f951..aa50d89eacd7 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -10,6 +10,11 @@ | |||
10 | #define LINUX_LOCKD_BIND_H | 10 | #define LINUX_LOCKD_BIND_H |
11 | 11 | ||
12 | #include <linux/lockd/nlm.h> | 12 | #include <linux/lockd/nlm.h> |
13 | /* need xdr-encoded error codes too, so... */ | ||
14 | #include <linux/lockd/xdr.h> | ||
15 | #ifdef CONFIG_LOCKD_V4 | ||
16 | #include <linux/lockd/xdr4.h> | ||
17 | #endif | ||
13 | 18 | ||
14 | /* Dummy declarations */ | 19 | /* Dummy declarations */ |
15 | struct svc_rqst; | 20 | struct svc_rqst; |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 2909619c0295..862d9730a60d 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -154,7 +154,7 @@ int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); | |||
154 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); | 154 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); |
155 | void nlmclnt_finish_block(struct nlm_wait *block); | 155 | void nlmclnt_finish_block(struct nlm_wait *block); |
156 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); | 156 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); |
157 | u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); | 157 | __be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); |
158 | void nlmclnt_recovery(struct nlm_host *); | 158 | void nlmclnt_recovery(struct nlm_host *); |
159 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 159 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); |
160 | void nlmclnt_next_cookie(struct nlm_cookie *); | 160 | void nlmclnt_next_cookie(struct nlm_cookie *); |
@@ -184,12 +184,12 @@ typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref) | |||
184 | /* | 184 | /* |
185 | * Server-side lock handling | 185 | * Server-side lock handling |
186 | */ | 186 | */ |
187 | u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | 187 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, |
188 | struct nlm_lock *, int, struct nlm_cookie *); | 188 | struct nlm_lock *, int, struct nlm_cookie *); |
189 | u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 189 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
190 | u32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, | 190 | __be32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, |
191 | struct nlm_lock *); | 191 | struct nlm_lock *); |
192 | u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 192 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
193 | unsigned long nlmsvc_retry_blocked(void); | 193 | unsigned long nlmsvc_retry_blocked(void); |
194 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 194 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
195 | nlm_host_match_fn_t match); | 195 | nlm_host_match_fn_t match); |
@@ -198,7 +198,7 @@ void nlmsvc_grant_reply(struct nlm_cookie *, u32); | |||
198 | /* | 198 | /* |
199 | * File handling for the server personality | 199 | * File handling for the server personality |
200 | */ | 200 | */ |
201 | u32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, | 201 | __be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, |
202 | struct nfs_fh *); | 202 | struct nfs_fh *); |
203 | void nlm_release_file(struct nlm_file *); | 203 | void nlm_release_file(struct nlm_file *); |
204 | void nlmsvc_mark_resources(void); | 204 | void nlmsvc_mark_resources(void); |
diff --git a/include/linux/lockd/share.h b/include/linux/lockd/share.h index cd7816e74c05..630c5bf69b07 100644 --- a/include/linux/lockd/share.h +++ b/include/linux/lockd/share.h | |||
@@ -21,9 +21,9 @@ struct nlm_share { | |||
21 | u32 s_mode; /* deny mode */ | 21 | u32 s_mode; /* deny mode */ |
22 | }; | 22 | }; |
23 | 23 | ||
24 | u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, | 24 | __be32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, |
25 | struct nlm_args *); | 25 | struct nlm_args *); |
26 | u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, | 26 | __be32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, |
27 | struct nlm_args *); | 27 | struct nlm_args *); |
28 | void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, | 28 | void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, |
29 | nlm_host_match_fn_t); | 29 | nlm_host_match_fn_t); |
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h index bb0a0f1caa91..29e7d9fc9dad 100644 --- a/include/linux/lockd/xdr.h +++ b/include/linux/lockd/xdr.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #include <linux/nfs.h> | 13 | #include <linux/nfs.h> |
14 | #include <linux/sunrpc/xdr.h> | 14 | #include <linux/sunrpc/xdr.h> |
15 | 15 | ||
16 | struct svc_rqst; | ||
17 | |||
16 | #define NLM_MAXCOOKIELEN 32 | 18 | #define NLM_MAXCOOKIELEN 32 |
17 | #define NLM_MAXSTRLEN 1024 | 19 | #define NLM_MAXSTRLEN 1024 |
18 | 20 | ||
@@ -22,6 +24,8 @@ | |||
22 | #define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED) | 24 | #define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED) |
23 | #define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD) | 25 | #define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD) |
24 | 26 | ||
27 | #define nlm_drop_reply __constant_htonl(30000) | ||
28 | |||
25 | /* Lock info passed via NLM */ | 29 | /* Lock info passed via NLM */ |
26 | struct nlm_lock { | 30 | struct nlm_lock { |
27 | char * caller; | 31 | char * caller; |
@@ -86,19 +90,19 @@ struct nlm_reboot { | |||
86 | */ | 90 | */ |
87 | #define NLMSVC_XDRSIZE sizeof(struct nlm_args) | 91 | #define NLMSVC_XDRSIZE sizeof(struct nlm_args) |
88 | 92 | ||
89 | int nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); | 93 | int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
90 | int nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); | 94 | int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); |
91 | int nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); | 95 | int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
92 | int nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); | 96 | int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
93 | int nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); | 97 | int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
94 | int nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); | 98 | int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); |
95 | int nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); | 99 | int nlmsvc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *); |
96 | int nlmsvc_encode_void(struct svc_rqst *, u32 *, void *); | 100 | int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *); |
97 | int nlmsvc_decode_void(struct svc_rqst *, u32 *, void *); | 101 | int nlmsvc_decode_void(struct svc_rqst *, __be32 *, void *); |
98 | int nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); | 102 | int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
99 | int nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); | 103 | int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); |
100 | int nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); | 104 | int nlmsvc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *); |
101 | int nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); | 105 | int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *); |
102 | /* | 106 | /* |
103 | int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 107 | int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
104 | int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 108 | int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h index 3cc1ae25009b..dd12b4c9e613 100644 --- a/include/linux/lockd/xdr4.h +++ b/include/linux/lockd/xdr4.h | |||
@@ -23,19 +23,19 @@ | |||
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); | 26 | int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
27 | int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); | 27 | int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); |
28 | int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); | 28 | int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
29 | int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); | 29 | int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
30 | int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); | 30 | int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
31 | int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); | 31 | int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); |
32 | int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); | 32 | int nlm4svc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *); |
33 | int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *); | 33 | int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *); |
34 | int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *); | 34 | int nlm4svc_decode_void(struct svc_rqst *, __be32 *, void *); |
35 | int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); | 35 | int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *); |
36 | int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); | 36 | int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); |
37 | int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); | 37 | int nlm4svc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *); |
38 | int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); | 38 | int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *); |
39 | /* | 39 | /* |
40 | int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 40 | int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
41 | int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); | 41 | int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 1314ca0f29be..819f08f1310d 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -202,7 +202,7 @@ extern int lockdep_internal(void); | |||
202 | */ | 202 | */ |
203 | 203 | ||
204 | extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | 204 | extern void lockdep_init_map(struct lockdep_map *lock, const char *name, |
205 | struct lock_class_key *key); | 205 | struct lock_class_key *key, int subclass); |
206 | 206 | ||
207 | /* | 207 | /* |
208 | * Reinitialize a lock key - for cases where there is special locking or | 208 | * Reinitialize a lock key - for cases where there is special locking or |
@@ -211,9 +211,14 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
211 | * or they are too narrow (they suffer from a false class-split): | 211 | * or they are too narrow (they suffer from a false class-split): |
212 | */ | 212 | */ |
213 | #define lockdep_set_class(lock, key) \ | 213 | #define lockdep_set_class(lock, key) \ |
214 | lockdep_init_map(&(lock)->dep_map, #key, key) | 214 | lockdep_init_map(&(lock)->dep_map, #key, key, 0) |
215 | #define lockdep_set_class_and_name(lock, key, name) \ | 215 | #define lockdep_set_class_and_name(lock, key, name) \ |
216 | lockdep_init_map(&(lock)->dep_map, name, key) | 216 | lockdep_init_map(&(lock)->dep_map, name, key, 0) |
217 | #define lockdep_set_class_and_subclass(lock, key, sub) \ | ||
218 | lockdep_init_map(&(lock)->dep_map, #key, key, sub) | ||
219 | #define lockdep_set_subclass(lock, sub) \ | ||
220 | lockdep_init_map(&(lock)->dep_map, #lock, \ | ||
221 | (lock)->dep_map.key, sub) | ||
217 | 222 | ||
218 | /* | 223 | /* |
219 | * Acquire a lock. | 224 | * Acquire a lock. |
@@ -257,10 +262,14 @@ static inline int lockdep_internal(void) | |||
257 | # define lock_release(l, n, i) do { } while (0) | 262 | # define lock_release(l, n, i) do { } while (0) |
258 | # define lockdep_init() do { } while (0) | 263 | # define lockdep_init() do { } while (0) |
259 | # define lockdep_info() do { } while (0) | 264 | # define lockdep_info() do { } while (0) |
260 | # define lockdep_init_map(lock, name, key) do { (void)(key); } while (0) | 265 | # define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0) |
261 | # define lockdep_set_class(lock, key) do { (void)(key); } while (0) | 266 | # define lockdep_set_class(lock, key) do { (void)(key); } while (0) |
262 | # define lockdep_set_class_and_name(lock, key, name) \ | 267 | # define lockdep_set_class_and_name(lock, key, name) \ |
263 | do { (void)(key); } while (0) | 268 | do { (void)(key); } while (0) |
269 | #define lockdep_set_class_and_subclass(lock, key, sub) \ | ||
270 | do { (void)(key); } while (0) | ||
271 | #define lockdep_set_subclass(lock, sub) do { } while (0) | ||
272 | |||
264 | # define INIT_LOCKDEP | 273 | # define INIT_LOCKDEP |
265 | # define lockdep_reset() do { debug_locks = 1; } while (0) | 274 | # define lockdep_reset() do { debug_locks = 1; } while (0) |
266 | # define lockdep_free_key_range(start, size) do { } while (0) | 275 | # define lockdep_free_key_range(start, size) do { } while (0) |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 09f0f575ddff..daabb3aa1ec6 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -150,7 +150,7 @@ extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | |||
150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); | 150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); |
151 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) | 151 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) |
152 | 152 | ||
153 | #ifdef CONFIG_CPUSET | 153 | #ifdef CONFIG_CPUSETS |
154 | #define current_cpuset_is_being_rebound() \ | 154 | #define current_cpuset_is_being_rebound() \ |
155 | (cpuset_being_rebound == current->cpuset) | 155 | (cpuset_being_rebound == current->cpuset) |
156 | #else | 156 | #else |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index b03cfb91e228..326da7d500c7 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -31,15 +31,14 @@ | |||
31 | #define HPET_MINOR 228 | 31 | #define HPET_MINOR 228 |
32 | 32 | ||
33 | struct device; | 33 | struct device; |
34 | struct class_device; | ||
35 | 34 | ||
36 | struct miscdevice { | 35 | struct miscdevice { |
37 | int minor; | 36 | int minor; |
38 | const char *name; | 37 | const char *name; |
39 | const struct file_operations *fops; | 38 | const struct file_operations *fops; |
40 | struct list_head list; | 39 | struct list_head list; |
41 | struct device *dev; | 40 | struct device *parent; |
42 | struct class_device *class; | 41 | struct device *this_device; |
43 | }; | 42 | }; |
44 | 43 | ||
45 | extern int misc_register(struct miscdevice * misc); | 44 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5a6068ff5556..d538de901965 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long addr); | |||
1115 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) | 1115 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) |
1116 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1116 | #endif /* __HAVE_ARCH_GATE_AREA */ |
1117 | 1117 | ||
1118 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ | ||
1119 | #define OOM_DISABLE -17 | ||
1120 | |||
1121 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1118 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, |
1122 | void __user *, size_t *, loff_t *); | 1119 | void __user *, size_t *, loff_t *); |
1123 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1120 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 991a37382a22..d0e6a5497614 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -39,6 +39,10 @@ struct mmc_csd { | |||
39 | write_misalign:1; | 39 | write_misalign:1; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct mmc_ext_csd { | ||
43 | unsigned int hs_max_dtr; | ||
44 | }; | ||
45 | |||
42 | struct sd_scr { | 46 | struct sd_scr { |
43 | unsigned char sda_vsn; | 47 | unsigned char sda_vsn; |
44 | unsigned char bus_widths; | 48 | unsigned char bus_widths; |
@@ -46,6 +50,10 @@ struct sd_scr { | |||
46 | #define SD_SCR_BUS_WIDTH_4 (1<<2) | 50 | #define SD_SCR_BUS_WIDTH_4 (1<<2) |
47 | }; | 51 | }; |
48 | 52 | ||
53 | struct sd_switch_caps { | ||
54 | unsigned int hs_max_dtr; | ||
55 | }; | ||
56 | |||
49 | struct mmc_host; | 57 | struct mmc_host; |
50 | 58 | ||
51 | /* | 59 | /* |
@@ -62,12 +70,15 @@ struct mmc_card { | |||
62 | #define MMC_STATE_BAD (1<<2) /* unrecognised device */ | 70 | #define MMC_STATE_BAD (1<<2) /* unrecognised device */ |
63 | #define MMC_STATE_SDCARD (1<<3) /* is an SD card */ | 71 | #define MMC_STATE_SDCARD (1<<3) /* is an SD card */ |
64 | #define MMC_STATE_READONLY (1<<4) /* card is read-only */ | 72 | #define MMC_STATE_READONLY (1<<4) /* card is read-only */ |
73 | #define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */ | ||
65 | u32 raw_cid[4]; /* raw card CID */ | 74 | u32 raw_cid[4]; /* raw card CID */ |
66 | u32 raw_csd[4]; /* raw card CSD */ | 75 | u32 raw_csd[4]; /* raw card CSD */ |
67 | u32 raw_scr[2]; /* raw card SCR */ | 76 | u32 raw_scr[2]; /* raw card SCR */ |
68 | struct mmc_cid cid; /* card identification */ | 77 | struct mmc_cid cid; /* card identification */ |
69 | struct mmc_csd csd; /* card specific */ | 78 | struct mmc_csd csd; /* card specific */ |
79 | struct mmc_ext_csd ext_csd; /* mmc v4 extended card specific */ | ||
70 | struct sd_scr scr; /* extra SD information */ | 80 | struct sd_scr scr; /* extra SD information */ |
81 | struct sd_switch_caps sw_caps; /* switch (CMD6) caps */ | ||
71 | }; | 82 | }; |
72 | 83 | ||
73 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) | 84 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) |
@@ -75,12 +86,14 @@ struct mmc_card { | |||
75 | #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) | 86 | #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) |
76 | #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) | 87 | #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) |
77 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) | 88 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) |
89 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | ||
78 | 90 | ||
79 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 91 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
80 | #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) | 92 | #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) |
81 | #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) | 93 | #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) |
82 | #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) | 94 | #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) |
83 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 95 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
96 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | ||
84 | 97 | ||
85 | #define mmc_card_name(c) ((c)->cid.prod_name) | 98 | #define mmc_card_name(c) ((c)->cid.prod_name) |
86 | #define mmc_card_id(c) ((c)->dev.bus_id) | 99 | #define mmc_card_id(c) ((c)->dev.bus_id) |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 587264a58d56..528e7d3fecb1 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -74,8 +74,8 @@ struct mmc_card; | |||
74 | struct device; | 74 | struct device; |
75 | 75 | ||
76 | struct mmc_host { | 76 | struct mmc_host { |
77 | struct device *dev; | 77 | struct device *parent; |
78 | struct class_device class_dev; | 78 | struct device class_dev; |
79 | int index; | 79 | int index; |
80 | const struct mmc_host_ops *ops; | 80 | const struct mmc_host_ops *ops; |
81 | unsigned int f_min; | 81 | unsigned int f_min; |
@@ -125,8 +125,8 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
125 | return (void *)host->private; | 125 | return (void *)host->private; |
126 | } | 126 | } |
127 | 127 | ||
128 | #define mmc_dev(x) ((x)->dev) | 128 | #define mmc_dev(x) ((x)->parent) |
129 | #define mmc_hostname(x) ((x)->class_dev.class_id) | 129 | #define mmc_hostname(x) ((x)->class_dev.bus_id) |
130 | 130 | ||
131 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 131 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
132 | extern int mmc_resume_host(struct mmc_host *); | 132 | extern int mmc_resume_host(struct mmc_host *); |
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 08dec8d9e703..2dce60c43f4b 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h | |||
@@ -25,14 +25,16 @@ | |||
25 | #ifndef MMC_MMC_PROTOCOL_H | 25 | #ifndef MMC_MMC_PROTOCOL_H |
26 | #define MMC_MMC_PROTOCOL_H | 26 | #define MMC_MMC_PROTOCOL_H |
27 | 27 | ||
28 | /* Standard MMC commands (3.1) type argument response */ | 28 | /* Standard MMC commands (4.1) type argument response */ |
29 | /* class 1 */ | 29 | /* class 1 */ |
30 | #define MMC_GO_IDLE_STATE 0 /* bc */ | 30 | #define MMC_GO_IDLE_STATE 0 /* bc */ |
31 | #define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ | 31 | #define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ |
32 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ | 32 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
33 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ | 33 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
34 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | 34 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ |
35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ | ||
35 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ | 36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ | ||
36 | #define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ | 38 | #define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ |
37 | #define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ | 39 | #define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ |
38 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ | 40 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ |
@@ -80,6 +82,7 @@ | |||
80 | /* class 8 */ | 82 | /* class 8 */ |
81 | /* This is basically the same command as for MMC with some quirks. */ | 83 | /* This is basically the same command as for MMC with some quirks. */ |
82 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ | 84 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ |
85 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ | ||
83 | 86 | ||
84 | /* Application commands */ | 87 | /* Application commands */ |
85 | #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ | 88 | #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ |
@@ -88,6 +91,30 @@ | |||
88 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ | 91 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ |
89 | 92 | ||
90 | /* | 93 | /* |
94 | * MMC_SWITCH argument format: | ||
95 | * | ||
96 | * [31:26] Always 0 | ||
97 | * [25:24] Access Mode | ||
98 | * [23:16] Location of target Byte in EXT_CSD | ||
99 | * [15:08] Value Byte | ||
100 | * [07:03] Always 0 | ||
101 | * [02:00] Command Set | ||
102 | */ | ||
103 | |||
104 | /* | ||
105 | * SD_SWITCH argument format: | ||
106 | * | ||
107 | * [31] Check (0) or switch (1) | ||
108 | * [30:24] Reserved (0) | ||
109 | * [23:20] Function group 6 | ||
110 | * [19:16] Function group 5 | ||
111 | * [15:12] Function group 4 | ||
112 | * [11:8] Function group 3 | ||
113 | * [7:4] Function group 2 | ||
114 | * [3:0] Function group 1 | ||
115 | */ | ||
116 | |||
117 | /* | ||
91 | MMC status in R1 | 118 | MMC status in R1 |
92 | Type | 119 | Type |
93 | e : error bit | 120 | e : error bit |
@@ -230,13 +257,54 @@ struct _mmc_csd { | |||
230 | 257 | ||
231 | #define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ | 258 | #define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ |
232 | #define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ | 259 | #define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ |
233 | #define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 */ | 260 | #define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */ |
261 | #define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */ | ||
234 | 262 | ||
235 | #define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ | 263 | #define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ |
236 | #define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ | 264 | #define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ |
237 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ | 265 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ |
238 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ | 266 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */ |
267 | #define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */ | ||
268 | |||
269 | /* | ||
270 | * EXT_CSD fields | ||
271 | */ | ||
272 | |||
273 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | ||
274 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | ||
275 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | ||
276 | |||
277 | /* | ||
278 | * EXT_CSD field definitions | ||
279 | */ | ||
280 | |||
281 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | ||
282 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | ||
283 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) | ||
284 | |||
285 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | ||
286 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | ||
287 | |||
288 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | ||
289 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | ||
290 | #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ | ||
291 | |||
292 | /* | ||
293 | * MMC_SWITCH access modes | ||
294 | */ | ||
295 | |||
296 | #define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ | ||
297 | #define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */ | ||
298 | #define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ | ||
299 | #define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ | ||
300 | |||
301 | /* | ||
302 | * SCR field definitions | ||
303 | */ | ||
239 | 304 | ||
305 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ | ||
306 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ | ||
307 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ | ||
240 | 308 | ||
241 | /* | 309 | /* |
242 | * SD bus widths | 310 | * SD bus widths |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 59855b8718a0..e06683e2bea3 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -218,13 +218,9 @@ struct zone { | |||
218 | * under - it drives the swappiness decision: whether to unmap mapped | 218 | * under - it drives the swappiness decision: whether to unmap mapped |
219 | * pages. | 219 | * pages. |
220 | * | 220 | * |
221 | * temp_priority is used to remember the scanning priority at which | 221 | * Access to both this field is quite racy even on uniprocessor. But |
222 | * this zone was successfully refilled to free_pages == pages_high. | ||
223 | * | ||
224 | * Access to both these fields is quite racy even on uniprocessor. But | ||
225 | * it is expected to average out OK. | 222 | * it is expected to average out OK. |
226 | */ | 223 | */ |
227 | int temp_priority; | ||
228 | int prev_priority; | 224 | int prev_priority; |
229 | 225 | ||
230 | 226 | ||
@@ -674,6 +670,12 @@ void sparse_init(void); | |||
674 | #define sparse_index_init(_sec, _nid) do {} while (0) | 670 | #define sparse_index_init(_sec, _nid) do {} while (0) |
675 | #endif /* CONFIG_SPARSEMEM */ | 671 | #endif /* CONFIG_SPARSEMEM */ |
676 | 672 | ||
673 | #ifdef CONFIG_NODES_SPAN_OTHER_NODES | ||
674 | #define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid)) | ||
675 | #else | ||
676 | #define early_pfn_in_nid(pfn, nid) (1) | ||
677 | #endif | ||
678 | |||
677 | #ifndef early_pfn_valid | 679 | #ifndef early_pfn_valid |
678 | #define early_pfn_valid(pfn) (1) | 680 | #define early_pfn_valid(pfn) (1) |
679 | #endif | 681 | #endif |
diff --git a/include/linux/module.h b/include/linux/module.h index d1d00ce8f4ed..9258ffd8a7f0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -264,6 +264,7 @@ struct module | |||
264 | struct module_attribute *modinfo_attrs; | 264 | struct module_attribute *modinfo_attrs; |
265 | const char *version; | 265 | const char *version; |
266 | const char *srcversion; | 266 | const char *srcversion; |
267 | struct kobject *drivers_dir; | ||
267 | 268 | ||
268 | /* Exported symbols */ | 269 | /* Exported symbols */ |
269 | const struct kernel_symbol *syms; | 270 | const struct kernel_symbol *syms; |
diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h index 8db9d75541a6..8b5a79615fbf 100644 --- a/include/linux/mqueue.h +++ b/include/linux/mqueue.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #ifndef _LINUX_MQUEUE_H | 18 | #ifndef _LINUX_MQUEUE_H |
19 | #define _LINUX_MQUEUE_H | 19 | #define _LINUX_MQUEUE_H |
20 | 20 | ||
21 | #include <linux/types.h> | ||
22 | |||
23 | #define MQ_PRIO_MAX 32768 | 21 | #define MQ_PRIO_MAX 32768 |
24 | /* per-uid limit of kernel memory used by mqueue, in bytes */ | 22 | /* per-uid limit of kernel memory used by mqueue, in bytes */ |
25 | #define MQ_BYTES_MAX 819200 | 23 | #define MQ_BYTES_MAX 819200 |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index ce6c85815cbd..24a9ef1506b6 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -402,6 +402,8 @@ extern const struct file_operations fat_file_operations; | |||
402 | extern struct inode_operations fat_file_inode_operations; | 402 | extern struct inode_operations fat_file_inode_operations; |
403 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); | 403 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); |
404 | extern void fat_truncate(struct inode *inode); | 404 | extern void fat_truncate(struct inode *inode); |
405 | extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, | ||
406 | struct kstat *stat); | ||
405 | 407 | ||
406 | /* fat/inode.c */ | 408 | /* fat/inode.c */ |
407 | extern void fat_attach(struct inode *inode, loff_t i_pos); | 409 | extern void fat_attach(struct inode *inode, loff_t i_pos); |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 70420bbae82b..8b3ef4187219 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -355,7 +355,7 @@ struct nand_buffers { | |||
355 | * @priv: [OPTIONAL] pointer to private chip date | 355 | * @priv: [OPTIONAL] pointer to private chip date |
356 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 356 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks |
357 | * (determine if errors are correctable) | 357 | * (determine if errors are correctable) |
358 | * @write_page [REPLACEABLE] High-level page write function | 358 | * @write_page: [REPLACEABLE] High-level page write function |
359 | */ | 359 | */ |
360 | 360 | ||
361 | struct nand_chip { | 361 | struct nand_chip { |
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index edfa012fad3a..aff25c000abf 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -724,7 +724,7 @@ | |||
724 | #define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) | 724 | #define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) |
725 | #define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) | 725 | #define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) |
726 | #define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) | 726 | #define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) |
727 | #define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10) | 727 | #define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10)) |
728 | #define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) | 728 | #define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) |
729 | #define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) | 729 | #define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) |
730 | #define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) | 730 | #define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) |
@@ -1135,7 +1135,7 @@ struct mv64xxx_i2c_pdata { | |||
1135 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) | 1135 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) |
1136 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) | 1136 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) |
1137 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) | 1137 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) |
1138 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 ((1<<21) | 1138 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 (1<<21) |
1139 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) | 1139 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) |
1140 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) | 1140 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) |
1141 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) | 1141 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) |
diff --git a/include/linux/net.h b/include/linux/net.h index c257f716e00f..6f0dfeba509a 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define _LINUX_NET_H | 19 | #define _LINUX_NET_H |
20 | 20 | ||
21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
22 | #include <linux/random.h> | ||
22 | #include <asm/socket.h> | 23 | #include <asm/socket.h> |
23 | 24 | ||
24 | struct poll_table_struct; | 25 | struct poll_table_struct; |
@@ -193,9 +194,9 @@ extern int sock_map_fd(struct socket *sock); | |||
193 | extern struct socket *sockfd_lookup(int fd, int *err); | 194 | extern struct socket *sockfd_lookup(int fd, int *err); |
194 | #define sockfd_put(sock) fput(sock->file) | 195 | #define sockfd_put(sock) fput(sock->file) |
195 | extern int net_ratelimit(void); | 196 | extern int net_ratelimit(void); |
196 | extern unsigned long net_random(void); | 197 | |
197 | extern void net_srandom(unsigned long); | 198 | #define net_random() random32() |
198 | extern void net_random_init(void); | 199 | #define net_srandom(seed) srandom32((__force u32)seed) |
199 | 200 | ||
200 | extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, | 201 | extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, |
201 | struct kvec *vec, size_t num, size_t len); | 202 | struct kvec *vec, size_t num, size_t len); |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9264139bd8df..949eada46ce1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/percpu.h> | 38 | #include <linux/percpu.h> |
39 | #include <linux/dmaengine.h> | 39 | #include <linux/dmaengine.h> |
40 | 40 | ||
41 | struct divert_blk; | ||
42 | struct vlan_group; | 41 | struct vlan_group; |
43 | struct ethtool_ops; | 42 | struct ethtool_ops; |
44 | struct netpoll_info; | 43 | struct netpoll_info; |
@@ -67,6 +66,10 @@ struct netpoll_info; | |||
67 | #define NET_RX_CN_HIGH 4 /* The storm is here */ | 66 | #define NET_RX_CN_HIGH 4 /* The storm is here */ |
68 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ | 67 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ |
69 | 68 | ||
69 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | ||
70 | * indicates that the device will soon be dropping packets, or already drops | ||
71 | * some packets of the same priority; prompting us to send less aggressively. */ | ||
72 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | ||
70 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 73 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
71 | 74 | ||
72 | #endif | 75 | #endif |
@@ -93,8 +96,10 @@ struct netpoll_info; | |||
93 | #endif | 96 | #endif |
94 | #endif | 97 | #endif |
95 | 98 | ||
96 | #if !defined(CONFIG_NET_IPIP) && \ | 99 | #if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \ |
97 | !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) | 100 | !defined(CONFIG_NET_IPGRE) && !defined(CONFIG_NET_IPGRE_MODULE) && \ |
101 | !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \ | ||
102 | !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE) | ||
98 | #define MAX_HEADER LL_MAX_HEADER | 103 | #define MAX_HEADER LL_MAX_HEADER |
99 | #else | 104 | #else |
100 | #define MAX_HEADER (LL_MAX_HEADER + 48) | 105 | #define MAX_HEADER (LL_MAX_HEADER + 48) |
@@ -191,7 +196,7 @@ struct hh_cache | |||
191 | * NOTE: For VLANs, this will be the | 196 | * NOTE: For VLANs, this will be the |
192 | * encapuslated type. --BLG | 197 | * encapuslated type. --BLG |
193 | */ | 198 | */ |
194 | int hh_len; /* length of header */ | 199 | u16 hh_len; /* length of header */ |
195 | int (*hh_output)(struct sk_buff *skb); | 200 | int (*hh_output)(struct sk_buff *skb); |
196 | rwlock_t hh_lock; | 201 | rwlock_t hh_lock; |
197 | 202 | ||
@@ -515,11 +520,6 @@ struct net_device | |||
515 | /* bridge stuff */ | 520 | /* bridge stuff */ |
516 | struct net_bridge_port *br_port; | 521 | struct net_bridge_port *br_port; |
517 | 522 | ||
518 | #ifdef CONFIG_NET_DIVERT | ||
519 | /* this will get initialized at each interface type init routine */ | ||
520 | struct divert_blk *divert; | ||
521 | #endif /* CONFIG_NET_DIVERT */ | ||
522 | |||
523 | /* class/net/name entry */ | 523 | /* class/net/name entry */ |
524 | struct class_device class_dev; | 524 | struct class_device class_dev; |
525 | /* space for optional statistics and wireless sysfs groups */ | 525 | /* space for optional statistics and wireless sysfs groups */ |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index b7e67d1d4382..d4c4c5120bc0 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -117,6 +117,16 @@ void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n); | |||
117 | int nf_register_sockopt(struct nf_sockopt_ops *reg); | 117 | int nf_register_sockopt(struct nf_sockopt_ops *reg); |
118 | void nf_unregister_sockopt(struct nf_sockopt_ops *reg); | 118 | void nf_unregister_sockopt(struct nf_sockopt_ops *reg); |
119 | 119 | ||
120 | #ifdef CONFIG_SYSCTL | ||
121 | /* Sysctl registration */ | ||
122 | struct ctl_table_header *nf_register_sysctl_table(struct ctl_table *path, | ||
123 | struct ctl_table *table); | ||
124 | void nf_unregister_sysctl_table(struct ctl_table_header *header, | ||
125 | struct ctl_table *table); | ||
126 | extern struct ctl_table nf_net_netfilter_sysctl_path[]; | ||
127 | extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[]; | ||
128 | #endif /* CONFIG_SYSCTL */ | ||
129 | |||
120 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 130 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; |
121 | 131 | ||
122 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will | 132 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will |
@@ -282,15 +292,31 @@ extern void nf_invalidate_cache(int pf); | |||
282 | Returns true or false. */ | 292 | Returns true or false. */ |
283 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); | 293 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); |
284 | 294 | ||
285 | extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval, | 295 | static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to) |
286 | u_int32_t csum); | 296 | { |
287 | extern u_int16_t nf_proto_csum_update(struct sk_buff *skb, | 297 | __be32 diff[] = { ~from, to }; |
288 | u_int32_t oldval, u_int32_t newval, | 298 | |
289 | u_int16_t csum, int pseudohdr); | 299 | *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); |
300 | } | ||
301 | |||
302 | static inline void nf_csum_replace2(__sum16 *sum, __be16 from, __be16 to) | ||
303 | { | ||
304 | nf_csum_replace4(sum, (__force __be32)from, (__force __be32)to); | ||
305 | } | ||
306 | |||
307 | extern void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, | ||
308 | __be32 from, __be32 to, int pseudohdr); | ||
309 | |||
310 | static inline void nf_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, | ||
311 | __be16 from, __be16 to, int pseudohdr) | ||
312 | { | ||
313 | nf_proto_csum_replace4(sum, skb, (__force __be32)from, | ||
314 | (__force __be32)to, pseudohdr); | ||
315 | } | ||
290 | 316 | ||
291 | struct nf_afinfo { | 317 | struct nf_afinfo { |
292 | unsigned short family; | 318 | unsigned short family; |
293 | unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, | 319 | __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, |
294 | unsigned int dataoff, u_int8_t protocol); | 320 | unsigned int dataoff, u_int8_t protocol); |
295 | void (*saveroute)(const struct sk_buff *skb, | 321 | void (*saveroute)(const struct sk_buff *skb, |
296 | struct nf_info *info); | 322 | struct nf_info *info); |
@@ -305,12 +331,12 @@ static inline struct nf_afinfo *nf_get_afinfo(unsigned short family) | |||
305 | return rcu_dereference(nf_afinfo[family]); | 331 | return rcu_dereference(nf_afinfo[family]); |
306 | } | 332 | } |
307 | 333 | ||
308 | static inline unsigned int | 334 | static inline __sum16 |
309 | nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, | 335 | nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, |
310 | u_int8_t protocol, unsigned short family) | 336 | u_int8_t protocol, unsigned short family) |
311 | { | 337 | { |
312 | struct nf_afinfo *afinfo; | 338 | struct nf_afinfo *afinfo; |
313 | unsigned int csum = 0; | 339 | __sum16 csum = 0; |
314 | 340 | ||
315 | rcu_read_lock(); | 341 | rcu_read_lock(); |
316 | afinfo = nf_get_afinfo(family); | 342 | afinfo = nf_get_afinfo(family); |
@@ -331,7 +357,7 @@ extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | |||
331 | static inline void | 357 | static inline void |
332 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) | 358 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) |
333 | { | 359 | { |
334 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 360 | #if defined(CONFIG_IP_NF_NAT_NEEDED) || defined(CONFIG_NF_NAT_NEEDED) |
335 | void (*decodefn)(struct sk_buff *, struct flowi *); | 361 | void (*decodefn)(struct sk_buff *, struct flowi *); |
336 | 362 | ||
337 | if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL) | 363 | if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL) |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 312bd2ffee33..6328175a1c3a 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -14,6 +14,7 @@ header-y += xt_dscp.h | |||
14 | header-y += xt_DSCP.h | 14 | header-y += xt_DSCP.h |
15 | header-y += xt_esp.h | 15 | header-y += xt_esp.h |
16 | header-y += xt_helper.h | 16 | header-y += xt_helper.h |
17 | header-y += xt_hashlimit.h | ||
17 | header-y += xt_length.h | 18 | header-y += xt_length.h |
18 | header-y += xt_limit.h | 19 | header-y += xt_limit.h |
19 | header-y += xt_mac.h | 20 | header-y += xt_mac.h |
@@ -21,6 +22,7 @@ header-y += xt_mark.h | |||
21 | header-y += xt_MARK.h | 22 | header-y += xt_MARK.h |
22 | header-y += xt_multiport.h | 23 | header-y += xt_multiport.h |
23 | header-y += xt_NFQUEUE.h | 24 | header-y += xt_NFQUEUE.h |
25 | header-y += xt_NFLOG.h | ||
24 | header-y += xt_pkttype.h | 26 | header-y += xt_pkttype.h |
25 | header-y += xt_policy.h | 27 | header-y += xt_policy.h |
26 | header-y += xt_realm.h | 28 | header-y += xt_realm.h |
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h new file mode 100644 index 000000000000..26c223544ae8 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_amanda.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef _NF_CONNTRACK_AMANDA_H | ||
2 | #define _NF_CONNTRACK_AMANDA_H | ||
3 | /* AMANDA tracking. */ | ||
4 | |||
5 | extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff **pskb, | ||
6 | enum ip_conntrack_info ctinfo, | ||
7 | unsigned int matchoff, | ||
8 | unsigned int matchlen, | ||
9 | struct nf_conntrack_expect *exp); | ||
10 | #endif /* _NF_CONNTRACK_AMANDA_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h index ad4a41c9ce93..81453ea7e4c2 100644 --- a/include/linux/netfilter/nf_conntrack_ftp.h +++ b/include/linux/netfilter/nf_conntrack_ftp.h | |||
@@ -3,16 +3,16 @@ | |||
3 | /* FTP tracking. */ | 3 | /* FTP tracking. */ |
4 | 4 | ||
5 | /* This enum is exposed to userspace */ | 5 | /* This enum is exposed to userspace */ |
6 | enum ip_ct_ftp_type | 6 | enum nf_ct_ftp_type |
7 | { | 7 | { |
8 | /* PORT command from client */ | 8 | /* PORT command from client */ |
9 | IP_CT_FTP_PORT, | 9 | NF_CT_FTP_PORT, |
10 | /* PASV response from server */ | 10 | /* PASV response from server */ |
11 | IP_CT_FTP_PASV, | 11 | NF_CT_FTP_PASV, |
12 | /* EPRT command from client */ | 12 | /* EPRT command from client */ |
13 | IP_CT_FTP_EPRT, | 13 | NF_CT_FTP_EPRT, |
14 | /* EPSV response from server */ | 14 | /* EPSV response from server */ |
15 | IP_CT_FTP_EPSV, | 15 | NF_CT_FTP_EPSV, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
@@ -21,23 +21,23 @@ enum ip_ct_ftp_type | |||
21 | 21 | ||
22 | #define NUM_SEQ_TO_REMEMBER 2 | 22 | #define NUM_SEQ_TO_REMEMBER 2 |
23 | /* This structure exists only once per master */ | 23 | /* This structure exists only once per master */ |
24 | struct ip_ct_ftp_master { | 24 | struct nf_ct_ftp_master { |
25 | /* Valid seq positions for cmd matching after newline */ | 25 | /* Valid seq positions for cmd matching after newline */ |
26 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | 26 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; |
27 | /* 0 means seq_match_aft_nl not set */ | 27 | /* 0 means seq_match_aft_nl not set */ |
28 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | 28 | int seq_aft_nl_num[IP_CT_DIR_MAX]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct ip_conntrack_expect; | 31 | struct nf_conntrack_expect; |
32 | 32 | ||
33 | /* For NAT to hook in when we find a packet which describes what other | 33 | /* For NAT to hook in when we find a packet which describes what other |
34 | * connection we should expect. */ | 34 | * connection we should expect. */ |
35 | extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, | 35 | extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb, |
36 | enum ip_conntrack_info ctinfo, | 36 | enum ip_conntrack_info ctinfo, |
37 | enum ip_ct_ftp_type type, | 37 | enum nf_ct_ftp_type type, |
38 | unsigned int matchoff, | 38 | unsigned int matchoff, |
39 | unsigned int matchlen, | 39 | unsigned int matchlen, |
40 | struct ip_conntrack_expect *exp, | 40 | struct nf_conntrack_expect *exp, |
41 | u32 *seq); | 41 | u32 *seq); |
42 | #endif /* __KERNEL__ */ | 42 | #endif /* __KERNEL__ */ |
43 | 43 | ||
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h new file mode 100644 index 000000000000..08e2f4977c2e --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_h323.h | |||
@@ -0,0 +1,92 @@ | |||
1 | #ifndef _NF_CONNTRACK_H323_H | ||
2 | #define _NF_CONNTRACK_H323_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/netfilter/nf_conntrack_h323_asn1.h> | ||
7 | |||
8 | #define RAS_PORT 1719 | ||
9 | #define Q931_PORT 1720 | ||
10 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
11 | |||
12 | /* This structure exists only once per master */ | ||
13 | struct nf_ct_h323_master { | ||
14 | |||
15 | /* Original and NATed Q.931 or H.245 signal ports */ | ||
16 | __be16 sig_port[IP_CT_DIR_MAX]; | ||
17 | |||
18 | /* Original and NATed RTP ports */ | ||
19 | __be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
20 | |||
21 | union { | ||
22 | /* RAS connection timeout */ | ||
23 | u_int32_t timeout; | ||
24 | |||
25 | /* Next TPKT length (for separate TPKT header and data) */ | ||
26 | u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
27 | }; | ||
28 | }; | ||
29 | |||
30 | struct nf_conn; | ||
31 | |||
32 | extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, | ||
33 | TransportAddress *taddr, | ||
34 | union nf_conntrack_address *addr, __be16 *port); | ||
35 | extern void nf_conntrack_h245_expect(struct nf_conn *new, | ||
36 | struct nf_conntrack_expect *this); | ||
37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, | ||
38 | struct nf_conntrack_expect *this); | ||
39 | extern int (*set_h245_addr_hook) (struct sk_buff **pskb, | ||
40 | unsigned char **data, int dataoff, | ||
41 | H245_TransportAddress *taddr, | ||
42 | union nf_conntrack_address *addr, | ||
43 | __be16 port); | ||
44 | extern int (*set_h225_addr_hook) (struct sk_buff **pskb, | ||
45 | unsigned char **data, int dataoff, | ||
46 | TransportAddress *taddr, | ||
47 | union nf_conntrack_address *addr, | ||
48 | __be16 port); | ||
49 | extern int (*set_sig_addr_hook) (struct sk_buff **pskb, | ||
50 | struct nf_conn *ct, | ||
51 | enum ip_conntrack_info ctinfo, | ||
52 | unsigned char **data, | ||
53 | TransportAddress *taddr, int count); | ||
54 | extern int (*set_ras_addr_hook) (struct sk_buff **pskb, | ||
55 | struct nf_conn *ct, | ||
56 | enum ip_conntrack_info ctinfo, | ||
57 | unsigned char **data, | ||
58 | TransportAddress *taddr, int count); | ||
59 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb, | ||
60 | struct nf_conn *ct, | ||
61 | enum ip_conntrack_info ctinfo, | ||
62 | unsigned char **data, int dataoff, | ||
63 | H245_TransportAddress *taddr, | ||
64 | __be16 port, __be16 rtp_port, | ||
65 | struct nf_conntrack_expect *rtp_exp, | ||
66 | struct nf_conntrack_expect *rtcp_exp); | ||
67 | extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
68 | enum ip_conntrack_info ctinfo, | ||
69 | unsigned char **data, int dataoff, | ||
70 | H245_TransportAddress *taddr, __be16 port, | ||
71 | struct nf_conntrack_expect *exp); | ||
72 | extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
73 | enum ip_conntrack_info ctinfo, | ||
74 | unsigned char **data, int dataoff, | ||
75 | TransportAddress *taddr, __be16 port, | ||
76 | struct nf_conntrack_expect *exp); | ||
77 | extern int (*nat_callforwarding_hook) (struct sk_buff **pskb, | ||
78 | struct nf_conn *ct, | ||
79 | enum ip_conntrack_info ctinfo, | ||
80 | unsigned char **data, int dataoff, | ||
81 | TransportAddress *taddr, | ||
82 | __be16 port, | ||
83 | struct nf_conntrack_expect *exp); | ||
84 | extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
85 | enum ip_conntrack_info ctinfo, | ||
86 | unsigned char **data, TransportAddress *taddr, | ||
87 | int idx, __be16 port, | ||
88 | struct nf_conntrack_expect *exp); | ||
89 | |||
90 | #endif | ||
91 | |||
92 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h index c6e9a0b6d30b..8dab5968fc7e 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h +++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 | 2 | * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323 |
3 | * conntrack/NAT module. | 3 | * conntrack/NAT module. |
4 | * | 4 | * |
5 | * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> | 5 | * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> |
6 | * | 6 | * |
@@ -34,13 +34,13 @@ | |||
34 | * | 34 | * |
35 | ****************************************************************************/ | 35 | ****************************************************************************/ |
36 | 36 | ||
37 | #ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ | 37 | #ifndef _NF_CONNTRACK_HELPER_H323_ASN1_H_ |
38 | #define _IP_CONNTRACK_HELPER_H323_ASN1_H_ | 38 | #define _NF_CONNTRACK_HELPER_H323_ASN1_H_ |
39 | 39 | ||
40 | /***************************************************************************** | 40 | /***************************************************************************** |
41 | * H.323 Types | 41 | * H.323 Types |
42 | ****************************************************************************/ | 42 | ****************************************************************************/ |
43 | #include "ip_conntrack_helper_h323_types.h" | 43 | #include "nf_conntrack_h323_types.h" |
44 | 44 | ||
45 | typedef struct { | 45 | typedef struct { |
46 | enum { | 46 | enum { |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter/nf_conntrack_h323_types.h index 3d4a773799fc..38d74d5c9700 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h +++ b/include/linux/netfilter/nf_conntrack_h323_types.h | |||
@@ -10,6 +10,11 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */ | |||
10 | unsigned ip; | 10 | unsigned ip; |
11 | } TransportAddress_ipAddress; | 11 | } TransportAddress_ipAddress; |
12 | 12 | ||
13 | typedef struct TransportAddress_ip6Address { /* SEQUENCE */ | ||
14 | int options; /* No use */ | ||
15 | unsigned ip6; | ||
16 | } TransportAddress_ip6Address; | ||
17 | |||
13 | typedef struct TransportAddress { /* CHOICE */ | 18 | typedef struct TransportAddress { /* CHOICE */ |
14 | enum { | 19 | enum { |
15 | eTransportAddress_ipAddress, | 20 | eTransportAddress_ipAddress, |
@@ -22,6 +27,7 @@ typedef struct TransportAddress { /* CHOICE */ | |||
22 | } choice; | 27 | } choice; |
23 | union { | 28 | union { |
24 | TransportAddress_ipAddress ipAddress; | 29 | TransportAddress_ipAddress ipAddress; |
30 | TransportAddress_ip6Address ip6Address; | ||
25 | }; | 31 | }; |
26 | } TransportAddress; | 32 | } TransportAddress; |
27 | 33 | ||
@@ -93,6 +99,11 @@ typedef struct UnicastAddress_iPAddress { /* SEQUENCE */ | |||
93 | unsigned network; | 99 | unsigned network; |
94 | } UnicastAddress_iPAddress; | 100 | } UnicastAddress_iPAddress; |
95 | 101 | ||
102 | typedef struct UnicastAddress_iP6Address { /* SEQUENCE */ | ||
103 | int options; /* No use */ | ||
104 | unsigned network; | ||
105 | } UnicastAddress_iP6Address; | ||
106 | |||
96 | typedef struct UnicastAddress { /* CHOICE */ | 107 | typedef struct UnicastAddress { /* CHOICE */ |
97 | enum { | 108 | enum { |
98 | eUnicastAddress_iPAddress, | 109 | eUnicastAddress_iPAddress, |
@@ -105,6 +116,7 @@ typedef struct UnicastAddress { /* CHOICE */ | |||
105 | } choice; | 116 | } choice; |
106 | union { | 117 | union { |
107 | UnicastAddress_iPAddress iPAddress; | 118 | UnicastAddress_iPAddress iPAddress; |
119 | UnicastAddress_iP6Address iP6Address; | ||
108 | }; | 120 | }; |
109 | } UnicastAddress; | 121 | } UnicastAddress; |
110 | 122 | ||
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h new file mode 100644 index 000000000000..2ab6b8255911 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_irc.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _NF_CONNTRACK_IRC_H | ||
2 | #define _NF_CONNTRACK_IRC_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #define IRC_PORT 6667 | ||
7 | |||
8 | extern unsigned int (*nf_nat_irc_hook)(struct sk_buff **pskb, | ||
9 | enum ip_conntrack_info ctinfo, | ||
10 | unsigned int matchoff, | ||
11 | unsigned int matchlen, | ||
12 | struct nf_conntrack_expect *exp); | ||
13 | |||
14 | #endif /* __KERNEL__ */ | ||
15 | #endif /* _NF_CONNTRACK_IRC_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h new file mode 100644 index 000000000000..fb049ec11ff2 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_pptp.h | |||
@@ -0,0 +1,321 @@ | |||
1 | /* PPTP constants and structs */ | ||
2 | #ifndef _NF_CONNTRACK_PPTP_H | ||
3 | #define _NF_CONNTRACK_PPTP_H | ||
4 | |||
5 | /* state of the control session */ | ||
6 | enum pptp_ctrlsess_state { | ||
7 | PPTP_SESSION_NONE, /* no session present */ | ||
8 | PPTP_SESSION_ERROR, /* some session error */ | ||
9 | PPTP_SESSION_STOPREQ, /* stop_sess request seen */ | ||
10 | PPTP_SESSION_REQUESTED, /* start_sess request seen */ | ||
11 | PPTP_SESSION_CONFIRMED, /* session established */ | ||
12 | }; | ||
13 | |||
14 | /* state of the call inside the control session */ | ||
15 | enum pptp_ctrlcall_state { | ||
16 | PPTP_CALL_NONE, | ||
17 | PPTP_CALL_ERROR, | ||
18 | PPTP_CALL_OUT_REQ, | ||
19 | PPTP_CALL_OUT_CONF, | ||
20 | PPTP_CALL_IN_REQ, | ||
21 | PPTP_CALL_IN_REP, | ||
22 | PPTP_CALL_IN_CONF, | ||
23 | PPTP_CALL_CLEAR_REQ, | ||
24 | }; | ||
25 | |||
26 | /* conntrack private data */ | ||
27 | struct nf_ct_pptp_master { | ||
28 | enum pptp_ctrlsess_state sstate; /* session state */ | ||
29 | enum pptp_ctrlcall_state cstate; /* call state */ | ||
30 | __be16 pac_call_id; /* call id of PAC */ | ||
31 | __be16 pns_call_id; /* call id of PNS */ | ||
32 | |||
33 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack | ||
34 | * and therefore imposes a fixed limit on the number of maps */ | ||
35 | struct nf_ct_gre_keymap *keymap[IP_CT_DIR_MAX]; | ||
36 | }; | ||
37 | |||
38 | struct nf_nat_pptp { | ||
39 | __be16 pns_call_id; /* NAT'ed PNS call id */ | ||
40 | __be16 pac_call_id; /* NAT'ed PAC call id */ | ||
41 | }; | ||
42 | |||
43 | #ifdef __KERNEL__ | ||
44 | |||
45 | #define PPTP_CONTROL_PORT 1723 | ||
46 | |||
47 | #define PPTP_PACKET_CONTROL 1 | ||
48 | #define PPTP_PACKET_MGMT 2 | ||
49 | |||
50 | #define PPTP_MAGIC_COOKIE 0x1a2b3c4d | ||
51 | |||
52 | struct pptp_pkt_hdr { | ||
53 | __u16 packetLength; | ||
54 | __be16 packetType; | ||
55 | __be32 magicCookie; | ||
56 | }; | ||
57 | |||
58 | /* PptpControlMessageType values */ | ||
59 | #define PPTP_START_SESSION_REQUEST 1 | ||
60 | #define PPTP_START_SESSION_REPLY 2 | ||
61 | #define PPTP_STOP_SESSION_REQUEST 3 | ||
62 | #define PPTP_STOP_SESSION_REPLY 4 | ||
63 | #define PPTP_ECHO_REQUEST 5 | ||
64 | #define PPTP_ECHO_REPLY 6 | ||
65 | #define PPTP_OUT_CALL_REQUEST 7 | ||
66 | #define PPTP_OUT_CALL_REPLY 8 | ||
67 | #define PPTP_IN_CALL_REQUEST 9 | ||
68 | #define PPTP_IN_CALL_REPLY 10 | ||
69 | #define PPTP_IN_CALL_CONNECT 11 | ||
70 | #define PPTP_CALL_CLEAR_REQUEST 12 | ||
71 | #define PPTP_CALL_DISCONNECT_NOTIFY 13 | ||
72 | #define PPTP_WAN_ERROR_NOTIFY 14 | ||
73 | #define PPTP_SET_LINK_INFO 15 | ||
74 | |||
75 | #define PPTP_MSG_MAX 15 | ||
76 | |||
77 | /* PptpGeneralError values */ | ||
78 | #define PPTP_ERROR_CODE_NONE 0 | ||
79 | #define PPTP_NOT_CONNECTED 1 | ||
80 | #define PPTP_BAD_FORMAT 2 | ||
81 | #define PPTP_BAD_VALUE 3 | ||
82 | #define PPTP_NO_RESOURCE 4 | ||
83 | #define PPTP_BAD_CALLID 5 | ||
84 | #define PPTP_REMOVE_DEVICE_ERROR 6 | ||
85 | |||
86 | struct PptpControlHeader { | ||
87 | __be16 messageType; | ||
88 | __u16 reserved; | ||
89 | }; | ||
90 | |||
91 | /* FramingCapability Bitmap Values */ | ||
92 | #define PPTP_FRAME_CAP_ASYNC 0x1 | ||
93 | #define PPTP_FRAME_CAP_SYNC 0x2 | ||
94 | |||
95 | /* BearerCapability Bitmap Values */ | ||
96 | #define PPTP_BEARER_CAP_ANALOG 0x1 | ||
97 | #define PPTP_BEARER_CAP_DIGITAL 0x2 | ||
98 | |||
99 | struct PptpStartSessionRequest { | ||
100 | __be16 protocolVersion; | ||
101 | __u16 reserved1; | ||
102 | __be32 framingCapability; | ||
103 | __be32 bearerCapability; | ||
104 | __be16 maxChannels; | ||
105 | __be16 firmwareRevision; | ||
106 | __u8 hostName[64]; | ||
107 | __u8 vendorString[64]; | ||
108 | }; | ||
109 | |||
110 | /* PptpStartSessionResultCode Values */ | ||
111 | #define PPTP_START_OK 1 | ||
112 | #define PPTP_START_GENERAL_ERROR 2 | ||
113 | #define PPTP_START_ALREADY_CONNECTED 3 | ||
114 | #define PPTP_START_NOT_AUTHORIZED 4 | ||
115 | #define PPTP_START_UNKNOWN_PROTOCOL 5 | ||
116 | |||
117 | struct PptpStartSessionReply { | ||
118 | __be16 protocolVersion; | ||
119 | __u8 resultCode; | ||
120 | __u8 generalErrorCode; | ||
121 | __be32 framingCapability; | ||
122 | __be32 bearerCapability; | ||
123 | __be16 maxChannels; | ||
124 | __be16 firmwareRevision; | ||
125 | __u8 hostName[64]; | ||
126 | __u8 vendorString[64]; | ||
127 | }; | ||
128 | |||
129 | /* PptpStopReasons */ | ||
130 | #define PPTP_STOP_NONE 1 | ||
131 | #define PPTP_STOP_PROTOCOL 2 | ||
132 | #define PPTP_STOP_LOCAL_SHUTDOWN 3 | ||
133 | |||
134 | struct PptpStopSessionRequest { | ||
135 | __u8 reason; | ||
136 | __u8 reserved1; | ||
137 | __u16 reserved2; | ||
138 | }; | ||
139 | |||
140 | /* PptpStopSessionResultCode */ | ||
141 | #define PPTP_STOP_OK 1 | ||
142 | #define PPTP_STOP_GENERAL_ERROR 2 | ||
143 | |||
144 | struct PptpStopSessionReply { | ||
145 | __u8 resultCode; | ||
146 | __u8 generalErrorCode; | ||
147 | __u16 reserved1; | ||
148 | }; | ||
149 | |||
150 | struct PptpEchoRequest { | ||
151 | __be32 identNumber; | ||
152 | }; | ||
153 | |||
154 | /* PptpEchoReplyResultCode */ | ||
155 | #define PPTP_ECHO_OK 1 | ||
156 | #define PPTP_ECHO_GENERAL_ERROR 2 | ||
157 | |||
158 | struct PptpEchoReply { | ||
159 | __be32 identNumber; | ||
160 | __u8 resultCode; | ||
161 | __u8 generalErrorCode; | ||
162 | __u16 reserved; | ||
163 | }; | ||
164 | |||
165 | /* PptpFramingType */ | ||
166 | #define PPTP_ASYNC_FRAMING 1 | ||
167 | #define PPTP_SYNC_FRAMING 2 | ||
168 | #define PPTP_DONT_CARE_FRAMING 3 | ||
169 | |||
170 | /* PptpCallBearerType */ | ||
171 | #define PPTP_ANALOG_TYPE 1 | ||
172 | #define PPTP_DIGITAL_TYPE 2 | ||
173 | #define PPTP_DONT_CARE_BEARER_TYPE 3 | ||
174 | |||
175 | struct PptpOutCallRequest { | ||
176 | __be16 callID; | ||
177 | __be16 callSerialNumber; | ||
178 | __be32 minBPS; | ||
179 | __be32 maxBPS; | ||
180 | __be32 bearerType; | ||
181 | __be32 framingType; | ||
182 | __be16 packetWindow; | ||
183 | __be16 packetProcDelay; | ||
184 | __be16 phoneNumberLength; | ||
185 | __u16 reserved1; | ||
186 | __u8 phoneNumber[64]; | ||
187 | __u8 subAddress[64]; | ||
188 | }; | ||
189 | |||
190 | /* PptpCallResultCode */ | ||
191 | #define PPTP_OUTCALL_CONNECT 1 | ||
192 | #define PPTP_OUTCALL_GENERAL_ERROR 2 | ||
193 | #define PPTP_OUTCALL_NO_CARRIER 3 | ||
194 | #define PPTP_OUTCALL_BUSY 4 | ||
195 | #define PPTP_OUTCALL_NO_DIAL_TONE 5 | ||
196 | #define PPTP_OUTCALL_TIMEOUT 6 | ||
197 | #define PPTP_OUTCALL_DONT_ACCEPT 7 | ||
198 | |||
199 | struct PptpOutCallReply { | ||
200 | __be16 callID; | ||
201 | __be16 peersCallID; | ||
202 | __u8 resultCode; | ||
203 | __u8 generalErrorCode; | ||
204 | __be16 causeCode; | ||
205 | __be32 connectSpeed; | ||
206 | __be16 packetWindow; | ||
207 | __be16 packetProcDelay; | ||
208 | __be32 physChannelID; | ||
209 | }; | ||
210 | |||
211 | struct PptpInCallRequest { | ||
212 | __be16 callID; | ||
213 | __be16 callSerialNumber; | ||
214 | __be32 callBearerType; | ||
215 | __be32 physChannelID; | ||
216 | __be16 dialedNumberLength; | ||
217 | __be16 dialingNumberLength; | ||
218 | __u8 dialedNumber[64]; | ||
219 | __u8 dialingNumber[64]; | ||
220 | __u8 subAddress[64]; | ||
221 | }; | ||
222 | |||
223 | /* PptpInCallResultCode */ | ||
224 | #define PPTP_INCALL_ACCEPT 1 | ||
225 | #define PPTP_INCALL_GENERAL_ERROR 2 | ||
226 | #define PPTP_INCALL_DONT_ACCEPT 3 | ||
227 | |||
228 | struct PptpInCallReply { | ||
229 | __be16 callID; | ||
230 | __be16 peersCallID; | ||
231 | __u8 resultCode; | ||
232 | __u8 generalErrorCode; | ||
233 | __be16 packetWindow; | ||
234 | __be16 packetProcDelay; | ||
235 | __u16 reserved; | ||
236 | }; | ||
237 | |||
238 | struct PptpInCallConnected { | ||
239 | __be16 peersCallID; | ||
240 | __u16 reserved; | ||
241 | __be32 connectSpeed; | ||
242 | __be16 packetWindow; | ||
243 | __be16 packetProcDelay; | ||
244 | __be32 callFramingType; | ||
245 | }; | ||
246 | |||
247 | struct PptpClearCallRequest { | ||
248 | __be16 callID; | ||
249 | __u16 reserved; | ||
250 | }; | ||
251 | |||
252 | struct PptpCallDisconnectNotify { | ||
253 | __be16 callID; | ||
254 | __u8 resultCode; | ||
255 | __u8 generalErrorCode; | ||
256 | __be16 causeCode; | ||
257 | __u16 reserved; | ||
258 | __u8 callStatistics[128]; | ||
259 | }; | ||
260 | |||
261 | struct PptpWanErrorNotify { | ||
262 | __be16 peersCallID; | ||
263 | __u16 reserved; | ||
264 | __be32 crcErrors; | ||
265 | __be32 framingErrors; | ||
266 | __be32 hardwareOverRuns; | ||
267 | __be32 bufferOverRuns; | ||
268 | __be32 timeoutErrors; | ||
269 | __be32 alignmentErrors; | ||
270 | }; | ||
271 | |||
272 | struct PptpSetLinkInfo { | ||
273 | __be16 peersCallID; | ||
274 | __u16 reserved; | ||
275 | __be32 sendAccm; | ||
276 | __be32 recvAccm; | ||
277 | }; | ||
278 | |||
279 | union pptp_ctrl_union { | ||
280 | struct PptpStartSessionRequest sreq; | ||
281 | struct PptpStartSessionReply srep; | ||
282 | struct PptpStopSessionRequest streq; | ||
283 | struct PptpStopSessionReply strep; | ||
284 | struct PptpOutCallRequest ocreq; | ||
285 | struct PptpOutCallReply ocack; | ||
286 | struct PptpInCallRequest icreq; | ||
287 | struct PptpInCallReply icack; | ||
288 | struct PptpInCallConnected iccon; | ||
289 | struct PptpClearCallRequest clrreq; | ||
290 | struct PptpCallDisconnectNotify disc; | ||
291 | struct PptpWanErrorNotify wanerr; | ||
292 | struct PptpSetLinkInfo setlink; | ||
293 | }; | ||
294 | |||
295 | /* crap needed for nf_conntrack_compat.h */ | ||
296 | struct nf_conn; | ||
297 | struct nf_conntrack_expect; | ||
298 | enum ip_conntrack_info; | ||
299 | |||
300 | extern int | ||
301 | (*nf_nat_pptp_hook_outbound)(struct sk_buff **pskb, | ||
302 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, | ||
303 | struct PptpControlHeader *ctlh, | ||
304 | union pptp_ctrl_union *pptpReq); | ||
305 | |||
306 | extern int | ||
307 | (*nf_nat_pptp_hook_inbound)(struct sk_buff **pskb, | ||
308 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, | ||
309 | struct PptpControlHeader *ctlh, | ||
310 | union pptp_ctrl_union *pptpReq); | ||
311 | |||
312 | extern void | ||
313 | (*nf_nat_pptp_hook_exp_gre)(struct nf_conntrack_expect *exp_orig, | ||
314 | struct nf_conntrack_expect *exp_reply); | ||
315 | |||
316 | extern void | ||
317 | (*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct, | ||
318 | struct nf_conntrack_expect *exp); | ||
319 | |||
320 | #endif /* __KERNEL__ */ | ||
321 | #endif /* _NF_CONNTRACK_PPTP_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h new file mode 100644 index 000000000000..4e6bbce04ff8 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #ifndef _CONNTRACK_PROTO_GRE_H | ||
2 | #define _CONNTRACK_PROTO_GRE_H | ||
3 | #include <asm/byteorder.h> | ||
4 | |||
5 | /* GRE PROTOCOL HEADER */ | ||
6 | |||
7 | /* GRE Version field */ | ||
8 | #define GRE_VERSION_1701 0x0 | ||
9 | #define GRE_VERSION_PPTP 0x1 | ||
10 | |||
11 | /* GRE Protocol field */ | ||
12 | #define GRE_PROTOCOL_PPTP 0x880B | ||
13 | |||
14 | /* GRE Flags */ | ||
15 | #define GRE_FLAG_C 0x80 | ||
16 | #define GRE_FLAG_R 0x40 | ||
17 | #define GRE_FLAG_K 0x20 | ||
18 | #define GRE_FLAG_S 0x10 | ||
19 | #define GRE_FLAG_A 0x80 | ||
20 | |||
21 | #define GRE_IS_C(f) ((f)&GRE_FLAG_C) | ||
22 | #define GRE_IS_R(f) ((f)&GRE_FLAG_R) | ||
23 | #define GRE_IS_K(f) ((f)&GRE_FLAG_K) | ||
24 | #define GRE_IS_S(f) ((f)&GRE_FLAG_S) | ||
25 | #define GRE_IS_A(f) ((f)&GRE_FLAG_A) | ||
26 | |||
27 | /* GRE is a mess: Four different standards */ | ||
28 | struct gre_hdr { | ||
29 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
30 | __u16 rec:3, | ||
31 | srr:1, | ||
32 | seq:1, | ||
33 | key:1, | ||
34 | routing:1, | ||
35 | csum:1, | ||
36 | version:3, | ||
37 | reserved:4, | ||
38 | ack:1; | ||
39 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
40 | __u16 csum:1, | ||
41 | routing:1, | ||
42 | key:1, | ||
43 | seq:1, | ||
44 | srr:1, | ||
45 | rec:3, | ||
46 | ack:1, | ||
47 | reserved:4, | ||
48 | version:3; | ||
49 | #else | ||
50 | #error "Adjust your <asm/byteorder.h> defines" | ||
51 | #endif | ||
52 | __be16 protocol; | ||
53 | }; | ||
54 | |||
55 | /* modified GRE header for PPTP */ | ||
56 | struct gre_hdr_pptp { | ||
57 | __u8 flags; /* bitfield */ | ||
58 | __u8 version; /* should be GRE_VERSION_PPTP */ | ||
59 | __be16 protocol; /* should be GRE_PROTOCOL_PPTP */ | ||
60 | __be16 payload_len; /* size of ppp payload, not inc. gre header */ | ||
61 | __be16 call_id; /* peer's call_id for this session */ | ||
62 | __be32 seq; /* sequence number. Present if S==1 */ | ||
63 | __be32 ack; /* seq number of highest packet recieved by */ | ||
64 | /* sender in this session */ | ||
65 | }; | ||
66 | |||
67 | struct nf_ct_gre { | ||
68 | unsigned int stream_timeout; | ||
69 | unsigned int timeout; | ||
70 | }; | ||
71 | |||
72 | #ifdef __KERNEL__ | ||
73 | #include <net/netfilter/nf_conntrack_tuple.h> | ||
74 | |||
75 | struct nf_conn; | ||
76 | |||
77 | /* structure for original <-> reply keymap */ | ||
78 | struct nf_ct_gre_keymap { | ||
79 | struct list_head list; | ||
80 | struct nf_conntrack_tuple tuple; | ||
81 | }; | ||
82 | |||
83 | /* add new tuple->key_reply pair to keymap */ | ||
84 | int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | ||
85 | struct nf_conntrack_tuple *t); | ||
86 | |||
87 | /* delete keymap entries */ | ||
88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); | ||
89 | |||
90 | /* get pointer to gre key, if present */ | ||
91 | static inline __be32 *gre_key(struct gre_hdr *greh) | ||
92 | { | ||
93 | if (!greh->key) | ||
94 | return NULL; | ||
95 | if (greh->csum || greh->routing) | ||
96 | return (__be32 *)(greh+sizeof(*greh)+4); | ||
97 | return (__be32 *)(greh+sizeof(*greh)); | ||
98 | } | ||
99 | |||
100 | /* get pointer ot gre csum, if present */ | ||
101 | static inline __sum16 *gre_csum(struct gre_hdr *greh) | ||
102 | { | ||
103 | if (!greh->csum) | ||
104 | return NULL; | ||
105 | return (__sum16 *)(greh+sizeof(*greh)); | ||
106 | } | ||
107 | |||
108 | extern void nf_ct_gre_keymap_flush(void); | ||
109 | extern void nf_nat_need_gre(void); | ||
110 | |||
111 | #endif /* __KERNEL__ */ | ||
112 | #endif /* _CONNTRACK_PROTO_GRE_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h index b8994d9fd1a9..5cf2c115cce4 100644 --- a/include/linux/netfilter/nf_conntrack_sctp.h +++ b/include/linux/netfilter/nf_conntrack_sctp.h | |||
@@ -20,7 +20,7 @@ struct ip_ct_sctp | |||
20 | { | 20 | { |
21 | enum sctp_conntrack state; | 21 | enum sctp_conntrack state; |
22 | 22 | ||
23 | u_int32_t vtag[IP_CT_DIR_MAX]; | 23 | __be32 vtag[IP_CT_DIR_MAX]; |
24 | u_int32_t ttag[IP_CT_DIR_MAX]; | 24 | u_int32_t ttag[IP_CT_DIR_MAX]; |
25 | }; | 25 | }; |
26 | 26 | ||
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h new file mode 100644 index 000000000000..bb7f2041db74 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -0,0 +1,41 @@ | |||
1 | #ifndef __NF_CONNTRACK_SIP_H__ | ||
2 | #define __NF_CONNTRACK_SIP_H__ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #define SIP_PORT 5060 | ||
6 | #define SIP_TIMEOUT 3600 | ||
7 | |||
8 | enum sip_header_pos { | ||
9 | POS_REG_REQ_URI, | ||
10 | POS_REQ_URI, | ||
11 | POS_FROM, | ||
12 | POS_TO, | ||
13 | POS_VIA, | ||
14 | POS_CONTACT, | ||
15 | POS_CONTENT, | ||
16 | POS_MEDIA, | ||
17 | POS_OWNER_IP4, | ||
18 | POS_CONNECTION_IP4, | ||
19 | POS_OWNER_IP6, | ||
20 | POS_CONNECTION_IP6, | ||
21 | POS_SDP_HEADER, | ||
22 | }; | ||
23 | |||
24 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff **pskb, | ||
25 | enum ip_conntrack_info ctinfo, | ||
26 | struct nf_conn *ct, | ||
27 | const char **dptr); | ||
28 | extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff **pskb, | ||
29 | enum ip_conntrack_info ctinfo, | ||
30 | struct nf_conntrack_expect *exp, | ||
31 | const char *dptr); | ||
32 | |||
33 | extern int ct_sip_get_info(struct nf_conn *ct, const char *dptr, size_t dlen, | ||
34 | unsigned int *matchoff, unsigned int *matchlen, | ||
35 | enum sip_header_pos pos); | ||
36 | extern int ct_sip_lnlen(const char *line, const char *limit); | ||
37 | extern const char *ct_sip_search(const char *needle, const char *haystack, | ||
38 | size_t needle_len, size_t haystack_len, | ||
39 | int case_sensitive); | ||
40 | #endif /* __KERNEL__ */ | ||
41 | #endif /* __NF_CONNTRACK_SIP_H__ */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_tftp.h b/include/linux/netfilter/nf_conntrack_tftp.h new file mode 100644 index 000000000000..0d79b7ae051f --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_tftp.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _NF_CONNTRACK_TFTP_H | ||
2 | #define _NF_CONNTRACK_TFTP_H | ||
3 | |||
4 | #define TFTP_PORT 69 | ||
5 | |||
6 | struct tftphdr { | ||
7 | __be16 opcode; | ||
8 | }; | ||
9 | |||
10 | #define TFTP_OPCODE_READ 1 | ||
11 | #define TFTP_OPCODE_WRITE 2 | ||
12 | #define TFTP_OPCODE_DATA 3 | ||
13 | #define TFTP_OPCODE_ACK 4 | ||
14 | #define TFTP_OPCODE_ERROR 5 | ||
15 | |||
16 | extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff **pskb, | ||
17 | enum ip_conntrack_info ctinfo, | ||
18 | struct nf_conntrack_expect *exp); | ||
19 | |||
20 | #endif /* _NF_CONNTRACK_TFTP_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 6d8e3e5a80e9..1e9c821f152d 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -78,7 +78,7 @@ struct nfattr | |||
78 | struct nfgenmsg { | 78 | struct nfgenmsg { |
79 | u_int8_t nfgen_family; /* AF_xxx */ | 79 | u_int8_t nfgen_family; /* AF_xxx */ |
80 | u_int8_t version; /* nfnetlink version */ | 80 | u_int8_t version; /* nfnetlink version */ |
81 | u_int16_t res_id; /* resource id */ | 81 | __be16 res_id; /* resource id */ |
82 | }; | 82 | }; |
83 | 83 | ||
84 | #define NFNETLINK_V0 0 | 84 | #define NFNETLINK_V0 0 |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index 87b92f8b988f..5966afa026e9 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -16,24 +16,22 @@ enum nfulnl_msg_types { | |||
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct nfulnl_msg_packet_hdr { | 18 | struct nfulnl_msg_packet_hdr { |
19 | u_int16_t hw_protocol; /* hw protocol (network order) */ | 19 | __be16 hw_protocol; /* hw protocol (network order) */ |
20 | u_int8_t hook; /* netfilter hook */ | 20 | u_int8_t hook; /* netfilter hook */ |
21 | u_int8_t _pad; | 21 | u_int8_t _pad; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct nfulnl_msg_packet_hw { | 24 | struct nfulnl_msg_packet_hw { |
25 | u_int16_t hw_addrlen; | 25 | __be16 hw_addrlen; |
26 | u_int16_t _pad; | 26 | u_int16_t _pad; |
27 | u_int8_t hw_addr[8]; | 27 | u_int8_t hw_addr[8]; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | struct nfulnl_msg_packet_timestamp { | 30 | struct nfulnl_msg_packet_timestamp { |
31 | aligned_u64 sec; | 31 | aligned_be64 sec; |
32 | aligned_u64 usec; | 32 | aligned_be64 usec; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ | ||
36 | |||
37 | enum nfulnl_attr_type { | 35 | enum nfulnl_attr_type { |
38 | NFULA_UNSPEC, | 36 | NFULA_UNSPEC, |
39 | NFULA_PACKET_HDR, | 37 | NFULA_PACKET_HDR, |
@@ -67,7 +65,7 @@ struct nfulnl_msg_config_cmd { | |||
67 | } __attribute__ ((packed)); | 65 | } __attribute__ ((packed)); |
68 | 66 | ||
69 | struct nfulnl_msg_config_mode { | 67 | struct nfulnl_msg_config_mode { |
70 | u_int32_t copy_range; | 68 | __be32 copy_range; |
71 | u_int8_t copy_mode; | 69 | u_int8_t copy_mode; |
72 | u_int8_t _pad; | 70 | u_int8_t _pad; |
73 | } __attribute__ ((packed)); | 71 | } __attribute__ ((packed)); |
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 36af0360b56d..83e789633e35 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -13,20 +13,20 @@ enum nfqnl_msg_types { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | struct nfqnl_msg_packet_hdr { | 15 | struct nfqnl_msg_packet_hdr { |
16 | u_int32_t packet_id; /* unique ID of packet in queue */ | 16 | __be32 packet_id; /* unique ID of packet in queue */ |
17 | u_int16_t hw_protocol; /* hw protocol (network order) */ | 17 | __be16 hw_protocol; /* hw protocol (network order) */ |
18 | u_int8_t hook; /* netfilter hook */ | 18 | u_int8_t hook; /* netfilter hook */ |
19 | } __attribute__ ((packed)); | 19 | } __attribute__ ((packed)); |
20 | 20 | ||
21 | struct nfqnl_msg_packet_hw { | 21 | struct nfqnl_msg_packet_hw { |
22 | u_int16_t hw_addrlen; | 22 | __be16 hw_addrlen; |
23 | u_int16_t _pad; | 23 | u_int16_t _pad; |
24 | u_int8_t hw_addr[8]; | 24 | u_int8_t hw_addr[8]; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct nfqnl_msg_packet_timestamp { | 27 | struct nfqnl_msg_packet_timestamp { |
28 | aligned_u64 sec; | 28 | aligned_be64 sec; |
29 | aligned_u64 usec; | 29 | aligned_be64 usec; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | enum nfqnl_attr_type { | 32 | enum nfqnl_attr_type { |
@@ -47,8 +47,8 @@ enum nfqnl_attr_type { | |||
47 | #define NFQA_MAX (__NFQA_MAX - 1) | 47 | #define NFQA_MAX (__NFQA_MAX - 1) |
48 | 48 | ||
49 | struct nfqnl_msg_verdict_hdr { | 49 | struct nfqnl_msg_verdict_hdr { |
50 | u_int32_t verdict; | 50 | __be32 verdict; |
51 | u_int32_t id; | 51 | __be32 id; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | 54 | ||
@@ -63,7 +63,7 @@ enum nfqnl_msg_config_cmds { | |||
63 | struct nfqnl_msg_config_cmd { | 63 | struct nfqnl_msg_config_cmd { |
64 | u_int8_t command; /* nfqnl_msg_config_cmds */ | 64 | u_int8_t command; /* nfqnl_msg_config_cmds */ |
65 | u_int8_t _pad; | 65 | u_int8_t _pad; |
66 | u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ | 66 | __be16 pf; /* AF_xxx for PF_[UN]BIND */ |
67 | }; | 67 | }; |
68 | 68 | ||
69 | enum nfqnl_config_mode { | 69 | enum nfqnl_config_mode { |
@@ -73,7 +73,7 @@ enum nfqnl_config_mode { | |||
73 | }; | 73 | }; |
74 | 74 | ||
75 | struct nfqnl_msg_config_params { | 75 | struct nfqnl_msg_config_params { |
76 | u_int32_t copy_range; | 76 | __be32 copy_range; |
77 | u_int8_t copy_mode; /* enum nfqnl_config_mode */ | 77 | u_int8_t copy_mode; /* enum nfqnl_config_mode */ |
78 | } __attribute__ ((packed)); | 78 | } __attribute__ ((packed)); |
79 | 79 | ||
@@ -82,6 +82,7 @@ enum nfqnl_attr_config { | |||
82 | NFQA_CFG_UNSPEC, | 82 | NFQA_CFG_UNSPEC, |
83 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | 83 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ |
84 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | 84 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ |
85 | NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */ | ||
85 | __NFQA_CFG_MAX | 86 | __NFQA_CFG_MAX |
86 | }; | 87 | }; |
87 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | 88 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 04319a76103a..022edfa97ed9 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -96,22 +96,6 @@ struct _xt_align | |||
96 | /* Error verdict. */ | 96 | /* Error verdict. */ |
97 | #define XT_ERROR_TARGET "ERROR" | 97 | #define XT_ERROR_TARGET "ERROR" |
98 | 98 | ||
99 | /* | ||
100 | * New IP firewall options for [gs]etsockopt at the RAW IP level. | ||
101 | * Unlike BSD Linux inherits IP options so you don't have to use a raw | ||
102 | * socket for this. Instead we check rights in the calls. */ | ||
103 | #define XT_BASE_CTL 64 /* base for firewall socket options */ | ||
104 | |||
105 | #define XT_SO_SET_REPLACE (XT_BASE_CTL) | ||
106 | #define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1) | ||
107 | #define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS | ||
108 | |||
109 | #define XT_SO_GET_INFO (XT_BASE_CTL) | ||
110 | #define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1) | ||
111 | #define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2) | ||
112 | #define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3) | ||
113 | #define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET | ||
114 | |||
115 | #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) | 99 | #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) |
116 | #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) | 100 | #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) |
117 | 101 | ||
diff --git a/include/linux/netfilter/xt_NFLOG.h b/include/linux/netfilter/xt_NFLOG.h new file mode 100644 index 000000000000..cdcd0ed58f7a --- /dev/null +++ b/include/linux/netfilter/xt_NFLOG.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _XT_NFLOG_TARGET | ||
2 | #define _XT_NFLOG_TARGET | ||
3 | |||
4 | #define XT_NFLOG_DEFAULT_GROUP 0x1 | ||
5 | #define XT_NFLOG_DEFAULT_THRESHOLD 1 | ||
6 | |||
7 | #define XT_NFLOG_MASK 0x0 | ||
8 | |||
9 | struct xt_nflog_info { | ||
10 | u_int32_t len; | ||
11 | u_int16_t group; | ||
12 | u_int16_t threshold; | ||
13 | u_int16_t flags; | ||
14 | u_int16_t pad; | ||
15 | char prefix[64]; | ||
16 | }; | ||
17 | |||
18 | #endif /* _XT_NFLOG_TARGET */ | ||
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 4c2d9945ca54..70b6f718cf4c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -29,14 +29,14 @@ | |||
29 | struct ip_conntrack_old_tuple | 29 | struct ip_conntrack_old_tuple |
30 | { | 30 | { |
31 | struct { | 31 | struct { |
32 | __u32 ip; | 32 | __be32 ip; |
33 | union { | 33 | union { |
34 | __u16 all; | 34 | __u16 all; |
35 | } u; | 35 | } u; |
36 | } src; | 36 | } src; |
37 | 37 | ||
38 | struct { | 38 | struct { |
39 | __u32 ip; | 39 | __be32 ip; |
40 | union { | 40 | union { |
41 | __u16 all; | 41 | __u16 all; |
42 | } u; | 42 | } u; |
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h new file mode 100644 index 000000000000..b4556b8edbfd --- /dev/null +++ b/include/linux/netfilter/xt_hashlimit.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _XT_HASHLIMIT_H | ||
2 | #define _XT_HASHLIMIT_H | ||
3 | |||
4 | /* timings are in milliseconds. */ | ||
5 | #define XT_HASHLIMIT_SCALE 10000 | ||
6 | /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 | ||
7 | seconds, or one every 59 hours. */ | ||
8 | |||
9 | /* details of this structure hidden by the implementation */ | ||
10 | struct xt_hashlimit_htable; | ||
11 | |||
12 | #define XT_HASHLIMIT_HASH_DIP 0x0001 | ||
13 | #define XT_HASHLIMIT_HASH_DPT 0x0002 | ||
14 | #define XT_HASHLIMIT_HASH_SIP 0x0004 | ||
15 | #define XT_HASHLIMIT_HASH_SPT 0x0008 | ||
16 | |||
17 | struct hashlimit_cfg { | ||
18 | u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */ | ||
19 | u_int32_t avg; /* Average secs between packets * scale */ | ||
20 | u_int32_t burst; /* Period multiplier for upper limit. */ | ||
21 | |||
22 | /* user specified */ | ||
23 | u_int32_t size; /* how many buckets */ | ||
24 | u_int32_t max; /* max number of entries */ | ||
25 | u_int32_t gc_interval; /* gc interval */ | ||
26 | u_int32_t expire; /* when do entries expire? */ | ||
27 | }; | ||
28 | |||
29 | struct xt_hashlimit_info { | ||
30 | char name [IFNAMSIZ]; /* name */ | ||
31 | struct hashlimit_cfg cfg; | ||
32 | struct xt_hashlimit_htable *hinfo; | ||
33 | |||
34 | /* Used internally by the kernel */ | ||
35 | union { | ||
36 | void *ptr; | ||
37 | struct xt_hashlimit_info *master; | ||
38 | } u; | ||
39 | }; | ||
40 | #endif /*_XT_HASHLIMIT_H*/ | ||
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h index a8132ec076fb..45654d359a68 100644 --- a/include/linux/netfilter/xt_policy.h +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -39,7 +39,7 @@ struct xt_policy_elem | |||
39 | union xt_policy_addr smask; | 39 | union xt_policy_addr smask; |
40 | union xt_policy_addr daddr; | 40 | union xt_policy_addr daddr; |
41 | union xt_policy_addr dmask; | 41 | union xt_policy_addr dmask; |
42 | u_int32_t spi; | 42 | __be32 spi; |
43 | u_int32_t reqid; | 43 | u_int32_t reqid; |
44 | u_int8_t proto; | 44 | u_int8_t proto; |
45 | u_int8_t mode; | 45 | u_int8_t mode; |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 44e39b61d9e7..0be235418a2f 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -112,19 +112,20 @@ struct arpt_entry | |||
112 | * New IP firewall options for [gs]etsockopt at the RAW IP level. | 112 | * New IP firewall options for [gs]etsockopt at the RAW IP level. |
113 | * Unlike BSD Linux inherits IP options so you don't have to use a raw | 113 | * Unlike BSD Linux inherits IP options so you don't have to use a raw |
114 | * socket for this. Instead we check rights in the calls. | 114 | * socket for this. Instead we check rights in the calls. |
115 | * | ||
116 | * ATTENTION: check linux/in.h before adding new number here. | ||
115 | */ | 117 | */ |
116 | #define ARPT_CTL_OFFSET 32 | 118 | #define ARPT_BASE_CTL 96 |
117 | #define ARPT_BASE_CTL (XT_BASE_CTL+ARPT_CTL_OFFSET) | 119 | |
118 | 120 | #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL) | |
119 | #define ARPT_SO_SET_REPLACE (XT_SO_SET_REPLACE+ARPT_CTL_OFFSET) | 121 | #define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1) |
120 | #define ARPT_SO_SET_ADD_COUNTERS (XT_SO_SET_ADD_COUNTERS+ARPT_CTL_OFFSET) | 122 | #define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS |
121 | #define ARPT_SO_SET_MAX (XT_SO_SET_MAX+ARPT_CTL_OFFSET) | 123 | |
122 | 124 | #define ARPT_SO_GET_INFO (ARPT_BASE_CTL) | |
123 | #define ARPT_SO_GET_INFO (XT_SO_GET_INFO+ARPT_CTL_OFFSET) | 125 | #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) |
124 | #define ARPT_SO_GET_ENTRIES (XT_SO_GET_ENTRIES+ARPT_CTL_OFFSET) | 126 | /* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */ |
125 | /* #define ARPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH */ | 127 | #define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3) |
126 | #define ARPT_SO_GET_REVISION_TARGET (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET) | 128 | #define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET) |
127 | #define ARPT_SO_GET_MAX (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET) | ||
128 | 129 | ||
129 | /* CONTINUE verdict for targets */ | 130 | /* CONTINUE verdict for targets */ |
130 | #define ARPT_CONTINUE XT_CONTINUE | 131 | #define ARPT_CONTINUE XT_CONTINUE |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 9a4dd11af86e..6c4613f8ad75 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -64,7 +64,7 @@ static inline int nf_bridge_pad(const struct sk_buff *skb) | |||
64 | 64 | ||
65 | struct bridge_skb_cb { | 65 | struct bridge_skb_cb { |
66 | union { | 66 | union { |
67 | __u32 ipv4; | 67 | __be32 ipv4; |
68 | } daddr; | 68 | } daddr; |
69 | }; | 69 | }; |
70 | 70 | ||
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h index b9f712c14a0a..07f044ff1a6b 100644 --- a/include/linux/netfilter_bridge/ebt_802_3.h +++ b/include/linux/netfilter_bridge/ebt_802_3.h | |||
@@ -28,21 +28,21 @@ struct hdr_ui { | |||
28 | uint8_t ssap; | 28 | uint8_t ssap; |
29 | uint8_t ctrl; | 29 | uint8_t ctrl; |
30 | uint8_t orig[3]; | 30 | uint8_t orig[3]; |
31 | uint16_t type; | 31 | __be16 type; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct hdr_ni { | 34 | struct hdr_ni { |
35 | uint8_t dsap; | 35 | uint8_t dsap; |
36 | uint8_t ssap; | 36 | uint8_t ssap; |
37 | uint16_t ctrl; | 37 | __be16 ctrl; |
38 | uint8_t orig[3]; | 38 | uint8_t orig[3]; |
39 | uint16_t type; | 39 | __be16 type; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct ebt_802_3_hdr { | 42 | struct ebt_802_3_hdr { |
43 | uint8_t daddr[6]; | 43 | uint8_t daddr[6]; |
44 | uint8_t saddr[6]; | 44 | uint8_t saddr[6]; |
45 | uint16_t len; | 45 | __be16 len; |
46 | union { | 46 | union { |
47 | struct hdr_ui ui; | 47 | struct hdr_ui ui; |
48 | struct hdr_ni ni; | 48 | struct hdr_ni ni; |
@@ -61,7 +61,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) | |||
61 | struct ebt_802_3_info | 61 | struct ebt_802_3_info |
62 | { | 62 | { |
63 | uint8_t sap; | 63 | uint8_t sap; |
64 | uint16_t type; | 64 | __be16 type; |
65 | uint8_t bitmask; | 65 | uint8_t bitmask; |
66 | uint8_t invflags; | 66 | uint8_t invflags; |
67 | }; | 67 | }; |
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h index 307c1fed8511..7654069233ca 100644 --- a/include/linux/netfilter_bridge/ebt_among.h +++ b/include/linux/netfilter_bridge/ebt_among.h | |||
@@ -32,7 +32,7 @@ | |||
32 | struct ebt_mac_wormhash_tuple | 32 | struct ebt_mac_wormhash_tuple |
33 | { | 33 | { |
34 | uint32_t cmp[2]; | 34 | uint32_t cmp[2]; |
35 | uint32_t ip; | 35 | __be32 ip; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | struct ebt_mac_wormhash | 38 | struct ebt_mac_wormhash |
diff --git a/include/linux/netfilter_bridge/ebt_arp.h b/include/linux/netfilter_bridge/ebt_arp.h index 537ec6b487a2..97e4dbde1f89 100644 --- a/include/linux/netfilter_bridge/ebt_arp.h +++ b/include/linux/netfilter_bridge/ebt_arp.h | |||
@@ -14,13 +14,13 @@ | |||
14 | 14 | ||
15 | struct ebt_arp_info | 15 | struct ebt_arp_info |
16 | { | 16 | { |
17 | uint16_t htype; | 17 | __be16 htype; |
18 | uint16_t ptype; | 18 | __be16 ptype; |
19 | uint16_t opcode; | 19 | __be16 opcode; |
20 | uint32_t saddr; | 20 | __be32 saddr; |
21 | uint32_t smsk; | 21 | __be32 smsk; |
22 | uint32_t daddr; | 22 | __be32 daddr; |
23 | uint32_t dmsk; | 23 | __be32 dmsk; |
24 | unsigned char smaddr[ETH_ALEN]; | 24 | unsigned char smaddr[ETH_ALEN]; |
25 | unsigned char smmsk[ETH_ALEN]; | 25 | unsigned char smmsk[ETH_ALEN]; |
26 | unsigned char dmaddr[ETH_ALEN]; | 26 | unsigned char dmaddr[ETH_ALEN]; |
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h index 7247385cdcb1..d6847475bf2e 100644 --- a/include/linux/netfilter_bridge/ebt_ip.h +++ b/include/linux/netfilter_bridge/ebt_ip.h | |||
@@ -28,10 +28,10 @@ | |||
28 | /* the same values are used for the invflags */ | 28 | /* the same values are used for the invflags */ |
29 | struct ebt_ip_info | 29 | struct ebt_ip_info |
30 | { | 30 | { |
31 | uint32_t saddr; | 31 | __be32 saddr; |
32 | uint32_t daddr; | 32 | __be32 daddr; |
33 | uint32_t smsk; | 33 | __be32 smsk; |
34 | uint32_t dmsk; | 34 | __be32 dmsk; |
35 | uint8_t tos; | 35 | uint8_t tos; |
36 | uint8_t protocol; | 36 | uint8_t protocol; |
37 | uint8_t bitmask; | 37 | uint8_t bitmask; |
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h index 26fd90da4cd6..435b886a51aa 100644 --- a/include/linux/netfilter_bridge/ebt_nat.h +++ b/include/linux/netfilter_bridge/ebt_nat.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_NAT_H | 1 | #ifndef __LINUX_BRIDGE_EBT_NAT_H |
2 | #define __LINUX_BRIDGE_EBT_NAT_H | 2 | #define __LINUX_BRIDGE_EBT_NAT_H |
3 | 3 | ||
4 | #define NAT_ARP_BIT (0x00000010) | ||
4 | struct ebt_nat_info | 5 | struct ebt_nat_info |
5 | { | 6 | { |
6 | unsigned char mac[ETH_ALEN]; | 7 | unsigned char mac[ETH_ALEN]; |
diff --git a/include/linux/netfilter_bridge/ebt_vlan.h b/include/linux/netfilter_bridge/ebt_vlan.h index cb1fcc41565f..1d98be4031e7 100644 --- a/include/linux/netfilter_bridge/ebt_vlan.h +++ b/include/linux/netfilter_bridge/ebt_vlan.h | |||
@@ -10,7 +10,7 @@ | |||
10 | struct ebt_vlan_info { | 10 | struct ebt_vlan_info { |
11 | uint16_t id; /* VLAN ID {1-4095} */ | 11 | uint16_t id; /* VLAN ID {1-4095} */ |
12 | uint8_t prio; /* VLAN User Priority {0-7} */ | 12 | uint8_t prio; /* VLAN User Priority {0-7} */ |
13 | uint16_t encap; /* VLAN Encapsulated frame code {0-65535} */ | 13 | __be16 encap; /* VLAN Encapsulated frame code {0-65535} */ |
14 | uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg, | 14 | uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg, |
15 | bit 2=1 User-Priority arg, bit 3=1 encap*/ | 15 | bit 2=1 User-Priority arg, bit 3=1 encap*/ |
16 | uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg, | 16 | uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg, |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index b1a7cc90877b..94e0a7dc0cb2 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -26,6 +26,10 @@ | |||
26 | #define EBT_CONTINUE -3 | 26 | #define EBT_CONTINUE -3 |
27 | #define EBT_RETURN -4 | 27 | #define EBT_RETURN -4 |
28 | #define NUM_STANDARD_TARGETS 4 | 28 | #define NUM_STANDARD_TARGETS 4 |
29 | /* ebtables target modules store the verdict inside an int. We can | ||
30 | * reclaim a part of this int for backwards compatible extensions. | ||
31 | * The 4 lsb are more than enough to store the verdict. */ | ||
32 | #define EBT_VERDICT_BITS 0x0000000F | ||
29 | 33 | ||
30 | struct ebt_counter | 34 | struct ebt_counter |
31 | { | 35 | { |
@@ -42,6 +46,23 @@ struct ebt_replace | |||
42 | /* total size of the entries */ | 46 | /* total size of the entries */ |
43 | unsigned int entries_size; | 47 | unsigned int entries_size; |
44 | /* start of the chains */ | 48 | /* start of the chains */ |
49 | struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS]; | ||
50 | /* nr of counters userspace expects back */ | ||
51 | unsigned int num_counters; | ||
52 | /* where the kernel will put the old counters */ | ||
53 | struct ebt_counter __user *counters; | ||
54 | char __user *entries; | ||
55 | }; | ||
56 | |||
57 | struct ebt_replace_kernel | ||
58 | { | ||
59 | char name[EBT_TABLE_MAXNAMELEN]; | ||
60 | unsigned int valid_hooks; | ||
61 | /* nr of rules in the table */ | ||
62 | unsigned int nentries; | ||
63 | /* total size of the entries */ | ||
64 | unsigned int entries_size; | ||
65 | /* start of the chains */ | ||
45 | struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; | 66 | struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; |
46 | /* nr of counters userspace expects back */ | 67 | /* nr of counters userspace expects back */ |
47 | unsigned int num_counters; | 68 | unsigned int num_counters; |
@@ -141,7 +162,7 @@ struct ebt_entry { | |||
141 | /* this needs to be the first field */ | 162 | /* this needs to be the first field */ |
142 | unsigned int bitmask; | 163 | unsigned int bitmask; |
143 | unsigned int invflags; | 164 | unsigned int invflags; |
144 | uint16_t ethproto; | 165 | __be16 ethproto; |
145 | /* the physical in-dev */ | 166 | /* the physical in-dev */ |
146 | char in[IFNAMSIZ]; | 167 | char in[IFNAMSIZ]; |
147 | /* the logical in-dev */ | 168 | /* the logical in-dev */ |
@@ -251,7 +272,7 @@ struct ebt_table | |||
251 | { | 272 | { |
252 | struct list_head list; | 273 | struct list_head list; |
253 | char name[EBT_TABLE_MAXNAMELEN]; | 274 | char name[EBT_TABLE_MAXNAMELEN]; |
254 | struct ebt_replace *table; | 275 | struct ebt_replace_kernel *table; |
255 | unsigned int valid_hooks; | 276 | unsigned int valid_hooks; |
256 | rwlock_t lock; | 277 | rwlock_t lock; |
257 | /* e.g. could be the table explicitly only allows certain | 278 | /* e.g. could be the table explicitly only allows certain |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 5b63a231a76b..5821eb5a0a3e 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -79,7 +79,7 @@ enum nf_ip_hook_priorities { | |||
79 | #ifdef __KERNEL__ | 79 | #ifdef __KERNEL__ |
80 | extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); | 80 | extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); |
81 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); | 81 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); |
82 | extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, | 82 | extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, |
83 | unsigned int dataoff, u_int8_t protocol); | 83 | unsigned int dataoff, u_int8_t protocol); |
84 | #endif /*__KERNEL__*/ | 84 | #endif /*__KERNEL__*/ |
85 | 85 | ||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 591c1a809c00..180337801a86 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -1,6 +1,4 @@ | |||
1 | header-y += ip_conntrack_helper.h | 1 | header-y += ip_conntrack_helper.h |
2 | header-y += ip_conntrack_helper_h323_asn1.h | ||
3 | header-y += ip_conntrack_helper_h323_types.h | ||
4 | header-y += ip_conntrack_protocol.h | 2 | header-y += ip_conntrack_protocol.h |
5 | header-y += ip_conntrack_sctp.h | 3 | header-y += ip_conntrack_sctp.h |
6 | header-y += ip_conntrack_tcp.h | 4 | header-y += ip_conntrack_tcp.h |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 64e868034c4a..61da56941dce 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -277,7 +277,7 @@ extern struct ip_conntrack_expect * | |||
277 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); | 277 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); |
278 | 278 | ||
279 | extern struct ip_conntrack_expect * | 279 | extern struct ip_conntrack_expect * |
280 | ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); | 280 | ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple); |
281 | 281 | ||
282 | extern struct ip_conntrack_tuple_hash * | 282 | extern struct ip_conntrack_tuple_hash * |
283 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, | 283 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h index 63811934de4d..2129fc3972ac 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h | |||
@@ -1,6 +1,44 @@ | |||
1 | #ifndef _IP_CONNTRACK_FTP_H | 1 | #ifndef _IP_CONNTRACK_FTP_H |
2 | #define _IP_CONNTRACK_FTP_H | 2 | #define _IP_CONNTRACK_FTP_H |
3 | /* FTP tracking. */ | ||
3 | 4 | ||
4 | #include <linux/netfilter/nf_conntrack_ftp.h> | 5 | /* This enum is exposed to userspace */ |
6 | enum ip_ct_ftp_type | ||
7 | { | ||
8 | /* PORT command from client */ | ||
9 | IP_CT_FTP_PORT, | ||
10 | /* PASV response from server */ | ||
11 | IP_CT_FTP_PASV, | ||
12 | /* EPRT command from client */ | ||
13 | IP_CT_FTP_EPRT, | ||
14 | /* EPSV response from server */ | ||
15 | IP_CT_FTP_EPSV, | ||
16 | }; | ||
17 | |||
18 | #ifdef __KERNEL__ | ||
19 | |||
20 | #define FTP_PORT 21 | ||
21 | |||
22 | #define NUM_SEQ_TO_REMEMBER 2 | ||
23 | /* This structure exists only once per master */ | ||
24 | struct ip_ct_ftp_master { | ||
25 | /* Valid seq positions for cmd matching after newline */ | ||
26 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | ||
27 | /* 0 means seq_match_aft_nl not set */ | ||
28 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | ||
29 | }; | ||
30 | |||
31 | struct ip_conntrack_expect; | ||
32 | |||
33 | /* For NAT to hook in when we find a packet which describes what other | ||
34 | * connection we should expect. */ | ||
35 | extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, | ||
36 | enum ip_conntrack_info ctinfo, | ||
37 | enum ip_ct_ftp_type type, | ||
38 | unsigned int matchoff, | ||
39 | unsigned int matchlen, | ||
40 | struct ip_conntrack_expect *exp, | ||
41 | u32 *seq); | ||
42 | #endif /* __KERNEL__ */ | ||
5 | 43 | ||
6 | #endif /* _IP_CONNTRACK_FTP_H */ | 44 | #endif /* _IP_CONNTRACK_FTP_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 943cc6a4871d..18f769818f4e 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> | 6 | #include <linux/netfilter/nf_conntrack_h323_asn1.h> |
7 | 7 | ||
8 | #define RAS_PORT 1719 | 8 | #define RAS_PORT 1719 |
9 | #define Q931_PORT 1720 | 9 | #define Q931_PORT 1720 |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h index 1d853aa873eb..e371e0fc1672 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h | |||
@@ -102,11 +102,11 @@ static inline __be32 *gre_key(struct gre_hdr *greh) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | /* get pointer ot gre csum, if present */ | 104 | /* get pointer ot gre csum, if present */ |
105 | static inline u_int16_t *gre_csum(struct gre_hdr *greh) | 105 | static inline __sum16 *gre_csum(struct gre_hdr *greh) |
106 | { | 106 | { |
107 | if (!greh->csum) | 107 | if (!greh->csum) |
108 | return NULL; | 108 | return NULL; |
109 | return (u_int16_t *) (greh+sizeof(*greh)); | 109 | return (__sum16 *) (greh+sizeof(*greh)); |
110 | } | 110 | } |
111 | 111 | ||
112 | #endif /* __KERNEL__ */ | 112 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h index 913dad66c0fb..bef6c646defa 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_sip.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h | |||
@@ -5,23 +5,18 @@ | |||
5 | #define SIP_PORT 5060 | 5 | #define SIP_PORT 5060 |
6 | #define SIP_TIMEOUT 3600 | 6 | #define SIP_TIMEOUT 3600 |
7 | 7 | ||
8 | #define POS_VIA 0 | 8 | enum sip_header_pos { |
9 | #define POS_CONTACT 1 | 9 | POS_REG_REQ_URI, |
10 | #define POS_CONTENT 2 | 10 | POS_REQ_URI, |
11 | #define POS_MEDIA 3 | 11 | POS_FROM, |
12 | #define POS_OWNER 4 | 12 | POS_TO, |
13 | #define POS_CONNECTION 5 | 13 | POS_VIA, |
14 | #define POS_REQ_HEADER 6 | 14 | POS_CONTACT, |
15 | #define POS_SDP_HEADER 7 | 15 | POS_CONTENT, |
16 | 16 | POS_MEDIA, | |
17 | struct sip_header_nfo { | 17 | POS_OWNER, |
18 | const char *lname; | 18 | POS_CONNECTION, |
19 | const char *sname; | 19 | POS_SDP_HEADER, |
20 | const char *ln_str; | ||
21 | size_t lnlen; | ||
22 | size_t snlen; | ||
23 | size_t ln_strlen; | ||
24 | int (*match_len)(const char *, const char *, int *); | ||
25 | }; | 20 | }; |
26 | 21 | ||
27 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, | 22 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, |
@@ -36,9 +31,10 @@ extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb, | |||
36 | extern int ct_sip_get_info(const char *dptr, size_t dlen, | 31 | extern int ct_sip_get_info(const char *dptr, size_t dlen, |
37 | unsigned int *matchoff, | 32 | unsigned int *matchoff, |
38 | unsigned int *matchlen, | 33 | unsigned int *matchlen, |
39 | struct sip_header_nfo *hnfo); | 34 | enum sip_header_pos pos); |
40 | extern int ct_sip_lnlen(const char *line, const char *limit); | 35 | extern int ct_sip_lnlen(const char *line, const char *limit); |
41 | extern const char *ct_sip_search(const char *needle, const char *haystack, | 36 | extern const char *ct_sip_search(const char *needle, const char *haystack, |
42 | size_t needle_len, size_t haystack_len); | 37 | size_t needle_len, size_t haystack_len, |
38 | int case_sensitive); | ||
43 | #endif /* __KERNEL__ */ | 39 | #endif /* __KERNEL__ */ |
44 | #endif /* __IP_CONNTRACK_SIP_H__ */ | 40 | #endif /* __IP_CONNTRACK_SIP_H__ */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h index cde9729aa173..a404fc0abf0e 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #define TFTP_PORT 69 | 4 | #define TFTP_PORT 69 |
5 | 5 | ||
6 | struct tftphdr { | 6 | struct tftphdr { |
7 | u_int16_t opcode; | 7 | __be16 opcode; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | #define TFTP_OPCODE_READ 1 | 10 | #define TFTP_OPCODE_READ 1 |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index a536bbdef145..4f06dad0bde9 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -101,18 +101,21 @@ struct ipt_entry | |||
101 | /* | 101 | /* |
102 | * New IP firewall options for [gs]etsockopt at the RAW IP level. | 102 | * New IP firewall options for [gs]etsockopt at the RAW IP level. |
103 | * Unlike BSD Linux inherits IP options so you don't have to use a raw | 103 | * Unlike BSD Linux inherits IP options so you don't have to use a raw |
104 | * socket for this. Instead we check rights in the calls. */ | 104 | * socket for this. Instead we check rights in the calls. |
105 | #define IPT_BASE_CTL XT_BASE_CTL | 105 | * |
106 | 106 | * ATTENTION: check linux/in.h before adding new number here. | |
107 | #define IPT_SO_SET_REPLACE XT_SO_SET_REPLACE | 107 | */ |
108 | #define IPT_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS | 108 | #define IPT_BASE_CTL 64 |
109 | #define IPT_SO_SET_MAX XT_SO_SET_MAX | 109 | |
110 | 110 | #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) | |
111 | #define IPT_SO_GET_INFO XT_SO_GET_INFO | 111 | #define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1) |
112 | #define IPT_SO_GET_ENTRIES XT_SO_GET_ENTRIES | 112 | #define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS |
113 | #define IPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH | 113 | |
114 | #define IPT_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET | 114 | #define IPT_SO_GET_INFO (IPT_BASE_CTL) |
115 | #define IPT_SO_GET_MAX XT_SO_GET_REVISION_TARGET | 115 | #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) |
116 | #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2) | ||
117 | #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) | ||
118 | #define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET | ||
116 | 119 | ||
117 | #define IPT_CONTINUE XT_CONTINUE | 120 | #define IPT_CONTINUE XT_CONTINUE |
118 | #define IPT_RETURN XT_RETURN | 121 | #define IPT_RETURN XT_RETURN |
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h index 892f9a33fea8..90fa6525ef9c 100644 --- a/include/linux/netfilter_ipv4/ipt_LOG.h +++ b/include/linux/netfilter_ipv4/ipt_LOG.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ |
7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ |
8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IPT_LOG_UID 0x08 /* Log UID owning local socket */ |
9 | #define IPT_LOG_NFLOG 0x10 /* Log using nf_log backend */ | 9 | #define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */ |
10 | #define IPT_LOG_MASK 0x1f | 10 | #define IPT_LOG_MASK 0x1f |
11 | 11 | ||
12 | struct ipt_log_info { | 12 | struct ipt_log_info { |
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h index ac2cb64ecd76..5662120a3d7b 100644 --- a/include/linux/netfilter_ipv4/ipt_hashlimit.h +++ b/include/linux/netfilter_ipv4/ipt_hashlimit.h | |||
@@ -1,40 +1,14 @@ | |||
1 | #ifndef _IPT_HASHLIMIT_H | 1 | #ifndef _IPT_HASHLIMIT_H |
2 | #define _IPT_HASHLIMIT_H | 2 | #define _IPT_HASHLIMIT_H |
3 | 3 | ||
4 | /* timings are in milliseconds. */ | 4 | #include <linux/netfilter/xt_hashlimit.h> |
5 | #define IPT_HASHLIMIT_SCALE 10000 | ||
6 | /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 | ||
7 | seconds, or one every 59 hours. */ | ||
8 | 5 | ||
9 | /* details of this structure hidden by the implementation */ | 6 | #define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE |
10 | struct ipt_hashlimit_htable; | 7 | #define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP |
8 | #define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT | ||
9 | #define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP | ||
10 | #define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT | ||
11 | 11 | ||
12 | #define IPT_HASHLIMIT_HASH_DIP 0x0001 | 12 | #define ipt_hashlimit_info xt_hashlimit_info |
13 | #define IPT_HASHLIMIT_HASH_DPT 0x0002 | ||
14 | #define IPT_HASHLIMIT_HASH_SIP 0x0004 | ||
15 | #define IPT_HASHLIMIT_HASH_SPT 0x0008 | ||
16 | 13 | ||
17 | struct hashlimit_cfg { | 14 | #endif /* _IPT_HASHLIMIT_H */ |
18 | u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */ | ||
19 | u_int32_t avg; /* Average secs between packets * scale */ | ||
20 | u_int32_t burst; /* Period multiplier for upper limit. */ | ||
21 | |||
22 | /* user specified */ | ||
23 | u_int32_t size; /* how many buckets */ | ||
24 | u_int32_t max; /* max number of entries */ | ||
25 | u_int32_t gc_interval; /* gc interval */ | ||
26 | u_int32_t expire; /* when do entries expire? */ | ||
27 | }; | ||
28 | |||
29 | struct ipt_hashlimit_info { | ||
30 | char name [IFNAMSIZ]; /* name */ | ||
31 | struct hashlimit_cfg cfg; | ||
32 | struct ipt_hashlimit_htable *hinfo; | ||
33 | |||
34 | /* Used internally by the kernel */ | ||
35 | union { | ||
36 | void *ptr; | ||
37 | struct ipt_hashlimit_info *master; | ||
38 | } u; | ||
39 | }; | ||
40 | #endif /*_IPT_HASHLIMIT_H*/ | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index d97e268cdfe5..ab81a6dc94ea 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -74,7 +74,7 @@ enum nf_ip6_hook_priorities { | |||
74 | 74 | ||
75 | #ifdef CONFIG_NETFILTER | 75 | #ifdef CONFIG_NETFILTER |
76 | extern int ip6_route_me_harder(struct sk_buff *skb); | 76 | extern int ip6_route_me_harder(struct sk_buff *skb); |
77 | extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 77 | extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
78 | unsigned int dataoff, u_int8_t protocol); | 78 | unsigned int dataoff, u_int8_t protocol); |
79 | 79 | ||
80 | extern int ipv6_netfilter_init(void); | 80 | extern int ipv6_netfilter_init(void); |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index d7a8e9c0dad0..4aed340401db 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -107,18 +107,21 @@ struct ip6t_entry | |||
107 | /* | 107 | /* |
108 | * New IP firewall options for [gs]etsockopt at the RAW IP level. | 108 | * New IP firewall options for [gs]etsockopt at the RAW IP level. |
109 | * Unlike BSD Linux inherits IP options so you don't have to use | 109 | * Unlike BSD Linux inherits IP options so you don't have to use |
110 | * a raw socket for this. Instead we check rights in the calls. */ | 110 | * a raw socket for this. Instead we check rights in the calls. |
111 | #define IP6T_BASE_CTL XT_BASE_CTL | 111 | * |
112 | 112 | * ATTENTION: check linux/in6.h before adding new number here. | |
113 | #define IP6T_SO_SET_REPLACE XT_SO_SET_REPLACE | 113 | */ |
114 | #define IP6T_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS | 114 | #define IP6T_BASE_CTL 64 |
115 | #define IP6T_SO_SET_MAX XT_SO_SET_MAX | 115 | |
116 | 116 | #define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL) | |
117 | #define IP6T_SO_GET_INFO XT_SO_GET_INFO | 117 | #define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1) |
118 | #define IP6T_SO_GET_ENTRIES XT_SO_GET_ENTRIES | 118 | #define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS |
119 | #define IP6T_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH | 119 | |
120 | #define IP6T_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET | 120 | #define IP6T_SO_GET_INFO (IP6T_BASE_CTL) |
121 | #define IP6T_SO_GET_MAX XT_SO_GET_REVISION_TARGET | 121 | #define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1) |
122 | #define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4) | ||
123 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) | ||
124 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET | ||
122 | 125 | ||
123 | /* CONTINUE verdict for targets */ | 126 | /* CONTINUE verdict for targets */ |
124 | #define IP6T_CONTINUE XT_CONTINUE | 127 | #define IP6T_CONTINUE XT_CONTINUE |
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h index 060c1a1c6c60..0d0119b0458c 100644 --- a/include/linux/netfilter_ipv6/ip6t_LOG.h +++ b/include/linux/netfilter_ipv6/ip6t_LOG.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ |
7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ |
8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ | 8 | #define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ |
9 | #define IP6T_LOG_NFLOG 0x10 /* Log using nf_log backend */ | 9 | #define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */ |
10 | #define IP6T_LOG_MASK 0x1f | 10 | #define IP6T_LOG_MASK 0x1f |
11 | 11 | ||
12 | struct ip6t_log_info { | 12 | struct ip6t_log_info { |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 66411622e06e..b3b9b609ee89 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -141,7 +141,6 @@ struct netlink_skb_parms | |||
141 | { | 141 | { |
142 | struct ucred creds; /* Skb credentials */ | 142 | struct ucred creds; /* Skb credentials */ |
143 | __u32 pid; | 143 | __u32 pid; |
144 | __u32 dst_pid; | ||
145 | __u32 dst_group; | 144 | __u32 dst_group; |
146 | kernel_cap_t eff_cap; | 145 | kernel_cap_t eff_cap; |
147 | __u32 loginuid; /* Login (audit) uid */ | 146 | __u32 loginuid; /* Login (audit) uid */ |
@@ -174,6 +173,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); | |||
174 | */ | 173 | */ |
175 | #define NLMSG_GOODORDER 0 | 174 | #define NLMSG_GOODORDER 0 |
176 | #define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) | 175 | #define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) |
176 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) | ||
177 | 177 | ||
178 | 178 | ||
179 | struct netlink_callback | 179 | struct netlink_callback |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 1efe60c5c00c..2cc9867b1626 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -12,26 +12,27 @@ | |||
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | 14 | ||
15 | struct netpoll; | ||
16 | |||
17 | struct netpoll { | 15 | struct netpoll { |
18 | struct net_device *dev; | 16 | struct net_device *dev; |
19 | char dev_name[16], *name; | 17 | char dev_name[IFNAMSIZ]; |
18 | const char *name; | ||
20 | void (*rx_hook)(struct netpoll *, int, char *, int); | 19 | void (*rx_hook)(struct netpoll *, int, char *, int); |
21 | void (*drop)(struct sk_buff *skb); | 20 | |
22 | u32 local_ip, remote_ip; | 21 | u32 local_ip, remote_ip; |
23 | u16 local_port, remote_port; | 22 | u16 local_port, remote_port; |
24 | unsigned char local_mac[6], remote_mac[6]; | 23 | u8 local_mac[ETH_ALEN], remote_mac[ETH_ALEN]; |
25 | }; | 24 | }; |
26 | 25 | ||
27 | struct netpoll_info { | 26 | struct netpoll_info { |
27 | atomic_t refcnt; | ||
28 | spinlock_t poll_lock; | 28 | spinlock_t poll_lock; |
29 | int poll_owner; | 29 | int poll_owner; |
30 | int tries; | ||
31 | int rx_flags; | 30 | int rx_flags; |
32 | spinlock_t rx_lock; | 31 | spinlock_t rx_lock; |
33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 32 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
34 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 33 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ |
34 | struct sk_buff_head txq; | ||
35 | struct work_struct tx_work; | ||
35 | }; | 36 | }; |
36 | 37 | ||
37 | void netpoll_poll(struct netpoll *np); | 38 | void netpoll_poll(struct netpoll *np); |
@@ -42,7 +43,7 @@ int netpoll_trap(void); | |||
42 | void netpoll_set_trap(int trap); | 43 | void netpoll_set_trap(int trap); |
43 | void netpoll_cleanup(struct netpoll *np); | 44 | void netpoll_cleanup(struct netpoll *np); |
44 | int __netpoll_rx(struct sk_buff *skb); | 45 | int __netpoll_rx(struct sk_buff *skb); |
45 | void netpoll_queue(struct sk_buff *skb); | 46 | |
46 | 47 | ||
47 | #ifdef CONFIG_NETPOLL | 48 | #ifdef CONFIG_NETPOLL |
48 | static inline int netpoll_rx(struct sk_buff *skb) | 49 | static inline int netpoll_rx(struct sk_buff *skb) |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 76ff54846ada..625ffea98561 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -157,7 +157,7 @@ struct nfs_inode { | |||
157 | * This is the cookie verifier used for NFSv3 readdir | 157 | * This is the cookie verifier used for NFSv3 readdir |
158 | * operations | 158 | * operations |
159 | */ | 159 | */ |
160 | __u32 cookieverf[2]; | 160 | __be32 cookieverf[2]; |
161 | 161 | ||
162 | /* | 162 | /* |
163 | * This is the list of dirty unwritten pages. | 163 | * This is the list of dirty unwritten pages. |
@@ -290,6 +290,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long | |||
290 | * linux/fs/nfs/inode.c | 290 | * linux/fs/nfs/inode.c |
291 | */ | 291 | */ |
292 | extern int nfs_sync_mapping(struct address_space *mapping); | 292 | extern int nfs_sync_mapping(struct address_space *mapping); |
293 | extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping); | ||
293 | extern void nfs_zap_caches(struct inode *); | 294 | extern void nfs_zap_caches(struct inode *); |
294 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 295 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, |
295 | struct nfs_fattr *); | 296 | struct nfs_fattr *); |
@@ -317,7 +318,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx); | |||
317 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 318 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
318 | 319 | ||
319 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 320 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
320 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 321 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
321 | 322 | ||
322 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) | 323 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) |
323 | { | 324 | { |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index dc5397d9d23c..768c1ad5ff6f 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -266,7 +266,7 @@ struct nfs_writeargs { | |||
266 | 266 | ||
267 | struct nfs_writeverf { | 267 | struct nfs_writeverf { |
268 | enum nfs3_stable_how committed; | 268 | enum nfs3_stable_how committed; |
269 | __u32 verifier[2]; | 269 | __be32 verifier[2]; |
270 | }; | 270 | }; |
271 | 271 | ||
272 | struct nfs_writeres { | 272 | struct nfs_writeres { |
@@ -420,7 +420,7 @@ struct nfs3_createargs { | |||
420 | unsigned int len; | 420 | unsigned int len; |
421 | struct iattr * sattr; | 421 | struct iattr * sattr; |
422 | enum nfs3_createmode createmode; | 422 | enum nfs3_createmode createmode; |
423 | __u32 verifier[2]; | 423 | __be32 verifier[2]; |
424 | }; | 424 | }; |
425 | 425 | ||
426 | struct nfs3_mkdirargs { | 426 | struct nfs3_mkdirargs { |
@@ -467,7 +467,7 @@ struct nfs3_linkargs { | |||
467 | struct nfs3_readdirargs { | 467 | struct nfs3_readdirargs { |
468 | struct nfs_fh * fh; | 468 | struct nfs_fh * fh; |
469 | __u64 cookie; | 469 | __u64 cookie; |
470 | __u32 verf[2]; | 470 | __be32 verf[2]; |
471 | int plus; | 471 | int plus; |
472 | unsigned int count; | 472 | unsigned int count; |
473 | struct page ** pages; | 473 | struct page ** pages; |
@@ -503,7 +503,7 @@ struct nfs3_linkres { | |||
503 | 503 | ||
504 | struct nfs3_readdirres { | 504 | struct nfs3_readdirres { |
505 | struct nfs_fattr * dir_attr; | 505 | struct nfs_fattr * dir_attr; |
506 | __u32 * verf; | 506 | __be32 * verf; |
507 | int plus; | 507 | int plus; |
508 | }; | 508 | }; |
509 | 509 | ||
@@ -811,7 +811,7 @@ struct nfs_rpc_ops { | |||
811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | 811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
812 | struct nfs_pathconf *); | 812 | struct nfs_pathconf *); |
813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
814 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 814 | __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); |
815 | void (*read_setup) (struct nfs_read_data *); | 815 | void (*read_setup) (struct nfs_read_data *); |
816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
817 | void (*write_setup) (struct nfs_write_data *, int how); | 817 | void (*write_setup) (struct nfs_write_data *, int how); |
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h index c3a3557c2a5b..007480cd6a60 100644 --- a/include/linux/nfsd/cache.h +++ b/include/linux/nfsd/cache.h | |||
@@ -26,14 +26,14 @@ struct svc_cacherep { | |||
26 | c_type, /* status, buffer */ | 26 | c_type, /* status, buffer */ |
27 | c_secure : 1; /* req came from port < 1024 */ | 27 | c_secure : 1; /* req came from port < 1024 */ |
28 | struct sockaddr_in c_addr; | 28 | struct sockaddr_in c_addr; |
29 | u32 c_xid; | 29 | __be32 c_xid; |
30 | u32 c_prot; | 30 | u32 c_prot; |
31 | u32 c_proc; | 31 | u32 c_proc; |
32 | u32 c_vers; | 32 | u32 c_vers; |
33 | unsigned long c_timestamp; | 33 | unsigned long c_timestamp; |
34 | union { | 34 | union { |
35 | struct kvec u_vec; | 35 | struct kvec u_vec; |
36 | u32 u_status; | 36 | __be32 u_status; |
37 | } c_u; | 37 | } c_u; |
38 | }; | 38 | }; |
39 | 39 | ||
@@ -75,7 +75,7 @@ enum { | |||
75 | void nfsd_cache_init(void); | 75 | void nfsd_cache_init(void); |
76 | void nfsd_cache_shutdown(void); | 76 | void nfsd_cache_shutdown(void); |
77 | int nfsd_cache_lookup(struct svc_rqst *, int); | 77 | int nfsd_cache_lookup(struct svc_rqst *, int); |
78 | void nfsd_cache_update(struct svc_rqst *, int, u32 *); | 78 | void nfsd_cache_update(struct svc_rqst *, int, __be32 *); |
79 | 79 | ||
80 | #endif /* __KERNEL__ */ | 80 | #endif /* __KERNEL__ */ |
81 | #endif /* NFSCACHE_H */ | 81 | #endif /* NFSCACHE_H */ |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 6e78ea969f49..045e38cdbe64 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -117,8 +117,8 @@ struct svc_export * exp_parent(struct auth_domain *clp, | |||
117 | struct cache_req *reqp); | 117 | struct cache_req *reqp); |
118 | int exp_rootfh(struct auth_domain *, | 118 | int exp_rootfh(struct auth_domain *, |
119 | char *path, struct knfsd_fh *, int maxsize); | 119 | char *path, struct knfsd_fh *, int maxsize); |
120 | int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); | 120 | __be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); |
121 | int nfserrno(int errno); | 121 | __be32 nfserrno(int errno); |
122 | 122 | ||
123 | extern struct cache_detail svc_export_cache; | 123 | extern struct cache_detail svc_export_cache; |
124 | 124 | ||
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index d0d4aae7085f..edb54c3171b3 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -50,7 +50,7 @@ | |||
50 | * Callback function for readdir | 50 | * Callback function for readdir |
51 | */ | 51 | */ |
52 | struct readdir_cd { | 52 | struct readdir_cd { |
53 | int err; /* 0, nfserr, or nfserr_eof */ | 53 | __be32 err; /* 0, nfserr, or nfserr_eof */ |
54 | }; | 54 | }; |
55 | typedef int (*encode_dent_fn)(struct readdir_cd *, const char *, | 55 | typedef int (*encode_dent_fn)(struct readdir_cd *, const char *, |
56 | int, loff_t, ino_t, unsigned int); | 56 | int, loff_t, ino_t, unsigned int); |
@@ -64,7 +64,7 @@ extern struct svc_serv *nfsd_serv; | |||
64 | * Function prototypes. | 64 | * Function prototypes. |
65 | */ | 65 | */ |
66 | int nfsd_svc(unsigned short port, int nrservs); | 66 | int nfsd_svc(unsigned short port, int nrservs); |
67 | int nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp); | 67 | int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp); |
68 | 68 | ||
69 | /* nfsd/vfs.c */ | 69 | /* nfsd/vfs.c */ |
70 | int fh_lock_parent(struct svc_fh *, struct dentry *); | 70 | int fh_lock_parent(struct svc_fh *, struct dentry *); |
@@ -72,57 +72,57 @@ int nfsd_racache_init(int); | |||
72 | void nfsd_racache_shutdown(void); | 72 | void nfsd_racache_shutdown(void); |
73 | int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | 73 | int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, |
74 | struct svc_export **expp); | 74 | struct svc_export **expp); |
75 | int nfsd_lookup(struct svc_rqst *, struct svc_fh *, | 75 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, |
76 | const char *, int, struct svc_fh *); | 76 | const char *, int, struct svc_fh *); |
77 | int nfsd_setattr(struct svc_rqst *, struct svc_fh *, | 77 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, |
78 | struct iattr *, int, time_t); | 78 | struct iattr *, int, time_t); |
79 | #ifdef CONFIG_NFSD_V4 | 79 | #ifdef CONFIG_NFSD_V4 |
80 | int nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, | 80 | __be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, |
81 | struct nfs4_acl *); | 81 | struct nfs4_acl *); |
82 | int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); | 82 | int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); |
83 | #endif /* CONFIG_NFSD_V4 */ | 83 | #endif /* CONFIG_NFSD_V4 */ |
84 | int nfsd_create(struct svc_rqst *, struct svc_fh *, | 84 | __be32 nfsd_create(struct svc_rqst *, struct svc_fh *, |
85 | char *name, int len, struct iattr *attrs, | 85 | char *name, int len, struct iattr *attrs, |
86 | int type, dev_t rdev, struct svc_fh *res); | 86 | int type, dev_t rdev, struct svc_fh *res); |
87 | #ifdef CONFIG_NFSD_V3 | 87 | #ifdef CONFIG_NFSD_V3 |
88 | int nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); | 88 | __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); |
89 | int nfsd_create_v3(struct svc_rqst *, struct svc_fh *, | 89 | __be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *, |
90 | char *name, int len, struct iattr *attrs, | 90 | char *name, int len, struct iattr *attrs, |
91 | struct svc_fh *res, int createmode, | 91 | struct svc_fh *res, int createmode, |
92 | u32 *verifier, int *truncp); | 92 | u32 *verifier, int *truncp, int *created); |
93 | int nfsd_commit(struct svc_rqst *, struct svc_fh *, | 93 | __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, |
94 | loff_t, unsigned long); | 94 | loff_t, unsigned long); |
95 | #endif /* CONFIG_NFSD_V3 */ | 95 | #endif /* CONFIG_NFSD_V3 */ |
96 | int nfsd_open(struct svc_rqst *, struct svc_fh *, int, | 96 | __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int, |
97 | int, struct file **); | 97 | int, struct file **); |
98 | void nfsd_close(struct file *); | 98 | void nfsd_close(struct file *); |
99 | int nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, | 99 | __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, |
100 | loff_t, struct kvec *, int, unsigned long *); | 100 | loff_t, struct kvec *, int, unsigned long *); |
101 | int nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, | 101 | __be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, |
102 | loff_t, struct kvec *,int, unsigned long, int *); | 102 | loff_t, struct kvec *,int, unsigned long, int *); |
103 | int nfsd_readlink(struct svc_rqst *, struct svc_fh *, | 103 | __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, |
104 | char *, int *); | 104 | char *, int *); |
105 | int nfsd_symlink(struct svc_rqst *, struct svc_fh *, | 105 | __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, |
106 | char *name, int len, char *path, int plen, | 106 | char *name, int len, char *path, int plen, |
107 | struct svc_fh *res, struct iattr *); | 107 | struct svc_fh *res, struct iattr *); |
108 | int nfsd_link(struct svc_rqst *, struct svc_fh *, | 108 | __be32 nfsd_link(struct svc_rqst *, struct svc_fh *, |
109 | char *, int, struct svc_fh *); | 109 | char *, int, struct svc_fh *); |
110 | int nfsd_rename(struct svc_rqst *, | 110 | __be32 nfsd_rename(struct svc_rqst *, |
111 | struct svc_fh *, char *, int, | 111 | struct svc_fh *, char *, int, |
112 | struct svc_fh *, char *, int); | 112 | struct svc_fh *, char *, int); |
113 | int nfsd_remove(struct svc_rqst *, | 113 | __be32 nfsd_remove(struct svc_rqst *, |
114 | struct svc_fh *, char *, int); | 114 | struct svc_fh *, char *, int); |
115 | int nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, | 115 | __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, |
116 | char *name, int len); | 116 | char *name, int len); |
117 | int nfsd_truncate(struct svc_rqst *, struct svc_fh *, | 117 | int nfsd_truncate(struct svc_rqst *, struct svc_fh *, |
118 | unsigned long size); | 118 | unsigned long size); |
119 | int nfsd_readdir(struct svc_rqst *, struct svc_fh *, | 119 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, |
120 | loff_t *, struct readdir_cd *, encode_dent_fn); | 120 | loff_t *, struct readdir_cd *, encode_dent_fn); |
121 | int nfsd_statfs(struct svc_rqst *, struct svc_fh *, | 121 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, |
122 | struct kstatfs *); | 122 | struct kstatfs *); |
123 | 123 | ||
124 | int nfsd_notify_change(struct inode *, struct iattr *); | 124 | int nfsd_notify_change(struct inode *, struct iattr *); |
125 | int nfsd_permission(struct svc_export *, struct dentry *, int); | 125 | __be32 nfsd_permission(struct svc_export *, struct dentry *, int); |
126 | int nfsd_sync_dir(struct dentry *dp); | 126 | int nfsd_sync_dir(struct dentry *dp); |
127 | 127 | ||
128 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | 128 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) |
@@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void); | |||
238 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) | 238 | #define nfserr_badname __constant_htonl(NFSERR_BADNAME) |
239 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) | 239 | #define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) |
240 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) | 240 | #define nfserr_locked __constant_htonl(NFSERR_LOCKED) |
241 | #define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) | ||
241 | 242 | ||
242 | /* error codes for internal use */ | 243 | /* error codes for internal use */ |
243 | /* if a request fails due to kmalloc failure, it gets dropped. | 244 | /* if a request fails due to kmalloc failure, it gets dropped. |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 069257ea99a0..f3b51d62ec7d 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -157,7 +157,7 @@ typedef struct svc_fh { | |||
157 | __u64 fh_post_size; /* i_size */ | 157 | __u64 fh_post_size; /* i_size */ |
158 | unsigned long fh_post_blocks; /* i_blocks */ | 158 | unsigned long fh_post_blocks; /* i_blocks */ |
159 | unsigned long fh_post_blksize;/* i_blksize */ | 159 | unsigned long fh_post_blksize;/* i_blksize */ |
160 | __u32 fh_post_rdev[2];/* i_rdev */ | 160 | __be32 fh_post_rdev[2];/* i_rdev */ |
161 | struct timespec fh_post_atime; /* i_atime */ | 161 | struct timespec fh_post_atime; /* i_atime */ |
162 | struct timespec fh_post_mtime; /* i_mtime */ | 162 | struct timespec fh_post_mtime; /* i_mtime */ |
163 | struct timespec fh_post_ctime; /* i_ctime */ | 163 | struct timespec fh_post_ctime; /* i_ctime */ |
@@ -209,9 +209,9 @@ extern char * SVCFH_fmt(struct svc_fh *fhp); | |||
209 | /* | 209 | /* |
210 | * Function prototypes | 210 | * Function prototypes |
211 | */ | 211 | */ |
212 | u32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); | 212 | __be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); |
213 | int fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); | 213 | __be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); |
214 | int fh_update(struct svc_fh *); | 214 | __be32 fh_update(struct svc_fh *); |
215 | void fh_put(struct svc_fh *); | 215 | void fh_put(struct svc_fh *); |
216 | 216 | ||
217 | static __inline__ struct svc_fh * | 217 | static __inline__ struct svc_fh * |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 8bf23cf8b603..c3673f487e84 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -125,7 +125,7 @@ struct nfs4_client { | |||
125 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | 125 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ |
126 | nfs4_verifier cl_verifier; /* generated by client */ | 126 | nfs4_verifier cl_verifier; /* generated by client */ |
127 | time_t cl_time; /* time of last lease renewal */ | 127 | time_t cl_time; /* time of last lease renewal */ |
128 | u32 cl_addr; /* client ipaddress */ | 128 | __be32 cl_addr; /* client ipaddress */ |
129 | struct svc_cred cl_cred; /* setclientid principal */ | 129 | struct svc_cred cl_cred; /* setclientid principal */ |
130 | clientid_t cl_clientid; /* generated by server */ | 130 | clientid_t cl_clientid; /* generated by server */ |
131 | nfs4_verifier cl_confirm; /* generated by server */ | 131 | nfs4_verifier cl_confirm; /* generated by server */ |
@@ -164,7 +164,7 @@ update_stateid(stateid_t *stateid) | |||
164 | * is cached. | 164 | * is cached. |
165 | */ | 165 | */ |
166 | struct nfs4_replay { | 166 | struct nfs4_replay { |
167 | u32 rp_status; | 167 | __be32 rp_status; |
168 | unsigned int rp_buflen; | 168 | unsigned int rp_buflen; |
169 | char *rp_buf; | 169 | char *rp_buf; |
170 | unsigned intrp_allocated; | 170 | unsigned intrp_allocated; |
@@ -273,19 +273,19 @@ struct nfs4_stateid { | |||
273 | ((err) != nfserr_stale_stateid) && \ | 273 | ((err) != nfserr_stale_stateid) && \ |
274 | ((err) != nfserr_bad_stateid)) | 274 | ((err) != nfserr_bad_stateid)) |
275 | 275 | ||
276 | extern int nfsd4_renew(clientid_t *clid); | 276 | extern __be32 nfsd4_renew(clientid_t *clid); |
277 | extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh, | 277 | extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh, |
278 | stateid_t *stateid, int flags, struct file **filp); | 278 | stateid_t *stateid, int flags, struct file **filp); |
279 | extern void nfs4_lock_state(void); | 279 | extern void nfs4_lock_state(void); |
280 | extern void nfs4_unlock_state(void); | 280 | extern void nfs4_unlock_state(void); |
281 | extern int nfs4_in_grace(void); | 281 | extern int nfs4_in_grace(void); |
282 | extern int nfs4_check_open_reclaim(clientid_t *clid); | 282 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
283 | extern void put_nfs4_client(struct nfs4_client *clp); | 283 | extern void put_nfs4_client(struct nfs4_client *clp); |
284 | extern void nfs4_free_stateowner(struct kref *kref); | 284 | extern void nfs4_free_stateowner(struct kref *kref); |
285 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 285 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
286 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 286 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
287 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | 287 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); |
288 | extern int nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); | 288 | extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); |
289 | extern void nfsd4_init_recdir(char *recdir_name); | 289 | extern void nfsd4_init_recdir(char *recdir_name); |
290 | extern int nfsd4_recdir_load(void); | 290 | extern int nfsd4_recdir_load(void); |
291 | extern void nfsd4_shutdown_recdir(void); | 291 | extern void nfsd4_shutdown_recdir(void); |
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h index 0e53de87d886..877192d3ae79 100644 --- a/include/linux/nfsd/xdr.h +++ b/include/linux/nfsd/xdr.h | |||
@@ -81,7 +81,7 @@ struct nfsd_readdirargs { | |||
81 | struct svc_fh fh; | 81 | struct svc_fh fh; |
82 | __u32 cookie; | 82 | __u32 cookie; |
83 | __u32 count; | 83 | __u32 count; |
84 | u32 * buffer; | 84 | __be32 * buffer; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | struct nfsd_attrstat { | 87 | struct nfsd_attrstat { |
@@ -108,9 +108,9 @@ struct nfsd_readdirres { | |||
108 | int count; | 108 | int count; |
109 | 109 | ||
110 | struct readdir_cd common; | 110 | struct readdir_cd common; |
111 | u32 * buffer; | 111 | __be32 * buffer; |
112 | int buflen; | 112 | int buflen; |
113 | u32 * offset; | 113 | __be32 * offset; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | struct nfsd_statfsres { | 116 | struct nfsd_statfsres { |
@@ -135,43 +135,43 @@ union nfsd_xdrstore { | |||
135 | #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) | 135 | #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) |
136 | 136 | ||
137 | 137 | ||
138 | int nfssvc_decode_void(struct svc_rqst *, u32 *, void *); | 138 | int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *); |
139 | int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); | 139 | int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); |
140 | int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *, | 140 | int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *, |
141 | struct nfsd_sattrargs *); | 141 | struct nfsd_sattrargs *); |
142 | int nfssvc_decode_diropargs(struct svc_rqst *, u32 *, | 142 | int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *, |
143 | struct nfsd_diropargs *); | 143 | struct nfsd_diropargs *); |
144 | int nfssvc_decode_readargs(struct svc_rqst *, u32 *, | 144 | int nfssvc_decode_readargs(struct svc_rqst *, __be32 *, |
145 | struct nfsd_readargs *); | 145 | struct nfsd_readargs *); |
146 | int nfssvc_decode_writeargs(struct svc_rqst *, u32 *, | 146 | int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *, |
147 | struct nfsd_writeargs *); | 147 | struct nfsd_writeargs *); |
148 | int nfssvc_decode_createargs(struct svc_rqst *, u32 *, | 148 | int nfssvc_decode_createargs(struct svc_rqst *, __be32 *, |
149 | struct nfsd_createargs *); | 149 | struct nfsd_createargs *); |
150 | int nfssvc_decode_renameargs(struct svc_rqst *, u32 *, | 150 | int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *, |
151 | struct nfsd_renameargs *); | 151 | struct nfsd_renameargs *); |
152 | int nfssvc_decode_readlinkargs(struct svc_rqst *, u32 *, | 152 | int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *, |
153 | struct nfsd_readlinkargs *); | 153 | struct nfsd_readlinkargs *); |
154 | int nfssvc_decode_linkargs(struct svc_rqst *, u32 *, | 154 | int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *, |
155 | struct nfsd_linkargs *); | 155 | struct nfsd_linkargs *); |
156 | int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *, | 156 | int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *, |
157 | struct nfsd_symlinkargs *); | 157 | struct nfsd_symlinkargs *); |
158 | int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *, | 158 | int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *, |
159 | struct nfsd_readdirargs *); | 159 | struct nfsd_readdirargs *); |
160 | int nfssvc_encode_void(struct svc_rqst *, u32 *, void *); | 160 | int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); |
161 | int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *); | 161 | int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); |
162 | int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *); | 162 | int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); |
163 | int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *); | 163 | int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); |
164 | int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *); | 164 | int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); |
165 | int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *); | 165 | int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); |
166 | int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *); | 166 | int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); |
167 | 167 | ||
168 | int nfssvc_encode_entry(struct readdir_cd *, const char *name, | 168 | int nfssvc_encode_entry(struct readdir_cd *, const char *name, |
169 | int namlen, loff_t offset, ino_t ino, unsigned int); | 169 | int namlen, loff_t offset, ino_t ino, unsigned int); |
170 | 170 | ||
171 | int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); | 171 | int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); |
172 | 172 | ||
173 | /* Helper functions for NFSv2 ACL code */ | 173 | /* Helper functions for NFSv2 ACL code */ |
174 | u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp); | 174 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp); |
175 | u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp); | 175 | __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp); |
176 | 176 | ||
177 | #endif /* LINUX_NFSD_H */ | 177 | #endif /* LINUX_NFSD_H */ |
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index 474d882dc2f3..79963867b0d7 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h | |||
@@ -51,7 +51,7 @@ struct nfsd3_createargs { | |||
51 | int len; | 51 | int len; |
52 | int createmode; | 52 | int createmode; |
53 | struct iattr attrs; | 53 | struct iattr attrs; |
54 | __u32 * verf; | 54 | __be32 * verf; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | struct nfsd3_mknodargs { | 57 | struct nfsd3_mknodargs { |
@@ -98,8 +98,8 @@ struct nfsd3_readdirargs { | |||
98 | __u64 cookie; | 98 | __u64 cookie; |
99 | __u32 dircount; | 99 | __u32 dircount; |
100 | __u32 count; | 100 | __u32 count; |
101 | __u32 * verf; | 101 | __be32 * verf; |
102 | u32 * buffer; | 102 | __be32 * buffer; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | struct nfsd3_commitargs { | 105 | struct nfsd3_commitargs { |
@@ -122,79 +122,79 @@ struct nfsd3_setaclargs { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | struct nfsd3_attrstat { | 124 | struct nfsd3_attrstat { |
125 | __u32 status; | 125 | __be32 status; |
126 | struct svc_fh fh; | 126 | struct svc_fh fh; |
127 | struct kstat stat; | 127 | struct kstat stat; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ | 130 | /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ |
131 | struct nfsd3_diropres { | 131 | struct nfsd3_diropres { |
132 | __u32 status; | 132 | __be32 status; |
133 | struct svc_fh dirfh; | 133 | struct svc_fh dirfh; |
134 | struct svc_fh fh; | 134 | struct svc_fh fh; |
135 | }; | 135 | }; |
136 | 136 | ||
137 | struct nfsd3_accessres { | 137 | struct nfsd3_accessres { |
138 | __u32 status; | 138 | __be32 status; |
139 | struct svc_fh fh; | 139 | struct svc_fh fh; |
140 | __u32 access; | 140 | __u32 access; |
141 | }; | 141 | }; |
142 | 142 | ||
143 | struct nfsd3_readlinkres { | 143 | struct nfsd3_readlinkres { |
144 | __u32 status; | 144 | __be32 status; |
145 | struct svc_fh fh; | 145 | struct svc_fh fh; |
146 | __u32 len; | 146 | __u32 len; |
147 | }; | 147 | }; |
148 | 148 | ||
149 | struct nfsd3_readres { | 149 | struct nfsd3_readres { |
150 | __u32 status; | 150 | __be32 status; |
151 | struct svc_fh fh; | 151 | struct svc_fh fh; |
152 | unsigned long count; | 152 | unsigned long count; |
153 | int eof; | 153 | int eof; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | struct nfsd3_writeres { | 156 | struct nfsd3_writeres { |
157 | __u32 status; | 157 | __be32 status; |
158 | struct svc_fh fh; | 158 | struct svc_fh fh; |
159 | unsigned long count; | 159 | unsigned long count; |
160 | int committed; | 160 | int committed; |
161 | }; | 161 | }; |
162 | 162 | ||
163 | struct nfsd3_renameres { | 163 | struct nfsd3_renameres { |
164 | __u32 status; | 164 | __be32 status; |
165 | struct svc_fh ffh; | 165 | struct svc_fh ffh; |
166 | struct svc_fh tfh; | 166 | struct svc_fh tfh; |
167 | }; | 167 | }; |
168 | 168 | ||
169 | struct nfsd3_linkres { | 169 | struct nfsd3_linkres { |
170 | __u32 status; | 170 | __be32 status; |
171 | struct svc_fh tfh; | 171 | struct svc_fh tfh; |
172 | struct svc_fh fh; | 172 | struct svc_fh fh; |
173 | }; | 173 | }; |
174 | 174 | ||
175 | struct nfsd3_readdirres { | 175 | struct nfsd3_readdirres { |
176 | __u32 status; | 176 | __be32 status; |
177 | struct svc_fh fh; | 177 | struct svc_fh fh; |
178 | int count; | 178 | int count; |
179 | __u32 verf[2]; | 179 | __be32 verf[2]; |
180 | 180 | ||
181 | struct readdir_cd common; | 181 | struct readdir_cd common; |
182 | u32 * buffer; | 182 | __be32 * buffer; |
183 | int buflen; | 183 | int buflen; |
184 | u32 * offset; | 184 | __be32 * offset; |
185 | u32 * offset1; | 185 | __be32 * offset1; |
186 | struct svc_rqst * rqstp; | 186 | struct svc_rqst * rqstp; |
187 | 187 | ||
188 | }; | 188 | }; |
189 | 189 | ||
190 | struct nfsd3_fsstatres { | 190 | struct nfsd3_fsstatres { |
191 | __u32 status; | 191 | __be32 status; |
192 | struct kstatfs stats; | 192 | struct kstatfs stats; |
193 | __u32 invarsec; | 193 | __u32 invarsec; |
194 | }; | 194 | }; |
195 | 195 | ||
196 | struct nfsd3_fsinfores { | 196 | struct nfsd3_fsinfores { |
197 | __u32 status; | 197 | __be32 status; |
198 | __u32 f_rtmax; | 198 | __u32 f_rtmax; |
199 | __u32 f_rtpref; | 199 | __u32 f_rtpref; |
200 | __u32 f_rtmult; | 200 | __u32 f_rtmult; |
@@ -207,7 +207,7 @@ struct nfsd3_fsinfores { | |||
207 | }; | 207 | }; |
208 | 208 | ||
209 | struct nfsd3_pathconfres { | 209 | struct nfsd3_pathconfres { |
210 | __u32 status; | 210 | __be32 status; |
211 | __u32 p_link_max; | 211 | __u32 p_link_max; |
212 | __u32 p_name_max; | 212 | __u32 p_name_max; |
213 | __u32 p_no_trunc; | 213 | __u32 p_no_trunc; |
@@ -217,12 +217,12 @@ struct nfsd3_pathconfres { | |||
217 | }; | 217 | }; |
218 | 218 | ||
219 | struct nfsd3_commitres { | 219 | struct nfsd3_commitres { |
220 | __u32 status; | 220 | __be32 status; |
221 | struct svc_fh fh; | 221 | struct svc_fh fh; |
222 | }; | 222 | }; |
223 | 223 | ||
224 | struct nfsd3_getaclres { | 224 | struct nfsd3_getaclres { |
225 | __u32 status; | 225 | __be32 status; |
226 | struct svc_fh fh; | 226 | struct svc_fh fh; |
227 | int mask; | 227 | int mask; |
228 | struct posix_acl *acl_access; | 228 | struct posix_acl *acl_access; |
@@ -266,70 +266,70 @@ union nfsd3_xdrstore { | |||
266 | 266 | ||
267 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) | 267 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) |
268 | 268 | ||
269 | int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); | 269 | int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); |
270 | int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *, | 270 | int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *, |
271 | struct nfsd3_sattrargs *); | 271 | struct nfsd3_sattrargs *); |
272 | int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *, | 272 | int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *, |
273 | struct nfsd3_diropargs *); | 273 | struct nfsd3_diropargs *); |
274 | int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *, | 274 | int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *, |
275 | struct nfsd3_accessargs *); | 275 | struct nfsd3_accessargs *); |
276 | int nfs3svc_decode_readargs(struct svc_rqst *, u32 *, | 276 | int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *, |
277 | struct nfsd3_readargs *); | 277 | struct nfsd3_readargs *); |
278 | int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *, | 278 | int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *, |
279 | struct nfsd3_writeargs *); | 279 | struct nfsd3_writeargs *); |
280 | int nfs3svc_decode_createargs(struct svc_rqst *, u32 *, | 280 | int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *, |
281 | struct nfsd3_createargs *); | 281 | struct nfsd3_createargs *); |
282 | int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *, | 282 | int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *, |
283 | struct nfsd3_createargs *); | 283 | struct nfsd3_createargs *); |
284 | int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *, | 284 | int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *, |
285 | struct nfsd3_mknodargs *); | 285 | struct nfsd3_mknodargs *); |
286 | int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *, | 286 | int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *, |
287 | struct nfsd3_renameargs *); | 287 | struct nfsd3_renameargs *); |
288 | int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *, | 288 | int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *, |
289 | struct nfsd3_readlinkargs *); | 289 | struct nfsd3_readlinkargs *); |
290 | int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *, | 290 | int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *, |
291 | struct nfsd3_linkargs *); | 291 | struct nfsd3_linkargs *); |
292 | int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *, | 292 | int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *, |
293 | struct nfsd3_symlinkargs *); | 293 | struct nfsd3_symlinkargs *); |
294 | int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *, | 294 | int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *, |
295 | struct nfsd3_readdirargs *); | 295 | struct nfsd3_readdirargs *); |
296 | int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *, | 296 | int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *, |
297 | struct nfsd3_readdirargs *); | 297 | struct nfsd3_readdirargs *); |
298 | int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *, | 298 | int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *, |
299 | struct nfsd3_commitargs *); | 299 | struct nfsd3_commitargs *); |
300 | int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *); | 300 | int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
301 | int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *, | 301 | int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, |
302 | struct nfsd3_attrstat *); | 302 | struct nfsd3_attrstat *); |
303 | int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *, | 303 | int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, |
304 | struct nfsd3_attrstat *); | 304 | struct nfsd3_attrstat *); |
305 | int nfs3svc_encode_diropres(struct svc_rqst *, u32 *, | 305 | int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *, |
306 | struct nfsd3_diropres *); | 306 | struct nfsd3_diropres *); |
307 | int nfs3svc_encode_accessres(struct svc_rqst *, u32 *, | 307 | int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *, |
308 | struct nfsd3_accessres *); | 308 | struct nfsd3_accessres *); |
309 | int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *, | 309 | int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *, |
310 | struct nfsd3_readlinkres *); | 310 | struct nfsd3_readlinkres *); |
311 | int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *); | 311 | int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *); |
312 | int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *); | 312 | int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *); |
313 | int nfs3svc_encode_createres(struct svc_rqst *, u32 *, | 313 | int nfs3svc_encode_createres(struct svc_rqst *, __be32 *, |
314 | struct nfsd3_diropres *); | 314 | struct nfsd3_diropres *); |
315 | int nfs3svc_encode_renameres(struct svc_rqst *, u32 *, | 315 | int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *, |
316 | struct nfsd3_renameres *); | 316 | struct nfsd3_renameres *); |
317 | int nfs3svc_encode_linkres(struct svc_rqst *, u32 *, | 317 | int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *, |
318 | struct nfsd3_linkres *); | 318 | struct nfsd3_linkres *); |
319 | int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *, | 319 | int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *, |
320 | struct nfsd3_readdirres *); | 320 | struct nfsd3_readdirres *); |
321 | int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *, | 321 | int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *, |
322 | struct nfsd3_fsstatres *); | 322 | struct nfsd3_fsstatres *); |
323 | int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *, | 323 | int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *, |
324 | struct nfsd3_fsinfores *); | 324 | struct nfsd3_fsinfores *); |
325 | int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *, | 325 | int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *, |
326 | struct nfsd3_pathconfres *); | 326 | struct nfsd3_pathconfres *); |
327 | int nfs3svc_encode_commitres(struct svc_rqst *, u32 *, | 327 | int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *, |
328 | struct nfsd3_commitres *); | 328 | struct nfsd3_commitres *); |
329 | 329 | ||
330 | int nfs3svc_release_fhandle(struct svc_rqst *, u32 *, | 330 | int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *, |
331 | struct nfsd3_attrstat *); | 331 | struct nfsd3_attrstat *); |
332 | int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *, | 332 | int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *, |
333 | struct nfsd3_fhandle_pair *); | 333 | struct nfsd3_fhandle_pair *); |
334 | int nfs3svc_encode_entry(struct readdir_cd *, const char *name, | 334 | int nfs3svc_encode_entry(struct readdir_cd *, const char *name, |
335 | int namlen, loff_t offset, ino_t ino, | 335 | int namlen, loff_t offset, ino_t ino, |
@@ -338,9 +338,9 @@ int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, | |||
338 | int namlen, loff_t offset, ino_t ino, | 338 | int namlen, loff_t offset, ino_t ino, |
339 | unsigned int); | 339 | unsigned int); |
340 | /* Helper functions for NFSv3 ACL code */ | 340 | /* Helper functions for NFSv3 ACL code */ |
341 | u32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, | 341 | __be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, |
342 | struct svc_fh *fhp); | 342 | struct svc_fh *fhp); |
343 | u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp); | 343 | __be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp); |
344 | 344 | ||
345 | 345 | ||
346 | #endif /* _LINUX_NFSD_XDR3_H */ | 346 | #endif /* _LINUX_NFSD_XDR3_H */ |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 66e642762a07..45ca01b5f844 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -258,9 +258,9 @@ struct nfsd4_readdir { | |||
258 | struct svc_fh * rd_fhp; /* response */ | 258 | struct svc_fh * rd_fhp; /* response */ |
259 | 259 | ||
260 | struct readdir_cd common; | 260 | struct readdir_cd common; |
261 | u32 * buffer; | 261 | __be32 * buffer; |
262 | int buflen; | 262 | int buflen; |
263 | u32 * offset; | 263 | __be32 * offset; |
264 | }; | 264 | }; |
265 | 265 | ||
266 | struct nfsd4_release_lockowner { | 266 | struct nfsd4_release_lockowner { |
@@ -334,7 +334,7 @@ struct nfsd4_write { | |||
334 | 334 | ||
335 | struct nfsd4_op { | 335 | struct nfsd4_op { |
336 | int opnum; | 336 | int opnum; |
337 | int status; | 337 | __be32 status; |
338 | union { | 338 | union { |
339 | struct nfsd4_access access; | 339 | struct nfsd4_access access; |
340 | struct nfsd4_close close; | 340 | struct nfsd4_close close; |
@@ -371,12 +371,12 @@ struct nfsd4_op { | |||
371 | 371 | ||
372 | struct nfsd4_compoundargs { | 372 | struct nfsd4_compoundargs { |
373 | /* scratch variables for XDR decode */ | 373 | /* scratch variables for XDR decode */ |
374 | u32 * p; | 374 | __be32 * p; |
375 | u32 * end; | 375 | __be32 * end; |
376 | struct page ** pagelist; | 376 | struct page ** pagelist; |
377 | int pagelen; | 377 | int pagelen; |
378 | u32 tmp[8]; | 378 | __be32 tmp[8]; |
379 | u32 * tmpp; | 379 | __be32 * tmpp; |
380 | struct tmpbuf { | 380 | struct tmpbuf { |
381 | struct tmpbuf *next; | 381 | struct tmpbuf *next; |
382 | void (*release)(const void *); | 382 | void (*release)(const void *); |
@@ -395,15 +395,15 @@ struct nfsd4_compoundargs { | |||
395 | 395 | ||
396 | struct nfsd4_compoundres { | 396 | struct nfsd4_compoundres { |
397 | /* scratch variables for XDR encode */ | 397 | /* scratch variables for XDR encode */ |
398 | u32 * p; | 398 | __be32 * p; |
399 | u32 * end; | 399 | __be32 * end; |
400 | struct xdr_buf * xbuf; | 400 | struct xdr_buf * xbuf; |
401 | struct svc_rqst * rqstp; | 401 | struct svc_rqst * rqstp; |
402 | 402 | ||
403 | u32 taglen; | 403 | u32 taglen; |
404 | char * tag; | 404 | char * tag; |
405 | u32 opcnt; | 405 | u32 opcnt; |
406 | u32 * tagp; /* where to encode tag and opcount */ | 406 | __be32 * tagp; /* where to encode tag and opcount */ |
407 | }; | 407 | }; |
408 | 408 | ||
409 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) | 409 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) |
@@ -419,45 +419,45 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | |||
419 | cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; | 419 | cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; |
420 | } | 420 | } |
421 | 421 | ||
422 | int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *); | 422 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
423 | int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *, | 423 | int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, |
424 | struct nfsd4_compoundargs *); | 424 | struct nfsd4_compoundargs *); |
425 | int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *, | 425 | int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, |
426 | struct nfsd4_compoundres *); | 426 | struct nfsd4_compoundres *); |
427 | void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); | 427 | void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); |
428 | void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); | 428 | void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); |
429 | int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, | 429 | __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, |
430 | struct dentry *dentry, u32 *buffer, int *countp, | 430 | struct dentry *dentry, __be32 *buffer, int *countp, |
431 | u32 *bmval, struct svc_rqst *); | 431 | u32 *bmval, struct svc_rqst *); |
432 | extern int nfsd4_setclientid(struct svc_rqst *rqstp, | 432 | extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, |
433 | struct nfsd4_setclientid *setclid); | 433 | struct nfsd4_setclientid *setclid); |
434 | extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | 434 | extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, |
435 | struct nfsd4_setclientid_confirm *setclientid_confirm); | 435 | struct nfsd4_setclientid_confirm *setclientid_confirm); |
436 | extern int nfsd4_process_open1(struct nfsd4_open *open); | 436 | extern __be32 nfsd4_process_open1(struct nfsd4_open *open); |
437 | extern int nfsd4_process_open2(struct svc_rqst *rqstp, | 437 | extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, |
438 | struct svc_fh *current_fh, struct nfsd4_open *open); | 438 | struct svc_fh *current_fh, struct nfsd4_open *open); |
439 | extern int nfsd4_open_confirm(struct svc_rqst *rqstp, | 439 | extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, |
440 | struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, | 440 | struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, |
441 | struct nfs4_stateowner **); | 441 | struct nfs4_stateowner **); |
442 | extern int nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, | 442 | extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, |
443 | struct nfsd4_close *close, | 443 | struct nfsd4_close *close, |
444 | struct nfs4_stateowner **replay_owner); | 444 | struct nfs4_stateowner **replay_owner); |
445 | extern int nfsd4_open_downgrade(struct svc_rqst *rqstp, | 445 | extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, |
446 | struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, | 446 | struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, |
447 | struct nfs4_stateowner **replay_owner); | 447 | struct nfs4_stateowner **replay_owner); |
448 | extern int nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, | 448 | extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, |
449 | struct nfsd4_lock *lock, | 449 | struct nfsd4_lock *lock, |
450 | struct nfs4_stateowner **replay_owner); | 450 | struct nfs4_stateowner **replay_owner); |
451 | extern int nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, | 451 | extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, |
452 | struct nfsd4_lockt *lockt); | 452 | struct nfsd4_lockt *lockt); |
453 | extern int nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, | 453 | extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, |
454 | struct nfsd4_locku *locku, | 454 | struct nfsd4_locku *locku, |
455 | struct nfs4_stateowner **replay_owner); | 455 | struct nfs4_stateowner **replay_owner); |
456 | extern int | 456 | extern __be32 |
457 | nfsd4_release_lockowner(struct svc_rqst *rqstp, | 457 | nfsd4_release_lockowner(struct svc_rqst *rqstp, |
458 | struct nfsd4_release_lockowner *rlockowner); | 458 | struct nfsd4_release_lockowner *rlockowner); |
459 | extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); | 459 | extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); |
460 | extern int nfsd4_delegreturn(struct svc_rqst *rqstp, | 460 | extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, |
461 | struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); | 461 | struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); |
462 | #endif | 462 | #endif |
463 | 463 | ||
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index f6baecdeecd6..971d1c6dfc4b 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -45,8 +45,10 @@ static inline void exit_task_namespaces(struct task_struct *p) | |||
45 | { | 45 | { |
46 | struct nsproxy *ns = p->nsproxy; | 46 | struct nsproxy *ns = p->nsproxy; |
47 | if (ns) { | 47 | if (ns) { |
48 | put_nsproxy(ns); | 48 | task_lock(p); |
49 | p->nsproxy = NULL; | 49 | p->nsproxy = NULL; |
50 | task_unlock(p); | ||
51 | put_nsproxy(ns); | ||
50 | } | 52 | } |
51 | } | 53 | } |
52 | #endif | 54 | #endif |
diff --git a/include/linux/oom.h b/include/linux/oom.h new file mode 100644 index 000000000000..ad76463629a0 --- /dev/null +++ b/include/linux/oom.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __INCLUDE_LINUX_OOM_H | ||
2 | #define __INCLUDE_LINUX_OOM_H | ||
3 | |||
4 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ | ||
5 | #define OOM_DISABLE (-17) | ||
6 | /* inclusive */ | ||
7 | #define OOM_ADJUST_MIN (-16) | ||
8 | #define OOM_ADJUST_MAX 15 | ||
9 | |||
10 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 64f950925151..c3e255bf8594 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -52,19 +52,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
52 | void release_pages(struct page **pages, int nr, int cold); | 52 | void release_pages(struct page **pages, int nr, int cold); |
53 | 53 | ||
54 | #ifdef CONFIG_NUMA | 54 | #ifdef CONFIG_NUMA |
55 | extern struct page *page_cache_alloc(struct address_space *x); | 55 | extern struct page *__page_cache_alloc(gfp_t gfp); |
56 | extern struct page *page_cache_alloc_cold(struct address_space *x); | ||
57 | #else | 56 | #else |
57 | static inline struct page *__page_cache_alloc(gfp_t gfp) | ||
58 | { | ||
59 | return alloc_pages(gfp, 0); | ||
60 | } | ||
61 | #endif | ||
62 | |||
58 | static inline struct page *page_cache_alloc(struct address_space *x) | 63 | static inline struct page *page_cache_alloc(struct address_space *x) |
59 | { | 64 | { |
60 | return alloc_pages(mapping_gfp_mask(x), 0); | 65 | return __page_cache_alloc(mapping_gfp_mask(x)); |
61 | } | 66 | } |
62 | 67 | ||
63 | static inline struct page *page_cache_alloc_cold(struct address_space *x) | 68 | static inline struct page *page_cache_alloc_cold(struct address_space *x) |
64 | { | 69 | { |
65 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 70 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); |
66 | } | 71 | } |
67 | #endif | ||
68 | 72 | ||
69 | typedef int filler_t(void *, struct page *); | 73 | typedef int filler_t(void *, struct page *); |
70 | 74 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5c604f5fad67..01c707261f9c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/list.h> | 51 | #include <linux/list.h> |
52 | #include <linux/compiler.h> | 52 | #include <linux/compiler.h> |
53 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
54 | #include <asm/atomic.h> | ||
54 | #include <linux/device.h> | 55 | #include <linux/device.h> |
55 | 56 | ||
56 | /* File state for mmap()s on /proc/bus/pci/X/Y */ | 57 | /* File state for mmap()s on /proc/bus/pci/X/Y */ |
@@ -159,7 +160,6 @@ struct pci_dev { | |||
159 | unsigned int transparent:1; /* Transparent PCI bridge */ | 160 | unsigned int transparent:1; /* Transparent PCI bridge */ |
160 | unsigned int multifunction:1;/* Part of multi-function device */ | 161 | unsigned int multifunction:1;/* Part of multi-function device */ |
161 | /* keep track of device state */ | 162 | /* keep track of device state */ |
162 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | ||
163 | unsigned int is_busmaster:1; /* device is busmaster */ | 163 | unsigned int is_busmaster:1; /* device is busmaster */ |
164 | unsigned int no_msi:1; /* device may not use msi */ | 164 | unsigned int no_msi:1; /* device may not use msi */ |
165 | unsigned int no_d1d2:1; /* only allow d0 or d3 */ | 165 | unsigned int no_d1d2:1; /* only allow d0 or d3 */ |
@@ -167,6 +167,7 @@ struct pci_dev { | |||
167 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 167 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
168 | unsigned int msi_enabled:1; | 168 | unsigned int msi_enabled:1; |
169 | unsigned int msix_enabled:1; | 169 | unsigned int msix_enabled:1; |
170 | atomic_t enable_cnt; /* pci_enable_device has been called */ | ||
170 | 171 | ||
171 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 172 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
172 | struct hlist_head saved_cap_space; | 173 | struct hlist_head saved_cap_space; |
@@ -443,6 +444,7 @@ extern void pci_remove_bus(struct pci_bus *b); | |||
443 | extern void pci_remove_bus_device(struct pci_dev *dev); | 444 | extern void pci_remove_bus_device(struct pci_dev *dev); |
444 | extern void pci_stop_bus_device(struct pci_dev *dev); | 445 | extern void pci_stop_bus_device(struct pci_dev *dev); |
445 | void pci_setup_cardbus(struct pci_bus *bus); | 446 | void pci_setup_cardbus(struct pci_bus *bus); |
447 | extern void pci_sort_breadthfirst(void); | ||
446 | 448 | ||
447 | /* Generic PCI functions exported to card drivers */ | 449 | /* Generic PCI functions exported to card drivers */ |
448 | 450 | ||
@@ -452,13 +454,18 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); | |||
452 | int pci_find_capability (struct pci_dev *dev, int cap); | 454 | int pci_find_capability (struct pci_dev *dev, int cap); |
453 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); | 455 | int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); |
454 | int pci_find_ext_capability (struct pci_dev *dev, int cap); | 456 | int pci_find_ext_capability (struct pci_dev *dev, int cap); |
455 | struct pci_bus * pci_find_next_bus(const struct pci_bus *from); | 457 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |
458 | |||
459 | struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | ||
460 | struct pci_dev *from); | ||
461 | struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device, | ||
462 | struct pci_dev *from); | ||
456 | 463 | ||
457 | struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); | ||
458 | struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, | 464 | struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, |
459 | unsigned int ss_vendor, unsigned int ss_device, | 465 | unsigned int ss_vendor, unsigned int ss_device, |
460 | struct pci_dev *from); | 466 | struct pci_dev *from); |
461 | struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn); | 467 | struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn); |
468 | struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); | ||
462 | struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); | 469 | struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); |
463 | int pci_dev_present(const struct pci_device_id *ids); | 470 | int pci_dev_present(const struct pci_device_id *ids); |
464 | 471 | ||
@@ -658,7 +665,12 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int | |||
658 | static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) | 665 | static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) |
659 | { return NULL; } | 666 | { return NULL; } |
660 | 667 | ||
661 | static inline struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from) | 668 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
669 | unsigned int device, struct pci_dev *from) | ||
670 | { return NULL; } | ||
671 | |||
672 | static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor, | ||
673 | unsigned int device, struct pci_dev *from) | ||
662 | { return NULL; } | 674 | { return NULL; } |
663 | 675 | ||
664 | static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, | 676 | static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h new file mode 100644 index 000000000000..a675a05c4091 --- /dev/null +++ b/include/linux/pci_hotplug.h | |||
@@ -0,0 +1,236 @@ | |||
1 | /* | ||
2 | * PCI HotPlug Core Functions | ||
3 | * | ||
4 | * Copyright (C) 1995,2001 Compaq Computer Corporation | ||
5 | * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) | ||
6 | * Copyright (C) 2001 IBM Corp. | ||
7 | * | ||
8 | * All rights reserved. | ||
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 (at | ||
13 | * your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but | ||
16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
18 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
19 | * details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | * Send feedback to <kristen.c.accardi@intel.com> | ||
26 | * | ||
27 | */ | ||
28 | #ifndef _PCI_HOTPLUG_H | ||
29 | #define _PCI_HOTPLUG_H | ||
30 | |||
31 | |||
32 | /* These values come from the PCI Hotplug Spec */ | ||
33 | enum pci_bus_speed { | ||
34 | PCI_SPEED_33MHz = 0x00, | ||
35 | PCI_SPEED_66MHz = 0x01, | ||
36 | PCI_SPEED_66MHz_PCIX = 0x02, | ||
37 | PCI_SPEED_100MHz_PCIX = 0x03, | ||
38 | PCI_SPEED_133MHz_PCIX = 0x04, | ||
39 | PCI_SPEED_66MHz_PCIX_ECC = 0x05, | ||
40 | PCI_SPEED_100MHz_PCIX_ECC = 0x06, | ||
41 | PCI_SPEED_133MHz_PCIX_ECC = 0x07, | ||
42 | PCI_SPEED_66MHz_PCIX_266 = 0x09, | ||
43 | PCI_SPEED_100MHz_PCIX_266 = 0x0a, | ||
44 | PCI_SPEED_133MHz_PCIX_266 = 0x0b, | ||
45 | PCI_SPEED_66MHz_PCIX_533 = 0x11, | ||
46 | PCI_SPEED_100MHz_PCIX_533 = 0x12, | ||
47 | PCI_SPEED_133MHz_PCIX_533 = 0x13, | ||
48 | PCI_SPEED_UNKNOWN = 0xff, | ||
49 | }; | ||
50 | |||
51 | /* These values come from the PCI Express Spec */ | ||
52 | enum pcie_link_width { | ||
53 | PCIE_LNK_WIDTH_RESRV = 0x00, | ||
54 | PCIE_LNK_X1 = 0x01, | ||
55 | PCIE_LNK_X2 = 0x02, | ||
56 | PCIE_LNK_X4 = 0x04, | ||
57 | PCIE_LNK_X8 = 0x08, | ||
58 | PCIE_LNK_X12 = 0x0C, | ||
59 | PCIE_LNK_X16 = 0x10, | ||
60 | PCIE_LNK_X32 = 0x20, | ||
61 | PCIE_LNK_WIDTH_UNKNOWN = 0xFF, | ||
62 | }; | ||
63 | |||
64 | enum pcie_link_speed { | ||
65 | PCIE_2PT5GB = 0x14, | ||
66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | ||
67 | }; | ||
68 | |||
69 | struct hotplug_slot; | ||
70 | struct hotplug_slot_attribute { | ||
71 | struct attribute attr; | ||
72 | ssize_t (*show)(struct hotplug_slot *, char *); | ||
73 | ssize_t (*store)(struct hotplug_slot *, const char *, size_t); | ||
74 | }; | ||
75 | #define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr); | ||
76 | |||
77 | /** | ||
78 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use | ||
79 | * @owner: The module owner of this structure | ||
80 | * @enable_slot: Called when the user wants to enable a specific pci slot | ||
81 | * @disable_slot: Called when the user wants to disable a specific pci slot | ||
82 | * @set_attention_status: Called to set the specific slot's attention LED to | ||
83 | * the specified value | ||
84 | * @hardware_test: Called to run a specified hardware test on the specified | ||
85 | * slot. | ||
86 | * @get_power_status: Called to get the current power status of a slot. | ||
87 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
88 | * will be used when this value is requested by a user. | ||
89 | * @get_attention_status: Called to get the current attention status of a slot. | ||
90 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
91 | * will be used when this value is requested by a user. | ||
92 | * @get_latch_status: Called to get the current latch status of a slot. | ||
93 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
94 | * will be used when this value is requested by a user. | ||
95 | * @get_adapter_status: Called to get see if an adapter is present in the slot or not. | ||
96 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
97 | * will be used when this value is requested by a user. | ||
98 | * @get_address: Called to get pci address of a slot. | ||
99 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
100 | * will be used when this value is requested by a user. | ||
101 | * @get_max_bus_speed: Called to get the max bus speed for a slot. | ||
102 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
103 | * will be used when this value is requested by a user. | ||
104 | * @get_cur_bus_speed: Called to get the current bus speed for a slot. | ||
105 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
106 | * will be used when this value is requested by a user. | ||
107 | * | ||
108 | * The table of function pointers that is passed to the hotplug pci core by a | ||
109 | * hotplug pci driver. These functions are called by the hotplug pci core when | ||
110 | * the user wants to do something to a specific slot (query it for information, | ||
111 | * set an LED, enable / disable power, etc.) | ||
112 | */ | ||
113 | struct hotplug_slot_ops { | ||
114 | struct module *owner; | ||
115 | int (*enable_slot) (struct hotplug_slot *slot); | ||
116 | int (*disable_slot) (struct hotplug_slot *slot); | ||
117 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); | ||
118 | int (*hardware_test) (struct hotplug_slot *slot, u32 value); | ||
119 | int (*get_power_status) (struct hotplug_slot *slot, u8 *value); | ||
120 | int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); | ||
121 | int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); | ||
122 | int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); | ||
123 | int (*get_address) (struct hotplug_slot *slot, u32 *value); | ||
124 | int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
125 | int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
126 | }; | ||
127 | |||
128 | /** | ||
129 | * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot | ||
130 | * @power: if power is enabled or not (1/0) | ||
131 | * @attention_status: if the attention light is enabled or not (1/0) | ||
132 | * @latch_status: if the latch (if any) is open or closed (1/0) | ||
133 | * @adapter_present: if there is a pci board present in the slot or not (1/0) | ||
134 | * @address: (domain << 16 | bus << 8 | dev) | ||
135 | * | ||
136 | * Used to notify the hotplug pci core of the status of a specific slot. | ||
137 | */ | ||
138 | struct hotplug_slot_info { | ||
139 | u8 power_status; | ||
140 | u8 attention_status; | ||
141 | u8 latch_status; | ||
142 | u8 adapter_status; | ||
143 | u32 address; | ||
144 | enum pci_bus_speed max_bus_speed; | ||
145 | enum pci_bus_speed cur_bus_speed; | ||
146 | }; | ||
147 | |||
148 | /** | ||
149 | * struct hotplug_slot - used to register a physical slot with the hotplug pci core | ||
150 | * @name: the name of the slot being registered. This string must | ||
151 | * be unique amoung slots registered on this system. | ||
152 | * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot | ||
153 | * @info: pointer to the &struct hotplug_slot_info for the initial values for | ||
154 | * this slot. | ||
155 | * @release: called during pci_hp_deregister to free memory allocated in a | ||
156 | * hotplug_slot structure. | ||
157 | * @private: used by the hotplug pci controller driver to store whatever it | ||
158 | * needs. | ||
159 | */ | ||
160 | struct hotplug_slot { | ||
161 | char *name; | ||
162 | struct hotplug_slot_ops *ops; | ||
163 | struct hotplug_slot_info *info; | ||
164 | void (*release) (struct hotplug_slot *slot); | ||
165 | void *private; | ||
166 | |||
167 | /* Variables below this are for use only by the hotplug pci core. */ | ||
168 | struct list_head slot_list; | ||
169 | struct kobject kobj; | ||
170 | }; | ||
171 | #define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj) | ||
172 | |||
173 | extern int pci_hp_register (struct hotplug_slot *slot); | ||
174 | extern int pci_hp_deregister (struct hotplug_slot *slot); | ||
175 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | ||
176 | struct hotplug_slot_info *info); | ||
177 | extern struct subsystem pci_hotplug_slots_subsys; | ||
178 | |||
179 | /* PCI Setting Record (Type 0) */ | ||
180 | struct hpp_type0 { | ||
181 | u32 revision; | ||
182 | u8 cache_line_size; | ||
183 | u8 latency_timer; | ||
184 | u8 enable_serr; | ||
185 | u8 enable_perr; | ||
186 | }; | ||
187 | |||
188 | /* PCI-X Setting Record (Type 1) */ | ||
189 | struct hpp_type1 { | ||
190 | u32 revision; | ||
191 | u8 max_mem_read; | ||
192 | u8 avg_max_split; | ||
193 | u16 tot_max_split; | ||
194 | }; | ||
195 | |||
196 | /* PCI Express Setting Record (Type 2) */ | ||
197 | struct hpp_type2 { | ||
198 | u32 revision; | ||
199 | u32 unc_err_mask_and; | ||
200 | u32 unc_err_mask_or; | ||
201 | u32 unc_err_sever_and; | ||
202 | u32 unc_err_sever_or; | ||
203 | u32 cor_err_mask_and; | ||
204 | u32 cor_err_mask_or; | ||
205 | u32 adv_err_cap_and; | ||
206 | u32 adv_err_cap_or; | ||
207 | u16 pci_exp_devctl_and; | ||
208 | u16 pci_exp_devctl_or; | ||
209 | u16 pci_exp_lnkctl_and; | ||
210 | u16 pci_exp_lnkctl_or; | ||
211 | u32 sec_unc_err_sever_and; | ||
212 | u32 sec_unc_err_sever_or; | ||
213 | u32 sec_unc_err_mask_and; | ||
214 | u32 sec_unc_err_mask_or; | ||
215 | }; | ||
216 | |||
217 | struct hotplug_params { | ||
218 | struct hpp_type0 *t0; /* Type0: NULL if not available */ | ||
219 | struct hpp_type1 *t1; /* Type1: NULL if not available */ | ||
220 | struct hpp_type2 *t2; /* Type2: NULL if not available */ | ||
221 | struct hpp_type0 type0_data; | ||
222 | struct hpp_type1 type1_data; | ||
223 | struct hpp_type2 type2_data; | ||
224 | }; | ||
225 | |||
226 | #ifdef CONFIG_ACPI | ||
227 | #include <acpi/acpi.h> | ||
228 | #include <acpi/acpi_bus.h> | ||
229 | #include <acpi/actypes.h> | ||
230 | extern acpi_status acpi_run_oshp(acpi_handle handle); | ||
231 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | ||
232 | struct hotplug_params *hpp); | ||
233 | int acpi_root_bridge(acpi_handle handle); | ||
234 | #endif | ||
235 | #endif | ||
236 | |||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f069df245469..c09da1e30c54 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1213,6 +1213,11 @@ | |||
1213 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | 1213 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 |
1214 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 | 1214 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 |
1215 | #define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 | 1215 | #define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 |
1216 | #define PCI_DEVICE_ID_NVIDIA_NVENET_24 0x054C | ||
1217 | #define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D | ||
1218 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E | ||
1219 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F | ||
1220 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 | ||
1216 | 1221 | ||
1217 | #define PCI_VENDOR_ID_IMS 0x10e0 | 1222 | #define PCI_VENDOR_ID_IMS 0x10e0 |
1218 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 | 1223 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 |
@@ -1892,6 +1897,7 @@ | |||
1892 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 1897 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
1893 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 1898 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
1894 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | 1899 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 |
1900 | #define PCI_DEVICE_ID_NX2_5709 0x1639 | ||
1895 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 | 1901 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 |
1896 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 | 1902 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 |
1897 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 | 1903 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 |
@@ -2210,6 +2216,13 @@ | |||
2210 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 | 2216 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 |
2211 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e | 2217 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e |
2212 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 | 2218 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 |
2219 | #define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910 | ||
2220 | #define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911 | ||
2221 | #define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912 | ||
2222 | #define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913 | ||
2223 | #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 | ||
2224 | #define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915 | ||
2225 | #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 | ||
2213 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2226 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2214 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2227 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2215 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2228 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
@@ -2351,3 +2364,5 @@ | |||
2351 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2364 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
2352 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2365 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
2353 | 2366 | ||
2367 | #define PCI_VENDOR_ID_QUICKNET 0x15E2 | ||
2368 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index c312a12ad2d6..064b1dc71c22 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -292,6 +292,12 @@ | |||
292 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ | 292 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
293 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ | 293 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ |
294 | 294 | ||
295 | /* MSI-X registers (these are at offset PCI_MSI_FLAGS) */ | ||
296 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF | ||
297 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | ||
298 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | ||
299 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) | ||
300 | |||
295 | /* CompactPCI Hotswap Register */ | 301 | /* CompactPCI Hotswap Register */ |
296 | 302 | ||
297 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ | 303 | #define PCI_CHSWP_CSR 2 /* Control and Status Register */ |
@@ -371,6 +377,7 @@ | |||
371 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ | 377 | #define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ |
372 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ | 378 | #define PCI_EXP_LNKCAP 12 /* Link Capabilities */ |
373 | #define PCI_EXP_LNKCTL 16 /* Link Control */ | 379 | #define PCI_EXP_LNKCTL 16 /* Link Control */ |
380 | #define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ | ||
374 | #define PCI_EXP_LNKSTA 18 /* Link Status */ | 381 | #define PCI_EXP_LNKSTA 18 /* Link Status */ |
375 | #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ | 382 | #define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ |
376 | #define PCI_EXP_SLTCTL 24 /* Slot Control */ | 383 | #define PCI_EXP_SLTCTL 24 /* Slot Control */ |
diff --git a/include/linux/personality.h b/include/linux/personality.h index 80d780e5a8f5..012cd558189b 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_PERSONALITY_H | 1 | #ifndef _LINUX_PERSONALITY_H |
2 | #define _LINUX_PERSONALITY_H | 2 | #define _LINUX_PERSONALITY_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
4 | /* | 6 | /* |
5 | * Handling of different ABIs (personalities). | 7 | * Handling of different ABIs (personalities). |
6 | */ | 8 | */ |
@@ -12,6 +14,8 @@ extern int register_exec_domain(struct exec_domain *); | |||
12 | extern int unregister_exec_domain(struct exec_domain *); | 14 | extern int unregister_exec_domain(struct exec_domain *); |
13 | extern int __set_personality(unsigned long); | 15 | extern int __set_personality(unsigned long); |
14 | 16 | ||
17 | #endif /* __KERNEL__ */ | ||
18 | |||
15 | /* | 19 | /* |
16 | * Flags for bug emulation. | 20 | * Flags for bug emulation. |
17 | * | 21 | * |
@@ -71,6 +75,7 @@ enum { | |||
71 | PER_MASK = 0x00ff, | 75 | PER_MASK = 0x00ff, |
72 | }; | 76 | }; |
73 | 77 | ||
78 | #ifdef __KERNEL__ | ||
74 | 79 | ||
75 | /* | 80 | /* |
76 | * Description of an execution domain. | 81 | * Description of an execution domain. |
@@ -109,6 +114,8 @@ struct exec_domain { | |||
109 | * Change personality of the currently running process. | 114 | * Change personality of the currently running process. |
110 | */ | 115 | */ |
111 | #define set_personality(pers) \ | 116 | #define set_personality(pers) \ |
112 | ((current->personality == pers) ? 0 : __set_personality(pers)) | 117 | ((current->personality == (pers)) ? 0 : __set_personality(pers)) |
118 | |||
119 | #endif /* __KERNEL__ */ | ||
113 | 120 | ||
114 | #endif /* _LINUX_PERSONALITY_H */ | 121 | #endif /* _LINUX_PERSONALITY_H */ |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index d5dd471da225..0f0b880c4280 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -32,7 +32,7 @@ struct sadb_ext { | |||
32 | struct sadb_sa { | 32 | struct sadb_sa { |
33 | uint16_t sadb_sa_len; | 33 | uint16_t sadb_sa_len; |
34 | uint16_t sadb_sa_exttype; | 34 | uint16_t sadb_sa_exttype; |
35 | uint32_t sadb_sa_spi; | 35 | __be32 sadb_sa_spi; |
36 | uint8_t sadb_sa_replay; | 36 | uint8_t sadb_sa_replay; |
37 | uint8_t sadb_sa_state; | 37 | uint8_t sadb_sa_state; |
38 | uint8_t sadb_sa_auth; | 38 | uint8_t sadb_sa_auth; |
@@ -211,7 +211,7 @@ struct sadb_x_nat_t_type { | |||
211 | struct sadb_x_nat_t_port { | 211 | struct sadb_x_nat_t_port { |
212 | uint16_t sadb_x_nat_t_port_len; | 212 | uint16_t sadb_x_nat_t_port_len; |
213 | uint16_t sadb_x_nat_t_port_exttype; | 213 | uint16_t sadb_x_nat_t_port_exttype; |
214 | uint16_t sadb_x_nat_t_port_port; | 214 | __be16 sadb_x_nat_t_port_port; |
215 | uint16_t sadb_x_nat_t_port_reserved; | 215 | uint16_t sadb_x_nat_t_port_reserved; |
216 | } __attribute__((packed)); | 216 | } __attribute__((packed)); |
217 | /* sizeof(struct sadb_x_nat_t_port) == 8 */ | 217 | /* sizeof(struct sadb_x_nat_t_port) == 8 */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 892d6abe57e5..edd4c88ca7d8 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -22,7 +22,8 @@ | |||
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/ethtool.h> | 23 | #include <linux/ethtool.h> |
24 | #include <linux/mii.h> | 24 | #include <linux/mii.h> |
25 | #include <asm/irq.h> | 25 | #include <linux/timer.h> |
26 | #include <linux/workqueue.h> | ||
26 | 27 | ||
27 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ | 28 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ |
28 | SUPPORTED_10baseT_Full | \ | 29 | SUPPORTED_10baseT_Full | \ |
@@ -46,15 +47,26 @@ | |||
46 | #define PHY_HAS_INTERRUPT 0x00000001 | 47 | #define PHY_HAS_INTERRUPT 0x00000001 |
47 | #define PHY_HAS_MAGICANEG 0x00000002 | 48 | #define PHY_HAS_MAGICANEG 0x00000002 |
48 | 49 | ||
50 | /* Interface Mode definitions */ | ||
51 | typedef enum { | ||
52 | PHY_INTERFACE_MODE_MII, | ||
53 | PHY_INTERFACE_MODE_GMII, | ||
54 | PHY_INTERFACE_MODE_SGMII, | ||
55 | PHY_INTERFACE_MODE_TBI, | ||
56 | PHY_INTERFACE_MODE_RMII, | ||
57 | PHY_INTERFACE_MODE_RGMII, | ||
58 | PHY_INTERFACE_MODE_RTBI | ||
59 | } phy_interface_t; | ||
60 | |||
49 | #define MII_BUS_MAX 4 | 61 | #define MII_BUS_MAX 4 |
50 | 62 | ||
51 | 63 | ||
52 | #define PHY_INIT_TIMEOUT 100000 | 64 | #define PHY_INIT_TIMEOUT 100000 |
53 | #define PHY_STATE_TIME 1 | 65 | #define PHY_STATE_TIME 1 |
54 | #define PHY_FORCE_TIMEOUT 10 | 66 | #define PHY_FORCE_TIMEOUT 10 |
55 | #define PHY_AN_TIMEOUT 10 | 67 | #define PHY_AN_TIMEOUT 10 |
56 | 68 | ||
57 | #define PHY_MAX_ADDR 32 | 69 | #define PHY_MAX_ADDR 32 |
58 | 70 | ||
59 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ | 71 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ |
60 | #define PHY_ID_FMT "%x:%02x" | 72 | #define PHY_ID_FMT "%x:%02x" |
@@ -86,8 +98,8 @@ struct mii_bus { | |||
86 | int *irq; | 98 | int *irq; |
87 | }; | 99 | }; |
88 | 100 | ||
89 | #define PHY_INTERRUPT_DISABLED 0x0 | 101 | #define PHY_INTERRUPT_DISABLED 0x0 |
90 | #define PHY_INTERRUPT_ENABLED 0x80000000 | 102 | #define PHY_INTERRUPT_ENABLED 0x80000000 |
91 | 103 | ||
92 | /* PHY state machine states: | 104 | /* PHY state machine states: |
93 | * | 105 | * |
@@ -229,6 +241,8 @@ struct phy_device { | |||
229 | 241 | ||
230 | u32 dev_flags; | 242 | u32 dev_flags; |
231 | 243 | ||
244 | phy_interface_t interface; | ||
245 | |||
232 | /* Bus address of the PHY (0-32) */ | 246 | /* Bus address of the PHY (0-32) */ |
233 | int addr; | 247 | int addr; |
234 | 248 | ||
@@ -344,9 +358,10 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | |||
344 | int phy_clear_interrupt(struct phy_device *phydev); | 358 | int phy_clear_interrupt(struct phy_device *phydev); |
345 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 359 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
346 | struct phy_device * phy_attach(struct net_device *dev, | 360 | struct phy_device * phy_attach(struct net_device *dev, |
347 | const char *phy_id, u32 flags); | 361 | const char *phy_id, u32 flags, phy_interface_t interface); |
348 | struct phy_device * phy_connect(struct net_device *dev, const char *phy_id, | 362 | struct phy_device * phy_connect(struct net_device *dev, const char *phy_id, |
349 | void (*handler)(struct net_device *), u32 flags); | 363 | void (*handler)(struct net_device *), u32 flags, |
364 | phy_interface_t interface); | ||
350 | void phy_disconnect(struct phy_device *phydev); | 365 | void phy_disconnect(struct phy_device *phydev); |
351 | void phy_detach(struct phy_device *phydev); | 366 | void phy_detach(struct phy_device *phydev); |
352 | void phy_start(struct phy_device *phydev); | 367 | void phy_start(struct phy_device *phydev); |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 29cd6dee13db..20f47b81d3fa 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -58,6 +58,12 @@ struct platform_driver { | |||
58 | extern int platform_driver_register(struct platform_driver *); | 58 | extern int platform_driver_register(struct platform_driver *); |
59 | extern void platform_driver_unregister(struct platform_driver *); | 59 | extern void platform_driver_unregister(struct platform_driver *); |
60 | 60 | ||
61 | /* non-hotpluggable platform devices may use this so that probe() and | ||
62 | * its support may live in __init sections, conserving runtime memory. | ||
63 | */ | ||
64 | extern int platform_driver_probe(struct platform_driver *driver, | ||
65 | int (*probe)(struct platform_device *)); | ||
66 | |||
61 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | 67 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) |
62 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | 68 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) |
63 | 69 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6b27e07aef19..070394e846d0 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -116,7 +116,9 @@ typedef int __bitwise suspend_disk_method_t; | |||
116 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2) | 116 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2) |
117 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3) | 117 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3) |
118 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4) | 118 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4) |
119 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 5) | 119 | #define PM_DISK_TEST ((__force suspend_disk_method_t) 5) |
120 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6) | ||
121 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 7) | ||
120 | 122 | ||
121 | struct pm_ops { | 123 | struct pm_ops { |
122 | suspend_disk_method_t pm_disk_mode; | 124 | suspend_disk_method_t pm_disk_mode; |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 84d887751855..ebd42a3710b4 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -146,16 +146,16 @@ enum bitmap_state { | |||
146 | 146 | ||
147 | /* the superblock at the front of the bitmap file -- little endian */ | 147 | /* the superblock at the front of the bitmap file -- little endian */ |
148 | typedef struct bitmap_super_s { | 148 | typedef struct bitmap_super_s { |
149 | __u32 magic; /* 0 BITMAP_MAGIC */ | 149 | __le32 magic; /* 0 BITMAP_MAGIC */ |
150 | __u32 version; /* 4 the bitmap major for now, could change... */ | 150 | __le32 version; /* 4 the bitmap major for now, could change... */ |
151 | __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ | 151 | __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ |
152 | __u64 events; /* 24 event counter for the bitmap (1)*/ | 152 | __le64 events; /* 24 event counter for the bitmap (1)*/ |
153 | __u64 events_cleared;/*32 event counter when last bit cleared (2) */ | 153 | __le64 events_cleared;/*32 event counter when last bit cleared (2) */ |
154 | __u64 sync_size; /* 40 the size of the md device's sync range(3) */ | 154 | __le64 sync_size; /* 40 the size of the md device's sync range(3) */ |
155 | __u32 state; /* 48 bitmap state information */ | 155 | __le32 state; /* 48 bitmap state information */ |
156 | __u32 chunksize; /* 52 the bitmap chunk size in bytes */ | 156 | __le32 chunksize; /* 52 the bitmap chunk size in bytes */ |
157 | __u32 daemon_sleep; /* 56 seconds between disk flushes */ | 157 | __le32 daemon_sleep; /* 56 seconds between disk flushes */ |
158 | __u32 write_behind; /* 60 number of outstanding write-behind writes */ | 158 | __le32 write_behind; /* 60 number of outstanding write-behind writes */ |
159 | 159 | ||
160 | __u8 pad[256 - 64]; /* set to zero */ | 160 | __u8 pad[256 - 64]; /* set to zero */ |
161 | } bitmap_super_t; | 161 | } bitmap_super_t; |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index b6ebc69bae54..3f2cd98c508b 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) { | |||
206 | */ | 206 | */ |
207 | struct mdp_superblock_1 { | 207 | struct mdp_superblock_1 { |
208 | /* constant array information - 128 bytes */ | 208 | /* constant array information - 128 bytes */ |
209 | __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ | 209 | __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ |
210 | __u32 major_version; /* 1 */ | 210 | __le32 major_version; /* 1 */ |
211 | __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ | 211 | __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ |
212 | __u32 pad0; /* always set to 0 when writing */ | 212 | __le32 pad0; /* always set to 0 when writing */ |
213 | 213 | ||
214 | __u8 set_uuid[16]; /* user-space generated. */ | 214 | __u8 set_uuid[16]; /* user-space generated. */ |
215 | char set_name[32]; /* set and interpreted by user-space */ | 215 | char set_name[32]; /* set and interpreted by user-space */ |
216 | 216 | ||
217 | __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ | 217 | __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ |
218 | __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ | 218 | __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ |
219 | __u32 layout; /* only for raid5 and raid10 currently */ | 219 | __le32 layout; /* only for raid5 and raid10 currently */ |
220 | __u64 size; /* used size of component devices, in 512byte sectors */ | 220 | __le64 size; /* used size of component devices, in 512byte sectors */ |
221 | 221 | ||
222 | __u32 chunksize; /* in 512byte sectors */ | 222 | __le32 chunksize; /* in 512byte sectors */ |
223 | __u32 raid_disks; | 223 | __le32 raid_disks; |
224 | __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts | 224 | __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts |
225 | * NOTE: signed, so bitmap can be before superblock | 225 | * NOTE: signed, so bitmap can be before superblock |
226 | * only meaningful of feature_map[0] is set. | 226 | * only meaningful of feature_map[0] is set. |
227 | */ | 227 | */ |
228 | 228 | ||
229 | /* These are only valid with feature bit '4' */ | 229 | /* These are only valid with feature bit '4' */ |
230 | __u32 new_level; /* new level we are reshaping to */ | 230 | __le32 new_level; /* new level we are reshaping to */ |
231 | __u64 reshape_position; /* next address in array-space for reshape */ | 231 | __le64 reshape_position; /* next address in array-space for reshape */ |
232 | __u32 delta_disks; /* change in number of raid_disks */ | 232 | __le32 delta_disks; /* change in number of raid_disks */ |
233 | __u32 new_layout; /* new layout */ | 233 | __le32 new_layout; /* new layout */ |
234 | __u32 new_chunk; /* new chunk size (bytes) */ | 234 | __le32 new_chunk; /* new chunk size (bytes) */ |
235 | __u8 pad1[128-124]; /* set to 0 when written */ | 235 | __u8 pad1[128-124]; /* set to 0 when written */ |
236 | 236 | ||
237 | /* constant this-device information - 64 bytes */ | 237 | /* constant this-device information - 64 bytes */ |
238 | __u64 data_offset; /* sector start of data, often 0 */ | 238 | __le64 data_offset; /* sector start of data, often 0 */ |
239 | __u64 data_size; /* sectors in this device that can be used for data */ | 239 | __le64 data_size; /* sectors in this device that can be used for data */ |
240 | __u64 super_offset; /* sector start of this superblock */ | 240 | __le64 super_offset; /* sector start of this superblock */ |
241 | __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ | 241 | __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ |
242 | __u32 dev_number; /* permanent identifier of this device - not role in raid */ | 242 | __le32 dev_number; /* permanent identifier of this device - not role in raid */ |
243 | __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ | 243 | __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ |
244 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ | 244 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ |
245 | __u8 devflags; /* per-device flags. Only one defined...*/ | 245 | __u8 devflags; /* per-device flags. Only one defined...*/ |
246 | #define WriteMostly1 1 /* mask for writemostly flag in above */ | 246 | #define WriteMostly1 1 /* mask for writemostly flag in above */ |
247 | __u8 pad2[64-57]; /* set to 0 when writing */ | 247 | __u8 pad2[64-57]; /* set to 0 when writing */ |
248 | 248 | ||
249 | /* array state information - 64 bytes */ | 249 | /* array state information - 64 bytes */ |
250 | __u64 utime; /* 40 bits second, 24 btes microseconds */ | 250 | __le64 utime; /* 40 bits second, 24 btes microseconds */ |
251 | __u64 events; /* incremented when superblock updated */ | 251 | __le64 events; /* incremented when superblock updated */ |
252 | __u64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ | 252 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ |
253 | __u32 sb_csum; /* checksum upto devs[max_dev] */ | 253 | __le32 sb_csum; /* checksum upto devs[max_dev] */ |
254 | __u32 max_dev; /* size of devs[] array to consider */ | 254 | __le32 max_dev; /* size of devs[] array to consider */ |
255 | __u8 pad3[64-32]; /* set to 0 when writing */ | 255 | __u8 pad3[64-32]; /* set to 0 when writing */ |
256 | 256 | ||
257 | /* device state information. Indexed by dev_number. | 257 | /* device state information. Indexed by dev_number. |
@@ -260,7 +260,7 @@ struct mdp_superblock_1 { | |||
260 | * into the 'roles' value. If a device is spare or faulty, then it doesn't | 260 | * into the 'roles' value. If a device is spare or faulty, then it doesn't |
261 | * have a meaningful role. | 261 | * have a meaningful role. |
262 | */ | 262 | */ |
263 | __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ | 263 | __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ |
264 | }; | 264 | }; |
265 | 265 | ||
266 | /* feature_map bits */ | 266 | /* feature_map bits */ |
diff --git a/include/linux/random.h b/include/linux/random.h index 5d6456bcdeba..01ad71033d65 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -51,16 +51,16 @@ extern void add_interrupt_randomness(int irq); | |||
51 | extern void get_random_bytes(void *buf, int nbytes); | 51 | extern void get_random_bytes(void *buf, int nbytes); |
52 | void generate_random_uuid(unsigned char uuid_out[16]); | 52 | void generate_random_uuid(unsigned char uuid_out[16]); |
53 | 53 | ||
54 | extern __u32 secure_ip_id(__u32 daddr); | 54 | extern __u32 secure_ip_id(__be32 daddr); |
55 | extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); | 55 | extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); |
56 | extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, | 56 | extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
57 | __u16 dport); | 57 | __be16 dport); |
58 | extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, | 58 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, |
59 | __u16 sport, __u16 dport); | 59 | __be16 sport, __be16 dport); |
60 | extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, | 60 | extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, |
61 | __u16 sport, __u16 dport); | 61 | __be16 sport, __be16 dport); |
62 | extern u64 secure_dccp_sequence_number(__u32 saddr, __u32 daddr, | 62 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, |
63 | __u16 sport, __u16 dport); | 63 | __be16 sport, __be16 dport); |
64 | 64 | ||
65 | #ifndef MODULE | 65 | #ifndef MODULE |
66 | extern struct file_operations random_fops, urandom_fops; | 66 | extern struct file_operations random_fops, urandom_fops; |
@@ -69,6 +69,9 @@ extern struct file_operations random_fops, urandom_fops; | |||
69 | unsigned int get_random_int(void); | 69 | unsigned int get_random_int(void); |
70 | unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); | 70 | unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); |
71 | 71 | ||
72 | u32 random32(void); | ||
73 | void srandom32(u32 seed); | ||
74 | |||
72 | #endif /* __KERNEL___ */ | 75 | #endif /* __KERNEL___ */ |
73 | 76 | ||
74 | #endif /* _LINUX_RANDOM_H */ | 77 | #endif /* _LINUX_RANDOM_H */ |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 73e0becec086..62a7169aed8b 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -429,7 +429,7 @@ enum reiserfs_mount_options { | |||
429 | /* -o hash={tea, rupasov, r5, detect} is meant for properly mounting | 429 | /* -o hash={tea, rupasov, r5, detect} is meant for properly mounting |
430 | ** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option | 430 | ** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option |
431 | ** is not required. If the normal autodection code can't determine which | 431 | ** is not required. If the normal autodection code can't determine which |
432 | ** hash to use (because both hases had the same value for a file) | 432 | ** hash to use (because both hashes had the same value for a file) |
433 | ** use this option to force a specific hash. It won't allow you to override | 433 | ** use this option to force a specific hash. It won't allow you to override |
434 | ** the existing hash on the FS, so if you have a tea hash disk, and mount | 434 | ** the existing hash on the FS, so if you have a tea hash disk, and mount |
435 | ** with -o hash=rupasov, the mount will fail. | 435 | ** with -o hash=rupasov, the mount will fail. |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3a18addaed4c..493297acdae8 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -81,8 +81,6 @@ enum { | |||
81 | 81 | ||
82 | RTM_NEWPREFIX = 52, | 82 | RTM_NEWPREFIX = 52, |
83 | #define RTM_NEWPREFIX RTM_NEWPREFIX | 83 | #define RTM_NEWPREFIX RTM_NEWPREFIX |
84 | RTM_GETPREFIX = 54, | ||
85 | #define RTM_GETPREFIX RTM_GETPREFIX | ||
86 | 84 | ||
87 | RTM_GETMULTICAST = 58, | 85 | RTM_GETMULTICAST = 58, |
88 | #define RTM_GETMULTICAST RTM_GETMULTICAST | 86 | #define RTM_GETMULTICAST RTM_GETMULTICAST |
@@ -587,6 +585,9 @@ extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | |||
587 | struct nlmsghdr *nlh, gfp_t flags); | 585 | struct nlmsghdr *nlh, gfp_t flags); |
588 | extern void rtnl_set_sk_err(u32 group, int error); | 586 | extern void rtnl_set_sk_err(u32 group, int error); |
589 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); | 587 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
588 | extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, | ||
589 | u32 id, u32 ts, u32 tsage, long expires, | ||
590 | u32 error); | ||
590 | 591 | ||
591 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); | 592 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); |
592 | 593 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6735c1cf334c..eafe4a7b8237 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -466,7 +466,6 @@ struct signal_struct { | |||
466 | struct pacct_struct pacct; /* per-process accounting information */ | 466 | struct pacct_struct pacct; /* per-process accounting information */ |
467 | #endif | 467 | #endif |
468 | #ifdef CONFIG_TASKSTATS | 468 | #ifdef CONFIG_TASKSTATS |
469 | spinlock_t stats_lock; | ||
470 | struct taskstats *stats; | 469 | struct taskstats *stats; |
471 | #endif | 470 | #endif |
472 | }; | 471 | }; |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 6ec66dec29f7..35108fe7a686 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -57,17 +57,17 @@ | |||
57 | 57 | ||
58 | /* Section 3.1. SCTP Common Header Format */ | 58 | /* Section 3.1. SCTP Common Header Format */ |
59 | typedef struct sctphdr { | 59 | typedef struct sctphdr { |
60 | __u16 source; | 60 | __be16 source; |
61 | __u16 dest; | 61 | __be16 dest; |
62 | __u32 vtag; | 62 | __be32 vtag; |
63 | __u32 checksum; | 63 | __be32 checksum; |
64 | } __attribute__((packed)) sctp_sctphdr_t; | 64 | } __attribute__((packed)) sctp_sctphdr_t; |
65 | 65 | ||
66 | /* Section 3.2. Chunk Field Descriptions. */ | 66 | /* Section 3.2. Chunk Field Descriptions. */ |
67 | typedef struct sctp_chunkhdr { | 67 | typedef struct sctp_chunkhdr { |
68 | __u8 type; | 68 | __u8 type; |
69 | __u8 flags; | 69 | __u8 flags; |
70 | __u16 length; | 70 | __be16 length; |
71 | } __attribute__((packed)) sctp_chunkhdr_t; | 71 | } __attribute__((packed)) sctp_chunkhdr_t; |
72 | 72 | ||
73 | 73 | ||
@@ -153,8 +153,8 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 }; | |||
153 | */ | 153 | */ |
154 | 154 | ||
155 | typedef struct sctp_paramhdr { | 155 | typedef struct sctp_paramhdr { |
156 | __u16 type; | 156 | __be16 type; |
157 | __u16 length; | 157 | __be16 length; |
158 | } __attribute__((packed)) sctp_paramhdr_t; | 158 | } __attribute__((packed)) sctp_paramhdr_t; |
159 | 159 | ||
160 | typedef enum { | 160 | typedef enum { |
@@ -203,10 +203,10 @@ enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), }; | |||
203 | /* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */ | 203 | /* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */ |
204 | 204 | ||
205 | typedef struct sctp_datahdr { | 205 | typedef struct sctp_datahdr { |
206 | __u32 tsn; | 206 | __be32 tsn; |
207 | __u16 stream; | 207 | __be16 stream; |
208 | __u16 ssn; | 208 | __be16 ssn; |
209 | __u32 ppid; | 209 | __be32 ppid; |
210 | __u8 payload[0]; | 210 | __u8 payload[0]; |
211 | } __attribute__((packed)) sctp_datahdr_t; | 211 | } __attribute__((packed)) sctp_datahdr_t; |
212 | 212 | ||
@@ -232,11 +232,11 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, }; | |||
232 | * endpoints. | 232 | * endpoints. |
233 | */ | 233 | */ |
234 | typedef struct sctp_inithdr { | 234 | typedef struct sctp_inithdr { |
235 | __u32 init_tag; | 235 | __be32 init_tag; |
236 | __u32 a_rwnd; | 236 | __be32 a_rwnd; |
237 | __u16 num_outbound_streams; | 237 | __be16 num_outbound_streams; |
238 | __u16 num_inbound_streams; | 238 | __be16 num_inbound_streams; |
239 | __u32 initial_tsn; | 239 | __be32 initial_tsn; |
240 | __u8 params[0]; | 240 | __u8 params[0]; |
241 | } __attribute__((packed)) sctp_inithdr_t; | 241 | } __attribute__((packed)) sctp_inithdr_t; |
242 | 242 | ||
@@ -261,7 +261,7 @@ typedef struct sctp_ipv6addr_param { | |||
261 | /* Section 3.3.2.1 Cookie Preservative (9) */ | 261 | /* Section 3.3.2.1 Cookie Preservative (9) */ |
262 | typedef struct sctp_cookie_preserve_param { | 262 | typedef struct sctp_cookie_preserve_param { |
263 | sctp_paramhdr_t param_hdr; | 263 | sctp_paramhdr_t param_hdr; |
264 | uint32_t lifespan_increment; | 264 | __be32 lifespan_increment; |
265 | } __attribute__((packed)) sctp_cookie_preserve_param_t; | 265 | } __attribute__((packed)) sctp_cookie_preserve_param_t; |
266 | 266 | ||
267 | /* Section 3.3.2.1 Host Name Address (11) */ | 267 | /* Section 3.3.2.1 Host Name Address (11) */ |
@@ -273,7 +273,7 @@ typedef struct sctp_hostname_param { | |||
273 | /* Section 3.3.2.1 Supported Address Types (12) */ | 273 | /* Section 3.3.2.1 Supported Address Types (12) */ |
274 | typedef struct sctp_supported_addrs_param { | 274 | typedef struct sctp_supported_addrs_param { |
275 | sctp_paramhdr_t param_hdr; | 275 | sctp_paramhdr_t param_hdr; |
276 | uint16_t types[0]; | 276 | __be16 types[0]; |
277 | } __attribute__((packed)) sctp_supported_addrs_param_t; | 277 | } __attribute__((packed)) sctp_supported_addrs_param_t; |
278 | 278 | ||
279 | /* Appendix A. ECN Capable (32768) */ | 279 | /* Appendix A. ECN Capable (32768) */ |
@@ -284,7 +284,7 @@ typedef struct sctp_ecn_capable_param { | |||
284 | /* ADDIP Section 3.2.6 Adaption Layer Indication */ | 284 | /* ADDIP Section 3.2.6 Adaption Layer Indication */ |
285 | typedef struct sctp_adaption_ind_param { | 285 | typedef struct sctp_adaption_ind_param { |
286 | struct sctp_paramhdr param_hdr; | 286 | struct sctp_paramhdr param_hdr; |
287 | __u32 adaption_ind; | 287 | __be32 adaption_ind; |
288 | } __attribute__((packed)) sctp_adaption_ind_param_t; | 288 | } __attribute__((packed)) sctp_adaption_ind_param_t; |
289 | 289 | ||
290 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): | 290 | /* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): |
@@ -316,11 +316,11 @@ typedef struct sctp_unrecognized_param { | |||
316 | */ | 316 | */ |
317 | 317 | ||
318 | typedef struct sctp_gap_ack_block { | 318 | typedef struct sctp_gap_ack_block { |
319 | __u16 start; | 319 | __be16 start; |
320 | __u16 end; | 320 | __be16 end; |
321 | } __attribute__((packed)) sctp_gap_ack_block_t; | 321 | } __attribute__((packed)) sctp_gap_ack_block_t; |
322 | 322 | ||
323 | typedef uint32_t sctp_dup_tsn_t; | 323 | typedef __be32 sctp_dup_tsn_t; |
324 | 324 | ||
325 | typedef union { | 325 | typedef union { |
326 | sctp_gap_ack_block_t gab; | 326 | sctp_gap_ack_block_t gab; |
@@ -328,10 +328,10 @@ typedef union { | |||
328 | } sctp_sack_variable_t; | 328 | } sctp_sack_variable_t; |
329 | 329 | ||
330 | typedef struct sctp_sackhdr { | 330 | typedef struct sctp_sackhdr { |
331 | __u32 cum_tsn_ack; | 331 | __be32 cum_tsn_ack; |
332 | __u32 a_rwnd; | 332 | __be32 a_rwnd; |
333 | __u16 num_gap_ack_blocks; | 333 | __be16 num_gap_ack_blocks; |
334 | __u16 num_dup_tsns; | 334 | __be16 num_dup_tsns; |
335 | sctp_sack_variable_t variable[0]; | 335 | sctp_sack_variable_t variable[0]; |
336 | } __attribute__((packed)) sctp_sackhdr_t; | 336 | } __attribute__((packed)) sctp_sackhdr_t; |
337 | 337 | ||
@@ -371,7 +371,7 @@ typedef struct sctp_abort_chunk { | |||
371 | * and the highest consecutive acking value. | 371 | * and the highest consecutive acking value. |
372 | */ | 372 | */ |
373 | typedef struct sctp_shutdownhdr { | 373 | typedef struct sctp_shutdownhdr { |
374 | __u32 cum_tsn_ack; | 374 | __be32 cum_tsn_ack; |
375 | } __attribute__((packed)) sctp_shutdownhdr_t; | 375 | } __attribute__((packed)) sctp_shutdownhdr_t; |
376 | 376 | ||
377 | struct sctp_shutdown_chunk_t { | 377 | struct sctp_shutdown_chunk_t { |
@@ -382,8 +382,8 @@ struct sctp_shutdown_chunk_t { | |||
382 | /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ | 382 | /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ |
383 | 383 | ||
384 | typedef struct sctp_errhdr { | 384 | typedef struct sctp_errhdr { |
385 | __u16 cause; | 385 | __be16 cause; |
386 | __u16 length; | 386 | __be16 length; |
387 | __u8 variable[0]; | 387 | __u8 variable[0]; |
388 | } __attribute__((packed)) sctp_errhdr_t; | 388 | } __attribute__((packed)) sctp_errhdr_t; |
389 | 389 | ||
@@ -462,7 +462,7 @@ typedef enum { | |||
462 | * Explicit Congestion Notification Echo (ECNE) (12) | 462 | * Explicit Congestion Notification Echo (ECNE) (12) |
463 | */ | 463 | */ |
464 | typedef struct sctp_ecnehdr { | 464 | typedef struct sctp_ecnehdr { |
465 | __u32 lowest_tsn; | 465 | __be32 lowest_tsn; |
466 | } sctp_ecnehdr_t; | 466 | } sctp_ecnehdr_t; |
467 | 467 | ||
468 | typedef struct sctp_ecne_chunk { | 468 | typedef struct sctp_ecne_chunk { |
@@ -474,7 +474,7 @@ typedef struct sctp_ecne_chunk { | |||
474 | * Congestion Window Reduced (CWR) (13) | 474 | * Congestion Window Reduced (CWR) (13) |
475 | */ | 475 | */ |
476 | typedef struct sctp_cwrhdr { | 476 | typedef struct sctp_cwrhdr { |
477 | __u32 lowest_tsn; | 477 | __be32 lowest_tsn; |
478 | } sctp_cwrhdr_t; | 478 | } sctp_cwrhdr_t; |
479 | 479 | ||
480 | typedef struct sctp_cwr_chunk { | 480 | typedef struct sctp_cwr_chunk { |
@@ -529,12 +529,12 @@ typedef struct sctp_cwr_chunk { | |||
529 | * chunks this field MUST be filled in. | 529 | * chunks this field MUST be filled in. |
530 | */ | 530 | */ |
531 | struct sctp_fwdtsn_skip { | 531 | struct sctp_fwdtsn_skip { |
532 | __u16 stream; | 532 | __be16 stream; |
533 | __u16 ssn; | 533 | __be16 ssn; |
534 | } __attribute__((packed)); | 534 | } __attribute__((packed)); |
535 | 535 | ||
536 | struct sctp_fwdtsn_hdr { | 536 | struct sctp_fwdtsn_hdr { |
537 | __u32 new_cum_tsn; | 537 | __be32 new_cum_tsn; |
538 | struct sctp_fwdtsn_skip skip[0]; | 538 | struct sctp_fwdtsn_skip skip[0]; |
539 | } __attribute((packed)); | 539 | } __attribute((packed)); |
540 | 540 | ||
@@ -578,11 +578,11 @@ struct sctp_fwdtsn_chunk { | |||
578 | */ | 578 | */ |
579 | typedef struct sctp_addip_param { | 579 | typedef struct sctp_addip_param { |
580 | sctp_paramhdr_t param_hdr; | 580 | sctp_paramhdr_t param_hdr; |
581 | __u32 crr_id; | 581 | __be32 crr_id; |
582 | } __attribute__((packed)) sctp_addip_param_t; | 582 | } __attribute__((packed)) sctp_addip_param_t; |
583 | 583 | ||
584 | typedef struct sctp_addiphdr { | 584 | typedef struct sctp_addiphdr { |
585 | __u32 serial; | 585 | __be32 serial; |
586 | __u8 params[0]; | 586 | __u8 params[0]; |
587 | } __attribute__((packed)) sctp_addiphdr_t; | 587 | } __attribute__((packed)) sctp_addiphdr_t; |
588 | 588 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index b200b9856f32..83cdefae9931 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -826,6 +826,8 @@ struct request_sock; | |||
826 | * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. | 826 | * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. |
827 | * @inet_csk_clone: | 827 | * @inet_csk_clone: |
828 | * Sets the new child socket's sid to the openreq sid. | 828 | * Sets the new child socket's sid to the openreq sid. |
829 | * @inet_conn_established: | ||
830 | * Sets the connection's peersid to the secmark on skb. | ||
829 | * @req_classify_flow: | 831 | * @req_classify_flow: |
830 | * Sets the flow's sid to the openreq sid. | 832 | * Sets the flow's sid to the openreq sid. |
831 | * | 833 | * |
@@ -836,10 +838,8 @@ struct request_sock; | |||
836 | * used by the XFRM system. | 838 | * used by the XFRM system. |
837 | * @sec_ctx contains the security context information being provided by | 839 | * @sec_ctx contains the security context information being provided by |
838 | * the user-level policy update program (e.g., setkey). | 840 | * the user-level policy update program (e.g., setkey). |
839 | * @sk refers to the sock from which to derive the security context. | ||
840 | * Allocate a security structure to the xp->security field; the security | 841 | * Allocate a security structure to the xp->security field; the security |
841 | * field is initialized to NULL when the xfrm_policy is allocated. Only | 842 | * field is initialized to NULL when the xfrm_policy is allocated. |
842 | * one of sec_ctx or sock can be specified. | ||
843 | * Return 0 if operation was successful (memory to allocate, legal context) | 843 | * Return 0 if operation was successful (memory to allocate, legal context) |
844 | * @xfrm_policy_clone_security: | 844 | * @xfrm_policy_clone_security: |
845 | * @old contains an existing xfrm_policy in the SPD. | 845 | * @old contains an existing xfrm_policy in the SPD. |
@@ -858,9 +858,6 @@ struct request_sock; | |||
858 | * Database by the XFRM system. | 858 | * Database by the XFRM system. |
859 | * @sec_ctx contains the security context information being provided by | 859 | * @sec_ctx contains the security context information being provided by |
860 | * the user-level SA generation program (e.g., setkey or racoon). | 860 | * the user-level SA generation program (e.g., setkey or racoon). |
861 | * @polsec contains the security context information associated with a xfrm | ||
862 | * policy rule from which to take the base context. polsec must be NULL | ||
863 | * when sec_ctx is specified. | ||
864 | * @secid contains the secid from which to take the mls portion of the context. | 861 | * @secid contains the secid from which to take the mls portion of the context. |
865 | * Allocate a security structure to the x->security field; the security | 862 | * Allocate a security structure to the x->security field; the security |
866 | * field is initialized to NULL when the xfrm_state is allocated. Set the | 863 | * field is initialized to NULL when the xfrm_state is allocated. Set the |
@@ -889,11 +886,6 @@ struct request_sock; | |||
889 | * @xp contains the policy to check for a match. | 886 | * @xp contains the policy to check for a match. |
890 | * @fl contains the flow to check for a match. | 887 | * @fl contains the flow to check for a match. |
891 | * Return 1 if there is a match. | 888 | * Return 1 if there is a match. |
892 | * @xfrm_flow_state_match: | ||
893 | * @fl contains the flow key to match. | ||
894 | * @xfrm points to the xfrm_state to match. | ||
895 | * @xp points to the xfrm_policy to match. | ||
896 | * Return 1 if there is a match. | ||
897 | * @xfrm_decode_session: | 889 | * @xfrm_decode_session: |
898 | * @skb points to skb to decode. | 890 | * @skb points to skb to decode. |
899 | * @secid points to the flow key secid to set. | 891 | * @secid points to the flow key secid to set. |
@@ -1373,25 +1365,24 @@ struct security_operations { | |||
1373 | int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, | 1365 | int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, |
1374 | struct request_sock *req); | 1366 | struct request_sock *req); |
1375 | void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); | 1367 | void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); |
1368 | void (*inet_conn_established)(struct sock *sk, struct sk_buff *skb); | ||
1376 | void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); | 1369 | void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); |
1377 | #endif /* CONFIG_SECURITY_NETWORK */ | 1370 | #endif /* CONFIG_SECURITY_NETWORK */ |
1378 | 1371 | ||
1379 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1372 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
1380 | int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, | 1373 | int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, |
1381 | struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk); | 1374 | struct xfrm_user_sec_ctx *sec_ctx); |
1382 | int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); | 1375 | int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); |
1383 | void (*xfrm_policy_free_security) (struct xfrm_policy *xp); | 1376 | void (*xfrm_policy_free_security) (struct xfrm_policy *xp); |
1384 | int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); | 1377 | int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); |
1385 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, | 1378 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, |
1386 | struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *polsec, | 1379 | struct xfrm_user_sec_ctx *sec_ctx, |
1387 | u32 secid); | 1380 | u32 secid); |
1388 | void (*xfrm_state_free_security) (struct xfrm_state *x); | 1381 | void (*xfrm_state_free_security) (struct xfrm_state *x); |
1389 | int (*xfrm_state_delete_security) (struct xfrm_state *x); | 1382 | int (*xfrm_state_delete_security) (struct xfrm_state *x); |
1390 | int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); | 1383 | int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); |
1391 | int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, | 1384 | int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, |
1392 | struct xfrm_policy *xp, struct flowi *fl); | 1385 | struct xfrm_policy *xp, struct flowi *fl); |
1393 | int (*xfrm_flow_state_match)(struct flowi *fl, struct xfrm_state *xfrm, | ||
1394 | struct xfrm_policy *xp); | ||
1395 | int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); | 1386 | int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); |
1396 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 1387 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
1397 | 1388 | ||
@@ -2966,9 +2957,15 @@ static inline void security_inet_csk_clone(struct sock *newsk, | |||
2966 | { | 2957 | { |
2967 | security_ops->inet_csk_clone(newsk, req); | 2958 | security_ops->inet_csk_clone(newsk, req); |
2968 | } | 2959 | } |
2960 | |||
2961 | static inline void security_inet_conn_established(struct sock *sk, | ||
2962 | struct sk_buff *skb) | ||
2963 | { | ||
2964 | security_ops->inet_conn_established(sk, skb); | ||
2965 | } | ||
2969 | #else /* CONFIG_SECURITY_NETWORK */ | 2966 | #else /* CONFIG_SECURITY_NETWORK */ |
2970 | static inline int security_unix_stream_connect(struct socket * sock, | 2967 | static inline int security_unix_stream_connect(struct socket * sock, |
2971 | struct socket * other, | 2968 | struct socket * other, |
2972 | struct sock * newsk) | 2969 | struct sock * newsk) |
2973 | { | 2970 | { |
2974 | return 0; | 2971 | return 0; |
@@ -3115,12 +3112,17 @@ static inline void security_inet_csk_clone(struct sock *newsk, | |||
3115 | const struct request_sock *req) | 3112 | const struct request_sock *req) |
3116 | { | 3113 | { |
3117 | } | 3114 | } |
3115 | |||
3116 | static inline void security_inet_conn_established(struct sock *sk, | ||
3117 | struct sk_buff *skb) | ||
3118 | { | ||
3119 | } | ||
3118 | #endif /* CONFIG_SECURITY_NETWORK */ | 3120 | #endif /* CONFIG_SECURITY_NETWORK */ |
3119 | 3121 | ||
3120 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 3122 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
3121 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | 3123 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) |
3122 | { | 3124 | { |
3123 | return security_ops->xfrm_policy_alloc_security(xp, sec_ctx, NULL); | 3125 | return security_ops->xfrm_policy_alloc_security(xp, sec_ctx); |
3124 | } | 3126 | } |
3125 | 3127 | ||
3126 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) | 3128 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) |
@@ -3141,7 +3143,7 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) | |||
3141 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, | 3143 | static inline int security_xfrm_state_alloc(struct xfrm_state *x, |
3142 | struct xfrm_user_sec_ctx *sec_ctx) | 3144 | struct xfrm_user_sec_ctx *sec_ctx) |
3143 | { | 3145 | { |
3144 | return security_ops->xfrm_state_alloc_security(x, sec_ctx, NULL, 0); | 3146 | return security_ops->xfrm_state_alloc_security(x, sec_ctx, 0); |
3145 | } | 3147 | } |
3146 | 3148 | ||
3147 | static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | 3149 | static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, |
@@ -3149,7 +3151,11 @@ static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | |||
3149 | { | 3151 | { |
3150 | if (!polsec) | 3152 | if (!polsec) |
3151 | return 0; | 3153 | return 0; |
3152 | return security_ops->xfrm_state_alloc_security(x, NULL, polsec, secid); | 3154 | /* |
3155 | * We want the context to be taken from secid which is usually | ||
3156 | * from the sock. | ||
3157 | */ | ||
3158 | return security_ops->xfrm_state_alloc_security(x, NULL, secid); | ||
3153 | } | 3159 | } |
3154 | 3160 | ||
3155 | static inline int security_xfrm_state_delete(struct xfrm_state *x) | 3161 | static inline int security_xfrm_state_delete(struct xfrm_state *x) |
@@ -3173,12 +3179,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | |||
3173 | return security_ops->xfrm_state_pol_flow_match(x, xp, fl); | 3179 | return security_ops->xfrm_state_pol_flow_match(x, xp, fl); |
3174 | } | 3180 | } |
3175 | 3181 | ||
3176 | static inline int security_xfrm_flow_state_match(struct flowi *fl, | ||
3177 | struct xfrm_state *xfrm, struct xfrm_policy *xp) | ||
3178 | { | ||
3179 | return security_ops->xfrm_flow_state_match(fl, xfrm, xp); | ||
3180 | } | ||
3181 | |||
3182 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) | 3182 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) |
3183 | { | 3183 | { |
3184 | return security_ops->xfrm_decode_session(skb, secid, 1); | 3184 | return security_ops->xfrm_decode_session(skb, secid, 1); |
@@ -3242,12 +3242,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | |||
3242 | return 1; | 3242 | return 1; |
3243 | } | 3243 | } |
3244 | 3244 | ||
3245 | static inline int security_xfrm_flow_state_match(struct flowi *fl, | ||
3246 | struct xfrm_state *xfrm, struct xfrm_policy *xp) | ||
3247 | { | ||
3248 | return 1; | ||
3249 | } | ||
3250 | |||
3251 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) | 3245 | static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) |
3252 | { | 3246 | { |
3253 | return 0; | 3247 | return 0; |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 3a697cc6ecae..b99c5ca9708d 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -41,6 +41,7 @@ struct serio { | |||
41 | void (*stop)(struct serio *); | 41 | void (*stop)(struct serio *); |
42 | 42 | ||
43 | struct serio *parent, *child; | 43 | struct serio *parent, *child; |
44 | unsigned int depth; /* level of nesting in serio hierarchy */ | ||
44 | 45 | ||
45 | struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ | 46 | struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ |
46 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ | 47 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 85577a4ffa61..14ec16d2d9ba 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -139,7 +139,7 @@ struct skb_shared_info { | |||
139 | /* Warning: this field is not always filled in (UFO)! */ | 139 | /* Warning: this field is not always filled in (UFO)! */ |
140 | unsigned short gso_segs; | 140 | unsigned short gso_segs; |
141 | unsigned short gso_type; | 141 | unsigned short gso_type; |
142 | unsigned int ip6_frag_id; | 142 | __be32 ip6_frag_id; |
143 | struct sk_buff *frag_list; | 143 | struct sk_buff *frag_list; |
144 | skb_frag_t frags[MAX_SKB_FRAGS]; | 144 | skb_frag_t frags[MAX_SKB_FRAGS]; |
145 | }; | 145 | }; |
@@ -216,7 +216,7 @@ enum { | |||
216 | * @tail: Tail pointer | 216 | * @tail: Tail pointer |
217 | * @end: End pointer | 217 | * @end: End pointer |
218 | * @destructor: Destruct function | 218 | * @destructor: Destruct function |
219 | * @nfmark: Can be used for communication between hooks | 219 | * @mark: Generic packet mark |
220 | * @nfct: Associated connection, if any | 220 | * @nfct: Associated connection, if any |
221 | * @ipvs_property: skbuff is owned by ipvs | 221 | * @ipvs_property: skbuff is owned by ipvs |
222 | * @nfctinfo: Relationship of this skb to the connection | 222 | * @nfctinfo: Relationship of this skb to the connection |
@@ -273,8 +273,11 @@ struct sk_buff { | |||
273 | 273 | ||
274 | unsigned int len, | 274 | unsigned int len, |
275 | data_len, | 275 | data_len, |
276 | mac_len, | 276 | mac_len; |
277 | csum; | 277 | union { |
278 | __wsum csum; | ||
279 | __u32 csum_offset; | ||
280 | }; | ||
278 | __u32 priority; | 281 | __u32 priority; |
279 | __u8 local_df:1, | 282 | __u8 local_df:1, |
280 | cloned:1, | 283 | cloned:1, |
@@ -295,7 +298,6 @@ struct sk_buff { | |||
295 | #ifdef CONFIG_BRIDGE_NETFILTER | 298 | #ifdef CONFIG_BRIDGE_NETFILTER |
296 | struct nf_bridge_info *nf_bridge; | 299 | struct nf_bridge_info *nf_bridge; |
297 | #endif | 300 | #endif |
298 | __u32 nfmark; | ||
299 | #endif /* CONFIG_NETFILTER */ | 301 | #endif /* CONFIG_NETFILTER */ |
300 | #ifdef CONFIG_NET_SCHED | 302 | #ifdef CONFIG_NET_SCHED |
301 | __u16 tc_index; /* traffic control index */ | 303 | __u16 tc_index; /* traffic control index */ |
@@ -310,6 +312,7 @@ struct sk_buff { | |||
310 | __u32 secmark; | 312 | __u32 secmark; |
311 | #endif | 313 | #endif |
312 | 314 | ||
315 | __u32 mark; | ||
313 | 316 | ||
314 | /* These elements must be at the end, see alloc_skb() for details. */ | 317 | /* These elements must be at the end, see alloc_skb() for details. */ |
315 | unsigned int truesize; | 318 | unsigned int truesize; |
@@ -1199,8 +1202,7 @@ static inline int skb_add_data(struct sk_buff *skb, | |||
1199 | 1202 | ||
1200 | if (skb->ip_summed == CHECKSUM_NONE) { | 1203 | if (skb->ip_summed == CHECKSUM_NONE) { |
1201 | int err = 0; | 1204 | int err = 0; |
1202 | unsigned int csum = csum_and_copy_from_user(from, | 1205 | __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy), |
1203 | skb_put(skb, copy), | ||
1204 | copy, 0, &err); | 1206 | copy, 0, &err); |
1205 | if (!err) { | 1207 | if (!err) { |
1206 | skb->csum = csum_block_add(skb->csum, csum, off); | 1208 | skb->csum = csum_block_add(skb->csum, csum, off); |
@@ -1335,15 +1337,15 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | |||
1335 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1337 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1336 | extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1338 | extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1337 | unsigned int flags); | 1339 | unsigned int flags); |
1338 | extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, | 1340 | extern __wsum skb_checksum(const struct sk_buff *skb, int offset, |
1339 | int len, unsigned int csum); | 1341 | int len, __wsum csum); |
1340 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, | 1342 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, |
1341 | void *to, int len); | 1343 | void *to, int len); |
1342 | extern int skb_store_bits(const struct sk_buff *skb, int offset, | 1344 | extern int skb_store_bits(const struct sk_buff *skb, int offset, |
1343 | void *from, int len); | 1345 | void *from, int len); |
1344 | extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, | 1346 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, |
1345 | int offset, u8 *to, int len, | 1347 | int offset, u8 *to, int len, |
1346 | unsigned int csum); | 1348 | __wsum csum); |
1347 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 1349 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
1348 | extern void skb_split(struct sk_buff *skb, | 1350 | extern void skb_split(struct sk_buff *skb, |
1349 | struct sk_buff *skb1, const u32 len); | 1351 | struct sk_buff *skb1, const u32 len); |
@@ -1399,7 +1401,7 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval * | |||
1399 | 1401 | ||
1400 | extern void __net_timestamp(struct sk_buff *skb); | 1402 | extern void __net_timestamp(struct sk_buff *skb); |
1401 | 1403 | ||
1402 | extern unsigned int __skb_checksum_complete(struct sk_buff *skb); | 1404 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
1403 | 1405 | ||
1404 | /** | 1406 | /** |
1405 | * skb_checksum_complete - Calculate checksum of an entire packet | 1407 | * skb_checksum_complete - Calculate checksum of an entire packet |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 361409094649..92cd38efad7f 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -264,6 +264,7 @@ struct ucred { | |||
264 | #define SOL_IPV6 41 | 264 | #define SOL_IPV6 41 |
265 | #define SOL_ICMPV6 58 | 265 | #define SOL_ICMPV6 58 |
266 | #define SOL_SCTP 132 | 266 | #define SOL_SCTP 132 |
267 | #define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */ | ||
267 | #define SOL_RAW 255 | 268 | #define SOL_RAW 255 |
268 | #define SOL_IPX 256 | 269 | #define SOL_IPX 256 |
269 | #define SOL_AX25 257 | 270 | #define SOL_AX25 257 |
@@ -292,7 +293,7 @@ extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, | |||
292 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | 293 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, |
293 | struct iovec *iov, | 294 | struct iovec *iov, |
294 | int offset, | 295 | int offset, |
295 | unsigned int len, int *csump); | 296 | unsigned int len, __wsum *csump); |
296 | 297 | ||
297 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); | 298 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); |
298 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 299 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
diff --git a/include/linux/sockios.h b/include/linux/sockios.h index e6b9d1d36ea2..abef7596655a 100644 --- a/include/linux/sockios.h +++ b/include/linux/sockios.h | |||
@@ -72,8 +72,8 @@ | |||
72 | #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ | 72 | #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ |
73 | #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ | 73 | #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ |
74 | 74 | ||
75 | #define SIOCGIFDIVERT 0x8944 /* Frame diversion support */ | 75 | /* SIOCGIFDIVERT was: 0x8944 Frame diversion support */ |
76 | #define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */ | 76 | /* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */ |
77 | 77 | ||
78 | #define SIOCETHTOOL 0x8946 /* Ethtool interface */ | 78 | #define SIOCETHTOOL 0x8946 /* Ethtool interface */ |
79 | 79 | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index b800d2d68b32..8451052ca66f 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -183,13 +183,27 @@ do { \ | |||
183 | #define read_lock(lock) _read_lock(lock) | 183 | #define read_lock(lock) _read_lock(lock) |
184 | 184 | ||
185 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 185 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
186 | |||
186 | #define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) | 187 | #define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) |
187 | #define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock) | 188 | #define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock) |
188 | #define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock) | 189 | #define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock) |
190 | |||
191 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
192 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
193 | flags = _spin_lock_irqsave_nested(lock, subclass) | ||
194 | #else | ||
195 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
196 | flags = _spin_lock_irqsave(lock) | ||
197 | #endif | ||
198 | |||
189 | #else | 199 | #else |
200 | |||
190 | #define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags) | 201 | #define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags) |
191 | #define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags) | 202 | #define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags) |
192 | #define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags) | 203 | #define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags) |
204 | #define spin_lock_irqsave_nested(lock, flags, subclass) \ | ||
205 | spin_lock_irqsave(lock, flags) | ||
206 | |||
193 | #endif | 207 | #endif |
194 | 208 | ||
195 | #define spin_lock_irq(lock) _spin_lock_irq(lock) | 209 | #define spin_lock_irq(lock) _spin_lock_irq(lock) |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 8828b8155e9c..8a2307ce7296 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); | |||
32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); | 32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); |
33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | 33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) |
34 | __acquires(lock); | 34 | __acquires(lock); |
35 | unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) | ||
36 | __acquires(lock); | ||
35 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 37 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) |
36 | __acquires(lock); | 38 | __acquires(lock); |
37 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 39 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 1e65f2dd80e5..606cb2165232 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -56,7 +56,9 @@ enum rpc_accept_stat { | |||
56 | RPC_PROG_MISMATCH = 2, | 56 | RPC_PROG_MISMATCH = 2, |
57 | RPC_PROC_UNAVAIL = 3, | 57 | RPC_PROC_UNAVAIL = 3, |
58 | RPC_GARBAGE_ARGS = 4, | 58 | RPC_GARBAGE_ARGS = 4, |
59 | RPC_SYSTEM_ERR = 5 | 59 | RPC_SYSTEM_ERR = 5, |
60 | /* internal use only */ | ||
61 | RPC_DROP_REPLY = 60000, | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | enum rpc_reject_stat { | 64 | enum rpc_reject_stat { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 9c9a8ad92477..965d6c20086e 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -335,7 +335,7 @@ struct svc_version { | |||
335 | /* | 335 | /* |
336 | * RPC procedure info | 336 | * RPC procedure info |
337 | */ | 337 | */ |
338 | typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp); | 338 | typedef __be32 (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp); |
339 | struct svc_procedure { | 339 | struct svc_procedure { |
340 | svc_procfunc pc_func; /* process the request */ | 340 | svc_procfunc pc_func; /* process the request */ |
341 | kxdrproc_t pc_decode; /* XDR decode args */ | 341 | kxdrproc_t pc_decode; /* XDR decode args */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 953723b09bc6..9a527c364394 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -74,6 +74,7 @@ struct xdr_buf { | |||
74 | #define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) | 74 | #define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) |
75 | #define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) | 75 | #define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) |
76 | #define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) | 76 | #define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) |
77 | #define rpc_drop_reply __constant_htonl(RPC_DROP_REPLY) | ||
77 | 78 | ||
78 | #define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) | 79 | #define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) |
79 | #define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) | 80 | #define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) |
@@ -150,7 +151,7 @@ typedef struct { | |||
150 | struct sk_buff *skb; | 151 | struct sk_buff *skb; |
151 | unsigned int offset; | 152 | unsigned int offset; |
152 | size_t count; | 153 | size_t count; |
153 | unsigned int csum; | 154 | __wsum csum; |
154 | } skb_reader_t; | 155 | } skb_reader_t; |
155 | 156 | ||
156 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); | 157 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 1b24bd45e080..94316a98e0d0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -6,10 +6,17 @@ | |||
6 | **************************************************************** | 6 | **************************************************************** |
7 | **************************************************************** | 7 | **************************************************************** |
8 | ** | 8 | ** |
9 | ** WARNING: | ||
9 | ** The values in this file are exported to user space via | 10 | ** The values in this file are exported to user space via |
10 | ** the sysctl() binary interface. However this interface | 11 | ** the sysctl() binary interface. Do *NOT* change the |
11 | ** is unstable and deprecated and will be removed in the future. | 12 | ** numbering of any existing values here, and do not change |
12 | ** For a stable interface use /proc/sys. | 13 | ** any numbers within any one set of values. If you have to |
14 | ** have to redefine an existing interface, use a new number for it. | ||
15 | ** The kernel will then return -ENOTDIR to any application using | ||
16 | ** the old binary interface. | ||
17 | ** | ||
18 | ** For new interfaces unless you really need a binary number | ||
19 | ** please use CTL_UNNUMBERED. | ||
13 | ** | 20 | ** |
14 | **************************************************************** | 21 | **************************************************************** |
15 | **************************************************************** | 22 | **************************************************************** |
@@ -48,6 +55,7 @@ struct __sysctl_args { | |||
48 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
49 | #define CTL_ANY -1 /* Matches any name */ | 56 | #define CTL_ANY -1 /* Matches any name */ |
50 | #define CTL_NONE 0 | 57 | #define CTL_NONE 0 |
58 | #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ | ||
51 | #endif | 59 | #endif |
52 | 60 | ||
53 | enum | 61 | enum |
@@ -418,6 +426,8 @@ enum | |||
418 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, | 426 | NET_CIPSOV4_CACHE_BUCKET_SIZE=119, |
419 | NET_CIPSOV4_RBM_OPTFMT=120, | 427 | NET_CIPSOV4_RBM_OPTFMT=120, |
420 | NET_CIPSOV4_RBM_STRICTVALID=121, | 428 | NET_CIPSOV4_RBM_STRICTVALID=121, |
429 | NET_TCP_AVAIL_CONG_CONTROL=122, | ||
430 | NET_TCP_ALLOWED_CONG_CONTROL=123, | ||
421 | }; | 431 | }; |
422 | 432 | ||
423 | enum { | 433 | enum { |
@@ -596,16 +606,6 @@ enum { | |||
596 | NET_DCCP_DEFAULT=1, | 606 | NET_DCCP_DEFAULT=1, |
597 | }; | 607 | }; |
598 | 608 | ||
599 | /* /proc/sys/net/dccp/default */ | ||
600 | enum { | ||
601 | NET_DCCP_DEFAULT_SEQ_WINDOW = 1, | ||
602 | NET_DCCP_DEFAULT_RX_CCID = 2, | ||
603 | NET_DCCP_DEFAULT_TX_CCID = 3, | ||
604 | NET_DCCP_DEFAULT_ACK_RATIO = 4, | ||
605 | NET_DCCP_DEFAULT_SEND_ACKVEC = 5, | ||
606 | NET_DCCP_DEFAULT_SEND_NDP = 6, | ||
607 | }; | ||
608 | |||
609 | /* /proc/sys/net/ipx */ | 609 | /* /proc/sys/net/ipx */ |
610 | enum { | 610 | enum { |
611 | NET_IPX_PPROP_BROADCASTING=1, | 611 | NET_IPX_PPROP_BROADCASTING=1, |
@@ -961,8 +961,8 @@ extern ctl_handler sysctl_ms_jiffies; | |||
961 | /* | 961 | /* |
962 | * Register a set of sysctl names by calling register_sysctl_table | 962 | * Register a set of sysctl names by calling register_sysctl_table |
963 | * with an initialised array of ctl_table's. An entry with zero | 963 | * with an initialised array of ctl_table's. An entry with zero |
964 | * ctl_name terminates the table. table->de will be set up by the | 964 | * ctl_name and NULL procname terminates the table. table->de will be |
965 | * registration and need not be initialised in advance. | 965 | * set up by the registration and need not be initialised in advance. |
966 | * | 966 | * |
967 | * sysctl names can be mirrored automatically under /proc/sys. The | 967 | * sysctl names can be mirrored automatically under /proc/sys. The |
968 | * procname supplied controls /proc naming. | 968 | * procname supplied controls /proc naming. |
@@ -973,7 +973,10 @@ extern ctl_handler sysctl_ms_jiffies; | |||
973 | * Leaf nodes in the sysctl tree will be represented by a single file | 973 | * Leaf nodes in the sysctl tree will be represented by a single file |
974 | * under /proc; non-leaf nodes will be represented by directories. A | 974 | * under /proc; non-leaf nodes will be represented by directories. A |
975 | * null procname disables /proc mirroring at this node. | 975 | * null procname disables /proc mirroring at this node. |
976 | * | 976 | * |
977 | * sysctl entries with a zero ctl_name will not be available through | ||
978 | * the binary sysctl interface. | ||
979 | * | ||
977 | * sysctl(2) can automatically manage read and write requests through | 980 | * sysctl(2) can automatically manage read and write requests through |
978 | * the sysctl table. The data and maxlen fields of the ctl_table | 981 | * the sysctl table. The data and maxlen fields of the ctl_table |
979 | * struct enable minimal validation of the values being written to be | 982 | * struct enable minimal validation of the values being written to be |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6d5c43d31dec..2129d1b6c874 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -97,6 +97,9 @@ extern int __must_check | |||
97 | sysfs_rename_dir(struct kobject *, const char *new_name); | 97 | sysfs_rename_dir(struct kobject *, const char *new_name); |
98 | 98 | ||
99 | extern int __must_check | 99 | extern int __must_check |
100 | sysfs_move_dir(struct kobject *, struct kobject *); | ||
101 | |||
102 | extern int __must_check | ||
100 | sysfs_create_file(struct kobject *, const struct attribute *); | 103 | sysfs_create_file(struct kobject *, const struct attribute *); |
101 | 104 | ||
102 | extern int __must_check | 105 | extern int __must_check |
@@ -142,6 +145,11 @@ static inline int sysfs_rename_dir(struct kobject * k, const char *new_name) | |||
142 | return 0; | 145 | return 0; |
143 | } | 146 | } |
144 | 147 | ||
148 | static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent) | ||
149 | { | ||
150 | return 0; | ||
151 | } | ||
152 | |||
145 | static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) | 153 | static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) |
146 | { | 154 | { |
147 | return 0; | 155 | return 0; |
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 16894b7edcc8..6562a2050a25 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
@@ -23,25 +23,26 @@ static inline void taskstats_exit_free(struct taskstats *tidstats) | |||
23 | 23 | ||
24 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 24 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
25 | { | 25 | { |
26 | spin_lock_init(&sig->stats_lock); | ||
27 | sig->stats = NULL; | 26 | sig->stats = NULL; |
28 | } | 27 | } |
29 | 28 | ||
30 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | 29 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) |
31 | { | 30 | { |
31 | struct signal_struct *sig = tsk->signal; | ||
32 | struct taskstats *stats; | 32 | struct taskstats *stats; |
33 | unsigned long flags; | ||
34 | 33 | ||
35 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | 34 | if (sig->stats != NULL) |
36 | if (!stats) | ||
37 | return; | 35 | return; |
38 | 36 | ||
39 | spin_lock_irqsave(&sig->stats_lock, flags); | 37 | /* No problem if kmem_cache_zalloc() fails */ |
38 | stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); | ||
39 | |||
40 | spin_lock_irq(&tsk->sighand->siglock); | ||
40 | if (!sig->stats) { | 41 | if (!sig->stats) { |
41 | sig->stats = stats; | 42 | sig->stats = stats; |
42 | stats = NULL; | 43 | stats = NULL; |
43 | } | 44 | } |
44 | spin_unlock_irqrestore(&sig->stats_lock, flags); | 45 | spin_unlock_irq(&tsk->sighand->siglock); |
45 | 46 | ||
46 | if (stats) | 47 | if (stats) |
47 | kmem_cache_free(taskstats_cache, stats); | 48 | kmem_cache_free(taskstats_cache, stats); |
@@ -49,23 +50,13 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig) | |||
49 | 50 | ||
50 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 51 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
51 | { | 52 | { |
52 | struct taskstats *stats = NULL; | 53 | if (sig->stats) |
53 | unsigned long flags; | 54 | kmem_cache_free(taskstats_cache, sig->stats); |
54 | |||
55 | spin_lock_irqsave(&sig->stats_lock, flags); | ||
56 | if (sig->stats) { | ||
57 | stats = sig->stats; | ||
58 | sig->stats = NULL; | ||
59 | } | ||
60 | spin_unlock_irqrestore(&sig->stats_lock, flags); | ||
61 | if (stats) | ||
62 | kmem_cache_free(taskstats_cache, stats); | ||
63 | } | 55 | } |
64 | 56 | ||
65 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); | 57 | extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); |
66 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); | 58 | extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); |
67 | extern void taskstats_init_early(void); | 59 | extern void taskstats_init_early(void); |
68 | extern void taskstats_tgid_alloc(struct signal_struct *); | ||
69 | #else | 60 | #else |
70 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) | 61 | static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) |
71 | {} | 62 | {} |
@@ -77,7 +68,7 @@ static inline void taskstats_exit_send(struct task_struct *tsk, | |||
77 | {} | 68 | {} |
78 | static inline void taskstats_tgid_init(struct signal_struct *sig) | 69 | static inline void taskstats_tgid_init(struct signal_struct *sig) |
79 | {} | 70 | {} |
80 | static inline void taskstats_tgid_alloc(struct signal_struct *sig) | 71 | static inline void taskstats_tgid_alloc(struct task_struct *tsk) |
81 | {} | 72 | {} |
82 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 73 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
83 | {} | 74 | {} |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 0e058a2d1c6d..3cc70d1a3504 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | #include <linux/socket.h> | ||
22 | 23 | ||
23 | struct tcphdr { | 24 | struct tcphdr { |
24 | __be16 source; | 25 | __be16 source; |
@@ -51,7 +52,7 @@ struct tcphdr { | |||
51 | #error "Adjust your <asm/byteorder.h> defines" | 52 | #error "Adjust your <asm/byteorder.h> defines" |
52 | #endif | 53 | #endif |
53 | __be16 window; | 54 | __be16 window; |
54 | __be16 check; | 55 | __sum16 check; |
55 | __be16 urg_ptr; | 56 | __be16 urg_ptr; |
56 | }; | 57 | }; |
57 | 58 | ||
@@ -94,6 +95,7 @@ enum { | |||
94 | #define TCP_INFO 11 /* Information about this connection. */ | 95 | #define TCP_INFO 11 /* Information about this connection. */ |
95 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ | 96 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ |
96 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ | 97 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ |
98 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ | ||
97 | 99 | ||
98 | #define TCPI_OPT_TIMESTAMPS 1 | 100 | #define TCPI_OPT_TIMESTAMPS 1 |
99 | #define TCPI_OPT_SACK 2 | 101 | #define TCPI_OPT_SACK 2 |
@@ -157,6 +159,17 @@ struct tcp_info | |||
157 | __u32 tcpi_total_retrans; | 159 | __u32 tcpi_total_retrans; |
158 | }; | 160 | }; |
159 | 161 | ||
162 | /* for TCP_MD5SIG socket option */ | ||
163 | #define TCP_MD5SIG_MAXKEYLEN 80 | ||
164 | |||
165 | struct tcp_md5sig { | ||
166 | struct __kernel_sockaddr_storage tcpm_addr; /* address associated */ | ||
167 | __u16 __tcpm_pad1; /* zero */ | ||
168 | __u16 tcpm_keylen; /* key length */ | ||
169 | __u32 __tcpm_pad2; /* zero */ | ||
170 | __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ | ||
171 | }; | ||
172 | |||
160 | #ifdef __KERNEL__ | 173 | #ifdef __KERNEL__ |
161 | 174 | ||
162 | #include <linux/skbuff.h> | 175 | #include <linux/skbuff.h> |
@@ -172,17 +185,17 @@ struct tcp_sack_block_wire { | |||
172 | }; | 185 | }; |
173 | 186 | ||
174 | struct tcp_sack_block { | 187 | struct tcp_sack_block { |
175 | __u32 start_seq; | 188 | u32 start_seq; |
176 | __u32 end_seq; | 189 | u32 end_seq; |
177 | }; | 190 | }; |
178 | 191 | ||
179 | struct tcp_options_received { | 192 | struct tcp_options_received { |
180 | /* PAWS/RTTM data */ | 193 | /* PAWS/RTTM data */ |
181 | long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ | 194 | long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ |
182 | __u32 ts_recent; /* Time stamp to echo next */ | 195 | u32 ts_recent; /* Time stamp to echo next */ |
183 | __u32 rcv_tsval; /* Time stamp value */ | 196 | u32 rcv_tsval; /* Time stamp value */ |
184 | __u32 rcv_tsecr; /* Time stamp echo reply */ | 197 | u32 rcv_tsecr; /* Time stamp echo reply */ |
185 | __u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */ | 198 | u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */ |
186 | tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */ | 199 | tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */ |
187 | dsack : 1, /* D-SACK is scheduled */ | 200 | dsack : 1, /* D-SACK is scheduled */ |
188 | wscale_ok : 1, /* Wscale seen on SYN packet */ | 201 | wscale_ok : 1, /* Wscale seen on SYN packet */ |
@@ -190,16 +203,20 @@ struct tcp_options_received { | |||
190 | snd_wscale : 4, /* Window scaling received from sender */ | 203 | snd_wscale : 4, /* Window scaling received from sender */ |
191 | rcv_wscale : 4; /* Window scaling to send to receiver */ | 204 | rcv_wscale : 4; /* Window scaling to send to receiver */ |
192 | /* SACKs data */ | 205 | /* SACKs data */ |
193 | __u8 eff_sacks; /* Size of SACK array to send with next packet */ | 206 | u8 eff_sacks; /* Size of SACK array to send with next packet */ |
194 | __u8 num_sacks; /* Number of SACK blocks */ | 207 | u8 num_sacks; /* Number of SACK blocks */ |
195 | __u16 user_mss; /* mss requested by user in ioctl */ | 208 | u16 user_mss; /* mss requested by user in ioctl */ |
196 | __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ | 209 | u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ |
197 | }; | 210 | }; |
198 | 211 | ||
199 | struct tcp_request_sock { | 212 | struct tcp_request_sock { |
200 | struct inet_request_sock req; | 213 | struct inet_request_sock req; |
201 | __u32 rcv_isn; | 214 | #ifdef CONFIG_TCP_MD5SIG |
202 | __u32 snt_isn; | 215 | /* Only used by TCP MD5 Signature so far. */ |
216 | struct tcp_request_sock_ops *af_specific; | ||
217 | #endif | ||
218 | u32 rcv_isn; | ||
219 | u32 snt_isn; | ||
203 | }; | 220 | }; |
204 | 221 | ||
205 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | 222 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) |
@@ -210,7 +227,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | |||
210 | struct tcp_sock { | 227 | struct tcp_sock { |
211 | /* inet_connection_sock has to be the first member of tcp_sock */ | 228 | /* inet_connection_sock has to be the first member of tcp_sock */ |
212 | struct inet_connection_sock inet_conn; | 229 | struct inet_connection_sock inet_conn; |
213 | int tcp_header_len; /* Bytes of tcp header to send */ | 230 | u16 tcp_header_len; /* Bytes of tcp header to send */ |
231 | u16 xmit_size_goal; /* Goal for segmenting output packets */ | ||
214 | 232 | ||
215 | /* | 233 | /* |
216 | * Header prediction flags | 234 | * Header prediction flags |
@@ -223,13 +241,13 @@ struct tcp_sock { | |||
223 | * read the code and the spec side by side (and laugh ...) | 241 | * read the code and the spec side by side (and laugh ...) |
224 | * See RFC793 and RFC1122. The RFC writes these in capitals. | 242 | * See RFC793 and RFC1122. The RFC writes these in capitals. |
225 | */ | 243 | */ |
226 | __u32 rcv_nxt; /* What we want to receive next */ | 244 | u32 rcv_nxt; /* What we want to receive next */ |
227 | __u32 snd_nxt; /* Next sequence we send */ | 245 | u32 snd_nxt; /* Next sequence we send */ |
228 | 246 | ||
229 | __u32 snd_una; /* First byte we want an ack for */ | 247 | u32 snd_una; /* First byte we want an ack for */ |
230 | __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ | 248 | u32 snd_sml; /* Last byte of the most recently transmitted small packet */ |
231 | __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 249 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
232 | __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 250 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
233 | 251 | ||
234 | /* Data for direct copy to user */ | 252 | /* Data for direct copy to user */ |
235 | struct { | 253 | struct { |
@@ -247,32 +265,30 @@ struct tcp_sock { | |||
247 | #endif | 265 | #endif |
248 | } ucopy; | 266 | } ucopy; |
249 | 267 | ||
250 | __u32 snd_wl1; /* Sequence for window update */ | 268 | u32 snd_wl1; /* Sequence for window update */ |
251 | __u32 snd_wnd; /* The window we expect to receive */ | 269 | u32 snd_wnd; /* The window we expect to receive */ |
252 | __u32 max_window; /* Maximal window ever seen from peer */ | 270 | u32 max_window; /* Maximal window ever seen from peer */ |
253 | __u32 mss_cache; /* Cached effective mss, not including SACKS */ | 271 | u32 mss_cache; /* Cached effective mss, not including SACKS */ |
254 | __u16 xmit_size_goal; /* Goal for segmenting output packets */ | ||
255 | /* XXX Two bytes hole, try to pack */ | ||
256 | 272 | ||
257 | __u32 window_clamp; /* Maximal window to advertise */ | 273 | u32 window_clamp; /* Maximal window to advertise */ |
258 | __u32 rcv_ssthresh; /* Current window clamp */ | 274 | u32 rcv_ssthresh; /* Current window clamp */ |
259 | 275 | ||
260 | __u32 frto_highmark; /* snd_nxt when RTO occurred */ | 276 | u32 frto_highmark; /* snd_nxt when RTO occurred */ |
261 | __u8 reordering; /* Packet reordering metric. */ | 277 | u8 reordering; /* Packet reordering metric. */ |
262 | __u8 frto_counter; /* Number of new acks after RTO */ | 278 | u8 frto_counter; /* Number of new acks after RTO */ |
263 | __u8 nonagle; /* Disable Nagle algorithm? */ | 279 | u8 nonagle; /* Disable Nagle algorithm? */ |
264 | __u8 keepalive_probes; /* num of allowed keep alive probes */ | 280 | u8 keepalive_probes; /* num of allowed keep alive probes */ |
265 | 281 | ||
266 | /* RTT measurement */ | 282 | /* RTT measurement */ |
267 | __u32 srtt; /* smoothed round trip time << 3 */ | 283 | u32 srtt; /* smoothed round trip time << 3 */ |
268 | __u32 mdev; /* medium deviation */ | 284 | u32 mdev; /* medium deviation */ |
269 | __u32 mdev_max; /* maximal mdev for the last rtt period */ | 285 | u32 mdev_max; /* maximal mdev for the last rtt period */ |
270 | __u32 rttvar; /* smoothed mdev_max */ | 286 | u32 rttvar; /* smoothed mdev_max */ |
271 | __u32 rtt_seq; /* sequence number to update rttvar */ | 287 | u32 rtt_seq; /* sequence number to update rttvar */ |
272 | 288 | ||
273 | __u32 packets_out; /* Packets which are "in flight" */ | 289 | u32 packets_out; /* Packets which are "in flight" */ |
274 | __u32 left_out; /* Packets which leaved network */ | 290 | u32 left_out; /* Packets which leaved network */ |
275 | __u32 retrans_out; /* Retransmitted packets out */ | 291 | u32 retrans_out; /* Retransmitted packets out */ |
276 | /* | 292 | /* |
277 | * Options received (usually on last packet, some only on SYN packets). | 293 | * Options received (usually on last packet, some only on SYN packets). |
278 | */ | 294 | */ |
@@ -281,20 +297,20 @@ struct tcp_sock { | |||
281 | /* | 297 | /* |
282 | * Slow start and congestion control (see also Nagle, and Karn & Partridge) | 298 | * Slow start and congestion control (see also Nagle, and Karn & Partridge) |
283 | */ | 299 | */ |
284 | __u32 snd_ssthresh; /* Slow start size threshold */ | 300 | u32 snd_ssthresh; /* Slow start size threshold */ |
285 | __u32 snd_cwnd; /* Sending congestion window */ | 301 | u32 snd_cwnd; /* Sending congestion window */ |
286 | __u16 snd_cwnd_cnt; /* Linear increase counter */ | 302 | u16 snd_cwnd_cnt; /* Linear increase counter */ |
287 | __u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ | 303 | u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ |
288 | __u32 snd_cwnd_used; | 304 | u32 snd_cwnd_used; |
289 | __u32 snd_cwnd_stamp; | 305 | u32 snd_cwnd_stamp; |
290 | 306 | ||
291 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 307 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
292 | 308 | ||
293 | __u32 rcv_wnd; /* Current receiver window */ | 309 | u32 rcv_wnd; /* Current receiver window */ |
294 | __u32 rcv_wup; /* rcv_nxt on last window update sent */ | 310 | u32 rcv_wup; /* rcv_nxt on last window update sent */ |
295 | __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ | 311 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ |
296 | __u32 pushed_seq; /* Last pushed seq, required to talk to windows */ | 312 | u32 pushed_seq; /* Last pushed seq, required to talk to windows */ |
297 | __u32 copied_seq; /* Head of yet unread data */ | 313 | u32 copied_seq; /* Head of yet unread data */ |
298 | 314 | ||
299 | /* SACKs data */ | 315 | /* SACKs data */ |
300 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 316 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
@@ -315,26 +331,26 @@ struct tcp_sock { | |||
315 | int retransmit_cnt_hint; | 331 | int retransmit_cnt_hint; |
316 | int forward_cnt_hint; | 332 | int forward_cnt_hint; |
317 | 333 | ||
318 | __u16 advmss; /* Advertised MSS */ | 334 | u16 advmss; /* Advertised MSS */ |
319 | __u16 prior_ssthresh; /* ssthresh saved at recovery start */ | 335 | u16 prior_ssthresh; /* ssthresh saved at recovery start */ |
320 | __u32 lost_out; /* Lost packets */ | 336 | u32 lost_out; /* Lost packets */ |
321 | __u32 sacked_out; /* SACK'd packets */ | 337 | u32 sacked_out; /* SACK'd packets */ |
322 | __u32 fackets_out; /* FACK'd packets */ | 338 | u32 fackets_out; /* FACK'd packets */ |
323 | __u32 high_seq; /* snd_nxt at onset of congestion */ | 339 | u32 high_seq; /* snd_nxt at onset of congestion */ |
324 | 340 | ||
325 | __u32 retrans_stamp; /* Timestamp of the last retransmit, | 341 | u32 retrans_stamp; /* Timestamp of the last retransmit, |
326 | * also used in SYN-SENT to remember stamp of | 342 | * also used in SYN-SENT to remember stamp of |
327 | * the first SYN. */ | 343 | * the first SYN. */ |
328 | __u32 undo_marker; /* tracking retrans started here. */ | 344 | u32 undo_marker; /* tracking retrans started here. */ |
329 | int undo_retrans; /* number of undoable retransmissions. */ | 345 | int undo_retrans; /* number of undoable retransmissions. */ |
330 | __u32 urg_seq; /* Seq of received urgent pointer */ | 346 | u32 urg_seq; /* Seq of received urgent pointer */ |
331 | __u16 urg_data; /* Saved octet of OOB data and control flags */ | 347 | u16 urg_data; /* Saved octet of OOB data and control flags */ |
332 | __u8 urg_mode; /* In urgent mode */ | 348 | u8 urg_mode; /* In urgent mode */ |
333 | __u8 ecn_flags; /* ECN status bits. */ | 349 | u8 ecn_flags; /* ECN status bits. */ |
334 | __u32 snd_up; /* Urgent pointer */ | 350 | u32 snd_up; /* Urgent pointer */ |
335 | 351 | ||
336 | __u32 total_retrans; /* Total retransmits for entire connection */ | 352 | u32 total_retrans; /* Total retransmits for entire connection */ |
337 | __u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ | 353 | u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ |
338 | 354 | ||
339 | unsigned int keepalive_time; /* time before keep alive takes place */ | 355 | unsigned int keepalive_time; /* time before keep alive takes place */ |
340 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 356 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
@@ -342,25 +358,35 @@ struct tcp_sock { | |||
342 | 358 | ||
343 | unsigned long last_synq_overflow; | 359 | unsigned long last_synq_overflow; |
344 | 360 | ||
361 | u32 tso_deferred; | ||
362 | |||
345 | /* Receiver side RTT estimation */ | 363 | /* Receiver side RTT estimation */ |
346 | struct { | 364 | struct { |
347 | __u32 rtt; | 365 | u32 rtt; |
348 | __u32 seq; | 366 | u32 seq; |
349 | __u32 time; | 367 | u32 time; |
350 | } rcv_rtt_est; | 368 | } rcv_rtt_est; |
351 | 369 | ||
352 | /* Receiver queue space */ | 370 | /* Receiver queue space */ |
353 | struct { | 371 | struct { |
354 | int space; | 372 | int space; |
355 | __u32 seq; | 373 | u32 seq; |
356 | __u32 time; | 374 | u32 time; |
357 | } rcvq_space; | 375 | } rcvq_space; |
358 | 376 | ||
359 | /* TCP-specific MTU probe information. */ | 377 | /* TCP-specific MTU probe information. */ |
360 | struct { | 378 | struct { |
361 | __u32 probe_seq_start; | 379 | u32 probe_seq_start; |
362 | __u32 probe_seq_end; | 380 | u32 probe_seq_end; |
363 | } mtu_probe; | 381 | } mtu_probe; |
382 | |||
383 | #ifdef CONFIG_TCP_MD5SIG | ||
384 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ | ||
385 | struct tcp_sock_af_ops *af_specific; | ||
386 | |||
387 | /* TCP MD5 Signagure Option information */ | ||
388 | struct tcp_md5sig_info *md5sig_info; | ||
389 | #endif | ||
364 | }; | 390 | }; |
365 | 391 | ||
366 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 392 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
@@ -370,11 +396,15 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk) | |||
370 | 396 | ||
371 | struct tcp_timewait_sock { | 397 | struct tcp_timewait_sock { |
372 | struct inet_timewait_sock tw_sk; | 398 | struct inet_timewait_sock tw_sk; |
373 | __u32 tw_rcv_nxt; | 399 | u32 tw_rcv_nxt; |
374 | __u32 tw_snd_nxt; | 400 | u32 tw_snd_nxt; |
375 | __u32 tw_rcv_wnd; | 401 | u32 tw_rcv_wnd; |
376 | __u32 tw_ts_recent; | 402 | u32 tw_ts_recent; |
377 | long tw_ts_recent_stamp; | 403 | long tw_ts_recent_stamp; |
404 | #ifdef CONFIG_TCP_MD5SIG | ||
405 | u16 tw_md5_keylen; | ||
406 | u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN]; | ||
407 | #endif | ||
378 | }; | 408 | }; |
379 | 409 | ||
380 | static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | 410 | static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 7dac8f04d28e..004808a6df1d 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -20,7 +20,7 @@ struct ts_config; | |||
20 | /** | 20 | /** |
21 | * struct ts_state - search state | 21 | * struct ts_state - search state |
22 | * @offset: offset for next match | 22 | * @offset: offset for next match |
23 | * @cb: control buffer, for persistant variables of get_next_block() | 23 | * @cb: control buffer, for persistent variables of get_next_block() |
24 | */ | 24 | */ |
25 | struct ts_state | 25 | struct ts_state |
26 | { | 26 | { |
@@ -71,7 +71,7 @@ struct ts_config | |||
71 | * Called repeatedly until 0 is returned. Must assign the | 71 | * Called repeatedly until 0 is returned. Must assign the |
72 | * head of the next block of data to &*dst and return the length | 72 | * head of the next block of data to &*dst and return the length |
73 | * of the block or 0 if at the end. consumed == 0 indicates | 73 | * of the block or 0 if at the end. consumed == 0 indicates |
74 | * a new search. May store/read persistant values in state->cb. | 74 | * a new search. May store/read persistent values in state->cb. |
75 | */ | 75 | */ |
76 | unsigned int (*get_next_block)(unsigned int consumed, | 76 | unsigned int (*get_next_block)(unsigned int consumed, |
77 | const u8 **dst, | 77 | const u8 **dst, |
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h index 7dab7831c3cb..31a9b25276fe 100644 --- a/include/linux/tfrc.h +++ b/include/linux/tfrc.h | |||
@@ -1,7 +1,8 @@ | |||
1 | #ifndef _LINUX_TFRC_H_ | 1 | #ifndef _LINUX_TFRC_H_ |
2 | #define _LINUX_TFRC_H_ | 2 | #define _LINUX_TFRC_H_ |
3 | /* | 3 | /* |
4 | * include/linux/tfrc.h | 4 | * TFRC - Data Structures for the TCP-Friendly Rate Control congestion |
5 | * control mechanism as specified in RFC 3448. | ||
5 | * | 6 | * |
6 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. | 7 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. |
7 | * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> | 8 | * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> |
@@ -13,15 +14,30 @@ | |||
13 | * the Free Software Foundation; either version 2 of the License, or | 14 | * the Free Software Foundation; either version 2 of the License, or |
14 | * (at your option) any later version. | 15 | * (at your option) any later version. |
15 | */ | 16 | */ |
16 | |||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | /** tfrc_rx_info - TFRC Receiver Data Structure | ||
20 | * | ||
21 | * @tfrcrx_x_recv: receiver estimate of sending rate (3.2.2) | ||
22 | * @tfrcrx_rtt: round-trip-time (communicated by sender) | ||
23 | * @tfrcrx_p: current estimate of loss event rate (3.2.2) | ||
24 | */ | ||
19 | struct tfrc_rx_info { | 25 | struct tfrc_rx_info { |
20 | __u32 tfrcrx_x_recv; | 26 | __u32 tfrcrx_x_recv; |
21 | __u32 tfrcrx_rtt; | 27 | __u32 tfrcrx_rtt; |
22 | __u32 tfrcrx_p; | 28 | __u32 tfrcrx_p; |
23 | }; | 29 | }; |
24 | 30 | ||
31 | /** tfrc_tx_info - TFRC Sender Data Structure | ||
32 | * | ||
33 | * @tfrctx_x: computed transmit rate (4.3 (4)) | ||
34 | * @tfrctx_x_recv: receiver estimate of send rate (4.3) | ||
35 | * @tfrctx_x_calc: return value of throughput equation (3.1) | ||
36 | * @tfrctx_rtt: (moving average) estimate of RTT (4.3) | ||
37 | * @tfrctx_p: current loss event rate (5.4) | ||
38 | * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3) | ||
39 | * @tfrctx_ipi: inter-packet interval (4.6) | ||
40 | */ | ||
25 | struct tfrc_tx_info { | 41 | struct tfrc_tx_info { |
26 | __u32 tfrctx_x; | 42 | __u32 tfrctx_x; |
27 | __u32 tfrctx_x_recv; | 43 | __u32 tfrctx_x_recv; |
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index 243a15f54002..bea469455a0c 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
@@ -129,6 +129,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
129 | 129 | ||
130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ | 130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ |
131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ | 131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ |
132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ | ||
132 | #if 0 | 133 | #if 0 |
133 | /* The following filter options are not currently implemented */ | 134 | /* The following filter options are not currently implemented */ |
134 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ | 135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 33a653913d94..b0c916d1f375 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
@@ -194,34 +194,34 @@ | |||
194 | 194 | ||
195 | 195 | ||
196 | struct tipc_node_info { | 196 | struct tipc_node_info { |
197 | __u32 addr; /* network address of node */ | 197 | __be32 addr; /* network address of node */ |
198 | __u32 up; /* 0=down, 1= up */ | 198 | __be32 up; /* 0=down, 1= up */ |
199 | }; | 199 | }; |
200 | 200 | ||
201 | struct tipc_link_info { | 201 | struct tipc_link_info { |
202 | __u32 dest; /* network address of peer node */ | 202 | __be32 dest; /* network address of peer node */ |
203 | __u32 up; /* 0=down, 1=up */ | 203 | __be32 up; /* 0=down, 1=up */ |
204 | char str[TIPC_MAX_LINK_NAME]; /* link name */ | 204 | char str[TIPC_MAX_LINK_NAME]; /* link name */ |
205 | }; | 205 | }; |
206 | 206 | ||
207 | struct tipc_bearer_config { | 207 | struct tipc_bearer_config { |
208 | __u32 priority; /* Range [1,31]. Override per link */ | 208 | __be32 priority; /* Range [1,31]. Override per link */ |
209 | __u32 detect_scope; | 209 | __be32 detect_scope; |
210 | char name[TIPC_MAX_BEARER_NAME]; | 210 | char name[TIPC_MAX_BEARER_NAME]; |
211 | }; | 211 | }; |
212 | 212 | ||
213 | struct tipc_link_config { | 213 | struct tipc_link_config { |
214 | __u32 value; | 214 | __be32 value; |
215 | char name[TIPC_MAX_LINK_NAME]; | 215 | char name[TIPC_MAX_LINK_NAME]; |
216 | }; | 216 | }; |
217 | 217 | ||
218 | #define TIPC_NTQ_ALLTYPES 0x80000000 | 218 | #define TIPC_NTQ_ALLTYPES 0x80000000 |
219 | 219 | ||
220 | struct tipc_name_table_query { | 220 | struct tipc_name_table_query { |
221 | __u32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */ | 221 | __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */ |
222 | __u32 type; /* {t,l,u} info ignored if high bit of "depth" is set */ | 222 | __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */ |
223 | __u32 lowbound; /* (i.e. displays all entries of name table) */ | 223 | __be32 lowbound; /* (i.e. displays all entries of name table) */ |
224 | __u32 upbound; | 224 | __be32 upbound; |
225 | }; | 225 | }; |
226 | 226 | ||
227 | /* | 227 | /* |
@@ -262,8 +262,8 @@ struct tipc_route_info { | |||
262 | */ | 262 | */ |
263 | 263 | ||
264 | struct tlv_desc { | 264 | struct tlv_desc { |
265 | __u16 tlv_len; /* TLV length (descriptor + value) */ | 265 | __be16 tlv_len; /* TLV length (descriptor + value) */ |
266 | __u16 tlv_type; /* TLV identifier */ | 266 | __be16 tlv_type; /* TLV identifier */ |
267 | }; | 267 | }; |
268 | 268 | ||
269 | #define TLV_ALIGNTO 4 | 269 | #define TLV_ALIGNTO 4 |
@@ -377,9 +377,9 @@ struct tipc_genlmsghdr { | |||
377 | 377 | ||
378 | struct tipc_cfg_msg_hdr | 378 | struct tipc_cfg_msg_hdr |
379 | { | 379 | { |
380 | __u32 tcm_len; /* Message length (including header) */ | 380 | __be32 tcm_len; /* Message length (including header) */ |
381 | __u16 tcm_type; /* Command type */ | 381 | __be16 tcm_type; /* Command type */ |
382 | __u16 tcm_flags; /* Additional flags */ | 382 | __be16 tcm_flags; /* Additional flags */ |
383 | char tcm_reserved[8]; /* Unused */ | 383 | char tcm_reserved[8]; /* Unused */ |
384 | }; | 384 | }; |
385 | 385 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 44091c0db0b4..65321f911c1e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -276,9 +276,8 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); | |||
276 | extern int tty_unregister_ldisc(int disc); | 276 | extern int tty_unregister_ldisc(int disc); |
277 | extern int tty_register_driver(struct tty_driver *driver); | 277 | extern int tty_register_driver(struct tty_driver *driver); |
278 | extern int tty_unregister_driver(struct tty_driver *driver); | 278 | extern int tty_unregister_driver(struct tty_driver *driver); |
279 | extern struct class_device *tty_register_device(struct tty_driver *driver, | 279 | extern struct device *tty_register_device(struct tty_driver *driver, |
280 | unsigned index, | 280 | unsigned index, struct device *dev); |
281 | struct device *dev); | ||
282 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 281 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
283 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 282 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
284 | int buflen); | 283 | int buflen); |
diff --git a/include/linux/types.h b/include/linux/types.h index 750f085fa564..745c409ebbb5 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -128,6 +128,8 @@ typedef __s64 int64_t; | |||
128 | 128 | ||
129 | /* this is a special 64bit data type that is 8-byte aligned */ | 129 | /* this is a special 64bit data type that is 8-byte aligned */ |
130 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) | 130 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) |
131 | #define aligned_be64 __be64 __attribute__((aligned(8))) | ||
132 | #define aligned_le64 __le64 __attribute__((aligned(8))) | ||
131 | 133 | ||
132 | /** | 134 | /** |
133 | * The type used for indexing onto a disc or disc partition. | 135 | * The type used for indexing onto a disc or disc partition. |
@@ -180,6 +182,8 @@ typedef __u32 __bitwise __be32; | |||
180 | typedef __u64 __bitwise __le64; | 182 | typedef __u64 __bitwise __le64; |
181 | typedef __u64 __bitwise __be64; | 183 | typedef __u64 __bitwise __be64; |
182 | #endif | 184 | #endif |
185 | typedef __u16 __bitwise __sum16; | ||
186 | typedef __u32 __bitwise __wsum; | ||
183 | 187 | ||
184 | #ifdef __KERNEL__ | 188 | #ifdef __KERNEL__ |
185 | typedef unsigned __bitwise__ gfp_t; | 189 | typedef unsigned __bitwise__ gfp_t; |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 014b41d1e308..7e08c07efe0f 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -23,7 +23,7 @@ struct udphdr { | |||
23 | __be16 source; | 23 | __be16 source; |
24 | __be16 dest; | 24 | __be16 dest; |
25 | __be16 len; | 25 | __be16 len; |
26 | __be16 check; | 26 | __sum16 check; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* UDP socket options */ | 29 | /* UDP socket options */ |
@@ -38,6 +38,7 @@ struct udphdr { | |||
38 | #include <linux/types.h> | 38 | #include <linux/types.h> |
39 | 39 | ||
40 | #include <net/inet_sock.h> | 40 | #include <net/inet_sock.h> |
41 | #define UDP_HTABLE_SIZE 128 | ||
41 | 42 | ||
42 | struct udp_sock { | 43 | struct udp_sock { |
43 | /* inet_sock has to be the first member */ | 44 | /* inet_sock has to be the first member */ |
@@ -50,12 +51,23 @@ struct udp_sock { | |||
50 | * when the socket is uncorked. | 51 | * when the socket is uncorked. |
51 | */ | 52 | */ |
52 | __u16 len; /* total length of pending frames */ | 53 | __u16 len; /* total length of pending frames */ |
54 | /* | ||
55 | * Fields specific to UDP-Lite. | ||
56 | */ | ||
57 | __u16 pcslen; | ||
58 | __u16 pcrlen; | ||
59 | /* indicator bits used by pcflag: */ | ||
60 | #define UDPLITE_BIT 0x1 /* set by udplite proto init function */ | ||
61 | #define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ | ||
62 | #define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ | ||
63 | __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ | ||
53 | }; | 64 | }; |
54 | 65 | ||
55 | static inline struct udp_sock *udp_sk(const struct sock *sk) | 66 | static inline struct udp_sock *udp_sk(const struct sock *sk) |
56 | { | 67 | { |
57 | return (struct udp_sock *)sk; | 68 | return (struct udp_sock *)sk; |
58 | } | 69 | } |
70 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | ||
59 | 71 | ||
60 | #endif | 72 | #endif |
61 | 73 | ||
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 61eef508b041..28967eda9d7b 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -908,7 +908,7 @@ struct ufs_super_block_third { | |||
908 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ | 908 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ |
909 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ | 909 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ |
910 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ | 910 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ |
911 | } fs_u2; | 911 | } __attribute__ ((packed)) fs_u2; |
912 | } fs_un1; | 912 | } fs_un1; |
913 | union { | 913 | union { |
914 | struct { | 914 | struct { |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h index 73e1751d03dd..749928c161fb 100644 --- a/include/linux/unwind.h +++ b/include/linux/unwind.h | |||
@@ -26,6 +26,7 @@ struct module; | |||
26 | * Initialize unwind support. | 26 | * Initialize unwind support. |
27 | */ | 27 | */ |
28 | extern void unwind_init(void); | 28 | extern void unwind_init(void); |
29 | extern void unwind_setup(void); | ||
29 | 30 | ||
30 | #ifdef CONFIG_MODULES | 31 | #ifdef CONFIG_MODULES |
31 | 32 | ||
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *); | |||
73 | struct unwind_frame_info {}; | 74 | struct unwind_frame_info {}; |
74 | 75 | ||
75 | static inline void unwind_init(void) {} | 76 | static inline void unwind_init(void) {} |
77 | static inline void unwind_setup(void) {} | ||
76 | 78 | ||
77 | #ifdef CONFIG_MODULES | 79 | #ifdef CONFIG_MODULES |
78 | 80 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 5482bfb3303d..0cd73edeef13 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -313,8 +313,13 @@ struct usb_bus { | |||
313 | /* This is arbitrary. | 313 | /* This is arbitrary. |
314 | * From USB 2.0 spec Table 11-13, offset 7, a hub can | 314 | * From USB 2.0 spec Table 11-13, offset 7, a hub can |
315 | * have up to 255 ports. The most yet reported is 10. | 315 | * have up to 255 ports. The most yet reported is 10. |
316 | * | ||
317 | * Current Wireless USB host hardware (Intel i1480 for example) allows | ||
318 | * up to 22 devices to connect. Upcoming hardware might raise that | ||
319 | * limit. Because the arrays need to add a bit for hub status data, we | ||
320 | * do 31, so plus one evens out to four bytes. | ||
316 | */ | 321 | */ |
317 | #define USB_MAXCHILDREN (16) | 322 | #define USB_MAXCHILDREN (31) |
318 | 323 | ||
319 | struct usb_tt; | 324 | struct usb_tt; |
320 | 325 | ||
@@ -357,7 +362,8 @@ struct usb_device { | |||
357 | u8 portnum; /* Parent port number (origin 1) */ | 362 | u8 portnum; /* Parent port number (origin 1) */ |
358 | u8 level; /* Number of USB hub ancestors */ | 363 | u8 level; /* Number of USB hub ancestors */ |
359 | 364 | ||
360 | int have_langid; /* whether string_langid is valid */ | 365 | unsigned discon_suspended:1; /* Disconnected while suspended */ |
366 | unsigned have_langid:1; /* whether string_langid is valid */ | ||
361 | int string_langid; /* language ID for strings */ | 367 | int string_langid; /* language ID for strings */ |
362 | 368 | ||
363 | /* static strings from the device */ | 369 | /* static strings from the device */ |
@@ -410,14 +416,37 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
410 | 416 | ||
411 | /* USB autosuspend and autoresume */ | 417 | /* USB autosuspend and autoresume */ |
412 | #ifdef CONFIG_USB_SUSPEND | 418 | #ifdef CONFIG_USB_SUSPEND |
419 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
413 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 420 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
414 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 421 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
415 | 422 | ||
423 | static inline void usb_autopm_enable(struct usb_interface *intf) | ||
424 | { | ||
425 | intf->pm_usage_cnt = 0; | ||
426 | usb_autopm_set_interface(intf); | ||
427 | } | ||
428 | |||
429 | static inline void usb_autopm_disable(struct usb_interface *intf) | ||
430 | { | ||
431 | intf->pm_usage_cnt = 1; | ||
432 | usb_autopm_set_interface(intf); | ||
433 | } | ||
434 | |||
416 | #else | 435 | #else |
417 | #define usb_autopm_get_interface(intf) 0 | ||
418 | #define usb_autopm_put_interface(intf) do {} while (0) | ||
419 | #endif | ||
420 | 436 | ||
437 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
438 | { return 0; } | ||
439 | |||
440 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | ||
441 | { return 0; } | ||
442 | |||
443 | static inline void usb_autopm_put_interface(struct usb_interface *intf) | ||
444 | { } | ||
445 | static inline void usb_autopm_enable(struct usb_interface *intf) | ||
446 | { } | ||
447 | static inline void usb_autopm_disable(struct usb_interface *intf) | ||
448 | { } | ||
449 | #endif | ||
421 | 450 | ||
422 | /*-------------------------------------------------------------------------*/ | 451 | /*-------------------------------------------------------------------------*/ |
423 | 452 | ||
@@ -490,17 +519,137 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, | |||
490 | 519 | ||
491 | /*-------------------------------------------------------------------------*/ | 520 | /*-------------------------------------------------------------------------*/ |
492 | 521 | ||
493 | extern int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd); | 522 | /** |
494 | extern int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd); | 523 | * usb_endpoint_dir_in - check if the endpoint has IN direction |
495 | extern int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd); | 524 | * @epd: endpoint to be checked |
496 | extern int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd); | 525 | * |
497 | extern int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd); | 526 | * Returns true if the endpoint is of type IN, otherwise it returns false. |
498 | extern int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd); | 527 | */ |
499 | extern int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd); | 528 | static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) |
500 | extern int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd); | 529 | { |
501 | extern int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd); | 530 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN); |
502 | extern int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd); | 531 | } |
503 | extern int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd); | 532 | |
533 | /** | ||
534 | * usb_endpoint_dir_out - check if the endpoint has OUT direction | ||
535 | * @epd: endpoint to be checked | ||
536 | * | ||
537 | * Returns true if the endpoint is of type OUT, otherwise it returns false. | ||
538 | */ | ||
539 | static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd) | ||
540 | { | ||
541 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); | ||
542 | } | ||
543 | |||
544 | /** | ||
545 | * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type | ||
546 | * @epd: endpoint to be checked | ||
547 | * | ||
548 | * Returns true if the endpoint is of type bulk, otherwise it returns false. | ||
549 | */ | ||
550 | static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) | ||
551 | { | ||
552 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
553 | USB_ENDPOINT_XFER_BULK); | ||
554 | } | ||
555 | |||
556 | /** | ||
557 | * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type | ||
558 | * @epd: endpoint to be checked | ||
559 | * | ||
560 | * Returns true if the endpoint is of type interrupt, otherwise it returns | ||
561 | * false. | ||
562 | */ | ||
563 | static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) | ||
564 | { | ||
565 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
566 | USB_ENDPOINT_XFER_INT); | ||
567 | } | ||
568 | |||
569 | /** | ||
570 | * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type | ||
571 | * @epd: endpoint to be checked | ||
572 | * | ||
573 | * Returns true if the endpoint is of type isochronous, otherwise it returns | ||
574 | * false. | ||
575 | */ | ||
576 | static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) | ||
577 | { | ||
578 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
579 | USB_ENDPOINT_XFER_ISOC); | ||
580 | } | ||
581 | |||
582 | /** | ||
583 | * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN | ||
584 | * @epd: endpoint to be checked | ||
585 | * | ||
586 | * Returns true if the endpoint has bulk transfer type and IN direction, | ||
587 | * otherwise it returns false. | ||
588 | */ | ||
589 | static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) | ||
590 | { | ||
591 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); | ||
592 | } | ||
593 | |||
594 | /** | ||
595 | * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT | ||
596 | * @epd: endpoint to be checked | ||
597 | * | ||
598 | * Returns true if the endpoint has bulk transfer type and OUT direction, | ||
599 | * otherwise it returns false. | ||
600 | */ | ||
601 | static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) | ||
602 | { | ||
603 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); | ||
604 | } | ||
605 | |||
606 | /** | ||
607 | * usb_endpoint_is_int_in - check if the endpoint is interrupt IN | ||
608 | * @epd: endpoint to be checked | ||
609 | * | ||
610 | * Returns true if the endpoint has interrupt transfer type and IN direction, | ||
611 | * otherwise it returns false. | ||
612 | */ | ||
613 | static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) | ||
614 | { | ||
615 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); | ||
616 | } | ||
617 | |||
618 | /** | ||
619 | * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT | ||
620 | * @epd: endpoint to be checked | ||
621 | * | ||
622 | * Returns true if the endpoint has interrupt transfer type and OUT direction, | ||
623 | * otherwise it returns false. | ||
624 | */ | ||
625 | static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd) | ||
626 | { | ||
627 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); | ||
628 | } | ||
629 | |||
630 | /** | ||
631 | * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN | ||
632 | * @epd: endpoint to be checked | ||
633 | * | ||
634 | * Returns true if the endpoint has isochronous transfer type and IN direction, | ||
635 | * otherwise it returns false. | ||
636 | */ | ||
637 | static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd) | ||
638 | { | ||
639 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); | ||
640 | } | ||
641 | |||
642 | /** | ||
643 | * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT | ||
644 | * @epd: endpoint to be checked | ||
645 | * | ||
646 | * Returns true if the endpoint has isochronous transfer type and OUT direction, | ||
647 | * otherwise it returns false. | ||
648 | */ | ||
649 | static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd) | ||
650 | { | ||
651 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); | ||
652 | } | ||
504 | 653 | ||
505 | /*-------------------------------------------------------------------------*/ | 654 | /*-------------------------------------------------------------------------*/ |
506 | 655 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index ce5f1482e6be..924e502905d4 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -23,13 +23,14 @@ struct vm_area_struct; | |||
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | struct vm_struct { | 25 | struct vm_struct { |
26 | /* keep next,addr,size together to speedup lookups */ | ||
27 | struct vm_struct *next; | ||
26 | void *addr; | 28 | void *addr; |
27 | unsigned long size; | 29 | unsigned long size; |
28 | unsigned long flags; | 30 | unsigned long flags; |
29 | struct page **pages; | 31 | struct page **pages; |
30 | unsigned int nr_pages; | 32 | unsigned int nr_pages; |
31 | unsigned long phys_addr; | 33 | unsigned long phys_addr; |
32 | struct vm_struct *next; | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | /* | 36 | /* |
@@ -60,7 +61,8 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | |||
60 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 61 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
61 | unsigned long start, unsigned long end); | 62 | unsigned long start, unsigned long end); |
62 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 63 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
63 | unsigned long flags, int node); | 64 | unsigned long flags, int node, |
65 | gfp_t gfp_mask); | ||
64 | extern struct vm_struct *remove_vm_area(void *addr); | 66 | extern struct vm_struct *remove_vm_area(void *addr); |
65 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 67 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
66 | struct page ***pages); | 68 | struct page ***pages); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index b3b9048421d8..e820d00e1383 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -79,6 +79,15 @@ struct task_struct; | |||
79 | 79 | ||
80 | extern void init_waitqueue_head(wait_queue_head_t *q); | 80 | extern void init_waitqueue_head(wait_queue_head_t *q); |
81 | 81 | ||
82 | #ifdef CONFIG_LOCKDEP | ||
83 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ | ||
84 | ({ init_waitqueue_head(&name); name; }) | ||
85 | # define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \ | ||
86 | wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) | ||
87 | #else | ||
88 | # define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name) | ||
89 | #endif | ||
90 | |||
82 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | 91 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) |
83 | { | 92 | { |
84 | q->flags = 0; | 93 | q->flags = 0; |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index a50a0130fd9e..7c269f4992eb 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -546,6 +546,8 @@ | |||
546 | /* MLME requests (SIOCSIWMLME / struct iw_mlme) */ | 546 | /* MLME requests (SIOCSIWMLME / struct iw_mlme) */ |
547 | #define IW_MLME_DEAUTH 0 | 547 | #define IW_MLME_DEAUTH 0 |
548 | #define IW_MLME_DISASSOC 1 | 548 | #define IW_MLME_DISASSOC 1 |
549 | #define IW_MLME_AUTH 2 | ||
550 | #define IW_MLME_ASSOC 3 | ||
549 | 551 | ||
550 | /* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ | 552 | /* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ |
551 | #define IW_AUTH_INDEX 0x0FFF | 553 | #define IW_AUTH_INDEX 0x0FFF |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index a341c8032866..fc35e6bdfb93 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -85,7 +85,6 @@ int wakeup_pdflush(long nr_pages); | |||
85 | void laptop_io_completion(void); | 85 | void laptop_io_completion(void); |
86 | void laptop_sync_completion(void); | 86 | void laptop_sync_completion(void); |
87 | void throttle_vm_writeout(void); | 87 | void throttle_vm_writeout(void); |
88 | void writeback_congestion_end(void); | ||
89 | 88 | ||
90 | /* These are exported to sysctl. */ | 89 | /* These are exported to sysctl. */ |
91 | extern int dirty_background_ratio; | 90 | extern int dirty_background_ratio; |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 8ae7f744917b..088ba8113f7e 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -211,8 +211,8 @@ struct xfrm_user_tmpl { | |||
211 | 211 | ||
212 | struct xfrm_encap_tmpl { | 212 | struct xfrm_encap_tmpl { |
213 | __u16 encap_type; | 213 | __u16 encap_type; |
214 | __u16 encap_sport; | 214 | __be16 encap_sport; |
215 | __u16 encap_dport; | 215 | __be16 encap_dport; |
216 | xfrm_address_t encap_oa; | 216 | xfrm_address_t encap_oa; |
217 | }; | 217 | }; |
218 | 218 | ||
@@ -289,7 +289,9 @@ struct xfrm_usersa_id { | |||
289 | 289 | ||
290 | struct xfrm_aevent_id { | 290 | struct xfrm_aevent_id { |
291 | struct xfrm_usersa_id sa_id; | 291 | struct xfrm_usersa_id sa_id; |
292 | xfrm_address_t saddr; | ||
292 | __u32 flags; | 293 | __u32 flags; |
294 | __u32 reqid; | ||
293 | }; | 295 | }; |
294 | 296 | ||
295 | struct xfrm_userspi_info { | 297 | struct xfrm_userspi_info { |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 44f1b673f916..88df8fc814e4 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -35,9 +35,9 @@ struct prefix_info { | |||
35 | #else | 35 | #else |
36 | #error "Please fix <asm/byteorder.h>" | 36 | #error "Please fix <asm/byteorder.h>" |
37 | #endif | 37 | #endif |
38 | __u32 valid; | 38 | __be32 valid; |
39 | __u32 prefered; | 39 | __be32 prefered; |
40 | __u32 reserved2; | 40 | __be32 reserved2; |
41 | 41 | ||
42 | struct in6_addr prefix; | 42 | struct in6_addr prefix; |
43 | }; | 43 | }; |
@@ -183,7 +183,7 @@ static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr) | |||
183 | * This will include the IEEE address token on links that support it. | 183 | * This will include the IEEE address token on links that support it. |
184 | */ | 184 | */ |
185 | 185 | ||
186 | word = addr->s6_addr32[2] ^ addr->s6_addr32[3]; | 186 | word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]); |
187 | word ^= (word >> 16); | 187 | word ^= (word >> 16); |
188 | word ^= (word >> 8); | 188 | word ^= (word >> 8); |
189 | 189 | ||
diff --git a/include/net/arp.h b/include/net/arp.h index 6a3d9a7d302b..f02664568600 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -16,7 +16,7 @@ extern void arp_send(int type, int ptype, __be32 dest_ip, | |||
16 | struct net_device *dev, __be32 src_ip, | 16 | struct net_device *dev, __be32 src_ip, |
17 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); | 17 | unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); |
18 | extern int arp_bind_neighbour(struct dst_entry *dst); | 18 | extern int arp_bind_neighbour(struct dst_entry *dst); |
19 | extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); | 19 | extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); |
20 | extern void arp_ifdown(struct net_device *dev); | 20 | extern void arp_ifdown(struct net_device *dev); |
21 | 21 | ||
22 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | 22 | extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, |
diff --git a/include/net/atmclip.h b/include/net/atmclip.h index 90fcc98e676f..b5a51a7bb364 100644 --- a/include/net/atmclip.h +++ b/include/net/atmclip.h | |||
@@ -36,7 +36,7 @@ struct clip_vcc { | |||
36 | 36 | ||
37 | 37 | ||
38 | struct atmarp_entry { | 38 | struct atmarp_entry { |
39 | u32 ip; /* IP address */ | 39 | __be32 ip; /* IP address */ |
40 | struct clip_vcc *vccs; /* active VCCs; NULL if resolution is | 40 | struct clip_vcc *vccs; /* active VCCs; NULL if resolution is |
41 | pending */ | 41 | pending */ |
42 | unsigned long expires; /* entry expiration time */ | 42 | unsigned long expires; /* entry expiration time */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index df22efcfcc0b..c0fc39620f36 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -153,6 +153,7 @@ struct hci_conn { | |||
153 | __u8 mode; | 153 | __u8 mode; |
154 | __u8 type; | 154 | __u8 type; |
155 | __u8 out; | 155 | __u8 out; |
156 | __u8 attempt; | ||
156 | __u8 dev_class[3]; | 157 | __u8 dev_class[3]; |
157 | __u8 features[8]; | 158 | __u8 features[8]; |
158 | __u16 interval; | 159 | __u16 interval; |
@@ -289,6 +290,22 @@ static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev, | |||
289 | return NULL; | 290 | return NULL; |
290 | } | 291 | } |
291 | 292 | ||
293 | static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, | ||
294 | __u8 type, __u16 state) | ||
295 | { | ||
296 | struct hci_conn_hash *h = &hdev->conn_hash; | ||
297 | struct list_head *p; | ||
298 | struct hci_conn *c; | ||
299 | |||
300 | list_for_each(p, &h->list) { | ||
301 | c = list_entry(p, struct hci_conn, list); | ||
302 | if (c->type == type && c->state == state) | ||
303 | return c; | ||
304 | } | ||
305 | return NULL; | ||
306 | } | ||
307 | |||
308 | void hci_acl_connect(struct hci_conn *conn); | ||
292 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 309 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); |
293 | void hci_add_sco(struct hci_conn *conn, __u16 handle); | 310 | void hci_add_sco(struct hci_conn *conn, __u16 handle); |
294 | 311 | ||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 89d743cfdfdf..3c563f02907c 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -124,7 +124,7 @@ struct rfcomm_pn { | |||
124 | u8 flow_ctrl; | 124 | u8 flow_ctrl; |
125 | u8 priority; | 125 | u8 priority; |
126 | u8 ack_timer; | 126 | u8 ack_timer; |
127 | u16 mtu; | 127 | __le16 mtu; |
128 | u8 max_retrans; | 128 | u8 max_retrans; |
129 | u8 credits; | 129 | u8 credits; |
130 | } __attribute__ ((packed)); | 130 | } __attribute__ ((packed)); |
@@ -136,7 +136,7 @@ struct rfcomm_rpn { | |||
136 | u8 flow_ctrl; | 136 | u8 flow_ctrl; |
137 | u8 xon_char; | 137 | u8 xon_char; |
138 | u8 xoff_char; | 138 | u8 xoff_char; |
139 | u16 param_mask; | 139 | __le16 param_mask; |
140 | } __attribute__ ((packed)); | 140 | } __attribute__ ((packed)); |
141 | 141 | ||
142 | struct rfcomm_rls { | 142 | struct rfcomm_rls { |
diff --git a/include/net/checksum.h b/include/net/checksum.h index e3ea7cc2c728..124246172a88 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
@@ -27,8 +27,8 @@ | |||
27 | 27 | ||
28 | #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER | 28 | #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER |
29 | static inline | 29 | static inline |
30 | unsigned int csum_and_copy_from_user (const unsigned char __user *src, unsigned char *dst, | 30 | __wsum csum_and_copy_from_user (const void __user *src, void *dst, |
31 | int len, int sum, int *err_ptr) | 31 | int len, __wsum sum, int *err_ptr) |
32 | { | 32 | { |
33 | if (access_ok(VERIFY_READ, src, len)) | 33 | if (access_ok(VERIFY_READ, src, len)) |
34 | return csum_partial_copy_from_user(src, dst, len, sum, err_ptr); | 34 | return csum_partial_copy_from_user(src, dst, len, sum, err_ptr); |
@@ -41,8 +41,8 @@ unsigned int csum_and_copy_from_user (const unsigned char __user *src, unsigned | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifndef HAVE_CSUM_COPY_USER | 43 | #ifndef HAVE_CSUM_COPY_USER |
44 | static __inline__ unsigned int csum_and_copy_to_user | 44 | static __inline__ __wsum csum_and_copy_to_user |
45 | (const unsigned char *src, unsigned char __user *dst, int len, unsigned int sum, int *err_ptr) | 45 | (const void *src, void __user *dst, int len, __wsum sum, int *err_ptr) |
46 | { | 46 | { |
47 | sum = csum_partial(src, len, sum); | 47 | sum = csum_partial(src, len, sum); |
48 | 48 | ||
@@ -53,35 +53,44 @@ static __inline__ unsigned int csum_and_copy_to_user | |||
53 | if (len) | 53 | if (len) |
54 | *err_ptr = -EFAULT; | 54 | *err_ptr = -EFAULT; |
55 | 55 | ||
56 | return -1; /* invalid checksum */ | 56 | return (__force __wsum)-1; /* invalid checksum */ |
57 | } | 57 | } |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | static inline unsigned int csum_add(unsigned int csum, unsigned int addend) | 60 | static inline __wsum csum_add(__wsum csum, __wsum addend) |
61 | { | 61 | { |
62 | csum += addend; | 62 | u32 res = (__force u32)csum; |
63 | return csum + (csum < addend); | 63 | res += (__force u32)addend; |
64 | return (__force __wsum)(res + (res < (__force u32)addend)); | ||
64 | } | 65 | } |
65 | 66 | ||
66 | static inline unsigned int csum_sub(unsigned int csum, unsigned int addend) | 67 | static inline __wsum csum_sub(__wsum csum, __wsum addend) |
67 | { | 68 | { |
68 | return csum_add(csum, ~addend); | 69 | return csum_add(csum, ~addend); |
69 | } | 70 | } |
70 | 71 | ||
71 | static inline unsigned int | 72 | static inline __wsum |
72 | csum_block_add(unsigned int csum, unsigned int csum2, int offset) | 73 | csum_block_add(__wsum csum, __wsum csum2, int offset) |
73 | { | 74 | { |
75 | u32 sum = (__force u32)csum2; | ||
74 | if (offset&1) | 76 | if (offset&1) |
75 | csum2 = ((csum2&0xFF00FF)<<8)+((csum2>>8)&0xFF00FF); | 77 | sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF); |
76 | return csum_add(csum, csum2); | 78 | return csum_add(csum, (__force __wsum)sum); |
77 | } | 79 | } |
78 | 80 | ||
79 | static inline unsigned int | 81 | static inline __wsum |
80 | csum_block_sub(unsigned int csum, unsigned int csum2, int offset) | 82 | csum_block_sub(__wsum csum, __wsum csum2, int offset) |
81 | { | 83 | { |
84 | u32 sum = (__force u32)csum2; | ||
82 | if (offset&1) | 85 | if (offset&1) |
83 | csum2 = ((csum2&0xFF00FF)<<8)+((csum2>>8)&0xFF00FF); | 86 | sum = ((sum&0xFF00FF)<<8)+((sum>>8)&0xFF00FF); |
84 | return csum_sub(csum, csum2); | 87 | return csum_sub(csum, (__force __wsum)sum); |
85 | } | 88 | } |
86 | 89 | ||
90 | static inline __wsum csum_unfold(__sum16 n) | ||
91 | { | ||
92 | return (__force __wsum)n; | ||
93 | } | ||
94 | |||
95 | #define CSUM_MANGLED_0 ((__force __sum16)0xffff) | ||
87 | #endif | 96 | #endif |
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index 718b4d9c891f..4c9522c5178f 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -58,10 +58,10 @@ | |||
58 | #define CIPSO_V4_MAP_PASS 2 | 58 | #define CIPSO_V4_MAP_PASS 2 |
59 | 59 | ||
60 | /* limits */ | 60 | /* limits */ |
61 | #define CIPSO_V4_MAX_REM_LVLS 256 | 61 | #define CIPSO_V4_MAX_REM_LVLS 255 |
62 | #define CIPSO_V4_INV_LVL 0x80000000 | 62 | #define CIPSO_V4_INV_LVL 0x80000000 |
63 | #define CIPSO_V4_MAX_LOC_LVLS (CIPSO_V4_INV_LVL - 1) | 63 | #define CIPSO_V4_MAX_LOC_LVLS (CIPSO_V4_INV_LVL - 1) |
64 | #define CIPSO_V4_MAX_REM_CATS 65536 | 64 | #define CIPSO_V4_MAX_REM_CATS 65534 |
65 | #define CIPSO_V4_INV_CAT 0x80000000 | 65 | #define CIPSO_V4_INV_CAT 0x80000000 |
66 | #define CIPSO_V4_MAX_LOC_CATS (CIPSO_V4_INV_CAT - 1) | 66 | #define CIPSO_V4_MAX_LOC_CATS (CIPSO_V4_INV_CAT - 1) |
67 | 67 | ||
diff --git a/include/net/dn.h b/include/net/dn.h index 465b78302782..ac4ce9091747 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -199,11 +199,6 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp) | |||
199 | { | 199 | { |
200 | fl->uli_u.dnports.sport = scp->addrloc; | 200 | fl->uli_u.dnports.sport = scp->addrloc; |
201 | fl->uli_u.dnports.dport = scp->addrrem; | 201 | fl->uli_u.dnports.dport = scp->addrrem; |
202 | fl->uli_u.dnports.objnum = scp->addr.sdn_objnum; | ||
203 | if (fl->uli_u.dnports.objnum == 0) { | ||
204 | fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel); | ||
205 | memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16); | ||
206 | } | ||
207 | } | 202 | } |
208 | 203 | ||
209 | extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); | 204 | extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); |
diff --git a/include/net/dsfield.h b/include/net/dsfield.h index a79c9e075f7f..eb65bf2e2502 100644 --- a/include/net/dsfield.h +++ b/include/net/dsfield.h | |||
@@ -20,14 +20,14 @@ static inline __u8 ipv4_get_dsfield(struct iphdr *iph) | |||
20 | 20 | ||
21 | static inline __u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h) | 21 | static inline __u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h) |
22 | { | 22 | { |
23 | return ntohs(*(__u16 *) ipv6h) >> 4; | 23 | return ntohs(*(__be16 *) ipv6h) >> 4; |
24 | } | 24 | } |
25 | 25 | ||
26 | 26 | ||
27 | static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, | 27 | static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, |
28 | __u8 value) | 28 | __u8 value) |
29 | { | 29 | { |
30 | __u32 check = ntohs(iph->check); | 30 | __u32 check = ntohs((__force __be16)iph->check); |
31 | __u8 dsfield; | 31 | __u8 dsfield; |
32 | 32 | ||
33 | dsfield = (iph->tos & mask) | value; | 33 | dsfield = (iph->tos & mask) | value; |
@@ -35,7 +35,7 @@ static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask, | |||
35 | if ((check+1) >> 16) check = (check+1) & 0xffff; | 35 | if ((check+1) >> 16) check = (check+1) & 0xffff; |
36 | check -= dsfield; | 36 | check -= dsfield; |
37 | check += check >> 16; /* adjust carry */ | 37 | check += check >> 16; /* adjust carry */ |
38 | iph->check = htons(check); | 38 | iph->check = (__force __sum16)htons(check); |
39 | iph->tos = dsfield; | 39 | iph->tos = dsfield; |
40 | } | 40 | } |
41 | 41 | ||
@@ -45,9 +45,9 @@ static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask, | |||
45 | { | 45 | { |
46 | __u16 tmp; | 46 | __u16 tmp; |
47 | 47 | ||
48 | tmp = ntohs(*(__u16 *) ipv6h); | 48 | tmp = ntohs(*(__be16 *) ipv6h); |
49 | tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4); | 49 | tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4); |
50 | *(__u16 *) ipv6h = htons(tmp); | 50 | *(__be16 *) ipv6h = htons(tmp); |
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 8e2f473d3e82..bc3c26494c3d 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -13,6 +13,8 @@ struct fib_rule | |||
13 | atomic_t refcnt; | 13 | atomic_t refcnt; |
14 | int ifindex; | 14 | int ifindex; |
15 | char ifname[IFNAMSIZ]; | 15 | char ifname[IFNAMSIZ]; |
16 | u32 mark; | ||
17 | u32 mark_mask; | ||
16 | u32 pref; | 18 | u32 pref; |
17 | u32 flags; | 19 | u32 flags; |
18 | u32 table; | 20 | u32 table; |
@@ -50,6 +52,7 @@ struct fib_rules_ops | |||
50 | struct nlmsghdr *, | 52 | struct nlmsghdr *, |
51 | struct fib_rule_hdr *); | 53 | struct fib_rule_hdr *); |
52 | u32 (*default_pref)(void); | 54 | u32 (*default_pref)(void); |
55 | size_t (*nlmsg_payload)(struct fib_rule *); | ||
53 | 56 | ||
54 | int nlgroup; | 57 | int nlgroup; |
55 | struct nla_policy *policy; | 58 | struct nla_policy *policy; |
@@ -57,6 +60,13 @@ struct fib_rules_ops | |||
57 | struct module *owner; | 60 | struct module *owner; |
58 | }; | 61 | }; |
59 | 62 | ||
63 | #define FRA_GENERIC_POLICY \ | ||
64 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ | ||
65 | [FRA_PRIORITY] = { .type = NLA_U32 }, \ | ||
66 | [FRA_FWMARK] = { .type = NLA_U32 }, \ | ||
67 | [FRA_FWMASK] = { .type = NLA_U32 }, \ | ||
68 | [FRA_TABLE] = { .type = NLA_U32 } | ||
69 | |||
60 | static inline void fib_rule_get(struct fib_rule *rule) | 70 | static inline void fib_rule_get(struct fib_rule *rule) |
61 | { | 71 | { |
62 | atomic_inc(&rule->refcnt); | 72 | atomic_inc(&rule->refcnt); |
diff --git a/include/net/flow.h b/include/net/flow.h index 3b44d72b27d3..ce4b10d8b412 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -13,12 +13,12 @@ | |||
13 | struct flowi { | 13 | struct flowi { |
14 | int oif; | 14 | int oif; |
15 | int iif; | 15 | int iif; |
16 | __u32 mark; | ||
16 | 17 | ||
17 | union { | 18 | union { |
18 | struct { | 19 | struct { |
19 | __be32 daddr; | 20 | __be32 daddr; |
20 | __be32 saddr; | 21 | __be32 saddr; |
21 | __u32 fwmark; | ||
22 | __u8 tos; | 22 | __u8 tos; |
23 | __u8 scope; | 23 | __u8 scope; |
24 | } ip4_u; | 24 | } ip4_u; |
@@ -26,28 +26,23 @@ struct flowi { | |||
26 | struct { | 26 | struct { |
27 | struct in6_addr daddr; | 27 | struct in6_addr daddr; |
28 | struct in6_addr saddr; | 28 | struct in6_addr saddr; |
29 | __u32 fwmark; | 29 | __be32 flowlabel; |
30 | __u32 flowlabel; | ||
31 | } ip6_u; | 30 | } ip6_u; |
32 | 31 | ||
33 | struct { | 32 | struct { |
34 | __le16 daddr; | 33 | __le16 daddr; |
35 | __le16 saddr; | 34 | __le16 saddr; |
36 | __u32 fwmark; | ||
37 | __u8 scope; | 35 | __u8 scope; |
38 | } dn_u; | 36 | } dn_u; |
39 | } nl_u; | 37 | } nl_u; |
40 | #define fld_dst nl_u.dn_u.daddr | 38 | #define fld_dst nl_u.dn_u.daddr |
41 | #define fld_src nl_u.dn_u.saddr | 39 | #define fld_src nl_u.dn_u.saddr |
42 | #define fld_fwmark nl_u.dn_u.fwmark | ||
43 | #define fld_scope nl_u.dn_u.scope | 40 | #define fld_scope nl_u.dn_u.scope |
44 | #define fl6_dst nl_u.ip6_u.daddr | 41 | #define fl6_dst nl_u.ip6_u.daddr |
45 | #define fl6_src nl_u.ip6_u.saddr | 42 | #define fl6_src nl_u.ip6_u.saddr |
46 | #define fl6_fwmark nl_u.ip6_u.fwmark | ||
47 | #define fl6_flowlabel nl_u.ip6_u.flowlabel | 43 | #define fl6_flowlabel nl_u.ip6_u.flowlabel |
48 | #define fl4_dst nl_u.ip4_u.daddr | 44 | #define fl4_dst nl_u.ip4_u.daddr |
49 | #define fl4_src nl_u.ip4_u.saddr | 45 | #define fl4_src nl_u.ip4_u.saddr |
50 | #define fl4_fwmark nl_u.ip4_u.fwmark | ||
51 | #define fl4_tos nl_u.ip4_u.tos | 46 | #define fl4_tos nl_u.ip4_u.tos |
52 | #define fl4_scope nl_u.ip4_u.scope | 47 | #define fl4_scope nl_u.ip4_u.scope |
53 | 48 | ||
@@ -68,9 +63,6 @@ struct flowi { | |||
68 | struct { | 63 | struct { |
69 | __le16 sport; | 64 | __le16 sport; |
70 | __le16 dport; | 65 | __le16 dport; |
71 | __u8 objnum; | ||
72 | __u8 objnamel; /* Not 16 bits since max val is 16 */ | ||
73 | __u8 objname[16]; /* Not zero terminated */ | ||
74 | } dnports; | 66 | } dnports; |
75 | 67 | ||
76 | __be32 spi; | 68 | __be32 spi; |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index b619314218a6..adff4c898d50 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -53,6 +53,7 @@ struct genl_info | |||
53 | * @policy: attribute validation policy | 53 | * @policy: attribute validation policy |
54 | * @doit: standard command callback | 54 | * @doit: standard command callback |
55 | * @dumpit: callback for dumpers | 55 | * @dumpit: callback for dumpers |
56 | * @done: completion callback for dumps | ||
56 | * @ops_list: operations list | 57 | * @ops_list: operations list |
57 | */ | 58 | */ |
58 | struct genl_ops | 59 | struct genl_ops |
@@ -64,6 +65,7 @@ struct genl_ops | |||
64 | struct genl_info *info); | 65 | struct genl_info *info); |
65 | int (*dumpit)(struct sk_buff *skb, | 66 | int (*dumpit)(struct sk_buff *skb, |
66 | struct netlink_callback *cb); | 67 | struct netlink_callback *cb); |
68 | int (*done)(struct netlink_callback *cb); | ||
67 | struct list_head ops_list; | 69 | struct list_head ops_list; |
68 | }; | 70 | }; |
69 | 71 | ||
@@ -79,34 +81,51 @@ extern struct sock *genl_sock; | |||
79 | * @skb: socket buffer holding the message | 81 | * @skb: socket buffer holding the message |
80 | * @pid: netlink pid the message is addressed to | 82 | * @pid: netlink pid the message is addressed to |
81 | * @seq: sequence number (usually the one of the sender) | 83 | * @seq: sequence number (usually the one of the sender) |
82 | * @type: netlink message type | 84 | * @family: generic netlink family |
83 | * @hdrlen: length of the user specific header | ||
84 | * @flags netlink message flags | 85 | * @flags netlink message flags |
85 | * @cmd: generic netlink command | 86 | * @cmd: generic netlink command |
86 | * @version: version | ||
87 | * | 87 | * |
88 | * Returns pointer to user specific header | 88 | * Returns pointer to user specific header |
89 | */ | 89 | */ |
90 | static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, | 90 | static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, |
91 | int type, int hdrlen, int flags, | 91 | struct genl_family *family, int flags, u8 cmd) |
92 | u8 cmd, u8 version) | ||
93 | { | 92 | { |
94 | struct nlmsghdr *nlh; | 93 | struct nlmsghdr *nlh; |
95 | struct genlmsghdr *hdr; | 94 | struct genlmsghdr *hdr; |
96 | 95 | ||
97 | nlh = nlmsg_put(skb, pid, seq, type, GENL_HDRLEN + hdrlen, flags); | 96 | nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN + |
97 | family->hdrsize, flags); | ||
98 | if (nlh == NULL) | 98 | if (nlh == NULL) |
99 | return NULL; | 99 | return NULL; |
100 | 100 | ||
101 | hdr = nlmsg_data(nlh); | 101 | hdr = nlmsg_data(nlh); |
102 | hdr->cmd = cmd; | 102 | hdr->cmd = cmd; |
103 | hdr->version = version; | 103 | hdr->version = family->version; |
104 | hdr->reserved = 0; | 104 | hdr->reserved = 0; |
105 | 105 | ||
106 | return (char *) hdr + GENL_HDRLEN; | 106 | return (char *) hdr + GENL_HDRLEN; |
107 | } | 107 | } |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * genlmsg_put_reply - Add generic netlink header to a reply message | ||
111 | * @skb: socket buffer holding the message | ||
112 | * @info: receiver info | ||
113 | * @family: generic netlink family | ||
114 | * @flags: netlink message flags | ||
115 | * @cmd: generic netlink command | ||
116 | * | ||
117 | * Returns pointer to user specific header | ||
118 | */ | ||
119 | static inline void *genlmsg_put_reply(struct sk_buff *skb, | ||
120 | struct genl_info *info, | ||
121 | struct genl_family *family, | ||
122 | int flags, u8 cmd) | ||
123 | { | ||
124 | return genlmsg_put(skb, info->snd_pid, info->snd_seq, family, | ||
125 | flags, cmd); | ||
126 | } | ||
127 | |||
128 | /** | ||
110 | * genlmsg_end - Finalize a generic netlink message | 129 | * genlmsg_end - Finalize a generic netlink message |
111 | * @skb: socket buffer the message is stored in | 130 | * @skb: socket buffer the message is stored in |
112 | * @hdr: user specific header | 131 | * @hdr: user specific header |
@@ -150,6 +169,16 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) | |||
150 | } | 169 | } |
151 | 170 | ||
152 | /** | 171 | /** |
172 | * genlmsg_reply - reply to a request | ||
173 | * @skb: netlink message to be sent back | ||
174 | * @info: receiver information | ||
175 | */ | ||
176 | static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) | ||
177 | { | ||
178 | return genlmsg_unicast(skb, info->snd_pid); | ||
179 | } | ||
180 | |||
181 | /** | ||
153 | * gennlmsg_data - head of message payload | 182 | * gennlmsg_data - head of message payload |
154 | * @gnlh: genetlink messsage header | 183 | * @gnlh: genetlink messsage header |
155 | */ | 184 | */ |
@@ -187,4 +216,15 @@ static inline int genlmsg_total_size(int payload) | |||
187 | return NLMSG_ALIGN(genlmsg_msg_size(payload)); | 216 | return NLMSG_ALIGN(genlmsg_msg_size(payload)); |
188 | } | 217 | } |
189 | 218 | ||
219 | /** | ||
220 | * genlmsg_new - Allocate a new generic netlink message | ||
221 | * @payload: size of the message payload | ||
222 | * @flags: the type of memory to allocate. | ||
223 | */ | ||
224 | static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags) | ||
225 | { | ||
226 | return nlmsg_new(genlmsg_total_size(payload), flags); | ||
227 | } | ||
228 | |||
229 | |||
190 | #endif /* __NET_GENERIC_NETLINK_H */ | 230 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index b174ebb277a9..e6af381e206d 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -1037,6 +1037,10 @@ struct ieee80211_device { | |||
1037 | /* host performs multicast decryption */ | 1037 | /* host performs multicast decryption */ |
1038 | int host_mc_decrypt; | 1038 | int host_mc_decrypt; |
1039 | 1039 | ||
1040 | /* host should strip IV and ICV from protected frames */ | ||
1041 | /* meaningful only when hardware decryption is being used */ | ||
1042 | int host_strip_iv_icv; | ||
1043 | |||
1040 | int host_open_frag; | 1044 | int host_open_frag; |
1041 | int host_build_iv; | 1045 | int host_build_iv; |
1042 | int ieee802_1x; /* is IEEE 802.1X used */ | 1046 | int ieee802_1x; /* is IEEE 802.1X used */ |
@@ -1076,6 +1080,8 @@ struct ieee80211_device { | |||
1076 | int perfect_rssi; | 1080 | int perfect_rssi; |
1077 | int worst_rssi; | 1081 | int worst_rssi; |
1078 | 1082 | ||
1083 | u16 prev_seq_ctl; /* used to drop duplicate frames */ | ||
1084 | |||
1079 | /* Callback functions */ | 1085 | /* Callback functions */ |
1080 | void (*set_security) (struct net_device * dev, | 1086 | void (*set_security) (struct net_device * dev, |
1081 | struct ieee80211_security * sec); | 1087 | struct ieee80211_security * sec); |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 425b3a57ac74..617b672b1132 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -63,13 +63,11 @@ struct ieee80211softmac_wpa { | |||
63 | 63 | ||
64 | /* | 64 | /* |
65 | * Information about association | 65 | * Information about association |
66 | * | ||
67 | * Do we need a lock for this? | ||
68 | * We only ever use this structure inlined | ||
69 | * into our global struct. I've used its lock, | ||
70 | * but maybe we need a local one here? | ||
71 | */ | 66 | */ |
72 | struct ieee80211softmac_assoc_info { | 67 | struct ieee80211softmac_assoc_info { |
68 | |||
69 | struct mutex mutex; | ||
70 | |||
73 | /* | 71 | /* |
74 | * This is the requested ESSID. It is written | 72 | * This is the requested ESSID. It is written |
75 | * only by the WX handlers. | 73 | * only by the WX handlers. |
@@ -99,12 +97,13 @@ struct ieee80211softmac_assoc_info { | |||
99 | * | 97 | * |
100 | * bssfixed is used for SIOCSIWAP. | 98 | * bssfixed is used for SIOCSIWAP. |
101 | */ | 99 | */ |
102 | u8 static_essid:1, | 100 | u8 static_essid; |
103 | short_preamble_available:1, | 101 | u8 short_preamble_available; |
104 | associating:1, | 102 | u8 associating; |
105 | assoc_wait:1, | 103 | u8 associated; |
106 | bssvalid:1, | 104 | u8 assoc_wait; |
107 | bssfixed:1; | 105 | u8 bssvalid; |
106 | u8 bssfixed; | ||
108 | 107 | ||
109 | /* Scan retries remaining */ | 108 | /* Scan retries remaining */ |
110 | int scan_retry; | 109 | int scan_retry; |
@@ -229,12 +228,10 @@ struct ieee80211softmac_device { | |||
229 | /* private stuff follows */ | 228 | /* private stuff follows */ |
230 | /* this lock protects this structure */ | 229 | /* this lock protects this structure */ |
231 | spinlock_t lock; | 230 | spinlock_t lock; |
232 | 231 | ||
233 | /* couple of flags */ | 232 | u8 running; /* SoftMAC started? */ |
234 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | 233 | u8 scanning; |
235 | associated:1, | 234 | |
236 | running:1; | ||
237 | |||
238 | struct ieee80211softmac_scaninfo *scaninfo; | 235 | struct ieee80211softmac_scaninfo *scaninfo; |
239 | struct ieee80211softmac_assoc_info associnfo; | 236 | struct ieee80211softmac_assoc_info associnfo; |
240 | struct ieee80211softmac_bss_info bssinfo; | 237 | struct ieee80211softmac_bss_info bssinfo; |
@@ -250,7 +247,7 @@ struct ieee80211softmac_device { | |||
250 | 247 | ||
251 | /* we need to keep a list of network structs we copied */ | 248 | /* we need to keep a list of network structs we copied */ |
252 | struct list_head network_list; | 249 | struct list_head network_list; |
253 | 250 | ||
254 | /* This must be the last item so that it points to the data | 251 | /* This must be the last item so that it points to the data |
255 | * allocated beyond this structure by alloc_ieee80211 */ | 252 | * allocated beyond this structure by alloc_ieee80211 */ |
256 | u8 priv[0]; | 253 | u8 priv[0]; |
@@ -295,7 +292,7 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device | |||
295 | { | 292 | { |
296 | struct ieee80211softmac_txrates *txrates = &mac->txrates; | 293 | struct ieee80211softmac_txrates *txrates = &mac->txrates; |
297 | 294 | ||
298 | if (!mac->associated) | 295 | if (!mac->associnfo.associated) |
299 | return txrates->mgt_mcast_rate; | 296 | return txrates->mgt_mcast_rate; |
300 | 297 | ||
301 | /* We are associated, sending unicast frame */ | 298 | /* We are associated, sending unicast frame */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 34489c13c119..3ec7d07346d6 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -152,6 +152,7 @@ struct ifacaddr6 | |||
152 | 152 | ||
153 | struct ipv6_devstat { | 153 | struct ipv6_devstat { |
154 | struct proc_dir_entry *proc_dir_entry; | 154 | struct proc_dir_entry *proc_dir_entry; |
155 | DEFINE_SNMP_STAT(struct ipstats_mib, ipv6); | ||
155 | DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6); | 156 | DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6); |
156 | }; | 157 | }; |
157 | 158 | ||
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index b33b438bffcc..16aa96a6a53b 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
@@ -27,7 +27,7 @@ extern int inet6_csk_bind_conflict(const struct sock *sk, | |||
27 | 27 | ||
28 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 28 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, |
29 | struct request_sock ***prevp, | 29 | struct request_sock ***prevp, |
30 | const __u16 rport, | 30 | const __be16 rport, |
31 | const struct in6_addr *raddr, | 31 | const struct in6_addr *raddr, |
32 | const struct in6_addr *laddr, | 32 | const struct in6_addr *laddr, |
33 | const int iif); | 33 | const int iif); |
@@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | |||
38 | 38 | ||
39 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 39 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
40 | 40 | ||
41 | extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok); | 41 | extern int inet6_csk_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok); |
42 | #endif /* _INET6_CONNECTION_SOCK_H */ | 42 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index bc6a71dce984..c28e424f53d9 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -26,11 +26,11 @@ struct inet_hashinfo; | |||
26 | 26 | ||
27 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ | 27 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ |
28 | static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, | 28 | static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, |
29 | const struct in6_addr *faddr, const u16 fport) | 29 | const struct in6_addr *faddr, const __be16 fport) |
30 | { | 30 | { |
31 | unsigned int hashent = (lport ^ fport); | 31 | unsigned int hashent = (lport ^ (__force u16)fport); |
32 | 32 | ||
33 | hashent ^= (laddr->s6_addr32[3] ^ faddr->s6_addr32[3]); | 33 | hashent ^= (__force u32)(laddr->s6_addr32[3] ^ faddr->s6_addr32[3]); |
34 | hashent ^= hashent >> 16; | 34 | hashent ^= hashent >> 16; |
35 | hashent ^= hashent >> 8; | 35 | hashent ^= hashent >> 8; |
36 | return hashent; | 36 | return hashent; |
@@ -43,7 +43,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) | |||
43 | const struct in6_addr *laddr = &np->rcv_saddr; | 43 | const struct in6_addr *laddr = &np->rcv_saddr; |
44 | const struct in6_addr *faddr = &np->daddr; | 44 | const struct in6_addr *faddr = &np->daddr; |
45 | const __u16 lport = inet->num; | 45 | const __u16 lport = inet->num; |
46 | const __u16 fport = inet->dport; | 46 | const __be16 fport = inet->dport; |
47 | return inet6_ehashfn(laddr, lport, faddr, fport); | 47 | return inet6_ehashfn(laddr, lport, faddr, fport); |
48 | } | 48 | } |
49 | 49 | ||
@@ -57,7 +57,7 @@ extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk); | |||
57 | */ | 57 | */ |
58 | extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, | 58 | extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, |
59 | const struct in6_addr *saddr, | 59 | const struct in6_addr *saddr, |
60 | const u16 sport, | 60 | const __be16 sport, |
61 | const struct in6_addr *daddr, | 61 | const struct in6_addr *daddr, |
62 | const u16 hnum, | 62 | const u16 hnum, |
63 | const int dif); | 63 | const int dif); |
@@ -69,7 +69,7 @@ extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, | |||
69 | 69 | ||
70 | static inline struct sock *__inet6_lookup(struct inet_hashinfo *hashinfo, | 70 | static inline struct sock *__inet6_lookup(struct inet_hashinfo *hashinfo, |
71 | const struct in6_addr *saddr, | 71 | const struct in6_addr *saddr, |
72 | const u16 sport, | 72 | const __be16 sport, |
73 | const struct in6_addr *daddr, | 73 | const struct in6_addr *daddr, |
74 | const u16 hnum, | 74 | const u16 hnum, |
75 | const int dif) | 75 | const int dif) |
@@ -83,8 +83,8 @@ static inline struct sock *__inet6_lookup(struct inet_hashinfo *hashinfo, | |||
83 | } | 83 | } |
84 | 84 | ||
85 | extern struct sock *inet6_lookup(struct inet_hashinfo *hashinfo, | 85 | extern struct sock *inet6_lookup(struct inet_hashinfo *hashinfo, |
86 | const struct in6_addr *saddr, const u16 sport, | 86 | const struct in6_addr *saddr, const __be16 sport, |
87 | const struct in6_addr *daddr, const u16 dport, | 87 | const struct in6_addr *daddr, const __be16 dport, |
88 | const int dif); | 88 | const int dif); |
89 | #endif /* defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) */ | 89 | #endif /* defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) */ |
90 | #endif /* _INET6_HASHTABLES_H */ | 90 | #endif /* _INET6_HASHTABLES_H */ |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 0bcf9f237e1f..cccea051e922 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -36,7 +36,8 @@ struct tcp_congestion_ops; | |||
36 | * (i.e. things that depend on the address family) | 36 | * (i.e. things that depend on the address family) |
37 | */ | 37 | */ |
38 | struct inet_connection_sock_af_ops { | 38 | struct inet_connection_sock_af_ops { |
39 | int (*queue_xmit)(struct sk_buff *skb, int ipfragok); | 39 | int (*queue_xmit)(struct sk_buff *skb, struct sock *sk, |
40 | int ipfragok); | ||
40 | void (*send_check)(struct sock *sk, int len, | 41 | void (*send_check)(struct sock *sk, int len, |
41 | struct sk_buff *skb); | 42 | struct sk_buff *skb); |
42 | int (*rebuild_header)(struct sock *sk); | 43 | int (*rebuild_header)(struct sock *sk); |
@@ -45,7 +46,8 @@ struct inet_connection_sock_af_ops { | |||
45 | struct request_sock *req, | 46 | struct request_sock *req, |
46 | struct dst_entry *dst); | 47 | struct dst_entry *dst); |
47 | int (*remember_stamp)(struct sock *sk); | 48 | int (*remember_stamp)(struct sock *sk); |
48 | __u16 net_header_len; | 49 | u16 net_header_len; |
50 | u16 sockaddr_len; | ||
49 | int (*setsockopt)(struct sock *sk, int level, int optname, | 51 | int (*setsockopt)(struct sock *sk, int level, int optname, |
50 | char __user *optval, int optlen); | 52 | char __user *optval, int optlen); |
51 | int (*getsockopt)(struct sock *sk, int level, int optname, | 53 | int (*getsockopt)(struct sock *sk, int level, int optname, |
@@ -57,7 +59,6 @@ struct inet_connection_sock_af_ops { | |||
57 | int level, int optname, | 59 | int level, int optname, |
58 | char __user *optval, int __user *optlen); | 60 | char __user *optval, int __user *optlen); |
59 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); | 61 | void (*addr2sockaddr)(struct sock *sk, struct sockaddr *); |
60 | int sockaddr_len; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /** inet_connection_sock - INET connection oriented sock | 64 | /** inet_connection_sock - INET connection oriented sock |
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index d599c6bfbb86..10117c8503e8 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -48,12 +48,12 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | |||
48 | 48 | ||
49 | #define IP6_ECN_flow_xmit(sk, label) do { \ | 49 | #define IP6_ECN_flow_xmit(sk, label) do { \ |
50 | if (INET_ECN_is_capable(inet_sk(sk)->tos)) \ | 50 | if (INET_ECN_is_capable(inet_sk(sk)->tos)) \ |
51 | (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \ | 51 | (label) |= htonl(INET_ECN_ECT_0 << 20); \ |
52 | } while (0) | 52 | } while (0) |
53 | 53 | ||
54 | static inline int IP_ECN_set_ce(struct iphdr *iph) | 54 | static inline int IP_ECN_set_ce(struct iphdr *iph) |
55 | { | 55 | { |
56 | u32 check = iph->check; | 56 | u32 check = (__force u32)iph->check; |
57 | u32 ecn = (iph->tos + 1) & INET_ECN_MASK; | 57 | u32 ecn = (iph->tos + 1) & INET_ECN_MASK; |
58 | 58 | ||
59 | /* | 59 | /* |
@@ -71,9 +71,9 @@ static inline int IP_ECN_set_ce(struct iphdr *iph) | |||
71 | * INET_ECN_ECT_1 => check += htons(0xFFFD) | 71 | * INET_ECN_ECT_1 => check += htons(0xFFFD) |
72 | * INET_ECN_ECT_0 => check += htons(0xFFFE) | 72 | * INET_ECN_ECT_0 => check += htons(0xFFFE) |
73 | */ | 73 | */ |
74 | check += htons(0xFFFB) + htons(ecn); | 74 | check += (__force u16)htons(0xFFFB) + (__force u16)htons(ecn); |
75 | 75 | ||
76 | iph->check = check + (check>=0xFFFF); | 76 | iph->check = (__force __sum16)(check + (check>=0xFFFF)); |
77 | iph->tos |= INET_ECN_CE; | 77 | iph->tos |= INET_ECN_CE; |
78 | return 1; | 78 | return 1; |
79 | } | 79 | } |
@@ -95,13 +95,13 @@ static inline int IP6_ECN_set_ce(struct ipv6hdr *iph) | |||
95 | { | 95 | { |
96 | if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) | 96 | if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) |
97 | return 0; | 97 | return 0; |
98 | *(u32*)iph |= htonl(INET_ECN_CE << 20); | 98 | *(__be32*)iph |= htonl(INET_ECN_CE << 20); |
99 | return 1; | 99 | return 1; |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline void IP6_ECN_clear(struct ipv6hdr *iph) | 102 | static inline void IP6_ECN_clear(struct ipv6hdr *iph) |
103 | { | 103 | { |
104 | *(u32*)iph &= ~htonl(INET_ECN_MASK << 20); | 104 | *(__be32*)iph &= ~htonl(INET_ECN_MASK << 20); |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline void ipv6_copy_dscp(struct ipv6hdr *outer, struct ipv6hdr *inner) | 107 | static inline void ipv6_copy_dscp(struct ipv6hdr *outer, struct ipv6hdr *inner) |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 925573fd2aed..aa10a8178e70 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -17,14 +17,15 @@ | |||
17 | 17 | ||
18 | struct inet_peer | 18 | struct inet_peer |
19 | { | 19 | { |
20 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | ||
20 | struct inet_peer *avl_left, *avl_right; | 21 | struct inet_peer *avl_left, *avl_right; |
21 | struct inet_peer *unused_next, **unused_prevp; | ||
22 | unsigned long dtime; /* the time of last use of not | ||
23 | * referenced entries */ | ||
24 | atomic_t refcnt; | ||
25 | __be32 v4daddr; /* peer's address */ | 22 | __be32 v4daddr; /* peer's address */ |
26 | __u16 avl_height; | 23 | __u16 avl_height; |
27 | __u16 ip_id_count; /* IP ID for the next packet */ | 24 | __u16 ip_id_count; /* IP ID for the next packet */ |
25 | struct inet_peer *unused_next, **unused_prevp; | ||
26 | __u32 dtime; /* the time of last use of not | ||
27 | * referenced entries */ | ||
28 | atomic_t refcnt; | ||
28 | atomic_t rid; /* Frag reception counter */ | 29 | atomic_t rid; /* Frag reception counter */ |
29 | __u32 tcp_ts; | 30 | __u32 tcp_ts; |
30 | unsigned long tcp_ts_stamp; | 31 | unsigned long tcp_ts_stamp; |
@@ -35,21 +36,8 @@ void inet_initpeers(void) __init; | |||
35 | /* can be called with or without local BH being disabled */ | 36 | /* can be called with or without local BH being disabled */ |
36 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | 37 | struct inet_peer *inet_getpeer(__be32 daddr, int create); |
37 | 38 | ||
38 | extern spinlock_t inet_peer_unused_lock; | ||
39 | extern struct inet_peer **inet_peer_unused_tailp; | ||
40 | /* can be called from BH context or outside */ | 39 | /* can be called from BH context or outside */ |
41 | static inline void inet_putpeer(struct inet_peer *p) | 40 | extern void inet_putpeer(struct inet_peer *p); |
42 | { | ||
43 | spin_lock_bh(&inet_peer_unused_lock); | ||
44 | if (atomic_dec_and_test(&p->refcnt)) { | ||
45 | p->unused_prevp = inet_peer_unused_tailp; | ||
46 | p->unused_next = NULL; | ||
47 | *inet_peer_unused_tailp = p; | ||
48 | inet_peer_unused_tailp = &p->unused_next; | ||
49 | p->dtime = jiffies; | ||
50 | } | ||
51 | spin_unlock_bh(&inet_peer_unused_lock); | ||
52 | } | ||
53 | 41 | ||
54 | extern spinlock_t inet_peer_idlock; | 42 | extern spinlock_t inet_peer_idlock; |
55 | /* can be called with or without local BH being disabled */ | 43 | /* can be called with or without local BH being disabled */ |
diff --git a/include/net/ip.h b/include/net/ip.h index b6d95e553401..83cb9ac5554e 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -97,7 +97,7 @@ extern int ip_mc_output(struct sk_buff *skb); | |||
97 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 97 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
98 | extern int ip_do_nat(struct sk_buff *skb); | 98 | extern int ip_do_nat(struct sk_buff *skb); |
99 | extern void ip_send_check(struct iphdr *ip); | 99 | extern void ip_send_check(struct iphdr *ip); |
100 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | 100 | extern int ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok); |
101 | extern void ip_init(void); | 101 | extern void ip_init(void); |
102 | extern int ip_append_data(struct sock *sk, | 102 | extern int ip_append_data(struct sock *sk, |
103 | int getfrag(void *from, char *to, int offset, int len, | 103 | int getfrag(void *from, char *to, int offset, int len, |
@@ -123,7 +123,7 @@ extern int ip4_datagram_connect(struct sock *sk, | |||
123 | * multicast packets. | 123 | * multicast packets. |
124 | */ | 124 | */ |
125 | 125 | ||
126 | static inline void ip_tr_mc_map(u32 addr, char *buf) | 126 | static inline void ip_tr_mc_map(__be32 addr, char *buf) |
127 | { | 127 | { |
128 | buf[0]=0xC0; | 128 | buf[0]=0xC0; |
129 | buf[1]=0x00; | 129 | buf[1]=0x00; |
@@ -135,7 +135,7 @@ static inline void ip_tr_mc_map(u32 addr, char *buf) | |||
135 | 135 | ||
136 | struct ip_reply_arg { | 136 | struct ip_reply_arg { |
137 | struct kvec iov[1]; | 137 | struct kvec iov[1]; |
138 | u32 csum; | 138 | __wsum csum; |
139 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ | 139 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ |
140 | /* -1 if not needed */ | 140 | /* -1 if not needed */ |
141 | }; | 141 | }; |
@@ -192,9 +192,9 @@ extern void ipfrag_init(void); | |||
192 | static inline | 192 | static inline |
193 | int ip_decrease_ttl(struct iphdr *iph) | 193 | int ip_decrease_ttl(struct iphdr *iph) |
194 | { | 194 | { |
195 | u32 check = iph->check; | 195 | u32 check = (__force u32)iph->check; |
196 | check += htons(0x0100); | 196 | check += (__force u32)htons(0x0100); |
197 | iph->check = check + (check>=0xFFFF); | 197 | iph->check = (__force __sum16)(check + (check>=0xFFFF)); |
198 | return --iph->ttl; | 198 | return --iph->ttl; |
199 | } | 199 | } |
200 | 200 | ||
@@ -238,9 +238,9 @@ static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst | |||
238 | * Map a multicast IP onto multicast MAC for type ethernet. | 238 | * Map a multicast IP onto multicast MAC for type ethernet. |
239 | */ | 239 | */ |
240 | 240 | ||
241 | static inline void ip_eth_mc_map(u32 addr, char *buf) | 241 | static inline void ip_eth_mc_map(__be32 naddr, char *buf) |
242 | { | 242 | { |
243 | addr=ntohl(addr); | 243 | __u32 addr=ntohl(naddr); |
244 | buf[0]=0x01; | 244 | buf[0]=0x01; |
245 | buf[1]=0x00; | 245 | buf[1]=0x00; |
246 | buf[2]=0x5e; | 246 | buf[2]=0x5e; |
@@ -256,13 +256,14 @@ static inline void ip_eth_mc_map(u32 addr, char *buf) | |||
256 | * Leave P_Key as 0 to be filled in by driver. | 256 | * Leave P_Key as 0 to be filled in by driver. |
257 | */ | 257 | */ |
258 | 258 | ||
259 | static inline void ip_ib_mc_map(u32 addr, char *buf) | 259 | static inline void ip_ib_mc_map(__be32 naddr, char *buf) |
260 | { | 260 | { |
261 | __u32 addr; | ||
261 | buf[0] = 0; /* Reserved */ | 262 | buf[0] = 0; /* Reserved */ |
262 | buf[1] = 0xff; /* Multicast QPN */ | 263 | buf[1] = 0xff; /* Multicast QPN */ |
263 | buf[2] = 0xff; | 264 | buf[2] = 0xff; |
264 | buf[3] = 0xff; | 265 | buf[3] = 0xff; |
265 | addr = ntohl(addr); | 266 | addr = ntohl(naddr); |
266 | buf[4] = 0xff; | 267 | buf[4] = 0xff; |
267 | buf[5] = 0x12; /* link local scope */ | 268 | buf[5] = 0x12; /* link local scope */ |
268 | buf[6] = 0x40; /* IPv4 signature */ | 269 | buf[6] = 0x40; /* IPv4 signature */ |
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index 3dfc885bdf25..68e2b32cf1d6 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -34,60 +34,60 @@ | |||
34 | 34 | ||
35 | #ifndef _HAVE_ARCH_IPV6_CSUM | 35 | #ifndef _HAVE_ARCH_IPV6_CSUM |
36 | 36 | ||
37 | static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | 37 | static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, |
38 | struct in6_addr *daddr, | 38 | const struct in6_addr *daddr, |
39 | __u16 len, | 39 | __u32 len, unsigned short proto, |
40 | unsigned short proto, | 40 | __wsum csum) |
41 | unsigned int csum) | ||
42 | { | 41 | { |
43 | 42 | ||
44 | int carry; | 43 | int carry; |
45 | __u32 ulen; | 44 | __u32 ulen; |
46 | __u32 uproto; | 45 | __u32 uproto; |
46 | __u32 sum = (__force u32)csum; | ||
47 | 47 | ||
48 | csum += saddr->s6_addr32[0]; | 48 | sum += (__force u32)saddr->s6_addr32[0]; |
49 | carry = (csum < saddr->s6_addr32[0]); | 49 | carry = (sum < (__force u32)saddr->s6_addr32[0]); |
50 | csum += carry; | 50 | sum += carry; |
51 | 51 | ||
52 | csum += saddr->s6_addr32[1]; | 52 | sum += (__force u32)saddr->s6_addr32[1]; |
53 | carry = (csum < saddr->s6_addr32[1]); | 53 | carry = (sum < (__force u32)saddr->s6_addr32[1]); |
54 | csum += carry; | 54 | sum += carry; |
55 | 55 | ||
56 | csum += saddr->s6_addr32[2]; | 56 | sum += (__force u32)saddr->s6_addr32[2]; |
57 | carry = (csum < saddr->s6_addr32[2]); | 57 | carry = (sum < (__force u32)saddr->s6_addr32[2]); |
58 | csum += carry; | 58 | sum += carry; |
59 | 59 | ||
60 | csum += saddr->s6_addr32[3]; | 60 | sum += (__force u32)saddr->s6_addr32[3]; |
61 | carry = (csum < saddr->s6_addr32[3]); | 61 | carry = (sum < (__force u32)saddr->s6_addr32[3]); |
62 | csum += carry; | 62 | sum += carry; |
63 | 63 | ||
64 | csum += daddr->s6_addr32[0]; | 64 | sum += (__force u32)daddr->s6_addr32[0]; |
65 | carry = (csum < daddr->s6_addr32[0]); | 65 | carry = (sum < (__force u32)daddr->s6_addr32[0]); |
66 | csum += carry; | 66 | sum += carry; |
67 | 67 | ||
68 | csum += daddr->s6_addr32[1]; | 68 | sum += (__force u32)daddr->s6_addr32[1]; |
69 | carry = (csum < daddr->s6_addr32[1]); | 69 | carry = (sum < (__force u32)daddr->s6_addr32[1]); |
70 | csum += carry; | 70 | sum += carry; |
71 | 71 | ||
72 | csum += daddr->s6_addr32[2]; | 72 | sum += (__force u32)daddr->s6_addr32[2]; |
73 | carry = (csum < daddr->s6_addr32[2]); | 73 | carry = (sum < (__force u32)daddr->s6_addr32[2]); |
74 | csum += carry; | 74 | sum += carry; |
75 | 75 | ||
76 | csum += daddr->s6_addr32[3]; | 76 | sum += (__force u32)daddr->s6_addr32[3]; |
77 | carry = (csum < daddr->s6_addr32[3]); | 77 | carry = (sum < (__force u32)daddr->s6_addr32[3]); |
78 | csum += carry; | 78 | sum += carry; |
79 | 79 | ||
80 | ulen = htonl((__u32) len); | 80 | ulen = (__force u32)htonl((__u32) len); |
81 | csum += ulen; | 81 | sum += ulen; |
82 | carry = (csum < ulen); | 82 | carry = (sum < ulen); |
83 | csum += carry; | 83 | sum += carry; |
84 | 84 | ||
85 | uproto = htonl(proto); | 85 | uproto = (__force u32)htonl(proto); |
86 | csum += uproto; | 86 | sum += uproto; |
87 | carry = (csum < uproto); | 87 | carry = (sum < uproto); |
88 | csum += carry; | 88 | sum += carry; |
89 | 89 | ||
90 | return csum_fold(csum); | 90 | return csum_fold((__force __wsum)csum); |
91 | } | 91 | } |
92 | 92 | ||
93 | #endif | 93 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index e4438de3bd6b..f9cde44f93b4 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -107,6 +107,11 @@ struct rt6_info | |||
107 | u8 rt6i_protocol; | 107 | u8 rt6i_protocol; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | ||
111 | { | ||
112 | return ((struct rt6_info *)dst)->rt6i_idev; | ||
113 | } | ||
114 | |||
110 | struct fib6_walker_t | 115 | struct fib6_walker_t |
111 | { | 116 | { |
112 | struct fib6_walker_t *prev, *next; | 117 | struct fib6_walker_t *prev, *next; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 6ca6b71dfe0f..4e927ebd1cb3 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -20,7 +20,7 @@ struct route_info { | |||
20 | route_pref:2, | 20 | route_pref:2, |
21 | reserved_h:3; | 21 | reserved_h:3; |
22 | #endif | 22 | #endif |
23 | __u32 lifetime; | 23 | __be32 lifetime; |
24 | __u8 prefix[0]; /* 0,8 or 16 */ | 24 | __u8 prefix[0]; /* 0,8 or 16 */ |
25 | }; | 25 | }; |
26 | 26 | ||
@@ -36,13 +36,6 @@ struct route_info { | |||
36 | #define RT6_LOOKUP_F_REACHABLE 0x2 | 36 | #define RT6_LOOKUP_F_REACHABLE 0x2 |
37 | #define RT6_LOOKUP_F_HAS_SADDR 0x4 | 37 | #define RT6_LOOKUP_F_HAS_SADDR 0x4 |
38 | 38 | ||
39 | struct pol_chain { | ||
40 | int type; | ||
41 | int priority; | ||
42 | struct fib6_node *rules; | ||
43 | struct pol_chain *next; | ||
44 | }; | ||
45 | |||
46 | extern struct rt6_info ip6_null_entry; | 39 | extern struct rt6_info ip6_null_entry; |
47 | 40 | ||
48 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 41 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 82229146bac7..36c635ca1aa6 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -21,17 +21,14 @@ | |||
21 | #include <net/fib_rules.h> | 21 | #include <net/fib_rules.h> |
22 | 22 | ||
23 | struct fib_config { | 23 | struct fib_config { |
24 | u8 fc_family; | ||
25 | u8 fc_dst_len; | 24 | u8 fc_dst_len; |
26 | u8 fc_src_len; | ||
27 | u8 fc_tos; | 25 | u8 fc_tos; |
28 | u8 fc_protocol; | 26 | u8 fc_protocol; |
29 | u8 fc_scope; | 27 | u8 fc_scope; |
30 | u8 fc_type; | 28 | u8 fc_type; |
31 | /* 1 byte unused */ | 29 | /* 3 bytes unused */ |
32 | u32 fc_table; | 30 | u32 fc_table; |
33 | __be32 fc_dst; | 31 | __be32 fc_dst; |
34 | __be32 fc_src; | ||
35 | __be32 fc_gw; | 32 | __be32 fc_gw; |
36 | int fc_oif; | 33 | int fc_oif; |
37 | u32 fc_flags; | 34 | u32 fc_flags; |
@@ -118,7 +115,7 @@ struct fib_result { | |||
118 | 115 | ||
119 | struct fib_result_nl { | 116 | struct fib_result_nl { |
120 | __be32 fl_addr; /* To be looked up*/ | 117 | __be32 fl_addr; /* To be looked up*/ |
121 | u32 fl_fwmark; | 118 | u32 fl_mark; |
122 | unsigned char fl_tos; | 119 | unsigned char fl_tos; |
123 | unsigned char fl_scope; | 120 | unsigned char fl_scope; |
124 | unsigned char tb_id_in; | 121 | unsigned char tb_id_in; |
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h index beffdd66ad74..25b56571e54b 100644 --- a/include/net/ip_mp_alg.h +++ b/include/net/ip_mp_alg.h | |||
@@ -88,9 +88,7 @@ static inline int multipath_comparekeys(const struct flowi *flp1, | |||
88 | return flp1->fl4_dst == flp2->fl4_dst && | 88 | return flp1->fl4_dst == flp2->fl4_dst && |
89 | flp1->fl4_src == flp2->fl4_src && | 89 | flp1->fl4_src == flp2->fl4_src && |
90 | flp1->oif == flp2->oif && | 90 | flp1->oif == flp2->oif && |
91 | #ifdef CONFIG_IP_ROUTE_FWMARK | 91 | flp1->mark == flp2->mark && |
92 | flp1->fl4_fwmark == flp2->fl4_fwmark && | ||
93 | #endif | ||
94 | !((flp1->fl4_tos ^ flp2->fl4_tos) & | 92 | !((flp1->fl4_tos ^ flp2->fl4_tos) & |
95 | (IPTOS_RT_MASK | RTO_ONLINK)); | 93 | (IPTOS_RT_MASK | RTO_ONLINK)); |
96 | } | 94 | } |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 49c717e3b040..672564e5a81d 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #define _IP_VS_H | 7 | #define _IP_VS_H |
8 | 8 | ||
9 | #include <asm/types.h> /* For __uXX types */ | 9 | #include <asm/types.h> /* For __uXX types */ |
10 | #include <linux/types.h> /* For __beXX types in userland */ | ||
10 | 11 | ||
11 | #define IP_VS_VERSION_CODE 0x010201 | 12 | #define IP_VS_VERSION_CODE 0x010201 |
12 | #define NVERSION(version) \ | 13 | #define NVERSION(version) \ |
@@ -987,14 +988,20 @@ extern int ip_vs_make_skb_writable(struct sk_buff **pskb, int len); | |||
987 | extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, | 988 | extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, |
988 | struct ip_vs_conn *cp, int dir); | 989 | struct ip_vs_conn *cp, int dir); |
989 | 990 | ||
990 | extern u16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); | 991 | extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); |
991 | 992 | ||
992 | static inline u16 ip_vs_check_diff(u32 old, u32 new, u16 oldsum) | 993 | static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) |
993 | { | 994 | { |
994 | u32 diff[2] = { old, new }; | 995 | __be32 diff[2] = { ~old, new }; |
995 | 996 | ||
996 | return csum_fold(csum_partial((char *) diff, sizeof(diff), | 997 | return csum_partial((char *) diff, sizeof(diff), oldsum); |
997 | oldsum ^ 0xFFFF)); | 998 | } |
999 | |||
1000 | static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) | ||
1001 | { | ||
1002 | __be16 diff[2] = { ~old, new }; | ||
1003 | |||
1004 | return csum_partial((char *) diff, sizeof(diff), oldsum); | ||
998 | } | 1005 | } |
999 | 1006 | ||
1000 | #endif /* __KERNEL__ */ | 1007 | #endif /* __KERNEL__ */ |
diff --git a/include/net/ipconfig.h b/include/net/ipconfig.h index 2a1fe996fbc6..3924d7d2cb11 100644 --- a/include/net/ipconfig.h +++ b/include/net/ipconfig.h | |||
@@ -11,12 +11,12 @@ | |||
11 | extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */ | 11 | extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */ |
12 | extern int ic_set_manually; /* IPconfig parameters set manually */ | 12 | extern int ic_set_manually; /* IPconfig parameters set manually */ |
13 | 13 | ||
14 | extern u32 ic_myaddr; /* My IP address */ | 14 | extern __be32 ic_myaddr; /* My IP address */ |
15 | extern u32 ic_gateway; /* Gateway IP address */ | 15 | extern __be32 ic_gateway; /* Gateway IP address */ |
16 | 16 | ||
17 | extern u32 ic_servaddr; /* Boot server IP address */ | 17 | extern __be32 ic_servaddr; /* Boot server IP address */ |
18 | 18 | ||
19 | extern u32 root_server_addr; /* Address of NFS server */ | 19 | extern __be32 root_server_addr; /* Address of NFS server */ |
20 | extern u8 root_server_path[]; /* Path to mount as root */ | 20 | extern u8 root_server_path[]; /* Path to mount as root */ |
21 | 21 | ||
22 | 22 | ||
diff --git a/include/net/ipip.h b/include/net/ipip.h index f490c3cbe377..7cdc914322f0 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -35,7 +35,7 @@ struct ip_tunnel | |||
35 | ip_send_check(iph); \ | 35 | ip_send_check(iph); \ |
36 | \ | 36 | \ |
37 | err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\ | 37 | err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\ |
38 | if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) { \ | 38 | if (net_xmit_eval(err) == 0) { \ |
39 | stats->tx_bytes += pkt_len; \ | 39 | stats->tx_bytes += pkt_len; \ |
40 | stats->tx_packets++; \ | 40 | stats->tx_packets++; \ |
41 | } else { \ | 41 | } else { \ |
@@ -44,8 +44,4 @@ struct ip_tunnel | |||
44 | } \ | 44 | } \ |
45 | } while (0) | 45 | } while (0) |
46 | 46 | ||
47 | |||
48 | extern int sit_init(void); | ||
49 | extern void sit_cleanup(void); | ||
50 | |||
51 | #endif | 47 | #endif |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 8223c4410b4b..00328b71a08c 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -95,10 +95,10 @@ | |||
95 | */ | 95 | */ |
96 | 96 | ||
97 | struct frag_hdr { | 97 | struct frag_hdr { |
98 | unsigned char nexthdr; | 98 | __u8 nexthdr; |
99 | unsigned char reserved; | 99 | __u8 reserved; |
100 | unsigned short frag_off; | 100 | __be16 frag_off; |
101 | __u32 identification; | 101 | __be32 identification; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | #define IP6_MF 0x0001 | 104 | #define IP6_MF 0x0001 |
@@ -113,9 +113,24 @@ extern int sysctl_mld_max_msf; | |||
113 | 113 | ||
114 | /* MIBs */ | 114 | /* MIBs */ |
115 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); | 115 | DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); |
116 | #define IP6_INC_STATS(field) SNMP_INC_STATS(ipv6_statistics, field) | 116 | #define IP6_INC_STATS(idev,field) ({ \ |
117 | #define IP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(ipv6_statistics, field) | 117 | struct inet6_dev *_idev = (idev); \ |
118 | #define IP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(ipv6_statistics, field) | 118 | if (likely(_idev != NULL)) \ |
119 | SNMP_INC_STATS(_idev->stats.ipv6, field); \ | ||
120 | SNMP_INC_STATS(ipv6_statistics, field); \ | ||
121 | }) | ||
122 | #define IP6_INC_STATS_BH(idev,field) ({ \ | ||
123 | struct inet6_dev *_idev = (idev); \ | ||
124 | if (likely(_idev != NULL)) \ | ||
125 | SNMP_INC_STATS_BH(_idev->stats.ipv6, field); \ | ||
126 | SNMP_INC_STATS_BH(ipv6_statistics, field); \ | ||
127 | }) | ||
128 | #define IP6_INC_STATS_USER(idev,field) ({ \ | ||
129 | struct inet6_dev *_idev = (idev); \ | ||
130 | if (likely(_idev != NULL)) \ | ||
131 | SNMP_INC_STATS_USER(_idev->stats.ipv6, field); \ | ||
132 | SNMP_INC_STATS_USER(ipv6_statistics, field); \ | ||
133 | }) | ||
119 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | 134 | DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); |
120 | #define ICMP6_INC_STATS(idev, field) ({ \ | 135 | #define ICMP6_INC_STATS(idev, field) ({ \ |
121 | struct inet6_dev *_idev = (idev); \ | 136 | struct inet6_dev *_idev = (idev); \ |
@@ -143,9 +158,13 @@ DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); | |||
143 | SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \ | 158 | SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \ |
144 | }) | 159 | }) |
145 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); | 160 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); |
146 | #define UDP6_INC_STATS(field) SNMP_INC_STATS(udp_stats_in6, field) | 161 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); |
147 | #define UDP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(udp_stats_in6, field) | 162 | #define UDP6_INC_STATS_BH(field, is_udplite) do { \ |
148 | #define UDP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(udp_stats_in6, field) | 163 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ |
164 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) | ||
165 | #define UDP6_INC_STATS_USER(field, is_udplite) do { \ | ||
166 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ | ||
167 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) | ||
149 | 168 | ||
150 | int snmp6_register_dev(struct inet6_dev *idev); | 169 | int snmp6_register_dev(struct inet6_dev *idev); |
151 | int snmp6_unregister_dev(struct inet6_dev *idev); | 170 | int snmp6_unregister_dev(struct inet6_dev *idev); |
@@ -191,7 +210,7 @@ struct ipv6_txoptions | |||
191 | struct ip6_flowlabel | 210 | struct ip6_flowlabel |
192 | { | 211 | { |
193 | struct ip6_flowlabel *next; | 212 | struct ip6_flowlabel *next; |
194 | u32 label; | 213 | __be32 label; |
195 | struct in6_addr dst; | 214 | struct in6_addr dst; |
196 | struct ipv6_txoptions *opt; | 215 | struct ipv6_txoptions *opt; |
197 | atomic_t users; | 216 | atomic_t users; |
@@ -211,7 +230,7 @@ struct ipv6_fl_socklist | |||
211 | struct ip6_flowlabel *fl; | 230 | struct ip6_flowlabel *fl; |
212 | }; | 231 | }; |
213 | 232 | ||
214 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, u32 label); | 233 | extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); |
215 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, | 234 | extern struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, |
216 | struct ip6_flowlabel * fl, | 235 | struct ip6_flowlabel * fl, |
217 | struct ipv6_txoptions * fopt); | 236 | struct ipv6_txoptions * fopt); |
@@ -375,22 +394,15 @@ static inline int ipv6_addr_any(const struct in6_addr *a) | |||
375 | */ | 394 | */ |
376 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) | 395 | static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) |
377 | { | 396 | { |
378 | const __u32 *a1 = token1, *a2 = token2; | 397 | const __be32 *a1 = token1, *a2 = token2; |
379 | int i; | 398 | int i; |
380 | 399 | ||
381 | addrlen >>= 2; | 400 | addrlen >>= 2; |
382 | 401 | ||
383 | for (i = 0; i < addrlen; i++) { | 402 | for (i = 0; i < addrlen; i++) { |
384 | __u32 xb = a1[i] ^ a2[i]; | 403 | __be32 xb = a1[i] ^ a2[i]; |
385 | if (xb) { | 404 | if (xb) |
386 | int j = 31; | 405 | return i * 32 + 32 - fls(ntohl(xb)); |
387 | |||
388 | xb = ntohl(xb); | ||
389 | while ((xb & (1 << j)) == 0) | ||
390 | j--; | ||
391 | |||
392 | return (i * 32 + 31 - j); | ||
393 | } | ||
394 | } | 406 | } |
395 | 407 | ||
396 | /* | 408 | /* |
@@ -544,7 +556,7 @@ extern int ip6_datagram_connect(struct sock *sk, | |||
544 | struct sockaddr *addr, int addr_len); | 556 | struct sockaddr *addr, int addr_len); |
545 | 557 | ||
546 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 558 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); |
547 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, | 559 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
548 | u32 info, u8 *payload); | 560 | u32 info, u8 *payload); |
549 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); | 561 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); |
550 | 562 | ||
@@ -589,6 +601,8 @@ extern int tcp6_proc_init(void); | |||
589 | extern void tcp6_proc_exit(void); | 601 | extern void tcp6_proc_exit(void); |
590 | extern int udp6_proc_init(void); | 602 | extern int udp6_proc_init(void); |
591 | extern void udp6_proc_exit(void); | 603 | extern void udp6_proc_exit(void); |
604 | extern int udplite6_proc_init(void); | ||
605 | extern void udplite6_proc_exit(void); | ||
592 | extern int ipv6_misc_proc_init(void); | 606 | extern int ipv6_misc_proc_init(void); |
593 | extern void ipv6_misc_proc_exit(void); | 607 | extern void ipv6_misc_proc_exit(void); |
594 | 608 | ||
diff --git a/include/net/ipx.h b/include/net/ipx.h index 5c0cf33826c5..c6b2ee610866 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -15,9 +15,9 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | 16 | ||
17 | struct ipx_address { | 17 | struct ipx_address { |
18 | __u32 net; | 18 | __be32 net; |
19 | __u8 node[IPX_NODE_LEN]; | 19 | __u8 node[IPX_NODE_LEN]; |
20 | __u16 sock; | 20 | __be16 sock; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #define ipx_broadcast_node "\377\377\377\377\377\377" | 23 | #define ipx_broadcast_node "\377\377\377\377\377\377" |
@@ -26,9 +26,9 @@ struct ipx_address { | |||
26 | #define IPX_MAX_PPROP_HOPS 8 | 26 | #define IPX_MAX_PPROP_HOPS 8 |
27 | 27 | ||
28 | struct ipxhdr { | 28 | struct ipxhdr { |
29 | __u16 ipx_checksum __attribute__ ((packed)); | 29 | __be16 ipx_checksum __attribute__ ((packed)); |
30 | #define IPX_NO_CHECKSUM 0xFFFF | 30 | #define IPX_NO_CHECKSUM __constant_htons(0xFFFF) |
31 | __u16 ipx_pktsize __attribute__ ((packed)); | 31 | __be16 ipx_pktsize __attribute__ ((packed)); |
32 | __u8 ipx_tctrl; | 32 | __u8 ipx_tctrl; |
33 | __u8 ipx_type; | 33 | __u8 ipx_type; |
34 | #define IPX_TYPE_UNKNOWN 0x00 | 34 | #define IPX_TYPE_UNKNOWN 0x00 |
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) | |||
48 | 48 | ||
49 | struct ipx_interface { | 49 | struct ipx_interface { |
50 | /* IPX address */ | 50 | /* IPX address */ |
51 | __u32 if_netnum; | 51 | __be32 if_netnum; |
52 | unsigned char if_node[IPX_NODE_LEN]; | 52 | unsigned char if_node[IPX_NODE_LEN]; |
53 | atomic_t refcnt; | 53 | atomic_t refcnt; |
54 | 54 | ||
55 | /* physical device info */ | 55 | /* physical device info */ |
56 | struct net_device *if_dev; | 56 | struct net_device *if_dev; |
57 | struct datalink_proto *if_dlink; | 57 | struct datalink_proto *if_dlink; |
58 | unsigned short if_dlink_type; | 58 | __be16 if_dlink_type; |
59 | 59 | ||
60 | /* socket support */ | 60 | /* socket support */ |
61 | unsigned short if_sknum; | 61 | unsigned short if_sknum; |
@@ -71,7 +71,7 @@ struct ipx_interface { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct ipx_route { | 73 | struct ipx_route { |
74 | __u32 ir_net; | 74 | __be32 ir_net; |
75 | struct ipx_interface *ir_intrfc; | 75 | struct ipx_interface *ir_intrfc; |
76 | unsigned char ir_routed; | 76 | unsigned char ir_routed; |
77 | unsigned char ir_router_node[IPX_NODE_LEN]; | 77 | unsigned char ir_router_node[IPX_NODE_LEN]; |
@@ -82,10 +82,10 @@ struct ipx_route { | |||
82 | #ifdef __KERNEL__ | 82 | #ifdef __KERNEL__ |
83 | struct ipx_cb { | 83 | struct ipx_cb { |
84 | u8 ipx_tctrl; | 84 | u8 ipx_tctrl; |
85 | u32 ipx_dest_net; | 85 | __be32 ipx_dest_net; |
86 | u32 ipx_source_net; | 86 | __be32 ipx_source_net; |
87 | struct { | 87 | struct { |
88 | u32 netnum; | 88 | __be32 netnum; |
89 | int index; | 89 | int index; |
90 | } last_hop; | 90 | } last_hop; |
91 | }; | 91 | }; |
@@ -97,7 +97,7 @@ struct ipx_sock { | |||
97 | struct sock sk; | 97 | struct sock sk; |
98 | struct ipx_address dest_addr; | 98 | struct ipx_address dest_addr; |
99 | struct ipx_interface *intrfc; | 99 | struct ipx_interface *intrfc; |
100 | unsigned short port; | 100 | __be16 port; |
101 | #ifdef CONFIG_IPX_INTERN | 101 | #ifdef CONFIG_IPX_INTERN |
102 | unsigned char node[IPX_NODE_LEN]; | 102 | unsigned char node[IPX_NODE_LEN]; |
103 | #endif | 103 | #endif |
@@ -132,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net; | |||
132 | extern int ipx_proc_init(void); | 132 | extern int ipx_proc_init(void); |
133 | extern void ipx_proc_exit(void); | 133 | extern void ipx_proc_exit(void); |
134 | 134 | ||
135 | extern const char *ipx_frame_name(unsigned short); | 135 | extern const char *ipx_frame_name(__be16); |
136 | extern const char *ipx_device_name(struct ipx_interface *intrfc); | 136 | extern const char *ipx_device_name(struct ipx_interface *intrfc); |
137 | 137 | ||
138 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) | 138 | static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) |
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h index 9dd54a5002b2..641f88e848bd 100644 --- a/include/net/irda/irlap_frame.h +++ b/include/net/irda/irlap_frame.h | |||
@@ -91,8 +91,8 @@ struct xid_frame { | |||
91 | __u8 caddr; /* Connection address */ | 91 | __u8 caddr; /* Connection address */ |
92 | __u8 control; | 92 | __u8 control; |
93 | __u8 ident; /* Should always be XID_FORMAT */ | 93 | __u8 ident; /* Should always be XID_FORMAT */ |
94 | __u32 saddr; /* Source device address */ | 94 | __le32 saddr; /* Source device address */ |
95 | __u32 daddr; /* Destination device address */ | 95 | __le32 daddr; /* Destination device address */ |
96 | __u8 flags; /* Discovery flags */ | 96 | __u8 flags; /* Discovery flags */ |
97 | __u8 slotnr; | 97 | __u8 slotnr; |
98 | __u8 version; | 98 | __u8 version; |
@@ -101,15 +101,15 @@ struct xid_frame { | |||
101 | struct test_frame { | 101 | struct test_frame { |
102 | __u8 caddr; /* Connection address */ | 102 | __u8 caddr; /* Connection address */ |
103 | __u8 control; | 103 | __u8 control; |
104 | __u32 saddr; /* Source device address */ | 104 | __le32 saddr; /* Source device address */ |
105 | __u32 daddr; /* Destination device address */ | 105 | __le32 daddr; /* Destination device address */ |
106 | } IRDA_PACK; | 106 | } IRDA_PACK; |
107 | 107 | ||
108 | struct ua_frame { | 108 | struct ua_frame { |
109 | __u8 caddr; | 109 | __u8 caddr; |
110 | __u8 control; | 110 | __u8 control; |
111 | __u32 saddr; /* Source device address */ | 111 | __le32 saddr; /* Source device address */ |
112 | __u32 daddr; /* Dest device address */ | 112 | __le32 daddr; /* Dest device address */ |
113 | } IRDA_PACK; | 113 | } IRDA_PACK; |
114 | 114 | ||
115 | struct dm_frame { | 115 | struct dm_frame { |
@@ -135,8 +135,8 @@ struct i_frame { | |||
135 | struct snrm_frame { | 135 | struct snrm_frame { |
136 | __u8 caddr; | 136 | __u8 caddr; |
137 | __u8 control; | 137 | __u8 control; |
138 | __u32 saddr; | 138 | __le32 saddr; |
139 | __u32 daddr; | 139 | __le32 daddr; |
140 | __u8 ncaddr; | 140 | __u8 ncaddr; |
141 | } IRDA_PACK; | 141 | } IRDA_PACK; |
142 | 142 | ||
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 8f6306581fa7..aa33a477c3fb 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -252,9 +252,9 @@ static inline void llc_pdu_header_init(struct sk_buff *skb, u8 type, | |||
252 | */ | 252 | */ |
253 | static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | 253 | static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) |
254 | { | 254 | { |
255 | if (skb->protocol == ntohs(ETH_P_802_2)) | 255 | if (skb->protocol == htons(ETH_P_802_2)) |
256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); | 256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); |
257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) { | 257 | else if (skb->protocol == htons(ETH_P_TR_802_2)) { |
258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); | 258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); |
259 | *sa &= 0x7F; | 259 | *sa &= 0x7F; |
260 | } | 260 | } |
@@ -269,9 +269,9 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | |||
269 | */ | 269 | */ |
270 | static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da) | 270 | static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da) |
271 | { | 271 | { |
272 | if (skb->protocol == ntohs(ETH_P_802_2)) | 272 | if (skb->protocol == htons(ETH_P_802_2)) |
273 | memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); | 273 | memcpy(da, eth_hdr(skb)->h_dest, ETH_ALEN); |
274 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) | 274 | else if (skb->protocol == htons(ETH_P_TR_802_2)) |
275 | memcpy(da, tr_hdr(skb)->daddr, ETH_ALEN); | 275 | memcpy(da, tr_hdr(skb)->daddr, ETH_ALEN); |
276 | } | 276 | } |
277 | 277 | ||
@@ -345,7 +345,7 @@ static inline void llc_pdu_init_as_test_rsp(struct sk_buff *skb, | |||
345 | pdu->ctrl_1 = LLC_PDU_TYPE_U; | 345 | pdu->ctrl_1 = LLC_PDU_TYPE_U; |
346 | pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST; | 346 | pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST; |
347 | pdu->ctrl_1 |= LLC_U_PF_BIT_MASK; | 347 | pdu->ctrl_1 |= LLC_U_PF_BIT_MASK; |
348 | if (ev_skb->protocol == ntohs(ETH_P_802_2)) { | 348 | if (ev_skb->protocol == htons(ETH_P_802_2)) { |
349 | struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb); | 349 | struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb); |
350 | int dsize; | 350 | int dsize; |
351 | 351 | ||
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index d3915dabe6de..475b10c575b3 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -66,8 +66,8 @@ struct rs_msg { | |||
66 | 66 | ||
67 | struct ra_msg { | 67 | struct ra_msg { |
68 | struct icmp6hdr icmph; | 68 | struct icmp6hdr icmph; |
69 | __u32 reachable_time; | 69 | __be32 reachable_time; |
70 | __u32 retrans_timer; | 70 | __be32 retrans_timer; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | struct nd_opt_hdr { | 73 | struct nd_opt_hdr { |
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h index 91684436af8e..1401ccc051c4 100644 --- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h +++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h | |||
@@ -9,32 +9,35 @@ | |||
9 | #ifndef _NF_CONNTRACK_IPV4_H | 9 | #ifndef _NF_CONNTRACK_IPV4_H |
10 | #define _NF_CONNTRACK_IPV4_H | 10 | #define _NF_CONNTRACK_IPV4_H |
11 | 11 | ||
12 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 12 | #ifdef CONFIG_NF_NAT_NEEDED |
13 | #include <linux/netfilter_ipv4/ip_nat.h> | 13 | #include <net/netfilter/nf_nat.h> |
14 | #include <linux/netfilter/nf_conntrack_pptp.h> | ||
14 | 15 | ||
15 | /* per conntrack: nat application helper private data */ | 16 | /* per conntrack: nat application helper private data */ |
16 | union ip_conntrack_nat_help { | 17 | union nf_conntrack_nat_help { |
17 | /* insert nat helper private data here */ | 18 | /* insert nat helper private data here */ |
19 | struct nf_nat_pptp nat_pptp_info; | ||
18 | }; | 20 | }; |
19 | 21 | ||
20 | struct nf_conntrack_ipv4_nat { | 22 | struct nf_conn_nat { |
21 | struct ip_nat_info info; | 23 | struct nf_nat_info info; |
22 | union ip_conntrack_nat_help help; | 24 | union nf_conntrack_nat_help help; |
23 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ | 25 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ |
24 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) | 26 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) |
25 | int masq_index; | 27 | int masq_index; |
26 | #endif | 28 | #endif |
27 | }; | 29 | }; |
28 | #endif /* CONFIG_IP_NF_NAT_NEEDED */ | 30 | #endif /* CONFIG_NF_NAT_NEEDED */ |
29 | |||
30 | struct nf_conntrack_ipv4 { | ||
31 | #ifdef CONFIG_IP_NF_NAT_NEEDED | ||
32 | struct nf_conntrack_ipv4_nat *nat; | ||
33 | #endif | ||
34 | }; | ||
35 | 31 | ||
36 | /* Returns new sk_buff, or NULL */ | 32 | /* Returns new sk_buff, or NULL */ |
37 | struct sk_buff * | 33 | struct sk_buff * |
38 | nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); | 34 | nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb); |
39 | 35 | ||
36 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4; | ||
37 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; | ||
38 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; | ||
39 | |||
40 | extern int nf_conntrack_ipv4_compat_init(void); | ||
41 | extern void nf_conntrack_ipv4_compat_fini(void); | ||
42 | |||
40 | #endif /*_NF_CONNTRACK_IPV4_H*/ | 43 | #endif /*_NF_CONNTRACK_IPV4_H*/ |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h new file mode 100644 index 000000000000..b4b6049e01fa --- /dev/null +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef _NF_CONNTRACK_IPV6_H | ||
2 | #define _NF_CONNTRACK_IPV6_H | ||
3 | |||
4 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; | ||
5 | |||
6 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; | ||
7 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; | ||
8 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | ||
9 | |||
10 | extern int nf_ct_ipv6_skip_exthdr(struct sk_buff *skb, int start, | ||
11 | u8 *nexthdrp, int len); | ||
12 | |||
13 | extern int nf_ct_frag6_init(void); | ||
14 | extern void nf_ct_frag6_cleanup(void); | ||
15 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); | ||
16 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | ||
17 | struct net_device *in, | ||
18 | struct net_device *out, | ||
19 | int (*okfn)(struct sk_buff *)); | ||
20 | |||
21 | extern unsigned int nf_ct_frag6_timeout; | ||
22 | extern unsigned int nf_ct_frag6_low_thresh; | ||
23 | extern unsigned int nf_ct_frag6_high_thresh; | ||
24 | |||
25 | #endif /* _NF_CONNTRACK_IPV6_H*/ | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 1fbd8193d5f1..032b36a0e378 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <linux/netfilter/nf_conntrack_tcp.h> | 22 | #include <linux/netfilter/nf_conntrack_tcp.h> |
23 | #include <linux/netfilter/nf_conntrack_sctp.h> | 23 | #include <linux/netfilter/nf_conntrack_sctp.h> |
24 | #include <linux/netfilter/nf_conntrack_proto_gre.h> | ||
24 | #include <net/netfilter/ipv4/nf_conntrack_icmp.h> | 25 | #include <net/netfilter/ipv4/nf_conntrack_icmp.h> |
25 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> | 26 | #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h> |
26 | 27 | ||
@@ -33,6 +34,7 @@ union nf_conntrack_proto { | |||
33 | struct ip_ct_tcp tcp; | 34 | struct ip_ct_tcp tcp; |
34 | struct ip_ct_icmp icmp; | 35 | struct ip_ct_icmp icmp; |
35 | struct nf_ct_icmpv6 icmpv6; | 36 | struct nf_ct_icmpv6 icmpv6; |
37 | struct nf_ct_gre gre; | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | union nf_conntrack_expect_proto { | 40 | union nf_conntrack_expect_proto { |
@@ -41,11 +43,15 @@ union nf_conntrack_expect_proto { | |||
41 | 43 | ||
42 | /* Add protocol helper include file here */ | 44 | /* Add protocol helper include file here */ |
43 | #include <linux/netfilter/nf_conntrack_ftp.h> | 45 | #include <linux/netfilter/nf_conntrack_ftp.h> |
46 | #include <linux/netfilter/nf_conntrack_pptp.h> | ||
47 | #include <linux/netfilter/nf_conntrack_h323.h> | ||
44 | 48 | ||
45 | /* per conntrack: application helper private data */ | 49 | /* per conntrack: application helper private data */ |
46 | union nf_conntrack_help { | 50 | union nf_conntrack_help { |
47 | /* insert conntrack helper private data (master) here */ | 51 | /* insert conntrack helper private data (master) here */ |
48 | struct ip_ct_ftp_master ct_ftp_info; | 52 | struct nf_ct_ftp_master ct_ftp_info; |
53 | struct nf_ct_pptp_master ct_pptp_info; | ||
54 | struct nf_ct_h323_master ct_h323_info; | ||
49 | }; | 55 | }; |
50 | 56 | ||
51 | #include <linux/types.h> | 57 | #include <linux/types.h> |
@@ -79,6 +85,8 @@ struct nf_conn_help { | |||
79 | 85 | ||
80 | 86 | ||
81 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 87 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
88 | #include <net/netfilter/ipv6/nf_conntrack_ipv6.h> | ||
89 | |||
82 | struct nf_conn | 90 | struct nf_conn |
83 | { | 91 | { |
84 | /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, | 92 | /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, |
@@ -124,44 +132,6 @@ struct nf_conn | |||
124 | char data[0]; | 132 | char data[0]; |
125 | }; | 133 | }; |
126 | 134 | ||
127 | struct nf_conntrack_expect | ||
128 | { | ||
129 | /* Internal linked list (global expectation list) */ | ||
130 | struct list_head list; | ||
131 | |||
132 | /* We expect this tuple, with the following mask */ | ||
133 | struct nf_conntrack_tuple tuple, mask; | ||
134 | |||
135 | /* Function to call after setup and insertion */ | ||
136 | void (*expectfn)(struct nf_conn *new, | ||
137 | struct nf_conntrack_expect *this); | ||
138 | |||
139 | /* The conntrack of the master connection */ | ||
140 | struct nf_conn *master; | ||
141 | |||
142 | /* Timer function; deletes the expectation. */ | ||
143 | struct timer_list timeout; | ||
144 | |||
145 | /* Usage count. */ | ||
146 | atomic_t use; | ||
147 | |||
148 | /* Unique ID */ | ||
149 | unsigned int id; | ||
150 | |||
151 | /* Flags */ | ||
152 | unsigned int flags; | ||
153 | |||
154 | #ifdef CONFIG_NF_NAT_NEEDED | ||
155 | /* This is the original per-proto part, used to map the | ||
156 | * expected connection the way the recipient expects. */ | ||
157 | union nf_conntrack_manip_proto saved_proto; | ||
158 | /* Direction relative to the master connection. */ | ||
159 | enum ip_conntrack_dir dir; | ||
160 | #endif | ||
161 | }; | ||
162 | |||
163 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
164 | |||
165 | static inline struct nf_conn * | 135 | static inline struct nf_conn * |
166 | nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash) | 136 | nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash) |
167 | { | 137 | { |
@@ -208,16 +178,6 @@ __nf_conntrack_find(const struct nf_conntrack_tuple *tuple, | |||
208 | 178 | ||
209 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 179 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
210 | 180 | ||
211 | extern struct nf_conntrack_expect * | ||
212 | __nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple); | ||
213 | |||
214 | extern struct nf_conntrack_expect * | ||
215 | nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple); | ||
216 | |||
217 | extern void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); | ||
218 | |||
219 | extern void nf_ct_remove_expectations(struct nf_conn *ct); | ||
220 | |||
221 | extern void nf_conntrack_flush(void); | 181 | extern void nf_conntrack_flush(void); |
222 | 182 | ||
223 | extern struct nf_conntrack_helper * | 183 | extern struct nf_conntrack_helper * |
@@ -289,89 +249,12 @@ static inline int nf_ct_is_dying(struct nf_conn *ct) | |||
289 | 249 | ||
290 | extern unsigned int nf_conntrack_htable_size; | 250 | extern unsigned int nf_conntrack_htable_size; |
291 | extern int nf_conntrack_checksum; | 251 | extern int nf_conntrack_checksum; |
252 | extern atomic_t nf_conntrack_count; | ||
253 | extern int nf_conntrack_max; | ||
292 | 254 | ||
255 | DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); | ||
293 | #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) | 256 | #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) |
294 | 257 | ||
295 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | ||
296 | #include <linux/notifier.h> | ||
297 | #include <linux/interrupt.h> | ||
298 | |||
299 | struct nf_conntrack_ecache { | ||
300 | struct nf_conn *ct; | ||
301 | unsigned int events; | ||
302 | }; | ||
303 | DECLARE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache); | ||
304 | |||
305 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(nf_conntrack_ecache).x) | ||
306 | |||
307 | extern struct atomic_notifier_head nf_conntrack_chain; | ||
308 | extern struct atomic_notifier_head nf_conntrack_expect_chain; | ||
309 | |||
310 | static inline int nf_conntrack_register_notifier(struct notifier_block *nb) | ||
311 | { | ||
312 | return atomic_notifier_chain_register(&nf_conntrack_chain, nb); | ||
313 | } | ||
314 | |||
315 | static inline int nf_conntrack_unregister_notifier(struct notifier_block *nb) | ||
316 | { | ||
317 | return atomic_notifier_chain_unregister(&nf_conntrack_chain, nb); | ||
318 | } | ||
319 | |||
320 | static inline int | ||
321 | nf_conntrack_expect_register_notifier(struct notifier_block *nb) | ||
322 | { | ||
323 | return atomic_notifier_chain_register(&nf_conntrack_expect_chain, nb); | ||
324 | } | ||
325 | |||
326 | static inline int | ||
327 | nf_conntrack_expect_unregister_notifier(struct notifier_block *nb) | ||
328 | { | ||
329 | return atomic_notifier_chain_unregister(&nf_conntrack_expect_chain, | ||
330 | nb); | ||
331 | } | ||
332 | |||
333 | extern void nf_ct_deliver_cached_events(const struct nf_conn *ct); | ||
334 | extern void __nf_ct_event_cache_init(struct nf_conn *ct); | ||
335 | |||
336 | static inline void | ||
337 | nf_conntrack_event_cache(enum ip_conntrack_events event, | ||
338 | const struct sk_buff *skb) | ||
339 | { | ||
340 | struct nf_conn *ct = (struct nf_conn *)skb->nfct; | ||
341 | struct nf_conntrack_ecache *ecache; | ||
342 | |||
343 | local_bh_disable(); | ||
344 | ecache = &__get_cpu_var(nf_conntrack_ecache); | ||
345 | if (ct != ecache->ct) | ||
346 | __nf_ct_event_cache_init(ct); | ||
347 | ecache->events |= event; | ||
348 | local_bh_enable(); | ||
349 | } | ||
350 | |||
351 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | ||
352 | struct nf_conn *ct) | ||
353 | { | ||
354 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) | ||
355 | atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); | ||
356 | } | ||
357 | |||
358 | static inline void | ||
359 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
360 | struct nf_conntrack_expect *exp) | ||
361 | { | ||
362 | atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp); | ||
363 | } | ||
364 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
365 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | ||
366 | const struct sk_buff *skb) {} | ||
367 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | ||
368 | struct nf_conn *ct) {} | ||
369 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | ||
370 | static inline void | ||
371 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
372 | struct nf_conntrack_expect *exp) {} | ||
373 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
374 | |||
375 | /* no helper, no nat */ | 258 | /* no helper, no nat */ |
376 | #define NF_CT_F_BASIC 0 | 259 | #define NF_CT_F_BASIC 0 |
377 | /* for helper */ | 260 | /* for helper */ |
@@ -387,17 +270,45 @@ nf_conntrack_unregister_cache(u_int32_t features); | |||
387 | 270 | ||
388 | /* valid combinations: | 271 | /* valid combinations: |
389 | * basic: nf_conn, nf_conn .. nf_conn_help | 272 | * basic: nf_conn, nf_conn .. nf_conn_help |
390 | * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat, nf_conn help | 273 | * nat: nf_conn .. nf_conn_nat, nf_conn .. nf_conn_nat .. nf_conn help |
391 | */ | 274 | */ |
275 | #ifdef CONFIG_NF_NAT_NEEDED | ||
276 | static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) | ||
277 | { | ||
278 | unsigned int offset = sizeof(struct nf_conn); | ||
279 | |||
280 | if (!(ct->features & NF_CT_F_NAT)) | ||
281 | return NULL; | ||
282 | |||
283 | offset = ALIGN(offset, __alignof__(struct nf_conn_nat)); | ||
284 | return (struct nf_conn_nat *) ((void *)ct + offset); | ||
285 | } | ||
286 | |||
392 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | 287 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) |
393 | { | 288 | { |
394 | unsigned int offset = sizeof(struct nf_conn); | 289 | unsigned int offset = sizeof(struct nf_conn); |
395 | 290 | ||
396 | if (!(ct->features & NF_CT_F_HELP)) | 291 | if (!(ct->features & NF_CT_F_HELP)) |
397 | return NULL; | 292 | return NULL; |
293 | if (ct->features & NF_CT_F_NAT) { | ||
294 | offset = ALIGN(offset, __alignof__(struct nf_conn_nat)); | ||
295 | offset += sizeof(struct nf_conn_nat); | ||
296 | } | ||
398 | 297 | ||
298 | offset = ALIGN(offset, __alignof__(struct nf_conn_help)); | ||
399 | return (struct nf_conn_help *) ((void *)ct + offset); | 299 | return (struct nf_conn_help *) ((void *)ct + offset); |
400 | } | 300 | } |
301 | #else /* No NAT */ | ||
302 | static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | ||
303 | { | ||
304 | unsigned int offset = sizeof(struct nf_conn); | ||
305 | |||
306 | if (!(ct->features & NF_CT_F_HELP)) | ||
307 | return NULL; | ||
401 | 308 | ||
309 | offset = ALIGN(offset, __alignof__(struct nf_conn_help)); | ||
310 | return (struct nf_conn_help *) ((void *)ct + offset); | ||
311 | } | ||
312 | #endif /* CONFIG_NF_NAT_NEEDED */ | ||
402 | #endif /* __KERNEL__ */ | 313 | #endif /* __KERNEL__ */ |
403 | #endif /* _NF_CONNTRACK_H */ | 314 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index da254525a4ce..7fdc72c01356 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -13,6 +13,9 @@ | |||
13 | #define _NF_CONNTRACK_CORE_H | 13 | #define _NF_CONNTRACK_CORE_H |
14 | 14 | ||
15 | #include <linux/netfilter.h> | 15 | #include <linux/netfilter.h> |
16 | #include <net/netfilter/nf_conntrack_l3proto.h> | ||
17 | #include <net/netfilter/nf_conntrack_l4proto.h> | ||
18 | #include <net/netfilter/nf_conntrack_ecache.h> | ||
16 | 19 | ||
17 | /* This header is used to share core functionality between the | 20 | /* This header is used to share core functionality between the |
18 | standalone connection tracking module, and the compatibility layer's use | 21 | standalone connection tracking module, and the compatibility layer's use |
@@ -29,7 +32,7 @@ extern struct nf_conntrack_l3proto *nf_ct_find_l3proto(u_int16_t pf); | |||
29 | /* Like above, but you already have conntrack read lock. */ | 32 | /* Like above, but you already have conntrack read lock. */ |
30 | extern struct nf_conntrack_l3proto *__nf_ct_find_l3proto(u_int16_t l3proto); | 33 | extern struct nf_conntrack_l3proto *__nf_ct_find_l3proto(u_int16_t l3proto); |
31 | 34 | ||
32 | struct nf_conntrack_protocol; | 35 | struct nf_conntrack_l4proto; |
33 | 36 | ||
34 | extern int | 37 | extern int |
35 | nf_ct_get_tuple(const struct sk_buff *skb, | 38 | nf_ct_get_tuple(const struct sk_buff *skb, |
@@ -39,13 +42,13 @@ nf_ct_get_tuple(const struct sk_buff *skb, | |||
39 | u_int8_t protonum, | 42 | u_int8_t protonum, |
40 | struct nf_conntrack_tuple *tuple, | 43 | struct nf_conntrack_tuple *tuple, |
41 | const struct nf_conntrack_l3proto *l3proto, | 44 | const struct nf_conntrack_l3proto *l3proto, |
42 | const struct nf_conntrack_protocol *protocol); | 45 | const struct nf_conntrack_l4proto *l4proto); |
43 | 46 | ||
44 | extern int | 47 | extern int |
45 | nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, | 48 | nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, |
46 | const struct nf_conntrack_tuple *orig, | 49 | const struct nf_conntrack_tuple *orig, |
47 | const struct nf_conntrack_l3proto *l3proto, | 50 | const struct nf_conntrack_l3proto *l3proto, |
48 | const struct nf_conntrack_protocol *protocol); | 51 | const struct nf_conntrack_l4proto *l4proto); |
49 | 52 | ||
50 | /* Find a connection corresponding to a tuple. */ | 53 | /* Find a connection corresponding to a tuple. */ |
51 | extern struct nf_conntrack_tuple_hash * | 54 | extern struct nf_conntrack_tuple_hash * |
@@ -70,7 +73,14 @@ static inline int nf_conntrack_confirm(struct sk_buff **pskb) | |||
70 | 73 | ||
71 | extern void __nf_conntrack_attach(struct sk_buff *nskb, struct sk_buff *skb); | 74 | extern void __nf_conntrack_attach(struct sk_buff *nskb, struct sk_buff *skb); |
72 | 75 | ||
76 | int | ||
77 | print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, | ||
78 | struct nf_conntrack_l3proto *l3proto, | ||
79 | struct nf_conntrack_l4proto *proto); | ||
80 | |||
73 | extern struct list_head *nf_conntrack_hash; | 81 | extern struct list_head *nf_conntrack_hash; |
74 | extern struct list_head nf_conntrack_expect_list; | 82 | extern struct list_head nf_conntrack_expect_list; |
75 | extern rwlock_t nf_conntrack_lock ; | 83 | extern rwlock_t nf_conntrack_lock ; |
84 | extern struct list_head unconfirmed; | ||
85 | |||
76 | #endif /* _NF_CONNTRACK_CORE_H */ | 86 | #endif /* _NF_CONNTRACK_CORE_H */ |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h new file mode 100644 index 000000000000..b62a8a9ec9d8 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * connection tracking event cache. | ||
3 | */ | ||
4 | |||
5 | #ifndef _NF_CONNTRACK_ECACHE_H | ||
6 | #define _NF_CONNTRACK_ECACHE_H | ||
7 | #include <net/netfilter/nf_conntrack.h> | ||
8 | |||
9 | #include <linux/notifier.h> | ||
10 | #include <linux/interrupt.h> | ||
11 | #include <net/netfilter/nf_conntrack_expect.h> | ||
12 | |||
13 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | ||
14 | struct nf_conntrack_ecache { | ||
15 | struct nf_conn *ct; | ||
16 | unsigned int events; | ||
17 | }; | ||
18 | DECLARE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache); | ||
19 | |||
20 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(nf_conntrack_ecache).x) | ||
21 | |||
22 | extern struct atomic_notifier_head nf_conntrack_chain; | ||
23 | extern struct atomic_notifier_head nf_conntrack_expect_chain; | ||
24 | |||
25 | static inline int nf_conntrack_register_notifier(struct notifier_block *nb) | ||
26 | { | ||
27 | return atomic_notifier_chain_register(&nf_conntrack_chain, nb); | ||
28 | } | ||
29 | |||
30 | static inline int nf_conntrack_unregister_notifier(struct notifier_block *nb) | ||
31 | { | ||
32 | return atomic_notifier_chain_unregister(&nf_conntrack_chain, nb); | ||
33 | } | ||
34 | |||
35 | static inline int | ||
36 | nf_conntrack_expect_register_notifier(struct notifier_block *nb) | ||
37 | { | ||
38 | return atomic_notifier_chain_register(&nf_conntrack_expect_chain, nb); | ||
39 | } | ||
40 | |||
41 | static inline int | ||
42 | nf_conntrack_expect_unregister_notifier(struct notifier_block *nb) | ||
43 | { | ||
44 | return atomic_notifier_chain_unregister(&nf_conntrack_expect_chain, | ||
45 | nb); | ||
46 | } | ||
47 | |||
48 | extern void nf_ct_deliver_cached_events(const struct nf_conn *ct); | ||
49 | extern void __nf_ct_event_cache_init(struct nf_conn *ct); | ||
50 | extern void nf_ct_event_cache_flush(void); | ||
51 | |||
52 | static inline void | ||
53 | nf_conntrack_event_cache(enum ip_conntrack_events event, | ||
54 | const struct sk_buff *skb) | ||
55 | { | ||
56 | struct nf_conn *ct = (struct nf_conn *)skb->nfct; | ||
57 | struct nf_conntrack_ecache *ecache; | ||
58 | |||
59 | local_bh_disable(); | ||
60 | ecache = &__get_cpu_var(nf_conntrack_ecache); | ||
61 | if (ct != ecache->ct) | ||
62 | __nf_ct_event_cache_init(ct); | ||
63 | ecache->events |= event; | ||
64 | local_bh_enable(); | ||
65 | } | ||
66 | |||
67 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | ||
68 | struct nf_conn *ct) | ||
69 | { | ||
70 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) | ||
71 | atomic_notifier_call_chain(&nf_conntrack_chain, event, ct); | ||
72 | } | ||
73 | |||
74 | static inline void | ||
75 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
76 | struct nf_conntrack_expect *exp) | ||
77 | { | ||
78 | atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp); | ||
79 | } | ||
80 | |||
81 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
82 | |||
83 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | ||
84 | const struct sk_buff *skb) {} | ||
85 | static inline void nf_conntrack_event(enum ip_conntrack_events event, | ||
86 | struct nf_conn *ct) {} | ||
87 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | ||
88 | static inline void | ||
89 | nf_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
90 | struct nf_conntrack_expect *exp) {} | ||
91 | static inline void nf_ct_event_cache_flush(void) {} | ||
92 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
93 | |||
94 | #endif /*_NF_CONNTRACK_ECACHE_H*/ | ||
95 | |||
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h new file mode 100644 index 000000000000..cef3136e22a3 --- /dev/null +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * connection tracking expectations. | ||
3 | */ | ||
4 | |||
5 | #ifndef _NF_CONNTRACK_EXPECT_H | ||
6 | #define _NF_CONNTRACK_EXPECT_H | ||
7 | #include <net/netfilter/nf_conntrack.h> | ||
8 | |||
9 | extern struct list_head nf_conntrack_expect_list; | ||
10 | extern kmem_cache_t *nf_conntrack_expect_cachep; | ||
11 | extern struct file_operations exp_file_ops; | ||
12 | |||
13 | struct nf_conntrack_expect | ||
14 | { | ||
15 | /* Internal linked list (global expectation list) */ | ||
16 | struct list_head list; | ||
17 | |||
18 | /* We expect this tuple, with the following mask */ | ||
19 | struct nf_conntrack_tuple tuple, mask; | ||
20 | |||
21 | /* Function to call after setup and insertion */ | ||
22 | void (*expectfn)(struct nf_conn *new, | ||
23 | struct nf_conntrack_expect *this); | ||
24 | |||
25 | /* Helper to assign to new connection */ | ||
26 | struct nf_conntrack_helper *helper; | ||
27 | |||
28 | /* The conntrack of the master connection */ | ||
29 | struct nf_conn *master; | ||
30 | |||
31 | /* Timer function; deletes the expectation. */ | ||
32 | struct timer_list timeout; | ||
33 | |||
34 | /* Usage count. */ | ||
35 | atomic_t use; | ||
36 | |||
37 | /* Unique ID */ | ||
38 | unsigned int id; | ||
39 | |||
40 | /* Flags */ | ||
41 | unsigned int flags; | ||
42 | |||
43 | #ifdef CONFIG_NF_NAT_NEEDED | ||
44 | __be32 saved_ip; | ||
45 | /* This is the original per-proto part, used to map the | ||
46 | * expected connection the way the recipient expects. */ | ||
47 | union nf_conntrack_man_proto saved_proto; | ||
48 | /* Direction relative to the master connection. */ | ||
49 | enum ip_conntrack_dir dir; | ||
50 | #endif | ||
51 | }; | ||
52 | |||
53 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
54 | |||
55 | |||
56 | struct nf_conntrack_expect * | ||
57 | __nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple); | ||
58 | |||
59 | struct nf_conntrack_expect * | ||
60 | nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple); | ||
61 | |||
62 | struct nf_conntrack_expect * | ||
63 | find_expectation(const struct nf_conntrack_tuple *tuple); | ||
64 | |||
65 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); | ||
66 | void nf_ct_remove_expectations(struct nf_conn *ct); | ||
67 | void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp); | ||
68 | |||
69 | /* Allocate space for an expectation: this is mandatory before calling | ||
70 | nf_conntrack_expect_related. You will have to call put afterwards. */ | ||
71 | struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me); | ||
72 | void nf_conntrack_expect_init(struct nf_conntrack_expect *, int, | ||
73 | union nf_conntrack_address *, | ||
74 | union nf_conntrack_address *, | ||
75 | u_int8_t, __be16 *, __be16 *); | ||
76 | void nf_conntrack_expect_put(struct nf_conntrack_expect *exp); | ||
77 | int nf_conntrack_expect_related(struct nf_conntrack_expect *expect); | ||
78 | |||
79 | #endif /*_NF_CONNTRACK_EXPECT_H*/ | ||
80 | |||
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 86ec8174ad02..8c72ac9f0ab8 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -34,20 +34,22 @@ struct nf_conntrack_helper | |||
34 | struct nf_conn *ct, | 34 | struct nf_conn *ct, |
35 | enum ip_conntrack_info conntrackinfo); | 35 | enum ip_conntrack_info conntrackinfo); |
36 | 36 | ||
37 | void (*destroy)(struct nf_conn *ct); | ||
38 | |||
37 | int (*to_nfattr)(struct sk_buff *skb, const struct nf_conn *ct); | 39 | int (*to_nfattr)(struct sk_buff *skb, const struct nf_conn *ct); |
38 | }; | 40 | }; |
39 | 41 | ||
40 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 42 | extern struct nf_conntrack_helper * |
41 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 43 | __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple); |
42 | 44 | ||
43 | /* Allocate space for an expectation: this is mandatory before calling | 45 | extern struct nf_conntrack_helper * |
44 | nf_conntrack_expect_related. You will have to call put afterwards. */ | 46 | nf_ct_helper_find_get( const struct nf_conntrack_tuple *tuple); |
45 | extern struct nf_conntrack_expect * | ||
46 | nf_conntrack_expect_alloc(struct nf_conn *master); | ||
47 | extern void nf_conntrack_expect_put(struct nf_conntrack_expect *exp); | ||
48 | 47 | ||
49 | /* Add an expected connection: can have more than one per connection */ | 48 | extern struct nf_conntrack_helper * |
50 | extern int nf_conntrack_expect_related(struct nf_conntrack_expect *exp); | 49 | __nf_conntrack_helper_find_byname(const char *name); |
51 | extern void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp); | 50 | |
51 | extern void nf_ct_helper_put(struct nf_conntrack_helper *helper); | ||
52 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | ||
53 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | ||
52 | 54 | ||
53 | #endif /*_NF_CONNTRACK_HELPER_H*/ | 55 | #endif /*_NF_CONNTRACK_HELPER_H*/ |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index dac43b15a5b0..664ddcffe00d 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -18,9 +18,6 @@ struct nfattr; | |||
18 | 18 | ||
19 | struct nf_conntrack_l3proto | 19 | struct nf_conntrack_l3proto |
20 | { | 20 | { |
21 | /* Next pointer. */ | ||
22 | struct list_head list; | ||
23 | |||
24 | /* L3 Protocol Family number. ex) PF_INET */ | 21 | /* L3 Protocol Family number. ex) PF_INET */ |
25 | u_int16_t l3proto; | 22 | u_int16_t l3proto; |
26 | 23 | ||
@@ -78,6 +75,12 @@ struct nf_conntrack_l3proto | |||
78 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 75 | int (*nfattr_to_tuple)(struct nfattr *tb[], |
79 | struct nf_conntrack_tuple *t); | 76 | struct nf_conntrack_tuple *t); |
80 | 77 | ||
78 | #ifdef CONFIG_SYSCTL | ||
79 | struct ctl_table_header *ctl_table_header; | ||
80 | struct ctl_table *ctl_table_path; | ||
81 | struct ctl_table *ctl_table; | ||
82 | #endif /* CONFIG_SYSCTL */ | ||
83 | |||
81 | /* Module (if any) which this is connected to. */ | 84 | /* Module (if any) which this is connected to. */ |
82 | struct module *me; | 85 | struct module *me; |
83 | }; | 86 | }; |
@@ -86,7 +89,7 @@ extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX]; | |||
86 | 89 | ||
87 | /* Protocol registration. */ | 90 | /* Protocol registration. */ |
88 | extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); | 91 | extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); |
89 | extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 92 | extern int nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); |
90 | 93 | ||
91 | extern struct nf_conntrack_l3proto * | 94 | extern struct nf_conntrack_l3proto * |
92 | nf_ct_l3proto_find_get(u_int16_t l3proto); | 95 | nf_ct_l3proto_find_get(u_int16_t l3proto); |
@@ -96,13 +99,13 @@ extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | |||
96 | /* Existing built-in protocols */ | 99 | /* Existing built-in protocols */ |
97 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; | 100 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; |
98 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; | 101 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; |
99 | extern struct nf_conntrack_l3proto nf_conntrack_generic_l3proto; | 102 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; |
100 | 103 | ||
101 | static inline struct nf_conntrack_l3proto * | 104 | static inline struct nf_conntrack_l3proto * |
102 | __nf_ct_l3proto_find(u_int16_t l3proto) | 105 | __nf_ct_l3proto_find(u_int16_t l3proto) |
103 | { | 106 | { |
104 | if (unlikely(l3proto >= AF_MAX)) | 107 | if (unlikely(l3proto >= AF_MAX)) |
105 | return &nf_conntrack_generic_l3proto; | 108 | return &nf_conntrack_l3proto_generic; |
106 | return nf_ct_l3protos[l3proto]; | 109 | return nf_ct_l3protos[l3proto]; |
107 | } | 110 | } |
108 | 111 | ||
diff --git a/include/net/netfilter/nf_conntrack_protocol.h b/include/net/netfilter/nf_conntrack_l4proto.h index 1f33737fcea5..fc8af08ff542 100644 --- a/include/net/netfilter/nf_conntrack_protocol.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Header for use in defining a given protocol for connection tracking. | 2 | * Header for use in defining a given L4 protocol for connection tracking. |
3 | * | 3 | * |
4 | * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> | 4 | * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> |
5 | * - generalized L3 protocol dependent part. | 5 | * - generalized L3 protocol dependent part. |
@@ -7,23 +7,20 @@ | |||
7 | * Derived from include/linux/netfiter_ipv4/ip_conntrack_protcol.h | 7 | * Derived from include/linux/netfiter_ipv4/ip_conntrack_protcol.h |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _NF_CONNTRACK_PROTOCOL_H | 10 | #ifndef _NF_CONNTRACK_L4PROTO_H |
11 | #define _NF_CONNTRACK_PROTOCOL_H | 11 | #define _NF_CONNTRACK_L4PROTO_H |
12 | #include <net/netfilter/nf_conntrack.h> | 12 | #include <net/netfilter/nf_conntrack.h> |
13 | 13 | ||
14 | struct seq_file; | 14 | struct seq_file; |
15 | struct nfattr; | 15 | struct nfattr; |
16 | 16 | ||
17 | struct nf_conntrack_protocol | 17 | struct nf_conntrack_l4proto |
18 | { | 18 | { |
19 | /* Next pointer. */ | ||
20 | struct list_head list; | ||
21 | |||
22 | /* L3 Protocol number. */ | 19 | /* L3 Protocol number. */ |
23 | u_int16_t l3proto; | 20 | u_int16_t l3proto; |
24 | 21 | ||
25 | /* Protocol number. */ | 22 | /* L4 Protocol number. */ |
26 | u_int8_t proto; | 23 | u_int8_t l4proto; |
27 | 24 | ||
28 | /* Protocol name */ | 25 | /* Protocol name */ |
29 | const char *name; | 26 | const char *name; |
@@ -79,30 +76,40 @@ struct nf_conntrack_protocol | |||
79 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 76 | int (*nfattr_to_tuple)(struct nfattr *tb[], |
80 | struct nf_conntrack_tuple *t); | 77 | struct nf_conntrack_tuple *t); |
81 | 78 | ||
79 | #ifdef CONFIG_SYSCTL | ||
80 | struct ctl_table_header **ctl_table_header; | ||
81 | struct ctl_table *ctl_table; | ||
82 | unsigned int *ctl_table_users; | ||
83 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
84 | struct ctl_table_header *ctl_compat_table_header; | ||
85 | struct ctl_table *ctl_compat_table; | ||
86 | #endif | ||
87 | #endif | ||
88 | |||
82 | /* Module (if any) which this is connected to. */ | 89 | /* Module (if any) which this is connected to. */ |
83 | struct module *me; | 90 | struct module *me; |
84 | }; | 91 | }; |
85 | 92 | ||
86 | /* Existing built-in protocols */ | 93 | /* Existing built-in protocols */ |
87 | extern struct nf_conntrack_protocol nf_conntrack_protocol_tcp6; | 94 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6; |
88 | extern struct nf_conntrack_protocol nf_conntrack_protocol_udp4; | 95 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; |
89 | extern struct nf_conntrack_protocol nf_conntrack_protocol_udp6; | 96 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; |
90 | extern struct nf_conntrack_protocol nf_conntrack_generic_protocol; | 97 | extern struct nf_conntrack_l4proto nf_conntrack_l4proto_generic; |
91 | 98 | ||
92 | #define MAX_NF_CT_PROTO 256 | 99 | #define MAX_NF_CT_PROTO 256 |
93 | extern struct nf_conntrack_protocol **nf_ct_protos[PF_MAX]; | 100 | extern struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX]; |
94 | 101 | ||
95 | extern struct nf_conntrack_protocol * | 102 | extern struct nf_conntrack_l4proto * |
96 | __nf_ct_proto_find(u_int16_t l3proto, u_int8_t protocol); | 103 | __nf_ct_l4proto_find(u_int16_t l3proto, u_int8_t l4proto); |
97 | 104 | ||
98 | extern struct nf_conntrack_protocol * | 105 | extern struct nf_conntrack_l4proto * |
99 | nf_ct_proto_find_get(u_int16_t l3proto, u_int8_t protocol); | 106 | nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t protocol); |
100 | 107 | ||
101 | extern void nf_ct_proto_put(struct nf_conntrack_protocol *p); | 108 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
102 | 109 | ||
103 | /* Protocol registration. */ | 110 | /* Protocol registration. */ |
104 | extern int nf_conntrack_protocol_register(struct nf_conntrack_protocol *proto); | 111 | extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto); |
105 | extern void nf_conntrack_protocol_unregister(struct nf_conntrack_protocol *proto); | 112 | extern int nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); |
106 | 113 | ||
107 | /* Generic netlink helpers */ | 114 | /* Generic netlink helpers */ |
108 | extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, | 115 | extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 530ef1f75283..5d72b16e876f 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -24,10 +24,10 @@ | |||
24 | 24 | ||
25 | /* The l3 protocol-specific manipulable parts of the tuple: always in | 25 | /* The l3 protocol-specific manipulable parts of the tuple: always in |
26 | network order! */ | 26 | network order! */ |
27 | union nf_conntrack_man_l3proto { | 27 | union nf_conntrack_address { |
28 | u_int32_t all[NF_CT_TUPLE_L3SIZE]; | 28 | u_int32_t all[NF_CT_TUPLE_L3SIZE]; |
29 | u_int32_t ip; | 29 | __be32 ip; |
30 | u_int32_t ip6[4]; | 30 | __be32 ip6[4]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* The protocol-specific manipulable parts of the tuple: always in | 33 | /* The protocol-specific manipulable parts of the tuple: always in |
@@ -38,23 +38,26 @@ union nf_conntrack_man_proto | |||
38 | u_int16_t all; | 38 | u_int16_t all; |
39 | 39 | ||
40 | struct { | 40 | struct { |
41 | u_int16_t port; | 41 | __be16 port; |
42 | } tcp; | 42 | } tcp; |
43 | struct { | 43 | struct { |
44 | u_int16_t port; | 44 | __be16 port; |
45 | } udp; | 45 | } udp; |
46 | struct { | 46 | struct { |
47 | u_int16_t id; | 47 | __be16 id; |
48 | } icmp; | 48 | } icmp; |
49 | struct { | 49 | struct { |
50 | u_int16_t port; | 50 | __be16 port; |
51 | } sctp; | 51 | } sctp; |
52 | struct { | ||
53 | __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */ | ||
54 | } gre; | ||
52 | }; | 55 | }; |
53 | 56 | ||
54 | /* The manipulable part of the tuple. */ | 57 | /* The manipulable part of the tuple. */ |
55 | struct nf_conntrack_man | 58 | struct nf_conntrack_man |
56 | { | 59 | { |
57 | union nf_conntrack_man_l3proto u3; | 60 | union nf_conntrack_address u3; |
58 | union nf_conntrack_man_proto u; | 61 | union nf_conntrack_man_proto u; |
59 | /* Layer 3 protocol */ | 62 | /* Layer 3 protocol */ |
60 | u_int16_t l3num; | 63 | u_int16_t l3num; |
@@ -67,27 +70,26 @@ struct nf_conntrack_tuple | |||
67 | 70 | ||
68 | /* These are the parts of the tuple which are fixed. */ | 71 | /* These are the parts of the tuple which are fixed. */ |
69 | struct { | 72 | struct { |
70 | union { | 73 | union nf_conntrack_address u3; |
71 | u_int32_t all[NF_CT_TUPLE_L3SIZE]; | ||
72 | u_int32_t ip; | ||
73 | u_int32_t ip6[4]; | ||
74 | } u3; | ||
75 | union { | 74 | union { |
76 | /* Add other protocols here. */ | 75 | /* Add other protocols here. */ |
77 | u_int16_t all; | 76 | u_int16_t all; |
78 | 77 | ||
79 | struct { | 78 | struct { |
80 | u_int16_t port; | 79 | __be16 port; |
81 | } tcp; | 80 | } tcp; |
82 | struct { | 81 | struct { |
83 | u_int16_t port; | 82 | __be16 port; |
84 | } udp; | 83 | } udp; |
85 | struct { | 84 | struct { |
86 | u_int8_t type, code; | 85 | u_int8_t type, code; |
87 | } icmp; | 86 | } icmp; |
88 | struct { | 87 | struct { |
89 | u_int16_t port; | 88 | __be16 port; |
90 | } sctp; | 89 | } sctp; |
90 | struct { | ||
91 | __be16 key; | ||
92 | } gre; | ||
91 | } u; | 93 | } u; |
92 | 94 | ||
93 | /* The protocol. */ | 95 | /* The protocol. */ |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h new file mode 100644 index 000000000000..61c62068ca6b --- /dev/null +++ b/include/net/netfilter/nf_nat.h | |||
@@ -0,0 +1,77 @@ | |||
1 | #ifndef _NF_NAT_H | ||
2 | #define _NF_NAT_H | ||
3 | #include <linux/netfilter_ipv4.h> | ||
4 | #include <net/netfilter/nf_conntrack_tuple.h> | ||
5 | |||
6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | ||
7 | |||
8 | enum nf_nat_manip_type | ||
9 | { | ||
10 | IP_NAT_MANIP_SRC, | ||
11 | IP_NAT_MANIP_DST | ||
12 | }; | ||
13 | |||
14 | /* SRC manip occurs POST_ROUTING or LOCAL_IN */ | ||
15 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING && (hooknum) != NF_IP_LOCAL_IN) | ||
16 | |||
17 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
19 | |||
20 | /* NAT sequence number modifications */ | ||
21 | struct nf_nat_seq { | ||
22 | /* position of the last TCP sequence number modification (if any) */ | ||
23 | u_int32_t correction_pos; | ||
24 | |||
25 | /* sequence number offset before and after last modification */ | ||
26 | int16_t offset_before, offset_after; | ||
27 | }; | ||
28 | |||
29 | /* Single range specification. */ | ||
30 | struct nf_nat_range | ||
31 | { | ||
32 | /* Set to OR of flags above. */ | ||
33 | unsigned int flags; | ||
34 | |||
35 | /* Inclusive: network order. */ | ||
36 | __be32 min_ip, max_ip; | ||
37 | |||
38 | /* Inclusive: network order */ | ||
39 | union nf_conntrack_man_proto min, max; | ||
40 | }; | ||
41 | |||
42 | /* For backwards compat: don't use in modern code. */ | ||
43 | struct nf_nat_multi_range_compat | ||
44 | { | ||
45 | unsigned int rangesize; /* Must be 1. */ | ||
46 | |||
47 | /* hangs off end. */ | ||
48 | struct nf_nat_range range[1]; | ||
49 | }; | ||
50 | |||
51 | #ifdef __KERNEL__ | ||
52 | #include <linux/list.h> | ||
53 | |||
54 | /* The structure embedded in the conntrack structure. */ | ||
55 | struct nf_nat_info | ||
56 | { | ||
57 | struct list_head bysource; | ||
58 | struct nf_nat_seq seq[IP_CT_DIR_MAX]; | ||
59 | }; | ||
60 | |||
61 | struct nf_conn; | ||
62 | |||
63 | /* Set up the info structure to map into this range. */ | ||
64 | extern unsigned int nf_nat_setup_info(struct nf_conn *ct, | ||
65 | const struct nf_nat_range *range, | ||
66 | unsigned int hooknum); | ||
67 | |||
68 | /* Is this tuple already taken? (not by us)*/ | ||
69 | extern int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple, | ||
70 | const struct nf_conn *ignored_conntrack); | ||
71 | |||
72 | extern int nf_nat_module_is_loaded; | ||
73 | |||
74 | #else /* !__KERNEL__: iptables wants this to compile. */ | ||
75 | #define nf_nat_multi_range nf_nat_multi_range_compat | ||
76 | #endif /*__KERNEL__*/ | ||
77 | #endif | ||
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h new file mode 100644 index 000000000000..9778ffa93440 --- /dev/null +++ b/include/net/netfilter/nf_nat_core.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _NF_NAT_CORE_H | ||
2 | #define _NF_NAT_CORE_H | ||
3 | #include <linux/list.h> | ||
4 | #include <net/netfilter/nf_conntrack.h> | ||
5 | |||
6 | /* This header used to share core functionality between the standalone | ||
7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | ||
8 | |||
9 | extern unsigned int nf_nat_packet(struct nf_conn *ct, | ||
10 | enum ip_conntrack_info ctinfo, | ||
11 | unsigned int hooknum, | ||
12 | struct sk_buff **pskb); | ||
13 | |||
14 | extern int nf_nat_icmp_reply_translation(struct nf_conn *ct, | ||
15 | enum ip_conntrack_info ctinfo, | ||
16 | unsigned int hooknum, | ||
17 | struct sk_buff **pskb); | ||
18 | |||
19 | static inline int nf_nat_initialized(struct nf_conn *ct, | ||
20 | enum nf_nat_manip_type manip) | ||
21 | { | ||
22 | if (manip == IP_NAT_MANIP_SRC) | ||
23 | return test_bit(IPS_SRC_NAT_DONE_BIT, &ct->status); | ||
24 | else | ||
25 | return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status); | ||
26 | } | ||
27 | #endif /* _NF_NAT_CORE_H */ | ||
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h new file mode 100644 index 000000000000..ec98ecf95fc8 --- /dev/null +++ b/include/net/netfilter/nf_nat_helper.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef _NF_NAT_HELPER_H | ||
2 | #define _NF_NAT_HELPER_H | ||
3 | /* NAT protocol helper routines. */ | ||
4 | |||
5 | #include <net/netfilter/nf_conntrack.h> | ||
6 | |||
7 | struct sk_buff; | ||
8 | |||
9 | /* These return true or false. */ | ||
10 | extern int nf_nat_mangle_tcp_packet(struct sk_buff **skb, | ||
11 | struct nf_conn *ct, | ||
12 | enum ip_conntrack_info ctinfo, | ||
13 | unsigned int match_offset, | ||
14 | unsigned int match_len, | ||
15 | const char *rep_buffer, | ||
16 | unsigned int rep_len); | ||
17 | extern int nf_nat_mangle_udp_packet(struct sk_buff **skb, | ||
18 | struct nf_conn *ct, | ||
19 | enum ip_conntrack_info ctinfo, | ||
20 | unsigned int match_offset, | ||
21 | unsigned int match_len, | ||
22 | const char *rep_buffer, | ||
23 | unsigned int rep_len); | ||
24 | extern int nf_nat_seq_adjust(struct sk_buff **pskb, | ||
25 | struct nf_conn *ct, | ||
26 | enum ip_conntrack_info ctinfo); | ||
27 | |||
28 | /* Setup NAT on this expected conntrack so it follows master, but goes | ||
29 | * to port ct->master->saved_proto. */ | ||
30 | extern void nf_nat_follow_master(struct nf_conn *ct, | ||
31 | struct nf_conntrack_expect *this); | ||
32 | #endif | ||
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h new file mode 100644 index 000000000000..a9ec5ef61468 --- /dev/null +++ b/include/net/netfilter/nf_nat_protocol.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* Header for use in defining a given protocol. */ | ||
2 | #ifndef _NF_NAT_PROTOCOL_H | ||
3 | #define _NF_NAT_PROTOCOL_H | ||
4 | #include <net/netfilter/nf_nat.h> | ||
5 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
6 | |||
7 | struct nf_nat_range; | ||
8 | |||
9 | struct nf_nat_protocol | ||
10 | { | ||
11 | /* Protocol name */ | ||
12 | const char *name; | ||
13 | |||
14 | /* Protocol number. */ | ||
15 | unsigned int protonum; | ||
16 | |||
17 | struct module *me; | ||
18 | |||
19 | /* Translate a packet to the target according to manip type. | ||
20 | Return true if succeeded. */ | ||
21 | int (*manip_pkt)(struct sk_buff **pskb, | ||
22 | unsigned int iphdroff, | ||
23 | const struct nf_conntrack_tuple *tuple, | ||
24 | enum nf_nat_manip_type maniptype); | ||
25 | |||
26 | /* Is the manipable part of the tuple between min and max incl? */ | ||
27 | int (*in_range)(const struct nf_conntrack_tuple *tuple, | ||
28 | enum nf_nat_manip_type maniptype, | ||
29 | const union nf_conntrack_man_proto *min, | ||
30 | const union nf_conntrack_man_proto *max); | ||
31 | |||
32 | /* Alter the per-proto part of the tuple (depending on | ||
33 | maniptype), to give a unique tuple in the given range if | ||
34 | possible; return false if not. Per-protocol part of tuple | ||
35 | is initialized to the incoming packet. */ | ||
36 | int (*unique_tuple)(struct nf_conntrack_tuple *tuple, | ||
37 | const struct nf_nat_range *range, | ||
38 | enum nf_nat_manip_type maniptype, | ||
39 | const struct nf_conn *ct); | ||
40 | |||
41 | int (*range_to_nfattr)(struct sk_buff *skb, | ||
42 | const struct nf_nat_range *range); | ||
43 | |||
44 | int (*nfattr_to_range)(struct nfattr *tb[], | ||
45 | struct nf_nat_range *range); | ||
46 | }; | ||
47 | |||
48 | /* Protocol registration. */ | ||
49 | extern int nf_nat_protocol_register(struct nf_nat_protocol *proto); | ||
50 | extern void nf_nat_protocol_unregister(struct nf_nat_protocol *proto); | ||
51 | |||
52 | extern struct nf_nat_protocol *nf_nat_proto_find_get(u_int8_t protocol); | ||
53 | extern void nf_nat_proto_put(struct nf_nat_protocol *proto); | ||
54 | |||
55 | /* Built-in protocols. */ | ||
56 | extern struct nf_nat_protocol nf_nat_protocol_tcp; | ||
57 | extern struct nf_nat_protocol nf_nat_protocol_udp; | ||
58 | extern struct nf_nat_protocol nf_nat_protocol_icmp; | ||
59 | extern struct nf_nat_protocol nf_nat_unknown_protocol; | ||
60 | |||
61 | extern int init_protocols(void) __init; | ||
62 | extern void cleanup_protocols(void); | ||
63 | extern struct nf_nat_protocol *find_nat_proto(u_int16_t protonum); | ||
64 | |||
65 | extern int nf_nat_port_range_to_nfattr(struct sk_buff *skb, | ||
66 | const struct nf_nat_range *range); | ||
67 | extern int nf_nat_port_nfattr_to_range(struct nfattr *tb[], | ||
68 | struct nf_nat_range *range); | ||
69 | |||
70 | #endif /*_NF_NAT_PROTO_H*/ | ||
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h new file mode 100644 index 000000000000..f191c672bcc6 --- /dev/null +++ b/include/net/netfilter/nf_nat_rule.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _NF_NAT_RULE_H | ||
2 | #define _NF_NAT_RULE_H | ||
3 | #include <net/netfilter/nf_conntrack.h> | ||
4 | #include <net/netfilter/nf_nat.h> | ||
5 | #include <linux/netfilter_ipv4/ip_tables.h> | ||
6 | |||
7 | /* Compatibility definitions for ipt_FOO modules */ | ||
8 | #define ip_nat_range nf_nat_range | ||
9 | #define ip_conntrack_tuple nf_conntrack_tuple | ||
10 | #define ip_conntrack_get nf_ct_get | ||
11 | #define ip_conntrack nf_conn | ||
12 | #define ip_nat_setup_info nf_nat_setup_info | ||
13 | #define ip_nat_multi_range_compat nf_nat_multi_range_compat | ||
14 | #define ip_ct_iterate_cleanup nf_ct_iterate_cleanup | ||
15 | #define IP_NF_ASSERT NF_CT_ASSERT | ||
16 | |||
17 | extern int nf_nat_rule_init(void) __init; | ||
18 | extern void nf_nat_rule_cleanup(void); | ||
19 | extern int nf_nat_rule_find(struct sk_buff **pskb, | ||
20 | unsigned int hooknum, | ||
21 | const struct net_device *in, | ||
22 | const struct net_device *out, | ||
23 | struct nf_conn *ct, | ||
24 | struct nf_nat_info *info); | ||
25 | |||
26 | extern unsigned int | ||
27 | alloc_null_binding(struct nf_conn *ct, | ||
28 | struct nf_nat_info *info, | ||
29 | unsigned int hooknum); | ||
30 | |||
31 | extern unsigned int | ||
32 | alloc_null_binding_confirmed(struct nf_conn *ct, | ||
33 | struct nf_nat_info *info, | ||
34 | unsigned int hooknum); | ||
35 | #endif /* _NF_NAT_RULE_H */ | ||
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index 12c214b9eadf..83da7e1f0d3d 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -111,13 +111,34 @@ struct netlbl_lsm_cache { | |||
111 | void (*free) (const void *data); | 111 | void (*free) (const void *data); |
112 | void *data; | 112 | void *data; |
113 | }; | 113 | }; |
114 | /* The catmap bitmap field MUST be a power of two in length and large | ||
115 | * enough to hold at least 240 bits. Special care (i.e. check the code!) | ||
116 | * should be used when changing these values as the LSM implementation | ||
117 | * probably has functions which rely on the sizes of these types to speed | ||
118 | * processing. */ | ||
119 | #define NETLBL_CATMAP_MAPTYPE u64 | ||
120 | #define NETLBL_CATMAP_MAPCNT 4 | ||
121 | #define NETLBL_CATMAP_MAPSIZE (sizeof(NETLBL_CATMAP_MAPTYPE) * 8) | ||
122 | #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \ | ||
123 | NETLBL_CATMAP_MAPCNT) | ||
124 | #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01 | ||
125 | struct netlbl_lsm_secattr_catmap { | ||
126 | u32 startbit; | ||
127 | NETLBL_CATMAP_MAPTYPE bitmap[NETLBL_CATMAP_MAPCNT]; | ||
128 | struct netlbl_lsm_secattr_catmap *next; | ||
129 | }; | ||
130 | #define NETLBL_SECATTR_NONE 0x00000000 | ||
131 | #define NETLBL_SECATTR_DOMAIN 0x00000001 | ||
132 | #define NETLBL_SECATTR_CACHE 0x00000002 | ||
133 | #define NETLBL_SECATTR_MLS_LVL 0x00000004 | ||
134 | #define NETLBL_SECATTR_MLS_CAT 0x00000008 | ||
114 | struct netlbl_lsm_secattr { | 135 | struct netlbl_lsm_secattr { |
136 | u32 flags; | ||
137 | |||
115 | char *domain; | 138 | char *domain; |
116 | 139 | ||
117 | u32 mls_lvl; | 140 | u32 mls_lvl; |
118 | u32 mls_lvl_vld; | 141 | struct netlbl_lsm_secattr_catmap *mls_cat; |
119 | unsigned char *mls_cat; | ||
120 | size_t mls_cat_len; | ||
121 | 142 | ||
122 | struct netlbl_lsm_cache *cache; | 143 | struct netlbl_lsm_cache *cache; |
123 | }; | 144 | }; |
@@ -165,18 +186,54 @@ static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | |||
165 | } | 186 | } |
166 | 187 | ||
167 | /** | 188 | /** |
189 | * netlbl_secattr_catmap_alloc - Allocate a LSM secattr catmap | ||
190 | * @flags: memory allocation flags | ||
191 | * | ||
192 | * Description: | ||
193 | * Allocate memory for a LSM secattr catmap, returns a pointer on success, NULL | ||
194 | * on failure. | ||
195 | * | ||
196 | */ | ||
197 | static inline struct netlbl_lsm_secattr_catmap *netlbl_secattr_catmap_alloc( | ||
198 | gfp_t flags) | ||
199 | { | ||
200 | return kzalloc(sizeof(struct netlbl_lsm_secattr_catmap), flags); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * netlbl_secattr_catmap_free - Free a LSM secattr catmap | ||
205 | * @catmap: the category bitmap | ||
206 | * | ||
207 | * Description: | ||
208 | * Free a LSM secattr catmap. | ||
209 | * | ||
210 | */ | ||
211 | static inline void netlbl_secattr_catmap_free( | ||
212 | struct netlbl_lsm_secattr_catmap *catmap) | ||
213 | { | ||
214 | struct netlbl_lsm_secattr_catmap *iter; | ||
215 | |||
216 | do { | ||
217 | iter = catmap; | ||
218 | catmap = catmap->next; | ||
219 | kfree(iter); | ||
220 | } while (catmap); | ||
221 | } | ||
222 | |||
223 | /** | ||
168 | * netlbl_secattr_init - Initialize a netlbl_lsm_secattr struct | 224 | * netlbl_secattr_init - Initialize a netlbl_lsm_secattr struct |
169 | * @secattr: the struct to initialize | 225 | * @secattr: the struct to initialize |
170 | * | 226 | * |
171 | * Description: | 227 | * Description: |
172 | * Initialize an already allocated netlbl_lsm_secattr struct. Returns zero on | 228 | * Initialize an already allocated netlbl_lsm_secattr struct. |
173 | * success, negative values on error. | ||
174 | * | 229 | * |
175 | */ | 230 | */ |
176 | static inline int netlbl_secattr_init(struct netlbl_lsm_secattr *secattr) | 231 | static inline void netlbl_secattr_init(struct netlbl_lsm_secattr *secattr) |
177 | { | 232 | { |
178 | memset(secattr, 0, sizeof(*secattr)); | 233 | secattr->flags = 0; |
179 | return 0; | 234 | secattr->domain = NULL; |
235 | secattr->mls_cat = NULL; | ||
236 | secattr->cache = NULL; | ||
180 | } | 237 | } |
181 | 238 | ||
182 | /** | 239 | /** |
@@ -193,7 +250,8 @@ static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) | |||
193 | if (secattr->cache) | 250 | if (secattr->cache) |
194 | netlbl_secattr_cache_free(secattr->cache); | 251 | netlbl_secattr_cache_free(secattr->cache); |
195 | kfree(secattr->domain); | 252 | kfree(secattr->domain); |
196 | kfree(secattr->mls_cat); | 253 | if (secattr->mls_cat) |
254 | netlbl_secattr_catmap_free(secattr->mls_cat); | ||
197 | } | 255 | } |
198 | 256 | ||
199 | /** | 257 | /** |
@@ -205,7 +263,7 @@ static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) | |||
205 | * pointer on success, or NULL on failure. | 263 | * pointer on success, or NULL on failure. |
206 | * | 264 | * |
207 | */ | 265 | */ |
208 | static inline struct netlbl_lsm_secattr *netlbl_secattr_alloc(int flags) | 266 | static inline struct netlbl_lsm_secattr *netlbl_secattr_alloc(gfp_t flags) |
209 | { | 267 | { |
210 | return kzalloc(sizeof(struct netlbl_lsm_secattr), flags); | 268 | return kzalloc(sizeof(struct netlbl_lsm_secattr), flags); |
211 | } | 269 | } |
@@ -224,6 +282,51 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr) | |||
224 | kfree(secattr); | 282 | kfree(secattr); |
225 | } | 283 | } |
226 | 284 | ||
285 | #ifdef CONFIG_NETLABEL | ||
286 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | ||
287 | u32 offset); | ||
288 | int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | ||
289 | u32 offset); | ||
290 | int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap *catmap, | ||
291 | u32 bit, | ||
292 | gfp_t flags); | ||
293 | int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap, | ||
294 | u32 start, | ||
295 | u32 end, | ||
296 | gfp_t flags); | ||
297 | #else | ||
298 | static inline int netlbl_secattr_catmap_walk( | ||
299 | struct netlbl_lsm_secattr_catmap *catmap, | ||
300 | u32 offset) | ||
301 | { | ||
302 | return -ENOENT; | ||
303 | } | ||
304 | |||
305 | static inline int netlbl_secattr_catmap_walk_rng( | ||
306 | struct netlbl_lsm_secattr_catmap *catmap, | ||
307 | u32 offset) | ||
308 | { | ||
309 | return -ENOENT; | ||
310 | } | ||
311 | |||
312 | static inline int netlbl_secattr_catmap_setbit( | ||
313 | struct netlbl_lsm_secattr_catmap *catmap, | ||
314 | u32 bit, | ||
315 | gfp_t flags) | ||
316 | { | ||
317 | return 0; | ||
318 | } | ||
319 | |||
320 | static inline int netlbl_secattr_catmap_setrng( | ||
321 | struct netlbl_lsm_secattr_catmap *catmap, | ||
322 | u32 start, | ||
323 | u32 end, | ||
324 | gfp_t flags) | ||
325 | { | ||
326 | return 0; | ||
327 | } | ||
328 | #endif | ||
329 | |||
227 | /* | 330 | /* |
228 | * LSM protocol operations | 331 | * LSM protocol operations |
229 | */ | 332 | */ |
diff --git a/include/net/netlink.h b/include/net/netlink.h index ce5cba19c393..fd75fd65d59e 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -500,14 +500,15 @@ static inline struct nlmsghdr *nlmsg_put_answer(struct sk_buff *skb, | |||
500 | 500 | ||
501 | /** | 501 | /** |
502 | * nlmsg_new - Allocate a new netlink message | 502 | * nlmsg_new - Allocate a new netlink message |
503 | * @size: maximum size of message | 503 | * @payload: size of the message payload |
504 | * @flags: the type of memory to allocate. | 504 | * @flags: the type of memory to allocate. |
505 | * | 505 | * |
506 | * Use NLMSG_GOODSIZE if size isn't know and you need a good default size. | 506 | * Use NLMSG_DEFAULT_SIZE if the size of the payload isn't known |
507 | * and a good default is needed. | ||
507 | */ | 508 | */ |
508 | static inline struct sk_buff *nlmsg_new(int size, gfp_t flags) | 509 | static inline struct sk_buff *nlmsg_new(size_t payload, gfp_t flags) |
509 | { | 510 | { |
510 | return alloc_skb(size, flags); | 511 | return alloc_skb(nlmsg_total_size(payload), flags); |
511 | } | 512 | } |
512 | 513 | ||
513 | /** | 514 | /** |
@@ -828,6 +829,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | |||
828 | #define NLA_PUT_U16(skb, attrtype, value) \ | 829 | #define NLA_PUT_U16(skb, attrtype, value) \ |
829 | NLA_PUT_TYPE(skb, u16, attrtype, value) | 830 | NLA_PUT_TYPE(skb, u16, attrtype, value) |
830 | 831 | ||
832 | #define NLA_PUT_LE16(skb, attrtype, value) \ | ||
833 | NLA_PUT_TYPE(skb, __le16, attrtype, value) | ||
834 | |||
831 | #define NLA_PUT_U32(skb, attrtype, value) \ | 835 | #define NLA_PUT_U32(skb, attrtype, value) \ |
832 | NLA_PUT_TYPE(skb, u32, attrtype, value) | 836 | NLA_PUT_TYPE(skb, u32, attrtype, value) |
833 | 837 | ||
@@ -874,6 +878,15 @@ static inline u16 nla_get_u16(struct nlattr *nla) | |||
874 | } | 878 | } |
875 | 879 | ||
876 | /** | 880 | /** |
881 | * nla_get_le16 - return payload of __le16 attribute | ||
882 | * @nla: __le16 netlink attribute | ||
883 | */ | ||
884 | static inline __le16 nla_get_le16(struct nlattr *nla) | ||
885 | { | ||
886 | return *(__le16 *) nla_data(nla); | ||
887 | } | ||
888 | |||
889 | /** | ||
877 | * nla_get_u8 - return payload of u8 attribute | 890 | * nla_get_u8 - return payload of u8 attribute |
878 | * @nla: u8 netlink attribute | 891 | * @nla: u8 netlink attribute |
879 | */ | 892 | */ |
diff --git a/include/net/protocol.h b/include/net/protocol.h index c643bce64e55..105bf12b0c79 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -50,7 +50,7 @@ struct inet6_protocol | |||
50 | void (*err_handler)(struct sk_buff *skb, | 50 | void (*err_handler)(struct sk_buff *skb, |
51 | struct inet6_skb_parm *opt, | 51 | struct inet6_skb_parm *opt, |
52 | int type, int code, int offset, | 52 | int type, int code, int offset, |
53 | __u32 info); | 53 | __be32 info); |
54 | 54 | ||
55 | int (*gso_send_check)(struct sk_buff *skb); | 55 | int (*gso_send_check)(struct sk_buff *skb); |
56 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 56 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
@@ -71,7 +71,7 @@ struct inet_protosw { | |||
71 | 71 | ||
72 | /* These two fields form the lookup key. */ | 72 | /* These two fields form the lookup key. */ |
73 | unsigned short type; /* This is the 2nd argument to socket(2). */ | 73 | unsigned short type; /* This is the 2nd argument to socket(2). */ |
74 | int protocol; /* This is the L4 protocol number. */ | 74 | unsigned short protocol; /* This is the L4 protocol number. */ |
75 | 75 | ||
76 | struct proto *prot; | 76 | struct proto *prot; |
77 | const struct proto_ops *ops; | 77 | const struct proto_ops *ops; |
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index 14476a71725e..af8960878ef4 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
@@ -21,7 +21,7 @@ extern void rawv6_err(struct sock *sk, | |||
21 | struct sk_buff *skb, | 21 | struct sk_buff *skb, |
22 | struct inet6_skb_parm *opt, | 22 | struct inet6_skb_parm *opt, |
23 | int type, int code, | 23 | int type, int code, |
24 | int offset, u32 info); | 24 | int offset, __be32 info); |
25 | 25 | ||
26 | #endif | 26 | #endif |
27 | 27 | ||
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 8e165ca16bd8..e37baaf2080b 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -28,14 +28,15 @@ struct proto; | |||
28 | 28 | ||
29 | struct request_sock_ops { | 29 | struct request_sock_ops { |
30 | int family; | 30 | int family; |
31 | kmem_cache_t *slab; | ||
32 | int obj_size; | 31 | int obj_size; |
32 | kmem_cache_t *slab; | ||
33 | int (*rtx_syn_ack)(struct sock *sk, | 33 | int (*rtx_syn_ack)(struct sock *sk, |
34 | struct request_sock *req, | 34 | struct request_sock *req, |
35 | struct dst_entry *dst); | 35 | struct dst_entry *dst); |
36 | void (*send_ack)(struct sk_buff *skb, | 36 | void (*send_ack)(struct sk_buff *skb, |
37 | struct request_sock *req); | 37 | struct request_sock *req); |
38 | void (*send_reset)(struct sk_buff *skb); | 38 | void (*send_reset)(struct sock *sk, |
39 | struct sk_buff *skb); | ||
39 | void (*destructor)(struct request_sock *req); | 40 | void (*destructor)(struct request_sock *req); |
40 | }; | 41 | }; |
41 | 42 | ||
@@ -51,12 +52,13 @@ struct request_sock { | |||
51 | u32 rcv_wnd; /* rcv_wnd offered first time */ | 52 | u32 rcv_wnd; /* rcv_wnd offered first time */ |
52 | u32 ts_recent; | 53 | u32 ts_recent; |
53 | unsigned long expires; | 54 | unsigned long expires; |
54 | struct request_sock_ops *rsk_ops; | 55 | const struct request_sock_ops *rsk_ops; |
55 | struct sock *sk; | 56 | struct sock *sk; |
56 | u32 secid; | 57 | u32 secid; |
58 | u32 peer_secid; | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops) | 61 | static inline struct request_sock *reqsk_alloc(const struct request_sock_ops *ops) |
60 | { | 62 | { |
61 | struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC); | 63 | struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC); |
62 | 64 | ||
@@ -120,7 +122,7 @@ struct request_sock_queue { | |||
120 | }; | 122 | }; |
121 | 123 | ||
122 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | 124 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, |
123 | const int nr_table_entries); | 125 | unsigned int nr_table_entries); |
124 | 126 | ||
125 | static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue) | 127 | static inline struct listen_sock *reqsk_queue_yank_listen_sk(struct request_sock_queue *queue) |
126 | { | 128 | { |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index b0e9108a4e18..82086392735a 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -60,6 +60,7 @@ struct Qdisc_class_ops | |||
60 | int (*graft)(struct Qdisc *, unsigned long cl, | 60 | int (*graft)(struct Qdisc *, unsigned long cl, |
61 | struct Qdisc *, struct Qdisc **); | 61 | struct Qdisc *, struct Qdisc **); |
62 | struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); | 62 | struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); |
63 | void (*qlen_notify)(struct Qdisc *, unsigned long); | ||
63 | 64 | ||
64 | /* Class manipulation routines */ | 65 | /* Class manipulation routines */ |
65 | unsigned long (*get)(struct Qdisc *, u32 classid); | 66 | unsigned long (*get)(struct Qdisc *, u32 classid); |
@@ -144,7 +145,7 @@ struct tcf_proto | |||
144 | void *root; | 145 | void *root; |
145 | int (*classify)(struct sk_buff*, struct tcf_proto*, | 146 | int (*classify)(struct sk_buff*, struct tcf_proto*, |
146 | struct tcf_result *); | 147 | struct tcf_result *); |
147 | u32 protocol; | 148 | __be16 protocol; |
148 | 149 | ||
149 | /* All the rest */ | 150 | /* All the rest */ |
150 | u32 prio; | 151 | u32 prio; |
@@ -172,9 +173,10 @@ extern void dev_activate(struct net_device *dev); | |||
172 | extern void dev_deactivate(struct net_device *dev); | 173 | extern void dev_deactivate(struct net_device *dev); |
173 | extern void qdisc_reset(struct Qdisc *qdisc); | 174 | extern void qdisc_reset(struct Qdisc *qdisc); |
174 | extern void qdisc_destroy(struct Qdisc *qdisc); | 175 | extern void qdisc_destroy(struct Qdisc *qdisc); |
176 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); | ||
175 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); | 177 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); |
176 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | 178 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, |
177 | struct Qdisc_ops *ops); | 179 | struct Qdisc_ops *ops, u32 parentid); |
178 | 180 | ||
179 | static inline void | 181 | static inline void |
180 | tcf_destroy(struct tcf_proto *tp) | 182 | tcf_destroy(struct tcf_proto *tp) |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 807d6f1ef4b5..6114c4f54b0a 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -116,9 +116,11 @@ typedef enum { | |||
116 | typedef union { | 116 | typedef union { |
117 | __s32 i32; | 117 | __s32 i32; |
118 | __u32 u32; | 118 | __u32 u32; |
119 | __be32 be32; | ||
119 | __u16 u16; | 120 | __u16 u16; |
120 | __u8 u8; | 121 | __u8 u8; |
121 | int error; | 122 | int error; |
123 | __be16 err; | ||
122 | sctp_state_t state; | 124 | sctp_state_t state; |
123 | sctp_event_timeout_t to; | 125 | sctp_event_timeout_t to; |
124 | unsigned long zero; | 126 | unsigned long zero; |
@@ -164,9 +166,11 @@ SCTP_## name (type arg) \ | |||
164 | 166 | ||
165 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) | 167 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) |
166 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) | 168 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) |
169 | SCTP_ARG_CONSTRUCTOR(BE32, __be32, be32) | ||
167 | SCTP_ARG_CONSTRUCTOR(U16, __u16, u16) | 170 | SCTP_ARG_CONSTRUCTOR(U16, __u16, u16) |
168 | SCTP_ARG_CONSTRUCTOR(U8, __u8, u8) | 171 | SCTP_ARG_CONSTRUCTOR(U8, __u8, u8) |
169 | SCTP_ARG_CONSTRUCTOR(ERROR, int, error) | 172 | SCTP_ARG_CONSTRUCTOR(ERROR, int, error) |
173 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ | ||
170 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) | 174 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) |
171 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) | 175 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) |
172 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) | 176 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 6c632e26f72d..5ddb85599863 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -356,7 +356,7 @@ typedef enum { | |||
356 | * addresses. | 356 | * addresses. |
357 | */ | 357 | */ |
358 | #define IS_IPV4_UNUSABLE_ADDRESS(a) \ | 358 | #define IS_IPV4_UNUSABLE_ADDRESS(a) \ |
359 | ((INADDR_BROADCAST == *a) || \ | 359 | ((htonl(INADDR_BROADCAST) == *a) || \ |
360 | (MULTICAST(*a)) || \ | 360 | (MULTICAST(*a)) || \ |
361 | (((unsigned char *)(a))[0] == 0) || \ | 361 | (((unsigned char *)(a))[0] == 0) || \ |
362 | ((((unsigned char *)(a))[0] == 198) && \ | 362 | ((((unsigned char *)(a))[0] == 198) && \ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 764e3af5be93..215461f18db1 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -585,7 +585,7 @@ static inline int ipver2af(__u8 ipver) | |||
585 | } | 585 | } |
586 | 586 | ||
587 | /* Convert from an address parameter type to an address family. */ | 587 | /* Convert from an address parameter type to an address family. */ |
588 | static inline int param_type2af(__u16 type) | 588 | static inline int param_type2af(__be16 type) |
589 | { | 589 | { |
590 | switch (type) { | 590 | switch (type) { |
591 | case SCTP_PARAM_IPV4_ADDRESS: | 591 | case SCTP_PARAM_IPV4_ADDRESS: |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index de313de4fefe..3269ed1cc222 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -213,7 +213,7 @@ struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc, | |||
213 | const struct sctp_chunk *); | 213 | const struct sctp_chunk *); |
214 | struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *, | 214 | struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *, |
215 | const struct sctp_chunk *); | 215 | const struct sctp_chunk *); |
216 | void sctp_init_cause(struct sctp_chunk *, __u16 cause, const void *, size_t); | 216 | void sctp_init_cause(struct sctp_chunk *, __be16 cause, const void *, size_t); |
217 | struct sctp_chunk *sctp_make_abort(const struct sctp_association *, | 217 | struct sctp_chunk *sctp_make_abort(const struct sctp_association *, |
218 | const struct sctp_chunk *, | 218 | const struct sctp_chunk *, |
219 | const size_t hint); | 219 | const size_t hint); |
@@ -236,14 +236,14 @@ struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, | |||
236 | const size_t paylen); | 236 | const size_t paylen); |
237 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *, | 237 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *, |
238 | const struct sctp_chunk *chunk, | 238 | const struct sctp_chunk *chunk, |
239 | __u16 cause_code, | 239 | __be16 cause_code, |
240 | const void *payload, | 240 | const void *payload, |
241 | size_t paylen); | 241 | size_t paylen); |
242 | 242 | ||
243 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, | 243 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, |
244 | union sctp_addr *, | 244 | union sctp_addr *, |
245 | struct sockaddr *, | 245 | struct sockaddr *, |
246 | int, __u16); | 246 | int, __be16); |
247 | struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, | 247 | struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, |
248 | union sctp_addr *addr); | 248 | union sctp_addr *addr); |
249 | struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, | 249 | struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index c6d93bb0dcd2..f8cbe40f52c0 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -537,7 +537,7 @@ struct sctp_af { | |||
537 | struct net_device *); | 537 | struct net_device *); |
538 | void (*dst_saddr) (union sctp_addr *saddr, | 538 | void (*dst_saddr) (union sctp_addr *saddr, |
539 | struct dst_entry *dst, | 539 | struct dst_entry *dst, |
540 | unsigned short port); | 540 | __be16 port); |
541 | int (*cmp_addr) (const union sctp_addr *addr1, | 541 | int (*cmp_addr) (const union sctp_addr *addr1, |
542 | const union sctp_addr *addr2); | 542 | const union sctp_addr *addr2); |
543 | void (*addr_copy) (union sctp_addr *dst, | 543 | void (*addr_copy) (union sctp_addr *dst, |
@@ -553,14 +553,14 @@ struct sctp_af { | |||
553 | struct sock *sk); | 553 | struct sock *sk); |
554 | void (*from_addr_param) (union sctp_addr *, | 554 | void (*from_addr_param) (union sctp_addr *, |
555 | union sctp_addr_param *, | 555 | union sctp_addr_param *, |
556 | __u16 port, int iif); | 556 | __be16 port, int iif); |
557 | int (*to_addr_param) (const union sctp_addr *, | 557 | int (*to_addr_param) (const union sctp_addr *, |
558 | union sctp_addr_param *); | 558 | union sctp_addr_param *); |
559 | int (*addr_valid) (union sctp_addr *, | 559 | int (*addr_valid) (union sctp_addr *, |
560 | struct sctp_sock *, | 560 | struct sctp_sock *, |
561 | const struct sk_buff *); | 561 | const struct sk_buff *); |
562 | sctp_scope_t (*scope) (union sctp_addr *); | 562 | sctp_scope_t (*scope) (union sctp_addr *); |
563 | void (*inaddr_any) (union sctp_addr *, unsigned short); | 563 | void (*inaddr_any) (union sctp_addr *, __be16); |
564 | int (*is_any) (const union sctp_addr *); | 564 | int (*is_any) (const union sctp_addr *); |
565 | int (*available) (union sctp_addr *, | 565 | int (*available) (union sctp_addr *, |
566 | struct sctp_sock *); | 566 | struct sctp_sock *); |
@@ -587,7 +587,7 @@ struct sctp_pf { | |||
587 | struct sctp_sock *); | 587 | struct sctp_sock *); |
588 | int (*bind_verify) (struct sctp_sock *, union sctp_addr *); | 588 | int (*bind_verify) (struct sctp_sock *, union sctp_addr *); |
589 | int (*send_verify) (struct sctp_sock *, union sctp_addr *); | 589 | int (*send_verify) (struct sctp_sock *, union sctp_addr *); |
590 | int (*supported_addrs)(const struct sctp_sock *, __u16 *); | 590 | int (*supported_addrs)(const struct sctp_sock *, __be16 *); |
591 | struct sock *(*create_accept_sk) (struct sock *sk, | 591 | struct sock *(*create_accept_sk) (struct sock *sk, |
592 | struct sctp_association *asoc); | 592 | struct sctp_association *asoc); |
593 | void (*addr_v4map) (struct sctp_sock *, union sctp_addr *); | 593 | void (*addr_v4map) (struct sctp_sock *, union sctp_addr *); |
@@ -1270,7 +1270,7 @@ struct sctp_endpoint { | |||
1270 | * this here so we pre-allocate this once and can re-use | 1270 | * this here so we pre-allocate this once and can re-use |
1271 | * on every receive. | 1271 | * on every receive. |
1272 | */ | 1272 | */ |
1273 | __u8 digest[SCTP_SIGNATURE_SIZE]; | 1273 | __u8 *digest; |
1274 | 1274 | ||
1275 | /* sendbuf acct. policy. */ | 1275 | /* sendbuf acct. policy. */ |
1276 | __u32 sndbuf_policy; | 1276 | __u32 sndbuf_policy; |
@@ -1314,6 +1314,13 @@ int sctp_process_init(struct sctp_association *, sctp_cid_t cid, | |||
1314 | __u32 sctp_generate_tag(const struct sctp_endpoint *); | 1314 | __u32 sctp_generate_tag(const struct sctp_endpoint *); |
1315 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); | 1315 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); |
1316 | 1316 | ||
1317 | struct sctp_inithdr_host { | ||
1318 | __u32 init_tag; | ||
1319 | __u32 a_rwnd; | ||
1320 | __u16 num_outbound_streams; | ||
1321 | __u16 num_inbound_streams; | ||
1322 | __u32 initial_tsn; | ||
1323 | }; | ||
1317 | 1324 | ||
1318 | /* RFC2960 | 1325 | /* RFC2960 |
1319 | * | 1326 | * |
@@ -1482,9 +1489,9 @@ struct sctp_association { | |||
1482 | /* This mask is used to disable sending the ASCONF chunk | 1489 | /* This mask is used to disable sending the ASCONF chunk |
1483 | * with specified parameter to peer. | 1490 | * with specified parameter to peer. |
1484 | */ | 1491 | */ |
1485 | __u16 addip_disabled_mask; | 1492 | __be16 addip_disabled_mask; |
1486 | 1493 | ||
1487 | struct sctp_inithdr i; | 1494 | struct sctp_inithdr_host i; |
1488 | int cookie_len; | 1495 | int cookie_len; |
1489 | void *cookie; | 1496 | void *cookie; |
1490 | 1497 | ||
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 021947da70ea..70a824df6f60 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h | |||
@@ -105,7 +105,7 @@ struct sctp_tsnmap { | |||
105 | * every SACK. Store up to SCTP_MAX_DUP_TSNS worth of | 105 | * every SACK. Store up to SCTP_MAX_DUP_TSNS worth of |
106 | * information. | 106 | * information. |
107 | */ | 107 | */ |
108 | __u32 dup_tsns[SCTP_MAX_DUP_TSNS]; | 108 | __be32 dup_tsns[SCTP_MAX_DUP_TSNS]; |
109 | __u16 num_dup_tsns; | 109 | __u16 num_dup_tsns; |
110 | 110 | ||
111 | /* Record gap ack block information here. */ | 111 | /* Record gap ack block information here. */ |
@@ -162,7 +162,7 @@ static inline __u16 sctp_tsnmap_num_dups(struct sctp_tsnmap *map) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | /* Return pointer to duplicate tsn array as needed by SACK. */ | 164 | /* Return pointer to duplicate tsn array as needed by SACK. */ |
165 | static inline __u32 *sctp_tsnmap_get_dups(struct sctp_tsnmap *map) | 165 | static inline __be32 *sctp_tsnmap_get_dups(struct sctp_tsnmap *map) |
166 | { | 166 | { |
167 | map->num_dup_tsns = 0; | 167 | map->num_dup_tsns = 0; |
168 | return map->dup_tsns; | 168 | return map->dup_tsns; |
diff --git a/include/net/sock.h b/include/net/sock.h index 40bb90ebb2d1..26fc0b16bc0c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -745,7 +745,13 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size) | |||
745 | */ | 745 | */ |
746 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) | 746 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) |
747 | 747 | ||
748 | extern void FASTCALL(lock_sock(struct sock *sk)); | 748 | extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass)); |
749 | |||
750 | static inline void lock_sock(struct sock *sk) | ||
751 | { | ||
752 | lock_sock_nested(sk, 0); | ||
753 | } | ||
754 | |||
749 | extern void FASTCALL(release_sock(struct sock *sk)); | 755 | extern void FASTCALL(release_sock(struct sock *sk)); |
750 | 756 | ||
751 | /* BH context may only use the following locking interface. */ | 757 | /* BH context may only use the following locking interface. */ |
@@ -883,19 +889,23 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb) | |||
883 | } | 889 | } |
884 | 890 | ||
885 | /** | 891 | /** |
886 | * sk_filter_release: Release a socket filter | 892 | * sk_filter_rcu_free: Free a socket filter |
887 | * @sk: socket | 893 | * @rcu: rcu_head that contains the sk_filter to free |
888 | * @fp: filter to remove | ||
889 | * | ||
890 | * Remove a filter from a socket and release its resources. | ||
891 | */ | 894 | */ |
892 | |||
893 | static inline void sk_filter_rcu_free(struct rcu_head *rcu) | 895 | static inline void sk_filter_rcu_free(struct rcu_head *rcu) |
894 | { | 896 | { |
895 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); | 897 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); |
896 | kfree(fp); | 898 | kfree(fp); |
897 | } | 899 | } |
898 | 900 | ||
901 | /** | ||
902 | * sk_filter_release: Release a socket filter | ||
903 | * @sk: socket | ||
904 | * @fp: filter to remove | ||
905 | * | ||
906 | * Remove a filter from a socket and release its resources. | ||
907 | */ | ||
908 | |||
899 | static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp) | 909 | static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp) |
900 | { | 910 | { |
901 | unsigned int size = sk_filter_len(fp); | 911 | unsigned int size = sk_filter_len(fp); |
@@ -944,7 +954,8 @@ static inline void sock_put(struct sock *sk) | |||
944 | sk_free(sk); | 954 | sk_free(sk); |
945 | } | 955 | } |
946 | 956 | ||
947 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb); | 957 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, |
958 | const int nested); | ||
948 | 959 | ||
949 | /* Detach socket from process context. | 960 | /* Detach socket from process context. |
950 | * Announce socket dead, detach it from wait queue and inode. | 961 | * Announce socket dead, detach it from wait queue and inode. |
@@ -1078,7 +1089,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from, | |||
1078 | { | 1089 | { |
1079 | if (skb->ip_summed == CHECKSUM_NONE) { | 1090 | if (skb->ip_summed == CHECKSUM_NONE) { |
1080 | int err = 0; | 1091 | int err = 0; |
1081 | unsigned int csum = csum_and_copy_from_user(from, | 1092 | __wsum csum = csum_and_copy_from_user(from, |
1082 | page_address(page) + off, | 1093 | page_address(page) + off, |
1083 | copy, 0, &err); | 1094 | copy, 0, &err); |
1084 | if (err) | 1095 | if (err) |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 7a093d0aa0fe..c99774f15eba 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
30 | #include <linux/dmaengine.h> | 30 | #include <linux/dmaengine.h> |
31 | #include <linux/crypto.h> | ||
31 | 32 | ||
32 | #include <net/inet_connection_sock.h> | 33 | #include <net/inet_connection_sock.h> |
33 | #include <net/inet_timewait_sock.h> | 34 | #include <net/inet_timewait_sock.h> |
@@ -138,7 +139,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
138 | #define MAX_TCP_SYNCNT 127 | 139 | #define MAX_TCP_SYNCNT 127 |
139 | 140 | ||
140 | #define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */ | 141 | #define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */ |
141 | #define TCP_SYNQ_HSIZE 512 /* Size of SYNACK hash table */ | ||
142 | 142 | ||
143 | #define TCP_PAWS_24DAYS (60 * 60 * 24 * 24) | 143 | #define TCP_PAWS_24DAYS (60 * 60 * 24 * 24) |
144 | #define TCP_PAWS_MSL 60 /* Per-host timestamps are invalidated | 144 | #define TCP_PAWS_MSL 60 /* Per-host timestamps are invalidated |
@@ -162,6 +162,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
162 | #define TCPOPT_SACK_PERM 4 /* SACK Permitted */ | 162 | #define TCPOPT_SACK_PERM 4 /* SACK Permitted */ |
163 | #define TCPOPT_SACK 5 /* SACK Block */ | 163 | #define TCPOPT_SACK 5 /* SACK Block */ |
164 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ | 164 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ |
165 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ | ||
165 | 166 | ||
166 | /* | 167 | /* |
167 | * TCP option lengths | 168 | * TCP option lengths |
@@ -171,6 +172,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
171 | #define TCPOLEN_WINDOW 3 | 172 | #define TCPOLEN_WINDOW 3 |
172 | #define TCPOLEN_SACK_PERM 2 | 173 | #define TCPOLEN_SACK_PERM 2 |
173 | #define TCPOLEN_TIMESTAMP 10 | 174 | #define TCPOLEN_TIMESTAMP 10 |
175 | #define TCPOLEN_MD5SIG 18 | ||
174 | 176 | ||
175 | /* But this is what stacks really send out. */ | 177 | /* But this is what stacks really send out. */ |
176 | #define TCPOLEN_TSTAMP_ALIGNED 12 | 178 | #define TCPOLEN_TSTAMP_ALIGNED 12 |
@@ -179,6 +181,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
179 | #define TCPOLEN_SACK_BASE 2 | 181 | #define TCPOLEN_SACK_BASE 2 |
180 | #define TCPOLEN_SACK_BASE_ALIGNED 4 | 182 | #define TCPOLEN_SACK_BASE_ALIGNED 4 |
181 | #define TCPOLEN_SACK_PERBLOCK 8 | 183 | #define TCPOLEN_SACK_PERBLOCK 8 |
184 | #define TCPOLEN_MD5SIG_ALIGNED 20 | ||
182 | 185 | ||
183 | /* Flags in tp->nonagle */ | 186 | /* Flags in tp->nonagle */ |
184 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ | 187 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ |
@@ -300,6 +303,8 @@ extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | |||
300 | extern int tcp_twsk_unique(struct sock *sk, | 303 | extern int tcp_twsk_unique(struct sock *sk, |
301 | struct sock *sktw, void *twp); | 304 | struct sock *sktw, void *twp); |
302 | 305 | ||
306 | extern void tcp_twsk_destructor(struct sock *sk); | ||
307 | |||
303 | static inline void tcp_dec_quickack_mode(struct sock *sk, | 308 | static inline void tcp_dec_quickack_mode(struct sock *sk, |
304 | const unsigned int pkts) | 309 | const unsigned int pkts) |
305 | { | 310 | { |
@@ -621,8 +626,12 @@ enum tcp_ca_event { | |||
621 | * Interface for adding new TCP congestion control handlers | 626 | * Interface for adding new TCP congestion control handlers |
622 | */ | 627 | */ |
623 | #define TCP_CA_NAME_MAX 16 | 628 | #define TCP_CA_NAME_MAX 16 |
629 | #define TCP_CA_MAX 128 | ||
630 | #define TCP_CA_BUF_MAX (TCP_CA_NAME_MAX*TCP_CA_MAX) | ||
631 | |||
624 | struct tcp_congestion_ops { | 632 | struct tcp_congestion_ops { |
625 | struct list_head list; | 633 | struct list_head list; |
634 | int non_restricted; | ||
626 | 635 | ||
627 | /* initialize private data (optional) */ | 636 | /* initialize private data (optional) */ |
628 | void (*init)(struct sock *sk); | 637 | void (*init)(struct sock *sk); |
@@ -660,6 +669,9 @@ extern void tcp_init_congestion_control(struct sock *sk); | |||
660 | extern void tcp_cleanup_congestion_control(struct sock *sk); | 669 | extern void tcp_cleanup_congestion_control(struct sock *sk); |
661 | extern int tcp_set_default_congestion_control(const char *name); | 670 | extern int tcp_set_default_congestion_control(const char *name); |
662 | extern void tcp_get_default_congestion_control(char *name); | 671 | extern void tcp_get_default_congestion_control(char *name); |
672 | extern void tcp_get_available_congestion_control(char *buf, size_t len); | ||
673 | extern void tcp_get_allowed_congestion_control(char *buf, size_t len); | ||
674 | extern int tcp_set_allowed_congestion_control(char *allowed); | ||
663 | extern int tcp_set_congestion_control(struct sock *sk, const char *name); | 675 | extern int tcp_set_congestion_control(struct sock *sk, const char *name); |
664 | extern void tcp_slow_start(struct tcp_sock *tp); | 676 | extern void tcp_slow_start(struct tcp_sock *tp); |
665 | 677 | ||
@@ -795,14 +807,14 @@ static inline void tcp_update_wl(struct tcp_sock *tp, u32 ack, u32 seq) | |||
795 | /* | 807 | /* |
796 | * Calculate(/check) TCP checksum | 808 | * Calculate(/check) TCP checksum |
797 | */ | 809 | */ |
798 | static inline u16 tcp_v4_check(struct tcphdr *th, int len, | 810 | static inline __sum16 tcp_v4_check(struct tcphdr *th, int len, |
799 | unsigned long saddr, unsigned long daddr, | 811 | __be32 saddr, __be32 daddr, |
800 | unsigned long base) | 812 | __wsum base) |
801 | { | 813 | { |
802 | return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); | 814 | return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base); |
803 | } | 815 | } |
804 | 816 | ||
805 | static inline int __tcp_checksum_complete(struct sk_buff *skb) | 817 | static inline __sum16 __tcp_checksum_complete(struct sk_buff *skb) |
806 | { | 818 | { |
807 | return __skb_checksum_complete(skb); | 819 | return __skb_checksum_complete(skb); |
808 | } | 820 | } |
@@ -1058,6 +1070,114 @@ static inline void clear_all_retrans_hints(struct tcp_sock *tp){ | |||
1058 | tp->fastpath_skb_hint = NULL; | 1070 | tp->fastpath_skb_hint = NULL; |
1059 | } | 1071 | } |
1060 | 1072 | ||
1073 | /* MD5 Signature */ | ||
1074 | struct crypto_hash; | ||
1075 | |||
1076 | /* - key database */ | ||
1077 | struct tcp_md5sig_key { | ||
1078 | u8 *key; | ||
1079 | u8 keylen; | ||
1080 | }; | ||
1081 | |||
1082 | struct tcp4_md5sig_key { | ||
1083 | u8 *key; | ||
1084 | u16 keylen; | ||
1085 | __be32 addr; | ||
1086 | }; | ||
1087 | |||
1088 | struct tcp6_md5sig_key { | ||
1089 | u8 *key; | ||
1090 | u16 keylen; | ||
1091 | #if 0 | ||
1092 | u32 scope_id; /* XXX */ | ||
1093 | #endif | ||
1094 | struct in6_addr addr; | ||
1095 | }; | ||
1096 | |||
1097 | /* - sock block */ | ||
1098 | struct tcp_md5sig_info { | ||
1099 | struct tcp4_md5sig_key *keys4; | ||
1100 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
1101 | struct tcp6_md5sig_key *keys6; | ||
1102 | u32 entries6; | ||
1103 | u32 alloced6; | ||
1104 | #endif | ||
1105 | u32 entries4; | ||
1106 | u32 alloced4; | ||
1107 | }; | ||
1108 | |||
1109 | /* - pseudo header */ | ||
1110 | struct tcp4_pseudohdr { | ||
1111 | __be32 saddr; | ||
1112 | __be32 daddr; | ||
1113 | __u8 pad; | ||
1114 | __u8 protocol; | ||
1115 | __be16 len; | ||
1116 | }; | ||
1117 | |||
1118 | struct tcp6_pseudohdr { | ||
1119 | struct in6_addr saddr; | ||
1120 | struct in6_addr daddr; | ||
1121 | __be32 len; | ||
1122 | __be32 protocol; /* including padding */ | ||
1123 | }; | ||
1124 | |||
1125 | union tcp_md5sum_block { | ||
1126 | struct tcp4_pseudohdr ip4; | ||
1127 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
1128 | struct tcp6_pseudohdr ip6; | ||
1129 | #endif | ||
1130 | }; | ||
1131 | |||
1132 | /* - pool: digest algorithm, hash description and scratch buffer */ | ||
1133 | struct tcp_md5sig_pool { | ||
1134 | struct hash_desc md5_desc; | ||
1135 | union tcp_md5sum_block md5_blk; | ||
1136 | }; | ||
1137 | |||
1138 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | ||
1139 | |||
1140 | /* - functions */ | ||
1141 | extern int tcp_v4_calc_md5_hash(char *md5_hash, | ||
1142 | struct tcp_md5sig_key *key, | ||
1143 | struct sock *sk, | ||
1144 | struct dst_entry *dst, | ||
1145 | struct request_sock *req, | ||
1146 | struct tcphdr *th, | ||
1147 | int protocol, int tcplen); | ||
1148 | extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, | ||
1149 | struct sock *addr_sk); | ||
1150 | |||
1151 | extern int tcp_v4_md5_do_add(struct sock *sk, | ||
1152 | __be32 addr, | ||
1153 | u8 *newkey, | ||
1154 | u8 newkeylen); | ||
1155 | |||
1156 | extern int tcp_v4_md5_do_del(struct sock *sk, | ||
1157 | __be32 addr); | ||
1158 | |||
1159 | extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); | ||
1160 | extern void tcp_free_md5sig_pool(void); | ||
1161 | |||
1162 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); | ||
1163 | extern void __tcp_put_md5sig_pool(void); | ||
1164 | |||
1165 | static inline | ||
1166 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) | ||
1167 | { | ||
1168 | int cpu = get_cpu(); | ||
1169 | struct tcp_md5sig_pool *ret = __tcp_get_md5sig_pool(cpu); | ||
1170 | if (!ret) | ||
1171 | put_cpu(); | ||
1172 | return ret; | ||
1173 | } | ||
1174 | |||
1175 | static inline void tcp_put_md5sig_pool(void) | ||
1176 | { | ||
1177 | __tcp_put_md5sig_pool(); | ||
1178 | put_cpu(); | ||
1179 | } | ||
1180 | |||
1061 | /* /proc */ | 1181 | /* /proc */ |
1062 | enum tcp_seq_states { | 1182 | enum tcp_seq_states { |
1063 | TCP_SEQ_STATE_LISTENING, | 1183 | TCP_SEQ_STATE_LISTENING, |
@@ -1097,6 +1217,35 @@ extern int tcp4_proc_init(void); | |||
1097 | extern void tcp4_proc_exit(void); | 1217 | extern void tcp4_proc_exit(void); |
1098 | #endif | 1218 | #endif |
1099 | 1219 | ||
1220 | /* TCP af-specific functions */ | ||
1221 | struct tcp_sock_af_ops { | ||
1222 | #ifdef CONFIG_TCP_MD5SIG | ||
1223 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, | ||
1224 | struct sock *addr_sk); | ||
1225 | int (*calc_md5_hash) (char *location, | ||
1226 | struct tcp_md5sig_key *md5, | ||
1227 | struct sock *sk, | ||
1228 | struct dst_entry *dst, | ||
1229 | struct request_sock *req, | ||
1230 | struct tcphdr *th, | ||
1231 | int protocol, int len); | ||
1232 | int (*md5_add) (struct sock *sk, | ||
1233 | struct sock *addr_sk, | ||
1234 | u8 *newkey, | ||
1235 | u8 len); | ||
1236 | int (*md5_parse) (struct sock *sk, | ||
1237 | char __user *optval, | ||
1238 | int optlen); | ||
1239 | #endif | ||
1240 | }; | ||
1241 | |||
1242 | struct tcp_request_sock_ops { | ||
1243 | #ifdef CONFIG_TCP_MD5SIG | ||
1244 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, | ||
1245 | struct request_sock *req); | ||
1246 | #endif | ||
1247 | }; | ||
1248 | |||
1100 | extern void tcp_v4_init(struct net_proto_family *ops); | 1249 | extern void tcp_v4_init(struct net_proto_family *ops); |
1101 | extern void tcp_init(void); | 1250 | extern void tcp_init(void); |
1102 | 1251 | ||
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index be293d795e38..d7a306ea560d 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -31,6 +31,9 @@ static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | |||
31 | 31 | ||
32 | static inline void twsk_destructor(struct sock *sk) | 32 | static inline void twsk_destructor(struct sock *sk) |
33 | { | 33 | { |
34 | BUG_ON(sk == NULL); | ||
35 | BUG_ON(sk->sk_prot == NULL); | ||
36 | BUG_ON(sk->sk_prot->twsk_prot == NULL); | ||
34 | if (sk->sk_prot->twsk_prot->twsk_destructor != NULL) | 37 | if (sk->sk_prot->twsk_prot->twsk_destructor != NULL) |
35 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 38 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
36 | } | 39 | } |
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h index e07136d74c2f..2151a80cdf30 100644 --- a/include/net/tipc/tipc_bearer.h +++ b/include/net/tipc/tipc_bearer.h | |||
@@ -58,7 +58,7 @@ | |||
58 | */ | 58 | */ |
59 | 59 | ||
60 | struct tipc_media_addr { | 60 | struct tipc_media_addr { |
61 | __u32 type; /* bearer type (network byte order) */ | 61 | __be32 type; /* bearer type (network byte order) */ |
62 | union { | 62 | union { |
63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ | 63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ |
64 | #if 0 | 64 | #if 0 |
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h index 4d096eebc93f..fb42eb7a86a5 100644 --- a/include/net/tipc/tipc_msg.h +++ b/include/net/tipc/tipc_msg.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
41 | 41 | ||
42 | struct tipc_msg { | 42 | struct tipc_msg { |
43 | u32 hdr[15]; | 43 | __be32 hdr[15]; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | 46 | ||
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 61f724c1036f..409da3a9a455 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | extern struct proto rawv6_prot; | 12 | extern struct proto rawv6_prot; |
13 | extern struct proto udpv6_prot; | 13 | extern struct proto udpv6_prot; |
14 | extern struct proto udplitev6_prot; | ||
14 | extern struct proto tcpv6_prot; | 15 | extern struct proto tcpv6_prot; |
15 | 16 | ||
16 | struct flowi; | 17 | struct flowi; |
@@ -24,6 +25,7 @@ extern void ipv6_destopt_init(void); | |||
24 | /* transport protocols */ | 25 | /* transport protocols */ |
25 | extern void rawv6_init(void); | 26 | extern void rawv6_init(void); |
26 | extern void udpv6_init(void); | 27 | extern void udpv6_init(void); |
28 | extern void udplitev6_init(void); | ||
27 | extern void tcpv6_init(void); | 29 | extern void tcpv6_init(void); |
28 | 30 | ||
29 | extern int udpv6_connect(struct sock *sk, | 31 | extern int udpv6_connect(struct sock *sk, |
diff --git a/include/net/udp.h b/include/net/udp.h index db0c05f67546..1548d68d45da 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -26,9 +26,28 @@ | |||
26 | #include <net/inet_sock.h> | 26 | #include <net/inet_sock.h> |
27 | #include <net/sock.h> | 27 | #include <net/sock.h> |
28 | #include <net/snmp.h> | 28 | #include <net/snmp.h> |
29 | #include <net/ip.h> | ||
30 | #include <linux/ipv6.h> | ||
29 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
30 | 32 | ||
31 | #define UDP_HTABLE_SIZE 128 | 33 | /** |
34 | * struct udp_skb_cb - UDP(-Lite) private variables | ||
35 | * | ||
36 | * @header: private variables used by IPv4/IPv6 | ||
37 | * @cscov: checksum coverage length (UDP-Lite only) | ||
38 | * @partial_cov: if set indicates partial csum coverage | ||
39 | */ | ||
40 | struct udp_skb_cb { | ||
41 | union { | ||
42 | struct inet_skb_parm h4; | ||
43 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | ||
44 | struct inet6_skb_parm h6; | ||
45 | #endif | ||
46 | } header; | ||
47 | __u16 cscov; | ||
48 | __u8 partial_cov; | ||
49 | }; | ||
50 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) | ||
32 | 51 | ||
33 | extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; | 52 | extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; |
34 | extern rwlock_t udp_hash_lock; | 53 | extern rwlock_t udp_hash_lock; |
@@ -47,6 +66,62 @@ extern struct proto udp_prot; | |||
47 | 66 | ||
48 | struct sk_buff; | 67 | struct sk_buff; |
49 | 68 | ||
69 | /* | ||
70 | * Generic checksumming routines for UDP(-Lite) v4 and v6 | ||
71 | */ | ||
72 | static inline __sum16 __udp_lib_checksum_complete(struct sk_buff *skb) | ||
73 | { | ||
74 | if (! UDP_SKB_CB(skb)->partial_cov) | ||
75 | return __skb_checksum_complete(skb); | ||
76 | return csum_fold(skb_checksum(skb, 0, UDP_SKB_CB(skb)->cscov, | ||
77 | skb->csum)); | ||
78 | } | ||
79 | |||
80 | static inline int udp_lib_checksum_complete(struct sk_buff *skb) | ||
81 | { | ||
82 | return skb->ip_summed != CHECKSUM_UNNECESSARY && | ||
83 | __udp_lib_checksum_complete(skb); | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * udp_csum_outgoing - compute UDPv4/v6 checksum over fragments | ||
88 | * @sk: socket we are writing to | ||
89 | * @skb: sk_buff containing the filled-in UDP header | ||
90 | * (checksum field must be zeroed out) | ||
91 | */ | ||
92 | static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb) | ||
93 | { | ||
94 | __wsum csum = csum_partial(skb->h.raw, sizeof(struct udphdr), 0); | ||
95 | |||
96 | skb_queue_walk(&sk->sk_write_queue, skb) { | ||
97 | csum = csum_add(csum, skb->csum); | ||
98 | } | ||
99 | return csum; | ||
100 | } | ||
101 | |||
102 | /* hash routines shared between UDPv4/6 and UDP-Litev4/6 */ | ||
103 | static inline void udp_lib_hash(struct sock *sk) | ||
104 | { | ||
105 | BUG(); | ||
106 | } | ||
107 | |||
108 | static inline void udp_lib_unhash(struct sock *sk) | ||
109 | { | ||
110 | write_lock_bh(&udp_hash_lock); | ||
111 | if (sk_del_node_init(sk)) { | ||
112 | inet_sk(sk)->num = 0; | ||
113 | sock_prot_dec_use(sk->sk_prot); | ||
114 | } | ||
115 | write_unlock_bh(&udp_hash_lock); | ||
116 | } | ||
117 | |||
118 | static inline void udp_lib_close(struct sock *sk, long timeout) | ||
119 | { | ||
120 | sk_common_release(sk); | ||
121 | } | ||
122 | |||
123 | |||
124 | /* net/ipv4/udp.c */ | ||
50 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 125 | extern int udp_get_port(struct sock *sk, unsigned short snum, |
51 | int (*saddr_cmp)(const struct sock *, const struct sock *)); | 126 | int (*saddr_cmp)(const struct sock *, const struct sock *)); |
52 | extern void udp_err(struct sk_buff *, u32); | 127 | extern void udp_err(struct sk_buff *, u32); |
@@ -59,23 +134,36 @@ extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); | |||
59 | extern int udp_disconnect(struct sock *sk, int flags); | 134 | extern int udp_disconnect(struct sock *sk, int flags); |
60 | extern unsigned int udp_poll(struct file *file, struct socket *sock, | 135 | extern unsigned int udp_poll(struct file *file, struct socket *sock, |
61 | poll_table *wait); | 136 | poll_table *wait); |
137 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, | ||
138 | char __user *optval, int __user *optlen); | ||
139 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | ||
140 | char __user *optval, int optlen, | ||
141 | int (*push_pending_frames)(struct sock *)); | ||
62 | 142 | ||
63 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); | 143 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); |
64 | #define UDP_INC_STATS(field) SNMP_INC_STATS(udp_statistics, field) | 144 | /* |
65 | #define UDP_INC_STATS_BH(field) SNMP_INC_STATS_BH(udp_statistics, field) | 145 | * SNMP statistics for UDP and UDP-Lite |
66 | #define UDP_INC_STATS_USER(field) SNMP_INC_STATS_USER(udp_statistics, field) | 146 | */ |
147 | #define UDP_INC_STATS_USER(field, is_udplite) do { \ | ||
148 | if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ | ||
149 | else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) | ||
150 | #define UDP_INC_STATS_BH(field, is_udplite) do { \ | ||
151 | if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ | ||
152 | else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) | ||
67 | 153 | ||
68 | /* /proc */ | 154 | /* /proc */ |
69 | struct udp_seq_afinfo { | 155 | struct udp_seq_afinfo { |
70 | struct module *owner; | 156 | struct module *owner; |
71 | char *name; | 157 | char *name; |
72 | sa_family_t family; | 158 | sa_family_t family; |
159 | struct hlist_head *hashtable; | ||
73 | int (*seq_show) (struct seq_file *m, void *v); | 160 | int (*seq_show) (struct seq_file *m, void *v); |
74 | struct file_operations *seq_fops; | 161 | struct file_operations *seq_fops; |
75 | }; | 162 | }; |
76 | 163 | ||
77 | struct udp_iter_state { | 164 | struct udp_iter_state { |
78 | sa_family_t family; | 165 | sa_family_t family; |
166 | struct hlist_head *hashtable; | ||
79 | int bucket; | 167 | int bucket; |
80 | struct seq_operations seq_ops; | 168 | struct seq_operations seq_ops; |
81 | }; | 169 | }; |
diff --git a/include/net/udplite.h b/include/net/udplite.h new file mode 100644 index 000000000000..67ac51424307 --- /dev/null +++ b/include/net/udplite.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * Definitions for the UDP-Lite (RFC 3828) code. | ||
3 | */ | ||
4 | #ifndef _UDPLITE_H | ||
5 | #define _UDPLITE_H | ||
6 | |||
7 | #include <net/ip6_checksum.h> | ||
8 | |||
9 | /* UDP-Lite socket options */ | ||
10 | #define UDPLITE_SEND_CSCOV 10 /* sender partial coverage (as sent) */ | ||
11 | #define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ | ||
12 | |||
13 | extern struct proto udplite_prot; | ||
14 | extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; | ||
15 | |||
16 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ | ||
17 | DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics); | ||
18 | |||
19 | /* | ||
20 | * Checksum computation is all in software, hence simpler getfrag. | ||
21 | */ | ||
22 | static __inline__ int udplite_getfrag(void *from, char *to, int offset, | ||
23 | int len, int odd, struct sk_buff *skb) | ||
24 | { | ||
25 | return memcpy_fromiovecend(to, (struct iovec *) from, offset, len); | ||
26 | } | ||
27 | |||
28 | /* Designate sk as UDP-Lite socket */ | ||
29 | static inline int udplite_sk_init(struct sock *sk) | ||
30 | { | ||
31 | udp_sk(sk)->pcflag = UDPLITE_BIT; | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | /* | ||
36 | * Checksumming routines | ||
37 | */ | ||
38 | static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh) | ||
39 | { | ||
40 | u16 cscov; | ||
41 | |||
42 | /* In UDPv4 a zero checksum means that the transmitter generated no | ||
43 | * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets | ||
44 | * with a zero checksum field are illegal. */ | ||
45 | if (uh->check == 0) { | ||
46 | LIMIT_NETDEBUG(KERN_DEBUG "UDPLITE: zeroed checksum field\n"); | ||
47 | return 1; | ||
48 | } | ||
49 | |||
50 | UDP_SKB_CB(skb)->partial_cov = 0; | ||
51 | cscov = ntohs(uh->len); | ||
52 | |||
53 | if (cscov == 0) /* Indicates that full coverage is required. */ | ||
54 | cscov = skb->len; | ||
55 | else if (cscov < 8 || cscov > skb->len) { | ||
56 | /* | ||
57 | * Coverage length violates RFC 3828: log and discard silently. | ||
58 | */ | ||
59 | LIMIT_NETDEBUG(KERN_DEBUG "UDPLITE: bad csum coverage %d/%d\n", | ||
60 | cscov, skb->len); | ||
61 | return 1; | ||
62 | |||
63 | } else if (cscov < skb->len) | ||
64 | UDP_SKB_CB(skb)->partial_cov = 1; | ||
65 | |||
66 | UDP_SKB_CB(skb)->cscov = cscov; | ||
67 | |||
68 | /* | ||
69 | * There is no known NIC manufacturer supporting UDP-Lite yet, | ||
70 | * hence ip_summed is always (re-)set to CHECKSUM_NONE. | ||
71 | */ | ||
72 | skb->ip_summed = CHECKSUM_NONE; | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | static __inline__ int udplite4_csum_init(struct sk_buff *skb, struct udphdr *uh) | ||
78 | { | ||
79 | int rc = udplite_checksum_init(skb, uh); | ||
80 | |||
81 | if (!rc) | ||
82 | skb->csum = csum_tcpudp_nofold(skb->nh.iph->saddr, | ||
83 | skb->nh.iph->daddr, | ||
84 | skb->len, IPPROTO_UDPLITE, 0); | ||
85 | return rc; | ||
86 | } | ||
87 | |||
88 | static __inline__ int udplite6_csum_init(struct sk_buff *skb, struct udphdr *uh) | ||
89 | { | ||
90 | int rc = udplite_checksum_init(skb, uh); | ||
91 | |||
92 | if (!rc) | ||
93 | skb->csum = ~csum_unfold(csum_ipv6_magic(&skb->nh.ipv6h->saddr, | ||
94 | &skb->nh.ipv6h->daddr, | ||
95 | skb->len, IPPROTO_UDPLITE, 0)); | ||
96 | return rc; | ||
97 | } | ||
98 | |||
99 | static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) | ||
100 | { | ||
101 | int cscov = up->len; | ||
102 | |||
103 | /* | ||
104 | * Sender has set `partial coverage' option on UDP-Lite socket | ||
105 | */ | ||
106 | if (up->pcflag & UDPLITE_SEND_CC) { | ||
107 | if (up->pcslen < up->len) { | ||
108 | /* up->pcslen == 0 means that full coverage is required, | ||
109 | * partial coverage only if 0 < up->pcslen < up->len */ | ||
110 | if (0 < up->pcslen) { | ||
111 | cscov = up->pcslen; | ||
112 | } | ||
113 | uh->len = htons(up->pcslen); | ||
114 | } | ||
115 | /* | ||
116 | * NOTE: Causes for the error case `up->pcslen > up->len': | ||
117 | * (i) Application error (will not be penalized). | ||
118 | * (ii) Payload too big for send buffer: data is split | ||
119 | * into several packets, each with its own header. | ||
120 | * In this case (e.g. last segment), coverage may | ||
121 | * exceed packet length. | ||
122 | * Since packets with coverage length > packet length are | ||
123 | * illegal, we fall back to the defaults here. | ||
124 | */ | ||
125 | } | ||
126 | return cscov; | ||
127 | } | ||
128 | |||
129 | static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) | ||
130 | { | ||
131 | int off, len, cscov = udplite_sender_cscov(udp_sk(sk), skb->h.uh); | ||
132 | __wsum csum = 0; | ||
133 | |||
134 | skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ | ||
135 | |||
136 | skb_queue_walk(&sk->sk_write_queue, skb) { | ||
137 | off = skb->h.raw - skb->data; | ||
138 | len = skb->len - off; | ||
139 | |||
140 | csum = skb_checksum(skb, off, (cscov > len)? len : cscov, csum); | ||
141 | |||
142 | if ((cscov -= len) <= 0) | ||
143 | break; | ||
144 | } | ||
145 | return csum; | ||
146 | } | ||
147 | |||
148 | extern void udplite4_register(void); | ||
149 | extern int udplite_get_port(struct sock *sk, unsigned short snum, | ||
150 | int (*scmp)(const struct sock *, const struct sock *)); | ||
151 | #endif /* _UDPLITE_H */ | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 737fdb2ee8a4..15ec19dcf9c8 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -310,6 +310,8 @@ struct xfrm_tmpl | |||
310 | /* Source address of tunnel. Ignored, if it is not a tunnel. */ | 310 | /* Source address of tunnel. Ignored, if it is not a tunnel. */ |
311 | xfrm_address_t saddr; | 311 | xfrm_address_t saddr; |
312 | 312 | ||
313 | unsigned short encap_family; | ||
314 | |||
313 | __u32 reqid; | 315 | __u32 reqid; |
314 | 316 | ||
315 | /* Mode: transport, tunnel etc. */ | 317 | /* Mode: transport, tunnel etc. */ |
@@ -340,18 +342,19 @@ struct xfrm_policy | |||
340 | atomic_t refcnt; | 342 | atomic_t refcnt; |
341 | struct timer_list timer; | 343 | struct timer_list timer; |
342 | 344 | ||
343 | u8 type; | ||
344 | u32 priority; | 345 | u32 priority; |
345 | u32 index; | 346 | u32 index; |
346 | struct xfrm_selector selector; | 347 | struct xfrm_selector selector; |
347 | struct xfrm_lifetime_cfg lft; | 348 | struct xfrm_lifetime_cfg lft; |
348 | struct xfrm_lifetime_cur curlft; | 349 | struct xfrm_lifetime_cur curlft; |
349 | struct dst_entry *bundles; | 350 | struct dst_entry *bundles; |
350 | __u16 family; | 351 | u16 family; |
351 | __u8 action; | 352 | u8 type; |
352 | __u8 flags; | 353 | u8 action; |
353 | __u8 dead; | 354 | u8 flags; |
354 | __u8 xfrm_nr; | 355 | u8 dead; |
356 | u8 xfrm_nr; | ||
357 | /* XXX 1 byte hole, try to pack */ | ||
355 | struct xfrm_sec_ctx *security; | 358 | struct xfrm_sec_ctx *security; |
356 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 359 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
357 | }; | 360 | }; |
@@ -379,7 +382,7 @@ struct xfrm_mgr | |||
379 | int (*notify)(struct xfrm_state *x, struct km_event *c); | 382 | int (*notify)(struct xfrm_state *x, struct km_event *c); |
380 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | 383 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); |
381 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); | 384 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); |
382 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 385 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
383 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); | 386 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
384 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 387 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
385 | }; | 388 | }; |
@@ -468,6 +471,7 @@ __be16 xfrm_flowi_sport(struct flowi *fl) | |||
468 | switch(fl->proto) { | 471 | switch(fl->proto) { |
469 | case IPPROTO_TCP: | 472 | case IPPROTO_TCP: |
470 | case IPPROTO_UDP: | 473 | case IPPROTO_UDP: |
474 | case IPPROTO_UDPLITE: | ||
471 | case IPPROTO_SCTP: | 475 | case IPPROTO_SCTP: |
472 | port = fl->fl_ip_sport; | 476 | port = fl->fl_ip_sport; |
473 | break; | 477 | break; |
@@ -493,6 +497,7 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
493 | switch(fl->proto) { | 497 | switch(fl->proto) { |
494 | case IPPROTO_TCP: | 498 | case IPPROTO_TCP: |
495 | case IPPROTO_UDP: | 499 | case IPPROTO_UDP: |
500 | case IPPROTO_UDPLITE: | ||
496 | case IPPROTO_SCTP: | 501 | case IPPROTO_SCTP: |
497 | port = fl->fl_ip_dport; | 502 | port = fl->fl_ip_dport; |
498 | break; | 503 | break; |
@@ -506,40 +511,8 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
506 | return port; | 511 | return port; |
507 | } | 512 | } |
508 | 513 | ||
509 | static inline int | 514 | extern int xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl, |
510 | __xfrm4_selector_match(struct xfrm_selector *sel, struct flowi *fl) | 515 | unsigned short family); |
511 | { | ||
512 | return addr_match(&fl->fl4_dst, &sel->daddr, sel->prefixlen_d) && | ||
513 | addr_match(&fl->fl4_src, &sel->saddr, sel->prefixlen_s) && | ||
514 | !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && | ||
515 | !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && | ||
516 | (fl->proto == sel->proto || !sel->proto) && | ||
517 | (fl->oif == sel->ifindex || !sel->ifindex); | ||
518 | } | ||
519 | |||
520 | static inline int | ||
521 | __xfrm6_selector_match(struct xfrm_selector *sel, struct flowi *fl) | ||
522 | { | ||
523 | return addr_match(&fl->fl6_dst, &sel->daddr, sel->prefixlen_d) && | ||
524 | addr_match(&fl->fl6_src, &sel->saddr, sel->prefixlen_s) && | ||
525 | !((xfrm_flowi_dport(fl) ^ sel->dport) & sel->dport_mask) && | ||
526 | !((xfrm_flowi_sport(fl) ^ sel->sport) & sel->sport_mask) && | ||
527 | (fl->proto == sel->proto || !sel->proto) && | ||
528 | (fl->oif == sel->ifindex || !sel->ifindex); | ||
529 | } | ||
530 | |||
531 | static inline int | ||
532 | xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl, | ||
533 | unsigned short family) | ||
534 | { | ||
535 | switch (family) { | ||
536 | case AF_INET: | ||
537 | return __xfrm4_selector_match(sel, fl); | ||
538 | case AF_INET6: | ||
539 | return __xfrm6_selector_match(sel, fl); | ||
540 | } | ||
541 | return 0; | ||
542 | } | ||
543 | 516 | ||
544 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 517 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
545 | /* If neither has a context --> match | 518 | /* If neither has a context --> match |
@@ -887,8 +860,7 @@ struct xfrm_tunnel { | |||
887 | struct xfrm6_tunnel { | 860 | struct xfrm6_tunnel { |
888 | int (*handler)(struct sk_buff *skb); | 861 | int (*handler)(struct sk_buff *skb); |
889 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | 862 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, |
890 | int type, int code, int offset, __u32 info); | 863 | int type, int code, int offset, __be32 info); |
891 | |||
892 | struct xfrm6_tunnel *next; | 864 | struct xfrm6_tunnel *next; |
893 | int priority; | 865 | int priority; |
894 | }; | 866 | }; |
@@ -951,9 +923,9 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | |||
951 | xfrm_address_t *saddr, u8 proto); | 923 | xfrm_address_t *saddr, u8 proto); |
952 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); | 924 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); |
953 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); | 925 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); |
954 | extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); | 926 | extern __be32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); |
955 | extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); | 927 | extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); |
956 | extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); | 928 | extern __be32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); |
957 | extern int xfrm6_output(struct sk_buff *skb); | 929 | extern int xfrm6_output(struct sk_buff *skb); |
958 | extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, | 930 | extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, |
959 | u8 **prevhdr); | 931 | u8 **prevhdr); |
@@ -1000,7 +972,7 @@ extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, | |||
1000 | extern void xfrm_init_pmtu(struct dst_entry *dst); | 972 | extern void xfrm_init_pmtu(struct dst_entry *dst); |
1001 | 973 | ||
1002 | extern wait_queue_head_t km_waitq; | 974 | extern wait_queue_head_t km_waitq; |
1003 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); | 975 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
1004 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); | 976 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
1005 | extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 977 | extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
1006 | 978 | ||
@@ -1033,7 +1005,7 @@ static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, | |||
1033 | switch (family) { | 1005 | switch (family) { |
1034 | default: | 1006 | default: |
1035 | case AF_INET: | 1007 | case AF_INET: |
1036 | return a->a4 - b->a4; | 1008 | return (__force __u32)a->a4 - (__force __u32)b->a4; |
1037 | case AF_INET6: | 1009 | case AF_INET6: |
1038 | return ipv6_addr_cmp((struct in6_addr *)a, | 1010 | return ipv6_addr_cmp((struct in6_addr *)a, |
1039 | (struct in6_addr *)b); | 1011 | (struct in6_addr *)b); |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 81b62307621d..c094e5012862 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -36,6 +36,22 @@ | |||
36 | #include <linux/socket.h> | 36 | #include <linux/socket.h> |
37 | #include <rdma/ib_verbs.h> | 37 | #include <rdma/ib_verbs.h> |
38 | 38 | ||
39 | struct rdma_addr_client { | ||
40 | atomic_t refcount; | ||
41 | struct completion comp; | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * rdma_addr_register_client - Register an address client. | ||
46 | */ | ||
47 | void rdma_addr_register_client(struct rdma_addr_client *client); | ||
48 | |||
49 | /** | ||
50 | * rdma_addr_unregister_client - Deregister an address client. | ||
51 | * @client: Client object to deregister. | ||
52 | */ | ||
53 | void rdma_addr_unregister_client(struct rdma_addr_client *client); | ||
54 | |||
39 | struct rdma_dev_addr { | 55 | struct rdma_dev_addr { |
40 | unsigned char src_dev_addr[MAX_ADDR_LEN]; | 56 | unsigned char src_dev_addr[MAX_ADDR_LEN]; |
41 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; | 57 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; |
@@ -52,6 +68,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr); | |||
52 | /** | 68 | /** |
53 | * rdma_resolve_ip - Resolve source and destination IP addresses to | 69 | * rdma_resolve_ip - Resolve source and destination IP addresses to |
54 | * RDMA hardware addresses. | 70 | * RDMA hardware addresses. |
71 | * @client: Address client associated with request. | ||
55 | * @src_addr: An optional source address to use in the resolution. If a | 72 | * @src_addr: An optional source address to use in the resolution. If a |
56 | * source address is not provided, a usable address will be returned via | 73 | * source address is not provided, a usable address will be returned via |
57 | * the callback. | 74 | * the callback. |
@@ -64,7 +81,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr); | |||
64 | * or been canceled. A status of 0 indicates success. | 81 | * or been canceled. A status of 0 indicates success. |
65 | * @context: User-specified context associated with the call. | 82 | * @context: User-specified context associated with the call. |
66 | */ | 83 | */ |
67 | int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr, | 84 | int rdma_resolve_ip(struct rdma_addr_client *client, |
85 | struct sockaddr *src_addr, struct sockaddr *dst_addr, | ||
68 | struct rdma_dev_addr *addr, int timeout_ms, | 86 | struct rdma_dev_addr *addr, int timeout_ms, |
69 | void (*callback)(int status, struct sockaddr *src_addr, | 87 | void (*callback)(int status, struct sockaddr *src_addr, |
70 | struct rdma_dev_addr *addr, void *context), | 88 | struct rdma_dev_addr *addr, void *context), |
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index c9b4738be9d6..5c070176d9ab 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h | |||
@@ -60,6 +60,7 @@ enum ib_cm_state { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | enum ib_cm_lap_state { | 62 | enum ib_cm_lap_state { |
63 | IB_CM_LAP_UNINIT, | ||
63 | IB_CM_LAP_IDLE, | 64 | IB_CM_LAP_IDLE, |
64 | IB_CM_LAP_SENT, | 65 | IB_CM_LAP_SENT, |
65 | IB_CM_LAP_RCVD, | 66 | IB_CM_LAP_RCVD, |
@@ -443,13 +444,20 @@ int ib_send_cm_drep(struct ib_cm_id *cm_id, | |||
443 | u8 private_data_len); | 444 | u8 private_data_len); |
444 | 445 | ||
445 | /** | 446 | /** |
446 | * ib_cm_establish - Forces a connection state to established. | 447 | * ib_cm_notify - Notifies the CM of an event reported to the consumer. |
447 | * @cm_id: Connection identifier to transition to established. | 448 | * @cm_id: Connection identifier to transition to established. |
449 | * @event: Type of event. | ||
448 | * | 450 | * |
449 | * This routine should be invoked by users who receive messages on a | 451 | * This routine should be invoked by users to notify the CM of relevant |
450 | * connected QP before an RTU has been received. | 452 | * communication events. Events that should be reported to the CM and |
453 | * when to report them are: | ||
454 | * | ||
455 | * IB_EVENT_COMM_EST - Used when a message is received on a connected | ||
456 | * QP before an RTU has been received. | ||
457 | * IB_EVENT_PATH_MIG - Notifies the CM that the connection has failed over | ||
458 | * to the alternate path. | ||
451 | */ | 459 | */ |
452 | int ib_cm_establish(struct ib_cm_id *cm_id); | 460 | int ib_cm_notify(struct ib_cm_id *cm_id, enum ib_event_type event); |
453 | 461 | ||
454 | /** | 462 | /** |
455 | * ib_send_cm_rej - Sends a connection rejection message to the | 463 | * ib_send_cm_rej - Sends a connection rejection message to the |
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h index 066c20b7cdfb..37650afb982c 100644 --- a/include/rdma/ib_user_cm.h +++ b/include/rdma/ib_user_cm.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #include <rdma/ib_user_sa.h> | 39 | #include <rdma/ib_user_sa.h> |
40 | 40 | ||
41 | #define IB_USER_CM_ABI_VERSION 4 | 41 | #define IB_USER_CM_ABI_VERSION 5 |
42 | 42 | ||
43 | enum { | 43 | enum { |
44 | IB_USER_CM_CMD_CREATE_ID, | 44 | IB_USER_CM_CMD_CREATE_ID, |
@@ -46,7 +46,7 @@ enum { | |||
46 | IB_USER_CM_CMD_ATTR_ID, | 46 | IB_USER_CM_CMD_ATTR_ID, |
47 | 47 | ||
48 | IB_USER_CM_CMD_LISTEN, | 48 | IB_USER_CM_CMD_LISTEN, |
49 | IB_USER_CM_CMD_ESTABLISH, | 49 | IB_USER_CM_CMD_NOTIFY, |
50 | 50 | ||
51 | IB_USER_CM_CMD_SEND_REQ, | 51 | IB_USER_CM_CMD_SEND_REQ, |
52 | IB_USER_CM_CMD_SEND_REP, | 52 | IB_USER_CM_CMD_SEND_REP, |
@@ -117,8 +117,9 @@ struct ib_ucm_listen { | |||
117 | __u32 reserved; | 117 | __u32 reserved; |
118 | }; | 118 | }; |
119 | 119 | ||
120 | struct ib_ucm_establish { | 120 | struct ib_ucm_notify { |
121 | __u32 id; | 121 | __u32 id; |
122 | __u32 event; | ||
122 | }; | 123 | }; |
123 | 124 | ||
124 | struct ib_ucm_private_data { | 125 | struct ib_ucm_private_data { |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index db1b814b62cc..64a721fcbc1c 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -458,7 +458,7 @@ struct ib_uverbs_query_qp_resp { | |||
458 | __u8 cur_qp_state; | 458 | __u8 cur_qp_state; |
459 | __u8 path_mtu; | 459 | __u8 path_mtu; |
460 | __u8 path_mig_state; | 460 | __u8 path_mig_state; |
461 | __u8 en_sqd_async_notify; | 461 | __u8 sq_draining; |
462 | __u8 max_rd_atomic; | 462 | __u8 max_rd_atomic; |
463 | __u8 max_dest_rd_atomic; | 463 | __u8 max_dest_rd_atomic; |
464 | __u8 min_rnr_timer; | 464 | __u8 min_rnr_timer; |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 401192e56e50..61eebec00a7b 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -136,7 +136,6 @@ struct iscsi_conn { | |||
136 | 136 | ||
137 | /* control data */ | 137 | /* control data */ |
138 | int id; /* CID */ | 138 | int id; /* CID */ |
139 | struct list_head item; /* maintains list of conns */ | ||
140 | int c_stage; /* connection state */ | 139 | int c_stage; /* connection state */ |
141 | /* | 140 | /* |
142 | * Preallocated buffer for pdus that have data but do not | 141 | * Preallocated buffer for pdus that have data but do not |
@@ -235,10 +234,8 @@ struct iscsi_session { | |||
235 | * - mgmtpool, * | 234 | * - mgmtpool, * |
236 | * - r2tpool */ | 235 | * - r2tpool */ |
237 | int state; /* session state */ | 236 | int state; /* session state */ |
238 | struct list_head item; | ||
239 | int age; /* counts session re-opens */ | 237 | int age; /* counts session re-opens */ |
240 | 238 | ||
241 | struct list_head connections; /* list of connections */ | ||
242 | int cmds_max; /* size of cmds array */ | 239 | int cmds_max; /* size of cmds array */ |
243 | struct iscsi_cmd_task **cmds; /* Original Cmds arr */ | 240 | struct iscsi_cmd_task **cmds; /* Original Cmds arr */ |
244 | struct iscsi_queue cmdpool; /* PDU's pool */ | 241 | struct iscsi_queue cmdpool; /* PDU's pool */ |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 9582e8401669..1d77b63c5ea4 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <scsi/scsi_device.h> | 35 | #include <scsi/scsi_device.h> |
36 | #include <scsi/scsi_cmnd.h> | 36 | #include <scsi/scsi_cmnd.h> |
37 | #include <scsi/scsi_transport_sas.h> | 37 | #include <scsi/scsi_transport_sas.h> |
38 | #include <asm/scatterlist.h> | ||
38 | 39 | ||
39 | struct block_device; | 40 | struct block_device; |
40 | 41 | ||
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 84a6d5fe0920..5c0e9791441c 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -97,6 +97,7 @@ extern const unsigned char scsi_command_size[8]; | |||
97 | #define PERSISTENT_RESERVE_IN 0x5e | 97 | #define PERSISTENT_RESERVE_IN 0x5e |
98 | #define PERSISTENT_RESERVE_OUT 0x5f | 98 | #define PERSISTENT_RESERVE_OUT 0x5f |
99 | #define REPORT_LUNS 0xa0 | 99 | #define REPORT_LUNS 0xa0 |
100 | #define MAINTENANCE_IN 0xa3 | ||
100 | #define MOVE_MEDIUM 0xa5 | 101 | #define MOVE_MEDIUM 0xa5 |
101 | #define EXCHANGE_MEDIUM 0xa6 | 102 | #define EXCHANGE_MEDIUM 0xa6 |
102 | #define READ_12 0xa8 | 103 | #define READ_12 0xa8 |
@@ -114,6 +115,8 @@ extern const unsigned char scsi_command_size[8]; | |||
114 | #define SERVICE_ACTION_IN 0x9e | 115 | #define SERVICE_ACTION_IN 0x9e |
115 | /* values for service action in */ | 116 | /* values for service action in */ |
116 | #define SAI_READ_CAPACITY_16 0x10 | 117 | #define SAI_READ_CAPACITY_16 0x10 |
118 | /* values for maintenance in */ | ||
119 | #define MI_REPORT_TARGET_PGS 0x0a | ||
117 | 120 | ||
118 | /* Values for T10/04-262r7 */ | 121 | /* Values for T10/04-262r7 */ |
119 | #define ATA_16 0x85 /* 16-byte pass-thru */ | 122 | #define ATA_16 0x85 /* 16-byte pass-thru */ |
@@ -430,7 +433,7 @@ struct scsi_lun { | |||
430 | #define SCSI_IOCTL_GET_PCI 0x5387 | 433 | #define SCSI_IOCTL_GET_PCI 0x5387 |
431 | 434 | ||
432 | /* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ | 435 | /* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ |
433 | static inline u32 scsi_to_u32(u8 *ptr) | 436 | static inline __u32 scsi_to_u32(__u8 *ptr) |
434 | { | 437 | { |
435 | return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; | 438 | return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; |
436 | } | 439 | } |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 39e833260bd0..4b95c89c95c9 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -29,7 +29,6 @@ | |||
29 | struct scsi_transport_template; | 29 | struct scsi_transport_template; |
30 | struct iscsi_transport; | 30 | struct iscsi_transport; |
31 | struct Scsi_Host; | 31 | struct Scsi_Host; |
32 | struct mempool_zone; | ||
33 | struct iscsi_cls_conn; | 32 | struct iscsi_cls_conn; |
34 | struct iscsi_conn; | 33 | struct iscsi_conn; |
35 | struct iscsi_cmd_task; | 34 | struct iscsi_cmd_task; |
@@ -157,9 +156,6 @@ struct iscsi_cls_conn { | |||
157 | 156 | ||
158 | int active; /* must be accessed with the connlock */ | 157 | int active; /* must be accessed with the connlock */ |
159 | struct device dev; /* sysfs transport/container device */ | 158 | struct device dev; /* sysfs transport/container device */ |
160 | struct mempool_zone *z_error; | ||
161 | struct mempool_zone *z_pdu; | ||
162 | struct list_head freequeue; | ||
163 | }; | 159 | }; |
164 | 160 | ||
165 | #define iscsi_dev_to_conn(_dev) \ | 161 | #define iscsi_dev_to_conn(_dev) \ |
diff --git a/include/sound/core.h b/include/sound/core.h index fa1ca0127bab..a994bea09cd6 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -132,6 +132,7 @@ struct snd_card { | |||
132 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
135 | struct device *parent; | ||
135 | struct device *dev; | 136 | struct device *dev; |
136 | 137 | ||
137 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
@@ -187,13 +188,14 @@ struct snd_minor { | |||
187 | int device; /* device number */ | 188 | int device; /* device number */ |
188 | const struct file_operations *f_ops; /* file operations */ | 189 | const struct file_operations *f_ops; /* file operations */ |
189 | void *private_data; /* private data for f_ops->open */ | 190 | void *private_data; /* private data for f_ops->open */ |
190 | struct class_device *class_dev; /* class device for sysfs */ | 191 | struct device *dev; /* device for sysfs */ |
191 | }; | 192 | }; |
192 | 193 | ||
193 | /* sound.c */ | 194 | /* sound.c */ |
194 | 195 | ||
195 | extern int snd_major; | 196 | extern int snd_major; |
196 | extern int snd_ecards_limit; | 197 | extern int snd_ecards_limit; |
198 | extern struct class *sound_class; | ||
197 | 199 | ||
198 | void snd_request_card(int card); | 200 | void snd_request_card(int card); |
199 | 201 | ||
@@ -203,7 +205,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
203 | int snd_unregister_device(int type, struct snd_card *card, int dev); | 205 | int snd_unregister_device(int type, struct snd_card *card, int dev); |
204 | void *snd_lookup_minor_data(unsigned int minor, int type); | 206 | void *snd_lookup_minor_data(unsigned int minor, int type); |
205 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | 207 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, |
206 | const struct class_device_attribute *attr); | 208 | struct device_attribute *attr); |
207 | 209 | ||
208 | #ifdef CONFIG_SND_OSSEMUL | 210 | #ifdef CONFIG_SND_OSSEMUL |
209 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 211 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
@@ -255,7 +257,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file); | |||
255 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 257 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
256 | 258 | ||
257 | #ifndef snd_card_set_dev | 259 | #ifndef snd_card_set_dev |
258 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) | 260 | #define snd_card_set_dev(card,devptr) ((card)->parent = (devptr)) |
259 | #endif | 261 | #endif |
260 | 262 | ||
261 | /* device.c */ | 263 | /* device.c */ |
diff --git a/include/sound/version.h b/include/sound/version.h index 4ad86eb6440b..17137f3a3b6f 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by alsa/ksync script. */ | 1 | /* include/version.h. Generated by alsa/ksync script. */ |
2 | #define CONFIG_SND_VERSION "1.0.13" | 2 | #define CONFIG_SND_VERSION "1.0.13" |
3 | #define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)" | 3 | #define CONFIG_SND_DATE " (Tue Nov 28 14:07:24 2006 UTC)" |