diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 22:06:19 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 22:06:19 -0400 |
commit | 3c8c7b2f32c52b259daa7564fefd582146799b23 (patch) | |
tree | 59ff1ad0d6b7821d474d8fccafd884703684b6d7 /include | |
parent | 7cb3cd090c2725b80561958a362c2ba15a7a8c86 (diff) | |
parent | 9123e0d78990246304fe681167b8d8097f1e02d7 (diff) |
Merge branch 'upstream-fixes'
Diffstat (limited to 'include')
71 files changed, 993 insertions, 396 deletions
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h index 399c33b7be51..0a4a8b40dfcd 100644 --- a/include/asm-alpha/compiler.h +++ b/include/asm-alpha/compiler.h | |||
@@ -98,6 +98,9 @@ | |||
98 | #undef inline | 98 | #undef inline |
99 | #undef __inline__ | 99 | #undef __inline__ |
100 | #undef __inline | 100 | #undef __inline |
101 | 101 | #if __GNUC__ == 3 && __GNUC_MINOR__ >= 1 || __GNUC__ > 3 | |
102 | #undef __always_inline | ||
103 | #define __always_inline inline __attribute__((always_inline)) | ||
104 | #endif | ||
102 | 105 | ||
103 | #endif /* __ALPHA_COMPILER_H */ | 106 | #endif /* __ALPHA_COMPILER_H */ |
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index be9754a05c19..9d7f87375aa7 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/arch/memory.h> | 15 | #include <asm/arch/memory.h> |
16 | 16 | ||
17 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
18 | #define IOMEM(x) ((void __iomem *)(x)) | 18 | #define IOMEM(x) ((void __iomem *)(unsigned long)(x)) |
19 | #else | 19 | #else |
20 | #define IOMEM(x) x | 20 | #define IOMEM(x) x |
21 | #endif /* __ASSEMBLY__ */ | 21 | #endif /* __ASSEMBLY__ */ |
@@ -52,7 +52,7 @@ | |||
52 | /* | 52 | /* |
53 | * IO Addresses | 53 | * IO Addresses |
54 | */ | 54 | */ |
55 | #define VIDC_BASE (void __iomem *)0xe0400000 | 55 | #define VIDC_BASE IOMEM(0xe0400000) |
56 | #define EXPMASK_BASE 0xe0360000 | 56 | #define EXPMASK_BASE 0xe0360000 |
57 | #define IOMD_BASE IOMEM(0xe0200000) | 57 | #define IOMD_BASE IOMEM(0xe0200000) |
58 | #define IOC_BASE IOMEM(0xe0200000) | 58 | #define IOC_BASE IOMEM(0xe0200000) |
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h index 97741d6e506a..d529ffda8599 100644 --- a/include/asm-arm/arch-s3c2410/anubis-map.h +++ b/include/asm-arm/arch-s3c2410/anubis-map.h | |||
@@ -20,22 +20,22 @@ | |||
20 | 20 | ||
21 | /* start peripherals off after the S3C2410 */ | 21 | /* start peripherals off after the S3C2410 */ |
22 | 22 | ||
23 | #define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x02000000)) | 23 | #define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x01800000)) |
24 | 24 | ||
25 | #define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26)) | 25 | #define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26)) |
26 | 26 | ||
27 | /* we put the CPLD registers next, to get them out of the way */ | 27 | /* we put the CPLD registers next, to get them out of the way */ |
28 | 28 | ||
29 | #define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01300000 */ | 29 | #define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */ |
30 | #define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) | 30 | #define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) |
31 | 31 | ||
32 | #define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01400000 */ | 32 | #define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01900000 */ |
33 | #define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) | 33 | #define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) |
34 | 34 | ||
35 | #define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01500000 */ | 35 | #define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01A00000 */ |
36 | #define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) | 36 | #define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) |
37 | 37 | ||
38 | #define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01600000 */ | 38 | #define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */ |
39 | #define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) | 39 | #define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) |
40 | 40 | ||
41 | #define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) | 41 | #define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) |
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h index 9f895bf61494..47e904cf25c7 100644 --- a/include/asm-arm/arch-versatile/io.h +++ b/include/asm-arm/arch-versatile/io.h | |||
@@ -22,7 +22,11 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffffffff | 23 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 24 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 25 | static inline void __iomem *__io(unsigned long addr) |
26 | { | ||
27 | return (void __iomem *)addr; | ||
28 | } | ||
29 | #define __io(a) __io(a) | ||
26 | #define __mem_pci(a) (a) | 30 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) (a) | 31 | #define __mem_isa(a) (a) |
28 | 32 | ||
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index a1696ba238d3..7da97a937548 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -124,6 +124,8 @@ do { \ | |||
124 | if (((ex).e_flags & EF_ARM_EABI_MASK) || \ | 124 | if (((ex).e_flags & EF_ARM_EABI_MASK) || \ |
125 | ((ex).e_flags & EF_ARM_SOFT_FLOAT)) \ | 125 | ((ex).e_flags & EF_ARM_SOFT_FLOAT)) \ |
126 | set_thread_flag(TIF_USING_IWMMXT); \ | 126 | set_thread_flag(TIF_USING_IWMMXT); \ |
127 | else \ | ||
128 | clear_thread_flag(TIF_USING_IWMMXT); \ | ||
127 | } while (0) | 129 | } while (0) |
128 | 130 | ||
129 | #endif | 131 | #endif |
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index cfa71a0dffb6..5c4ae8f5dbb0 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -136,9 +136,9 @@ extern void __readwrite_bug(const char *fn); | |||
136 | /* | 136 | /* |
137 | * String version of IO memory access ops: | 137 | * String version of IO memory access ops: |
138 | */ | 138 | */ |
139 | extern void _memcpy_fromio(void *, void __iomem *, size_t); | 139 | extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t); |
140 | extern void _memcpy_toio(void __iomem *, const void *, size_t); | 140 | extern void _memcpy_toio(volatile void __iomem *, const void *, size_t); |
141 | extern void _memset_io(void __iomem *, int, size_t); | 141 | extern void _memset_io(volatile void __iomem *, int, size_t); |
142 | 142 | ||
143 | #define mmiowb() | 143 | #define mmiowb() |
144 | 144 | ||
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h index 760f6e65af05..ced69161917b 100644 --- a/include/asm-arm/signal.h +++ b/include/asm-arm/signal.h | |||
@@ -115,7 +115,6 @@ typedef unsigned long sigset_t; | |||
115 | 115 | ||
116 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
117 | #define SA_TIMER 0x40000000 | 117 | #define SA_TIMER 0x40000000 |
118 | #define SA_IRQNOMASK 0x08000000 | ||
119 | #endif | 118 | #endif |
120 | 119 | ||
121 | #include <asm-generic/signal.h> | 120 | #include <asm-generic/signal.h> |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f86c1e549466..ff28c8b31f58 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -158,6 +158,19 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
158 | #define lazy_mmu_prot_update(pte) do { } while (0) | 158 | #define lazy_mmu_prot_update(pte) do { } while (0) |
159 | #endif | 159 | #endif |
160 | 160 | ||
161 | #ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE | ||
162 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | ||
163 | #else | ||
164 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
165 | ({ \ | ||
166 | pte_t newpte = (pte); \ | ||
167 | if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ | ||
168 | pte_page(pte) == ZERO_PAGE(old_addr)) \ | ||
169 | newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ | ||
170 | newpte; \ | ||
171 | }) | ||
172 | #endif | ||
173 | |||
161 | /* | 174 | /* |
162 | * When walking page tables, get the address of the next boundary, | 175 | * When walking page tables, get the address of the next boundary, |
163 | * or the end address of the range if that comes earlier. Although no | 176 | * or the end address of the range if that comes earlier. Although no |
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 4ac84cc6f01a..622815bf3243 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
19 | #include <asm/sections.h> | 19 | #include <asm/sections.h> |
20 | 20 | ||
21 | struct hw_interrupt_type; | ||
22 | |||
21 | /* | 23 | /* |
22 | * Various low-level irq details needed by irq.c, process.c, | 24 | * Various low-level irq details needed by irq.c, process.c, |
23 | * time.c, io_apic.c and smp.c | 25 | * time.c, io_apic.c and smp.c |
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index 97a28b8b2ddd..c7d9c9ed38ba 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h | |||
@@ -80,7 +80,12 @@ struct ia64_sal_os_state { | |||
80 | u64 sal_ra; /* Return address in SAL, physical */ | 80 | u64 sal_ra; /* Return address in SAL, physical */ |
81 | u64 sal_gp; /* GP of the SAL - physical */ | 81 | u64 sal_gp; /* GP of the SAL - physical */ |
82 | pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */ | 82 | pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */ |
83 | /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK). | ||
84 | * Note: if the MCA/INIT recovery code wants to resume to a new context | ||
85 | * then it must change these values to reflect the new kernel stack. | ||
86 | */ | ||
83 | u64 prev_IA64_KR_CURRENT; /* previous value of IA64_KR(CURRENT) */ | 87 | u64 prev_IA64_KR_CURRENT; /* previous value of IA64_KR(CURRENT) */ |
88 | u64 prev_IA64_KR_CURRENT_STACK; | ||
84 | struct task_struct *prev_task; /* previous task, NULL if it is not useful */ | 89 | struct task_struct *prev_task; /* previous task, NULL if it is not useful */ |
85 | /* Some interrupt registers are not saved in minstate, pt_regs or | 90 | /* Some interrupt registers are not saved in minstate, pt_regs or |
86 | * switch_stack. Because MCA/INIT can occur when interrupts are | 91 | * switch_stack. Because MCA/INIT can occur when interrupts are |
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h index 3a7829bb5954..9adb51211c22 100644 --- a/include/asm-ia64/uaccess.h +++ b/include/asm-ia64/uaccess.h | |||
@@ -187,8 +187,8 @@ extern void __get_user_unknown (void); | |||
187 | ({ \ | 187 | ({ \ |
188 | const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ | 188 | const __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ |
189 | __typeof__ (size) __gu_size = (size); \ | 189 | __typeof__ (size) __gu_size = (size); \ |
190 | long __gu_err = -EFAULT, __gu_val = 0; \ | 190 | long __gu_err = -EFAULT; \ |
191 | \ | 191 | unsigned long __gu_val = 0; \ |
192 | if (!check || __access_ok(__gu_ptr, size, segment)) \ | 192 | if (!check || __access_ok(__gu_ptr, size, segment)) \ |
193 | switch (__gu_size) { \ | 193 | switch (__gu_size) { \ |
194 | case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break; \ | 194 | case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break; \ |
@@ -240,13 +240,13 @@ extern unsigned long __must_check __copy_user (void __user *to, const void __use | |||
240 | static inline unsigned long | 240 | static inline unsigned long |
241 | __copy_to_user (void __user *to, const void *from, unsigned long count) | 241 | __copy_to_user (void __user *to, const void *from, unsigned long count) |
242 | { | 242 | { |
243 | return __copy_user(to, (void __user *) from, count); | 243 | return __copy_user(to, (__force void __user *) from, count); |
244 | } | 244 | } |
245 | 245 | ||
246 | static inline unsigned long | 246 | static inline unsigned long |
247 | __copy_from_user (void *to, const void __user *from, unsigned long count) | 247 | __copy_from_user (void *to, const void __user *from, unsigned long count) |
248 | { | 248 | { |
249 | return __copy_user((void __user *) to, from, count); | 249 | return __copy_user((__force void __user *) to, from, count); |
250 | } | 250 | } |
251 | 251 | ||
252 | #define __copy_to_user_inatomic __copy_to_user | 252 | #define __copy_to_user_inatomic __copy_to_user |
@@ -258,7 +258,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) | |||
258 | long __cu_len = (n); \ | 258 | long __cu_len = (n); \ |
259 | \ | 259 | \ |
260 | if (__access_ok(__cu_to, __cu_len, get_fs())) \ | 260 | if (__access_ok(__cu_to, __cu_len, get_fs())) \ |
261 | __cu_len = __copy_user(__cu_to, (void __user *) __cu_from, __cu_len); \ | 261 | __cu_len = __copy_user(__cu_to, (__force void __user *) __cu_from, __cu_len); \ |
262 | __cu_len; \ | 262 | __cu_len; \ |
263 | }) | 263 | }) |
264 | 264 | ||
@@ -270,7 +270,7 @@ __copy_from_user (void *to, const void __user *from, unsigned long count) | |||
270 | \ | 270 | \ |
271 | __chk_user_ptr(__cu_from); \ | 271 | __chk_user_ptr(__cu_from); \ |
272 | if (__access_ok(__cu_from, __cu_len, get_fs())) \ | 272 | if (__access_ok(__cu_from, __cu_len, get_fs())) \ |
273 | __cu_len = __copy_user((void __user *) __cu_to, __cu_from, __cu_len); \ | 273 | __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len); \ |
274 | __cu_len; \ | 274 | __cu_len; \ |
275 | }) | 275 | }) |
276 | 276 | ||
diff --git a/include/asm-m32r/io.h b/include/asm-m32r/io.h index 8e9e481e6996..70ad1c949c2b 100644 --- a/include/asm-m32r/io.h +++ b/include/asm-m32r/io.h | |||
@@ -60,7 +60,7 @@ __ioremap(unsigned long offset, unsigned long size, unsigned long flags); | |||
60 | * address. | 60 | * address. |
61 | */ | 61 | */ |
62 | 62 | ||
63 | static inline void * ioremap(unsigned long offset, unsigned long size) | 63 | static inline void __iomem *ioremap(unsigned long offset, unsigned long size) |
64 | { | 64 | { |
65 | return __ioremap(offset, size, 0); | 65 | return __ioremap(offset, size, 0); |
66 | } | 66 | } |
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h index 93d863c455a1..0da7c47d2f01 100644 --- a/include/asm-m32r/uaccess.h +++ b/include/asm-m32r/uaccess.h | |||
@@ -208,7 +208,8 @@ extern void __get_user_4(void); | |||
208 | * On error, the variable @x is set to zero. | 208 | * On error, the variable @x is set to zero. |
209 | */ | 209 | */ |
210 | #define get_user(x,ptr) \ | 210 | #define get_user(x,ptr) \ |
211 | ({ int __ret_gu,__val_gu; \ | 211 | ({ int __ret_gu; \ |
212 | unsigned long __val_gu; \ | ||
212 | __chk_user_ptr(ptr); \ | 213 | __chk_user_ptr(ptr); \ |
213 | switch(sizeof (*(ptr))) { \ | 214 | switch(sizeof (*(ptr))) { \ |
214 | case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ | 215 | case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ |
@@ -403,7 +404,8 @@ struct __large_struct { unsigned long buf[100]; }; | |||
403 | 404 | ||
404 | #define __get_user_nocheck(x,ptr,size) \ | 405 | #define __get_user_nocheck(x,ptr,size) \ |
405 | ({ \ | 406 | ({ \ |
406 | long __gu_err, __gu_val; \ | 407 | long __gu_err; \ |
408 | unsigned long __gu_val; \ | ||
407 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | 409 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ |
408 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 410 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
409 | __gu_err; \ | 411 | __gu_err; \ |
@@ -594,8 +596,8 @@ static inline unsigned long __generic_copy_to_user_nocheck(void __user *to, | |||
594 | return n; | 596 | return n; |
595 | } | 597 | } |
596 | 598 | ||
597 | unsigned long __generic_copy_to_user(void *, const void *, unsigned long); | 599 | unsigned long __generic_copy_to_user(void __user *, const void *, unsigned long); |
598 | unsigned long __generic_copy_from_user(void *, const void *, unsigned long); | 600 | unsigned long __generic_copy_from_user(void *, const void __user *, unsigned long); |
599 | 601 | ||
600 | /** | 602 | /** |
601 | * __copy_to_user: - Copy a block of data into user space, with less checking. | 603 | * __copy_to_user: - Copy a block of data into user space, with less checking. |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index cbd1672c94cb..eaf5d9b3a0e1 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -68,6 +68,8 @@ extern unsigned long zero_page_mask; | |||
68 | #define ZERO_PAGE(vaddr) \ | 68 | #define ZERO_PAGE(vaddr) \ |
69 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) | 69 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) |
70 | 70 | ||
71 | #define __HAVE_ARCH_MULTIPLE_ZERO_PAGE | ||
72 | |||
71 | extern void paging_init(void); | 73 | extern void paging_init(void); |
72 | 74 | ||
73 | /* | 75 | /* |
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 7eb7cf6360bd..94d83998a759 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h | |||
@@ -56,7 +56,7 @@ extern unsigned long pci_dram_offset; | |||
56 | * is actually performed (i.e. the data has come back) before we start | 56 | * is actually performed (i.e. the data has come back) before we start |
57 | * executing any following instructions. | 57 | * executing any following instructions. |
58 | */ | 58 | */ |
59 | extern inline int in_8(volatile unsigned char __iomem *addr) | 59 | extern inline int in_8(const volatile unsigned char __iomem *addr) |
60 | { | 60 | { |
61 | int ret; | 61 | int ret; |
62 | 62 | ||
@@ -72,7 +72,7 @@ extern inline void out_8(volatile unsigned char __iomem *addr, int val) | |||
72 | __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); | 72 | __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); |
73 | } | 73 | } |
74 | 74 | ||
75 | extern inline int in_le16(volatile unsigned short __iomem *addr) | 75 | extern inline int in_le16(const volatile unsigned short __iomem *addr) |
76 | { | 76 | { |
77 | int ret; | 77 | int ret; |
78 | 78 | ||
@@ -83,7 +83,7 @@ extern inline int in_le16(volatile unsigned short __iomem *addr) | |||
83 | return ret; | 83 | return ret; |
84 | } | 84 | } |
85 | 85 | ||
86 | extern inline int in_be16(volatile unsigned short __iomem *addr) | 86 | extern inline int in_be16(const volatile unsigned short __iomem *addr) |
87 | { | 87 | { |
88 | int ret; | 88 | int ret; |
89 | 89 | ||
@@ -104,7 +104,7 @@ extern inline void out_be16(volatile unsigned short __iomem *addr, int val) | |||
104 | __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); | 104 | __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); |
105 | } | 105 | } |
106 | 106 | ||
107 | extern inline unsigned in_le32(volatile unsigned __iomem *addr) | 107 | extern inline unsigned in_le32(const volatile unsigned __iomem *addr) |
108 | { | 108 | { |
109 | unsigned ret; | 109 | unsigned ret; |
110 | 110 | ||
@@ -115,7 +115,7 @@ extern inline unsigned in_le32(volatile unsigned __iomem *addr) | |||
115 | return ret; | 115 | return ret; |
116 | } | 116 | } |
117 | 117 | ||
118 | extern inline unsigned in_be32(volatile unsigned __iomem *addr) | 118 | extern inline unsigned in_be32(const volatile unsigned __iomem *addr) |
119 | { | 119 | { |
120 | unsigned ret; | 120 | unsigned ret; |
121 | 121 | ||
@@ -139,7 +139,7 @@ extern inline void out_be32(volatile unsigned __iomem *addr, int val) | |||
139 | #define readb(addr) in_8((volatile u8 *)(addr)) | 139 | #define readb(addr) in_8((volatile u8 *)(addr)) |
140 | #define writeb(b,addr) out_8((volatile u8 *)(addr), (b)) | 140 | #define writeb(b,addr) out_8((volatile u8 *)(addr), (b)) |
141 | #else | 141 | #else |
142 | static inline __u8 readb(volatile void __iomem *addr) | 142 | static inline __u8 readb(const volatile void __iomem *addr) |
143 | { | 143 | { |
144 | return in_8(addr); | 144 | return in_8(addr); |
145 | } | 145 | } |
@@ -150,11 +150,11 @@ static inline void writeb(__u8 b, volatile void __iomem *addr) | |||
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #if defined(CONFIG_APUS) | 152 | #if defined(CONFIG_APUS) |
153 | static inline __u16 readw(volatile void __iomem *addr) | 153 | static inline __u16 readw(const volatile void __iomem *addr) |
154 | { | 154 | { |
155 | return *(__force volatile __u16 *)(addr); | 155 | return *(__force volatile __u16 *)(addr); |
156 | } | 156 | } |
157 | static inline __u32 readl(volatile void __iomem *addr) | 157 | static inline __u32 readl(const volatile void __iomem *addr) |
158 | { | 158 | { |
159 | return *(__force volatile __u32 *)(addr); | 159 | return *(__force volatile __u32 *)(addr); |
160 | } | 160 | } |
@@ -173,11 +173,11 @@ static inline void writel(__u32 b, volatile void __iomem *addr) | |||
173 | #define writew(b,addr) out_le16((volatile u16 *)(addr),(b)) | 173 | #define writew(b,addr) out_le16((volatile u16 *)(addr),(b)) |
174 | #define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) | 174 | #define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) |
175 | #else | 175 | #else |
176 | static inline __u16 readw(volatile void __iomem *addr) | 176 | static inline __u16 readw(const volatile void __iomem *addr) |
177 | { | 177 | { |
178 | return in_le16(addr); | 178 | return in_le16(addr); |
179 | } | 179 | } |
180 | static inline __u32 readl(volatile void __iomem *addr) | 180 | static inline __u32 readl(const volatile void __iomem *addr) |
181 | { | 181 | { |
182 | return in_le32(addr); | 182 | return in_le32(addr); |
183 | } | 183 | } |
diff --git a/include/asm-ppc/macio.h b/include/asm-ppc/macio.h index a481b772d154..b553dd4b139e 100644 --- a/include/asm-ppc/macio.h +++ b/include/asm-ppc/macio.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef __MACIO_ASIC_H__ | 1 | #ifndef __MACIO_ASIC_H__ |
2 | #define __MACIO_ASIC_H__ | 2 | #define __MACIO_ASIC_H__ |
3 | 3 | ||
4 | #include <linux/mod_devicetable.h> | ||
5 | #include <asm/of_device.h> | 4 | #include <asm/of_device.h> |
6 | 5 | ||
7 | extern struct bus_type macio_bus_type; | 6 | extern struct bus_type macio_bus_type; |
diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h index 75c2ffa26b26..ee2f9188cc64 100644 --- a/include/asm-ppc/mv64x60.h +++ b/include/asm-ppc/mv64x60.h | |||
@@ -233,7 +233,7 @@ struct mv64x60_chip_info { | |||
233 | struct mv64x60_handle { | 233 | struct mv64x60_handle { |
234 | u32 type; /* type of bridge */ | 234 | u32 type; /* type of bridge */ |
235 | u32 rev; /* revision of bridge */ | 235 | u32 rev; /* revision of bridge */ |
236 | void *v_base; /* virtual base addr of bridge regs */ | 236 | void __iomem *v_base;/* virtual base addr of bridge regs */ |
237 | phys_addr_t p_base; /* physical base addr of bridge regs */ | 237 | phys_addr_t p_base; /* physical base addr of bridge regs */ |
238 | 238 | ||
239 | u32 pci_mode_a; /* pci 0 mode: conventional pci, pci-x*/ | 239 | u32 pci_mode_a; /* pci 0 mode: conventional pci, pci-x*/ |
@@ -303,7 +303,7 @@ void mv64x60_alloc_hose(struct mv64x60_handle *bh, u32 cfg_addr, | |||
303 | u32 cfg_data, struct pci_controller **hose); | 303 | u32 cfg_data, struct pci_controller **hose); |
304 | int mv64x60_get_type(struct mv64x60_handle *bh); | 304 | int mv64x60_get_type(struct mv64x60_handle *bh); |
305 | int mv64x60_setup_for_chip(struct mv64x60_handle *bh); | 305 | int mv64x60_setup_for_chip(struct mv64x60_handle *bh); |
306 | void *mv64x60_get_bridge_vbase(void); | 306 | void __iomem *mv64x60_get_bridge_vbase(void); |
307 | u32 mv64x60_get_bridge_type(void); | 307 | u32 mv64x60_get_bridge_type(void); |
308 | u32 mv64x60_get_bridge_rev(void); | 308 | u32 mv64x60_get_bridge_rev(void); |
309 | void mv64x60_get_mem_windows(struct mv64x60_handle *bh, | 309 | void mv64x60_get_mem_windows(struct mv64x60_handle *bh, |
diff --git a/include/asm-ppc/of_device.h b/include/asm-ppc/of_device.h index 4b264cfd3998..575bce418f80 100644 --- a/include/asm-ppc/of_device.h +++ b/include/asm-ppc/of_device.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __OF_DEVICE_H__ | 2 | #define __OF_DEVICE_H__ |
3 | 3 | ||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/mod_devicetable.h> | ||
5 | #include <asm/prom.h> | 6 | #include <asm/prom.h> |
6 | 7 | ||
7 | /* | 8 | /* |
@@ -55,7 +56,9 @@ extern int of_register_driver(struct of_platform_driver *drv); | |||
55 | extern void of_unregister_driver(struct of_platform_driver *drv); | 56 | extern void of_unregister_driver(struct of_platform_driver *drv); |
56 | extern int of_device_register(struct of_device *ofdev); | 57 | extern int of_device_register(struct of_device *ofdev); |
57 | extern void of_device_unregister(struct of_device *ofdev); | 58 | extern void of_device_unregister(struct of_device *ofdev); |
58 | extern struct of_device *of_platform_device_create(struct device_node *np, const char *bus_id); | 59 | extern struct of_device *of_platform_device_create(struct device_node *np, |
60 | const char *bus_id, | ||
61 | struct device *parent); | ||
59 | extern void of_release_dev(struct device *dev); | 62 | extern void of_release_dev(struct device *dev); |
60 | 63 | ||
61 | #endif /* __OF_DEVICE_H__ */ | 64 | #endif /* __OF_DEVICE_H__ */ |
diff --git a/include/asm-ppc64/smu.h b/include/asm-ppc64/smu.h index 10b4397af9aa..dee8eefe47bc 100644 --- a/include/asm-ppc64/smu.h +++ b/include/asm-ppc64/smu.h | |||
@@ -1,22 +1,379 @@ | |||
1 | #ifndef _SMU_H | ||
2 | #define _SMU_H | ||
3 | |||
1 | /* | 4 | /* |
2 | * Definitions for talking to the SMU chip in newer G5 PowerMacs | 5 | * Definitions for talking to the SMU chip in newer G5 PowerMacs |
3 | */ | 6 | */ |
4 | 7 | ||
5 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <linux/list.h> | ||
10 | |||
11 | /* | ||
12 | * Known SMU commands | ||
13 | * | ||
14 | * Most of what is below comes from looking at the Open Firmware driver, | ||
15 | * though this is still incomplete and could use better documentation here | ||
16 | * or there... | ||
17 | */ | ||
18 | |||
19 | |||
20 | /* | ||
21 | * Partition info commands | ||
22 | * | ||
23 | * I do not know what those are for at this point | ||
24 | */ | ||
25 | #define SMU_CMD_PARTITION_COMMAND 0x3e | ||
26 | |||
27 | |||
28 | /* | ||
29 | * Fan control | ||
30 | * | ||
31 | * This is a "mux" for fan control commands, first byte is the | ||
32 | * "sub" command. | ||
33 | */ | ||
34 | #define SMU_CMD_FAN_COMMAND 0x4a | ||
35 | |||
36 | |||
37 | /* | ||
38 | * Battery access | ||
39 | * | ||
40 | * Same command number as the PMU, could it be same syntax ? | ||
41 | */ | ||
42 | #define SMU_CMD_BATTERY_COMMAND 0x6f | ||
43 | #define SMU_CMD_GET_BATTERY_INFO 0x00 | ||
44 | |||
45 | /* | ||
46 | * Real time clock control | ||
47 | * | ||
48 | * This is a "mux", first data byte contains the "sub" command. | ||
49 | * The "RTC" part of the SMU controls the date, time, powerup | ||
50 | * timer, but also a PRAM | ||
51 | * | ||
52 | * Dates are in BCD format on 7 bytes: | ||
53 | * [sec] [min] [hour] [weekday] [month day] [month] [year] | ||
54 | * with month being 1 based and year minus 100 | ||
55 | */ | ||
56 | #define SMU_CMD_RTC_COMMAND 0x8e | ||
57 | #define SMU_CMD_RTC_SET_PWRUP_TIMER 0x00 /* i: 7 bytes date */ | ||
58 | #define SMU_CMD_RTC_GET_PWRUP_TIMER 0x01 /* o: 7 bytes date */ | ||
59 | #define SMU_CMD_RTC_STOP_PWRUP_TIMER 0x02 | ||
60 | #define SMU_CMD_RTC_SET_PRAM_BYTE_ACC 0x20 /* i: 1 byte (address?) */ | ||
61 | #define SMU_CMD_RTC_SET_PRAM_AUTOINC 0x21 /* i: 1 byte (data?) */ | ||
62 | #define SMU_CMD_RTC_SET_PRAM_LO_BYTES 0x22 /* i: 10 bytes */ | ||
63 | #define SMU_CMD_RTC_SET_PRAM_HI_BYTES 0x23 /* i: 10 bytes */ | ||
64 | #define SMU_CMD_RTC_GET_PRAM_BYTE 0x28 /* i: 1 bytes (address?) */ | ||
65 | #define SMU_CMD_RTC_GET_PRAM_LO_BYTES 0x29 /* o: 10 bytes */ | ||
66 | #define SMU_CMD_RTC_GET_PRAM_HI_BYTES 0x2a /* o: 10 bytes */ | ||
67 | #define SMU_CMD_RTC_SET_DATETIME 0x80 /* i: 7 bytes date */ | ||
68 | #define SMU_CMD_RTC_GET_DATETIME 0x81 /* o: 7 bytes date */ | ||
69 | |||
70 | /* | ||
71 | * i2c commands | ||
72 | * | ||
73 | * To issue an i2c command, first is to send a parameter block to the | ||
74 | * the SMU. This is a command of type 0x9a with 9 bytes of header | ||
75 | * eventually followed by data for a write: | ||
76 | * | ||
77 | * 0: bus number (from device-tree usually, SMU has lots of busses !) | ||
78 | * 1: transfer type/format (see below) | ||
79 | * 2: device address. For combined and combined4 type transfers, this | ||
80 | * is the "write" version of the address (bit 0x01 cleared) | ||
81 | * 3: subaddress length (0..3) | ||
82 | * 4: subaddress byte 0 (or only byte for subaddress length 1) | ||
83 | * 5: subaddress byte 1 | ||
84 | * 6: subaddress byte 2 | ||
85 | * 7: combined address (device address for combined mode data phase) | ||
86 | * 8: data length | ||
87 | * | ||
88 | * The transfer types are the same good old Apple ones it seems, | ||
89 | * that is: | ||
90 | * - 0x00: Simple transfer | ||
91 | * - 0x01: Subaddress transfer (addr write + data tx, no restart) | ||
92 | * - 0x02: Combined transfer (addr write + restart + data tx) | ||
93 | * | ||
94 | * This is then followed by actual data for a write. | ||
95 | * | ||
96 | * At this point, the OF driver seems to have a limitation on transfer | ||
97 | * sizes of 0xd bytes on reads and 0x5 bytes on writes. I do not know | ||
98 | * wether this is just an OF limit due to some temporary buffer size | ||
99 | * or if this is an SMU imposed limit. This driver has the same limitation | ||
100 | * for now as I use a 0x10 bytes temporary buffer as well | ||
101 | * | ||
102 | * Once that is completed, a response is expected from the SMU. This is | ||
103 | * obtained via a command of type 0x9a with a length of 1 byte containing | ||
104 | * 0 as the data byte. OF also fills the rest of the data buffer with 0xff's | ||
105 | * though I can't tell yet if this is actually necessary. Once this command | ||
106 | * is complete, at this point, all I can tell is what OF does. OF tests | ||
107 | * byte 0 of the reply: | ||
108 | * - on read, 0xfe or 0xfc : bus is busy, wait (see below) or nak ? | ||
109 | * - on read, 0x00 or 0x01 : reply is in buffer (after the byte 0) | ||
110 | * - on write, < 0 -> failure (immediate exit) | ||
111 | * - else, OF just exists (without error, weird) | ||
112 | * | ||
113 | * So on read, there is this wait-for-busy thing when getting a 0xfc or | ||
114 | * 0xfe result. OF does a loop of up to 64 retries, waiting 20ms and | ||
115 | * doing the above again until either the retries expire or the result | ||
116 | * is no longer 0xfe or 0xfc | ||
117 | * | ||
118 | * The Darwin I2C driver is less subtle though. On any non-success status | ||
119 | * from the response command, it waits 5ms and tries again up to 20 times, | ||
120 | * it doesn't differenciate between fatal errors or "busy" status. | ||
121 | * | ||
122 | * This driver provides an asynchronous paramblock based i2c command | ||
123 | * interface to be used either directly by low level code or by a higher | ||
124 | * level driver interfacing to the linux i2c layer. The current | ||
125 | * implementation of this relies on working timers & timer interrupts | ||
126 | * though, so be careful of calling context for now. This may be "fixed" | ||
127 | * in the future by adding a polling facility. | ||
128 | */ | ||
129 | #define SMU_CMD_I2C_COMMAND 0x9a | ||
130 | /* transfer types */ | ||
131 | #define SMU_I2C_TRANSFER_SIMPLE 0x00 | ||
132 | #define SMU_I2C_TRANSFER_STDSUB 0x01 | ||
133 | #define SMU_I2C_TRANSFER_COMBINED 0x02 | ||
134 | |||
135 | /* | ||
136 | * Power supply control | ||
137 | * | ||
138 | * The "sub" command is an ASCII string in the data, the | ||
139 | * data lenght is that of the string. | ||
140 | * | ||
141 | * The VSLEW command can be used to get or set the voltage slewing. | ||
142 | * - lenght 5 (only "VSLEW") : it returns "DONE" and 3 bytes of | ||
143 | * reply at data offset 6, 7 and 8. | ||
144 | * - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is | ||
145 | * used to set the voltage slewing point. The SMU replies with "DONE" | ||
146 | * I yet have to figure out their exact meaning of those 3 bytes in | ||
147 | * both cases. | ||
148 | * | ||
149 | */ | ||
150 | #define SMU_CMD_POWER_COMMAND 0xaa | ||
151 | #define SMU_CMD_POWER_RESTART "RESTART" | ||
152 | #define SMU_CMD_POWER_SHUTDOWN "SHUTDOWN" | ||
153 | #define SMU_CMD_POWER_VOLTAGE_SLEW "VSLEW" | ||
154 | |||
155 | /* Misc commands | ||
156 | * | ||
157 | * This command seem to be a grab bag of various things | ||
158 | */ | ||
159 | #define SMU_CMD_MISC_df_COMMAND 0xdf | ||
160 | #define SMU_CMD_MISC_df_SET_DISPLAY_LIT 0x02 /* i: 1 byte */ | ||
161 | #define SMU_CMD_MISC_df_NMI_OPTION 0x04 | ||
162 | |||
163 | /* | ||
164 | * Version info commands | ||
165 | * | ||
166 | * I haven't quite tried to figure out how these work | ||
167 | */ | ||
168 | #define SMU_CMD_VERSION_COMMAND 0xea | ||
169 | |||
170 | |||
171 | /* | ||
172 | * Misc commands | ||
173 | * | ||
174 | * This command seem to be a grab bag of various things | ||
175 | */ | ||
176 | #define SMU_CMD_MISC_ee_COMMAND 0xee | ||
177 | #define SMU_CMD_MISC_ee_GET_DATABLOCK_REC 0x02 | ||
178 | #define SMU_CMD_MISC_ee_LEDS_CTRL 0x04 /* i: 00 (00,01) [00] */ | ||
179 | #define SMU_CMD_MISC_ee_GET_DATA 0x05 /* i: 00 , o: ?? */ | ||
180 | |||
181 | |||
182 | |||
183 | /* | ||
184 | * - Kernel side interface - | ||
185 | */ | ||
186 | |||
187 | #ifdef __KERNEL__ | ||
188 | |||
189 | /* | ||
190 | * Asynchronous SMU commands | ||
191 | * | ||
192 | * Fill up this structure and submit it via smu_queue_command(), | ||
193 | * and get notified by the optional done() callback, or because | ||
194 | * status becomes != 1 | ||
195 | */ | ||
196 | |||
197 | struct smu_cmd; | ||
198 | |||
199 | struct smu_cmd | ||
200 | { | ||
201 | /* public */ | ||
202 | u8 cmd; /* command */ | ||
203 | int data_len; /* data len */ | ||
204 | int reply_len; /* reply len */ | ||
205 | void *data_buf; /* data buffer */ | ||
206 | void *reply_buf; /* reply buffer */ | ||
207 | int status; /* command status */ | ||
208 | void (*done)(struct smu_cmd *cmd, void *misc); | ||
209 | void *misc; | ||
210 | |||
211 | /* private */ | ||
212 | struct list_head link; | ||
213 | }; | ||
214 | |||
215 | /* | ||
216 | * Queues an SMU command, all fields have to be initialized | ||
217 | */ | ||
218 | extern int smu_queue_cmd(struct smu_cmd *cmd); | ||
219 | |||
220 | /* | ||
221 | * Simple command wrapper. This structure embeds a small buffer | ||
222 | * to ease sending simple SMU commands from the stack | ||
223 | */ | ||
224 | struct smu_simple_cmd | ||
225 | { | ||
226 | struct smu_cmd cmd; | ||
227 | u8 buffer[16]; | ||
228 | }; | ||
229 | |||
230 | /* | ||
231 | * Queues a simple command. All fields will be initialized by that | ||
232 | * function | ||
233 | */ | ||
234 | extern int smu_queue_simple(struct smu_simple_cmd *scmd, u8 command, | ||
235 | unsigned int data_len, | ||
236 | void (*done)(struct smu_cmd *cmd, void *misc), | ||
237 | void *misc, | ||
238 | ...); | ||
239 | |||
240 | /* | ||
241 | * Completion helper. Pass it to smu_queue_simple or as 'done' | ||
242 | * member to smu_queue_cmd, it will call complete() on the struct | ||
243 | * completion passed in the "misc" argument | ||
244 | */ | ||
245 | extern void smu_done_complete(struct smu_cmd *cmd, void *misc); | ||
6 | 246 | ||
7 | /* | 247 | /* |
8 | * Basic routines for use by architecture. To be extended as | 248 | * Synchronous helpers. Will spin-wait for completion of a command |
9 | * we understand more of the chip | 249 | */ |
250 | extern void smu_spinwait_cmd(struct smu_cmd *cmd); | ||
251 | |||
252 | static inline void smu_spinwait_simple(struct smu_simple_cmd *scmd) | ||
253 | { | ||
254 | smu_spinwait_cmd(&scmd->cmd); | ||
255 | } | ||
256 | |||
257 | /* | ||
258 | * Poll routine to call if blocked with irqs off | ||
259 | */ | ||
260 | extern void smu_poll(void); | ||
261 | |||
262 | |||
263 | /* | ||
264 | * Init routine, presence check.... | ||
10 | */ | 265 | */ |
11 | extern int smu_init(void); | 266 | extern int smu_init(void); |
12 | extern int smu_present(void); | 267 | extern int smu_present(void); |
268 | struct of_device; | ||
269 | extern struct of_device *smu_get_ofdev(void); | ||
270 | |||
271 | |||
272 | /* | ||
273 | * Common command wrappers | ||
274 | */ | ||
13 | extern void smu_shutdown(void); | 275 | extern void smu_shutdown(void); |
14 | extern void smu_restart(void); | 276 | extern void smu_restart(void); |
15 | extern int smu_get_rtc_time(struct rtc_time *time); | 277 | struct rtc_time; |
16 | extern int smu_set_rtc_time(struct rtc_time *time); | 278 | extern int smu_get_rtc_time(struct rtc_time *time, int spinwait); |
279 | extern int smu_set_rtc_time(struct rtc_time *time, int spinwait); | ||
17 | 280 | ||
18 | /* | 281 | /* |
19 | * SMU command buffer absolute address, exported by pmac_setup, | 282 | * SMU command buffer absolute address, exported by pmac_setup, |
20 | * this is allocated very early during boot. | 283 | * this is allocated very early during boot. |
21 | */ | 284 | */ |
22 | extern unsigned long smu_cmdbuf_abs; | 285 | extern unsigned long smu_cmdbuf_abs; |
286 | |||
287 | |||
288 | /* | ||
289 | * Kenrel asynchronous i2c interface | ||
290 | */ | ||
291 | |||
292 | /* SMU i2c header, exactly matches i2c header on wire */ | ||
293 | struct smu_i2c_param | ||
294 | { | ||
295 | u8 bus; /* SMU bus ID (from device tree) */ | ||
296 | u8 type; /* i2c transfer type */ | ||
297 | u8 devaddr; /* device address (includes direction) */ | ||
298 | u8 sublen; /* subaddress length */ | ||
299 | u8 subaddr[3]; /* subaddress */ | ||
300 | u8 caddr; /* combined address, filled by SMU driver */ | ||
301 | u8 datalen; /* length of transfer */ | ||
302 | u8 data[7]; /* data */ | ||
303 | }; | ||
304 | |||
305 | #define SMU_I2C_READ_MAX 0x0d | ||
306 | #define SMU_I2C_WRITE_MAX 0x05 | ||
307 | |||
308 | struct smu_i2c_cmd | ||
309 | { | ||
310 | /* public */ | ||
311 | struct smu_i2c_param info; | ||
312 | void (*done)(struct smu_i2c_cmd *cmd, void *misc); | ||
313 | void *misc; | ||
314 | int status; /* 1 = pending, 0 = ok, <0 = fail */ | ||
315 | |||
316 | /* private */ | ||
317 | struct smu_cmd scmd; | ||
318 | int read; | ||
319 | int stage; | ||
320 | int retries; | ||
321 | u8 pdata[0x10]; | ||
322 | struct list_head link; | ||
323 | }; | ||
324 | |||
325 | /* | ||
326 | * Call this to queue an i2c command to the SMU. You must fill info, | ||
327 | * including info.data for a write, done and misc. | ||
328 | * For now, no polling interface is provided so you have to use completion | ||
329 | * callback. | ||
330 | */ | ||
331 | extern int smu_queue_i2c(struct smu_i2c_cmd *cmd); | ||
332 | |||
333 | |||
334 | #endif /* __KERNEL__ */ | ||
335 | |||
336 | /* | ||
337 | * - Userland interface - | ||
338 | */ | ||
339 | |||
340 | /* | ||
341 | * A given instance of the device can be configured for 2 different | ||
342 | * things at the moment: | ||
343 | * | ||
344 | * - sending SMU commands (default at open() time) | ||
345 | * - receiving SMU events (not yet implemented) | ||
346 | * | ||
347 | * Commands are written with write() of a command block. They can be | ||
348 | * "driver" commands (for example to switch to event reception mode) | ||
349 | * or real SMU commands. They are made of a header followed by command | ||
350 | * data if any. | ||
351 | * | ||
352 | * For SMU commands (not for driver commands), you can then read() back | ||
353 | * a reply. The reader will be blocked or not depending on how the device | ||
354 | * file is opened. poll() isn't implemented yet. The reply will consist | ||
355 | * of a header as well, followed by the reply data if any. You should | ||
356 | * always provide a buffer large enough for the maximum reply data, I | ||
357 | * recommand one page. | ||
358 | * | ||
359 | * It is illegal to send SMU commands through a file descriptor configured | ||
360 | * for events reception | ||
361 | * | ||
362 | */ | ||
363 | struct smu_user_cmd_hdr | ||
364 | { | ||
365 | __u32 cmdtype; | ||
366 | #define SMU_CMDTYPE_SMU 0 /* SMU command */ | ||
367 | #define SMU_CMDTYPE_WANTS_EVENTS 1 /* switch fd to events mode */ | ||
368 | |||
369 | __u8 cmd; /* SMU command byte */ | ||
370 | __u32 data_len; /* Lenght of data following */ | ||
371 | }; | ||
372 | |||
373 | struct smu_user_reply_hdr | ||
374 | { | ||
375 | __u32 status; /* Command status */ | ||
376 | __u32 reply_len; /* Lenght of data follwing */ | ||
377 | }; | ||
378 | |||
379 | #endif /* _SMU_H */ | ||
diff --git a/include/asm-ppc64/tlbflush.h b/include/asm-ppc64/tlbflush.h index 45411a67e082..74271d7c1d16 100644 --- a/include/asm-ppc64/tlbflush.h +++ b/include/asm-ppc64/tlbflush.h | |||
@@ -25,6 +25,7 @@ struct ppc64_tlb_batch { | |||
25 | pte_t pte[PPC64_TLB_BATCH_NR]; | 25 | pte_t pte[PPC64_TLB_BATCH_NR]; |
26 | unsigned long addr[PPC64_TLB_BATCH_NR]; | 26 | unsigned long addr[PPC64_TLB_BATCH_NR]; |
27 | unsigned long vaddr[PPC64_TLB_BATCH_NR]; | 27 | unsigned long vaddr[PPC64_TLB_BATCH_NR]; |
28 | unsigned int large; | ||
28 | }; | 29 | }; |
29 | DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); | 30 | DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); |
30 | 31 | ||
diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h index c181a60d868c..132c1276547b 100644 --- a/include/asm-ppc64/uaccess.h +++ b/include/asm-ppc64/uaccess.h | |||
@@ -164,7 +164,8 @@ do { \ | |||
164 | 164 | ||
165 | #define __get_user_nocheck(x,ptr,size) \ | 165 | #define __get_user_nocheck(x,ptr,size) \ |
166 | ({ \ | 166 | ({ \ |
167 | long __gu_err, __gu_val; \ | 167 | long __gu_err; \ |
168 | unsigned long __gu_val; \ | ||
168 | might_sleep(); \ | 169 | might_sleep(); \ |
169 | __get_user_size(__gu_val,(ptr),(size),__gu_err,-EFAULT);\ | 170 | __get_user_size(__gu_val,(ptr),(size),__gu_err,-EFAULT);\ |
170 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 171 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
@@ -173,7 +174,8 @@ do { \ | |||
173 | 174 | ||
174 | #define __get_user_check(x,ptr,size) \ | 175 | #define __get_user_check(x,ptr,size) \ |
175 | ({ \ | 176 | ({ \ |
176 | long __gu_err = -EFAULT, __gu_val = 0; \ | 177 | long __gu_err = -EFAULT; \ |
178 | unsigned long __gu_val = 0; \ | ||
177 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | 179 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ |
178 | might_sleep(); \ | 180 | might_sleep(); \ |
179 | if (access_ok(VERIFY_READ,__gu_addr,size)) \ | 181 | if (access_ok(VERIFY_READ,__gu_addr,size)) \ |
diff --git a/include/asm-s390/sigcontext.h b/include/asm-s390/sigcontext.h index d57bc0cebdce..803545351dd8 100644 --- a/include/asm-s390/sigcontext.h +++ b/include/asm-s390/sigcontext.h | |||
@@ -61,7 +61,7 @@ typedef struct | |||
61 | struct sigcontext | 61 | struct sigcontext |
62 | { | 62 | { |
63 | unsigned long oldmask[_SIGCONTEXT_NSIG_WORDS]; | 63 | unsigned long oldmask[_SIGCONTEXT_NSIG_WORDS]; |
64 | _sigregs *sregs; | 64 | _sigregs __user *sregs; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | 67 | ||
diff --git a/include/asm-s390/signal.h b/include/asm-s390/signal.h index 3d6e11c6c1fd..7084626de215 100644 --- a/include/asm-s390/signal.h +++ b/include/asm-s390/signal.h | |||
@@ -165,7 +165,7 @@ struct sigaction { | |||
165 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
166 | 166 | ||
167 | typedef struct sigaltstack { | 167 | typedef struct sigaltstack { |
168 | void *ss_sp; | 168 | void __user *ss_sp; |
169 | int ss_flags; | 169 | int ss_flags; |
170 | size_t ss_size; | 170 | size_t ss_size; |
171 | } stack_t; | 171 | } stack_t; |
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 8f4f6a959651..8395ad2f1c09 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
@@ -82,6 +82,8 @@ extern unsigned long page_kernel; | |||
82 | /* Top-level page directory */ | 82 | /* Top-level page directory */ |
83 | extern pgd_t swapper_pg_dir[1024]; | 83 | extern pgd_t swapper_pg_dir[1024]; |
84 | 84 | ||
85 | extern void paging_init(void); | ||
86 | |||
85 | /* Page table for 0-4MB for everybody, on the Sparc this | 87 | /* Page table for 0-4MB for everybody, on the Sparc this |
86 | * holds the same as on the i386. | 88 | * holds the same as on the i386. |
87 | */ | 89 | */ |
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h index ededd2659eab..b3f61659ba81 100644 --- a/include/asm-sparc64/cacheflush.h +++ b/include/asm-sparc64/cacheflush.h | |||
@@ -66,6 +66,11 @@ extern void flush_ptrace_access(struct vm_area_struct *, struct page *, | |||
66 | #define flush_cache_vmap(start, end) do { } while (0) | 66 | #define flush_cache_vmap(start, end) do { } while (0) |
67 | #define flush_cache_vunmap(start, end) do { } while (0) | 67 | #define flush_cache_vunmap(start, end) do { } while (0) |
68 | 68 | ||
69 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
70 | /* internal debugging function */ | ||
71 | void kernel_map_pages(struct page *page, int numpages, int enable); | ||
72 | #endif | ||
73 | |||
69 | #endif /* !__ASSEMBLY__ */ | 74 | #endif /* !__ASSEMBLY__ */ |
70 | 75 | ||
71 | #endif /* _SPARC64_CACHEFLUSH_H */ | 76 | #endif /* _SPARC64_CACHEFLUSH_H */ |
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index 9a3a81f1cc58..74de79dca915 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h | |||
@@ -22,6 +22,16 @@ typedef struct { | |||
22 | unsigned int __pad1; | 22 | unsigned int __pad1; |
23 | unsigned long *pte_cache[2]; | 23 | unsigned long *pte_cache[2]; |
24 | unsigned long *pgd_cache; | 24 | unsigned long *pgd_cache; |
25 | |||
26 | /* Dcache line 3, rarely used */ | ||
27 | unsigned int dcache_size; | ||
28 | unsigned int dcache_line_size; | ||
29 | unsigned int icache_size; | ||
30 | unsigned int icache_line_size; | ||
31 | unsigned int ecache_size; | ||
32 | unsigned int ecache_line_size; | ||
33 | unsigned int __pad2; | ||
34 | unsigned int __pad3; | ||
25 | } cpuinfo_sparc; | 35 | } cpuinfo_sparc; |
26 | 36 | ||
27 | DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); | 37 | DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data); |
diff --git a/include/asm-sparc64/head.h b/include/asm-sparc64/head.h index b63a33cf4971..0abd3a674e8f 100644 --- a/include/asm-sparc64/head.h +++ b/include/asm-sparc64/head.h | |||
@@ -12,9 +12,12 @@ | |||
12 | #define __JALAPENO_ID 0x003e0016 | 12 | #define __JALAPENO_ID 0x003e0016 |
13 | 13 | ||
14 | #define CHEETAH_MANUF 0x003e | 14 | #define CHEETAH_MANUF 0x003e |
15 | #define CHEETAH_IMPL 0x0014 | 15 | #define CHEETAH_IMPL 0x0014 /* Ultra-III */ |
16 | #define CHEETAH_PLUS_IMPL 0x0015 | 16 | #define CHEETAH_PLUS_IMPL 0x0015 /* Ultra-III+ */ |
17 | #define JALAPENO_IMPL 0x0016 | 17 | #define JALAPENO_IMPL 0x0016 /* Ultra-IIIi */ |
18 | #define JAGUAR_IMPL 0x0018 /* Ultra-IV */ | ||
19 | #define PANTHER_IMPL 0x0019 /* Ultra-IV+ */ | ||
20 | #define SERRANO_IMPL 0x0022 /* Ultra-IIIi+ */ | ||
18 | 21 | ||
19 | #define BRANCH_IF_CHEETAH_BASE(tmp1,tmp2,label) \ | 22 | #define BRANCH_IF_CHEETAH_BASE(tmp1,tmp2,label) \ |
20 | rdpr %ver, %tmp1; \ | 23 | rdpr %ver, %tmp1; \ |
diff --git a/include/asm-sparc64/openprom.h b/include/asm-sparc64/openprom.h index 0a336901d585..b4959d2b0d99 100644 --- a/include/asm-sparc64/openprom.h +++ b/include/asm-sparc64/openprom.h | |||
@@ -186,8 +186,8 @@ struct linux_prom_registers { | |||
186 | }; | 186 | }; |
187 | 187 | ||
188 | struct linux_prom64_registers { | 188 | struct linux_prom64_registers { |
189 | long phys_addr; | 189 | unsigned long phys_addr; |
190 | long reg_size; | 190 | unsigned long reg_size; |
191 | }; | 191 | }; |
192 | 192 | ||
193 | struct linux_prom_irqs { | 193 | struct linux_prom_irqs { |
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index a432d9e7daaa..d02f1e8ae1a6 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h | |||
@@ -38,6 +38,20 @@ extern int prom_stdin, prom_stdout; | |||
38 | */ | 38 | */ |
39 | extern int prom_chosen_node; | 39 | extern int prom_chosen_node; |
40 | 40 | ||
41 | /* Helper values and strings in arch/sparc64/kernel/head.S */ | ||
42 | extern const char prom_finddev_name[]; | ||
43 | extern const char prom_chosen_path[]; | ||
44 | extern const char prom_getprop_name[]; | ||
45 | extern const char prom_mmu_name[]; | ||
46 | extern const char prom_callmethod_name[]; | ||
47 | extern const char prom_translate_name[]; | ||
48 | extern const char prom_map_name[]; | ||
49 | extern const char prom_unmap_name[]; | ||
50 | extern int prom_mmu_ihandle_cache; | ||
51 | extern unsigned int prom_boot_mapped_pc; | ||
52 | extern unsigned int prom_boot_mapping_mode; | ||
53 | extern unsigned long prom_boot_mapping_phys_high, prom_boot_mapping_phys_low; | ||
54 | |||
41 | struct linux_mlist_p1275 { | 55 | struct linux_mlist_p1275 { |
42 | struct linux_mlist_p1275 *theres_more; | 56 | struct linux_mlist_p1275 *theres_more; |
43 | unsigned long start_adr; | 57 | unsigned long start_adr; |
@@ -68,7 +82,7 @@ extern char *prom_getbootargs(void); | |||
68 | * of the string is different on V0 vs. V2->higher proms. The caller must | 82 | * of the string is different on V0 vs. V2->higher proms. The caller must |
69 | * know what he/she is doing! Returns the device descriptor, an int. | 83 | * know what he/she is doing! Returns the device descriptor, an int. |
70 | */ | 84 | */ |
71 | extern int prom_devopen(char *device_string); | 85 | extern int prom_devopen(const char *device_string); |
72 | 86 | ||
73 | /* Close a previously opened device described by the passed integer | 87 | /* Close a previously opened device described by the passed integer |
74 | * descriptor. | 88 | * descriptor. |
@@ -81,27 +95,13 @@ extern int prom_devclose(int device_handle); | |||
81 | extern void prom_seek(int device_handle, unsigned int seek_hival, | 95 | extern void prom_seek(int device_handle, unsigned int seek_hival, |
82 | unsigned int seek_lowval); | 96 | unsigned int seek_lowval); |
83 | 97 | ||
84 | /* Machine memory configuration routine. */ | ||
85 | |||
86 | /* This function returns a V0 format memory descriptor table, it has three | ||
87 | * entries. One for the total amount of physical ram on the machine, one | ||
88 | * for the amount of physical ram available, and one describing the virtual | ||
89 | * areas which are allocated by the prom. So, in a sense the physical | ||
90 | * available is a calculation of the total physical minus the physical mapped | ||
91 | * by the prom with virtual mappings. | ||
92 | * | ||
93 | * These lists are returned pre-sorted, this should make your life easier | ||
94 | * since the prom itself is way too lazy to do such nice things. | ||
95 | */ | ||
96 | extern struct linux_mem_p1275 *prom_meminfo(void); | ||
97 | |||
98 | /* Miscellaneous routines, don't really fit in any category per se. */ | 98 | /* Miscellaneous routines, don't really fit in any category per se. */ |
99 | 99 | ||
100 | /* Reboot the machine with the command line passed. */ | 100 | /* Reboot the machine with the command line passed. */ |
101 | extern void prom_reboot(char *boot_command); | 101 | extern void prom_reboot(const char *boot_command); |
102 | 102 | ||
103 | /* Evaluate the forth string passed. */ | 103 | /* Evaluate the forth string passed. */ |
104 | extern void prom_feval(char *forth_string); | 104 | extern void prom_feval(const char *forth_string); |
105 | 105 | ||
106 | /* Enter the prom, with possibility of continuation with the 'go' | 106 | /* Enter the prom, with possibility of continuation with the 'go' |
107 | * command in newer proms. | 107 | * command in newer proms. |
@@ -154,7 +154,7 @@ extern char prom_getchar(void); | |||
154 | extern void prom_putchar(char character); | 154 | extern void prom_putchar(char character); |
155 | 155 | ||
156 | /* Prom's internal routines, don't use in kernel/boot code. */ | 156 | /* Prom's internal routines, don't use in kernel/boot code. */ |
157 | extern void prom_printf(char *fmt, ...); | 157 | extern void prom_printf(const char *fmt, ...); |
158 | extern void prom_write(const char *buf, unsigned int len); | 158 | extern void prom_write(const char *buf, unsigned int len); |
159 | 159 | ||
160 | /* Query for input device type */ | 160 | /* Query for input device type */ |
@@ -215,7 +215,7 @@ extern int prom_getunumber(int syndrome_code, | |||
215 | char *buf, int buflen); | 215 | char *buf, int buflen); |
216 | 216 | ||
217 | /* Retain physical memory to the caller across soft resets. */ | 217 | /* Retain physical memory to the caller across soft resets. */ |
218 | extern unsigned long prom_retain(char *name, | 218 | extern unsigned long prom_retain(const char *name, |
219 | unsigned long pa_low, unsigned long pa_high, | 219 | unsigned long pa_low, unsigned long pa_high, |
220 | long size, long align); | 220 | long size, long align); |
221 | 221 | ||
@@ -269,28 +269,28 @@ extern int prom_getsibling(int node); | |||
269 | /* Get the length, at the passed node, of the given property type. | 269 | /* Get the length, at the passed node, of the given property type. |
270 | * Returns -1 on error (ie. no such property at this node). | 270 | * Returns -1 on error (ie. no such property at this node). |
271 | */ | 271 | */ |
272 | extern int prom_getproplen(int thisnode, char *property); | 272 | extern int prom_getproplen(int thisnode, const char *property); |
273 | 273 | ||
274 | /* Fetch the requested property using the given buffer. Returns | 274 | /* Fetch the requested property using the given buffer. Returns |
275 | * the number of bytes the prom put into your buffer or -1 on error. | 275 | * the number of bytes the prom put into your buffer or -1 on error. |
276 | */ | 276 | */ |
277 | extern int prom_getproperty(int thisnode, char *property, | 277 | extern int prom_getproperty(int thisnode, const char *property, |
278 | char *prop_buffer, int propbuf_size); | 278 | char *prop_buffer, int propbuf_size); |
279 | 279 | ||
280 | /* Acquire an integer property. */ | 280 | /* Acquire an integer property. */ |
281 | extern int prom_getint(int node, char *property); | 281 | extern int prom_getint(int node, const char *property); |
282 | 282 | ||
283 | /* Acquire an integer property, with a default value. */ | 283 | /* Acquire an integer property, with a default value. */ |
284 | extern int prom_getintdefault(int node, char *property, int defval); | 284 | extern int prom_getintdefault(int node, const char *property, int defval); |
285 | 285 | ||
286 | /* Acquire a boolean property, 0=FALSE 1=TRUE. */ | 286 | /* Acquire a boolean property, 0=FALSE 1=TRUE. */ |
287 | extern int prom_getbool(int node, char *prop); | 287 | extern int prom_getbool(int node, const char *prop); |
288 | 288 | ||
289 | /* Acquire a string property, null string on error. */ | 289 | /* Acquire a string property, null string on error. */ |
290 | extern void prom_getstring(int node, char *prop, char *buf, int bufsize); | 290 | extern void prom_getstring(int node, const char *prop, char *buf, int bufsize); |
291 | 291 | ||
292 | /* Does the passed node have the given "name"? YES=1 NO=0 */ | 292 | /* Does the passed node have the given "name"? YES=1 NO=0 */ |
293 | extern int prom_nodematch(int thisnode, char *name); | 293 | extern int prom_nodematch(int thisnode, const char *name); |
294 | 294 | ||
295 | /* Puts in buffer a prom name in the form name@x,y or name (x for which_io | 295 | /* Puts in buffer a prom name in the form name@x,y or name (x for which_io |
296 | * and y for first regs phys address | 296 | * and y for first regs phys address |
@@ -300,7 +300,7 @@ extern int prom_getname(int node, char *buf, int buflen); | |||
300 | /* Search all siblings starting at the passed node for "name" matching | 300 | /* Search all siblings starting at the passed node for "name" matching |
301 | * the given string. Returns the node on success, zero on failure. | 301 | * the given string. Returns the node on success, zero on failure. |
302 | */ | 302 | */ |
303 | extern int prom_searchsiblings(int node_start, char *name); | 303 | extern int prom_searchsiblings(int node_start, const char *name); |
304 | 304 | ||
305 | /* Return the first property type, as a string, for the given node. | 305 | /* Return the first property type, as a string, for the given node. |
306 | * Returns a null string on error. Buffer should be at least 32B long. | 306 | * Returns a null string on error. Buffer should be at least 32B long. |
@@ -310,21 +310,21 @@ extern char *prom_firstprop(int node, char *buffer); | |||
310 | /* Returns the next property after the passed property for the given | 310 | /* Returns the next property after the passed property for the given |
311 | * node. Returns null string on failure. Buffer should be at least 32B long. | 311 | * node. Returns null string on failure. Buffer should be at least 32B long. |
312 | */ | 312 | */ |
313 | extern char *prom_nextprop(int node, char *prev_property, char *buffer); | 313 | extern char *prom_nextprop(int node, const char *prev_property, char *buffer); |
314 | 314 | ||
315 | /* Returns 1 if the specified node has given property. */ | 315 | /* Returns 1 if the specified node has given property. */ |
316 | extern int prom_node_has_property(int node, char *property); | 316 | extern int prom_node_has_property(int node, const char *property); |
317 | 317 | ||
318 | /* Returns phandle of the path specified */ | 318 | /* Returns phandle of the path specified */ |
319 | extern int prom_finddevice(char *name); | 319 | extern int prom_finddevice(const char *name); |
320 | 320 | ||
321 | /* Set the indicated property at the given node with the passed value. | 321 | /* Set the indicated property at the given node with the passed value. |
322 | * Returns the number of bytes of your value that the prom took. | 322 | * Returns the number of bytes of your value that the prom took. |
323 | */ | 323 | */ |
324 | extern int prom_setprop(int node, char *prop_name, char *prop_value, | 324 | extern int prom_setprop(int node, const char *prop_name, char *prop_value, |
325 | int value_size); | 325 | int value_size); |
326 | 326 | ||
327 | extern int prom_pathtoinode(char *path); | 327 | extern int prom_pathtoinode(const char *path); |
328 | extern int prom_inst2pkg(int); | 328 | extern int prom_inst2pkg(int); |
329 | 329 | ||
330 | /* CPU probing helpers. */ | 330 | /* CPU probing helpers. */ |
@@ -334,7 +334,7 @@ int cpu_find_by_mid(int mid, int *prom_node); | |||
334 | /* Client interface level routines. */ | 334 | /* Client interface level routines. */ |
335 | extern void prom_set_trap_table(unsigned long tba); | 335 | extern void prom_set_trap_table(unsigned long tba); |
336 | 336 | ||
337 | extern long p1275_cmd (char *, long, ...); | 337 | extern long p1275_cmd(const char *, long, ...); |
338 | 338 | ||
339 | 339 | ||
340 | #if 0 | 340 | #if 0 |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 7f8d764abc47..5426bb28a993 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -140,23 +140,6 @@ extern unsigned long page_to_pfn(struct page *); | |||
140 | #define virt_to_phys __pa | 140 | #define virt_to_phys __pa |
141 | #define phys_to_virt __va | 141 | #define phys_to_virt __va |
142 | 142 | ||
143 | /* The following structure is used to hold the physical | ||
144 | * memory configuration of the machine. This is filled in | ||
145 | * probe_memory() and is later used by mem_init() to set up | ||
146 | * mem_map[]. We statically allocate SPARC_PHYS_BANKS of | ||
147 | * these structs, this is arbitrary. The entry after the | ||
148 | * last valid one has num_bytes==0. | ||
149 | */ | ||
150 | |||
151 | struct sparc_phys_banks { | ||
152 | unsigned long base_addr; | ||
153 | unsigned long num_bytes; | ||
154 | }; | ||
155 | |||
156 | #define SPARC_PHYS_BANKS 32 | ||
157 | |||
158 | extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; | ||
159 | |||
160 | #endif /* !(__ASSEMBLY__) */ | 143 | #endif /* !(__ASSEMBLY__) */ |
161 | 144 | ||
162 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 145 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index a297f6144f0f..8c6dfc6c7af6 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -60,13 +60,13 @@ | |||
60 | * table can map | 60 | * table can map |
61 | */ | 61 | */ |
62 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) | 62 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) |
63 | #define PMD_SIZE (1UL << PMD_SHIFT) | 63 | #define PMD_SIZE (_AC(1,UL) << PMD_SHIFT) |
64 | #define PMD_MASK (~(PMD_SIZE-1)) | 64 | #define PMD_MASK (~(PMD_SIZE-1)) |
65 | #define PMD_BITS (PAGE_SHIFT - 2) | 65 | #define PMD_BITS (PAGE_SHIFT - 2) |
66 | 66 | ||
67 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 67 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
68 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) | 68 | #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) |
69 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 69 | #define PGDIR_SIZE (_AC(1,UL) << PGDIR_SHIFT) |
70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 70 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
71 | #define PGDIR_BITS (PAGE_SHIFT - 2) | 71 | #define PGDIR_BITS (PAGE_SHIFT - 2) |
72 | 72 | ||
@@ -98,7 +98,9 @@ | |||
98 | #define _PAGE_NFO _AC(0x1000000000000000,UL) /* No Fault Only */ | 98 | #define _PAGE_NFO _AC(0x1000000000000000,UL) /* No Fault Only */ |
99 | #define _PAGE_IE _AC(0x0800000000000000,UL) /* Invert Endianness */ | 99 | #define _PAGE_IE _AC(0x0800000000000000,UL) /* Invert Endianness */ |
100 | #define _PAGE_SOFT2 _AC(0x07FC000000000000,UL) /* Software bits, set 2 */ | 100 | #define _PAGE_SOFT2 _AC(0x07FC000000000000,UL) /* Software bits, set 2 */ |
101 | #define _PAGE_RES1 _AC(0x0003000000000000,UL) /* Reserved */ | 101 | #define _PAGE_RES1 _AC(0x0002000000000000,UL) /* Reserved */ |
102 | #define _PAGE_SZ32MB _AC(0x0001000000000000,UL) /* (Panther) 32MB page */ | ||
103 | #define _PAGE_SZ256MB _AC(0x2001000000000000,UL) /* (Panther) 256MB page */ | ||
102 | #define _PAGE_SN _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ | 104 | #define _PAGE_SN _AC(0x0000800000000000,UL) /* (Cheetah) Snoop */ |
103 | #define _PAGE_RES2 _AC(0x0000780000000000,UL) /* Reserved */ | 105 | #define _PAGE_RES2 _AC(0x0000780000000000,UL) /* Reserved */ |
104 | #define _PAGE_PADDR_SF _AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr[40:13]*/ | 106 | #define _PAGE_PADDR_SF _AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr[40:13]*/ |
@@ -336,7 +338,11 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
336 | #define pte_clear(mm,addr,ptep) \ | 338 | #define pte_clear(mm,addr,ptep) \ |
337 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 339 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
338 | 340 | ||
339 | extern pgd_t swapper_pg_dir[1]; | 341 | extern pgd_t swapper_pg_dir[2048]; |
342 | extern pmd_t swapper_low_pmd_dir[2048]; | ||
343 | |||
344 | extern void paging_init(void); | ||
345 | extern unsigned long find_ecache_flush_span(unsigned long size); | ||
340 | 346 | ||
341 | /* These do nothing with the way I have things setup. */ | 347 | /* These do nothing with the way I have things setup. */ |
342 | #define mmu_lockarea(vaddr, len) (vaddr) | 348 | #define mmu_lockarea(vaddr, len) (vaddr) |
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 80a65d7e3dbf..203e8eee6351 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h | |||
@@ -70,26 +70,14 @@ static inline int access_ok(int type, const void __user * addr, unsigned long si | |||
70 | * with the main instruction path. This means when everything is well, | 70 | * with the main instruction path. This means when everything is well, |
71 | * we don't even have to jump over them. Further, they do not intrude | 71 | * we don't even have to jump over them. Further, they do not intrude |
72 | * on our cache or tlb entries. | 72 | * on our cache or tlb entries. |
73 | * | ||
74 | * There is a special way how to put a range of potentially faulting | ||
75 | * insns (like twenty ldd/std's with now intervening other instructions) | ||
76 | * You specify address of first in insn and 0 in fixup and in the next | ||
77 | * exception_table_entry you specify last potentially faulting insn + 1 | ||
78 | * and in fixup the routine which should handle the fault. | ||
79 | * That fixup code will get | ||
80 | * (faulting_insn_address - first_insn_in_the_range_address)/4 | ||
81 | * in %g2 (ie. index of the faulting instruction in the range). | ||
82 | */ | 73 | */ |
83 | 74 | ||
84 | struct exception_table_entry | 75 | struct exception_table_entry { |
85 | { | 76 | unsigned int insn, fixup; |
86 | unsigned insn, fixup; | ||
87 | }; | 77 | }; |
88 | 78 | ||
89 | /* Special exable search, which handles ranges. Returns fixup */ | ||
90 | unsigned long search_extables_range(unsigned long addr, unsigned long *g2); | ||
91 | |||
92 | extern void __ret_efault(void); | 79 | extern void __ret_efault(void); |
80 | extern void __retl_efault(void); | ||
93 | 81 | ||
94 | /* Uh, these should become the main single-value transfer routines.. | 82 | /* Uh, these should become the main single-value transfer routines.. |
95 | * They automatically use the right size if we just have the right | 83 | * They automatically use the right size if we just have the right |
@@ -263,7 +251,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size) | |||
263 | { | 251 | { |
264 | unsigned long ret = ___copy_from_user(to, from, size); | 252 | unsigned long ret = ___copy_from_user(to, from, size); |
265 | 253 | ||
266 | if (ret) | 254 | if (unlikely(ret)) |
267 | ret = copy_from_user_fixup(to, from, size); | 255 | ret = copy_from_user_fixup(to, from, size); |
268 | return ret; | 256 | return ret; |
269 | } | 257 | } |
@@ -279,7 +267,7 @@ copy_to_user(void __user *to, const void *from, unsigned long size) | |||
279 | { | 267 | { |
280 | unsigned long ret = ___copy_to_user(to, from, size); | 268 | unsigned long ret = ___copy_to_user(to, from, size); |
281 | 269 | ||
282 | if (ret) | 270 | if (unlikely(ret)) |
283 | ret = copy_to_user_fixup(to, from, size); | 271 | ret = copy_to_user_fixup(to, from, size); |
284 | return ret; | 272 | return ret; |
285 | } | 273 | } |
@@ -295,7 +283,7 @@ copy_in_user(void __user *to, void __user *from, unsigned long size) | |||
295 | { | 283 | { |
296 | unsigned long ret = ___copy_in_user(to, from, size); | 284 | unsigned long ret = ___copy_in_user(to, from, size); |
297 | 285 | ||
298 | if (ret) | 286 | if (unlikely(ret)) |
299 | ret = copy_in_user_fixup(to, from, size); | 287 | ret = copy_in_user_fixup(to, from, size); |
300 | return ret; | 288 | return ret; |
301 | } | 289 | } |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index ed06170e0edd..616d02b57ea9 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -346,7 +346,6 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) | |||
346 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 346 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
347 | { | 347 | { |
348 | pte_set_val(pte, (pte_val(pte) & _PAGE_CHG_MASK), newprot); | 348 | pte_set_val(pte, (pte_val(pte) & _PAGE_CHG_MASK), newprot); |
349 | if(pte_present(pte)) pte = pte_mknewpage(pte_mknewprot(pte)); | ||
350 | return pte; | 349 | return pte; |
351 | } | 350 | } |
352 | 351 | ||
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index 801710d00a40..2ee028b8de9d 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -44,7 +44,7 @@ | |||
44 | const __typeof__(ptr) __private_ptr = ptr; \ | 44 | const __typeof__(ptr) __private_ptr = ptr; \ |
45 | __typeof__(*(__private_ptr)) __private_val; \ | 45 | __typeof__(*(__private_ptr)) __private_val; \ |
46 | int __private_ret = -EFAULT; \ | 46 | int __private_ret = -EFAULT; \ |
47 | (x) = 0; \ | 47 | (x) = (__typeof__(*(__private_ptr)))0; \ |
48 | if (__copy_from_user(&__private_val, (__private_ptr), \ | 48 | if (__copy_from_user(&__private_val, (__private_ptr), \ |
49 | sizeof(*(__private_ptr))) == 0) {\ | 49 | sizeof(*(__private_ptr))) == 0) {\ |
50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ | 50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ |
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h index 4d727f3f5550..5a7fe3c6c3d8 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86_64/msr.h | |||
@@ -234,6 +234,7 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
234 | #define MSR_K8_TOP_MEM1 0xC001001A | 234 | #define MSR_K8_TOP_MEM1 0xC001001A |
235 | #define MSR_K8_TOP_MEM2 0xC001001D | 235 | #define MSR_K8_TOP_MEM2 0xC001001D |
236 | #define MSR_K8_SYSCFG 0xC0010010 | 236 | #define MSR_K8_SYSCFG 0xC0010010 |
237 | #define MSR_K8_HWCR 0xC0010015 | ||
237 | 238 | ||
238 | /* K6 MSRs */ | 239 | /* K6 MSRs */ |
239 | #define MSR_K6_EFER 0xC0000080 | 240 | #define MSR_K6_EFER 0xC0000080 |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 2cb483516459..dd8711ecaf2f 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -384,7 +384,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
384 | } | 384 | } |
385 | 385 | ||
386 | #define pte_index(address) \ | 386 | #define pte_index(address) \ |
387 | ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | 387 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) |
388 | #define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_kernel(*(dir)) + \ | 388 | #define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_kernel(*(dir)) + \ |
389 | pte_index(address)) | 389 | pte_index(address)) |
390 | 390 | ||
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h index 24f86f0e43cf..12b5732dc6e5 100644 --- a/include/asm-xtensa/atomic.h +++ b/include/asm-xtensa/atomic.h | |||
@@ -22,7 +22,7 @@ typedef struct { volatile int counter; } atomic_t; | |||
22 | #include <asm/processor.h> | 22 | #include <asm/processor.h> |
23 | #include <asm/system.h> | 23 | #include <asm/system.h> |
24 | 24 | ||
25 | #define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) | 25 | #define ATOMIC_INIT(i) { (i) } |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * This Xtensa implementation assumes that the right mechanism | 28 | * This Xtensa implementation assumes that the right mechanism |
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h index d395ef226c32..e76ee889e21d 100644 --- a/include/asm-xtensa/bitops.h +++ b/include/asm-xtensa/bitops.h | |||
@@ -174,7 +174,7 @@ static __inline__ int test_bit(int nr, const volatile void *addr) | |||
174 | return 1UL & (((const volatile unsigned int *)addr)[nr>>5] >> (nr&31)); | 174 | return 1UL & (((const volatile unsigned int *)addr)[nr>>5] >> (nr&31)); |
175 | } | 175 | } |
176 | 176 | ||
177 | #if XCHAL_HAVE_NSAU | 177 | #if XCHAL_HAVE_NSA |
178 | 178 | ||
179 | static __inline__ int __cntlz (unsigned long x) | 179 | static __inline__ int __cntlz (unsigned long x) |
180 | { | 180 | { |
diff --git a/include/asm-xtensa/hardirq.h b/include/asm-xtensa/hardirq.h index e07c76c36b95..aa9c1adf68d7 100644 --- a/include/asm-xtensa/hardirq.h +++ b/include/asm-xtensa/hardirq.h | |||
@@ -23,6 +23,7 @@ typedef struct { | |||
23 | unsigned int __nmi_count; /* arch dependent */ | 23 | unsigned int __nmi_count; /* arch dependent */ |
24 | } ____cacheline_aligned irq_cpustat_t; | 24 | } ____cacheline_aligned irq_cpustat_t; |
25 | 25 | ||
26 | void ack_bad_irq(unsigned int irq); | ||
26 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 27 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
27 | 28 | ||
28 | #endif /* _XTENSA_HARDIRQ_H */ | 29 | #endif /* _XTENSA_HARDIRQ_H */ |
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h index db740b8bc6f0..09e89ab3eb61 100644 --- a/include/asm-xtensa/semaphore.h +++ b/include/asm-xtensa/semaphore.h | |||
@@ -20,28 +20,19 @@ struct semaphore { | |||
20 | atomic_t count; | 20 | atomic_t count; |
21 | int sleepers; | 21 | int sleepers; |
22 | wait_queue_head_t wait; | 22 | wait_queue_head_t wait; |
23 | #if WAITQUEUE_DEBUG | ||
24 | long __magic; | ||
25 | #endif | ||
26 | }; | 23 | }; |
27 | 24 | ||
28 | #if WAITQUEUE_DEBUG | 25 | #define __SEMAPHORE_INITIALIZER(name,n) \ |
29 | # define __SEM_DEBUG_INIT(name) \ | 26 | { \ |
30 | , (int)&(name).__magic | 27 | .count = ATOMIC_INIT(n), \ |
31 | #else | 28 | .sleepers = 0, \ |
32 | # define __SEM_DEBUG_INIT(name) | 29 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
33 | #endif | 30 | } |
34 | |||
35 | #define __SEMAPHORE_INITIALIZER(name,count) \ | ||
36 | { ATOMIC_INIT(count), \ | ||
37 | 0, \ | ||
38 | __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | ||
39 | __SEM_DEBUG_INIT(name) } | ||
40 | 31 | ||
41 | #define __MUTEX_INITIALIZER(name) \ | 32 | #define __MUTEX_INITIALIZER(name) \ |
42 | __SEMAPHORE_INITIALIZER(name, 1) | 33 | __SEMAPHORE_INITIALIZER(name, 1) |
43 | 34 | ||
44 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 35 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
45 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 36 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
46 | 37 | ||
47 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) | 38 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) |
@@ -49,17 +40,8 @@ struct semaphore { | |||
49 | 40 | ||
50 | static inline void sema_init (struct semaphore *sem, int val) | 41 | static inline void sema_init (struct semaphore *sem, int val) |
51 | { | 42 | { |
52 | /* | ||
53 | * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); | ||
54 | * | ||
55 | * i'd rather use the more flexible initialization above, but sadly | ||
56 | * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. | ||
57 | */ | ||
58 | atomic_set(&sem->count, val); | 43 | atomic_set(&sem->count, val); |
59 | init_waitqueue_head(&sem->wait); | 44 | init_waitqueue_head(&sem->wait); |
60 | #if WAITQUEUE_DEBUG | ||
61 | sem->__magic = (int)&sem->__magic; | ||
62 | #endif | ||
63 | } | 45 | } |
64 | 46 | ||
65 | static inline void init_MUTEX (struct semaphore *sem) | 47 | static inline void init_MUTEX (struct semaphore *sem) |
@@ -81,9 +63,7 @@ extern spinlock_t semaphore_wake_lock; | |||
81 | 63 | ||
82 | static inline void down(struct semaphore * sem) | 64 | static inline void down(struct semaphore * sem) |
83 | { | 65 | { |
84 | #if WAITQUEUE_DEBUG | 66 | might_sleep(); |
85 | CHECK_MAGIC(sem->__magic); | ||
86 | #endif | ||
87 | 67 | ||
88 | if (atomic_sub_return(1, &sem->count) < 0) | 68 | if (atomic_sub_return(1, &sem->count) < 0) |
89 | __down(sem); | 69 | __down(sem); |
@@ -92,9 +72,8 @@ static inline void down(struct semaphore * sem) | |||
92 | static inline int down_interruptible(struct semaphore * sem) | 72 | static inline int down_interruptible(struct semaphore * sem) |
93 | { | 73 | { |
94 | int ret = 0; | 74 | int ret = 0; |
95 | #if WAITQUEUE_DEBUG | 75 | |
96 | CHECK_MAGIC(sem->__magic); | 76 | might_sleep(); |
97 | #endif | ||
98 | 77 | ||
99 | if (atomic_sub_return(1, &sem->count) < 0) | 78 | if (atomic_sub_return(1, &sem->count) < 0) |
100 | ret = __down_interruptible(sem); | 79 | ret = __down_interruptible(sem); |
@@ -104,9 +83,6 @@ static inline int down_interruptible(struct semaphore * sem) | |||
104 | static inline int down_trylock(struct semaphore * sem) | 83 | static inline int down_trylock(struct semaphore * sem) |
105 | { | 84 | { |
106 | int ret = 0; | 85 | int ret = 0; |
107 | #if WAITQUEUE_DEBUG | ||
108 | CHECK_MAGIC(sem->__magic); | ||
109 | #endif | ||
110 | 86 | ||
111 | if (atomic_sub_return(1, &sem->count) < 0) | 87 | if (atomic_sub_return(1, &sem->count) < 0) |
112 | ret = __down_trylock(sem); | 88 | ret = __down_trylock(sem); |
@@ -119,9 +95,6 @@ static inline int down_trylock(struct semaphore * sem) | |||
119 | */ | 95 | */ |
120 | static inline void up(struct semaphore * sem) | 96 | static inline void up(struct semaphore * sem) |
121 | { | 97 | { |
122 | #if WAITQUEUE_DEBUG | ||
123 | CHECK_MAGIC(sem->__magic); | ||
124 | #endif | ||
125 | if (atomic_add_return(1, &sem->count) <= 0) | 98 | if (atomic_add_return(1, &sem->count) <= 0) |
126 | __up(sem); | 99 | __up(sem); |
127 | } | 100 | } |
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index f09393232e5e..9284867f1cb9 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h | |||
@@ -189,20 +189,6 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val) | |||
189 | 189 | ||
190 | #define tas(ptr) (xchg((ptr),1)) | 190 | #define tas(ptr) (xchg((ptr),1)) |
191 | 191 | ||
192 | #if ( __XCC__ == 1 ) | ||
193 | |||
194 | /* xt-xcc processes __inline__ differently than xt-gcc and decides to | ||
195 | * insert an out-of-line copy of function __xchg. This presents the | ||
196 | * unresolved symbol at link time of __xchg_called_with_bad_pointer, | ||
197 | * even though such a function would never be called at run-time. | ||
198 | * xt-gcc always inlines __xchg, and optimizes away the undefined | ||
199 | * bad_pointer function. | ||
200 | */ | ||
201 | |||
202 | #define xchg(ptr,x) xchg_u32(ptr,x) | ||
203 | |||
204 | #else /* assume xt-gcc */ | ||
205 | |||
206 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | 192 | #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) |
207 | 193 | ||
208 | /* | 194 | /* |
@@ -224,8 +210,6 @@ __xchg(unsigned long x, volatile void * ptr, int size) | |||
224 | return x; | 210 | return x; |
225 | } | 211 | } |
226 | 212 | ||
227 | #endif | ||
228 | |||
229 | extern void set_except_vector(int n, void *addr); | 213 | extern void set_except_vector(int n, void *addr); |
230 | 214 | ||
231 | static inline void spill_registers(void) | 215 | static inline void spill_registers(void) |
diff --git a/include/linux/aio.h b/include/linux/aio.h index a4d5af907f90..60def658b246 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -43,6 +43,40 @@ struct kioctx; | |||
43 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) | 43 | #define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) |
44 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) | 44 | #define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) |
45 | 45 | ||
46 | /* is there a better place to document function pointer methods? */ | ||
47 | /** | ||
48 | * ki_retry - iocb forward progress callback | ||
49 | * @kiocb: The kiocb struct to advance by performing an operation. | ||
50 | * | ||
51 | * This callback is called when the AIO core wants a given AIO operation | ||
52 | * to make forward progress. The kiocb argument describes the operation | ||
53 | * that is to be performed. As the operation proceeds, perhaps partially, | ||
54 | * ki_retry is expected to update the kiocb with progress made. Typically | ||
55 | * ki_retry is set in the AIO core and it itself calls file_operations | ||
56 | * helpers. | ||
57 | * | ||
58 | * ki_retry's return value determines when the AIO operation is completed | ||
59 | * and an event is generated in the AIO event ring. Except the special | ||
60 | * return values described below, the value that is returned from ki_retry | ||
61 | * is transferred directly into the completion ring as the operation's | ||
62 | * resulting status. Once this has happened ki_retry *MUST NOT* reference | ||
63 | * the kiocb pointer again. | ||
64 | * | ||
65 | * If ki_retry returns -EIOCBQUEUED it has made a promise that aio_complete() | ||
66 | * will be called on the kiocb pointer in the future. The AIO core will | ||
67 | * not ask the method again -- ki_retry must ensure forward progress. | ||
68 | * aio_complete() must be called once and only once in the future, multiple | ||
69 | * calls may result in undefined behaviour. | ||
70 | * | ||
71 | * If ki_retry returns -EIOCBRETRY it has made a promise that kick_iocb() | ||
72 | * will be called on the kiocb pointer in the future. This may happen | ||
73 | * through generic helpers that associate kiocb->ki_wait with a wait | ||
74 | * queue head that ki_retry uses via current->io_wait. It can also happen | ||
75 | * with custom tracking and manual calls to kick_iocb(), though that is | ||
76 | * discouraged. In either case, kick_iocb() must be called once and only | ||
77 | * once. ki_retry must ensure forward progress, the AIO core will wait | ||
78 | * indefinitely for kick_iocb() to be called. | ||
79 | */ | ||
46 | struct kiocb { | 80 | struct kiocb { |
47 | struct list_head ki_run_list; | 81 | struct list_head ki_run_list; |
48 | long ki_flags; | 82 | long ki_flags; |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 96de26301f84..86d4b0a81713 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -104,12 +104,19 @@ struct cn_queue_dev { | |||
104 | struct sock *nls; | 104 | struct sock *nls; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | struct cn_callback { | 107 | struct cn_callback_id { |
108 | unsigned char name[CN_CBQ_NAMELEN]; | 108 | unsigned char name[CN_CBQ_NAMELEN]; |
109 | |||
110 | struct cb_id id; | 109 | struct cb_id id; |
110 | }; | ||
111 | |||
112 | struct cn_callback_data { | ||
113 | void (*destruct_data) (void *); | ||
114 | void *ddata; | ||
115 | |||
116 | void *callback_priv; | ||
111 | void (*callback) (void *); | 117 | void (*callback) (void *); |
112 | void *priv; | 118 | |
119 | void *free; | ||
113 | }; | 120 | }; |
114 | 121 | ||
115 | struct cn_callback_entry { | 122 | struct cn_callback_entry { |
@@ -118,8 +125,8 @@ struct cn_callback_entry { | |||
118 | struct work_struct work; | 125 | struct work_struct work; |
119 | struct cn_queue_dev *pdev; | 126 | struct cn_queue_dev *pdev; |
120 | 127 | ||
121 | void (*destruct_data) (void *); | 128 | struct cn_callback_id id; |
122 | void *ddata; | 129 | struct cn_callback_data data; |
123 | 130 | ||
124 | int seq, group; | 131 | int seq, group; |
125 | struct sock *nls; | 132 | struct sock *nls; |
@@ -144,7 +151,7 @@ int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | |||
144 | void cn_del_callback(struct cb_id *); | 151 | void cn_del_callback(struct cb_id *); |
145 | int cn_netlink_send(struct cn_msg *, u32, int); | 152 | int cn_netlink_send(struct cn_msg *, u32, int); |
146 | 153 | ||
147 | int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); | 154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
148 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
149 | 156 | ||
150 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 157 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
@@ -152,6 +159,8 @@ void cn_queue_free_dev(struct cn_queue_dev *dev); | |||
152 | 159 | ||
153 | int cn_cb_equal(struct cb_id *, struct cb_id *); | 160 | int cn_cb_equal(struct cb_id *, struct cb_id *); |
154 | 161 | ||
162 | void cn_queue_wrapper(void *data); | ||
163 | |||
155 | extern int cn_already_initialized; | 164 | extern int cn_already_initialized; |
156 | 165 | ||
157 | #endif /* __KERNEL__ */ | 166 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index fc2d4c8225aa..d21c305c6c64 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -111,7 +111,9 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
111 | return (struct ethhdr *)skb->mac.raw; | 111 | return (struct ethhdr *)skb->mac.raw; |
112 | } | 112 | } |
113 | 113 | ||
114 | #ifdef CONFIG_SYSCTL | ||
114 | extern struct ctl_table ether_table[]; | 115 | extern struct ctl_table ether_table[]; |
115 | #endif | 116 | #endif |
117 | #endif | ||
116 | 118 | ||
117 | #endif /* _LINUX_IF_ETHER_H */ | 119 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 7e1e15f934f3..fd7af86151b1 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask, u32 addr) | |||
142 | 142 | ||
143 | #define endfor_ifa(in_dev) } | 143 | #define endfor_ifa(in_dev) } |
144 | 144 | ||
145 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | ||
146 | { | ||
147 | struct in_device *in_dev = dev->ip_ptr; | ||
148 | if (in_dev) | ||
149 | in_dev = rcu_dereference(in_dev); | ||
150 | return in_dev; | ||
151 | } | ||
152 | |||
145 | static __inline__ struct in_device * | 153 | static __inline__ struct in_device * |
146 | in_dev_get(const struct net_device *dev) | 154 | in_dev_get(const struct net_device *dev) |
147 | { | 155 | { |
148 | struct in_device *in_dev; | 156 | struct in_device *in_dev; |
149 | 157 | ||
150 | rcu_read_lock(); | 158 | rcu_read_lock(); |
151 | in_dev = dev->ip_ptr; | 159 | in_dev = __in_dev_get_rcu(dev); |
152 | if (in_dev) | 160 | if (in_dev) |
153 | atomic_inc(&in_dev->refcnt); | 161 | atomic_inc(&in_dev->refcnt); |
154 | rcu_read_unlock(); | 162 | rcu_read_unlock(); |
@@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev) | |||
156 | } | 164 | } |
157 | 165 | ||
158 | static __inline__ struct in_device * | 166 | static __inline__ struct in_device * |
159 | __in_dev_get(const struct net_device *dev) | 167 | __in_dev_get_rtnl(const struct net_device *dev) |
160 | { | 168 | { |
161 | return (struct in_device*)dev->ip_ptr; | 169 | return (struct in_device*)dev->ip_ptr; |
162 | } | 170 | } |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index bb6f88e14061..e0b922785d98 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -372,8 +372,9 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
372 | #define inet_v6_ipv6only(__sk) 0 | 372 | #define inet_v6_ipv6only(__sk) 0 |
373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 373 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
374 | 374 | ||
375 | #define INET6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ | 375 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ |
376 | (((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 376 | (((__sk)->sk_hash == (__hash)) && \ |
377 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | ||
377 | ((__sk)->sk_family == AF_INET6) && \ | 378 | ((__sk)->sk_family == AF_INET6) && \ |
378 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 379 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
379 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 380 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h index cc326174a808..918c34a8347e 100644 --- a/include/linux/key-ui.h +++ b/include/linux/key-ui.h | |||
@@ -42,11 +42,14 @@ struct keyring_list { | |||
42 | /* | 42 | /* |
43 | * check to see whether permission is granted to use a key in the desired way | 43 | * check to see whether permission is granted to use a key in the desired way |
44 | */ | 44 | */ |
45 | static inline int key_permission(const struct key *key, key_perm_t perm) | 45 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) |
46 | { | 46 | { |
47 | struct key *key = key_ref_to_ptr(key_ref); | ||
47 | key_perm_t kperm; | 48 | key_perm_t kperm; |
48 | 49 | ||
49 | if (key->uid == current->fsuid) | 50 | if (is_key_possessed(key_ref)) |
51 | kperm = key->perm >> 24; | ||
52 | else if (key->uid == current->fsuid) | ||
50 | kperm = key->perm >> 16; | 53 | kperm = key->perm >> 16; |
51 | else if (key->gid != -1 && | 54 | else if (key->gid != -1 && |
52 | key->perm & KEY_GRP_ALL && | 55 | key->perm & KEY_GRP_ALL && |
@@ -65,11 +68,14 @@ static inline int key_permission(const struct key *key, key_perm_t perm) | |||
65 | * check to see whether permission is granted to use a key in at least one of | 68 | * check to see whether permission is granted to use a key in at least one of |
66 | * the desired ways | 69 | * the desired ways |
67 | */ | 70 | */ |
68 | static inline int key_any_permission(const struct key *key, key_perm_t perm) | 71 | static inline int key_any_permission(const key_ref_t key_ref, key_perm_t perm) |
69 | { | 72 | { |
73 | struct key *key = key_ref_to_ptr(key_ref); | ||
70 | key_perm_t kperm; | 74 | key_perm_t kperm; |
71 | 75 | ||
72 | if (key->uid == current->fsuid) | 76 | if (is_key_possessed(key_ref)) |
77 | kperm = key->perm >> 24; | ||
78 | else if (key->uid == current->fsuid) | ||
73 | kperm = key->perm >> 16; | 79 | kperm = key->perm >> 16; |
74 | else if (key->gid != -1 && | 80 | else if (key->gid != -1 && |
75 | key->perm & KEY_GRP_ALL && | 81 | key->perm & KEY_GRP_ALL && |
@@ -94,13 +100,17 @@ static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid) | |||
94 | return ret; | 100 | return ret; |
95 | } | 101 | } |
96 | 102 | ||
97 | static inline int key_task_permission(const struct key *key, | 103 | static inline int key_task_permission(const key_ref_t key_ref, |
98 | struct task_struct *context, | 104 | struct task_struct *context, |
99 | key_perm_t perm) | 105 | key_perm_t perm) |
100 | { | 106 | { |
107 | struct key *key = key_ref_to_ptr(key_ref); | ||
101 | key_perm_t kperm; | 108 | key_perm_t kperm; |
102 | 109 | ||
103 | if (key->uid == context->fsuid) { | 110 | if (is_key_possessed(key_ref)) { |
111 | kperm = key->perm >> 24; | ||
112 | } | ||
113 | else if (key->uid == context->fsuid) { | ||
104 | kperm = key->perm >> 16; | 114 | kperm = key->perm >> 16; |
105 | } | 115 | } |
106 | else if (key->gid != -1 && | 116 | else if (key->gid != -1 && |
@@ -121,9 +131,9 @@ static inline int key_task_permission(const struct key *key, | |||
121 | 131 | ||
122 | } | 132 | } |
123 | 133 | ||
124 | extern struct key *lookup_user_key(struct task_struct *context, | 134 | extern key_ref_t lookup_user_key(struct task_struct *context, |
125 | key_serial_t id, int create, int partial, | 135 | key_serial_t id, int create, int partial, |
126 | key_perm_t perm); | 136 | key_perm_t perm); |
127 | 137 | ||
128 | extern long join_session_keyring(const char *name); | 138 | extern long join_session_keyring(const char *name); |
129 | 139 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 970bbd916cf4..f1efa016dbf3 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -35,11 +35,18 @@ struct key; | |||
35 | 35 | ||
36 | #undef KEY_DEBUGGING | 36 | #undef KEY_DEBUGGING |
37 | 37 | ||
38 | #define KEY_USR_VIEW 0x00010000 /* user can view a key's attributes */ | 38 | #define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */ |
39 | #define KEY_USR_READ 0x00020000 /* user can read key payload / view keyring */ | 39 | #define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */ |
40 | #define KEY_USR_WRITE 0x00040000 /* user can update key payload / add link to keyring */ | 40 | #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ |
41 | #define KEY_USR_SEARCH 0x00080000 /* user can find a key in search / search a keyring */ | 41 | #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ |
42 | #define KEY_USR_LINK 0x00100000 /* user can create a link to a key/keyring */ | 42 | #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ |
43 | #define KEY_POS_ALL 0x1f000000 | ||
44 | |||
45 | #define KEY_USR_VIEW 0x00010000 /* user permissions... */ | ||
46 | #define KEY_USR_READ 0x00020000 | ||
47 | #define KEY_USR_WRITE 0x00040000 | ||
48 | #define KEY_USR_SEARCH 0x00080000 | ||
49 | #define KEY_USR_LINK 0x00100000 | ||
43 | #define KEY_USR_ALL 0x001f0000 | 50 | #define KEY_USR_ALL 0x001f0000 |
44 | 51 | ||
45 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ | 52 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ |
@@ -67,6 +74,38 @@ struct keyring_name; | |||
67 | 74 | ||
68 | /*****************************************************************************/ | 75 | /*****************************************************************************/ |
69 | /* | 76 | /* |
77 | * key reference with possession attribute handling | ||
78 | * | ||
79 | * NOTE! key_ref_t is a typedef'd pointer to a type that is not actually | ||
80 | * defined. This is because we abuse the bottom bit of the reference to carry a | ||
81 | * flag to indicate whether the calling process possesses that key in one of | ||
82 | * its keyrings. | ||
83 | * | ||
84 | * the key_ref_t has been made a separate type so that the compiler can reject | ||
85 | * attempts to dereference it without proper conversion. | ||
86 | * | ||
87 | * the three functions are used to assemble and disassemble references | ||
88 | */ | ||
89 | typedef struct __key_reference_with_attributes *key_ref_t; | ||
90 | |||
91 | static inline key_ref_t make_key_ref(const struct key *key, | ||
92 | unsigned long possession) | ||
93 | { | ||
94 | return (key_ref_t) ((unsigned long) key | possession); | ||
95 | } | ||
96 | |||
97 | static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) | ||
98 | { | ||
99 | return (struct key *) ((unsigned long) key_ref & ~1UL); | ||
100 | } | ||
101 | |||
102 | static inline unsigned long is_key_possessed(const key_ref_t key_ref) | ||
103 | { | ||
104 | return (unsigned long) key_ref & 1UL; | ||
105 | } | ||
106 | |||
107 | /*****************************************************************************/ | ||
108 | /* | ||
70 | * authentication token / access credential / keyring | 109 | * authentication token / access credential / keyring |
71 | * - types of key include: | 110 | * - types of key include: |
72 | * - keyrings | 111 | * - keyrings |
@@ -215,20 +254,25 @@ static inline struct key *key_get(struct key *key) | |||
215 | return key; | 254 | return key; |
216 | } | 255 | } |
217 | 256 | ||
257 | static inline void key_ref_put(key_ref_t key_ref) | ||
258 | { | ||
259 | key_put(key_ref_to_ptr(key_ref)); | ||
260 | } | ||
261 | |||
218 | extern struct key *request_key(struct key_type *type, | 262 | extern struct key *request_key(struct key_type *type, |
219 | const char *description, | 263 | const char *description, |
220 | const char *callout_info); | 264 | const char *callout_info); |
221 | 265 | ||
222 | extern int key_validate(struct key *key); | 266 | extern int key_validate(struct key *key); |
223 | 267 | ||
224 | extern struct key *key_create_or_update(struct key *keyring, | 268 | extern key_ref_t key_create_or_update(key_ref_t keyring, |
225 | const char *type, | 269 | const char *type, |
226 | const char *description, | 270 | const char *description, |
227 | const void *payload, | 271 | const void *payload, |
228 | size_t plen, | 272 | size_t plen, |
229 | int not_in_quota); | 273 | int not_in_quota); |
230 | 274 | ||
231 | extern int key_update(struct key *key, | 275 | extern int key_update(key_ref_t key, |
232 | const void *payload, | 276 | const void *payload, |
233 | size_t plen); | 277 | size_t plen); |
234 | 278 | ||
@@ -243,9 +287,9 @@ extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | |||
243 | 287 | ||
244 | extern int keyring_clear(struct key *keyring); | 288 | extern int keyring_clear(struct key *keyring); |
245 | 289 | ||
246 | extern struct key *keyring_search(struct key *keyring, | 290 | extern key_ref_t keyring_search(key_ref_t keyring, |
247 | struct key_type *type, | 291 | struct key_type *type, |
248 | const char *description); | 292 | const char *description); |
249 | 293 | ||
250 | extern int keyring_add_key(struct key *keyring, | 294 | extern int keyring_add_key(struct key *keyring, |
251 | struct key *key); | 295 | struct key *key); |
@@ -285,6 +329,10 @@ extern void key_init(void); | |||
285 | #define key_serial(k) 0 | 329 | #define key_serial(k) 0 |
286 | #define key_get(k) ({ NULL; }) | 330 | #define key_get(k) ({ NULL; }) |
287 | #define key_put(k) do { } while(0) | 331 | #define key_put(k) do { } while(0) |
332 | #define key_ref_put(k) do { } while(0) | ||
333 | #define make_key_ref(k) ({ NULL; }) | ||
334 | #define key_ref_to_ptr(k) ({ NULL; }) | ||
335 | #define is_key_possessed(k) 0 | ||
288 | #define alloc_uid_keyring(u) 0 | 336 | #define alloc_uid_keyring(u) 0 |
289 | #define switch_uid_keyring(u) do { } while(0) | 337 | #define switch_uid_keyring(u) do { } while(0) |
290 | #define __install_session_keyring(t, k) ({ NULL; }) | 338 | #define __install_session_keyring(t, k) ({ NULL; }) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 022105c745fc..ceee1fc42c60 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -393,6 +393,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
393 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 393 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
394 | #endif /* CONFIG_PCI */ | 394 | #endif /* CONFIG_PCI */ |
395 | extern int ata_device_add(struct ata_probe_ent *ent); | 395 | extern int ata_device_add(struct ata_probe_ent *ent); |
396 | extern void ata_host_set_remove(struct ata_host_set *host_set); | ||
396 | extern int ata_scsi_detect(Scsi_Host_Template *sht); | 397 | extern int ata_scsi_detect(Scsi_Host_Template *sht); |
397 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 398 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
398 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 399 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 47da39ba3f03..2f0299a448f6 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -183,7 +183,7 @@ struct of_device_id | |||
183 | char name[32]; | 183 | char name[32]; |
184 | char type[32]; | 184 | char type[32]; |
185 | char compatible[128]; | 185 | char compatible[128]; |
186 | #if __KERNEL__ | 186 | #ifdef __KERNEL__ |
187 | void *data; | 187 | void *data; |
188 | #else | 188 | #else |
189 | kernel_ulong_t data; | 189 | kernel_ulong_t data; |
@@ -209,10 +209,11 @@ struct pcmcia_device_id { | |||
209 | /* for real multi-function devices */ | 209 | /* for real multi-function devices */ |
210 | __u8 function; | 210 | __u8 function; |
211 | 211 | ||
212 | /* for pseude multi-function devices */ | 212 | /* for pseudo multi-function devices */ |
213 | __u8 device_no; | 213 | __u8 device_no; |
214 | 214 | ||
215 | __u32 prod_id_hash[4]; | 215 | __u32 prod_id_hash[4] |
216 | __attribute__((aligned(sizeof(__u32)))); | ||
216 | 217 | ||
217 | /* not matched against in kernelspace*/ | 218 | /* not matched against in kernelspace*/ |
218 | #ifdef __KERNEL__ | 219 | #ifdef __KERNEL__ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 98c98e6cd4f3..a9281b24c40b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -265,6 +265,8 @@ struct net_device | |||
265 | * the interface. | 265 | * the interface. |
266 | */ | 266 | */ |
267 | char name[IFNAMSIZ]; | 267 | char name[IFNAMSIZ]; |
268 | /* device name hash chain */ | ||
269 | struct hlist_node name_hlist; | ||
268 | 270 | ||
269 | /* | 271 | /* |
270 | * I/O specific fields | 272 | * I/O specific fields |
@@ -292,6 +294,21 @@ struct net_device | |||
292 | 294 | ||
293 | /* ------- Fields preinitialized in Space.c finish here ------- */ | 295 | /* ------- Fields preinitialized in Space.c finish here ------- */ |
294 | 296 | ||
297 | /* Net device features */ | ||
298 | unsigned long features; | ||
299 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | ||
300 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | ||
301 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | ||
302 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ | ||
303 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ | ||
304 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ | ||
305 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ | ||
306 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | ||
307 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | ||
308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | ||
309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | ||
310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | ||
311 | |||
295 | struct net_device *next_sched; | 312 | struct net_device *next_sched; |
296 | 313 | ||
297 | /* Interface index. Unique device identifier */ | 314 | /* Interface index. Unique device identifier */ |
@@ -316,9 +333,6 @@ struct net_device | |||
316 | * will (read: may be cleaned up at will). | 333 | * will (read: may be cleaned up at will). |
317 | */ | 334 | */ |
318 | 335 | ||
319 | /* These may be needed for future network-power-down code. */ | ||
320 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | ||
321 | unsigned long last_rx; /* Time of last Rx */ | ||
322 | 336 | ||
323 | unsigned short flags; /* interface flags (a la BSD) */ | 337 | unsigned short flags; /* interface flags (a la BSD) */ |
324 | unsigned short gflags; | 338 | unsigned short gflags; |
@@ -328,15 +342,12 @@ struct net_device | |||
328 | unsigned mtu; /* interface MTU value */ | 342 | unsigned mtu; /* interface MTU value */ |
329 | unsigned short type; /* interface hardware type */ | 343 | unsigned short type; /* interface hardware type */ |
330 | unsigned short hard_header_len; /* hardware hdr length */ | 344 | unsigned short hard_header_len; /* hardware hdr length */ |
331 | void *priv; /* pointer to private data */ | ||
332 | 345 | ||
333 | struct net_device *master; /* Pointer to master device of a group, | 346 | struct net_device *master; /* Pointer to master device of a group, |
334 | * which this device is member of. | 347 | * which this device is member of. |
335 | */ | 348 | */ |
336 | 349 | ||
337 | /* Interface address info. */ | 350 | /* Interface address info. */ |
338 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | ||
339 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ | ||
340 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 351 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
341 | unsigned char addr_len; /* hardware address length */ | 352 | unsigned char addr_len; /* hardware address length */ |
342 | unsigned short dev_id; /* for shared network cards */ | 353 | unsigned short dev_id; /* for shared network cards */ |
@@ -346,8 +357,6 @@ struct net_device | |||
346 | int promiscuity; | 357 | int promiscuity; |
347 | int allmulti; | 358 | int allmulti; |
348 | 359 | ||
349 | int watchdog_timeo; | ||
350 | struct timer_list watchdog_timer; | ||
351 | 360 | ||
352 | /* Protocol specific pointers */ | 361 | /* Protocol specific pointers */ |
353 | 362 | ||
@@ -358,32 +367,62 @@ struct net_device | |||
358 | void *ec_ptr; /* Econet specific data */ | 367 | void *ec_ptr; /* Econet specific data */ |
359 | void *ax25_ptr; /* AX.25 specific data */ | 368 | void *ax25_ptr; /* AX.25 specific data */ |
360 | 369 | ||
361 | struct list_head poll_list; /* Link to poll list */ | 370 | /* |
371 | * Cache line mostly used on receive path (including eth_type_trans()) | ||
372 | */ | ||
373 | struct list_head poll_list ____cacheline_aligned_in_smp; | ||
374 | /* Link to poll list */ | ||
375 | |||
376 | int (*poll) (struct net_device *dev, int *quota); | ||
362 | int quota; | 377 | int quota; |
363 | int weight; | 378 | int weight; |
379 | unsigned long last_rx; /* Time of last Rx */ | ||
380 | /* Interface address info used in eth_type_trans() */ | ||
381 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast | ||
382 | because most packets are unicast) */ | ||
383 | |||
384 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | ||
364 | 385 | ||
386 | /* | ||
387 | * Cache line mostly used on queue transmit path (qdisc) | ||
388 | */ | ||
389 | /* device queue lock */ | ||
390 | spinlock_t queue_lock ____cacheline_aligned_in_smp; | ||
365 | struct Qdisc *qdisc; | 391 | struct Qdisc *qdisc; |
366 | struct Qdisc *qdisc_sleeping; | 392 | struct Qdisc *qdisc_sleeping; |
367 | struct Qdisc *qdisc_ingress; | ||
368 | struct list_head qdisc_list; | 393 | struct list_head qdisc_list; |
369 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 394 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
370 | 395 | ||
371 | /* ingress path synchronizer */ | 396 | /* ingress path synchronizer */ |
372 | spinlock_t ingress_lock; | 397 | spinlock_t ingress_lock; |
398 | struct Qdisc *qdisc_ingress; | ||
399 | |||
400 | /* | ||
401 | * One part is mostly used on xmit path (device) | ||
402 | */ | ||
373 | /* hard_start_xmit synchronizer */ | 403 | /* hard_start_xmit synchronizer */ |
374 | spinlock_t xmit_lock; | 404 | spinlock_t xmit_lock ____cacheline_aligned_in_smp; |
375 | /* cpu id of processor entered to hard_start_xmit or -1, | 405 | /* cpu id of processor entered to hard_start_xmit or -1, |
376 | if nobody entered there. | 406 | if nobody entered there. |
377 | */ | 407 | */ |
378 | int xmit_lock_owner; | 408 | int xmit_lock_owner; |
379 | /* device queue lock */ | 409 | void *priv; /* pointer to private data */ |
380 | spinlock_t queue_lock; | 410 | int (*hard_start_xmit) (struct sk_buff *skb, |
411 | struct net_device *dev); | ||
412 | /* These may be needed for future network-power-down code. */ | ||
413 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | ||
414 | |||
415 | int watchdog_timeo; /* used by dev_watchdog() */ | ||
416 | struct timer_list watchdog_timer; | ||
417 | |||
418 | /* | ||
419 | * refcnt is a very hot point, so align it on SMP | ||
420 | */ | ||
381 | /* Number of references to this device */ | 421 | /* Number of references to this device */ |
382 | atomic_t refcnt; | 422 | atomic_t refcnt ____cacheline_aligned_in_smp; |
423 | |||
383 | /* delayed register/unregister */ | 424 | /* delayed register/unregister */ |
384 | struct list_head todo_list; | 425 | struct list_head todo_list; |
385 | /* device name hash chain */ | ||
386 | struct hlist_node name_hlist; | ||
387 | /* device index hash chain */ | 426 | /* device index hash chain */ |
388 | struct hlist_node index_hlist; | 427 | struct hlist_node index_hlist; |
389 | 428 | ||
@@ -396,21 +435,6 @@ struct net_device | |||
396 | NETREG_RELEASED, /* called free_netdev */ | 435 | NETREG_RELEASED, /* called free_netdev */ |
397 | } reg_state; | 436 | } reg_state; |
398 | 437 | ||
399 | /* Net device features */ | ||
400 | unsigned long features; | ||
401 | #define NETIF_F_SG 1 /* Scatter/gather IO. */ | ||
402 | #define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ | ||
403 | #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ | ||
404 | #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ | ||
405 | #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ | ||
406 | #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ | ||
407 | #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ | ||
408 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | ||
409 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | ||
410 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | ||
411 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | ||
412 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | ||
413 | |||
414 | /* Called after device is detached from network. */ | 438 | /* Called after device is detached from network. */ |
415 | void (*uninit)(struct net_device *dev); | 439 | void (*uninit)(struct net_device *dev); |
416 | /* Called after last user reference disappears. */ | 440 | /* Called after last user reference disappears. */ |
@@ -419,10 +443,7 @@ struct net_device | |||
419 | /* Pointers to interface service routines. */ | 443 | /* Pointers to interface service routines. */ |
420 | int (*open)(struct net_device *dev); | 444 | int (*open)(struct net_device *dev); |
421 | int (*stop)(struct net_device *dev); | 445 | int (*stop)(struct net_device *dev); |
422 | int (*hard_start_xmit) (struct sk_buff *skb, | ||
423 | struct net_device *dev); | ||
424 | #define HAVE_NETDEV_POLL | 446 | #define HAVE_NETDEV_POLL |
425 | int (*poll) (struct net_device *dev, int *quota); | ||
426 | int (*hard_header) (struct sk_buff *skb, | 447 | int (*hard_header) (struct sk_buff *skb, |
427 | struct net_device *dev, | 448 | struct net_device *dev, |
428 | unsigned short type, | 449 | unsigned short type, |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index bace72a76cc4..4ced38736813 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -332,11 +332,28 @@ extern void need_ip_conntrack(void); | |||
332 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, | 332 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, |
333 | const struct ip_conntrack_tuple *orig); | 333 | const struct ip_conntrack_tuple *orig); |
334 | 334 | ||
335 | extern void __ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
336 | enum ip_conntrack_info ctinfo, | ||
337 | const struct sk_buff *skb, | ||
338 | unsigned long extra_jiffies, | ||
339 | int do_acct); | ||
340 | |||
341 | /* Refresh conntrack for this many jiffies and do accounting */ | ||
342 | static inline void ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
343 | enum ip_conntrack_info ctinfo, | ||
344 | const struct sk_buff *skb, | ||
345 | unsigned long extra_jiffies) | ||
346 | { | ||
347 | __ip_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, 1); | ||
348 | } | ||
349 | |||
335 | /* Refresh conntrack for this many jiffies */ | 350 | /* Refresh conntrack for this many jiffies */ |
336 | extern void ip_ct_refresh_acct(struct ip_conntrack *ct, | 351 | static inline void ip_ct_refresh(struct ip_conntrack *ct, |
337 | enum ip_conntrack_info ctinfo, | 352 | const struct sk_buff *skb, |
338 | const struct sk_buff *skb, | 353 | unsigned long extra_jiffies) |
339 | unsigned long extra_jiffies); | 354 | { |
355 | __ip_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | ||
356 | } | ||
340 | 357 | ||
341 | /* These are for NAT. Icky. */ | 358 | /* These are for NAT. Icky. */ |
342 | /* Update TCP window tracking data when NAT mangles the packet */ | 359 | /* Update TCP window tracking data when NAT mangles the packet */ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h index 389e3851d52f..816144c75de0 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h | |||
@@ -60,8 +60,8 @@ struct ip_ct_pptp_expect { | |||
60 | 60 | ||
61 | struct pptp_pkt_hdr { | 61 | struct pptp_pkt_hdr { |
62 | __u16 packetLength; | 62 | __u16 packetLength; |
63 | __u16 packetType; | 63 | __be16 packetType; |
64 | __u32 magicCookie; | 64 | __be32 magicCookie; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* PptpControlMessageType values */ | 67 | /* PptpControlMessageType values */ |
@@ -93,7 +93,7 @@ struct pptp_pkt_hdr { | |||
93 | #define PPTP_REMOVE_DEVICE_ERROR 6 | 93 | #define PPTP_REMOVE_DEVICE_ERROR 6 |
94 | 94 | ||
95 | struct PptpControlHeader { | 95 | struct PptpControlHeader { |
96 | __u16 messageType; | 96 | __be16 messageType; |
97 | __u16 reserved; | 97 | __u16 reserved; |
98 | }; | 98 | }; |
99 | 99 | ||
@@ -106,13 +106,13 @@ struct PptpControlHeader { | |||
106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 | 106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 |
107 | 107 | ||
108 | struct PptpStartSessionRequest { | 108 | struct PptpStartSessionRequest { |
109 | __u16 protocolVersion; | 109 | __be16 protocolVersion; |
110 | __u8 reserved1; | 110 | __u8 reserved1; |
111 | __u8 reserved2; | 111 | __u8 reserved2; |
112 | __u32 framingCapability; | 112 | __be32 framingCapability; |
113 | __u32 bearerCapability; | 113 | __be32 bearerCapability; |
114 | __u16 maxChannels; | 114 | __be16 maxChannels; |
115 | __u16 firmwareRevision; | 115 | __be16 firmwareRevision; |
116 | __u8 hostName[64]; | 116 | __u8 hostName[64]; |
117 | __u8 vendorString[64]; | 117 | __u8 vendorString[64]; |
118 | }; | 118 | }; |
@@ -125,13 +125,13 @@ struct PptpStartSessionRequest { | |||
125 | #define PPTP_START_UNKNOWN_PROTOCOL 5 | 125 | #define PPTP_START_UNKNOWN_PROTOCOL 5 |
126 | 126 | ||
127 | struct PptpStartSessionReply { | 127 | struct PptpStartSessionReply { |
128 | __u16 protocolVersion; | 128 | __be16 protocolVersion; |
129 | __u8 resultCode; | 129 | __u8 resultCode; |
130 | __u8 generalErrorCode; | 130 | __u8 generalErrorCode; |
131 | __u32 framingCapability; | 131 | __be32 framingCapability; |
132 | __u32 bearerCapability; | 132 | __be32 bearerCapability; |
133 | __u16 maxChannels; | 133 | __be16 maxChannels; |
134 | __u16 firmwareRevision; | 134 | __be16 firmwareRevision; |
135 | __u8 hostName[64]; | 135 | __u8 hostName[64]; |
136 | __u8 vendorString[64]; | 136 | __u8 vendorString[64]; |
137 | }; | 137 | }; |
@@ -155,7 +155,7 @@ struct PptpStopSessionReply { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | struct PptpEchoRequest { | 157 | struct PptpEchoRequest { |
158 | __u32 identNumber; | 158 | __be32 identNumber; |
159 | }; | 159 | }; |
160 | 160 | ||
161 | /* PptpEchoReplyResultCode */ | 161 | /* PptpEchoReplyResultCode */ |
@@ -163,7 +163,7 @@ struct PptpEchoRequest { | |||
163 | #define PPTP_ECHO_GENERAL_ERROR 2 | 163 | #define PPTP_ECHO_GENERAL_ERROR 2 |
164 | 164 | ||
165 | struct PptpEchoReply { | 165 | struct PptpEchoReply { |
166 | __u32 identNumber; | 166 | __be32 identNumber; |
167 | __u8 resultCode; | 167 | __u8 resultCode; |
168 | __u8 generalErrorCode; | 168 | __u8 generalErrorCode; |
169 | __u16 reserved; | 169 | __u16 reserved; |
@@ -180,16 +180,16 @@ struct PptpEchoReply { | |||
180 | #define PPTP_DONT_CARE_BEARER_TYPE 3 | 180 | #define PPTP_DONT_CARE_BEARER_TYPE 3 |
181 | 181 | ||
182 | struct PptpOutCallRequest { | 182 | struct PptpOutCallRequest { |
183 | __u16 callID; | 183 | __be16 callID; |
184 | __u16 callSerialNumber; | 184 | __be16 callSerialNumber; |
185 | __u32 minBPS; | 185 | __be32 minBPS; |
186 | __u32 maxBPS; | 186 | __be32 maxBPS; |
187 | __u32 bearerType; | 187 | __be32 bearerType; |
188 | __u32 framingType; | 188 | __be32 framingType; |
189 | __u16 packetWindow; | 189 | __be16 packetWindow; |
190 | __u16 packetProcDelay; | 190 | __be16 packetProcDelay; |
191 | __u16 reserved1; | 191 | __u16 reserved1; |
192 | __u16 phoneNumberLength; | 192 | __be16 phoneNumberLength; |
193 | __u16 reserved2; | 193 | __u16 reserved2; |
194 | __u8 phoneNumber[64]; | 194 | __u8 phoneNumber[64]; |
195 | __u8 subAddress[64]; | 195 | __u8 subAddress[64]; |
@@ -205,24 +205,24 @@ struct PptpOutCallRequest { | |||
205 | #define PPTP_OUTCALL_DONT_ACCEPT 7 | 205 | #define PPTP_OUTCALL_DONT_ACCEPT 7 |
206 | 206 | ||
207 | struct PptpOutCallReply { | 207 | struct PptpOutCallReply { |
208 | __u16 callID; | 208 | __be16 callID; |
209 | __u16 peersCallID; | 209 | __be16 peersCallID; |
210 | __u8 resultCode; | 210 | __u8 resultCode; |
211 | __u8 generalErrorCode; | 211 | __u8 generalErrorCode; |
212 | __u16 causeCode; | 212 | __be16 causeCode; |
213 | __u32 connectSpeed; | 213 | __be32 connectSpeed; |
214 | __u16 packetWindow; | 214 | __be16 packetWindow; |
215 | __u16 packetProcDelay; | 215 | __be16 packetProcDelay; |
216 | __u32 physChannelID; | 216 | __be32 physChannelID; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | struct PptpInCallRequest { | 219 | struct PptpInCallRequest { |
220 | __u16 callID; | 220 | __be16 callID; |
221 | __u16 callSerialNumber; | 221 | __be16 callSerialNumber; |
222 | __u32 callBearerType; | 222 | __be32 callBearerType; |
223 | __u32 physChannelID; | 223 | __be32 physChannelID; |
224 | __u16 dialedNumberLength; | 224 | __be16 dialedNumberLength; |
225 | __u16 dialingNumberLength; | 225 | __be16 dialingNumberLength; |
226 | __u8 dialedNumber[64]; | 226 | __u8 dialedNumber[64]; |
227 | __u8 dialingNumber[64]; | 227 | __u8 dialingNumber[64]; |
228 | __u8 subAddress[64]; | 228 | __u8 subAddress[64]; |
@@ -234,61 +234,54 @@ struct PptpInCallRequest { | |||
234 | #define PPTP_INCALL_DONT_ACCEPT 3 | 234 | #define PPTP_INCALL_DONT_ACCEPT 3 |
235 | 235 | ||
236 | struct PptpInCallReply { | 236 | struct PptpInCallReply { |
237 | __u16 callID; | 237 | __be16 callID; |
238 | __u16 peersCallID; | 238 | __be16 peersCallID; |
239 | __u8 resultCode; | 239 | __u8 resultCode; |
240 | __u8 generalErrorCode; | 240 | __u8 generalErrorCode; |
241 | __u16 packetWindow; | 241 | __be16 packetWindow; |
242 | __u16 packetProcDelay; | 242 | __be16 packetProcDelay; |
243 | __u16 reserved; | 243 | __u16 reserved; |
244 | }; | 244 | }; |
245 | 245 | ||
246 | struct PptpInCallConnected { | 246 | struct PptpInCallConnected { |
247 | __u16 peersCallID; | 247 | __be16 peersCallID; |
248 | __u16 reserved; | 248 | __u16 reserved; |
249 | __u32 connectSpeed; | 249 | __be32 connectSpeed; |
250 | __u16 packetWindow; | 250 | __be16 packetWindow; |
251 | __u16 packetProcDelay; | 251 | __be16 packetProcDelay; |
252 | __u32 callFramingType; | 252 | __be32 callFramingType; |
253 | }; | 253 | }; |
254 | 254 | ||
255 | struct PptpClearCallRequest { | 255 | struct PptpClearCallRequest { |
256 | __u16 callID; | 256 | __be16 callID; |
257 | __u16 reserved; | 257 | __u16 reserved; |
258 | }; | 258 | }; |
259 | 259 | ||
260 | struct PptpCallDisconnectNotify { | 260 | struct PptpCallDisconnectNotify { |
261 | __u16 callID; | 261 | __be16 callID; |
262 | __u8 resultCode; | 262 | __u8 resultCode; |
263 | __u8 generalErrorCode; | 263 | __u8 generalErrorCode; |
264 | __u16 causeCode; | 264 | __be16 causeCode; |
265 | __u16 reserved; | 265 | __u16 reserved; |
266 | __u8 callStatistics[128]; | 266 | __u8 callStatistics[128]; |
267 | }; | 267 | }; |
268 | 268 | ||
269 | struct PptpWanErrorNotify { | 269 | struct PptpWanErrorNotify { |
270 | __u16 peersCallID; | 270 | __be16 peersCallID; |
271 | __u16 reserved; | 271 | __u16 reserved; |
272 | __u32 crcErrors; | 272 | __be32 crcErrors; |
273 | __u32 framingErrors; | 273 | __be32 framingErrors; |
274 | __u32 hardwareOverRuns; | 274 | __be32 hardwareOverRuns; |
275 | __u32 bufferOverRuns; | 275 | __be32 bufferOverRuns; |
276 | __u32 timeoutErrors; | 276 | __be32 timeoutErrors; |
277 | __u32 alignmentErrors; | 277 | __be32 alignmentErrors; |
278 | }; | 278 | }; |
279 | 279 | ||
280 | struct PptpSetLinkInfo { | 280 | struct PptpSetLinkInfo { |
281 | __u16 peersCallID; | 281 | __be16 peersCallID; |
282 | __u16 reserved; | 282 | __u16 reserved; |
283 | __u32 sendAccm; | 283 | __be32 sendAccm; |
284 | __u32 recvAccm; | 284 | __be32 recvAccm; |
285 | }; | ||
286 | |||
287 | |||
288 | struct pptp_priv_data { | ||
289 | __u16 call_id; | ||
290 | __u16 mcall_id; | ||
291 | __u16 pcall_id; | ||
292 | }; | 285 | }; |
293 | 286 | ||
294 | union pptp_ctrl_union { | 287 | union pptp_ctrl_union { |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 14dc0f7b6556..20e43f018b7c 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
@@ -17,7 +17,7 @@ union ip_conntrack_manip_proto | |||
17 | u_int16_t all; | 17 | u_int16_t all; |
18 | 18 | ||
19 | struct { | 19 | struct { |
20 | u_int16_t port; | 20 | __be16 port; |
21 | } tcp; | 21 | } tcp; |
22 | struct { | 22 | struct { |
23 | u_int16_t port; | 23 | u_int16_t port; |
@@ -29,7 +29,7 @@ union ip_conntrack_manip_proto | |||
29 | u_int16_t port; | 29 | u_int16_t port; |
30 | } sctp; | 30 | } sctp; |
31 | struct { | 31 | struct { |
32 | u_int16_t key; /* key is 32bit, pptp only uses 16 */ | 32 | __be16 key; /* key is 32bit, pptp only uses 16 */ |
33 | } gre; | 33 | } gre; |
34 | }; | 34 | }; |
35 | 35 | ||
@@ -65,7 +65,7 @@ struct ip_conntrack_tuple | |||
65 | u_int16_t port; | 65 | u_int16_t port; |
66 | } sctp; | 66 | } sctp; |
67 | struct { | 67 | struct { |
68 | u_int16_t key; /* key is 32bit, | 68 | __be16 key; /* key is 32bit, |
69 | * pptp only uses 16 */ | 69 | * pptp only uses 16 */ |
70 | } gre; | 70 | } gre; |
71 | } u; | 71 | } u; |
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 3b50eb91f007..30db23f06b03 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h | |||
@@ -5,16 +5,14 @@ | |||
5 | 5 | ||
6 | /* This header used to share core functionality between the standalone | 6 | /* This header used to share core functionality between the standalone |
7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | 7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
8 | extern int ip_nat_init(void); | ||
9 | extern void ip_nat_cleanup(void); | ||
10 | 8 | ||
11 | extern unsigned int nat_packet(struct ip_conntrack *ct, | 9 | extern unsigned int ip_nat_packet(struct ip_conntrack *ct, |
12 | enum ip_conntrack_info conntrackinfo, | 10 | enum ip_conntrack_info conntrackinfo, |
13 | unsigned int hooknum, | 11 | unsigned int hooknum, |
14 | struct sk_buff **pskb); | 12 | struct sk_buff **pskb); |
15 | 13 | ||
16 | extern int icmp_reply_translation(struct sk_buff **pskb, | 14 | extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, |
17 | struct ip_conntrack *ct, | 15 | struct ip_conntrack *ct, |
18 | enum ip_nat_manip_type manip, | 16 | enum ip_nat_manip_type manip, |
19 | enum ip_conntrack_dir dir); | 17 | enum ip_conntrack_dir dir); |
20 | #endif /* _IP_NAT_CORE_H */ | 18 | #endif /* _IP_NAT_CORE_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c49d28eca561..f74ed9462475 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -185,6 +185,7 @@ | |||
185 | #define PCI_DEVICE_ID_LSI_61C102 0x0901 | 185 | #define PCI_DEVICE_ID_LSI_61C102 0x0901 |
186 | #define PCI_DEVICE_ID_LSI_63C815 0x1000 | 186 | #define PCI_DEVICE_ID_LSI_63C815 0x1000 |
187 | #define PCI_DEVICE_ID_LSI_SAS1064 0x0050 | 187 | #define PCI_DEVICE_ID_LSI_SAS1064 0x0050 |
188 | #define PCI_DEVICE_ID_LSI_SAS1064R 0x0411 | ||
188 | #define PCI_DEVICE_ID_LSI_SAS1066 0x005E | 189 | #define PCI_DEVICE_ID_LSI_SAS1066 0x005E |
189 | #define PCI_DEVICE_ID_LSI_SAS1068 0x0054 | 190 | #define PCI_DEVICE_ID_LSI_SAS1068 0x0054 |
190 | #define PCI_DEVICE_ID_LSI_SAS1064A 0x005C | 191 | #define PCI_DEVICE_ID_LSI_SAS1064A 0x005C |
@@ -392,6 +393,7 @@ | |||
392 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 | 393 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 |
393 | #define PCI_DEVICE_ID_NS_83815 0x0020 | 394 | #define PCI_DEVICE_ID_NS_83815 0x0020 |
394 | #define PCI_DEVICE_ID_NS_83820 0x0022 | 395 | #define PCI_DEVICE_ID_NS_83820 0x0022 |
396 | #define PCI_DEVICE_ID_NS_SATURN 0x0035 | ||
395 | #define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 | 397 | #define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 |
396 | #define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 | 398 | #define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 |
397 | #define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 | 399 | #define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 |
@@ -559,6 +561,7 @@ | |||
559 | #define PCI_VENDOR_ID_DELL 0x1028 | 561 | #define PCI_VENDOR_ID_DELL 0x1028 |
560 | #define PCI_DEVICE_ID_DELL_RACIII 0x0008 | 562 | #define PCI_DEVICE_ID_DELL_RACIII 0x0008 |
561 | #define PCI_DEVICE_ID_DELL_RAC4 0x0012 | 563 | #define PCI_DEVICE_ID_DELL_RAC4 0x0012 |
564 | #define PCI_DEVICE_ID_DELL_PERC5 0x0015 | ||
562 | 565 | ||
563 | #define PCI_VENDOR_ID_MATROX 0x102B | 566 | #define PCI_VENDOR_ID_MATROX 0x102B |
564 | #define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 | 567 | #define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 |
@@ -769,6 +772,8 @@ | |||
769 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 | 772 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 |
770 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 773 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
771 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 774 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
775 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | ||
776 | #define PCI_DEVICE_ID_TI_X515 0x8036 | ||
772 | #define PCI_DEVICE_ID_TI_1130 0xac12 | 777 | #define PCI_DEVICE_ID_TI_1130 0xac12 |
773 | #define PCI_DEVICE_ID_TI_1031 0xac13 | 778 | #define PCI_DEVICE_ID_TI_1031 0xac13 |
774 | #define PCI_DEVICE_ID_TI_1131 0xac15 | 779 | #define PCI_DEVICE_ID_TI_1131 0xac15 |
@@ -785,12 +790,17 @@ | |||
785 | #define PCI_DEVICE_ID_TI_4451 0xac42 | 790 | #define PCI_DEVICE_ID_TI_4451 0xac42 |
786 | #define PCI_DEVICE_ID_TI_4510 0xac44 | 791 | #define PCI_DEVICE_ID_TI_4510 0xac44 |
787 | #define PCI_DEVICE_ID_TI_4520 0xac46 | 792 | #define PCI_DEVICE_ID_TI_4520 0xac46 |
793 | #define PCI_DEVICE_ID_TI_7510 0xac47 | ||
794 | #define PCI_DEVICE_ID_TI_7610 0xac48 | ||
795 | #define PCI_DEVICE_ID_TI_7410 0xac49 | ||
788 | #define PCI_DEVICE_ID_TI_1410 0xac50 | 796 | #define PCI_DEVICE_ID_TI_1410 0xac50 |
789 | #define PCI_DEVICE_ID_TI_1420 0xac51 | 797 | #define PCI_DEVICE_ID_TI_1420 0xac51 |
790 | #define PCI_DEVICE_ID_TI_1451A 0xac52 | 798 | #define PCI_DEVICE_ID_TI_1451A 0xac52 |
791 | #define PCI_DEVICE_ID_TI_1620 0xac54 | 799 | #define PCI_DEVICE_ID_TI_1620 0xac54 |
792 | #define PCI_DEVICE_ID_TI_1520 0xac55 | 800 | #define PCI_DEVICE_ID_TI_1520 0xac55 |
793 | #define PCI_DEVICE_ID_TI_1510 0xac56 | 801 | #define PCI_DEVICE_ID_TI_1510 0xac56 |
802 | #define PCI_DEVICE_ID_TI_X620 0xac8d | ||
803 | #define PCI_DEVICE_ID_TI_X420 0xac8e | ||
794 | 804 | ||
795 | #define PCI_VENDOR_ID_SONY 0x104d | 805 | #define PCI_VENDOR_ID_SONY 0x104d |
796 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 | 806 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 |
@@ -976,6 +986,7 @@ | |||
976 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 | 986 | #define PCI_DEVICE_ID_SUN_SABRE 0xa000 |
977 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 | 987 | #define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 |
978 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 | 988 | #define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 |
989 | #define PCI_DEVICE_ID_SUN_CASSINI 0xabba | ||
979 | 990 | ||
980 | #define PCI_VENDOR_ID_CMD 0x1095 | 991 | #define PCI_VENDOR_ID_CMD 0x1095 |
981 | #define PCI_DEVICE_ID_CMD_640 0x0640 | 992 | #define PCI_DEVICE_ID_CMD_640 0x0640 |
@@ -1268,7 +1279,8 @@ | |||
1268 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1279 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
1269 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1280 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
1270 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1281 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1271 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F | 1282 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
1283 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | ||
1272 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | 1284 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 |
1273 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | 1285 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 |
1274 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | 1286 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B |
@@ -2186,7 +2198,12 @@ | |||
2186 | #define PCI_DEVICE_ID_ENE_1211 0x1211 | 2198 | #define PCI_DEVICE_ID_ENE_1211 0x1211 |
2187 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2199 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
2188 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2200 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
2201 | #define PCI_DEVICE_ID_ENE_710 0x1411 | ||
2202 | #define PCI_DEVICE_ID_ENE_712 0x1412 | ||
2189 | #define PCI_DEVICE_ID_ENE_1420 0x1420 | 2203 | #define PCI_DEVICE_ID_ENE_1420 0x1420 |
2204 | #define PCI_DEVICE_ID_ENE_720 0x1421 | ||
2205 | #define PCI_DEVICE_ID_ENE_722 0x1422 | ||
2206 | |||
2190 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 2207 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
2191 | 2208 | ||
2192 | #define PCI_VENDOR_ID_MIPS 0x153f | 2209 | #define PCI_VENDOR_ID_MIPS 0x153f |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 3b3266ff1a95..7ab2cdb83ef0 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,6 +59,10 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_restart_prepare(char *cmd); | ||
63 | extern void kernel_halt_prepare(void); | ||
64 | extern void kernel_power_off_prepare(void); | ||
65 | |||
62 | extern void kernel_restart(char *cmd); | 66 | extern void kernel_restart(char *cmd); |
63 | extern void kernel_halt(void); | 67 | extern void kernel_halt(void); |
64 | extern void kernel_power_off(void); | 68 | extern void kernel_power_off(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 49e617fa0f66..c3ba31f210a9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -107,13 +107,25 @@ extern unsigned long nr_iowait(void); | |||
107 | 107 | ||
108 | #include <asm/processor.h> | 108 | #include <asm/processor.h> |
109 | 109 | ||
110 | /* | ||
111 | * Task state bitmask. NOTE! These bits are also | ||
112 | * encoded in fs/proc/array.c: get_task_state(). | ||
113 | * | ||
114 | * We have two separate sets of flags: task->state | ||
115 | * is about runnability, while task->exit_state are | ||
116 | * about the task exiting. Confusing, but this way | ||
117 | * modifying one set can't modify the other one by | ||
118 | * mistake. | ||
119 | */ | ||
110 | #define TASK_RUNNING 0 | 120 | #define TASK_RUNNING 0 |
111 | #define TASK_INTERRUPTIBLE 1 | 121 | #define TASK_INTERRUPTIBLE 1 |
112 | #define TASK_UNINTERRUPTIBLE 2 | 122 | #define TASK_UNINTERRUPTIBLE 2 |
113 | #define TASK_STOPPED 4 | 123 | #define TASK_STOPPED 4 |
114 | #define TASK_TRACED 8 | 124 | #define TASK_TRACED 8 |
125 | /* in tsk->exit_state */ | ||
115 | #define EXIT_ZOMBIE 16 | 126 | #define EXIT_ZOMBIE 16 |
116 | #define EXIT_DEAD 32 | 127 | #define EXIT_DEAD 32 |
128 | /* in tsk->state again */ | ||
117 | #define TASK_NONINTERACTIVE 64 | 129 | #define TASK_NONINTERACTIVE 64 |
118 | 130 | ||
119 | #define __set_task_state(tsk, state_value) \ | 131 | #define __set_task_state(tsk, state_value) \ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2741c0c55e83..466c879f82b8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -155,8 +155,6 @@ struct skb_shared_info { | |||
155 | #define SKB_DATAREF_SHIFT 16 | 155 | #define SKB_DATAREF_SHIFT 16 |
156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
157 | 157 | ||
158 | extern struct timeval skb_tv_base; | ||
159 | |||
160 | struct skb_timeval { | 158 | struct skb_timeval { |
161 | u32 off_sec; | 159 | u32 off_sec; |
162 | u32 off_usec; | 160 | u32 off_usec; |
@@ -175,7 +173,7 @@ enum { | |||
175 | * @prev: Previous buffer in list | 173 | * @prev: Previous buffer in list |
176 | * @list: List we are on | 174 | * @list: List we are on |
177 | * @sk: Socket we are owned by | 175 | * @sk: Socket we are owned by |
178 | * @tstamp: Time we arrived stored as offset to skb_tv_base | 176 | * @tstamp: Time we arrived |
179 | * @dev: Device we arrived on/are leaving by | 177 | * @dev: Device we arrived on/are leaving by |
180 | * @input_dev: Device we arrived on | 178 | * @input_dev: Device we arrived on |
181 | * @h: Transport layer header | 179 | * @h: Transport layer header |
@@ -1255,10 +1253,6 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
1255 | { | 1253 | { |
1256 | stamp->tv_sec = skb->tstamp.off_sec; | 1254 | stamp->tv_sec = skb->tstamp.off_sec; |
1257 | stamp->tv_usec = skb->tstamp.off_usec; | 1255 | stamp->tv_usec = skb->tstamp.off_usec; |
1258 | if (skb->tstamp.off_sec) { | ||
1259 | stamp->tv_sec += skb_tv_base.tv_sec; | ||
1260 | stamp->tv_usec += skb_tv_base.tv_usec; | ||
1261 | } | ||
1262 | } | 1256 | } |
1263 | 1257 | ||
1264 | /** | 1258 | /** |
@@ -1272,8 +1266,8 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval * | |||
1272 | */ | 1266 | */ |
1273 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | 1267 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) |
1274 | { | 1268 | { |
1275 | skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; | 1269 | skb->tstamp.off_sec = stamp->tv_sec; |
1276 | skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; | 1270 | skb->tstamp.off_usec = stamp->tv_usec; |
1277 | } | 1271 | } |
1278 | 1272 | ||
1279 | extern void __net_timestamp(struct sk_buff *skb); | 1273 | extern void __net_timestamp(struct sk_buff *skb); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3a29a9f9b451..fc8e367f671e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -202,7 +202,8 @@ enum | |||
202 | NET_TR=14, | 202 | NET_TR=14, |
203 | NET_DECNET=15, | 203 | NET_DECNET=15, |
204 | NET_ECONET=16, | 204 | NET_ECONET=16, |
205 | NET_SCTP=17, | 205 | NET_SCTP=17, |
206 | NET_LLC=18, | ||
206 | }; | 207 | }; |
207 | 208 | ||
208 | /* /proc/sys/kernel/random */ | 209 | /* /proc/sys/kernel/random */ |
@@ -522,6 +523,29 @@ enum { | |||
522 | NET_IPX_FORWARDING=2 | 523 | NET_IPX_FORWARDING=2 |
523 | }; | 524 | }; |
524 | 525 | ||
526 | /* /proc/sys/net/llc */ | ||
527 | enum { | ||
528 | NET_LLC2=1, | ||
529 | NET_LLC_STATION=2, | ||
530 | }; | ||
531 | |||
532 | /* /proc/sys/net/llc/llc2 */ | ||
533 | enum { | ||
534 | NET_LLC2_TIMEOUT=1, | ||
535 | }; | ||
536 | |||
537 | /* /proc/sys/net/llc/station */ | ||
538 | enum { | ||
539 | NET_LLC_STATION_ACK_TIMEOUT=1, | ||
540 | }; | ||
541 | |||
542 | /* /proc/sys/net/llc/llc2/timeout */ | ||
543 | enum { | ||
544 | NET_LLC2_ACK_TIMEOUT=1, | ||
545 | NET_LLC2_P_TIMEOUT=2, | ||
546 | NET_LLC2_REJ_TIMEOUT=3, | ||
547 | NET_LLC2_BUSY_TIMEOUT=4, | ||
548 | }; | ||
525 | 549 | ||
526 | /* /proc/sys/net/appletalk */ | 550 | /* /proc/sys/net/appletalk */ |
527 | enum { | 551 | enum { |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index 081b1ee8516e..e21937cf91d0 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -71,7 +71,7 @@ enum | |||
71 | TCF_META_ID_SK_SNDBUF, | 71 | TCF_META_ID_SK_SNDBUF, |
72 | TCF_META_ID_SK_ALLOCS, | 72 | TCF_META_ID_SK_ALLOCS, |
73 | TCF_META_ID_SK_ROUTE_CAPS, | 73 | TCF_META_ID_SK_ROUTE_CAPS, |
74 | TCF_META_ID_SK_HASHENT, | 74 | TCF_META_ID_SK_HASH, |
75 | TCF_META_ID_SK_LINGERTIME, | 75 | TCF_META_ID_SK_LINGERTIME, |
76 | TCF_META_ID_SK_ACK_BACKLOG, | 76 | TCF_META_ID_SK_ACK_BACKLOG, |
77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, | 77 | TCF_META_ID_SK_MAX_ACK_BACKLOG, |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 03df3b157960..5a2beed5a770 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -26,19 +26,18 @@ | |||
26 | struct inet_hashinfo; | 26 | struct inet_hashinfo; |
27 | 27 | ||
28 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ | 28 | /* I have no idea if this is a good hash for v6 or not. -DaveM */ |
29 | static inline int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, | 29 | static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, |
30 | const struct in6_addr *faddr, const u16 fport, | 30 | const struct in6_addr *faddr, const u16 fport) |
31 | const int ehash_size) | ||
32 | { | 31 | { |
33 | int hashent = (lport ^ fport); | 32 | unsigned int hashent = (lport ^ fport); |
34 | 33 | ||
35 | hashent ^= (laddr->s6_addr32[3] ^ faddr->s6_addr32[3]); | 34 | hashent ^= (laddr->s6_addr32[3] ^ faddr->s6_addr32[3]); |
36 | hashent ^= hashent >> 16; | 35 | hashent ^= hashent >> 16; |
37 | hashent ^= hashent >> 8; | 36 | hashent ^= hashent >> 8; |
38 | return (hashent & (ehash_size - 1)); | 37 | return hashent; |
39 | } | 38 | } |
40 | 39 | ||
41 | static inline int inet6_sk_ehashfn(const struct sock *sk, const int ehash_size) | 40 | static inline int inet6_sk_ehashfn(const struct sock *sk) |
42 | { | 41 | { |
43 | const struct inet_sock *inet = inet_sk(sk); | 42 | const struct inet_sock *inet = inet_sk(sk); |
44 | const struct ipv6_pinfo *np = inet6_sk(sk); | 43 | const struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -46,7 +45,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk, const int ehash_size) | |||
46 | const struct in6_addr *faddr = &np->daddr; | 45 | const struct in6_addr *faddr = &np->daddr; |
47 | const __u16 lport = inet->num; | 46 | const __u16 lport = inet->num; |
48 | const __u16 fport = inet->dport; | 47 | const __u16 fport = inet->dport; |
49 | return inet6_ehashfn(laddr, lport, faddr, fport, ehash_size); | 48 | return inet6_ehashfn(laddr, lport, faddr, fport); |
50 | } | 49 | } |
51 | 50 | ||
52 | /* | 51 | /* |
@@ -69,14 +68,14 @@ static inline struct sock * | |||
69 | /* Optimize here for direct hit, only listening connections can | 68 | /* Optimize here for direct hit, only listening connections can |
70 | * have wildcards anyways. | 69 | * have wildcards anyways. |
71 | */ | 70 | */ |
72 | const int hash = inet6_ehashfn(daddr, hnum, saddr, sport, | 71 | unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); |
73 | hashinfo->ehash_size); | 72 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); |
74 | struct inet_ehash_bucket *head = &hashinfo->ehash[hash]; | ||
75 | 73 | ||
74 | prefetch(head->chain.first); | ||
76 | read_lock(&head->lock); | 75 | read_lock(&head->lock); |
77 | sk_for_each(sk, node, &head->chain) { | 76 | sk_for_each(sk, node, &head->chain) { |
78 | /* For IPV6 do the cheaper port and family tests first. */ | 77 | /* For IPV6 do the cheaper port and family tests first. */ |
79 | if (INET6_MATCH(sk, saddr, daddr, ports, dif)) | 78 | if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) |
80 | goto hit; /* You sunk my battleship! */ | 79 | goto hit; /* You sunk my battleship! */ |
81 | } | 80 | } |
82 | /* Must check for a TIME_WAIT'er before going to listener hash. */ | 81 | /* Must check for a TIME_WAIT'er before going to listener hash. */ |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 646b6ea7fe26..35f49e65e295 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -108,7 +108,7 @@ struct inet_hashinfo { | |||
108 | struct inet_bind_hashbucket *bhash; | 108 | struct inet_bind_hashbucket *bhash; |
109 | 109 | ||
110 | int bhash_size; | 110 | int bhash_size; |
111 | int ehash_size; | 111 | unsigned int ehash_size; |
112 | 112 | ||
113 | /* All sockets in TCP_LISTEN state will be in here. This is the only | 113 | /* All sockets in TCP_LISTEN state will be in here. This is the only |
114 | * table where wildcard'd TCP sockets can exist. Hash function here | 114 | * table where wildcard'd TCP sockets can exist. Hash function here |
@@ -130,17 +130,16 @@ struct inet_hashinfo { | |||
130 | int port_rover; | 130 | int port_rover; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static inline int inet_ehashfn(const __u32 laddr, const __u16 lport, | 133 | static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, |
134 | const __u32 faddr, const __u16 fport, | 134 | const __u32 faddr, const __u16 fport) |
135 | const int ehash_size) | ||
136 | { | 135 | { |
137 | int h = (laddr ^ lport) ^ (faddr ^ fport); | 136 | unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); |
138 | h ^= h >> 16; | 137 | h ^= h >> 16; |
139 | h ^= h >> 8; | 138 | h ^= h >> 8; |
140 | return h & (ehash_size - 1); | 139 | return h; |
141 | } | 140 | } |
142 | 141 | ||
143 | static inline int inet_sk_ehashfn(const struct sock *sk, const int ehash_size) | 142 | static inline int inet_sk_ehashfn(const struct sock *sk) |
144 | { | 143 | { |
145 | const struct inet_sock *inet = inet_sk(sk); | 144 | const struct inet_sock *inet = inet_sk(sk); |
146 | const __u32 laddr = inet->rcv_saddr; | 145 | const __u32 laddr = inet->rcv_saddr; |
@@ -148,7 +147,14 @@ static inline int inet_sk_ehashfn(const struct sock *sk, const int ehash_size) | |||
148 | const __u32 faddr = inet->daddr; | 147 | const __u32 faddr = inet->daddr; |
149 | const __u16 fport = inet->dport; | 148 | const __u16 fport = inet->dport; |
150 | 149 | ||
151 | return inet_ehashfn(laddr, lport, faddr, fport, ehash_size); | 150 | return inet_ehashfn(laddr, lport, faddr, fport); |
151 | } | ||
152 | |||
153 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | ||
154 | struct inet_hashinfo *hashinfo, | ||
155 | unsigned int hash) | ||
156 | { | ||
157 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; | ||
152 | } | 158 | } |
153 | 159 | ||
154 | extern struct inet_bind_bucket * | 160 | extern struct inet_bind_bucket * |
@@ -235,9 +241,11 @@ static inline void __inet_hash(struct inet_hashinfo *hashinfo, | |||
235 | lock = &hashinfo->lhash_lock; | 241 | lock = &hashinfo->lhash_lock; |
236 | inet_listen_wlock(hashinfo); | 242 | inet_listen_wlock(hashinfo); |
237 | } else { | 243 | } else { |
238 | sk->sk_hashent = inet_sk_ehashfn(sk, hashinfo->ehash_size); | 244 | struct inet_ehash_bucket *head; |
239 | list = &hashinfo->ehash[sk->sk_hashent].chain; | 245 | sk->sk_hash = inet_sk_ehashfn(sk); |
240 | lock = &hashinfo->ehash[sk->sk_hashent].lock; | 246 | head = inet_ehash_bucket(hashinfo, sk->sk_hash); |
247 | list = &head->chain; | ||
248 | lock = &head->lock; | ||
241 | write_lock(lock); | 249 | write_lock(lock); |
242 | } | 250 | } |
243 | __sk_add_node(sk, list); | 251 | __sk_add_node(sk, list); |
@@ -268,9 +276,8 @@ static inline void inet_unhash(struct inet_hashinfo *hashinfo, struct sock *sk) | |||
268 | inet_listen_wlock(hashinfo); | 276 | inet_listen_wlock(hashinfo); |
269 | lock = &hashinfo->lhash_lock; | 277 | lock = &hashinfo->lhash_lock; |
270 | } else { | 278 | } else { |
271 | struct inet_ehash_bucket *head = &hashinfo->ehash[sk->sk_hashent]; | 279 | lock = &inet_ehash_bucket(hashinfo, sk->sk_hash)->lock; |
272 | lock = &head->lock; | 280 | write_lock_bh(lock); |
273 | write_lock_bh(&head->lock); | ||
274 | } | 281 | } |
275 | 282 | ||
276 | if (__sk_del_node_init(sk)) | 283 | if (__sk_del_node_init(sk)) |
@@ -337,23 +344,27 @@ sherry_cache: | |||
337 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ | 344 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ |
338 | const __u64 __name = (((__u64)(__daddr)) << 32) | ((__u64)(__saddr)); | 345 | const __u64 __name = (((__u64)(__daddr)) << 32) | ((__u64)(__saddr)); |
339 | #endif /* __BIG_ENDIAN */ | 346 | #endif /* __BIG_ENDIAN */ |
340 | #define INET_MATCH(__sk, __cookie, __saddr, __daddr, __ports, __dif)\ | 347 | #define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
341 | (((*((__u64 *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | 348 | (((__sk)->sk_hash == (__hash)) && \ |
349 | ((*((__u64 *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | ||
342 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 350 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
343 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 351 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
344 | #define INET_TW_MATCH(__sk, __cookie, __saddr, __daddr, __ports, __dif)\ | 352 | #define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
345 | (((*((__u64 *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ | 353 | (((__sk)->sk_hash == (__hash)) && \ |
354 | ((*((__u64 *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ | ||
346 | ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 355 | ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ |
347 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 356 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
348 | #else /* 32-bit arch */ | 357 | #else /* 32-bit arch */ |
349 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 358 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
350 | #define INET_MATCH(__sk, __cookie, __saddr, __daddr, __ports, __dif) \ | 359 | #define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ |
351 | ((inet_sk(__sk)->daddr == (__saddr)) && \ | 360 | (((__sk)->sk_hash == (__hash)) && \ |
361 | (inet_sk(__sk)->daddr == (__saddr)) && \ | ||
352 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ | 362 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ |
353 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 363 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
354 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 364 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
355 | #define INET_TW_MATCH(__sk, __cookie, __saddr, __daddr, __ports, __dif) \ | 365 | #define INET_TW_MATCH(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ |
356 | ((inet_twsk(__sk)->tw_daddr == (__saddr)) && \ | 366 | (((__sk)->sk_hash == (__hash)) && \ |
367 | (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ | ||
357 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ | 368 | (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ |
358 | ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ | 369 | ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ |
359 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 370 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
@@ -378,18 +389,19 @@ static inline struct sock * | |||
378 | /* Optimize here for direct hit, only listening connections can | 389 | /* Optimize here for direct hit, only listening connections can |
379 | * have wildcards anyways. | 390 | * have wildcards anyways. |
380 | */ | 391 | */ |
381 | const int hash = inet_ehashfn(daddr, hnum, saddr, sport, hashinfo->ehash_size); | 392 | unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); |
382 | struct inet_ehash_bucket *head = &hashinfo->ehash[hash]; | 393 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); |
383 | 394 | ||
395 | prefetch(head->chain.first); | ||
384 | read_lock(&head->lock); | 396 | read_lock(&head->lock); |
385 | sk_for_each(sk, node, &head->chain) { | 397 | sk_for_each(sk, node, &head->chain) { |
386 | if (INET_MATCH(sk, acookie, saddr, daddr, ports, dif)) | 398 | if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) |
387 | goto hit; /* You sunk my battleship! */ | 399 | goto hit; /* You sunk my battleship! */ |
388 | } | 400 | } |
389 | 401 | ||
390 | /* Must check for a TIME_WAIT'er before going to listener hash. */ | 402 | /* Must check for a TIME_WAIT'er before going to listener hash. */ |
391 | sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { | 403 | sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { |
392 | if (INET_TW_MATCH(sk, acookie, saddr, daddr, ports, dif)) | 404 | if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) |
393 | goto hit; | 405 | goto hit; |
394 | } | 406 | } |
395 | sk = NULL; | 407 | sk = NULL; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 3b070352e869..4ade56ef3a4d 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -112,6 +112,7 @@ struct inet_timewait_sock { | |||
112 | #define tw_node __tw_common.skc_node | 112 | #define tw_node __tw_common.skc_node |
113 | #define tw_bind_node __tw_common.skc_bind_node | 113 | #define tw_bind_node __tw_common.skc_bind_node |
114 | #define tw_refcnt __tw_common.skc_refcnt | 114 | #define tw_refcnt __tw_common.skc_refcnt |
115 | #define tw_hash __tw_common.skc_hash | ||
115 | #define tw_prot __tw_common.skc_prot | 116 | #define tw_prot __tw_common.skc_prot |
116 | volatile unsigned char tw_substate; | 117 | volatile unsigned char tw_substate; |
117 | /* 3 bits hole, try to pack */ | 118 | /* 3 bits hole, try to pack */ |
@@ -126,7 +127,6 @@ struct inet_timewait_sock { | |||
126 | /* And these are ours. */ | 127 | /* And these are ours. */ |
127 | __u8 tw_ipv6only:1; | 128 | __u8 tw_ipv6only:1; |
128 | /* 31 bits hole, try to pack */ | 129 | /* 31 bits hole, try to pack */ |
129 | int tw_hashent; | ||
130 | int tw_timeout; | 130 | int tw_timeout; |
131 | unsigned long tw_ttd; | 131 | unsigned long tw_ttd; |
132 | struct inet_bind_bucket *tw_tb; | 132 | struct inet_bind_bucket *tw_tb; |
diff --git a/include/net/llc.h b/include/net/llc.h index 71769a5aeef3..1adb2ef3f6f7 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | 19 | ||
20 | #include <asm/atomic.h> | ||
21 | |||
20 | struct net_device; | 22 | struct net_device; |
21 | struct packet_type; | 23 | struct packet_type; |
22 | struct sk_buff; | 24 | struct sk_buff; |
@@ -44,6 +46,7 @@ struct llc_sap { | |||
44 | unsigned char state; | 46 | unsigned char state; |
45 | unsigned char p_bit; | 47 | unsigned char p_bit; |
46 | unsigned char f_bit; | 48 | unsigned char f_bit; |
49 | atomic_t refcnt; | ||
47 | int (*rcv_func)(struct sk_buff *skb, | 50 | int (*rcv_func)(struct sk_buff *skb, |
48 | struct net_device *dev, | 51 | struct net_device *dev, |
49 | struct packet_type *pt, | 52 | struct packet_type *pt, |
@@ -81,13 +84,27 @@ extern struct llc_sap *llc_sap_open(unsigned char lsap, | |||
81 | struct net_device *dev, | 84 | struct net_device *dev, |
82 | struct packet_type *pt, | 85 | struct packet_type *pt, |
83 | struct net_device *orig_dev)); | 86 | struct net_device *orig_dev)); |
87 | static inline void llc_sap_hold(struct llc_sap *sap) | ||
88 | { | ||
89 | atomic_inc(&sap->refcnt); | ||
90 | } | ||
91 | |||
84 | extern void llc_sap_close(struct llc_sap *sap); | 92 | extern void llc_sap_close(struct llc_sap *sap); |
85 | 93 | ||
94 | static inline void llc_sap_put(struct llc_sap *sap) | ||
95 | { | ||
96 | if (atomic_dec_and_test(&sap->refcnt)) | ||
97 | llc_sap_close(sap); | ||
98 | } | ||
99 | |||
86 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); | 100 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); |
87 | 101 | ||
88 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, | 102 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, |
89 | unsigned char *dmac, unsigned char dsap); | 103 | unsigned char *dmac, unsigned char dsap); |
90 | 104 | ||
105 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
106 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
107 | |||
91 | extern int llc_station_init(void); | 108 | extern int llc_station_init(void); |
92 | extern void llc_station_exit(void); | 109 | extern void llc_station_exit(void); |
93 | 110 | ||
@@ -98,4 +115,17 @@ extern void llc_proc_exit(void); | |||
98 | #define llc_proc_init() (0) | 115 | #define llc_proc_init() (0) |
99 | #define llc_proc_exit() do { } while(0) | 116 | #define llc_proc_exit() do { } while(0) |
100 | #endif /* CONFIG_PROC_FS */ | 117 | #endif /* CONFIG_PROC_FS */ |
118 | #ifdef CONFIG_SYSCTL | ||
119 | extern int llc_sysctl_init(void); | ||
120 | extern void llc_sysctl_exit(void); | ||
121 | |||
122 | extern int sysctl_llc2_ack_timeout; | ||
123 | extern int sysctl_llc2_busy_timeout; | ||
124 | extern int sysctl_llc2_p_timeout; | ||
125 | extern int sysctl_llc2_rej_timeout; | ||
126 | extern int sysctl_llc_station_ack_timeout; | ||
127 | #else | ||
128 | #define llc_sysctl_init() (0) | ||
129 | #define llc_sysctl_exit() do { } while(0) | ||
130 | #endif /* CONFIG_SYSCTL */ | ||
101 | #endif /* LLC_H */ | 131 | #endif /* LLC_H */ |
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 8ad3bc2c23d7..54852ff6033b 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h | |||
@@ -19,14 +19,14 @@ | |||
19 | #define LLC_EVENT 1 | 19 | #define LLC_EVENT 1 |
20 | #define LLC_PACKET 2 | 20 | #define LLC_PACKET 2 |
21 | 21 | ||
22 | #define LLC_P_TIME 2 | 22 | #define LLC2_P_TIME 2 |
23 | #define LLC_ACK_TIME 1 | 23 | #define LLC2_ACK_TIME 1 |
24 | #define LLC_REJ_TIME 3 | 24 | #define LLC2_REJ_TIME 3 |
25 | #define LLC_BUSY_TIME 3 | 25 | #define LLC2_BUSY_TIME 3 |
26 | 26 | ||
27 | struct llc_timer { | 27 | struct llc_timer { |
28 | struct timer_list timer; | 28 | struct timer_list timer; |
29 | u16 expire; /* timer expire time */ | 29 | unsigned long expire; /* timer expire time */ |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct llc_sock { | 32 | struct llc_sock { |
@@ -38,6 +38,7 @@ struct llc_sock { | |||
38 | struct llc_addr laddr; /* lsap/mac pair */ | 38 | struct llc_addr laddr; /* lsap/mac pair */ |
39 | struct llc_addr daddr; /* dsap/mac pair */ | 39 | struct llc_addr daddr; /* dsap/mac pair */ |
40 | struct net_device *dev; /* device to send to remote */ | 40 | struct net_device *dev; /* device to send to remote */ |
41 | u32 copied_seq; /* head of yet unread data */ | ||
41 | u8 retry_count; /* number of retries */ | 42 | u8 retry_count; /* number of retries */ |
42 | u8 ack_must_be_send; | 43 | u8 ack_must_be_send; |
43 | u8 first_pdu_Ns; | 44 | u8 first_pdu_Ns; |
@@ -92,7 +93,8 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb) | |||
92 | return skb->cb[sizeof(skb->cb) - 1]; | 93 | return skb->cb[sizeof(skb->cb) - 1]; |
93 | } | 94 | } |
94 | 95 | ||
95 | extern struct sock *llc_sk_alloc(int family, int priority, struct proto *prot); | 96 | extern struct sock *llc_sk_alloc(int family, unsigned int __nocast priority, |
97 | struct proto *prot); | ||
96 | extern void llc_sk_free(struct sock *sk); | 98 | extern void llc_sk_free(struct sock *sk); |
97 | 99 | ||
98 | extern void llc_sk_reset(struct sock *sk); | 100 | extern void llc_sk_reset(struct sock *sk); |
@@ -115,5 +117,4 @@ extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); | |||
115 | 117 | ||
116 | extern u8 llc_data_accept_state(u8 state); | 118 | extern u8 llc_data_accept_state(u8 state); |
117 | extern void llc_build_offset_table(void); | 119 | extern void llc_build_offset_table(void); |
118 | extern int llc_release_sockets(struct llc_sap *sap); | ||
119 | #endif /* LLC_CONN_H */ | 120 | #endif /* LLC_CONN_H */ |
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index 353baaa627f3..2c56dbece729 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h | |||
@@ -12,11 +12,15 @@ | |||
12 | * See the GNU General Public License for more details. | 12 | * See the GNU General Public License for more details. |
13 | */ | 13 | */ |
14 | struct llc_sap; | 14 | struct llc_sap; |
15 | struct net_device; | ||
15 | struct sk_buff; | 16 | struct sk_buff; |
17 | struct sock; | ||
16 | 18 | ||
17 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); | 19 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); |
18 | extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim); | 20 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, |
19 | extern struct sk_buff *llc_alloc_frame(void); | 21 | unsigned char prim); |
22 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, | ||
23 | struct net_device *dev); | ||
20 | 24 | ||
21 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, | 25 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, |
22 | struct sk_buff *skb, | 26 | struct sk_buff *skb, |
diff --git a/include/net/sock.h b/include/net/sock.h index 8c48fbecb7cf..b6440805c420 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -99,6 +99,7 @@ struct proto; | |||
99 | * @skc_node: main hash linkage for various protocol lookup tables | 99 | * @skc_node: main hash linkage for various protocol lookup tables |
100 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 100 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
101 | * @skc_refcnt: reference count | 101 | * @skc_refcnt: reference count |
102 | * @skc_hash: hash value used with various protocol lookup tables | ||
102 | * @skc_prot: protocol handlers inside a network family | 103 | * @skc_prot: protocol handlers inside a network family |
103 | * | 104 | * |
104 | * This is the minimal network layer representation of sockets, the header | 105 | * This is the minimal network layer representation of sockets, the header |
@@ -112,6 +113,7 @@ struct sock_common { | |||
112 | struct hlist_node skc_node; | 113 | struct hlist_node skc_node; |
113 | struct hlist_node skc_bind_node; | 114 | struct hlist_node skc_bind_node; |
114 | atomic_t skc_refcnt; | 115 | atomic_t skc_refcnt; |
116 | unsigned int skc_hash; | ||
115 | struct proto *skc_prot; | 117 | struct proto *skc_prot; |
116 | }; | 118 | }; |
117 | 119 | ||
@@ -139,7 +141,6 @@ struct sock_common { | |||
139 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 141 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
140 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 142 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
141 | * @sk_lingertime: %SO_LINGER l_linger setting | 143 | * @sk_lingertime: %SO_LINGER l_linger setting |
142 | * @sk_hashent: hash entry in several tables (e.g. inet_hashinfo.ehash) | ||
143 | * @sk_backlog: always used with the per-socket spinlock held | 144 | * @sk_backlog: always used with the per-socket spinlock held |
144 | * @sk_callback_lock: used with the callbacks in the end of this struct | 145 | * @sk_callback_lock: used with the callbacks in the end of this struct |
145 | * @sk_error_queue: rarely used | 146 | * @sk_error_queue: rarely used |
@@ -186,6 +187,7 @@ struct sock { | |||
186 | #define sk_node __sk_common.skc_node | 187 | #define sk_node __sk_common.skc_node |
187 | #define sk_bind_node __sk_common.skc_bind_node | 188 | #define sk_bind_node __sk_common.skc_bind_node |
188 | #define sk_refcnt __sk_common.skc_refcnt | 189 | #define sk_refcnt __sk_common.skc_refcnt |
190 | #define sk_hash __sk_common.skc_hash | ||
189 | #define sk_prot __sk_common.skc_prot | 191 | #define sk_prot __sk_common.skc_prot |
190 | unsigned char sk_shutdown : 2, | 192 | unsigned char sk_shutdown : 2, |
191 | sk_no_check : 2, | 193 | sk_no_check : 2, |
@@ -208,7 +210,6 @@ struct sock { | |||
208 | unsigned int sk_allocation; | 210 | unsigned int sk_allocation; |
209 | int sk_sndbuf; | 211 | int sk_sndbuf; |
210 | int sk_route_caps; | 212 | int sk_route_caps; |
211 | int sk_hashent; | ||
212 | unsigned long sk_flags; | 213 | unsigned long sk_flags; |
213 | unsigned long sk_lingertime; | 214 | unsigned long sk_lingertime; |
214 | /* | 215 | /* |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 0f7aacc33fe9..c8592c7e8eaa 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -21,6 +21,9 @@ | |||
21 | #include <pcmcia/cs_types.h> | 21 | #include <pcmcia/cs_types.h> |
22 | #include <pcmcia/cs.h> | 22 | #include <pcmcia/cs.h> |
23 | #include <pcmcia/bulkmem.h> | 23 | #include <pcmcia/bulkmem.h> |
24 | #ifdef CONFIG_CARDBUS | ||
25 | #include <linux/pci.h> | ||
26 | #endif | ||
24 | 27 | ||
25 | /* Definitions for card status flags for GetStatus */ | 28 | /* Definitions for card status flags for GetStatus */ |
26 | #define SS_WRPROT 0x0001 | 29 | #define SS_WRPROT 0x0001 |
@@ -233,7 +236,11 @@ struct pcmcia_socket { | |||
233 | 236 | ||
234 | /* so is power hook */ | 237 | /* so is power hook */ |
235 | int (*power_hook)(struct pcmcia_socket *sock, int operation); | 238 | int (*power_hook)(struct pcmcia_socket *sock, int operation); |
236 | 239 | #ifdef CONFIG_CARDBUS | |
240 | /* allows tuning the CB bridge before loading driver for the CB card */ | ||
241 | void (*tune_bridge)(struct pcmcia_socket *sock, struct pci_bus *bus); | ||
242 | #endif | ||
243 | |||
237 | /* state thread */ | 244 | /* state thread */ |
238 | struct semaphore skt_sem; /* protects socket h/w state */ | 245 | struct semaphore skt_sem; /* protects socket h/w state */ |
239 | 246 | ||
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e16cf94870f2..e6f4c9e55df7 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -665,7 +665,6 @@ struct ib_ucontext { | |||
665 | struct list_head qp_list; | 665 | struct list_head qp_list; |
666 | struct list_head srq_list; | 666 | struct list_head srq_list; |
667 | struct list_head ah_list; | 667 | struct list_head ah_list; |
668 | spinlock_t lock; | ||
669 | }; | 668 | }; |
670 | 669 | ||
671 | struct ib_uobject { | 670 | struct ib_uobject { |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index c0e4c67d836f..7ece05666feb 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -163,6 +163,7 @@ struct scsi_target { | |||
163 | unsigned int id; /* target id ... replace | 163 | unsigned int id; /* target id ... replace |
164 | * scsi_device.id eventually */ | 164 | * scsi_device.id eventually */ |
165 | unsigned long create:1; /* signal that it needs to be added */ | 165 | unsigned long create:1; /* signal that it needs to be added */ |
166 | char scsi_level; | ||
166 | void *hostdata; /* available to low-level driver */ | 167 | void *hostdata; /* available to low-level driver */ |
167 | unsigned long starget_data[0]; /* for the transport */ | 168 | unsigned long starget_data[0]; /* for the transport */ |
168 | /* starget_data must be the last element!!!! */ | 169 | /* starget_data must be the last element!!!! */ |