diff options
Diffstat (limited to 'include')
413 files changed, 11375 insertions, 2286 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index a3252a5ead66..a756bc8d866d 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -98,6 +98,9 @@ acpi_os_table_override(struct acpi_table_header *existing_table, | |||
98 | /* | 98 | /* |
99 | * Spinlock primitives | 99 | * Spinlock primitives |
100 | */ | 100 | */ |
101 | acpi_status | ||
102 | acpi_os_create_lock(acpi_spinlock *out_handle); | ||
103 | |||
101 | void acpi_os_delete_lock(acpi_spinlock handle); | 104 | void acpi_os_delete_lock(acpi_spinlock handle); |
102 | 105 | ||
103 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); | 106 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index f6ad63d25b73..2ed0a8486c19 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20110316 | 50 | #define ACPI_CA_VERSION 0x20110413 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 64f838beaabf..b67231bef632 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -501,8 +501,9 @@ typedef u64 acpi_integer; | |||
501 | #define ACPI_STATE_D1 (u8) 1 | 501 | #define ACPI_STATE_D1 (u8) 1 |
502 | #define ACPI_STATE_D2 (u8) 2 | 502 | #define ACPI_STATE_D2 (u8) 2 |
503 | #define ACPI_STATE_D3 (u8) 3 | 503 | #define ACPI_STATE_D3 (u8) 3 |
504 | #define ACPI_D_STATES_MAX ACPI_STATE_D3 | 504 | #define ACPI_STATE_D3_COLD (u8) 4 |
505 | #define ACPI_D_STATE_COUNT 4 | 505 | #define ACPI_D_STATES_MAX ACPI_STATE_D3_COLD |
506 | #define ACPI_D_STATE_COUNT 5 | ||
506 | 507 | ||
507 | #define ACPI_STATE_C0 (u8) 0 | 508 | #define ACPI_STATE_C0 (u8) 0 |
508 | #define ACPI_STATE_C1 (u8) 1 | 509 | #define ACPI_STATE_C1 (u8) 1 |
@@ -712,8 +713,24 @@ typedef u8 acpi_adr_space_type; | |||
712 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 | 713 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 |
713 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 | 714 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 |
714 | #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 | 715 | #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 |
715 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 8 | 716 | |
716 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 | 717 | #define ACPI_NUM_PREDEFINED_REGIONS 8 |
718 | |||
719 | /* | ||
720 | * Special Address Spaces | ||
721 | * | ||
722 | * Note: A Data Table region is a special type of operation region | ||
723 | * that has its own AML opcode. However, internally, the AML | ||
724 | * interpreter simply creates an operation region with an an address | ||
725 | * space type of ACPI_ADR_SPACE_DATA_TABLE. | ||
726 | */ | ||
727 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 0x7E /* Internal to ACPICA only */ | ||
728 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 0x7F | ||
729 | |||
730 | /* Values for _REG connection code */ | ||
731 | |||
732 | #define ACPI_REG_DISCONNECT 0 | ||
733 | #define ACPI_REG_CONNECT 1 | ||
717 | 734 | ||
718 | /* | 735 | /* |
719 | * bit_register IDs | 736 | * bit_register IDs |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 55192ac0cede..ba4928cae473 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -310,14 +310,7 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | |||
310 | 310 | ||
311 | /* in processor_core.c */ | 311 | /* in processor_core.c */ |
312 | void acpi_processor_set_pdc(acpi_handle handle); | 312 | void acpi_processor_set_pdc(acpi_handle handle); |
313 | #ifdef CONFIG_SMP | ||
314 | int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); | 313 | int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); |
315 | #else | ||
316 | static inline int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | ||
317 | { | ||
318 | return -1; | ||
319 | } | ||
320 | #endif | ||
321 | 314 | ||
322 | /* in processor_throttling.c */ | 315 | /* in processor_throttling.c */ |
323 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 316 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h index bcbab3e4a3be..89b73e5d0fd0 100644 --- a/include/asm-generic/audit_change_attr.h +++ b/include/asm-generic/audit_change_attr.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifdef __NR_chmod | ||
1 | __NR_chmod, | 2 | __NR_chmod, |
3 | #endif | ||
2 | __NR_fchmod, | 4 | __NR_fchmod, |
3 | #ifdef __NR_chown | 5 | #ifdef __NR_chown |
4 | __NR_chown, | 6 | __NR_chown, |
@@ -20,7 +22,9 @@ __NR_chown32, | |||
20 | __NR_fchown32, | 22 | __NR_fchown32, |
21 | __NR_lchown32, | 23 | __NR_lchown32, |
22 | #endif | 24 | #endif |
25 | #ifdef __NR_link | ||
23 | __NR_link, | 26 | __NR_link, |
27 | #endif | ||
24 | #ifdef __NR_linkat | 28 | #ifdef __NR_linkat |
25 | __NR_linkat, | 29 | __NR_linkat, |
26 | #endif | 30 | #endif |
diff --git a/include/asm-generic/audit_dir_write.h b/include/asm-generic/audit_dir_write.h index 6621bd82cbe8..7b61db4fe72b 100644 --- a/include/asm-generic/audit_dir_write.h +++ b/include/asm-generic/audit_dir_write.h | |||
@@ -1,13 +1,27 @@ | |||
1 | #ifdef __NR_rename | ||
1 | __NR_rename, | 2 | __NR_rename, |
3 | #endif | ||
4 | #ifdef __NR_mkdir | ||
2 | __NR_mkdir, | 5 | __NR_mkdir, |
6 | #endif | ||
7 | #ifdef __NR_rmdir | ||
3 | __NR_rmdir, | 8 | __NR_rmdir, |
9 | #endif | ||
4 | #ifdef __NR_creat | 10 | #ifdef __NR_creat |
5 | __NR_creat, | 11 | __NR_creat, |
6 | #endif | 12 | #endif |
13 | #ifdef __NR_link | ||
7 | __NR_link, | 14 | __NR_link, |
15 | #endif | ||
16 | #ifdef __NR_unlink | ||
8 | __NR_unlink, | 17 | __NR_unlink, |
18 | #endif | ||
19 | #ifdef __NR_symlink | ||
9 | __NR_symlink, | 20 | __NR_symlink, |
21 | #endif | ||
22 | #ifdef __NR_mknod | ||
10 | __NR_mknod, | 23 | __NR_mknod, |
24 | #endif | ||
11 | #ifdef __NR_mkdirat | 25 | #ifdef __NR_mkdirat |
12 | __NR_mkdirat, | 26 | __NR_mkdirat, |
13 | __NR_mknodat, | 27 | __NR_mknodat, |
diff --git a/include/asm-generic/audit_read.h b/include/asm-generic/audit_read.h index 0e87464d9847..3b249cb857dc 100644 --- a/include/asm-generic/audit_read.h +++ b/include/asm-generic/audit_read.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifdef __NR_readlink | ||
1 | __NR_readlink, | 2 | __NR_readlink, |
3 | #endif | ||
2 | __NR_quotactl, | 4 | __NR_quotactl, |
3 | __NR_listxattr, | 5 | __NR_listxattr, |
4 | __NR_llistxattr, | 6 | __NR_llistxattr, |
@@ -6,3 +8,6 @@ __NR_flistxattr, | |||
6 | __NR_getxattr, | 8 | __NR_getxattr, |
7 | __NR_lgetxattr, | 9 | __NR_lgetxattr, |
8 | __NR_fgetxattr, | 10 | __NR_fgetxattr, |
11 | #ifdef __NR_readlinkat | ||
12 | __NR_readlinkat, | ||
13 | #endif | ||
diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h index c5f1c2c920e2..e7020c57b13b 100644 --- a/include/asm-generic/audit_write.h +++ b/include/asm-generic/audit_write.h | |||
@@ -4,7 +4,9 @@ __NR_acct, | |||
4 | __NR_swapon, | 4 | __NR_swapon, |
5 | #endif | 5 | #endif |
6 | __NR_quotactl, | 6 | __NR_quotactl, |
7 | #ifdef __NR_truncate | ||
7 | __NR_truncate, | 8 | __NR_truncate, |
9 | #endif | ||
8 | #ifdef __NR_truncate64 | 10 | #ifdef __NR_truncate64 |
9 | __NR_truncate64, | 11 | __NR_truncate64, |
10 | #endif | 12 | #endif |
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h index 110fa700f853..71c778033f57 100644 --- a/include/asm-generic/bitops/find.h +++ b/include/asm-generic/bitops/find.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_FIND_H_ | 1 | #ifndef _ASM_GENERIC_BITOPS_FIND_H_ |
2 | #define _ASM_GENERIC_BITOPS_FIND_H_ | 2 | #define _ASM_GENERIC_BITOPS_FIND_H_ |
3 | 3 | ||
4 | #ifndef find_next_bit | ||
4 | /** | 5 | /** |
5 | * find_next_bit - find the next set bit in a memory region | 6 | * find_next_bit - find the next set bit in a memory region |
6 | * @addr: The address to base the search on | 7 | * @addr: The address to base the search on |
@@ -9,7 +10,9 @@ | |||
9 | */ | 10 | */ |
10 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | 11 | extern unsigned long find_next_bit(const unsigned long *addr, unsigned long |
11 | size, unsigned long offset); | 12 | size, unsigned long offset); |
13 | #endif | ||
12 | 14 | ||
15 | #ifndef find_next_zero_bit | ||
13 | /** | 16 | /** |
14 | * find_next_zero_bit - find the next cleared bit in a memory region | 17 | * find_next_zero_bit - find the next cleared bit in a memory region |
15 | * @addr: The address to base the search on | 18 | * @addr: The address to base the search on |
@@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long | |||
18 | */ | 21 | */ |
19 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned | 22 | extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned |
20 | long size, unsigned long offset); | 23 | long size, unsigned long offset); |
24 | #endif | ||
21 | 25 | ||
22 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT | 26 | #ifdef CONFIG_GENERIC_FIND_FIRST_BIT |
23 | 27 | ||
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h index 946a21b1b5dc..f95c663a6a41 100644 --- a/include/asm-generic/bitops/le.h +++ b/include/asm-generic/bitops/le.h | |||
@@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr, | |||
30 | 30 | ||
31 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) | 31 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
32 | 32 | ||
33 | #ifndef find_next_zero_bit_le | ||
33 | extern unsigned long find_next_zero_bit_le(const void *addr, | 34 | extern unsigned long find_next_zero_bit_le(const void *addr, |
34 | unsigned long size, unsigned long offset); | 35 | unsigned long size, unsigned long offset); |
36 | #endif | ||
37 | |||
38 | #ifndef find_next_bit_le | ||
35 | extern unsigned long find_next_bit_le(const void *addr, | 39 | extern unsigned long find_next_bit_le(const void *addr, |
36 | unsigned long size, unsigned long offset); | 40 | unsigned long size, unsigned long offset); |
41 | #endif | ||
37 | 42 | ||
43 | #ifndef find_first_zero_bit_le | ||
38 | #define find_first_zero_bit_le(addr, size) \ | 44 | #define find_first_zero_bit_le(addr, size) \ |
39 | find_next_zero_bit_le((addr), (size), 0) | 45 | find_next_zero_bit_le((addr), (size), 0) |
46 | #endif | ||
40 | 47 | ||
41 | #else | 48 | #else |
42 | #error "Please fix <asm/byteorder.h>" | 49 | #error "Please fix <asm/byteorder.h>" |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index e5a3f5880001..dfb0ec666c94 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -162,9 +162,6 @@ extern void warn_slowpath_null(const char *file, const int line); | |||
162 | unlikely(__ret_warn_once); \ | 162 | unlikely(__ret_warn_once); \ |
163 | }) | 163 | }) |
164 | 164 | ||
165 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
166 | WARN_ON((condition) && __ratelimit(state)) | ||
167 | |||
168 | /* | 165 | /* |
169 | * WARN_ON_SMP() is for cases that the warning is either | 166 | * WARN_ON_SMP() is for cases that the warning is either |
170 | * meaningless for !SMP or may even cause failures. | 167 | * meaningless for !SMP or may even cause failures. |
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index 57b5c3c82e86..87bc536ccde3 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h | |||
@@ -24,7 +24,10 @@ | |||
24 | #define flush_cache_vunmap(start, end) do { } while (0) | 24 | #define flush_cache_vunmap(start, end) do { } while (0) |
25 | 25 | ||
26 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 26 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ |
27 | memcpy(dst, src, len) | 27 | do { \ |
28 | memcpy(dst, src, len); \ | ||
29 | flush_icache_user_range(vma, page, vaddr, len); \ | ||
30 | } while (0) | ||
28 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 31 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
29 | memcpy(dst, src, len) | 32 | memcpy(dst, src, len) |
30 | 33 | ||
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index ff5c66080c8c..fcdcb5d5c995 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -35,9 +35,9 @@ | |||
35 | * platform data and other tables. | 35 | * platform data and other tables. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | static inline int gpio_is_valid(int number) | 38 | static inline bool gpio_is_valid(int number) |
39 | { | 39 | { |
40 | return ((unsigned)number) < ARCH_NR_GPIOS; | 40 | return number >= 0 && number < ARCH_NR_GPIOS; |
41 | } | 41 | } |
42 | 42 | ||
43 | struct device; | 43 | struct device; |
@@ -193,8 +193,8 @@ struct gpio { | |||
193 | }; | 193 | }; |
194 | 194 | ||
195 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | 195 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); |
196 | extern int gpio_request_array(struct gpio *array, size_t num); | 196 | extern int gpio_request_array(const struct gpio *array, size_t num); |
197 | extern void gpio_free_array(struct gpio *array, size_t num); | 197 | extern void gpio_free_array(const struct gpio *array, size_t num); |
198 | 198 | ||
199 | #ifdef CONFIG_GPIO_SYSFS | 199 | #ifdef CONFIG_GPIO_SYSFS |
200 | 200 | ||
@@ -212,7 +212,7 @@ extern void gpio_unexport(unsigned gpio); | |||
212 | 212 | ||
213 | #else /* !CONFIG_GPIOLIB */ | 213 | #else /* !CONFIG_GPIOLIB */ |
214 | 214 | ||
215 | static inline int gpio_is_valid(int number) | 215 | static inline bool gpio_is_valid(int number) |
216 | { | 216 | { |
217 | /* only non-negative numbers are valid */ | 217 | /* only non-negative numbers are valid */ |
218 | return number >= 0; | 218 | return number >= 0; |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index b4bfe338ea0e..e9b8e5926bef 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -184,22 +184,18 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
184 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ | 184 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
185 | #endif | 185 | #endif |
186 | 186 | ||
187 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY | 187 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY |
188 | #define page_test_dirty(page) (0) | 188 | #define page_test_and_clear_dirty(pfn, mapped) (0) |
189 | #endif | 189 | #endif |
190 | 190 | ||
191 | #ifndef __HAVE_ARCH_PAGE_CLEAR_DIRTY | 191 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY |
192 | #define page_clear_dirty(page, mapped) do { } while (0) | ||
193 | #endif | ||
194 | |||
195 | #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY | ||
196 | #define pte_maybe_dirty(pte) pte_dirty(pte) | 192 | #define pte_maybe_dirty(pte) pte_dirty(pte) |
197 | #else | 193 | #else |
198 | #define pte_maybe_dirty(pte) (1) | 194 | #define pte_maybe_dirty(pte) (1) |
199 | #endif | 195 | #endif |
200 | 196 | ||
201 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 197 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |
202 | #define page_test_and_clear_young(page) (0) | 198 | #define page_test_and_clear_young(pfn) (0) |
203 | #endif | 199 | #endif |
204 | 200 | ||
205 | #ifndef __HAVE_ARCH_PGD_OFFSET_GATE | 201 | #ifndef __HAVE_ARCH_PGD_OFFSET_GATE |
diff --git a/include/asm-generic/ptrace.h b/include/asm-generic/ptrace.h new file mode 100644 index 000000000000..82e674f6b337 --- /dev/null +++ b/include/asm-generic/ptrace.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Common low level (register) ptrace helpers | ||
3 | * | ||
4 | * Copyright 2004-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_GENERIC_PTRACE_H__ | ||
10 | #define __ASM_GENERIC_PTRACE_H__ | ||
11 | |||
12 | #ifndef __ASSEMBLY__ | ||
13 | |||
14 | /* Helpers for working with the instruction pointer */ | ||
15 | #ifndef GET_IP | ||
16 | #define GET_IP(regs) ((regs)->pc) | ||
17 | #endif | ||
18 | #ifndef SET_IP | ||
19 | #define SET_IP(regs, val) (GET_IP(regs) = (val)) | ||
20 | #endif | ||
21 | |||
22 | static inline unsigned long instruction_pointer(struct pt_regs *regs) | ||
23 | { | ||
24 | return GET_IP(regs); | ||
25 | } | ||
26 | static inline void instruction_pointer_set(struct pt_regs *regs, | ||
27 | unsigned long val) | ||
28 | { | ||
29 | SET_IP(regs, val); | ||
30 | } | ||
31 | |||
32 | #ifndef profile_pc | ||
33 | #define profile_pc(regs) instruction_pointer(regs) | ||
34 | #endif | ||
35 | |||
36 | /* Helpers for working with the user stack pointer */ | ||
37 | #ifndef GET_USP | ||
38 | #define GET_USP(regs) ((regs)->usp) | ||
39 | #endif | ||
40 | #ifndef SET_USP | ||
41 | #define SET_USP(regs, val) (GET_USP(regs) = (val)) | ||
42 | #endif | ||
43 | |||
44 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) | ||
45 | { | ||
46 | return GET_USP(regs); | ||
47 | } | ||
48 | static inline void user_stack_pointer_set(struct pt_regs *regs, | ||
49 | unsigned long val) | ||
50 | { | ||
51 | SET_USP(regs, val); | ||
52 | } | ||
53 | |||
54 | /* Helpers for working with the frame pointer */ | ||
55 | #ifndef GET_FP | ||
56 | #define GET_FP(regs) ((regs)->fp) | ||
57 | #endif | ||
58 | #ifndef SET_FP | ||
59 | #define SET_FP(regs, val) (GET_FP(regs) = (val)) | ||
60 | #endif | ||
61 | |||
62 | static inline unsigned long frame_pointer(struct pt_regs *regs) | ||
63 | { | ||
64 | return GET_FP(regs); | ||
65 | } | ||
66 | static inline void frame_pointer_set(struct pt_regs *regs, | ||
67 | unsigned long val) | ||
68 | { | ||
69 | SET_FP(regs, val); | ||
70 | } | ||
71 | |||
72 | #endif /* __ASSEMBLY__ */ | ||
73 | |||
74 | #endif | ||
diff --git a/include/asm-generic/resource.h b/include/asm-generic/resource.h index 587566f95f6c..61fa862fe08d 100644 --- a/include/asm-generic/resource.h +++ b/include/asm-generic/resource.h | |||
@@ -78,7 +78,7 @@ | |||
78 | [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ | 78 | [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ |
79 | [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 79 | [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
80 | [RLIMIT_NPROC] = { 0, 0 }, \ | 80 | [RLIMIT_NPROC] = { 0, 0 }, \ |
81 | [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \ | 81 | [RLIMIT_NOFILE] = { INR_OPEN_CUR, INR_OPEN_MAX }, \ |
82 | [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ | 82 | [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ |
83 | [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 83 | [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
84 | [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ | 84 | [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index e43f9766259f..e58fa777fa09 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -5,6 +5,8 @@ | |||
5 | * Copyright 2001 Red Hat, Inc. | 5 | * Copyright 2001 Red Hat, Inc. |
6 | * Based on code from mm/memory.c Copyright Linus Torvalds and others. | 6 | * Based on code from mm/memory.c Copyright Linus Torvalds and others. |
7 | * | 7 | * |
8 | * Copyright 2011 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> | ||
9 | * | ||
8 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
10 | * as published by the Free Software Foundation; either version | 12 | * as published by the Free Software Foundation; either version |
@@ -17,97 +19,111 @@ | |||
17 | #include <asm/pgalloc.h> | 19 | #include <asm/pgalloc.h> |
18 | #include <asm/tlbflush.h> | 20 | #include <asm/tlbflush.h> |
19 | 21 | ||
22 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE | ||
20 | /* | 23 | /* |
21 | * For UP we don't need to worry about TLB flush | 24 | * Semi RCU freeing of the page directories. |
22 | * and page free order so much.. | 25 | * |
26 | * This is needed by some architectures to implement software pagetable walkers. | ||
27 | * | ||
28 | * gup_fast() and other software pagetable walkers do a lockless page-table | ||
29 | * walk and therefore needs some synchronization with the freeing of the page | ||
30 | * directories. The chosen means to accomplish that is by disabling IRQs over | ||
31 | * the walk. | ||
32 | * | ||
33 | * Architectures that use IPIs to flush TLBs will then automagically DTRT, | ||
34 | * since we unlink the page, flush TLBs, free the page. Since the disabling of | ||
35 | * IRQs delays the completion of the TLB flush we can never observe an already | ||
36 | * freed page. | ||
37 | * | ||
38 | * Architectures that do not have this (PPC) need to delay the freeing by some | ||
39 | * other means, this is that means. | ||
40 | * | ||
41 | * What we do is batch the freed directory pages (tables) and RCU free them. | ||
42 | * We use the sched RCU variant, as that guarantees that IRQ/preempt disabling | ||
43 | * holds off grace periods. | ||
44 | * | ||
45 | * However, in order to batch these pages we need to allocate storage, this | ||
46 | * allocation is deep inside the MM code and can thus easily fail on memory | ||
47 | * pressure. To guarantee progress we fall back to single table freeing, see | ||
48 | * the implementation of tlb_remove_table_one(). | ||
49 | * | ||
23 | */ | 50 | */ |
24 | #ifdef CONFIG_SMP | 51 | struct mmu_table_batch { |
25 | #ifdef ARCH_FREE_PTR_NR | 52 | struct rcu_head rcu; |
26 | #define FREE_PTR_NR ARCH_FREE_PTR_NR | 53 | unsigned int nr; |
27 | #else | 54 | void *tables[0]; |
28 | #define FREE_PTE_NR 506 | 55 | }; |
29 | #endif | 56 | |
30 | #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) | 57 | #define MAX_TABLE_BATCH \ |
31 | #else | 58 | ((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *)) |
32 | #define FREE_PTE_NR 1 | 59 | |
33 | #define tlb_fast_mode(tlb) 1 | 60 | extern void tlb_table_flush(struct mmu_gather *tlb); |
61 | extern void tlb_remove_table(struct mmu_gather *tlb, void *table); | ||
62 | |||
34 | #endif | 63 | #endif |
35 | 64 | ||
36 | /* struct mmu_gather is an opaque type used by the mm code for passing around | 65 | /* |
37 | * any data needed by arch specific code for tlb_remove_page. | 66 | * If we can't allocate a page to make a big batch of page pointers |
67 | * to work on, then just handle a few from the on-stack structure. | ||
38 | */ | 68 | */ |
39 | struct mmu_gather { | 69 | #define MMU_GATHER_BUNDLE 8 |
40 | struct mm_struct *mm; | 70 | |
41 | unsigned int nr; /* set to ~0U means fast mode */ | 71 | struct mmu_gather_batch { |
42 | unsigned int need_flush;/* Really unmapped some ptes? */ | 72 | struct mmu_gather_batch *next; |
43 | unsigned int fullmm; /* non-zero means full mm flush */ | 73 | unsigned int nr; |
44 | struct page * pages[FREE_PTE_NR]; | 74 | unsigned int max; |
75 | struct page *pages[0]; | ||
45 | }; | 76 | }; |
46 | 77 | ||
47 | /* Users of the generic TLB shootdown code must declare this storage space. */ | 78 | #define MAX_GATHER_BATCH \ |
48 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | 79 | ((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *)) |
49 | 80 | ||
50 | /* tlb_gather_mmu | 81 | /* struct mmu_gather is an opaque type used by the mm code for passing around |
51 | * Return a pointer to an initialized struct mmu_gather. | 82 | * any data needed by arch specific code for tlb_remove_page. |
52 | */ | 83 | */ |
53 | static inline struct mmu_gather * | 84 | struct mmu_gather { |
54 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 85 | struct mm_struct *mm; |
55 | { | 86 | #ifdef CONFIG_HAVE_RCU_TABLE_FREE |
56 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); | 87 | struct mmu_table_batch *batch; |
57 | 88 | #endif | |
58 | tlb->mm = mm; | 89 | unsigned int need_flush : 1, /* Did free PTEs */ |
90 | fast_mode : 1; /* No batching */ | ||
59 | 91 | ||
60 | /* Use fast mode if only one CPU is online */ | 92 | unsigned int fullmm; |
61 | tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; | ||
62 | 93 | ||
63 | tlb->fullmm = full_mm_flush; | 94 | struct mmu_gather_batch *active; |
95 | struct mmu_gather_batch local; | ||
96 | struct page *__pages[MMU_GATHER_BUNDLE]; | ||
97 | }; | ||
64 | 98 | ||
65 | return tlb; | 99 | #define HAVE_GENERIC_MMU_GATHER |
66 | } | ||
67 | 100 | ||
68 | static inline void | 101 | static inline int tlb_fast_mode(struct mmu_gather *tlb) |
69 | tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
70 | { | 102 | { |
71 | if (!tlb->need_flush) | 103 | #ifdef CONFIG_SMP |
72 | return; | 104 | return tlb->fast_mode; |
73 | tlb->need_flush = 0; | 105 | #else |
74 | tlb_flush(tlb); | 106 | /* |
75 | if (!tlb_fast_mode(tlb)) { | 107 | * For UP we don't need to worry about TLB flush |
76 | free_pages_and_swap_cache(tlb->pages, tlb->nr); | 108 | * and page free order so much.. |
77 | tlb->nr = 0; | 109 | */ |
78 | } | 110 | return 1; |
111 | #endif | ||
79 | } | 112 | } |
80 | 113 | ||
81 | /* tlb_finish_mmu | 114 | void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); |
82 | * Called at the end of the shootdown operation to free up any resources | 115 | void tlb_flush_mmu(struct mmu_gather *tlb); |
83 | * that were required. | 116 | void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end); |
84 | */ | 117 | int __tlb_remove_page(struct mmu_gather *tlb, struct page *page); |
85 | static inline void | ||
86 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
87 | { | ||
88 | tlb_flush_mmu(tlb, start, end); | ||
89 | |||
90 | /* keep the page table cache within bounds */ | ||
91 | check_pgt_cache(); | ||
92 | |||
93 | put_cpu_var(mmu_gathers); | ||
94 | } | ||
95 | 118 | ||
96 | /* tlb_remove_page | 119 | /* tlb_remove_page |
97 | * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while | 120 | * Similar to __tlb_remove_page but will call tlb_flush_mmu() itself when |
98 | * handling the additional races in SMP caused by other CPUs caching valid | 121 | * required. |
99 | * mappings in their TLBs. | ||
100 | */ | 122 | */ |
101 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | 123 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) |
102 | { | 124 | { |
103 | tlb->need_flush = 1; | 125 | if (!__tlb_remove_page(tlb, page)) |
104 | if (tlb_fast_mode(tlb)) { | 126 | tlb_flush_mmu(tlb); |
105 | free_page_and_swap_cache(page); | ||
106 | return; | ||
107 | } | ||
108 | tlb->pages[tlb->nr++] = page; | ||
109 | if (tlb->nr >= FREE_PTE_NR) | ||
110 | tlb_flush_mmu(tlb, 0, 0); | ||
111 | } | 127 | } |
112 | 128 | ||
113 | /** | 129 | /** |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 07c40d5149de..4f76959397fa 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -24,16 +24,24 @@ | |||
24 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64) | 24 | #define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64) |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #ifdef __SYSCALL_COMPAT | ||
28 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _comp) | ||
29 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SYSCALL(_nr, _comp) | ||
30 | #else | ||
31 | #define __SC_COMP(_nr, _sys, _comp) __SYSCALL(_nr, _sys) | ||
32 | #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64) | ||
33 | #endif | ||
34 | |||
27 | #define __NR_io_setup 0 | 35 | #define __NR_io_setup 0 |
28 | __SYSCALL(__NR_io_setup, sys_io_setup) | 36 | __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup) |
29 | #define __NR_io_destroy 1 | 37 | #define __NR_io_destroy 1 |
30 | __SYSCALL(__NR_io_destroy, sys_io_destroy) | 38 | __SYSCALL(__NR_io_destroy, sys_io_destroy) |
31 | #define __NR_io_submit 2 | 39 | #define __NR_io_submit 2 |
32 | __SYSCALL(__NR_io_submit, sys_io_submit) | 40 | __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit) |
33 | #define __NR_io_cancel 3 | 41 | #define __NR_io_cancel 3 |
34 | __SYSCALL(__NR_io_cancel, sys_io_cancel) | 42 | __SYSCALL(__NR_io_cancel, sys_io_cancel) |
35 | #define __NR_io_getevents 4 | 43 | #define __NR_io_getevents 4 |
36 | __SYSCALL(__NR_io_getevents, sys_io_getevents) | 44 | __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents) |
37 | 45 | ||
38 | /* fs/xattr.c */ | 46 | /* fs/xattr.c */ |
39 | #define __NR_setxattr 5 | 47 | #define __NR_setxattr 5 |
@@ -67,7 +75,7 @@ __SYSCALL(__NR_getcwd, sys_getcwd) | |||
67 | 75 | ||
68 | /* fs/cookies.c */ | 76 | /* fs/cookies.c */ |
69 | #define __NR_lookup_dcookie 18 | 77 | #define __NR_lookup_dcookie 18 |
70 | __SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie) | 78 | __SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie) |
71 | 79 | ||
72 | /* fs/eventfd.c */ | 80 | /* fs/eventfd.c */ |
73 | #define __NR_eventfd2 19 | 81 | #define __NR_eventfd2 19 |
@@ -79,7 +87,7 @@ __SYSCALL(__NR_epoll_create1, sys_epoll_create1) | |||
79 | #define __NR_epoll_ctl 21 | 87 | #define __NR_epoll_ctl 21 |
80 | __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) | 88 | __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) |
81 | #define __NR_epoll_pwait 22 | 89 | #define __NR_epoll_pwait 22 |
82 | __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) | 90 | __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait) |
83 | 91 | ||
84 | /* fs/fcntl.c */ | 92 | /* fs/fcntl.c */ |
85 | #define __NR_dup 23 | 93 | #define __NR_dup 23 |
@@ -87,7 +95,7 @@ __SYSCALL(__NR_dup, sys_dup) | |||
87 | #define __NR_dup3 24 | 95 | #define __NR_dup3 24 |
88 | __SYSCALL(__NR_dup3, sys_dup3) | 96 | __SYSCALL(__NR_dup3, sys_dup3) |
89 | #define __NR3264_fcntl 25 | 97 | #define __NR3264_fcntl 25 |
90 | __SC_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl) | 98 | __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64) |
91 | 99 | ||
92 | /* fs/inotify_user.c */ | 100 | /* fs/inotify_user.c */ |
93 | #define __NR_inotify_init1 26 | 101 | #define __NR_inotify_init1 26 |
@@ -99,7 +107,7 @@ __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) | |||
99 | 107 | ||
100 | /* fs/ioctl.c */ | 108 | /* fs/ioctl.c */ |
101 | #define __NR_ioctl 29 | 109 | #define __NR_ioctl 29 |
102 | __SYSCALL(__NR_ioctl, sys_ioctl) | 110 | __SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl) |
103 | 111 | ||
104 | /* fs/ioprio.c */ | 112 | /* fs/ioprio.c */ |
105 | #define __NR_ioprio_set 30 | 113 | #define __NR_ioprio_set 30 |
@@ -129,26 +137,30 @@ __SYSCALL(__NR_renameat, sys_renameat) | |||
129 | #define __NR_umount2 39 | 137 | #define __NR_umount2 39 |
130 | __SYSCALL(__NR_umount2, sys_umount) | 138 | __SYSCALL(__NR_umount2, sys_umount) |
131 | #define __NR_mount 40 | 139 | #define __NR_mount 40 |
132 | __SYSCALL(__NR_mount, sys_mount) | 140 | __SC_COMP(__NR_mount, sys_mount, compat_sys_mount) |
133 | #define __NR_pivot_root 41 | 141 | #define __NR_pivot_root 41 |
134 | __SYSCALL(__NR_pivot_root, sys_pivot_root) | 142 | __SYSCALL(__NR_pivot_root, sys_pivot_root) |
135 | 143 | ||
136 | /* fs/nfsctl.c */ | 144 | /* fs/nfsctl.c */ |
137 | #define __NR_nfsservctl 42 | 145 | #define __NR_nfsservctl 42 |
138 | __SYSCALL(__NR_nfsservctl, sys_nfsservctl) | 146 | __SC_COMP(__NR_nfsservctl, sys_nfsservctl, compat_sys_nfsservctl) |
139 | 147 | ||
140 | /* fs/open.c */ | 148 | /* fs/open.c */ |
141 | #define __NR3264_statfs 43 | 149 | #define __NR3264_statfs 43 |
142 | __SC_3264(__NR3264_statfs, sys_statfs64, sys_statfs) | 150 | __SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \ |
151 | compat_sys_statfs64) | ||
143 | #define __NR3264_fstatfs 44 | 152 | #define __NR3264_fstatfs 44 |
144 | __SC_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs) | 153 | __SC_COMP_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs, \ |
154 | compat_sys_fstatfs64) | ||
145 | #define __NR3264_truncate 45 | 155 | #define __NR3264_truncate 45 |
146 | __SC_3264(__NR3264_truncate, sys_truncate64, sys_truncate) | 156 | __SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \ |
157 | compat_sys_truncate64) | ||
147 | #define __NR3264_ftruncate 46 | 158 | #define __NR3264_ftruncate 46 |
148 | __SC_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate) | 159 | __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \ |
160 | compat_sys_ftruncate64) | ||
149 | 161 | ||
150 | #define __NR_fallocate 47 | 162 | #define __NR_fallocate 47 |
151 | __SYSCALL(__NR_fallocate, sys_fallocate) | 163 | __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate) |
152 | #define __NR_faccessat 48 | 164 | #define __NR_faccessat 48 |
153 | __SYSCALL(__NR_faccessat, sys_faccessat) | 165 | __SYSCALL(__NR_faccessat, sys_faccessat) |
154 | #define __NR_chdir 49 | 166 | #define __NR_chdir 49 |
@@ -166,7 +178,7 @@ __SYSCALL(__NR_fchownat, sys_fchownat) | |||
166 | #define __NR_fchown 55 | 178 | #define __NR_fchown 55 |
167 | __SYSCALL(__NR_fchown, sys_fchown) | 179 | __SYSCALL(__NR_fchown, sys_fchown) |
168 | #define __NR_openat 56 | 180 | #define __NR_openat 56 |
169 | __SYSCALL(__NR_openat, sys_openat) | 181 | __SC_COMP(__NR_openat, sys_openat, compat_sys_openat) |
170 | #define __NR_close 57 | 182 | #define __NR_close 57 |
171 | __SYSCALL(__NR_close, sys_close) | 183 | __SYSCALL(__NR_close, sys_close) |
172 | #define __NR_vhangup 58 | 184 | #define __NR_vhangup 58 |
@@ -182,7 +194,7 @@ __SYSCALL(__NR_quotactl, sys_quotactl) | |||
182 | 194 | ||
183 | /* fs/readdir.c */ | 195 | /* fs/readdir.c */ |
184 | #define __NR_getdents64 61 | 196 | #define __NR_getdents64 61 |
185 | __SYSCALL(__NR_getdents64, sys_getdents64) | 197 | __SC_COMP(__NR_getdents64, sys_getdents64, compat_sys_getdents64) |
186 | 198 | ||
187 | /* fs/read_write.c */ | 199 | /* fs/read_write.c */ |
188 | #define __NR3264_lseek 62 | 200 | #define __NR3264_lseek 62 |
@@ -192,17 +204,17 @@ __SYSCALL(__NR_read, sys_read) | |||
192 | #define __NR_write 64 | 204 | #define __NR_write 64 |
193 | __SYSCALL(__NR_write, sys_write) | 205 | __SYSCALL(__NR_write, sys_write) |
194 | #define __NR_readv 65 | 206 | #define __NR_readv 65 |
195 | __SYSCALL(__NR_readv, sys_readv) | 207 | __SC_COMP(__NR_readv, sys_readv, compat_sys_readv) |
196 | #define __NR_writev 66 | 208 | #define __NR_writev 66 |
197 | __SYSCALL(__NR_writev, sys_writev) | 209 | __SC_COMP(__NR_writev, sys_writev, compat_sys_writev) |
198 | #define __NR_pread64 67 | 210 | #define __NR_pread64 67 |
199 | __SYSCALL(__NR_pread64, sys_pread64) | 211 | __SC_COMP(__NR_pread64, sys_pread64, compat_sys_pread64) |
200 | #define __NR_pwrite64 68 | 212 | #define __NR_pwrite64 68 |
201 | __SYSCALL(__NR_pwrite64, sys_pwrite64) | 213 | __SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64) |
202 | #define __NR_preadv 69 | 214 | #define __NR_preadv 69 |
203 | __SYSCALL(__NR_preadv, sys_preadv) | 215 | __SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv) |
204 | #define __NR_pwritev 70 | 216 | #define __NR_pwritev 70 |
205 | __SYSCALL(__NR_pwritev, sys_pwritev) | 217 | __SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev) |
206 | 218 | ||
207 | /* fs/sendfile.c */ | 219 | /* fs/sendfile.c */ |
208 | #define __NR3264_sendfile 71 | 220 | #define __NR3264_sendfile 71 |
@@ -210,17 +222,17 @@ __SC_3264(__NR3264_sendfile, sys_sendfile64, sys_sendfile) | |||
210 | 222 | ||
211 | /* fs/select.c */ | 223 | /* fs/select.c */ |
212 | #define __NR_pselect6 72 | 224 | #define __NR_pselect6 72 |
213 | __SYSCALL(__NR_pselect6, sys_pselect6) | 225 | __SC_COMP(__NR_pselect6, sys_pselect6, compat_sys_pselect6) |
214 | #define __NR_ppoll 73 | 226 | #define __NR_ppoll 73 |
215 | __SYSCALL(__NR_ppoll, sys_ppoll) | 227 | __SC_COMP(__NR_ppoll, sys_ppoll, compat_sys_ppoll) |
216 | 228 | ||
217 | /* fs/signalfd.c */ | 229 | /* fs/signalfd.c */ |
218 | #define __NR_signalfd4 74 | 230 | #define __NR_signalfd4 74 |
219 | __SYSCALL(__NR_signalfd4, sys_signalfd4) | 231 | __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4) |
220 | 232 | ||
221 | /* fs/splice.c */ | 233 | /* fs/splice.c */ |
222 | #define __NR_vmsplice 75 | 234 | #define __NR_vmsplice 75 |
223 | __SYSCALL(__NR_vmsplice, sys_vmsplice) | 235 | __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice) |
224 | #define __NR_splice 76 | 236 | #define __NR_splice 76 |
225 | __SYSCALL(__NR_splice, sys_splice) | 237 | __SYSCALL(__NR_splice, sys_splice) |
226 | #define __NR_tee 77 | 238 | #define __NR_tee 77 |
@@ -243,23 +255,27 @@ __SYSCALL(__NR_fsync, sys_fsync) | |||
243 | __SYSCALL(__NR_fdatasync, sys_fdatasync) | 255 | __SYSCALL(__NR_fdatasync, sys_fdatasync) |
244 | #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 | 256 | #ifdef __ARCH_WANT_SYNC_FILE_RANGE2 |
245 | #define __NR_sync_file_range2 84 | 257 | #define __NR_sync_file_range2 84 |
246 | __SYSCALL(__NR_sync_file_range2, sys_sync_file_range2) | 258 | __SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \ |
259 | compat_sys_sync_file_range2) | ||
247 | #else | 260 | #else |
248 | #define __NR_sync_file_range 84 | 261 | #define __NR_sync_file_range 84 |
249 | __SYSCALL(__NR_sync_file_range, sys_sync_file_range) | 262 | __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \ |
263 | compat_sys_sync_file_range) | ||
250 | #endif | 264 | #endif |
251 | 265 | ||
252 | /* fs/timerfd.c */ | 266 | /* fs/timerfd.c */ |
253 | #define __NR_timerfd_create 85 | 267 | #define __NR_timerfd_create 85 |
254 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) | 268 | __SYSCALL(__NR_timerfd_create, sys_timerfd_create) |
255 | #define __NR_timerfd_settime 86 | 269 | #define __NR_timerfd_settime 86 |
256 | __SYSCALL(__NR_timerfd_settime, sys_timerfd_settime) | 270 | __SC_COMP(__NR_timerfd_settime, sys_timerfd_settime, \ |
271 | compat_sys_timerfd_settime) | ||
257 | #define __NR_timerfd_gettime 87 | 272 | #define __NR_timerfd_gettime 87 |
258 | __SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime) | 273 | __SC_COMP(__NR_timerfd_gettime, sys_timerfd_gettime, \ |
274 | compat_sys_timerfd_gettime) | ||
259 | 275 | ||
260 | /* fs/utimes.c */ | 276 | /* fs/utimes.c */ |
261 | #define __NR_utimensat 88 | 277 | #define __NR_utimensat 88 |
262 | __SYSCALL(__NR_utimensat, sys_utimensat) | 278 | __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat) |
263 | 279 | ||
264 | /* kernel/acct.c */ | 280 | /* kernel/acct.c */ |
265 | #define __NR_acct 89 | 281 | #define __NR_acct 89 |
@@ -281,7 +297,7 @@ __SYSCALL(__NR_exit, sys_exit) | |||
281 | #define __NR_exit_group 94 | 297 | #define __NR_exit_group 94 |
282 | __SYSCALL(__NR_exit_group, sys_exit_group) | 298 | __SYSCALL(__NR_exit_group, sys_exit_group) |
283 | #define __NR_waitid 95 | 299 | #define __NR_waitid 95 |
284 | __SYSCALL(__NR_waitid, sys_waitid) | 300 | __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid) |
285 | 301 | ||
286 | /* kernel/fork.c */ | 302 | /* kernel/fork.c */ |
287 | #define __NR_set_tid_address 96 | 303 | #define __NR_set_tid_address 96 |
@@ -291,25 +307,27 @@ __SYSCALL(__NR_unshare, sys_unshare) | |||
291 | 307 | ||
292 | /* kernel/futex.c */ | 308 | /* kernel/futex.c */ |
293 | #define __NR_futex 98 | 309 | #define __NR_futex 98 |
294 | __SYSCALL(__NR_futex, sys_futex) | 310 | __SC_COMP(__NR_futex, sys_futex, compat_sys_futex) |
295 | #define __NR_set_robust_list 99 | 311 | #define __NR_set_robust_list 99 |
296 | __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | 312 | __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \ |
313 | compat_sys_set_robust_list) | ||
297 | #define __NR_get_robust_list 100 | 314 | #define __NR_get_robust_list 100 |
298 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | 315 | __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \ |
316 | compat_sys_get_robust_list) | ||
299 | 317 | ||
300 | /* kernel/hrtimer.c */ | 318 | /* kernel/hrtimer.c */ |
301 | #define __NR_nanosleep 101 | 319 | #define __NR_nanosleep 101 |
302 | __SYSCALL(__NR_nanosleep, sys_nanosleep) | 320 | __SC_COMP(__NR_nanosleep, sys_nanosleep, compat_sys_nanosleep) |
303 | 321 | ||
304 | /* kernel/itimer.c */ | 322 | /* kernel/itimer.c */ |
305 | #define __NR_getitimer 102 | 323 | #define __NR_getitimer 102 |
306 | __SYSCALL(__NR_getitimer, sys_getitimer) | 324 | __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer) |
307 | #define __NR_setitimer 103 | 325 | #define __NR_setitimer 103 |
308 | __SYSCALL(__NR_setitimer, sys_setitimer) | 326 | __SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer) |
309 | 327 | ||
310 | /* kernel/kexec.c */ | 328 | /* kernel/kexec.c */ |
311 | #define __NR_kexec_load 104 | 329 | #define __NR_kexec_load 104 |
312 | __SYSCALL(__NR_kexec_load, sys_kexec_load) | 330 | __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load) |
313 | 331 | ||
314 | /* kernel/module.c */ | 332 | /* kernel/module.c */ |
315 | #define __NR_init_module 105 | 333 | #define __NR_init_module 105 |
@@ -319,23 +337,24 @@ __SYSCALL(__NR_delete_module, sys_delete_module) | |||
319 | 337 | ||
320 | /* kernel/posix-timers.c */ | 338 | /* kernel/posix-timers.c */ |
321 | #define __NR_timer_create 107 | 339 | #define __NR_timer_create 107 |
322 | __SYSCALL(__NR_timer_create, sys_timer_create) | 340 | __SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create) |
323 | #define __NR_timer_gettime 108 | 341 | #define __NR_timer_gettime 108 |
324 | __SYSCALL(__NR_timer_gettime, sys_timer_gettime) | 342 | __SC_COMP(__NR_timer_gettime, sys_timer_gettime, compat_sys_timer_gettime) |
325 | #define __NR_timer_getoverrun 109 | 343 | #define __NR_timer_getoverrun 109 |
326 | __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) | 344 | __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) |
327 | #define __NR_timer_settime 110 | 345 | #define __NR_timer_settime 110 |
328 | __SYSCALL(__NR_timer_settime, sys_timer_settime) | 346 | __SC_COMP(__NR_timer_settime, sys_timer_settime, compat_sys_timer_settime) |
329 | #define __NR_timer_delete 111 | 347 | #define __NR_timer_delete 111 |
330 | __SYSCALL(__NR_timer_delete, sys_timer_delete) | 348 | __SYSCALL(__NR_timer_delete, sys_timer_delete) |
331 | #define __NR_clock_settime 112 | 349 | #define __NR_clock_settime 112 |
332 | __SYSCALL(__NR_clock_settime, sys_clock_settime) | 350 | __SC_COMP(__NR_clock_settime, sys_clock_settime, compat_sys_clock_settime) |
333 | #define __NR_clock_gettime 113 | 351 | #define __NR_clock_gettime 113 |
334 | __SYSCALL(__NR_clock_gettime, sys_clock_gettime) | 352 | __SC_COMP(__NR_clock_gettime, sys_clock_gettime, compat_sys_clock_gettime) |
335 | #define __NR_clock_getres 114 | 353 | #define __NR_clock_getres 114 |
336 | __SYSCALL(__NR_clock_getres, sys_clock_getres) | 354 | __SC_COMP(__NR_clock_getres, sys_clock_getres, compat_sys_clock_getres) |
337 | #define __NR_clock_nanosleep 115 | 355 | #define __NR_clock_nanosleep 115 |
338 | __SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep) | 356 | __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \ |
357 | compat_sys_clock_nanosleep) | ||
339 | 358 | ||
340 | /* kernel/printk.c */ | 359 | /* kernel/printk.c */ |
341 | #define __NR_syslog 116 | 360 | #define __NR_syslog 116 |
@@ -355,9 +374,11 @@ __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler) | |||
355 | #define __NR_sched_getparam 121 | 374 | #define __NR_sched_getparam 121 |
356 | __SYSCALL(__NR_sched_getparam, sys_sched_getparam) | 375 | __SYSCALL(__NR_sched_getparam, sys_sched_getparam) |
357 | #define __NR_sched_setaffinity 122 | 376 | #define __NR_sched_setaffinity 122 |
358 | __SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity) | 377 | __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \ |
378 | compat_sys_sched_setaffinity) | ||
359 | #define __NR_sched_getaffinity 123 | 379 | #define __NR_sched_getaffinity 123 |
360 | __SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity) | 380 | __SC_COMP(__NR_sched_getaffinity, sys_sched_getaffinity, \ |
381 | compat_sys_sched_getaffinity) | ||
361 | #define __NR_sched_yield 124 | 382 | #define __NR_sched_yield 124 |
362 | __SYSCALL(__NR_sched_yield, sys_sched_yield) | 383 | __SYSCALL(__NR_sched_yield, sys_sched_yield) |
363 | #define __NR_sched_get_priority_max 125 | 384 | #define __NR_sched_get_priority_max 125 |
@@ -365,7 +386,8 @@ __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max) | |||
365 | #define __NR_sched_get_priority_min 126 | 386 | #define __NR_sched_get_priority_min 126 |
366 | __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) | 387 | __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) |
367 | #define __NR_sched_rr_get_interval 127 | 388 | #define __NR_sched_rr_get_interval 127 |
368 | __SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval) | 389 | __SC_COMP(__NR_sched_rr_get_interval, sys_sched_rr_get_interval, \ |
390 | compat_sys_sched_rr_get_interval) | ||
369 | 391 | ||
370 | /* kernel/signal.c */ | 392 | /* kernel/signal.c */ |
371 | #define __NR_restart_syscall 128 | 393 | #define __NR_restart_syscall 128 |
@@ -377,21 +399,23 @@ __SYSCALL(__NR_tkill, sys_tkill) | |||
377 | #define __NR_tgkill 131 | 399 | #define __NR_tgkill 131 |
378 | __SYSCALL(__NR_tgkill, sys_tgkill) | 400 | __SYSCALL(__NR_tgkill, sys_tgkill) |
379 | #define __NR_sigaltstack 132 | 401 | #define __NR_sigaltstack 132 |
380 | __SYSCALL(__NR_sigaltstack, sys_sigaltstack) | 402 | __SC_COMP(__NR_sigaltstack, sys_sigaltstack, compat_sys_sigaltstack) |
381 | #define __NR_rt_sigsuspend 133 | 403 | #define __NR_rt_sigsuspend 133 |
382 | __SYSCALL(__NR_rt_sigsuspend, sys_rt_sigsuspend) /* __ARCH_WANT_SYS_RT_SIGSUSPEND */ | 404 | __SC_COMP(__NR_rt_sigsuspend, sys_rt_sigsuspend, compat_sys_rt_sigsuspend) |
383 | #define __NR_rt_sigaction 134 | 405 | #define __NR_rt_sigaction 134 |
384 | __SYSCALL(__NR_rt_sigaction, sys_rt_sigaction) /* __ARCH_WANT_SYS_RT_SIGACTION */ | 406 | __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction) |
385 | #define __NR_rt_sigprocmask 135 | 407 | #define __NR_rt_sigprocmask 135 |
386 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) | 408 | __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) |
387 | #define __NR_rt_sigpending 136 | 409 | #define __NR_rt_sigpending 136 |
388 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) | 410 | __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) |
389 | #define __NR_rt_sigtimedwait 137 | 411 | #define __NR_rt_sigtimedwait 137 |
390 | __SYSCALL(__NR_rt_sigtimedwait, sys_rt_sigtimedwait) | 412 | __SC_COMP(__NR_rt_sigtimedwait, sys_rt_sigtimedwait, \ |
413 | compat_sys_rt_sigtimedwait) | ||
391 | #define __NR_rt_sigqueueinfo 138 | 414 | #define __NR_rt_sigqueueinfo 138 |
392 | __SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo) | 415 | __SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \ |
416 | compat_sys_rt_sigqueueinfo) | ||
393 | #define __NR_rt_sigreturn 139 | 417 | #define __NR_rt_sigreturn 139 |
394 | __SYSCALL(__NR_rt_sigreturn, sys_rt_sigreturn) /* sys_rt_sigreturn_wrapper, */ | 418 | __SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn) |
395 | 419 | ||
396 | /* kernel/sys.c */ | 420 | /* kernel/sys.c */ |
397 | #define __NR_setpriority 140 | 421 | #define __NR_setpriority 140 |
@@ -421,7 +445,7 @@ __SYSCALL(__NR_setfsuid, sys_setfsuid) | |||
421 | #define __NR_setfsgid 152 | 445 | #define __NR_setfsgid 152 |
422 | __SYSCALL(__NR_setfsgid, sys_setfsgid) | 446 | __SYSCALL(__NR_setfsgid, sys_setfsgid) |
423 | #define __NR_times 153 | 447 | #define __NR_times 153 |
424 | __SYSCALL(__NR_times, sys_times) | 448 | __SC_COMP(__NR_times, sys_times, compat_sys_times) |
425 | #define __NR_setpgid 154 | 449 | #define __NR_setpgid 154 |
426 | __SYSCALL(__NR_setpgid, sys_setpgid) | 450 | __SYSCALL(__NR_setpgid, sys_setpgid) |
427 | #define __NR_getpgid 155 | 451 | #define __NR_getpgid 155 |
@@ -441,11 +465,11 @@ __SYSCALL(__NR_sethostname, sys_sethostname) | |||
441 | #define __NR_setdomainname 162 | 465 | #define __NR_setdomainname 162 |
442 | __SYSCALL(__NR_setdomainname, sys_setdomainname) | 466 | __SYSCALL(__NR_setdomainname, sys_setdomainname) |
443 | #define __NR_getrlimit 163 | 467 | #define __NR_getrlimit 163 |
444 | __SYSCALL(__NR_getrlimit, sys_getrlimit) | 468 | __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit) |
445 | #define __NR_setrlimit 164 | 469 | #define __NR_setrlimit 164 |
446 | __SYSCALL(__NR_setrlimit, sys_setrlimit) | 470 | __SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit) |
447 | #define __NR_getrusage 165 | 471 | #define __NR_getrusage 165 |
448 | __SYSCALL(__NR_getrusage, sys_getrusage) | 472 | __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage) |
449 | #define __NR_umask 166 | 473 | #define __NR_umask 166 |
450 | __SYSCALL(__NR_umask, sys_umask) | 474 | __SYSCALL(__NR_umask, sys_umask) |
451 | #define __NR_prctl 167 | 475 | #define __NR_prctl 167 |
@@ -455,11 +479,11 @@ __SYSCALL(__NR_getcpu, sys_getcpu) | |||
455 | 479 | ||
456 | /* kernel/time.c */ | 480 | /* kernel/time.c */ |
457 | #define __NR_gettimeofday 169 | 481 | #define __NR_gettimeofday 169 |
458 | __SYSCALL(__NR_gettimeofday, sys_gettimeofday) | 482 | __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday) |
459 | #define __NR_settimeofday 170 | 483 | #define __NR_settimeofday 170 |
460 | __SYSCALL(__NR_settimeofday, sys_settimeofday) | 484 | __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday) |
461 | #define __NR_adjtimex 171 | 485 | #define __NR_adjtimex 171 |
462 | __SYSCALL(__NR_adjtimex, sys_adjtimex) | 486 | __SC_COMP(__NR_adjtimex, sys_adjtimex, compat_sys_adjtimex) |
463 | 487 | ||
464 | /* kernel/timer.c */ | 488 | /* kernel/timer.c */ |
465 | #define __NR_getpid 172 | 489 | #define __NR_getpid 172 |
@@ -477,39 +501,40 @@ __SYSCALL(__NR_getegid, sys_getegid) | |||
477 | #define __NR_gettid 178 | 501 | #define __NR_gettid 178 |
478 | __SYSCALL(__NR_gettid, sys_gettid) | 502 | __SYSCALL(__NR_gettid, sys_gettid) |
479 | #define __NR_sysinfo 179 | 503 | #define __NR_sysinfo 179 |
480 | __SYSCALL(__NR_sysinfo, sys_sysinfo) | 504 | __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo) |
481 | 505 | ||
482 | /* ipc/mqueue.c */ | 506 | /* ipc/mqueue.c */ |
483 | #define __NR_mq_open 180 | 507 | #define __NR_mq_open 180 |
484 | __SYSCALL(__NR_mq_open, sys_mq_open) | 508 | __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open) |
485 | #define __NR_mq_unlink 181 | 509 | #define __NR_mq_unlink 181 |
486 | __SYSCALL(__NR_mq_unlink, sys_mq_unlink) | 510 | __SYSCALL(__NR_mq_unlink, sys_mq_unlink) |
487 | #define __NR_mq_timedsend 182 | 511 | #define __NR_mq_timedsend 182 |
488 | __SYSCALL(__NR_mq_timedsend, sys_mq_timedsend) | 512 | __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend) |
489 | #define __NR_mq_timedreceive 183 | 513 | #define __NR_mq_timedreceive 183 |
490 | __SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive) | 514 | __SC_COMP(__NR_mq_timedreceive, sys_mq_timedreceive, \ |
515 | compat_sys_mq_timedreceive) | ||
491 | #define __NR_mq_notify 184 | 516 | #define __NR_mq_notify 184 |
492 | __SYSCALL(__NR_mq_notify, sys_mq_notify) | 517 | __SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify) |
493 | #define __NR_mq_getsetattr 185 | 518 | #define __NR_mq_getsetattr 185 |
494 | __SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) | 519 | __SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr) |
495 | 520 | ||
496 | /* ipc/msg.c */ | 521 | /* ipc/msg.c */ |
497 | #define __NR_msgget 186 | 522 | #define __NR_msgget 186 |
498 | __SYSCALL(__NR_msgget, sys_msgget) | 523 | __SYSCALL(__NR_msgget, sys_msgget) |
499 | #define __NR_msgctl 187 | 524 | #define __NR_msgctl 187 |
500 | __SYSCALL(__NR_msgctl, sys_msgctl) | 525 | __SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl) |
501 | #define __NR_msgrcv 188 | 526 | #define __NR_msgrcv 188 |
502 | __SYSCALL(__NR_msgrcv, sys_msgrcv) | 527 | __SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv) |
503 | #define __NR_msgsnd 189 | 528 | #define __NR_msgsnd 189 |
504 | __SYSCALL(__NR_msgsnd, sys_msgsnd) | 529 | __SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd) |
505 | 530 | ||
506 | /* ipc/sem.c */ | 531 | /* ipc/sem.c */ |
507 | #define __NR_semget 190 | 532 | #define __NR_semget 190 |
508 | __SYSCALL(__NR_semget, sys_semget) | 533 | __SYSCALL(__NR_semget, sys_semget) |
509 | #define __NR_semctl 191 | 534 | #define __NR_semctl 191 |
510 | __SYSCALL(__NR_semctl, sys_semctl) | 535 | __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl) |
511 | #define __NR_semtimedop 192 | 536 | #define __NR_semtimedop 192 |
512 | __SYSCALL(__NR_semtimedop, sys_semtimedop) | 537 | __SC_COMP(__NR_semtimedop, sys_semtimedop, compat_sys_semtimedop) |
513 | #define __NR_semop 193 | 538 | #define __NR_semop 193 |
514 | __SYSCALL(__NR_semop, sys_semop) | 539 | __SYSCALL(__NR_semop, sys_semop) |
515 | 540 | ||
@@ -517,9 +542,9 @@ __SYSCALL(__NR_semop, sys_semop) | |||
517 | #define __NR_shmget 194 | 542 | #define __NR_shmget 194 |
518 | __SYSCALL(__NR_shmget, sys_shmget) | 543 | __SYSCALL(__NR_shmget, sys_shmget) |
519 | #define __NR_shmctl 195 | 544 | #define __NR_shmctl 195 |
520 | __SYSCALL(__NR_shmctl, sys_shmctl) | 545 | __SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl) |
521 | #define __NR_shmat 196 | 546 | #define __NR_shmat 196 |
522 | __SYSCALL(__NR_shmat, sys_shmat) | 547 | __SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat) |
523 | #define __NR_shmdt 197 | 548 | #define __NR_shmdt 197 |
524 | __SYSCALL(__NR_shmdt, sys_shmdt) | 549 | __SYSCALL(__NR_shmdt, sys_shmdt) |
525 | 550 | ||
@@ -543,21 +568,21 @@ __SYSCALL(__NR_getpeername, sys_getpeername) | |||
543 | #define __NR_sendto 206 | 568 | #define __NR_sendto 206 |
544 | __SYSCALL(__NR_sendto, sys_sendto) | 569 | __SYSCALL(__NR_sendto, sys_sendto) |
545 | #define __NR_recvfrom 207 | 570 | #define __NR_recvfrom 207 |
546 | __SYSCALL(__NR_recvfrom, sys_recvfrom) | 571 | __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom) |
547 | #define __NR_setsockopt 208 | 572 | #define __NR_setsockopt 208 |
548 | __SYSCALL(__NR_setsockopt, sys_setsockopt) | 573 | __SC_COMP(__NR_setsockopt, sys_setsockopt, compat_sys_setsockopt) |
549 | #define __NR_getsockopt 209 | 574 | #define __NR_getsockopt 209 |
550 | __SYSCALL(__NR_getsockopt, sys_getsockopt) | 575 | __SC_COMP(__NR_getsockopt, sys_getsockopt, compat_sys_getsockopt) |
551 | #define __NR_shutdown 210 | 576 | #define __NR_shutdown 210 |
552 | __SYSCALL(__NR_shutdown, sys_shutdown) | 577 | __SYSCALL(__NR_shutdown, sys_shutdown) |
553 | #define __NR_sendmsg 211 | 578 | #define __NR_sendmsg 211 |
554 | __SYSCALL(__NR_sendmsg, sys_sendmsg) | 579 | __SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg) |
555 | #define __NR_recvmsg 212 | 580 | #define __NR_recvmsg 212 |
556 | __SYSCALL(__NR_recvmsg, sys_recvmsg) | 581 | __SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg) |
557 | 582 | ||
558 | /* mm/filemap.c */ | 583 | /* mm/filemap.c */ |
559 | #define __NR_readahead 213 | 584 | #define __NR_readahead 213 |
560 | __SYSCALL(__NR_readahead, sys_readahead) | 585 | __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead) |
561 | 586 | ||
562 | /* mm/nommu.c, also with MMU */ | 587 | /* mm/nommu.c, also with MMU */ |
563 | #define __NR_brk 214 | 588 | #define __NR_brk 214 |
@@ -573,19 +598,19 @@ __SYSCALL(__NR_add_key, sys_add_key) | |||
573 | #define __NR_request_key 218 | 598 | #define __NR_request_key 218 |
574 | __SYSCALL(__NR_request_key, sys_request_key) | 599 | __SYSCALL(__NR_request_key, sys_request_key) |
575 | #define __NR_keyctl 219 | 600 | #define __NR_keyctl 219 |
576 | __SYSCALL(__NR_keyctl, sys_keyctl) | 601 | __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl) |
577 | 602 | ||
578 | /* arch/example/kernel/sys_example.c */ | 603 | /* arch/example/kernel/sys_example.c */ |
579 | #define __NR_clone 220 | 604 | #define __NR_clone 220 |
580 | __SYSCALL(__NR_clone, sys_clone) /* .long sys_clone_wrapper */ | 605 | __SYSCALL(__NR_clone, sys_clone) |
581 | #define __NR_execve 221 | 606 | #define __NR_execve 221 |
582 | __SYSCALL(__NR_execve, sys_execve) /* .long sys_execve_wrapper */ | 607 | __SC_COMP(__NR_execve, sys_execve, compat_sys_execve) |
583 | 608 | ||
584 | #define __NR3264_mmap 222 | 609 | #define __NR3264_mmap 222 |
585 | __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) | 610 | __SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap) |
586 | /* mm/fadvise.c */ | 611 | /* mm/fadvise.c */ |
587 | #define __NR3264_fadvise64 223 | 612 | #define __NR3264_fadvise64 223 |
588 | __SYSCALL(__NR3264_fadvise64, sys_fadvise64_64) | 613 | __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64) |
589 | 614 | ||
590 | /* mm/, CONFIG_MMU only */ | 615 | /* mm/, CONFIG_MMU only */ |
591 | #ifndef __ARCH_NOMMU | 616 | #ifndef __ARCH_NOMMU |
@@ -612,25 +637,26 @@ __SYSCALL(__NR_madvise, sys_madvise) | |||
612 | #define __NR_remap_file_pages 234 | 637 | #define __NR_remap_file_pages 234 |
613 | __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) | 638 | __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) |
614 | #define __NR_mbind 235 | 639 | #define __NR_mbind 235 |
615 | __SYSCALL(__NR_mbind, sys_mbind) | 640 | __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind) |
616 | #define __NR_get_mempolicy 236 | 641 | #define __NR_get_mempolicy 236 |
617 | __SYSCALL(__NR_get_mempolicy, sys_get_mempolicy) | 642 | __SC_COMP(__NR_get_mempolicy, sys_get_mempolicy, compat_sys_get_mempolicy) |
618 | #define __NR_set_mempolicy 237 | 643 | #define __NR_set_mempolicy 237 |
619 | __SYSCALL(__NR_set_mempolicy, sys_set_mempolicy) | 644 | __SC_COMP(__NR_set_mempolicy, sys_set_mempolicy, compat_sys_set_mempolicy) |
620 | #define __NR_migrate_pages 238 | 645 | #define __NR_migrate_pages 238 |
621 | __SYSCALL(__NR_migrate_pages, sys_migrate_pages) | 646 | __SC_COMP(__NR_migrate_pages, sys_migrate_pages, compat_sys_migrate_pages) |
622 | #define __NR_move_pages 239 | 647 | #define __NR_move_pages 239 |
623 | __SYSCALL(__NR_move_pages, sys_move_pages) | 648 | __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages) |
624 | #endif | 649 | #endif |
625 | 650 | ||
626 | #define __NR_rt_tgsigqueueinfo 240 | 651 | #define __NR_rt_tgsigqueueinfo 240 |
627 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | 652 | __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \ |
653 | compat_sys_rt_tgsigqueueinfo) | ||
628 | #define __NR_perf_event_open 241 | 654 | #define __NR_perf_event_open 241 |
629 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | 655 | __SYSCALL(__NR_perf_event_open, sys_perf_event_open) |
630 | #define __NR_accept4 242 | 656 | #define __NR_accept4 242 |
631 | __SYSCALL(__NR_accept4, sys_accept4) | 657 | __SYSCALL(__NR_accept4, sys_accept4) |
632 | #define __NR_recvmmsg 243 | 658 | #define __NR_recvmmsg 243 |
633 | __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | 659 | __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg) |
634 | 660 | ||
635 | /* | 661 | /* |
636 | * Architectures may provide up to 16 syscalls of their own | 662 | * Architectures may provide up to 16 syscalls of their own |
@@ -639,24 +665,29 @@ __SYSCALL(__NR_recvmmsg, sys_recvmmsg) | |||
639 | #define __NR_arch_specific_syscall 244 | 665 | #define __NR_arch_specific_syscall 244 |
640 | 666 | ||
641 | #define __NR_wait4 260 | 667 | #define __NR_wait4 260 |
642 | __SYSCALL(__NR_wait4, sys_wait4) | 668 | __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4) |
643 | #define __NR_prlimit64 261 | 669 | #define __NR_prlimit64 261 |
644 | __SYSCALL(__NR_prlimit64, sys_prlimit64) | 670 | __SYSCALL(__NR_prlimit64, sys_prlimit64) |
645 | #define __NR_fanotify_init 262 | 671 | #define __NR_fanotify_init 262 |
646 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) | 672 | __SYSCALL(__NR_fanotify_init, sys_fanotify_init) |
647 | #define __NR_fanotify_mark 263 | 673 | #define __NR_fanotify_mark 263 |
648 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) | 674 | __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark) |
649 | #define __NR_name_to_handle_at 264 | 675 | #define __NR_name_to_handle_at 264 |
650 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) | 676 | __SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at) |
651 | #define __NR_open_by_handle_at 265 | 677 | #define __NR_open_by_handle_at 265 |
652 | __SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at) | 678 | __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \ |
679 | compat_sys_open_by_handle_at) | ||
653 | #define __NR_clock_adjtime 266 | 680 | #define __NR_clock_adjtime 266 |
654 | __SYSCALL(__NR_clock_adjtime, sys_clock_adjtime) | 681 | __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime) |
655 | #define __NR_syncfs 267 | 682 | #define __NR_syncfs 267 |
656 | __SYSCALL(__NR_syncfs, sys_syncfs) | 683 | __SYSCALL(__NR_syncfs, sys_syncfs) |
684 | #define __NR_setns 268 | ||
685 | __SYSCALL(__NR_setns, sys_setns) | ||
686 | #define __NR_sendmmsg 269 | ||
687 | __SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg) | ||
657 | 688 | ||
658 | #undef __NR_syscalls | 689 | #undef __NR_syscalls |
659 | #define __NR_syscalls 268 | 690 | #define __NR_syscalls 270 |
660 | 691 | ||
661 | /* | 692 | /* |
662 | * All syscalls below here should go away really, | 693 | * All syscalls below here should go away really, |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd297a20ab98..db22d136ad08 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * HEAD_TEXT_SECTION | 15 | * HEAD_TEXT_SECTION |
16 | * INIT_TEXT_SECTION(PAGE_SIZE) | 16 | * INIT_TEXT_SECTION(PAGE_SIZE) |
17 | * INIT_DATA_SECTION(...) | 17 | * INIT_DATA_SECTION(...) |
18 | * PERCPU(CACHELINE_SIZE, PAGE_SIZE) | 18 | * PERCPU_SECTION(CACHELINE_SIZE) |
19 | * __init_end = .; | 19 | * __init_end = .; |
20 | * | 20 | * |
21 | * _stext = .; | 21 | * _stext = .; |
@@ -170,6 +170,10 @@ | |||
170 | STRUCT_ALIGN(); \ | 170 | STRUCT_ALIGN(); \ |
171 | *(__tracepoints) \ | 171 | *(__tracepoints) \ |
172 | /* implement dynamic printk debug */ \ | 172 | /* implement dynamic printk debug */ \ |
173 | . = ALIGN(8); \ | ||
174 | VMLINUX_SYMBOL(__start___jump_table) = .; \ | ||
175 | *(__jump_table) \ | ||
176 | VMLINUX_SYMBOL(__stop___jump_table) = .; \ | ||
173 | . = ALIGN(8); \ | 177 | . = ALIGN(8); \ |
174 | VMLINUX_SYMBOL(__start___verbose) = .; \ | 178 | VMLINUX_SYMBOL(__start___verbose) = .; \ |
175 | *(__verbose) \ | 179 | *(__verbose) \ |
@@ -228,8 +232,6 @@ | |||
228 | \ | 232 | \ |
229 | BUG_TABLE \ | 233 | BUG_TABLE \ |
230 | \ | 234 | \ |
231 | JUMP_TABLE \ | ||
232 | \ | ||
233 | /* PCI quirks */ \ | 235 | /* PCI quirks */ \ |
234 | .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ | 236 | .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ |
235 | VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ | 237 | VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ |
@@ -274,70 +276,70 @@ | |||
274 | /* Kernel symbol table: Normal symbols */ \ | 276 | /* Kernel symbol table: Normal symbols */ \ |
275 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ | 277 | __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ |
276 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ | 278 | VMLINUX_SYMBOL(__start___ksymtab) = .; \ |
277 | *(__ksymtab) \ | 279 | *(SORT(___ksymtab+*)) \ |
278 | VMLINUX_SYMBOL(__stop___ksymtab) = .; \ | 280 | VMLINUX_SYMBOL(__stop___ksymtab) = .; \ |
279 | } \ | 281 | } \ |
280 | \ | 282 | \ |
281 | /* Kernel symbol table: GPL-only symbols */ \ | 283 | /* Kernel symbol table: GPL-only symbols */ \ |
282 | __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ | 284 | __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ |
283 | VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ | 285 | VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ |
284 | *(__ksymtab_gpl) \ | 286 | *(SORT(___ksymtab_gpl+*)) \ |
285 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ | 287 | VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ |
286 | } \ | 288 | } \ |
287 | \ | 289 | \ |
288 | /* Kernel symbol table: Normal unused symbols */ \ | 290 | /* Kernel symbol table: Normal unused symbols */ \ |
289 | __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ | 291 | __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \ |
290 | VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ | 292 | VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \ |
291 | *(__ksymtab_unused) \ | 293 | *(SORT(___ksymtab_unused+*)) \ |
292 | VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ | 294 | VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \ |
293 | } \ | 295 | } \ |
294 | \ | 296 | \ |
295 | /* Kernel symbol table: GPL-only unused symbols */ \ | 297 | /* Kernel symbol table: GPL-only unused symbols */ \ |
296 | __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ | 298 | __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \ |
297 | VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ | 299 | VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \ |
298 | *(__ksymtab_unused_gpl) \ | 300 | *(SORT(___ksymtab_unused_gpl+*)) \ |
299 | VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ | 301 | VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \ |
300 | } \ | 302 | } \ |
301 | \ | 303 | \ |
302 | /* Kernel symbol table: GPL-future-only symbols */ \ | 304 | /* Kernel symbol table: GPL-future-only symbols */ \ |
303 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ | 305 | __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ |
304 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ | 306 | VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ |
305 | *(__ksymtab_gpl_future) \ | 307 | *(SORT(___ksymtab_gpl_future+*)) \ |
306 | VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ | 308 | VMLINUX_SYMBOL(__stop___ksymtab_gpl_future) = .; \ |
307 | } \ | 309 | } \ |
308 | \ | 310 | \ |
309 | /* Kernel symbol table: Normal symbols */ \ | 311 | /* Kernel symbol table: Normal symbols */ \ |
310 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ | 312 | __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ |
311 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ | 313 | VMLINUX_SYMBOL(__start___kcrctab) = .; \ |
312 | *(__kcrctab) \ | 314 | *(SORT(___kcrctab+*)) \ |
313 | VMLINUX_SYMBOL(__stop___kcrctab) = .; \ | 315 | VMLINUX_SYMBOL(__stop___kcrctab) = .; \ |
314 | } \ | 316 | } \ |
315 | \ | 317 | \ |
316 | /* Kernel symbol table: GPL-only symbols */ \ | 318 | /* Kernel symbol table: GPL-only symbols */ \ |
317 | __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ | 319 | __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ |
318 | VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ | 320 | VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ |
319 | *(__kcrctab_gpl) \ | 321 | *(SORT(___kcrctab_gpl+*)) \ |
320 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ | 322 | VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ |
321 | } \ | 323 | } \ |
322 | \ | 324 | \ |
323 | /* Kernel symbol table: Normal unused symbols */ \ | 325 | /* Kernel symbol table: Normal unused symbols */ \ |
324 | __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ | 326 | __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \ |
325 | VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ | 327 | VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \ |
326 | *(__kcrctab_unused) \ | 328 | *(SORT(___kcrctab_unused+*)) \ |
327 | VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ | 329 | VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \ |
328 | } \ | 330 | } \ |
329 | \ | 331 | \ |
330 | /* Kernel symbol table: GPL-only unused symbols */ \ | 332 | /* Kernel symbol table: GPL-only unused symbols */ \ |
331 | __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ | 333 | __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \ |
332 | VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ | 334 | VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \ |
333 | *(__kcrctab_unused_gpl) \ | 335 | *(SORT(___kcrctab_unused_gpl+*)) \ |
334 | VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ | 336 | VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \ |
335 | } \ | 337 | } \ |
336 | \ | 338 | \ |
337 | /* Kernel symbol table: GPL-future-only symbols */ \ | 339 | /* Kernel symbol table: GPL-future-only symbols */ \ |
338 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ | 340 | __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ |
339 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ | 341 | VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ |
340 | *(__kcrctab_gpl_future) \ | 342 | *(SORT(___kcrctab_gpl_future+*)) \ |
341 | VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ | 343 | VMLINUX_SYMBOL(__stop___kcrctab_gpl_future) = .; \ |
342 | } \ | 344 | } \ |
343 | \ | 345 | \ |
@@ -589,14 +591,6 @@ | |||
589 | #define BUG_TABLE | 591 | #define BUG_TABLE |
590 | #endif | 592 | #endif |
591 | 593 | ||
592 | #define JUMP_TABLE \ | ||
593 | . = ALIGN(8); \ | ||
594 | __jump_table : AT(ADDR(__jump_table) - LOAD_OFFSET) { \ | ||
595 | VMLINUX_SYMBOL(__start___jump_table) = .; \ | ||
596 | *(__jump_table) \ | ||
597 | VMLINUX_SYMBOL(__stop___jump_table) = .; \ | ||
598 | } | ||
599 | |||
600 | #ifdef CONFIG_PM_TRACE | 594 | #ifdef CONFIG_PM_TRACE |
601 | #define TRACEDATA \ | 595 | #define TRACEDATA \ |
602 | . = ALIGN(4); \ | 596 | . = ALIGN(4); \ |
@@ -688,6 +682,28 @@ | |||
688 | } | 682 | } |
689 | 683 | ||
690 | /** | 684 | /** |
685 | * PERCPU_INPUT - the percpu input sections | ||
686 | * @cacheline: cacheline size | ||
687 | * | ||
688 | * The core percpu section names and core symbols which do not rely | ||
689 | * directly upon load addresses. | ||
690 | * | ||
691 | * @cacheline is used to align subsections to avoid false cacheline | ||
692 | * sharing between subsections for different purposes. | ||
693 | */ | ||
694 | #define PERCPU_INPUT(cacheline) \ | ||
695 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
696 | *(.data..percpu..first) \ | ||
697 | . = ALIGN(PAGE_SIZE); \ | ||
698 | *(.data..percpu..page_aligned) \ | ||
699 | . = ALIGN(cacheline); \ | ||
700 | *(.data..percpu..readmostly) \ | ||
701 | . = ALIGN(cacheline); \ | ||
702 | *(.data..percpu) \ | ||
703 | *(.data..percpu..shared_aligned) \ | ||
704 | VMLINUX_SYMBOL(__per_cpu_end) = .; | ||
705 | |||
706 | /** | ||
691 | * PERCPU_VADDR - define output section for percpu area | 707 | * PERCPU_VADDR - define output section for percpu area |
692 | * @cacheline: cacheline size | 708 | * @cacheline: cacheline size |
693 | * @vaddr: explicit base address (optional) | 709 | * @vaddr: explicit base address (optional) |
@@ -709,52 +725,33 @@ | |||
709 | * | 725 | * |
710 | * Note that this macros defines __per_cpu_load as an absolute symbol. | 726 | * Note that this macros defines __per_cpu_load as an absolute symbol. |
711 | * If there is no need to put the percpu section at a predetermined | 727 | * If there is no need to put the percpu section at a predetermined |
712 | * address, use PERCPU(). | 728 | * address, use PERCPU_SECTION. |
713 | */ | 729 | */ |
714 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ | 730 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ |
715 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 731 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
716 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | 732 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ |
717 | - LOAD_OFFSET) { \ | 733 | - LOAD_OFFSET) { \ |
718 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 734 | PERCPU_INPUT(cacheline) \ |
719 | *(.data..percpu..first) \ | ||
720 | . = ALIGN(PAGE_SIZE); \ | ||
721 | *(.data..percpu..page_aligned) \ | ||
722 | . = ALIGN(cacheline); \ | ||
723 | *(.data..percpu..readmostly) \ | ||
724 | . = ALIGN(cacheline); \ | ||
725 | *(.data..percpu) \ | ||
726 | *(.data..percpu..shared_aligned) \ | ||
727 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
728 | } phdr \ | 735 | } phdr \ |
729 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); | 736 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); |
730 | 737 | ||
731 | /** | 738 | /** |
732 | * PERCPU - define output section for percpu area, simple version | 739 | * PERCPU_SECTION - define output section for percpu area, simple version |
733 | * @cacheline: cacheline size | 740 | * @cacheline: cacheline size |
734 | * @align: required alignment | ||
735 | * | 741 | * |
736 | * Align to @align and outputs output section for percpu area. This macro | 742 | * Align to PAGE_SIZE and outputs output section for percpu area. This |
737 | * doesn't manipulate @vaddr or @phdr and __per_cpu_load and | 743 | * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and |
738 | * __per_cpu_start will be identical. | 744 | * __per_cpu_start will be identical. |
739 | * | 745 | * |
740 | * This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,) | 746 | * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,) |
741 | * except that __per_cpu_load is defined as a relative symbol against | 747 | * except that __per_cpu_load is defined as a relative symbol against |
742 | * .data..percpu which is required for relocatable x86_32 configuration. | 748 | * .data..percpu which is required for relocatable x86_32 configuration. |
743 | */ | 749 | */ |
744 | #define PERCPU(cacheline, align) \ | 750 | #define PERCPU_SECTION(cacheline) \ |
745 | . = ALIGN(align); \ | 751 | . = ALIGN(PAGE_SIZE); \ |
746 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ | 752 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ |
747 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 753 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
748 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 754 | PERCPU_INPUT(cacheline) \ |
749 | *(.data..percpu..first) \ | ||
750 | . = ALIGN(PAGE_SIZE); \ | ||
751 | *(.data..percpu..page_aligned) \ | ||
752 | . = ALIGN(cacheline); \ | ||
753 | *(.data..percpu..readmostly) \ | ||
754 | . = ALIGN(cacheline); \ | ||
755 | *(.data..percpu) \ | ||
756 | *(.data..percpu..shared_aligned) \ | ||
757 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
758 | } | 755 | } |
759 | 756 | ||
760 | 757 | ||
diff --git a/include/asm-generic/xor.h b/include/asm-generic/xor.h index aaab875e1a35..6028fb862254 100644 --- a/include/asm-generic/xor.h +++ b/include/asm-generic/xor.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 13 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <asm/processor.h> | 16 | #include <linux/prefetch.h> |
17 | 17 | ||
18 | static void | 18 | static void |
19 | xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) | 19 | xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 202424d17ed7..738b3a5faa12 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -122,10 +122,14 @@ struct drm_device; | |||
122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. | 122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | extern void drm_ut_debug_printk(unsigned int request_level, | 125 | extern __attribute__((format (printf, 4, 5))) |
126 | void drm_ut_debug_printk(unsigned int request_level, | ||
126 | const char *prefix, | 127 | const char *prefix, |
127 | const char *function_name, | 128 | const char *function_name, |
128 | const char *format, ...); | 129 | const char *format, ...); |
130 | extern __attribute__((format (printf, 2, 3))) | ||
131 | int drm_err(const char *func, const char *format, ...); | ||
132 | |||
129 | /***********************************************************************/ | 133 | /***********************************************************************/ |
130 | /** \name DRM template customization defaults */ | 134 | /** \name DRM template customization defaults */ |
131 | /*@{*/ | 135 | /*@{*/ |
@@ -181,21 +185,11 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
181 | * \param fmt printf() like format string. | 185 | * \param fmt printf() like format string. |
182 | * \param arg arguments | 186 | * \param arg arguments |
183 | */ | 187 | */ |
184 | #define DRM_ERROR(fmt, arg...) \ | 188 | #define DRM_ERROR(fmt, ...) \ |
185 | printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg) | 189 | drm_err(__func__, fmt, ##__VA_ARGS__) |
186 | |||
187 | /** | ||
188 | * Memory error output. | ||
189 | * | ||
190 | * \param area memory area where the error occurred. | ||
191 | * \param fmt printf() like format string. | ||
192 | * \param arg arguments | ||
193 | */ | ||
194 | #define DRM_MEM_ERROR(area, fmt, arg...) \ | ||
195 | printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __func__, \ | ||
196 | drm_mem_stats[area].name , ##arg) | ||
197 | 190 | ||
198 | #define DRM_INFO(fmt, arg...) printk(KERN_INFO "[" DRM_NAME "] " fmt , ##arg) | 191 | #define DRM_INFO(fmt, ...) \ |
192 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) | ||
199 | 193 | ||
200 | /** | 194 | /** |
201 | * Debug output. | 195 | * Debug output. |
@@ -1000,6 +994,22 @@ struct drm_minor { | |||
1000 | struct drm_mode_group mode_group; | 994 | struct drm_mode_group mode_group; |
1001 | }; | 995 | }; |
1002 | 996 | ||
997 | /* mode specified on the command line */ | ||
998 | struct drm_cmdline_mode { | ||
999 | bool specified; | ||
1000 | bool refresh_specified; | ||
1001 | bool bpp_specified; | ||
1002 | int xres, yres; | ||
1003 | int bpp; | ||
1004 | int refresh; | ||
1005 | bool rb; | ||
1006 | bool interlace; | ||
1007 | bool cvt; | ||
1008 | bool margins; | ||
1009 | enum drm_connector_force force; | ||
1010 | }; | ||
1011 | |||
1012 | |||
1003 | struct drm_pending_vblank_event { | 1013 | struct drm_pending_vblank_event { |
1004 | struct drm_pending_event base; | 1014 | struct drm_pending_event base; |
1005 | int pipe; | 1015 | int pipe; |
@@ -1395,6 +1405,15 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, | |||
1395 | struct drm_crtc *refcrtc); | 1405 | struct drm_crtc *refcrtc); |
1396 | extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); | 1406 | extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); |
1397 | 1407 | ||
1408 | extern bool | ||
1409 | drm_mode_parse_command_line_for_connector(const char *mode_option, | ||
1410 | struct drm_connector *connector, | ||
1411 | struct drm_cmdline_mode *mode); | ||
1412 | |||
1413 | extern struct drm_display_mode * | ||
1414 | drm_mode_create_from_cmdline_mode(struct drm_device *dev, | ||
1415 | struct drm_cmdline_mode *cmd); | ||
1416 | |||
1398 | /* Modesetting support */ | 1417 | /* Modesetting support */ |
1399 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1418 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
1400 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); | 1419 | extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index d94684b7ba34..9573e0ce3120 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -183,7 +183,9 @@ enum subpixel_order { | |||
183 | SubPixelNone, | 183 | SubPixelNone, |
184 | }; | 184 | }; |
185 | 185 | ||
186 | 186 | #define DRM_COLOR_FORMAT_RGB444 (1<<0) | |
187 | #define DRM_COLOR_FORMAT_YCRCB444 (1<<1) | ||
188 | #define DRM_COLOR_FORMAT_YCRCB422 (1<<2) | ||
187 | /* | 189 | /* |
188 | * Describes a given display (e.g. CRT or flat panel) and its limitations. | 190 | * Describes a given display (e.g. CRT or flat panel) and its limitations. |
189 | */ | 191 | */ |
@@ -198,8 +200,10 @@ struct drm_display_info { | |||
198 | unsigned int min_vfreq, max_vfreq; | 200 | unsigned int min_vfreq, max_vfreq; |
199 | unsigned int min_hfreq, max_hfreq; | 201 | unsigned int min_hfreq, max_hfreq; |
200 | unsigned int pixel_clock; | 202 | unsigned int pixel_clock; |
203 | unsigned int bpc; | ||
201 | 204 | ||
202 | enum subpixel_order subpixel_order; | 205 | enum subpixel_order subpixel_order; |
206 | u32 color_formats; | ||
203 | 207 | ||
204 | char *raw_edid; /* if any */ | 208 | char *raw_edid; /* if any */ |
205 | }; | 209 | }; |
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 83a389e44543..91567bbdb027 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -53,6 +53,7 @@ | |||
53 | 53 | ||
54 | #define DP_MAX_LANE_COUNT 0x002 | 54 | #define DP_MAX_LANE_COUNT 0x002 |
55 | # define DP_MAX_LANE_COUNT_MASK 0x1f | 55 | # define DP_MAX_LANE_COUNT_MASK 0x1f |
56 | # define DP_TPS3_SUPPORTED (1 << 6) | ||
56 | # define DP_ENHANCED_FRAME_CAP (1 << 7) | 57 | # define DP_ENHANCED_FRAME_CAP (1 << 7) |
57 | 58 | ||
58 | #define DP_MAX_DOWNSPREAD 0x003 | 59 | #define DP_MAX_DOWNSPREAD 0x003 |
@@ -71,10 +72,13 @@ | |||
71 | 72 | ||
72 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 | 73 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 |
73 | 74 | ||
75 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e | ||
76 | |||
74 | /* link configuration */ | 77 | /* link configuration */ |
75 | #define DP_LINK_BW_SET 0x100 | 78 | #define DP_LINK_BW_SET 0x100 |
76 | # define DP_LINK_BW_1_62 0x06 | 79 | # define DP_LINK_BW_1_62 0x06 |
77 | # define DP_LINK_BW_2_7 0x0a | 80 | # define DP_LINK_BW_2_7 0x0a |
81 | # define DP_LINK_BW_5_4 0x14 | ||
78 | 82 | ||
79 | #define DP_LANE_COUNT_SET 0x101 | 83 | #define DP_LANE_COUNT_SET 0x101 |
80 | # define DP_LANE_COUNT_MASK 0x0f | 84 | # define DP_LANE_COUNT_MASK 0x0f |
@@ -84,6 +88,7 @@ | |||
84 | # define DP_TRAINING_PATTERN_DISABLE 0 | 88 | # define DP_TRAINING_PATTERN_DISABLE 0 |
85 | # define DP_TRAINING_PATTERN_1 1 | 89 | # define DP_TRAINING_PATTERN_1 1 |
86 | # define DP_TRAINING_PATTERN_2 2 | 90 | # define DP_TRAINING_PATTERN_2 2 |
91 | # define DP_TRAINING_PATTERN_3 3 | ||
87 | # define DP_TRAINING_PATTERN_MASK 0x3 | 92 | # define DP_TRAINING_PATTERN_MASK 0x3 |
88 | 93 | ||
89 | # define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2) | 94 | # define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2) |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 5881fad91faa..eacb415b309a 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
@@ -155,12 +155,35 @@ struct detailed_timing { | |||
155 | #define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3) | 155 | #define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3) |
156 | #define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 4) | 156 | #define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 4) |
157 | #define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 5) | 157 | #define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 5) |
158 | #define DRM_EDID_INPUT_DIGITAL (1 << 7) /* bits below must be zero if set */ | 158 | #define DRM_EDID_INPUT_DIGITAL (1 << 7) |
159 | #define DRM_EDID_DIGITAL_DEPTH_MASK (7 << 4) | ||
160 | #define DRM_EDID_DIGITAL_DEPTH_UNDEF (0 << 4) | ||
161 | #define DRM_EDID_DIGITAL_DEPTH_6 (1 << 4) | ||
162 | #define DRM_EDID_DIGITAL_DEPTH_8 (2 << 4) | ||
163 | #define DRM_EDID_DIGITAL_DEPTH_10 (3 << 4) | ||
164 | #define DRM_EDID_DIGITAL_DEPTH_12 (4 << 4) | ||
165 | #define DRM_EDID_DIGITAL_DEPTH_14 (5 << 4) | ||
166 | #define DRM_EDID_DIGITAL_DEPTH_16 (6 << 4) | ||
167 | #define DRM_EDID_DIGITAL_DEPTH_RSVD (7 << 4) | ||
168 | #define DRM_EDID_DIGITAL_TYPE_UNDEF (0) | ||
169 | #define DRM_EDID_DIGITAL_TYPE_DVI (1) | ||
170 | #define DRM_EDID_DIGITAL_TYPE_HDMI_A (2) | ||
171 | #define DRM_EDID_DIGITAL_TYPE_HDMI_B (3) | ||
172 | #define DRM_EDID_DIGITAL_TYPE_MDDI (4) | ||
173 | #define DRM_EDID_DIGITAL_TYPE_DP (5) | ||
159 | 174 | ||
160 | #define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 0) | 175 | #define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 0) |
161 | #define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1) | 176 | #define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1) |
162 | #define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 2) | 177 | #define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 2) |
178 | /* If analog */ | ||
163 | #define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */ | 179 | #define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */ |
180 | /* If digital */ | ||
181 | #define DRM_EDID_FEATURE_COLOR_MASK (3 << 3) | ||
182 | #define DRM_EDID_FEATURE_RGB (0 << 3) | ||
183 | #define DRM_EDID_FEATURE_RGB_YCRCB444 (1 << 3) | ||
184 | #define DRM_EDID_FEATURE_RGB_YCRCB422 (2 << 3) | ||
185 | #define DRM_EDID_FEATURE_RGB_YCRCB (3 << 3) /* both 4:4:4 and 4:2:2 */ | ||
186 | |||
164 | #define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 5) | 187 | #define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 5) |
165 | #define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6) | 188 | #define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6) |
166 | #define DRM_EDID_FEATURE_PM_STANDBY (1 << 7) | 189 | #define DRM_EDID_FEATURE_PM_STANDBY (1 << 7) |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index c99c3d3e7811..6e3076ad646e 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -40,20 +40,6 @@ struct drm_fb_helper_crtc { | |||
40 | struct drm_display_mode *desired_mode; | 40 | struct drm_display_mode *desired_mode; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* mode specified on the command line */ | ||
44 | struct drm_fb_helper_cmdline_mode { | ||
45 | bool specified; | ||
46 | bool refresh_specified; | ||
47 | bool bpp_specified; | ||
48 | int xres, yres; | ||
49 | int bpp; | ||
50 | int refresh; | ||
51 | bool rb; | ||
52 | bool interlace; | ||
53 | bool cvt; | ||
54 | bool margins; | ||
55 | }; | ||
56 | |||
57 | struct drm_fb_helper_surface_size { | 43 | struct drm_fb_helper_surface_size { |
58 | u32 fb_width; | 44 | u32 fb_width; |
59 | u32 fb_height; | 45 | u32 fb_height; |
@@ -74,8 +60,8 @@ struct drm_fb_helper_funcs { | |||
74 | }; | 60 | }; |
75 | 61 | ||
76 | struct drm_fb_helper_connector { | 62 | struct drm_fb_helper_connector { |
77 | struct drm_fb_helper_cmdline_mode cmdline_mode; | ||
78 | struct drm_connector *connector; | 63 | struct drm_connector *connector; |
64 | struct drm_cmdline_mode cmdline_mode; | ||
79 | }; | 65 | }; |
80 | 66 | ||
81 | struct drm_fb_helper { | 67 | struct drm_fb_helper { |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index f04b2a3b0f49..e08f344c6cff 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -467,6 +467,17 @@ | |||
467 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 467 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
468 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 468 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
469 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 469 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
470 | {0x1002, 0x9640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
471 | {0x1002, 0x9641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
472 | {0x1002, 0x9642, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
473 | {0x1002, 0x9643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
474 | {0x1002, 0x9644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
475 | {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
476 | {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | ||
477 | {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | ||
478 | {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
479 | {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | ||
480 | {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | ||
470 | {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 481 | {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
471 | {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 482 | {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
472 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 483 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 75cf611641e6..01f636275057 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -4,6 +4,7 @@ header-y += caif/ | |||
4 | header-y += dvb/ | 4 | header-y += dvb/ |
5 | header-y += hdlc/ | 5 | header-y += hdlc/ |
6 | header-y += isdn/ | 6 | header-y += isdn/ |
7 | header-y += mmc/ | ||
7 | header-y += nfsd/ | 8 | header-y += nfsd/ |
8 | header-y += raid/ | 9 | header-y += raid/ |
9 | header-y += spi/ | 10 | header-y += spi/ |
@@ -302,6 +303,7 @@ header-y += ppp-comp.h | |||
302 | header-y += ppp_defs.h | 303 | header-y += ppp_defs.h |
303 | header-y += pps.h | 304 | header-y += pps.h |
304 | header-y += prctl.h | 305 | header-y += prctl.h |
306 | header-y += ptp_clock.h | ||
305 | header-y += ptrace.h | 307 | header-y += ptrace.h |
306 | header-y += qnx4_fs.h | 308 | header-y += qnx4_fs.h |
307 | header-y += qnxtypes.h | 309 | header-y += qnxtypes.h |
@@ -372,6 +374,7 @@ header-y += unistd.h | |||
372 | header-y += usbdevice_fs.h | 374 | header-y += usbdevice_fs.h |
373 | header-y += utime.h | 375 | header-y += utime.h |
374 | header-y += utsname.h | 376 | header-y += utsname.h |
377 | header-y += uvcvideo.h | ||
375 | header-y += v4l2-mediabus.h | 378 | header-y += v4l2-mediabus.h |
376 | header-y += v4l2-subdev.h | 379 | header-y += v4l2-subdev.h |
377 | header-y += veth.h | 380 | header-y += veth.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a2e910e01293..1deb2a73c2da 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -150,8 +150,7 @@ extern int ec_read(u8 addr, u8 *val); | |||
150 | extern int ec_write(u8 addr, u8 val); | 150 | extern int ec_write(u8 addr, u8 val); |
151 | extern int ec_transaction(u8 command, | 151 | extern int ec_transaction(u8 command, |
152 | const u8 *wdata, unsigned wdata_len, | 152 | const u8 *wdata, unsigned wdata_len, |
153 | u8 *rdata, unsigned rdata_len, | 153 | u8 *rdata, unsigned rdata_len); |
154 | int force_poll); | ||
155 | 154 | ||
156 | #if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE) | 155 | #if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE) |
157 | 156 | ||
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h new file mode 100644 index 000000000000..c5d6095b46f8 --- /dev/null +++ b/include/linux/alarmtimer.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _LINUX_ALARMTIMER_H | ||
2 | #define _LINUX_ALARMTIMER_H | ||
3 | |||
4 | #include <linux/time.h> | ||
5 | #include <linux/hrtimer.h> | ||
6 | #include <linux/timerqueue.h> | ||
7 | #include <linux/rtc.h> | ||
8 | |||
9 | enum alarmtimer_type { | ||
10 | ALARM_REALTIME, | ||
11 | ALARM_BOOTTIME, | ||
12 | |||
13 | ALARM_NUMTYPE, | ||
14 | }; | ||
15 | |||
16 | /** | ||
17 | * struct alarm - Alarm timer structure | ||
18 | * @node: timerqueue node for adding to the event list this value | ||
19 | * also includes the expiration time. | ||
20 | * @period: Period for recuring alarms | ||
21 | * @function: Function pointer to be executed when the timer fires. | ||
22 | * @type: Alarm type (BOOTTIME/REALTIME) | ||
23 | * @enabled: Flag that represents if the alarm is set to fire or not | ||
24 | * @data: Internal data value. | ||
25 | */ | ||
26 | struct alarm { | ||
27 | struct timerqueue_node node; | ||
28 | ktime_t period; | ||
29 | void (*function)(struct alarm *); | ||
30 | enum alarmtimer_type type; | ||
31 | bool enabled; | ||
32 | void *data; | ||
33 | }; | ||
34 | |||
35 | void alarm_init(struct alarm *alarm, enum alarmtimer_type type, | ||
36 | void (*function)(struct alarm *)); | ||
37 | void alarm_start(struct alarm *alarm, ktime_t start, ktime_t period); | ||
38 | void alarm_cancel(struct alarm *alarm); | ||
39 | |||
40 | #endif | ||
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h index b847fc7b93f9..60a7c49dcb49 100644 --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h | |||
@@ -23,6 +23,13 @@ | |||
23 | 23 | ||
24 | struct ath9k_platform_data { | 24 | struct ath9k_platform_data { |
25 | u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; | 25 | u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; |
26 | u8 *macaddr; | ||
27 | |||
28 | int led_pin; | ||
29 | u32 gpio_mask; | ||
30 | u32 gpio_val; | ||
31 | |||
32 | bool is_clk_25mhz; | ||
26 | }; | 33 | }; |
27 | 34 | ||
28 | #endif /* _LINUX_ATH9K_PLATFORM_H */ | 35 | #endif /* _LINUX_ATH9K_PLATFORM_H */ |
diff --git a/include/linux/atomic.h b/include/linux/atomic.h index 96c038e43d66..ee456c79b0e6 100644 --- a/include/linux/atomic.h +++ b/include/linux/atomic.h | |||
@@ -34,4 +34,17 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint) | |||
34 | } | 34 | } |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifndef CONFIG_ARCH_HAS_ATOMIC_OR | ||
38 | static inline void atomic_or(int i, atomic_t *v) | ||
39 | { | ||
40 | int old; | ||
41 | int new; | ||
42 | |||
43 | do { | ||
44 | old = atomic_read(v); | ||
45 | new = old | i; | ||
46 | } while (atomic_cmpxchg(v, old, new) != old); | ||
47 | } | ||
48 | #endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */ | ||
49 | |||
37 | #endif /* _LINUX_ATOMIC_H */ | 50 | #endif /* _LINUX_ATOMIC_H */ |
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h index 198087a16fc4..98999cf107ce 100644 --- a/include/linux/basic_mmio_gpio.h +++ b/include/linux/basic_mmio_gpio.h | |||
@@ -13,8 +13,65 @@ | |||
13 | #ifndef __BASIC_MMIO_GPIO_H | 13 | #ifndef __BASIC_MMIO_GPIO_H |
14 | #define __BASIC_MMIO_GPIO_H | 14 | #define __BASIC_MMIO_GPIO_H |
15 | 15 | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <linux/compiler.h> | ||
19 | #include <linux/spinlock_types.h> | ||
20 | |||
16 | struct bgpio_pdata { | 21 | struct bgpio_pdata { |
17 | int base; | 22 | int base; |
23 | int ngpio; | ||
18 | }; | 24 | }; |
19 | 25 | ||
26 | struct device; | ||
27 | |||
28 | struct bgpio_chip { | ||
29 | struct gpio_chip gc; | ||
30 | |||
31 | unsigned long (*read_reg)(void __iomem *reg); | ||
32 | void (*write_reg)(void __iomem *reg, unsigned long data); | ||
33 | |||
34 | void __iomem *reg_dat; | ||
35 | void __iomem *reg_set; | ||
36 | void __iomem *reg_clr; | ||
37 | void __iomem *reg_dir; | ||
38 | |||
39 | /* Number of bits (GPIOs): <register width> * 8. */ | ||
40 | int bits; | ||
41 | |||
42 | /* | ||
43 | * Some GPIO controllers work with the big-endian bits notation, | ||
44 | * e.g. in a 8-bits register, GPIO7 is the least significant bit. | ||
45 | */ | ||
46 | unsigned long (*pin2mask)(struct bgpio_chip *bgc, unsigned int pin); | ||
47 | |||
48 | /* | ||
49 | * Used to lock bgpio_chip->data. Also, this is needed to keep | ||
50 | * shadowed and real data registers writes together. | ||
51 | */ | ||
52 | spinlock_t lock; | ||
53 | |||
54 | /* Shadowed data register to clear/set bits safely. */ | ||
55 | unsigned long data; | ||
56 | |||
57 | /* Shadowed direction registers to clear/set direction safely. */ | ||
58 | unsigned long dir; | ||
59 | }; | ||
60 | |||
61 | static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc) | ||
62 | { | ||
63 | return container_of(gc, struct bgpio_chip, gc); | ||
64 | } | ||
65 | |||
66 | int __devexit bgpio_remove(struct bgpio_chip *bgc); | ||
67 | int __devinit bgpio_init(struct bgpio_chip *bgc, | ||
68 | struct device *dev, | ||
69 | unsigned long sz, | ||
70 | void __iomem *dat, | ||
71 | void __iomem *set, | ||
72 | void __iomem *clr, | ||
73 | void __iomem *dirout, | ||
74 | void __iomem *dirin, | ||
75 | bool big_endian); | ||
76 | |||
20 | #endif /* __BASIC_MMIO_GPIO_H */ | 77 | #endif /* __BASIC_MMIO_GPIO_H */ |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h new file mode 100644 index 000000000000..08763e4e848f --- /dev/null +++ b/include/linux/bcma/bcma.h | |||
@@ -0,0 +1,224 @@ | |||
1 | #ifndef LINUX_BCMA_H_ | ||
2 | #define LINUX_BCMA_H_ | ||
3 | |||
4 | #include <linux/pci.h> | ||
5 | #include <linux/mod_devicetable.h> | ||
6 | |||
7 | #include <linux/bcma/bcma_driver_chipcommon.h> | ||
8 | #include <linux/bcma/bcma_driver_pci.h> | ||
9 | |||
10 | #include "bcma_regs.h" | ||
11 | |||
12 | struct bcma_device; | ||
13 | struct bcma_bus; | ||
14 | |||
15 | enum bcma_hosttype { | ||
16 | BCMA_HOSTTYPE_NONE, | ||
17 | BCMA_HOSTTYPE_PCI, | ||
18 | BCMA_HOSTTYPE_SDIO, | ||
19 | }; | ||
20 | |||
21 | struct bcma_chipinfo { | ||
22 | u16 id; | ||
23 | u8 rev; | ||
24 | u8 pkg; | ||
25 | }; | ||
26 | |||
27 | struct bcma_host_ops { | ||
28 | u8 (*read8)(struct bcma_device *core, u16 offset); | ||
29 | u16 (*read16)(struct bcma_device *core, u16 offset); | ||
30 | u32 (*read32)(struct bcma_device *core, u16 offset); | ||
31 | void (*write8)(struct bcma_device *core, u16 offset, u8 value); | ||
32 | void (*write16)(struct bcma_device *core, u16 offset, u16 value); | ||
33 | void (*write32)(struct bcma_device *core, u16 offset, u32 value); | ||
34 | /* Agent ops */ | ||
35 | u32 (*aread32)(struct bcma_device *core, u16 offset); | ||
36 | void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); | ||
37 | }; | ||
38 | |||
39 | /* Core manufacturers */ | ||
40 | #define BCMA_MANUF_ARM 0x43B | ||
41 | #define BCMA_MANUF_MIPS 0x4A7 | ||
42 | #define BCMA_MANUF_BCM 0x4BF | ||
43 | |||
44 | /* Core class values. */ | ||
45 | #define BCMA_CL_SIM 0x0 | ||
46 | #define BCMA_CL_EROM 0x1 | ||
47 | #define BCMA_CL_CORESIGHT 0x9 | ||
48 | #define BCMA_CL_VERIF 0xB | ||
49 | #define BCMA_CL_OPTIMO 0xD | ||
50 | #define BCMA_CL_GEN 0xE | ||
51 | #define BCMA_CL_PRIMECELL 0xF | ||
52 | |||
53 | /* Core-ID values. */ | ||
54 | #define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ | ||
55 | #define BCMA_CORE_INVALID 0x700 | ||
56 | #define BCMA_CORE_CHIPCOMMON 0x800 | ||
57 | #define BCMA_CORE_ILINE20 0x801 | ||
58 | #define BCMA_CORE_SRAM 0x802 | ||
59 | #define BCMA_CORE_SDRAM 0x803 | ||
60 | #define BCMA_CORE_PCI 0x804 | ||
61 | #define BCMA_CORE_MIPS 0x805 | ||
62 | #define BCMA_CORE_ETHERNET 0x806 | ||
63 | #define BCMA_CORE_V90 0x807 | ||
64 | #define BCMA_CORE_USB11_HOSTDEV 0x808 | ||
65 | #define BCMA_CORE_ADSL 0x809 | ||
66 | #define BCMA_CORE_ILINE100 0x80A | ||
67 | #define BCMA_CORE_IPSEC 0x80B | ||
68 | #define BCMA_CORE_UTOPIA 0x80C | ||
69 | #define BCMA_CORE_PCMCIA 0x80D | ||
70 | #define BCMA_CORE_INTERNAL_MEM 0x80E | ||
71 | #define BCMA_CORE_MEMC_SDRAM 0x80F | ||
72 | #define BCMA_CORE_OFDM 0x810 | ||
73 | #define BCMA_CORE_EXTIF 0x811 | ||
74 | #define BCMA_CORE_80211 0x812 | ||
75 | #define BCMA_CORE_PHY_A 0x813 | ||
76 | #define BCMA_CORE_PHY_B 0x814 | ||
77 | #define BCMA_CORE_PHY_G 0x815 | ||
78 | #define BCMA_CORE_MIPS_3302 0x816 | ||
79 | #define BCMA_CORE_USB11_HOST 0x817 | ||
80 | #define BCMA_CORE_USB11_DEV 0x818 | ||
81 | #define BCMA_CORE_USB20_HOST 0x819 | ||
82 | #define BCMA_CORE_USB20_DEV 0x81A | ||
83 | #define BCMA_CORE_SDIO_HOST 0x81B | ||
84 | #define BCMA_CORE_ROBOSWITCH 0x81C | ||
85 | #define BCMA_CORE_PARA_ATA 0x81D | ||
86 | #define BCMA_CORE_SATA_XORDMA 0x81E | ||
87 | #define BCMA_CORE_ETHERNET_GBIT 0x81F | ||
88 | #define BCMA_CORE_PCIE 0x820 | ||
89 | #define BCMA_CORE_PHY_N 0x821 | ||
90 | #define BCMA_CORE_SRAM_CTL 0x822 | ||
91 | #define BCMA_CORE_MINI_MACPHY 0x823 | ||
92 | #define BCMA_CORE_ARM_1176 0x824 | ||
93 | #define BCMA_CORE_ARM_7TDMI 0x825 | ||
94 | #define BCMA_CORE_PHY_LP 0x826 | ||
95 | #define BCMA_CORE_PMU 0x827 | ||
96 | #define BCMA_CORE_PHY_SSN 0x828 | ||
97 | #define BCMA_CORE_SDIO_DEV 0x829 | ||
98 | #define BCMA_CORE_ARM_CM3 0x82A | ||
99 | #define BCMA_CORE_PHY_HT 0x82B | ||
100 | #define BCMA_CORE_MIPS_74K 0x82C | ||
101 | #define BCMA_CORE_MAC_GBIT 0x82D | ||
102 | #define BCMA_CORE_DDR12_MEM_CTL 0x82E | ||
103 | #define BCMA_CORE_PCIE_RC 0x82F /* PCIe Root Complex */ | ||
104 | #define BCMA_CORE_OCP_OCP_BRIDGE 0x830 | ||
105 | #define BCMA_CORE_SHARED_COMMON 0x831 | ||
106 | #define BCMA_CORE_OCP_AHB_BRIDGE 0x832 | ||
107 | #define BCMA_CORE_SPI_HOST 0x833 | ||
108 | #define BCMA_CORE_I2S 0x834 | ||
109 | #define BCMA_CORE_SDR_DDR1_MEM_CTL 0x835 /* SDR/DDR1 memory controller core */ | ||
110 | #define BCMA_CORE_SHIM 0x837 /* SHIM component in ubus/6362 */ | ||
111 | #define BCMA_CORE_DEFAULT 0xFFF | ||
112 | |||
113 | #define BCMA_MAX_NR_CORES 16 | ||
114 | |||
115 | struct bcma_device { | ||
116 | struct bcma_bus *bus; | ||
117 | struct bcma_device_id id; | ||
118 | |||
119 | struct device dev; | ||
120 | bool dev_registered; | ||
121 | |||
122 | u8 core_index; | ||
123 | |||
124 | u32 addr; | ||
125 | u32 wrap; | ||
126 | |||
127 | void *drvdata; | ||
128 | struct list_head list; | ||
129 | }; | ||
130 | |||
131 | static inline void *bcma_get_drvdata(struct bcma_device *core) | ||
132 | { | ||
133 | return core->drvdata; | ||
134 | } | ||
135 | static inline void bcma_set_drvdata(struct bcma_device *core, void *drvdata) | ||
136 | { | ||
137 | core->drvdata = drvdata; | ||
138 | } | ||
139 | |||
140 | struct bcma_driver { | ||
141 | const char *name; | ||
142 | const struct bcma_device_id *id_table; | ||
143 | |||
144 | int (*probe)(struct bcma_device *dev); | ||
145 | void (*remove)(struct bcma_device *dev); | ||
146 | int (*suspend)(struct bcma_device *dev, pm_message_t state); | ||
147 | int (*resume)(struct bcma_device *dev); | ||
148 | void (*shutdown)(struct bcma_device *dev); | ||
149 | |||
150 | struct device_driver drv; | ||
151 | }; | ||
152 | extern | ||
153 | int __bcma_driver_register(struct bcma_driver *drv, struct module *owner); | ||
154 | static inline int bcma_driver_register(struct bcma_driver *drv) | ||
155 | { | ||
156 | return __bcma_driver_register(drv, THIS_MODULE); | ||
157 | } | ||
158 | extern void bcma_driver_unregister(struct bcma_driver *drv); | ||
159 | |||
160 | struct bcma_bus { | ||
161 | /* The MMIO area. */ | ||
162 | void __iomem *mmio; | ||
163 | |||
164 | const struct bcma_host_ops *ops; | ||
165 | |||
166 | enum bcma_hosttype hosttype; | ||
167 | union { | ||
168 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ | ||
169 | struct pci_dev *host_pci; | ||
170 | /* Pointer to the SDIO device (only for BCMA_HOSTTYPE_SDIO) */ | ||
171 | struct sdio_func *host_sdio; | ||
172 | }; | ||
173 | |||
174 | struct bcma_chipinfo chipinfo; | ||
175 | |||
176 | struct bcma_device *mapped_core; | ||
177 | struct list_head cores; | ||
178 | u8 nr_cores; | ||
179 | |||
180 | struct bcma_drv_cc drv_cc; | ||
181 | struct bcma_drv_pci drv_pci; | ||
182 | }; | ||
183 | |||
184 | extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) | ||
185 | { | ||
186 | return core->bus->ops->read8(core, offset); | ||
187 | } | ||
188 | extern inline u32 bcma_read16(struct bcma_device *core, u16 offset) | ||
189 | { | ||
190 | return core->bus->ops->read16(core, offset); | ||
191 | } | ||
192 | extern inline u32 bcma_read32(struct bcma_device *core, u16 offset) | ||
193 | { | ||
194 | return core->bus->ops->read32(core, offset); | ||
195 | } | ||
196 | extern inline | ||
197 | void bcma_write8(struct bcma_device *core, u16 offset, u32 value) | ||
198 | { | ||
199 | core->bus->ops->write8(core, offset, value); | ||
200 | } | ||
201 | extern inline | ||
202 | void bcma_write16(struct bcma_device *core, u16 offset, u32 value) | ||
203 | { | ||
204 | core->bus->ops->write16(core, offset, value); | ||
205 | } | ||
206 | extern inline | ||
207 | void bcma_write32(struct bcma_device *core, u16 offset, u32 value) | ||
208 | { | ||
209 | core->bus->ops->write32(core, offset, value); | ||
210 | } | ||
211 | extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) | ||
212 | { | ||
213 | return core->bus->ops->aread32(core, offset); | ||
214 | } | ||
215 | extern inline | ||
216 | void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value) | ||
217 | { | ||
218 | core->bus->ops->awrite32(core, offset, value); | ||
219 | } | ||
220 | |||
221 | extern bool bcma_core_is_enabled(struct bcma_device *core); | ||
222 | extern int bcma_core_enable(struct bcma_device *core, u32 flags); | ||
223 | |||
224 | #endif /* LINUX_BCMA_H_ */ | ||
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h new file mode 100644 index 000000000000..083c3b6cd5ce --- /dev/null +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -0,0 +1,302 @@ | |||
1 | #ifndef LINUX_BCMA_DRIVER_CC_H_ | ||
2 | #define LINUX_BCMA_DRIVER_CC_H_ | ||
3 | |||
4 | /** ChipCommon core registers. **/ | ||
5 | #define BCMA_CC_ID 0x0000 | ||
6 | #define BCMA_CC_ID_ID 0x0000FFFF | ||
7 | #define BCMA_CC_ID_ID_SHIFT 0 | ||
8 | #define BCMA_CC_ID_REV 0x000F0000 | ||
9 | #define BCMA_CC_ID_REV_SHIFT 16 | ||
10 | #define BCMA_CC_ID_PKG 0x00F00000 | ||
11 | #define BCMA_CC_ID_PKG_SHIFT 20 | ||
12 | #define BCMA_CC_ID_NRCORES 0x0F000000 | ||
13 | #define BCMA_CC_ID_NRCORES_SHIFT 24 | ||
14 | #define BCMA_CC_ID_TYPE 0xF0000000 | ||
15 | #define BCMA_CC_ID_TYPE_SHIFT 28 | ||
16 | #define BCMA_CC_CAP 0x0004 /* Capabilities */ | ||
17 | #define BCMA_CC_CAP_NRUART 0x00000003 /* # of UARTs */ | ||
18 | #define BCMA_CC_CAP_MIPSEB 0x00000004 /* MIPS in BigEndian Mode */ | ||
19 | #define BCMA_CC_CAP_UARTCLK 0x00000018 /* UART clock select */ | ||
20 | #define BCMA_CC_CAP_UARTCLK_INT 0x00000008 /* UARTs are driven by internal divided clock */ | ||
21 | #define BCMA_CC_CAP_UARTGPIO 0x00000020 /* UARTs on GPIO 15-12 */ | ||
22 | #define BCMA_CC_CAP_EXTBUS 0x000000C0 /* External buses present */ | ||
23 | #define BCMA_CC_CAP_FLASHT 0x00000700 /* Flash Type */ | ||
24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ | ||
25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ | ||
26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ | ||
27 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ | ||
28 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ | ||
29 | #define BCMA_PLLTYPE_NONE 0x00000000 | ||
30 | #define BCMA_PLLTYPE_1 0x00010000 /* 48Mhz base, 3 dividers */ | ||
31 | #define BCMA_PLLTYPE_2 0x00020000 /* 48Mhz, 4 dividers */ | ||
32 | #define BCMA_PLLTYPE_3 0x00030000 /* 25Mhz, 2 dividers */ | ||
33 | #define BCMA_PLLTYPE_4 0x00008000 /* 48Mhz, 4 dividers */ | ||
34 | #define BCMA_PLLTYPE_5 0x00018000 /* 25Mhz, 4 dividers */ | ||
35 | #define BCMA_PLLTYPE_6 0x00028000 /* 100/200 or 120/240 only */ | ||
36 | #define BCMA_PLLTYPE_7 0x00038000 /* 25Mhz, 4 dividers */ | ||
37 | #define BCMA_CC_CAP_PCTL 0x00040000 /* Power Control */ | ||
38 | #define BCMA_CC_CAP_OTPS 0x00380000 /* OTP size */ | ||
39 | #define BCMA_CC_CAP_OTPS_SHIFT 19 | ||
40 | #define BCMA_CC_CAP_OTPS_BASE 5 | ||
41 | #define BCMA_CC_CAP_JTAGM 0x00400000 /* JTAG master present */ | ||
42 | #define BCMA_CC_CAP_BROM 0x00800000 /* Internal boot ROM active */ | ||
43 | #define BCMA_CC_CAP_64BIT 0x08000000 /* 64-bit Backplane */ | ||
44 | #define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ | ||
45 | #define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ | ||
46 | #define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ | ||
47 | #define BCMA_CC_CORECTL 0x0008 | ||
48 | #define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ | ||
49 | #define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ | ||
50 | #define BCMA_CC_CORECTL_UARTCLKEN 0x00000008 /* UART clock enable (rev >= 21) */ | ||
51 | #define BCMA_CC_BIST 0x000C | ||
52 | #define BCMA_CC_OTPS 0x0010 /* OTP status */ | ||
53 | #define BCMA_CC_OTPS_PROGFAIL 0x80000000 | ||
54 | #define BCMA_CC_OTPS_PROTECT 0x00000007 | ||
55 | #define BCMA_CC_OTPS_HW_PROTECT 0x00000001 | ||
56 | #define BCMA_CC_OTPS_SW_PROTECT 0x00000002 | ||
57 | #define BCMA_CC_OTPS_CID_PROTECT 0x00000004 | ||
58 | #define BCMA_CC_OTPC 0x0014 /* OTP control */ | ||
59 | #define BCMA_CC_OTPC_RECWAIT 0xFF000000 | ||
60 | #define BCMA_CC_OTPC_PROGWAIT 0x00FFFF00 | ||
61 | #define BCMA_CC_OTPC_PRW_SHIFT 8 | ||
62 | #define BCMA_CC_OTPC_MAXFAIL 0x00000038 | ||
63 | #define BCMA_CC_OTPC_VSEL 0x00000006 | ||
64 | #define BCMA_CC_OTPC_SELVL 0x00000001 | ||
65 | #define BCMA_CC_OTPP 0x0018 /* OTP prog */ | ||
66 | #define BCMA_CC_OTPP_COL 0x000000FF | ||
67 | #define BCMA_CC_OTPP_ROW 0x0000FF00 | ||
68 | #define BCMA_CC_OTPP_ROW_SHIFT 8 | ||
69 | #define BCMA_CC_OTPP_READERR 0x10000000 | ||
70 | #define BCMA_CC_OTPP_VALUE 0x20000000 | ||
71 | #define BCMA_CC_OTPP_READ 0x40000000 | ||
72 | #define BCMA_CC_OTPP_START 0x80000000 | ||
73 | #define BCMA_CC_OTPP_BUSY 0x80000000 | ||
74 | #define BCMA_CC_IRQSTAT 0x0020 | ||
75 | #define BCMA_CC_IRQMASK 0x0024 | ||
76 | #define BCMA_CC_IRQ_GPIO 0x00000001 /* gpio intr */ | ||
77 | #define BCMA_CC_IRQ_EXT 0x00000002 /* ro: ext intr pin (corerev >= 3) */ | ||
78 | #define BCMA_CC_IRQ_WDRESET 0x80000000 /* watchdog reset occurred */ | ||
79 | #define BCMA_CC_CHIPCTL 0x0028 /* Rev >= 11 only */ | ||
80 | #define BCMA_CC_CHIPSTAT 0x002C /* Rev >= 11 only */ | ||
81 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ | ||
82 | #define BCMA_CC_JCMD_START 0x80000000 | ||
83 | #define BCMA_CC_JCMD_BUSY 0x80000000 | ||
84 | #define BCMA_CC_JCMD_PAUSE 0x40000000 | ||
85 | #define BCMA_CC_JCMD0_ACC_MASK 0x0000F000 | ||
86 | #define BCMA_CC_JCMD0_ACC_IRDR 0x00000000 | ||
87 | #define BCMA_CC_JCMD0_ACC_DR 0x00001000 | ||
88 | #define BCMA_CC_JCMD0_ACC_IR 0x00002000 | ||
89 | #define BCMA_CC_JCMD0_ACC_RESET 0x00003000 | ||
90 | #define BCMA_CC_JCMD0_ACC_IRPDR 0x00004000 | ||
91 | #define BCMA_CC_JCMD0_ACC_PDR 0x00005000 | ||
92 | #define BCMA_CC_JCMD0_IRW_MASK 0x00000F00 | ||
93 | #define BCMA_CC_JCMD_ACC_MASK 0x000F0000 /* Changes for corerev 11 */ | ||
94 | #define BCMA_CC_JCMD_ACC_IRDR 0x00000000 | ||
95 | #define BCMA_CC_JCMD_ACC_DR 0x00010000 | ||
96 | #define BCMA_CC_JCMD_ACC_IR 0x00020000 | ||
97 | #define BCMA_CC_JCMD_ACC_RESET 0x00030000 | ||
98 | #define BCMA_CC_JCMD_ACC_IRPDR 0x00040000 | ||
99 | #define BCMA_CC_JCMD_ACC_PDR 0x00050000 | ||
100 | #define BCMA_CC_JCMD_IRW_MASK 0x00001F00 | ||
101 | #define BCMA_CC_JCMD_IRW_SHIFT 8 | ||
102 | #define BCMA_CC_JCMD_DRW_MASK 0x0000003F | ||
103 | #define BCMA_CC_JIR 0x0034 /* Rev >= 10 only */ | ||
104 | #define BCMA_CC_JDR 0x0038 /* Rev >= 10 only */ | ||
105 | #define BCMA_CC_JCTL 0x003C /* Rev >= 10 only */ | ||
106 | #define BCMA_CC_JCTL_FORCE_CLK 4 /* Force clock */ | ||
107 | #define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ | ||
108 | #define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ | ||
109 | #define BCMA_CC_FLASHCTL 0x0040 | ||
110 | #define BCMA_CC_FLASHCTL_START 0x80000000 | ||
111 | #define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START | ||
112 | #define BCMA_CC_FLASHADDR 0x0044 | ||
113 | #define BCMA_CC_FLASHDATA 0x0048 | ||
114 | #define BCMA_CC_BCAST_ADDR 0x0050 | ||
115 | #define BCMA_CC_BCAST_DATA 0x0054 | ||
116 | #define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ | ||
117 | #define BCMA_CC_GPIOPULLDOWN 0x005C /* Rev >= 20 only */ | ||
118 | #define BCMA_CC_GPIOIN 0x0060 | ||
119 | #define BCMA_CC_GPIOOUT 0x0064 | ||
120 | #define BCMA_CC_GPIOOUTEN 0x0068 | ||
121 | #define BCMA_CC_GPIOCTL 0x006C | ||
122 | #define BCMA_CC_GPIOPOL 0x0070 | ||
123 | #define BCMA_CC_GPIOIRQ 0x0074 | ||
124 | #define BCMA_CC_WATCHDOG 0x0080 | ||
125 | #define BCMA_CC_GPIOTIMER 0x0088 /* LED powersave (corerev >= 16) */ | ||
126 | #define BCMA_CC_GPIOTIMER_OFFTIME 0x0000FFFF | ||
127 | #define BCMA_CC_GPIOTIMER_OFFTIME_SHIFT 0 | ||
128 | #define BCMA_CC_GPIOTIMER_ONTIME 0xFFFF0000 | ||
129 | #define BCMA_CC_GPIOTIMER_ONTIME_SHIFT 16 | ||
130 | #define BCMA_CC_GPIOTOUTM 0x008C /* LED powersave (corerev >= 16) */ | ||
131 | #define BCMA_CC_CLOCK_N 0x0090 | ||
132 | #define BCMA_CC_CLOCK_SB 0x0094 | ||
133 | #define BCMA_CC_CLOCK_PCI 0x0098 | ||
134 | #define BCMA_CC_CLOCK_M2 0x009C | ||
135 | #define BCMA_CC_CLOCK_MIPS 0x00A0 | ||
136 | #define BCMA_CC_CLKDIV 0x00A4 /* Rev >= 3 only */ | ||
137 | #define BCMA_CC_CLKDIV_SFLASH 0x0F000000 | ||
138 | #define BCMA_CC_CLKDIV_SFLASH_SHIFT 24 | ||
139 | #define BCMA_CC_CLKDIV_OTP 0x000F0000 | ||
140 | #define BCMA_CC_CLKDIV_OTP_SHIFT 16 | ||
141 | #define BCMA_CC_CLKDIV_JTAG 0x00000F00 | ||
142 | #define BCMA_CC_CLKDIV_JTAG_SHIFT 8 | ||
143 | #define BCMA_CC_CLKDIV_UART 0x000000FF | ||
144 | #define BCMA_CC_CAP_EXT 0x00AC /* Capabilities */ | ||
145 | #define BCMA_CC_PLLONDELAY 0x00B0 /* Rev >= 4 only */ | ||
146 | #define BCMA_CC_FREFSELDELAY 0x00B4 /* Rev >= 4 only */ | ||
147 | #define BCMA_CC_SLOWCLKCTL 0x00B8 /* 6 <= Rev <= 9 only */ | ||
148 | #define BCMA_CC_SLOWCLKCTL_SRC 0x00000007 /* slow clock source mask */ | ||
149 | #define BCMA_CC_SLOWCLKCTL_SRC_LPO 0x00000000 /* source of slow clock is LPO */ | ||
150 | #define BCMA_CC_SLOWCLKCTL_SRC_XTAL 0x00000001 /* source of slow clock is crystal */ | ||
151 | #define BCMA_CC_SLOECLKCTL_SRC_PCI 0x00000002 /* source of slow clock is PCI */ | ||
152 | #define BCMA_CC_SLOWCLKCTL_LPOFREQ 0x00000200 /* LPOFreqSel, 1: 160Khz, 0: 32KHz */ | ||
153 | #define BCMA_CC_SLOWCLKCTL_LPOPD 0x00000400 /* LPOPowerDown, 1: LPO is disabled, 0: LPO is enabled */ | ||
154 | #define BCMA_CC_SLOWCLKCTL_FSLOW 0x00000800 /* ForceSlowClk, 1: sb/cores running on slow clock, 0: power logic control */ | ||
155 | #define BCMA_CC_SLOWCLKCTL_IPLL 0x00001000 /* IgnorePllOffReq, 1/0: power logic ignores/honors PLL clock disable requests from core */ | ||
156 | #define BCMA_CC_SLOWCLKCTL_ENXTAL 0x00002000 /* XtalControlEn, 1/0: power logic does/doesn't disable crystal when appropriate */ | ||
157 | #define BCMA_CC_SLOWCLKCTL_XTALPU 0x00004000 /* XtalPU (RO), 1/0: crystal running/disabled */ | ||
158 | #define BCMA_CC_SLOWCLKCTL_CLKDIV 0xFFFF0000 /* ClockDivider (SlowClk = 1/(4+divisor)) */ | ||
159 | #define BCMA_CC_SLOWCLKCTL_CLKDIV_SHIFT 16 | ||
160 | #define BCMA_CC_SYSCLKCTL 0x00C0 /* Rev >= 3 only */ | ||
161 | #define BCMA_CC_SYSCLKCTL_IDLPEN 0x00000001 /* ILPen: Enable Idle Low Power */ | ||
162 | #define BCMA_CC_SYSCLKCTL_ALPEN 0x00000002 /* ALPen: Enable Active Low Power */ | ||
163 | #define BCMA_CC_SYSCLKCTL_PLLEN 0x00000004 /* ForcePLLOn */ | ||
164 | #define BCMA_CC_SYSCLKCTL_FORCEALP 0x00000008 /* Force ALP (or HT if ALPen is not set */ | ||
165 | #define BCMA_CC_SYSCLKCTL_FORCEHT 0x00000010 /* Force HT */ | ||
166 | #define BCMA_CC_SYSCLKCTL_CLKDIV 0xFFFF0000 /* ClkDiv (ILP = 1/(4+divisor)) */ | ||
167 | #define BCMA_CC_SYSCLKCTL_CLKDIV_SHIFT 16 | ||
168 | #define BCMA_CC_CLKSTSTR 0x00C4 /* Rev >= 3 only */ | ||
169 | #define BCMA_CC_EROM 0x00FC | ||
170 | #define BCMA_CC_PCMCIA_CFG 0x0100 | ||
171 | #define BCMA_CC_PCMCIA_MEMWAIT 0x0104 | ||
172 | #define BCMA_CC_PCMCIA_ATTRWAIT 0x0108 | ||
173 | #define BCMA_CC_PCMCIA_IOWAIT 0x010C | ||
174 | #define BCMA_CC_IDE_CFG 0x0110 | ||
175 | #define BCMA_CC_IDE_MEMWAIT 0x0114 | ||
176 | #define BCMA_CC_IDE_ATTRWAIT 0x0118 | ||
177 | #define BCMA_CC_IDE_IOWAIT 0x011C | ||
178 | #define BCMA_CC_PROG_CFG 0x0120 | ||
179 | #define BCMA_CC_PROG_WAITCNT 0x0124 | ||
180 | #define BCMA_CC_FLASH_CFG 0x0128 | ||
181 | #define BCMA_CC_FLASH_WAITCNT 0x012C | ||
182 | #define BCMA_CC_CLKCTLST 0x01E0 /* Clock control and status (rev >= 20) */ | ||
183 | #define BCMA_CC_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */ | ||
184 | #define BCMA_CC_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */ | ||
185 | #define BCMA_CC_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */ | ||
186 | #define BCMA_CC_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */ | ||
187 | #define BCMA_CC_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | ||
188 | #define BCMA_CC_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | ||
189 | #define BCMA_CC_CLKCTLST_HAVEHT 0x00010000 /* HT available */ | ||
190 | #define BCMA_CC_CLKCTLST_HAVEALP 0x00020000 /* APL available */ | ||
191 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | ||
192 | #define BCMA_CC_UART0_DATA 0x0300 | ||
193 | #define BCMA_CC_UART0_IMR 0x0304 | ||
194 | #define BCMA_CC_UART0_FCR 0x0308 | ||
195 | #define BCMA_CC_UART0_LCR 0x030C | ||
196 | #define BCMA_CC_UART0_MCR 0x0310 | ||
197 | #define BCMA_CC_UART0_LSR 0x0314 | ||
198 | #define BCMA_CC_UART0_MSR 0x0318 | ||
199 | #define BCMA_CC_UART0_SCRATCH 0x031C | ||
200 | #define BCMA_CC_UART1_DATA 0x0400 | ||
201 | #define BCMA_CC_UART1_IMR 0x0404 | ||
202 | #define BCMA_CC_UART1_FCR 0x0408 | ||
203 | #define BCMA_CC_UART1_LCR 0x040C | ||
204 | #define BCMA_CC_UART1_MCR 0x0410 | ||
205 | #define BCMA_CC_UART1_LSR 0x0414 | ||
206 | #define BCMA_CC_UART1_MSR 0x0418 | ||
207 | #define BCMA_CC_UART1_SCRATCH 0x041C | ||
208 | /* PMU registers (rev >= 20) */ | ||
209 | #define BCMA_CC_PMU_CTL 0x0600 /* PMU control */ | ||
210 | #define BCMA_CC_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ | ||
211 | #define BCMA_CC_PMU_CTL_ILP_DIV_SHIFT 16 | ||
212 | #define BCMA_CC_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ | ||
213 | #define BCMA_CC_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ | ||
214 | #define BCMA_CC_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */ | ||
215 | #define BCMA_CC_PMU_CTL_XTALFREQ 0x0000007C /* Crystal freq */ | ||
216 | #define BCMA_CC_PMU_CTL_XTALFREQ_SHIFT 2 | ||
217 | #define BCMA_CC_PMU_CTL_ILPDIVEN 0x00000002 /* ILP div enable */ | ||
218 | #define BCMA_CC_PMU_CTL_LPOSEL 0x00000001 /* LPO sel */ | ||
219 | #define BCMA_CC_PMU_CAP 0x0604 /* PMU capabilities */ | ||
220 | #define BCMA_CC_PMU_CAP_REVISION 0x000000FF /* Revision mask */ | ||
221 | #define BCMA_CC_PMU_STAT 0x0608 /* PMU status */ | ||
222 | #define BCMA_CC_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */ | ||
223 | #define BCMA_CC_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */ | ||
224 | #define BCMA_CC_PMU_STAT_HAVEALP 0x00000008 /* ALP available */ | ||
225 | #define BCMA_CC_PMU_STAT_HAVEHT 0x00000004 /* HT available */ | ||
226 | #define BCMA_CC_PMU_STAT_RESINIT 0x00000003 /* Res init */ | ||
227 | #define BCMA_CC_PMU_RES_STAT 0x060C /* PMU res status */ | ||
228 | #define BCMA_CC_PMU_RES_PEND 0x0610 /* PMU res pending */ | ||
229 | #define BCMA_CC_PMU_TIMER 0x0614 /* PMU timer */ | ||
230 | #define BCMA_CC_PMU_MINRES_MSK 0x0618 /* PMU min res mask */ | ||
231 | #define BCMA_CC_PMU_MAXRES_MSK 0x061C /* PMU max res mask */ | ||
232 | #define BCMA_CC_PMU_RES_TABSEL 0x0620 /* PMU res table sel */ | ||
233 | #define BCMA_CC_PMU_RES_DEPMSK 0x0624 /* PMU res dep mask */ | ||
234 | #define BCMA_CC_PMU_RES_UPDNTM 0x0628 /* PMU res updown timer */ | ||
235 | #define BCMA_CC_PMU_RES_TIMER 0x062C /* PMU res timer */ | ||
236 | #define BCMA_CC_PMU_CLKSTRETCH 0x0630 /* PMU clockstretch */ | ||
237 | #define BCMA_CC_PMU_WATCHDOG 0x0634 /* PMU watchdog */ | ||
238 | #define BCMA_CC_PMU_RES_REQTS 0x0640 /* PMU res req timer sel */ | ||
239 | #define BCMA_CC_PMU_RES_REQT 0x0644 /* PMU res req timer */ | ||
240 | #define BCMA_CC_PMU_RES_REQM 0x0648 /* PMU res req mask */ | ||
241 | #define BCMA_CC_CHIPCTL_ADDR 0x0650 | ||
242 | #define BCMA_CC_CHIPCTL_DATA 0x0654 | ||
243 | #define BCMA_CC_REGCTL_ADDR 0x0658 | ||
244 | #define BCMA_CC_REGCTL_DATA 0x065C | ||
245 | #define BCMA_CC_PLLCTL_ADDR 0x0660 | ||
246 | #define BCMA_CC_PLLCTL_DATA 0x0664 | ||
247 | |||
248 | /* Data for the PMU, if available. | ||
249 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | ||
250 | */ | ||
251 | struct bcma_chipcommon_pmu { | ||
252 | u8 rev; /* PMU revision */ | ||
253 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ | ||
254 | }; | ||
255 | |||
256 | struct bcma_drv_cc { | ||
257 | struct bcma_device *core; | ||
258 | u32 status; | ||
259 | u32 capabilities; | ||
260 | u32 capabilities_ext; | ||
261 | /* Fast Powerup Delay constant */ | ||
262 | u16 fast_pwrup_delay; | ||
263 | struct bcma_chipcommon_pmu pmu; | ||
264 | }; | ||
265 | |||
266 | /* Register access */ | ||
267 | #define bcma_cc_read32(cc, offset) \ | ||
268 | bcma_read32((cc)->core, offset) | ||
269 | #define bcma_cc_write32(cc, offset, val) \ | ||
270 | bcma_write32((cc)->core, offset, val) | ||
271 | |||
272 | #define bcma_cc_mask32(cc, offset, mask) \ | ||
273 | bcma_cc_write32(cc, offset, bcma_cc_read32(cc, offset) & (mask)) | ||
274 | #define bcma_cc_set32(cc, offset, set) \ | ||
275 | bcma_cc_write32(cc, offset, bcma_cc_read32(cc, offset) | (set)) | ||
276 | #define bcma_cc_maskset32(cc, offset, mask, set) \ | ||
277 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) | ||
278 | |||
279 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); | ||
280 | |||
281 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); | ||
282 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); | ||
283 | |||
284 | extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, | ||
285 | u32 ticks); | ||
286 | |||
287 | void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
288 | |||
289 | u32 bcma_chipco_irq_status(struct bcma_drv_cc *cc, u32 mask); | ||
290 | |||
291 | /* Chipcommon GPIO pin access. */ | ||
292 | u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask); | ||
293 | u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
294 | u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
295 | u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
296 | u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
297 | u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); | ||
298 | |||
299 | /* PMU support */ | ||
300 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); | ||
301 | |||
302 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ | ||
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h new file mode 100644 index 000000000000..b7e191cf00ec --- /dev/null +++ b/include/linux/bcma/bcma_driver_pci.h | |||
@@ -0,0 +1,89 @@ | |||
1 | #ifndef LINUX_BCMA_DRIVER_PCI_H_ | ||
2 | #define LINUX_BCMA_DRIVER_PCI_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct pci_dev; | ||
7 | |||
8 | /** PCI core registers. **/ | ||
9 | #define BCMA_CORE_PCI_CTL 0x0000 /* PCI Control */ | ||
10 | #define BCMA_CORE_PCI_CTL_RST_OE 0x00000001 /* PCI_RESET Output Enable */ | ||
11 | #define BCMA_CORE_PCI_CTL_RST 0x00000002 /* PCI_RESET driven out to pin */ | ||
12 | #define BCMA_CORE_PCI_CTL_CLK_OE 0x00000004 /* Clock gate Output Enable */ | ||
13 | #define BCMA_CORE_PCI_CTL_CLK 0x00000008 /* Gate for clock driven out to pin */ | ||
14 | #define BCMA_CORE_PCI_ARBCTL 0x0010 /* PCI Arbiter Control */ | ||
15 | #define BCMA_CORE_PCI_ARBCTL_INTERN 0x00000001 /* Use internal arbiter */ | ||
16 | #define BCMA_CORE_PCI_ARBCTL_EXTERN 0x00000002 /* Use external arbiter */ | ||
17 | #define BCMA_CORE_PCI_ARBCTL_PARKID 0x00000006 /* Mask, selects which agent is parked on an idle bus */ | ||
18 | #define BCMA_CORE_PCI_ARBCTL_PARKID_LAST 0x00000000 /* Last requestor */ | ||
19 | #define BCMA_CORE_PCI_ARBCTL_PARKID_4710 0x00000002 /* 4710 */ | ||
20 | #define BCMA_CORE_PCI_ARBCTL_PARKID_EXT0 0x00000004 /* External requestor 0 */ | ||
21 | #define BCMA_CORE_PCI_ARBCTL_PARKID_EXT1 0x00000006 /* External requestor 1 */ | ||
22 | #define BCMA_CORE_PCI_ISTAT 0x0020 /* Interrupt status */ | ||
23 | #define BCMA_CORE_PCI_ISTAT_INTA 0x00000001 /* PCI INTA# */ | ||
24 | #define BCMA_CORE_PCI_ISTAT_INTB 0x00000002 /* PCI INTB# */ | ||
25 | #define BCMA_CORE_PCI_ISTAT_SERR 0x00000004 /* PCI SERR# (write to clear) */ | ||
26 | #define BCMA_CORE_PCI_ISTAT_PERR 0x00000008 /* PCI PERR# (write to clear) */ | ||
27 | #define BCMA_CORE_PCI_ISTAT_PME 0x00000010 /* PCI PME# */ | ||
28 | #define BCMA_CORE_PCI_IMASK 0x0024 /* Interrupt mask */ | ||
29 | #define BCMA_CORE_PCI_IMASK_INTA 0x00000001 /* PCI INTA# */ | ||
30 | #define BCMA_CORE_PCI_IMASK_INTB 0x00000002 /* PCI INTB# */ | ||
31 | #define BCMA_CORE_PCI_IMASK_SERR 0x00000004 /* PCI SERR# */ | ||
32 | #define BCMA_CORE_PCI_IMASK_PERR 0x00000008 /* PCI PERR# */ | ||
33 | #define BCMA_CORE_PCI_IMASK_PME 0x00000010 /* PCI PME# */ | ||
34 | #define BCMA_CORE_PCI_MBOX 0x0028 /* Backplane to PCI Mailbox */ | ||
35 | #define BCMA_CORE_PCI_MBOX_F0_0 0x00000100 /* PCI function 0, INT 0 */ | ||
36 | #define BCMA_CORE_PCI_MBOX_F0_1 0x00000200 /* PCI function 0, INT 1 */ | ||
37 | #define BCMA_CORE_PCI_MBOX_F1_0 0x00000400 /* PCI function 1, INT 0 */ | ||
38 | #define BCMA_CORE_PCI_MBOX_F1_1 0x00000800 /* PCI function 1, INT 1 */ | ||
39 | #define BCMA_CORE_PCI_MBOX_F2_0 0x00001000 /* PCI function 2, INT 0 */ | ||
40 | #define BCMA_CORE_PCI_MBOX_F2_1 0x00002000 /* PCI function 2, INT 1 */ | ||
41 | #define BCMA_CORE_PCI_MBOX_F3_0 0x00004000 /* PCI function 3, INT 0 */ | ||
42 | #define BCMA_CORE_PCI_MBOX_F3_1 0x00008000 /* PCI function 3, INT 1 */ | ||
43 | #define BCMA_CORE_PCI_BCAST_ADDR 0x0050 /* Backplane Broadcast Address */ | ||
44 | #define BCMA_CORE_PCI_BCAST_ADDR_MASK 0x000000FF | ||
45 | #define BCMA_CORE_PCI_BCAST_DATA 0x0054 /* Backplane Broadcast Data */ | ||
46 | #define BCMA_CORE_PCI_GPIO_IN 0x0060 /* rev >= 2 only */ | ||
47 | #define BCMA_CORE_PCI_GPIO_OUT 0x0064 /* rev >= 2 only */ | ||
48 | #define BCMA_CORE_PCI_GPIO_ENABLE 0x0068 /* rev >= 2 only */ | ||
49 | #define BCMA_CORE_PCI_GPIO_CTL 0x006C /* rev >= 2 only */ | ||
50 | #define BCMA_CORE_PCI_SBTOPCI0 0x0100 /* Backplane to PCI translation 0 (sbtopci0) */ | ||
51 | #define BCMA_CORE_PCI_SBTOPCI0_MASK 0xFC000000 | ||
52 | #define BCMA_CORE_PCI_SBTOPCI1 0x0104 /* Backplane to PCI translation 1 (sbtopci1) */ | ||
53 | #define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000 | ||
54 | #define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ | ||
55 | #define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000 | ||
56 | #define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ | ||
57 | #define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ | ||
58 | #define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ | ||
59 | #define BCMA_CORE_PCI_PCICFG3 0x0700 /* PCI config space 3 (rev >= 8) */ | ||
60 | #define BCMA_CORE_PCI_SPROM(wordoffset) (0x0800 + ((wordoffset) * 2)) /* SPROM shadow area (72 bytes) */ | ||
61 | |||
62 | /* SBtoPCIx */ | ||
63 | #define BCMA_CORE_PCI_SBTOPCI_MEM 0x00000000 | ||
64 | #define BCMA_CORE_PCI_SBTOPCI_IO 0x00000001 | ||
65 | #define BCMA_CORE_PCI_SBTOPCI_CFG0 0x00000002 | ||
66 | #define BCMA_CORE_PCI_SBTOPCI_CFG1 0x00000003 | ||
67 | #define BCMA_CORE_PCI_SBTOPCI_PREF 0x00000004 /* Prefetch enable */ | ||
68 | #define BCMA_CORE_PCI_SBTOPCI_BURST 0x00000008 /* Burst enable */ | ||
69 | #define BCMA_CORE_PCI_SBTOPCI_MRM 0x00000020 /* Memory Read Multiple */ | ||
70 | #define BCMA_CORE_PCI_SBTOPCI_RC 0x00000030 /* Read Command mask (rev >= 11) */ | ||
71 | #define BCMA_CORE_PCI_SBTOPCI_RC_READ 0x00000000 /* Memory read */ | ||
72 | #define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */ | ||
73 | #define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */ | ||
74 | |||
75 | /* PCIcore specific boardflags */ | ||
76 | #define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */ | ||
77 | |||
78 | struct bcma_drv_pci { | ||
79 | struct bcma_device *core; | ||
80 | u8 setup_done:1; | ||
81 | }; | ||
82 | |||
83 | /* Register access */ | ||
84 | #define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset) | ||
85 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) | ||
86 | |||
87 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); | ||
88 | |||
89 | #endif /* LINUX_BCMA_DRIVER_PCI_H_ */ | ||
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h new file mode 100644 index 000000000000..f82d88a960ce --- /dev/null +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef LINUX_BCMA_REGS_H_ | ||
2 | #define LINUX_BCMA_REGS_H_ | ||
3 | |||
4 | /* Agent registers (common for every core) */ | ||
5 | #define BCMA_IOCTL 0x0408 | ||
6 | #define BCMA_IOCTL_CLK 0x0001 | ||
7 | #define BCMA_IOCTL_FGC 0x0002 | ||
8 | #define BCMA_IOCTL_CORE_BITS 0x3FFC | ||
9 | #define BCMA_IOCTL_PME_EN 0x4000 | ||
10 | #define BCMA_IOCTL_BIST_EN 0x8000 | ||
11 | #define BCMA_RESET_CTL 0x0800 | ||
12 | #define BCMA_RESET_CTL_RESET 0x0001 | ||
13 | |||
14 | /* BCMA PCI config space registers. */ | ||
15 | #define BCMA_PCI_PMCSR 0x44 | ||
16 | #define BCMA_PCI_PE 0x100 | ||
17 | #define BCMA_PCI_BAR0_WIN 0x80 /* Backplane address space 0 */ | ||
18 | #define BCMA_PCI_BAR1_WIN 0x84 /* Backplane address space 1 */ | ||
19 | #define BCMA_PCI_SPROMCTL 0x88 /* SPROM control */ | ||
20 | #define BCMA_PCI_SPROMCTL_WE 0x10 /* SPROM write enable */ | ||
21 | #define BCMA_PCI_BAR1_CONTROL 0x8c /* Address space 1 burst control */ | ||
22 | #define BCMA_PCI_IRQS 0x90 /* PCI interrupts */ | ||
23 | #define BCMA_PCI_IRQMASK 0x94 /* PCI IRQ control and mask (pcirev >= 6 only) */ | ||
24 | #define BCMA_PCI_BACKPLANE_IRQS 0x98 /* Backplane Interrupts */ | ||
25 | #define BCMA_PCI_BAR0_WIN2 0xAC | ||
26 | #define BCMA_PCI_GPIO_IN 0xB0 /* GPIO Input (pcirev >= 3 only) */ | ||
27 | #define BCMA_PCI_GPIO_OUT 0xB4 /* GPIO Output (pcirev >= 3 only) */ | ||
28 | #define BCMA_PCI_GPIO_OUT_ENABLE 0xB8 /* GPIO Output Enable/Disable (pcirev >= 3 only) */ | ||
29 | #define BCMA_PCI_GPIO_SCS 0x10 /* PCI config space bit 4 for 4306c0 slow clock source */ | ||
30 | #define BCMA_PCI_GPIO_HWRAD 0x20 /* PCI config space GPIO 13 for hw radio disable */ | ||
31 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ | ||
32 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ | ||
33 | |||
34 | #endif /* LINUX_BCMA_REGS_H_ */ | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index c3d6512eded1..8845613fd7e3 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -60,10 +60,6 @@ struct linux_binprm { | |||
60 | unsigned long loader, exec; | 60 | unsigned long loader, exec; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | extern void acct_arg_size(struct linux_binprm *bprm, unsigned long pages); | ||
64 | extern struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
65 | int write); | ||
66 | |||
67 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 | 63 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 |
68 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) | 64 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) |
69 | 65 | ||
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index daf8c480c786..dcafe0bf0005 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -55,7 +55,8 @@ | |||
55 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf | 55 | * bitmap_parse(buf, buflen, dst, nbits) Parse bitmap dst from kernel buf |
56 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 56 | * bitmap_parse_user(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
57 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | 57 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf |
58 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list | 58 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from kernel buf |
59 | * bitmap_parselist_user(buf, dst, nbits) Parse bitmap dst from user buf | ||
59 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region | 60 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region |
60 | * bitmap_release_region(bitmap, pos, order) Free specified bit region | 61 | * bitmap_release_region(bitmap, pos, order) Free specified bit region |
61 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region | 62 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region |
@@ -129,6 +130,8 @@ extern int bitmap_scnlistprintf(char *buf, unsigned int len, | |||
129 | const unsigned long *src, int nbits); | 130 | const unsigned long *src, int nbits); |
130 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, | 131 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, |
131 | int nmaskbits); | 132 | int nmaskbits); |
133 | extern int bitmap_parselist_user(const char __user *ubuf, unsigned int ulen, | ||
134 | unsigned long *dst, int nbits); | ||
132 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, | 135 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, |
133 | const unsigned long *old, const unsigned long *new, int bits); | 136 | const unsigned long *old, const unsigned long *new, int bits); |
134 | extern int bitmap_bitremap(int oldbit, | 137 | extern int bitmap_bitremap(int oldbit, |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 2184c6b97aeb..a3ef66a2a083 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -148,7 +148,7 @@ static inline unsigned long __ffs64(u64 word) | |||
148 | 148 | ||
149 | #ifdef __KERNEL__ | 149 | #ifdef __KERNEL__ |
150 | 150 | ||
151 | #ifdef CONFIG_GENERIC_FIND_LAST_BIT | 151 | #ifndef find_last_bit |
152 | /** | 152 | /** |
153 | * find_last_bit - find the last set bit in a memory region | 153 | * find_last_bit - find the last set bit in a memory region |
154 | * @addr: The address to start the search at | 154 | * @addr: The address to start the search at |
@@ -158,7 +158,7 @@ static inline unsigned long __ffs64(u64 word) | |||
158 | */ | 158 | */ |
159 | extern unsigned long find_last_bit(const unsigned long *addr, | 159 | extern unsigned long find_last_bit(const unsigned long *addr, |
160 | unsigned long size); | 160 | unsigned long size); |
161 | #endif /* CONFIG_GENERIC_FIND_LAST_BIT */ | 161 | #endif |
162 | 162 | ||
163 | #endif /* __KERNEL__ */ | 163 | #endif /* __KERNEL__ */ |
164 | #endif | 164 | #endif |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index be50d9e70a7d..2a7cea53ca0d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -151,7 +151,6 @@ enum rq_flag_bits { | |||
151 | __REQ_IO_STAT, /* account I/O stat */ | 151 | __REQ_IO_STAT, /* account I/O stat */ |
152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ |
154 | __REQ_ON_PLUG, /* on plug list */ | ||
155 | __REQ_NR_BITS, /* stops here */ | 154 | __REQ_NR_BITS, /* stops here */ |
156 | }; | 155 | }; |
157 | 156 | ||
@@ -192,6 +191,5 @@ enum rq_flag_bits { | |||
192 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 191 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
193 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | 192 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) |
194 | #define REQ_SECURE (1 << __REQ_SECURE) | 193 | #define REQ_SECURE (1 << __REQ_SECURE) |
195 | #define REQ_ON_PLUG (1 << __REQ_ON_PLUG) | ||
196 | 194 | ||
197 | #endif /* __LINUX_BLK_TYPES_H */ | 195 | #endif /* __LINUX_BLK_TYPES_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2ad95fa1d130..1a23722e8878 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -257,7 +257,7 @@ struct queue_limits { | |||
257 | unsigned char misaligned; | 257 | unsigned char misaligned; |
258 | unsigned char discard_misaligned; | 258 | unsigned char discard_misaligned; |
259 | unsigned char cluster; | 259 | unsigned char cluster; |
260 | signed char discard_zeroes_data; | 260 | unsigned char discard_zeroes_data; |
261 | }; | 261 | }; |
262 | 262 | ||
263 | struct request_queue | 263 | struct request_queue |
@@ -364,6 +364,8 @@ struct request_queue | |||
364 | * for flush operations | 364 | * for flush operations |
365 | */ | 365 | */ |
366 | unsigned int flush_flags; | 366 | unsigned int flush_flags; |
367 | unsigned int flush_not_queueable:1; | ||
368 | unsigned int flush_queue_delayed:1; | ||
367 | unsigned int flush_pending_idx:1; | 369 | unsigned int flush_pending_idx:1; |
368 | unsigned int flush_running_idx:1; | 370 | unsigned int flush_running_idx:1; |
369 | unsigned long flush_pending_since; | 371 | unsigned long flush_pending_since; |
@@ -843,6 +845,7 @@ extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | |||
843 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | 845 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); |
844 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 846 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
845 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); | 847 | extern void blk_queue_flush(struct request_queue *q, unsigned int flush); |
848 | extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); | ||
846 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 849 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
847 | 850 | ||
848 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 851 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
@@ -1066,13 +1069,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector | |||
1066 | { | 1069 | { |
1067 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); | 1070 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
1068 | 1071 | ||
1072 | if (!lim->max_discard_sectors) | ||
1073 | return 0; | ||
1074 | |||
1069 | return (lim->discard_granularity + lim->discard_alignment - alignment) | 1075 | return (lim->discard_granularity + lim->discard_alignment - alignment) |
1070 | & (lim->discard_granularity - 1); | 1076 | & (lim->discard_granularity - 1); |
1071 | } | 1077 | } |
1072 | 1078 | ||
1073 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1079 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
1074 | { | 1080 | { |
1075 | if (q->limits.discard_zeroes_data == 1) | 1081 | if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) |
1076 | return 1; | 1082 | return 1; |
1077 | 1083 | ||
1078 | return 0; | 1084 | return 0; |
@@ -1111,6 +1117,11 @@ static inline unsigned int block_size(struct block_device *bdev) | |||
1111 | return bdev->bd_block_size; | 1117 | return bdev->bd_block_size; |
1112 | } | 1118 | } |
1113 | 1119 | ||
1120 | static inline bool queue_flush_queueable(struct request_queue *q) | ||
1121 | { | ||
1122 | return !q->flush_not_queueable; | ||
1123 | } | ||
1124 | |||
1114 | typedef struct {struct page *v;} Sector; | 1125 | typedef struct {struct page *v;} Sector; |
1115 | 1126 | ||
1116 | unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *); | 1127 | unsigned char *read_dev_sector(struct block_device *, sector_t, Sector *); |
@@ -1271,8 +1282,8 @@ queue_max_integrity_segments(struct request_queue *q) | |||
1271 | #define blk_get_integrity(a) (0) | 1282 | #define blk_get_integrity(a) (0) |
1272 | #define blk_integrity_compare(a, b) (0) | 1283 | #define blk_integrity_compare(a, b) (0) |
1273 | #define blk_integrity_register(a, b) (0) | 1284 | #define blk_integrity_register(a, b) (0) |
1274 | #define blk_integrity_unregister(a) do { } while (0); | 1285 | #define blk_integrity_unregister(a) do { } while (0) |
1275 | #define blk_queue_max_integrity_segments(a, b) do { } while (0); | 1286 | #define blk_queue_max_integrity_segments(a, b) do { } while (0) |
1276 | #define queue_max_integrity_segments(a) (0) | 1287 | #define queue_max_integrity_segments(a) (0) |
1277 | #define blk_integrity_merge_rq(a, b, c) (0) | 1288 | #define blk_integrity_merge_rq(a, b, c) (0) |
1278 | #define blk_integrity_merge_bio(a, b, c) (0) | 1289 | #define blk_integrity_merge_bio(a, b, c) (0) |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 01eca1794e14..ab344a521105 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -99,24 +99,31 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
99 | unsigned long align, | 99 | unsigned long align, |
100 | unsigned long goal); | 100 | unsigned long goal); |
101 | 101 | ||
102 | #ifdef CONFIG_NO_BOOTMEM | ||
103 | /* We are using top down, so it is safe to use 0 here */ | ||
104 | #define BOOTMEM_LOW_LIMIT 0 | ||
105 | #else | ||
106 | #define BOOTMEM_LOW_LIMIT __pa(MAX_DMA_ADDRESS) | ||
107 | #endif | ||
108 | |||
102 | #define alloc_bootmem(x) \ | 109 | #define alloc_bootmem(x) \ |
103 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 110 | __alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
104 | #define alloc_bootmem_align(x, align) \ | 111 | #define alloc_bootmem_align(x, align) \ |
105 | __alloc_bootmem(x, align, __pa(MAX_DMA_ADDRESS)) | 112 | __alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT) |
106 | #define alloc_bootmem_nopanic(x) \ | 113 | #define alloc_bootmem_nopanic(x) \ |
107 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 114 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
108 | #define alloc_bootmem_pages(x) \ | 115 | #define alloc_bootmem_pages(x) \ |
109 | __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 116 | __alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
110 | #define alloc_bootmem_pages_nopanic(x) \ | 117 | #define alloc_bootmem_pages_nopanic(x) \ |
111 | __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 118 | __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
112 | #define alloc_bootmem_node(pgdat, x) \ | 119 | #define alloc_bootmem_node(pgdat, x) \ |
113 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 120 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
114 | #define alloc_bootmem_node_nopanic(pgdat, x) \ | 121 | #define alloc_bootmem_node_nopanic(pgdat, x) \ |
115 | __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 122 | __alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT) |
116 | #define alloc_bootmem_pages_node(pgdat, x) \ | 123 | #define alloc_bootmem_pages_node(pgdat, x) \ |
117 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 124 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
118 | #define alloc_bootmem_pages_node_nopanic(pgdat, x) \ | 125 | #define alloc_bootmem_pages_node_nopanic(pgdat, x) \ |
119 | __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 126 | __alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) |
120 | 127 | ||
121 | #define alloc_bootmem_low(x) \ | 128 | #define alloc_bootmem_low(x) \ |
122 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) | 129 | __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) |
diff --git a/include/linux/bsearch.h b/include/linux/bsearch.h new file mode 100644 index 000000000000..90b1aa867224 --- /dev/null +++ b/include/linux/bsearch.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _LINUX_BSEARCH_H | ||
2 | #define _LINUX_BSEARCH_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | void *bsearch(const void *key, const void *base, size_t num, size_t size, | ||
7 | int (*cmp)(const void *key, const void *elt)); | ||
8 | |||
9 | #endif /* _LINUX_BSEARCH_H */ | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index f5df23561b96..503c8a6b3079 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -217,8 +217,24 @@ int cont_write_begin(struct file *, struct address_space *, loff_t, | |||
217 | get_block_t *, loff_t *); | 217 | get_block_t *, loff_t *); |
218 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 218 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
219 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 219 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
220 | int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | ||
221 | get_block_t get_block); | ||
220 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 222 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
221 | get_block_t get_block); | 223 | get_block_t get_block); |
224 | /* Convert errno to return value from ->page_mkwrite() call */ | ||
225 | static inline int block_page_mkwrite_return(int err) | ||
226 | { | ||
227 | if (err == 0) | ||
228 | return VM_FAULT_LOCKED; | ||
229 | if (err == -EFAULT) | ||
230 | return VM_FAULT_NOPAGE; | ||
231 | if (err == -ENOMEM) | ||
232 | return VM_FAULT_OOM; | ||
233 | if (err == -EAGAIN) | ||
234 | return VM_FAULT_RETRY; | ||
235 | /* -ENOSPC, -EDQUOT, -EIO ... */ | ||
236 | return VM_FAULT_SIGBUS; | ||
237 | } | ||
222 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 238 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
223 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 239 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
224 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, | 240 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, |
diff --git a/include/linux/c2port.h b/include/linux/c2port.h index 2a5cd867c365..a2f7d7413f30 100644 --- a/include/linux/c2port.h +++ b/include/linux/c2port.h | |||
@@ -60,9 +60,6 @@ struct c2port_ops { | |||
60 | * Exported functions | 60 | * Exported functions |
61 | */ | 61 | */ |
62 | 62 | ||
63 | #define to_class_dev(obj) container_of((obj), struct class_device, kobj) | ||
64 | #define to_c2port_device(obj) container_of((obj), struct c2port_device, class) | ||
65 | |||
66 | extern struct c2port_device *c2port_device_register(char *name, | 63 | extern struct c2port_device *c2port_device_register(char *name, |
67 | struct c2port_ops *ops, void *devdata); | 64 | struct c2port_ops *ops, void *devdata); |
68 | extern void c2port_device_unregister(struct c2port_device *dev); | 65 | extern void c2port_device_unregister(struct c2port_device *dev); |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 6f70a6d3a16e..5ce6b5d62ecc 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
@@ -44,8 +44,8 @@ struct can_proto { | |||
44 | 44 | ||
45 | /* function prototypes for the CAN networklayer core (af_can.c) */ | 45 | /* function prototypes for the CAN networklayer core (af_can.c) */ |
46 | 46 | ||
47 | extern int can_proto_register(struct can_proto *cp); | 47 | extern int can_proto_register(const struct can_proto *cp); |
48 | extern void can_proto_unregister(struct can_proto *cp); | 48 | extern void can_proto_unregister(const struct can_proto *cp); |
49 | 49 | ||
50 | extern int can_rx_register(struct net_device *dev, canid_t can_id, | 50 | extern int can_rx_register(struct net_device *dev, canid_t can_id, |
51 | canid_t mask, | 51 | canid_t mask, |
diff --git a/include/linux/capability.h b/include/linux/capability.h index d4675af963fa..c42112350003 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -355,7 +355,12 @@ struct cpu_vfs_cap_data { | |||
355 | 355 | ||
356 | #define CAP_SYSLOG 34 | 356 | #define CAP_SYSLOG 34 |
357 | 357 | ||
358 | #define CAP_LAST_CAP CAP_SYSLOG | 358 | /* Allow triggering something that will wake the system */ |
359 | |||
360 | #define CAP_WAKE_ALARM 35 | ||
361 | |||
362 | |||
363 | #define CAP_LAST_CAP CAP_WAKE_ALARM | ||
359 | 364 | ||
360 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | 365 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) |
361 | 366 | ||
@@ -412,7 +417,6 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
412 | 417 | ||
413 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) | 418 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) |
414 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) | 419 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) |
415 | # define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) | ||
416 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ | 420 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ |
417 | | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ | 421 | | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ |
418 | CAP_FS_MASK_B1 } }) | 422 | CAP_FS_MASK_B1 } }) |
@@ -422,11 +426,7 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
422 | 426 | ||
423 | #endif /* _KERNEL_CAPABILITY_U32S != 2 */ | 427 | #endif /* _KERNEL_CAPABILITY_U32S != 2 */ |
424 | 428 | ||
425 | #define CAP_INIT_INH_SET CAP_EMPTY_SET | ||
426 | |||
427 | # define cap_clear(c) do { (c) = __cap_empty_set; } while (0) | 429 | # define cap_clear(c) do { (c) = __cap_empty_set; } while (0) |
428 | # define cap_set_full(c) do { (c) = __cap_full_set; } while (0) | ||
429 | # define cap_set_init_eff(c) do { (c) = __cap_init_eff_set; } while (0) | ||
430 | 430 | ||
431 | #define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag)) | 431 | #define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag)) |
432 | #define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag)) | 432 | #define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag)) |
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index b8e995fbd867..b8c60694b2b0 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -313,6 +313,7 @@ enum { | |||
313 | CEPH_MDS_OP_GETATTR = 0x00101, | 313 | CEPH_MDS_OP_GETATTR = 0x00101, |
314 | CEPH_MDS_OP_LOOKUPHASH = 0x00102, | 314 | CEPH_MDS_OP_LOOKUPHASH = 0x00102, |
315 | CEPH_MDS_OP_LOOKUPPARENT = 0x00103, | 315 | CEPH_MDS_OP_LOOKUPPARENT = 0x00103, |
316 | CEPH_MDS_OP_LOOKUPINO = 0x00104, | ||
316 | 317 | ||
317 | CEPH_MDS_OP_SETXATTR = 0x01105, | 318 | CEPH_MDS_OP_SETXATTR = 0x01105, |
318 | CEPH_MDS_OP_RMXATTR = 0x01106, | 319 | CEPH_MDS_OP_RMXATTR = 0x01106, |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5ac7ebc36dbb..ab4ac0ccb857 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -467,12 +467,14 @@ struct cgroup_subsys { | |||
467 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 467 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
468 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 468 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
469 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 469 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
470 | struct task_struct *tsk, bool threadgroup); | 470 | struct task_struct *tsk); |
471 | int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk); | ||
471 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 472 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
472 | struct task_struct *tsk, bool threadgroup); | 473 | struct task_struct *tsk); |
474 | void (*pre_attach)(struct cgroup *cgrp); | ||
475 | void (*attach_task)(struct cgroup *cgrp, struct task_struct *tsk); | ||
473 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 476 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
474 | struct cgroup *old_cgrp, struct task_struct *tsk, | 477 | struct cgroup *old_cgrp, struct task_struct *tsk); |
475 | bool threadgroup); | ||
476 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 478 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
477 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 479 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
478 | struct cgroup *old_cgrp, struct task_struct *task); | 480 | struct cgroup *old_cgrp, struct task_struct *task); |
@@ -553,9 +555,6 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
553 | return task_subsys_state(task, subsys_id)->cgroup; | 555 | return task_subsys_state(task, subsys_id)->cgroup; |
554 | } | 556 | } |
555 | 557 | ||
556 | int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss, | ||
557 | char *nodename); | ||
558 | |||
559 | /* A cgroup_iter should be treated as an opaque object */ | 558 | /* A cgroup_iter should be treated as an opaque object */ |
560 | struct cgroup_iter { | 559 | struct cgroup_iter { |
561 | struct list_head *cg_link; | 560 | struct list_head *cg_link; |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index cdbfcb8780ec..ac663c18776c 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -19,12 +19,6 @@ SUBSYS(debug) | |||
19 | 19 | ||
20 | /* */ | 20 | /* */ |
21 | 21 | ||
22 | #ifdef CONFIG_CGROUP_NS | ||
23 | SUBSYS(ns) | ||
24 | #endif | ||
25 | |||
26 | /* */ | ||
27 | |||
28 | #ifdef CONFIG_CGROUP_SCHED | 22 | #ifdef CONFIG_CGROUP_SCHED |
29 | SUBSYS(cpu_cgroup) | 23 | SUBSYS(cpu_cgroup) |
30 | #endif | 24 | #endif |
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h new file mode 100644 index 000000000000..04ffb2e6c9d0 --- /dev/null +++ b/include/linux/cleancache.h | |||
@@ -0,0 +1,122 @@ | |||
1 | #ifndef _LINUX_CLEANCACHE_H | ||
2 | #define _LINUX_CLEANCACHE_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | #include <linux/exportfs.h> | ||
6 | #include <linux/mm.h> | ||
7 | |||
8 | #define CLEANCACHE_KEY_MAX 6 | ||
9 | |||
10 | /* | ||
11 | * cleancache requires every file with a page in cleancache to have a | ||
12 | * unique key unless/until the file is removed/truncated. For some | ||
13 | * filesystems, the inode number is unique, but for "modern" filesystems | ||
14 | * an exportable filehandle is required (see exportfs.h) | ||
15 | */ | ||
16 | struct cleancache_filekey { | ||
17 | union { | ||
18 | ino_t ino; | ||
19 | __u32 fh[CLEANCACHE_KEY_MAX]; | ||
20 | u32 key[CLEANCACHE_KEY_MAX]; | ||
21 | } u; | ||
22 | }; | ||
23 | |||
24 | struct cleancache_ops { | ||
25 | int (*init_fs)(size_t); | ||
26 | int (*init_shared_fs)(char *uuid, size_t); | ||
27 | int (*get_page)(int, struct cleancache_filekey, | ||
28 | pgoff_t, struct page *); | ||
29 | void (*put_page)(int, struct cleancache_filekey, | ||
30 | pgoff_t, struct page *); | ||
31 | void (*flush_page)(int, struct cleancache_filekey, pgoff_t); | ||
32 | void (*flush_inode)(int, struct cleancache_filekey); | ||
33 | void (*flush_fs)(int); | ||
34 | }; | ||
35 | |||
36 | extern struct cleancache_ops | ||
37 | cleancache_register_ops(struct cleancache_ops *ops); | ||
38 | extern void __cleancache_init_fs(struct super_block *); | ||
39 | extern void __cleancache_init_shared_fs(char *, struct super_block *); | ||
40 | extern int __cleancache_get_page(struct page *); | ||
41 | extern void __cleancache_put_page(struct page *); | ||
42 | extern void __cleancache_flush_page(struct address_space *, struct page *); | ||
43 | extern void __cleancache_flush_inode(struct address_space *); | ||
44 | extern void __cleancache_flush_fs(struct super_block *); | ||
45 | extern int cleancache_enabled; | ||
46 | |||
47 | #ifdef CONFIG_CLEANCACHE | ||
48 | static inline bool cleancache_fs_enabled(struct page *page) | ||
49 | { | ||
50 | return page->mapping->host->i_sb->cleancache_poolid >= 0; | ||
51 | } | ||
52 | static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping) | ||
53 | { | ||
54 | return mapping->host->i_sb->cleancache_poolid >= 0; | ||
55 | } | ||
56 | #else | ||
57 | #define cleancache_enabled (0) | ||
58 | #define cleancache_fs_enabled(_page) (0) | ||
59 | #define cleancache_fs_enabled_mapping(_page) (0) | ||
60 | #endif | ||
61 | |||
62 | /* | ||
63 | * The shim layer provided by these inline functions allows the compiler | ||
64 | * to reduce all cleancache hooks to nothingness if CONFIG_CLEANCACHE | ||
65 | * is disabled, to a single global variable check if CONFIG_CLEANCACHE | ||
66 | * is enabled but no cleancache "backend" has dynamically enabled it, | ||
67 | * and, for the most frequent cleancache ops, to a single global variable | ||
68 | * check plus a superblock element comparison if CONFIG_CLEANCACHE is enabled | ||
69 | * and a cleancache backend has dynamically enabled cleancache, but the | ||
70 | * filesystem referenced by that cleancache op has not enabled cleancache. | ||
71 | * As a result, CONFIG_CLEANCACHE can be enabled by default with essentially | ||
72 | * no measurable performance impact. | ||
73 | */ | ||
74 | |||
75 | static inline void cleancache_init_fs(struct super_block *sb) | ||
76 | { | ||
77 | if (cleancache_enabled) | ||
78 | __cleancache_init_fs(sb); | ||
79 | } | ||
80 | |||
81 | static inline void cleancache_init_shared_fs(char *uuid, struct super_block *sb) | ||
82 | { | ||
83 | if (cleancache_enabled) | ||
84 | __cleancache_init_shared_fs(uuid, sb); | ||
85 | } | ||
86 | |||
87 | static inline int cleancache_get_page(struct page *page) | ||
88 | { | ||
89 | int ret = -1; | ||
90 | |||
91 | if (cleancache_enabled && cleancache_fs_enabled(page)) | ||
92 | ret = __cleancache_get_page(page); | ||
93 | return ret; | ||
94 | } | ||
95 | |||
96 | static inline void cleancache_put_page(struct page *page) | ||
97 | { | ||
98 | if (cleancache_enabled && cleancache_fs_enabled(page)) | ||
99 | __cleancache_put_page(page); | ||
100 | } | ||
101 | |||
102 | static inline void cleancache_flush_page(struct address_space *mapping, | ||
103 | struct page *page) | ||
104 | { | ||
105 | /* careful... page->mapping is NULL sometimes when this is called */ | ||
106 | if (cleancache_enabled && cleancache_fs_enabled_mapping(mapping)) | ||
107 | __cleancache_flush_page(mapping, page); | ||
108 | } | ||
109 | |||
110 | static inline void cleancache_flush_inode(struct address_space *mapping) | ||
111 | { | ||
112 | if (cleancache_enabled && cleancache_fs_enabled_mapping(mapping)) | ||
113 | __cleancache_flush_inode(mapping); | ||
114 | } | ||
115 | |||
116 | static inline void cleancache_flush_fs(struct super_block *sb) | ||
117 | { | ||
118 | if (cleancache_enabled) | ||
119 | __cleancache_flush_fs(sb); | ||
120 | } | ||
121 | |||
122 | #endif /* _LINUX_CLEANCACHE_H */ | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index fc53492b6ad7..d6733e27af34 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -56,46 +56,52 @@ enum clock_event_nofitiers { | |||
56 | 56 | ||
57 | /** | 57 | /** |
58 | * struct clock_event_device - clock event device descriptor | 58 | * struct clock_event_device - clock event device descriptor |
59 | * @name: ptr to clock event name | 59 | * @event_handler: Assigned by the framework to be called by the low |
60 | * @features: features | 60 | * level handler of the event source |
61 | * @set_next_event: set next event function | ||
62 | * @next_event: local storage for the next event in oneshot mode | ||
61 | * @max_delta_ns: maximum delta value in ns | 63 | * @max_delta_ns: maximum delta value in ns |
62 | * @min_delta_ns: minimum delta value in ns | 64 | * @min_delta_ns: minimum delta value in ns |
63 | * @mult: nanosecond to cycles multiplier | 65 | * @mult: nanosecond to cycles multiplier |
64 | * @shift: nanoseconds to cycles divisor (power of two) | 66 | * @shift: nanoseconds to cycles divisor (power of two) |
67 | * @mode: operating mode assigned by the management code | ||
68 | * @features: features | ||
69 | * @retries: number of forced programming retries | ||
70 | * @set_mode: set mode function | ||
71 | * @broadcast: function to broadcast events | ||
72 | * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration | ||
73 | * @max_delta_ticks: maximum delta value in ticks stored for reconfiguration | ||
74 | * @name: ptr to clock event name | ||
65 | * @rating: variable to rate clock event devices | 75 | * @rating: variable to rate clock event devices |
66 | * @irq: IRQ number (only for non CPU local devices) | 76 | * @irq: IRQ number (only for non CPU local devices) |
67 | * @cpumask: cpumask to indicate for which CPUs this device works | 77 | * @cpumask: cpumask to indicate for which CPUs this device works |
68 | * @set_next_event: set next event function | ||
69 | * @set_mode: set mode function | ||
70 | * @event_handler: Assigned by the framework to be called by the low | ||
71 | * level handler of the event source | ||
72 | * @broadcast: function to broadcast events | ||
73 | * @list: list head for the management code | 78 | * @list: list head for the management code |
74 | * @mode: operating mode assigned by the management code | ||
75 | * @next_event: local storage for the next event in oneshot mode | ||
76 | * @retries: number of forced programming retries | ||
77 | */ | 79 | */ |
78 | struct clock_event_device { | 80 | struct clock_event_device { |
79 | const char *name; | 81 | void (*event_handler)(struct clock_event_device *); |
80 | unsigned int features; | 82 | int (*set_next_event)(unsigned long evt, |
83 | struct clock_event_device *); | ||
84 | ktime_t next_event; | ||
81 | u64 max_delta_ns; | 85 | u64 max_delta_ns; |
82 | u64 min_delta_ns; | 86 | u64 min_delta_ns; |
83 | u32 mult; | 87 | u32 mult; |
84 | u32 shift; | 88 | u32 shift; |
89 | enum clock_event_mode mode; | ||
90 | unsigned int features; | ||
91 | unsigned long retries; | ||
92 | |||
93 | void (*broadcast)(const struct cpumask *mask); | ||
94 | void (*set_mode)(enum clock_event_mode mode, | ||
95 | struct clock_event_device *); | ||
96 | unsigned long min_delta_ticks; | ||
97 | unsigned long max_delta_ticks; | ||
98 | |||
99 | const char *name; | ||
85 | int rating; | 100 | int rating; |
86 | int irq; | 101 | int irq; |
87 | const struct cpumask *cpumask; | 102 | const struct cpumask *cpumask; |
88 | int (*set_next_event)(unsigned long evt, | ||
89 | struct clock_event_device *); | ||
90 | void (*set_mode)(enum clock_event_mode mode, | ||
91 | struct clock_event_device *); | ||
92 | void (*event_handler)(struct clock_event_device *); | ||
93 | void (*broadcast)(const struct cpumask *mask); | ||
94 | struct list_head list; | 103 | struct list_head list; |
95 | enum clock_event_mode mode; | 104 | } ____cacheline_aligned; |
96 | ktime_t next_event; | ||
97 | unsigned long retries; | ||
98 | }; | ||
99 | 105 | ||
100 | /* | 106 | /* |
101 | * Calculate a multiplication factor for scaled math, which is used to convert | 107 | * Calculate a multiplication factor for scaled math, which is used to convert |
@@ -122,6 +128,12 @@ extern u64 clockevent_delta2ns(unsigned long latch, | |||
122 | struct clock_event_device *evt); | 128 | struct clock_event_device *evt); |
123 | extern void clockevents_register_device(struct clock_event_device *dev); | 129 | extern void clockevents_register_device(struct clock_event_device *dev); |
124 | 130 | ||
131 | extern void clockevents_config_and_register(struct clock_event_device *dev, | ||
132 | u32 freq, unsigned long min_delta, | ||
133 | unsigned long max_delta); | ||
134 | |||
135 | extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq); | ||
136 | |||
125 | extern void clockevents_exchange_device(struct clock_event_device *old, | 137 | extern void clockevents_exchange_device(struct clock_event_device *old, |
126 | struct clock_event_device *new); | 138 | struct clock_event_device *new); |
127 | extern void clockevents_set_mode(struct clock_event_device *dev, | 139 | extern void clockevents_set_mode(struct clock_event_device *dev, |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c37b21ad5a3b..d4646b48dc4a 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -159,42 +159,38 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
159 | */ | 159 | */ |
160 | struct clocksource { | 160 | struct clocksource { |
161 | /* | 161 | /* |
162 | * First part of structure is read mostly | 162 | * Hotpath data, fits in a single cache line when the |
163 | * clocksource itself is cacheline aligned. | ||
163 | */ | 164 | */ |
164 | char *name; | ||
165 | struct list_head list; | ||
166 | int rating; | ||
167 | cycle_t (*read)(struct clocksource *cs); | 165 | cycle_t (*read)(struct clocksource *cs); |
168 | int (*enable)(struct clocksource *cs); | 166 | cycle_t cycle_last; |
169 | void (*disable)(struct clocksource *cs); | ||
170 | cycle_t mask; | 167 | cycle_t mask; |
171 | u32 mult; | 168 | u32 mult; |
172 | u32 shift; | 169 | u32 shift; |
173 | u64 max_idle_ns; | 170 | u64 max_idle_ns; |
174 | unsigned long flags; | 171 | |
175 | cycle_t (*vread)(void); | ||
176 | void (*suspend)(struct clocksource *cs); | ||
177 | void (*resume)(struct clocksource *cs); | ||
178 | #ifdef CONFIG_IA64 | 172 | #ifdef CONFIG_IA64 |
179 | void *fsys_mmio; /* used by fsyscall asm code */ | 173 | void *fsys_mmio; /* used by fsyscall asm code */ |
180 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) | 174 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) |
181 | #else | 175 | #else |
182 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) | 176 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) |
183 | #endif | 177 | #endif |
184 | 178 | const char *name; | |
185 | /* | 179 | struct list_head list; |
186 | * Second part is written at each timer interrupt | 180 | int rating; |
187 | * Keep it in a different cache line to dirty no | 181 | cycle_t (*vread)(void); |
188 | * more than one cache line. | 182 | int (*enable)(struct clocksource *cs); |
189 | */ | 183 | void (*disable)(struct clocksource *cs); |
190 | cycle_t cycle_last ____cacheline_aligned_in_smp; | 184 | unsigned long flags; |
185 | void (*suspend)(struct clocksource *cs); | ||
186 | void (*resume)(struct clocksource *cs); | ||
191 | 187 | ||
192 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | 188 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG |
193 | /* Watchdog related data, used by the framework */ | 189 | /* Watchdog related data, used by the framework */ |
194 | struct list_head wd_list; | 190 | struct list_head wd_list; |
195 | cycle_t wd_last; | 191 | cycle_t wd_last; |
196 | #endif | 192 | #endif |
197 | }; | 193 | } ____cacheline_aligned; |
198 | 194 | ||
199 | /* | 195 | /* |
200 | * Clock source flags bits:: | 196 | * Clock source flags bits:: |
@@ -341,4 +337,14 @@ static inline void update_vsyscall_tz(void) | |||
341 | 337 | ||
342 | extern void timekeeping_notify(struct clocksource *clock); | 338 | extern void timekeeping_notify(struct clocksource *clock); |
343 | 339 | ||
340 | extern cycle_t clocksource_mmio_readl_up(struct clocksource *); | ||
341 | extern cycle_t clocksource_mmio_readl_down(struct clocksource *); | ||
342 | extern cycle_t clocksource_mmio_readw_up(struct clocksource *); | ||
343 | extern cycle_t clocksource_mmio_readw_down(struct clocksource *); | ||
344 | |||
345 | extern int clocksource_mmio_init(void __iomem *, const char *, | ||
346 | unsigned long, int, unsigned, cycle_t (*)(struct clocksource *)); | ||
347 | |||
348 | extern int clocksource_i8253_init(void); | ||
349 | |||
344 | #endif /* _LINUX_CLOCKSOURCE_H */ | 350 | #endif /* _LINUX_CLOCKSOURCE_H */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 5778b559d59c..ddcb7db38e67 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/sem.h> | 12 | #include <linux/sem.h> |
13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
14 | #include <linux/if.h> | 14 | #include <linux/if.h> |
15 | #include <linux/fs.h> | ||
16 | #include <linux/aio_abi.h> /* for aio_context_t */ | ||
15 | 17 | ||
16 | #include <asm/compat.h> | 18 | #include <asm/compat.h> |
17 | #include <asm/siginfo.h> | 19 | #include <asm/siginfo.h> |
@@ -26,7 +28,7 @@ typedef __compat_gid32_t compat_gid_t; | |||
26 | struct compat_sel_arg_struct; | 28 | struct compat_sel_arg_struct; |
27 | struct rusage; | 29 | struct rusage; |
28 | 30 | ||
29 | struct compat_itimerspec { | 31 | struct compat_itimerspec { |
30 | struct compat_timespec it_interval; | 32 | struct compat_timespec it_interval; |
31 | struct compat_timespec it_value; | 33 | struct compat_timespec it_value; |
32 | }; | 34 | }; |
@@ -70,9 +72,9 @@ struct compat_timex { | |||
70 | compat_long_t stbcnt; | 72 | compat_long_t stbcnt; |
71 | compat_int_t tai; | 73 | compat_int_t tai; |
72 | 74 | ||
73 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | 75 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; |
74 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | 76 | compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32; |
75 | compat_int_t :32; compat_int_t :32; compat_int_t :32; | 77 | compat_int_t:32; compat_int_t:32; compat_int_t:32; |
76 | }; | 78 | }; |
77 | 79 | ||
78 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) | 80 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) |
@@ -81,8 +83,10 @@ typedef struct { | |||
81 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; | 83 | compat_sigset_word sig[_COMPAT_NSIG_WORDS]; |
82 | } compat_sigset_t; | 84 | } compat_sigset_t; |
83 | 85 | ||
84 | extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); | 86 | extern int get_compat_timespec(struct timespec *, |
85 | extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); | 87 | const struct compat_timespec __user *); |
88 | extern int put_compat_timespec(const struct timespec *, | ||
89 | struct compat_timespec __user *); | ||
86 | 90 | ||
87 | struct compat_iovec { | 91 | struct compat_iovec { |
88 | compat_uptr_t iov_base; | 92 | compat_uptr_t iov_base; |
@@ -113,7 +117,8 @@ struct compat_rusage { | |||
113 | compat_long_t ru_nivcsw; | 117 | compat_long_t ru_nivcsw; |
114 | }; | 118 | }; |
115 | 119 | ||
116 | extern int put_compat_rusage(const struct rusage *, struct compat_rusage __user *); | 120 | extern int put_compat_rusage(const struct rusage *, |
121 | struct compat_rusage __user *); | ||
117 | 122 | ||
118 | struct compat_siginfo; | 123 | struct compat_siginfo; |
119 | 124 | ||
@@ -166,8 +171,7 @@ struct compat_ifmap { | |||
166 | unsigned char port; | 171 | unsigned char port; |
167 | }; | 172 | }; |
168 | 173 | ||
169 | struct compat_if_settings | 174 | struct compat_if_settings { |
170 | { | ||
171 | unsigned int type; /* Type of physical device or protocol */ | 175 | unsigned int type; /* Type of physical device or protocol */ |
172 | unsigned int size; /* Size of the data allocated by the caller */ | 176 | unsigned int size; /* Size of the data allocated by the caller */ |
173 | compat_uptr_t ifs_ifsu; /* union of pointers */ | 177 | compat_uptr_t ifs_ifsu; /* union of pointers */ |
@@ -195,8 +199,8 @@ struct compat_ifreq { | |||
195 | }; | 199 | }; |
196 | 200 | ||
197 | struct compat_ifconf { | 201 | struct compat_ifconf { |
198 | compat_int_t ifc_len; /* size of buffer */ | 202 | compat_int_t ifc_len; /* size of buffer */ |
199 | compat_caddr_t ifcbuf; | 203 | compat_caddr_t ifcbuf; |
200 | }; | 204 | }; |
201 | 205 | ||
202 | struct compat_robust_list { | 206 | struct compat_robust_list { |
@@ -209,6 +213,18 @@ struct compat_robust_list_head { | |||
209 | compat_uptr_t list_op_pending; | 213 | compat_uptr_t list_op_pending; |
210 | }; | 214 | }; |
211 | 215 | ||
216 | struct compat_statfs; | ||
217 | struct compat_statfs64; | ||
218 | struct compat_old_linux_dirent; | ||
219 | struct compat_linux_dirent; | ||
220 | struct linux_dirent64; | ||
221 | struct compat_msghdr; | ||
222 | struct compat_mmsghdr; | ||
223 | struct compat_sysinfo; | ||
224 | struct compat_sysctl_args; | ||
225 | struct compat_kexec_segment; | ||
226 | struct compat_mq_attr; | ||
227 | |||
212 | extern void compat_exit_robust_list(struct task_struct *curr); | 228 | extern void compat_exit_robust_list(struct task_struct *curr); |
213 | 229 | ||
214 | asmlinkage long | 230 | asmlinkage long |
@@ -243,8 +259,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, | |||
243 | const struct compat_iovec __user *vec, | 259 | const struct compat_iovec __user *vec, |
244 | unsigned long vlen, u32 pos_low, u32 pos_high); | 260 | unsigned long vlen, u32 pos_low, u32 pos_high); |
245 | 261 | ||
246 | int compat_do_execve(char * filename, compat_uptr_t __user *argv, | 262 | int compat_do_execve(char *filename, compat_uptr_t __user *argv, |
247 | compat_uptr_t __user *envp, struct pt_regs * regs); | 263 | compat_uptr_t __user *envp, struct pt_regs *regs); |
248 | 264 | ||
249 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | 265 | asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, |
250 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 266 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
@@ -331,12 +347,18 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, | |||
331 | const compat_sigset_t __user *sigmask, | 347 | const compat_sigset_t __user *sigmask, |
332 | compat_size_t sigsetsize); | 348 | compat_size_t sigsetsize); |
333 | 349 | ||
334 | asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, | 350 | asmlinkage long compat_sys_utime(const char __user *filename, |
335 | struct compat_timespec __user *t, int flags); | 351 | struct compat_utimbuf __user *t); |
352 | asmlinkage long compat_sys_utimensat(unsigned int dfd, | ||
353 | const char __user *filename, | ||
354 | struct compat_timespec __user *t, | ||
355 | int flags); | ||
336 | 356 | ||
357 | asmlinkage long compat_sys_time(compat_time_t __user *tloc); | ||
358 | asmlinkage long compat_sys_stime(compat_time_t __user *tptr); | ||
337 | asmlinkage long compat_sys_signalfd(int ufd, | 359 | asmlinkage long compat_sys_signalfd(int ufd, |
338 | const compat_sigset_t __user *sigmask, | 360 | const compat_sigset_t __user *sigmask, |
339 | compat_size_t sigsetsize); | 361 | compat_size_t sigsetsize); |
340 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, | 362 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
341 | const struct compat_itimerspec __user *utmr, | 363 | const struct compat_itimerspec __user *utmr, |
342 | struct compat_itimerspec __user *otmr); | 364 | struct compat_itimerspec __user *otmr); |
@@ -348,16 +370,190 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | |||
348 | const int __user *nodes, | 370 | const int __user *nodes, |
349 | int __user *status, | 371 | int __user *status, |
350 | int flags); | 372 | int flags); |
351 | asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, | 373 | asmlinkage long compat_sys_futimesat(unsigned int dfd, |
374 | const char __user *filename, | ||
352 | struct compat_timeval __user *t); | 375 | struct compat_timeval __user *t); |
353 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename, | 376 | asmlinkage long compat_sys_utimes(const char __user *filename, |
377 | struct compat_timeval __user *t); | ||
378 | asmlinkage long compat_sys_newstat(const char __user *filename, | ||
379 | struct compat_stat __user *statbuf); | ||
380 | asmlinkage long compat_sys_newlstat(const char __user *filename, | ||
381 | struct compat_stat __user *statbuf); | ||
382 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, | ||
383 | const char __user *filename, | ||
354 | struct compat_stat __user *statbuf, | 384 | struct compat_stat __user *statbuf, |
355 | int flag); | 385 | int flag); |
386 | asmlinkage long compat_sys_newfstat(unsigned int fd, | ||
387 | struct compat_stat __user *statbuf); | ||
388 | asmlinkage long compat_sys_statfs(const char __user *pathname, | ||
389 | struct compat_statfs __user *buf); | ||
390 | asmlinkage long compat_sys_fstatfs(unsigned int fd, | ||
391 | struct compat_statfs __user *buf); | ||
392 | asmlinkage long compat_sys_statfs64(const char __user *pathname, | ||
393 | compat_size_t sz, | ||
394 | struct compat_statfs64 __user *buf); | ||
395 | asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, | ||
396 | struct compat_statfs64 __user *buf); | ||
397 | asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd, | ||
398 | unsigned long arg); | ||
399 | asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd, | ||
400 | unsigned long arg); | ||
401 | asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p); | ||
402 | asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id, | ||
403 | unsigned long min_nr, | ||
404 | unsigned long nr, | ||
405 | struct io_event __user *events, | ||
406 | struct compat_timespec __user *timeout); | ||
407 | asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr, | ||
408 | u32 __user *iocb); | ||
409 | asmlinkage long compat_sys_mount(const char __user *dev_name, | ||
410 | const char __user *dir_name, | ||
411 | const char __user *type, unsigned long flags, | ||
412 | const void __user *data); | ||
413 | asmlinkage long compat_sys_old_readdir(unsigned int fd, | ||
414 | struct compat_old_linux_dirent __user *, | ||
415 | unsigned int count); | ||
416 | asmlinkage long compat_sys_getdents(unsigned int fd, | ||
417 | struct compat_linux_dirent __user *dirent, | ||
418 | unsigned int count); | ||
419 | asmlinkage long compat_sys_getdents64(unsigned int fd, | ||
420 | struct linux_dirent64 __user *dirent, | ||
421 | unsigned int count); | ||
422 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | ||
423 | unsigned int nr_segs, unsigned int flags); | ||
424 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | ||
425 | int mode); | ||
356 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 426 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
357 | int flags, int mode); | 427 | int flags, int mode); |
428 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | ||
429 | struct file_handle __user *handle, | ||
430 | int flags); | ||
431 | asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, | ||
432 | compat_ulong_t __user *outp, | ||
433 | compat_ulong_t __user *exp, | ||
434 | struct compat_timespec __user *tsp, | ||
435 | void __user *sig); | ||
436 | asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | ||
437 | unsigned int nfds, | ||
438 | struct compat_timespec __user *tsp, | ||
439 | const compat_sigset_t __user *sigmask, | ||
440 | compat_size_t sigsetsize); | ||
441 | #if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \ | ||
442 | !defined(CONFIG_NFSD_DEPRECATED) | ||
443 | union compat_nfsctl_res; | ||
444 | struct compat_nfsctl_arg; | ||
445 | asmlinkage long compat_sys_nfsservctl(int cmd, | ||
446 | struct compat_nfsctl_arg __user *arg, | ||
447 | union compat_nfsctl_res __user *res); | ||
448 | #else | ||
449 | asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); | ||
450 | #endif | ||
451 | asmlinkage long compat_sys_signalfd4(int ufd, | ||
452 | const compat_sigset_t __user *sigmask, | ||
453 | compat_size_t sigsetsize, int flags); | ||
454 | asmlinkage long compat_sys_get_mempolicy(int __user *policy, | ||
455 | compat_ulong_t __user *nmask, | ||
456 | compat_ulong_t maxnode, | ||
457 | compat_ulong_t addr, | ||
458 | compat_ulong_t flags); | ||
459 | asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask, | ||
460 | compat_ulong_t maxnode); | ||
461 | asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len, | ||
462 | compat_ulong_t mode, | ||
463 | compat_ulong_t __user *nmask, | ||
464 | compat_ulong_t maxnode, compat_ulong_t flags); | ||
465 | |||
466 | asmlinkage long compat_sys_setsockopt(int fd, int level, int optname, | ||
467 | char __user *optval, unsigned int optlen); | ||
468 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, | ||
469 | unsigned flags); | ||
470 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, | ||
471 | unsigned int flags); | ||
472 | asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, | ||
473 | unsigned flags); | ||
474 | asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | ||
475 | unsigned flags, struct sockaddr __user *addr, | ||
476 | int __user *addrlen); | ||
477 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | ||
478 | unsigned vlen, unsigned int flags, | ||
479 | struct compat_timespec __user *timeout); | ||
480 | asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp, | ||
481 | struct compat_timespec __user *rmtp); | ||
482 | asmlinkage long compat_sys_getitimer(int which, | ||
483 | struct compat_itimerval __user *it); | ||
484 | asmlinkage long compat_sys_setitimer(int which, | ||
485 | struct compat_itimerval __user *in, | ||
486 | struct compat_itimerval __user *out); | ||
487 | asmlinkage long compat_sys_times(struct compat_tms __user *tbuf); | ||
488 | asmlinkage long compat_sys_setrlimit(unsigned int resource, | ||
489 | struct compat_rlimit __user *rlim); | ||
490 | asmlinkage long compat_sys_getrlimit(unsigned int resource, | ||
491 | struct compat_rlimit __user *rlim); | ||
492 | asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru); | ||
493 | asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid, | ||
494 | unsigned int len, | ||
495 | compat_ulong_t __user *user_mask_ptr); | ||
496 | asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, | ||
497 | unsigned int len, | ||
498 | compat_ulong_t __user *user_mask_ptr); | ||
499 | asmlinkage long compat_sys_timer_create(clockid_t which_clock, | ||
500 | struct compat_sigevent __user *timer_event_spec, | ||
501 | timer_t __user *created_timer_id); | ||
502 | asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags, | ||
503 | struct compat_itimerspec __user *new, | ||
504 | struct compat_itimerspec __user *old); | ||
505 | asmlinkage long compat_sys_timer_gettime(timer_t timer_id, | ||
506 | struct compat_itimerspec __user *setting); | ||
507 | asmlinkage long compat_sys_clock_settime(clockid_t which_clock, | ||
508 | struct compat_timespec __user *tp); | ||
509 | asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, | ||
510 | struct compat_timespec __user *tp); | ||
511 | asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock, | ||
512 | struct compat_timex __user *tp); | ||
513 | asmlinkage long compat_sys_clock_getres(clockid_t which_clock, | ||
514 | struct compat_timespec __user *tp); | ||
515 | asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags, | ||
516 | struct compat_timespec __user *rqtp, | ||
517 | struct compat_timespec __user *rmtp); | ||
518 | asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese, | ||
519 | struct compat_siginfo __user *uinfo, | ||
520 | struct compat_timespec __user *uts, compat_size_t sigsetsize); | ||
521 | asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, | ||
522 | compat_size_t sigsetsize); | ||
523 | asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info); | ||
524 | asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | ||
525 | unsigned long arg); | ||
526 | asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | ||
527 | struct compat_timespec __user *utime, u32 __user *uaddr2, | ||
528 | u32 val3); | ||
529 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | ||
530 | char __user *optval, int __user *optlen); | ||
531 | asmlinkage long compat_sys_kexec_load(unsigned long entry, | ||
532 | unsigned long nr_segments, | ||
533 | struct compat_kexec_segment __user *, | ||
534 | unsigned long flags); | ||
535 | asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, | ||
536 | const struct compat_mq_attr __user *u_mqstat, | ||
537 | struct compat_mq_attr __user *u_omqstat); | ||
538 | asmlinkage long compat_sys_mq_notify(mqd_t mqdes, | ||
539 | const struct compat_sigevent __user *u_notification); | ||
540 | asmlinkage long compat_sys_mq_open(const char __user *u_name, | ||
541 | int oflag, compat_mode_t mode, | ||
542 | struct compat_mq_attr __user *u_attr); | ||
543 | asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, | ||
544 | const char __user *u_msg_ptr, | ||
545 | size_t msg_len, unsigned int msg_prio, | ||
546 | const struct compat_timespec __user *u_abs_timeout); | ||
547 | asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes, | ||
548 | char __user *u_msg_ptr, | ||
549 | size_t msg_len, unsigned int __user *u_msg_prio, | ||
550 | const struct compat_timespec __user *u_abs_timeout); | ||
551 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args); | ||
552 | asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); | ||
358 | 553 | ||
359 | extern ssize_t compat_rw_copy_check_uvector(int type, | 554 | extern ssize_t compat_rw_copy_check_uvector(int type, |
360 | const struct compat_iovec __user *uvector, unsigned long nr_segs, | 555 | const struct compat_iovec __user *uvector, |
556 | unsigned long nr_segs, | ||
361 | unsigned long fast_segs, struct iovec *fast_pointer, | 557 | unsigned long fast_segs, struct iovec *fast_pointer, |
362 | struct iovec **ret_pointer); | 558 | struct iovec **ret_pointer); |
363 | 559 | ||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index cb4c1eb7778e..59e4028e833d 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -34,8 +34,12 @@ | |||
34 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 34 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
35 | (typeof(ptr)) (__ptr + (off)); }) | 35 | (typeof(ptr)) (__ptr + (off)); }) |
36 | 36 | ||
37 | #ifdef __CHECKER__ | ||
38 | #define __must_be_array(arr) 0 | ||
39 | #else | ||
37 | /* &a[0] degrades to a pointer: a different type from an array */ | 40 | /* &a[0] degrades to a pointer: a different type from an array */ |
38 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | 41 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
42 | #endif | ||
39 | 43 | ||
40 | /* | 44 | /* |
41 | * Force always-inline if the user requests it so via the .config, | 45 | * Force always-inline if the user requests it so via the .config, |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 64b7c003fd7a..dfadc96e9d63 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -51,7 +51,7 @@ | |||
51 | #if __GNUC_MINOR__ > 0 | 51 | #if __GNUC_MINOR__ > 0 |
52 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 52 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
53 | #endif | 53 | #endif |
54 | #if __GNUC_MINOR__ >= 4 | 54 | #if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__) |
55 | #define __compiletime_warning(message) __attribute__((warning(message))) | 55 | #define __compiletime_warning(message) __attribute__((warning(message))) |
56 | #define __compiletime_error(message) __attribute__((error(message))) | 56 | #define __compiletime_error(message) __attribute__((error(message))) |
57 | #endif | 57 | #endif |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 9343dd3de858..11be48e0d168 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2001 Russell King | 4 | * Copyright (C) 2001 Russell King |
5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> | 5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
@@ -56,9 +56,9 @@ static inline int cpufreq_unregister_notifier(struct notifier_block *nb, | |||
56 | #define CPUFREQ_POLICY_POWERSAVE (1) | 56 | #define CPUFREQ_POLICY_POWERSAVE (1) |
57 | #define CPUFREQ_POLICY_PERFORMANCE (2) | 57 | #define CPUFREQ_POLICY_PERFORMANCE (2) |
58 | 58 | ||
59 | /* Frequency values here are CPU kHz so that hardware which doesn't run | 59 | /* Frequency values here are CPU kHz so that hardware which doesn't run |
60 | * with some frequencies can complain without having to guess what per | 60 | * with some frequencies can complain without having to guess what per |
61 | * cent / per mille means. | 61 | * cent / per mille means. |
62 | * Maximum transition latency is in nanoseconds - if it's unknown, | 62 | * Maximum transition latency is in nanoseconds - if it's unknown, |
63 | * CPUFREQ_ETERNAL shall be used. | 63 | * CPUFREQ_ETERNAL shall be used. |
64 | */ | 64 | */ |
@@ -72,13 +72,15 @@ extern struct kobject *cpufreq_global_kobject; | |||
72 | struct cpufreq_cpuinfo { | 72 | struct cpufreq_cpuinfo { |
73 | unsigned int max_freq; | 73 | unsigned int max_freq; |
74 | unsigned int min_freq; | 74 | unsigned int min_freq; |
75 | unsigned int transition_latency; /* in 10^(-9) s = nanoseconds */ | 75 | |
76 | /* in 10^(-9) s = nanoseconds */ | ||
77 | unsigned int transition_latency; | ||
76 | }; | 78 | }; |
77 | 79 | ||
78 | struct cpufreq_real_policy { | 80 | struct cpufreq_real_policy { |
79 | unsigned int min; /* in kHz */ | 81 | unsigned int min; /* in kHz */ |
80 | unsigned int max; /* in kHz */ | 82 | unsigned int max; /* in kHz */ |
81 | unsigned int policy; /* see above */ | 83 | unsigned int policy; /* see above */ |
82 | struct cpufreq_governor *governor; /* see below */ | 84 | struct cpufreq_governor *governor; /* see below */ |
83 | }; | 85 | }; |
84 | 86 | ||
@@ -94,7 +96,7 @@ struct cpufreq_policy { | |||
94 | unsigned int max; /* in kHz */ | 96 | unsigned int max; /* in kHz */ |
95 | unsigned int cur; /* in kHz, only needed if cpufreq | 97 | unsigned int cur; /* in kHz, only needed if cpufreq |
96 | * governors are used */ | 98 | * governors are used */ |
97 | unsigned int policy; /* see above */ | 99 | unsigned int policy; /* see above */ |
98 | struct cpufreq_governor *governor; /* see below */ | 100 | struct cpufreq_governor *governor; /* see below */ |
99 | 101 | ||
100 | struct work_struct update; /* if update_policy() needs to be | 102 | struct work_struct update; /* if update_policy() needs to be |
@@ -167,11 +169,11 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu | |||
167 | 169 | ||
168 | struct cpufreq_governor { | 170 | struct cpufreq_governor { |
169 | char name[CPUFREQ_NAME_LEN]; | 171 | char name[CPUFREQ_NAME_LEN]; |
170 | int (*governor) (struct cpufreq_policy *policy, | 172 | int (*governor) (struct cpufreq_policy *policy, |
171 | unsigned int event); | 173 | unsigned int event); |
172 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, | 174 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, |
173 | char *buf); | 175 | char *buf); |
174 | int (*store_setspeed) (struct cpufreq_policy *policy, | 176 | int (*store_setspeed) (struct cpufreq_policy *policy, |
175 | unsigned int freq); | 177 | unsigned int freq); |
176 | unsigned int max_transition_latency; /* HW must be able to switch to | 178 | unsigned int max_transition_latency; /* HW must be able to switch to |
177 | next freq faster than this value in nano secs or we | 179 | next freq faster than this value in nano secs or we |
@@ -180,7 +182,8 @@ struct cpufreq_governor { | |||
180 | struct module *owner; | 182 | struct module *owner; |
181 | }; | 183 | }; |
182 | 184 | ||
183 | /* pass a target to the cpufreq driver | 185 | /* |
186 | * Pass a target to the cpufreq driver. | ||
184 | */ | 187 | */ |
185 | extern int cpufreq_driver_target(struct cpufreq_policy *policy, | 188 | extern int cpufreq_driver_target(struct cpufreq_policy *policy, |
186 | unsigned int target_freq, | 189 | unsigned int target_freq, |
@@ -237,9 +240,9 @@ struct cpufreq_driver { | |||
237 | 240 | ||
238 | /* flags */ | 241 | /* flags */ |
239 | 242 | ||
240 | #define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if | 243 | #define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if |
241 | * all ->init() calls failed */ | 244 | * all ->init() calls failed */ |
242 | #define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel | 245 | #define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel |
243 | * "constants" aren't affected by | 246 | * "constants" aren't affected by |
244 | * frequency transitions */ | 247 | * frequency transitions */ |
245 | #define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed | 248 | #define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed |
@@ -252,7 +255,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | |||
252 | void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); | 255 | void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); |
253 | 256 | ||
254 | 257 | ||
255 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) | 258 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) |
256 | { | 259 | { |
257 | if (policy->min < min) | 260 | if (policy->min < min) |
258 | policy->min = min; | 261 | policy->min = min; |
@@ -386,34 +389,15 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
386 | /* the following 3 funtions are for cpufreq core use only */ | 389 | /* the following 3 funtions are for cpufreq core use only */ |
387 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 390 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
388 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | 391 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); |
389 | void cpufreq_cpu_put (struct cpufreq_policy *data); | 392 | void cpufreq_cpu_put(struct cpufreq_policy *data); |
390 | 393 | ||
391 | /* the following are really really optional */ | 394 | /* the following are really really optional */ |
392 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | 395 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; |
393 | 396 | ||
394 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | 397 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, |
395 | unsigned int cpu); | 398 | unsigned int cpu); |
396 | 399 | ||
397 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 400 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
398 | 401 | ||
399 | 402 | ||
400 | /********************************************************************* | ||
401 | * UNIFIED DEBUG HELPERS * | ||
402 | *********************************************************************/ | ||
403 | |||
404 | #define CPUFREQ_DEBUG_CORE 1 | ||
405 | #define CPUFREQ_DEBUG_DRIVER 2 | ||
406 | #define CPUFREQ_DEBUG_GOVERNOR 4 | ||
407 | |||
408 | #ifdef CONFIG_CPU_FREQ_DEBUG | ||
409 | |||
410 | extern void cpufreq_debug_printk(unsigned int type, const char *prefix, | ||
411 | const char *fmt, ...); | ||
412 | |||
413 | #else | ||
414 | |||
415 | #define cpufreq_debug_printk(msg...) do { } while(0) | ||
416 | |||
417 | #endif /* CONFIG_CPU_FREQ_DEBUG */ | ||
418 | |||
419 | #endif /* _LINUX_CPUFREQ_H */ | 403 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index bae6fe24d1f9..b24ac56477b4 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -547,6 +547,21 @@ static inline int cpumask_parse_user(const char __user *buf, int len, | |||
547 | } | 547 | } |
548 | 548 | ||
549 | /** | 549 | /** |
550 | * cpumask_parselist_user - extract a cpumask from a user string | ||
551 | * @buf: the buffer to extract from | ||
552 | * @len: the length of the buffer | ||
553 | * @dstp: the cpumask to set. | ||
554 | * | ||
555 | * Returns -errno, or 0 for success. | ||
556 | */ | ||
557 | static inline int cpumask_parselist_user(const char __user *buf, int len, | ||
558 | struct cpumask *dstp) | ||
559 | { | ||
560 | return bitmap_parselist_user(buf, len, cpumask_bits(dstp), | ||
561 | nr_cpumask_bits); | ||
562 | } | ||
563 | |||
564 | /** | ||
550 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list | 565 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list |
551 | * @buf: the buffer to sprintf into | 566 | * @buf: the buffer to sprintf into |
552 | * @len: the length of the buffer | 567 | * @len: the length of the buffer |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index f20eb8f16025..e9eaec522655 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -146,7 +146,7 @@ static inline void cpuset_cpus_allowed(struct task_struct *p, | |||
146 | 146 | ||
147 | static inline int cpuset_cpus_allowed_fallback(struct task_struct *p) | 147 | static inline int cpuset_cpus_allowed_fallback(struct task_struct *p) |
148 | { | 148 | { |
149 | cpumask_copy(&p->cpus_allowed, cpu_possible_mask); | 149 | do_set_cpus_allowed(p, cpu_possible_mask); |
150 | return cpumask_any(cpu_active_mask); | 150 | return cpumask_any(cpu_active_mask); |
151 | } | 151 | } |
152 | 152 | ||
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 088cd4ace4ef..74054074e876 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -66,6 +66,11 @@ static inline void vmcore_unusable(void) | |||
66 | if (is_kdump_kernel()) | 66 | if (is_kdump_kernel()) |
67 | elfcorehdr_addr = ELFCORE_ADDR_ERR; | 67 | elfcorehdr_addr = ELFCORE_ADDR_ERR; |
68 | } | 68 | } |
69 | |||
70 | #define HAVE_OLDMEM_PFN_IS_RAM 1 | ||
71 | extern int register_oldmem_pfn_is_ram(int (*fn)(unsigned long pfn)); | ||
72 | extern void unregister_oldmem_pfn_is_ram(void); | ||
73 | |||
69 | #else /* !CONFIG_CRASH_DUMP */ | 74 | #else /* !CONFIG_CRASH_DUMP */ |
70 | static inline int is_kdump_kernel(void) { return 0; } | 75 | static inline int is_kdump_kernel(void) { return 0; } |
71 | #endif /* CONFIG_CRASH_DUMP */ | 76 | #endif /* CONFIG_CRASH_DUMP */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h index be16b61283cc..82607992f308 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Credentials management - see Documentation/credentials.txt | 1 | /* Credentials management - see Documentation/security/credentials.txt |
2 | * | 2 | * |
3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 32a4423710f5..4427e0454051 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -191,6 +191,12 @@ struct dm_target { | |||
191 | 191 | ||
192 | /* Used to provide an error string from the ctr */ | 192 | /* Used to provide an error string from the ctr */ |
193 | char *error; | 193 | char *error; |
194 | |||
195 | /* | ||
196 | * Set if this target needs to receive discards regardless of | ||
197 | * whether or not its underlying devices have support. | ||
198 | */ | ||
199 | unsigned discards_supported:1; | ||
194 | }; | 200 | }; |
195 | 201 | ||
196 | /* Each target can link one of these into the table */ | 202 | /* Each target can link one of these into the table */ |
diff --git a/include/linux/device.h b/include/linux/device.h index d08399db6e2c..c66111affca9 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -47,6 +47,38 @@ extern int __must_check bus_create_file(struct bus_type *, | |||
47 | struct bus_attribute *); | 47 | struct bus_attribute *); |
48 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 48 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
49 | 49 | ||
50 | /** | ||
51 | * struct bus_type - The bus type of the device | ||
52 | * | ||
53 | * @name: The name of the bus. | ||
54 | * @bus_attrs: Default attributes of the bus. | ||
55 | * @dev_attrs: Default attributes of the devices on the bus. | ||
56 | * @drv_attrs: Default attributes of the device drivers on the bus. | ||
57 | * @match: Called, perhaps multiple times, whenever a new device or driver | ||
58 | * is added for this bus. It should return a nonzero value if the | ||
59 | * given device can be handled by the given driver. | ||
60 | * @uevent: Called when a device is added, removed, or a few other things | ||
61 | * that generate uevents to add the environment variables. | ||
62 | * @probe: Called when a new device or driver add to this bus, and callback | ||
63 | * the specific driver's probe to initial the matched device. | ||
64 | * @remove: Called when a device removed from this bus. | ||
65 | * @shutdown: Called at shut-down time to quiesce the device. | ||
66 | * @suspend: Called when a device on this bus wants to go to sleep mode. | ||
67 | * @resume: Called to bring a device on this bus out of sleep mode. | ||
68 | * @pm: Power management operations of this bus, callback the specific | ||
69 | * device driver's pm-ops. | ||
70 | * @p: The private data of the driver core, only the driver core can | ||
71 | * touch this. | ||
72 | * | ||
73 | * A bus is a channel between the processor and one or more devices. For the | ||
74 | * purposes of the device model, all devices are connected via a bus, even if | ||
75 | * it is an internal, virtual, "platform" bus. Buses can plug into each other. | ||
76 | * A USB controller is usually a PCI device, for example. The device model | ||
77 | * represents the actual connections between buses and the devices they control. | ||
78 | * A bus is represented by the bus_type structure. It contains the name, the | ||
79 | * default attributes, the bus' methods, PM operations, and the driver core's | ||
80 | * private data. | ||
81 | */ | ||
50 | struct bus_type { | 82 | struct bus_type { |
51 | const char *name; | 83 | const char *name; |
52 | struct bus_attribute *bus_attrs; | 84 | struct bus_attribute *bus_attrs; |
@@ -119,6 +151,37 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
119 | extern struct kset *bus_get_kset(struct bus_type *bus); | 151 | extern struct kset *bus_get_kset(struct bus_type *bus); |
120 | extern struct klist *bus_get_device_klist(struct bus_type *bus); | 152 | extern struct klist *bus_get_device_klist(struct bus_type *bus); |
121 | 153 | ||
154 | /** | ||
155 | * struct device_driver - The basic device driver structure | ||
156 | * @name: Name of the device driver. | ||
157 | * @bus: The bus which the device of this driver belongs to. | ||
158 | * @owner: The module owner. | ||
159 | * @mod_name: Used for built-in modules. | ||
160 | * @suppress_bind_attrs: Disables bind/unbind via sysfs. | ||
161 | * @of_match_table: The open firmware table. | ||
162 | * @probe: Called to query the existence of a specific device, | ||
163 | * whether this driver can work with it, and bind the driver | ||
164 | * to a specific device. | ||
165 | * @remove: Called when the device is removed from the system to | ||
166 | * unbind a device from this driver. | ||
167 | * @shutdown: Called at shut-down time to quiesce the device. | ||
168 | * @suspend: Called to put the device to sleep mode. Usually to a | ||
169 | * low power state. | ||
170 | * @resume: Called to bring a device from sleep mode. | ||
171 | * @groups: Default attributes that get created by the driver core | ||
172 | * automatically. | ||
173 | * @pm: Power management operations of the device which matched | ||
174 | * this driver. | ||
175 | * @p: Driver core's private data, no one other than the driver | ||
176 | * core can touch this. | ||
177 | * | ||
178 | * The device driver-model tracks all of the drivers known to the system. | ||
179 | * The main reason for this tracking is to enable the driver core to match | ||
180 | * up drivers with new devices. Once drivers are known objects within the | ||
181 | * system, however, a number of other things become possible. Device drivers | ||
182 | * can export information and configuration variables that are independent | ||
183 | * of any specific device. | ||
184 | */ | ||
122 | struct device_driver { | 185 | struct device_driver { |
123 | const char *name; | 186 | const char *name; |
124 | struct bus_type *bus; | 187 | struct bus_type *bus; |
@@ -185,8 +248,34 @@ struct device *driver_find_device(struct device_driver *drv, | |||
185 | struct device *start, void *data, | 248 | struct device *start, void *data, |
186 | int (*match)(struct device *dev, void *data)); | 249 | int (*match)(struct device *dev, void *data)); |
187 | 250 | ||
188 | /* | 251 | /** |
189 | * device classes | 252 | * struct class - device classes |
253 | * @name: Name of the class. | ||
254 | * @owner: The module owner. | ||
255 | * @class_attrs: Default attributes of this class. | ||
256 | * @dev_attrs: Default attributes of the devices belong to the class. | ||
257 | * @dev_bin_attrs: Default binary attributes of the devices belong to the class. | ||
258 | * @dev_kobj: The kobject that represents this class and links it into the hierarchy. | ||
259 | * @dev_uevent: Called when a device is added, removed from this class, or a | ||
260 | * few other things that generate uevents to add the environment | ||
261 | * variables. | ||
262 | * @devnode: Callback to provide the devtmpfs. | ||
263 | * @class_release: Called to release this class. | ||
264 | * @dev_release: Called to release the device. | ||
265 | * @suspend: Used to put the device to sleep mode, usually to a low power | ||
266 | * state. | ||
267 | * @resume: Used to bring the device from the sleep mode. | ||
268 | * @ns_type: Callbacks so sysfs can detemine namespaces. | ||
269 | * @namespace: Namespace of the device belongs to this class. | ||
270 | * @pm: The default device power management operations of this class. | ||
271 | * @p: The private data of the driver core, no one other than the | ||
272 | * driver core can touch this. | ||
273 | * | ||
274 | * A class is a higher-level view of a device that abstracts out low-level | ||
275 | * implementation details. Drivers may see a SCSI disk or an ATA disk, but, | ||
276 | * at the class level, they are all simply disks. Classes allow user space | ||
277 | * to work with devices based on what they do, rather than how they are | ||
278 | * connected or how they work. | ||
190 | */ | 279 | */ |
191 | struct class { | 280 | struct class { |
192 | const char *name; | 281 | const char *name; |
@@ -401,6 +490,65 @@ struct device_dma_parameters { | |||
401 | unsigned long segment_boundary_mask; | 490 | unsigned long segment_boundary_mask; |
402 | }; | 491 | }; |
403 | 492 | ||
493 | /** | ||
494 | * struct device - The basic device structure | ||
495 | * @parent: The device's "parent" device, the device to which it is attached. | ||
496 | * In most cases, a parent device is some sort of bus or host | ||
497 | * controller. If parent is NULL, the device, is a top-level device, | ||
498 | * which is not usually what you want. | ||
499 | * @p: Holds the private data of the driver core portions of the device. | ||
500 | * See the comment of the struct device_private for detail. | ||
501 | * @kobj: A top-level, abstract class from which other classes are derived. | ||
502 | * @init_name: Initial name of the device. | ||
503 | * @type: The type of device. | ||
504 | * This identifies the device type and carries type-specific | ||
505 | * information. | ||
506 | * @mutex: Mutex to synchronize calls to its driver. | ||
507 | * @bus: Type of bus device is on. | ||
508 | * @driver: Which driver has allocated this | ||
509 | * @platform_data: Platform data specific to the device. | ||
510 | * Example: For devices on custom boards, as typical of embedded | ||
511 | * and SOC based hardware, Linux often uses platform_data to point | ||
512 | * to board-specific structures describing devices and how they | ||
513 | * are wired. That can include what ports are available, chip | ||
514 | * variants, which GPIO pins act in what additional roles, and so | ||
515 | * on. This shrinks the "Board Support Packages" (BSPs) and | ||
516 | * minimizes board-specific #ifdefs in drivers. | ||
517 | * @power: For device power management. | ||
518 | * See Documentation/power/devices.txt for details. | ||
519 | * @pwr_domain: Provide callbacks that are executed during system suspend, | ||
520 | * hibernation, system resume and during runtime PM transitions | ||
521 | * along with subsystem-level and driver-level callbacks. | ||
522 | * @numa_node: NUMA node this device is close to. | ||
523 | * @dma_mask: Dma mask (if dma'ble device). | ||
524 | * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all | ||
525 | * hardware supports 64-bit addresses for consistent allocations | ||
526 | * such descriptors. | ||
527 | * @dma_parms: A low level driver may set these to teach IOMMU code about | ||
528 | * segment limitations. | ||
529 | * @dma_pools: Dma pools (if dma'ble device). | ||
530 | * @dma_mem: Internal for coherent mem override. | ||
531 | * @archdata: For arch-specific additions. | ||
532 | * @of_node: Associated device tree node. | ||
533 | * @of_match: Matching of_device_id from driver. | ||
534 | * @devt: For creating the sysfs "dev". | ||
535 | * @devres_lock: Spinlock to protect the resource of the device. | ||
536 | * @devres_head: The resources list of the device. | ||
537 | * @knode_class: The node used to add the device to the class list. | ||
538 | * @class: The class of the device. | ||
539 | * @groups: Optional attribute groups. | ||
540 | * @release: Callback to free the device after all references have | ||
541 | * gone away. This should be set by the allocator of the | ||
542 | * device (i.e. the bus driver that discovered the device). | ||
543 | * | ||
544 | * At the lowest level, every device in a Linux system is represented by an | ||
545 | * instance of struct device. The device structure contains the information | ||
546 | * that the device model core needs to model the system. Most subsystems, | ||
547 | * however, track additional information about the devices they host. As a | ||
548 | * result, it is rare for devices to be represented by bare device structures; | ||
549 | * instead, that structure, like kobject structures, is usually embedded within | ||
550 | * a higher-level representation of the device. | ||
551 | */ | ||
404 | struct device { | 552 | struct device { |
405 | struct device *parent; | 553 | struct device *parent; |
406 | 554 | ||
@@ -408,7 +556,7 @@ struct device { | |||
408 | 556 | ||
409 | struct kobject kobj; | 557 | struct kobject kobj; |
410 | const char *init_name; /* initial name of the device */ | 558 | const char *init_name; /* initial name of the device */ |
411 | struct device_type *type; | 559 | const struct device_type *type; |
412 | 560 | ||
413 | struct mutex mutex; /* mutex to synchronize calls to | 561 | struct mutex mutex; /* mutex to synchronize calls to |
414 | * its driver. | 562 | * its driver. |
@@ -556,7 +704,7 @@ extern int device_move(struct device *dev, struct device *new_parent, | |||
556 | extern const char *device_get_devnode(struct device *dev, | 704 | extern const char *device_get_devnode(struct device *dev, |
557 | mode_t *mode, const char **tmp); | 705 | mode_t *mode, const char **tmp); |
558 | extern void *dev_get_drvdata(const struct device *dev); | 706 | extern void *dev_get_drvdata(const struct device *dev); |
559 | extern void dev_set_drvdata(struct device *dev, void *data); | 707 | extern int dev_set_drvdata(struct device *dev, void *data); |
560 | 708 | ||
561 | /* | 709 | /* |
562 | * Root device objects for grouping under /sys/devices | 710 | * Root device objects for grouping under /sys/devices |
@@ -610,7 +758,7 @@ extern int (*platform_notify)(struct device *dev); | |||
610 | extern int (*platform_notify_remove)(struct device *dev); | 758 | extern int (*platform_notify_remove)(struct device *dev); |
611 | 759 | ||
612 | 760 | ||
613 | /** | 761 | /* |
614 | * get_device - atomically increment the reference count for the device. | 762 | * get_device - atomically increment the reference count for the device. |
615 | * | 763 | * |
616 | */ | 764 | */ |
@@ -632,13 +780,6 @@ static inline int devtmpfs_mount(const char *mountpoint) { return 0; } | |||
632 | /* drivers/base/power/shutdown.c */ | 780 | /* drivers/base/power/shutdown.c */ |
633 | extern void device_shutdown(void); | 781 | extern void device_shutdown(void); |
634 | 782 | ||
635 | #ifndef CONFIG_ARCH_NO_SYSDEV_OPS | ||
636 | /* drivers/base/sys.c */ | ||
637 | extern void sysdev_shutdown(void); | ||
638 | #else | ||
639 | static inline void sysdev_shutdown(void) { } | ||
640 | #endif | ||
641 | |||
642 | /* debugging and troubleshooting/diagnostic helpers. */ | 783 | /* debugging and troubleshooting/diagnostic helpers. */ |
643 | extern const char *dev_driver_string(const struct device *dev); | 784 | extern const char *dev_driver_string(const struct device *dev); |
644 | 785 | ||
@@ -741,13 +882,17 @@ do { \ | |||
741 | #endif | 882 | #endif |
742 | 883 | ||
743 | /* | 884 | /* |
744 | * dev_WARN() acts like dev_printk(), but with the key difference | 885 | * dev_WARN*() acts like dev_printk(), but with the key difference |
745 | * of using a WARN/WARN_ON to get the message out, including the | 886 | * of using a WARN/WARN_ON to get the message out, including the |
746 | * file/line information and a backtrace. | 887 | * file/line information and a backtrace. |
747 | */ | 888 | */ |
748 | #define dev_WARN(dev, format, arg...) \ | 889 | #define dev_WARN(dev, format, arg...) \ |
749 | WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); | 890 | WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg); |
750 | 891 | ||
892 | #define dev_WARN_ONCE(dev, condition, format, arg...) \ | ||
893 | WARN_ONCE(condition, "Device %s\n" format, \ | ||
894 | dev_driver_string(dev), ## arg) | ||
895 | |||
751 | /* Create alias, so I can be autoloaded. */ | 896 | /* Create alias, so I can be autoloaded. */ |
752 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 897 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
753 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) | 898 | MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/dlm_plock.h b/include/linux/dlm_plock.h index 2dd21243104f..3b1cc1be419f 100644 --- a/include/linux/dlm_plock.h +++ b/include/linux/dlm_plock.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #define DLM_PLOCK_MISC_NAME "dlm_plock" | 14 | #define DLM_PLOCK_MISC_NAME "dlm_plock" |
15 | 15 | ||
16 | #define DLM_PLOCK_VERSION_MAJOR 1 | 16 | #define DLM_PLOCK_VERSION_MAJOR 1 |
17 | #define DLM_PLOCK_VERSION_MINOR 1 | 17 | #define DLM_PLOCK_VERSION_MINOR 2 |
18 | #define DLM_PLOCK_VERSION_PATCH 0 | 18 | #define DLM_PLOCK_VERSION_PATCH 0 |
19 | 19 | ||
20 | enum { | 20 | enum { |
@@ -23,12 +23,14 @@ enum { | |||
23 | DLM_PLOCK_OP_GET, | 23 | DLM_PLOCK_OP_GET, |
24 | }; | 24 | }; |
25 | 25 | ||
26 | #define DLM_PLOCK_FL_CLOSE 1 | ||
27 | |||
26 | struct dlm_plock_info { | 28 | struct dlm_plock_info { |
27 | __u32 version[3]; | 29 | __u32 version[3]; |
28 | __u8 optype; | 30 | __u8 optype; |
29 | __u8 ex; | 31 | __u8 ex; |
30 | __u8 wait; | 32 | __u8 wait; |
31 | __u8 pad; | 33 | __u8 flags; |
32 | __u32 pid; | 34 | __u32 pid; |
33 | __s32 nodeid; | 35 | __s32 nodeid; |
34 | __s32 rv; | 36 | __s32 rv; |
diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h index 5c9186b93fff..f4b0aa3126f5 100644 --- a/include/linux/dm-io.h +++ b/include/linux/dm-io.h | |||
@@ -69,8 +69,7 @@ struct dm_io_request { | |||
69 | * | 69 | * |
70 | * Create/destroy may block. | 70 | * Create/destroy may block. |
71 | */ | 71 | */ |
72 | struct dm_io_client *dm_io_client_create(unsigned num_pages); | 72 | struct dm_io_client *dm_io_client_create(void); |
73 | int dm_io_client_resize(unsigned num_pages, struct dm_io_client *client); | ||
74 | void dm_io_client_destroy(struct dm_io_client *client); | 73 | void dm_io_client_destroy(struct dm_io_client *client); |
75 | 74 | ||
76 | /* | 75 | /* |
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h index 5db216311695..298d587e349b 100644 --- a/include/linux/dm-kcopyd.h +++ b/include/linux/dm-kcopyd.h | |||
@@ -25,8 +25,7 @@ | |||
25 | * To use kcopyd you must first create a dm_kcopyd_client object. | 25 | * To use kcopyd you must first create a dm_kcopyd_client object. |
26 | */ | 26 | */ |
27 | struct dm_kcopyd_client; | 27 | struct dm_kcopyd_client; |
28 | int dm_kcopyd_client_create(unsigned num_pages, | 28 | struct dm_kcopyd_client *dm_kcopyd_client_create(void); |
29 | struct dm_kcopyd_client **result); | ||
30 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); | 29 | void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc); |
31 | 30 | ||
32 | /* | 31 | /* |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 5619f8522738..bbd8661b3473 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -9,8 +9,12 @@ | |||
9 | #define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) | 9 | #define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) |
10 | #define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) | 10 | #define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) |
11 | 11 | ||
12 | #define VTD_STRIDE_SHIFT (9) | ||
13 | #define VTD_STRIDE_MASK (((u64)-1) << VTD_STRIDE_SHIFT) | ||
14 | |||
12 | #define DMA_PTE_READ (1) | 15 | #define DMA_PTE_READ (1) |
13 | #define DMA_PTE_WRITE (2) | 16 | #define DMA_PTE_WRITE (2) |
17 | #define DMA_PTE_LARGE_PAGE (1 << 7) | ||
14 | #define DMA_PTE_SNP (1 << 11) | 18 | #define DMA_PTE_SNP (1 << 11) |
15 | 19 | ||
16 | #define CONTEXT_TT_MULTI_LEVEL 0 | 20 | #define CONTEXT_TT_MULTI_LEVEL 0 |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index cec467f5d676..9e5f5607eba3 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | /* Although the Linux source code makes a difference between | 39 | /* Although the Linux source code makes a difference between |
40 | generic endianness and the bitfields' endianness, there is no | 40 | generic endianness and the bitfields' endianness, there is no |
41 | architecture as of Linux-2.6.24-rc4 where the bitfileds' endianness | 41 | architecture as of Linux-2.6.24-rc4 where the bitfields' endianness |
42 | does not match the generic endianness. */ | 42 | does not match the generic endianness. */ |
43 | 43 | ||
44 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 44 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.10" | 56 | #define REL_VERSION "8.3.11" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 96 | 59 | #define PRO_VERSION_MAX 96 |
@@ -195,7 +195,7 @@ enum drbd_conns { | |||
195 | C_WF_REPORT_PARAMS, /* we have a socket */ | 195 | C_WF_REPORT_PARAMS, /* we have a socket */ |
196 | C_CONNECTED, /* we have introduced each other */ | 196 | C_CONNECTED, /* we have introduced each other */ |
197 | C_STARTING_SYNC_S, /* starting full sync by admin request. */ | 197 | C_STARTING_SYNC_S, /* starting full sync by admin request. */ |
198 | C_STARTING_SYNC_T, /* stariing full sync by admin request. */ | 198 | C_STARTING_SYNC_T, /* starting full sync by admin request. */ |
199 | C_WF_BITMAP_S, | 199 | C_WF_BITMAP_S, |
200 | C_WF_BITMAP_T, | 200 | C_WF_BITMAP_T, |
201 | C_WF_SYNC_UUID, | 201 | C_WF_SYNC_UUID, |
@@ -236,7 +236,7 @@ union drbd_state { | |||
236 | * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com> | 236 | * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com> |
237 | * even though we transmit as "cpu_to_be32(state)", | 237 | * even though we transmit as "cpu_to_be32(state)", |
238 | * the offsets of the bitfields still need to be swapped | 238 | * the offsets of the bitfields still need to be swapped |
239 | * on different endianess. | 239 | * on different endianness. |
240 | */ | 240 | */ |
241 | struct { | 241 | struct { |
242 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 242 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
@@ -266,7 +266,7 @@ union drbd_state { | |||
266 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ | 266 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ |
267 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ | 267 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ |
268 | #else | 268 | #else |
269 | # error "this endianess is not supported" | 269 | # error "this endianness is not supported" |
270 | #endif | 270 | #endif |
271 | }; | 271 | }; |
272 | unsigned int i; | 272 | unsigned int i; |
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h index f14a165e82dc..069543190516 100644 --- a/include/linux/drbd_tag_magic.h +++ b/include/linux/drbd_tag_magic.h | |||
@@ -30,7 +30,7 @@ enum packet_types { | |||
30 | int tag_and_len ## member; | 30 | int tag_and_len ## member; |
31 | #include "linux/drbd_nl.h" | 31 | #include "linux/drbd_nl.h" |
32 | 32 | ||
33 | /* declate tag-list-sizes */ | 33 | /* declare tag-list-sizes */ |
34 | static const int tag_list_sizes[] = { | 34 | static const int tag_list_sizes[] = { |
35 | #define NL_PACKET(name, number, fields) 2 fields , | 35 | #define NL_PACKET(name, number, fields) 2 fields , |
36 | #define NL_INTEGER(pn, pr, member) + 4 + 4 | 36 | #define NL_INTEGER(pn, pr, member) + 4 + 4 |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 493a2bf85f62..36a3ed63f571 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
@@ -175,14 +175,20 @@ typedef enum fe_transmit_mode { | |||
175 | TRANSMISSION_MODE_2K, | 175 | TRANSMISSION_MODE_2K, |
176 | TRANSMISSION_MODE_8K, | 176 | TRANSMISSION_MODE_8K, |
177 | TRANSMISSION_MODE_AUTO, | 177 | TRANSMISSION_MODE_AUTO, |
178 | TRANSMISSION_MODE_4K | 178 | TRANSMISSION_MODE_4K, |
179 | TRANSMISSION_MODE_1K, | ||
180 | TRANSMISSION_MODE_16K, | ||
181 | TRANSMISSION_MODE_32K, | ||
179 | } fe_transmit_mode_t; | 182 | } fe_transmit_mode_t; |
180 | 183 | ||
181 | typedef enum fe_bandwidth { | 184 | typedef enum fe_bandwidth { |
182 | BANDWIDTH_8_MHZ, | 185 | BANDWIDTH_8_MHZ, |
183 | BANDWIDTH_7_MHZ, | 186 | BANDWIDTH_7_MHZ, |
184 | BANDWIDTH_6_MHZ, | 187 | BANDWIDTH_6_MHZ, |
185 | BANDWIDTH_AUTO | 188 | BANDWIDTH_AUTO, |
189 | BANDWIDTH_5_MHZ, | ||
190 | BANDWIDTH_10_MHZ, | ||
191 | BANDWIDTH_1_712_MHZ, | ||
186 | } fe_bandwidth_t; | 192 | } fe_bandwidth_t; |
187 | 193 | ||
188 | 194 | ||
@@ -191,7 +197,10 @@ typedef enum fe_guard_interval { | |||
191 | GUARD_INTERVAL_1_16, | 197 | GUARD_INTERVAL_1_16, |
192 | GUARD_INTERVAL_1_8, | 198 | GUARD_INTERVAL_1_8, |
193 | GUARD_INTERVAL_1_4, | 199 | GUARD_INTERVAL_1_4, |
194 | GUARD_INTERVAL_AUTO | 200 | GUARD_INTERVAL_AUTO, |
201 | GUARD_INTERVAL_1_128, | ||
202 | GUARD_INTERVAL_19_128, | ||
203 | GUARD_INTERVAL_19_256, | ||
195 | } fe_guard_interval_t; | 204 | } fe_guard_interval_t; |
196 | 205 | ||
197 | 206 | ||
@@ -305,7 +314,9 @@ struct dvb_frontend_event { | |||
305 | 314 | ||
306 | #define DTV_ISDBS_TS_ID 42 | 315 | #define DTV_ISDBS_TS_ID 42 |
307 | 316 | ||
308 | #define DTV_MAX_COMMAND DTV_ISDBS_TS_ID | 317 | #define DTV_DVBT2_PLP_ID 43 |
318 | |||
319 | #define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID | ||
309 | 320 | ||
310 | typedef enum fe_pilot { | 321 | typedef enum fe_pilot { |
311 | PILOT_ON, | 322 | PILOT_ON, |
@@ -337,6 +348,7 @@ typedef enum fe_delivery_system { | |||
337 | SYS_DMBTH, | 348 | SYS_DMBTH, |
338 | SYS_CMMB, | 349 | SYS_CMMB, |
339 | SYS_DAB, | 350 | SYS_DAB, |
351 | SYS_DVBT2, | ||
340 | } fe_delivery_system_t; | 352 | } fe_delivery_system_t; |
341 | 353 | ||
342 | struct dtv_cmds_h { | 354 | struct dtv_cmds_h { |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 5a7546c12688..1421cc84afaa 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
@@ -24,6 +24,6 @@ | |||
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 5 | 26 | #define DVB_API_VERSION 5 |
27 | #define DVB_API_VERSION_MINOR 2 | 27 | #define DVB_API_VERSION_MINOR 3 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h index 6998d9376ef9..4bfe0a2f7d50 100644 --- a/include/linux/dw_dmac.h +++ b/include/linux/dw_dmac.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * AVR32 systems.) | 3 | * AVR32 systems.) |
4 | * | 4 | * |
5 | * Copyright (C) 2007 Atmel Corporation | 5 | * Copyright (C) 2007 Atmel Corporation |
6 | * Copyright (C) 2010-2011 ST Microelectronics | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 0c9653f11c18..e747ecd48e1c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _DYNAMIC_DEBUG_H | 1 | #ifndef _DYNAMIC_DEBUG_H |
2 | #define _DYNAMIC_DEBUG_H | 2 | #define _DYNAMIC_DEBUG_H |
3 | 3 | ||
4 | #include <linux/jump_label.h> | ||
5 | |||
6 | /* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which | 4 | /* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which |
7 | * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They | 5 | * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They |
8 | * use independent hash functions, to reduce the chance of false positives. | 6 | * use independent hash functions, to reduce the chance of false positives. |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 33fa1203024e..e376270cd26e 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -299,6 +299,7 @@ extern void efi_initialize_iomem_resources(struct resource *code_resource, | |||
299 | struct resource *data_resource, struct resource *bss_resource); | 299 | struct resource *data_resource, struct resource *bss_resource); |
300 | extern unsigned long efi_get_time(void); | 300 | extern unsigned long efi_get_time(void); |
301 | extern int efi_set_rtc_mmss(unsigned long nowtime); | 301 | extern int efi_set_rtc_mmss(unsigned long nowtime); |
302 | extern void efi_reserve_boot_services(void); | ||
302 | extern struct efi_memory_map memmap; | 303 | extern struct efi_memory_map memmap; |
303 | 304 | ||
304 | /** | 305 | /** |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 4d608014753a..110821cb6ea5 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -395,6 +395,7 @@ typedef struct elf64_shdr { | |||
395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | 395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ |
396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | 396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ |
397 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ | 397 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ |
398 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ | ||
398 | 399 | ||
399 | 400 | ||
400 | /* Note header in a PT_NOTE section */ | 401 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index dc80d8294247..439b173c5882 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -24,7 +24,10 @@ struct ethtool_cmd { | |||
24 | __u32 cmd; | 24 | __u32 cmd; |
25 | __u32 supported; /* Features this interface supports */ | 25 | __u32 supported; /* Features this interface supports */ |
26 | __u32 advertising; /* Features this interface advertises */ | 26 | __u32 advertising; /* Features this interface advertises */ |
27 | __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ | 27 | __u16 speed; /* The forced speed (lower bits) in |
28 | * Mbps. Please use | ||
29 | * ethtool_cmd_speed()/_set() to | ||
30 | * access it */ | ||
28 | __u8 duplex; /* Duplex, half or full */ | 31 | __u8 duplex; /* Duplex, half or full */ |
29 | __u8 port; /* Which connector port */ | 32 | __u8 port; /* Which connector port */ |
30 | __u8 phy_address; | 33 | __u8 phy_address; |
@@ -33,7 +36,10 @@ struct ethtool_cmd { | |||
33 | __u8 mdio_support; | 36 | __u8 mdio_support; |
34 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ | 37 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ |
35 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ | 38 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ |
36 | __u16 speed_hi; | 39 | __u16 speed_hi; /* The forced speed (upper |
40 | * bits) in Mbps. Please use | ||
41 | * ethtool_cmd_speed()/_set() to | ||
42 | * access it */ | ||
37 | __u8 eth_tp_mdix; | 43 | __u8 eth_tp_mdix; |
38 | __u8 reserved2; | 44 | __u8 reserved2; |
39 | __u32 lp_advertising; /* Features the link partner advertises */ | 45 | __u32 lp_advertising; /* Features the link partner advertises */ |
@@ -41,14 +47,14 @@ struct ethtool_cmd { | |||
41 | }; | 47 | }; |
42 | 48 | ||
43 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, | 49 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, |
44 | __u32 speed) | 50 | __u32 speed) |
45 | { | 51 | { |
46 | 52 | ||
47 | ep->speed = (__u16)speed; | 53 | ep->speed = (__u16)speed; |
48 | ep->speed_hi = (__u16)(speed >> 16); | 54 | ep->speed_hi = (__u16)(speed >> 16); |
49 | } | 55 | } |
50 | 56 | ||
51 | static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) | 57 | static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep) |
52 | { | 58 | { |
53 | return (ep->speed_hi << 16) | ep->speed; | 59 | return (ep->speed_hi << 16) | ep->speed; |
54 | } | 60 | } |
@@ -229,12 +235,40 @@ struct ethtool_ringparam { | |||
229 | __u32 tx_pending; | 235 | __u32 tx_pending; |
230 | }; | 236 | }; |
231 | 237 | ||
238 | /** | ||
239 | * struct ethtool_channels - configuring number of network channel | ||
240 | * @cmd: ETHTOOL_{G,S}CHANNELS | ||
241 | * @max_rx: Read only. Maximum number of receive channel the driver support. | ||
242 | * @max_tx: Read only. Maximum number of transmit channel the driver support. | ||
243 | * @max_other: Read only. Maximum number of other channel the driver support. | ||
244 | * @max_combined: Read only. Maximum number of combined channel the driver | ||
245 | * support. Set of queues RX, TX or other. | ||
246 | * @rx_count: Valid values are in the range 1 to the max_rx. | ||
247 | * @tx_count: Valid values are in the range 1 to the max_tx. | ||
248 | * @other_count: Valid values are in the range 1 to the max_other. | ||
249 | * @combined_count: Valid values are in the range 1 to the max_combined. | ||
250 | * | ||
251 | * This can be used to configure RX, TX and other channels. | ||
252 | */ | ||
253 | |||
254 | struct ethtool_channels { | ||
255 | __u32 cmd; | ||
256 | __u32 max_rx; | ||
257 | __u32 max_tx; | ||
258 | __u32 max_other; | ||
259 | __u32 max_combined; | ||
260 | __u32 rx_count; | ||
261 | __u32 tx_count; | ||
262 | __u32 other_count; | ||
263 | __u32 combined_count; | ||
264 | }; | ||
265 | |||
232 | /* for configuring link flow control parameters */ | 266 | /* for configuring link flow control parameters */ |
233 | struct ethtool_pauseparam { | 267 | struct ethtool_pauseparam { |
234 | __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ | 268 | __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ |
235 | 269 | ||
236 | /* If the link is being auto-negotiated (via ethtool_cmd.autoneg | 270 | /* If the link is being auto-negotiated (via ethtool_cmd.autoneg |
237 | * being true) the user may set 'autonet' here non-zero to have the | 271 | * being true) the user may set 'autoneg' here non-zero to have the |
238 | * pause parameters be auto-negotiated too. In such a case, the | 272 | * pause parameters be auto-negotiated too. In such a case, the |
239 | * {rx,tx}_pause values below determine what capabilities are | 273 | * {rx,tx}_pause values below determine what capabilities are |
240 | * advertised. | 274 | * advertised. |
@@ -380,27 +414,42 @@ struct ethtool_usrip4_spec { | |||
380 | __u8 proto; | 414 | __u8 proto; |
381 | }; | 415 | }; |
382 | 416 | ||
417 | union ethtool_flow_union { | ||
418 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
419 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
420 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
421 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
422 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
423 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
424 | struct ethhdr ether_spec; | ||
425 | __u8 hdata[60]; | ||
426 | }; | ||
427 | |||
428 | struct ethtool_flow_ext { | ||
429 | __be16 vlan_etype; | ||
430 | __be16 vlan_tci; | ||
431 | __be32 data[2]; | ||
432 | }; | ||
433 | |||
383 | /** | 434 | /** |
384 | * struct ethtool_rx_flow_spec - specification for RX flow filter | 435 | * struct ethtool_rx_flow_spec - specification for RX flow filter |
385 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW | 436 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW |
386 | * @h_u: Flow fields to match (dependent on @flow_type) | 437 | * @h_u: Flow fields to match (dependent on @flow_type) |
387 | * @m_u: Masks for flow field bits to be ignored | 438 | * @h_ext: Additional fields to match |
439 | * @m_u: Masks for flow field bits to be matched | ||
440 | * @m_ext: Masks for additional field bits to be matched | ||
441 | * Note, all additional fields must be ignored unless @flow_type | ||
442 | * includes the %FLOW_EXT flag. | ||
388 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC | 443 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC |
389 | * if packets should be discarded | 444 | * if packets should be discarded |
390 | * @location: Index of filter in hardware table | 445 | * @location: Index of filter in hardware table |
391 | */ | 446 | */ |
392 | struct ethtool_rx_flow_spec { | 447 | struct ethtool_rx_flow_spec { |
393 | __u32 flow_type; | 448 | __u32 flow_type; |
394 | union { | 449 | union ethtool_flow_union h_u; |
395 | struct ethtool_tcpip4_spec tcp_ip4_spec; | 450 | struct ethtool_flow_ext h_ext; |
396 | struct ethtool_tcpip4_spec udp_ip4_spec; | 451 | union ethtool_flow_union m_u; |
397 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 452 | struct ethtool_flow_ext m_ext; |
398 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
399 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
400 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
401 | struct ethhdr ether_spec; | ||
402 | __u8 hdata[72]; | ||
403 | } h_u, m_u; | ||
404 | __u64 ring_cookie; | 453 | __u64 ring_cookie; |
405 | __u32 location; | 454 | __u32 location; |
406 | }; | 455 | }; |
@@ -458,16 +507,10 @@ struct ethtool_rxnfc { | |||
458 | 507 | ||
459 | struct compat_ethtool_rx_flow_spec { | 508 | struct compat_ethtool_rx_flow_spec { |
460 | u32 flow_type; | 509 | u32 flow_type; |
461 | union { | 510 | union ethtool_flow_union h_u; |
462 | struct ethtool_tcpip4_spec tcp_ip4_spec; | 511 | struct ethtool_flow_ext h_ext; |
463 | struct ethtool_tcpip4_spec udp_ip4_spec; | 512 | union ethtool_flow_union m_u; |
464 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 513 | struct ethtool_flow_ext m_ext; |
465 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
466 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
467 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
468 | struct ethhdr ether_spec; | ||
469 | u8 hdata[72]; | ||
470 | } h_u, m_u; | ||
471 | compat_u64 ring_cookie; | 514 | compat_u64 ring_cookie; |
472 | u32 location; | 515 | u32 location; |
473 | }; | 516 | }; |
@@ -558,6 +601,26 @@ struct ethtool_flash { | |||
558 | char data[ETHTOOL_FLASH_MAX_FILENAME]; | 601 | char data[ETHTOOL_FLASH_MAX_FILENAME]; |
559 | }; | 602 | }; |
560 | 603 | ||
604 | /** | ||
605 | * struct ethtool_dump - used for retrieving, setting device dump | ||
606 | * @cmd: Command number - %ETHTOOL_GET_DUMP_FLAG, %ETHTOOL_GET_DUMP_DATA, or | ||
607 | * %ETHTOOL_SET_DUMP | ||
608 | * @version: FW version of the dump, filled in by driver | ||
609 | * @flag: driver dependent flag for dump setting, filled in by driver during | ||
610 | * get and filled in by ethtool for set operation | ||
611 | * @len: length of dump data, used as the length of the user buffer on entry to | ||
612 | * %ETHTOOL_GET_DUMP_DATA and this is returned as dump length by driver | ||
613 | * for %ETHTOOL_GET_DUMP_FLAG command | ||
614 | * @data: data collected for get dump data operation | ||
615 | */ | ||
616 | struct ethtool_dump { | ||
617 | __u32 cmd; | ||
618 | __u32 version; | ||
619 | __u32 flag; | ||
620 | __u32 len; | ||
621 | __u8 data[0]; | ||
622 | }; | ||
623 | |||
561 | /* for returning and changing feature sets */ | 624 | /* for returning and changing feature sets */ |
562 | 625 | ||
563 | /** | 626 | /** |
@@ -663,6 +726,22 @@ struct ethtool_rx_ntuple_list { | |||
663 | unsigned int count; | 726 | unsigned int count; |
664 | }; | 727 | }; |
665 | 728 | ||
729 | /** | ||
730 | * enum ethtool_phys_id_state - indicator state for physical identification | ||
731 | * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated | ||
732 | * @ETHTOOL_ID_ACTIVE: Physical ID indicator should be activated | ||
733 | * @ETHTOOL_ID_ON: LED should be turned on (used iff %ETHTOOL_ID_ACTIVE | ||
734 | * is not supported) | ||
735 | * @ETHTOOL_ID_OFF: LED should be turned off (used iff %ETHTOOL_ID_ACTIVE | ||
736 | * is not supported) | ||
737 | */ | ||
738 | enum ethtool_phys_id_state { | ||
739 | ETHTOOL_ID_INACTIVE, | ||
740 | ETHTOOL_ID_ACTIVE, | ||
741 | ETHTOOL_ID_ON, | ||
742 | ETHTOOL_ID_OFF | ||
743 | }; | ||
744 | |||
666 | struct net_device; | 745 | struct net_device; |
667 | 746 | ||
668 | /* Some generic methods drivers may use in their ethtool_ops */ | 747 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -683,63 +762,131 @@ void ethtool_ntuple_flush(struct net_device *dev); | |||
683 | bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); | 762 | bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); |
684 | 763 | ||
685 | /** | 764 | /** |
686 | * ðtool_ops - Alter and report network device settings | 765 | * struct ethtool_ops - optional netdev operations |
687 | * get_settings: Get device-specific settings | 766 | * @get_settings: Get various device settings including Ethernet link |
688 | * set_settings: Set device-specific settings | 767 | * settings. The @cmd parameter is expected to have been cleared |
689 | * get_drvinfo: Report driver information | 768 | * before get_settings is called. Returns a negative error code or |
690 | * get_regs: Get device registers | 769 | * zero. |
691 | * get_wol: Report whether Wake-on-Lan is enabled | 770 | * @set_settings: Set various device settings including Ethernet link |
692 | * set_wol: Turn Wake-on-Lan on or off | 771 | * settings. Returns a negative error code or zero. |
693 | * get_msglevel: Report driver message level | 772 | * @get_drvinfo: Report driver/device information. Should only set the |
694 | * set_msglevel: Set driver message level | 773 | * @driver, @version, @fw_version and @bus_info fields. If not |
695 | * nway_reset: Restart autonegotiation | 774 | * implemented, the @driver and @bus_info fields will be filled in |
696 | * get_link: Get link status | 775 | * according to the netdev's parent device. |
697 | * get_eeprom: Read data from the device EEPROM | 776 | * @get_regs_len: Get buffer length required for @get_regs |
698 | * set_eeprom: Write data to the device EEPROM | 777 | * @get_regs: Get device registers |
699 | * get_coalesce: Get interrupt coalescing parameters | 778 | * @get_wol: Report whether Wake-on-Lan is enabled |
700 | * set_coalesce: Set interrupt coalescing parameters | 779 | * @set_wol: Turn Wake-on-Lan on or off. Returns a negative error code |
701 | * get_ringparam: Report ring sizes | 780 | * or zero. |
702 | * set_ringparam: Set ring sizes | 781 | * @get_msglevel: Report driver message level. This should be the value |
703 | * get_pauseparam: Report pause parameters | 782 | * of the @msg_enable field used by netif logging functions. |
704 | * set_pauseparam: Set pause parameters | 783 | * @set_msglevel: Set driver message level |
705 | * get_rx_csum: Report whether receive checksums are turned on or off | 784 | * @nway_reset: Restart autonegotiation. Returns a negative error code |
706 | * set_rx_csum: Turn receive checksum on or off | 785 | * or zero. |
707 | * get_tx_csum: Report whether transmit checksums are turned on or off | 786 | * @get_link: Report whether physical link is up. Will only be called if |
708 | * set_tx_csum: Turn transmit checksums on or off | 787 | * the netdev is up. Should usually be set to ethtool_op_get_link(), |
709 | * get_sg: Report whether scatter-gather is enabled | 788 | * which uses netif_carrier_ok(). |
710 | * set_sg: Turn scatter-gather on or off | 789 | * @get_eeprom: Read data from the device EEPROM. |
711 | * get_tso: Report whether TCP segmentation offload is enabled | ||
712 | * set_tso: Turn TCP segmentation offload on or off | ||
713 | * get_ufo: Report whether UDP fragmentation offload is enabled | ||
714 | * set_ufo: Turn UDP fragmentation offload on or off | ||
715 | * self_test: Run specified self-tests | ||
716 | * get_strings: Return a set of strings that describe the requested objects | ||
717 | * phys_id: Identify the device | ||
718 | * get_stats: Return statistics about the device | ||
719 | * get_flags: get 32-bit flags bitmap | ||
720 | * set_flags: set 32-bit flags bitmap | ||
721 | * | ||
722 | * Description: | ||
723 | * | ||
724 | * get_settings: | ||
725 | * @get_settings is passed an ðtool_cmd to fill in. It returns | ||
726 | * an negative errno or zero. | ||
727 | * | ||
728 | * set_settings: | ||
729 | * @set_settings is passed an ðtool_cmd and should attempt to set | ||
730 | * all the settings this device supports. It may return an error value | ||
731 | * if something goes wrong (otherwise 0). | ||
732 | * | ||
733 | * get_eeprom: | ||
734 | * Should fill in the magic field. Don't need to check len for zero | 790 | * Should fill in the magic field. Don't need to check len for zero |
735 | * or wraparound. Fill in the data argument with the eeprom values | 791 | * or wraparound. Fill in the data argument with the eeprom values |
736 | * from offset to offset + len. Update len to the amount read. | 792 | * from offset to offset + len. Update len to the amount read. |
737 | * Returns an error or zero. | 793 | * Returns an error or zero. |
738 | * | 794 | * @set_eeprom: Write data to the device EEPROM. |
739 | * set_eeprom: | ||
740 | * Should validate the magic field. Don't need to check len for zero | 795 | * Should validate the magic field. Don't need to check len for zero |
741 | * or wraparound. Update len to the amount written. Returns an error | 796 | * or wraparound. Update len to the amount written. Returns an error |
742 | * or zero. | 797 | * or zero. |
798 | * @get_coalesce: Get interrupt coalescing parameters. Returns a negative | ||
799 | * error code or zero. | ||
800 | * @set_coalesce: Set interrupt coalescing parameters. Returns a negative | ||
801 | * error code or zero. | ||
802 | * @get_ringparam: Report ring sizes | ||
803 | * @set_ringparam: Set ring sizes. Returns a negative error code or zero. | ||
804 | * @get_pauseparam: Report pause parameters | ||
805 | * @set_pauseparam: Set pause parameters. Returns a negative error code | ||
806 | * or zero. | ||
807 | * @get_rx_csum: Deprecated in favour of the netdev feature %NETIF_F_RXCSUM. | ||
808 | * Report whether receive checksums are turned on or off. | ||
809 | * @set_rx_csum: Deprecated in favour of generic netdev features. Turn | ||
810 | * receive checksum on or off. Returns a negative error code or zero. | ||
811 | * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums | ||
812 | * are turned on or off. | ||
813 | * @set_tx_csum: Deprecated in favour of generic netdev features. Turn | ||
814 | * transmit checksums on or off. Returns a negative error code or zero. | ||
815 | * @get_sg: Deprecated as redundant. Report whether scatter-gather is | ||
816 | * enabled. | ||
817 | * @set_sg: Deprecated in favour of generic netdev features. Turn | ||
818 | * scatter-gather on or off. Returns a negative error code or zero. | ||
819 | * @get_tso: Deprecated as redundant. Report whether TCP segmentation | ||
820 | * offload is enabled. | ||
821 | * @set_tso: Deprecated in favour of generic netdev features. Turn TCP | ||
822 | * segmentation offload on or off. Returns a negative error code or zero. | ||
823 | * @self_test: Run specified self-tests | ||
824 | * @get_strings: Return a set of strings that describe the requested objects | ||
825 | * @set_phys_id: Identify the physical devices, e.g. by flashing an LED | ||
826 | * attached to it. The implementation may update the indicator | ||
827 | * asynchronously or synchronously, but in either case it must return | ||
828 | * quickly. It is initially called with the argument %ETHTOOL_ID_ACTIVE, | ||
829 | * and must either activate asynchronous updates and return zero, return | ||
830 | * a negative error or return a positive frequency for synchronous | ||
831 | * indication (e.g. 1 for one on/off cycle per second). If it returns | ||
832 | * a frequency then it will be called again at intervals with the | ||
833 | * argument %ETHTOOL_ID_ON or %ETHTOOL_ID_OFF and should set the state of | ||
834 | * the indicator accordingly. Finally, it is called with the argument | ||
835 | * %ETHTOOL_ID_INACTIVE and must deactivate the indicator. Returns a | ||
836 | * negative error code or zero. | ||
837 | * @get_ethtool_stats: Return extended statistics about the device. | ||
838 | * This is only useful if the device maintains statistics not | ||
839 | * included in &struct rtnl_link_stats64. | ||
840 | * @begin: Function to be called before any other operation. Returns a | ||
841 | * negative error code or zero. | ||
842 | * @complete: Function to be called after any other operation except | ||
843 | * @begin. Will be called even if the other operation failed. | ||
844 | * @get_ufo: Deprecated as redundant. Report whether UDP fragmentation | ||
845 | * offload is enabled. | ||
846 | * @set_ufo: Deprecated in favour of generic netdev features. Turn UDP | ||
847 | * fragmentation offload on or off. Returns a negative error code or zero. | ||
848 | * @get_flags: Deprecated as redundant. Report features included in | ||
849 | * &enum ethtool_flags that are enabled. | ||
850 | * @set_flags: Deprecated in favour of generic netdev features. Turn | ||
851 | * features included in &enum ethtool_flags on or off. Returns a | ||
852 | * negative error code or zero. | ||
853 | * @get_priv_flags: Report driver-specific feature flags. | ||
854 | * @set_priv_flags: Set driver-specific feature flags. Returns a negative | ||
855 | * error code or zero. | ||
856 | * @get_sset_count: Get number of strings that @get_strings will write. | ||
857 | * @get_rxnfc: Get RX flow classification rules. Returns a negative | ||
858 | * error code or zero. | ||
859 | * @set_rxnfc: Set RX flow classification rules. Returns a negative | ||
860 | * error code or zero. | ||
861 | * @flash_device: Write a firmware image to device's flash memory. | ||
862 | * Returns a negative error code or zero. | ||
863 | * @reset: Reset (part of) the device, as specified by a bitmask of | ||
864 | * flags from &enum ethtool_reset_flags. Returns a negative | ||
865 | * error code or zero. | ||
866 | * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code | ||
867 | * or zero. | ||
868 | * @get_rx_ntuple: Deprecated. | ||
869 | * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. | ||
870 | * Returns a negative error code or zero. | ||
871 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. | ||
872 | * Returns a negative error code or zero. | ||
873 | * @get_channels: Get number of channels. | ||
874 | * @set_channels: Set number of channels. Returns a negative error code or | ||
875 | * zero. | ||
876 | * @get_dump_flag: Get dump flag indicating current dump length, version, | ||
877 | * and flag of the device. | ||
878 | * @get_dump_data: Get dump data. | ||
879 | * @set_dump: Set dump specific flags to the device. | ||
880 | * | ||
881 | * All operations are optional (i.e. the function pointer may be set | ||
882 | * to %NULL) and callers must take this into account. Callers must | ||
883 | * hold the RTNL, except that for @get_drvinfo the caller may or may | ||
884 | * not hold the RTNL. | ||
885 | * | ||
886 | * See the structures used by these operations for further documentation. | ||
887 | * | ||
888 | * See &struct net_device and &struct net_device_ops for documentation | ||
889 | * of the generic netdev features interface. | ||
743 | */ | 890 | */ |
744 | struct ethtool_ops { | 891 | struct ethtool_ops { |
745 | int (*get_settings)(struct net_device *, struct ethtool_cmd *); | 892 | int (*get_settings)(struct net_device *, struct ethtool_cmd *); |
@@ -778,7 +925,7 @@ struct ethtool_ops { | |||
778 | int (*set_tso)(struct net_device *, u32); | 925 | int (*set_tso)(struct net_device *, u32); |
779 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); | 926 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); |
780 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); | 927 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); |
781 | int (*phys_id)(struct net_device *, u32); | 928 | int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state); |
782 | void (*get_ethtool_stats)(struct net_device *, | 929 | void (*get_ethtool_stats)(struct net_device *, |
783 | struct ethtool_stats *, u64 *); | 930 | struct ethtool_stats *, u64 *); |
784 | int (*begin)(struct net_device *); | 931 | int (*begin)(struct net_device *); |
@@ -802,6 +949,13 @@ struct ethtool_ops { | |||
802 | struct ethtool_rxfh_indir *); | 949 | struct ethtool_rxfh_indir *); |
803 | int (*set_rxfh_indir)(struct net_device *, | 950 | int (*set_rxfh_indir)(struct net_device *, |
804 | const struct ethtool_rxfh_indir *); | 951 | const struct ethtool_rxfh_indir *); |
952 | void (*get_channels)(struct net_device *, struct ethtool_channels *); | ||
953 | int (*set_channels)(struct net_device *, struct ethtool_channels *); | ||
954 | int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); | ||
955 | int (*get_dump_data)(struct net_device *, | ||
956 | struct ethtool_dump *, void *); | ||
957 | int (*set_dump)(struct net_device *, struct ethtool_dump *); | ||
958 | |||
805 | }; | 959 | }; |
806 | #endif /* __KERNEL__ */ | 960 | #endif /* __KERNEL__ */ |
807 | 961 | ||
@@ -870,6 +1024,11 @@ struct ethtool_ops { | |||
870 | 1024 | ||
871 | #define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */ | 1025 | #define ETHTOOL_GFEATURES 0x0000003a /* Get device offload settings */ |
872 | #define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */ | 1026 | #define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */ |
1027 | #define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */ | ||
1028 | #define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */ | ||
1029 | #define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */ | ||
1030 | #define ETHTOOL_GET_DUMP_FLAG 0x0000003f /* Get dump settings */ | ||
1031 | #define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */ | ||
873 | 1032 | ||
874 | /* compatibility with older code */ | 1033 | /* compatibility with older code */ |
875 | #define SPARC_ETH_GSET ETHTOOL_GSET | 1034 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -897,6 +1056,8 @@ struct ethtool_ops { | |||
897 | #define SUPPORTED_10000baseKX4_Full (1 << 18) | 1056 | #define SUPPORTED_10000baseKX4_Full (1 << 18) |
898 | #define SUPPORTED_10000baseKR_Full (1 << 19) | 1057 | #define SUPPORTED_10000baseKR_Full (1 << 19) |
899 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 1058 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
1059 | #define SUPPORTED_20000baseMLD2_Full (1 << 21) | ||
1060 | #define SUPPORTED_20000baseKR2_Full (1 << 22) | ||
900 | 1061 | ||
901 | /* Indicates what features are advertised by the interface. */ | 1062 | /* Indicates what features are advertised by the interface. */ |
902 | #define ADVERTISED_10baseT_Half (1 << 0) | 1063 | #define ADVERTISED_10baseT_Half (1 << 0) |
@@ -920,11 +1081,13 @@ struct ethtool_ops { | |||
920 | #define ADVERTISED_10000baseKX4_Full (1 << 18) | 1081 | #define ADVERTISED_10000baseKX4_Full (1 << 18) |
921 | #define ADVERTISED_10000baseKR_Full (1 << 19) | 1082 | #define ADVERTISED_10000baseKR_Full (1 << 19) |
922 | #define ADVERTISED_10000baseR_FEC (1 << 20) | 1083 | #define ADVERTISED_10000baseR_FEC (1 << 20) |
1084 | #define ADVERTISED_20000baseMLD2_Full (1 << 21) | ||
1085 | #define ADVERTISED_20000baseKR2_Full (1 << 22) | ||
923 | 1086 | ||
924 | /* The following are all involved in forcing a particular link | 1087 | /* The following are all involved in forcing a particular link |
925 | * mode for the device for setting things. When getting the | 1088 | * mode for the device for setting things. When getting the |
926 | * devices settings, these indicate the current mode and whether | 1089 | * devices settings, these indicate the current mode and whether |
927 | * it was foced up into this mode or autonegotiated. | 1090 | * it was forced up into this mode or autonegotiated. |
928 | */ | 1091 | */ |
929 | 1092 | ||
930 | /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ | 1093 | /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ |
@@ -992,6 +1155,8 @@ struct ethtool_ops { | |||
992 | #define IPV4_FLOW 0x10 /* hash only */ | 1155 | #define IPV4_FLOW 0x10 /* hash only */ |
993 | #define IPV6_FLOW 0x11 /* hash only */ | 1156 | #define IPV6_FLOW 0x11 /* hash only */ |
994 | #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ | 1157 | #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ |
1158 | /* Flag to enable additional fields in struct ethtool_rx_flow_spec */ | ||
1159 | #define FLOW_EXT 0x80000000 | ||
995 | 1160 | ||
996 | /* L3-L4 network traffic flow hash options */ | 1161 | /* L3-L4 network traffic flow hash options */ |
997 | #define RXH_L2DA (1 << 1) | 1162 | #define RXH_L2DA (1 << 1) |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 85c1d302c12e..5e06acf95d0f 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -909,7 +909,7 @@ extern int ext3_setattr (struct dentry *, struct iattr *); | |||
909 | extern void ext3_evict_inode (struct inode *); | 909 | extern void ext3_evict_inode (struct inode *); |
910 | extern int ext3_sync_inode (handle_t *, struct inode *); | 910 | extern int ext3_sync_inode (handle_t *, struct inode *); |
911 | extern void ext3_discard_reservation (struct inode *); | 911 | extern void ext3_discard_reservation (struct inode *); |
912 | extern void ext3_dirty_inode(struct inode *); | 912 | extern void ext3_dirty_inode(struct inode *, int); |
913 | extern int ext3_change_inode_journal_flag(struct inode *, int); | 913 | extern int ext3_change_inode_journal_flag(struct inode *, int); |
914 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); | 914 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); |
915 | extern int ext3_can_truncate(struct inode *inode); | 915 | extern int ext3_can_truncate(struct inode *inode); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 45266b75409a..9ee3f9fb0b4a 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -131,10 +131,16 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
131 | #define SKF_LL_OFF (-0x200000) | 131 | #define SKF_LL_OFF (-0x200000) |
132 | 132 | ||
133 | #ifdef __KERNEL__ | 133 | #ifdef __KERNEL__ |
134 | |||
135 | struct sk_buff; | ||
136 | struct sock; | ||
137 | |||
134 | struct sk_filter | 138 | struct sk_filter |
135 | { | 139 | { |
136 | atomic_t refcnt; | 140 | atomic_t refcnt; |
137 | unsigned int len; /* Number of filter blocks */ | 141 | unsigned int len; /* Number of filter blocks */ |
142 | unsigned int (*bpf_func)(const struct sk_buff *skb, | ||
143 | const struct sock_filter *filter); | ||
138 | struct rcu_head rcu; | 144 | struct rcu_head rcu; |
139 | struct sock_filter insns[0]; | 145 | struct sock_filter insns[0]; |
140 | }; | 146 | }; |
@@ -144,15 +150,86 @@ static inline unsigned int sk_filter_len(const struct sk_filter *fp) | |||
144 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); | 150 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); |
145 | } | 151 | } |
146 | 152 | ||
147 | struct sk_buff; | ||
148 | struct sock; | ||
149 | |||
150 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); | 153 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
151 | extern unsigned int sk_run_filter(const struct sk_buff *skb, | 154 | extern unsigned int sk_run_filter(const struct sk_buff *skb, |
152 | const struct sock_filter *filter); | 155 | const struct sock_filter *filter); |
153 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 156 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
154 | extern int sk_detach_filter(struct sock *sk); | 157 | extern int sk_detach_filter(struct sock *sk); |
155 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 158 | extern int sk_chk_filter(struct sock_filter *filter, int flen); |
159 | |||
160 | #ifdef CONFIG_BPF_JIT | ||
161 | extern void bpf_jit_compile(struct sk_filter *fp); | ||
162 | extern void bpf_jit_free(struct sk_filter *fp); | ||
163 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) | ||
164 | #else | ||
165 | static inline void bpf_jit_compile(struct sk_filter *fp) | ||
166 | { | ||
167 | } | ||
168 | static inline void bpf_jit_free(struct sk_filter *fp) | ||
169 | { | ||
170 | } | ||
171 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) | ||
172 | #endif | ||
173 | |||
174 | enum { | ||
175 | BPF_S_RET_K = 1, | ||
176 | BPF_S_RET_A, | ||
177 | BPF_S_ALU_ADD_K, | ||
178 | BPF_S_ALU_ADD_X, | ||
179 | BPF_S_ALU_SUB_K, | ||
180 | BPF_S_ALU_SUB_X, | ||
181 | BPF_S_ALU_MUL_K, | ||
182 | BPF_S_ALU_MUL_X, | ||
183 | BPF_S_ALU_DIV_X, | ||
184 | BPF_S_ALU_AND_K, | ||
185 | BPF_S_ALU_AND_X, | ||
186 | BPF_S_ALU_OR_K, | ||
187 | BPF_S_ALU_OR_X, | ||
188 | BPF_S_ALU_LSH_K, | ||
189 | BPF_S_ALU_LSH_X, | ||
190 | BPF_S_ALU_RSH_K, | ||
191 | BPF_S_ALU_RSH_X, | ||
192 | BPF_S_ALU_NEG, | ||
193 | BPF_S_LD_W_ABS, | ||
194 | BPF_S_LD_H_ABS, | ||
195 | BPF_S_LD_B_ABS, | ||
196 | BPF_S_LD_W_LEN, | ||
197 | BPF_S_LD_W_IND, | ||
198 | BPF_S_LD_H_IND, | ||
199 | BPF_S_LD_B_IND, | ||
200 | BPF_S_LD_IMM, | ||
201 | BPF_S_LDX_W_LEN, | ||
202 | BPF_S_LDX_B_MSH, | ||
203 | BPF_S_LDX_IMM, | ||
204 | BPF_S_MISC_TAX, | ||
205 | BPF_S_MISC_TXA, | ||
206 | BPF_S_ALU_DIV_K, | ||
207 | BPF_S_LD_MEM, | ||
208 | BPF_S_LDX_MEM, | ||
209 | BPF_S_ST, | ||
210 | BPF_S_STX, | ||
211 | BPF_S_JMP_JA, | ||
212 | BPF_S_JMP_JEQ_K, | ||
213 | BPF_S_JMP_JEQ_X, | ||
214 | BPF_S_JMP_JGE_K, | ||
215 | BPF_S_JMP_JGE_X, | ||
216 | BPF_S_JMP_JGT_K, | ||
217 | BPF_S_JMP_JGT_X, | ||
218 | BPF_S_JMP_JSET_K, | ||
219 | BPF_S_JMP_JSET_X, | ||
220 | /* Ancillary data */ | ||
221 | BPF_S_ANC_PROTOCOL, | ||
222 | BPF_S_ANC_PKTTYPE, | ||
223 | BPF_S_ANC_IFINDEX, | ||
224 | BPF_S_ANC_NLATTR, | ||
225 | BPF_S_ANC_NLATTR_NEST, | ||
226 | BPF_S_ANC_MARK, | ||
227 | BPF_S_ANC_QUEUE, | ||
228 | BPF_S_ANC_HATYPE, | ||
229 | BPF_S_ANC_RXHASH, | ||
230 | BPF_S_ANC_CPU, | ||
231 | }; | ||
232 | |||
156 | #endif /* __KERNEL__ */ | 233 | #endif /* __KERNEL__ */ |
157 | 234 | ||
158 | #endif /* __LINUX_FILTER_H__ */ | 235 | #endif /* __LINUX_FILTER_H__ */ |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index c64f3680d4f1..5e6f42789afe 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -125,7 +125,6 @@ struct fw_card { | |||
125 | struct delayed_work bm_work; /* bus manager job */ | 125 | struct delayed_work bm_work; /* bus manager job */ |
126 | int bm_retries; | 126 | int bm_retries; |
127 | int bm_generation; | 127 | int bm_generation; |
128 | __be32 bm_transaction_data[2]; | ||
129 | int bm_node_id; | 128 | int bm_node_id; |
130 | bool bm_abdicate; | 129 | bool bm_abdicate; |
131 | 130 | ||
@@ -441,12 +440,15 @@ int fw_iso_context_queue(struct fw_iso_context *ctx, | |||
441 | struct fw_iso_packet *packet, | 440 | struct fw_iso_packet *packet, |
442 | struct fw_iso_buffer *buffer, | 441 | struct fw_iso_buffer *buffer, |
443 | unsigned long payload); | 442 | unsigned long payload); |
443 | void fw_iso_context_queue_flush(struct fw_iso_context *ctx); | ||
444 | int fw_iso_context_start(struct fw_iso_context *ctx, | 444 | int fw_iso_context_start(struct fw_iso_context *ctx, |
445 | int cycle, int sync, int tags); | 445 | int cycle, int sync, int tags); |
446 | int fw_iso_context_stop(struct fw_iso_context *ctx); | 446 | int fw_iso_context_stop(struct fw_iso_context *ctx); |
447 | void fw_iso_context_destroy(struct fw_iso_context *ctx); | 447 | void fw_iso_context_destroy(struct fw_iso_context *ctx); |
448 | void fw_iso_resource_manage(struct fw_card *card, int generation, | 448 | void fw_iso_resource_manage(struct fw_card *card, int generation, |
449 | u64 channels_mask, int *channel, int *bandwidth, | 449 | u64 channels_mask, int *channel, int *bandwidth, |
450 | bool allocate, __be32 buffer[2]); | 450 | bool allocate); |
451 | |||
452 | extern struct workqueue_struct *fw_workqueue; | ||
451 | 453 | ||
452 | #endif /* _LINUX_FIREWIRE_H */ | 454 | #endif /* _LINUX_FIREWIRE_H */ |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index ebeb2f3ad068..6843cf193a44 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
@@ -21,6 +21,8 @@ struct flex_array { | |||
21 | struct { | 21 | struct { |
22 | int element_size; | 22 | int element_size; |
23 | int total_nr_elements; | 23 | int total_nr_elements; |
24 | int elems_per_part; | ||
25 | u32 reciprocal_elems; | ||
24 | struct flex_array_part *parts[]; | 26 | struct flex_array_part *parts[]; |
25 | }; | 27 | }; |
26 | /* | 28 | /* |
diff --git a/include/linux/fs.h b/include/linux/fs.h index cdf9495df204..1c777878f1ea 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -23,7 +23,8 @@ | |||
23 | 23 | ||
24 | /* Fixed constants first: */ | 24 | /* Fixed constants first: */ |
25 | #undef NR_OPEN | 25 | #undef NR_OPEN |
26 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ | 26 | #define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ |
27 | #define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */ | ||
27 | 28 | ||
28 | #define BLOCK_SIZE_BITS 10 | 29 | #define BLOCK_SIZE_BITS 10 |
29 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | 30 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) |
@@ -207,6 +208,7 @@ struct inodes_stat_t { | |||
207 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 208 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
208 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 209 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
209 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 210 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
211 | #define MS_NOSEC (1<<28) | ||
210 | #define MS_BORN (1<<29) | 212 | #define MS_BORN (1<<29) |
211 | #define MS_ACTIVE (1<<30) | 213 | #define MS_ACTIVE (1<<30) |
212 | #define MS_NOUSER (1<<31) | 214 | #define MS_NOUSER (1<<31) |
@@ -236,6 +238,7 @@ struct inodes_stat_t { | |||
236 | #define S_PRIVATE 512 /* Inode is fs-internal */ | 238 | #define S_PRIVATE 512 /* Inode is fs-internal */ |
237 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | 239 | #define S_IMA 1024 /* Inode has an associated IMA struct */ |
238 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | 240 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ |
241 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ | ||
239 | 242 | ||
240 | /* | 243 | /* |
241 | * Note that nosuid etc flags are inode-specific: setting some file-system | 244 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -272,6 +275,7 @@ struct inodes_stat_t { | |||
272 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | 275 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) |
273 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | 276 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) |
274 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | 277 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) |
278 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | ||
275 | 279 | ||
276 | /* the read-only stuff doesn't really belong here, but any other place is | 280 | /* the read-only stuff doesn't really belong here, but any other place is |
277 | probably as bad and I don't want to create yet another include file. */ | 281 | probably as bad and I don't want to create yet another include file. */ |
@@ -634,8 +638,7 @@ struct address_space { | |||
634 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ | 638 | unsigned int i_mmap_writable;/* count VM_SHARED mappings */ |
635 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ | 639 | struct prio_tree_root i_mmap; /* tree of private and shared mappings */ |
636 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ | 640 | struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ |
637 | spinlock_t i_mmap_lock; /* protect tree, count, list */ | 641 | struct mutex i_mmap_mutex; /* protect tree, count, list */ |
638 | unsigned int truncate_count; /* Cover race condition with truncate */ | ||
639 | unsigned long nrpages; /* number of total pages */ | 642 | unsigned long nrpages; /* number of total pages */ |
640 | pgoff_t writeback_index;/* writeback starts here */ | 643 | pgoff_t writeback_index;/* writeback starts here */ |
641 | const struct address_space_operations *a_ops; /* methods */ | 644 | const struct address_space_operations *a_ops; /* methods */ |
@@ -644,7 +647,6 @@ struct address_space { | |||
644 | spinlock_t private_lock; /* for use by the address_space */ | 647 | spinlock_t private_lock; /* for use by the address_space */ |
645 | struct list_head private_list; /* ditto */ | 648 | struct list_head private_list; /* ditto */ |
646 | struct address_space *assoc_mapping; /* ditto */ | 649 | struct address_space *assoc_mapping; /* ditto */ |
647 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
648 | } __attribute__((aligned(sizeof(long)))); | 650 | } __attribute__((aligned(sizeof(long)))); |
649 | /* | 651 | /* |
650 | * On most architectures that alignment is already the case; but | 652 | * On most architectures that alignment is already the case; but |
@@ -742,9 +744,13 @@ struct inode { | |||
742 | 744 | ||
743 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 745 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
744 | unsigned int i_flags; | 746 | unsigned int i_flags; |
747 | unsigned int i_state; | ||
748 | #ifdef CONFIG_SECURITY | ||
749 | void *i_security; | ||
750 | #endif | ||
745 | struct mutex i_mutex; | 751 | struct mutex i_mutex; |
746 | 752 | ||
747 | unsigned long i_state; | 753 | |
748 | unsigned long dirtied_when; /* jiffies of first dirtying */ | 754 | unsigned long dirtied_when; /* jiffies of first dirtying */ |
749 | 755 | ||
750 | struct hlist_node i_hash; | 756 | struct hlist_node i_hash; |
@@ -796,9 +802,6 @@ struct inode { | |||
796 | atomic_t i_readcount; /* struct files open RO */ | 802 | atomic_t i_readcount; /* struct files open RO */ |
797 | #endif | 803 | #endif |
798 | atomic_t i_writecount; | 804 | atomic_t i_writecount; |
799 | #ifdef CONFIG_SECURITY | ||
800 | void *i_security; | ||
801 | #endif | ||
802 | #ifdef CONFIG_FS_POSIX_ACL | 805 | #ifdef CONFIG_FS_POSIX_ACL |
803 | struct posix_acl *i_acl; | 806 | struct posix_acl *i_acl; |
804 | struct posix_acl *i_default_acl; | 807 | struct posix_acl *i_default_acl; |
@@ -1429,6 +1432,11 @@ struct super_block { | |||
1429 | */ | 1432 | */ |
1430 | char __rcu *s_options; | 1433 | char __rcu *s_options; |
1431 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ | 1434 | const struct dentry_operations *s_d_op; /* default d_op for dentries */ |
1435 | |||
1436 | /* | ||
1437 | * Saved pool identifier for cleancache (-1 means none) | ||
1438 | */ | ||
1439 | int cleancache_poolid; | ||
1432 | }; | 1440 | }; |
1433 | 1441 | ||
1434 | extern struct timespec current_fs_time(struct super_block *sb); | 1442 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1614,7 +1622,7 @@ struct super_operations { | |||
1614 | struct inode *(*alloc_inode)(struct super_block *sb); | 1622 | struct inode *(*alloc_inode)(struct super_block *sb); |
1615 | void (*destroy_inode)(struct inode *); | 1623 | void (*destroy_inode)(struct inode *); |
1616 | 1624 | ||
1617 | void (*dirty_inode) (struct inode *); | 1625 | void (*dirty_inode) (struct inode *, int flags); |
1618 | int (*write_inode) (struct inode *, struct writeback_control *wbc); | 1626 | int (*write_inode) (struct inode *, struct writeback_control *wbc); |
1619 | int (*drop_inode) (struct inode *); | 1627 | int (*drop_inode) (struct inode *); |
1620 | void (*evict_inode) (struct inode *); | 1628 | void (*evict_inode) (struct inode *); |
@@ -2578,5 +2586,16 @@ int __init get_filesystem_list(char *buf); | |||
2578 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ | 2586 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2579 | (flag & __FMODE_NONOTIFY))) | 2587 | (flag & __FMODE_NONOTIFY))) |
2580 | 2588 | ||
2589 | static inline int is_sxid(mode_t mode) | ||
2590 | { | ||
2591 | return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); | ||
2592 | } | ||
2593 | |||
2594 | static inline void inode_has_no_xattr(struct inode *inode) | ||
2595 | { | ||
2596 | if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC)) | ||
2597 | inode->i_flags |= S_NOSEC; | ||
2598 | } | ||
2599 | |||
2581 | #endif /* __KERNEL__ */ | 2600 | #endif /* __KERNEL__ */ |
2582 | #endif /* _LINUX_FS_H */ | 2601 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 76427e688d15..af095b54502e 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -100,17 +100,6 @@ struct fscache_operation { | |||
100 | 100 | ||
101 | /* operation releaser */ | 101 | /* operation releaser */ |
102 | fscache_operation_release_t release; | 102 | fscache_operation_release_t release; |
103 | |||
104 | #ifdef CONFIG_WORKQUEUE_DEBUGFS | ||
105 | struct work_struct put_work; /* work to delay operation put */ | ||
106 | const char *name; /* operation name */ | ||
107 | const char *state; /* operation state */ | ||
108 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | ||
109 | #define fscache_set_op_state(OP, S) do { (OP)->state = (S); } while(0) | ||
110 | #else | ||
111 | #define fscache_set_op_name(OP, N) do { } while(0) | ||
112 | #define fscache_set_op_state(OP, S) do { } while(0) | ||
113 | #endif | ||
114 | }; | 103 | }; |
115 | 104 | ||
116 | extern atomic_t fscache_op_debug_id; | 105 | extern atomic_t fscache_op_debug_id; |
@@ -137,7 +126,6 @@ static inline void fscache_operation_init(struct fscache_operation *op, | |||
137 | op->processor = processor; | 126 | op->processor = processor; |
138 | op->release = release; | 127 | op->release = release; |
139 | INIT_LIST_HEAD(&op->pend_link); | 128 | INIT_LIST_HEAD(&op->pend_link); |
140 | fscache_set_op_state(op, "Init"); | ||
141 | } | 129 | } |
142 | 130 | ||
143 | /* | 131 | /* |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 4eb56ed75fbc..fffdf00f87b9 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -72,6 +72,7 @@ struct fsl_usb2_platform_data { | |||
72 | void (*exit)(struct platform_device *); | 72 | void (*exit)(struct platform_device *); |
73 | void __iomem *regs; /* ioremap'd register base */ | 73 | void __iomem *regs; /* ioremap'd register base */ |
74 | struct clk *clk; | 74 | struct clk *clk; |
75 | unsigned power_budget; /* hcd->power_budget */ | ||
75 | unsigned big_endian_mmio:1; | 76 | unsigned big_endian_mmio:1; |
76 | unsigned big_endian_desc:1; | 77 | unsigned big_endian_desc:1; |
77 | unsigned es:1; /* need USBMODE:ES */ | 78 | unsigned es:1; /* need USBMODE:ES */ |
@@ -79,6 +80,21 @@ struct fsl_usb2_platform_data { | |||
79 | unsigned have_sysif_regs:1; | 80 | unsigned have_sysif_regs:1; |
80 | unsigned invert_drvvbus:1; | 81 | unsigned invert_drvvbus:1; |
81 | unsigned invert_pwr_fault:1; | 82 | unsigned invert_pwr_fault:1; |
83 | |||
84 | unsigned suspended:1; | ||
85 | unsigned already_suspended:1; | ||
86 | |||
87 | /* register save area for suspend/resume */ | ||
88 | u32 pm_command; | ||
89 | u32 pm_status; | ||
90 | u32 pm_intr_enable; | ||
91 | u32 pm_frame_index; | ||
92 | u32 pm_segment; | ||
93 | u32 pm_frame_list; | ||
94 | u32 pm_async_next; | ||
95 | u32 pm_configured_flag; | ||
96 | u32 pm_portsc; | ||
97 | u32 pm_usbgenctrl; | ||
82 | }; | 98 | }; |
83 | 99 | ||
84 | /* Flags in fsl_usb2_mph_platform_data */ | 100 | /* Flags in fsl_usb2_mph_platform_data */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index ca29e03c1fac..9d88e1cb5dbb 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -29,9 +29,22 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
29 | 29 | ||
30 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 30 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); |
31 | 31 | ||
32 | struct ftrace_hash; | ||
33 | |||
34 | enum { | ||
35 | FTRACE_OPS_FL_ENABLED = 1 << 0, | ||
36 | FTRACE_OPS_FL_GLOBAL = 1 << 1, | ||
37 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, | ||
38 | }; | ||
39 | |||
32 | struct ftrace_ops { | 40 | struct ftrace_ops { |
33 | ftrace_func_t func; | 41 | ftrace_func_t func; |
34 | struct ftrace_ops *next; | 42 | struct ftrace_ops *next; |
43 | unsigned long flags; | ||
44 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
45 | struct ftrace_hash *notrace_hash; | ||
46 | struct ftrace_hash *filter_hash; | ||
47 | #endif | ||
35 | }; | 48 | }; |
36 | 49 | ||
37 | extern int function_trace_stop; | 50 | extern int function_trace_stop; |
@@ -146,14 +159,13 @@ extern void unregister_ftrace_function_probe_all(char *glob); | |||
146 | extern int ftrace_text_reserved(void *start, void *end); | 159 | extern int ftrace_text_reserved(void *start, void *end); |
147 | 160 | ||
148 | enum { | 161 | enum { |
149 | FTRACE_FL_FREE = (1 << 0), | 162 | FTRACE_FL_ENABLED = (1 << 30), |
150 | FTRACE_FL_FAILED = (1 << 1), | 163 | FTRACE_FL_FREE = (1 << 31), |
151 | FTRACE_FL_FILTER = (1 << 2), | ||
152 | FTRACE_FL_ENABLED = (1 << 3), | ||
153 | FTRACE_FL_NOTRACE = (1 << 4), | ||
154 | FTRACE_FL_CONVERTED = (1 << 5), | ||
155 | }; | 164 | }; |
156 | 165 | ||
166 | #define FTRACE_FL_MASK (0x3UL << 30) | ||
167 | #define FTRACE_REF_MAX ((1 << 30) - 1) | ||
168 | |||
157 | struct dyn_ftrace { | 169 | struct dyn_ftrace { |
158 | union { | 170 | union { |
159 | unsigned long ip; /* address of mcount call-site */ | 171 | unsigned long ip; /* address of mcount call-site */ |
@@ -167,7 +179,12 @@ struct dyn_ftrace { | |||
167 | }; | 179 | }; |
168 | 180 | ||
169 | int ftrace_force_update(void); | 181 | int ftrace_force_update(void); |
170 | void ftrace_set_filter(unsigned char *buf, int len, int reset); | 182 | void ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, |
183 | int len, int reset); | ||
184 | void ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, | ||
185 | int len, int reset); | ||
186 | void ftrace_set_global_filter(unsigned char *buf, int len, int reset); | ||
187 | void ftrace_set_global_notrace(unsigned char *buf, int len, int reset); | ||
171 | 188 | ||
172 | int register_ftrace_command(struct ftrace_func_command *cmd); | 189 | int register_ftrace_command(struct ftrace_func_command *cmd); |
173 | int unregister_ftrace_command(struct ftrace_func_command *cmd); | 190 | int unregister_ftrace_command(struct ftrace_func_command *cmd); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index b5a550a39a70..59d3ef100eb9 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -16,6 +16,11 @@ struct trace_print_flags { | |||
16 | const char *name; | 16 | const char *name; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct trace_print_flags_u64 { | ||
20 | unsigned long long mask; | ||
21 | const char *name; | ||
22 | }; | ||
23 | |||
19 | const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | 24 | const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, |
20 | unsigned long flags, | 25 | unsigned long flags, |
21 | const struct trace_print_flags *flag_array); | 26 | const struct trace_print_flags *flag_array); |
@@ -23,6 +28,13 @@ const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | |||
23 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | 28 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, |
24 | const struct trace_print_flags *symbol_array); | 29 | const struct trace_print_flags *symbol_array); |
25 | 30 | ||
31 | #if BITS_PER_LONG == 32 | ||
32 | const char *ftrace_print_symbols_seq_u64(struct trace_seq *p, | ||
33 | unsigned long long val, | ||
34 | const struct trace_print_flags_u64 | ||
35 | *symbol_array); | ||
36 | #endif | ||
37 | |||
26 | const char *ftrace_print_hex_seq(struct trace_seq *p, | 38 | const char *ftrace_print_hex_seq(struct trace_seq *p, |
27 | const unsigned char *buf, int len); | 39 | const unsigned char *buf, int len); |
28 | 40 | ||
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 9869ef3674ac..5bbebda78b02 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -9,6 +9,8 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | 11 | ||
12 | #ifndef __GENALLOC_H__ | ||
13 | #define __GENALLOC_H__ | ||
12 | /* | 14 | /* |
13 | * General purpose special memory pool descriptor. | 15 | * General purpose special memory pool descriptor. |
14 | */ | 16 | */ |
@@ -24,13 +26,34 @@ struct gen_pool { | |||
24 | struct gen_pool_chunk { | 26 | struct gen_pool_chunk { |
25 | spinlock_t lock; | 27 | spinlock_t lock; |
26 | struct list_head next_chunk; /* next chunk in pool */ | 28 | struct list_head next_chunk; /* next chunk in pool */ |
29 | phys_addr_t phys_addr; /* physical starting address of memory chunk */ | ||
27 | unsigned long start_addr; /* starting address of memory chunk */ | 30 | unsigned long start_addr; /* starting address of memory chunk */ |
28 | unsigned long end_addr; /* ending address of memory chunk */ | 31 | unsigned long end_addr; /* ending address of memory chunk */ |
29 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ | 32 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ |
30 | }; | 33 | }; |
31 | 34 | ||
32 | extern struct gen_pool *gen_pool_create(int, int); | 35 | extern struct gen_pool *gen_pool_create(int, int); |
33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); | 36 | extern phys_addr_t gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long); |
37 | extern int gen_pool_add_virt(struct gen_pool *, unsigned long, phys_addr_t, | ||
38 | size_t, int); | ||
39 | /** | ||
40 | * gen_pool_add - add a new chunk of special memory to the pool | ||
41 | * @pool: pool to add new memory chunk to | ||
42 | * @addr: starting address of memory chunk to add to pool | ||
43 | * @size: size in bytes of the memory chunk to add to pool | ||
44 | * @nid: node id of the node the chunk structure and bitmap should be | ||
45 | * allocated on, or -1 | ||
46 | * | ||
47 | * Add a new chunk of special memory to the specified pool. | ||
48 | * | ||
49 | * Returns 0 on success or a -ve errno on failure. | ||
50 | */ | ||
51 | static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, | ||
52 | size_t size, int nid) | ||
53 | { | ||
54 | return gen_pool_add_virt(pool, addr, -1, size, nid); | ||
55 | } | ||
34 | extern void gen_pool_destroy(struct gen_pool *); | 56 | extern void gen_pool_destroy(struct gen_pool *); |
35 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 57 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
36 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 58 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
59 | #endif /* __GENALLOC_H__ */ | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index d764a426e9fd..300d7582006e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -127,6 +127,7 @@ struct hd_struct { | |||
127 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 127 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 128 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
129 | #define GENHD_FL_NATIVE_CAPACITY 128 | 129 | #define GENHD_FL_NATIVE_CAPACITY 128 |
130 | #define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 | ||
130 | 131 | ||
131 | enum { | 132 | enum { |
132 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ | 133 | DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 56d8fc87fbbc..cb4089254f01 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -249,14 +249,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
249 | 249 | ||
250 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | 250 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & |
251 | ((1 << ZONES_SHIFT) - 1); | 251 | ((1 << ZONES_SHIFT) - 1); |
252 | 252 | VM_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | |
253 | if (__builtin_constant_p(bit)) | ||
254 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
255 | else { | ||
256 | #ifdef CONFIG_DEBUG_VM | ||
257 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
258 | #endif | ||
259 | } | ||
260 | return z; | 253 | return z; |
261 | } | 254 | } |
262 | 255 | ||
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 32720baf70f1..32d47e710661 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -25,9 +25,9 @@ struct gpio_chip; | |||
25 | * warning when something is wrongly called. | 25 | * warning when something is wrongly called. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | static inline int gpio_is_valid(int number) | 28 | static inline bool gpio_is_valid(int number) |
29 | { | 29 | { |
30 | return 0; | 30 | return false; |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline int gpio_request(unsigned gpio, const char *label) | 33 | static inline int gpio_request(unsigned gpio, const char *label) |
@@ -41,7 +41,7 @@ static inline int gpio_request_one(unsigned gpio, | |||
41 | return -ENOSYS; | 41 | return -ENOSYS; |
42 | } | 42 | } |
43 | 43 | ||
44 | static inline int gpio_request_array(struct gpio *array, size_t num) | 44 | static inline int gpio_request_array(const struct gpio *array, size_t num) |
45 | { | 45 | { |
46 | return -ENOSYS; | 46 | return -ENOSYS; |
47 | } | 47 | } |
@@ -54,7 +54,7 @@ static inline void gpio_free(unsigned gpio) | |||
54 | WARN_ON(1); | 54 | WARN_ON(1); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void gpio_free_array(struct gpio *array, size_t num) | 57 | static inline void gpio_free_array(const struct gpio *array, size_t num) |
58 | { | 58 | { |
59 | might_sleep(); | 59 | might_sleep(); |
60 | 60 | ||
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index dd1a56fbe924..b5ca4b2c08ec 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
@@ -3,14 +3,15 @@ | |||
3 | 3 | ||
4 | struct gpio_keys_button { | 4 | struct gpio_keys_button { |
5 | /* Configuration parameters */ | 5 | /* Configuration parameters */ |
6 | int code; /* input event code (KEY_*, SW_*) */ | 6 | unsigned int code; /* input event code (KEY_*, SW_*) */ |
7 | int gpio; | 7 | int gpio; |
8 | int active_low; | 8 | int active_low; |
9 | char *desc; | 9 | const char *desc; |
10 | int type; /* input event type (EV_KEY, EV_SW) */ | 10 | unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */ |
11 | int wakeup; /* configure the button as a wake-up source */ | 11 | int wakeup; /* configure the button as a wake-up source */ |
12 | int debounce_interval; /* debounce ticks interval in msecs */ | 12 | int debounce_interval; /* debounce ticks interval in msecs */ |
13 | bool can_disable; | 13 | bool can_disable; |
14 | int value; /* axis value for EV_ABS */ | ||
14 | }; | 15 | }; |
15 | 16 | ||
16 | struct gpio_keys_platform_data { | 17 | struct gpio_keys_platform_data { |
@@ -21,6 +22,7 @@ struct gpio_keys_platform_data { | |||
21 | unsigned int rep:1; /* enable input subsystem auto repeat */ | 22 | unsigned int rep:1; /* enable input subsystem auto repeat */ |
22 | int (*enable)(struct device *dev); | 23 | int (*enable)(struct device *dev); |
23 | void (*disable)(struct device *dev); | 24 | void (*disable)(struct device *dev); |
25 | const char *name; /* input device name */ | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | #endif | 28 | #endif |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 62f500c724f9..51932e5acf7c 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -143,19 +143,18 @@ struct hrtimer_sleeper { | |||
143 | */ | 143 | */ |
144 | struct hrtimer_clock_base { | 144 | struct hrtimer_clock_base { |
145 | struct hrtimer_cpu_base *cpu_base; | 145 | struct hrtimer_cpu_base *cpu_base; |
146 | clockid_t index; | 146 | int index; |
147 | clockid_t clockid; | ||
147 | struct timerqueue_head active; | 148 | struct timerqueue_head active; |
148 | ktime_t resolution; | 149 | ktime_t resolution; |
149 | ktime_t (*get_time)(void); | 150 | ktime_t (*get_time)(void); |
150 | ktime_t softirq_time; | 151 | ktime_t softirq_time; |
151 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
152 | ktime_t offset; | 152 | ktime_t offset; |
153 | #endif | ||
154 | }; | 153 | }; |
155 | 154 | ||
156 | enum hrtimer_base_type { | 155 | enum hrtimer_base_type { |
157 | HRTIMER_BASE_REALTIME, | ||
158 | HRTIMER_BASE_MONOTONIC, | 156 | HRTIMER_BASE_MONOTONIC, |
157 | HRTIMER_BASE_REALTIME, | ||
159 | HRTIMER_BASE_BOOTTIME, | 158 | HRTIMER_BASE_BOOTTIME, |
160 | HRTIMER_MAX_CLOCK_BASES, | 159 | HRTIMER_MAX_CLOCK_BASES, |
161 | }; | 160 | }; |
@@ -164,7 +163,7 @@ enum hrtimer_base_type { | |||
164 | * struct hrtimer_cpu_base - the per cpu clock bases | 163 | * struct hrtimer_cpu_base - the per cpu clock bases |
165 | * @lock: lock protecting the base and associated clock bases | 164 | * @lock: lock protecting the base and associated clock bases |
166 | * and timers | 165 | * and timers |
167 | * @clock_base: array of clock bases for this cpu | 166 | * @active_bases: Bitfield to mark bases with active timers |
168 | * @expires_next: absolute time of the next event which was scheduled | 167 | * @expires_next: absolute time of the next event which was scheduled |
169 | * via clock_set_next_event() | 168 | * via clock_set_next_event() |
170 | * @hres_active: State of high resolution mode | 169 | * @hres_active: State of high resolution mode |
@@ -173,10 +172,11 @@ enum hrtimer_base_type { | |||
173 | * @nr_retries: Total number of hrtimer interrupt retries | 172 | * @nr_retries: Total number of hrtimer interrupt retries |
174 | * @nr_hangs: Total number of hrtimer interrupt hangs | 173 | * @nr_hangs: Total number of hrtimer interrupt hangs |
175 | * @max_hang_time: Maximum time spent in hrtimer_interrupt | 174 | * @max_hang_time: Maximum time spent in hrtimer_interrupt |
175 | * @clock_base: array of clock bases for this cpu | ||
176 | */ | 176 | */ |
177 | struct hrtimer_cpu_base { | 177 | struct hrtimer_cpu_base { |
178 | raw_spinlock_t lock; | 178 | raw_spinlock_t lock; |
179 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | 179 | unsigned long active_bases; |
180 | #ifdef CONFIG_HIGH_RES_TIMERS | 180 | #ifdef CONFIG_HIGH_RES_TIMERS |
181 | ktime_t expires_next; | 181 | ktime_t expires_next; |
182 | int hres_active; | 182 | int hres_active; |
@@ -186,6 +186,7 @@ struct hrtimer_cpu_base { | |||
186 | unsigned long nr_hangs; | 186 | unsigned long nr_hangs; |
187 | ktime_t max_hang_time; | 187 | ktime_t max_hang_time; |
188 | #endif | 188 | #endif |
189 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | ||
189 | }; | 190 | }; |
190 | 191 | ||
191 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 192 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
@@ -256,8 +257,6 @@ static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) | |||
256 | #ifdef CONFIG_HIGH_RES_TIMERS | 257 | #ifdef CONFIG_HIGH_RES_TIMERS |
257 | struct clock_event_device; | 258 | struct clock_event_device; |
258 | 259 | ||
259 | extern void clock_was_set(void); | ||
260 | extern void hres_timers_resume(void); | ||
261 | extern void hrtimer_interrupt(struct clock_event_device *dev); | 260 | extern void hrtimer_interrupt(struct clock_event_device *dev); |
262 | 261 | ||
263 | /* | 262 | /* |
@@ -291,16 +290,8 @@ extern void hrtimer_peek_ahead_timers(void); | |||
291 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC | 290 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC |
292 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES | 291 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES |
293 | 292 | ||
294 | /* | ||
295 | * clock_was_set() is a NOP for non- high-resolution systems. The | ||
296 | * time-sorted order guarantees that a timer does not expire early and | ||
297 | * is expired in the next softirq when the clock was advanced. | ||
298 | */ | ||
299 | static inline void clock_was_set(void) { } | ||
300 | static inline void hrtimer_peek_ahead_timers(void) { } | 293 | static inline void hrtimer_peek_ahead_timers(void) { } |
301 | 294 | ||
302 | static inline void hres_timers_resume(void) { } | ||
303 | |||
304 | /* | 295 | /* |
305 | * In non high resolution mode the time reference is taken from | 296 | * In non high resolution mode the time reference is taken from |
306 | * the base softirq time variable. | 297 | * the base softirq time variable. |
@@ -316,10 +307,18 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | |||
316 | } | 307 | } |
317 | #endif | 308 | #endif |
318 | 309 | ||
310 | extern void clock_was_set(void); | ||
311 | #ifdef CONFIG_TIMERFD | ||
312 | extern void timerfd_clock_was_set(void); | ||
313 | #else | ||
314 | static inline void timerfd_clock_was_set(void) { } | ||
315 | #endif | ||
316 | extern void hrtimers_resume(void); | ||
317 | |||
319 | extern ktime_t ktime_get(void); | 318 | extern ktime_t ktime_get(void); |
320 | extern ktime_t ktime_get_real(void); | 319 | extern ktime_t ktime_get_real(void); |
321 | extern ktime_t ktime_get_boottime(void); | 320 | extern ktime_t ktime_get_boottime(void); |
322 | 321 | extern ktime_t ktime_get_monotonic_offset(void); | |
323 | 322 | ||
324 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | 323 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); |
325 | 324 | ||
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 8847c8c29791..48c32ebf65a7 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -92,12 +92,8 @@ extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); | |||
92 | #define wait_split_huge_page(__anon_vma, __pmd) \ | 92 | #define wait_split_huge_page(__anon_vma, __pmd) \ |
93 | do { \ | 93 | do { \ |
94 | pmd_t *____pmd = (__pmd); \ | 94 | pmd_t *____pmd = (__pmd); \ |
95 | spin_unlock_wait(&(__anon_vma)->root->lock); \ | 95 | anon_vma_lock(__anon_vma); \ |
96 | /* \ | 96 | anon_vma_unlock(__anon_vma); \ |
97 | * spin_unlock_wait() is just a loop in C and so the \ | ||
98 | * CPU can reorder anything around it. \ | ||
99 | */ \ | ||
100 | smp_mb(); \ | ||
101 | BUG_ON(pmd_trans_splitting(*____pmd) || \ | 97 | BUG_ON(pmd_trans_splitting(*____pmd) || \ |
102 | pmd_trans_huge(*____pmd)); \ | 98 | pmd_trans_huge(*____pmd)); \ |
103 | } while (0) | 99 | } while (0) |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 943c76b3d4bb..59225ef27d15 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_HUGETLB_H | 1 | #ifndef _LINUX_HUGETLB_H |
2 | #define _LINUX_HUGETLB_H | 2 | #define _LINUX_HUGETLB_H |
3 | 3 | ||
4 | #include <linux/mm_types.h> | ||
4 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
5 | #include <linux/hugetlb_inline.h> | 6 | #include <linux/hugetlb_inline.h> |
6 | 7 | ||
@@ -41,7 +42,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
41 | unsigned long address, unsigned int flags); | 42 | unsigned long address, unsigned int flags); |
42 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, | 43 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
43 | struct vm_area_struct *vma, | 44 | struct vm_area_struct *vma, |
44 | int acctflags); | 45 | vm_flags_t vm_flags); |
45 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 46 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
46 | int dequeue_hwpoisoned_huge_page(struct page *page); | 47 | int dequeue_hwpoisoned_huge_page(struct page *page); |
47 | void copy_huge_page(struct page *dst, struct page *src); | 48 | void copy_huge_page(struct page *dst, struct page *src); |
@@ -168,7 +169,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
168 | 169 | ||
169 | extern const struct file_operations hugetlbfs_file_operations; | 170 | extern const struct file_operations hugetlbfs_file_operations; |
170 | extern const struct vm_operations_struct hugetlb_vm_ops; | 171 | extern const struct vm_operations_struct hugetlb_vm_ops; |
171 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, | 172 | struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, |
172 | struct user_struct **user, int creat_flags); | 173 | struct user_struct **user, int creat_flags); |
173 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 174 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
174 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 175 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
@@ -192,7 +193,7 @@ static inline void set_file_hugepages(struct file *file) | |||
192 | #define is_file_hugepages(file) 0 | 193 | #define is_file_hugepages(file) 0 |
193 | #define set_file_hugepages(file) BUG() | 194 | #define set_file_hugepages(file) BUG() |
194 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, | 195 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, |
195 | int acctflag, struct user_struct **user, int creat_flags) | 196 | vm_flags_t acctflag, struct user_struct **user, int creat_flags) |
196 | { | 197 | { |
197 | return ERR_PTR(-ENOSYS); | 198 | return ERR_PTR(-ENOSYS); |
198 | } | 199 | } |
diff --git a/include/linux/hugetlb_inline.h b/include/linux/hugetlb_inline.h index 6931489a5c14..2bb681fbeb35 100644 --- a/include/linux/hugetlb_inline.h +++ b/include/linux/hugetlb_inline.h | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 8 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
9 | { | 9 | { |
10 | return vma->vm_flags & VM_HUGETLB; | 10 | return !!(vma->vm_flags & VM_HUGETLB); |
11 | } | 11 | } |
12 | 12 | ||
13 | #else | 13 | #else |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f1e3ff5880a9..a6c652ef516d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -409,7 +409,7 @@ void i2c_unlock_adapter(struct i2c_adapter *); | |||
409 | /* i2c adapter classes (bitmask) */ | 409 | /* i2c adapter classes (bitmask) */ |
410 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 410 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ |
411 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 411 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
412 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 412 | #define I2C_CLASS_SPD (1<<7) /* Memory modules */ |
413 | 413 | ||
414 | /* Internal numbers to terminate lists */ | 414 | /* Internal numbers to terminate lists */ |
415 | #define I2C_CLIENT_END 0xfffeU | 415 | #define I2C_CLIENT_END 0xfffeU |
diff --git a/include/linux/i2c/i2c-sh_mobile.h b/include/linux/i2c/i2c-sh_mobile.h new file mode 100644 index 000000000000..beda7081aead --- /dev/null +++ b/include/linux/i2c/i2c-sh_mobile.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __I2C_SH_MOBILE_H__ | ||
2 | #define __I2C_SH_MOBILE_H__ | ||
3 | |||
4 | #include <linux/platform_device.h> | ||
5 | |||
6 | struct i2c_sh_mobile_platform_data { | ||
7 | unsigned long bus_speed; | ||
8 | }; | ||
9 | |||
10 | #endif /* __I2C_SH_MOBILE_H__ */ | ||
diff --git a/include/linux/i2c/mpr121_touchkey.h b/include/linux/i2c/mpr121_touchkey.h new file mode 100644 index 000000000000..f0bcc38bbb97 --- /dev/null +++ b/include/linux/i2c/mpr121_touchkey.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* Header file for Freescale MPR121 Capacitive Touch Sensor */ | ||
2 | |||
3 | #ifndef _MPR121_TOUCHKEY_H | ||
4 | #define _MPR121_TOUCHKEY_H | ||
5 | |||
6 | /** | ||
7 | * struct mpr121_platform_data - platform data for mpr121 sensor | ||
8 | * @keymap: pointer to array of KEY_* values representing keymap | ||
9 | * @keymap_size: size of the keymap | ||
10 | * @wakeup: configure the button as a wake-up source | ||
11 | * @vdd_uv: VDD voltage in uV | ||
12 | */ | ||
13 | struct mpr121_platform_data { | ||
14 | const unsigned short *keymap; | ||
15 | unsigned int keymap_size; | ||
16 | bool wakeup; | ||
17 | int vdd_uv; | ||
18 | }; | ||
19 | |||
20 | #endif /* _MPR121_TOUCHKEY_H */ | ||
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h index c6361fbb7bf9..591427a63b06 100644 --- a/include/linux/i2c/tsc2007.h +++ b/include/linux/i2c/tsc2007.h | |||
@@ -6,6 +6,13 @@ | |||
6 | struct tsc2007_platform_data { | 6 | struct tsc2007_platform_data { |
7 | u16 model; /* 2007. */ | 7 | u16 model; /* 2007. */ |
8 | u16 x_plate_ohms; | 8 | u16 x_plate_ohms; |
9 | u16 max_rt; /* max. resistance above which samples are ignored */ | ||
10 | unsigned long poll_delay; /* delay (in ms) after pen-down event | ||
11 | before polling starts */ | ||
12 | unsigned long poll_period; /* time (in ms) between samples */ | ||
13 | int fuzzx; /* fuzz factor for X, Y and pressure axes */ | ||
14 | int fuzzy; | ||
15 | int fuzzz; | ||
9 | 16 | ||
10 | int (*get_pendown_state)(void); | 17 | int (*get_pendown_state)(void); |
11 | void (*clear_penirq)(void); /* If needed, clear 2nd level | 18 | void (*clear_penirq)(void); /* If needed, clear 2nd level |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 0c0d1ae79981..ba4f88624fcd 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -91,6 +91,7 @@ | |||
91 | #define BCI_INTR_OFFSET 2 | 91 | #define BCI_INTR_OFFSET 2 |
92 | #define MADC_INTR_OFFSET 3 | 92 | #define MADC_INTR_OFFSET 3 |
93 | #define USB_INTR_OFFSET 4 | 93 | #define USB_INTR_OFFSET 4 |
94 | #define CHARGERFAULT_INTR_OFFSET 5 | ||
94 | #define BCI_PRES_INTR_OFFSET 9 | 95 | #define BCI_PRES_INTR_OFFSET 9 |
95 | #define USB_PRES_INTR_OFFSET 10 | 96 | #define USB_PRES_INTR_OFFSET 10 |
96 | #define RTC_INTR_OFFSET 11 | 97 | #define RTC_INTR_OFFSET 11 |
@@ -150,7 +151,12 @@ | |||
150 | #define MMC_PU (0x1 << 3) | 151 | #define MMC_PU (0x1 << 3) |
151 | #define MMC_PD (0x1 << 2) | 152 | #define MMC_PD (0x1 << 2) |
152 | 153 | ||
153 | 154 | #define TWL_SIL_TYPE(rev) ((rev) & 0x00FFFFFF) | |
155 | #define TWL_SIL_REV(rev) ((rev) >> 24) | ||
156 | #define TWL_SIL_5030 0x09002F | ||
157 | #define TWL5030_REV_1_0 0x00 | ||
158 | #define TWL5030_REV_1_1 0x10 | ||
159 | #define TWL5030_REV_1_2 0x30 | ||
154 | 160 | ||
155 | #define TWL4030_CLASS_ID 0x4030 | 161 | #define TWL4030_CLASS_ID 0x4030 |
156 | #define TWL6030_CLASS_ID 0x6030 | 162 | #define TWL6030_CLASS_ID 0x6030 |
@@ -165,6 +171,8 @@ static inline int twl_class_is_ ##class(void) \ | |||
165 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | 171 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) |
166 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 172 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
167 | 173 | ||
174 | #define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ | ||
175 | |||
168 | /* | 176 | /* |
169 | * Read and write single 8-bit registers | 177 | * Read and write single 8-bit registers |
170 | */ | 178 | */ |
@@ -180,6 +188,9 @@ int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
180 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 188 | int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
181 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | 189 | int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
182 | 190 | ||
191 | int twl_get_type(void); | ||
192 | int twl_get_version(void); | ||
193 | |||
183 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | 194 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); |
184 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | 195 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); |
185 | 196 | ||
@@ -279,7 +290,12 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
279 | *(Use TWL_4030_MODULE_INTBR) | 290 | *(Use TWL_4030_MODULE_INTBR) |
280 | */ | 291 | */ |
281 | 292 | ||
293 | #define REG_IDCODE_7_0 0x00 | ||
294 | #define REG_IDCODE_15_8 0x01 | ||
295 | #define REG_IDCODE_16_23 0x02 | ||
296 | #define REG_IDCODE_31_24 0x03 | ||
282 | #define REG_GPPUPDCTR1 0x0F | 297 | #define REG_GPPUPDCTR1 0x0F |
298 | #define REG_UNLOCK_TEST_REG 0x12 | ||
283 | 299 | ||
284 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ | 300 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ |
285 | 301 | ||
@@ -288,6 +304,8 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
288 | #define SR_I2C_SCL_CTRL_PU BIT(4) | 304 | #define SR_I2C_SCL_CTRL_PU BIT(4) |
289 | #define SR_I2C_SDA_CTRL_PU BIT(6) | 305 | #define SR_I2C_SDA_CTRL_PU BIT(6) |
290 | 306 | ||
307 | #define TWL_EEPROM_R_UNLOCK 0x49 | ||
308 | |||
291 | /*----------------------------------------------------------------------*/ | 309 | /*----------------------------------------------------------------------*/ |
292 | 310 | ||
293 | /* | 311 | /* |
@@ -501,7 +519,7 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
501 | #define RES_32KCLKOUT 26 | 519 | #define RES_32KCLKOUT 26 |
502 | #define RES_RESET 27 | 520 | #define RES_RESET 27 |
503 | /* Power Reference */ | 521 | /* Power Reference */ |
504 | #define RES_Main_Ref 28 | 522 | #define RES_MAIN_REF 28 |
505 | 523 | ||
506 | #define TOTAL_RESOURCES 28 | 524 | #define TOTAL_RESOURCES 28 |
507 | /* | 525 | /* |
@@ -593,6 +611,7 @@ enum twl4030_usb_mode { | |||
593 | 611 | ||
594 | struct twl4030_usb_data { | 612 | struct twl4030_usb_data { |
595 | enum twl4030_usb_mode usb_mode; | 613 | enum twl4030_usb_mode usb_mode; |
614 | unsigned long features; | ||
596 | 615 | ||
597 | int (*phy_init)(struct device *dev); | 616 | int (*phy_init)(struct device *dev); |
598 | int (*phy_exit)(struct device *dev); | 617 | int (*phy_exit)(struct device *dev); |
@@ -699,6 +718,20 @@ struct twl4030_platform_data { | |||
699 | struct regulator_init_data *vcxio; | 718 | struct regulator_init_data *vcxio; |
700 | struct regulator_init_data *vusb; | 719 | struct regulator_init_data *vusb; |
701 | struct regulator_init_data *clk32kg; | 720 | struct regulator_init_data *clk32kg; |
721 | /* TWL6025 LDO regulators */ | ||
722 | struct regulator_init_data *ldo1; | ||
723 | struct regulator_init_data *ldo2; | ||
724 | struct regulator_init_data *ldo3; | ||
725 | struct regulator_init_data *ldo4; | ||
726 | struct regulator_init_data *ldo5; | ||
727 | struct regulator_init_data *ldo6; | ||
728 | struct regulator_init_data *ldo7; | ||
729 | struct regulator_init_data *ldoln; | ||
730 | struct regulator_init_data *ldousb; | ||
731 | /* TWL6025 DCDC regulators */ | ||
732 | struct regulator_init_data *smps3; | ||
733 | struct regulator_init_data *smps4; | ||
734 | struct regulator_init_data *vio6025; | ||
702 | }; | 735 | }; |
703 | 736 | ||
704 | /*----------------------------------------------------------------------*/ | 737 | /*----------------------------------------------------------------------*/ |
@@ -780,4 +813,21 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
780 | #define TWL6030_REG_VRTC 47 | 813 | #define TWL6030_REG_VRTC 47 |
781 | #define TWL6030_REG_CLK32KG 48 | 814 | #define TWL6030_REG_CLK32KG 48 |
782 | 815 | ||
816 | /* LDOs on 6025 have different names */ | ||
817 | #define TWL6025_REG_LDO2 49 | ||
818 | #define TWL6025_REG_LDO4 50 | ||
819 | #define TWL6025_REG_LDO3 51 | ||
820 | #define TWL6025_REG_LDO5 52 | ||
821 | #define TWL6025_REG_LDO1 53 | ||
822 | #define TWL6025_REG_LDO7 54 | ||
823 | #define TWL6025_REG_LDO6 55 | ||
824 | #define TWL6025_REG_LDOLN 56 | ||
825 | #define TWL6025_REG_LDOUSB 57 | ||
826 | |||
827 | /* 6025 DCDC supplies */ | ||
828 | #define TWL6025_REG_SMPS3 58 | ||
829 | #define TWL6025_REG_SMPS4 59 | ||
830 | #define TWL6025_REG_VIO 60 | ||
831 | |||
832 | |||
783 | #endif /* End of __TWL4030_H */ | 833 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 072fe8c93e6f..42557851b12e 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -18,13 +18,13 @@ | |||
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/completion.h> | 19 | #include <linux/completion.h> |
20 | #include <linux/pm.h> | 20 | #include <linux/pm.h> |
21 | #include <linux/mutex.h> | ||
21 | #ifdef CONFIG_BLK_DEV_IDEACPI | 22 | #ifdef CONFIG_BLK_DEV_IDEACPI |
22 | #include <acpi/acpi.h> | 23 | #include <acpi/acpi.h> |
23 | #endif | 24 | #endif |
24 | #include <asm/byteorder.h> | 25 | #include <asm/byteorder.h> |
25 | #include <asm/system.h> | 26 | #include <asm/system.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/mutex.h> | ||
28 | 28 | ||
29 | /* for request_sense */ | 29 | /* for request_sense */ |
30 | #include <linux/cdrom.h> | 30 | #include <linux/cdrom.h> |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2d1c6117d92c..bf56b6f78270 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -884,6 +884,15 @@ struct ieee80211_ht_cap { | |||
884 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | 884 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 |
885 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | 885 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 |
886 | 886 | ||
887 | /* 802.11n HT extended capabilities masks (for extended_ht_cap_info) */ | ||
888 | #define IEEE80211_HT_EXT_CAP_PCO 0x0001 | ||
889 | #define IEEE80211_HT_EXT_CAP_PCO_TIME 0x0006 | ||
890 | #define IEEE80211_HT_EXT_CAP_PCO_TIME_SHIFT 1 | ||
891 | #define IEEE80211_HT_EXT_CAP_MCS_FB 0x0300 | ||
892 | #define IEEE80211_HT_EXT_CAP_MCS_FB_SHIFT 8 | ||
893 | #define IEEE80211_HT_EXT_CAP_HTC_SUP 0x0400 | ||
894 | #define IEEE80211_HT_EXT_CAP_RD_RESPONDER 0x0800 | ||
895 | |||
887 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ | 896 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ |
888 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | 897 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 |
889 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | 898 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C |
@@ -993,6 +1002,15 @@ struct ieee80211_ht_info { | |||
993 | 1002 | ||
994 | #define WLAN_CAPABILITY_ESS (1<<0) | 1003 | #define WLAN_CAPABILITY_ESS (1<<0) |
995 | #define WLAN_CAPABILITY_IBSS (1<<1) | 1004 | #define WLAN_CAPABILITY_IBSS (1<<1) |
1005 | |||
1006 | /* | ||
1007 | * A mesh STA sets the ESS and IBSS capability bits to zero. | ||
1008 | * however, this holds true for p2p probe responses (in the p2p_find | ||
1009 | * phase) as well. | ||
1010 | */ | ||
1011 | #define WLAN_CAPABILITY_IS_STA_BSS(cap) \ | ||
1012 | (!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS))) | ||
1013 | |||
996 | #define WLAN_CAPABILITY_CF_POLLABLE (1<<2) | 1014 | #define WLAN_CAPABILITY_CF_POLLABLE (1<<2) |
997 | #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) | 1015 | #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) |
998 | #define WLAN_CAPABILITY_PRIVACY (1<<4) | 1016 | #define WLAN_CAPABILITY_PRIVACY (1<<4) |
@@ -1252,9 +1270,8 @@ enum ieee80211_category { | |||
1252 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, | 1270 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, |
1253 | WLAN_CATEGORY_SELF_PROTECTED = 15, | 1271 | WLAN_CATEGORY_SELF_PROTECTED = 15, |
1254 | WLAN_CATEGORY_WMM = 17, | 1272 | WLAN_CATEGORY_WMM = 17, |
1255 | /* TODO: remove MESH_PLINK and MESH_PATH_SEL after */ | 1273 | /* TODO: remove MESH_PATH_SEL after mesh is updated |
1256 | /* mesh is updated to current 802.11s draft */ | 1274 | * to current 802.11s draft */ |
1257 | WLAN_CATEGORY_MESH_PLINK = 30, | ||
1258 | WLAN_CATEGORY_MESH_PATH_SEL = 32, | 1275 | WLAN_CATEGORY_MESH_PATH_SEL = 32, |
1259 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1276 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
1260 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1277 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
@@ -1507,6 +1524,7 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) | |||
1507 | category = ((u8 *) hdr) + 24; | 1524 | category = ((u8 *) hdr) + 24; |
1508 | return *category != WLAN_CATEGORY_PUBLIC && | 1525 | return *category != WLAN_CATEGORY_PUBLIC && |
1509 | *category != WLAN_CATEGORY_HT && | 1526 | *category != WLAN_CATEGORY_HT && |
1527 | *category != WLAN_CATEGORY_SELF_PROTECTED && | ||
1510 | *category != WLAN_CATEGORY_VENDOR_SPECIFIC; | 1528 | *category != WLAN_CATEGORY_VENDOR_SPECIFIC; |
1511 | } | 1529 | } |
1512 | 1530 | ||
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index be69043d2896..0065ffd3226b 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -132,10 +132,7 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
132 | 132 | ||
133 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 133 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
134 | 134 | ||
135 | #ifdef CONFIG_SYSCTL | 135 | int mac_pton(const char *s, u8 *mac); |
136 | extern struct ctl_table ether_table[]; | ||
137 | #endif | ||
138 | |||
139 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 136 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
140 | 137 | ||
141 | #endif | 138 | #endif |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index f4a2e6b1b864..0ee969a5593d 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -136,6 +136,7 @@ enum { | |||
136 | IFLA_PORT_SELF, | 136 | IFLA_PORT_SELF, |
137 | IFLA_AF_SPEC, | 137 | IFLA_AF_SPEC, |
138 | IFLA_GROUP, /* Group the device belongs to */ | 138 | IFLA_GROUP, /* Group the device belongs to */ |
139 | IFLA_NET_NS_FD, | ||
139 | __IFLA_MAX | 140 | __IFLA_MAX |
140 | }; | 141 | }; |
141 | 142 | ||
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 72bfa5a034dd..7b318630139f 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -62,6 +62,7 @@ struct tpacket_auxdata { | |||
62 | __u16 tp_mac; | 62 | __u16 tp_mac; |
63 | __u16 tp_net; | 63 | __u16 tp_net; |
64 | __u16 tp_vlan_tci; | 64 | __u16 tp_vlan_tci; |
65 | __u16 tp_padding; | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | /* Rx ring - header status */ | 68 | /* Rx ring - header status */ |
@@ -70,6 +71,7 @@ struct tpacket_auxdata { | |||
70 | #define TP_STATUS_COPY 0x2 | 71 | #define TP_STATUS_COPY 0x2 |
71 | #define TP_STATUS_LOSING 0x4 | 72 | #define TP_STATUS_LOSING 0x4 |
72 | #define TP_STATUS_CSUMNOTREADY 0x8 | 73 | #define TP_STATUS_CSUMNOTREADY 0x8 |
74 | #define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ | ||
73 | 75 | ||
74 | /* Tx ring - header status */ | 76 | /* Tx ring - header status */ |
75 | #define TP_STATUS_AVAILABLE 0x0 | 77 | #define TP_STATUS_AVAILABLE 0x0 |
@@ -100,6 +102,7 @@ struct tpacket2_hdr { | |||
100 | __u32 tp_sec; | 102 | __u32 tp_sec; |
101 | __u32 tp_nsec; | 103 | __u32 tp_nsec; |
102 | __u16 tp_vlan_tci; | 104 | __u16 tp_vlan_tci; |
105 | __u16 tp_padding; | ||
103 | }; | 106 | }; |
104 | 107 | ||
105 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) | 108 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 635e1faec412..affa27380b72 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -86,7 +86,6 @@ struct vlan_group { | |||
86 | * the vlan is attached to. | 86 | * the vlan is attached to. |
87 | */ | 87 | */ |
88 | unsigned int nr_vlans; | 88 | unsigned int nr_vlans; |
89 | int killall; | ||
90 | struct hlist_node hlist; /* linked list */ | 89 | struct hlist_node hlist; /* linked list */ |
91 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 90 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
92 | struct rcu_head rcu; | 91 | struct rcu_head rcu; |
@@ -111,6 +110,11 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
111 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
112 | } | 111 | } |
113 | 112 | ||
113 | static inline int is_vlan_dev(struct net_device *dev) | ||
114 | { | ||
115 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
116 | } | ||
117 | |||
114 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) | 118 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
115 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 119 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
116 | 120 | ||
@@ -132,7 +136,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev); | |||
132 | 136 | ||
133 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 137 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
134 | u16 vlan_tci, int polling); | 138 | u16 vlan_tci, int polling); |
135 | extern bool vlan_hwaccel_do_receive(struct sk_buff **skb); | 139 | extern bool vlan_do_receive(struct sk_buff **skb); |
140 | extern struct sk_buff *vlan_untag(struct sk_buff *skb); | ||
136 | extern gro_result_t | 141 | extern gro_result_t |
137 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 142 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
138 | unsigned int vlan_tci, struct sk_buff *skb); | 143 | unsigned int vlan_tci, struct sk_buff *skb); |
@@ -166,13 +171,18 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
166 | return NET_XMIT_SUCCESS; | 171 | return NET_XMIT_SUCCESS; |
167 | } | 172 | } |
168 | 173 | ||
169 | static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb) | 174 | static inline bool vlan_do_receive(struct sk_buff **skb) |
170 | { | 175 | { |
171 | if ((*skb)->vlan_tci & VLAN_VID_MASK) | 176 | if ((*skb)->vlan_tci & VLAN_VID_MASK) |
172 | (*skb)->pkt_type = PACKET_OTHERHOST; | 177 | (*skb)->pkt_type = PACKET_OTHERHOST; |
173 | return false; | 178 | return false; |
174 | } | 179 | } |
175 | 180 | ||
181 | static inline struct sk_buff *vlan_untag(struct sk_buff *skb) | ||
182 | { | ||
183 | return skb; | ||
184 | } | ||
185 | |||
176 | static inline gro_result_t | 186 | static inline gro_result_t |
177 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 187 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
178 | unsigned int vlan_tci, struct sk_buff *skb) | 188 | unsigned int vlan_tci, struct sk_buff *skb) |
@@ -215,7 +225,7 @@ static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, | |||
215 | } | 225 | } |
216 | 226 | ||
217 | /** | 227 | /** |
218 | * __vlan_put_tag - regular VLAN tag inserting | 228 | * vlan_insert_tag - regular VLAN tag inserting |
219 | * @skb: skbuff to tag | 229 | * @skb: skbuff to tag |
220 | * @vlan_tci: VLAN TCI to insert | 230 | * @vlan_tci: VLAN TCI to insert |
221 | * | 231 | * |
@@ -224,8 +234,10 @@ static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, | |||
224 | * | 234 | * |
225 | * Following the skb_unshare() example, in case of error, the calling function | 235 | * Following the skb_unshare() example, in case of error, the calling function |
226 | * doesn't have to worry about freeing the original skb. | 236 | * doesn't have to worry about freeing the original skb. |
237 | * | ||
238 | * Does not change skb->protocol so this function can be used during receive. | ||
227 | */ | 239 | */ |
228 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | 240 | static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) |
229 | { | 241 | { |
230 | struct vlan_ethhdr *veth; | 242 | struct vlan_ethhdr *veth; |
231 | 243 | ||
@@ -245,8 +257,25 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | |||
245 | /* now, the TCI */ | 257 | /* now, the TCI */ |
246 | veth->h_vlan_TCI = htons(vlan_tci); | 258 | veth->h_vlan_TCI = htons(vlan_tci); |
247 | 259 | ||
248 | skb->protocol = htons(ETH_P_8021Q); | 260 | return skb; |
261 | } | ||
249 | 262 | ||
263 | /** | ||
264 | * __vlan_put_tag - regular VLAN tag inserting | ||
265 | * @skb: skbuff to tag | ||
266 | * @vlan_tci: VLAN TCI to insert | ||
267 | * | ||
268 | * Inserts the VLAN tag into @skb as part of the payload | ||
269 | * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. | ||
270 | * | ||
271 | * Following the skb_unshare() example, in case of error, the calling function | ||
272 | * doesn't have to worry about freeing the original skb. | ||
273 | */ | ||
274 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | ||
275 | { | ||
276 | skb = vlan_insert_tag(skb, vlan_tci); | ||
277 | if (skb) | ||
278 | skb->protocol = htons(ETH_P_8021Q); | ||
250 | return skb; | 279 | return skb; |
251 | } | 280 | } |
252 | 281 | ||
diff --git a/include/linux/init.h b/include/linux/init.h index 577671c55153..9146f39cdddf 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -79,29 +79,29 @@ | |||
79 | #define __exitused __used | 79 | #define __exitused __used |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | #define __exit __section(.exit.text) __exitused __cold | 82 | #define __exit __section(.exit.text) __exitused __cold notrace |
83 | 83 | ||
84 | /* Used for HOTPLUG */ | 84 | /* Used for HOTPLUG */ |
85 | #define __devinit __section(.devinit.text) __cold | 85 | #define __devinit __section(.devinit.text) __cold notrace |
86 | #define __devinitdata __section(.devinit.data) | 86 | #define __devinitdata __section(.devinit.data) |
87 | #define __devinitconst __section(.devinit.rodata) | 87 | #define __devinitconst __section(.devinit.rodata) |
88 | #define __devexit __section(.devexit.text) __exitused __cold | 88 | #define __devexit __section(.devexit.text) __exitused __cold notrace |
89 | #define __devexitdata __section(.devexit.data) | 89 | #define __devexitdata __section(.devexit.data) |
90 | #define __devexitconst __section(.devexit.rodata) | 90 | #define __devexitconst __section(.devexit.rodata) |
91 | 91 | ||
92 | /* Used for HOTPLUG_CPU */ | 92 | /* Used for HOTPLUG_CPU */ |
93 | #define __cpuinit __section(.cpuinit.text) __cold | 93 | #define __cpuinit __section(.cpuinit.text) __cold notrace |
94 | #define __cpuinitdata __section(.cpuinit.data) | 94 | #define __cpuinitdata __section(.cpuinit.data) |
95 | #define __cpuinitconst __section(.cpuinit.rodata) | 95 | #define __cpuinitconst __section(.cpuinit.rodata) |
96 | #define __cpuexit __section(.cpuexit.text) __exitused __cold | 96 | #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace |
97 | #define __cpuexitdata __section(.cpuexit.data) | 97 | #define __cpuexitdata __section(.cpuexit.data) |
98 | #define __cpuexitconst __section(.cpuexit.rodata) | 98 | #define __cpuexitconst __section(.cpuexit.rodata) |
99 | 99 | ||
100 | /* Used for MEMORY_HOTPLUG */ | 100 | /* Used for MEMORY_HOTPLUG */ |
101 | #define __meminit __section(.meminit.text) __cold | 101 | #define __meminit __section(.meminit.text) __cold notrace |
102 | #define __meminitdata __section(.meminit.data) | 102 | #define __meminitdata __section(.meminit.data) |
103 | #define __meminitconst __section(.meminit.rodata) | 103 | #define __meminitconst __section(.meminit.rodata) |
104 | #define __memexit __section(.memexit.text) __exitused __cold | 104 | #define __memexit __section(.memexit.text) __exitused __cold notrace |
105 | #define __memexitdata __section(.memexit.data) | 105 | #define __memexitdata __section(.memexit.data) |
106 | #define __memexitconst __section(.memexit.rodata) | 106 | #define __memexitconst __section(.memexit.rodata) |
107 | 107 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index caa151fbebb7..580f70c02391 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -22,6 +22,14 @@ | |||
22 | extern struct files_struct init_files; | 22 | extern struct files_struct init_files; |
23 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
24 | 24 | ||
25 | #ifdef CONFIG_CGROUPS | ||
26 | #define INIT_THREADGROUP_FORK_LOCK(sig) \ | ||
27 | .threadgroup_fork_lock = \ | ||
28 | __RWSEM_INITIALIZER(sig.threadgroup_fork_lock), | ||
29 | #else | ||
30 | #define INIT_THREADGROUP_FORK_LOCK(sig) | ||
31 | #endif | ||
32 | |||
25 | #define INIT_SIGNALS(sig) { \ | 33 | #define INIT_SIGNALS(sig) { \ |
26 | .nr_threads = 1, \ | 34 | .nr_threads = 1, \ |
27 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 35 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
@@ -38,6 +46,7 @@ extern struct fs_struct init_fs; | |||
38 | }, \ | 46 | }, \ |
39 | .cred_guard_mutex = \ | 47 | .cred_guard_mutex = \ |
40 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ | 48 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ |
49 | INIT_THREADGROUP_FORK_LOCK(sig) \ | ||
41 | } | 50 | } |
42 | 51 | ||
43 | extern struct nsproxy init_nsproxy; | 52 | extern struct nsproxy init_nsproxy; |
@@ -83,13 +92,6 @@ extern struct group_info init_groups; | |||
83 | #define INIT_IDS | 92 | #define INIT_IDS |
84 | #endif | 93 | #endif |
85 | 94 | ||
86 | /* | ||
87 | * Because of the reduced scope of CAP_SETPCAP when filesystem | ||
88 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | ||
89 | * be available in the default configuration. | ||
90 | */ | ||
91 | # define CAP_INIT_BSET CAP_FULL_SET | ||
92 | |||
93 | #ifdef CONFIG_RCU_BOOST | 95 | #ifdef CONFIG_RCU_BOOST |
94 | #define INIT_TASK_RCU_BOOST() \ | 96 | #define INIT_TASK_RCU_BOOST() \ |
95 | .rcu_boost_mutex = NULL, | 97 | .rcu_boost_mutex = NULL, |
@@ -134,7 +136,6 @@ extern struct cred init_cred; | |||
134 | .stack = &init_thread_info, \ | 136 | .stack = &init_thread_info, \ |
135 | .usage = ATOMIC_INIT(2), \ | 137 | .usage = ATOMIC_INIT(2), \ |
136 | .flags = PF_KTHREAD, \ | 138 | .flags = PF_KTHREAD, \ |
137 | .lock_depth = -1, \ | ||
138 | .prio = MAX_PRIO-20, \ | 139 | .prio = MAX_PRIO-20, \ |
139 | .static_prio = MAX_PRIO-20, \ | 140 | .static_prio = MAX_PRIO-20, \ |
140 | .normal_prio = MAX_PRIO-20, \ | 141 | .normal_prio = MAX_PRIO-20, \ |
diff --git a/include/linux/input/ad714x.h b/include/linux/input/ad714x.h index 0cbe5e81482e..d388d857bf14 100644 --- a/include/linux/input/ad714x.h +++ b/include/linux/input/ad714x.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * The platform_data for the device's "struct device" holds this | 6 | * The platform_data for the device's "struct device" holds this |
7 | * information. | 7 | * information. |
8 | * | 8 | * |
9 | * Copyright 2009 Analog Devices Inc. | 9 | * Copyright 2009-2011 Analog Devices Inc. |
10 | * | 10 | * |
11 | * Licensed under the GPL-2 or later. | 11 | * Licensed under the GPL-2 or later. |
12 | */ | 12 | */ |
@@ -58,6 +58,7 @@ struct ad714x_platform_data { | |||
58 | struct ad714x_button_plat *button; | 58 | struct ad714x_button_plat *button; |
59 | unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM]; | 59 | unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM]; |
60 | unsigned short sys_cfg_reg[SYS_CFGREG_NUM]; | 60 | unsigned short sys_cfg_reg[SYS_CFGREG_NUM]; |
61 | unsigned long irqflags; | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | #endif | 64 | #endif |
diff --git a/include/linux/input/adp5589.h b/include/linux/input/adp5589.h new file mode 100644 index 000000000000..ef792ecfaabf --- /dev/null +++ b/include/linux/input/adp5589.h | |||
@@ -0,0 +1,213 @@ | |||
1 | /* | ||
2 | * Analog Devices ADP5589 I/O Expander and QWERTY Keypad Controller | ||
3 | * | ||
4 | * Copyright 2010-2011 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ADP5589_H | ||
10 | #define _ADP5589_H | ||
11 | |||
12 | #define ADP5589_ID 0x00 | ||
13 | #define ADP5589_INT_STATUS 0x01 | ||
14 | #define ADP5589_STATUS 0x02 | ||
15 | #define ADP5589_FIFO_1 0x03 | ||
16 | #define ADP5589_FIFO_2 0x04 | ||
17 | #define ADP5589_FIFO_3 0x05 | ||
18 | #define ADP5589_FIFO_4 0x06 | ||
19 | #define ADP5589_FIFO_5 0x07 | ||
20 | #define ADP5589_FIFO_6 0x08 | ||
21 | #define ADP5589_FIFO_7 0x09 | ||
22 | #define ADP5589_FIFO_8 0x0A | ||
23 | #define ADP5589_FIFO_9 0x0B | ||
24 | #define ADP5589_FIFO_10 0x0C | ||
25 | #define ADP5589_FIFO_11 0x0D | ||
26 | #define ADP5589_FIFO_12 0x0E | ||
27 | #define ADP5589_FIFO_13 0x0F | ||
28 | #define ADP5589_FIFO_14 0x10 | ||
29 | #define ADP5589_FIFO_15 0x11 | ||
30 | #define ADP5589_FIFO_16 0x12 | ||
31 | #define ADP5589_GPI_INT_STAT_A 0x13 | ||
32 | #define ADP5589_GPI_INT_STAT_B 0x14 | ||
33 | #define ADP5589_GPI_INT_STAT_C 0x15 | ||
34 | #define ADP5589_GPI_STATUS_A 0x16 | ||
35 | #define ADP5589_GPI_STATUS_B 0x17 | ||
36 | #define ADP5589_GPI_STATUS_C 0x18 | ||
37 | #define ADP5589_RPULL_CONFIG_A 0x19 | ||
38 | #define ADP5589_RPULL_CONFIG_B 0x1A | ||
39 | #define ADP5589_RPULL_CONFIG_C 0x1B | ||
40 | #define ADP5589_RPULL_CONFIG_D 0x1C | ||
41 | #define ADP5589_RPULL_CONFIG_E 0x1D | ||
42 | #define ADP5589_GPI_INT_LEVEL_A 0x1E | ||
43 | #define ADP5589_GPI_INT_LEVEL_B 0x1F | ||
44 | #define ADP5589_GPI_INT_LEVEL_C 0x20 | ||
45 | #define ADP5589_GPI_EVENT_EN_A 0x21 | ||
46 | #define ADP5589_GPI_EVENT_EN_B 0x22 | ||
47 | #define ADP5589_GPI_EVENT_EN_C 0x23 | ||
48 | #define ADP5589_GPI_INTERRUPT_EN_A 0x24 | ||
49 | #define ADP5589_GPI_INTERRUPT_EN_B 0x25 | ||
50 | #define ADP5589_GPI_INTERRUPT_EN_C 0x26 | ||
51 | #define ADP5589_DEBOUNCE_DIS_A 0x27 | ||
52 | #define ADP5589_DEBOUNCE_DIS_B 0x28 | ||
53 | #define ADP5589_DEBOUNCE_DIS_C 0x29 | ||
54 | #define ADP5589_GPO_DATA_OUT_A 0x2A | ||
55 | #define ADP5589_GPO_DATA_OUT_B 0x2B | ||
56 | #define ADP5589_GPO_DATA_OUT_C 0x2C | ||
57 | #define ADP5589_GPO_OUT_MODE_A 0x2D | ||
58 | #define ADP5589_GPO_OUT_MODE_B 0x2E | ||
59 | #define ADP5589_GPO_OUT_MODE_C 0x2F | ||
60 | #define ADP5589_GPIO_DIRECTION_A 0x30 | ||
61 | #define ADP5589_GPIO_DIRECTION_B 0x31 | ||
62 | #define ADP5589_GPIO_DIRECTION_C 0x32 | ||
63 | #define ADP5589_UNLOCK1 0x33 | ||
64 | #define ADP5589_UNLOCK2 0x34 | ||
65 | #define ADP5589_EXT_LOCK_EVENT 0x35 | ||
66 | #define ADP5589_UNLOCK_TIMERS 0x36 | ||
67 | #define ADP5589_LOCK_CFG 0x37 | ||
68 | #define ADP5589_RESET1_EVENT_A 0x38 | ||
69 | #define ADP5589_RESET1_EVENT_B 0x39 | ||
70 | #define ADP5589_RESET1_EVENT_C 0x3A | ||
71 | #define ADP5589_RESET2_EVENT_A 0x3B | ||
72 | #define ADP5589_RESET2_EVENT_B 0x3C | ||
73 | #define ADP5589_RESET_CFG 0x3D | ||
74 | #define ADP5589_PWM_OFFT_LOW 0x3E | ||
75 | #define ADP5589_PWM_OFFT_HIGH 0x3F | ||
76 | #define ADP5589_PWM_ONT_LOW 0x40 | ||
77 | #define ADP5589_PWM_ONT_HIGH 0x41 | ||
78 | #define ADP5589_PWM_CFG 0x42 | ||
79 | #define ADP5589_CLOCK_DIV_CFG 0x43 | ||
80 | #define ADP5589_LOGIC_1_CFG 0x44 | ||
81 | #define ADP5589_LOGIC_2_CFG 0x45 | ||
82 | #define ADP5589_LOGIC_FF_CFG 0x46 | ||
83 | #define ADP5589_LOGIC_INT_EVENT_EN 0x47 | ||
84 | #define ADP5589_POLL_PTIME_CFG 0x48 | ||
85 | #define ADP5589_PIN_CONFIG_A 0x49 | ||
86 | #define ADP5589_PIN_CONFIG_B 0x4A | ||
87 | #define ADP5589_PIN_CONFIG_C 0x4B | ||
88 | #define ADP5589_PIN_CONFIG_D 0x4C | ||
89 | #define ADP5589_GENERAL_CFG 0x4D | ||
90 | #define ADP5589_INT_EN 0x4E | ||
91 | |||
92 | #define ADP5589_DEVICE_ID_MASK 0xF | ||
93 | |||
94 | /* Put one of these structures in i2c_board_info platform_data */ | ||
95 | |||
96 | #define ADP5589_KEYMAPSIZE 88 | ||
97 | |||
98 | #define ADP5589_GPI_PIN_ROW0 97 | ||
99 | #define ADP5589_GPI_PIN_ROW1 98 | ||
100 | #define ADP5589_GPI_PIN_ROW2 99 | ||
101 | #define ADP5589_GPI_PIN_ROW3 100 | ||
102 | #define ADP5589_GPI_PIN_ROW4 101 | ||
103 | #define ADP5589_GPI_PIN_ROW5 102 | ||
104 | #define ADP5589_GPI_PIN_ROW6 103 | ||
105 | #define ADP5589_GPI_PIN_ROW7 104 | ||
106 | #define ADP5589_GPI_PIN_COL0 105 | ||
107 | #define ADP5589_GPI_PIN_COL1 106 | ||
108 | #define ADP5589_GPI_PIN_COL2 107 | ||
109 | #define ADP5589_GPI_PIN_COL3 108 | ||
110 | #define ADP5589_GPI_PIN_COL4 109 | ||
111 | #define ADP5589_GPI_PIN_COL5 110 | ||
112 | #define ADP5589_GPI_PIN_COL6 111 | ||
113 | #define ADP5589_GPI_PIN_COL7 112 | ||
114 | #define ADP5589_GPI_PIN_COL8 113 | ||
115 | #define ADP5589_GPI_PIN_COL9 114 | ||
116 | #define ADP5589_GPI_PIN_COL10 115 | ||
117 | #define GPI_LOGIC1 116 | ||
118 | #define GPI_LOGIC2 117 | ||
119 | |||
120 | #define ADP5589_GPI_PIN_ROW_BASE ADP5589_GPI_PIN_ROW0 | ||
121 | #define ADP5589_GPI_PIN_ROW_END ADP5589_GPI_PIN_ROW7 | ||
122 | #define ADP5589_GPI_PIN_COL_BASE ADP5589_GPI_PIN_COL0 | ||
123 | #define ADP5589_GPI_PIN_COL_END ADP5589_GPI_PIN_COL10 | ||
124 | |||
125 | #define ADP5589_GPI_PIN_BASE ADP5589_GPI_PIN_ROW_BASE | ||
126 | #define ADP5589_GPI_PIN_END ADP5589_GPI_PIN_COL_END | ||
127 | |||
128 | #define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) | ||
129 | |||
130 | struct adp5589_gpi_map { | ||
131 | unsigned short pin; | ||
132 | unsigned short sw_evt; | ||
133 | }; | ||
134 | |||
135 | /* scan_cycle_time */ | ||
136 | #define ADP5589_SCAN_CYCLE_10ms 0 | ||
137 | #define ADP5589_SCAN_CYCLE_20ms 1 | ||
138 | #define ADP5589_SCAN_CYCLE_30ms 2 | ||
139 | #define ADP5589_SCAN_CYCLE_40ms 3 | ||
140 | |||
141 | /* RESET_CFG */ | ||
142 | #define RESET_PULSE_WIDTH_500us 0 | ||
143 | #define RESET_PULSE_WIDTH_1ms 1 | ||
144 | #define RESET_PULSE_WIDTH_2ms 2 | ||
145 | #define RESET_PULSE_WIDTH_10ms 3 | ||
146 | |||
147 | #define RESET_TRIG_TIME_0ms (0 << 2) | ||
148 | #define RESET_TRIG_TIME_1000ms (1 << 2) | ||
149 | #define RESET_TRIG_TIME_1500ms (2 << 2) | ||
150 | #define RESET_TRIG_TIME_2000ms (3 << 2) | ||
151 | #define RESET_TRIG_TIME_2500ms (4 << 2) | ||
152 | #define RESET_TRIG_TIME_3000ms (5 << 2) | ||
153 | #define RESET_TRIG_TIME_3500ms (6 << 2) | ||
154 | #define RESET_TRIG_TIME_4000ms (7 << 2) | ||
155 | |||
156 | #define RESET_PASSTHRU_EN (1 << 5) | ||
157 | #define RESET1_POL_HIGH (1 << 6) | ||
158 | #define RESET1_POL_LOW (0 << 6) | ||
159 | #define RESET2_POL_HIGH (1 << 7) | ||
160 | #define RESET2_POL_LOW (0 << 7) | ||
161 | |||
162 | /* Mask Bits: | ||
163 | * C C C C C C C C C C C | R R R R R R R R | ||
164 | * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | ||
165 | * 0 | ||
166 | * ---------------- BIT ------------------ | ||
167 | * 1 1 1 1 1 1 1 1 1 0 0 | 0 0 0 0 0 0 0 0 | ||
168 | * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 | ||
169 | */ | ||
170 | |||
171 | #define ADP_ROW(x) (1 << (x)) | ||
172 | #define ADP_COL(x) (1 << (x + 8)) | ||
173 | |||
174 | struct adp5589_kpad_platform_data { | ||
175 | unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ | ||
176 | const unsigned short *keymap; /* Pointer to keymap */ | ||
177 | unsigned short keymapsize; /* Keymap size */ | ||
178 | bool repeat; /* Enable key repeat */ | ||
179 | bool en_keylock; /* Enable key lock feature */ | ||
180 | unsigned char unlock_key1; /* Unlock Key 1 */ | ||
181 | unsigned char unlock_key2; /* Unlock Key 2 */ | ||
182 | unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable */ | ||
183 | unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ | ||
184 | unsigned char reset_cfg; /* Reset config */ | ||
185 | unsigned short reset1_key_1; /* Reset Key 1 */ | ||
186 | unsigned short reset1_key_2; /* Reset Key 2 */ | ||
187 | unsigned short reset1_key_3; /* Reset Key 3 */ | ||
188 | unsigned short reset2_key_1; /* Reset Key 1 */ | ||
189 | unsigned short reset2_key_2; /* Reset Key 2 */ | ||
190 | unsigned debounce_dis_mask; /* Disable debounce mask */ | ||
191 | unsigned pull_dis_mask; /* Disable all pull resistors mask */ | ||
192 | unsigned pullup_en_100k; /* Pull-Up 100k Enable Mask */ | ||
193 | unsigned pullup_en_300k; /* Pull-Up 300k Enable Mask */ | ||
194 | unsigned pulldown_en_300k; /* Pull-Down 300k Enable Mask */ | ||
195 | const struct adp5589_gpi_map *gpimap; | ||
196 | unsigned short gpimapsize; | ||
197 | const struct adp5589_gpio_platform_data *gpio_data; | ||
198 | }; | ||
199 | |||
200 | struct i2c_client; /* forward declaration */ | ||
201 | |||
202 | struct adp5589_gpio_platform_data { | ||
203 | int gpio_start; /* GPIO Chip base # */ | ||
204 | int (*setup)(struct i2c_client *client, | ||
205 | int gpio, unsigned ngpio, | ||
206 | void *context); | ||
207 | int (*teardown)(struct i2c_client *client, | ||
208 | int gpio, unsigned ngpio, | ||
209 | void *context); | ||
210 | void *context; | ||
211 | }; | ||
212 | |||
213 | #endif | ||
diff --git a/include/linux/input/pmic8xxx-keypad.h b/include/linux/input/pmic8xxx-keypad.h new file mode 100644 index 000000000000..5f1e2f9ad959 --- /dev/null +++ b/include/linux/input/pmic8xxx-keypad.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PMIC8XXX_KEYPAD_H__ | ||
14 | #define __PMIC8XXX_KEYPAD_H__ | ||
15 | |||
16 | #include <linux/input/matrix_keypad.h> | ||
17 | |||
18 | #define PM8XXX_KEYPAD_DEV_NAME "pm8xxx-keypad" | ||
19 | |||
20 | /** | ||
21 | * struct pm8xxx_keypad_platform_data - platform data for keypad | ||
22 | * @keymap_data - matrix keymap data | ||
23 | * @input_name - input device name | ||
24 | * @input_phys_device - input device name | ||
25 | * @num_cols - number of columns of keypad | ||
26 | * @num_rows - number of row of keypad | ||
27 | * @debounce_ms - debounce period in milliseconds | ||
28 | * @scan_delay_ms - scan delay in milliseconds | ||
29 | * @row_hold_ns - row hold period in nanoseconds | ||
30 | * @wakeup - configure keypad as wakeup | ||
31 | * @rep - enable or disable key repeat bit | ||
32 | */ | ||
33 | struct pm8xxx_keypad_platform_data { | ||
34 | const struct matrix_keymap_data *keymap_data; | ||
35 | |||
36 | const char *input_name; | ||
37 | const char *input_phys_device; | ||
38 | |||
39 | unsigned int num_cols; | ||
40 | unsigned int num_rows; | ||
41 | unsigned int rows_gpio_start; | ||
42 | unsigned int cols_gpio_start; | ||
43 | |||
44 | unsigned int debounce_ms; | ||
45 | unsigned int scan_delay_ms; | ||
46 | unsigned int row_hold_ns; | ||
47 | |||
48 | bool wakeup; | ||
49 | bool rep; | ||
50 | }; | ||
51 | |||
52 | #endif /*__PMIC8XXX_KEYPAD_H__ */ | ||
diff --git a/include/linux/input/pmic8xxx-pwrkey.h b/include/linux/input/pmic8xxx-pwrkey.h new file mode 100644 index 000000000000..6d2974e57109 --- /dev/null +++ b/include/linux/input/pmic8xxx-pwrkey.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PMIC8XXX_PWRKEY_H__ | ||
14 | #define __PMIC8XXX_PWRKEY_H__ | ||
15 | |||
16 | #define PM8XXX_PWRKEY_DEV_NAME "pm8xxx-pwrkey" | ||
17 | |||
18 | /** | ||
19 | * struct pm8xxx_pwrkey_platform_data - platform data for pwrkey driver | ||
20 | * @pull up: power on register control for pull up/down configuration | ||
21 | * @kpd_trigger_delay_us: time delay for power key state change interrupt | ||
22 | * trigger. | ||
23 | * @wakeup: configure power key as wakeup source | ||
24 | */ | ||
25 | struct pm8xxx_pwrkey_platform_data { | ||
26 | bool pull_up; | ||
27 | u32 kpd_trigger_delay_us; | ||
28 | u32 wakeup; | ||
29 | }; | ||
30 | |||
31 | #endif /* __PMIC8XXX_PWRKEY_H__ */ | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index bea0ac750712..6c12989839d9 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -414,7 +414,6 @@ enum | |||
414 | TASKLET_SOFTIRQ, | 414 | TASKLET_SOFTIRQ, |
415 | SCHED_SOFTIRQ, | 415 | SCHED_SOFTIRQ, |
416 | HRTIMER_SOFTIRQ, | 416 | HRTIMER_SOFTIRQ, |
417 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | ||
418 | 417 | ||
419 | NR_SOFTIRQS | 418 | NR_SOFTIRQS |
420 | }; | 419 | }; |
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 906590aa6907..204f9cd26c16 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -236,7 +236,7 @@ static inline void ipmi_free_smi_msg(struct ipmi_smi_msg *msg) | |||
236 | directory for this interface. Note that the entry will | 236 | directory for this interface. Note that the entry will |
237 | automatically be dstroyed when the interface is destroyed. */ | 237 | automatically be dstroyed when the interface is destroyed. */ |
238 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | 238 | int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, |
239 | read_proc_t *read_proc, | 239 | const struct file_operations *proc_ops, |
240 | void *data); | 240 | void *data); |
241 | 241 | ||
242 | #endif /* __LINUX_IPMI_SMI_H */ | 242 | #endif /* __LINUX_IPMI_SMI_H */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 09a308072f56..8b4538446636 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -53,12 +53,13 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); | |||
53 | * Bits which can be modified via irq_set/clear/modify_status_flags() | 53 | * Bits which can be modified via irq_set/clear/modify_status_flags() |
54 | * IRQ_LEVEL - Interrupt is level type. Will be also | 54 | * IRQ_LEVEL - Interrupt is level type. Will be also |
55 | * updated in the code when the above trigger | 55 | * updated in the code when the above trigger |
56 | * bits are modified via set_irq_type() | 56 | * bits are modified via irq_set_irq_type() |
57 | * IRQ_PER_CPU - Mark an interrupt PER_CPU. Will protect | 57 | * IRQ_PER_CPU - Mark an interrupt PER_CPU. Will protect |
58 | * it from affinity setting | 58 | * it from affinity setting |
59 | * IRQ_NOPROBE - Interrupt cannot be probed by autoprobing | 59 | * IRQ_NOPROBE - Interrupt cannot be probed by autoprobing |
60 | * IRQ_NOREQUEST - Interrupt cannot be requested via | 60 | * IRQ_NOREQUEST - Interrupt cannot be requested via |
61 | * request_irq() | 61 | * request_irq() |
62 | * IRQ_NOTHREAD - Interrupt cannot be threaded | ||
62 | * IRQ_NOAUTOEN - Interrupt is not automatically enabled in | 63 | * IRQ_NOAUTOEN - Interrupt is not automatically enabled in |
63 | * request/setup_irq() | 64 | * request/setup_irq() |
64 | * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) | 65 | * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) |
@@ -85,6 +86,7 @@ enum { | |||
85 | IRQ_NO_BALANCING = (1 << 13), | 86 | IRQ_NO_BALANCING = (1 << 13), |
86 | IRQ_MOVE_PCNTXT = (1 << 14), | 87 | IRQ_MOVE_PCNTXT = (1 << 14), |
87 | IRQ_NESTED_THREAD = (1 << 15), | 88 | IRQ_NESTED_THREAD = (1 << 15), |
89 | IRQ_NOTHREAD = (1 << 16), | ||
88 | }; | 90 | }; |
89 | 91 | ||
90 | #define IRQF_MODIFY_MASK \ | 92 | #define IRQF_MODIFY_MASK \ |
@@ -261,23 +263,6 @@ static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d) | |||
261 | * struct irq_chip - hardware interrupt chip descriptor | 263 | * struct irq_chip - hardware interrupt chip descriptor |
262 | * | 264 | * |
263 | * @name: name for /proc/interrupts | 265 | * @name: name for /proc/interrupts |
264 | * @startup: deprecated, replaced by irq_startup | ||
265 | * @shutdown: deprecated, replaced by irq_shutdown | ||
266 | * @enable: deprecated, replaced by irq_enable | ||
267 | * @disable: deprecated, replaced by irq_disable | ||
268 | * @ack: deprecated, replaced by irq_ack | ||
269 | * @mask: deprecated, replaced by irq_mask | ||
270 | * @mask_ack: deprecated, replaced by irq_mask_ack | ||
271 | * @unmask: deprecated, replaced by irq_unmask | ||
272 | * @eoi: deprecated, replaced by irq_eoi | ||
273 | * @end: deprecated, will go away with __do_IRQ() | ||
274 | * @set_affinity: deprecated, replaced by irq_set_affinity | ||
275 | * @retrigger: deprecated, replaced by irq_retrigger | ||
276 | * @set_type: deprecated, replaced by irq_set_type | ||
277 | * @set_wake: deprecated, replaced by irq_wake | ||
278 | * @bus_lock: deprecated, replaced by irq_bus_lock | ||
279 | * @bus_sync_unlock: deprecated, replaced by irq_bus_sync_unlock | ||
280 | * | ||
281 | * @irq_startup: start up the interrupt (defaults to ->enable if NULL) | 266 | * @irq_startup: start up the interrupt (defaults to ->enable if NULL) |
282 | * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL) | 267 | * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL) |
283 | * @irq_enable: enable the interrupt (defaults to chip->unmask if NULL) | 268 | * @irq_enable: enable the interrupt (defaults to chip->unmask if NULL) |
@@ -295,6 +280,9 @@ static inline void irqd_clr_chained_irq_inprogress(struct irq_data *d) | |||
295 | * @irq_bus_sync_unlock:function to sync and unlock slow bus (i2c) chips | 280 | * @irq_bus_sync_unlock:function to sync and unlock slow bus (i2c) chips |
296 | * @irq_cpu_online: configure an interrupt source for a secondary CPU | 281 | * @irq_cpu_online: configure an interrupt source for a secondary CPU |
297 | * @irq_cpu_offline: un-configure an interrupt source for a secondary CPU | 282 | * @irq_cpu_offline: un-configure an interrupt source for a secondary CPU |
283 | * @irq_suspend: function called from core code on suspend once per chip | ||
284 | * @irq_resume: function called from core code on resume once per chip | ||
285 | * @irq_pm_shutdown: function called from core code on shutdown once per chip | ||
298 | * @irq_print_chip: optional to print special chip info in show_interrupts | 286 | * @irq_print_chip: optional to print special chip info in show_interrupts |
299 | * @flags: chip specific flags | 287 | * @flags: chip specific flags |
300 | * | 288 | * |
@@ -324,6 +312,10 @@ struct irq_chip { | |||
324 | void (*irq_cpu_online)(struct irq_data *data); | 312 | void (*irq_cpu_online)(struct irq_data *data); |
325 | void (*irq_cpu_offline)(struct irq_data *data); | 313 | void (*irq_cpu_offline)(struct irq_data *data); |
326 | 314 | ||
315 | void (*irq_suspend)(struct irq_data *data); | ||
316 | void (*irq_resume)(struct irq_data *data); | ||
317 | void (*irq_pm_shutdown)(struct irq_data *data); | ||
318 | |||
327 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); | 319 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); |
328 | 320 | ||
329 | unsigned long flags; | 321 | unsigned long flags; |
@@ -439,7 +431,7 @@ irq_set_handler(unsigned int irq, irq_flow_handler_t handle) | |||
439 | /* | 431 | /* |
440 | * Set a highlevel chained flow handler for a given IRQ. | 432 | * Set a highlevel chained flow handler for a given IRQ. |
441 | * (a chained handler is automatically enabled and set to | 433 | * (a chained handler is automatically enabled and set to |
442 | * IRQ_NOREQUEST and IRQ_NOPROBE) | 434 | * IRQ_NOREQUEST, IRQ_NOPROBE, and IRQ_NOTHREAD) |
443 | */ | 435 | */ |
444 | static inline void | 436 | static inline void |
445 | irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) | 437 | irq_set_chained_handler(unsigned int irq, irq_flow_handler_t handle) |
@@ -469,6 +461,16 @@ static inline void irq_set_probe(unsigned int irq) | |||
469 | irq_modify_status(irq, IRQ_NOPROBE, 0); | 461 | irq_modify_status(irq, IRQ_NOPROBE, 0); |
470 | } | 462 | } |
471 | 463 | ||
464 | static inline void irq_set_nothread(unsigned int irq) | ||
465 | { | ||
466 | irq_modify_status(irq, 0, IRQ_NOTHREAD); | ||
467 | } | ||
468 | |||
469 | static inline void irq_set_thread(unsigned int irq) | ||
470 | { | ||
471 | irq_modify_status(irq, IRQ_NOTHREAD, 0); | ||
472 | } | ||
473 | |||
472 | static inline void irq_set_nested_thread(unsigned int irq, bool nest) | 474 | static inline void irq_set_nested_thread(unsigned int irq, bool nest) |
473 | { | 475 | { |
474 | if (nest) | 476 | if (nest) |
@@ -573,6 +575,145 @@ static inline int irq_reserve_irq(unsigned int irq) | |||
573 | return irq_reserve_irqs(irq, 1); | 575 | return irq_reserve_irqs(irq, 1); |
574 | } | 576 | } |
575 | 577 | ||
578 | #ifndef irq_reg_writel | ||
579 | # define irq_reg_writel(val, addr) writel(val, addr) | ||
580 | #endif | ||
581 | #ifndef irq_reg_readl | ||
582 | # define irq_reg_readl(addr) readl(addr) | ||
583 | #endif | ||
584 | |||
585 | /** | ||
586 | * struct irq_chip_regs - register offsets for struct irq_gci | ||
587 | * @enable: Enable register offset to reg_base | ||
588 | * @disable: Disable register offset to reg_base | ||
589 | * @mask: Mask register offset to reg_base | ||
590 | * @ack: Ack register offset to reg_base | ||
591 | * @eoi: Eoi register offset to reg_base | ||
592 | * @type: Type configuration register offset to reg_base | ||
593 | * @polarity: Polarity configuration register offset to reg_base | ||
594 | */ | ||
595 | struct irq_chip_regs { | ||
596 | unsigned long enable; | ||
597 | unsigned long disable; | ||
598 | unsigned long mask; | ||
599 | unsigned long ack; | ||
600 | unsigned long eoi; | ||
601 | unsigned long type; | ||
602 | unsigned long polarity; | ||
603 | }; | ||
604 | |||
605 | /** | ||
606 | * struct irq_chip_type - Generic interrupt chip instance for a flow type | ||
607 | * @chip: The real interrupt chip which provides the callbacks | ||
608 | * @regs: Register offsets for this chip | ||
609 | * @handler: Flow handler associated with this chip | ||
610 | * @type: Chip can handle these flow types | ||
611 | * | ||
612 | * A irq_generic_chip can have several instances of irq_chip_type when | ||
613 | * it requires different functions and register offsets for different | ||
614 | * flow types. | ||
615 | */ | ||
616 | struct irq_chip_type { | ||
617 | struct irq_chip chip; | ||
618 | struct irq_chip_regs regs; | ||
619 | irq_flow_handler_t handler; | ||
620 | u32 type; | ||
621 | }; | ||
622 | |||
623 | /** | ||
624 | * struct irq_chip_generic - Generic irq chip data structure | ||
625 | * @lock: Lock to protect register and cache data access | ||
626 | * @reg_base: Register base address (virtual) | ||
627 | * @irq_base: Interrupt base nr for this chip | ||
628 | * @irq_cnt: Number of interrupts handled by this chip | ||
629 | * @mask_cache: Cached mask register | ||
630 | * @type_cache: Cached type register | ||
631 | * @polarity_cache: Cached polarity register | ||
632 | * @wake_enabled: Interrupt can wakeup from suspend | ||
633 | * @wake_active: Interrupt is marked as an wakeup from suspend source | ||
634 | * @num_ct: Number of available irq_chip_type instances (usually 1) | ||
635 | * @private: Private data for non generic chip callbacks | ||
636 | * @list: List head for keeping track of instances | ||
637 | * @chip_types: Array of interrupt irq_chip_types | ||
638 | * | ||
639 | * Note, that irq_chip_generic can have multiple irq_chip_type | ||
640 | * implementations which can be associated to a particular irq line of | ||
641 | * an irq_chip_generic instance. That allows to share and protect | ||
642 | * state in an irq_chip_generic instance when we need to implement | ||
643 | * different flow mechanisms (level/edge) for it. | ||
644 | */ | ||
645 | struct irq_chip_generic { | ||
646 | raw_spinlock_t lock; | ||
647 | void __iomem *reg_base; | ||
648 | unsigned int irq_base; | ||
649 | unsigned int irq_cnt; | ||
650 | u32 mask_cache; | ||
651 | u32 type_cache; | ||
652 | u32 polarity_cache; | ||
653 | u32 wake_enabled; | ||
654 | u32 wake_active; | ||
655 | unsigned int num_ct; | ||
656 | void *private; | ||
657 | struct list_head list; | ||
658 | struct irq_chip_type chip_types[0]; | ||
659 | }; | ||
660 | |||
661 | /** | ||
662 | * enum irq_gc_flags - Initialization flags for generic irq chips | ||
663 | * @IRQ_GC_INIT_MASK_CACHE: Initialize the mask_cache by reading mask reg | ||
664 | * @IRQ_GC_INIT_NESTED_LOCK: Set the lock class of the irqs to nested for | ||
665 | * irq chips which need to call irq_set_wake() on | ||
666 | * the parent irq. Usually GPIO implementations | ||
667 | */ | ||
668 | enum irq_gc_flags { | ||
669 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, | ||
670 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, | ||
671 | }; | ||
672 | |||
673 | /* Generic chip callback functions */ | ||
674 | void irq_gc_noop(struct irq_data *d); | ||
675 | void irq_gc_mask_disable_reg(struct irq_data *d); | ||
676 | void irq_gc_mask_set_bit(struct irq_data *d); | ||
677 | void irq_gc_mask_clr_bit(struct irq_data *d); | ||
678 | void irq_gc_unmask_enable_reg(struct irq_data *d); | ||
679 | void irq_gc_ack(struct irq_data *d); | ||
680 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); | ||
681 | void irq_gc_eoi(struct irq_data *d); | ||
682 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); | ||
683 | |||
684 | /* Setup functions for irq_chip_generic */ | ||
685 | struct irq_chip_generic * | ||
686 | irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base, | ||
687 | void __iomem *reg_base, irq_flow_handler_t handler); | ||
688 | void irq_setup_generic_chip(struct irq_chip_generic *gc, u32 msk, | ||
689 | enum irq_gc_flags flags, unsigned int clr, | ||
690 | unsigned int set); | ||
691 | int irq_setup_alt_chip(struct irq_data *d, unsigned int type); | ||
692 | void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, | ||
693 | unsigned int clr, unsigned int set); | ||
694 | |||
695 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) | ||
696 | { | ||
697 | return container_of(d->chip, struct irq_chip_type, chip); | ||
698 | } | ||
699 | |||
700 | #define IRQ_MSK(n) (u32)((n) < 32 ? ((1 << (n)) - 1) : UINT_MAX) | ||
701 | |||
702 | #ifdef CONFIG_SMP | ||
703 | static inline void irq_gc_lock(struct irq_chip_generic *gc) | ||
704 | { | ||
705 | raw_spin_lock(&gc->lock); | ||
706 | } | ||
707 | |||
708 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) | ||
709 | { | ||
710 | raw_spin_unlock(&gc->lock); | ||
711 | } | ||
712 | #else | ||
713 | static inline void irq_gc_lock(struct irq_chip_generic *gc) { } | ||
714 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } | ||
715 | #endif | ||
716 | |||
576 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 717 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
577 | 718 | ||
578 | #endif /* !CONFIG_S390 */ | 719 | #endif /* !CONFIG_S390 */ |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index a082905b5ebe..2d921b35212c 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -16,16 +16,18 @@ struct timer_rand_state; | |||
16 | * @irq_data: per irq and chip data passed down to chip functions | 16 | * @irq_data: per irq and chip data passed down to chip functions |
17 | * @timer_rand_state: pointer to timer rand state struct | 17 | * @timer_rand_state: pointer to timer rand state struct |
18 | * @kstat_irqs: irq stats per cpu | 18 | * @kstat_irqs: irq stats per cpu |
19 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] | 19 | * @handle_irq: highlevel irq-events handler |
20 | * @preflow_handler: handler called before the flow handler (currently used by sparc) | ||
20 | * @action: the irq action chain | 21 | * @action: the irq action chain |
21 | * @status: status information | 22 | * @status: status information |
22 | * @core_internal_state__do_not_mess_with_it: core internal status information | 23 | * @core_internal_state__do_not_mess_with_it: core internal status information |
23 | * @depth: disable-depth, for nested irq_disable() calls | 24 | * @depth: disable-depth, for nested irq_disable() calls |
24 | * @wake_depth: enable depth, for multiple set_irq_wake() callers | 25 | * @wake_depth: enable depth, for multiple irq_set_irq_wake() callers |
25 | * @irq_count: stats field to detect stalled irqs | 26 | * @irq_count: stats field to detect stalled irqs |
26 | * @last_unhandled: aging timer for unhandled count | 27 | * @last_unhandled: aging timer for unhandled count |
27 | * @irqs_unhandled: stats field for spurious unhandled interrupts | 28 | * @irqs_unhandled: stats field for spurious unhandled interrupts |
28 | * @lock: locking for SMP | 29 | * @lock: locking for SMP |
30 | * @affinity_hint: hint to user space for preferred irq affinity | ||
29 | * @affinity_notify: context for notification of affinity changes | 31 | * @affinity_notify: context for notification of affinity changes |
30 | * @pending_mask: pending rebalanced interrupts | 32 | * @pending_mask: pending rebalanced interrupts |
31 | * @threads_oneshot: bitfield to handle shared oneshot threads | 33 | * @threads_oneshot: bitfield to handle shared oneshot threads |
@@ -109,10 +111,7 @@ static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *de | |||
109 | desc->handle_irq(irq, desc); | 111 | desc->handle_irq(irq, desc); |
110 | } | 112 | } |
111 | 113 | ||
112 | static inline void generic_handle_irq(unsigned int irq) | 114 | int generic_handle_irq(unsigned int irq); |
113 | { | ||
114 | generic_handle_irq_desc(irq, irq_to_desc(irq)); | ||
115 | } | ||
116 | 115 | ||
117 | /* Test to see if a driver has successfully requested an irq */ | 116 | /* Test to see if a driver has successfully requested an irq */ |
118 | static inline int irq_has_action(unsigned int irq) | 117 | static inline int irq_has_action(unsigned int irq) |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 819acaaac3f5..714ba08dc092 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
@@ -8,9 +8,9 @@ | |||
8 | * @IRQ_WAKE_THREAD handler requests to wake the handler thread | 8 | * @IRQ_WAKE_THREAD handler requests to wake the handler thread |
9 | */ | 9 | */ |
10 | enum irqreturn { | 10 | enum irqreturn { |
11 | IRQ_NONE, | 11 | IRQ_NONE = (0 << 0), |
12 | IRQ_HANDLED, | 12 | IRQ_HANDLED = (1 << 0), |
13 | IRQ_WAKE_THREAD, | 13 | IRQ_WAKE_THREAD = (1 << 1), |
14 | }; | 14 | }; |
15 | 15 | ||
16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index a32dcaec04e1..4ecb7b16b278 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -529,9 +529,10 @@ struct transaction_s | |||
529 | enum { | 529 | enum { |
530 | T_RUNNING, | 530 | T_RUNNING, |
531 | T_LOCKED, | 531 | T_LOCKED, |
532 | T_RUNDOWN, | ||
533 | T_FLUSH, | 532 | T_FLUSH, |
534 | T_COMMIT, | 533 | T_COMMIT, |
534 | T_COMMIT_DFLUSH, | ||
535 | T_COMMIT_JFLUSH, | ||
535 | T_FINISHED | 536 | T_FINISHED |
536 | } t_state; | 537 | } t_state; |
537 | 538 | ||
@@ -658,7 +659,9 @@ struct transaction_s | |||
658 | * waiting for it to finish. | 659 | * waiting for it to finish. |
659 | */ | 660 | */ |
660 | unsigned int t_synchronous_commit:1; | 661 | unsigned int t_synchronous_commit:1; |
661 | unsigned int t_flushed_data_blocks:1; | 662 | |
663 | /* Disk flush needs to be sent to fs partition [no locking] */ | ||
664 | int t_need_data_flush; | ||
662 | 665 | ||
663 | /* | 666 | /* |
664 | * For use by the filesystem to store fs-specific data | 667 | * For use by the filesystem to store fs-specific data |
@@ -1228,6 +1231,7 @@ int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); | |||
1228 | int jbd2_journal_force_commit_nested(journal_t *journal); | 1231 | int jbd2_journal_force_commit_nested(journal_t *journal); |
1229 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); | 1232 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); |
1230 | int jbd2_log_do_checkpoint(journal_t *journal); | 1233 | int jbd2_log_do_checkpoint(journal_t *journal); |
1234 | int jbd2_trans_will_send_data_barrier(journal_t *journal, tid_t tid); | ||
1231 | 1235 | ||
1232 | void __jbd2_log_wait_for_space(journal_t *journal); | 1236 | void __jbd2_log_wait_for_space(journal_t *journal); |
1233 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); | 1237 | extern void __jbd2_journal_drop_transaction(journal_t *, transaction_t *); |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 7880f18e4b86..83e745f3ead7 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -1,20 +1,43 @@ | |||
1 | #ifndef _LINUX_JUMP_LABEL_H | 1 | #ifndef _LINUX_JUMP_LABEL_H |
2 | #define _LINUX_JUMP_LABEL_H | 2 | #define _LINUX_JUMP_LABEL_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/compiler.h> | ||
6 | |||
4 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) | 7 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) |
8 | |||
9 | struct jump_label_key { | ||
10 | atomic_t enabled; | ||
11 | struct jump_entry *entries; | ||
12 | #ifdef CONFIG_MODULES | ||
13 | struct jump_label_mod *next; | ||
14 | #endif | ||
15 | }; | ||
16 | |||
5 | # include <asm/jump_label.h> | 17 | # include <asm/jump_label.h> |
6 | # define HAVE_JUMP_LABEL | 18 | # define HAVE_JUMP_LABEL |
7 | #endif | 19 | #endif |
8 | 20 | ||
9 | enum jump_label_type { | 21 | enum jump_label_type { |
22 | JUMP_LABEL_DISABLE = 0, | ||
10 | JUMP_LABEL_ENABLE, | 23 | JUMP_LABEL_ENABLE, |
11 | JUMP_LABEL_DISABLE | ||
12 | }; | 24 | }; |
13 | 25 | ||
14 | struct module; | 26 | struct module; |
15 | 27 | ||
16 | #ifdef HAVE_JUMP_LABEL | 28 | #ifdef HAVE_JUMP_LABEL |
17 | 29 | ||
30 | #ifdef CONFIG_MODULES | ||
31 | #define JUMP_LABEL_INIT {{ 0 }, NULL, NULL} | ||
32 | #else | ||
33 | #define JUMP_LABEL_INIT {{ 0 }, NULL} | ||
34 | #endif | ||
35 | |||
36 | static __always_inline bool static_branch(struct jump_label_key *key) | ||
37 | { | ||
38 | return arch_static_branch(key); | ||
39 | } | ||
40 | |||
18 | extern struct jump_entry __start___jump_table[]; | 41 | extern struct jump_entry __start___jump_table[]; |
19 | extern struct jump_entry __stop___jump_table[]; | 42 | extern struct jump_entry __stop___jump_table[]; |
20 | 43 | ||
@@ -23,37 +46,37 @@ extern void jump_label_unlock(void); | |||
23 | extern void arch_jump_label_transform(struct jump_entry *entry, | 46 | extern void arch_jump_label_transform(struct jump_entry *entry, |
24 | enum jump_label_type type); | 47 | enum jump_label_type type); |
25 | extern void arch_jump_label_text_poke_early(jump_label_t addr); | 48 | extern void arch_jump_label_text_poke_early(jump_label_t addr); |
26 | extern void jump_label_update(unsigned long key, enum jump_label_type type); | ||
27 | extern void jump_label_apply_nops(struct module *mod); | ||
28 | extern int jump_label_text_reserved(void *start, void *end); | 49 | extern int jump_label_text_reserved(void *start, void *end); |
50 | extern void jump_label_inc(struct jump_label_key *key); | ||
51 | extern void jump_label_dec(struct jump_label_key *key); | ||
52 | extern bool jump_label_enabled(struct jump_label_key *key); | ||
53 | extern void jump_label_apply_nops(struct module *mod); | ||
29 | 54 | ||
30 | #define jump_label_enable(key) \ | 55 | #else |
31 | jump_label_update((unsigned long)key, JUMP_LABEL_ENABLE); | ||
32 | 56 | ||
33 | #define jump_label_disable(key) \ | 57 | #include <asm/atomic.h> |
34 | jump_label_update((unsigned long)key, JUMP_LABEL_DISABLE); | ||
35 | 58 | ||
36 | #else | 59 | #define JUMP_LABEL_INIT {ATOMIC_INIT(0)} |
37 | 60 | ||
38 | #define JUMP_LABEL(key, label) \ | 61 | struct jump_label_key { |
39 | do { \ | 62 | atomic_t enabled; |
40 | if (unlikely(*key)) \ | 63 | }; |
41 | goto label; \ | ||
42 | } while (0) | ||
43 | 64 | ||
44 | #define jump_label_enable(cond_var) \ | 65 | static __always_inline bool static_branch(struct jump_label_key *key) |
45 | do { \ | 66 | { |
46 | *(cond_var) = 1; \ | 67 | if (unlikely(atomic_read(&key->enabled))) |
47 | } while (0) | 68 | return true; |
69 | return false; | ||
70 | } | ||
48 | 71 | ||
49 | #define jump_label_disable(cond_var) \ | 72 | static inline void jump_label_inc(struct jump_label_key *key) |
50 | do { \ | 73 | { |
51 | *(cond_var) = 0; \ | 74 | atomic_inc(&key->enabled); |
52 | } while (0) | 75 | } |
53 | 76 | ||
54 | static inline int jump_label_apply_nops(struct module *mod) | 77 | static inline void jump_label_dec(struct jump_label_key *key) |
55 | { | 78 | { |
56 | return 0; | 79 | atomic_dec(&key->enabled); |
57 | } | 80 | } |
58 | 81 | ||
59 | static inline int jump_label_text_reserved(void *start, void *end) | 82 | static inline int jump_label_text_reserved(void *start, void *end) |
@@ -64,16 +87,16 @@ static inline int jump_label_text_reserved(void *start, void *end) | |||
64 | static inline void jump_label_lock(void) {} | 87 | static inline void jump_label_lock(void) {} |
65 | static inline void jump_label_unlock(void) {} | 88 | static inline void jump_label_unlock(void) {} |
66 | 89 | ||
67 | #endif | 90 | static inline bool jump_label_enabled(struct jump_label_key *key) |
91 | { | ||
92 | return !!atomic_read(&key->enabled); | ||
93 | } | ||
68 | 94 | ||
69 | #define COND_STMT(key, stmt) \ | 95 | static inline int jump_label_apply_nops(struct module *mod) |
70 | do { \ | 96 | { |
71 | __label__ jl_enabled; \ | 97 | return 0; |
72 | JUMP_LABEL(key, jl_enabled); \ | 98 | } |
73 | if (0) { \ | 99 | |
74 | jl_enabled: \ | 100 | #endif |
75 | stmt; \ | ||
76 | } \ | ||
77 | } while (0) | ||
78 | 101 | ||
79 | #endif | 102 | #endif |
diff --git a/include/linux/jump_label_ref.h b/include/linux/jump_label_ref.h deleted file mode 100644 index e5d012ad92c6..000000000000 --- a/include/linux/jump_label_ref.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | #ifndef _LINUX_JUMP_LABEL_REF_H | ||
2 | #define _LINUX_JUMP_LABEL_REF_H | ||
3 | |||
4 | #include <linux/jump_label.h> | ||
5 | #include <asm/atomic.h> | ||
6 | |||
7 | #ifdef HAVE_JUMP_LABEL | ||
8 | |||
9 | static inline void jump_label_inc(atomic_t *key) | ||
10 | { | ||
11 | if (atomic_add_return(1, key) == 1) | ||
12 | jump_label_enable(key); | ||
13 | } | ||
14 | |||
15 | static inline void jump_label_dec(atomic_t *key) | ||
16 | { | ||
17 | if (atomic_dec_and_test(key)) | ||
18 | jump_label_disable(key); | ||
19 | } | ||
20 | |||
21 | #else /* !HAVE_JUMP_LABEL */ | ||
22 | |||
23 | static inline void jump_label_inc(atomic_t *key) | ||
24 | { | ||
25 | atomic_inc(key); | ||
26 | } | ||
27 | |||
28 | static inline void jump_label_dec(atomic_t *key) | ||
29 | { | ||
30 | atomic_dec(key); | ||
31 | } | ||
32 | |||
33 | #undef JUMP_LABEL | ||
34 | #define JUMP_LABEL(key, label) \ | ||
35 | do { \ | ||
36 | if (unlikely(__builtin_choose_expr( \ | ||
37 | __builtin_types_compatible_p(typeof(key), atomic_t *), \ | ||
38 | atomic_read((atomic_t *)(key)), *(key)))) \ | ||
39 | goto label; \ | ||
40 | } while (0) | ||
41 | |||
42 | #endif /* HAVE_JUMP_LABEL */ | ||
43 | |||
44 | #endif /* _LINUX_JUMP_LABEL_REF_H */ | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 00cec4dc0ae2..fb0e7329fee1 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -248,6 +248,37 @@ int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); | |||
248 | int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); | 248 | int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); |
249 | int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); | 249 | int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); |
250 | 250 | ||
251 | int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res); | ||
252 | int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res); | ||
253 | int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res); | ||
254 | int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res); | ||
255 | int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res); | ||
256 | int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res); | ||
257 | int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res); | ||
258 | int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res); | ||
259 | int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res); | ||
260 | int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res); | ||
261 | |||
262 | static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res) | ||
263 | { | ||
264 | return kstrtoull_from_user(s, count, base, res); | ||
265 | } | ||
266 | |||
267 | static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res) | ||
268 | { | ||
269 | return kstrtoll_from_user(s, count, base, res); | ||
270 | } | ||
271 | |||
272 | static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res) | ||
273 | { | ||
274 | return kstrtouint_from_user(s, count, base, res); | ||
275 | } | ||
276 | |||
277 | static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res) | ||
278 | { | ||
279 | return kstrtoint_from_user(s, count, base, res); | ||
280 | } | ||
281 | |||
251 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); | 282 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); |
252 | extern long simple_strtol(const char *,char **,unsigned int); | 283 | extern long simple_strtol(const char *,char **,unsigned int); |
253 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 284 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
@@ -283,6 +314,7 @@ extern char *get_options(const char *str, int nints, int *ints); | |||
283 | extern unsigned long long memparse(const char *ptr, char **retptr); | 314 | extern unsigned long long memparse(const char *ptr, char **retptr); |
284 | 315 | ||
285 | extern int core_kernel_text(unsigned long addr); | 316 | extern int core_kernel_text(unsigned long addr); |
317 | extern int core_kernel_data(unsigned long addr); | ||
286 | extern int __kernel_text_address(unsigned long addr); | 318 | extern int __kernel_text_address(unsigned long addr); |
287 | extern int kernel_text_address(unsigned long addr); | 319 | extern int kernel_text_address(unsigned long addr); |
288 | extern int func_ptr_is_kernel_text(void *ptr); | 320 | extern int func_ptr_is_kernel_text(void *ptr); |
@@ -637,6 +669,13 @@ struct sysinfo { | |||
637 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | 669 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
638 | }; | 670 | }; |
639 | 671 | ||
672 | #ifdef __CHECKER__ | ||
673 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | ||
674 | #define BUILD_BUG_ON_ZERO(e) | ||
675 | #define BUILD_BUG_ON_NULL(e) | ||
676 | #define BUILD_BUG_ON(condition) | ||
677 | #else /* __CHECKER__ */ | ||
678 | |||
640 | /* Force a compilation error if a constant expression is not a power of 2 */ | 679 | /* Force a compilation error if a constant expression is not a power of 2 */ |
641 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | 680 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ |
642 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | 681 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) |
@@ -673,6 +712,7 @@ extern int __build_bug_on_failed; | |||
673 | if (condition) __build_bug_on_failed = 1; \ | 712 | if (condition) __build_bug_on_failed = 1; \ |
674 | } while(0) | 713 | } while(0) |
675 | #endif | 714 | #endif |
715 | #endif /* __CHECKER__ */ | ||
676 | 716 | ||
677 | /* Trap pasters of __FUNCTION__ at compile-time */ | 717 | /* Trap pasters of __FUNCTION__ at compile-time */ |
678 | #define __FUNCTION__ (__func__) | 718 | #define __FUNCTION__ (__func__) |
diff --git a/include/linux/key.h b/include/linux/key.h index b2bb01719561..6ea4eebd3467 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | * | 10 | * |
11 | * | 11 | * |
12 | * See Documentation/keys.txt for information on keys/keyrings. | 12 | * See Documentation/security/keys.txt for information on keys/keyrings. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef _LINUX_KEY_H | 15 | #ifndef _LINUX_KEY_H |
@@ -276,6 +276,19 @@ static inline key_serial_t key_serial(struct key *key) | |||
276 | return key ? key->serial : 0; | 276 | return key ? key->serial : 0; |
277 | } | 277 | } |
278 | 278 | ||
279 | /** | ||
280 | * key_is_instantiated - Determine if a key has been positively instantiated | ||
281 | * @key: The key to check. | ||
282 | * | ||
283 | * Return true if the specified key has been positively instantiated, false | ||
284 | * otherwise. | ||
285 | */ | ||
286 | static inline bool key_is_instantiated(const struct key *key) | ||
287 | { | ||
288 | return test_bit(KEY_FLAG_INSTANTIATED, &key->flags) && | ||
289 | !test_bit(KEY_FLAG_NEGATIVE, &key->flags); | ||
290 | } | ||
291 | |||
279 | #define rcu_dereference_key(KEY) \ | 292 | #define rcu_dereference_key(KEY) \ |
280 | (rcu_dereference_protected((KEY)->payload.rcudata, \ | 293 | (rcu_dereference_protected((KEY)->payload.rcudata, \ |
281 | rwsem_is_locked(&((struct key *)(KEY))->sem))) | 294 | rwsem_is_locked(&((struct key *)(KEY))->sem))) |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 6efd7a78de6a..d4a5c84c503d 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/compiler.h> | 25 | #include <linux/compiler.h> |
26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
27 | #include <linux/sysctl.h> | ||
27 | 28 | ||
28 | #define KMOD_PATH_LEN 256 | 29 | #define KMOD_PATH_LEN 256 |
29 | 30 | ||
@@ -109,9 +110,12 @@ call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) | |||
109 | NULL, NULL, NULL); | 110 | NULL, NULL, NULL); |
110 | } | 111 | } |
111 | 112 | ||
113 | extern struct ctl_table usermodehelper_table[]; | ||
114 | |||
112 | extern void usermodehelper_init(void); | 115 | extern void usermodehelper_init(void); |
113 | 116 | ||
114 | extern int usermodehelper_disable(void); | 117 | extern int usermodehelper_disable(void); |
115 | extern void usermodehelper_enable(void); | 118 | extern void usermodehelper_enable(void); |
119 | extern bool usermodehelper_is_disabled(void); | ||
116 | 120 | ||
117 | #endif /* __LINUX_KMOD_H__ */ | 121 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index ea2dc1a2e13d..55ef181521ff 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -541,6 +541,9 @@ struct kvm_ppc_pvinfo { | |||
541 | #define KVM_CAP_PPC_GET_PVINFO 57 | 541 | #define KVM_CAP_PPC_GET_PVINFO 57 |
542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 | 542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 |
543 | #define KVM_CAP_ASYNC_PF 59 | 543 | #define KVM_CAP_ASYNC_PF 59 |
544 | #define KVM_CAP_TSC_CONTROL 60 | ||
545 | #define KVM_CAP_GET_TSC_KHZ 61 | ||
546 | #define KVM_CAP_PPC_BOOKE_SREGS 62 | ||
544 | 547 | ||
545 | #ifdef KVM_CAP_IRQ_ROUTING | 548 | #ifdef KVM_CAP_IRQ_ROUTING |
546 | 549 | ||
@@ -677,6 +680,9 @@ struct kvm_clock_data { | |||
677 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) | 680 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) |
678 | /* Available with KVM_CAP_PPC_GET_PVINFO */ | 681 | /* Available with KVM_CAP_PPC_GET_PVINFO */ |
679 | #define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo) | 682 | #define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo) |
683 | /* Available with KVM_CAP_TSC_CONTROL */ | ||
684 | #define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2) | ||
685 | #define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3) | ||
680 | 686 | ||
681 | /* | 687 | /* |
682 | * ioctls for vcpu fds | 688 | * ioctls for vcpu fds |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ab428552af8e..31ebb59cbd2f 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -27,6 +27,10 @@ | |||
27 | 27 | ||
28 | #include <asm/kvm_host.h> | 28 | #include <asm/kvm_host.h> |
29 | 29 | ||
30 | #ifndef KVM_MMIO_SIZE | ||
31 | #define KVM_MMIO_SIZE 8 | ||
32 | #endif | ||
33 | |||
30 | /* | 34 | /* |
31 | * vcpu->requests bit members | 35 | * vcpu->requests bit members |
32 | */ | 36 | */ |
@@ -43,7 +47,6 @@ | |||
43 | #define KVM_REQ_DEACTIVATE_FPU 10 | 47 | #define KVM_REQ_DEACTIVATE_FPU 10 |
44 | #define KVM_REQ_EVENT 11 | 48 | #define KVM_REQ_EVENT 11 |
45 | #define KVM_REQ_APF_HALT 12 | 49 | #define KVM_REQ_APF_HALT 12 |
46 | #define KVM_REQ_NMI 13 | ||
47 | 50 | ||
48 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 51 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
49 | 52 | ||
@@ -133,7 +136,8 @@ struct kvm_vcpu { | |||
133 | int mmio_read_completed; | 136 | int mmio_read_completed; |
134 | int mmio_is_write; | 137 | int mmio_is_write; |
135 | int mmio_size; | 138 | int mmio_size; |
136 | unsigned char mmio_data[8]; | 139 | int mmio_index; |
140 | unsigned char mmio_data[KVM_MMIO_SIZE]; | ||
137 | gpa_t mmio_phys_addr; | 141 | gpa_t mmio_phys_addr; |
138 | #endif | 142 | #endif |
139 | 143 | ||
@@ -292,9 +296,10 @@ static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | |||
292 | } | 296 | } |
293 | 297 | ||
294 | #define kvm_for_each_vcpu(idx, vcpup, kvm) \ | 298 | #define kvm_for_each_vcpu(idx, vcpup, kvm) \ |
295 | for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \ | 299 | for (idx = 0; \ |
296 | idx < atomic_read(&kvm->online_vcpus) && vcpup; \ | 300 | idx < atomic_read(&kvm->online_vcpus) && \ |
297 | vcpup = kvm_get_vcpu(kvm, ++idx)) | 301 | (vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \ |
302 | idx++) | ||
298 | 303 | ||
299 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 304 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
300 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 305 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
@@ -365,7 +370,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | |||
365 | bool *writable); | 370 | bool *writable); |
366 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 371 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
367 | struct kvm_memory_slot *slot, gfn_t gfn); | 372 | struct kvm_memory_slot *slot, gfn_t gfn); |
368 | int memslot_id(struct kvm *kvm, gfn_t gfn); | ||
369 | void kvm_release_pfn_dirty(pfn_t); | 373 | void kvm_release_pfn_dirty(pfn_t); |
370 | void kvm_release_pfn_clean(pfn_t pfn); | 374 | void kvm_release_pfn_clean(pfn_t pfn); |
371 | void kvm_set_pfn_dirty(pfn_t pfn); | 375 | void kvm_set_pfn_dirty(pfn_t pfn); |
@@ -513,6 +517,7 @@ struct kvm_assigned_dev_kernel { | |||
513 | struct kvm *kvm; | 517 | struct kvm *kvm; |
514 | spinlock_t intx_lock; | 518 | spinlock_t intx_lock; |
515 | char irq_name[32]; | 519 | char irq_name[32]; |
520 | struct pci_saved_state *pci_saved_state; | ||
516 | }; | 521 | }; |
517 | 522 | ||
518 | struct kvm_irq_mask_notifier { | 523 | struct kvm_irq_mask_notifier { |
@@ -587,8 +592,17 @@ static inline int kvm_deassign_device(struct kvm *kvm, | |||
587 | 592 | ||
588 | static inline void kvm_guest_enter(void) | 593 | static inline void kvm_guest_enter(void) |
589 | { | 594 | { |
595 | BUG_ON(preemptible()); | ||
590 | account_system_vtime(current); | 596 | account_system_vtime(current); |
591 | current->flags |= PF_VCPU; | 597 | current->flags |= PF_VCPU; |
598 | /* KVM does not hold any references to rcu protected data when it | ||
599 | * switches CPU into a guest mode. In fact switching to a guest mode | ||
600 | * is very similar to exiting to userspase from rcu point of view. In | ||
601 | * addition CPU may stay in a guest mode for quite a long time (up to | ||
602 | * one time slice). Lets treat guest mode as quiescent state, just like | ||
603 | * we do with user-mode execution. | ||
604 | */ | ||
605 | rcu_virt_note_context_switch(smp_processor_id()); | ||
592 | } | 606 | } |
593 | 607 | ||
594 | static inline void kvm_guest_exit(void) | 608 | static inline void kvm_guest_exit(void) |
@@ -597,6 +611,11 @@ static inline void kvm_guest_exit(void) | |||
597 | current->flags &= ~PF_VCPU; | 611 | current->flags &= ~PF_VCPU; |
598 | } | 612 | } |
599 | 613 | ||
614 | static inline int memslot_id(struct kvm *kvm, gfn_t gfn) | ||
615 | { | ||
616 | return gfn_to_memslot(kvm, gfn)->id; | ||
617 | } | ||
618 | |||
600 | static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, | 619 | static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, |
601 | gfn_t gfn) | 620 | gfn_t gfn) |
602 | { | 621 | { |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index f158eb1149aa..b8d6fffed4d8 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -25,7 +25,7 @@ enum pca9532_state { | |||
25 | }; | 25 | }; |
26 | 26 | ||
27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, | 27 | enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED, |
28 | PCA9532_TYPE_N2100_BEEP }; | 28 | PCA9532_TYPE_N2100_BEEP, PCA9532_TYPE_GPIO }; |
29 | 29 | ||
30 | struct pca9532_led { | 30 | struct pca9532_led { |
31 | u8 id; | 31 | u8 id; |
@@ -41,6 +41,7 @@ struct pca9532_platform_data { | |||
41 | struct pca9532_led leds[16]; | 41 | struct pca9532_led leds[16]; |
42 | u8 pwm[2]; | 42 | u8 pwm[2]; |
43 | u8 psc[2]; | 43 | u8 psc[2]; |
44 | int gpio_base; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif /* __LINUX_PCA9532_H */ | 47 | #endif /* __LINUX_PCA9532_H */ |
diff --git a/include/linux/leds-regulator.h b/include/linux/leds-regulator.h index 5a8eb389aab8..e2337a8c90b0 100644 --- a/include/linux/leds-regulator.h +++ b/include/linux/leds-regulator.h | |||
@@ -16,7 +16,7 @@ | |||
16 | * Use "vled" as supply id when declaring the regulator consumer: | 16 | * Use "vled" as supply id when declaring the regulator consumer: |
17 | * | 17 | * |
18 | * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { | 18 | * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { |
19 | * { .dev_name = "leds-regulator.0", supply = "vled" }, | 19 | * { .dev_name = "leds-regulator.0", .supply = "vled" }, |
20 | * }; | 20 | * }; |
21 | * | 21 | * |
22 | * If you have several regulator driven LEDs, you can append a numerical id to | 22 | * If you have several regulator driven LEDs, you can append a numerical id to |
diff --git a/include/linux/leds.h b/include/linux/leds.h index 61e0340a4b77..5884def15a24 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -207,5 +207,7 @@ struct gpio_led_platform_data { | |||
207 | unsigned long *delay_off); | 207 | unsigned long *delay_off); |
208 | }; | 208 | }; |
209 | 209 | ||
210 | struct platform_device *gpio_led_register_device( | ||
211 | int id, const struct gpio_led_platform_data *pdata); | ||
210 | 212 | ||
211 | #endif /* __LINUX_LEDS_H_INCLUDED */ | 213 | #endif /* __LINUX_LEDS_H_INCLUDED */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 04f32a3eb26b..5a9926b34072 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1151,6 +1151,7 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
1151 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | 1151 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, |
1152 | ata_postreset_fn_t postreset); | 1152 | ata_postreset_fn_t postreset); |
1153 | extern void ata_std_error_handler(struct ata_port *ap); | 1153 | extern void ata_std_error_handler(struct ata_port *ap); |
1154 | extern int ata_link_nr_enabled(struct ata_link *link); | ||
1154 | 1155 | ||
1155 | /* | 1156 | /* |
1156 | * Base operations to inherit from and initializers for sht | 1157 | * Base operations to inherit from and initializers for sht |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 7135ebc8428c..3f46aedea42f 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -14,10 +14,6 @@ | |||
14 | #define asmlinkage CPP_ASMLINKAGE | 14 | #define asmlinkage CPP_ASMLINKAGE |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | #ifndef asmregparm | ||
18 | # define asmregparm | ||
19 | #endif | ||
20 | |||
21 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) | 17 | #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) |
22 | #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) | 18 | #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) |
23 | 19 | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 3a54266a1e85..cc6d2aa6b415 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/poison.h> | 6 | #include <linux/poison.h> |
7 | #include <linux/prefetch.h> | 7 | #include <linux/const.h> |
8 | 8 | ||
9 | /* | 9 | /* |
10 | * Simple doubly linked list implementation. | 10 | * Simple doubly linked list implementation. |
@@ -367,18 +367,15 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
367 | * @head: the head for your list. | 367 | * @head: the head for your list. |
368 | */ | 368 | */ |
369 | #define list_for_each(pos, head) \ | 369 | #define list_for_each(pos, head) \ |
370 | for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | 370 | for (pos = (head)->next; pos != (head); pos = pos->next) |
371 | pos = pos->next) | ||
372 | 371 | ||
373 | /** | 372 | /** |
374 | * __list_for_each - iterate over a list | 373 | * __list_for_each - iterate over a list |
375 | * @pos: the &struct list_head to use as a loop cursor. | 374 | * @pos: the &struct list_head to use as a loop cursor. |
376 | * @head: the head for your list. | 375 | * @head: the head for your list. |
377 | * | 376 | * |
378 | * This variant differs from list_for_each() in that it's the | 377 | * This variant doesn't differ from list_for_each() any more. |
379 | * simplest possible list iteration code, no prefetching is done. | 378 | * We don't do prefetching in either case. |
380 | * Use this for code that knows the list to be very short (empty | ||
381 | * or 1 entry) most of the time. | ||
382 | */ | 379 | */ |
383 | #define __list_for_each(pos, head) \ | 380 | #define __list_for_each(pos, head) \ |
384 | for (pos = (head)->next; pos != (head); pos = pos->next) | 381 | for (pos = (head)->next; pos != (head); pos = pos->next) |
@@ -389,8 +386,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
389 | * @head: the head for your list. | 386 | * @head: the head for your list. |
390 | */ | 387 | */ |
391 | #define list_for_each_prev(pos, head) \ | 388 | #define list_for_each_prev(pos, head) \ |
392 | for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ | 389 | for (pos = (head)->prev; pos != (head); pos = pos->prev) |
393 | pos = pos->prev) | ||
394 | 390 | ||
395 | /** | 391 | /** |
396 | * list_for_each_safe - iterate over a list safe against removal of list entry | 392 | * list_for_each_safe - iterate over a list safe against removal of list entry |
@@ -410,7 +406,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
410 | */ | 406 | */ |
411 | #define list_for_each_prev_safe(pos, n, head) \ | 407 | #define list_for_each_prev_safe(pos, n, head) \ |
412 | for (pos = (head)->prev, n = pos->prev; \ | 408 | for (pos = (head)->prev, n = pos->prev; \ |
413 | prefetch(pos->prev), pos != (head); \ | 409 | pos != (head); \ |
414 | pos = n, n = pos->prev) | 410 | pos = n, n = pos->prev) |
415 | 411 | ||
416 | /** | 412 | /** |
@@ -421,7 +417,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
421 | */ | 417 | */ |
422 | #define list_for_each_entry(pos, head, member) \ | 418 | #define list_for_each_entry(pos, head, member) \ |
423 | for (pos = list_entry((head)->next, typeof(*pos), member); \ | 419 | for (pos = list_entry((head)->next, typeof(*pos), member); \ |
424 | prefetch(pos->member.next), &pos->member != (head); \ | 420 | &pos->member != (head); \ |
425 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 421 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
426 | 422 | ||
427 | /** | 423 | /** |
@@ -432,7 +428,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
432 | */ | 428 | */ |
433 | #define list_for_each_entry_reverse(pos, head, member) \ | 429 | #define list_for_each_entry_reverse(pos, head, member) \ |
434 | for (pos = list_entry((head)->prev, typeof(*pos), member); \ | 430 | for (pos = list_entry((head)->prev, typeof(*pos), member); \ |
435 | prefetch(pos->member.prev), &pos->member != (head); \ | 431 | &pos->member != (head); \ |
436 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 432 | pos = list_entry(pos->member.prev, typeof(*pos), member)) |
437 | 433 | ||
438 | /** | 434 | /** |
@@ -457,7 +453,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
457 | */ | 453 | */ |
458 | #define list_for_each_entry_continue(pos, head, member) \ | 454 | #define list_for_each_entry_continue(pos, head, member) \ |
459 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | 455 | for (pos = list_entry(pos->member.next, typeof(*pos), member); \ |
460 | prefetch(pos->member.next), &pos->member != (head); \ | 456 | &pos->member != (head); \ |
461 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 457 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
462 | 458 | ||
463 | /** | 459 | /** |
@@ -471,7 +467,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
471 | */ | 467 | */ |
472 | #define list_for_each_entry_continue_reverse(pos, head, member) \ | 468 | #define list_for_each_entry_continue_reverse(pos, head, member) \ |
473 | for (pos = list_entry(pos->member.prev, typeof(*pos), member); \ | 469 | for (pos = list_entry(pos->member.prev, typeof(*pos), member); \ |
474 | prefetch(pos->member.prev), &pos->member != (head); \ | 470 | &pos->member != (head); \ |
475 | pos = list_entry(pos->member.prev, typeof(*pos), member)) | 471 | pos = list_entry(pos->member.prev, typeof(*pos), member)) |
476 | 472 | ||
477 | /** | 473 | /** |
@@ -483,7 +479,7 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
483 | * Iterate over list of given type, continuing from current position. | 479 | * Iterate over list of given type, continuing from current position. |
484 | */ | 480 | */ |
485 | #define list_for_each_entry_from(pos, head, member) \ | 481 | #define list_for_each_entry_from(pos, head, member) \ |
486 | for (; prefetch(pos->member.next), &pos->member != (head); \ | 482 | for (; &pos->member != (head); \ |
487 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 483 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
488 | 484 | ||
489 | /** | 485 | /** |
@@ -664,8 +660,7 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
664 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) | 660 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) |
665 | 661 | ||
666 | #define hlist_for_each(pos, head) \ | 662 | #define hlist_for_each(pos, head) \ |
667 | for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \ | 663 | for (pos = (head)->first; pos ; pos = pos->next) |
668 | pos = pos->next) | ||
669 | 664 | ||
670 | #define hlist_for_each_safe(pos, n, head) \ | 665 | #define hlist_for_each_safe(pos, n, head) \ |
671 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | 666 | for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ |
@@ -680,7 +675,7 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
680 | */ | 675 | */ |
681 | #define hlist_for_each_entry(tpos, pos, head, member) \ | 676 | #define hlist_for_each_entry(tpos, pos, head, member) \ |
682 | for (pos = (head)->first; \ | 677 | for (pos = (head)->first; \ |
683 | pos && ({ prefetch(pos->next); 1;}) && \ | 678 | pos && \ |
684 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 679 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ |
685 | pos = pos->next) | 680 | pos = pos->next) |
686 | 681 | ||
@@ -692,7 +687,7 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
692 | */ | 687 | */ |
693 | #define hlist_for_each_entry_continue(tpos, pos, member) \ | 688 | #define hlist_for_each_entry_continue(tpos, pos, member) \ |
694 | for (pos = (pos)->next; \ | 689 | for (pos = (pos)->next; \ |
695 | pos && ({ prefetch(pos->next); 1;}) && \ | 690 | pos && \ |
696 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 691 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ |
697 | pos = pos->next) | 692 | pos = pos->next) |
698 | 693 | ||
@@ -703,7 +698,7 @@ static inline void hlist_move_list(struct hlist_head *old, | |||
703 | * @member: the name of the hlist_node within the struct. | 698 | * @member: the name of the hlist_node within the struct. |
704 | */ | 699 | */ |
705 | #define hlist_for_each_entry_from(tpos, pos, member) \ | 700 | #define hlist_for_each_entry_from(tpos, pos, member) \ |
706 | for (; pos && ({ prefetch(pos->next); 1;}) && \ | 701 | for (; pos && \ |
707 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | 702 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ |
708 | pos = pos->next) | 703 | pos = pos->next) |
709 | 704 | ||
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 4aef1dda6406..ef820a3c378b 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -487,12 +487,15 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
487 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 487 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
488 | # ifdef CONFIG_PROVE_LOCKING | 488 | # ifdef CONFIG_PROVE_LOCKING |
489 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) | 489 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) |
490 | # define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) | ||
490 | # else | 491 | # else |
491 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) | 492 | # define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) |
493 | # define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i) | ||
492 | # endif | 494 | # endif |
493 | # define mutex_release(l, n, i) lock_release(l, n, i) | 495 | # define mutex_release(l, n, i) lock_release(l, n, i) |
494 | #else | 496 | #else |
495 | # define mutex_acquire(l, s, t, i) do { } while (0) | 497 | # define mutex_acquire(l, s, t, i) do { } while (0) |
498 | # define mutex_acquire_nest(l, s, t, n, i) do { } while (0) | ||
496 | # define mutex_release(l, n, i) do { } while (0) | 499 | # define mutex_release(l, n, i) do { } while (0) |
497 | #endif | 500 | #endif |
498 | 501 | ||
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h index 6a4fab7c6e09..7a71ffad037c 100644 --- a/include/linux/lru_cache.h +++ b/include/linux/lru_cache.h | |||
@@ -139,9 +139,9 @@ write intent log information, three of which are mentioned here. | |||
139 | * .list is on one of three lists: | 139 | * .list is on one of three lists: |
140 | * in_use: currently in use (refcnt > 0, lc_number != LC_FREE) | 140 | * in_use: currently in use (refcnt > 0, lc_number != LC_FREE) |
141 | * lru: unused but ready to be reused or recycled | 141 | * lru: unused but ready to be reused or recycled |
142 | * (ts_refcnt == 0, lc_number != LC_FREE), | 142 | * (lc_refcnt == 0, lc_number != LC_FREE), |
143 | * free: unused but ready to be recycled | 143 | * free: unused but ready to be recycled |
144 | * (ts_refcnt == 0, lc_number == LC_FREE), | 144 | * (lc_refcnt == 0, lc_number == LC_FREE), |
145 | * | 145 | * |
146 | * an element is said to be "in the active set", | 146 | * an element is said to be "in the active set", |
147 | * if either on "in_use" or "lru", i.e. lc_number != LC_FREE. | 147 | * if either on "in_use" or "lru", i.e. lc_number != LC_FREE. |
@@ -160,8 +160,8 @@ struct lc_element { | |||
160 | struct hlist_node colision; | 160 | struct hlist_node colision; |
161 | struct list_head list; /* LRU list or free list */ | 161 | struct list_head list; /* LRU list or free list */ |
162 | unsigned refcnt; | 162 | unsigned refcnt; |
163 | /* back "pointer" into ts_cache->element[index], | 163 | /* back "pointer" into lc_cache->element[index], |
164 | * for paranoia, and for "ts_element_to_index" */ | 164 | * for paranoia, and for "lc_element_to_index" */ |
165 | unsigned lc_index; | 165 | unsigned lc_index; |
166 | /* if we want to track a larger set of objects, | 166 | /* if we want to track a larger set of objects, |
167 | * it needs to become arch independend u64 */ | 167 | * it needs to become arch independend u64 */ |
@@ -190,8 +190,8 @@ struct lru_cache { | |||
190 | /* Arbitrary limit on maximum tracked objects. Practical limit is much | 190 | /* Arbitrary limit on maximum tracked objects. Practical limit is much |
191 | * lower due to allocation failures, probably. For typical use cases, | 191 | * lower due to allocation failures, probably. For typical use cases, |
192 | * nr_elements should be a few thousand at most. | 192 | * nr_elements should be a few thousand at most. |
193 | * This also limits the maximum value of ts_element.ts_index, allowing the | 193 | * This also limits the maximum value of lc_element.lc_index, allowing the |
194 | * 8 high bits of .ts_index to be overloaded with flags in the future. */ | 194 | * 8 high bits of .lc_index to be overloaded with flags in the future. */ |
195 | #define LC_MAX_ACTIVE (1<<24) | 195 | #define LC_MAX_ACTIVE (1<<24) |
196 | 196 | ||
197 | /* statistics */ | 197 | /* statistics */ |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 62a10c2a11f2..7525e38c434d 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _LINUX_MEMBLOCK_H | 2 | #define _LINUX_MEMBLOCK_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #define MEMBLOCK_ERROR 0 | ||
6 | |||
5 | #ifdef CONFIG_HAVE_MEMBLOCK | 7 | #ifdef CONFIG_HAVE_MEMBLOCK |
6 | /* | 8 | /* |
7 | * Logical memory blocks. | 9 | * Logical memory blocks. |
@@ -20,7 +22,6 @@ | |||
20 | #include <asm/memblock.h> | 22 | #include <asm/memblock.h> |
21 | 23 | ||
22 | #define INIT_MEMBLOCK_REGIONS 128 | 24 | #define INIT_MEMBLOCK_REGIONS 128 |
23 | #define MEMBLOCK_ERROR 0 | ||
24 | 25 | ||
25 | struct memblock_region { | 26 | struct memblock_region { |
26 | phys_addr_t base; | 27 | phys_addr_t base; |
@@ -160,6 +161,12 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo | |||
160 | #define __initdata_memblock | 161 | #define __initdata_memblock |
161 | #endif | 162 | #endif |
162 | 163 | ||
164 | #else | ||
165 | static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align) | ||
166 | { | ||
167 | return MEMBLOCK_ERROR; | ||
168 | } | ||
169 | |||
163 | #endif /* CONFIG_HAVE_MEMBLOCK */ | 170 | #endif /* CONFIG_HAVE_MEMBLOCK */ |
164 | 171 | ||
165 | #endif /* __KERNEL__ */ | 172 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5e9840f50980..9724a38ee69d 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _LINUX_MEMCONTROL_H | 20 | #ifndef _LINUX_MEMCONTROL_H |
21 | #define _LINUX_MEMCONTROL_H | 21 | #define _LINUX_MEMCONTROL_H |
22 | #include <linux/cgroup.h> | 22 | #include <linux/cgroup.h> |
23 | #include <linux/vm_event_item.h> | ||
24 | |||
23 | struct mem_cgroup; | 25 | struct mem_cgroup; |
24 | struct page_cgroup; | 26 | struct page_cgroup; |
25 | struct page; | 27 | struct page; |
@@ -106,9 +108,10 @@ extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | |||
106 | */ | 108 | */ |
107 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 109 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); |
108 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 110 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); |
109 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 111 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
110 | struct zone *zone, | 112 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
111 | enum lru_list lru); | 113 | struct zone *zone, |
114 | enum lru_list lru); | ||
112 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | 115 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, |
113 | struct zone *zone); | 116 | struct zone *zone); |
114 | struct zone_reclaim_stat* | 117 | struct zone_reclaim_stat* |
@@ -144,9 +147,11 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
144 | } | 147 | } |
145 | 148 | ||
146 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 149 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
147 | gfp_t gfp_mask); | 150 | gfp_t gfp_mask, |
151 | unsigned long *total_scanned); | ||
148 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 152 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); |
149 | 153 | ||
154 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | ||
150 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 155 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
151 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); | 156 | void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail); |
152 | #endif | 157 | #endif |
@@ -302,8 +307,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | |||
302 | } | 307 | } |
303 | 308 | ||
304 | static inline unsigned long | 309 | static inline unsigned long |
305 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | 310 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, |
306 | enum lru_list lru) | 311 | enum lru_list lru) |
307 | { | 312 | { |
308 | return 0; | 313 | return 0; |
309 | } | 314 | } |
@@ -338,7 +343,8 @@ static inline void mem_cgroup_dec_page_stat(struct page *page, | |||
338 | 343 | ||
339 | static inline | 344 | static inline |
340 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 345 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
341 | gfp_t gfp_mask) | 346 | gfp_t gfp_mask, |
347 | unsigned long *total_scanned) | ||
342 | { | 348 | { |
343 | return 0; | 349 | return 0; |
344 | } | 350 | } |
@@ -354,6 +360,10 @@ static inline void mem_cgroup_split_huge_fixup(struct page *head, | |||
354 | { | 360 | { |
355 | } | 361 | } |
356 | 362 | ||
363 | static inline | ||
364 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) | ||
365 | { | ||
366 | } | ||
357 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 367 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
358 | 368 | ||
359 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) | 369 | #if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 31ac26ca4acf..7978eec1b7d9 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -199,6 +199,9 @@ void mpol_free_shared_policy(struct shared_policy *p); | |||
199 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | 199 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, |
200 | unsigned long idx); | 200 | unsigned long idx); |
201 | 201 | ||
202 | struct mempolicy *get_vma_policy(struct task_struct *tsk, | ||
203 | struct vm_area_struct *vma, unsigned long addr); | ||
204 | |||
202 | extern void numa_default_policy(void); | 205 | extern void numa_default_policy(void); |
203 | extern void numa_policy_init(void); | 206 | extern void numa_policy_init(void); |
204 | extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, | 207 | extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, |
@@ -228,10 +231,10 @@ int do_migrate_pages(struct mm_struct *mm, | |||
228 | 231 | ||
229 | #ifdef CONFIG_TMPFS | 232 | #ifdef CONFIG_TMPFS |
230 | extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); | 233 | extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); |
234 | #endif | ||
231 | 235 | ||
232 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 236 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
233 | int no_context); | 237 | int no_context); |
234 | #endif | ||
235 | 238 | ||
236 | /* Check if a vma is migratable */ | 239 | /* Check if a vma is migratable */ |
237 | static inline int vma_migratable(struct vm_area_struct *vma) | 240 | static inline int vma_migratable(struct vm_area_struct *vma) |
@@ -368,13 +371,13 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol, | |||
368 | { | 371 | { |
369 | return 1; /* error */ | 372 | return 1; /* error */ |
370 | } | 373 | } |
374 | #endif | ||
371 | 375 | ||
372 | static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 376 | static inline int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
373 | int no_context) | 377 | int no_context) |
374 | { | 378 | { |
375 | return 0; | 379 | return 0; |
376 | } | 380 | } |
377 | #endif | ||
378 | 381 | ||
379 | #endif /* CONFIG_NUMA */ | 382 | #endif /* CONFIG_NUMA */ |
380 | #endif /* __KERNEL__ */ | 383 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index 8fba7972ff5f..63b4fb8e3b6f 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
@@ -330,6 +330,11 @@ struct pm860x_led_pdata { | |||
330 | unsigned long flags; | 330 | unsigned long flags; |
331 | }; | 331 | }; |
332 | 332 | ||
333 | struct pm860x_rtc_pdata { | ||
334 | int (*sync)(unsigned int ticks); | ||
335 | int vrtc; | ||
336 | }; | ||
337 | |||
333 | struct pm860x_touch_pdata { | 338 | struct pm860x_touch_pdata { |
334 | int gpadc_prebias; | 339 | int gpadc_prebias; |
335 | int slot_cycle; | 340 | int slot_cycle; |
@@ -349,6 +354,7 @@ struct pm860x_power_pdata { | |||
349 | struct pm860x_platform_data { | 354 | struct pm860x_platform_data { |
350 | struct pm860x_backlight_pdata *backlight; | 355 | struct pm860x_backlight_pdata *backlight; |
351 | struct pm860x_led_pdata *led; | 356 | struct pm860x_led_pdata *led; |
357 | struct pm860x_rtc_pdata *rtc; | ||
352 | struct pm860x_touch_pdata *touch; | 358 | struct pm860x_touch_pdata *touch; |
353 | struct pm860x_power_pdata *power; | 359 | struct pm860x_power_pdata *power; |
354 | struct regulator_init_data *regulator; | 360 | struct regulator_init_data *regulator; |
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 7d9b6ae1c203..896b5e47f16e 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -34,6 +34,13 @@ | |||
34 | #define AB5500_2_0 0x21 | 34 | #define AB5500_2_0 0x21 |
35 | #define AB5500_2_1 0x22 | 35 | #define AB5500_2_1 0x22 |
36 | 36 | ||
37 | /* AB8500 CIDs*/ | ||
38 | #define AB8500_CUTEARLY 0x00 | ||
39 | #define AB8500_CUT1P0 0x10 | ||
40 | #define AB8500_CUT1P1 0x11 | ||
41 | #define AB8500_CUT2P0 0x20 | ||
42 | #define AB8500_CUT3P0 0x30 | ||
43 | |||
37 | /* | 44 | /* |
38 | * AB3100, EVENTA1, A2 and A3 event register flags | 45 | * AB3100, EVENTA1, A2 and A3 event register flags |
39 | * these are catenated into a single 32-bit flag in the code | 46 | * these are catenated into a single 32-bit flag in the code |
@@ -186,6 +193,7 @@ struct abx500_init_settings { | |||
186 | struct ab3550_platform_data { | 193 | struct ab3550_platform_data { |
187 | struct {unsigned int base; unsigned int count; } irq; | 194 | struct {unsigned int base; unsigned int count; } irq; |
188 | void *dev_data[AB3550_NUM_DEVICES]; | 195 | void *dev_data[AB3550_NUM_DEVICES]; |
196 | size_t dev_data_sz[AB3550_NUM_DEVICES]; | ||
189 | struct abx500_init_settings *init_settings; | 197 | struct abx500_init_settings *init_settings; |
190 | unsigned int init_settings_sz; | 198 | unsigned int init_settings_sz; |
191 | }; | 199 | }; |
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index de3c4ad19afb..ed793b77a1c5 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -16,6 +16,13 @@ | |||
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | struct led_classdev; | ||
20 | struct asic3_led { | ||
21 | const char *name; | ||
22 | const char *default_trigger; | ||
23 | struct led_classdev *cdev; | ||
24 | }; | ||
25 | |||
19 | struct asic3_platform_data { | 26 | struct asic3_platform_data { |
20 | u16 *gpio_config; | 27 | u16 *gpio_config; |
21 | unsigned int gpio_config_num; | 28 | unsigned int gpio_config_num; |
@@ -23,6 +30,8 @@ struct asic3_platform_data { | |||
23 | unsigned int irq_base; | 30 | unsigned int irq_base; |
24 | 31 | ||
25 | unsigned int gpio_base; | 32 | unsigned int gpio_base; |
33 | |||
34 | struct asic3_led *leds; | ||
26 | }; | 35 | }; |
27 | 36 | ||
28 | #define ASIC3_NUM_GPIO_BANKS 4 | 37 | #define ASIC3_NUM_GPIO_BANKS 4 |
@@ -111,9 +120,9 @@ struct asic3_platform_data { | |||
111 | #define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) | 120 | #define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) |
112 | #define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) | 121 | #define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) |
113 | #define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) | 122 | #define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) |
114 | #define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 1, 0) | 123 | #define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 0, 0) |
115 | #define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 1, 0) | 124 | #define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 0, 0) |
116 | #define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 1, 0) | 125 | #define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 0, 0) |
117 | #define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) | 126 | #define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) |
118 | #define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) | 127 | #define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) |
119 | #define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) | 128 | #define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) |
@@ -152,6 +161,7 @@ struct asic3_platform_data { | |||
152 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ | 161 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ |
153 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ | 162 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ |
154 | 163 | ||
164 | #define ASIC3_NUM_LEDS 3 | ||
155 | #define ASIC3_LED_0_Base 0x0700 | 165 | #define ASIC3_LED_0_Base 0x0700 |
156 | #define ASIC3_LED_1_Base 0x0800 | 166 | #define ASIC3_LED_1_Base 0x0800 |
157 | #define ASIC3_LED_2_Base 0x0900 | 167 | #define ASIC3_LED_2_Base 0x0900 |
@@ -287,10 +297,17 @@ struct asic3_platform_data { | |||
287 | * | 297 | * |
288 | *****************************************************************************/ | 298 | *****************************************************************************/ |
289 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ | 299 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ |
300 | #define ASIC3_SD_CONFIG_SIZE 0x0200 /* Assumes 32 bit addressing */ | ||
290 | #define ASIC3_SD_CTRL_BASE 0x1000 | 301 | #define ASIC3_SD_CTRL_BASE 0x1000 |
291 | #define ASIC3_SDIO_CTRL_BASE 0x1200 | 302 | #define ASIC3_SDIO_CTRL_BASE 0x1200 |
292 | 303 | ||
293 | #define ASIC3_MAP_SIZE_32BIT 0x2000 | 304 | #define ASIC3_MAP_SIZE_32BIT 0x2000 |
294 | #define ASIC3_MAP_SIZE_16BIT 0x1000 | 305 | #define ASIC3_MAP_SIZE_16BIT 0x1000 |
295 | 306 | ||
307 | /* Functions needed by leds-asic3 */ | ||
308 | |||
309 | struct asic3; | ||
310 | extern void asic3_write_register(struct asic3 *asic, unsigned int reg, u32 val); | ||
311 | extern u32 asic3_read_register(struct asic3 *asic, unsigned int reg); | ||
312 | |||
296 | #endif /* __ASIC3_H__ */ | 313 | #endif /* __ASIC3_H__ */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index aef23309a742..4e76163dd862 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -33,8 +33,9 @@ struct mfd_cell { | |||
33 | int (*suspend)(struct platform_device *dev); | 33 | int (*suspend)(struct platform_device *dev); |
34 | int (*resume)(struct platform_device *dev); | 34 | int (*resume)(struct platform_device *dev); |
35 | 35 | ||
36 | /* mfd_data can be used to pass data to client drivers */ | 36 | /* platform data passed to the sub devices drivers */ |
37 | void *mfd_data; | 37 | void *platform_data; |
38 | size_t pdata_size; | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * These resources can be specified relative to the parent device. | 41 | * These resources can be specified relative to the parent device. |
@@ -89,24 +90,6 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) | |||
89 | return pdev->mfd_cell; | 90 | return pdev->mfd_cell; |
90 | } | 91 | } |
91 | 92 | ||
92 | /* | ||
93 | * Given a platform device that's been created by mfd_add_devices(), fetch | ||
94 | * the .mfd_data entry from the mfd_cell that created it. | ||
95 | * Otherwise just return the platform_data pointer. | ||
96 | * This maintains compatibility with platform drivers whose devices aren't | ||
97 | * created by the mfd layer, and expect platform_data to contain what would've | ||
98 | * otherwise been in mfd_data. | ||
99 | */ | ||
100 | static inline void *mfd_get_data(struct platform_device *pdev) | ||
101 | { | ||
102 | const struct mfd_cell *cell = mfd_get_cell(pdev); | ||
103 | |||
104 | if (cell) | ||
105 | return cell->mfd_data; | ||
106 | else | ||
107 | return pdev->dev.platform_data; | ||
108 | } | ||
109 | |||
110 | extern int mfd_add_devices(struct device *parent, int id, | 93 | extern int mfd_add_devices(struct device *parent, int id, |
111 | struct mfd_cell *cells, int n_devs, | 94 | struct mfd_cell *cells, int n_devs, |
112 | struct resource *mem_base, | 95 | struct resource *mem_base, |
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h new file mode 100644 index 000000000000..f0977986402c --- /dev/null +++ b/include/linux/mfd/db5500-prcmu.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * U5500 PRCMU API. | ||
7 | */ | ||
8 | #ifndef __MACH_PRCMU_U5500_H | ||
9 | #define __MACH_PRCMU_U5500_H | ||
10 | |||
11 | #ifdef CONFIG_UX500_SOC_DB5500 | ||
12 | |||
13 | void db5500_prcmu_early_init(void); | ||
14 | |||
15 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
16 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
17 | |||
18 | #else /* !CONFIG_UX500_SOC_DB5500 */ | ||
19 | |||
20 | static inline void db5500_prcmu_early_init(void) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
25 | { | ||
26 | return -ENOSYS; | ||
27 | } | ||
28 | |||
29 | static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | ||
30 | { | ||
31 | return -ENOSYS; | ||
32 | } | ||
33 | |||
34 | #endif /* CONFIG_UX500_SOC_DB5500 */ | ||
35 | |||
36 | static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) | ||
37 | { | ||
38 | #ifdef CONFIG_MACH_U5500_SIMULATOR | ||
39 | return 0; | ||
40 | #else | ||
41 | return -1; | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | #endif /* __MACH_PRCMU_U5500_H */ | ||
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h new file mode 100644 index 000000000000..917dbcab701c --- /dev/null +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -0,0 +1,978 @@ | |||
1 | /* | ||
2 | * Copyright (C) STMicroelectronics 2009 | ||
3 | * Copyright (C) ST-Ericsson SA 2010 | ||
4 | * | ||
5 | * License Terms: GNU General Public License v2 | ||
6 | * Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com> | ||
7 | * | ||
8 | * PRCMU f/w APIs | ||
9 | */ | ||
10 | #ifndef __MFD_DB8500_PRCMU_H | ||
11 | #define __MFD_DB8500_PRCMU_H | ||
12 | |||
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/notifier.h> | ||
15 | |||
16 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | ||
17 | |||
18 | /** | ||
19 | * enum state - ON/OFF state definition | ||
20 | * @OFF: State is ON | ||
21 | * @ON: State is OFF | ||
22 | * | ||
23 | */ | ||
24 | enum state { | ||
25 | OFF = 0x0, | ||
26 | ON = 0x1, | ||
27 | }; | ||
28 | |||
29 | /** | ||
30 | * enum ret_state - general purpose On/Off/Retention states | ||
31 | * | ||
32 | */ | ||
33 | enum ret_state { | ||
34 | OFFST = 0, | ||
35 | ONST = 1, | ||
36 | RETST = 2 | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * enum clk_arm - ARM Cortex A9 clock schemes | ||
41 | * @A9_OFF: | ||
42 | * @A9_BOOT: | ||
43 | * @A9_OPPT1: | ||
44 | * @A9_OPPT2: | ||
45 | * @A9_EXTCLK: | ||
46 | */ | ||
47 | enum clk_arm { | ||
48 | A9_OFF, | ||
49 | A9_BOOT, | ||
50 | A9_OPPT1, | ||
51 | A9_OPPT2, | ||
52 | A9_EXTCLK | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * enum clk_gen - GEN#0/GEN#1 clock schemes | ||
57 | * @GEN_OFF: | ||
58 | * @GEN_BOOT: | ||
59 | * @GEN_OPPT1: | ||
60 | */ | ||
61 | enum clk_gen { | ||
62 | GEN_OFF, | ||
63 | GEN_BOOT, | ||
64 | GEN_OPPT1, | ||
65 | }; | ||
66 | |||
67 | /* some information between arm and xp70 */ | ||
68 | |||
69 | /** | ||
70 | * enum romcode_write - Romcode message written by A9 AND read by XP70 | ||
71 | * @RDY_2_DS: Value set when ApDeepSleep state can be executed by XP70 | ||
72 | * @RDY_2_XP70_RST: Value set when 0x0F has been successfully polled by the | ||
73 | * romcode. The xp70 will go into self-reset | ||
74 | */ | ||
75 | enum romcode_write { | ||
76 | RDY_2_DS = 0x09, | ||
77 | RDY_2_XP70_RST = 0x10 | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * enum romcode_read - Romcode message written by XP70 and read by A9 | ||
82 | * @INIT: Init value when romcode field is not used | ||
83 | * @FS_2_DS: Value set when power state is going from ApExecute to | ||
84 | * ApDeepSleep | ||
85 | * @END_DS: Value set when ApDeepSleep power state is reached coming from | ||
86 | * ApExecute state | ||
87 | * @DS_TO_FS: Value set when power state is going from ApDeepSleep to | ||
88 | * ApExecute | ||
89 | * @END_FS: Value set when ApExecute power state is reached coming from | ||
90 | * ApDeepSleep state | ||
91 | * @SWR: Value set when power state is going to ApReset | ||
92 | * @END_SWR: Value set when the xp70 finished executing ApReset actions and | ||
93 | * waits for romcode acknowledgment to go to self-reset | ||
94 | */ | ||
95 | enum romcode_read { | ||
96 | INIT = 0x00, | ||
97 | FS_2_DS = 0x0A, | ||
98 | END_DS = 0x0B, | ||
99 | DS_TO_FS = 0x0C, | ||
100 | END_FS = 0x0D, | ||
101 | SWR = 0x0E, | ||
102 | END_SWR = 0x0F | ||
103 | }; | ||
104 | |||
105 | /** | ||
106 | * enum ap_pwrst - current power states defined in PRCMU firmware | ||
107 | * @NO_PWRST: Current power state init | ||
108 | * @AP_BOOT: Current power state is apBoot | ||
109 | * @AP_EXECUTE: Current power state is apExecute | ||
110 | * @AP_DEEP_SLEEP: Current power state is apDeepSleep | ||
111 | * @AP_SLEEP: Current power state is apSleep | ||
112 | * @AP_IDLE: Current power state is apIdle | ||
113 | * @AP_RESET: Current power state is apReset | ||
114 | */ | ||
115 | enum ap_pwrst { | ||
116 | NO_PWRST = 0x00, | ||
117 | AP_BOOT = 0x01, | ||
118 | AP_EXECUTE = 0x02, | ||
119 | AP_DEEP_SLEEP = 0x03, | ||
120 | AP_SLEEP = 0x04, | ||
121 | AP_IDLE = 0x05, | ||
122 | AP_RESET = 0x06 | ||
123 | }; | ||
124 | |||
125 | /** | ||
126 | * enum ap_pwrst_trans - Transition states defined in PRCMU firmware | ||
127 | * @NO_TRANSITION: No power state transition | ||
128 | * @APEXECUTE_TO_APSLEEP: Power state transition from ApExecute to ApSleep | ||
129 | * @APIDLE_TO_APSLEEP: Power state transition from ApIdle to ApSleep | ||
130 | * @APBOOT_TO_APEXECUTE: Power state transition from ApBoot to ApExecute | ||
131 | * @APEXECUTE_TO_APDEEPSLEEP: Power state transition from ApExecute to | ||
132 | * ApDeepSleep | ||
133 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle | ||
134 | */ | ||
135 | enum ap_pwrst_trans { | ||
136 | NO_TRANSITION = 0x00, | ||
137 | APEXECUTE_TO_APSLEEP = 0x01, | ||
138 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ | ||
139 | PRCMU_AP_SLEEP = 0x01, | ||
140 | APBOOT_TO_APEXECUTE = 0x03, | ||
141 | APEXECUTE_TO_APDEEPSLEEP = 0x04, /* To be removed */ | ||
142 | PRCMU_AP_DEEP_SLEEP = 0x04, | ||
143 | APEXECUTE_TO_APIDLE = 0x05, /* To be removed */ | ||
144 | PRCMU_AP_IDLE = 0x05, | ||
145 | PRCMU_AP_DEEP_IDLE = 0x07, | ||
146 | }; | ||
147 | |||
148 | /** | ||
149 | * enum ddr_pwrst - DDR power states definition | ||
150 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | ||
151 | * @DDR_PWR_STATE_ON: | ||
152 | * @DDR_PWR_STATE_OFFLOWLAT: | ||
153 | * @DDR_PWR_STATE_OFFHIGHLAT: | ||
154 | */ | ||
155 | enum ddr_pwrst { | ||
156 | DDR_PWR_STATE_UNCHANGED = 0x00, | ||
157 | DDR_PWR_STATE_ON = 0x01, | ||
158 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | ||
159 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | ||
160 | }; | ||
161 | |||
162 | /** | ||
163 | * enum arm_opp - ARM OPP states definition | ||
164 | * @ARM_OPP_INIT: | ||
165 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | ||
166 | * @ARM_100_OPP: The new ARM operating point is arm100opp | ||
167 | * @ARM_50_OPP: The new ARM operating point is arm50opp | ||
168 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | ||
169 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | ||
170 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | ||
171 | */ | ||
172 | enum arm_opp { | ||
173 | ARM_OPP_INIT = 0x00, | ||
174 | ARM_NO_CHANGE = 0x01, | ||
175 | ARM_100_OPP = 0x02, | ||
176 | ARM_50_OPP = 0x03, | ||
177 | ARM_MAX_OPP = 0x04, | ||
178 | ARM_MAX_FREQ100OPP = 0x05, | ||
179 | ARM_EXTCLK = 0x07 | ||
180 | }; | ||
181 | |||
182 | /** | ||
183 | * enum ape_opp - APE OPP states definition | ||
184 | * @APE_OPP_INIT: | ||
185 | * @APE_NO_CHANGE: The APE operating point is unchanged | ||
186 | * @APE_100_OPP: The new APE operating point is ape100opp | ||
187 | * @APE_50_OPP: 50% | ||
188 | */ | ||
189 | enum ape_opp { | ||
190 | APE_OPP_INIT = 0x00, | ||
191 | APE_NO_CHANGE = 0x01, | ||
192 | APE_100_OPP = 0x02, | ||
193 | APE_50_OPP = 0x03 | ||
194 | }; | ||
195 | |||
196 | /** | ||
197 | * enum hw_acc_state - State definition for hardware accelerator | ||
198 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged | ||
199 | * @HW_OFF: The hardware accelerator must be switched off | ||
200 | * @HW_OFF_RAMRET: The hardware accelerator must be switched off with its | ||
201 | * internal RAM in retention | ||
202 | * @HW_ON: The hwa hardware accelerator hwa must be switched on | ||
203 | * | ||
204 | * NOTE! Deprecated, to be removed when all users switched over to use the | ||
205 | * regulator API. | ||
206 | */ | ||
207 | enum hw_acc_state { | ||
208 | HW_NO_CHANGE = 0x00, | ||
209 | HW_OFF = 0x01, | ||
210 | HW_OFF_RAMRET = 0x02, | ||
211 | HW_ON = 0x04 | ||
212 | }; | ||
213 | |||
214 | /** | ||
215 | * enum mbox_2_arm_stat - Status messages definition for mbox_arm | ||
216 | * @BOOT_TO_EXECUTEOK: The apBoot to apExecute state transition has been | ||
217 | * completed | ||
218 | * @DEEPSLEEPOK: The apExecute to apDeepSleep state transition has been | ||
219 | * completed | ||
220 | * @SLEEPOK: The apExecute to apSleep state transition has been completed | ||
221 | * @IDLEOK: The apExecute to apIdle state transition has been completed | ||
222 | * @SOFTRESETOK: The A9 watchdog/ SoftReset state has been completed | ||
223 | * @SOFTRESETGO : The A9 watchdog/SoftReset state is on going | ||
224 | * @BOOT_TO_EXECUTE: The apBoot to apExecute state transition is on going | ||
225 | * @EXECUTE_TO_DEEPSLEEP: The apExecute to apDeepSleep state transition is on | ||
226 | * going | ||
227 | * @DEEPSLEEP_TO_EXECUTE: The apDeepSleep to apExecute state transition is on | ||
228 | * going | ||
229 | * @DEEPSLEEP_TO_EXECUTEOK: The apDeepSleep to apExecute state transition has | ||
230 | * been completed | ||
231 | * @EXECUTE_TO_SLEEP: The apExecute to apSleep state transition is on going | ||
232 | * @SLEEP_TO_EXECUTE: The apSleep to apExecute state transition is on going | ||
233 | * @SLEEP_TO_EXECUTEOK: The apSleep to apExecute state transition has been | ||
234 | * completed | ||
235 | * @EXECUTE_TO_IDLE: The apExecute to apIdle state transition is on going | ||
236 | * @IDLE_TO_EXECUTE: The apIdle to apExecute state transition is on going | ||
237 | * @IDLE_TO_EXECUTEOK: The apIdle to apExecute state transition has been | ||
238 | * completed | ||
239 | * @INIT_STATUS: Status init | ||
240 | */ | ||
241 | enum ap_pwrsttr_status { | ||
242 | BOOT_TO_EXECUTEOK = 0xFF, | ||
243 | DEEPSLEEPOK = 0xFE, | ||
244 | SLEEPOK = 0xFD, | ||
245 | IDLEOK = 0xFC, | ||
246 | SOFTRESETOK = 0xFB, | ||
247 | SOFTRESETGO = 0xFA, | ||
248 | BOOT_TO_EXECUTE = 0xF9, | ||
249 | EXECUTE_TO_DEEPSLEEP = 0xF8, | ||
250 | DEEPSLEEP_TO_EXECUTE = 0xF7, | ||
251 | DEEPSLEEP_TO_EXECUTEOK = 0xF6, | ||
252 | EXECUTE_TO_SLEEP = 0xF5, | ||
253 | SLEEP_TO_EXECUTE = 0xF4, | ||
254 | SLEEP_TO_EXECUTEOK = 0xF3, | ||
255 | EXECUTE_TO_IDLE = 0xF2, | ||
256 | IDLE_TO_EXECUTE = 0xF1, | ||
257 | IDLE_TO_EXECUTEOK = 0xF0, | ||
258 | RDYTODS_RETURNTOEXE = 0xEF, | ||
259 | NORDYTODS_RETURNTOEXE = 0xEE, | ||
260 | EXETOSLEEP_RETURNTOEXE = 0xED, | ||
261 | EXETOIDLE_RETURNTOEXE = 0xEC, | ||
262 | INIT_STATUS = 0xEB, | ||
263 | |||
264 | /*error messages */ | ||
265 | INITERROR = 0x00, | ||
266 | PLLARMLOCKP_ER = 0x01, | ||
267 | PLLDDRLOCKP_ER = 0x02, | ||
268 | PLLSOCLOCKP_ER = 0x03, | ||
269 | PLLSOCK1LOCKP_ER = 0x04, | ||
270 | ARMWFI_ER = 0x05, | ||
271 | SYSCLKOK_ER = 0x06, | ||
272 | I2C_NACK_DATA_ER = 0x07, | ||
273 | BOOT_ER = 0x08, | ||
274 | I2C_STATUS_ALWAYS_1 = 0x0A, | ||
275 | I2C_NACK_REG_ADDR_ER = 0x0B, | ||
276 | I2C_NACK_DATA0123_ER = 0x1B, | ||
277 | I2C_NACK_ADDR_ER = 0x1F, | ||
278 | CURAPPWRSTISNOT_BOOT = 0x20, | ||
279 | CURAPPWRSTISNOT_EXECUTE = 0x21, | ||
280 | CURAPPWRSTISNOT_SLEEPMODE = 0x22, | ||
281 | CURAPPWRSTISNOT_CORRECTFORIT10 = 0x23, | ||
282 | FIFO4500WUISNOT_WUPEVENT = 0x24, | ||
283 | PLL32KLOCKP_ER = 0x29, | ||
284 | DDRDEEPSLEEPOK_ER = 0x2A, | ||
285 | ROMCODEREADY_ER = 0x50, | ||
286 | WUPBEFOREDS = 0x51, | ||
287 | DDRCONFIG_ER = 0x52, | ||
288 | WUPBEFORESLEEP = 0x53, | ||
289 | WUPBEFOREIDLE = 0x54 | ||
290 | }; /* earlier called as mbox_2_arm_stat */ | ||
291 | |||
292 | /** | ||
293 | * enum dvfs_stat - DVFS status messages definition | ||
294 | * @DVFS_GO: A state transition DVFS is on going | ||
295 | * @DVFS_ARM100OPPOK: The state transition DVFS has been completed for 100OPP | ||
296 | * @DVFS_ARM50OPPOK: The state transition DVFS has been completed for 50OPP | ||
297 | * @DVFS_ARMEXTCLKOK: The state transition DVFS has been completed for EXTCLK | ||
298 | * @DVFS_NOCHGTCLKOK: The state transition DVFS has been completed for | ||
299 | * NOCHGCLK | ||
300 | * @DVFS_INITSTATUS: Value init | ||
301 | */ | ||
302 | enum dvfs_stat { | ||
303 | DVFS_GO = 0xFF, | ||
304 | DVFS_ARM100OPPOK = 0xFE, | ||
305 | DVFS_ARM50OPPOK = 0xFD, | ||
306 | DVFS_ARMEXTCLKOK = 0xFC, | ||
307 | DVFS_NOCHGTCLKOK = 0xFB, | ||
308 | DVFS_INITSTATUS = 0x00 | ||
309 | }; | ||
310 | |||
311 | /** | ||
312 | * enum sva_mmdsp_stat - SVA MMDSP status messages | ||
313 | * @SVA_MMDSP_GO: SVAMMDSP interrupt has happened | ||
314 | * @SVA_MMDSP_INIT: Status init | ||
315 | */ | ||
316 | enum sva_mmdsp_stat { | ||
317 | SVA_MMDSP_GO = 0xFF, | ||
318 | SVA_MMDSP_INIT = 0x00 | ||
319 | }; | ||
320 | |||
321 | /** | ||
322 | * enum sia_mmdsp_stat - SIA MMDSP status messages | ||
323 | * @SIA_MMDSP_GO: SIAMMDSP interrupt has happened | ||
324 | * @SIA_MMDSP_INIT: Status init | ||
325 | */ | ||
326 | enum sia_mmdsp_stat { | ||
327 | SIA_MMDSP_GO = 0xFF, | ||
328 | SIA_MMDSP_INIT = 0x00 | ||
329 | }; | ||
330 | |||
331 | /** | ||
332 | * enum mbox_to_arm_err - Error messages definition | ||
333 | * @INIT_ERR: Init value | ||
334 | * @PLLARMLOCKP_ERR: PLLARM has not been correctly locked in given time | ||
335 | * @PLLDDRLOCKP_ERR: PLLDDR has not been correctly locked in the given time | ||
336 | * @PLLSOC0LOCKP_ERR: PLLSOC0 has not been correctly locked in the given time | ||
337 | * @PLLSOC1LOCKP_ERR: PLLSOC1 has not been correctly locked in the given time | ||
338 | * @ARMWFI_ERR: The ARM WFI has not been correctly executed in the given time | ||
339 | * @SYSCLKOK_ERR: The SYSCLK is not available in the given time | ||
340 | * @BOOT_ERR: Romcode has not validated the XP70 self reset in the given time | ||
341 | * @ROMCODESAVECONTEXT: The Romcode didn.t correctly save it secure context | ||
342 | * @VARMHIGHSPEEDVALTO_ERR: The ARM high speed supply value transfered | ||
343 | * through I2C has not been correctly executed in the given time | ||
344 | * @VARMHIGHSPEEDACCESS_ERR: The command value of VarmHighSpeedVal transfered | ||
345 | * through I2C has not been correctly executed in the given time | ||
346 | * @VARMLOWSPEEDVALTO_ERR:The ARM low speed supply value transfered through | ||
347 | * I2C has not been correctly executed in the given time | ||
348 | * @VARMLOWSPEEDACCESS_ERR: The command value of VarmLowSpeedVal transfered | ||
349 | * through I2C has not been correctly executed in the given time | ||
350 | * @VARMRETENTIONVALTO_ERR: The ARM retention supply value transfered through | ||
351 | * I2C has not been correctly executed in the given time | ||
352 | * @VARMRETENTIONACCESS_ERR: The command value of VarmRetentionVal transfered | ||
353 | * through I2C has not been correctly executed in the given time | ||
354 | * @VAPEHIGHSPEEDVALTO_ERR: The APE highspeed supply value transfered through | ||
355 | * I2C has not been correctly executed in the given time | ||
356 | * @VSAFEHPVALTO_ERR: The SAFE high power supply value transfered through I2C | ||
357 | * has not been correctly executed in the given time | ||
358 | * @VMODSEL1VALTO_ERR: The MODEM sel1 supply value transfered through I2C has | ||
359 | * not been correctly executed in the given time | ||
360 | * @VMODSEL2VALTO_ERR: The MODEM sel2 supply value transfered through I2C has | ||
361 | * not been correctly executed in the given time | ||
362 | * @VARMOFFACCESS_ERR: The command value of Varm ON/OFF transfered through | ||
363 | * I2C has not been correctly executed in the given time | ||
364 | * @VAPEOFFACCESS_ERR: The command value of Vape ON/OFF transfered through | ||
365 | * I2C has not been correctly executed in the given time | ||
366 | * @VARMRETACCES_ERR: The command value of Varm retention ON/OFF transfered | ||
367 | * through I2C has not been correctly executed in the given time | ||
368 | * @CURAPPWRSTISNOTBOOT:Generated when Arm want to do power state transition | ||
369 | * ApBoot to ApExecute but the power current state is not Apboot | ||
370 | * @CURAPPWRSTISNOTEXECUTE: Generated when Arm want to do power state | ||
371 | * transition from ApExecute to others power state but the | ||
372 | * power current state is not ApExecute | ||
373 | * @CURAPPWRSTISNOTSLEEPMODE: Generated when wake up events are transmitted | ||
374 | * but the power current state is not ApDeepSleep/ApSleep/ApIdle | ||
375 | * @CURAPPWRSTISNOTCORRECTDBG: Generated when wake up events are transmitted | ||
376 | * but the power current state is not correct | ||
377 | * @ARMREGU1VALTO_ERR:The ArmRegu1 value transferred through I2C has not | ||
378 | * been correctly executed in the given time | ||
379 | * @ARMREGU2VALTO_ERR: The ArmRegu2 value transferred through I2C has not | ||
380 | * been correctly executed in the given time | ||
381 | * @VAPEREGUVALTO_ERR: The VApeRegu value transfered through I2C has not | ||
382 | * been correctly executed in the given time | ||
383 | * @VSMPS3REGUVALTO_ERR: The VSmps3Regu value transfered through I2C has not | ||
384 | * been correctly executed in the given time | ||
385 | * @VMODREGUVALTO_ERR: The VModemRegu value transfered through I2C has not | ||
386 | * been correctly executed in the given time | ||
387 | */ | ||
388 | enum mbox_to_arm_err { | ||
389 | INIT_ERR = 0x00, | ||
390 | PLLARMLOCKP_ERR = 0x01, | ||
391 | PLLDDRLOCKP_ERR = 0x02, | ||
392 | PLLSOC0LOCKP_ERR = 0x03, | ||
393 | PLLSOC1LOCKP_ERR = 0x04, | ||
394 | ARMWFI_ERR = 0x05, | ||
395 | SYSCLKOK_ERR = 0x06, | ||
396 | BOOT_ERR = 0x07, | ||
397 | ROMCODESAVECONTEXT = 0x08, | ||
398 | VARMHIGHSPEEDVALTO_ERR = 0x10, | ||
399 | VARMHIGHSPEEDACCESS_ERR = 0x11, | ||
400 | VARMLOWSPEEDVALTO_ERR = 0x12, | ||
401 | VARMLOWSPEEDACCESS_ERR = 0x13, | ||
402 | VARMRETENTIONVALTO_ERR = 0x14, | ||
403 | VARMRETENTIONACCESS_ERR = 0x15, | ||
404 | VAPEHIGHSPEEDVALTO_ERR = 0x16, | ||
405 | VSAFEHPVALTO_ERR = 0x17, | ||
406 | VMODSEL1VALTO_ERR = 0x18, | ||
407 | VMODSEL2VALTO_ERR = 0x19, | ||
408 | VARMOFFACCESS_ERR = 0x1A, | ||
409 | VAPEOFFACCESS_ERR = 0x1B, | ||
410 | VARMRETACCES_ERR = 0x1C, | ||
411 | CURAPPWRSTISNOTBOOT = 0x20, | ||
412 | CURAPPWRSTISNOTEXECUTE = 0x21, | ||
413 | CURAPPWRSTISNOTSLEEPMODE = 0x22, | ||
414 | CURAPPWRSTISNOTCORRECTDBG = 0x23, | ||
415 | ARMREGU1VALTO_ERR = 0x24, | ||
416 | ARMREGU2VALTO_ERR = 0x25, | ||
417 | VAPEREGUVALTO_ERR = 0x26, | ||
418 | VSMPS3REGUVALTO_ERR = 0x27, | ||
419 | VMODREGUVALTO_ERR = 0x28 | ||
420 | }; | ||
421 | |||
422 | enum hw_acc { | ||
423 | SVAMMDSP = 0, | ||
424 | SVAPIPE = 1, | ||
425 | SIAMMDSP = 2, | ||
426 | SIAPIPE = 3, | ||
427 | SGA = 4, | ||
428 | B2R2MCDE = 5, | ||
429 | ESRAM12 = 6, | ||
430 | ESRAM34 = 7, | ||
431 | }; | ||
432 | |||
433 | enum cs_pwrmgt { | ||
434 | PWRDNCS0 = 0, | ||
435 | WKUPCS0 = 1, | ||
436 | PWRDNCS1 = 2, | ||
437 | WKUPCS1 = 3 | ||
438 | }; | ||
439 | |||
440 | /* Defs related to autonomous power management */ | ||
441 | |||
442 | /** | ||
443 | * enum sia_sva_pwr_policy - Power policy | ||
444 | * @NO_CHGT: No change | ||
445 | * @DSPOFF_HWPOFF: | ||
446 | * @DSPOFFRAMRET_HWPOFF: | ||
447 | * @DSPCLKOFF_HWPOFF: | ||
448 | * @DSPCLKOFF_HWPCLKOFF: | ||
449 | * | ||
450 | */ | ||
451 | enum sia_sva_pwr_policy { | ||
452 | NO_CHGT = 0x0, | ||
453 | DSPOFF_HWPOFF = 0x1, | ||
454 | DSPOFFRAMRET_HWPOFF = 0x2, | ||
455 | DSPCLKOFF_HWPOFF = 0x3, | ||
456 | DSPCLKOFF_HWPCLKOFF = 0x4, | ||
457 | }; | ||
458 | |||
459 | /** | ||
460 | * enum auto_enable - Auto Power enable | ||
461 | * @AUTO_OFF: | ||
462 | * @AUTO_ON: | ||
463 | * | ||
464 | */ | ||
465 | enum auto_enable { | ||
466 | AUTO_OFF = 0x0, | ||
467 | AUTO_ON = 0x1, | ||
468 | }; | ||
469 | |||
470 | /* End of file previously known as prcmu-fw-defs_v1.h */ | ||
471 | |||
472 | /* PRCMU Wakeup defines */ | ||
473 | enum prcmu_wakeup_index { | ||
474 | PRCMU_WAKEUP_INDEX_RTC, | ||
475 | PRCMU_WAKEUP_INDEX_RTT0, | ||
476 | PRCMU_WAKEUP_INDEX_RTT1, | ||
477 | PRCMU_WAKEUP_INDEX_HSI0, | ||
478 | PRCMU_WAKEUP_INDEX_HSI1, | ||
479 | PRCMU_WAKEUP_INDEX_USB, | ||
480 | PRCMU_WAKEUP_INDEX_ABB, | ||
481 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | ||
482 | PRCMU_WAKEUP_INDEX_ARM, | ||
483 | NUM_PRCMU_WAKEUP_INDICES | ||
484 | }; | ||
485 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | ||
486 | |||
487 | /* PRCMU QoS APE OPP class */ | ||
488 | #define PRCMU_QOS_APE_OPP 1 | ||
489 | #define PRCMU_QOS_DDR_OPP 2 | ||
490 | #define PRCMU_QOS_DEFAULT_VALUE -1 | ||
491 | |||
492 | /** | ||
493 | * enum hw_acc_dev - enum for hw accelerators | ||
494 | * @HW_ACC_SVAMMDSP: for SVAMMDSP | ||
495 | * @HW_ACC_SVAPIPE: for SVAPIPE | ||
496 | * @HW_ACC_SIAMMDSP: for SIAMMDSP | ||
497 | * @HW_ACC_SIAPIPE: for SIAPIPE | ||
498 | * @HW_ACC_SGA: for SGA | ||
499 | * @HW_ACC_B2R2: for B2R2 | ||
500 | * @HW_ACC_MCDE: for MCDE | ||
501 | * @HW_ACC_ESRAM1: for ESRAM1 | ||
502 | * @HW_ACC_ESRAM2: for ESRAM2 | ||
503 | * @HW_ACC_ESRAM3: for ESRAM3 | ||
504 | * @HW_ACC_ESRAM4: for ESRAM4 | ||
505 | * @NUM_HW_ACC: number of hardware accelerators | ||
506 | * | ||
507 | * Different hw accelerators which can be turned ON/ | ||
508 | * OFF or put into retention (MMDSPs and ESRAMs). | ||
509 | * Used with EPOD API. | ||
510 | * | ||
511 | * NOTE! Deprecated, to be removed when all users switched over to use the | ||
512 | * regulator API. | ||
513 | */ | ||
514 | enum hw_acc_dev { | ||
515 | HW_ACC_SVAMMDSP, | ||
516 | HW_ACC_SVAPIPE, | ||
517 | HW_ACC_SIAMMDSP, | ||
518 | HW_ACC_SIAPIPE, | ||
519 | HW_ACC_SGA, | ||
520 | HW_ACC_B2R2, | ||
521 | HW_ACC_MCDE, | ||
522 | HW_ACC_ESRAM1, | ||
523 | HW_ACC_ESRAM2, | ||
524 | HW_ACC_ESRAM3, | ||
525 | HW_ACC_ESRAM4, | ||
526 | NUM_HW_ACC | ||
527 | }; | ||
528 | |||
529 | /* | ||
530 | * Ids for all EPODs (power domains) | ||
531 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | ||
532 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | ||
533 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | ||
534 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | ||
535 | * - EPOD_ID_SGA: power domain for SGA | ||
536 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | ||
537 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | ||
538 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | ||
539 | * - NUM_EPOD_ID: number of power domains | ||
540 | */ | ||
541 | #define EPOD_ID_SVAMMDSP 0 | ||
542 | #define EPOD_ID_SVAPIPE 1 | ||
543 | #define EPOD_ID_SIAMMDSP 2 | ||
544 | #define EPOD_ID_SIAPIPE 3 | ||
545 | #define EPOD_ID_SGA 4 | ||
546 | #define EPOD_ID_B2R2_MCDE 5 | ||
547 | #define EPOD_ID_ESRAM12 6 | ||
548 | #define EPOD_ID_ESRAM34 7 | ||
549 | #define NUM_EPOD_ID 8 | ||
550 | |||
551 | /* | ||
552 | * state definition for EPOD (power domain) | ||
553 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | ||
554 | * - EPOD_STATE_OFF: The EPOD is switched off | ||
555 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | ||
556 | * retention | ||
557 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | ||
558 | * - EPOD_STATE_ON: Same as above, but with clock enabled | ||
559 | */ | ||
560 | #define EPOD_STATE_NO_CHANGE 0x00 | ||
561 | #define EPOD_STATE_OFF 0x01 | ||
562 | #define EPOD_STATE_RAMRET 0x02 | ||
563 | #define EPOD_STATE_ON_CLK_OFF 0x03 | ||
564 | #define EPOD_STATE_ON 0x04 | ||
565 | |||
566 | /* | ||
567 | * CLKOUT sources | ||
568 | */ | ||
569 | #define PRCMU_CLKSRC_CLK38M 0x00 | ||
570 | #define PRCMU_CLKSRC_ACLK 0x01 | ||
571 | #define PRCMU_CLKSRC_SYSCLK 0x02 | ||
572 | #define PRCMU_CLKSRC_LCDCLK 0x03 | ||
573 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | ||
574 | #define PRCMU_CLKSRC_TVCLK 0x05 | ||
575 | #define PRCMU_CLKSRC_TIMCLK 0x06 | ||
576 | #define PRCMU_CLKSRC_CLK009 0x07 | ||
577 | /* These are only valid for CLKOUT1: */ | ||
578 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | ||
579 | #define PRCMU_CLKSRC_I2CCLK 0x41 | ||
580 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | ||
581 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | ||
582 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | ||
583 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | ||
584 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | ||
585 | #define PRCMU_CLKSRC_HDMICLK 0x47 | ||
586 | |||
587 | /* | ||
588 | * Definitions for autonomous power management configuration. | ||
589 | */ | ||
590 | |||
591 | #define PRCMU_AUTO_PM_OFF 0 | ||
592 | #define PRCMU_AUTO_PM_ON 1 | ||
593 | |||
594 | #define PRCMU_AUTO_PM_POWER_ON_HSEM BIT(0) | ||
595 | #define PRCMU_AUTO_PM_POWER_ON_ABB_FIFO_IT BIT(1) | ||
596 | |||
597 | enum prcmu_auto_pm_policy { | ||
598 | PRCMU_AUTO_PM_POLICY_NO_CHANGE, | ||
599 | PRCMU_AUTO_PM_POLICY_DSP_OFF_HWP_OFF, | ||
600 | PRCMU_AUTO_PM_POLICY_DSP_OFF_RAMRET_HWP_OFF, | ||
601 | PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_OFF, | ||
602 | PRCMU_AUTO_PM_POLICY_DSP_CLK_OFF_HWP_CLK_OFF, | ||
603 | }; | ||
604 | |||
605 | /** | ||
606 | * struct prcmu_auto_pm_config - Autonomous power management configuration. | ||
607 | * @sia_auto_pm_enable: SIA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON}) | ||
608 | * @sia_power_on: SIA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask) | ||
609 | * @sia_policy: SIA power policy. (enum prcmu_auto_pm_policy) | ||
610 | * @sva_auto_pm_enable: SVA autonomous pm enable. (PRCMU_AUTO_PM_{OFF,ON}) | ||
611 | * @sva_power_on: SVA power ON enable. (PRCMU_AUTO_PM_POWER_ON_* bitmask) | ||
612 | * @sva_policy: SVA power policy. (enum prcmu_auto_pm_policy) | ||
613 | */ | ||
614 | struct prcmu_auto_pm_config { | ||
615 | u8 sia_auto_pm_enable; | ||
616 | u8 sia_power_on; | ||
617 | u8 sia_policy; | ||
618 | u8 sva_auto_pm_enable; | ||
619 | u8 sva_power_on; | ||
620 | u8 sva_policy; | ||
621 | }; | ||
622 | |||
623 | /** | ||
624 | * enum ddr_opp - DDR OPP states definition | ||
625 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | ||
626 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | ||
627 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | ||
628 | */ | ||
629 | enum ddr_opp { | ||
630 | DDR_100_OPP = 0x00, | ||
631 | DDR_50_OPP = 0x01, | ||
632 | DDR_25_OPP = 0x02, | ||
633 | }; | ||
634 | |||
635 | /* | ||
636 | * Clock identifiers. | ||
637 | */ | ||
638 | enum prcmu_clock { | ||
639 | PRCMU_SGACLK, | ||
640 | PRCMU_UARTCLK, | ||
641 | PRCMU_MSP02CLK, | ||
642 | PRCMU_MSP1CLK, | ||
643 | PRCMU_I2CCLK, | ||
644 | PRCMU_SDMMCCLK, | ||
645 | PRCMU_SLIMCLK, | ||
646 | PRCMU_PER1CLK, | ||
647 | PRCMU_PER2CLK, | ||
648 | PRCMU_PER3CLK, | ||
649 | PRCMU_PER5CLK, | ||
650 | PRCMU_PER6CLK, | ||
651 | PRCMU_PER7CLK, | ||
652 | PRCMU_LCDCLK, | ||
653 | PRCMU_BMLCLK, | ||
654 | PRCMU_HSITXCLK, | ||
655 | PRCMU_HSIRXCLK, | ||
656 | PRCMU_HDMICLK, | ||
657 | PRCMU_APEATCLK, | ||
658 | PRCMU_APETRACECLK, | ||
659 | PRCMU_MCDECLK, | ||
660 | PRCMU_IPI2CCLK, | ||
661 | PRCMU_DSIALTCLK, | ||
662 | PRCMU_DMACLK, | ||
663 | PRCMU_B2R2CLK, | ||
664 | PRCMU_TVCLK, | ||
665 | PRCMU_SSPCLK, | ||
666 | PRCMU_RNGCLK, | ||
667 | PRCMU_UICCCLK, | ||
668 | PRCMU_NUM_REG_CLOCKS, | ||
669 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
670 | PRCMU_TIMCLK, | ||
671 | }; | ||
672 | |||
673 | /* | ||
674 | * Definitions for controlling ESRAM0 in deep sleep. | ||
675 | */ | ||
676 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | ||
677 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | ||
678 | |||
679 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
680 | void __init prcmu_early_init(void); | ||
681 | int prcmu_set_display_clocks(void); | ||
682 | int prcmu_disable_dsipll(void); | ||
683 | int prcmu_enable_dsipll(void); | ||
684 | #else | ||
685 | static inline void __init prcmu_early_init(void) {} | ||
686 | #endif | ||
687 | |||
688 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
689 | |||
690 | int prcmu_set_rc_a2p(enum romcode_write); | ||
691 | enum romcode_read prcmu_get_rc_p2a(void); | ||
692 | enum ap_pwrst prcmu_get_xp70_current_state(void); | ||
693 | int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
694 | |||
695 | void prcmu_enable_wakeups(u32 wakeups); | ||
696 | static inline void prcmu_disable_wakeups(void) | ||
697 | { | ||
698 | prcmu_enable_wakeups(0); | ||
699 | } | ||
700 | |||
701 | void prcmu_config_abb_event_readout(u32 abb_events); | ||
702 | void prcmu_get_abb_event_buffer(void __iomem **buf); | ||
703 | int prcmu_set_arm_opp(u8 opp); | ||
704 | int prcmu_get_arm_opp(void); | ||
705 | bool prcmu_has_arm_maxopp(void); | ||
706 | bool prcmu_is_u8400(void); | ||
707 | int prcmu_set_ape_opp(u8 opp); | ||
708 | int prcmu_get_ape_opp(void); | ||
709 | int prcmu_request_ape_opp_100_voltage(bool enable); | ||
710 | int prcmu_release_usb_wakeup_state(void); | ||
711 | int prcmu_set_ddr_opp(u8 opp); | ||
712 | int prcmu_get_ddr_opp(void); | ||
713 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | ||
714 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | ||
715 | /* NOTE! Use regulator framework instead */ | ||
716 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); | ||
717 | int prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
718 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | ||
719 | struct prcmu_auto_pm_config *idle); | ||
720 | bool prcmu_is_auto_pm_enabled(void); | ||
721 | |||
722 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | ||
723 | int prcmu_request_clock(u8 clock, bool enable); | ||
724 | int prcmu_set_clock_divider(u8 clock, u8 divider); | ||
725 | int prcmu_config_esram0_deep_sleep(u8 state); | ||
726 | int prcmu_config_hotdog(u8 threshold); | ||
727 | int prcmu_config_hotmon(u8 low, u8 high); | ||
728 | int prcmu_start_temp_sense(u16 cycles32k); | ||
729 | int prcmu_stop_temp_sense(void); | ||
730 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | ||
731 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | ||
732 | |||
733 | void prcmu_ac_wake_req(void); | ||
734 | void prcmu_ac_sleep_req(void); | ||
735 | void prcmu_system_reset(u16 reset_code); | ||
736 | void prcmu_modem_reset(void); | ||
737 | bool prcmu_is_ac_wake_requested(void); | ||
738 | void prcmu_enable_spi2(void); | ||
739 | void prcmu_disable_spi2(void); | ||
740 | |||
741 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | ||
742 | |||
743 | static inline int prcmu_set_rc_a2p(enum romcode_write code) | ||
744 | { | ||
745 | return 0; | ||
746 | } | ||
747 | |||
748 | static inline enum romcode_read prcmu_get_rc_p2a(void) | ||
749 | { | ||
750 | return INIT; | ||
751 | } | ||
752 | |||
753 | static inline enum ap_pwrst prcmu_get_xp70_current_state(void) | ||
754 | { | ||
755 | return AP_EXECUTE; | ||
756 | } | ||
757 | |||
758 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
759 | bool keep_ap_pll) | ||
760 | { | ||
761 | return 0; | ||
762 | } | ||
763 | |||
764 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | ||
765 | |||
766 | static inline void prcmu_disable_wakeups(void) {} | ||
767 | |||
768 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | ||
769 | |||
770 | static inline int prcmu_set_arm_opp(u8 opp) | ||
771 | { | ||
772 | return 0; | ||
773 | } | ||
774 | |||
775 | static inline int prcmu_get_arm_opp(void) | ||
776 | { | ||
777 | return ARM_100_OPP; | ||
778 | } | ||
779 | |||
780 | static bool prcmu_has_arm_maxopp(void) | ||
781 | { | ||
782 | return false; | ||
783 | } | ||
784 | |||
785 | static bool prcmu_is_u8400(void) | ||
786 | { | ||
787 | return false; | ||
788 | } | ||
789 | |||
790 | static inline int prcmu_set_ape_opp(u8 opp) | ||
791 | { | ||
792 | return 0; | ||
793 | } | ||
794 | |||
795 | static inline int prcmu_get_ape_opp(void) | ||
796 | { | ||
797 | return APE_100_OPP; | ||
798 | } | ||
799 | |||
800 | static inline int prcmu_request_ape_opp_100_voltage(bool enable) | ||
801 | { | ||
802 | return 0; | ||
803 | } | ||
804 | |||
805 | static inline int prcmu_release_usb_wakeup_state(void) | ||
806 | { | ||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | static inline int prcmu_set_ddr_opp(u8 opp) | ||
811 | { | ||
812 | return 0; | ||
813 | } | ||
814 | |||
815 | static inline int prcmu_get_ddr_opp(void) | ||
816 | { | ||
817 | return DDR_100_OPP; | ||
818 | } | ||
819 | |||
820 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | ||
821 | { | ||
822 | return 0; | ||
823 | } | ||
824 | |||
825 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | ||
826 | |||
827 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) | ||
828 | { | ||
829 | return 0; | ||
830 | } | ||
831 | |||
832 | static inline void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | ||
833 | struct prcmu_auto_pm_config *idle) | ||
834 | { | ||
835 | } | ||
836 | |||
837 | static inline bool prcmu_is_auto_pm_enabled(void) | ||
838 | { | ||
839 | return false; | ||
840 | } | ||
841 | |||
842 | static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | ||
843 | { | ||
844 | return 0; | ||
845 | } | ||
846 | |||
847 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
848 | { | ||
849 | return 0; | ||
850 | } | ||
851 | |||
852 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) | ||
853 | { | ||
854 | return 0; | ||
855 | } | ||
856 | |||
857 | int prcmu_config_esram0_deep_sleep(u8 state) | ||
858 | { | ||
859 | return 0; | ||
860 | } | ||
861 | |||
862 | static inline int prcmu_config_hotdog(u8 threshold) | ||
863 | { | ||
864 | return 0; | ||
865 | } | ||
866 | |||
867 | static inline int prcmu_config_hotmon(u8 low, u8 high) | ||
868 | { | ||
869 | return 0; | ||
870 | } | ||
871 | |||
872 | static inline int prcmu_start_temp_sense(u16 cycles32k) | ||
873 | { | ||
874 | return 0; | ||
875 | } | ||
876 | |||
877 | static inline int prcmu_stop_temp_sense(void) | ||
878 | { | ||
879 | return 0; | ||
880 | } | ||
881 | |||
882 | static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | ||
883 | { | ||
884 | return -ENOSYS; | ||
885 | } | ||
886 | |||
887 | static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | ||
888 | { | ||
889 | return -ENOSYS; | ||
890 | } | ||
891 | |||
892 | static inline void prcmu_ac_wake_req(void) {} | ||
893 | |||
894 | static inline void prcmu_ac_sleep_req(void) {} | ||
895 | |||
896 | static inline void prcmu_system_reset(u16 reset_code) {} | ||
897 | |||
898 | static inline void prcmu_modem_reset(void) {} | ||
899 | |||
900 | static inline bool prcmu_is_ac_wake_requested(void) | ||
901 | { | ||
902 | return false; | ||
903 | } | ||
904 | |||
905 | #ifndef CONFIG_UX500_SOC_DB5500 | ||
906 | static inline int prcmu_set_display_clocks(void) | ||
907 | { | ||
908 | return 0; | ||
909 | } | ||
910 | |||
911 | static inline int prcmu_disable_dsipll(void) | ||
912 | { | ||
913 | return 0; | ||
914 | } | ||
915 | |||
916 | static inline int prcmu_enable_dsipll(void) | ||
917 | { | ||
918 | return 0; | ||
919 | } | ||
920 | #endif | ||
921 | |||
922 | static inline int prcmu_enable_spi2(void) | ||
923 | { | ||
924 | return 0; | ||
925 | } | ||
926 | |||
927 | static inline int prcmu_disable_spi2(void) | ||
928 | { | ||
929 | return 0; | ||
930 | } | ||
931 | |||
932 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | ||
933 | |||
934 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | ||
935 | int prcmu_qos_requirement(int pm_qos_class); | ||
936 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | ||
937 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | ||
938 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | ||
939 | int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
940 | struct notifier_block *notifier); | ||
941 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
942 | struct notifier_block *notifier); | ||
943 | #else | ||
944 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | ||
945 | { | ||
946 | return 0; | ||
947 | } | ||
948 | |||
949 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | ||
950 | char *name, s32 value) | ||
951 | { | ||
952 | return 0; | ||
953 | } | ||
954 | |||
955 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | ||
956 | char *name, s32 new_value) | ||
957 | { | ||
958 | return 0; | ||
959 | } | ||
960 | |||
961 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | ||
962 | { | ||
963 | } | ||
964 | |||
965 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
966 | struct notifier_block *notifier) | ||
967 | { | ||
968 | return 0; | ||
969 | } | ||
970 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
971 | struct notifier_block *notifier) | ||
972 | { | ||
973 | return 0; | ||
974 | } | ||
975 | |||
976 | #endif | ||
977 | |||
978 | #endif /* __MFD_DB8500_PRCMU_H */ | ||
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index 69d1010e2e51..5ff2400ad46c 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
@@ -311,10 +311,6 @@ enum max8997_irq { | |||
311 | MAX8997_IRQ_NR, | 311 | MAX8997_IRQ_NR, |
312 | }; | 312 | }; |
313 | 313 | ||
314 | #define MAX8997_REG_BUCK1DVS(x) (MAX8997_REG_BUCK1DVS1 + (x) - 1) | ||
315 | #define MAX8997_REG_BUCK2DVS(x) (MAX8997_REG_BUCK2DVS1 + (x) - 1) | ||
316 | #define MAX8997_REG_BUCK5DVS(x) (MAX8997_REG_BUCK5DVS1 + (x) - 1) | ||
317 | |||
318 | #define MAX8997_NUM_GPIO 12 | 314 | #define MAX8997_NUM_GPIO 12 |
319 | struct max8997_dev { | 315 | struct max8997_dev { |
320 | struct device *dev; | 316 | struct device *dev; |
diff --git a/include/linux/mfd/pm8xxx/core.h b/include/linux/mfd/pm8xxx/core.h new file mode 100644 index 000000000000..bd2f4f64e931 --- /dev/null +++ b/include/linux/mfd/pm8xxx/core.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC 8xxx driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8XXX_CORE_H | ||
19 | #define __MFD_PM8XXX_CORE_H | ||
20 | |||
21 | #include <linux/mfd/core.h> | ||
22 | |||
23 | struct pm8xxx_drvdata { | ||
24 | int (*pmic_readb) (const struct device *dev, u16 addr, u8 *val); | ||
25 | int (*pmic_writeb) (const struct device *dev, u16 addr, u8 val); | ||
26 | int (*pmic_read_buf) (const struct device *dev, u16 addr, u8 *buf, | ||
27 | int n); | ||
28 | int (*pmic_write_buf) (const struct device *dev, u16 addr, u8 *buf, | ||
29 | int n); | ||
30 | int (*pmic_read_irq_stat) (const struct device *dev, int irq); | ||
31 | void *pm_chip_data; | ||
32 | }; | ||
33 | |||
34 | static inline int pm8xxx_readb(const struct device *dev, u16 addr, u8 *val) | ||
35 | { | ||
36 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
37 | |||
38 | if (!dd) | ||
39 | return -EINVAL; | ||
40 | return dd->pmic_readb(dev, addr, val); | ||
41 | } | ||
42 | |||
43 | static inline int pm8xxx_writeb(const struct device *dev, u16 addr, u8 val) | ||
44 | { | ||
45 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
46 | |||
47 | if (!dd) | ||
48 | return -EINVAL; | ||
49 | return dd->pmic_writeb(dev, addr, val); | ||
50 | } | ||
51 | |||
52 | static inline int pm8xxx_read_buf(const struct device *dev, u16 addr, u8 *buf, | ||
53 | int n) | ||
54 | { | ||
55 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
56 | |||
57 | if (!dd) | ||
58 | return -EINVAL; | ||
59 | return dd->pmic_read_buf(dev, addr, buf, n); | ||
60 | } | ||
61 | |||
62 | static inline int pm8xxx_write_buf(const struct device *dev, u16 addr, u8 *buf, | ||
63 | int n) | ||
64 | { | ||
65 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
66 | |||
67 | if (!dd) | ||
68 | return -EINVAL; | ||
69 | return dd->pmic_write_buf(dev, addr, buf, n); | ||
70 | } | ||
71 | |||
72 | static inline int pm8xxx_read_irq_stat(const struct device *dev, int irq) | ||
73 | { | ||
74 | struct pm8xxx_drvdata *dd = dev_get_drvdata(dev); | ||
75 | |||
76 | if (!dd) | ||
77 | return -EINVAL; | ||
78 | return dd->pmic_read_irq_stat(dev, irq); | ||
79 | } | ||
80 | |||
81 | #endif | ||
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h new file mode 100644 index 000000000000..4b21769f4483 --- /dev/null +++ b/include/linux/mfd/pm8xxx/irq.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC irq 8xxx driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8XXX_IRQ_H | ||
19 | #define __MFD_PM8XXX_IRQ_H | ||
20 | |||
21 | #include <linux/errno.h> | ||
22 | #include <linux/err.h> | ||
23 | |||
24 | struct pm8xxx_irq_core_data { | ||
25 | u32 rev; | ||
26 | int nirqs; | ||
27 | }; | ||
28 | |||
29 | struct pm8xxx_irq_platform_data { | ||
30 | int irq_base; | ||
31 | struct pm8xxx_irq_core_data irq_cdata; | ||
32 | int devirq; | ||
33 | int irq_trigger_flag; | ||
34 | }; | ||
35 | |||
36 | struct pm_irq_chip; | ||
37 | |||
38 | #ifdef CONFIG_MFD_PM8XXX_IRQ | ||
39 | int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); | ||
40 | struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev, | ||
41 | const struct pm8xxx_irq_platform_data *pdata); | ||
42 | int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip); | ||
43 | #else | ||
44 | static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) | ||
45 | { | ||
46 | return -ENXIO; | ||
47 | } | ||
48 | static inline struct pm_irq_chip * __devinit pm8xxx_irq_init( | ||
49 | const struct device *dev, | ||
50 | const struct pm8xxx_irq_platform_data *pdata) | ||
51 | { | ||
52 | return ERR_PTR(-ENXIO); | ||
53 | } | ||
54 | static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip) | ||
55 | { | ||
56 | return -ENXIO; | ||
57 | } | ||
58 | #endif /* CONFIG_MFD_PM8XXX_IRQ */ | ||
59 | #endif /* __MFD_PM8XXX_IRQ_H */ | ||
diff --git a/include/linux/mfd/pm8xxx/pm8921.h b/include/linux/mfd/pm8xxx/pm8921.h new file mode 100644 index 000000000000..d5517fd32d1b --- /dev/null +++ b/include/linux/mfd/pm8xxx/pm8921.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 and | ||
6 | * only version 2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | /* | ||
14 | * Qualcomm PMIC 8921 driver header file | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __MFD_PM8921_H | ||
19 | #define __MFD_PM8921_H | ||
20 | |||
21 | #include <linux/device.h> | ||
22 | #include <linux/mfd/pm8xxx/irq.h> | ||
23 | |||
24 | #define PM8921_NR_IRQS 256 | ||
25 | |||
26 | struct pm8921_platform_data { | ||
27 | int irq_base; | ||
28 | struct pm8xxx_irq_platform_data *irq_pdata; | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 8e70310ee945..5a90266c3a5a 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
6 | #include <linux/platform_device.h> | 6 | #include <linux/platform_device.h> |
7 | #include <linux/pm_runtime.h> | ||
7 | 8 | ||
8 | #define tmio_ioread8(addr) readb(addr) | 9 | #define tmio_ioread8(addr) readb(addr) |
9 | #define tmio_ioread16(addr) readw(addr) | 10 | #define tmio_ioread16(addr) readw(addr) |
@@ -61,6 +62,12 @@ | |||
61 | * Some controllers can support SDIO IRQ signalling. | 62 | * Some controllers can support SDIO IRQ signalling. |
62 | */ | 63 | */ |
63 | #define TMIO_MMC_SDIO_IRQ (1 << 2) | 64 | #define TMIO_MMC_SDIO_IRQ (1 << 2) |
65 | /* | ||
66 | * Some platforms can detect card insertion events with controller powered | ||
67 | * down, in which case they have to call tmio_mmc_cd_wakeup() to power up the | ||
68 | * controller and report the event to the driver. | ||
69 | */ | ||
70 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | ||
64 | 71 | ||
65 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 72 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
66 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 73 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
@@ -82,11 +89,21 @@ struct tmio_mmc_data { | |||
82 | unsigned long flags; | 89 | unsigned long flags; |
83 | u32 ocr_mask; /* available voltages */ | 90 | u32 ocr_mask; /* available voltages */ |
84 | struct tmio_mmc_dma *dma; | 91 | struct tmio_mmc_dma *dma; |
92 | struct device *dev; | ||
93 | bool power; | ||
85 | void (*set_pwr)(struct platform_device *host, int state); | 94 | void (*set_pwr)(struct platform_device *host, int state); |
86 | void (*set_clk_div)(struct platform_device *host, int state); | 95 | void (*set_clk_div)(struct platform_device *host, int state); |
87 | int (*get_cd)(struct platform_device *host); | 96 | int (*get_cd)(struct platform_device *host); |
88 | }; | 97 | }; |
89 | 98 | ||
99 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | ||
100 | { | ||
101 | if (pdata && !pdata->power) { | ||
102 | pdata->power = true; | ||
103 | pm_runtime_get(pdata->dev); | ||
104 | } | ||
105 | } | ||
106 | |||
90 | /* | 107 | /* |
91 | * data for the NAND controller | 108 | * data for the NAND controller |
92 | */ | 109 | */ |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h new file mode 100644 index 000000000000..8bb85b930c07 --- /dev/null +++ b/include/linux/mfd/tps65910.h | |||
@@ -0,0 +1,800 @@ | |||
1 | /* | ||
2 | * tps65910.h -- TI TPS6591x | ||
3 | * | ||
4 | * Copyright 2010-2011 Texas Instruments Inc. | ||
5 | * | ||
6 | * Author: Graeme Gregory <gg@slimlogic.co.uk> | ||
7 | * Author: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk> | ||
8 | * Author: Arnaud Deconinck <a-deconinck@ti.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_MFD_TPS65910_H | ||
18 | #define __LINUX_MFD_TPS65910_H | ||
19 | |||
20 | /* TPS chip id list */ | ||
21 | #define TPS65910 0 | ||
22 | #define TPS65911 1 | ||
23 | |||
24 | /* TPS regulator type list */ | ||
25 | #define REGULATOR_LDO 0 | ||
26 | #define REGULATOR_DCDC 1 | ||
27 | |||
28 | /* | ||
29 | * List of registers for component TPS65910 | ||
30 | * | ||
31 | */ | ||
32 | |||
33 | #define TPS65910_SECONDS 0x0 | ||
34 | #define TPS65910_MINUTES 0x1 | ||
35 | #define TPS65910_HOURS 0x2 | ||
36 | #define TPS65910_DAYS 0x3 | ||
37 | #define TPS65910_MONTHS 0x4 | ||
38 | #define TPS65910_YEARS 0x5 | ||
39 | #define TPS65910_WEEKS 0x6 | ||
40 | #define TPS65910_ALARM_SECONDS 0x8 | ||
41 | #define TPS65910_ALARM_MINUTES 0x9 | ||
42 | #define TPS65910_ALARM_HOURS 0xA | ||
43 | #define TPS65910_ALARM_DAYS 0xB | ||
44 | #define TPS65910_ALARM_MONTHS 0xC | ||
45 | #define TPS65910_ALARM_YEARS 0xD | ||
46 | #define TPS65910_RTC_CTRL 0x10 | ||
47 | #define TPS65910_RTC_STATUS 0x11 | ||
48 | #define TPS65910_RTC_INTERRUPTS 0x12 | ||
49 | #define TPS65910_RTC_COMP_LSB 0x13 | ||
50 | #define TPS65910_RTC_COMP_MSB 0x14 | ||
51 | #define TPS65910_RTC_RES_PROG 0x15 | ||
52 | #define TPS65910_RTC_RESET_STATUS 0x16 | ||
53 | #define TPS65910_BCK1 0x17 | ||
54 | #define TPS65910_BCK2 0x18 | ||
55 | #define TPS65910_BCK3 0x19 | ||
56 | #define TPS65910_BCK4 0x1A | ||
57 | #define TPS65910_BCK5 0x1B | ||
58 | #define TPS65910_PUADEN 0x1C | ||
59 | #define TPS65910_REF 0x1D | ||
60 | #define TPS65910_VRTC 0x1E | ||
61 | #define TPS65910_VIO 0x20 | ||
62 | #define TPS65910_VDD1 0x21 | ||
63 | #define TPS65910_VDD1_OP 0x22 | ||
64 | #define TPS65910_VDD1_SR 0x23 | ||
65 | #define TPS65910_VDD2 0x24 | ||
66 | #define TPS65910_VDD2_OP 0x25 | ||
67 | #define TPS65910_VDD2_SR 0x26 | ||
68 | #define TPS65910_VDD3 0x27 | ||
69 | #define TPS65910_VDIG1 0x30 | ||
70 | #define TPS65910_VDIG2 0x31 | ||
71 | #define TPS65910_VAUX1 0x32 | ||
72 | #define TPS65910_VAUX2 0x33 | ||
73 | #define TPS65910_VAUX33 0x34 | ||
74 | #define TPS65910_VMMC 0x35 | ||
75 | #define TPS65910_VPLL 0x36 | ||
76 | #define TPS65910_VDAC 0x37 | ||
77 | #define TPS65910_THERM 0x38 | ||
78 | #define TPS65910_BBCH 0x39 | ||
79 | #define TPS65910_DCDCCTRL 0x3E | ||
80 | #define TPS65910_DEVCTRL 0x3F | ||
81 | #define TPS65910_DEVCTRL2 0x40 | ||
82 | #define TPS65910_SLEEP_KEEP_LDO_ON 0x41 | ||
83 | #define TPS65910_SLEEP_KEEP_RES_ON 0x42 | ||
84 | #define TPS65910_SLEEP_SET_LDO_OFF 0x43 | ||
85 | #define TPS65910_SLEEP_SET_RES_OFF 0x44 | ||
86 | #define TPS65910_EN1_LDO_ASS 0x45 | ||
87 | #define TPS65910_EN1_SMPS_ASS 0x46 | ||
88 | #define TPS65910_EN2_LDO_ASS 0x47 | ||
89 | #define TPS65910_EN2_SMPS_ASS 0x48 | ||
90 | #define TPS65910_EN3_LDO_ASS 0x49 | ||
91 | #define TPS65910_SPARE 0x4A | ||
92 | #define TPS65910_INT_STS 0x50 | ||
93 | #define TPS65910_INT_MSK 0x51 | ||
94 | #define TPS65910_INT_STS2 0x52 | ||
95 | #define TPS65910_INT_MSK2 0x53 | ||
96 | #define TPS65910_INT_STS3 0x54 | ||
97 | #define TPS65910_INT_MSK3 0x55 | ||
98 | #define TPS65910_GPIO0 0x60 | ||
99 | #define TPS65910_GPIO1 0x61 | ||
100 | #define TPS65910_GPIO2 0x62 | ||
101 | #define TPS65910_GPIO3 0x63 | ||
102 | #define TPS65910_GPIO4 0x64 | ||
103 | #define TPS65910_GPIO5 0x65 | ||
104 | #define TPS65910_GPIO6 0x66 | ||
105 | #define TPS65910_GPIO7 0x67 | ||
106 | #define TPS65910_GPIO8 0x68 | ||
107 | #define TPS65910_JTAGVERNUM 0x80 | ||
108 | #define TPS65910_MAX_REGISTER 0x80 | ||
109 | |||
110 | /* | ||
111 | * List of registers specific to TPS65911 | ||
112 | */ | ||
113 | #define TPS65911_VDDCTRL 0x27 | ||
114 | #define TPS65911_VDDCTRL_OP 0x28 | ||
115 | #define TPS65911_VDDCTRL_SR 0x29 | ||
116 | #define TPS65911_LDO1 0x30 | ||
117 | #define TPS65911_LDO2 0x31 | ||
118 | #define TPS65911_LDO5 0x32 | ||
119 | #define TPS65911_LDO8 0x33 | ||
120 | #define TPS65911_LDO7 0x34 | ||
121 | #define TPS65911_LDO6 0x35 | ||
122 | #define TPS65911_LDO4 0x36 | ||
123 | #define TPS65911_LDO3 0x37 | ||
124 | #define TPS65911_VMBCH 0x6A | ||
125 | #define TPS65911_VMBCH2 0x6B | ||
126 | |||
127 | /* | ||
128 | * List of register bitfields for component TPS65910 | ||
129 | * | ||
130 | */ | ||
131 | |||
132 | |||
133 | /*Register BCK1 (0x80) register.RegisterDescription */ | ||
134 | #define BCK1_BCKUP_MASK 0xFF | ||
135 | #define BCK1_BCKUP_SHIFT 0 | ||
136 | |||
137 | |||
138 | /*Register BCK2 (0x80) register.RegisterDescription */ | ||
139 | #define BCK2_BCKUP_MASK 0xFF | ||
140 | #define BCK2_BCKUP_SHIFT 0 | ||
141 | |||
142 | |||
143 | /*Register BCK3 (0x80) register.RegisterDescription */ | ||
144 | #define BCK3_BCKUP_MASK 0xFF | ||
145 | #define BCK3_BCKUP_SHIFT 0 | ||
146 | |||
147 | |||
148 | /*Register BCK4 (0x80) register.RegisterDescription */ | ||
149 | #define BCK4_BCKUP_MASK 0xFF | ||
150 | #define BCK4_BCKUP_SHIFT 0 | ||
151 | |||
152 | |||
153 | /*Register BCK5 (0x80) register.RegisterDescription */ | ||
154 | #define BCK5_BCKUP_MASK 0xFF | ||
155 | #define BCK5_BCKUP_SHIFT 0 | ||
156 | |||
157 | |||
158 | /*Register PUADEN (0x80) register.RegisterDescription */ | ||
159 | #define PUADEN_EN3P_MASK 0x80 | ||
160 | #define PUADEN_EN3P_SHIFT 7 | ||
161 | #define PUADEN_I2CCTLP_MASK 0x40 | ||
162 | #define PUADEN_I2CCTLP_SHIFT 6 | ||
163 | #define PUADEN_I2CSRP_MASK 0x20 | ||
164 | #define PUADEN_I2CSRP_SHIFT 5 | ||
165 | #define PUADEN_PWRONP_MASK 0x10 | ||
166 | #define PUADEN_PWRONP_SHIFT 4 | ||
167 | #define PUADEN_SLEEPP_MASK 0x08 | ||
168 | #define PUADEN_SLEEPP_SHIFT 3 | ||
169 | #define PUADEN_PWRHOLDP_MASK 0x04 | ||
170 | #define PUADEN_PWRHOLDP_SHIFT 2 | ||
171 | #define PUADEN_BOOT1P_MASK 0x02 | ||
172 | #define PUADEN_BOOT1P_SHIFT 1 | ||
173 | #define PUADEN_BOOT0P_MASK 0x01 | ||
174 | #define PUADEN_BOOT0P_SHIFT 0 | ||
175 | |||
176 | |||
177 | /*Register REF (0x80) register.RegisterDescription */ | ||
178 | #define REF_VMBCH_SEL_MASK 0x0C | ||
179 | #define REF_VMBCH_SEL_SHIFT 2 | ||
180 | #define REF_ST_MASK 0x03 | ||
181 | #define REF_ST_SHIFT 0 | ||
182 | |||
183 | |||
184 | /*Register VRTC (0x80) register.RegisterDescription */ | ||
185 | #define VRTC_VRTC_OFFMASK_MASK 0x08 | ||
186 | #define VRTC_VRTC_OFFMASK_SHIFT 3 | ||
187 | #define VRTC_ST_MASK 0x03 | ||
188 | #define VRTC_ST_SHIFT 0 | ||
189 | |||
190 | |||
191 | /*Register VIO (0x80) register.RegisterDescription */ | ||
192 | #define VIO_ILMAX_MASK 0xC0 | ||
193 | #define VIO_ILMAX_SHIFT 6 | ||
194 | #define VIO_SEL_MASK 0x0C | ||
195 | #define VIO_SEL_SHIFT 2 | ||
196 | #define VIO_ST_MASK 0x03 | ||
197 | #define VIO_ST_SHIFT 0 | ||
198 | |||
199 | |||
200 | /*Register VDD1 (0x80) register.RegisterDescription */ | ||
201 | #define VDD1_VGAIN_SEL_MASK 0xC0 | ||
202 | #define VDD1_VGAIN_SEL_SHIFT 6 | ||
203 | #define VDD1_ILMAX_MASK 0x20 | ||
204 | #define VDD1_ILMAX_SHIFT 5 | ||
205 | #define VDD1_TSTEP_MASK 0x1C | ||
206 | #define VDD1_TSTEP_SHIFT 2 | ||
207 | #define VDD1_ST_MASK 0x03 | ||
208 | #define VDD1_ST_SHIFT 0 | ||
209 | |||
210 | |||
211 | /*Register VDD1_OP (0x80) register.RegisterDescription */ | ||
212 | #define VDD1_OP_CMD_MASK 0x80 | ||
213 | #define VDD1_OP_CMD_SHIFT 7 | ||
214 | #define VDD1_OP_SEL_MASK 0x7F | ||
215 | #define VDD1_OP_SEL_SHIFT 0 | ||
216 | |||
217 | |||
218 | /*Register VDD1_SR (0x80) register.RegisterDescription */ | ||
219 | #define VDD1_SR_SEL_MASK 0x7F | ||
220 | #define VDD1_SR_SEL_SHIFT 0 | ||
221 | |||
222 | |||
223 | /*Register VDD2 (0x80) register.RegisterDescription */ | ||
224 | #define VDD2_VGAIN_SEL_MASK 0xC0 | ||
225 | #define VDD2_VGAIN_SEL_SHIFT 6 | ||
226 | #define VDD2_ILMAX_MASK 0x20 | ||
227 | #define VDD2_ILMAX_SHIFT 5 | ||
228 | #define VDD2_TSTEP_MASK 0x1C | ||
229 | #define VDD2_TSTEP_SHIFT 2 | ||
230 | #define VDD2_ST_MASK 0x03 | ||
231 | #define VDD2_ST_SHIFT 0 | ||
232 | |||
233 | |||
234 | /*Register VDD2_OP (0x80) register.RegisterDescription */ | ||
235 | #define VDD2_OP_CMD_MASK 0x80 | ||
236 | #define VDD2_OP_CMD_SHIFT 7 | ||
237 | #define VDD2_OP_SEL_MASK 0x7F | ||
238 | #define VDD2_OP_SEL_SHIFT 0 | ||
239 | |||
240 | /*Register VDD2_SR (0x80) register.RegisterDescription */ | ||
241 | #define VDD2_SR_SEL_MASK 0x7F | ||
242 | #define VDD2_SR_SEL_SHIFT 0 | ||
243 | |||
244 | |||
245 | /*Registers VDD1, VDD2 voltage values definitions */ | ||
246 | #define VDD1_2_NUM_VOLTS 73 | ||
247 | #define VDD1_2_MIN_VOLT 6000 | ||
248 | #define VDD1_2_OFFSET 125 | ||
249 | |||
250 | |||
251 | /*Register VDD3 (0x80) register.RegisterDescription */ | ||
252 | #define VDD3_CKINEN_MASK 0x04 | ||
253 | #define VDD3_CKINEN_SHIFT 2 | ||
254 | #define VDD3_ST_MASK 0x03 | ||
255 | #define VDD3_ST_SHIFT 0 | ||
256 | #define VDDCTRL_MIN_VOLT 6000 | ||
257 | #define VDDCTRL_OFFSET 125 | ||
258 | |||
259 | /*Registers VDIG (0x80) to VDAC register.RegisterDescription */ | ||
260 | #define LDO_SEL_MASK 0x0C | ||
261 | #define LDO_SEL_SHIFT 2 | ||
262 | #define LDO_ST_MASK 0x03 | ||
263 | #define LDO_ST_SHIFT 0 | ||
264 | #define LDO_ST_ON_BIT 0x01 | ||
265 | #define LDO_ST_MODE_BIT 0x02 | ||
266 | |||
267 | |||
268 | /* Registers LDO1 to LDO8 in tps65910 */ | ||
269 | #define LDO1_SEL_MASK 0xFC | ||
270 | #define LDO3_SEL_MASK 0x7C | ||
271 | #define LDO_MIN_VOLT 1000 | ||
272 | #define LDO_MAX_VOLT 3300; | ||
273 | |||
274 | |||
275 | /*Register VDIG1 (0x80) register.RegisterDescription */ | ||
276 | #define VDIG1_SEL_MASK 0x0C | ||
277 | #define VDIG1_SEL_SHIFT 2 | ||
278 | #define VDIG1_ST_MASK 0x03 | ||
279 | #define VDIG1_ST_SHIFT 0 | ||
280 | |||
281 | |||
282 | /*Register VDIG2 (0x80) register.RegisterDescription */ | ||
283 | #define VDIG2_SEL_MASK 0x0C | ||
284 | #define VDIG2_SEL_SHIFT 2 | ||
285 | #define VDIG2_ST_MASK 0x03 | ||
286 | #define VDIG2_ST_SHIFT 0 | ||
287 | |||
288 | |||
289 | /*Register VAUX1 (0x80) register.RegisterDescription */ | ||
290 | #define VAUX1_SEL_MASK 0x0C | ||
291 | #define VAUX1_SEL_SHIFT 2 | ||
292 | #define VAUX1_ST_MASK 0x03 | ||
293 | #define VAUX1_ST_SHIFT 0 | ||
294 | |||
295 | |||
296 | /*Register VAUX2 (0x80) register.RegisterDescription */ | ||
297 | #define VAUX2_SEL_MASK 0x0C | ||
298 | #define VAUX2_SEL_SHIFT 2 | ||
299 | #define VAUX2_ST_MASK 0x03 | ||
300 | #define VAUX2_ST_SHIFT 0 | ||
301 | |||
302 | |||
303 | /*Register VAUX33 (0x80) register.RegisterDescription */ | ||
304 | #define VAUX33_SEL_MASK 0x0C | ||
305 | #define VAUX33_SEL_SHIFT 2 | ||
306 | #define VAUX33_ST_MASK 0x03 | ||
307 | #define VAUX33_ST_SHIFT 0 | ||
308 | |||
309 | |||
310 | /*Register VMMC (0x80) register.RegisterDescription */ | ||
311 | #define VMMC_SEL_MASK 0x0C | ||
312 | #define VMMC_SEL_SHIFT 2 | ||
313 | #define VMMC_ST_MASK 0x03 | ||
314 | #define VMMC_ST_SHIFT 0 | ||
315 | |||
316 | |||
317 | /*Register VPLL (0x80) register.RegisterDescription */ | ||
318 | #define VPLL_SEL_MASK 0x0C | ||
319 | #define VPLL_SEL_SHIFT 2 | ||
320 | #define VPLL_ST_MASK 0x03 | ||
321 | #define VPLL_ST_SHIFT 0 | ||
322 | |||
323 | |||
324 | /*Register VDAC (0x80) register.RegisterDescription */ | ||
325 | #define VDAC_SEL_MASK 0x0C | ||
326 | #define VDAC_SEL_SHIFT 2 | ||
327 | #define VDAC_ST_MASK 0x03 | ||
328 | #define VDAC_ST_SHIFT 0 | ||
329 | |||
330 | |||
331 | /*Register THERM (0x80) register.RegisterDescription */ | ||
332 | #define THERM_THERM_HD_MASK 0x20 | ||
333 | #define THERM_THERM_HD_SHIFT 5 | ||
334 | #define THERM_THERM_TS_MASK 0x10 | ||
335 | #define THERM_THERM_TS_SHIFT 4 | ||
336 | #define THERM_THERM_HDSEL_MASK 0x0C | ||
337 | #define THERM_THERM_HDSEL_SHIFT 2 | ||
338 | #define THERM_RSVD1_MASK 0x02 | ||
339 | #define THERM_RSVD1_SHIFT 1 | ||
340 | #define THERM_THERM_STATE_MASK 0x01 | ||
341 | #define THERM_THERM_STATE_SHIFT 0 | ||
342 | |||
343 | |||
344 | /*Register BBCH (0x80) register.RegisterDescription */ | ||
345 | #define BBCH_BBSEL_MASK 0x06 | ||
346 | #define BBCH_BBSEL_SHIFT 1 | ||
347 | #define BBCH_BBCHEN_MASK 0x01 | ||
348 | #define BBCH_BBCHEN_SHIFT 0 | ||
349 | |||
350 | |||
351 | /*Register DCDCCTRL (0x80) register.RegisterDescription */ | ||
352 | #define DCDCCTRL_VDD2_PSKIP_MASK 0x20 | ||
353 | #define DCDCCTRL_VDD2_PSKIP_SHIFT 5 | ||
354 | #define DCDCCTRL_VDD1_PSKIP_MASK 0x10 | ||
355 | #define DCDCCTRL_VDD1_PSKIP_SHIFT 4 | ||
356 | #define DCDCCTRL_VIO_PSKIP_MASK 0x08 | ||
357 | #define DCDCCTRL_VIO_PSKIP_SHIFT 3 | ||
358 | #define DCDCCTRL_DCDCCKEXT_MASK 0x04 | ||
359 | #define DCDCCTRL_DCDCCKEXT_SHIFT 2 | ||
360 | #define DCDCCTRL_DCDCCKSYNC_MASK 0x03 | ||
361 | #define DCDCCTRL_DCDCCKSYNC_SHIFT 0 | ||
362 | |||
363 | |||
364 | /*Register DEVCTRL (0x80) register.RegisterDescription */ | ||
365 | #define DEVCTRL_RTC_PWDN_MASK 0x40 | ||
366 | #define DEVCTRL_RTC_PWDN_SHIFT 6 | ||
367 | #define DEVCTRL_CK32K_CTRL_MASK 0x20 | ||
368 | #define DEVCTRL_CK32K_CTRL_SHIFT 5 | ||
369 | #define DEVCTRL_SR_CTL_I2C_SEL_MASK 0x10 | ||
370 | #define DEVCTRL_SR_CTL_I2C_SEL_SHIFT 4 | ||
371 | #define DEVCTRL_DEV_OFF_RST_MASK 0x08 | ||
372 | #define DEVCTRL_DEV_OFF_RST_SHIFT 3 | ||
373 | #define DEVCTRL_DEV_ON_MASK 0x04 | ||
374 | #define DEVCTRL_DEV_ON_SHIFT 2 | ||
375 | #define DEVCTRL_DEV_SLP_MASK 0x02 | ||
376 | #define DEVCTRL_DEV_SLP_SHIFT 1 | ||
377 | #define DEVCTRL_DEV_OFF_MASK 0x01 | ||
378 | #define DEVCTRL_DEV_OFF_SHIFT 0 | ||
379 | |||
380 | |||
381 | /*Register DEVCTRL2 (0x80) register.RegisterDescription */ | ||
382 | #define DEVCTRL2_TSLOT_LENGTH_MASK 0x30 | ||
383 | #define DEVCTRL2_TSLOT_LENGTH_SHIFT 4 | ||
384 | #define DEVCTRL2_SLEEPSIG_POL_MASK 0x08 | ||
385 | #define DEVCTRL2_SLEEPSIG_POL_SHIFT 3 | ||
386 | #define DEVCTRL2_PWON_LP_OFF_MASK 0x04 | ||
387 | #define DEVCTRL2_PWON_LP_OFF_SHIFT 2 | ||
388 | #define DEVCTRL2_PWON_LP_RST_MASK 0x02 | ||
389 | #define DEVCTRL2_PWON_LP_RST_SHIFT 1 | ||
390 | #define DEVCTRL2_IT_POL_MASK 0x01 | ||
391 | #define DEVCTRL2_IT_POL_SHIFT 0 | ||
392 | |||
393 | |||
394 | /*Register SLEEP_KEEP_LDO_ON (0x80) register.RegisterDescription */ | ||
395 | #define SLEEP_KEEP_LDO_ON_VDAC_KEEPON_MASK 0x80 | ||
396 | #define SLEEP_KEEP_LDO_ON_VDAC_KEEPON_SHIFT 7 | ||
397 | #define SLEEP_KEEP_LDO_ON_VPLL_KEEPON_MASK 0x40 | ||
398 | #define SLEEP_KEEP_LDO_ON_VPLL_KEEPON_SHIFT 6 | ||
399 | #define SLEEP_KEEP_LDO_ON_VAUX33_KEEPON_MASK 0x20 | ||
400 | #define SLEEP_KEEP_LDO_ON_VAUX33_KEEPON_SHIFT 5 | ||
401 | #define SLEEP_KEEP_LDO_ON_VAUX2_KEEPON_MASK 0x10 | ||
402 | #define SLEEP_KEEP_LDO_ON_VAUX2_KEEPON_SHIFT 4 | ||
403 | #define SLEEP_KEEP_LDO_ON_VAUX1_KEEPON_MASK 0x08 | ||
404 | #define SLEEP_KEEP_LDO_ON_VAUX1_KEEPON_SHIFT 3 | ||
405 | #define SLEEP_KEEP_LDO_ON_VDIG2_KEEPON_MASK 0x04 | ||
406 | #define SLEEP_KEEP_LDO_ON_VDIG2_KEEPON_SHIFT 2 | ||
407 | #define SLEEP_KEEP_LDO_ON_VDIG1_KEEPON_MASK 0x02 | ||
408 | #define SLEEP_KEEP_LDO_ON_VDIG1_KEEPON_SHIFT 1 | ||
409 | #define SLEEP_KEEP_LDO_ON_VMMC_KEEPON_MASK 0x01 | ||
410 | #define SLEEP_KEEP_LDO_ON_VMMC_KEEPON_SHIFT 0 | ||
411 | |||
412 | |||
413 | /*Register SLEEP_KEEP_RES_ON (0x80) register.RegisterDescription */ | ||
414 | #define SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK 0x80 | ||
415 | #define SLEEP_KEEP_RES_ON_THERM_KEEPON_SHIFT 7 | ||
416 | #define SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK 0x40 | ||
417 | #define SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_SHIFT 6 | ||
418 | #define SLEEP_KEEP_RES_ON_VRTC_KEEPON_MASK 0x20 | ||
419 | #define SLEEP_KEEP_RES_ON_VRTC_KEEPON_SHIFT 5 | ||
420 | #define SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK 0x10 | ||
421 | #define SLEEP_KEEP_RES_ON_I2CHS_KEEPON_SHIFT 4 | ||
422 | #define SLEEP_KEEP_RES_ON_VDD3_KEEPON_MASK 0x08 | ||
423 | #define SLEEP_KEEP_RES_ON_VDD3_KEEPON_SHIFT 3 | ||
424 | #define SLEEP_KEEP_RES_ON_VDD2_KEEPON_MASK 0x04 | ||
425 | #define SLEEP_KEEP_RES_ON_VDD2_KEEPON_SHIFT 2 | ||
426 | #define SLEEP_KEEP_RES_ON_VDD1_KEEPON_MASK 0x02 | ||
427 | #define SLEEP_KEEP_RES_ON_VDD1_KEEPON_SHIFT 1 | ||
428 | #define SLEEP_KEEP_RES_ON_VIO_KEEPON_MASK 0x01 | ||
429 | #define SLEEP_KEEP_RES_ON_VIO_KEEPON_SHIFT 0 | ||
430 | |||
431 | |||
432 | /*Register SLEEP_SET_LDO_OFF (0x80) register.RegisterDescription */ | ||
433 | #define SLEEP_SET_LDO_OFF_VDAC_SETOFF_MASK 0x80 | ||
434 | #define SLEEP_SET_LDO_OFF_VDAC_SETOFF_SHIFT 7 | ||
435 | #define SLEEP_SET_LDO_OFF_VPLL_SETOFF_MASK 0x40 | ||
436 | #define SLEEP_SET_LDO_OFF_VPLL_SETOFF_SHIFT 6 | ||
437 | #define SLEEP_SET_LDO_OFF_VAUX33_SETOFF_MASK 0x20 | ||
438 | #define SLEEP_SET_LDO_OFF_VAUX33_SETOFF_SHIFT 5 | ||
439 | #define SLEEP_SET_LDO_OFF_VAUX2_SETOFF_MASK 0x10 | ||
440 | #define SLEEP_SET_LDO_OFF_VAUX2_SETOFF_SHIFT 4 | ||
441 | #define SLEEP_SET_LDO_OFF_VAUX1_SETOFF_MASK 0x08 | ||
442 | #define SLEEP_SET_LDO_OFF_VAUX1_SETOFF_SHIFT 3 | ||
443 | #define SLEEP_SET_LDO_OFF_VDIG2_SETOFF_MASK 0x04 | ||
444 | #define SLEEP_SET_LDO_OFF_VDIG2_SETOFF_SHIFT 2 | ||
445 | #define SLEEP_SET_LDO_OFF_VDIG1_SETOFF_MASK 0x02 | ||
446 | #define SLEEP_SET_LDO_OFF_VDIG1_SETOFF_SHIFT 1 | ||
447 | #define SLEEP_SET_LDO_OFF_VMMC_SETOFF_MASK 0x01 | ||
448 | #define SLEEP_SET_LDO_OFF_VMMC_SETOFF_SHIFT 0 | ||
449 | |||
450 | |||
451 | /*Register SLEEP_SET_RES_OFF (0x80) register.RegisterDescription */ | ||
452 | #define SLEEP_SET_RES_OFF_DEFAULT_VOLT_MASK 0x80 | ||
453 | #define SLEEP_SET_RES_OFF_DEFAULT_VOLT_SHIFT 7 | ||
454 | #define SLEEP_SET_RES_OFF_RSVD_MASK 0x60 | ||
455 | #define SLEEP_SET_RES_OFF_RSVD_SHIFT 5 | ||
456 | #define SLEEP_SET_RES_OFF_SPARE_SETOFF_MASK 0x10 | ||
457 | #define SLEEP_SET_RES_OFF_SPARE_SETOFF_SHIFT 4 | ||
458 | #define SLEEP_SET_RES_OFF_VDD3_SETOFF_MASK 0x08 | ||
459 | #define SLEEP_SET_RES_OFF_VDD3_SETOFF_SHIFT 3 | ||
460 | #define SLEEP_SET_RES_OFF_VDD2_SETOFF_MASK 0x04 | ||
461 | #define SLEEP_SET_RES_OFF_VDD2_SETOFF_SHIFT 2 | ||
462 | #define SLEEP_SET_RES_OFF_VDD1_SETOFF_MASK 0x02 | ||
463 | #define SLEEP_SET_RES_OFF_VDD1_SETOFF_SHIFT 1 | ||
464 | #define SLEEP_SET_RES_OFF_VIO_SETOFF_MASK 0x01 | ||
465 | #define SLEEP_SET_RES_OFF_VIO_SETOFF_SHIFT 0 | ||
466 | |||
467 | |||
468 | /*Register EN1_LDO_ASS (0x80) register.RegisterDescription */ | ||
469 | #define EN1_LDO_ASS_VDAC_EN1_MASK 0x80 | ||
470 | #define EN1_LDO_ASS_VDAC_EN1_SHIFT 7 | ||
471 | #define EN1_LDO_ASS_VPLL_EN1_MASK 0x40 | ||
472 | #define EN1_LDO_ASS_VPLL_EN1_SHIFT 6 | ||
473 | #define EN1_LDO_ASS_VAUX33_EN1_MASK 0x20 | ||
474 | #define EN1_LDO_ASS_VAUX33_EN1_SHIFT 5 | ||
475 | #define EN1_LDO_ASS_VAUX2_EN1_MASK 0x10 | ||
476 | #define EN1_LDO_ASS_VAUX2_EN1_SHIFT 4 | ||
477 | #define EN1_LDO_ASS_VAUX1_EN1_MASK 0x08 | ||
478 | #define EN1_LDO_ASS_VAUX1_EN1_SHIFT 3 | ||
479 | #define EN1_LDO_ASS_VDIG2_EN1_MASK 0x04 | ||
480 | #define EN1_LDO_ASS_VDIG2_EN1_SHIFT 2 | ||
481 | #define EN1_LDO_ASS_VDIG1_EN1_MASK 0x02 | ||
482 | #define EN1_LDO_ASS_VDIG1_EN1_SHIFT 1 | ||
483 | #define EN1_LDO_ASS_VMMC_EN1_MASK 0x01 | ||
484 | #define EN1_LDO_ASS_VMMC_EN1_SHIFT 0 | ||
485 | |||
486 | |||
487 | /*Register EN1_SMPS_ASS (0x80) register.RegisterDescription */ | ||
488 | #define EN1_SMPS_ASS_RSVD_MASK 0xE0 | ||
489 | #define EN1_SMPS_ASS_RSVD_SHIFT 5 | ||
490 | #define EN1_SMPS_ASS_SPARE_EN1_MASK 0x10 | ||
491 | #define EN1_SMPS_ASS_SPARE_EN1_SHIFT 4 | ||
492 | #define EN1_SMPS_ASS_VDD3_EN1_MASK 0x08 | ||
493 | #define EN1_SMPS_ASS_VDD3_EN1_SHIFT 3 | ||
494 | #define EN1_SMPS_ASS_VDD2_EN1_MASK 0x04 | ||
495 | #define EN1_SMPS_ASS_VDD2_EN1_SHIFT 2 | ||
496 | #define EN1_SMPS_ASS_VDD1_EN1_MASK 0x02 | ||
497 | #define EN1_SMPS_ASS_VDD1_EN1_SHIFT 1 | ||
498 | #define EN1_SMPS_ASS_VIO_EN1_MASK 0x01 | ||
499 | #define EN1_SMPS_ASS_VIO_EN1_SHIFT 0 | ||
500 | |||
501 | |||
502 | /*Register EN2_LDO_ASS (0x80) register.RegisterDescription */ | ||
503 | #define EN2_LDO_ASS_VDAC_EN2_MASK 0x80 | ||
504 | #define EN2_LDO_ASS_VDAC_EN2_SHIFT 7 | ||
505 | #define EN2_LDO_ASS_VPLL_EN2_MASK 0x40 | ||
506 | #define EN2_LDO_ASS_VPLL_EN2_SHIFT 6 | ||
507 | #define EN2_LDO_ASS_VAUX33_EN2_MASK 0x20 | ||
508 | #define EN2_LDO_ASS_VAUX33_EN2_SHIFT 5 | ||
509 | #define EN2_LDO_ASS_VAUX2_EN2_MASK 0x10 | ||
510 | #define EN2_LDO_ASS_VAUX2_EN2_SHIFT 4 | ||
511 | #define EN2_LDO_ASS_VAUX1_EN2_MASK 0x08 | ||
512 | #define EN2_LDO_ASS_VAUX1_EN2_SHIFT 3 | ||
513 | #define EN2_LDO_ASS_VDIG2_EN2_MASK 0x04 | ||
514 | #define EN2_LDO_ASS_VDIG2_EN2_SHIFT 2 | ||
515 | #define EN2_LDO_ASS_VDIG1_EN2_MASK 0x02 | ||
516 | #define EN2_LDO_ASS_VDIG1_EN2_SHIFT 1 | ||
517 | #define EN2_LDO_ASS_VMMC_EN2_MASK 0x01 | ||
518 | #define EN2_LDO_ASS_VMMC_EN2_SHIFT 0 | ||
519 | |||
520 | |||
521 | /*Register EN2_SMPS_ASS (0x80) register.RegisterDescription */ | ||
522 | #define EN2_SMPS_ASS_RSVD_MASK 0xE0 | ||
523 | #define EN2_SMPS_ASS_RSVD_SHIFT 5 | ||
524 | #define EN2_SMPS_ASS_SPARE_EN2_MASK 0x10 | ||
525 | #define EN2_SMPS_ASS_SPARE_EN2_SHIFT 4 | ||
526 | #define EN2_SMPS_ASS_VDD3_EN2_MASK 0x08 | ||
527 | #define EN2_SMPS_ASS_VDD3_EN2_SHIFT 3 | ||
528 | #define EN2_SMPS_ASS_VDD2_EN2_MASK 0x04 | ||
529 | #define EN2_SMPS_ASS_VDD2_EN2_SHIFT 2 | ||
530 | #define EN2_SMPS_ASS_VDD1_EN2_MASK 0x02 | ||
531 | #define EN2_SMPS_ASS_VDD1_EN2_SHIFT 1 | ||
532 | #define EN2_SMPS_ASS_VIO_EN2_MASK 0x01 | ||
533 | #define EN2_SMPS_ASS_VIO_EN2_SHIFT 0 | ||
534 | |||
535 | |||
536 | /*Register EN3_LDO_ASS (0x80) register.RegisterDescription */ | ||
537 | #define EN3_LDO_ASS_VDAC_EN3_MASK 0x80 | ||
538 | #define EN3_LDO_ASS_VDAC_EN3_SHIFT 7 | ||
539 | #define EN3_LDO_ASS_VPLL_EN3_MASK 0x40 | ||
540 | #define EN3_LDO_ASS_VPLL_EN3_SHIFT 6 | ||
541 | #define EN3_LDO_ASS_VAUX33_EN3_MASK 0x20 | ||
542 | #define EN3_LDO_ASS_VAUX33_EN3_SHIFT 5 | ||
543 | #define EN3_LDO_ASS_VAUX2_EN3_MASK 0x10 | ||
544 | #define EN3_LDO_ASS_VAUX2_EN3_SHIFT 4 | ||
545 | #define EN3_LDO_ASS_VAUX1_EN3_MASK 0x08 | ||
546 | #define EN3_LDO_ASS_VAUX1_EN3_SHIFT 3 | ||
547 | #define EN3_LDO_ASS_VDIG2_EN3_MASK 0x04 | ||
548 | #define EN3_LDO_ASS_VDIG2_EN3_SHIFT 2 | ||
549 | #define EN3_LDO_ASS_VDIG1_EN3_MASK 0x02 | ||
550 | #define EN3_LDO_ASS_VDIG1_EN3_SHIFT 1 | ||
551 | #define EN3_LDO_ASS_VMMC_EN3_MASK 0x01 | ||
552 | #define EN3_LDO_ASS_VMMC_EN3_SHIFT 0 | ||
553 | |||
554 | |||
555 | /*Register SPARE (0x80) register.RegisterDescription */ | ||
556 | #define SPARE_SPARE_MASK 0xFF | ||
557 | #define SPARE_SPARE_SHIFT 0 | ||
558 | |||
559 | |||
560 | /*Register INT_STS (0x80) register.RegisterDescription */ | ||
561 | #define INT_STS_RTC_PERIOD_IT_MASK 0x80 | ||
562 | #define INT_STS_RTC_PERIOD_IT_SHIFT 7 | ||
563 | #define INT_STS_RTC_ALARM_IT_MASK 0x40 | ||
564 | #define INT_STS_RTC_ALARM_IT_SHIFT 6 | ||
565 | #define INT_STS_HOTDIE_IT_MASK 0x20 | ||
566 | #define INT_STS_HOTDIE_IT_SHIFT 5 | ||
567 | #define INT_STS_PWRHOLD_IT_MASK 0x10 | ||
568 | #define INT_STS_PWRHOLD_IT_SHIFT 4 | ||
569 | #define INT_STS_PWRON_LP_IT_MASK 0x08 | ||
570 | #define INT_STS_PWRON_LP_IT_SHIFT 3 | ||
571 | #define INT_STS_PWRON_IT_MASK 0x04 | ||
572 | #define INT_STS_PWRON_IT_SHIFT 2 | ||
573 | #define INT_STS_VMBHI_IT_MASK 0x02 | ||
574 | #define INT_STS_VMBHI_IT_SHIFT 1 | ||
575 | #define INT_STS_VMBDCH_IT_MASK 0x01 | ||
576 | #define INT_STS_VMBDCH_IT_SHIFT 0 | ||
577 | |||
578 | |||
579 | /*Register INT_MSK (0x80) register.RegisterDescription */ | ||
580 | #define INT_MSK_RTC_PERIOD_IT_MSK_MASK 0x80 | ||
581 | #define INT_MSK_RTC_PERIOD_IT_MSK_SHIFT 7 | ||
582 | #define INT_MSK_RTC_ALARM_IT_MSK_MASK 0x40 | ||
583 | #define INT_MSK_RTC_ALARM_IT_MSK_SHIFT 6 | ||
584 | #define INT_MSK_HOTDIE_IT_MSK_MASK 0x20 | ||
585 | #define INT_MSK_HOTDIE_IT_MSK_SHIFT 5 | ||
586 | #define INT_MSK_PWRHOLD_IT_MSK_MASK 0x10 | ||
587 | #define INT_MSK_PWRHOLD_IT_MSK_SHIFT 4 | ||
588 | #define INT_MSK_PWRON_LP_IT_MSK_MASK 0x08 | ||
589 | #define INT_MSK_PWRON_LP_IT_MSK_SHIFT 3 | ||
590 | #define INT_MSK_PWRON_IT_MSK_MASK 0x04 | ||
591 | #define INT_MSK_PWRON_IT_MSK_SHIFT 2 | ||
592 | #define INT_MSK_VMBHI_IT_MSK_MASK 0x02 | ||
593 | #define INT_MSK_VMBHI_IT_MSK_SHIFT 1 | ||
594 | #define INT_MSK_VMBDCH_IT_MSK_MASK 0x01 | ||
595 | #define INT_MSK_VMBDCH_IT_MSK_SHIFT 0 | ||
596 | |||
597 | |||
598 | /*Register INT_STS2 (0x80) register.RegisterDescription */ | ||
599 | #define INT_STS2_GPIO3_F_IT_MASK 0x80 | ||
600 | #define INT_STS2_GPIO3_F_IT_SHIFT 7 | ||
601 | #define INT_STS2_GPIO3_R_IT_MASK 0x40 | ||
602 | #define INT_STS2_GPIO3_R_IT_SHIFT 6 | ||
603 | #define INT_STS2_GPIO2_F_IT_MASK 0x20 | ||
604 | #define INT_STS2_GPIO2_F_IT_SHIFT 5 | ||
605 | #define INT_STS2_GPIO2_R_IT_MASK 0x10 | ||
606 | #define INT_STS2_GPIO2_R_IT_SHIFT 4 | ||
607 | #define INT_STS2_GPIO1_F_IT_MASK 0x08 | ||
608 | #define INT_STS2_GPIO1_F_IT_SHIFT 3 | ||
609 | #define INT_STS2_GPIO1_R_IT_MASK 0x04 | ||
610 | #define INT_STS2_GPIO1_R_IT_SHIFT 2 | ||
611 | #define INT_STS2_GPIO0_F_IT_MASK 0x02 | ||
612 | #define INT_STS2_GPIO0_F_IT_SHIFT 1 | ||
613 | #define INT_STS2_GPIO0_R_IT_MASK 0x01 | ||
614 | #define INT_STS2_GPIO0_R_IT_SHIFT 0 | ||
615 | |||
616 | |||
617 | /*Register INT_MSK2 (0x80) register.RegisterDescription */ | ||
618 | #define INT_MSK2_GPIO3_F_IT_MSK_MASK 0x80 | ||
619 | #define INT_MSK2_GPIO3_F_IT_MSK_SHIFT 7 | ||
620 | #define INT_MSK2_GPIO3_R_IT_MSK_MASK 0x40 | ||
621 | #define INT_MSK2_GPIO3_R_IT_MSK_SHIFT 6 | ||
622 | #define INT_MSK2_GPIO2_F_IT_MSK_MASK 0x20 | ||
623 | #define INT_MSK2_GPIO2_F_IT_MSK_SHIFT 5 | ||
624 | #define INT_MSK2_GPIO2_R_IT_MSK_MASK 0x10 | ||
625 | #define INT_MSK2_GPIO2_R_IT_MSK_SHIFT 4 | ||
626 | #define INT_MSK2_GPIO1_F_IT_MSK_MASK 0x08 | ||
627 | #define INT_MSK2_GPIO1_F_IT_MSK_SHIFT 3 | ||
628 | #define INT_MSK2_GPIO1_R_IT_MSK_MASK 0x04 | ||
629 | #define INT_MSK2_GPIO1_R_IT_MSK_SHIFT 2 | ||
630 | #define INT_MSK2_GPIO0_F_IT_MSK_MASK 0x02 | ||
631 | #define INT_MSK2_GPIO0_F_IT_MSK_SHIFT 1 | ||
632 | #define INT_MSK2_GPIO0_R_IT_MSK_MASK 0x01 | ||
633 | #define INT_MSK2_GPIO0_R_IT_MSK_SHIFT 0 | ||
634 | |||
635 | |||
636 | /*Register INT_STS3 (0x80) register.RegisterDescription */ | ||
637 | #define INT_STS3_GPIO5_F_IT_MASK 0x08 | ||
638 | #define INT_STS3_GPIO5_F_IT_SHIFT 3 | ||
639 | #define INT_STS3_GPIO5_R_IT_MASK 0x04 | ||
640 | #define INT_STS3_GPIO5_R_IT_SHIFT 2 | ||
641 | #define INT_STS3_GPIO4_F_IT_MASK 0x02 | ||
642 | #define INT_STS3_GPIO4_F_IT_SHIFT 1 | ||
643 | #define INT_STS3_GPIO4_R_IT_MASK 0x01 | ||
644 | #define INT_STS3_GPIO4_R_IT_SHIFT 0 | ||
645 | |||
646 | |||
647 | /*Register INT_MSK3 (0x80) register.RegisterDescription */ | ||
648 | #define INT_MSK3_GPIO5_F_IT_MSK_MASK 0x08 | ||
649 | #define INT_MSK3_GPIO5_F_IT_MSK_SHIFT 3 | ||
650 | #define INT_MSK3_GPIO5_R_IT_MSK_MASK 0x04 | ||
651 | #define INT_MSK3_GPIO5_R_IT_MSK_SHIFT 2 | ||
652 | #define INT_MSK3_GPIO4_F_IT_MSK_MASK 0x02 | ||
653 | #define INT_MSK3_GPIO4_F_IT_MSK_SHIFT 1 | ||
654 | #define INT_MSK3_GPIO4_R_IT_MSK_MASK 0x01 | ||
655 | #define INT_MSK3_GPIO4_R_IT_MSK_SHIFT 0 | ||
656 | |||
657 | |||
658 | /*Register GPIO (0x80) register.RegisterDescription */ | ||
659 | #define GPIO_DEB_MASK 0x10 | ||
660 | #define GPIO_DEB_SHIFT 4 | ||
661 | #define GPIO_PUEN_MASK 0x08 | ||
662 | #define GPIO_PUEN_SHIFT 3 | ||
663 | #define GPIO_CFG_MASK 0x04 | ||
664 | #define GPIO_CFG_SHIFT 2 | ||
665 | #define GPIO_STS_MASK 0x02 | ||
666 | #define GPIO_STS_SHIFT 1 | ||
667 | #define GPIO_SET_MASK 0x01 | ||
668 | #define GPIO_SET_SHIFT 0 | ||
669 | |||
670 | |||
671 | /*Register JTAGVERNUM (0x80) register.RegisterDescription */ | ||
672 | #define JTAGVERNUM_VERNUM_MASK 0x0F | ||
673 | #define JTAGVERNUM_VERNUM_SHIFT 0 | ||
674 | |||
675 | |||
676 | /* Register VDDCTRL (0x27) bit definitions */ | ||
677 | #define VDDCTRL_ST_MASK 0x03 | ||
678 | #define VDDCTRL_ST_SHIFT 0 | ||
679 | |||
680 | |||
681 | /*Register VDDCTRL_OP (0x28) bit definitios */ | ||
682 | #define VDDCTRL_OP_CMD_MASK 0x80 | ||
683 | #define VDDCTRL_OP_CMD_SHIFT 7 | ||
684 | #define VDDCTRL_OP_SEL_MASK 0x7F | ||
685 | #define VDDCTRL_OP_SEL_SHIFT 0 | ||
686 | |||
687 | |||
688 | /*Register VDDCTRL_SR (0x29) bit definitions */ | ||
689 | #define VDDCTRL_SR_SEL_MASK 0x7F | ||
690 | #define VDDCTRL_SR_SEL_SHIFT 0 | ||
691 | |||
692 | |||
693 | /* IRQ Definitions */ | ||
694 | #define TPS65910_IRQ_VBAT_VMBDCH 0 | ||
695 | #define TPS65910_IRQ_VBAT_VMHI 1 | ||
696 | #define TPS65910_IRQ_PWRON 2 | ||
697 | #define TPS65910_IRQ_PWRON_LP 3 | ||
698 | #define TPS65910_IRQ_PWRHOLD 4 | ||
699 | #define TPS65910_IRQ_HOTDIE 5 | ||
700 | #define TPS65910_IRQ_RTC_ALARM 6 | ||
701 | #define TPS65910_IRQ_RTC_PERIOD 7 | ||
702 | #define TPS65910_IRQ_GPIO_R 8 | ||
703 | #define TPS65910_IRQ_GPIO_F 9 | ||
704 | #define TPS65910_NUM_IRQ 10 | ||
705 | |||
706 | #define TPS65911_IRQ_VBAT_VMBDCH 0 | ||
707 | #define TPS65911_IRQ_VBAT_VMBDCH2L 1 | ||
708 | #define TPS65911_IRQ_VBAT_VMBDCH2H 2 | ||
709 | #define TPS65911_IRQ_VBAT_VMHI 3 | ||
710 | #define TPS65911_IRQ_PWRON 4 | ||
711 | #define TPS65911_IRQ_PWRON_LP 5 | ||
712 | #define TPS65911_IRQ_PWRHOLD_F 6 | ||
713 | #define TPS65911_IRQ_PWRHOLD_R 7 | ||
714 | #define TPS65911_IRQ_HOTDIE 8 | ||
715 | #define TPS65911_IRQ_RTC_ALARM 9 | ||
716 | #define TPS65911_IRQ_RTC_PERIOD 10 | ||
717 | #define TPS65911_IRQ_GPIO0_R 11 | ||
718 | #define TPS65911_IRQ_GPIO0_F 12 | ||
719 | #define TPS65911_IRQ_GPIO1_R 13 | ||
720 | #define TPS65911_IRQ_GPIO1_F 14 | ||
721 | #define TPS65911_IRQ_GPIO2_R 15 | ||
722 | #define TPS65911_IRQ_GPIO2_F 16 | ||
723 | #define TPS65911_IRQ_GPIO3_R 17 | ||
724 | #define TPS65911_IRQ_GPIO3_F 18 | ||
725 | #define TPS65911_IRQ_GPIO4_R 19 | ||
726 | #define TPS65911_IRQ_GPIO4_F 20 | ||
727 | #define TPS65911_IRQ_GPIO5_R 21 | ||
728 | #define TPS65911_IRQ_GPIO5_F 22 | ||
729 | #define TPS65911_IRQ_WTCHDG 23 | ||
730 | #define TPS65911_IRQ_PWRDN 24 | ||
731 | |||
732 | #define TPS65911_NUM_IRQ 25 | ||
733 | |||
734 | |||
735 | /* GPIO Register Definitions */ | ||
736 | #define TPS65910_GPIO_DEB BIT(2) | ||
737 | #define TPS65910_GPIO_PUEN BIT(3) | ||
738 | #define TPS65910_GPIO_CFG BIT(2) | ||
739 | #define TPS65910_GPIO_STS BIT(1) | ||
740 | #define TPS65910_GPIO_SET BIT(0) | ||
741 | |||
742 | /** | ||
743 | * struct tps65910_board | ||
744 | * Board platform data may be used to initialize regulators. | ||
745 | */ | ||
746 | |||
747 | struct tps65910_board { | ||
748 | int gpio_base; | ||
749 | int irq; | ||
750 | int irq_base; | ||
751 | int vmbch_threshold; | ||
752 | int vmbch2_threshold; | ||
753 | struct regulator_init_data *tps65910_pmic_init_data; | ||
754 | }; | ||
755 | |||
756 | /** | ||
757 | * struct tps65910 - tps65910 sub-driver chip access routines | ||
758 | */ | ||
759 | |||
760 | struct tps65910 { | ||
761 | struct device *dev; | ||
762 | struct i2c_client *i2c_client; | ||
763 | struct mutex io_mutex; | ||
764 | unsigned int id; | ||
765 | int (*read)(struct tps65910 *tps65910, u8 reg, int size, void *dest); | ||
766 | int (*write)(struct tps65910 *tps65910, u8 reg, int size, void *src); | ||
767 | |||
768 | /* Client devices */ | ||
769 | struct tps65910_pmic *pmic; | ||
770 | struct tps65910_rtc *rtc; | ||
771 | struct tps65910_power *power; | ||
772 | |||
773 | /* GPIO Handling */ | ||
774 | struct gpio_chip gpio; | ||
775 | |||
776 | /* IRQ Handling */ | ||
777 | struct mutex irq_lock; | ||
778 | int chip_irq; | ||
779 | int irq_base; | ||
780 | int irq_num; | ||
781 | u32 irq_mask; | ||
782 | }; | ||
783 | |||
784 | struct tps65910_platform_data { | ||
785 | int irq; | ||
786 | int irq_base; | ||
787 | }; | ||
788 | |||
789 | int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
790 | int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | ||
791 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | ||
792 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | ||
793 | struct tps65910_platform_data *pdata); | ||
794 | |||
795 | static inline int tps65910_chip_id(struct tps65910 *tps65910) | ||
796 | { | ||
797 | return tps65910->id; | ||
798 | } | ||
799 | |||
800 | #endif /* __LINUX_MFD_TPS65910_H */ | ||
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h index 2ec317c68e59..5cc16bbd1da1 100644 --- a/include/linux/mfd/twl4030-codec.h +++ b/include/linux/mfd/twl4030-codec.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MFD driver for twl4030 codec submodule | 2 | * MFD driver for twl4030 codec submodule |
3 | * | 3 | * |
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | 4 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
5 | * | 5 | * |
6 | * Copyright: (C) 2009 Nokia Corporation | 6 | * Copyright: (C) 2009 Nokia Corporation |
7 | * | 7 | * |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 903280d21866..0d515ee1c247 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -301,30 +301,4 @@ int wm831x_device_suspend(struct wm831x *wm831x); | |||
301 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 301 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
302 | void wm831x_irq_exit(struct wm831x *wm831x); | 302 | void wm831x_irq_exit(struct wm831x *wm831x); |
303 | 303 | ||
304 | static inline int __must_check wm831x_request_irq(struct wm831x *wm831x, | ||
305 | unsigned int irq, | ||
306 | irq_handler_t handler, | ||
307 | unsigned long flags, | ||
308 | const char *name, | ||
309 | void *dev) | ||
310 | { | ||
311 | return request_threaded_irq(irq, NULL, handler, flags, name, dev); | ||
312 | } | ||
313 | |||
314 | static inline void wm831x_free_irq(struct wm831x *wm831x, | ||
315 | unsigned int irq, void *dev) | ||
316 | { | ||
317 | free_irq(irq, dev); | ||
318 | } | ||
319 | |||
320 | static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq) | ||
321 | { | ||
322 | disable_irq(irq); | ||
323 | } | ||
324 | |||
325 | static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq) | ||
326 | { | ||
327 | enable_irq(irq); | ||
328 | } | ||
329 | |||
330 | #endif | 304 | #endif |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 632d1567a1b6..ff42d700293f 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -105,6 +105,9 @@ struct wm831x_watchdog_pdata { | |||
105 | #define WM831X_MAX_LDO 11 | 105 | #define WM831X_MAX_LDO 11 |
106 | #define WM831X_MAX_ISINK 2 | 106 | #define WM831X_MAX_ISINK 2 |
107 | 107 | ||
108 | #define WM831X_GPIO_CONFIGURE 0x10000 | ||
109 | #define WM831X_GPIO_NUM 16 | ||
110 | |||
108 | struct wm831x_pdata { | 111 | struct wm831x_pdata { |
109 | /** Used to distinguish multiple WM831x chips */ | 112 | /** Used to distinguish multiple WM831x chips */ |
110 | int wm831x_num; | 113 | int wm831x_num; |
@@ -119,6 +122,7 @@ struct wm831x_pdata { | |||
119 | 122 | ||
120 | int irq_base; | 123 | int irq_base; |
121 | int gpio_base; | 124 | int gpio_base; |
125 | int gpio_defaults[WM831X_GPIO_NUM]; | ||
122 | struct wm831x_backlight_pdata *backlight; | 126 | struct wm831x_backlight_pdata *backlight; |
123 | struct wm831x_backup_pdata *backup; | 127 | struct wm831x_backup_pdata *backup; |
124 | struct wm831x_battery_pdata *battery; | 128 | struct wm831x_battery_pdata *battery; |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 466b1c777aff..d12f8d635a81 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -32,6 +32,10 @@ struct wm8994_ldo_pdata { | |||
32 | #define WM8994_EQ_REGS 20 | 32 | #define WM8994_EQ_REGS 20 |
33 | #define WM8958_MBC_CUTOFF_REGS 20 | 33 | #define WM8958_MBC_CUTOFF_REGS 20 |
34 | #define WM8958_MBC_COEFF_REGS 48 | 34 | #define WM8958_MBC_COEFF_REGS 48 |
35 | #define WM8958_MBC_COMBINED_REGS 56 | ||
36 | #define WM8958_VSS_HPF_REGS 2 | ||
37 | #define WM8958_VSS_REGS 148 | ||
38 | #define WM8958_ENH_EQ_REGS 32 | ||
35 | 39 | ||
36 | /** | 40 | /** |
37 | * DRC configurations are specified with a label and a set of register | 41 | * DRC configurations are specified with a label and a set of register |
@@ -71,6 +75,42 @@ struct wm8958_mbc_cfg { | |||
71 | const char *name; | 75 | const char *name; |
72 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; | 76 | u16 cutoff_regs[WM8958_MBC_CUTOFF_REGS]; |
73 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; | 77 | u16 coeff_regs[WM8958_MBC_COEFF_REGS]; |
78 | |||
79 | /* Coefficient layout when using MBC+VSS firmware */ | ||
80 | u16 combined_regs[WM8958_MBC_COMBINED_REGS]; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * VSS HPF configurations are specified with a label and two values to | ||
85 | * write. Configurations are expected to be generated using the | ||
86 | * multiband compressor configuration panel in WISCE - see | ||
87 | * http://www.wolfsonmicro.com/wisce/ | ||
88 | */ | ||
89 | struct wm8958_vss_hpf_cfg { | ||
90 | const char *name; | ||
91 | u16 regs[WM8958_VSS_HPF_REGS]; | ||
92 | }; | ||
93 | |||
94 | /** | ||
95 | * VSS configurations are specified with a label and array of values | ||
96 | * to write. Configurations are expected to be generated using the | ||
97 | * multiband compressor configuration panel in WISCE - see | ||
98 | * http://www.wolfsonmicro.com/wisce/ | ||
99 | */ | ||
100 | struct wm8958_vss_cfg { | ||
101 | const char *name; | ||
102 | u16 regs[WM8958_VSS_REGS]; | ||
103 | }; | ||
104 | |||
105 | /** | ||
106 | * Enhanced EQ configurations are specified with a label and array of | ||
107 | * values to write. Configurations are expected to be generated using | ||
108 | * the multiband compressor configuration panel in WISCE - see | ||
109 | * http://www.wolfsonmicro.com/wisce/ | ||
110 | */ | ||
111 | struct wm8958_enh_eq_cfg { | ||
112 | const char *name; | ||
113 | u16 regs[WM8958_ENH_EQ_REGS]; | ||
74 | }; | 114 | }; |
75 | 115 | ||
76 | struct wm8994_pdata { | 116 | struct wm8994_pdata { |
@@ -95,6 +135,15 @@ struct wm8994_pdata { | |||
95 | int num_mbc_cfgs; | 135 | int num_mbc_cfgs; |
96 | struct wm8958_mbc_cfg *mbc_cfgs; | 136 | struct wm8958_mbc_cfg *mbc_cfgs; |
97 | 137 | ||
138 | int num_vss_cfgs; | ||
139 | struct wm8958_vss_cfg *vss_cfgs; | ||
140 | |||
141 | int num_vss_hpf_cfgs; | ||
142 | struct wm8958_vss_hpf_cfg *vss_hpf_cfgs; | ||
143 | |||
144 | int num_enh_eq_cfgs; | ||
145 | struct wm8958_enh_eq_cfg *enh_eq_cfgs; | ||
146 | |||
98 | /* LINEOUT can be differential or single ended */ | 147 | /* LINEOUT can be differential or single ended */ |
99 | unsigned int lineout1_diff:1; | 148 | unsigned int lineout1_diff:1; |
100 | unsigned int lineout2_diff:1; | 149 | unsigned int lineout2_diff:1; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6507dde38b16..9670f71d7be9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -153,6 +153,7 @@ extern pgprot_t protection_map[16]; | |||
153 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 153 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ |
154 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | 154 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ |
155 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ | 155 | #define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ |
156 | #define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ | ||
156 | 157 | ||
157 | /* | 158 | /* |
158 | * This interface is used by x86 PAT code to identify a pfn mapping that is | 159 | * This interface is used by x86 PAT code to identify a pfn mapping that is |
@@ -164,12 +165,12 @@ extern pgprot_t protection_map[16]; | |||
164 | */ | 165 | */ |
165 | static inline int is_linear_pfn_mapping(struct vm_area_struct *vma) | 166 | static inline int is_linear_pfn_mapping(struct vm_area_struct *vma) |
166 | { | 167 | { |
167 | return (vma->vm_flags & VM_PFN_AT_MMAP); | 168 | return !!(vma->vm_flags & VM_PFN_AT_MMAP); |
168 | } | 169 | } |
169 | 170 | ||
170 | static inline int is_pfn_mapping(struct vm_area_struct *vma) | 171 | static inline int is_pfn_mapping(struct vm_area_struct *vma) |
171 | { | 172 | { |
172 | return (vma->vm_flags & VM_PFNMAP); | 173 | return !!(vma->vm_flags & VM_PFNMAP); |
173 | } | 174 | } |
174 | 175 | ||
175 | /* | 176 | /* |
@@ -604,10 +605,6 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
604 | #define NODE_NOT_IN_PAGE_FLAGS | 605 | #define NODE_NOT_IN_PAGE_FLAGS |
605 | #endif | 606 | #endif |
606 | 607 | ||
607 | #ifndef PFN_SECTION_SHIFT | ||
608 | #define PFN_SECTION_SHIFT 0 | ||
609 | #endif | ||
610 | |||
611 | /* | 608 | /* |
612 | * Define the bit shifts to access each section. For non-existent | 609 | * Define the bit shifts to access each section. For non-existent |
613 | * sections we define the shift as 0; that plus a 0 mask ensures | 610 | * sections we define the shift as 0; that plus a 0 mask ensures |
@@ -681,6 +678,12 @@ static inline struct zone *page_zone(struct page *page) | |||
681 | } | 678 | } |
682 | 679 | ||
683 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | 680 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) |
681 | static inline void set_page_section(struct page *page, unsigned long section) | ||
682 | { | ||
683 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | ||
684 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | ||
685 | } | ||
686 | |||
684 | static inline unsigned long page_to_section(struct page *page) | 687 | static inline unsigned long page_to_section(struct page *page) |
685 | { | 688 | { |
686 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; | 689 | return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; |
@@ -699,18 +702,14 @@ static inline void set_page_node(struct page *page, unsigned long node) | |||
699 | page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; | 702 | page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; |
700 | } | 703 | } |
701 | 704 | ||
702 | static inline void set_page_section(struct page *page, unsigned long section) | ||
703 | { | ||
704 | page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); | ||
705 | page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; | ||
706 | } | ||
707 | |||
708 | static inline void set_page_links(struct page *page, enum zone_type zone, | 705 | static inline void set_page_links(struct page *page, enum zone_type zone, |
709 | unsigned long node, unsigned long pfn) | 706 | unsigned long node, unsigned long pfn) |
710 | { | 707 | { |
711 | set_page_zone(page, zone); | 708 | set_page_zone(page, zone); |
712 | set_page_node(page, node); | 709 | set_page_node(page, node); |
710 | #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP) | ||
713 | set_page_section(page, pfn_to_section_nr(pfn)); | 711 | set_page_section(page, pfn_to_section_nr(pfn)); |
712 | #endif | ||
714 | } | 713 | } |
715 | 714 | ||
716 | /* | 715 | /* |
@@ -862,26 +861,18 @@ extern void pagefault_out_of_memory(void); | |||
862 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 861 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
863 | 862 | ||
864 | /* | 863 | /* |
865 | * Flags passed to show_mem() and __show_free_areas() to suppress output in | 864 | * Flags passed to show_mem() and show_free_areas() to suppress output in |
866 | * various contexts. | 865 | * various contexts. |
867 | */ | 866 | */ |
868 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ | 867 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ |
869 | 868 | ||
870 | extern void show_free_areas(void); | 869 | extern void show_free_areas(unsigned int flags); |
871 | extern void __show_free_areas(unsigned int flags); | 870 | extern bool skip_free_areas_node(unsigned int flags, int nid); |
872 | 871 | ||
873 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 872 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
874 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | 873 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
875 | int shmem_zero_setup(struct vm_area_struct *); | 874 | int shmem_zero_setup(struct vm_area_struct *); |
876 | 875 | ||
877 | #ifndef CONFIG_MMU | ||
878 | extern unsigned long shmem_get_unmapped_area(struct file *file, | ||
879 | unsigned long addr, | ||
880 | unsigned long len, | ||
881 | unsigned long pgoff, | ||
882 | unsigned long flags); | ||
883 | #endif | ||
884 | |||
885 | extern int can_do_mlock(void); | 876 | extern int can_do_mlock(void); |
886 | extern int user_shm_lock(size_t, struct user_struct *); | 877 | extern int user_shm_lock(size_t, struct user_struct *); |
887 | extern void user_shm_unlock(size_t, struct user_struct *); | 878 | extern void user_shm_unlock(size_t, struct user_struct *); |
@@ -894,8 +885,6 @@ struct zap_details { | |||
894 | struct address_space *check_mapping; /* Check page->mapping if set */ | 885 | struct address_space *check_mapping; /* Check page->mapping if set */ |
895 | pgoff_t first_index; /* Lowest page->index to unmap */ | 886 | pgoff_t first_index; /* Lowest page->index to unmap */ |
896 | pgoff_t last_index; /* Highest page->index to unmap */ | 887 | pgoff_t last_index; /* Highest page->index to unmap */ |
897 | spinlock_t *i_mmap_lock; /* For unmap_mapping_range: */ | ||
898 | unsigned long truncate_count; /* Compare vm_truncate_count */ | ||
899 | }; | 888 | }; |
900 | 889 | ||
901 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | 890 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, |
@@ -905,7 +894,7 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | |||
905 | unsigned long size); | 894 | unsigned long size); |
906 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | 895 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, |
907 | unsigned long size, struct zap_details *); | 896 | unsigned long size, struct zap_details *); |
908 | unsigned long unmap_vmas(struct mmu_gather **tlb, | 897 | unsigned long unmap_vmas(struct mmu_gather *tlb, |
909 | struct vm_area_struct *start_vma, unsigned long start_addr, | 898 | struct vm_area_struct *start_vma, unsigned long start_addr, |
910 | unsigned long end_addr, unsigned long *nr_accounted, | 899 | unsigned long end_addr, unsigned long *nr_accounted, |
911 | struct zap_details *); | 900 | struct zap_details *); |
@@ -1056,65 +1045,35 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
1056 | /* | 1045 | /* |
1057 | * per-process(per-mm_struct) statistics. | 1046 | * per-process(per-mm_struct) statistics. |
1058 | */ | 1047 | */ |
1059 | #if defined(SPLIT_RSS_COUNTING) | ||
1060 | /* | ||
1061 | * The mm counters are not protected by its page_table_lock, | ||
1062 | * so must be incremented atomically. | ||
1063 | */ | ||
1064 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | 1048 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) |
1065 | { | 1049 | { |
1066 | atomic_long_set(&mm->rss_stat.count[member], value); | 1050 | atomic_long_set(&mm->rss_stat.count[member], value); |
1067 | } | 1051 | } |
1068 | 1052 | ||
1053 | #if defined(SPLIT_RSS_COUNTING) | ||
1069 | unsigned long get_mm_counter(struct mm_struct *mm, int member); | 1054 | unsigned long get_mm_counter(struct mm_struct *mm, int member); |
1070 | 1055 | #else | |
1071 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | ||
1072 | { | ||
1073 | atomic_long_add(value, &mm->rss_stat.count[member]); | ||
1074 | } | ||
1075 | |||
1076 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | ||
1077 | { | ||
1078 | atomic_long_inc(&mm->rss_stat.count[member]); | ||
1079 | } | ||
1080 | |||
1081 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | ||
1082 | { | ||
1083 | atomic_long_dec(&mm->rss_stat.count[member]); | ||
1084 | } | ||
1085 | |||
1086 | #else /* !USE_SPLIT_PTLOCKS */ | ||
1087 | /* | ||
1088 | * The mm counters are protected by its page_table_lock, | ||
1089 | * so can be incremented directly. | ||
1090 | */ | ||
1091 | static inline void set_mm_counter(struct mm_struct *mm, int member, long value) | ||
1092 | { | ||
1093 | mm->rss_stat.count[member] = value; | ||
1094 | } | ||
1095 | |||
1096 | static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) | 1056 | static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) |
1097 | { | 1057 | { |
1098 | return mm->rss_stat.count[member]; | 1058 | return atomic_long_read(&mm->rss_stat.count[member]); |
1099 | } | 1059 | } |
1060 | #endif | ||
1100 | 1061 | ||
1101 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) | 1062 | static inline void add_mm_counter(struct mm_struct *mm, int member, long value) |
1102 | { | 1063 | { |
1103 | mm->rss_stat.count[member] += value; | 1064 | atomic_long_add(value, &mm->rss_stat.count[member]); |
1104 | } | 1065 | } |
1105 | 1066 | ||
1106 | static inline void inc_mm_counter(struct mm_struct *mm, int member) | 1067 | static inline void inc_mm_counter(struct mm_struct *mm, int member) |
1107 | { | 1068 | { |
1108 | mm->rss_stat.count[member]++; | 1069 | atomic_long_inc(&mm->rss_stat.count[member]); |
1109 | } | 1070 | } |
1110 | 1071 | ||
1111 | static inline void dec_mm_counter(struct mm_struct *mm, int member) | 1072 | static inline void dec_mm_counter(struct mm_struct *mm, int member) |
1112 | { | 1073 | { |
1113 | mm->rss_stat.count[member]--; | 1074 | atomic_long_dec(&mm->rss_stat.count[member]); |
1114 | } | 1075 | } |
1115 | 1076 | ||
1116 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
1117 | |||
1118 | static inline unsigned long get_mm_rss(struct mm_struct *mm) | 1077 | static inline unsigned long get_mm_rss(struct mm_struct *mm) |
1119 | { | 1078 | { |
1120 | return get_mm_counter(mm, MM_FILEPAGES) + | 1079 | return get_mm_counter(mm, MM_FILEPAGES) + |
@@ -1163,13 +1122,24 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1163 | #endif | 1122 | #endif |
1164 | 1123 | ||
1165 | /* | 1124 | /* |
1125 | * This struct is used to pass information from page reclaim to the shrinkers. | ||
1126 | * We consolidate the values for easier extention later. | ||
1127 | */ | ||
1128 | struct shrink_control { | ||
1129 | gfp_t gfp_mask; | ||
1130 | |||
1131 | /* How many slab objects shrinker() should scan and try to reclaim */ | ||
1132 | unsigned long nr_to_scan; | ||
1133 | }; | ||
1134 | |||
1135 | /* | ||
1166 | * A callback you can register to apply pressure to ageable caches. | 1136 | * A callback you can register to apply pressure to ageable caches. |
1167 | * | 1137 | * |
1168 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should | 1138 | * 'sc' is passed shrink_control which includes a count 'nr_to_scan' |
1169 | * look through the least-recently-used 'nr_to_scan' entries and | 1139 | * and a 'gfpmask'. It should look through the least-recently-used |
1170 | * attempt to free them up. It should return the number of objects | 1140 | * 'nr_to_scan' entries and attempt to free them up. It should return |
1171 | * which remain in the cache. If it returns -1, it means it cannot do | 1141 | * the number of objects which remain in the cache. If it returns -1, it means |
1172 | * any scanning at this time (eg. there is a risk of deadlock). | 1142 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). |
1173 | * | 1143 | * |
1174 | * The 'gfpmask' refers to the allocation we are currently trying to | 1144 | * The 'gfpmask' refers to the allocation we are currently trying to |
1175 | * fulfil. | 1145 | * fulfil. |
@@ -1178,7 +1148,7 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1178 | * querying the cache size, so a fastpath for that case is appropriate. | 1148 | * querying the cache size, so a fastpath for that case is appropriate. |
1179 | */ | 1149 | */ |
1180 | struct shrinker { | 1150 | struct shrinker { |
1181 | int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask); | 1151 | int (*shrink)(struct shrinker *, struct shrink_control *sc); |
1182 | int seeks; /* seeks to recreate an obj */ | 1152 | int seeks; /* seeks to recreate an obj */ |
1183 | 1153 | ||
1184 | /* These are for internal use */ | 1154 | /* These are for internal use */ |
@@ -1380,7 +1350,7 @@ extern void set_dma_reserve(unsigned long new_dma_reserve); | |||
1380 | extern void memmap_init_zone(unsigned long, int, unsigned long, | 1350 | extern void memmap_init_zone(unsigned long, int, unsigned long, |
1381 | unsigned long, enum memmap_context); | 1351 | unsigned long, enum memmap_context); |
1382 | extern void setup_per_zone_wmarks(void); | 1352 | extern void setup_per_zone_wmarks(void); |
1383 | extern void calculate_zone_inactive_ratio(struct zone *zone); | 1353 | extern int __meminit init_per_zone_wmark_min(void); |
1384 | extern void mem_init(void); | 1354 | extern void mem_init(void); |
1385 | extern void __init mmap_init(void); | 1355 | extern void __init mmap_init(void); |
1386 | extern void show_mem(unsigned int flags); | 1356 | extern void show_mem(unsigned int flags); |
@@ -1388,6 +1358,8 @@ extern void si_meminfo(struct sysinfo * val); | |||
1388 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 1358 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
1389 | extern int after_bootmem; | 1359 | extern int after_bootmem; |
1390 | 1360 | ||
1361 | extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); | ||
1362 | |||
1391 | extern void setup_per_cpu_pageset(void); | 1363 | extern void setup_per_cpu_pageset(void); |
1392 | 1364 | ||
1393 | extern void zone_pcp_update(struct zone *zone); | 1365 | extern void zone_pcp_update(struct zone *zone); |
@@ -1436,17 +1408,11 @@ extern void exit_mmap(struct mm_struct *); | |||
1436 | extern int mm_take_all_locks(struct mm_struct *mm); | 1408 | extern int mm_take_all_locks(struct mm_struct *mm); |
1437 | extern void mm_drop_all_locks(struct mm_struct *mm); | 1409 | extern void mm_drop_all_locks(struct mm_struct *mm); |
1438 | 1410 | ||
1439 | #ifdef CONFIG_PROC_FS | ||
1440 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ | 1411 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ |
1441 | extern void added_exe_file_vma(struct mm_struct *mm); | 1412 | extern void added_exe_file_vma(struct mm_struct *mm); |
1442 | extern void removed_exe_file_vma(struct mm_struct *mm); | 1413 | extern void removed_exe_file_vma(struct mm_struct *mm); |
1443 | #else | 1414 | extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); |
1444 | static inline void added_exe_file_vma(struct mm_struct *mm) | 1415 | extern struct file *get_mm_exe_file(struct mm_struct *mm); |
1445 | {} | ||
1446 | |||
1447 | static inline void removed_exe_file_vma(struct mm_struct *mm) | ||
1448 | {} | ||
1449 | #endif /* CONFIG_PROC_FS */ | ||
1450 | 1416 | ||
1451 | extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); | 1417 | extern int may_expand_vm(struct mm_struct *mm, unsigned long npages); |
1452 | extern int install_special_mapping(struct mm_struct *mm, | 1418 | extern int install_special_mapping(struct mm_struct *mm, |
@@ -1460,7 +1426,7 @@ extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1460 | unsigned long flag, unsigned long pgoff); | 1426 | unsigned long flag, unsigned long pgoff); |
1461 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1427 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
1462 | unsigned long len, unsigned long flags, | 1428 | unsigned long len, unsigned long flags, |
1463 | unsigned int vm_flags, unsigned long pgoff); | 1429 | vm_flags_t vm_flags, unsigned long pgoff); |
1464 | 1430 | ||
1465 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, | 1431 | static inline unsigned long do_mmap(struct file *file, unsigned long addr, |
1466 | unsigned long len, unsigned long prot, | 1432 | unsigned long len, unsigned long prot, |
@@ -1517,15 +1483,17 @@ unsigned long ra_submit(struct file_ra_state *ra, | |||
1517 | struct address_space *mapping, | 1483 | struct address_space *mapping, |
1518 | struct file *filp); | 1484 | struct file *filp); |
1519 | 1485 | ||
1520 | /* Do stack extension */ | 1486 | /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ |
1521 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1487 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
1488 | |||
1489 | /* CONFIG_STACK_GROWSUP still needs to to grow downwards at some places */ | ||
1490 | extern int expand_downwards(struct vm_area_struct *vma, | ||
1491 | unsigned long address); | ||
1522 | #if VM_GROWSUP | 1492 | #if VM_GROWSUP |
1523 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1493 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1524 | #else | 1494 | #else |
1525 | #define expand_upwards(vma, address) do { } while (0) | 1495 | #define expand_upwards(vma, address) do { } while (0) |
1526 | #endif | 1496 | #endif |
1527 | extern int expand_stack_downwards(struct vm_area_struct *vma, | ||
1528 | unsigned long address); | ||
1529 | 1497 | ||
1530 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1498 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
1531 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 1499 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |
@@ -1627,8 +1595,9 @@ int in_gate_area_no_mm(unsigned long addr); | |||
1627 | 1595 | ||
1628 | int drop_caches_sysctl_handler(struct ctl_table *, int, | 1596 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
1629 | void __user *, size_t *, loff_t *); | 1597 | void __user *, size_t *, loff_t *); |
1630 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1598 | unsigned long shrink_slab(struct shrink_control *shrink, |
1631 | unsigned long lru_pages); | 1599 | unsigned long nr_pages_scanned, |
1600 | unsigned long lru_pages); | ||
1632 | 1601 | ||
1633 | #ifndef CONFIG_MMU | 1602 | #ifndef CONFIG_MMU |
1634 | #define randomize_va_space 0 | 1603 | #define randomize_va_space 0 |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 02aa5619709b..027935c86c68 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -102,6 +102,8 @@ struct page { | |||
102 | #endif | 102 | #endif |
103 | }; | 103 | }; |
104 | 104 | ||
105 | typedef unsigned long __nocast vm_flags_t; | ||
106 | |||
105 | /* | 107 | /* |
106 | * A region containing a mapping of a non-memory backed file under NOMMU | 108 | * A region containing a mapping of a non-memory backed file under NOMMU |
107 | * conditions. These are held in a global tree and are pinned by the VMAs that | 109 | * conditions. These are held in a global tree and are pinned by the VMAs that |
@@ -109,7 +111,7 @@ struct page { | |||
109 | */ | 111 | */ |
110 | struct vm_region { | 112 | struct vm_region { |
111 | struct rb_node vm_rb; /* link in global region tree */ | 113 | struct rb_node vm_rb; /* link in global region tree */ |
112 | unsigned long vm_flags; /* VMA vm_flags */ | 114 | vm_flags_t vm_flags; /* VMA vm_flags */ |
113 | unsigned long vm_start; /* start address of region */ | 115 | unsigned long vm_start; /* start address of region */ |
114 | unsigned long vm_end; /* region initialised to here */ | 116 | unsigned long vm_end; /* region initialised to here */ |
115 | unsigned long vm_top; /* region allocated to here */ | 117 | unsigned long vm_top; /* region allocated to here */ |
@@ -175,7 +177,6 @@ struct vm_area_struct { | |||
175 | units, *not* PAGE_CACHE_SIZE */ | 177 | units, *not* PAGE_CACHE_SIZE */ |
176 | struct file * vm_file; /* File we map to (can be NULL). */ | 178 | struct file * vm_file; /* File we map to (can be NULL). */ |
177 | void * vm_private_data; /* was vm_pte (shared mem) */ | 179 | void * vm_private_data; /* was vm_pte (shared mem) */ |
178 | unsigned long vm_truncate_count;/* truncate_count or restart_addr */ | ||
179 | 180 | ||
180 | #ifndef CONFIG_MMU | 181 | #ifndef CONFIG_MMU |
181 | struct vm_region *vm_region; /* NOMMU mapping region */ | 182 | struct vm_region *vm_region; /* NOMMU mapping region */ |
@@ -205,19 +206,16 @@ enum { | |||
205 | 206 | ||
206 | #if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) | 207 | #if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) |
207 | #define SPLIT_RSS_COUNTING | 208 | #define SPLIT_RSS_COUNTING |
208 | struct mm_rss_stat { | ||
209 | atomic_long_t count[NR_MM_COUNTERS]; | ||
210 | }; | ||
211 | /* per-thread cached information, */ | 209 | /* per-thread cached information, */ |
212 | struct task_rss_stat { | 210 | struct task_rss_stat { |
213 | int events; /* for synchronization threshold */ | 211 | int events; /* for synchronization threshold */ |
214 | int count[NR_MM_COUNTERS]; | 212 | int count[NR_MM_COUNTERS]; |
215 | }; | 213 | }; |
216 | #else /* !USE_SPLIT_PTLOCKS */ | 214 | #endif /* USE_SPLIT_PTLOCKS */ |
215 | |||
217 | struct mm_rss_stat { | 216 | struct mm_rss_stat { |
218 | unsigned long count[NR_MM_COUNTERS]; | 217 | atomic_long_t count[NR_MM_COUNTERS]; |
219 | }; | 218 | }; |
220 | #endif /* !USE_SPLIT_PTLOCKS */ | ||
221 | 219 | ||
222 | struct mm_struct { | 220 | struct mm_struct { |
223 | struct vm_area_struct * mmap; /* list of VMAs */ | 221 | struct vm_area_struct * mmap; /* list of VMAs */ |
@@ -266,7 +264,7 @@ struct mm_struct { | |||
266 | 264 | ||
267 | struct linux_binfmt *binfmt; | 265 | struct linux_binfmt *binfmt; |
268 | 266 | ||
269 | cpumask_t cpu_vm_mask; | 267 | cpumask_var_t cpu_vm_mask_var; |
270 | 268 | ||
271 | /* Architecture-specific MM context */ | 269 | /* Architecture-specific MM context */ |
272 | mm_context_t context; | 270 | mm_context_t context; |
@@ -306,20 +304,31 @@ struct mm_struct { | |||
306 | struct task_struct __rcu *owner; | 304 | struct task_struct __rcu *owner; |
307 | #endif | 305 | #endif |
308 | 306 | ||
309 | #ifdef CONFIG_PROC_FS | ||
310 | /* store ref to file /proc/<pid>/exe symlink points to */ | 307 | /* store ref to file /proc/<pid>/exe symlink points to */ |
311 | struct file *exe_file; | 308 | struct file *exe_file; |
312 | unsigned long num_exe_file_vmas; | 309 | unsigned long num_exe_file_vmas; |
313 | #endif | ||
314 | #ifdef CONFIG_MMU_NOTIFIER | 310 | #ifdef CONFIG_MMU_NOTIFIER |
315 | struct mmu_notifier_mm *mmu_notifier_mm; | 311 | struct mmu_notifier_mm *mmu_notifier_mm; |
316 | #endif | 312 | #endif |
317 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 313 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
318 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | 314 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ |
319 | #endif | 315 | #endif |
316 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
317 | struct cpumask cpumask_allocation; | ||
318 | #endif | ||
320 | }; | 319 | }; |
321 | 320 | ||
321 | static inline void mm_init_cpumask(struct mm_struct *mm) | ||
322 | { | ||
323 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
324 | mm->cpu_vm_mask_var = &mm->cpumask_allocation; | ||
325 | #endif | ||
326 | } | ||
327 | |||
322 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 328 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |
323 | #define mm_cpumask(mm) (&(mm)->cpu_vm_mask) | 329 | static inline cpumask_t *mm_cpumask(struct mm_struct *mm) |
330 | { | ||
331 | return mm->cpu_vm_mask_var; | ||
332 | } | ||
324 | 333 | ||
325 | #endif /* _LINUX_MM_TYPES_H */ | 334 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild new file mode 100644 index 000000000000..1fb26448faa9 --- /dev/null +++ b/include/linux/mmc/Kbuild | |||
@@ -0,0 +1 @@ | |||
header-y += ioctl.h | |||
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index adb4888248be..c6927a4d157f 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define LINUX_MMC_CARD_H | 11 | #define LINUX_MMC_CARD_H |
12 | 12 | ||
13 | #include <linux/mmc/core.h> | 13 | #include <linux/mmc/core.h> |
14 | #include <linux/mod_devicetable.h> | ||
14 | 15 | ||
15 | struct mmc_cid { | 16 | struct mmc_cid { |
16 | unsigned int manfid; | 17 | unsigned int manfid; |
@@ -29,6 +30,7 @@ struct mmc_csd { | |||
29 | unsigned short cmdclass; | 30 | unsigned short cmdclass; |
30 | unsigned short tacc_clks; | 31 | unsigned short tacc_clks; |
31 | unsigned int tacc_ns; | 32 | unsigned int tacc_ns; |
33 | unsigned int c_size; | ||
32 | unsigned int r2w_factor; | 34 | unsigned int r2w_factor; |
33 | unsigned int max_dtr; | 35 | unsigned int max_dtr; |
34 | unsigned int erase_size; /* In sectors */ | 36 | unsigned int erase_size; /* In sectors */ |
@@ -45,6 +47,10 @@ struct mmc_ext_csd { | |||
45 | u8 rev; | 47 | u8 rev; |
46 | u8 erase_group_def; | 48 | u8 erase_group_def; |
47 | u8 sec_feature_support; | 49 | u8 sec_feature_support; |
50 | u8 rel_sectors; | ||
51 | u8 rel_param; | ||
52 | u8 part_config; | ||
53 | unsigned int part_time; /* Units: ms */ | ||
48 | unsigned int sa_timeout; /* Units: 100ns */ | 54 | unsigned int sa_timeout; /* Units: 100ns */ |
49 | unsigned int hs_max_dtr; | 55 | unsigned int hs_max_dtr; |
50 | unsigned int sectors; | 56 | unsigned int sectors; |
@@ -57,13 +63,18 @@ struct mmc_ext_csd { | |||
57 | bool enhanced_area_en; /* enable bit */ | 63 | bool enhanced_area_en; /* enable bit */ |
58 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
59 | unsigned int enhanced_area_size; /* Units: KB */ | 65 | unsigned int enhanced_area_size; /* Units: KB */ |
66 | unsigned int boot_size; /* in bytes */ | ||
60 | }; | 67 | }; |
61 | 68 | ||
62 | struct sd_scr { | 69 | struct sd_scr { |
63 | unsigned char sda_vsn; | 70 | unsigned char sda_vsn; |
71 | unsigned char sda_spec3; | ||
64 | unsigned char bus_widths; | 72 | unsigned char bus_widths; |
65 | #define SD_SCR_BUS_WIDTH_1 (1<<0) | 73 | #define SD_SCR_BUS_WIDTH_1 (1<<0) |
66 | #define SD_SCR_BUS_WIDTH_4 (1<<2) | 74 | #define SD_SCR_BUS_WIDTH_4 (1<<2) |
75 | unsigned char cmds; | ||
76 | #define SD_SCR_CMD20_SUPPORT (1<<0) | ||
77 | #define SD_SCR_CMD23_SUPPORT (1<<1) | ||
67 | }; | 78 | }; |
68 | 79 | ||
69 | struct sd_ssr { | 80 | struct sd_ssr { |
@@ -74,6 +85,39 @@ struct sd_ssr { | |||
74 | 85 | ||
75 | struct sd_switch_caps { | 86 | struct sd_switch_caps { |
76 | unsigned int hs_max_dtr; | 87 | unsigned int hs_max_dtr; |
88 | unsigned int uhs_max_dtr; | ||
89 | #define UHS_SDR104_MAX_DTR 208000000 | ||
90 | #define UHS_SDR50_MAX_DTR 100000000 | ||
91 | #define UHS_DDR50_MAX_DTR 50000000 | ||
92 | #define UHS_SDR25_MAX_DTR UHS_DDR50_MAX_DTR | ||
93 | #define UHS_SDR12_MAX_DTR 25000000 | ||
94 | unsigned int sd3_bus_mode; | ||
95 | #define UHS_SDR12_BUS_SPEED 0 | ||
96 | #define UHS_SDR25_BUS_SPEED 1 | ||
97 | #define UHS_SDR50_BUS_SPEED 2 | ||
98 | #define UHS_SDR104_BUS_SPEED 3 | ||
99 | #define UHS_DDR50_BUS_SPEED 4 | ||
100 | |||
101 | #define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) | ||
102 | #define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) | ||
103 | #define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) | ||
104 | #define SD_MODE_UHS_SDR104 (1 << UHS_SDR104_BUS_SPEED) | ||
105 | #define SD_MODE_UHS_DDR50 (1 << UHS_DDR50_BUS_SPEED) | ||
106 | unsigned int sd3_drv_type; | ||
107 | #define SD_DRIVER_TYPE_B 0x01 | ||
108 | #define SD_DRIVER_TYPE_A 0x02 | ||
109 | #define SD_DRIVER_TYPE_C 0x04 | ||
110 | #define SD_DRIVER_TYPE_D 0x08 | ||
111 | unsigned int sd3_curr_limit; | ||
112 | #define SD_SET_CURRENT_LIMIT_200 0 | ||
113 | #define SD_SET_CURRENT_LIMIT_400 1 | ||
114 | #define SD_SET_CURRENT_LIMIT_600 2 | ||
115 | #define SD_SET_CURRENT_LIMIT_800 3 | ||
116 | |||
117 | #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) | ||
118 | #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400) | ||
119 | #define SD_MAX_CURRENT_600 (1 << SD_SET_CURRENT_LIMIT_600) | ||
120 | #define SD_MAX_CURRENT_800 (1 << SD_SET_CURRENT_LIMIT_800) | ||
77 | }; | 121 | }; |
78 | 122 | ||
79 | struct sdio_cccr { | 123 | struct sdio_cccr { |
@@ -118,6 +162,8 @@ struct mmc_card { | |||
118 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 162 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
119 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 163 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
120 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ | 164 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ |
165 | #define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ | ||
166 | #define MMC_CARD_SDXC (1<<6) /* card is SDXC */ | ||
121 | unsigned int quirks; /* card quirks */ | 167 | unsigned int quirks; /* card quirks */ |
122 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 168 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
123 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | 169 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ |
@@ -125,6 +171,10 @@ struct mmc_card { | |||
125 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ | 171 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ |
126 | /* (missing CIA registers) */ | 172 | /* (missing CIA registers) */ |
127 | #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */ | 173 | #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */ |
174 | #define MMC_QUIRK_NONSTD_FUNC_IF (1<<4) /* SDIO card has nonstd function interfaces */ | ||
175 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ | ||
176 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ | ||
177 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | ||
128 | 178 | ||
129 | unsigned int erase_size; /* erase size in sectors */ | 179 | unsigned int erase_size; /* erase size in sectors */ |
130 | unsigned int erase_shift; /* if erase unit is power 2 */ | 180 | unsigned int erase_shift; /* if erase unit is power 2 */ |
@@ -145,14 +195,100 @@ struct mmc_card { | |||
145 | struct sdio_cccr cccr; /* common card info */ | 195 | struct sdio_cccr cccr; /* common card info */ |
146 | struct sdio_cis cis; /* common tuple info */ | 196 | struct sdio_cis cis; /* common tuple info */ |
147 | struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ | 197 | struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */ |
198 | struct sdio_func *sdio_single_irq; /* SDIO function when only one IRQ active */ | ||
148 | unsigned num_info; /* number of info strings */ | 199 | unsigned num_info; /* number of info strings */ |
149 | const char **info; /* info strings */ | 200 | const char **info; /* info strings */ |
150 | struct sdio_func_tuple *tuples; /* unknown common tuples */ | 201 | struct sdio_func_tuple *tuples; /* unknown common tuples */ |
151 | 202 | ||
203 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ | ||
204 | |||
152 | struct dentry *debugfs_root; | 205 | struct dentry *debugfs_root; |
153 | }; | 206 | }; |
154 | 207 | ||
155 | void mmc_fixup_device(struct mmc_card *dev); | 208 | /* |
209 | * The world is not perfect and supplies us with broken mmc/sdio devices. | ||
210 | * For at least some of these bugs we need a work-around. | ||
211 | */ | ||
212 | |||
213 | struct mmc_fixup { | ||
214 | /* CID-specific fields. */ | ||
215 | const char *name; | ||
216 | |||
217 | /* Valid revision range */ | ||
218 | u64 rev_start, rev_end; | ||
219 | |||
220 | unsigned int manfid; | ||
221 | unsigned short oemid; | ||
222 | |||
223 | /* SDIO-specfic fields. You can use SDIO_ANY_ID here of course */ | ||
224 | u16 cis_vendor, cis_device; | ||
225 | |||
226 | void (*vendor_fixup)(struct mmc_card *card, int data); | ||
227 | int data; | ||
228 | }; | ||
229 | |||
230 | #define CID_MANFID_ANY (-1u) | ||
231 | #define CID_OEMID_ANY ((unsigned short) -1) | ||
232 | #define CID_NAME_ANY (NULL) | ||
233 | |||
234 | #define END_FIXUP { 0 } | ||
235 | |||
236 | #define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end, \ | ||
237 | _cis_vendor, _cis_device, \ | ||
238 | _fixup, _data) \ | ||
239 | { \ | ||
240 | .name = (_name), \ | ||
241 | .manfid = (_manfid), \ | ||
242 | .oemid = (_oemid), \ | ||
243 | .rev_start = (_rev_start), \ | ||
244 | .rev_end = (_rev_end), \ | ||
245 | .cis_vendor = (_cis_vendor), \ | ||
246 | .cis_device = (_cis_device), \ | ||
247 | .vendor_fixup = (_fixup), \ | ||
248 | .data = (_data), \ | ||
249 | } | ||
250 | |||
251 | #define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end, \ | ||
252 | _fixup, _data) \ | ||
253 | _FIXUP_EXT(_name, _manfid, \ | ||
254 | _oemid, _rev_start, _rev_end, \ | ||
255 | SDIO_ANY_ID, SDIO_ANY_ID, \ | ||
256 | _fixup, _data) \ | ||
257 | |||
258 | #define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \ | ||
259 | MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data) | ||
260 | |||
261 | #define SDIO_FIXUP(_vendor, _device, _fixup, _data) \ | ||
262 | _FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY, \ | ||
263 | CID_OEMID_ANY, 0, -1ull, \ | ||
264 | _vendor, _device, \ | ||
265 | _fixup, _data) \ | ||
266 | |||
267 | #define cid_rev(hwrev, fwrev, year, month) \ | ||
268 | (((u64) hwrev) << 40 | \ | ||
269 | ((u64) fwrev) << 32 | \ | ||
270 | ((u64) year) << 16 | \ | ||
271 | ((u64) month)) | ||
272 | |||
273 | #define cid_rev_card(card) \ | ||
274 | cid_rev(card->cid.hwrev, \ | ||
275 | card->cid.fwrev, \ | ||
276 | card->cid.year, \ | ||
277 | card->cid.month) | ||
278 | |||
279 | /* | ||
280 | * Unconditionally quirk add/remove. | ||
281 | */ | ||
282 | |||
283 | static inline void __maybe_unused add_quirk(struct mmc_card *card, int data) | ||
284 | { | ||
285 | card->quirks |= data; | ||
286 | } | ||
287 | |||
288 | static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | ||
289 | { | ||
290 | card->quirks &= ~data; | ||
291 | } | ||
156 | 292 | ||
157 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) | 293 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) |
158 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) | 294 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) |
@@ -163,12 +299,50 @@ void mmc_fixup_device(struct mmc_card *dev); | |||
163 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 299 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
164 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 300 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
165 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) | 301 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) |
302 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | ||
303 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) | ||
166 | 304 | ||
167 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 305 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
168 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 306 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
169 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 307 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
170 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 308 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
171 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) | 309 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) |
310 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | ||
311 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) | ||
312 | |||
313 | /* | ||
314 | * Quirk add/remove for MMC products. | ||
315 | */ | ||
316 | |||
317 | static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data) | ||
318 | { | ||
319 | if (mmc_card_mmc(card)) | ||
320 | card->quirks |= data; | ||
321 | } | ||
322 | |||
323 | static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card, | ||
324 | int data) | ||
325 | { | ||
326 | if (mmc_card_mmc(card)) | ||
327 | card->quirks &= ~data; | ||
328 | } | ||
329 | |||
330 | /* | ||
331 | * Quirk add/remove for SD products. | ||
332 | */ | ||
333 | |||
334 | static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data) | ||
335 | { | ||
336 | if (mmc_card_sd(card)) | ||
337 | card->quirks |= data; | ||
338 | } | ||
339 | |||
340 | static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card, | ||
341 | int data) | ||
342 | { | ||
343 | if (mmc_card_sd(card)) | ||
344 | card->quirks &= ~data; | ||
345 | } | ||
172 | 346 | ||
173 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | 347 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) |
174 | { | 348 | { |
@@ -180,6 +354,16 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c) | |||
180 | return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; | 354 | return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; |
181 | } | 355 | } |
182 | 356 | ||
357 | static inline int mmc_card_disable_cd(const struct mmc_card *c) | ||
358 | { | ||
359 | return c->quirks & MMC_QUIRK_DISABLE_CD; | ||
360 | } | ||
361 | |||
362 | static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) | ||
363 | { | ||
364 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; | ||
365 | } | ||
366 | |||
183 | #define mmc_card_name(c) ((c)->cid.prod_name) | 367 | #define mmc_card_name(c) ((c)->cid.prod_name) |
184 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 368 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
185 | 369 | ||
@@ -203,4 +387,7 @@ struct mmc_driver { | |||
203 | extern int mmc_register_driver(struct mmc_driver *); | 387 | extern int mmc_register_driver(struct mmc_driver *); |
204 | extern void mmc_unregister_driver(struct mmc_driver *); | 388 | extern void mmc_unregister_driver(struct mmc_driver *); |
205 | 389 | ||
390 | extern void mmc_fixup_device(struct mmc_card *card, | ||
391 | const struct mmc_fixup *table); | ||
392 | |||
206 | #endif | 393 | #endif |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 07f27af4dba5..b6718e549a51 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -92,7 +92,7 @@ struct mmc_command { | |||
92 | * actively failing requests | 92 | * actively failing requests |
93 | */ | 93 | */ |
94 | 94 | ||
95 | unsigned int erase_timeout; /* in milliseconds */ | 95 | unsigned int cmd_timeout_ms; /* in milliseconds */ |
96 | 96 | ||
97 | struct mmc_data *data; /* data segment associated with cmd */ | 97 | struct mmc_data *data; /* data segment associated with cmd */ |
98 | struct mmc_request *mrq; /* associated request */ | 98 | struct mmc_request *mrq; /* associated request */ |
@@ -120,6 +120,7 @@ struct mmc_data { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct mmc_request { | 122 | struct mmc_request { |
123 | struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ | ||
123 | struct mmc_command *cmd; | 124 | struct mmc_command *cmd; |
124 | struct mmc_data *data; | 125 | struct mmc_data *data; |
125 | struct mmc_command *stop; | 126 | struct mmc_command *stop; |
@@ -133,8 +134,10 @@ struct mmc_card; | |||
133 | 134 | ||
134 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 135 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
135 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 136 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
137 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | ||
136 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | 138 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, |
137 | struct mmc_command *, int); | 139 | struct mmc_command *, int); |
140 | extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | ||
138 | 141 | ||
139 | #define MMC_ERASE_ARG 0x00000000 | 142 | #define MMC_ERASE_ARG 0x00000000 |
140 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 143 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bcb793ec7374..1ee4424462eb 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -50,12 +50,30 @@ struct mmc_ios { | |||
50 | #define MMC_TIMING_LEGACY 0 | 50 | #define MMC_TIMING_LEGACY 0 |
51 | #define MMC_TIMING_MMC_HS 1 | 51 | #define MMC_TIMING_MMC_HS 1 |
52 | #define MMC_TIMING_SD_HS 2 | 52 | #define MMC_TIMING_SD_HS 2 |
53 | #define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY | ||
54 | #define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS | ||
55 | #define MMC_TIMING_UHS_SDR50 3 | ||
56 | #define MMC_TIMING_UHS_SDR104 4 | ||
57 | #define MMC_TIMING_UHS_DDR50 5 | ||
53 | 58 | ||
54 | unsigned char ddr; /* dual data rate used */ | 59 | unsigned char ddr; /* dual data rate used */ |
55 | 60 | ||
56 | #define MMC_SDR_MODE 0 | 61 | #define MMC_SDR_MODE 0 |
57 | #define MMC_1_2V_DDR_MODE 1 | 62 | #define MMC_1_2V_DDR_MODE 1 |
58 | #define MMC_1_8V_DDR_MODE 2 | 63 | #define MMC_1_8V_DDR_MODE 2 |
64 | |||
65 | unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */ | ||
66 | |||
67 | #define MMC_SIGNAL_VOLTAGE_330 0 | ||
68 | #define MMC_SIGNAL_VOLTAGE_180 1 | ||
69 | #define MMC_SIGNAL_VOLTAGE_120 2 | ||
70 | |||
71 | unsigned char drv_type; /* driver type (A, B, C, D) */ | ||
72 | |||
73 | #define MMC_SET_DRIVER_TYPE_B 0 | ||
74 | #define MMC_SET_DRIVER_TYPE_A 1 | ||
75 | #define MMC_SET_DRIVER_TYPE_C 2 | ||
76 | #define MMC_SET_DRIVER_TYPE_D 3 | ||
59 | }; | 77 | }; |
60 | 78 | ||
61 | struct mmc_host_ops { | 79 | struct mmc_host_ops { |
@@ -117,6 +135,10 @@ struct mmc_host_ops { | |||
117 | 135 | ||
118 | /* optional callback for HC quirks */ | 136 | /* optional callback for HC quirks */ |
119 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); | 137 | void (*init_card)(struct mmc_host *host, struct mmc_card *card); |
138 | |||
139 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | ||
140 | int (*execute_tuning)(struct mmc_host *host); | ||
141 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | ||
120 | }; | 142 | }; |
121 | 143 | ||
122 | struct mmc_card; | 144 | struct mmc_card; |
@@ -173,6 +195,22 @@ struct mmc_host { | |||
173 | /* DDR mode at 1.2V */ | 195 | /* DDR mode at 1.2V */ |
174 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ | 196 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ |
175 | #define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ | 197 | #define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ |
198 | #define MMC_CAP_UHS_SDR12 (1 << 15) /* Host supports UHS SDR12 mode */ | ||
199 | #define MMC_CAP_UHS_SDR25 (1 << 16) /* Host supports UHS SDR25 mode */ | ||
200 | #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ | ||
201 | #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ | ||
202 | #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ | ||
203 | #define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */ | ||
204 | #define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */ | ||
205 | #define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */ | ||
206 | #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ | ||
207 | #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ | ||
208 | #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ | ||
209 | #define MMC_CAP_MAX_CURRENT_200 (1 << 26) /* Host max current limit is 200mA */ | ||
210 | #define MMC_CAP_MAX_CURRENT_400 (1 << 27) /* Host max current limit is 400mA */ | ||
211 | #define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ | ||
212 | #define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ | ||
213 | #define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ | ||
176 | 214 | ||
177 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 215 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
178 | 216 | ||
@@ -321,10 +359,19 @@ static inline int mmc_card_is_removable(struct mmc_host *host) | |||
321 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; | 359 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; |
322 | } | 360 | } |
323 | 361 | ||
324 | static inline int mmc_card_is_powered_resumed(struct mmc_host *host) | 362 | static inline int mmc_card_keep_power(struct mmc_host *host) |
325 | { | 363 | { |
326 | return host->pm_flags & MMC_PM_KEEP_POWER; | 364 | return host->pm_flags & MMC_PM_KEEP_POWER; |
327 | } | 365 | } |
328 | 366 | ||
367 | static inline int mmc_card_wake_sdio_irq(struct mmc_host *host) | ||
368 | { | ||
369 | return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ; | ||
370 | } | ||
371 | |||
372 | static inline int mmc_host_cmd23(struct mmc_host *host) | ||
373 | { | ||
374 | return host->caps & MMC_CAP_CMD23; | ||
375 | } | ||
329 | #endif | 376 | #endif |
330 | 377 | ||
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h new file mode 100644 index 000000000000..5baf2983a12f --- /dev/null +++ b/include/linux/mmc/ioctl.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef LINUX_MMC_IOCTL_H | ||
2 | #define LINUX_MMC_IOCTL_H | ||
3 | struct mmc_ioc_cmd { | ||
4 | /* Implies direction of data. true = write, false = read */ | ||
5 | int write_flag; | ||
6 | |||
7 | /* Application-specific command. true = precede with CMD55 */ | ||
8 | int is_acmd; | ||
9 | |||
10 | __u32 opcode; | ||
11 | __u32 arg; | ||
12 | __u32 response[4]; /* CMD response */ | ||
13 | unsigned int flags; | ||
14 | unsigned int blksz; | ||
15 | unsigned int blocks; | ||
16 | |||
17 | /* | ||
18 | * Sleep at least postsleep_min_us useconds, and at most | ||
19 | * postsleep_max_us useconds *after* issuing command. Needed for | ||
20 | * some read commands for which cards have no other way of indicating | ||
21 | * they're ready for the next command (i.e. there is no equivalent of | ||
22 | * a "busy" indicator for read operations). | ||
23 | */ | ||
24 | unsigned int postsleep_min_us; | ||
25 | unsigned int postsleep_max_us; | ||
26 | |||
27 | /* | ||
28 | * Override driver-computed timeouts. Note the difference in units! | ||
29 | */ | ||
30 | unsigned int data_timeout_ns; | ||
31 | unsigned int cmd_timeout_ms; | ||
32 | |||
33 | /* | ||
34 | * For 64-bit machines, the next member, ``__u64 data_ptr``, wants to | ||
35 | * be 8-byte aligned. Make sure this struct is the same size when | ||
36 | * built for 32-bit. | ||
37 | */ | ||
38 | __u32 __pad; | ||
39 | |||
40 | /* DAT buffer */ | ||
41 | __u64 data_ptr; | ||
42 | }; | ||
43 | #define mmc_ioc_cmd_set_data(ic, ptr) ic.data_ptr = (__u64)(unsigned long) ptr | ||
44 | |||
45 | #define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd) | ||
46 | |||
47 | /* | ||
48 | * Since this ioctl is only meant to enhance (and not replace) normal access | ||
49 | * to the mmc bus device, an upper data transfer limit of MMC_IOC_MAX_BYTES | ||
50 | * is enforced per ioctl call. For larger data transfers, use the normal | ||
51 | * block device operations. | ||
52 | */ | ||
53 | #define MMC_IOC_MAX_BYTES (512L * 256) | ||
54 | #endif /* LINUX_MMC_IOCTL_H */ | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 264ba5451e3b..ac26a685cca8 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ | 50 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ |
51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ | 51 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ | 52 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | ||
53 | 54 | ||
54 | /* class 3 */ | 55 | /* class 3 */ |
55 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 56 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
@@ -82,6 +83,12 @@ | |||
82 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ | 83 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ |
83 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ | 84 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ |
84 | 85 | ||
86 | static inline bool mmc_op_multi(u32 opcode) | ||
87 | { | ||
88 | return opcode == MMC_WRITE_MULTIPLE_BLOCK || | ||
89 | opcode == MMC_READ_MULTIPLE_BLOCK; | ||
90 | } | ||
91 | |||
85 | /* | 92 | /* |
86 | * MMC_SWITCH argument format: | 93 | * MMC_SWITCH argument format: |
87 | * | 94 | * |
@@ -255,18 +262,23 @@ struct _mmc_csd { | |||
255 | 262 | ||
256 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 263 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
257 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 264 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
265 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | ||
258 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 266 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
267 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | ||
259 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 268 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
260 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 269 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
261 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | 270 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
262 | #define EXT_CSD_REV 192 /* RO */ | 271 | #define EXT_CSD_REV 192 /* RO */ |
263 | #define EXT_CSD_STRUCTURE 194 /* RO */ | 272 | #define EXT_CSD_STRUCTURE 194 /* RO */ |
264 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 273 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
274 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ | ||
265 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 275 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
266 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 276 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
277 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ | ||
267 | #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ | 278 | #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ |
268 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ | 279 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ |
269 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ | 280 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ |
281 | #define EXT_CSD_BOOT_MULT 226 /* RO */ | ||
270 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ | 282 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ |
271 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ | 283 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ |
272 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ | 284 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ |
@@ -276,6 +288,12 @@ struct _mmc_csd { | |||
276 | * EXT_CSD field definitions | 288 | * EXT_CSD field definitions |
277 | */ | 289 | */ |
278 | 290 | ||
291 | #define EXT_CSD_WR_REL_PARAM_EN (1<<2) | ||
292 | |||
293 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | ||
294 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | ||
295 | #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) | ||
296 | |||
279 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 297 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
280 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | 298 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
281 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) | 299 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) |
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h index 3fd85e088cc3..7d35d52c3df3 100644 --- a/include/linux/mmc/sd.h +++ b/include/linux/mmc/sd.h | |||
@@ -17,6 +17,7 @@ | |||
17 | /* This is basically the same command as for MMC with some quirks. */ | 17 | /* This is basically the same command as for MMC with some quirks. */ |
18 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ | 18 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ |
19 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ | 19 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ |
20 | #define SD_SWITCH_VOLTAGE 11 /* ac R1 */ | ||
20 | 21 | ||
21 | /* class 10 */ | 22 | /* class 10 */ |
22 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ | 23 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ |
@@ -32,6 +33,12 @@ | |||
32 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ | 33 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ |
33 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ | 34 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ |
34 | 35 | ||
36 | /* OCR bit definitions */ | ||
37 | #define SD_OCR_S18R (1 << 24) /* 1.8V switching request */ | ||
38 | #define SD_ROCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */ | ||
39 | #define SD_OCR_XPC (1 << 28) /* SDXC power control */ | ||
40 | #define SD_OCR_CCS (1 << 30) /* Card Capacity Status */ | ||
41 | |||
35 | /* | 42 | /* |
36 | * SD_SWITCH argument format: | 43 | * SD_SWITCH argument format: |
37 | * | 44 | * |
@@ -59,7 +66,7 @@ | |||
59 | 66 | ||
60 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ | 67 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ |
61 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ | 68 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ |
62 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ | 69 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00-3.0X */ |
63 | 70 | ||
64 | /* | 71 | /* |
65 | * SD bus widths | 72 | * SD bus widths |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 83bd9f76709a..6a68c4eb4e44 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -85,6 +85,8 @@ struct sdhci_host { | |||
85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) | 85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) |
86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ | 86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ |
87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) | 87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) |
88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ | ||
89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) | ||
88 | 90 | ||
89 | int irq; /* Device IRQ */ | 91 | int irq; /* Device IRQ */ |
90 | void __iomem *ioaddr; /* Mapped address */ | 92 | void __iomem *ioaddr; /* Mapped address */ |
@@ -109,11 +111,16 @@ struct sdhci_host { | |||
109 | #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ | 111 | #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ |
110 | #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ | 112 | #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ |
111 | #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ | 113 | #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ |
114 | #define SDHCI_SDR50_NEEDS_TUNING (1<<4) /* SDR50 needs tuning */ | ||
115 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ | ||
116 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ | ||
117 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | ||
112 | 118 | ||
113 | unsigned int version; /* SDHCI spec. version */ | 119 | unsigned int version; /* SDHCI spec. version */ |
114 | 120 | ||
115 | unsigned int max_clk; /* Max possible freq (MHz) */ | 121 | unsigned int max_clk; /* Max possible freq (MHz) */ |
116 | unsigned int timeout_clk; /* Timeout freq (KHz) */ | 122 | unsigned int timeout_clk; /* Timeout freq (KHz) */ |
123 | unsigned int clk_mul; /* Clock Muliplier value */ | ||
117 | 124 | ||
118 | unsigned int clock; /* Current clock (MHz) */ | 125 | unsigned int clock; /* Current clock (MHz) */ |
119 | u8 pwr; /* Current voltage */ | 126 | u8 pwr; /* Current voltage */ |
@@ -145,6 +152,14 @@ struct sdhci_host { | |||
145 | unsigned int ocr_avail_sd; | 152 | unsigned int ocr_avail_sd; |
146 | unsigned int ocr_avail_mmc; | 153 | unsigned int ocr_avail_mmc; |
147 | 154 | ||
155 | wait_queue_head_t buf_ready_int; /* Waitqueue for Buffer Read Ready interrupt */ | ||
156 | unsigned int tuning_done; /* Condition flag set when CMD19 succeeds */ | ||
157 | |||
158 | unsigned int tuning_count; /* Timer count for re-tuning */ | ||
159 | unsigned int tuning_mode; /* Re-tuning mode supported by host */ | ||
160 | #define SDHCI_TUNING_MODE_1 0 | ||
161 | struct timer_list tuning_timer; /* Timer for tuning */ | ||
162 | |||
148 | unsigned long private[0] ____cacheline_aligned; | 163 | unsigned long private[0] ____cacheline_aligned; |
149 | }; | 164 | }; |
150 | #endif /* __SDHCI_H */ | 165 | #endif /* __SDHCI_H */ |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index c981b959760f..faf32b6ec185 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -3,12 +3,16 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct platform_device; | ||
7 | struct tmio_mmc_data; | ||
8 | |||
6 | struct sh_mobile_sdhi_info { | 9 | struct sh_mobile_sdhi_info { |
7 | int dma_slave_tx; | 10 | int dma_slave_tx; |
8 | int dma_slave_rx; | 11 | int dma_slave_rx; |
9 | unsigned long tmio_flags; | 12 | unsigned long tmio_flags; |
10 | unsigned long tmio_caps; | 13 | unsigned long tmio_caps; |
11 | u32 tmio_ocr_mask; /* available MMC voltages */ | 14 | u32 tmio_ocr_mask; /* available MMC voltages */ |
15 | struct tmio_mmc_data *pdata; | ||
12 | void (*set_pwr)(struct platform_device *pdev, int state); | 16 | void (*set_pwr)(struct platform_device *pdev, int state); |
13 | int (*get_cd)(struct platform_device *pdev); | 17 | int (*get_cd)(struct platform_device *pdev); |
14 | }; | 18 | }; |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index cc2e7dfea9d7..1d1b1e13f79f 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -150,7 +150,7 @@ struct mmu_notifier_ops { | |||
150 | * Therefore notifier chains can only be traversed when either | 150 | * Therefore notifier chains can only be traversed when either |
151 | * | 151 | * |
152 | * 1. mmap_sem is held. | 152 | * 1. mmap_sem is held. |
153 | * 2. One of the reverse map locks is held (i_mmap_lock or anon_vma->lock). | 153 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex). |
154 | * 3. No other concurrent thread can access the list (release) | 154 | * 3. No other concurrent thread can access the list (release) |
155 | */ | 155 | */ |
156 | struct mmu_notifier { | 156 | struct mmu_notifier { |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e56f835274c9..c928dac6cad0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -273,11 +273,6 @@ struct zone_reclaim_stat { | |||
273 | */ | 273 | */ |
274 | unsigned long recent_rotated[2]; | 274 | unsigned long recent_rotated[2]; |
275 | unsigned long recent_scanned[2]; | 275 | unsigned long recent_scanned[2]; |
276 | |||
277 | /* | ||
278 | * accumulated for batching | ||
279 | */ | ||
280 | unsigned long nr_saved_scan[NR_LRU_LISTS]; | ||
281 | }; | 276 | }; |
282 | 277 | ||
283 | struct zone { | 278 | struct zone { |
@@ -928,9 +923,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
928 | #define pfn_to_nid(pfn) (0) | 923 | #define pfn_to_nid(pfn) (0) |
929 | #endif | 924 | #endif |
930 | 925 | ||
931 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
932 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
933 | |||
934 | #ifdef CONFIG_SPARSEMEM | 926 | #ifdef CONFIG_SPARSEMEM |
935 | 927 | ||
936 | /* | 928 | /* |
@@ -956,6 +948,12 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn) | |||
956 | #error Allocator MAX_ORDER exceeds SECTION_SIZE | 948 | #error Allocator MAX_ORDER exceeds SECTION_SIZE |
957 | #endif | 949 | #endif |
958 | 950 | ||
951 | #define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) | ||
952 | #define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) | ||
953 | |||
954 | #define SECTION_ALIGN_UP(pfn) (((pfn) + PAGES_PER_SECTION - 1) & PAGE_SECTION_MASK) | ||
955 | #define SECTION_ALIGN_DOWN(pfn) ((pfn) & PAGE_SECTION_MASK) | ||
956 | |||
959 | struct page; | 957 | struct page; |
960 | struct page_cgroup; | 958 | struct page_cgroup; |
961 | struct mem_section { | 959 | struct mem_section { |
@@ -1053,12 +1051,14 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn) | |||
1053 | return __nr_to_section(pfn_to_section_nr(pfn)); | 1051 | return __nr_to_section(pfn_to_section_nr(pfn)); |
1054 | } | 1052 | } |
1055 | 1053 | ||
1054 | #ifndef CONFIG_HAVE_ARCH_PFN_VALID | ||
1056 | static inline int pfn_valid(unsigned long pfn) | 1055 | static inline int pfn_valid(unsigned long pfn) |
1057 | { | 1056 | { |
1058 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | 1057 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
1059 | return 0; | 1058 | return 0; |
1060 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); | 1059 | return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); |
1061 | } | 1060 | } |
1061 | #endif | ||
1062 | 1062 | ||
1063 | static inline int pfn_present(unsigned long pfn) | 1063 | static inline int pfn_present(unsigned long pfn) |
1064 | { | 1064 | { |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 48c007dae476..ae28e93fd072 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -382,6 +382,23 @@ struct ssb_device_id { | |||
382 | #define SSB_ANY_ID 0xFFFF | 382 | #define SSB_ANY_ID 0xFFFF |
383 | #define SSB_ANY_REV 0xFF | 383 | #define SSB_ANY_REV 0xFF |
384 | 384 | ||
385 | /* Broadcom's specific AMBA core, see drivers/bcma/ */ | ||
386 | struct bcma_device_id { | ||
387 | __u16 manuf; | ||
388 | __u16 id; | ||
389 | __u8 rev; | ||
390 | __u8 class; | ||
391 | }; | ||
392 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | ||
393 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | ||
394 | #define BCMA_CORETABLE_END \ | ||
395 | { 0, }, | ||
396 | |||
397 | #define BCMA_ANY_MANUF 0xFFFF | ||
398 | #define BCMA_ANY_ID 0xFFFF | ||
399 | #define BCMA_ANY_REV 0xFF | ||
400 | #define BCMA_ANY_CLASS 0xFF | ||
401 | |||
385 | struct virtio_device_id { | 402 | struct virtio_device_id { |
386 | __u32 device; | 403 | __u32 device; |
387 | __u32 vendor; | 404 | __u32 vendor; |
diff --git a/include/linux/module.h b/include/linux/module.h index 5de42043dff0..d9ca2d5dc6d0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -64,6 +64,9 @@ struct module_version_attribute { | |||
64 | const char *version; | 64 | const char *version; |
65 | } __attribute__ ((__aligned__(sizeof(void *)))); | 65 | } __attribute__ ((__aligned__(sizeof(void *)))); |
66 | 66 | ||
67 | extern ssize_t __modver_version_show(struct module_attribute *, | ||
68 | struct module *, char *); | ||
69 | |||
67 | struct module_kobject | 70 | struct module_kobject |
68 | { | 71 | { |
69 | struct kobject kobj; | 72 | struct kobject kobj; |
@@ -172,12 +175,7 @@ extern struct module __this_module; | |||
172 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 175 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
173 | #else | 176 | #else |
174 | #define MODULE_VERSION(_version) \ | 177 | #define MODULE_VERSION(_version) \ |
175 | extern ssize_t __modver_version_show(struct module_attribute *, \ | 178 | static struct module_version_attribute ___modver_attr = { \ |
176 | struct module *, char *); \ | ||
177 | static struct module_version_attribute __modver_version_attr \ | ||
178 | __used \ | ||
179 | __attribute__ ((__section__ ("__modver"),aligned(sizeof(void *)))) \ | ||
180 | = { \ | ||
181 | .mattr = { \ | 179 | .mattr = { \ |
182 | .attr = { \ | 180 | .attr = { \ |
183 | .name = "version", \ | 181 | .name = "version", \ |
@@ -187,7 +185,10 @@ extern struct module __this_module; | |||
187 | }, \ | 185 | }, \ |
188 | .module_name = KBUILD_MODNAME, \ | 186 | .module_name = KBUILD_MODNAME, \ |
189 | .version = _version, \ | 187 | .version = _version, \ |
190 | } | 188 | }; \ |
189 | static const struct module_version_attribute \ | ||
190 | __used __attribute__ ((__section__ ("__modver"))) \ | ||
191 | * __moduleparam_const __modver_attr = &___modver_attr | ||
191 | #endif | 192 | #endif |
192 | 193 | ||
193 | /* Optional firmware file (or files) needed by the module | 194 | /* Optional firmware file (or files) needed by the module |
@@ -223,7 +224,7 @@ struct module_use { | |||
223 | extern void *__crc_##sym __attribute__((weak)); \ | 224 | extern void *__crc_##sym __attribute__((weak)); \ |
224 | static const unsigned long __kcrctab_##sym \ | 225 | static const unsigned long __kcrctab_##sym \ |
225 | __used \ | 226 | __used \ |
226 | __attribute__((section("__kcrctab" sec), unused)) \ | 227 | __attribute__((section("___kcrctab" sec "+" #sym), unused)) \ |
227 | = (unsigned long) &__crc_##sym; | 228 | = (unsigned long) &__crc_##sym; |
228 | #else | 229 | #else |
229 | #define __CRC_SYMBOL(sym, sec) | 230 | #define __CRC_SYMBOL(sym, sec) |
@@ -238,7 +239,7 @@ struct module_use { | |||
238 | = MODULE_SYMBOL_PREFIX #sym; \ | 239 | = MODULE_SYMBOL_PREFIX #sym; \ |
239 | static const struct kernel_symbol __ksymtab_##sym \ | 240 | static const struct kernel_symbol __ksymtab_##sym \ |
240 | __used \ | 241 | __used \ |
241 | __attribute__((section("__ksymtab" sec), unused)) \ | 242 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ |
242 | = { (unsigned long)&sym, __kstrtab_##sym } | 243 | = { (unsigned long)&sym, __kstrtab_##sym } |
243 | 244 | ||
244 | #define EXPORT_SYMBOL(sym) \ | 245 | #define EXPORT_SYMBOL(sym) \ |
@@ -367,34 +368,35 @@ struct module | |||
367 | struct module_notes_attrs *notes_attrs; | 368 | struct module_notes_attrs *notes_attrs; |
368 | #endif | 369 | #endif |
369 | 370 | ||
371 | /* The command line arguments (may be mangled). People like | ||
372 | keeping pointers to this stuff */ | ||
373 | char *args; | ||
374 | |||
370 | #ifdef CONFIG_SMP | 375 | #ifdef CONFIG_SMP |
371 | /* Per-cpu data. */ | 376 | /* Per-cpu data. */ |
372 | void __percpu *percpu; | 377 | void __percpu *percpu; |
373 | unsigned int percpu_size; | 378 | unsigned int percpu_size; |
374 | #endif | 379 | #endif |
375 | 380 | ||
376 | /* The command line arguments (may be mangled). People like | ||
377 | keeping pointers to this stuff */ | ||
378 | char *args; | ||
379 | #ifdef CONFIG_TRACEPOINTS | 381 | #ifdef CONFIG_TRACEPOINTS |
380 | struct tracepoint * const *tracepoints_ptrs; | ||
381 | unsigned int num_tracepoints; | 382 | unsigned int num_tracepoints; |
383 | struct tracepoint * const *tracepoints_ptrs; | ||
382 | #endif | 384 | #endif |
383 | #ifdef HAVE_JUMP_LABEL | 385 | #ifdef HAVE_JUMP_LABEL |
384 | struct jump_entry *jump_entries; | 386 | struct jump_entry *jump_entries; |
385 | unsigned int num_jump_entries; | 387 | unsigned int num_jump_entries; |
386 | #endif | 388 | #endif |
387 | #ifdef CONFIG_TRACING | 389 | #ifdef CONFIG_TRACING |
388 | const char **trace_bprintk_fmt_start; | ||
389 | unsigned int num_trace_bprintk_fmt; | 390 | unsigned int num_trace_bprintk_fmt; |
391 | const char **trace_bprintk_fmt_start; | ||
390 | #endif | 392 | #endif |
391 | #ifdef CONFIG_EVENT_TRACING | 393 | #ifdef CONFIG_EVENT_TRACING |
392 | struct ftrace_event_call **trace_events; | 394 | struct ftrace_event_call **trace_events; |
393 | unsigned int num_trace_events; | 395 | unsigned int num_trace_events; |
394 | #endif | 396 | #endif |
395 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 397 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
396 | unsigned long *ftrace_callsites; | ||
397 | unsigned int num_ftrace_callsites; | 398 | unsigned int num_ftrace_callsites; |
399 | unsigned long *ftrace_callsites; | ||
398 | #endif | 400 | #endif |
399 | 401 | ||
400 | #ifdef CONFIG_MODULE_UNLOAD | 402 | #ifdef CONFIG_MODULE_UNLOAD |
@@ -475,8 +477,9 @@ const struct kernel_symbol *find_symbol(const char *name, | |||
475 | bool warn); | 477 | bool warn); |
476 | 478 | ||
477 | /* Walk the exported symbol table */ | 479 | /* Walk the exported symbol table */ |
478 | bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner, | 480 | bool each_symbol_section(bool (*fn)(const struct symsearch *arr, |
479 | unsigned int symnum, void *data), void *data); | 481 | struct module *owner, |
482 | void *data), void *data); | ||
480 | 483 | ||
481 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if | 484 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if |
482 | symnum out of range. */ | 485 | symnum out of range. */ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 07b41951e3fa..ddaae98c53f9 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -67,9 +67,9 @@ struct kparam_string { | |||
67 | struct kparam_array | 67 | struct kparam_array |
68 | { | 68 | { |
69 | unsigned int max; | 69 | unsigned int max; |
70 | unsigned int elemsize; | ||
70 | unsigned int *num; | 71 | unsigned int *num; |
71 | const struct kernel_param_ops *ops; | 72 | const struct kernel_param_ops *ops; |
72 | unsigned int elemsize; | ||
73 | void *elem; | 73 | void *elem; |
74 | }; | 74 | }; |
75 | 75 | ||
@@ -371,8 +371,9 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp); | |||
371 | */ | 371 | */ |
372 | #define module_param_array_named(name, array, type, nump, perm) \ | 372 | #define module_param_array_named(name, array, type, nump, perm) \ |
373 | static const struct kparam_array __param_arr_##name \ | 373 | static const struct kparam_array __param_arr_##name \ |
374 | = { ARRAY_SIZE(array), nump, ¶m_ops_##type, \ | 374 | = { .max = ARRAY_SIZE(array), .num = nump, \ |
375 | sizeof(array[0]), array }; \ | 375 | .ops = ¶m_ops_##type, \ |
376 | .elemsize = sizeof(array[0]), .elem = array }; \ | ||
376 | __module_param_call(MODULE_PARAM_PREFIX, name, \ | 377 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
377 | ¶m_array_ops, \ | 378 | ¶m_array_ops, \ |
378 | .arr = &__param_arr_##name, \ | 379 | .arr = &__param_arr_##name, \ |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index b21d567692b2..46caaf44339d 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -244,6 +244,7 @@ struct mfc_cache { | |||
244 | #ifdef __KERNEL__ | 244 | #ifdef __KERNEL__ |
245 | struct rtmsg; | 245 | struct rtmsg; |
246 | extern int ipmr_get_route(struct net *net, struct sk_buff *skb, | 246 | extern int ipmr_get_route(struct net *net, struct sk_buff *skb, |
247 | __be32 saddr, __be32 daddr, | ||
247 | struct rtmsg *rtm, int nowait); | 248 | struct rtmsg *rtm, int nowait); |
248 | #endif | 249 | #endif |
249 | 250 | ||
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 9d5306bad117..2541fb848daa 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -322,9 +322,12 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd) | |||
322 | 322 | ||
323 | /* Kernel-side ioctl definitions */ | 323 | /* Kernel-side ioctl definitions */ |
324 | 324 | ||
325 | extern int add_mtd_device(struct mtd_info *mtd); | 325 | struct mtd_partition; |
326 | extern int del_mtd_device (struct mtd_info *mtd); | ||
327 | 326 | ||
327 | extern int mtd_device_register(struct mtd_info *master, | ||
328 | const struct mtd_partition *parts, | ||
329 | int nr_parts); | ||
330 | extern int mtd_device_unregister(struct mtd_info *master); | ||
328 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); | 331 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); |
329 | extern int __get_mtd_device(struct mtd_info *mtd); | 332 | extern int __get_mtd_device(struct mtd_info *mtd); |
330 | extern void __put_mtd_device(struct mtd_info *mtd); | 333 | extern void __put_mtd_device(struct mtd_info *mtd); |
@@ -348,15 +351,9 @@ int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
348 | int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, | 351 | int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs, |
349 | unsigned long count, loff_t from, size_t *retlen); | 352 | unsigned long count, loff_t from, size_t *retlen); |
350 | 353 | ||
351 | #ifdef CONFIG_MTD_PARTITIONS | 354 | void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); |
355 | |||
352 | void mtd_erase_callback(struct erase_info *instr); | 356 | void mtd_erase_callback(struct erase_info *instr); |
353 | #else | ||
354 | static inline void mtd_erase_callback(struct erase_info *instr) | ||
355 | { | ||
356 | if (instr->callback) | ||
357 | instr->callback(instr); | ||
358 | } | ||
359 | #endif | ||
360 | 357 | ||
361 | /* | 358 | /* |
362 | * Debugging macro and defines | 359 | * Debugging macro and defines |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index d44192740f6f..c2b9ac4fbc4a 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -237,9 +237,9 @@ typedef enum { | |||
237 | * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch | 237 | * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch |
238 | * the OOB area. | 238 | * the OOB area. |
239 | */ | 239 | */ |
240 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 | 240 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00800000 |
241 | /* Create an empty BBT with no vendor information if the BBT is available */ | 241 | /* Create an empty BBT with no vendor information if the BBT is available */ |
242 | #define NAND_CREATE_EMPTY_BBT 0x00200000 | 242 | #define NAND_CREATE_EMPTY_BBT 0x01000000 |
243 | 243 | ||
244 | /* Options set by nand scan */ | 244 | /* Options set by nand scan */ |
245 | /* Nand scan has allocated controller struct */ | 245 | /* Nand scan has allocated controller struct */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 4a0a8ba90a72..3a6f0372fc96 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -16,7 +16,7 @@ | |||
16 | * Partition definition structure: | 16 | * Partition definition structure: |
17 | * | 17 | * |
18 | * An array of struct partition is passed along with a MTD object to | 18 | * An array of struct partition is passed along with a MTD object to |
19 | * add_mtd_partitions() to create them. | 19 | * mtd_device_register() to create them. |
20 | * | 20 | * |
21 | * For each partition, these fields are available: | 21 | * For each partition, these fields are available: |
22 | * name: string that will be used to label the partition's MTD device. | 22 | * name: string that will be used to label the partition's MTD device. |
@@ -49,9 +49,6 @@ struct mtd_partition { | |||
49 | 49 | ||
50 | struct mtd_info; | 50 | struct mtd_info; |
51 | 51 | ||
52 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); | ||
53 | int del_mtd_partitions(struct mtd_info *); | ||
54 | |||
55 | /* | 52 | /* |
56 | * Functions dealing with the various ways of partitioning the space | 53 | * Functions dealing with the various ways of partitioning the space |
57 | */ | 54 | */ |
@@ -73,14 +70,17 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | |||
73 | struct device; | 70 | struct device; |
74 | struct device_node; | 71 | struct device_node; |
75 | 72 | ||
73 | #ifdef CONFIG_MTD_OF_PARTS | ||
76 | int __devinit of_mtd_parse_partitions(struct device *dev, | 74 | int __devinit of_mtd_parse_partitions(struct device *dev, |
77 | struct device_node *node, | 75 | struct device_node *node, |
78 | struct mtd_partition **pparts); | 76 | struct mtd_partition **pparts); |
79 | |||
80 | #ifdef CONFIG_MTD_PARTITIONS | ||
81 | static inline int mtd_has_partitions(void) { return 1; } | ||
82 | #else | 77 | #else |
83 | static inline int mtd_has_partitions(void) { return 0; } | 78 | static inline int of_mtd_parse_partitions(struct device *dev, |
79 | struct device_node *node, | ||
80 | struct mtd_partition **pparts) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 86 | #ifdef CONFIG_MTD_CMDLINE_PARTS |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index bcfd9f777454..e5f21d293c70 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -19,10 +19,13 @@ | |||
19 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
20 | 20 | ||
21 | struct map_info; | 21 | struct map_info; |
22 | struct platform_device; | ||
22 | 23 | ||
23 | struct physmap_flash_data { | 24 | struct physmap_flash_data { |
24 | unsigned int width; | 25 | unsigned int width; |
25 | void (*set_vpp)(struct map_info *, int); | 26 | int (*init)(struct platform_device *); |
27 | void (*exit)(struct platform_device *); | ||
28 | void (*set_vpp)(struct platform_device *, int); | ||
26 | unsigned int nr_parts; | 29 | unsigned int nr_parts; |
27 | unsigned int pfow_base; | 30 | unsigned int pfow_base; |
28 | char *probe_type; | 31 | char *probe_type; |
@@ -35,8 +38,6 @@ struct physmap_flash_data { | |||
35 | void physmap_configure(unsigned long addr, unsigned long size, | 38 | void physmap_configure(unsigned long addr, unsigned long size, |
36 | int bankwidth, void (*set_vpp)(struct map_info *, int) ); | 39 | int bankwidth, void (*set_vpp)(struct map_info *, int) ); |
37 | 40 | ||
38 | #ifdef CONFIG_MTD_PARTITIONS | ||
39 | |||
40 | /* | 41 | /* |
41 | * Machines that wish to do flash partition may want to call this function in | 42 | * Machines that wish to do flash partition may want to call this function in |
42 | * their setup routine. | 43 | * their setup routine. |
@@ -48,6 +49,4 @@ void physmap_configure(unsigned long addr, unsigned long size, | |||
48 | */ | 49 | */ |
49 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); | 50 | void physmap_set_partitions(struct mtd_partition *parts, int num_parts); |
50 | 51 | ||
51 | #endif /* defined(CONFIG_MTD_PARTITIONS) */ | ||
52 | |||
53 | #endif /* __LINUX_MTD_PHYSMAP__ */ | 52 | #endif /* __LINUX_MTD_PHYSMAP__ */ |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 84854edf4436..15da0e99f48a 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __LINUX_UBI_H__ | 21 | #ifndef __LINUX_UBI_H__ |
22 | #define __LINUX_UBI_H__ | 22 | #define __LINUX_UBI_H__ |
23 | 23 | ||
24 | #include <asm/ioctl.h> | 24 | #include <linux/ioctl.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <mtd/ubi-user.h> | 26 | #include <mtd/ubi-user.h> |
27 | 27 | ||
@@ -87,7 +87,7 @@ enum { | |||
87 | * physical eraseblock size and on how much bytes UBI headers consume. But | 87 | * physical eraseblock size and on how much bytes UBI headers consume. But |
88 | * because of the volume alignment (@alignment), the usable size of logical | 88 | * because of the volume alignment (@alignment), the usable size of logical |
89 | * eraseblocks if a volume may be less. The following equation is true: | 89 | * eraseblocks if a volume may be less. The following equation is true: |
90 | * @usable_leb_size = LEB size - (LEB size mod @alignment), | 90 | * @usable_leb_size = LEB size - (LEB size mod @alignment), |
91 | * where LEB size is the logical eraseblock size defined by the UBI device. | 91 | * where LEB size is the logical eraseblock size defined by the UBI device. |
92 | * | 92 | * |
93 | * The alignment is multiple to the minimal flash input/output unit size or %1 | 93 | * The alignment is multiple to the minimal flash input/output unit size or %1 |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 94b48bd40dd7..a940fe435aca 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -51,7 +51,7 @@ struct mutex { | |||
51 | spinlock_t wait_lock; | 51 | spinlock_t wait_lock; |
52 | struct list_head wait_list; | 52 | struct list_head wait_list; |
53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) | 53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) |
54 | struct thread_info *owner; | 54 | struct task_struct *owner; |
55 | #endif | 55 | #endif |
56 | #ifdef CONFIG_DEBUG_MUTEXES | 56 | #ifdef CONFIG_DEBUG_MUTEXES |
57 | const char *name; | 57 | const char *name; |
@@ -132,6 +132,7 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
132 | */ | 132 | */ |
133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 133 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 134 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
135 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); | ||
135 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, | 136 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
136 | unsigned int subclass); | 137 | unsigned int subclass); |
137 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | 138 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, |
@@ -140,6 +141,13 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
140 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) | 141 | #define mutex_lock(lock) mutex_lock_nested(lock, 0) |
141 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) | 142 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) |
142 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) | 143 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) |
144 | |||
145 | #define mutex_lock_nest_lock(lock, nest_lock) \ | ||
146 | do { \ | ||
147 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ | ||
148 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | ||
149 | } while (0) | ||
150 | |||
143 | #else | 151 | #else |
144 | extern void mutex_lock(struct mutex *lock); | 152 | extern void mutex_lock(struct mutex *lock); |
145 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); | 153 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); |
@@ -148,6 +156,7 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
148 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 156 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
149 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 157 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
150 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) | 158 | # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) |
159 | # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) | ||
151 | #endif | 160 | #endif |
152 | 161 | ||
153 | /* | 162 | /* |
diff --git a/include/linux/mxm-wmi.h b/include/linux/mxm-wmi.h new file mode 100644 index 000000000000..617a2950523c --- /dev/null +++ b/include/linux/mxm-wmi.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * MXM WMI driver | ||
3 | * | ||
4 | * Copyright(C) 2010 Red Hat. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef MXM_WMI_H | ||
22 | #define MXM_WMI_H | ||
23 | |||
24 | /* discrete adapters */ | ||
25 | #define MXM_MXDS_ADAPTER_0 0x0 | ||
26 | #define MXM_MXDS_ADAPTER_1 0x0 | ||
27 | /* integrated adapter */ | ||
28 | #define MXM_MXDS_ADAPTER_IGD 0x10 | ||
29 | int mxm_wmi_call_mxds(int adapter); | ||
30 | int mxm_wmi_call_mxmx(int adapter); | ||
31 | bool mxm_wmi_supported(void); | ||
32 | |||
33 | #endif | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 94de83c0f877..b29923006b11 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ | 42 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ |
43 | #define SYS_ACCEPT4 18 /* sys_accept4(2) */ | 43 | #define SYS_ACCEPT4 18 /* sys_accept4(2) */ |
44 | #define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */ | 44 | #define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */ |
45 | #define SYS_SENDMMSG 20 /* sys_sendmmsg(2) */ | ||
45 | 46 | ||
46 | typedef enum { | 47 | typedef enum { |
47 | SS_FREE = 0, /* not allocated */ | 48 | SS_FREE = 0, /* not allocated */ |
@@ -288,11 +289,5 @@ extern int kernel_sock_shutdown(struct socket *sock, | |||
288 | MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \ | 289 | MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \ |
289 | "-type-" __stringify(type)) | 290 | "-type-" __stringify(type)) |
290 | 291 | ||
291 | #ifdef CONFIG_SYSCTL | ||
292 | #include <linux/sysctl.h> | ||
293 | #include <linux/ratelimit.h> | ||
294 | extern struct ratelimit_state net_ratelimit_state; | ||
295 | #endif | ||
296 | |||
297 | #endif /* __KERNEL__ */ | 292 | #endif /* __KERNEL__ */ |
298 | #endif /* _LINUX_NET_H */ | 293 | #endif /* _LINUX_NET_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0249fe7e3872..54b8b4d7b68f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1020,9 +1020,6 @@ struct net_device { | |||
1020 | * part of the usual set specified in Space.c. | 1020 | * part of the usual set specified in Space.c. |
1021 | */ | 1021 | */ |
1022 | 1022 | ||
1023 | unsigned char if_port; /* Selectable AUI, TP,..*/ | ||
1024 | unsigned char dma; /* DMA channel */ | ||
1025 | |||
1026 | unsigned long state; | 1023 | unsigned long state; |
1027 | 1024 | ||
1028 | struct list_head dev_list; | 1025 | struct list_head dev_list; |
@@ -1035,7 +1032,7 @@ struct net_device { | |||
1035 | u32 hw_features; | 1032 | u32 hw_features; |
1036 | /* user-requested features */ | 1033 | /* user-requested features */ |
1037 | u32 wanted_features; | 1034 | u32 wanted_features; |
1038 | /* VLAN feature mask */ | 1035 | /* mask of features inheritable by VLAN devices */ |
1039 | u32 vlan_features; | 1036 | u32 vlan_features; |
1040 | 1037 | ||
1041 | /* Net device feature bits; if you change something, | 1038 | /* Net device feature bits; if you change something, |
@@ -1066,6 +1063,8 @@ struct net_device { | |||
1066 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | 1063 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ |
1067 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ | 1064 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ |
1068 | #define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */ | 1065 | #define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */ |
1066 | #define NETIF_F_NOCACHE_COPY (1 << 30) /* Use no-cache copyfromuser */ | ||
1067 | #define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */ | ||
1069 | 1068 | ||
1070 | /* Segmentation offload features */ | 1069 | /* Segmentation offload features */ |
1071 | #define NETIF_F_GSO_SHIFT 16 | 1070 | #define NETIF_F_GSO_SHIFT 16 |
@@ -1079,9 +1078,9 @@ struct net_device { | |||
1079 | 1078 | ||
1080 | /* Features valid for ethtool to change */ | 1079 | /* Features valid for ethtool to change */ |
1081 | /* = all defined minus driver/device-class-related */ | 1080 | /* = all defined minus driver/device-class-related */ |
1082 | #define NETIF_F_NEVER_CHANGE (NETIF_F_HIGHDMA | NETIF_F_VLAN_CHALLENGED | \ | 1081 | #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ |
1083 | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) | 1082 | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) |
1084 | #define NETIF_F_ETHTOOL_BITS (0x3f3fffff & ~NETIF_F_NEVER_CHANGE) | 1083 | #define NETIF_F_ETHTOOL_BITS (0xff3fffff & ~NETIF_F_NEVER_CHANGE) |
1085 | 1084 | ||
1086 | /* List of features with software fallbacks. */ | 1085 | /* List of features with software fallbacks. */ |
1087 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ | 1086 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ |
@@ -1095,9 +1094,14 @@ struct net_device { | |||
1095 | 1094 | ||
1096 | #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN) | 1095 | #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN) |
1097 | 1096 | ||
1097 | #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ | ||
1098 | NETIF_F_FSO) | ||
1099 | |||
1098 | #define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \ | 1100 | #define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \ |
1099 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ | 1101 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ |
1100 | NETIF_F_SCTP_CSUM | NETIF_F_FCOE_CRC) | 1102 | NETIF_F_HIGHDMA | \ |
1103 | NETIF_F_SCTP_CSUM | \ | ||
1104 | NETIF_F_ALL_FCOE) | ||
1101 | 1105 | ||
1102 | /* | 1106 | /* |
1103 | * If one device supports one of these features, then enable them | 1107 | * If one device supports one of these features, then enable them |
@@ -1105,7 +1109,12 @@ struct net_device { | |||
1105 | */ | 1109 | */ |
1106 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 1110 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
1107 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 1111 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
1108 | NETIF_F_FRAGLIST) | 1112 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) |
1113 | /* | ||
1114 | * If one device doesn't support one of these features, then disable it | ||
1115 | * for all in netdev_increment_features. | ||
1116 | */ | ||
1117 | #define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO) | ||
1109 | 1118 | ||
1110 | /* changeable features with no special hardware requirements */ | 1119 | /* changeable features with no special hardware requirements */ |
1111 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) | 1120 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) |
@@ -1134,13 +1143,16 @@ struct net_device { | |||
1134 | const struct header_ops *header_ops; | 1143 | const struct header_ops *header_ops; |
1135 | 1144 | ||
1136 | unsigned int flags; /* interface flags (a la BSD) */ | 1145 | unsigned int flags; /* interface flags (a la BSD) */ |
1146 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ | ||
1137 | unsigned short gflags; | 1147 | unsigned short gflags; |
1138 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ | ||
1139 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 1148 | unsigned short padded; /* How much padding added by alloc_netdev() */ |
1140 | 1149 | ||
1141 | unsigned char operstate; /* RFC2863 operstate */ | 1150 | unsigned char operstate; /* RFC2863 operstate */ |
1142 | unsigned char link_mode; /* mapping policy to operstate */ | 1151 | unsigned char link_mode; /* mapping policy to operstate */ |
1143 | 1152 | ||
1153 | unsigned char if_port; /* Selectable AUI, TP,..*/ | ||
1154 | unsigned char dma; /* DMA channel */ | ||
1155 | |||
1144 | unsigned int mtu; /* interface MTU value */ | 1156 | unsigned int mtu; /* interface MTU value */ |
1145 | unsigned short type; /* interface hardware type */ | 1157 | unsigned short type; /* interface hardware type */ |
1146 | unsigned short hard_header_len; /* hardware hdr length */ | 1158 | unsigned short hard_header_len; /* hardware hdr length */ |
@@ -1281,7 +1293,9 @@ struct net_device { | |||
1281 | NETREG_UNREGISTERED, /* completed unregister todo */ | 1293 | NETREG_UNREGISTERED, /* completed unregister todo */ |
1282 | NETREG_RELEASED, /* called free_netdev */ | 1294 | NETREG_RELEASED, /* called free_netdev */ |
1283 | NETREG_DUMMY, /* dummy device for NAPI poll */ | 1295 | NETREG_DUMMY, /* dummy device for NAPI poll */ |
1284 | } reg_state:16; | 1296 | } reg_state:8; |
1297 | |||
1298 | bool dismantle; /* device is going do be freed */ | ||
1285 | 1299 | ||
1286 | enum { | 1300 | enum { |
1287 | RTNL_LINK_INITIALIZED, | 1301 | RTNL_LINK_INITIALIZED, |
@@ -2513,6 +2527,7 @@ extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | |||
2513 | extern int netdev_max_backlog; | 2527 | extern int netdev_max_backlog; |
2514 | extern int netdev_tstamp_prequeue; | 2528 | extern int netdev_tstamp_prequeue; |
2515 | extern int weight_p; | 2529 | extern int weight_p; |
2530 | extern int bpf_jit_enable; | ||
2516 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 2531 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
2517 | extern int netdev_set_bond_master(struct net_device *dev, | 2532 | extern int netdev_set_bond_master(struct net_device *dev, |
2518 | struct net_device *master); | 2533 | struct net_device *master); |
@@ -2540,7 +2555,7 @@ extern void netdev_class_remove_file(struct class_attribute *class_attr); | |||
2540 | 2555 | ||
2541 | extern struct kobj_ns_type_operations net_ns_type_operations; | 2556 | extern struct kobj_ns_type_operations net_ns_type_operations; |
2542 | 2557 | ||
2543 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); | 2558 | extern const char *netdev_drivername(const struct net_device *dev); |
2544 | 2559 | ||
2545 | extern void linkwatch_run_queue(void); | 2560 | extern void linkwatch_run_queue(void); |
2546 | 2561 | ||
@@ -2550,7 +2565,9 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev) | |||
2550 | } | 2565 | } |
2551 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); | 2566 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); |
2552 | u32 netdev_fix_features(struct net_device *dev, u32 features); | 2567 | u32 netdev_fix_features(struct net_device *dev, u32 features); |
2568 | int __netdev_update_features(struct net_device *dev); | ||
2553 | void netdev_update_features(struct net_device *dev); | 2569 | void netdev_update_features(struct net_device *dev); |
2570 | void netdev_change_features(struct net_device *dev); | ||
2554 | 2571 | ||
2555 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2572 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2556 | struct net_device *dev); | 2573 | struct net_device *dev); |
@@ -2588,13 +2605,8 @@ static inline int netif_is_bond_slave(struct net_device *dev) | |||
2588 | 2605 | ||
2589 | extern struct pernet_operations __net_initdata loopback_net_ops; | 2606 | extern struct pernet_operations __net_initdata loopback_net_ops; |
2590 | 2607 | ||
2591 | static inline int dev_ethtool_get_settings(struct net_device *dev, | 2608 | int dev_ethtool_get_settings(struct net_device *dev, |
2592 | struct ethtool_cmd *cmd) | 2609 | struct ethtool_cmd *cmd); |
2593 | { | ||
2594 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings) | ||
2595 | return -EOPNOTSUPP; | ||
2596 | return dev->ethtool_ops->get_settings(dev, cmd); | ||
2597 | } | ||
2598 | 2610 | ||
2599 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) | 2611 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) |
2600 | { | 2612 | { |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 7fa95df60146..857f5026ced6 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #endif | 13 | #endif |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/sysctl.h> | ||
16 | 17 | ||
17 | /* Responses from hook functions. */ | 18 | /* Responses from hook functions. */ |
18 | #define NF_DROP 0 | 19 | #define NF_DROP 0 |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index a0196ac79051..ac3c822eb39a 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -839,7 +839,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout) | |||
839 | struct htable *t = h->table; | 839 | struct htable *t = h->table; |
840 | const struct type_pf_elem *d = value; | 840 | const struct type_pf_elem *d = value; |
841 | struct hbucket *n; | 841 | struct hbucket *n; |
842 | int i, ret = 0; | 842 | int i; |
843 | struct type_pf_elem *data; | 843 | struct type_pf_elem *data; |
844 | u32 key; | 844 | u32 key; |
845 | 845 | ||
@@ -850,7 +850,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout) | |||
850 | if (!type_pf_data_equal(data, d)) | 850 | if (!type_pf_data_equal(data, d)) |
851 | continue; | 851 | continue; |
852 | if (type_pf_data_expired(data)) | 852 | if (type_pf_data_expired(data)) |
853 | ret = -IPSET_ERR_EXIST; | 853 | return -IPSET_ERR_EXIST; |
854 | if (i != n->pos - 1) | 854 | if (i != n->pos - 1) |
855 | /* Not last one */ | 855 | /* Not last one */ |
856 | type_pf_data_copy(data, ahash_tdata(n, n->pos - 1)); | 856 | type_pf_data_copy(data, ahash_tdata(n, n->pos - 1)); |
diff --git a/include/linux/netfilter/ipset/ip_set_getport.h b/include/linux/netfilter/ipset/ip_set_getport.h index 5aebd170f899..90d09300e954 100644 --- a/include/linux/netfilter/ipset/ip_set_getport.h +++ b/include/linux/netfilter/ipset/ip_set_getport.h | |||
@@ -22,7 +22,9 @@ static inline bool ip_set_proto_with_ports(u8 proto) | |||
22 | { | 22 | { |
23 | switch (proto) { | 23 | switch (proto) { |
24 | case IPPROTO_TCP: | 24 | case IPPROTO_TCP: |
25 | case IPPROTO_SCTP: | ||
25 | case IPPROTO_UDP: | 26 | case IPPROTO_UDP: |
27 | case IPPROTO_UDPLITE: | ||
26 | return true; | 28 | return true; |
27 | } | 29 | } |
28 | return false; | 30 | return false; |
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h index 9f30c5f2ec1c..bcdd40ad39ed 100644 --- a/include/linux/netfilter/ipset/ip_set_timeout.h +++ b/include/linux/netfilter/ipset/ip_set_timeout.h | |||
@@ -45,7 +45,7 @@ ip_set_timeout_test(unsigned long timeout) | |||
45 | { | 45 | { |
46 | return timeout != IPSET_ELEM_UNSET && | 46 | return timeout != IPSET_ELEM_UNSET && |
47 | (timeout == IPSET_ELEM_PERMANENT || | 47 | (timeout == IPSET_ELEM_PERMANENT || |
48 | time_after(timeout, jiffies)); | 48 | time_is_after_jiffies(timeout)); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline bool | 51 | static inline bool |
@@ -53,7 +53,7 @@ ip_set_timeout_expired(unsigned long timeout) | |||
53 | { | 53 | { |
54 | return timeout != IPSET_ELEM_UNSET && | 54 | return timeout != IPSET_ELEM_UNSET && |
55 | timeout != IPSET_ELEM_PERMANENT && | 55 | timeout != IPSET_ELEM_PERMANENT && |
56 | time_before(timeout, jiffies); | 56 | time_is_before_jiffies(timeout); |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline unsigned long | 59 | static inline unsigned long |
@@ -64,7 +64,7 @@ ip_set_timeout_set(u32 timeout) | |||
64 | if (!timeout) | 64 | if (!timeout) |
65 | return IPSET_ELEM_PERMANENT; | 65 | return IPSET_ELEM_PERMANENT; |
66 | 66 | ||
67 | t = timeout * HZ + jiffies; | 67 | t = msecs_to_jiffies(timeout * 1000) + jiffies; |
68 | if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT) | 68 | if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT) |
69 | /* Bingo! */ | 69 | /* Bingo! */ |
70 | t++; | 70 | t++; |
@@ -75,7 +75,8 @@ ip_set_timeout_set(u32 timeout) | |||
75 | static inline u32 | 75 | static inline u32 |
76 | ip_set_timeout_get(unsigned long timeout) | 76 | ip_set_timeout_get(unsigned long timeout) |
77 | { | 77 | { |
78 | return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ; | 78 | return timeout == IPSET_ELEM_PERMANENT ? 0 : |
79 | jiffies_to_msecs(timeout - jiffies)/1000; | ||
79 | } | 80 | } |
80 | 81 | ||
81 | #else | 82 | #else |
@@ -89,14 +90,14 @@ static inline bool | |||
89 | ip_set_timeout_test(unsigned long timeout) | 90 | ip_set_timeout_test(unsigned long timeout) |
90 | { | 91 | { |
91 | return timeout == IPSET_ELEM_PERMANENT || | 92 | return timeout == IPSET_ELEM_PERMANENT || |
92 | time_after(timeout, jiffies); | 93 | time_is_after_jiffies(timeout); |
93 | } | 94 | } |
94 | 95 | ||
95 | static inline bool | 96 | static inline bool |
96 | ip_set_timeout_expired(unsigned long timeout) | 97 | ip_set_timeout_expired(unsigned long timeout) |
97 | { | 98 | { |
98 | return timeout != IPSET_ELEM_PERMANENT && | 99 | return timeout != IPSET_ELEM_PERMANENT && |
99 | time_before(timeout, jiffies); | 100 | time_is_before_jiffies(timeout); |
100 | } | 101 | } |
101 | 102 | ||
102 | static inline unsigned long | 103 | static inline unsigned long |
@@ -107,7 +108,7 @@ ip_set_timeout_set(u32 timeout) | |||
107 | if (!timeout) | 108 | if (!timeout) |
108 | return IPSET_ELEM_PERMANENT; | 109 | return IPSET_ELEM_PERMANENT; |
109 | 110 | ||
110 | t = timeout * HZ + jiffies; | 111 | t = msecs_to_jiffies(timeout * 1000) + jiffies; |
111 | if (t == IPSET_ELEM_PERMANENT) | 112 | if (t == IPSET_ELEM_PERMANENT) |
112 | /* Bingo! :-) */ | 113 | /* Bingo! :-) */ |
113 | t++; | 114 | t++; |
@@ -118,7 +119,8 @@ ip_set_timeout_set(u32 timeout) | |||
118 | static inline u32 | 119 | static inline u32 |
119 | ip_set_timeout_get(unsigned long timeout) | 120 | ip_set_timeout_get(unsigned long timeout) |
120 | { | 121 | { |
121 | return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ; | 122 | return timeout == IPSET_ELEM_PERMANENT ? 0 : |
123 | jiffies_to_msecs(timeout - jiffies)/1000; | ||
122 | } | 124 | } |
123 | #endif /* ! IP_SET_BITMAP_TIMEOUT */ | 125 | #endif /* ! IP_SET_BITMAP_TIMEOUT */ |
124 | 126 | ||
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 50cdc2559a5a..0d3dd66322ec 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -18,6 +18,9 @@ enum ip_conntrack_info { | |||
18 | /* >= this indicates reply direction */ | 18 | /* >= this indicates reply direction */ |
19 | IP_CT_IS_REPLY, | 19 | IP_CT_IS_REPLY, |
20 | 20 | ||
21 | IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY, | ||
22 | IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY, | ||
23 | IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY, | ||
21 | /* Number of distinct IP_CT types (no NEW in reply dirn). */ | 24 | /* Number of distinct IP_CT types (no NEW in reply dirn). */ |
22 | IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 | 25 | IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 |
23 | }; | 26 | }; |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 37219525ff6f..32cddf78b13e 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -456,72 +456,60 @@ extern void xt_proto_fini(struct net *net, u_int8_t af); | |||
456 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); | 456 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); |
457 | extern void xt_free_table_info(struct xt_table_info *info); | 457 | extern void xt_free_table_info(struct xt_table_info *info); |
458 | 458 | ||
459 | /* | 459 | /** |
460 | * Per-CPU spinlock associated with per-cpu table entries, and | 460 | * xt_recseq - recursive seqcount for netfilter use |
461 | * with a counter for the "reading" side that allows a recursive | 461 | * |
462 | * reader to avoid taking the lock and deadlocking. | 462 | * Packet processing changes the seqcount only if no recursion happened |
463 | * | 463 | * get_counters() can use read_seqcount_begin()/read_seqcount_retry(), |
464 | * "reading" is used by ip/arp/ip6 tables rule processing which runs per-cpu. | 464 | * because we use the normal seqcount convention : |
465 | * It needs to ensure that the rules are not being changed while the packet | 465 | * Low order bit set to 1 if a writer is active. |
466 | * is being processed. In some cases, the read lock will be acquired | ||
467 | * twice on the same CPU; this is okay because of the count. | ||
468 | * | ||
469 | * "writing" is used when reading counters. | ||
470 | * During replace any readers that are using the old tables have to complete | ||
471 | * before freeing the old table. This is handled by the write locking | ||
472 | * necessary for reading the counters. | ||
473 | */ | 466 | */ |
474 | struct xt_info_lock { | 467 | DECLARE_PER_CPU(seqcount_t, xt_recseq); |
475 | seqlock_t lock; | ||
476 | unsigned char readers; | ||
477 | }; | ||
478 | DECLARE_PER_CPU(struct xt_info_lock, xt_info_locks); | ||
479 | 468 | ||
480 | /* | 469 | /** |
481 | * Note: we need to ensure that preemption is disabled before acquiring | 470 | * xt_write_recseq_begin - start of a write section |
482 | * the per-cpu-variable, so we do it as a two step process rather than | ||
483 | * using "spin_lock_bh()". | ||
484 | * | ||
485 | * We _also_ need to disable bottom half processing before updating our | ||
486 | * nesting count, to make sure that the only kind of re-entrancy is this | ||
487 | * code being called by itself: since the count+lock is not an atomic | ||
488 | * operation, we can allow no races. | ||
489 | * | 471 | * |
490 | * _Only_ that special combination of being per-cpu and never getting | 472 | * Begin packet processing : all readers must wait the end |
491 | * re-entered asynchronously means that the count is safe. | 473 | * 1) Must be called with preemption disabled |
474 | * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) | ||
475 | * Returns : | ||
476 | * 1 if no recursion on this cpu | ||
477 | * 0 if recursion detected | ||
492 | */ | 478 | */ |
493 | static inline void xt_info_rdlock_bh(void) | 479 | static inline unsigned int xt_write_recseq_begin(void) |
494 | { | 480 | { |
495 | struct xt_info_lock *lock; | 481 | unsigned int addend; |
496 | 482 | ||
497 | local_bh_disable(); | 483 | /* |
498 | lock = &__get_cpu_var(xt_info_locks); | 484 | * Low order bit of sequence is set if we already |
499 | if (likely(!lock->readers++)) | 485 | * called xt_write_recseq_begin(). |
500 | write_seqlock(&lock->lock); | 486 | */ |
501 | } | 487 | addend = (__this_cpu_read(xt_recseq.sequence) + 1) & 1; |
502 | 488 | ||
503 | static inline void xt_info_rdunlock_bh(void) | 489 | /* |
504 | { | 490 | * This is kind of a write_seqcount_begin(), but addend is 0 or 1 |
505 | struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks); | 491 | * We dont check addend value to avoid a test and conditional jump, |
492 | * since addend is most likely 1 | ||
493 | */ | ||
494 | __this_cpu_add(xt_recseq.sequence, addend); | ||
495 | smp_wmb(); | ||
506 | 496 | ||
507 | if (likely(!--lock->readers)) | 497 | return addend; |
508 | write_sequnlock(&lock->lock); | ||
509 | local_bh_enable(); | ||
510 | } | 498 | } |
511 | 499 | ||
512 | /* | 500 | /** |
513 | * The "writer" side needs to get exclusive access to the lock, | 501 | * xt_write_recseq_end - end of a write section |
514 | * regardless of readers. This must be called with bottom half | 502 | * @addend: return value from previous xt_write_recseq_begin() |
515 | * processing (and thus also preemption) disabled. | 503 | * |
504 | * End packet processing : all readers can proceed | ||
505 | * 1) Must be called with preemption disabled | ||
506 | * 2) softirqs must be disabled too (or we should use irqsafe_cpu_add()) | ||
516 | */ | 507 | */ |
517 | static inline void xt_info_wrlock(unsigned int cpu) | 508 | static inline void xt_write_recseq_end(unsigned int addend) |
518 | { | ||
519 | write_seqlock(&per_cpu(xt_info_locks, cpu).lock); | ||
520 | } | ||
521 | |||
522 | static inline void xt_info_wrunlock(unsigned int cpu) | ||
523 | { | 509 | { |
524 | write_sequnlock(&per_cpu(xt_info_locks, cpu).lock); | 510 | /* this is kind of a write_seqcount_end(), but addend is 0 or 1 */ |
511 | smp_wmb(); | ||
512 | __this_cpu_add(xt_recseq.sequence, addend); | ||
525 | } | 513 | } |
526 | 514 | ||
527 | /* | 515 | /* |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 4c4ac3f3ce5a..a9dd89552f9c 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -24,6 +24,7 @@ | |||
24 | /* leave room for NETLINK_DM (DM Events) */ | 24 | /* leave room for NETLINK_DM (DM Events) */ |
25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ | 25 | #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ |
26 | #define NETLINK_ECRYPTFS 19 | 26 | #define NETLINK_ECRYPTFS 19 |
27 | #define NETLINK_RDMA 20 | ||
27 | 28 | ||
28 | #define MAX_LINKS 32 | 29 | #define MAX_LINKS 32 |
29 | 30 | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 178fafe0ff93..504b289ba680 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -562,6 +562,7 @@ enum { | |||
562 | NFSPROC4_CLNT_LAYOUTGET, | 562 | NFSPROC4_CLNT_LAYOUTGET, |
563 | NFSPROC4_CLNT_GETDEVICEINFO, | 563 | NFSPROC4_CLNT_GETDEVICEINFO, |
564 | NFSPROC4_CLNT_LAYOUTCOMMIT, | 564 | NFSPROC4_CLNT_LAYOUTCOMMIT, |
565 | NFSPROC4_CLNT_LAYOUTRETURN, | ||
565 | }; | 566 | }; |
566 | 567 | ||
567 | /* nfs41 types */ | 568 | /* nfs41 types */ |
@@ -570,9 +571,11 @@ struct nfs4_sessionid { | |||
570 | }; | 571 | }; |
571 | 572 | ||
572 | /* Create Session Flags */ | 573 | /* Create Session Flags */ |
573 | #define SESSION4_PERSIST 0x001 | 574 | #define SESSION4_PERSIST 0x001 |
574 | #define SESSION4_BACK_CHAN 0x002 | 575 | #define SESSION4_BACK_CHAN 0x002 |
575 | #define SESSION4_RDMA 0x004 | 576 | #define SESSION4_RDMA 0x004 |
577 | |||
578 | #define SESSION4_FLAG_MASK_A 0x007 | ||
576 | 579 | ||
577 | enum state_protect_how4 { | 580 | enum state_protect_how4 { |
578 | SP4_NONE = 0, | 581 | SP4_NONE = 0, |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 91af2e49fa3a..3a34e80ae92f 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -68,7 +68,7 @@ struct nfs_pageio_descriptor { | |||
68 | int pg_ioflags; | 68 | int pg_ioflags; |
69 | int pg_error; | 69 | int pg_error; |
70 | struct pnfs_layout_segment *pg_lseg; | 70 | struct pnfs_layout_segment *pg_lseg; |
71 | int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); | 71 | bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); |
72 | }; | 72 | }; |
73 | 73 | ||
74 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 74 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 7e371f7df9c4..5e8444a11adf 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -269,6 +269,27 @@ struct nfs4_layoutcommit_data { | |||
269 | struct nfs4_layoutcommit_res res; | 269 | struct nfs4_layoutcommit_res res; |
270 | }; | 270 | }; |
271 | 271 | ||
272 | struct nfs4_layoutreturn_args { | ||
273 | __u32 layout_type; | ||
274 | struct inode *inode; | ||
275 | nfs4_stateid stateid; | ||
276 | struct nfs4_sequence_args seq_args; | ||
277 | }; | ||
278 | |||
279 | struct nfs4_layoutreturn_res { | ||
280 | struct nfs4_sequence_res seq_res; | ||
281 | u32 lrs_present; | ||
282 | nfs4_stateid stateid; | ||
283 | }; | ||
284 | |||
285 | struct nfs4_layoutreturn { | ||
286 | struct nfs4_layoutreturn_args args; | ||
287 | struct nfs4_layoutreturn_res res; | ||
288 | struct rpc_cred *cred; | ||
289 | struct nfs_client *clp; | ||
290 | int rpc_status; | ||
291 | }; | ||
292 | |||
272 | /* | 293 | /* |
273 | * Arguments to the open call. | 294 | * Arguments to the open call. |
274 | */ | 295 | */ |
@@ -1087,6 +1108,7 @@ struct nfs_read_data { | |||
1087 | const struct rpc_call_ops *mds_ops; | 1108 | const struct rpc_call_ops *mds_ops; |
1088 | int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data); | 1109 | int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data); |
1089 | __u64 mds_offset; | 1110 | __u64 mds_offset; |
1111 | int pnfs_error; | ||
1090 | struct page *page_array[NFS_PAGEVEC_SIZE]; | 1112 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
1091 | }; | 1113 | }; |
1092 | 1114 | ||
@@ -1112,6 +1134,7 @@ struct nfs_write_data { | |||
1112 | unsigned long timestamp; /* For lease renewal */ | 1134 | unsigned long timestamp; /* For lease renewal */ |
1113 | #endif | 1135 | #endif |
1114 | __u64 mds_offset; /* Filelayout dense stripe */ | 1136 | __u64 mds_offset; /* Filelayout dense stripe */ |
1137 | int pnfs_error; | ||
1115 | struct page *page_array[NFS_PAGEVEC_SIZE]; | 1138 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
1116 | }; | 1139 | }; |
1117 | 1140 | ||
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 8768c469e93e..7454ad7451b4 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
@@ -107,7 +107,7 @@ struct nilfs_super_root { | |||
107 | #define NILFS_SR_DAT_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 0) | 107 | #define NILFS_SR_DAT_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 0) |
108 | #define NILFS_SR_CPFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 1) | 108 | #define NILFS_SR_CPFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 1) |
109 | #define NILFS_SR_SUFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 2) | 109 | #define NILFS_SR_SUFILE_OFFSET(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 2) |
110 | #define NILFS_SR_BYTES (sizeof(struct nilfs_super_root)) | 110 | #define NILFS_SR_BYTES(inode_size) NILFS_SR_MDT_OFFSET(inode_size, 3) |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * Maximal mount counts | 113 | * Maximal mount counts |
@@ -845,5 +845,7 @@ struct nilfs_bdesc { | |||
845 | _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64) | 845 | _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64) |
846 | #define NILFS_IOCTL_RESIZE \ | 846 | #define NILFS_IOCTL_RESIZE \ |
847 | _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64) | 847 | _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64) |
848 | #define NILFS_IOCTL_SET_ALLOC_RANGE \ | ||
849 | _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2]) | ||
848 | 850 | ||
849 | #endif /* _LINUX_NILFS_FS_H */ | 851 | #endif /* _LINUX_NILFS_FS_H */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index bbfa1093f606..c7ccaae15af6 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -77,6 +77,39 @@ | |||
77 | */ | 77 | */ |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * DOC: Virtual interface / concurrency capabilities | ||
81 | * | ||
82 | * Some devices are able to operate with virtual MACs, they can have | ||
83 | * more than one virtual interface. The capability handling for this | ||
84 | * is a bit complex though, as there may be a number of restrictions | ||
85 | * on the types of concurrency that are supported. | ||
86 | * | ||
87 | * To start with, each device supports the interface types listed in | ||
88 | * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the | ||
89 | * types there no concurrency is implied. | ||
90 | * | ||
91 | * Once concurrency is desired, more attributes must be observed: | ||
92 | * To start with, since some interface types are purely managed in | ||
93 | * software, like the AP-VLAN type in mac80211 for example, there's | ||
94 | * an additional list of these, they can be added at any time and | ||
95 | * are only restricted by some semantic restrictions (e.g. AP-VLAN | ||
96 | * cannot be added without a corresponding AP interface). This list | ||
97 | * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute. | ||
98 | * | ||
99 | * Further, the list of supported combinations is exported. This is | ||
100 | * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically, | ||
101 | * it exports a list of "groups", and at any point in time the | ||
102 | * interfaces that are currently active must fall into any one of | ||
103 | * the advertised groups. Within each group, there are restrictions | ||
104 | * on the number of interfaces of different types that are supported | ||
105 | * and also the number of different channels, along with potentially | ||
106 | * some other restrictions. See &enum nl80211_if_combination_attrs. | ||
107 | * | ||
108 | * All together, these attributes define the concurrency of virtual | ||
109 | * interfaces that a given device supports. | ||
110 | */ | ||
111 | |||
112 | /** | ||
80 | * enum nl80211_commands - supported nl80211 commands | 113 | * enum nl80211_commands - supported nl80211 commands |
81 | * | 114 | * |
82 | * @NL80211_CMD_UNSPEC: unspecified command to catch errors | 115 | * @NL80211_CMD_UNSPEC: unspecified command to catch errors |
@@ -203,6 +236,28 @@ | |||
203 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, | 236 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, |
204 | * partial scan results may be available | 237 | * partial scan results may be available |
205 | * | 238 | * |
239 | * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain | ||
240 | * intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL. | ||
241 | * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) | ||
242 | * are passed, they are used in the probe requests. For | ||
243 | * broadcast, a broadcast SSID must be passed (ie. an empty | ||
244 | * string). If no SSID is passed, no probe requests are sent and | ||
245 | * a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES, | ||
246 | * if passed, define which channels should be scanned; if not | ||
247 | * passed, all channels allowed for the current regulatory domain | ||
248 | * are used. Extra IEs can also be passed from the userspace by | ||
249 | * using the %NL80211_ATTR_IE attribute. | ||
250 | * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan | ||
251 | * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan | ||
252 | * results available. | ||
253 | * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has | ||
254 | * stopped. The driver may issue this event at any time during a | ||
255 | * scheduled scan. One reason for stopping the scan is if the hardware | ||
256 | * does not support starting an association or a normal scan while running | ||
257 | * a scheduled scan. This event is also sent when the | ||
258 | * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface | ||
259 | * is brought down while a scheduled scan was running. | ||
260 | * | ||
206 | * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation | 261 | * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation |
207 | * or noise level | 262 | * or noise level |
208 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to | 263 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to |
@@ -410,6 +465,24 @@ | |||
410 | * notification. This event is used to indicate that an unprotected | 465 | * notification. This event is used to indicate that an unprotected |
411 | * disassociation frame was dropped when MFP is in use. | 466 | * disassociation frame was dropped when MFP is in use. |
412 | * | 467 | * |
468 | * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a | ||
469 | * beacon or probe response from a compatible mesh peer. This is only | ||
470 | * sent while no station information (sta_info) exists for the new peer | ||
471 | * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set. On | ||
472 | * reception of this notification, userspace may decide to create a new | ||
473 | * station (@NL80211_CMD_NEW_STATION). To stop this notification from | ||
474 | * reoccurring, the userspace authentication daemon may want to create the | ||
475 | * new station with the AUTHENTICATED flag unset and maybe change it later | ||
476 | * depending on the authentication result. | ||
477 | * | ||
478 | * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings. | ||
479 | * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings. | ||
480 | * Since wireless is more complex than wired ethernet, it supports | ||
481 | * various triggers. These triggers can be configured through this | ||
482 | * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For | ||
483 | * more background information, see | ||
484 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. | ||
485 | * | ||
413 | * @NL80211_CMD_MAX: highest used command number | 486 | * @NL80211_CMD_MAX: highest used command number |
414 | * @__NL80211_CMD_AFTER_LAST: internal use | 487 | * @__NL80211_CMD_AFTER_LAST: internal use |
415 | */ | 488 | */ |
@@ -522,6 +595,16 @@ enum nl80211_commands { | |||
522 | NL80211_CMD_UNPROT_DEAUTHENTICATE, | 595 | NL80211_CMD_UNPROT_DEAUTHENTICATE, |
523 | NL80211_CMD_UNPROT_DISASSOCIATE, | 596 | NL80211_CMD_UNPROT_DISASSOCIATE, |
524 | 597 | ||
598 | NL80211_CMD_NEW_PEER_CANDIDATE, | ||
599 | |||
600 | NL80211_CMD_GET_WOWLAN, | ||
601 | NL80211_CMD_SET_WOWLAN, | ||
602 | |||
603 | NL80211_CMD_START_SCHED_SCAN, | ||
604 | NL80211_CMD_STOP_SCHED_SCAN, | ||
605 | NL80211_CMD_SCHED_SCAN_RESULTS, | ||
606 | NL80211_CMD_SCHED_SCAN_STOPPED, | ||
607 | |||
525 | /* add new commands above here */ | 608 | /* add new commands above here */ |
526 | 609 | ||
527 | /* used to define NL80211_CMD_MAX below */ | 610 | /* used to define NL80211_CMD_MAX below */ |
@@ -545,6 +628,7 @@ enum nl80211_commands { | |||
545 | /* source-level API compatibility */ | 628 | /* source-level API compatibility */ |
546 | #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG | 629 | #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG |
547 | #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG | 630 | #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG |
631 | #define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE | ||
548 | 632 | ||
549 | /** | 633 | /** |
550 | * enum nl80211_attrs - nl80211 netlink attributes | 634 | * enum nl80211_attrs - nl80211 netlink attributes |
@@ -886,6 +970,31 @@ enum nl80211_commands { | |||
886 | * changed once the mesh is active. | 970 | * changed once the mesh is active. |
887 | * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute | 971 | * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute |
888 | * containing attributes from &enum nl80211_meshconf_params. | 972 | * containing attributes from &enum nl80211_meshconf_params. |
973 | * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver | ||
974 | * allows auth frames in a mesh to be passed to userspace for processing via | ||
975 | * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. | ||
976 | * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as | ||
977 | * defined in &enum nl80211_plink_state. Used when userspace is | ||
978 | * driving the peer link management state machine. | ||
979 | * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. | ||
980 | * | ||
981 | * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities, | ||
982 | * the supported WoWLAN triggers | ||
983 | * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to | ||
984 | * indicate which WoW triggers should be enabled. This is also | ||
985 | * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN | ||
986 | * triggers. | ||
987 | |||
988 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan | ||
989 | * cycles, in msecs. | ||
990 | * | ||
991 | * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported | ||
992 | * interface combinations. In each nested item, it contains attributes | ||
993 | * defined in &enum nl80211_if_combination_attrs. | ||
994 | * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like | ||
995 | * %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that | ||
996 | * are managed in software: interfaces of these types aren't subject to | ||
997 | * any restrictions in their number or combinations. | ||
889 | * | 998 | * |
890 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 999 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
891 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1000 | * @__NL80211_ATTR_AFTER_LAST: internal use |
@@ -1074,6 +1183,17 @@ enum nl80211_attrs { | |||
1074 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, | 1183 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, |
1075 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, | 1184 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, |
1076 | 1185 | ||
1186 | NL80211_ATTR_SUPPORT_MESH_AUTH, | ||
1187 | NL80211_ATTR_STA_PLINK_STATE, | ||
1188 | |||
1189 | NL80211_ATTR_WOWLAN_TRIGGERS, | ||
1190 | NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, | ||
1191 | |||
1192 | NL80211_ATTR_SCHED_SCAN_INTERVAL, | ||
1193 | |||
1194 | NL80211_ATTR_INTERFACE_COMBINATIONS, | ||
1195 | NL80211_ATTR_SOFTWARE_IFTYPES, | ||
1196 | |||
1077 | /* add attributes here, update the policy in nl80211.c */ | 1197 | /* add attributes here, update the policy in nl80211.c */ |
1078 | 1198 | ||
1079 | __NL80211_ATTR_AFTER_LAST, | 1199 | __NL80211_ATTR_AFTER_LAST, |
@@ -1126,7 +1246,9 @@ enum nl80211_attrs { | |||
1126 | * @NL80211_IFTYPE_ADHOC: independent BSS member | 1246 | * @NL80211_IFTYPE_ADHOC: independent BSS member |
1127 | * @NL80211_IFTYPE_STATION: managed BSS member | 1247 | * @NL80211_IFTYPE_STATION: managed BSS member |
1128 | * @NL80211_IFTYPE_AP: access point | 1248 | * @NL80211_IFTYPE_AP: access point |
1129 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points | 1249 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces |
1250 | * are a bit special in that they must always be tied to a pre-existing | ||
1251 | * AP type interface. | ||
1130 | * @NL80211_IFTYPE_WDS: wireless distribution interface | 1252 | * @NL80211_IFTYPE_WDS: wireless distribution interface |
1131 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames | 1253 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames |
1132 | * @NL80211_IFTYPE_MESH_POINT: mesh point | 1254 | * @NL80211_IFTYPE_MESH_POINT: mesh point |
@@ -1168,6 +1290,7 @@ enum nl80211_iftype { | |||
1168 | * with short barker preamble | 1290 | * with short barker preamble |
1169 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable | 1291 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable |
1170 | * @NL80211_STA_FLAG_MFP: station uses management frame protection | 1292 | * @NL80211_STA_FLAG_MFP: station uses management frame protection |
1293 | * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated | ||
1171 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined | 1294 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined |
1172 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use | 1295 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use |
1173 | */ | 1296 | */ |
@@ -1177,6 +1300,7 @@ enum nl80211_sta_flags { | |||
1177 | NL80211_STA_FLAG_SHORT_PREAMBLE, | 1300 | NL80211_STA_FLAG_SHORT_PREAMBLE, |
1178 | NL80211_STA_FLAG_WME, | 1301 | NL80211_STA_FLAG_WME, |
1179 | NL80211_STA_FLAG_MFP, | 1302 | NL80211_STA_FLAG_MFP, |
1303 | NL80211_STA_FLAG_AUTHENTICATED, | ||
1180 | 1304 | ||
1181 | /* keep last */ | 1305 | /* keep last */ |
1182 | __NL80211_STA_FLAG_AFTER_LAST, | 1306 | __NL80211_STA_FLAG_AFTER_LAST, |
@@ -1222,6 +1346,36 @@ enum nl80211_rate_info { | |||
1222 | }; | 1346 | }; |
1223 | 1347 | ||
1224 | /** | 1348 | /** |
1349 | * enum nl80211_sta_bss_param - BSS information collected by STA | ||
1350 | * | ||
1351 | * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM | ||
1352 | * when getting information about the bitrate of a station. | ||
1353 | * | ||
1354 | * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved | ||
1355 | * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag) | ||
1356 | * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE: whether short preamble is enabled | ||
1357 | * (flag) | ||
1358 | * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME: whether short slot time is enabled | ||
1359 | * (flag) | ||
1360 | * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8) | ||
1361 | * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16) | ||
1362 | * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined | ||
1363 | * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use | ||
1364 | */ | ||
1365 | enum nl80211_sta_bss_param { | ||
1366 | __NL80211_STA_BSS_PARAM_INVALID, | ||
1367 | NL80211_STA_BSS_PARAM_CTS_PROT, | ||
1368 | NL80211_STA_BSS_PARAM_SHORT_PREAMBLE, | ||
1369 | NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME, | ||
1370 | NL80211_STA_BSS_PARAM_DTIM_PERIOD, | ||
1371 | NL80211_STA_BSS_PARAM_BEACON_INTERVAL, | ||
1372 | |||
1373 | /* keep last */ | ||
1374 | __NL80211_STA_BSS_PARAM_AFTER_LAST, | ||
1375 | NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1 | ||
1376 | }; | ||
1377 | |||
1378 | /** | ||
1225 | * enum nl80211_sta_info - station information | 1379 | * enum nl80211_sta_info - station information |
1226 | * | 1380 | * |
1227 | * These attribute types are used with %NL80211_ATTR_STA_INFO | 1381 | * These attribute types are used with %NL80211_ATTR_STA_INFO |
@@ -1233,7 +1387,7 @@ enum nl80211_rate_info { | |||
1233 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 1387 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
1234 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | 1388 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) |
1235 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | 1389 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute |
1236 | * containing info as possible, see &enum nl80211_sta_info_txrate. | 1390 | * containing info as possible, see &enum nl80211_rate_info |
1237 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) | 1391 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) |
1238 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this | 1392 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this |
1239 | * station) | 1393 | * station) |
@@ -1243,8 +1397,12 @@ enum nl80211_rate_info { | |||
1243 | * @NL80211_STA_INFO_LLID: the station's mesh LLID | 1397 | * @NL80211_STA_INFO_LLID: the station's mesh LLID |
1244 | * @NL80211_STA_INFO_PLID: the station's mesh PLID | 1398 | * @NL80211_STA_INFO_PLID: the station's mesh PLID |
1245 | * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station | 1399 | * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station |
1400 | * (see %enum nl80211_plink_state) | ||
1246 | * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested | 1401 | * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested |
1247 | * attribute, like NL80211_STA_INFO_TX_BITRATE. | 1402 | * attribute, like NL80211_STA_INFO_TX_BITRATE. |
1403 | * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute | ||
1404 | * containing info as possible, see &enum nl80211_sta_bss_param | ||
1405 | * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected | ||
1248 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 1406 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
1249 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 1407 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
1250 | */ | 1408 | */ |
@@ -1264,6 +1422,8 @@ enum nl80211_sta_info { | |||
1264 | NL80211_STA_INFO_TX_FAILED, | 1422 | NL80211_STA_INFO_TX_FAILED, |
1265 | NL80211_STA_INFO_SIGNAL_AVG, | 1423 | NL80211_STA_INFO_SIGNAL_AVG, |
1266 | NL80211_STA_INFO_RX_BITRATE, | 1424 | NL80211_STA_INFO_RX_BITRATE, |
1425 | NL80211_STA_INFO_BSS_PARAM, | ||
1426 | NL80211_STA_INFO_CONNECTED_TIME, | ||
1267 | 1427 | ||
1268 | /* keep last */ | 1428 | /* keep last */ |
1269 | __NL80211_STA_INFO_AFTER_LAST, | 1429 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -1686,9 +1846,21 @@ enum nl80211_meshconf_params { | |||
1686 | * vendor specific path metric or disable it to use the default Airtime | 1846 | * vendor specific path metric or disable it to use the default Airtime |
1687 | * metric. | 1847 | * metric. |
1688 | * | 1848 | * |
1689 | * @NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE: A vendor specific information | 1849 | * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a |
1690 | * element that vendors will use to identify the path selection methods and | 1850 | * robust security network ie, or a vendor specific information element that |
1691 | * metrics in use. | 1851 | * vendors will use to identify the path selection methods and metrics in use. |
1852 | * | ||
1853 | * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication | ||
1854 | * daemon will be authenticating mesh candidates. | ||
1855 | * | ||
1856 | * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication | ||
1857 | * daemon will be securing peer link frames. AMPE is a secured version of Mesh | ||
1858 | * Peering Management (MPM) and is implemented with the assistance of a | ||
1859 | * userspace daemon. When this flag is set, the kernel will send peer | ||
1860 | * management frames to a userspace daemon that will implement AMPE | ||
1861 | * functionality (security capabilities selection, key confirmation, and key | ||
1862 | * management). When the flag is unset (default), the kernel can autonomously | ||
1863 | * complete (unsecured) mesh peering without the need of a userspace daemon. | ||
1692 | * | 1864 | * |
1693 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number | 1865 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number |
1694 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use | 1866 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use |
@@ -1697,7 +1869,9 @@ enum nl80211_mesh_setup_params { | |||
1697 | __NL80211_MESH_SETUP_INVALID, | 1869 | __NL80211_MESH_SETUP_INVALID, |
1698 | NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, | 1870 | NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, |
1699 | NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, | 1871 | NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, |
1700 | NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE, | 1872 | NL80211_MESH_SETUP_IE, |
1873 | NL80211_MESH_SETUP_USERSPACE_AUTH, | ||
1874 | NL80211_MESH_SETUP_USERSPACE_AMPE, | ||
1701 | 1875 | ||
1702 | /* keep last */ | 1876 | /* keep last */ |
1703 | __NL80211_MESH_SETUP_ATTR_AFTER_LAST, | 1877 | __NL80211_MESH_SETUP_ATTR_AFTER_LAST, |
@@ -2002,4 +2176,189 @@ enum nl80211_tx_power_setting { | |||
2002 | NL80211_TX_POWER_FIXED, | 2176 | NL80211_TX_POWER_FIXED, |
2003 | }; | 2177 | }; |
2004 | 2178 | ||
2179 | /** | ||
2180 | * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute | ||
2181 | * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute | ||
2182 | * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has | ||
2183 | * a zero bit are ignored | ||
2184 | * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have | ||
2185 | * a bit for each byte in the pattern. The lowest-order bit corresponds | ||
2186 | * to the first byte of the pattern, but the bytes of the pattern are | ||
2187 | * in a little-endian-like format, i.e. the 9th byte of the pattern | ||
2188 | * corresponds to the lowest-order bit in the second byte of the mask. | ||
2189 | * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where | ||
2190 | * xx indicates "don't care") would be represented by a pattern of | ||
2191 | * twelve zero bytes, and a mask of "0xed,0x07". | ||
2192 | * Note that the pattern matching is done as though frames were not | ||
2193 | * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked | ||
2194 | * first (including SNAP header unpacking) and then matched. | ||
2195 | * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes | ||
2196 | * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number | ||
2197 | */ | ||
2198 | enum nl80211_wowlan_packet_pattern_attr { | ||
2199 | __NL80211_WOWLAN_PKTPAT_INVALID, | ||
2200 | NL80211_WOWLAN_PKTPAT_MASK, | ||
2201 | NL80211_WOWLAN_PKTPAT_PATTERN, | ||
2202 | |||
2203 | NUM_NL80211_WOWLAN_PKTPAT, | ||
2204 | MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, | ||
2205 | }; | ||
2206 | |||
2207 | /** | ||
2208 | * struct nl80211_wowlan_pattern_support - pattern support information | ||
2209 | * @max_patterns: maximum number of patterns supported | ||
2210 | * @min_pattern_len: minimum length of each pattern | ||
2211 | * @max_pattern_len: maximum length of each pattern | ||
2212 | * | ||
2213 | * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when | ||
2214 | * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the | ||
2215 | * capability information given by the kernel to userspace. | ||
2216 | */ | ||
2217 | struct nl80211_wowlan_pattern_support { | ||
2218 | __u32 max_patterns; | ||
2219 | __u32 min_pattern_len; | ||
2220 | __u32 max_pattern_len; | ||
2221 | } __attribute__((packed)); | ||
2222 | |||
2223 | /** | ||
2224 | * enum nl80211_wowlan_triggers - WoWLAN trigger definitions | ||
2225 | * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes | ||
2226 | * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put | ||
2227 | * the chip into a special state -- works best with chips that have | ||
2228 | * support for low-power operation already (flag) | ||
2229 | * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect | ||
2230 | * is detected is implementation-specific (flag) | ||
2231 | * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed | ||
2232 | * by 16 repetitions of MAC addr, anywhere in payload) (flag) | ||
2233 | * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns | ||
2234 | * which are passed in an array of nested attributes, each nested attribute | ||
2235 | * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. | ||
2236 | * Each pattern defines a wakeup packet. The matching is done on the MSDU, | ||
2237 | * i.e. as though the packet was an 802.3 packet, so the pattern matching | ||
2238 | * is done after the packet is converted to the MSDU. | ||
2239 | * | ||
2240 | * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute | ||
2241 | * carrying a &struct nl80211_wowlan_pattern_support. | ||
2242 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers | ||
2243 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number | ||
2244 | */ | ||
2245 | enum nl80211_wowlan_triggers { | ||
2246 | __NL80211_WOWLAN_TRIG_INVALID, | ||
2247 | NL80211_WOWLAN_TRIG_ANY, | ||
2248 | NL80211_WOWLAN_TRIG_DISCONNECT, | ||
2249 | NL80211_WOWLAN_TRIG_MAGIC_PKT, | ||
2250 | NL80211_WOWLAN_TRIG_PKT_PATTERN, | ||
2251 | |||
2252 | /* keep last */ | ||
2253 | NUM_NL80211_WOWLAN_TRIG, | ||
2254 | MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1 | ||
2255 | }; | ||
2256 | |||
2257 | /** | ||
2258 | * enum nl80211_iface_limit_attrs - limit attributes | ||
2259 | * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) | ||
2260 | * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that | ||
2261 | * can be chosen from this set of interface types (u32) | ||
2262 | * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a | ||
2263 | * flag attribute for each interface type in this set | ||
2264 | * @NUM_NL80211_IFACE_LIMIT: number of attributes | ||
2265 | * @MAX_NL80211_IFACE_LIMIT: highest attribute number | ||
2266 | */ | ||
2267 | enum nl80211_iface_limit_attrs { | ||
2268 | NL80211_IFACE_LIMIT_UNSPEC, | ||
2269 | NL80211_IFACE_LIMIT_MAX, | ||
2270 | NL80211_IFACE_LIMIT_TYPES, | ||
2271 | |||
2272 | /* keep last */ | ||
2273 | NUM_NL80211_IFACE_LIMIT, | ||
2274 | MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1 | ||
2275 | }; | ||
2276 | |||
2277 | /** | ||
2278 | * enum nl80211_if_combination_attrs -- interface combination attributes | ||
2279 | * | ||
2280 | * @NL80211_IFACE_COMB_UNSPEC: (reserved) | ||
2281 | * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits | ||
2282 | * for given interface types, see &enum nl80211_iface_limit_attrs. | ||
2283 | * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of | ||
2284 | * interfaces that can be created in this group. This number doesn't | ||
2285 | * apply to interfaces purely managed in software, which are listed | ||
2286 | * in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE. | ||
2287 | * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that | ||
2288 | * beacon intervals within this group must be all the same even for | ||
2289 | * infrastructure and AP/GO combinations, i.e. the GO(s) must adopt | ||
2290 | * the infrastructure network's beacon interval. | ||
2291 | * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many | ||
2292 | * different channels may be used within this group. | ||
2293 | * @NUM_NL80211_IFACE_COMB: number of attributes | ||
2294 | * @MAX_NL80211_IFACE_COMB: highest attribute number | ||
2295 | * | ||
2296 | * Examples: | ||
2297 | * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 | ||
2298 | * => allows an AP and a STA that must match BIs | ||
2299 | * | ||
2300 | * numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8 | ||
2301 | * => allows 8 of AP/GO | ||
2302 | * | ||
2303 | * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 | ||
2304 | * => allows two STAs on different channels | ||
2305 | * | ||
2306 | * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4 | ||
2307 | * => allows a STA plus three P2P interfaces | ||
2308 | * | ||
2309 | * The list of these four possiblities could completely be contained | ||
2310 | * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate | ||
2311 | * that any of these groups must match. | ||
2312 | * | ||
2313 | * "Combinations" of just a single interface will not be listed here, | ||
2314 | * a single interface of any valid interface type is assumed to always | ||
2315 | * be possible by itself. This means that implicitly, for each valid | ||
2316 | * interface type, the following group always exists: | ||
2317 | * numbers = [ #{<type>} <= 1 ], channels = 1, max = 1 | ||
2318 | */ | ||
2319 | enum nl80211_if_combination_attrs { | ||
2320 | NL80211_IFACE_COMB_UNSPEC, | ||
2321 | NL80211_IFACE_COMB_LIMITS, | ||
2322 | NL80211_IFACE_COMB_MAXNUM, | ||
2323 | NL80211_IFACE_COMB_STA_AP_BI_MATCH, | ||
2324 | NL80211_IFACE_COMB_NUM_CHANNELS, | ||
2325 | |||
2326 | /* keep last */ | ||
2327 | NUM_NL80211_IFACE_COMB, | ||
2328 | MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1 | ||
2329 | }; | ||
2330 | |||
2331 | |||
2332 | /** | ||
2333 | * enum nl80211_plink_state - state of a mesh peer link finite state machine | ||
2334 | * | ||
2335 | * @NL80211_PLINK_LISTEN: initial state, considered the implicit | ||
2336 | * state of non existant mesh peer links | ||
2337 | * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to | ||
2338 | * this mesh peer | ||
2339 | * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received | ||
2340 | * from this mesh peer | ||
2341 | * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been | ||
2342 | * received from this mesh peer | ||
2343 | * @NL80211_PLINK_ESTAB: mesh peer link is established | ||
2344 | * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled | ||
2345 | * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh | ||
2346 | * plink are discarded | ||
2347 | * @NUM_NL80211_PLINK_STATES: number of peer link states | ||
2348 | * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states | ||
2349 | */ | ||
2350 | enum nl80211_plink_state { | ||
2351 | NL80211_PLINK_LISTEN, | ||
2352 | NL80211_PLINK_OPN_SNT, | ||
2353 | NL80211_PLINK_OPN_RCVD, | ||
2354 | NL80211_PLINK_CNF_RCVD, | ||
2355 | NL80211_PLINK_ESTAB, | ||
2356 | NL80211_PLINK_HOLDING, | ||
2357 | NL80211_PLINK_BLOCKED, | ||
2358 | |||
2359 | /* keep last */ | ||
2360 | NUM_NL80211_PLINK_STATES, | ||
2361 | MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 | ||
2362 | }; | ||
2363 | |||
2005 | #endif /* __LINUX_NL80211_H */ | 2364 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index c536f8545f74..2d304efc89df 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -45,11 +45,12 @@ static inline bool trigger_all_cpu_backtrace(void) | |||
45 | 45 | ||
46 | #ifdef CONFIG_LOCKUP_DETECTOR | 46 | #ifdef CONFIG_LOCKUP_DETECTOR |
47 | int hw_nmi_is_cpu_stuck(struct pt_regs *); | 47 | int hw_nmi_is_cpu_stuck(struct pt_regs *); |
48 | u64 hw_nmi_get_sample_period(void); | 48 | u64 hw_nmi_get_sample_period(int watchdog_thresh); |
49 | extern int watchdog_enabled; | 49 | extern int watchdog_enabled; |
50 | extern int watchdog_thresh; | ||
50 | struct ctl_table; | 51 | struct ctl_table; |
51 | extern int proc_dowatchdog_enabled(struct ctl_table *, int , | 52 | extern int proc_dowatchdog(struct ctl_table *, int , |
52 | void __user *, size_t *, loff_t *); | 53 | void __user *, size_t *, loff_t *); |
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | #endif | 56 | #endif |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 621dfa16acc0..c0688b0168b3 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -209,8 +209,9 @@ static inline int notifier_to_errno(int ret) | |||
209 | #define NETDEV_POST_TYPE_CHANGE 0x000F | 209 | #define NETDEV_POST_TYPE_CHANGE 0x000F |
210 | #define NETDEV_POST_INIT 0x0010 | 210 | #define NETDEV_POST_INIT 0x0010 |
211 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 211 | #define NETDEV_UNREGISTER_BATCH 0x0011 |
212 | #define NETDEV_BONDING_DESLAVE 0x0012 | 212 | #define NETDEV_RELEASE 0x0012 |
213 | #define NETDEV_NOTIFY_PEERS 0x0013 | 213 | #define NETDEV_NOTIFY_PEERS 0x0013 |
214 | #define NETDEV_JOIN 0x0014 | ||
214 | 215 | ||
215 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 216 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
216 | #define SYS_RESTART SYS_DOWN | 217 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 7b370c7cfeff..50d20aba57d3 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -81,13 +81,4 @@ static inline void get_nsproxy(struct nsproxy *ns) | |||
81 | atomic_inc(&ns->count); | 81 | atomic_inc(&ns->count); |
82 | } | 82 | } |
83 | 83 | ||
84 | #ifdef CONFIG_CGROUP_NS | ||
85 | int ns_cgroup_clone(struct task_struct *tsk, struct pid *pid); | ||
86 | #else | ||
87 | static inline int ns_cgroup_clone(struct task_struct *tsk, struct pid *pid) | ||
88 | { | ||
89 | return 0; | ||
90 | } | ||
91 | #endif | ||
92 | |||
93 | #endif | 84 | #endif |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 109e013b1772..e6955f5d1f08 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -68,6 +68,7 @@ extern int of_irq_to_resource(struct device_node *dev, int index, | |||
68 | extern int of_irq_count(struct device_node *dev); | 68 | extern int of_irq_count(struct device_node *dev); |
69 | extern int of_irq_to_resource_table(struct device_node *dev, | 69 | extern int of_irq_to_resource_table(struct device_node *dev, |
70 | struct resource *res, int nr_irqs); | 70 | struct resource *res, int nr_irqs); |
71 | extern struct device_node *of_irq_find_parent(struct device_node *child); | ||
71 | 72 | ||
72 | #endif /* CONFIG_OF_IRQ */ | 73 | #endif /* CONFIG_OF_IRQ */ |
73 | #endif /* CONFIG_OF */ | 74 | #endif /* CONFIG_OF */ |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 5e3aa8311c5e..4952fb874ad3 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -40,6 +40,8 @@ enum oom_constraint { | |||
40 | CONSTRAINT_MEMCG, | 40 | CONSTRAINT_MEMCG, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | extern int test_set_oom_score_adj(int new_val); | ||
44 | |||
43 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | 45 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, |
44 | const nodemask_t *nodemask, unsigned long totalpages); | 46 | const nodemask_t *nodemask, unsigned long totalpages); |
45 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 47 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 811183de1ef5..6081493db68f 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -308,7 +308,7 @@ static inline void SetPageUptodate(struct page *page) | |||
308 | { | 308 | { |
309 | #ifdef CONFIG_S390 | 309 | #ifdef CONFIG_S390 |
310 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | 310 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
311 | page_clear_dirty(page, 0); | 311 | page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY, 0); |
312 | #else | 312 | #else |
313 | /* | 313 | /* |
314 | * Memory barrier must be issued before setting the PG_uptodate bit, | 314 | * Memory barrier must be issued before setting the PG_uptodate bit, |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c11950652646..716875e53520 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -219,6 +219,12 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
219 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); | 219 | return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); |
220 | } | 220 | } |
221 | 221 | ||
222 | static inline struct page *page_cache_alloc_readahead(struct address_space *x) | ||
223 | { | ||
224 | return __page_cache_alloc(mapping_gfp_mask(x) | | ||
225 | __GFP_COLD | __GFP_NORETRY | __GFP_NOWARN); | ||
226 | } | ||
227 | |||
222 | typedef int filler_t(void *, struct page *); | 228 | typedef int filler_t(void *, struct page *); |
223 | 229 | ||
224 | extern struct page * find_get_page(struct address_space *mapping, | 230 | extern struct page * find_get_page(struct address_space *mapping, |
@@ -357,6 +363,15 @@ static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, | |||
357 | */ | 363 | */ |
358 | extern void wait_on_page_bit(struct page *page, int bit_nr); | 364 | extern void wait_on_page_bit(struct page *page, int bit_nr); |
359 | 365 | ||
366 | extern int wait_on_page_bit_killable(struct page *page, int bit_nr); | ||
367 | |||
368 | static inline int wait_on_page_locked_killable(struct page *page) | ||
369 | { | ||
370 | if (PageLocked(page)) | ||
371 | return wait_on_page_bit_killable(page, PG_locked); | ||
372 | return 0; | ||
373 | } | ||
374 | |||
360 | /* | 375 | /* |
361 | * Wait for a page to be unlocked. | 376 | * Wait for a page to be unlocked. |
362 | * | 377 | * |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index 67cb3ae38016..7cea7b6c1413 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -28,6 +28,7 @@ extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | |||
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); | 29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); |
30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
31 | extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); | ||
31 | extern void pcie_clear_aspm(void); | 32 | extern void pcie_clear_aspm(void); |
32 | extern void pcie_no_aspm(void); | 33 | extern void pcie_no_aspm(void); |
33 | #else | 34 | #else |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h new file mode 100644 index 000000000000..655824fa4c76 --- /dev/null +++ b/include/linux/pci-ats.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef LINUX_PCI_ATS_H | ||
2 | #define LINUX_PCI_ATS_H | ||
3 | |||
4 | /* Address Translation Service */ | ||
5 | struct pci_ats { | ||
6 | int pos; /* capability position */ | ||
7 | int stu; /* Smallest Translation Unit */ | ||
8 | int qdep; /* Invalidate Queue Depth */ | ||
9 | int ref_cnt; /* Physical Function reference count */ | ||
10 | unsigned int is_enabled:1; /* Enable bit is set */ | ||
11 | }; | ||
12 | |||
13 | #ifdef CONFIG_PCI_IOV | ||
14 | |||
15 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | ||
16 | extern void pci_disable_ats(struct pci_dev *dev); | ||
17 | extern int pci_ats_queue_depth(struct pci_dev *dev); | ||
18 | /** | ||
19 | * pci_ats_enabled - query the ATS status | ||
20 | * @dev: the PCI device | ||
21 | * | ||
22 | * Returns 1 if ATS capability is enabled, or 0 if not. | ||
23 | */ | ||
24 | static inline int pci_ats_enabled(struct pci_dev *dev) | ||
25 | { | ||
26 | return dev->ats && dev->ats->is_enabled; | ||
27 | } | ||
28 | |||
29 | #else /* CONFIG_PCI_IOV */ | ||
30 | |||
31 | static inline int pci_enable_ats(struct pci_dev *dev, int ps) | ||
32 | { | ||
33 | return -ENODEV; | ||
34 | } | ||
35 | |||
36 | static inline void pci_disable_ats(struct pci_dev *dev) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | static inline int pci_ats_queue_depth(struct pci_dev *dev) | ||
41 | { | ||
42 | return -ENODEV; | ||
43 | } | ||
44 | |||
45 | static inline int pci_ats_enabled(struct pci_dev *dev) | ||
46 | { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | #endif /* CONFIG_PCI_IOV */ | ||
51 | |||
52 | #endif /* LINUX_PCI_ATS_H*/ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 96f70d7e058d..c446b5ca2d38 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -214,12 +214,17 @@ enum pci_bus_speed { | |||
214 | PCI_SPEED_UNKNOWN = 0xff, | 214 | PCI_SPEED_UNKNOWN = 0xff, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | struct pci_cap_saved_state { | 217 | struct pci_cap_saved_data { |
218 | struct hlist_node next; | ||
219 | char cap_nr; | 218 | char cap_nr; |
219 | unsigned int size; | ||
220 | u32 data[0]; | 220 | u32 data[0]; |
221 | }; | 221 | }; |
222 | 222 | ||
223 | struct pci_cap_saved_state { | ||
224 | struct hlist_node next; | ||
225 | struct pci_cap_saved_data cap; | ||
226 | }; | ||
227 | |||
223 | struct pcie_link_state; | 228 | struct pcie_link_state; |
224 | struct pci_vpd; | 229 | struct pci_vpd; |
225 | struct pci_sriov; | 230 | struct pci_sriov; |
@@ -366,7 +371,7 @@ static inline struct pci_cap_saved_state *pci_find_saved_cap( | |||
366 | struct hlist_node *pos; | 371 | struct hlist_node *pos; |
367 | 372 | ||
368 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { | 373 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { |
369 | if (tmp->cap_nr == cap) | 374 | if (tmp->cap.cap_nr == cap) |
370 | return tmp; | 375 | return tmp; |
371 | } | 376 | } |
372 | return NULL; | 377 | return NULL; |
@@ -807,6 +812,10 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | |||
807 | /* Power management related routines */ | 812 | /* Power management related routines */ |
808 | int pci_save_state(struct pci_dev *dev); | 813 | int pci_save_state(struct pci_dev *dev); |
809 | void pci_restore_state(struct pci_dev *dev); | 814 | void pci_restore_state(struct pci_dev *dev); |
815 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); | ||
816 | int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); | ||
817 | int pci_load_and_free_saved_state(struct pci_dev *dev, | ||
818 | struct pci_saved_state **state); | ||
810 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 819 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
811 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 820 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
812 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 821 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
@@ -828,6 +837,23 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
828 | return __pci_enable_wake(dev, state, false, enable); | 837 | return __pci_enable_wake(dev, state, false, enable); |
829 | } | 838 | } |
830 | 839 | ||
840 | #define PCI_EXP_IDO_REQUEST (1<<0) | ||
841 | #define PCI_EXP_IDO_COMPLETION (1<<1) | ||
842 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | ||
843 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | ||
844 | |||
845 | enum pci_obff_signal_type { | ||
846 | PCI_EXP_OBFF_SIGNAL_L0, | ||
847 | PCI_EXP_OBFF_SIGNAL_ALWAYS, | ||
848 | }; | ||
849 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
850 | void pci_disable_obff(struct pci_dev *dev); | ||
851 | |||
852 | bool pci_ltr_supported(struct pci_dev *dev); | ||
853 | int pci_enable_ltr(struct pci_dev *dev); | ||
854 | void pci_disable_ltr(struct pci_dev *dev); | ||
855 | int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); | ||
856 | |||
831 | /* For use by arch with custom probe code */ | 857 | /* For use by arch with custom probe code */ |
832 | void set_pcie_port_type(struct pci_dev *pdev); | 858 | void set_pcie_port_type(struct pci_dev *pdev); |
833 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | 859 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); |
@@ -915,8 +941,11 @@ int pci_cfg_space_size_ext(struct pci_dev *dev); | |||
915 | int pci_cfg_space_size(struct pci_dev *dev); | 941 | int pci_cfg_space_size(struct pci_dev *dev); |
916 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 942 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
917 | 943 | ||
944 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) | ||
945 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) | ||
946 | |||
918 | int pci_set_vga_state(struct pci_dev *pdev, bool decode, | 947 | int pci_set_vga_state(struct pci_dev *pdev, bool decode, |
919 | unsigned int command_bits, bool change_bridge); | 948 | unsigned int command_bits, u32 flags); |
920 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 949 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
921 | 950 | ||
922 | #include <linux/pci-dma.h> | 951 | #include <linux/pci-dma.h> |
@@ -1061,7 +1090,7 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
1061 | 1090 | ||
1062 | /* some architectures require additional setup to direct VGA traffic */ | 1091 | /* some architectures require additional setup to direct VGA traffic */ |
1063 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | 1092 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, |
1064 | unsigned int command_bits, bool change_bridge); | 1093 | unsigned int command_bits, u32 flags); |
1065 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); | 1094 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); |
1066 | 1095 | ||
1067 | #else /* CONFIG_PCI is not enabled */ | 1096 | #else /* CONFIG_PCI is not enabled */ |
@@ -1207,6 +1236,23 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
1207 | return 0; | 1236 | return 0; |
1208 | } | 1237 | } |
1209 | 1238 | ||
1239 | static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type) | ||
1240 | { | ||
1241 | } | ||
1242 | |||
1243 | static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | ||
1244 | { | ||
1245 | } | ||
1246 | |||
1247 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
1248 | { | ||
1249 | return 0; | ||
1250 | } | ||
1251 | |||
1252 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
1253 | { | ||
1254 | } | ||
1255 | |||
1210 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1256 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
1211 | { | 1257 | { |
1212 | return -EIO; | 1258 | return -EIO; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 8abe8d78c4bf..a311008af5e1 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -608,6 +608,8 @@ | |||
608 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 | 608 | #define PCI_DEVICE_ID_MATROX_G550 0x2527 |
609 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 | 609 | #define PCI_DEVICE_ID_MATROX_VIA 0x4536 |
610 | 610 | ||
611 | #define PCI_VENDOR_ID_MOBILITY_ELECTRONICS 0x14f2 | ||
612 | |||
611 | #define PCI_VENDOR_ID_CT 0x102c | 613 | #define PCI_VENDOR_ID_CT 0x102c |
612 | #define PCI_DEVICE_ID_CT_69000 0x00c0 | 614 | #define PCI_DEVICE_ID_CT_69000 0x00c0 |
613 | #define PCI_DEVICE_ID_CT_65545 0x00d8 | 615 | #define PCI_DEVICE_ID_CT_65545 0x00d8 |
@@ -2481,6 +2483,9 @@ | |||
2481 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2483 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
2482 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 | 2484 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_0 0x1d40 |
2483 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 | 2485 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC_1 0x1d41 |
2486 | #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI 0x1e31 | ||
2487 | #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN 0x1e40 | ||
2488 | #define PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX 0x1e5f | ||
2484 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN 0x2310 | 2489 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN 0x2310 |
2485 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX 0x231f | 2490 | #define PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX 0x231f |
2486 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2491 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index be01380f798a..e8840964aca1 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -508,8 +508,18 @@ | |||
508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | 508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ |
509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
511 | #define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ | ||
512 | #define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ | ||
513 | #define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ | ||
514 | #define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ | ||
511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 515 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
512 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ | 516 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ |
517 | #define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ | ||
518 | #define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ | ||
519 | #define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */ | ||
520 | #define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ | ||
521 | #define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ | ||
522 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ | ||
513 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 523 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
514 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 524 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
515 | 525 | ||
@@ -527,6 +537,7 @@ | |||
527 | #define PCI_EXT_CAP_ID_ARI 14 | 537 | #define PCI_EXT_CAP_ID_ARI 14 |
528 | #define PCI_EXT_CAP_ID_ATS 15 | 538 | #define PCI_EXT_CAP_ID_ATS 15 |
529 | #define PCI_EXT_CAP_ID_SRIOV 16 | 539 | #define PCI_EXT_CAP_ID_SRIOV 16 |
540 | #define PCI_EXT_CAP_ID_LTR 24 | ||
530 | 541 | ||
531 | /* Advanced Error Reporting */ | 542 | /* Advanced Error Reporting */ |
532 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ | 543 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
@@ -683,6 +694,12 @@ | |||
683 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 694 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
684 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 695 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
685 | 696 | ||
697 | #define PCI_LTR_MAX_SNOOP_LAT 0x4 | ||
698 | #define PCI_LTR_MAX_NOSNOOP_LAT 0x6 | ||
699 | #define PCI_LTR_VALUE_MASK 0x000003ff | ||
700 | #define PCI_LTR_SCALE_MASK 0x00001c00 | ||
701 | #define PCI_LTR_SCALE_SHIFT 10 | ||
702 | |||
686 | /* Access Control Service */ | 703 | /* Access Control Service */ |
687 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | 704 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ |
688 | #define PCI_ACS_SV 0x01 /* Source Validation */ | 705 | #define PCI_ACS_SV 0x01 /* Source Validation */ |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 8b97308e65df..9ca008f0c542 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -259,6 +259,9 @@ extern void __bad_size_call_parameter(void); | |||
259 | * Special handling for cmpxchg_double. cmpxchg_double is passed two | 259 | * Special handling for cmpxchg_double. cmpxchg_double is passed two |
260 | * percpu variables. The first has to be aligned to a double word | 260 | * percpu variables. The first has to be aligned to a double word |
261 | * boundary and the second has to follow directly thereafter. | 261 | * boundary and the second has to follow directly thereafter. |
262 | * We enforce this on all architectures even if they don't support | ||
263 | * a double cmpxchg instruction, since it's a cheap requirement, and it | ||
264 | * avoids breaking the requirement for architectures with the instruction. | ||
262 | */ | 265 | */ |
263 | #define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ | 266 | #define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ |
264 | ({ \ | 267 | ({ \ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 46f6ba56fa91..5edc9014263a 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -75,7 +75,7 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) | |||
75 | barrier(); /* Prevent reloads of fbc->count */ | 75 | barrier(); /* Prevent reloads of fbc->count */ |
76 | if (ret >= 0) | 76 | if (ret >= 0) |
77 | return ret; | 77 | return ret; |
78 | return 1; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) | 81 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) |
@@ -133,6 +133,10 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc) | |||
133 | return fbc->count; | 133 | return fbc->count; |
134 | } | 134 | } |
135 | 135 | ||
136 | /* | ||
137 | * percpu_counter is intended to track positive numbers. In the UP case the | ||
138 | * number should never be negative. | ||
139 | */ | ||
136 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) | 140 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
137 | { | 141 | { |
138 | return fbc->count; | 142 | return fbc->count; |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index ee9f1e782800..e0786e35f247 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -2,8 +2,8 @@ | |||
2 | * Performance events: | 2 | * Performance events: |
3 | * | 3 | * |
4 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> | 4 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> |
5 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar | 5 | * Copyright (C) 2008-2011, Red Hat, Inc., Ingo Molnar |
6 | * Copyright (C) 2008-2009, Red Hat, Inc., Peter Zijlstra | 6 | * Copyright (C) 2008-2011, Red Hat, Inc., Peter Zijlstra |
7 | * | 7 | * |
8 | * Data type definitions, declarations, prototypes. | 8 | * Data type definitions, declarations, prototypes. |
9 | * | 9 | * |
@@ -52,6 +52,8 @@ enum perf_hw_id { | |||
52 | PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, | 52 | PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, |
53 | PERF_COUNT_HW_BRANCH_MISSES = 5, | 53 | PERF_COUNT_HW_BRANCH_MISSES = 5, |
54 | PERF_COUNT_HW_BUS_CYCLES = 6, | 54 | PERF_COUNT_HW_BUS_CYCLES = 6, |
55 | PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7, | ||
56 | PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8, | ||
55 | 57 | ||
56 | PERF_COUNT_HW_MAX, /* non-ABI */ | 58 | PERF_COUNT_HW_MAX, /* non-ABI */ |
57 | }; | 59 | }; |
@@ -135,14 +137,14 @@ enum perf_event_sample_format { | |||
135 | * | 137 | * |
136 | * struct read_format { | 138 | * struct read_format { |
137 | * { u64 value; | 139 | * { u64 value; |
138 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | 140 | * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED |
139 | * { u64 time_running; } && PERF_FORMAT_RUNNING | 141 | * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING |
140 | * { u64 id; } && PERF_FORMAT_ID | 142 | * { u64 id; } && PERF_FORMAT_ID |
141 | * } && !PERF_FORMAT_GROUP | 143 | * } && !PERF_FORMAT_GROUP |
142 | * | 144 | * |
143 | * { u64 nr; | 145 | * { u64 nr; |
144 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | 146 | * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED |
145 | * { u64 time_running; } && PERF_FORMAT_RUNNING | 147 | * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING |
146 | * { u64 value; | 148 | * { u64 value; |
147 | * { u64 id; } && PERF_FORMAT_ID | 149 | * { u64 id; } && PERF_FORMAT_ID |
148 | * } cntr[nr]; | 150 | * } cntr[nr]; |
@@ -468,9 +470,9 @@ enum perf_callchain_context { | |||
468 | PERF_CONTEXT_MAX = (__u64)-4095, | 470 | PERF_CONTEXT_MAX = (__u64)-4095, |
469 | }; | 471 | }; |
470 | 472 | ||
471 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 473 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
472 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 474 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
473 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ | 475 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ |
474 | 476 | ||
475 | #ifdef __KERNEL__ | 477 | #ifdef __KERNEL__ |
476 | /* | 478 | /* |
@@ -484,9 +486,9 @@ enum perf_callchain_context { | |||
484 | #endif | 486 | #endif |
485 | 487 | ||
486 | struct perf_guest_info_callbacks { | 488 | struct perf_guest_info_callbacks { |
487 | int (*is_in_guest) (void); | 489 | int (*is_in_guest)(void); |
488 | int (*is_user_mode) (void); | 490 | int (*is_user_mode)(void); |
489 | unsigned long (*get_guest_ip) (void); | 491 | unsigned long (*get_guest_ip)(void); |
490 | }; | 492 | }; |
491 | 493 | ||
492 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 494 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
@@ -505,7 +507,7 @@ struct perf_guest_info_callbacks { | |||
505 | #include <linux/ftrace.h> | 507 | #include <linux/ftrace.h> |
506 | #include <linux/cpu.h> | 508 | #include <linux/cpu.h> |
507 | #include <linux/irq_work.h> | 509 | #include <linux/irq_work.h> |
508 | #include <linux/jump_label_ref.h> | 510 | #include <linux/jump_label.h> |
509 | #include <asm/atomic.h> | 511 | #include <asm/atomic.h> |
510 | #include <asm/local.h> | 512 | #include <asm/local.h> |
511 | 513 | ||
@@ -652,19 +654,19 @@ struct pmu { | |||
652 | * Start the transaction, after this ->add() doesn't need to | 654 | * Start the transaction, after this ->add() doesn't need to |
653 | * do schedulability tests. | 655 | * do schedulability tests. |
654 | */ | 656 | */ |
655 | void (*start_txn) (struct pmu *pmu); /* optional */ | 657 | void (*start_txn) (struct pmu *pmu); /* optional */ |
656 | /* | 658 | /* |
657 | * If ->start_txn() disabled the ->add() schedulability test | 659 | * If ->start_txn() disabled the ->add() schedulability test |
658 | * then ->commit_txn() is required to perform one. On success | 660 | * then ->commit_txn() is required to perform one. On success |
659 | * the transaction is closed. On error the transaction is kept | 661 | * the transaction is closed. On error the transaction is kept |
660 | * open until ->cancel_txn() is called. | 662 | * open until ->cancel_txn() is called. |
661 | */ | 663 | */ |
662 | int (*commit_txn) (struct pmu *pmu); /* optional */ | 664 | int (*commit_txn) (struct pmu *pmu); /* optional */ |
663 | /* | 665 | /* |
664 | * Will cancel the transaction, assumes ->del() is called | 666 | * Will cancel the transaction, assumes ->del() is called |
665 | * for each successful ->add() during the transaction. | 667 | * for each successful ->add() during the transaction. |
666 | */ | 668 | */ |
667 | void (*cancel_txn) (struct pmu *pmu); /* optional */ | 669 | void (*cancel_txn) (struct pmu *pmu); /* optional */ |
668 | }; | 670 | }; |
669 | 671 | ||
670 | /** | 672 | /** |
@@ -712,15 +714,15 @@ typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | |||
712 | struct pt_regs *regs); | 714 | struct pt_regs *regs); |
713 | 715 | ||
714 | enum perf_group_flag { | 716 | enum perf_group_flag { |
715 | PERF_GROUP_SOFTWARE = 0x1, | 717 | PERF_GROUP_SOFTWARE = 0x1, |
716 | }; | 718 | }; |
717 | 719 | ||
718 | #define SWEVENT_HLIST_BITS 8 | 720 | #define SWEVENT_HLIST_BITS 8 |
719 | #define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS) | 721 | #define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS) |
720 | 722 | ||
721 | struct swevent_hlist { | 723 | struct swevent_hlist { |
722 | struct hlist_head heads[SWEVENT_HLIST_SIZE]; | 724 | struct hlist_head heads[SWEVENT_HLIST_SIZE]; |
723 | struct rcu_head rcu_head; | 725 | struct rcu_head rcu_head; |
724 | }; | 726 | }; |
725 | 727 | ||
726 | #define PERF_ATTACH_CONTEXT 0x01 | 728 | #define PERF_ATTACH_CONTEXT 0x01 |
@@ -733,13 +735,13 @@ struct swevent_hlist { | |||
733 | * This is a per-cpu dynamically allocated data structure. | 735 | * This is a per-cpu dynamically allocated data structure. |
734 | */ | 736 | */ |
735 | struct perf_cgroup_info { | 737 | struct perf_cgroup_info { |
736 | u64 time; | 738 | u64 time; |
737 | u64 timestamp; | 739 | u64 timestamp; |
738 | }; | 740 | }; |
739 | 741 | ||
740 | struct perf_cgroup { | 742 | struct perf_cgroup { |
741 | struct cgroup_subsys_state css; | 743 | struct cgroup_subsys_state css; |
742 | struct perf_cgroup_info *info; /* timing info, one per cpu */ | 744 | struct perf_cgroup_info *info; /* timing info, one per cpu */ |
743 | }; | 745 | }; |
744 | #endif | 746 | #endif |
745 | 747 | ||
@@ -923,7 +925,7 @@ struct perf_event_context { | |||
923 | 925 | ||
924 | /* | 926 | /* |
925 | * Number of contexts where an event can trigger: | 927 | * Number of contexts where an event can trigger: |
926 | * task, softirq, hardirq, nmi. | 928 | * task, softirq, hardirq, nmi. |
927 | */ | 929 | */ |
928 | #define PERF_NR_CONTEXTS 4 | 930 | #define PERF_NR_CONTEXTS 4 |
929 | 931 | ||
@@ -1001,8 +1003,7 @@ struct perf_sample_data { | |||
1001 | struct perf_raw_record *raw; | 1003 | struct perf_raw_record *raw; |
1002 | }; | 1004 | }; |
1003 | 1005 | ||
1004 | static inline | 1006 | static inline void perf_sample_data_init(struct perf_sample_data *data, u64 addr) |
1005 | void perf_sample_data_init(struct perf_sample_data *data, u64 addr) | ||
1006 | { | 1007 | { |
1007 | data->addr = addr; | 1008 | data->addr = addr; |
1008 | data->raw = NULL; | 1009 | data->raw = NULL; |
@@ -1034,13 +1035,12 @@ static inline int is_software_event(struct perf_event *event) | |||
1034 | return event->pmu->task_ctx_nr == perf_sw_context; | 1035 | return event->pmu->task_ctx_nr == perf_sw_context; |
1035 | } | 1036 | } |
1036 | 1037 | ||
1037 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 1038 | extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
1038 | 1039 | ||
1039 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 1040 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); |
1040 | 1041 | ||
1041 | #ifndef perf_arch_fetch_caller_regs | 1042 | #ifndef perf_arch_fetch_caller_regs |
1042 | static inline void | 1043 | static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } |
1043 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } | ||
1044 | #endif | 1044 | #endif |
1045 | 1045 | ||
1046 | /* | 1046 | /* |
@@ -1063,26 +1063,24 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | |||
1063 | { | 1063 | { |
1064 | struct pt_regs hot_regs; | 1064 | struct pt_regs hot_regs; |
1065 | 1065 | ||
1066 | JUMP_LABEL(&perf_swevent_enabled[event_id], have_event); | 1066 | if (static_branch(&perf_swevent_enabled[event_id])) { |
1067 | return; | 1067 | if (!regs) { |
1068 | 1068 | perf_fetch_caller_regs(&hot_regs); | |
1069 | have_event: | 1069 | regs = &hot_regs; |
1070 | if (!regs) { | 1070 | } |
1071 | perf_fetch_caller_regs(&hot_regs); | 1071 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1072 | regs = &hot_regs; | ||
1073 | } | 1072 | } |
1074 | __perf_sw_event(event_id, nr, nmi, regs, addr); | ||
1075 | } | 1073 | } |
1076 | 1074 | ||
1077 | extern atomic_t perf_sched_events; | 1075 | extern struct jump_label_key perf_sched_events; |
1078 | 1076 | ||
1079 | static inline void perf_event_task_sched_in(struct task_struct *task) | 1077 | static inline void perf_event_task_sched_in(struct task_struct *task) |
1080 | { | 1078 | { |
1081 | COND_STMT(&perf_sched_events, __perf_event_task_sched_in(task)); | 1079 | if (static_branch(&perf_sched_events)) |
1080 | __perf_event_task_sched_in(task); | ||
1082 | } | 1081 | } |
1083 | 1082 | ||
1084 | static inline | 1083 | static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) |
1085 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
1086 | { | 1084 | { |
1087 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | 1085 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); |
1088 | 1086 | ||
@@ -1100,14 +1098,10 @@ extern void perf_event_fork(struct task_struct *tsk); | |||
1100 | /* Callchains */ | 1098 | /* Callchains */ |
1101 | DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry); | 1099 | DECLARE_PER_CPU(struct perf_callchain_entry, perf_callchain_entry); |
1102 | 1100 | ||
1103 | extern void perf_callchain_user(struct perf_callchain_entry *entry, | 1101 | extern void perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs); |
1104 | struct pt_regs *regs); | 1102 | extern void perf_callchain_kernel(struct perf_callchain_entry *entry, struct pt_regs *regs); |
1105 | extern void perf_callchain_kernel(struct perf_callchain_entry *entry, | ||
1106 | struct pt_regs *regs); | ||
1107 | |||
1108 | 1103 | ||
1109 | static inline void | 1104 | static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) |
1110 | perf_callchain_store(struct perf_callchain_entry *entry, u64 ip) | ||
1111 | { | 1105 | { |
1112 | if (entry->nr < PERF_MAX_STACK_DEPTH) | 1106 | if (entry->nr < PERF_MAX_STACK_DEPTH) |
1113 | entry->ip[entry->nr++] = ip; | 1107 | entry->ip[entry->nr++] = ip; |
@@ -1143,9 +1137,9 @@ extern void perf_tp_event(u64 addr, u64 count, void *record, | |||
1143 | extern void perf_bp_event(struct perf_event *event, void *data); | 1137 | extern void perf_bp_event(struct perf_event *event, void *data); |
1144 | 1138 | ||
1145 | #ifndef perf_misc_flags | 1139 | #ifndef perf_misc_flags |
1146 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ | 1140 | # define perf_misc_flags(regs) \ |
1147 | PERF_RECORD_MISC_KERNEL) | 1141 | (user_mode(regs) ? PERF_RECORD_MISC_USER : PERF_RECORD_MISC_KERNEL) |
1148 | #define perf_instruction_pointer(regs) instruction_pointer(regs) | 1142 | # define perf_instruction_pointer(regs) instruction_pointer(regs) |
1149 | #endif | 1143 | #endif |
1150 | 1144 | ||
1151 | extern int perf_output_begin(struct perf_output_handle *handle, | 1145 | extern int perf_output_begin(struct perf_output_handle *handle, |
@@ -1180,9 +1174,9 @@ static inline void | |||
1180 | perf_bp_event(struct perf_event *event, void *data) { } | 1174 | perf_bp_event(struct perf_event *event, void *data) { } |
1181 | 1175 | ||
1182 | static inline int perf_register_guest_info_callbacks | 1176 | static inline int perf_register_guest_info_callbacks |
1183 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | 1177 | (struct perf_guest_info_callbacks *callbacks) { return 0; } |
1184 | static inline int perf_unregister_guest_info_callbacks | 1178 | static inline int perf_unregister_guest_info_callbacks |
1185 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | 1179 | (struct perf_guest_info_callbacks *callbacks) { return 0; } |
1186 | 1180 | ||
1187 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 1181 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
1188 | static inline void perf_event_comm(struct task_struct *tsk) { } | 1182 | static inline void perf_event_comm(struct task_struct *tsk) { } |
@@ -1195,23 +1189,22 @@ static inline void perf_event_disable(struct perf_event *event) { } | |||
1195 | static inline void perf_event_task_tick(void) { } | 1189 | static inline void perf_event_task_tick(void) { } |
1196 | #endif | 1190 | #endif |
1197 | 1191 | ||
1198 | #define perf_output_put(handle, x) \ | 1192 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) |
1199 | perf_output_copy((handle), &(x), sizeof(x)) | ||
1200 | 1193 | ||
1201 | /* | 1194 | /* |
1202 | * This has to have a higher priority than migration_notifier in sched.c. | 1195 | * This has to have a higher priority than migration_notifier in sched.c. |
1203 | */ | 1196 | */ |
1204 | #define perf_cpu_notifier(fn) \ | 1197 | #define perf_cpu_notifier(fn) \ |
1205 | do { \ | 1198 | do { \ |
1206 | static struct notifier_block fn##_nb __cpuinitdata = \ | 1199 | static struct notifier_block fn##_nb __cpuinitdata = \ |
1207 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ | 1200 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
1208 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ | 1201 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ |
1209 | (void *)(unsigned long)smp_processor_id()); \ | 1202 | (void *)(unsigned long)smp_processor_id()); \ |
1210 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ | 1203 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ |
1211 | (void *)(unsigned long)smp_processor_id()); \ | 1204 | (void *)(unsigned long)smp_processor_id()); \ |
1212 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ | 1205 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ |
1213 | (void *)(unsigned long)smp_processor_id()); \ | 1206 | (void *)(unsigned long)smp_processor_id()); \ |
1214 | register_cpu_notifier(&fn##_nb); \ | 1207 | register_cpu_notifier(&fn##_nb); \ |
1215 | } while (0) | 1208 | } while (0) |
1216 | 1209 | ||
1217 | #endif /* __KERNEL__ */ | 1210 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/pid.h b/include/linux/pid.h index cdced84261d7..b152d44fb181 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -105,7 +105,7 @@ extern struct pid_namespace init_pid_ns; | |||
105 | * or rcu_read_lock() held. | 105 | * or rcu_read_lock() held. |
106 | * | 106 | * |
107 | * find_pid_ns() finds the pid in the namespace specified | 107 | * find_pid_ns() finds the pid in the namespace specified |
108 | * find_vpid() finr the pid by its virtual id, i.e. in the current namespace | 108 | * find_vpid() finds the pid by its virtual id, i.e. in the current namespace |
109 | * | 109 | * |
110 | * see also find_task_by_vpid() set in include/linux/sched.h | 110 | * see also find_task_by_vpid() set in include/linux/sched.h |
111 | */ | 111 | */ |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 3a02e0208575..c5336705921f 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -588,4 +588,19 @@ struct tc_sfb_xstats { | |||
588 | 588 | ||
589 | #define SFB_MAX_PROB 0xFFFF | 589 | #define SFB_MAX_PROB 0xFFFF |
590 | 590 | ||
591 | /* QFQ */ | ||
592 | enum { | ||
593 | TCA_QFQ_UNSPEC, | ||
594 | TCA_QFQ_WEIGHT, | ||
595 | TCA_QFQ_LMAX, | ||
596 | __TCA_QFQ_MAX | ||
597 | }; | ||
598 | |||
599 | #define TCA_QFQ_MAX (__TCA_QFQ_MAX - 1) | ||
600 | |||
601 | struct tc_qfq_stats { | ||
602 | __u32 weight; | ||
603 | __u32 lmax; | ||
604 | }; | ||
605 | |||
591 | #endif | 606 | #endif |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 744942c95fec..ede1a80e3358 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -150,9 +150,6 @@ extern struct platform_device *platform_create_bundle(struct platform_driver *dr | |||
150 | struct resource *res, unsigned int n_res, | 150 | struct resource *res, unsigned int n_res, |
151 | const void *data, size_t size); | 151 | const void *data, size_t size); |
152 | 152 | ||
153 | extern const struct dev_pm_ops * platform_bus_get_pm_ops(void); | ||
154 | extern void platform_bus_set_pm_ops(const struct dev_pm_ops *pm); | ||
155 | |||
156 | /* early platform driver interface */ | 153 | /* early platform driver interface */ |
157 | struct early_platform_driver { | 154 | struct early_platform_driver { |
158 | const char *class_str; | 155 | const char *class_str; |
@@ -205,4 +202,64 @@ static inline char *early_platform_driver_setup_func(void) \ | |||
205 | } | 202 | } |
206 | #endif /* MODULE */ | 203 | #endif /* MODULE */ |
207 | 204 | ||
205 | #ifdef CONFIG_PM_SLEEP | ||
206 | extern int platform_pm_prepare(struct device *dev); | ||
207 | extern void platform_pm_complete(struct device *dev); | ||
208 | #else | ||
209 | #define platform_pm_prepare NULL | ||
210 | #define platform_pm_complete NULL | ||
211 | #endif | ||
212 | |||
213 | #ifdef CONFIG_SUSPEND | ||
214 | extern int platform_pm_suspend(struct device *dev); | ||
215 | extern int platform_pm_suspend_noirq(struct device *dev); | ||
216 | extern int platform_pm_resume(struct device *dev); | ||
217 | extern int platform_pm_resume_noirq(struct device *dev); | ||
218 | #else | ||
219 | #define platform_pm_suspend NULL | ||
220 | #define platform_pm_resume NULL | ||
221 | #define platform_pm_suspend_noirq NULL | ||
222 | #define platform_pm_resume_noirq NULL | ||
223 | #endif | ||
224 | |||
225 | #ifdef CONFIG_HIBERNATE_CALLBACKS | ||
226 | extern int platform_pm_freeze(struct device *dev); | ||
227 | extern int platform_pm_freeze_noirq(struct device *dev); | ||
228 | extern int platform_pm_thaw(struct device *dev); | ||
229 | extern int platform_pm_thaw_noirq(struct device *dev); | ||
230 | extern int platform_pm_poweroff(struct device *dev); | ||
231 | extern int platform_pm_poweroff_noirq(struct device *dev); | ||
232 | extern int platform_pm_restore(struct device *dev); | ||
233 | extern int platform_pm_restore_noirq(struct device *dev); | ||
234 | #else | ||
235 | #define platform_pm_freeze NULL | ||
236 | #define platform_pm_thaw NULL | ||
237 | #define platform_pm_poweroff NULL | ||
238 | #define platform_pm_restore NULL | ||
239 | #define platform_pm_freeze_noirq NULL | ||
240 | #define platform_pm_thaw_noirq NULL | ||
241 | #define platform_pm_poweroff_noirq NULL | ||
242 | #define platform_pm_restore_noirq NULL | ||
243 | #endif | ||
244 | |||
245 | #ifdef CONFIG_PM_SLEEP | ||
246 | #define USE_PLATFORM_PM_SLEEP_OPS \ | ||
247 | .prepare = platform_pm_prepare, \ | ||
248 | .complete = platform_pm_complete, \ | ||
249 | .suspend = platform_pm_suspend, \ | ||
250 | .resume = platform_pm_resume, \ | ||
251 | .freeze = platform_pm_freeze, \ | ||
252 | .thaw = platform_pm_thaw, \ | ||
253 | .poweroff = platform_pm_poweroff, \ | ||
254 | .restore = platform_pm_restore, \ | ||
255 | .suspend_noirq = platform_pm_suspend_noirq, \ | ||
256 | .resume_noirq = platform_pm_resume_noirq, \ | ||
257 | .freeze_noirq = platform_pm_freeze_noirq, \ | ||
258 | .thaw_noirq = platform_pm_thaw_noirq, \ | ||
259 | .poweroff_noirq = platform_pm_poweroff_noirq, \ | ||
260 | .restore_noirq = platform_pm_restore_noirq, | ||
261 | #else | ||
262 | #define USE_PLATFORM_PM_SLEEP_OPS | ||
263 | #endif | ||
264 | |||
208 | #endif /* _PLATFORM_DEVICE_H_ */ | 265 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 512e09177e57..3160648ccdda 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -460,6 +460,7 @@ struct dev_pm_info { | |||
460 | unsigned long active_jiffies; | 460 | unsigned long active_jiffies; |
461 | unsigned long suspended_jiffies; | 461 | unsigned long suspended_jiffies; |
462 | unsigned long accounting_timestamp; | 462 | unsigned long accounting_timestamp; |
463 | void *subsys_data; /* Owned by the subsystem. */ | ||
463 | #endif | 464 | #endif |
464 | }; | 465 | }; |
465 | 466 | ||
@@ -529,21 +530,17 @@ struct dev_power_domain { | |||
529 | */ | 530 | */ |
530 | 531 | ||
531 | #ifdef CONFIG_PM_SLEEP | 532 | #ifdef CONFIG_PM_SLEEP |
532 | #ifndef CONFIG_ARCH_NO_SYSDEV_OPS | ||
533 | extern int sysdev_suspend(pm_message_t state); | ||
534 | extern int sysdev_resume(void); | ||
535 | #else | ||
536 | static inline int sysdev_suspend(pm_message_t state) { return 0; } | ||
537 | static inline int sysdev_resume(void) { return 0; } | ||
538 | #endif | ||
539 | |||
540 | extern void device_pm_lock(void); | 533 | extern void device_pm_lock(void); |
541 | extern void dpm_resume_noirq(pm_message_t state); | 534 | extern void dpm_resume_noirq(pm_message_t state); |
542 | extern void dpm_resume_end(pm_message_t state); | 535 | extern void dpm_resume_end(pm_message_t state); |
536 | extern void dpm_resume(pm_message_t state); | ||
537 | extern void dpm_complete(pm_message_t state); | ||
543 | 538 | ||
544 | extern void device_pm_unlock(void); | 539 | extern void device_pm_unlock(void); |
545 | extern int dpm_suspend_noirq(pm_message_t state); | 540 | extern int dpm_suspend_noirq(pm_message_t state); |
546 | extern int dpm_suspend_start(pm_message_t state); | 541 | extern int dpm_suspend_start(pm_message_t state); |
542 | extern int dpm_suspend(pm_message_t state); | ||
543 | extern int dpm_prepare(pm_message_t state); | ||
547 | 544 | ||
548 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 545 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
549 | 546 | ||
@@ -553,6 +550,16 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
553 | } while (0) | 550 | } while (0) |
554 | 551 | ||
555 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); | 552 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); |
553 | |||
554 | extern int pm_generic_prepare(struct device *dev); | ||
555 | extern int pm_generic_suspend(struct device *dev); | ||
556 | extern int pm_generic_resume(struct device *dev); | ||
557 | extern int pm_generic_freeze(struct device *dev); | ||
558 | extern int pm_generic_thaw(struct device *dev); | ||
559 | extern int pm_generic_restore(struct device *dev); | ||
560 | extern int pm_generic_poweroff(struct device *dev); | ||
561 | extern void pm_generic_complete(struct device *dev); | ||
562 | |||
556 | #else /* !CONFIG_PM_SLEEP */ | 563 | #else /* !CONFIG_PM_SLEEP */ |
557 | 564 | ||
558 | #define device_pm_lock() do {} while (0) | 565 | #define device_pm_lock() do {} while (0) |
@@ -569,6 +576,15 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b) | |||
569 | { | 576 | { |
570 | return 0; | 577 | return 0; |
571 | } | 578 | } |
579 | |||
580 | #define pm_generic_prepare NULL | ||
581 | #define pm_generic_suspend NULL | ||
582 | #define pm_generic_resume NULL | ||
583 | #define pm_generic_freeze NULL | ||
584 | #define pm_generic_thaw NULL | ||
585 | #define pm_generic_restore NULL | ||
586 | #define pm_generic_poweroff NULL | ||
587 | #define pm_generic_complete NULL | ||
572 | #endif /* !CONFIG_PM_SLEEP */ | 588 | #endif /* !CONFIG_PM_SLEEP */ |
573 | 589 | ||
574 | /* How to reorder dpm_list after device_move() */ | 590 | /* How to reorder dpm_list after device_move() */ |
@@ -579,11 +595,4 @@ enum dpm_order { | |||
579 | DPM_ORDER_DEV_LAST, | 595 | DPM_ORDER_DEV_LAST, |
580 | }; | 596 | }; |
581 | 597 | ||
582 | extern int pm_generic_suspend(struct device *dev); | ||
583 | extern int pm_generic_resume(struct device *dev); | ||
584 | extern int pm_generic_freeze(struct device *dev); | ||
585 | extern int pm_generic_thaw(struct device *dev); | ||
586 | extern int pm_generic_restore(struct device *dev); | ||
587 | extern int pm_generic_poweroff(struct device *dev); | ||
588 | |||
589 | #endif /* _LINUX_PM_H */ | 598 | #endif /* _LINUX_PM_H */ |
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h index 77cbddb3784c..a7d87f911cab 100644 --- a/include/linux/pm_qos_params.h +++ b/include/linux/pm_qos_params.h | |||
@@ -16,6 +16,10 @@ | |||
16 | #define PM_QOS_NUM_CLASSES 4 | 16 | #define PM_QOS_NUM_CLASSES 4 |
17 | #define PM_QOS_DEFAULT_VALUE -1 | 17 | #define PM_QOS_DEFAULT_VALUE -1 |
18 | 18 | ||
19 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | ||
20 | #define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | ||
21 | #define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 | ||
22 | |||
19 | struct pm_qos_request_list { | 23 | struct pm_qos_request_list { |
20 | struct plist_node list; | 24 | struct plist_node list; |
21 | int pm_qos_class; | 25 | int pm_qos_class; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 8de9aa6e7def..878cf84baeb1 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -245,4 +245,46 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev) | |||
245 | __pm_runtime_use_autosuspend(dev, false); | 245 | __pm_runtime_use_autosuspend(dev, false); |
246 | } | 246 | } |
247 | 247 | ||
248 | struct pm_clk_notifier_block { | ||
249 | struct notifier_block nb; | ||
250 | struct dev_power_domain *pwr_domain; | ||
251 | char *con_ids[]; | ||
252 | }; | ||
253 | |||
254 | #ifdef CONFIG_PM_RUNTIME_CLK | ||
255 | extern int pm_runtime_clk_init(struct device *dev); | ||
256 | extern void pm_runtime_clk_destroy(struct device *dev); | ||
257 | extern int pm_runtime_clk_add(struct device *dev, const char *con_id); | ||
258 | extern void pm_runtime_clk_remove(struct device *dev, const char *con_id); | ||
259 | extern int pm_runtime_clk_suspend(struct device *dev); | ||
260 | extern int pm_runtime_clk_resume(struct device *dev); | ||
261 | #else | ||
262 | static inline int pm_runtime_clk_init(struct device *dev) | ||
263 | { | ||
264 | return -EINVAL; | ||
265 | } | ||
266 | static inline void pm_runtime_clk_destroy(struct device *dev) | ||
267 | { | ||
268 | } | ||
269 | static inline int pm_runtime_clk_add(struct device *dev, const char *con_id) | ||
270 | { | ||
271 | return -EINVAL; | ||
272 | } | ||
273 | static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id) | ||
274 | { | ||
275 | } | ||
276 | #define pm_runtime_clock_suspend NULL | ||
277 | #define pm_runtime_clock_resume NULL | ||
278 | #endif | ||
279 | |||
280 | #ifdef CONFIG_HAVE_CLK | ||
281 | extern void pm_runtime_clk_add_notifier(struct bus_type *bus, | ||
282 | struct pm_clk_notifier_block *clknb); | ||
283 | #else | ||
284 | static inline void pm_runtime_clk_add_notifier(struct bus_type *bus, | ||
285 | struct pm_clk_notifier_block *clknb) | ||
286 | { | ||
287 | } | ||
288 | #endif | ||
289 | |||
248 | #endif | 290 | #endif |
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h new file mode 100644 index 000000000000..76efbdd01622 --- /dev/null +++ b/include/linux/pnfs_osd_xdr.h | |||
@@ -0,0 +1,345 @@ | |||
1 | /* | ||
2 | * pNFS-osd on-the-wire data structures | ||
3 | * | ||
4 | * Copyright (C) 2007 Panasas Inc. [year of first publication] | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Benny Halevy <bhalevy@panasas.com> | ||
8 | * Boaz Harrosh <bharrosh@panasas.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 | ||
12 | * See the file COPYING included with this distribution for more details. | ||
13 | * | ||
14 | * Redistribution and use in source and binary forms, with or without | ||
15 | * modification, are permitted provided that the following conditions | ||
16 | * are met: | ||
17 | * | ||
18 | * 1. Redistributions of source code must retain the above copyright | ||
19 | * notice, this list of conditions and the following disclaimer. | ||
20 | * 2. Redistributions in binary form must reproduce the above copyright | ||
21 | * notice, this list of conditions and the following disclaimer in the | ||
22 | * documentation and/or other materials provided with the distribution. | ||
23 | * 3. Neither the name of the Panasas company nor the names of its | ||
24 | * contributors may be used to endorse or promote products derived | ||
25 | * from this software without specific prior written permission. | ||
26 | * | ||
27 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
28 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
29 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
30 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
31 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
34 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
35 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
36 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
37 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
38 | */ | ||
39 | #ifndef __PNFS_OSD_XDR_H__ | ||
40 | #define __PNFS_OSD_XDR_H__ | ||
41 | |||
42 | #include <linux/nfs_fs.h> | ||
43 | #include <linux/nfs_page.h> | ||
44 | #include <scsi/osd_protocol.h> | ||
45 | |||
46 | #define PNFS_OSD_OSDNAME_MAXSIZE 256 | ||
47 | |||
48 | /* | ||
49 | * draft-ietf-nfsv4-minorversion-22 | ||
50 | * draft-ietf-nfsv4-pnfs-obj-12 | ||
51 | */ | ||
52 | |||
53 | /* Layout Structure */ | ||
54 | |||
55 | enum pnfs_osd_raid_algorithm4 { | ||
56 | PNFS_OSD_RAID_0 = 1, | ||
57 | PNFS_OSD_RAID_4 = 2, | ||
58 | PNFS_OSD_RAID_5 = 3, | ||
59 | PNFS_OSD_RAID_PQ = 4 /* Reed-Solomon P+Q */ | ||
60 | }; | ||
61 | |||
62 | /* struct pnfs_osd_data_map4 { | ||
63 | * uint32_t odm_num_comps; | ||
64 | * length4 odm_stripe_unit; | ||
65 | * uint32_t odm_group_width; | ||
66 | * uint32_t odm_group_depth; | ||
67 | * uint32_t odm_mirror_cnt; | ||
68 | * pnfs_osd_raid_algorithm4 odm_raid_algorithm; | ||
69 | * }; | ||
70 | */ | ||
71 | struct pnfs_osd_data_map { | ||
72 | u32 odm_num_comps; | ||
73 | u64 odm_stripe_unit; | ||
74 | u32 odm_group_width; | ||
75 | u32 odm_group_depth; | ||
76 | u32 odm_mirror_cnt; | ||
77 | u32 odm_raid_algorithm; | ||
78 | }; | ||
79 | |||
80 | /* struct pnfs_osd_objid4 { | ||
81 | * deviceid4 oid_device_id; | ||
82 | * uint64_t oid_partition_id; | ||
83 | * uint64_t oid_object_id; | ||
84 | * }; | ||
85 | */ | ||
86 | struct pnfs_osd_objid { | ||
87 | struct nfs4_deviceid oid_device_id; | ||
88 | u64 oid_partition_id; | ||
89 | u64 oid_object_id; | ||
90 | }; | ||
91 | |||
92 | /* For printout. I use: | ||
93 | * kprint("dev(%llx:%llx)", _DEVID_LO(pointer), _DEVID_HI(pointer)); | ||
94 | * BE style | ||
95 | */ | ||
96 | #define _DEVID_LO(oid_device_id) \ | ||
97 | (unsigned long long)be64_to_cpup((__be64 *)(oid_device_id)->data) | ||
98 | |||
99 | #define _DEVID_HI(oid_device_id) \ | ||
100 | (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) | ||
101 | |||
102 | static inline int | ||
103 | pnfs_osd_objid_xdr_sz(void) | ||
104 | { | ||
105 | return (NFS4_DEVICEID4_SIZE / 4) + 2 + 2; | ||
106 | } | ||
107 | |||
108 | enum pnfs_osd_version { | ||
109 | PNFS_OSD_MISSING = 0, | ||
110 | PNFS_OSD_VERSION_1 = 1, | ||
111 | PNFS_OSD_VERSION_2 = 2 | ||
112 | }; | ||
113 | |||
114 | struct pnfs_osd_opaque_cred { | ||
115 | u32 cred_len; | ||
116 | void *cred; | ||
117 | }; | ||
118 | |||
119 | enum pnfs_osd_cap_key_sec { | ||
120 | PNFS_OSD_CAP_KEY_SEC_NONE = 0, | ||
121 | PNFS_OSD_CAP_KEY_SEC_SSV = 1, | ||
122 | }; | ||
123 | |||
124 | /* struct pnfs_osd_object_cred4 { | ||
125 | * pnfs_osd_objid4 oc_object_id; | ||
126 | * pnfs_osd_version4 oc_osd_version; | ||
127 | * pnfs_osd_cap_key_sec4 oc_cap_key_sec; | ||
128 | * opaque oc_capability_key<>; | ||
129 | * opaque oc_capability<>; | ||
130 | * }; | ||
131 | */ | ||
132 | struct pnfs_osd_object_cred { | ||
133 | struct pnfs_osd_objid oc_object_id; | ||
134 | u32 oc_osd_version; | ||
135 | u32 oc_cap_key_sec; | ||
136 | struct pnfs_osd_opaque_cred oc_cap_key; | ||
137 | struct pnfs_osd_opaque_cred oc_cap; | ||
138 | }; | ||
139 | |||
140 | /* struct pnfs_osd_layout4 { | ||
141 | * pnfs_osd_data_map4 olo_map; | ||
142 | * uint32_t olo_comps_index; | ||
143 | * pnfs_osd_object_cred4 olo_components<>; | ||
144 | * }; | ||
145 | */ | ||
146 | struct pnfs_osd_layout { | ||
147 | struct pnfs_osd_data_map olo_map; | ||
148 | u32 olo_comps_index; | ||
149 | u32 olo_num_comps; | ||
150 | struct pnfs_osd_object_cred *olo_comps; | ||
151 | }; | ||
152 | |||
153 | /* Device Address */ | ||
154 | enum pnfs_osd_targetid_type { | ||
155 | OBJ_TARGET_ANON = 1, | ||
156 | OBJ_TARGET_SCSI_NAME = 2, | ||
157 | OBJ_TARGET_SCSI_DEVICE_ID = 3, | ||
158 | }; | ||
159 | |||
160 | /* union pnfs_osd_targetid4 switch (pnfs_osd_targetid_type4 oti_type) { | ||
161 | * case OBJ_TARGET_SCSI_NAME: | ||
162 | * string oti_scsi_name<>; | ||
163 | * | ||
164 | * case OBJ_TARGET_SCSI_DEVICE_ID: | ||
165 | * opaque oti_scsi_device_id<>; | ||
166 | * | ||
167 | * default: | ||
168 | * void; | ||
169 | * }; | ||
170 | * | ||
171 | * union pnfs_osd_targetaddr4 switch (bool ota_available) { | ||
172 | * case TRUE: | ||
173 | * netaddr4 ota_netaddr; | ||
174 | * case FALSE: | ||
175 | * void; | ||
176 | * }; | ||
177 | * | ||
178 | * struct pnfs_osd_deviceaddr4 { | ||
179 | * pnfs_osd_targetid4 oda_targetid; | ||
180 | * pnfs_osd_targetaddr4 oda_targetaddr; | ||
181 | * uint64_t oda_lun; | ||
182 | * opaque oda_systemid<>; | ||
183 | * pnfs_osd_object_cred4 oda_root_obj_cred; | ||
184 | * opaque oda_osdname<>; | ||
185 | * }; | ||
186 | */ | ||
187 | struct pnfs_osd_targetid { | ||
188 | u32 oti_type; | ||
189 | struct nfs4_string oti_scsi_device_id; | ||
190 | }; | ||
191 | |||
192 | enum { PNFS_OSD_TARGETID_MAX = 1 + PNFS_OSD_OSDNAME_MAXSIZE / 4 }; | ||
193 | |||
194 | /* struct netaddr4 { | ||
195 | * // see struct rpcb in RFC1833 | ||
196 | * string r_netid<>; // network id | ||
197 | * string r_addr<>; // universal address | ||
198 | * }; | ||
199 | */ | ||
200 | struct pnfs_osd_net_addr { | ||
201 | struct nfs4_string r_netid; | ||
202 | struct nfs4_string r_addr; | ||
203 | }; | ||
204 | |||
205 | struct pnfs_osd_targetaddr { | ||
206 | u32 ota_available; | ||
207 | struct pnfs_osd_net_addr ota_netaddr; | ||
208 | }; | ||
209 | |||
210 | enum { | ||
211 | NETWORK_ID_MAX = 16 / 4, | ||
212 | UNIVERSAL_ADDRESS_MAX = 64 / 4, | ||
213 | PNFS_OSD_TARGETADDR_MAX = 3 + NETWORK_ID_MAX + UNIVERSAL_ADDRESS_MAX, | ||
214 | }; | ||
215 | |||
216 | struct pnfs_osd_deviceaddr { | ||
217 | struct pnfs_osd_targetid oda_targetid; | ||
218 | struct pnfs_osd_targetaddr oda_targetaddr; | ||
219 | u8 oda_lun[8]; | ||
220 | struct nfs4_string oda_systemid; | ||
221 | struct pnfs_osd_object_cred oda_root_obj_cred; | ||
222 | struct nfs4_string oda_osdname; | ||
223 | }; | ||
224 | |||
225 | enum { | ||
226 | ODA_OSDNAME_MAX = PNFS_OSD_OSDNAME_MAXSIZE / 4, | ||
227 | PNFS_OSD_DEVICEADDR_MAX = | ||
228 | PNFS_OSD_TARGETID_MAX + PNFS_OSD_TARGETADDR_MAX + | ||
229 | 2 /*oda_lun*/ + | ||
230 | 1 + OSD_SYSTEMID_LEN + | ||
231 | 1 + ODA_OSDNAME_MAX, | ||
232 | }; | ||
233 | |||
234 | /* LAYOUTCOMMIT: layoutupdate */ | ||
235 | |||
236 | /* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { | ||
237 | * case TRUE: | ||
238 | * int64_t dsu_delta; | ||
239 | * case FALSE: | ||
240 | * void; | ||
241 | * }; | ||
242 | * | ||
243 | * struct pnfs_osd_layoutupdate4 { | ||
244 | * pnfs_osd_deltaspaceused4 olu_delta_space_used; | ||
245 | * bool olu_ioerr_flag; | ||
246 | * }; | ||
247 | */ | ||
248 | struct pnfs_osd_layoutupdate { | ||
249 | u32 dsu_valid; | ||
250 | s64 dsu_delta; | ||
251 | u32 olu_ioerr_flag; | ||
252 | }; | ||
253 | |||
254 | /* LAYOUTRETURN: I/O Rrror Report */ | ||
255 | |||
256 | enum pnfs_osd_errno { | ||
257 | PNFS_OSD_ERR_EIO = 1, | ||
258 | PNFS_OSD_ERR_NOT_FOUND = 2, | ||
259 | PNFS_OSD_ERR_NO_SPACE = 3, | ||
260 | PNFS_OSD_ERR_BAD_CRED = 4, | ||
261 | PNFS_OSD_ERR_NO_ACCESS = 5, | ||
262 | PNFS_OSD_ERR_UNREACHABLE = 6, | ||
263 | PNFS_OSD_ERR_RESOURCE = 7 | ||
264 | }; | ||
265 | |||
266 | /* struct pnfs_osd_ioerr4 { | ||
267 | * pnfs_osd_objid4 oer_component; | ||
268 | * length4 oer_comp_offset; | ||
269 | * length4 oer_comp_length; | ||
270 | * bool oer_iswrite; | ||
271 | * pnfs_osd_errno4 oer_errno; | ||
272 | * }; | ||
273 | */ | ||
274 | struct pnfs_osd_ioerr { | ||
275 | struct pnfs_osd_objid oer_component; | ||
276 | u64 oer_comp_offset; | ||
277 | u64 oer_comp_length; | ||
278 | u32 oer_iswrite; | ||
279 | u32 oer_errno; | ||
280 | }; | ||
281 | |||
282 | /* OSD XDR API */ | ||
283 | /* Layout helpers */ | ||
284 | /* Layout decoding is done in two parts: | ||
285 | * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part | ||
286 | * of the layout. @iter members need not be initialized. | ||
287 | * Returned: | ||
288 | * @layout members are set. (@layout->olo_comps set to NULL). | ||
289 | * | ||
290 | * Zero on success, or negative error if passed xdr is broken. | ||
291 | * | ||
292 | * 2. 2nd Call pnfs_osd_xdr_decode_layout_comp() in a loop until it returns | ||
293 | * false, to decode the next component. | ||
294 | * Returned: | ||
295 | * true if there is more to decode or false if we are done or error. | ||
296 | * | ||
297 | * Example: | ||
298 | * struct pnfs_osd_xdr_decode_layout_iter iter; | ||
299 | * struct pnfs_osd_layout layout; | ||
300 | * struct pnfs_osd_object_cred comp; | ||
301 | * int status; | ||
302 | * | ||
303 | * status = pnfs_osd_xdr_decode_layout_map(&layout, &iter, xdr); | ||
304 | * if (unlikely(status)) | ||
305 | * goto err; | ||
306 | * while(pnfs_osd_xdr_decode_layout_comp(&comp, &iter, xdr, &status)) { | ||
307 | * // All of @comp strings point to inside the xdr_buffer | ||
308 | * // or scrach buffer. Copy them out to user memory eg. | ||
309 | * copy_single_comp(dest_comp++, &comp); | ||
310 | * } | ||
311 | * if (unlikely(status)) | ||
312 | * goto err; | ||
313 | */ | ||
314 | |||
315 | struct pnfs_osd_xdr_decode_layout_iter { | ||
316 | unsigned total_comps; | ||
317 | unsigned decoded_comps; | ||
318 | }; | ||
319 | |||
320 | extern int pnfs_osd_xdr_decode_layout_map(struct pnfs_osd_layout *layout, | ||
321 | struct pnfs_osd_xdr_decode_layout_iter *iter, struct xdr_stream *xdr); | ||
322 | |||
323 | extern bool pnfs_osd_xdr_decode_layout_comp(struct pnfs_osd_object_cred *comp, | ||
324 | struct pnfs_osd_xdr_decode_layout_iter *iter, struct xdr_stream *xdr, | ||
325 | int *err); | ||
326 | |||
327 | /* Device Info helpers */ | ||
328 | |||
329 | /* Note: All strings inside @deviceaddr point to space inside @p. | ||
330 | * @p should stay valid while @deviceaddr is in use. | ||
331 | */ | ||
332 | extern void pnfs_osd_xdr_decode_deviceaddr( | ||
333 | struct pnfs_osd_deviceaddr *deviceaddr, __be32 *p); | ||
334 | |||
335 | /* layoutupdate (layout_commit) xdr helpers */ | ||
336 | extern int | ||
337 | pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, | ||
338 | struct pnfs_osd_layoutupdate *lou); | ||
339 | |||
340 | /* osd_ioerror encoding/decoding (layout_return) */ | ||
341 | /* Client */ | ||
342 | extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); | ||
343 | extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); | ||
344 | |||
345 | #endif /* __PNFS_OSD_XDR_H__ */ | ||
diff --git a/include/linux/posix-clock.h b/include/linux/posix-clock.h index 7f1183dcd119..34c4498b800f 100644 --- a/include/linux/posix-clock.h +++ b/include/linux/posix-clock.h | |||
@@ -45,7 +45,7 @@ struct posix_clock; | |||
45 | * @timer_create: Create a new timer | 45 | * @timer_create: Create a new timer |
46 | * @timer_delete: Remove a previously created timer | 46 | * @timer_delete: Remove a previously created timer |
47 | * @timer_gettime: Get remaining time and interval of a timer | 47 | * @timer_gettime: Get remaining time and interval of a timer |
48 | * @timer_setttime: Set a timer's initial expiration and interval | 48 | * @timer_settime: Set a timer's initial expiration and interval |
49 | * @fasync: Optional character device fasync method | 49 | * @fasync: Optional character device fasync method |
50 | * @mmap: Optional character device mmap method | 50 | * @mmap: Optional character device mmap method |
51 | * @open: Optional character device open method | 51 | * @open: Optional character device open method |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index d51243ae0726..959c14132f46 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/timex.h> | 7 | #include <linux/timex.h> |
8 | #include <linux/alarmtimer.h> | ||
8 | 9 | ||
9 | union cpu_time_count { | 10 | union cpu_time_count { |
10 | cputime_t cpu; | 11 | cputime_t cpu; |
@@ -80,6 +81,8 @@ struct k_itimer { | |||
80 | unsigned long incr; | 81 | unsigned long incr; |
81 | unsigned long expires; | 82 | unsigned long expires; |
82 | } mmtimer; | 83 | } mmtimer; |
84 | struct alarm alarmtimer; | ||
85 | struct rcu_head rcu; | ||
83 | } it; | 86 | } it; |
84 | }; | 87 | }; |
85 | 88 | ||
diff --git a/include/linux/power/isp1704_charger.h b/include/linux/power/isp1704_charger.h new file mode 100644 index 000000000000..68096a6aa2d7 --- /dev/null +++ b/include/linux/power/isp1704_charger.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * ISP1704 USB Charger Detection driver | ||
3 | * | ||
4 | * Copyright (C) 2011 Nokia Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | |||
22 | #ifndef __ISP1704_CHARGER_H | ||
23 | #define __ISP1704_CHARGER_H | ||
24 | |||
25 | struct isp1704_charger_data { | ||
26 | void (*set_power)(bool on); | ||
27 | }; | ||
28 | |||
29 | #endif | ||
diff --git a/include/linux/power/max8903_charger.h b/include/linux/power/max8903_charger.h new file mode 100644 index 000000000000..24f51db8a83f --- /dev/null +++ b/include/linux/power/max8903_charger.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * max8903_charger.h - Maxim 8903 USB/Adapter Charger Driver | ||
3 | * | ||
4 | * Copyright (C) 2011 Samsung Electronics | ||
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef __MAX8903_CHARGER_H__ | ||
24 | #define __MAX8903_CHARGER_H__ | ||
25 | |||
26 | struct max8903_pdata { | ||
27 | /* | ||
28 | * GPIOs | ||
29 | * cen, chg, flt, and usus are optional. | ||
30 | * dok, dcm, and uok are not optional depending on the status of | ||
31 | * dc_valid and usb_valid. | ||
32 | */ | ||
33 | int cen; /* Charger Enable input */ | ||
34 | int dok; /* DC(Adapter) Power OK output */ | ||
35 | int uok; /* USB Power OK output */ | ||
36 | int chg; /* Charger status output */ | ||
37 | int flt; /* Fault output */ | ||
38 | int dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ | ||
39 | int usus; /* USB Suspend Input (1: suspended) */ | ||
40 | |||
41 | /* | ||
42 | * DC(Adapter/TA) is wired | ||
43 | * When dc_valid is true, | ||
44 | * dok and dcm should be valid. | ||
45 | * | ||
46 | * At least one of dc_valid or usb_valid should be true. | ||
47 | */ | ||
48 | bool dc_valid; | ||
49 | /* | ||
50 | * USB is wired | ||
51 | * When usb_valid is true, | ||
52 | * uok should be valid. | ||
53 | */ | ||
54 | bool usb_valid; | ||
55 | }; | ||
56 | |||
57 | #endif /* __MAX8903_CHARGER_H__ */ | ||
diff --git a/include/linux/printk.h b/include/linux/printk.h index ee048e77e1ae..0101d55d9651 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __KERNEL_PRINTK__ | 1 | #ifndef __KERNEL_PRINTK__ |
2 | #define __KERNEL_PRINTK__ | 2 | #define __KERNEL_PRINTK__ |
3 | 3 | ||
4 | #include <linux/init.h> | ||
5 | |||
4 | extern const char linux_banner[]; | 6 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 7 | extern const char linux_proc_banner[]; |
6 | 8 | ||
@@ -113,6 +115,7 @@ extern int dmesg_restrict; | |||
113 | extern int kptr_restrict; | 115 | extern int kptr_restrict; |
114 | 116 | ||
115 | void log_buf_kexec_setup(void); | 117 | void log_buf_kexec_setup(void); |
118 | void __init setup_log_buf(int early); | ||
116 | #else | 119 | #else |
117 | static inline __attribute__ ((format (printf, 1, 0))) | 120 | static inline __attribute__ ((format (printf, 1, 0))) |
118 | int vprintk(const char *s, va_list args) | 121 | int vprintk(const char *s, va_list args) |
@@ -137,6 +140,10 @@ static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
137 | static inline void log_buf_kexec_setup(void) | 140 | static inline void log_buf_kexec_setup(void) |
138 | { | 141 | { |
139 | } | 142 | } |
143 | |||
144 | static inline void setup_log_buf(int early) | ||
145 | { | ||
146 | } | ||
140 | #endif | 147 | #endif |
141 | 148 | ||
142 | extern void dump_stack(void) __cold; | 149 | extern void dump_stack(void) __cold; |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index eaf4350c0f90..e7576cf9e32d 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -173,11 +173,7 @@ extern void proc_net_remove(struct net *net, const char *name); | |||
173 | extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, | 173 | extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, |
174 | struct proc_dir_entry *parent); | 174 | struct proc_dir_entry *parent); |
175 | 175 | ||
176 | /* While the {get|set|dup}_mm_exe_file functions are for mm_structs, they are | 176 | extern struct file *proc_ns_fget(int fd); |
177 | * only needed to implement /proc/<pid>|self/exe so we define them here. */ | ||
178 | extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file); | ||
179 | extern struct file *get_mm_exe_file(struct mm_struct *mm); | ||
180 | extern void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm); | ||
181 | 177 | ||
182 | #else | 178 | #else |
183 | 179 | ||
@@ -228,19 +224,11 @@ static inline void pid_ns_release_proc(struct pid_namespace *ns) | |||
228 | { | 224 | { |
229 | } | 225 | } |
230 | 226 | ||
231 | static inline void set_mm_exe_file(struct mm_struct *mm, | 227 | static inline struct file *proc_ns_fget(int fd) |
232 | struct file *new_exe_file) | ||
233 | {} | ||
234 | |||
235 | static inline struct file *get_mm_exe_file(struct mm_struct *mm) | ||
236 | { | 228 | { |
237 | return NULL; | 229 | return ERR_PTR(-EINVAL); |
238 | } | 230 | } |
239 | 231 | ||
240 | static inline void dup_mm_exe_file(struct mm_struct *oldmm, | ||
241 | struct mm_struct *newmm) | ||
242 | {} | ||
243 | |||
244 | #endif /* CONFIG_PROC_FS */ | 232 | #endif /* CONFIG_PROC_FS */ |
245 | 233 | ||
246 | #if !defined(CONFIG_PROC_KCORE) | 234 | #if !defined(CONFIG_PROC_KCORE) |
@@ -252,6 +240,18 @@ kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | |||
252 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); | 240 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); |
253 | #endif | 241 | #endif |
254 | 242 | ||
243 | struct nsproxy; | ||
244 | struct proc_ns_operations { | ||
245 | const char *name; | ||
246 | int type; | ||
247 | void *(*get)(struct task_struct *task); | ||
248 | void (*put)(void *ns); | ||
249 | int (*install)(struct nsproxy *nsproxy, void *ns); | ||
250 | }; | ||
251 | extern const struct proc_ns_operations netns_operations; | ||
252 | extern const struct proc_ns_operations utsns_operations; | ||
253 | extern const struct proc_ns_operations ipcns_operations; | ||
254 | |||
255 | union proc_op { | 255 | union proc_op { |
256 | int (*proc_get_link)(struct inode *, struct path *); | 256 | int (*proc_get_link)(struct inode *, struct path *); |
257 | int (*proc_read)(struct task_struct *task, char *page); | 257 | int (*proc_read)(struct task_struct *task, char *page); |
@@ -270,6 +270,8 @@ struct proc_inode { | |||
270 | struct proc_dir_entry *pde; | 270 | struct proc_dir_entry *pde; |
271 | struct ctl_table_header *sysctl; | 271 | struct ctl_table_header *sysctl; |
272 | struct ctl_table *sysctl_entry; | 272 | struct ctl_table *sysctl_entry; |
273 | void *ns; | ||
274 | const struct proc_ns_operations *ns_ops; | ||
273 | struct inode vfs_inode; | 275 | struct inode vfs_inode; |
274 | }; | 276 | }; |
275 | 277 | ||
@@ -288,12 +290,4 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde) | |||
288 | return pde->parent->data; | 290 | return pde->parent->data; |
289 | } | 291 | } |
290 | 292 | ||
291 | struct proc_maps_private { | ||
292 | struct pid *pid; | ||
293 | struct task_struct *task; | ||
294 | #ifdef CONFIG_MMU | ||
295 | struct vm_area_struct *tail_vma; | ||
296 | #endif | ||
297 | }; | ||
298 | |||
299 | #endif /* _LINUX_PROC_FS_H */ | 293 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 41977737bb7d..2455ef2683f0 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -35,7 +35,9 @@ struct pstore_info { | |||
35 | struct mutex buf_mutex; /* serialize access to 'buf' */ | 35 | struct mutex buf_mutex; /* serialize access to 'buf' */ |
36 | char *buf; | 36 | char *buf; |
37 | size_t bufsize; | 37 | size_t bufsize; |
38 | size_t (*read)(u64 *id, enum pstore_type_id *type, | 38 | int (*open)(struct pstore_info *psi); |
39 | int (*close)(struct pstore_info *psi); | ||
40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | ||
39 | struct timespec *time); | 41 | struct timespec *time); |
40 | u64 (*write)(enum pstore_type_id type, size_t size); | 42 | u64 (*write)(enum pstore_type_id type, size_t size); |
41 | int (*erase)(u64 id); | 43 | int (*erase)(u64 id); |
diff --git a/include/linux/pti.h b/include/linux/pti.h new file mode 100644 index 000000000000..81af667bb2d5 --- /dev/null +++ b/include/linux/pti.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (C) Intel 2011 | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
14 | * | ||
15 | * The PTI (Parallel Trace Interface) driver directs trace data routed from | ||
16 | * various parts in the system out through the Intel Penwell PTI port and | ||
17 | * out of the mobile device for analysis with a debugging tool | ||
18 | * (Lauterbach, Fido). This is part of a solution for the MIPI P1149.7, | ||
19 | * compact JTAG, standard. | ||
20 | * | ||
21 | * This header file will allow other parts of the OS to use the | ||
22 | * interface to write out it's contents for debugging a mobile system. | ||
23 | */ | ||
24 | |||
25 | #ifndef PTI_H_ | ||
26 | #define PTI_H_ | ||
27 | |||
28 | /* offset for last dword of any PTI message. Part of MIPI P1149.7 */ | ||
29 | #define PTI_LASTDWORD_DTS 0x30 | ||
30 | |||
31 | /* basic structure used as a write address to the PTI HW */ | ||
32 | struct pti_masterchannel { | ||
33 | u8 master; | ||
34 | u8 channel; | ||
35 | }; | ||
36 | |||
37 | /* the following functions are defined in misc/pti.c */ | ||
38 | void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count); | ||
39 | struct pti_masterchannel *pti_request_masterchannel(u8 type); | ||
40 | void pti_release_masterchannel(struct pti_masterchannel *mc); | ||
41 | |||
42 | #endif /*PTI_H_*/ | ||
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h index 943a85ab0020..e07e2742a865 100644 --- a/include/linux/ptp_classify.h +++ b/include/linux/ptp_classify.h | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <linux/if_ether.h> | 26 | #include <linux/if_ether.h> |
27 | #include <linux/if_vlan.h> | 27 | #include <linux/if_vlan.h> |
28 | #include <linux/ip.h> | ||
28 | #include <linux/filter.h> | 29 | #include <linux/filter.h> |
29 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
30 | #include <linux/in.h> | 31 | #include <linux/in.h> |
@@ -58,6 +59,12 @@ | |||
58 | #define OFF_NEXT 6 | 59 | #define OFF_NEXT 6 |
59 | #define OFF_UDP_DST 2 | 60 | #define OFF_UDP_DST 2 |
60 | 61 | ||
62 | #define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */ | ||
63 | #define OFF_PTP_SEQUENCE_ID 30 | ||
64 | #define OFF_PTP_CONTROL 32 /* PTPv1 only */ | ||
65 | |||
66 | #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) | ||
67 | |||
61 | #define IP6_HLEN 40 | 68 | #define IP6_HLEN 40 |
62 | #define UDP_HLEN 8 | 69 | #define UDP_HLEN 8 |
63 | 70 | ||
diff --git a/include/linux/ptp_clock.h b/include/linux/ptp_clock.h new file mode 100644 index 000000000000..94e981f810a2 --- /dev/null +++ b/include/linux/ptp_clock.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * PTP 1588 clock support - user space interface | ||
3 | * | ||
4 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _PTP_CLOCK_H_ | ||
22 | #define _PTP_CLOCK_H_ | ||
23 | |||
24 | #include <linux/ioctl.h> | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | /* PTP_xxx bits, for the flags field within the request structures. */ | ||
28 | #define PTP_ENABLE_FEATURE (1<<0) | ||
29 | #define PTP_RISING_EDGE (1<<1) | ||
30 | #define PTP_FALLING_EDGE (1<<2) | ||
31 | |||
32 | /* | ||
33 | * struct ptp_clock_time - represents a time value | ||
34 | * | ||
35 | * The sign of the seconds field applies to the whole value. The | ||
36 | * nanoseconds field is always unsigned. The reserved field is | ||
37 | * included for sub-nanosecond resolution, should the demand for | ||
38 | * this ever appear. | ||
39 | * | ||
40 | */ | ||
41 | struct ptp_clock_time { | ||
42 | __s64 sec; /* seconds */ | ||
43 | __u32 nsec; /* nanoseconds */ | ||
44 | __u32 reserved; | ||
45 | }; | ||
46 | |||
47 | struct ptp_clock_caps { | ||
48 | int max_adj; /* Maximum frequency adjustment in parts per billon. */ | ||
49 | int n_alarm; /* Number of programmable alarms. */ | ||
50 | int n_ext_ts; /* Number of external time stamp channels. */ | ||
51 | int n_per_out; /* Number of programmable periodic signals. */ | ||
52 | int pps; /* Whether the clock supports a PPS callback. */ | ||
53 | int rsv[15]; /* Reserved for future use. */ | ||
54 | }; | ||
55 | |||
56 | struct ptp_extts_request { | ||
57 | unsigned int index; /* Which channel to configure. */ | ||
58 | unsigned int flags; /* Bit field for PTP_xxx flags. */ | ||
59 | unsigned int rsv[2]; /* Reserved for future use. */ | ||
60 | }; | ||
61 | |||
62 | struct ptp_perout_request { | ||
63 | struct ptp_clock_time start; /* Absolute start time. */ | ||
64 | struct ptp_clock_time period; /* Desired period, zero means disable. */ | ||
65 | unsigned int index; /* Which channel to configure. */ | ||
66 | unsigned int flags; /* Reserved for future use. */ | ||
67 | unsigned int rsv[4]; /* Reserved for future use. */ | ||
68 | }; | ||
69 | |||
70 | #define PTP_CLK_MAGIC '=' | ||
71 | |||
72 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) | ||
73 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) | ||
74 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) | ||
75 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) | ||
76 | |||
77 | struct ptp_extts_event { | ||
78 | struct ptp_clock_time t; /* Time event occured. */ | ||
79 | unsigned int index; /* Which channel produced the event. */ | ||
80 | unsigned int flags; /* Reserved for future use. */ | ||
81 | unsigned int rsv[2]; /* Reserved for future use. */ | ||
82 | }; | ||
83 | |||
84 | #endif | ||
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h new file mode 100644 index 000000000000..dd2e44fba63e --- /dev/null +++ b/include/linux/ptp_clock_kernel.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * PTP 1588 clock support | ||
3 | * | ||
4 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _PTP_CLOCK_KERNEL_H_ | ||
22 | #define _PTP_CLOCK_KERNEL_H_ | ||
23 | |||
24 | #include <linux/ptp_clock.h> | ||
25 | |||
26 | |||
27 | struct ptp_clock_request { | ||
28 | enum { | ||
29 | PTP_CLK_REQ_EXTTS, | ||
30 | PTP_CLK_REQ_PEROUT, | ||
31 | PTP_CLK_REQ_PPS, | ||
32 | } type; | ||
33 | union { | ||
34 | struct ptp_extts_request extts; | ||
35 | struct ptp_perout_request perout; | ||
36 | }; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * struct ptp_clock_info - decribes a PTP hardware clock | ||
41 | * | ||
42 | * @owner: The clock driver should set to THIS_MODULE. | ||
43 | * @name: A short name to identify the clock. | ||
44 | * @max_adj: The maximum possible frequency adjustment, in parts per billon. | ||
45 | * @n_alarm: The number of programmable alarms. | ||
46 | * @n_ext_ts: The number of external time stamp channels. | ||
47 | * @n_per_out: The number of programmable periodic signals. | ||
48 | * @pps: Indicates whether the clock supports a PPS callback. | ||
49 | * | ||
50 | * clock operations | ||
51 | * | ||
52 | * @adjfreq: Adjusts the frequency of the hardware clock. | ||
53 | * parameter delta: Desired period change in parts per billion. | ||
54 | * | ||
55 | * @adjtime: Shifts the time of the hardware clock. | ||
56 | * parameter delta: Desired change in nanoseconds. | ||
57 | * | ||
58 | * @gettime: Reads the current time from the hardware clock. | ||
59 | * parameter ts: Holds the result. | ||
60 | * | ||
61 | * @settime: Set the current time on the hardware clock. | ||
62 | * parameter ts: Time value to set. | ||
63 | * | ||
64 | * @enable: Request driver to enable or disable an ancillary feature. | ||
65 | * parameter request: Desired resource to enable or disable. | ||
66 | * parameter on: Caller passes one to enable or zero to disable. | ||
67 | * | ||
68 | * Drivers should embed their ptp_clock_info within a private | ||
69 | * structure, obtaining a reference to it using container_of(). | ||
70 | * | ||
71 | * The callbacks must all return zero on success, non-zero otherwise. | ||
72 | */ | ||
73 | |||
74 | struct ptp_clock_info { | ||
75 | struct module *owner; | ||
76 | char name[16]; | ||
77 | s32 max_adj; | ||
78 | int n_alarm; | ||
79 | int n_ext_ts; | ||
80 | int n_per_out; | ||
81 | int pps; | ||
82 | int (*adjfreq)(struct ptp_clock_info *ptp, s32 delta); | ||
83 | int (*adjtime)(struct ptp_clock_info *ptp, s64 delta); | ||
84 | int (*gettime)(struct ptp_clock_info *ptp, struct timespec *ts); | ||
85 | int (*settime)(struct ptp_clock_info *ptp, const struct timespec *ts); | ||
86 | int (*enable)(struct ptp_clock_info *ptp, | ||
87 | struct ptp_clock_request *request, int on); | ||
88 | }; | ||
89 | |||
90 | struct ptp_clock; | ||
91 | |||
92 | /** | ||
93 | * ptp_clock_register() - register a PTP hardware clock driver | ||
94 | * | ||
95 | * @info: Structure describing the new clock. | ||
96 | */ | ||
97 | |||
98 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info); | ||
99 | |||
100 | /** | ||
101 | * ptp_clock_unregister() - unregister a PTP hardware clock driver | ||
102 | * | ||
103 | * @ptp: The clock to remove from service. | ||
104 | */ | ||
105 | |||
106 | extern int ptp_clock_unregister(struct ptp_clock *ptp); | ||
107 | |||
108 | |||
109 | enum ptp_clock_events { | ||
110 | PTP_CLOCK_ALARM, | ||
111 | PTP_CLOCK_EXTTS, | ||
112 | PTP_CLOCK_PPS, | ||
113 | }; | ||
114 | |||
115 | /** | ||
116 | * struct ptp_clock_event - decribes a PTP hardware clock event | ||
117 | * | ||
118 | * @type: One of the ptp_clock_events enumeration values. | ||
119 | * @index: Identifies the source of the event. | ||
120 | * @timestamp: When the event occured. | ||
121 | */ | ||
122 | |||
123 | struct ptp_clock_event { | ||
124 | int type; | ||
125 | int index; | ||
126 | u64 timestamp; | ||
127 | }; | ||
128 | |||
129 | /** | ||
130 | * ptp_clock_event() - notify the PTP layer about an event | ||
131 | * | ||
132 | * @ptp: The clock obtained from ptp_clock_register(). | ||
133 | * @event: Message structure describing the event. | ||
134 | */ | ||
135 | |||
136 | extern void ptp_clock_event(struct ptp_clock *ptp, | ||
137 | struct ptp_clock_event *event); | ||
138 | |||
139 | #endif | ||
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 03ff67b0cdf5..2f007157fab9 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -41,4 +41,44 @@ extern struct ratelimit_state printk_ratelimit_state; | |||
41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | 41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); |
42 | #define __ratelimit(state) ___ratelimit(state, __func__) | 42 | #define __ratelimit(state) ___ratelimit(state, __func__) |
43 | 43 | ||
44 | #ifdef CONFIG_PRINTK | ||
45 | |||
46 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
47 | WARN_ON((condition) && __ratelimit(state)) | ||
48 | |||
49 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
50 | ({ \ | ||
51 | int rtn = 0; \ | ||
52 | if (unlikely(__ratelimit(state))) \ | ||
53 | rtn = WARN(condition, format); \ | ||
54 | rtn; \ | ||
55 | }) | ||
56 | |||
57 | #define WARN_RATELIMIT(condition, format...) \ | ||
58 | ({ \ | ||
59 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
60 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
61 | DEFAULT_RATELIMIT_BURST); \ | ||
62 | __WARN_RATELIMIT(condition, &_rs, format); \ | ||
63 | }) | ||
64 | |||
65 | #else | ||
66 | |||
67 | #define WARN_ON_RATELIMIT(condition, state) \ | ||
68 | WARN_ON(condition) | ||
69 | |||
70 | #define __WARN_RATELIMIT(condition, state, format...) \ | ||
71 | ({ \ | ||
72 | int rtn = WARN(condition, format); \ | ||
73 | rtn; \ | ||
74 | }) | ||
75 | |||
76 | #define WARN_RATELIMIT(condition, format...) \ | ||
77 | ({ \ | ||
78 | int rtn = WARN(condition, format); \ | ||
79 | rtn; \ | ||
80 | }) | ||
81 | |||
82 | #endif | ||
83 | |||
44 | #endif /* _LINUX_RATELIMIT_H */ | 84 | #endif /* _LINUX_RATELIMIT_H */ |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 7066acb2c530..033b507b33b1 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -136,6 +136,14 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
136 | #define RB_EMPTY_NODE(node) (rb_parent(node) == node) | 136 | #define RB_EMPTY_NODE(node) (rb_parent(node) == node) |
137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | 137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) |
138 | 138 | ||
139 | static inline void rb_init_node(struct rb_node *rb) | ||
140 | { | ||
141 | rb->rb_parent_color = 0; | ||
142 | rb->rb_right = NULL; | ||
143 | rb->rb_left = NULL; | ||
144 | RB_CLEAR_NODE(rb); | ||
145 | } | ||
146 | |||
139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 147 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
140 | extern void rb_erase(struct rb_node *, struct rb_root *); | 148 | extern void rb_erase(struct rb_node *, struct rb_root *); |
141 | 149 | ||
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 2dea94fc4402..e3beb315517a 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -253,7 +253,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
253 | */ | 253 | */ |
254 | #define list_for_each_entry_rcu(pos, head, member) \ | 254 | #define list_for_each_entry_rcu(pos, head, member) \ |
255 | for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \ | 255 | for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \ |
256 | prefetch(pos->member.next), &pos->member != (head); \ | 256 | &pos->member != (head); \ |
257 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) | 257 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) |
258 | 258 | ||
259 | 259 | ||
@@ -270,7 +270,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
270 | */ | 270 | */ |
271 | #define list_for_each_continue_rcu(pos, head) \ | 271 | #define list_for_each_continue_rcu(pos, head) \ |
272 | for ((pos) = rcu_dereference_raw(list_next_rcu(pos)); \ | 272 | for ((pos) = rcu_dereference_raw(list_next_rcu(pos)); \ |
273 | prefetch((pos)->next), (pos) != (head); \ | 273 | (pos) != (head); \ |
274 | (pos) = rcu_dereference_raw(list_next_rcu(pos))) | 274 | (pos) = rcu_dereference_raw(list_next_rcu(pos))) |
275 | 275 | ||
276 | /** | 276 | /** |
@@ -284,7 +284,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
284 | */ | 284 | */ |
285 | #define list_for_each_entry_continue_rcu(pos, head, member) \ | 285 | #define list_for_each_entry_continue_rcu(pos, head, member) \ |
286 | for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \ | 286 | for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \ |
287 | prefetch(pos->member.next), &pos->member != (head); \ | 287 | &pos->member != (head); \ |
288 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) | 288 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) |
289 | 289 | ||
290 | /** | 290 | /** |
@@ -427,7 +427,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
427 | 427 | ||
428 | #define __hlist_for_each_rcu(pos, head) \ | 428 | #define __hlist_for_each_rcu(pos, head) \ |
429 | for (pos = rcu_dereference(hlist_first_rcu(head)); \ | 429 | for (pos = rcu_dereference(hlist_first_rcu(head)); \ |
430 | pos && ({ prefetch(pos->next); 1; }); \ | 430 | pos; \ |
431 | pos = rcu_dereference(hlist_next_rcu(pos))) | 431 | pos = rcu_dereference(hlist_next_rcu(pos))) |
432 | 432 | ||
433 | /** | 433 | /** |
@@ -443,7 +443,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
443 | */ | 443 | */ |
444 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 444 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
445 | for (pos = rcu_dereference_raw(hlist_first_rcu(head)); \ | 445 | for (pos = rcu_dereference_raw(hlist_first_rcu(head)); \ |
446 | pos && ({ prefetch(pos->next); 1; }) && \ | 446 | pos && \ |
447 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 447 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
448 | pos = rcu_dereference_raw(hlist_next_rcu(pos))) | 448 | pos = rcu_dereference_raw(hlist_next_rcu(pos))) |
449 | 449 | ||
@@ -460,7 +460,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
460 | */ | 460 | */ |
461 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ | 461 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ |
462 | for (pos = rcu_dereference_bh((head)->first); \ | 462 | for (pos = rcu_dereference_bh((head)->first); \ |
463 | pos && ({ prefetch(pos->next); 1; }) && \ | 463 | pos && \ |
464 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 464 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
465 | pos = rcu_dereference_bh(pos->next)) | 465 | pos = rcu_dereference_bh(pos->next)) |
466 | 466 | ||
@@ -472,7 +472,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
472 | */ | 472 | */ |
473 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | 473 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ |
474 | for (pos = rcu_dereference((pos)->next); \ | 474 | for (pos = rcu_dereference((pos)->next); \ |
475 | pos && ({ prefetch(pos->next); 1; }) && \ | 475 | pos && \ |
476 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 476 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
477 | pos = rcu_dereference(pos->next)) | 477 | pos = rcu_dereference(pos->next)) |
478 | 478 | ||
@@ -484,7 +484,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
484 | */ | 484 | */ |
485 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ | 485 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ |
486 | for (pos = rcu_dereference_bh((pos)->next); \ | 486 | for (pos = rcu_dereference_bh((pos)->next); \ |
487 | pos && ({ prefetch(pos->next); 1; }) && \ | 487 | pos && \ |
488 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 488 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
489 | pos = rcu_dereference_bh(pos->next)) | 489 | pos = rcu_dereference_bh(pos->next)) |
490 | 490 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index ff422d2b7f90..99f9aa7c2804 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -47,6 +47,18 @@ | |||
47 | extern int rcutorture_runnable; /* for sysctl */ | 47 | extern int rcutorture_runnable; /* for sysctl */ |
48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
49 | 49 | ||
50 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | ||
51 | extern void rcutorture_record_test_transition(void); | ||
52 | extern void rcutorture_record_progress(unsigned long vernum); | ||
53 | #else | ||
54 | static inline void rcutorture_record_test_transition(void) | ||
55 | { | ||
56 | } | ||
57 | static inline void rcutorture_record_progress(unsigned long vernum) | ||
58 | { | ||
59 | } | ||
60 | #endif | ||
61 | |||
50 | #define UINT_CMP_GE(a, b) (UINT_MAX / 2 >= (a) - (b)) | 62 | #define UINT_CMP_GE(a, b) (UINT_MAX / 2 >= (a) - (b)) |
51 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) | 63 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) |
52 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) | 64 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) |
@@ -68,7 +80,6 @@ extern void call_rcu_sched(struct rcu_head *head, | |||
68 | extern void synchronize_sched(void); | 80 | extern void synchronize_sched(void); |
69 | extern void rcu_barrier_bh(void); | 81 | extern void rcu_barrier_bh(void); |
70 | extern void rcu_barrier_sched(void); | 82 | extern void rcu_barrier_sched(void); |
71 | extern int sched_expedited_torture_stats(char *page); | ||
72 | 83 | ||
73 | static inline void __rcu_read_lock_bh(void) | 84 | static inline void __rcu_read_lock_bh(void) |
74 | { | 85 | { |
@@ -774,6 +785,7 @@ extern struct debug_obj_descr rcuhead_debug_descr; | |||
774 | 785 | ||
775 | static inline void debug_rcu_head_queue(struct rcu_head *head) | 786 | static inline void debug_rcu_head_queue(struct rcu_head *head) |
776 | { | 787 | { |
788 | WARN_ON_ONCE((unsigned long)head & 0x3); | ||
777 | debug_object_activate(head, &rcuhead_debug_descr); | 789 | debug_object_activate(head, &rcuhead_debug_descr); |
778 | debug_object_active_state(head, &rcuhead_debug_descr, | 790 | debug_object_active_state(head, &rcuhead_debug_descr, |
779 | STATE_RCU_HEAD_READY, | 791 | STATE_RCU_HEAD_READY, |
@@ -797,4 +809,60 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head) | |||
797 | } | 809 | } |
798 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 810 | #endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
799 | 811 | ||
812 | static __always_inline bool __is_kfree_rcu_offset(unsigned long offset) | ||
813 | { | ||
814 | return offset < 4096; | ||
815 | } | ||
816 | |||
817 | static __always_inline | ||
818 | void __kfree_rcu(struct rcu_head *head, unsigned long offset) | ||
819 | { | ||
820 | typedef void (*rcu_callback)(struct rcu_head *); | ||
821 | |||
822 | BUILD_BUG_ON(!__builtin_constant_p(offset)); | ||
823 | |||
824 | /* See the kfree_rcu() header comment. */ | ||
825 | BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); | ||
826 | |||
827 | call_rcu(head, (rcu_callback)offset); | ||
828 | } | ||
829 | |||
830 | extern void kfree(const void *); | ||
831 | |||
832 | static inline void __rcu_reclaim(struct rcu_head *head) | ||
833 | { | ||
834 | unsigned long offset = (unsigned long)head->func; | ||
835 | |||
836 | if (__is_kfree_rcu_offset(offset)) | ||
837 | kfree((void *)head - offset); | ||
838 | else | ||
839 | head->func(head); | ||
840 | } | ||
841 | |||
842 | /** | ||
843 | * kfree_rcu() - kfree an object after a grace period. | ||
844 | * @ptr: pointer to kfree | ||
845 | * @rcu_head: the name of the struct rcu_head within the type of @ptr. | ||
846 | * | ||
847 | * Many rcu callbacks functions just call kfree() on the base structure. | ||
848 | * These functions are trivial, but their size adds up, and furthermore | ||
849 | * when they are used in a kernel module, that module must invoke the | ||
850 | * high-latency rcu_barrier() function at module-unload time. | ||
851 | * | ||
852 | * The kfree_rcu() function handles this issue. Rather than encoding a | ||
853 | * function address in the embedded rcu_head structure, kfree_rcu() instead | ||
854 | * encodes the offset of the rcu_head structure within the base structure. | ||
855 | * Because the functions are not allowed in the low-order 4096 bytes of | ||
856 | * kernel virtual memory, offsets up to 4095 bytes can be accommodated. | ||
857 | * If the offset is larger than 4095 bytes, a compile-time error will | ||
858 | * be generated in __kfree_rcu(). If this error is triggered, you can | ||
859 | * either fall back to use of call_rcu() or rearrange the structure to | ||
860 | * position the rcu_head structure into the first 4096 bytes. | ||
861 | * | ||
862 | * Note that the allowable offset might decrease in the future, for example, | ||
863 | * to allow something like kmem_cache_free_rcu(). | ||
864 | */ | ||
865 | #define kfree_rcu(ptr, rcu_head) \ | ||
866 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | ||
867 | |||
800 | #endif /* __LINUX_RCUPDATE_H */ | 868 | #endif /* __LINUX_RCUPDATE_H */ |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 30ebd7c8d874..52b3e0281fd0 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -100,6 +100,14 @@ static inline void rcu_note_context_switch(int cpu) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Take advantage of the fact that there is only one CPU, which | ||
104 | * allows us to ignore virtualization-based context switches. | ||
105 | */ | ||
106 | static inline void rcu_virt_note_context_switch(int cpu) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | /* | ||
103 | * Return the number of grace periods. | 111 | * Return the number of grace periods. |
104 | */ | 112 | */ |
105 | static inline long rcu_batches_completed(void) | 113 | static inline long rcu_batches_completed(void) |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 3a933482734a..e65d06634dd8 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -35,6 +35,16 @@ extern void rcu_note_context_switch(int cpu); | |||
35 | extern int rcu_needs_cpu(int cpu); | 35 | extern int rcu_needs_cpu(int cpu); |
36 | extern void rcu_cpu_stall_reset(void); | 36 | extern void rcu_cpu_stall_reset(void); |
37 | 37 | ||
38 | /* | ||
39 | * Note a virtualization-based context switch. This is simply a | ||
40 | * wrapper around rcu_note_context_switch(), which allows TINY_RCU | ||
41 | * to save a few bytes. | ||
42 | */ | ||
43 | static inline void rcu_virt_note_context_switch(int cpu) | ||
44 | { | ||
45 | rcu_note_context_switch(cpu); | ||
46 | } | ||
47 | |||
38 | #ifdef CONFIG_TREE_PREEMPT_RCU | 48 | #ifdef CONFIG_TREE_PREEMPT_RCU |
39 | 49 | ||
40 | extern void exit_rcu(void); | 50 | extern void exit_rcu(void); |
@@ -58,9 +68,12 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
58 | 68 | ||
59 | extern void rcu_barrier(void); | 69 | extern void rcu_barrier(void); |
60 | 70 | ||
71 | extern unsigned long rcutorture_testseq; | ||
72 | extern unsigned long rcutorture_vernum; | ||
61 | extern long rcu_batches_completed(void); | 73 | extern long rcu_batches_completed(void); |
62 | extern long rcu_batches_completed_bh(void); | 74 | extern long rcu_batches_completed_bh(void); |
63 | extern long rcu_batches_completed_sched(void); | 75 | extern long rcu_batches_completed_sched(void); |
76 | |||
64 | extern void rcu_force_quiescent_state(void); | 77 | extern void rcu_force_quiescent_state(void); |
65 | extern void rcu_bh_force_quiescent_state(void); | 78 | extern void rcu_bh_force_quiescent_state(void); |
66 | extern void rcu_sched_force_quiescent_state(void); | 79 | extern void rcu_sched_force_quiescent_state(void); |
diff --git a/include/linux/regulator/db8500-prcmu.h b/include/linux/regulator/db8500-prcmu.h new file mode 100644 index 000000000000..612062313b68 --- /dev/null +++ b/include/linux/regulator/db8500-prcmu.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * | ||
6 | * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson | ||
7 | * | ||
8 | * Interface to power domain regulators on DB8500 | ||
9 | */ | ||
10 | |||
11 | #ifndef __REGULATOR_H__ | ||
12 | #define __REGULATOR_H__ | ||
13 | |||
14 | /* Number of DB8500 regulators and regulator enumeration */ | ||
15 | enum db8500_regulator_id { | ||
16 | DB8500_REGULATOR_VAPE, | ||
17 | DB8500_REGULATOR_VARM, | ||
18 | DB8500_REGULATOR_VMODEM, | ||
19 | DB8500_REGULATOR_VPLL, | ||
20 | DB8500_REGULATOR_VSMPS1, | ||
21 | DB8500_REGULATOR_VSMPS2, | ||
22 | DB8500_REGULATOR_VSMPS3, | ||
23 | DB8500_REGULATOR_VRF1, | ||
24 | DB8500_REGULATOR_SWITCH_SVAMMDSP, | ||
25 | DB8500_REGULATOR_SWITCH_SVAMMDSPRET, | ||
26 | DB8500_REGULATOR_SWITCH_SVAPIPE, | ||
27 | DB8500_REGULATOR_SWITCH_SIAMMDSP, | ||
28 | DB8500_REGULATOR_SWITCH_SIAMMDSPRET, | ||
29 | DB8500_REGULATOR_SWITCH_SIAPIPE, | ||
30 | DB8500_REGULATOR_SWITCH_SGA, | ||
31 | DB8500_REGULATOR_SWITCH_B2R2_MCDE, | ||
32 | DB8500_REGULATOR_SWITCH_ESRAM12, | ||
33 | DB8500_REGULATOR_SWITCH_ESRAM12RET, | ||
34 | DB8500_REGULATOR_SWITCH_ESRAM34, | ||
35 | DB8500_REGULATOR_SWITCH_ESRAM34RET, | ||
36 | DB8500_NUM_REGULATORS | ||
37 | }; | ||
38 | |||
39 | /* | ||
40 | * Exported interface for CPUIdle only. This function is called with all | ||
41 | * interrupts turned off. | ||
42 | */ | ||
43 | int power_state_active_is_enabled(void); | ||
44 | |||
45 | #endif | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index c4c4fc45f856..ce3127a75c88 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -68,6 +68,8 @@ struct regulator_state { | |||
68 | * | 68 | * |
69 | * @min_uV: Smallest voltage consumers may set. | 69 | * @min_uV: Smallest voltage consumers may set. |
70 | * @max_uV: Largest voltage consumers may set. | 70 | * @max_uV: Largest voltage consumers may set. |
71 | * @uV_offset: Offset applied to voltages from consumer to compensate for | ||
72 | * voltage drops. | ||
71 | * | 73 | * |
72 | * @min_uA: Smallest consumers consumers may set. | 74 | * @min_uA: Smallest consumers consumers may set. |
73 | * @max_uA: Largest current consumers may set. | 75 | * @max_uA: Largest current consumers may set. |
@@ -99,6 +101,8 @@ struct regulation_constraints { | |||
99 | int min_uV; | 101 | int min_uV; |
100 | int max_uV; | 102 | int max_uV; |
101 | 103 | ||
104 | int uV_offset; | ||
105 | |||
102 | /* current output range (inclusive) - for current control */ | 106 | /* current output range (inclusive) - for current control */ |
103 | int min_uA; | 107 | int min_uA; |
104 | int max_uA; | 108 | int max_uA; |
@@ -160,8 +164,6 @@ struct regulator_consumer_supply { | |||
160 | * @supply_regulator: Parent regulator. Specified using the regulator name | 164 | * @supply_regulator: Parent regulator. Specified using the regulator name |
161 | * as it appears in the name field in sysfs, which can | 165 | * as it appears in the name field in sysfs, which can |
162 | * be explicitly set using the constraints field 'name'. | 166 | * be explicitly set using the constraints field 'name'. |
163 | * @supply_regulator_dev: Parent regulator (if any) - DEPRECATED in favour | ||
164 | * of supply_regulator. | ||
165 | * | 167 | * |
166 | * @constraints: Constraints. These must be specified for the regulator to | 168 | * @constraints: Constraints. These must be specified for the regulator to |
167 | * be usable. | 169 | * be usable. |
@@ -173,7 +175,6 @@ struct regulator_consumer_supply { | |||
173 | */ | 175 | */ |
174 | struct regulator_init_data { | 176 | struct regulator_init_data { |
175 | const char *supply_regulator; /* or NULL for system supply */ | 177 | const char *supply_regulator; /* or NULL for system supply */ |
176 | struct device *supply_regulator_dev; /* or NULL for system supply */ | ||
177 | 178 | ||
178 | struct regulation_constraints constraints; | 179 | struct regulation_constraints constraints; |
179 | 180 | ||
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h new file mode 100644 index 000000000000..a175d0598033 --- /dev/null +++ b/include/linux/rfkill-gpio.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, NVIDIA Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | |||
20 | #ifndef __RFKILL_GPIO_H | ||
21 | #define __RFKILL_GPIO_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/rfkill.h> | ||
25 | |||
26 | /** | ||
27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. | ||
28 | * for unused gpio's, the expected value is -1. | ||
29 | * @name: name for the gpio rf kill instance | ||
30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | ||
31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | ||
32 | * @power_clk_name: [optional] name of clk to turn off while blocked | ||
33 | */ | ||
34 | |||
35 | struct rfkill_gpio_platform_data { | ||
36 | char *name; | ||
37 | int reset_gpio; | ||
38 | int shutdown_gpio; | ||
39 | const char *power_clk_name; | ||
40 | enum rfkill_type type; | ||
41 | }; | ||
42 | |||
43 | #endif /* __RFKILL_GPIO_H */ | ||
diff --git a/include/linux/rfkill-regulator.h b/include/linux/rfkill-regulator.h new file mode 100644 index 000000000000..aca36bc83315 --- /dev/null +++ b/include/linux/rfkill-regulator.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * rfkill-regulator.c - Regulator consumer driver for rfkill | ||
3 | * | ||
4 | * Copyright (C) 2009 Guiming Zhuo <gmzhuo@gmail.com> | ||
5 | * Copyright (C) 2011 Antonio Ospite <ospite@studenti.unina.it> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_RFKILL_REGULATOR_H | ||
14 | #define __LINUX_RFKILL_REGULATOR_H | ||
15 | |||
16 | /* | ||
17 | * Use "vrfkill" as supply id when declaring the regulator consumer: | ||
18 | * | ||
19 | * static struct regulator_consumer_supply pcap_regulator_V6_consumers [] = { | ||
20 | * { .dev_name = "rfkill-regulator.0", .supply = "vrfkill" }, | ||
21 | * }; | ||
22 | * | ||
23 | * If you have several regulator driven rfkill, you can append a numerical id to | ||
24 | * .dev_name as done above, and use the same id when declaring the platform | ||
25 | * device: | ||
26 | * | ||
27 | * static struct rfkill_regulator_platform_data ezx_rfkill_bt_data = { | ||
28 | * .name = "ezx-bluetooth", | ||
29 | * .type = RFKILL_TYPE_BLUETOOTH, | ||
30 | * }; | ||
31 | * | ||
32 | * static struct platform_device a910_rfkill = { | ||
33 | * .name = "rfkill-regulator", | ||
34 | * .id = 0, | ||
35 | * .dev = { | ||
36 | * .platform_data = &ezx_rfkill_bt_data, | ||
37 | * }, | ||
38 | * }; | ||
39 | */ | ||
40 | |||
41 | #include <linux/rfkill.h> | ||
42 | |||
43 | struct rfkill_regulator_platform_data { | ||
44 | char *name; /* the name for the rfkill switch */ | ||
45 | enum rfkill_type type; /* the type as specified in rfkill.h */ | ||
46 | }; | ||
47 | |||
48 | #endif /* __LINUX_RFKILL_REGULATOR_H */ | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 830e65dc01ee..2148b122779b 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/spinlock.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/memcontrol.h> | 11 | #include <linux/memcontrol.h> |
12 | 12 | ||
13 | /* | 13 | /* |
@@ -26,7 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | struct anon_vma *root; /* Root of this anon_vma tree */ | 28 | struct anon_vma *root; /* Root of this anon_vma tree */ |
29 | spinlock_t lock; /* Serialize access to vma list */ | 29 | struct mutex mutex; /* Serialize access to vma list */ |
30 | /* | 30 | /* |
31 | * The refcount is taken on an anon_vma when there is no | 31 | * The refcount is taken on an anon_vma when there is no |
32 | * guarantee that the vma of page tables will exist for | 32 | * guarantee that the vma of page tables will exist for |
@@ -64,7 +64,7 @@ struct anon_vma_chain { | |||
64 | struct vm_area_struct *vma; | 64 | struct vm_area_struct *vma; |
65 | struct anon_vma *anon_vma; | 65 | struct anon_vma *anon_vma; |
66 | struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ | 66 | struct list_head same_vma; /* locked by mmap_sem & page_table_lock */ |
67 | struct list_head same_anon_vma; /* locked by anon_vma->lock */ | 67 | struct list_head same_anon_vma; /* locked by anon_vma->mutex */ |
68 | }; | 68 | }; |
69 | 69 | ||
70 | #ifdef CONFIG_MMU | 70 | #ifdef CONFIG_MMU |
@@ -93,24 +93,24 @@ static inline void vma_lock_anon_vma(struct vm_area_struct *vma) | |||
93 | { | 93 | { |
94 | struct anon_vma *anon_vma = vma->anon_vma; | 94 | struct anon_vma *anon_vma = vma->anon_vma; |
95 | if (anon_vma) | 95 | if (anon_vma) |
96 | spin_lock(&anon_vma->root->lock); | 96 | mutex_lock(&anon_vma->root->mutex); |
97 | } | 97 | } |
98 | 98 | ||
99 | static inline void vma_unlock_anon_vma(struct vm_area_struct *vma) | 99 | static inline void vma_unlock_anon_vma(struct vm_area_struct *vma) |
100 | { | 100 | { |
101 | struct anon_vma *anon_vma = vma->anon_vma; | 101 | struct anon_vma *anon_vma = vma->anon_vma; |
102 | if (anon_vma) | 102 | if (anon_vma) |
103 | spin_unlock(&anon_vma->root->lock); | 103 | mutex_unlock(&anon_vma->root->mutex); |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline void anon_vma_lock(struct anon_vma *anon_vma) | 106 | static inline void anon_vma_lock(struct anon_vma *anon_vma) |
107 | { | 107 | { |
108 | spin_lock(&anon_vma->root->lock); | 108 | mutex_lock(&anon_vma->root->mutex); |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) | 111 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) |
112 | { | 112 | { |
113 | spin_unlock(&anon_vma->root->lock); | 113 | mutex_unlock(&anon_vma->root->mutex); |
114 | } | 114 | } |
115 | 115 | ||
116 | /* | 116 | /* |
@@ -218,20 +218,7 @@ int try_to_munlock(struct page *); | |||
218 | /* | 218 | /* |
219 | * Called by memory-failure.c to kill processes. | 219 | * Called by memory-failure.c to kill processes. |
220 | */ | 220 | */ |
221 | struct anon_vma *__page_lock_anon_vma(struct page *page); | 221 | struct anon_vma *page_lock_anon_vma(struct page *page); |
222 | |||
223 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
224 | { | ||
225 | struct anon_vma *anon_vma; | ||
226 | |||
227 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
228 | |||
229 | /* (void) is needed to make gcc happy */ | ||
230 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
231 | |||
232 | return anon_vma; | ||
233 | } | ||
234 | |||
235 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 222 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 223 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
237 | 224 | ||
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h index 215278b8df2a..3f594dce5716 100644 --- a/include/linux/rotary_encoder.h +++ b/include/linux/rotary_encoder.h | |||
@@ -10,6 +10,7 @@ struct rotary_encoder_platform_data { | |||
10 | unsigned int inverted_b; | 10 | unsigned int inverted_b; |
11 | bool relative_axis; | 11 | bool relative_axis; |
12 | bool rollover; | 12 | bool rollover; |
13 | bool half_period; | ||
13 | }; | 14 | }; |
14 | 15 | ||
15 | #endif /* __ROTARY_ENCODER_H__ */ | 16 | #endif /* __ROTARY_ENCODER_H__ */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 877ece45426f..b27ebea25660 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -92,10 +92,10 @@ struct rtc_pll_info { | |||
92 | #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ | 92 | #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ |
93 | 93 | ||
94 | /* interrupt flags */ | 94 | /* interrupt flags */ |
95 | #define RTC_IRQF 0x80 /* any of the following is active */ | 95 | #define RTC_IRQF 0x80 /* Any of the following is active */ |
96 | #define RTC_PF 0x40 | 96 | #define RTC_PF 0x40 /* Periodic interrupt */ |
97 | #define RTC_AF 0x20 | 97 | #define RTC_AF 0x20 /* Alarm interrupt */ |
98 | #define RTC_UF 0x10 | 98 | #define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ |
99 | 99 | ||
100 | #ifdef __KERNEL__ | 100 | #ifdef __KERNEL__ |
101 | 101 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 781abd137673..a837b20ba190 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -315,7 +315,6 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write, | |||
315 | void __user *buffer, | 315 | void __user *buffer, |
316 | size_t *lenp, loff_t *ppos); | 316 | size_t *lenp, loff_t *ppos); |
317 | extern unsigned int softlockup_panic; | 317 | extern unsigned int softlockup_panic; |
318 | extern int softlockup_thresh; | ||
319 | void lockup_detector_init(void); | 318 | void lockup_detector_init(void); |
320 | #else | 319 | #else |
321 | static inline void touch_softlockup_watchdog(void) | 320 | static inline void touch_softlockup_watchdog(void) |
@@ -360,7 +359,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout); | |||
360 | extern signed long schedule_timeout_killable(signed long timeout); | 359 | extern signed long schedule_timeout_killable(signed long timeout); |
361 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 360 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
362 | asmlinkage void schedule(void); | 361 | asmlinkage void schedule(void); |
363 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | 362 | extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); |
364 | 363 | ||
365 | struct nsproxy; | 364 | struct nsproxy; |
366 | struct user_namespace; | 365 | struct user_namespace; |
@@ -514,6 +513,7 @@ struct thread_group_cputimer { | |||
514 | spinlock_t lock; | 513 | spinlock_t lock; |
515 | }; | 514 | }; |
516 | 515 | ||
516 | #include <linux/rwsem.h> | ||
517 | struct autogroup; | 517 | struct autogroup; |
518 | 518 | ||
519 | /* | 519 | /* |
@@ -633,6 +633,16 @@ struct signal_struct { | |||
633 | unsigned audit_tty; | 633 | unsigned audit_tty; |
634 | struct tty_audit_buf *tty_audit_buf; | 634 | struct tty_audit_buf *tty_audit_buf; |
635 | #endif | 635 | #endif |
636 | #ifdef CONFIG_CGROUPS | ||
637 | /* | ||
638 | * The threadgroup_fork_lock prevents threads from forking with | ||
639 | * CLONE_THREAD while held for writing. Use this for fork-sensitive | ||
640 | * threadgroup-wide operations. It's taken for reading in fork.c in | ||
641 | * copy_process(). | ||
642 | * Currently only needed write-side by cgroups. | ||
643 | */ | ||
644 | struct rw_semaphore threadgroup_fork_lock; | ||
645 | #endif | ||
636 | 646 | ||
637 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 647 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
638 | int oom_score_adj; /* OOM kill score adjustment */ | 648 | int oom_score_adj; /* OOM kill score adjustment */ |
@@ -653,9 +663,8 @@ struct signal_struct { | |||
653 | * Bits in flags field of signal_struct. | 663 | * Bits in flags field of signal_struct. |
654 | */ | 664 | */ |
655 | #define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */ | 665 | #define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */ |
656 | #define SIGNAL_STOP_DEQUEUED 0x00000002 /* stop signal dequeued */ | 666 | #define SIGNAL_STOP_CONTINUED 0x00000002 /* SIGCONT since WCONTINUED reap */ |
657 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ | 667 | #define SIGNAL_GROUP_EXIT 0x00000004 /* group exit in progress */ |
658 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ | ||
659 | /* | 668 | /* |
660 | * Pending notifications to parent. | 669 | * Pending notifications to parent. |
661 | */ | 670 | */ |
@@ -731,10 +740,6 @@ struct sched_info { | |||
731 | /* timestamps */ | 740 | /* timestamps */ |
732 | unsigned long long last_arrival,/* when we last ran on a cpu */ | 741 | unsigned long long last_arrival,/* when we last ran on a cpu */ |
733 | last_queued; /* when we were last queued to run */ | 742 | last_queued; /* when we were last queued to run */ |
734 | #ifdef CONFIG_SCHEDSTATS | ||
735 | /* BKL stats */ | ||
736 | unsigned int bkl_count; | ||
737 | #endif | ||
738 | }; | 743 | }; |
739 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | 744 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ |
740 | 745 | ||
@@ -792,17 +797,39 @@ enum cpu_idle_type { | |||
792 | }; | 797 | }; |
793 | 798 | ||
794 | /* | 799 | /* |
795 | * sched-domains (multiprocessor balancing) declarations: | 800 | * Increase resolution of nice-level calculations for 64-bit architectures. |
801 | * The extra resolution improves shares distribution and load balancing of | ||
802 | * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup | ||
803 | * hierarchies, especially on larger systems. This is not a user-visible change | ||
804 | * and does not change the user-interface for setting shares/weights. | ||
805 | * | ||
806 | * We increase resolution only if we have enough bits to allow this increased | ||
807 | * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution | ||
808 | * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the | ||
809 | * increased costs. | ||
796 | */ | 810 | */ |
811 | #if BITS_PER_LONG > 32 | ||
812 | # define SCHED_LOAD_RESOLUTION 10 | ||
813 | # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) | ||
814 | # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) | ||
815 | #else | ||
816 | # define SCHED_LOAD_RESOLUTION 0 | ||
817 | # define scale_load(w) (w) | ||
818 | # define scale_load_down(w) (w) | ||
819 | #endif | ||
797 | 820 | ||
798 | /* | 821 | #define SCHED_LOAD_SHIFT (10 + SCHED_LOAD_RESOLUTION) |
799 | * Increase resolution of nice-level calculations: | ||
800 | */ | ||
801 | #define SCHED_LOAD_SHIFT 10 | ||
802 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | 822 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) |
803 | 823 | ||
804 | #define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE | 824 | /* |
825 | * Increase resolution of cpu_power calculations | ||
826 | */ | ||
827 | #define SCHED_POWER_SHIFT 10 | ||
828 | #define SCHED_POWER_SCALE (1L << SCHED_POWER_SHIFT) | ||
805 | 829 | ||
830 | /* | ||
831 | * sched-domains (multiprocessor balancing) declarations: | ||
832 | */ | ||
806 | #ifdef CONFIG_SMP | 833 | #ifdef CONFIG_SMP |
807 | #define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */ | 834 | #define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */ |
808 | #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ | 835 | #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ |
@@ -868,6 +895,7 @@ static inline int sd_power_saving_flags(void) | |||
868 | 895 | ||
869 | struct sched_group { | 896 | struct sched_group { |
870 | struct sched_group *next; /* Must be a circular list */ | 897 | struct sched_group *next; /* Must be a circular list */ |
898 | atomic_t ref; | ||
871 | 899 | ||
872 | /* | 900 | /* |
873 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 901 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
@@ -882,9 +910,6 @@ struct sched_group { | |||
882 | * NOTE: this field is variable length. (Allocated dynamically | 910 | * NOTE: this field is variable length. (Allocated dynamically |
883 | * by attaching extra space to the end of the structure, | 911 | * by attaching extra space to the end of the structure, |
884 | * depending on how many CPUs the kernel has booted up with) | 912 | * depending on how many CPUs the kernel has booted up with) |
885 | * | ||
886 | * It is also be embedded into static data structures at build | ||
887 | * time. (See 'struct static_sched_group' in kernel/sched.c) | ||
888 | */ | 913 | */ |
889 | unsigned long cpumask[0]; | 914 | unsigned long cpumask[0]; |
890 | }; | 915 | }; |
@@ -894,17 +919,6 @@ static inline struct cpumask *sched_group_cpus(struct sched_group *sg) | |||
894 | return to_cpumask(sg->cpumask); | 919 | return to_cpumask(sg->cpumask); |
895 | } | 920 | } |
896 | 921 | ||
897 | enum sched_domain_level { | ||
898 | SD_LV_NONE = 0, | ||
899 | SD_LV_SIBLING, | ||
900 | SD_LV_MC, | ||
901 | SD_LV_BOOK, | ||
902 | SD_LV_CPU, | ||
903 | SD_LV_NODE, | ||
904 | SD_LV_ALLNODES, | ||
905 | SD_LV_MAX | ||
906 | }; | ||
907 | |||
908 | struct sched_domain_attr { | 922 | struct sched_domain_attr { |
909 | int relax_domain_level; | 923 | int relax_domain_level; |
910 | }; | 924 | }; |
@@ -913,6 +927,8 @@ struct sched_domain_attr { | |||
913 | .relax_domain_level = -1, \ | 927 | .relax_domain_level = -1, \ |
914 | } | 928 | } |
915 | 929 | ||
930 | extern int sched_domain_level_max; | ||
931 | |||
916 | struct sched_domain { | 932 | struct sched_domain { |
917 | /* These fields must be setup */ | 933 | /* These fields must be setup */ |
918 | struct sched_domain *parent; /* top domain must be null terminated */ | 934 | struct sched_domain *parent; /* top domain must be null terminated */ |
@@ -930,7 +946,7 @@ struct sched_domain { | |||
930 | unsigned int forkexec_idx; | 946 | unsigned int forkexec_idx; |
931 | unsigned int smt_gain; | 947 | unsigned int smt_gain; |
932 | int flags; /* See SD_* */ | 948 | int flags; /* See SD_* */ |
933 | enum sched_domain_level level; | 949 | int level; |
934 | 950 | ||
935 | /* Runtime fields. */ | 951 | /* Runtime fields. */ |
936 | unsigned long last_balance; /* init to jiffies. units in jiffies */ | 952 | unsigned long last_balance; /* init to jiffies. units in jiffies */ |
@@ -973,6 +989,10 @@ struct sched_domain { | |||
973 | #ifdef CONFIG_SCHED_DEBUG | 989 | #ifdef CONFIG_SCHED_DEBUG |
974 | char *name; | 990 | char *name; |
975 | #endif | 991 | #endif |
992 | union { | ||
993 | void *private; /* used during construction */ | ||
994 | struct rcu_head rcu; /* used during destruction */ | ||
995 | }; | ||
976 | 996 | ||
977 | unsigned int span_weight; | 997 | unsigned int span_weight; |
978 | /* | 998 | /* |
@@ -981,9 +1001,6 @@ struct sched_domain { | |||
981 | * NOTE: this field is variable length. (Allocated dynamically | 1001 | * NOTE: this field is variable length. (Allocated dynamically |
982 | * by attaching extra space to the end of the structure, | 1002 | * by attaching extra space to the end of the structure, |
983 | * depending on how many CPUs the kernel has booted up with) | 1003 | * depending on how many CPUs the kernel has booted up with) |
984 | * | ||
985 | * It is also be embedded into static data structures at build | ||
986 | * time. (See 'struct static_sched_domain' in kernel/sched.c) | ||
987 | */ | 1004 | */ |
988 | unsigned long span[0]; | 1005 | unsigned long span[0]; |
989 | }; | 1006 | }; |
@@ -1046,10 +1063,15 @@ struct sched_domain; | |||
1046 | */ | 1063 | */ |
1047 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ | 1064 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ |
1048 | #define WF_FORK 0x02 /* child wakeup after fork */ | 1065 | #define WF_FORK 0x02 /* child wakeup after fork */ |
1066 | #define WF_MIGRATED 0x04 /* internal use, task got migrated */ | ||
1049 | 1067 | ||
1050 | #define ENQUEUE_WAKEUP 1 | 1068 | #define ENQUEUE_WAKEUP 1 |
1051 | #define ENQUEUE_WAKING 2 | 1069 | #define ENQUEUE_HEAD 2 |
1052 | #define ENQUEUE_HEAD 4 | 1070 | #ifdef CONFIG_SMP |
1071 | #define ENQUEUE_WAKING 4 /* sched_class::task_waking was called */ | ||
1072 | #else | ||
1073 | #define ENQUEUE_WAKING 0 | ||
1074 | #endif | ||
1053 | 1075 | ||
1054 | #define DEQUEUE_SLEEP 1 | 1076 | #define DEQUEUE_SLEEP 1 |
1055 | 1077 | ||
@@ -1067,12 +1089,11 @@ struct sched_class { | |||
1067 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1089 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
1068 | 1090 | ||
1069 | #ifdef CONFIG_SMP | 1091 | #ifdef CONFIG_SMP |
1070 | int (*select_task_rq)(struct rq *rq, struct task_struct *p, | 1092 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
1071 | int sd_flag, int flags); | ||
1072 | 1093 | ||
1073 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1094 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
1074 | void (*post_schedule) (struct rq *this_rq); | 1095 | void (*post_schedule) (struct rq *this_rq); |
1075 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); | 1096 | void (*task_waking) (struct task_struct *task); |
1076 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | 1097 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); |
1077 | 1098 | ||
1078 | void (*set_cpus_allowed)(struct task_struct *p, | 1099 | void (*set_cpus_allowed)(struct task_struct *p, |
@@ -1197,13 +1218,11 @@ struct task_struct { | |||
1197 | unsigned int flags; /* per process flags, defined below */ | 1218 | unsigned int flags; /* per process flags, defined below */ |
1198 | unsigned int ptrace; | 1219 | unsigned int ptrace; |
1199 | 1220 | ||
1200 | int lock_depth; /* BKL lock depth */ | ||
1201 | |||
1202 | #ifdef CONFIG_SMP | 1221 | #ifdef CONFIG_SMP |
1203 | #ifdef __ARCH_WANT_UNLOCKED_CTXSW | 1222 | struct task_struct *wake_entry; |
1204 | int oncpu; | 1223 | int on_cpu; |
1205 | #endif | ||
1206 | #endif | 1224 | #endif |
1225 | int on_rq; | ||
1207 | 1226 | ||
1208 | int prio, static_prio, normal_prio; | 1227 | int prio, static_prio, normal_prio; |
1209 | unsigned int rt_priority; | 1228 | unsigned int rt_priority; |
@@ -1264,6 +1283,7 @@ struct task_struct { | |||
1264 | int exit_state; | 1283 | int exit_state; |
1265 | int exit_code, exit_signal; | 1284 | int exit_code, exit_signal; |
1266 | int pdeath_signal; /* The signal sent when the parent dies */ | 1285 | int pdeath_signal; /* The signal sent when the parent dies */ |
1286 | unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ | ||
1267 | /* ??? */ | 1287 | /* ??? */ |
1268 | unsigned int personality; | 1288 | unsigned int personality; |
1269 | unsigned did_exec:1; | 1289 | unsigned did_exec:1; |
@@ -1274,6 +1294,7 @@ struct task_struct { | |||
1274 | 1294 | ||
1275 | /* Revert to default priority/policy when forking */ | 1295 | /* Revert to default priority/policy when forking */ |
1276 | unsigned sched_reset_on_fork:1; | 1296 | unsigned sched_reset_on_fork:1; |
1297 | unsigned sched_contributes_to_load:1; | ||
1277 | 1298 | ||
1278 | pid_t pid; | 1299 | pid_t pid; |
1279 | pid_t tgid; | 1300 | pid_t tgid; |
@@ -1526,7 +1547,7 @@ struct task_struct { | |||
1526 | #ifdef CONFIG_TRACING | 1547 | #ifdef CONFIG_TRACING |
1527 | /* state flags for use by tracers */ | 1548 | /* state flags for use by tracers */ |
1528 | unsigned long trace; | 1549 | unsigned long trace; |
1529 | /* bitmask of trace recursion */ | 1550 | /* bitmask and counter of trace recursion */ |
1530 | unsigned long trace_recursion; | 1551 | unsigned long trace_recursion; |
1531 | #endif /* CONFIG_TRACING */ | 1552 | #endif /* CONFIG_TRACING */ |
1532 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ | 1553 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ |
@@ -1744,7 +1765,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1744 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1765 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1745 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1766 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
1746 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1767 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1747 | #define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */ | ||
1748 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1768 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1749 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1769 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1750 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1770 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
@@ -1783,6 +1803,17 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1783 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) | 1803 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) |
1784 | #define used_math() tsk_used_math(current) | 1804 | #define used_math() tsk_used_math(current) |
1785 | 1805 | ||
1806 | /* | ||
1807 | * task->group_stop flags | ||
1808 | */ | ||
1809 | #define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ | ||
1810 | #define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ | ||
1811 | #define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ | ||
1812 | #define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ | ||
1813 | #define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ | ||
1814 | |||
1815 | extern void task_clear_group_stop_pending(struct task_struct *task); | ||
1816 | |||
1786 | #ifdef CONFIG_PREEMPT_RCU | 1817 | #ifdef CONFIG_PREEMPT_RCU |
1787 | 1818 | ||
1788 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | 1819 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ |
@@ -1811,9 +1842,16 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
1811 | #endif | 1842 | #endif |
1812 | 1843 | ||
1813 | #ifdef CONFIG_SMP | 1844 | #ifdef CONFIG_SMP |
1845 | extern void do_set_cpus_allowed(struct task_struct *p, | ||
1846 | const struct cpumask *new_mask); | ||
1847 | |||
1814 | extern int set_cpus_allowed_ptr(struct task_struct *p, | 1848 | extern int set_cpus_allowed_ptr(struct task_struct *p, |
1815 | const struct cpumask *new_mask); | 1849 | const struct cpumask *new_mask); |
1816 | #else | 1850 | #else |
1851 | static inline void do_set_cpus_allowed(struct task_struct *p, | ||
1852 | const struct cpumask *new_mask) | ||
1853 | { | ||
1854 | } | ||
1817 | static inline int set_cpus_allowed_ptr(struct task_struct *p, | 1855 | static inline int set_cpus_allowed_ptr(struct task_struct *p, |
1818 | const struct cpumask *new_mask) | 1856 | const struct cpumask *new_mask) |
1819 | { | 1857 | { |
@@ -2063,14 +2101,13 @@ extern void xtime_update(unsigned long ticks); | |||
2063 | 2101 | ||
2064 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); | 2102 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); |
2065 | extern int wake_up_process(struct task_struct *tsk); | 2103 | extern int wake_up_process(struct task_struct *tsk); |
2066 | extern void wake_up_new_task(struct task_struct *tsk, | 2104 | extern void wake_up_new_task(struct task_struct *tsk); |
2067 | unsigned long clone_flags); | ||
2068 | #ifdef CONFIG_SMP | 2105 | #ifdef CONFIG_SMP |
2069 | extern void kick_process(struct task_struct *tsk); | 2106 | extern void kick_process(struct task_struct *tsk); |
2070 | #else | 2107 | #else |
2071 | static inline void kick_process(struct task_struct *tsk) { } | 2108 | static inline void kick_process(struct task_struct *tsk) { } |
2072 | #endif | 2109 | #endif |
2073 | extern void sched_fork(struct task_struct *p, int clone_flags); | 2110 | extern void sched_fork(struct task_struct *p); |
2074 | extern void sched_dead(struct task_struct *p); | 2111 | extern void sched_dead(struct task_struct *p); |
2075 | 2112 | ||
2076 | extern void proc_caches_init(void); | 2113 | extern void proc_caches_init(void); |
@@ -2195,8 +2232,10 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
2195 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2232 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2196 | 2233 | ||
2197 | #ifdef CONFIG_SMP | 2234 | #ifdef CONFIG_SMP |
2235 | void scheduler_ipi(void); | ||
2198 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2236 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
2199 | #else | 2237 | #else |
2238 | static inline void scheduler_ipi(void) { } | ||
2200 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2239 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
2201 | long match_state) | 2240 | long match_state) |
2202 | { | 2241 | { |
@@ -2302,6 +2341,31 @@ static inline void unlock_task_sighand(struct task_struct *tsk, | |||
2302 | spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); | 2341 | spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); |
2303 | } | 2342 | } |
2304 | 2343 | ||
2344 | /* See the declaration of threadgroup_fork_lock in signal_struct. */ | ||
2345 | #ifdef CONFIG_CGROUPS | ||
2346 | static inline void threadgroup_fork_read_lock(struct task_struct *tsk) | ||
2347 | { | ||
2348 | down_read(&tsk->signal->threadgroup_fork_lock); | ||
2349 | } | ||
2350 | static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) | ||
2351 | { | ||
2352 | up_read(&tsk->signal->threadgroup_fork_lock); | ||
2353 | } | ||
2354 | static inline void threadgroup_fork_write_lock(struct task_struct *tsk) | ||
2355 | { | ||
2356 | down_write(&tsk->signal->threadgroup_fork_lock); | ||
2357 | } | ||
2358 | static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) | ||
2359 | { | ||
2360 | up_write(&tsk->signal->threadgroup_fork_lock); | ||
2361 | } | ||
2362 | #else | ||
2363 | static inline void threadgroup_fork_read_lock(struct task_struct *tsk) {} | ||
2364 | static inline void threadgroup_fork_read_unlock(struct task_struct *tsk) {} | ||
2365 | static inline void threadgroup_fork_write_lock(struct task_struct *tsk) {} | ||
2366 | static inline void threadgroup_fork_write_unlock(struct task_struct *tsk) {} | ||
2367 | #endif | ||
2368 | |||
2305 | #ifndef __HAVE_THREAD_FUNCTIONS | 2369 | #ifndef __HAVE_THREAD_FUNCTIONS |
2306 | 2370 | ||
2307 | #define task_thread_info(task) ((struct thread_info *)(task)->stack) | 2371 | #define task_thread_info(task) ((struct thread_info *)(task)->stack) |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index e98cd2e57194..c6db9fb33c44 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | #include <linux/preempt.h> | 30 | #include <linux/preempt.h> |
31 | #include <asm/processor.h> | ||
31 | 32 | ||
32 | typedef struct { | 33 | typedef struct { |
33 | unsigned sequence; | 34 | unsigned sequence; |
@@ -41,9 +42,6 @@ typedef struct { | |||
41 | #define __SEQLOCK_UNLOCKED(lockname) \ | 42 | #define __SEQLOCK_UNLOCKED(lockname) \ |
42 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } | 43 | { 0, __SPIN_LOCK_UNLOCKED(lockname) } |
43 | 44 | ||
44 | #define SEQLOCK_UNLOCKED \ | ||
45 | __SEQLOCK_UNLOCKED(old_style_seqlock_init) | ||
46 | |||
47 | #define seqlock_init(x) \ | 45 | #define seqlock_init(x) \ |
48 | do { \ | 46 | do { \ |
49 | (x)->sequence = 0; \ | 47 | (x)->sequence = 0; \ |
@@ -88,12 +86,12 @@ static __always_inline unsigned read_seqbegin(const seqlock_t *sl) | |||
88 | unsigned ret; | 86 | unsigned ret; |
89 | 87 | ||
90 | repeat: | 88 | repeat: |
91 | ret = sl->sequence; | 89 | ret = ACCESS_ONCE(sl->sequence); |
92 | smp_rmb(); | ||
93 | if (unlikely(ret & 1)) { | 90 | if (unlikely(ret & 1)) { |
94 | cpu_relax(); | 91 | cpu_relax(); |
95 | goto repeat; | 92 | goto repeat; |
96 | } | 93 | } |
94 | smp_rmb(); | ||
97 | 95 | ||
98 | return ret; | 96 | return ret; |
99 | } | 97 | } |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 758c5b0c6fd3..a5c31146a337 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -45,7 +45,8 @@ | |||
45 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ | 45 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ |
46 | #define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ | 46 | #define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ |
47 | #define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ | 47 | #define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ |
48 | #define PORT_MAX_8250 19 /* max port ID */ | 48 | #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ |
49 | #define PORT_MAX_8250 20 /* max port ID */ | ||
49 | 50 | ||
50 | /* | 51 | /* |
51 | * ARM specific type numbers. These are not currently guaranteed | 52 | * ARM specific type numbers. These are not currently guaranteed |
@@ -202,6 +203,9 @@ | |||
202 | /* VIA VT8500 SoC */ | 203 | /* VIA VT8500 SoC */ |
203 | #define PORT_VT8500 97 | 204 | #define PORT_VT8500 97 |
204 | 205 | ||
206 | /* Xilinx PSS UART */ | ||
207 | #define PORT_XUARTPS 98 | ||
208 | |||
205 | #ifdef __KERNEL__ | 209 | #ifdef __KERNEL__ |
206 | 210 | ||
207 | #include <linux/compiler.h> | 211 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 3ecb71a9e505..c75bda37c18e 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -57,6 +57,7 @@ | |||
57 | * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654 | 57 | * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654 |
58 | * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750 | 58 | * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750 |
59 | * TI16C752: 8 16 56 60 8 16 32 56 | 59 | * TI16C752: 8 16 56 60 8 16 32 56 |
60 | * Tegra: 1 4 8 14 16 8 4 1 PORT_TEGRA | ||
60 | */ | 61 | */ |
61 | #define UART_FCR_R_TRIG_00 0x00 | 62 | #define UART_FCR_R_TRIG_00 0x00 |
62 | #define UART_FCR_R_TRIG_01 0x40 | 63 | #define UART_FCR_R_TRIG_01 0x40 |
@@ -118,6 +119,7 @@ | |||
118 | #define UART_MCR_DTR 0x01 /* DTR complement */ | 119 | #define UART_MCR_DTR 0x01 /* DTR complement */ |
119 | 120 | ||
120 | #define UART_LSR 5 /* In: Line Status Register */ | 121 | #define UART_LSR 5 /* In: Line Status Register */ |
122 | #define UART_LSR_FIFOE 0x80 /* Fifo error */ | ||
121 | #define UART_LSR_TEMT 0x40 /* Transmitter empty */ | 123 | #define UART_LSR_TEMT 0x40 /* Transmitter empty */ |
122 | #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ | 124 | #define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ |
123 | #define UART_LSR_BI 0x10 /* Break interrupt indicator */ | 125 | #define UART_LSR_BI 0x10 /* Break interrupt indicator */ |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 399be5ad2f99..2b7fec840517 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #define SHMEM_NR_DIRECT 16 | 10 | #define SHMEM_NR_DIRECT 16 |
11 | 11 | ||
12 | #define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t)) | ||
13 | |||
12 | struct shmem_inode_info { | 14 | struct shmem_inode_info { |
13 | spinlock_t lock; | 15 | spinlock_t lock; |
14 | unsigned long flags; | 16 | unsigned long flags; |
@@ -17,8 +19,12 @@ struct shmem_inode_info { | |||
17 | unsigned long next_index; /* highest alloced index + 1 */ | 19 | unsigned long next_index; /* highest alloced index + 1 */ |
18 | struct shared_policy policy; /* NUMA memory alloc policy */ | 20 | struct shared_policy policy; /* NUMA memory alloc policy */ |
19 | struct page *i_indirect; /* top indirect blocks page */ | 21 | struct page *i_indirect; /* top indirect blocks page */ |
20 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 22 | union { |
23 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | ||
24 | char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; | ||
25 | }; | ||
21 | struct list_head swaplist; /* chain of maybes on swap */ | 26 | struct list_head swaplist; /* chain of maybes on swap */ |
27 | struct list_head xattr_list; /* list of shmem_xattr */ | ||
22 | struct inode vfs_inode; | 28 | struct inode vfs_inode; |
23 | }; | 29 | }; |
24 | 30 | ||
diff --git a/include/linux/sht15.h b/include/linux/sht15.h index 046bce05ecab..f85c7c523da0 100644 --- a/include/linux/sht15.h +++ b/include/linux/sht15.h | |||
@@ -8,17 +8,27 @@ | |||
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | * | ||
12 | * For further information, see the Documentation/hwmon/sht15 file. | ||
11 | */ | 13 | */ |
12 | 14 | ||
13 | /** | 15 | /** |
14 | * struct sht15_platform_data - sht15 connectivity info | 16 | * struct sht15_platform_data - sht15 connectivity info |
15 | * @gpio_data: no. of gpio to which bidirectional data line is connected | 17 | * @gpio_data: no. of gpio to which bidirectional data line is |
16 | * @gpio_sck: no. of gpio to which the data clock is connected. | 18 | * connected. |
17 | * @supply_mv: supply voltage in mv. Overridden by regulator if available. | 19 | * @gpio_sck: no. of gpio to which the data clock is connected. |
18 | **/ | 20 | * @supply_mv: supply voltage in mv. Overridden by regulator if |
21 | * available. | ||
22 | * @checksum: flag to indicate the checksum should be validated. | ||
23 | * @no_otp_reload: flag to indicate no reload from OTP. | ||
24 | * @low_resolution: flag to indicate the temp/humidity resolution to use. | ||
25 | */ | ||
19 | struct sht15_platform_data { | 26 | struct sht15_platform_data { |
20 | int gpio_data; | 27 | int gpio_data; |
21 | int gpio_sck; | 28 | int gpio_sck; |
22 | int supply_mv; | 29 | int supply_mv; |
30 | bool checksum; | ||
31 | bool no_otp_reload; | ||
32 | bool low_resolution; | ||
23 | }; | 33 | }; |
24 | 34 | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index fcd2b14b1932..a822300a253b 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | 9 | ||
10 | struct task_struct; | ||
11 | |||
10 | /* for sysctl */ | 12 | /* for sysctl */ |
11 | extern int print_fatal_signals; | 13 | extern int print_fatal_signals; |
12 | /* | 14 | /* |
@@ -123,13 +125,13 @@ _SIG_SET_BINOP(sigorsets, _sig_or) | |||
123 | #define _sig_and(x,y) ((x) & (y)) | 125 | #define _sig_and(x,y) ((x) & (y)) |
124 | _SIG_SET_BINOP(sigandsets, _sig_and) | 126 | _SIG_SET_BINOP(sigandsets, _sig_and) |
125 | 127 | ||
126 | #define _sig_nand(x,y) ((x) & ~(y)) | 128 | #define _sig_andn(x,y) ((x) & ~(y)) |
127 | _SIG_SET_BINOP(signandsets, _sig_nand) | 129 | _SIG_SET_BINOP(sigandnsets, _sig_andn) |
128 | 130 | ||
129 | #undef _SIG_SET_BINOP | 131 | #undef _SIG_SET_BINOP |
130 | #undef _sig_or | 132 | #undef _sig_or |
131 | #undef _sig_and | 133 | #undef _sig_and |
132 | #undef _sig_nand | 134 | #undef _sig_andn |
133 | 135 | ||
134 | #define _SIG_SET_OP(name, op) \ | 136 | #define _SIG_SET_OP(name, op) \ |
135 | static inline void name(sigset_t *set) \ | 137 | static inline void name(sigset_t *set) \ |
@@ -234,6 +236,9 @@ static inline int valid_signal(unsigned long sig) | |||
234 | return sig <= _NSIG ? 1 : 0; | 236 | return sig <= _NSIG ? 1 : 0; |
235 | } | 237 | } |
236 | 238 | ||
239 | struct timespec; | ||
240 | struct pt_regs; | ||
241 | |||
237 | extern int next_signal(struct sigpending *pending, sigset_t *mask); | 242 | extern int next_signal(struct sigpending *pending, sigset_t *mask); |
238 | extern int do_send_sig_info(int sig, struct siginfo *info, | 243 | extern int do_send_sig_info(int sig, struct siginfo *info, |
239 | struct task_struct *p, bool group); | 244 | struct task_struct *p, bool group); |
@@ -242,10 +247,12 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | |||
242 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | 247 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, |
243 | siginfo_t *info); | 248 | siginfo_t *info); |
244 | extern long do_sigpending(void __user *, unsigned long); | 249 | extern long do_sigpending(void __user *, unsigned long); |
250 | extern int do_sigtimedwait(const sigset_t *, siginfo_t *, | ||
251 | const struct timespec *); | ||
245 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 252 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
253 | extern void set_current_blocked(const sigset_t *); | ||
246 | extern int show_unhandled_signals; | 254 | extern int show_unhandled_signals; |
247 | 255 | ||
248 | struct pt_regs; | ||
249 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 256 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
250 | extern void exit_signals(struct task_struct *tsk); | 257 | extern void exit_signals(struct task_struct *tsk); |
251 | 258 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d0ae90af0b40..c0a4f3ab0cc0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -391,8 +391,8 @@ struct sk_buff { | |||
391 | 391 | ||
392 | __u32 rxhash; | 392 | __u32 rxhash; |
393 | 393 | ||
394 | __u16 queue_mapping; | ||
394 | kmemcheck_bitfield_begin(flags2); | 395 | kmemcheck_bitfield_begin(flags2); |
395 | __u16 queue_mapping:16; | ||
396 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 396 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
397 | __u8 ndisc_nodetype:2; | 397 | __u8 ndisc_nodetype:2; |
398 | #endif | 398 | #endif |
@@ -1256,6 +1256,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len) | |||
1256 | skb->tail += len; | 1256 | skb->tail += len; |
1257 | } | 1257 | } |
1258 | 1258 | ||
1259 | static inline void skb_reset_mac_len(struct sk_buff *skb) | ||
1260 | { | ||
1261 | skb->mac_len = skb->network_header - skb->mac_header; | ||
1262 | } | ||
1263 | |||
1259 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 1264 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
1260 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | 1265 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) |
1261 | { | 1266 | { |
@@ -1442,7 +1447,7 @@ extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | |||
1442 | 1447 | ||
1443 | static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | 1448 | static inline void __skb_trim(struct sk_buff *skb, unsigned int len) |
1444 | { | 1449 | { |
1445 | if (unlikely(skb->data_len)) { | 1450 | if (unlikely(skb_is_nonlinear(skb))) { |
1446 | WARN_ON(1); | 1451 | WARN_ON(1); |
1447 | return; | 1452 | return; |
1448 | } | 1453 | } |
@@ -1782,7 +1787,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1782 | 1787 | ||
1783 | #define skb_queue_walk(queue, skb) \ | 1788 | #define skb_queue_walk(queue, skb) \ |
1784 | for (skb = (queue)->next; \ | 1789 | for (skb = (queue)->next; \ |
1785 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1790 | skb != (struct sk_buff *)(queue); \ |
1786 | skb = skb->next) | 1791 | skb = skb->next) |
1787 | 1792 | ||
1788 | #define skb_queue_walk_safe(queue, skb, tmp) \ | 1793 | #define skb_queue_walk_safe(queue, skb, tmp) \ |
@@ -1791,7 +1796,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1791 | skb = tmp, tmp = skb->next) | 1796 | skb = tmp, tmp = skb->next) |
1792 | 1797 | ||
1793 | #define skb_queue_walk_from(queue, skb) \ | 1798 | #define skb_queue_walk_from(queue, skb) \ |
1794 | for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1799 | for (; skb != (struct sk_buff *)(queue); \ |
1795 | skb = skb->next) | 1800 | skb = skb->next) |
1796 | 1801 | ||
1797 | #define skb_queue_walk_from_safe(queue, skb, tmp) \ | 1802 | #define skb_queue_walk_from_safe(queue, skb, tmp) \ |
@@ -1801,7 +1806,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1801 | 1806 | ||
1802 | #define skb_queue_reverse_walk(queue, skb) \ | 1807 | #define skb_queue_reverse_walk(queue, skb) \ |
1803 | for (skb = (queue)->prev; \ | 1808 | for (skb = (queue)->prev; \ |
1804 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | 1809 | skb != (struct sk_buff *)(queue); \ |
1805 | skb = skb->prev) | 1810 | skb = skb->prev) |
1806 | 1811 | ||
1807 | #define skb_queue_reverse_walk_safe(queue, skb, tmp) \ | 1812 | #define skb_queue_reverse_walk_safe(queue, skb, tmp) \ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 45ca123e8002..c8668d161dd8 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -37,9 +37,7 @@ enum stat_item { | |||
37 | 37 | ||
38 | struct kmem_cache_cpu { | 38 | struct kmem_cache_cpu { |
39 | void **freelist; /* Pointer to next available object */ | 39 | void **freelist; /* Pointer to next available object */ |
40 | #ifdef CONFIG_CMPXCHG_LOCAL | ||
41 | unsigned long tid; /* Globally unique transaction id */ | 40 | unsigned long tid; /* Globally unique transaction id */ |
42 | #endif | ||
43 | struct page *page; /* The slab from which we are allocating */ | 41 | struct page *page; /* The slab from which we are allocating */ |
44 | int node; /* The node of the page (or -1 for debug) */ | 42 | int node; /* The node of the page (or -1 for debug) */ |
45 | #ifdef CONFIG_SLUB_STATS | 43 | #ifdef CONFIG_SLUB_STATS |
@@ -179,7 +177,8 @@ static __always_inline int kmalloc_index(size_t size) | |||
179 | if (size <= 4 * 1024) return 12; | 177 | if (size <= 4 * 1024) return 12; |
180 | /* | 178 | /* |
181 | * The following is only needed to support architectures with a larger page | 179 | * The following is only needed to support architectures with a larger page |
182 | * size than 4k. | 180 | * size than 4k. We need to support 2 * PAGE_SIZE here. So for a 64k page |
181 | * size we would have to go up to 128k. | ||
183 | */ | 182 | */ |
184 | if (size <= 8 * 1024) return 13; | 183 | if (size <= 8 * 1024) return 13; |
185 | if (size <= 16 * 1024) return 14; | 184 | if (size <= 16 * 1024) return 14; |
@@ -190,7 +189,8 @@ static __always_inline int kmalloc_index(size_t size) | |||
190 | if (size <= 512 * 1024) return 19; | 189 | if (size <= 512 * 1024) return 19; |
191 | if (size <= 1024 * 1024) return 20; | 190 | if (size <= 1024 * 1024) return 20; |
192 | if (size <= 2 * 1024 * 1024) return 21; | 191 | if (size <= 2 * 1024 * 1024) return 21; |
193 | return -1; | 192 | BUG(); |
193 | return -1; /* Will never be reached */ | ||
194 | 194 | ||
195 | /* | 195 | /* |
196 | * What we really wanted to do and cannot do because of compiler issues is: | 196 | * What we really wanted to do and cannot do because of compiler issues is: |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 74243c86ba39..7ad824d510a2 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -98,16 +98,6 @@ void ipi_call_unlock_irq(void); | |||
98 | */ | 98 | */ |
99 | int on_each_cpu(smp_call_func_t func, void *info, int wait); | 99 | int on_each_cpu(smp_call_func_t func, void *info, int wait); |
100 | 100 | ||
101 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | ||
102 | #define MSG_ALL 0x8001 | ||
103 | |||
104 | #define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */ | ||
105 | #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's | ||
106 | * when rebooting | ||
107 | */ | ||
108 | #define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/ | ||
109 | #define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */ | ||
110 | |||
111 | /* | 101 | /* |
112 | * Mark the boot cpu "online" so that it can call console drivers in | 102 | * Mark the boot cpu "online" so that it can call console drivers in |
113 | * printk() and can access its per-cpu storage. | 103 | * printk() and can access its per-cpu storage. |
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h index 7144e8aa1e41..4dde70e74822 100644 --- a/include/linux/smsc911x.h +++ b/include/linux/smsc911x.h | |||
@@ -29,6 +29,7 @@ struct smsc911x_platform_config { | |||
29 | unsigned int irq_polarity; | 29 | unsigned int irq_polarity; |
30 | unsigned int irq_type; | 30 | unsigned int irq_type; |
31 | unsigned int flags; | 31 | unsigned int flags; |
32 | unsigned int shift; | ||
32 | phy_interface_t phy_interface; | 33 | phy_interface_t phy_interface; |
33 | unsigned char mac[6]; | 34 | unsigned char mac[6]; |
34 | }; | 35 | }; |
diff --git a/include/linux/socket.h b/include/linux/socket.h index d2b5e982f079..4ef98e422fde 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -333,5 +333,7 @@ struct timespec; | |||
333 | 333 | ||
334 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | 334 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, |
335 | unsigned int flags, struct timespec *timeout); | 335 | unsigned int flags, struct timespec *timeout); |
336 | extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, | ||
337 | unsigned int vlen, unsigned int flags); | ||
336 | #endif /* not kernel and not glibc */ | 338 | #endif /* not kernel and not glibc */ |
337 | #endif /* _LINUX_SOCKET_H */ | 339 | #endif /* _LINUX_SOCKET_H */ |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 92bd0839d5b4..c64de9dd7631 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -14,7 +14,8 @@ enum ads7846_filter { | |||
14 | struct ads7846_platform_data { | 14 | struct ads7846_platform_data { |
15 | u16 model; /* 7843, 7845, 7846, 7873. */ | 15 | u16 model; /* 7843, 7845, 7846, 7873. */ |
16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts |
18 | * ads7846: if 0, use internal vref */ | ||
18 | bool keep_vref_on; /* set to keep vref on for differential | 19 | bool keep_vref_on; /* set to keep vref on for differential |
19 | * measurements as well */ | 20 | * measurements as well */ |
20 | bool swap_xy; /* swap x and y axes */ | 21 | bool swap_xy; /* swap x and y axes */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b4d7710bc38d..bb4f5fbbbd8e 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -581,7 +581,7 @@ extern int spi_bus_unlock(struct spi_master *master); | |||
581 | * Callable only from contexts that can sleep. | 581 | * Callable only from contexts that can sleep. |
582 | */ | 582 | */ |
583 | static inline int | 583 | static inline int |
584 | spi_write(struct spi_device *spi, const u8 *buf, size_t len) | 584 | spi_write(struct spi_device *spi, const void *buf, size_t len) |
585 | { | 585 | { |
586 | struct spi_transfer t = { | 586 | struct spi_transfer t = { |
587 | .tx_buf = buf, | 587 | .tx_buf = buf, |
@@ -605,7 +605,7 @@ spi_write(struct spi_device *spi, const u8 *buf, size_t len) | |||
605 | * Callable only from contexts that can sleep. | 605 | * Callable only from contexts that can sleep. |
606 | */ | 606 | */ |
607 | static inline int | 607 | static inline int |
608 | spi_read(struct spi_device *spi, u8 *buf, size_t len) | 608 | spi_read(struct spi_device *spi, void *buf, size_t len) |
609 | { | 609 | { |
610 | struct spi_transfer t = { | 610 | struct spi_transfer t = { |
611 | .rx_buf = buf, | 611 | .rx_buf = buf, |
@@ -620,8 +620,8 @@ spi_read(struct spi_device *spi, u8 *buf, size_t len) | |||
620 | 620 | ||
621 | /* this copies txbuf and rxbuf data; for small transfers only! */ | 621 | /* this copies txbuf and rxbuf data; for small transfers only! */ |
622 | extern int spi_write_then_read(struct spi_device *spi, | 622 | extern int spi_write_then_read(struct spi_device *spi, |
623 | const u8 *txbuf, unsigned n_tx, | 623 | const void *txbuf, unsigned n_tx, |
624 | u8 *rxbuf, unsigned n_rx); | 624 | void *rxbuf, unsigned n_rx); |
625 | 625 | ||
626 | /** | 626 | /** |
627 | * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read | 627 | * spi_w8r8 - SPI synchronous 8 bit write followed by 8 bit read |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index b14f6a91e19f..a26e2fb604e6 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
@@ -5,6 +5,8 @@ | |||
5 | # error "please don't include this file directly" | 5 | # error "please don't include this file directly" |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | #include <asm/processor.h> /* for cpu_relax() */ | ||
9 | |||
8 | /* | 10 | /* |
9 | * include/linux/spinlock_up.h - UP-debug version of spinlocks. | 11 | * include/linux/spinlock_up.h - UP-debug version of spinlocks. |
10 | * | 12 | * |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 9659eff52ca2..252e44821787 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -308,7 +308,7 @@ struct ssb_bus { | |||
308 | 308 | ||
309 | /* ID information about the Chip. */ | 309 | /* ID information about the Chip. */ |
310 | u16 chip_id; | 310 | u16 chip_id; |
311 | u16 chip_rev; | 311 | u8 chip_rev; |
312 | u16 sprom_offset; | 312 | u16 sprom_offset; |
313 | u16 sprom_size; /* number of words in sprom */ | 313 | u16 sprom_size; /* number of words in sprom */ |
314 | u8 chip_package; | 314 | u8 chip_package; |
@@ -404,7 +404,9 @@ extern bool ssb_is_sprom_available(struct ssb_bus *bus); | |||
404 | 404 | ||
405 | /* Set a fallback SPROM. | 405 | /* Set a fallback SPROM. |
406 | * See kdoc at the function definition for complete documentation. */ | 406 | * See kdoc at the function definition for complete documentation. */ |
407 | extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); | 407 | extern int ssb_arch_register_fallback_sprom( |
408 | int (*sprom_callback)(struct ssb_bus *bus, | ||
409 | struct ssb_sprom *out)); | ||
408 | 410 | ||
409 | /* Suspend a SSB bus. | 411 | /* Suspend a SSB bus. |
410 | * Call this from the parent bus suspend routine. */ | 412 | * Call this from the parent bus suspend routine. */ |
@@ -518,6 +520,7 @@ extern int ssb_bus_may_powerdown(struct ssb_bus *bus); | |||
518 | * Otherwise static always-on powercontrol will be used. */ | 520 | * Otherwise static always-on powercontrol will be used. */ |
519 | extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl); | 521 | extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl); |
520 | 522 | ||
523 | extern void ssb_commit_settings(struct ssb_bus *bus); | ||
521 | 524 | ||
522 | /* Various helper functions */ | 525 | /* Various helper functions */ |
523 | extern u32 ssb_admatch_base(u32 adm); | 526 | extern u32 ssb_admatch_base(u32 adm); |
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 2cdf249b4e5f..a08d693d8324 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
@@ -123,6 +123,8 @@ | |||
123 | #define SSB_CHIPCO_FLASHDATA 0x0048 | 123 | #define SSB_CHIPCO_FLASHDATA 0x0048 |
124 | #define SSB_CHIPCO_BCAST_ADDR 0x0050 | 124 | #define SSB_CHIPCO_BCAST_ADDR 0x0050 |
125 | #define SSB_CHIPCO_BCAST_DATA 0x0054 | 125 | #define SSB_CHIPCO_BCAST_DATA 0x0054 |
126 | #define SSB_CHIPCO_GPIOPULLUP 0x0058 /* Rev >= 20 only */ | ||
127 | #define SSB_CHIPCO_GPIOPULLDOWN 0x005C /* Rev >= 20 only */ | ||
126 | #define SSB_CHIPCO_GPIOIN 0x0060 | 128 | #define SSB_CHIPCO_GPIOIN 0x0060 |
127 | #define SSB_CHIPCO_GPIOOUT 0x0064 | 129 | #define SSB_CHIPCO_GPIOOUT 0x0064 |
128 | #define SSB_CHIPCO_GPIOOUTEN 0x0068 | 130 | #define SSB_CHIPCO_GPIOOUTEN 0x0068 |
@@ -131,6 +133,9 @@ | |||
131 | #define SSB_CHIPCO_GPIOIRQ 0x0074 | 133 | #define SSB_CHIPCO_GPIOIRQ 0x0074 |
132 | #define SSB_CHIPCO_WATCHDOG 0x0080 | 134 | #define SSB_CHIPCO_WATCHDOG 0x0080 |
133 | #define SSB_CHIPCO_GPIOTIMER 0x0088 /* LED powersave (corerev >= 16) */ | 135 | #define SSB_CHIPCO_GPIOTIMER 0x0088 /* LED powersave (corerev >= 16) */ |
136 | #define SSB_CHIPCO_GPIOTIMER_OFFTIME 0x0000FFFF | ||
137 | #define SSB_CHIPCO_GPIOTIMER_OFFTIME_SHIFT 0 | ||
138 | #define SSB_CHIPCO_GPIOTIMER_ONTIME 0xFFFF0000 | ||
134 | #define SSB_CHIPCO_GPIOTIMER_ONTIME_SHIFT 16 | 139 | #define SSB_CHIPCO_GPIOTIMER_ONTIME_SHIFT 16 |
135 | #define SSB_CHIPCO_GPIOTOUTM 0x008C /* LED powersave (corerev >= 16) */ | 140 | #define SSB_CHIPCO_GPIOTOUTM 0x008C /* LED powersave (corerev >= 16) */ |
136 | #define SSB_CHIPCO_CLOCK_N 0x0090 | 141 | #define SSB_CHIPCO_CLOCK_N 0x0090 |
@@ -189,8 +194,10 @@ | |||
189 | #define SSB_CHIPCO_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */ | 194 | #define SSB_CHIPCO_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */ |
190 | #define SSB_CHIPCO_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | 195 | #define SSB_CHIPCO_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ |
191 | #define SSB_CHIPCO_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | 196 | #define SSB_CHIPCO_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ |
192 | #define SSB_CHIPCO_CLKCTLST_HAVEHT 0x00010000 /* HT available */ | 197 | #define SSB_CHIPCO_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ |
193 | #define SSB_CHIPCO_CLKCTLST_HAVEALP 0x00020000 /* APL available */ | 198 | #define SSB_CHIPCO_CLKCTLST_HAVEHT 0x00020000 /* HT available */ |
199 | #define SSB_CHIPCO_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ | ||
200 | #define SSB_CHIPCO_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ | ||
194 | #define SSB_CHIPCO_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 201 | #define SSB_CHIPCO_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
195 | #define SSB_CHIPCO_UART0_DATA 0x0300 | 202 | #define SSB_CHIPCO_UART0_DATA 0x0300 |
196 | #define SSB_CHIPCO_UART0_IMR 0x0304 | 203 | #define SSB_CHIPCO_UART0_IMR 0x0304 |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 402955ae48ce..efbf459d571c 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -97,7 +97,7 @@ | |||
97 | #define SSB_INTVEC_ENET1 0x00000040 /* Enable interrupts for enet 1 */ | 97 | #define SSB_INTVEC_ENET1 0x00000040 /* Enable interrupts for enet 1 */ |
98 | #define SSB_TMSLOW 0x0F98 /* SB Target State Low */ | 98 | #define SSB_TMSLOW 0x0F98 /* SB Target State Low */ |
99 | #define SSB_TMSLOW_RESET 0x00000001 /* Reset */ | 99 | #define SSB_TMSLOW_RESET 0x00000001 /* Reset */ |
100 | #define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */ | 100 | #define SSB_TMSLOW_REJECT 0x00000002 /* Reject (Standard Backplane) */ |
101 | #define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ | 101 | #define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ |
102 | #define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ | 102 | #define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ |
103 | #define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ | 103 | #define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index f29197a4b227..9529e49b0385 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #ifndef __STMMAC_PLATFORM_DATA | 26 | #ifndef __STMMAC_PLATFORM_DATA |
27 | #define __STMMAC_PLATFORM_DATA | 27 | #define __STMMAC_PLATFORM_DATA |
28 | 28 | ||
29 | #include <linux/platform_device.h> | ||
30 | |||
29 | /* platform data for platform device structure's platform_data field */ | 31 | /* platform data for platform device structure's platform_data field */ |
30 | 32 | ||
31 | /* Private data for the STM on-board ethernet driver */ | 33 | /* Private data for the STM on-board ethernet driver */ |
diff --git a/include/linux/string.h b/include/linux/string.h index a716ee2a8adb..a176db2f2c85 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -123,6 +123,7 @@ extern char **argv_split(gfp_t gfp, const char *str, int *argcp); | |||
123 | extern void argv_free(char **argv); | 123 | extern void argv_free(char **argv); |
124 | 124 | ||
125 | extern bool sysfs_streq(const char *s1, const char *s2); | 125 | extern bool sysfs_streq(const char *s1, const char *s2); |
126 | extern int strtobool(const char *s, bool *res); | ||
126 | 127 | ||
127 | #ifdef CONFIG_BINARY_PRINTF | 128 | #ifdef CONFIG_BINARY_PRINTF |
128 | int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); | 129 | int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 77e624883393..c68a147939a6 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -145,6 +145,7 @@ typedef __be32 rpc_fraghdr; | |||
145 | #define RPCBIND_NETID_TCP "tcp" | 145 | #define RPCBIND_NETID_TCP "tcp" |
146 | #define RPCBIND_NETID_UDP6 "udp6" | 146 | #define RPCBIND_NETID_UDP6 "udp6" |
147 | #define RPCBIND_NETID_TCP6 "tcp6" | 147 | #define RPCBIND_NETID_TCP6 "tcp6" |
148 | #define RPCBIND_NETID_LOCAL "local" | ||
148 | 149 | ||
149 | /* | 150 | /* |
150 | * Note that RFC 1833 does not put any size restrictions on the | 151 | * Note that RFC 1833 does not put any size restrictions on the |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 04dba23c59f2..85c50b40759d 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -28,6 +28,7 @@ struct svc_sock { | |||
28 | /* private TCP part */ | 28 | /* private TCP part */ |
29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
31 | struct page * sk_pages[RPCSVC_MAXPAGES]; /* received data */ | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | /* | 34 | /* |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index fc84b7a19ca3..a20970ef9e4e 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -216,6 +216,8 @@ extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | |||
216 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 216 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
217 | unsigned int base, unsigned int len); | 217 | unsigned int base, unsigned int len); |
218 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); | 218 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
219 | extern void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, | ||
220 | struct page **pages, unsigned int len); | ||
219 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); | 221 | extern void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen); |
220 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 222 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
221 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 223 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index a0f998c07c65..81cce3b3ee66 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -141,7 +141,8 @@ enum xprt_transports { | |||
141 | XPRT_TRANSPORT_UDP = IPPROTO_UDP, | 141 | XPRT_TRANSPORT_UDP = IPPROTO_UDP, |
142 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, | 142 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, |
143 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, | 143 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, |
144 | XPRT_TRANSPORT_RDMA = 256 | 144 | XPRT_TRANSPORT_RDMA = 256, |
145 | XPRT_TRANSPORT_LOCAL = 257, | ||
145 | }; | 146 | }; |
146 | 147 | ||
147 | struct rpc_xprt { | 148 | struct rpc_xprt { |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a5c6da5d8df8..384eb5fe530b 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -257,7 +257,8 @@ extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | |||
257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | 257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, |
258 | gfp_t gfp_mask, bool noswap, | 258 | gfp_t gfp_mask, bool noswap, |
259 | unsigned int swappiness, | 259 | unsigned int swappiness, |
260 | struct zone *zone); | 260 | struct zone *zone, |
261 | unsigned long *nr_scanned); | ||
261 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 262 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
262 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 263 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
263 | extern int vm_swappiness; | 264 | extern int vm_swappiness; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 8c0e349f4a6c..445702c60d04 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -24,6 +24,7 @@ extern int swiotlb_force; | |||
24 | 24 | ||
25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); |
27 | extern unsigned long swioltb_nr_tbl(void); | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * Enumeration for sync targets | 30 | * Enumeration for sync targets |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 83ecc1749ef6..8c03b98df5f9 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -610,6 +610,8 @@ asmlinkage long sys_send(int, void __user *, size_t, unsigned); | |||
610 | asmlinkage long sys_sendto(int, void __user *, size_t, unsigned, | 610 | asmlinkage long sys_sendto(int, void __user *, size_t, unsigned, |
611 | struct sockaddr __user *, int); | 611 | struct sockaddr __user *, int); |
612 | asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); | 612 | asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); |
613 | asmlinkage long sys_sendmmsg(int fd, struct mmsghdr __user *msg, | ||
614 | unsigned int vlen, unsigned flags); | ||
613 | asmlinkage long sys_recv(int, void __user *, size_t, unsigned); | 615 | asmlinkage long sys_recv(int, void __user *, size_t, unsigned); |
614 | asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, | 616 | asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, |
615 | struct sockaddr __user *, int __user *); | 617 | struct sockaddr __user *, int __user *); |
@@ -844,4 +846,5 @@ asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name, | |||
844 | asmlinkage long sys_open_by_handle_at(int mountdirfd, | 846 | asmlinkage long sys_open_by_handle_at(int mountdirfd, |
845 | struct file_handle __user *handle, | 847 | struct file_handle __user *handle, |
846 | int flags); | 848 | int flags); |
849 | asmlinkage long sys_setns(int fd, int nstype); | ||
847 | #endif | 850 | #endif |
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index dfb078db8ebb..d35e783a598c 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -34,12 +34,6 @@ struct sysdev_class { | |||
34 | struct list_head drivers; | 34 | struct list_head drivers; |
35 | struct sysdev_class_attribute **attrs; | 35 | struct sysdev_class_attribute **attrs; |
36 | struct kset kset; | 36 | struct kset kset; |
37 | #ifndef CONFIG_ARCH_NO_SYSDEV_OPS | ||
38 | /* Default operations for these types of devices */ | ||
39 | int (*shutdown)(struct sys_device *); | ||
40 | int (*suspend)(struct sys_device *, pm_message_t state); | ||
41 | int (*resume)(struct sys_device *); | ||
42 | #endif | ||
43 | }; | 37 | }; |
44 | 38 | ||
45 | struct sysdev_class_attribute { | 39 | struct sysdev_class_attribute { |
@@ -77,11 +71,6 @@ struct sysdev_driver { | |||
77 | struct list_head entry; | 71 | struct list_head entry; |
78 | int (*add)(struct sys_device *); | 72 | int (*add)(struct sys_device *); |
79 | int (*remove)(struct sys_device *); | 73 | int (*remove)(struct sys_device *); |
80 | #ifndef CONFIG_ARCH_NO_SYSDEV_OPS | ||
81 | int (*shutdown)(struct sys_device *); | ||
82 | int (*suspend)(struct sys_device *, pm_message_t state); | ||
83 | int (*resume)(struct sys_device *); | ||
84 | #endif | ||
85 | }; | 74 | }; |
86 | 75 | ||
87 | 76 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 30b881555fa5..c3acda60eee0 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -176,7 +176,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | |||
176 | const unsigned char *name); | 176 | const unsigned char *name); |
177 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | 177 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); |
178 | void sysfs_put(struct sysfs_dirent *sd); | 178 | void sysfs_put(struct sysfs_dirent *sd); |
179 | void sysfs_printk_last_file(void); | ||
180 | 179 | ||
181 | /* Called to clear a ns tag when it is no longer valid */ | 180 | /* Called to clear a ns tag when it is no longer valid */ |
182 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); | 181 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); |
@@ -348,10 +347,6 @@ static inline int __must_check sysfs_init(void) | |||
348 | return 0; | 347 | return 0; |
349 | } | 348 | } |
350 | 349 | ||
351 | static inline void sysfs_printk_last_file(void) | ||
352 | { | ||
353 | } | ||
354 | |||
355 | #endif /* CONFIG_SYSFS */ | 350 | #endif /* CONFIG_SYSFS */ |
356 | 351 | ||
357 | #endif /* _SYSFS_H_ */ | 352 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 20fc303947d3..8d03f079688c 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -29,7 +29,7 @@ struct restart_block { | |||
29 | } futex; | 29 | } futex; |
30 | /* For nanosleep */ | 30 | /* For nanosleep */ |
31 | struct { | 31 | struct { |
32 | clockid_t index; | 32 | clockid_t clockid; |
33 | struct timespec __user *rmtp; | 33 | struct timespec __user *rmtp; |
34 | #ifdef CONFIG_COMPAT | 34 | #ifdef CONFIG_COMPAT |
35 | struct compat_timespec __user *compat_rmtp; | 35 | struct compat_timespec __user *compat_rmtp; |
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 7071ec5d0118..b004e557caa9 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
@@ -140,12 +140,12 @@ extern long st_unregister(struct st_proto_s *); | |||
140 | */ | 140 | */ |
141 | struct st_data_s { | 141 | struct st_data_s { |
142 | unsigned long st_state; | 142 | unsigned long st_state; |
143 | struct tty_struct *tty; | ||
144 | struct sk_buff *tx_skb; | 143 | struct sk_buff *tx_skb; |
145 | #define ST_TX_SENDING 1 | 144 | #define ST_TX_SENDING 1 |
146 | #define ST_TX_WAKEUP 2 | 145 | #define ST_TX_WAKEUP 2 |
147 | unsigned long tx_state; | 146 | unsigned long tx_state; |
148 | struct st_proto_s *list[ST_MAX_CHANNELS]; | 147 | struct st_proto_s *list[ST_MAX_CHANNELS]; |
148 | bool is_registered[ST_MAX_CHANNELS]; | ||
149 | unsigned long rx_state; | 149 | unsigned long rx_state; |
150 | unsigned long rx_count; | 150 | unsigned long rx_count; |
151 | struct sk_buff *rx_skb; | 151 | struct sk_buff *rx_skb; |
@@ -155,6 +155,7 @@ struct st_data_s { | |||
155 | unsigned char protos_registered; | 155 | unsigned char protos_registered; |
156 | unsigned long ll_state; | 156 | unsigned long ll_state; |
157 | void *kim_data; | 157 | void *kim_data; |
158 | struct tty_struct *tty; | ||
158 | }; | 159 | }; |
159 | 160 | ||
160 | /* | 161 | /* |
diff --git a/include/linux/time.h b/include/linux/time.h index 454a26205787..b3061782dec3 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -126,6 +126,7 @@ struct timespec __current_kernel_time(void); /* does not take xtime_lock */ | |||
126 | struct timespec get_monotonic_coarse(void); | 126 | struct timespec get_monotonic_coarse(void); |
127 | void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, | 127 | void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, |
128 | struct timespec *wtom, struct timespec *sleep); | 128 | struct timespec *wtom, struct timespec *sleep); |
129 | void timekeeping_inject_sleeptime(struct timespec *delta); | ||
129 | 130 | ||
130 | #define CURRENT_TIME (current_kernel_time()) | 131 | #define CURRENT_TIME (current_kernel_time()) |
131 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 132 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
@@ -294,6 +295,8 @@ struct itimerval { | |||
294 | #define CLOCK_REALTIME_COARSE 5 | 295 | #define CLOCK_REALTIME_COARSE 5 |
295 | #define CLOCK_MONOTONIC_COARSE 6 | 296 | #define CLOCK_MONOTONIC_COARSE 6 |
296 | #define CLOCK_BOOTTIME 7 | 297 | #define CLOCK_BOOTTIME 7 |
298 | #define CLOCK_REALTIME_ALARM 8 | ||
299 | #define CLOCK_BOOTTIME_ALARM 9 | ||
297 | 300 | ||
298 | /* | 301 | /* |
299 | * The IDs of various hardware clocks: | 302 | * The IDs of various hardware clocks: |
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h index 2d0792983f8c..d3b57fa12225 100644 --- a/include/linux/timerfd.h +++ b/include/linux/timerfd.h | |||
@@ -19,6 +19,7 @@ | |||
19 | * shared O_* flags. | 19 | * shared O_* flags. |
20 | */ | 20 | */ |
21 | #define TFD_TIMER_ABSTIME (1 << 0) | 21 | #define TFD_TIMER_ABSTIME (1 << 0) |
22 | #define TFD_TIMER_CANCEL_ON_SET (1 << 1) | ||
22 | #define TFD_CLOEXEC O_CLOEXEC | 23 | #define TFD_CLOEXEC O_CLOEXEC |
23 | #define TFD_NONBLOCK O_NONBLOCK | 24 | #define TFD_NONBLOCK O_NONBLOCK |
24 | 25 | ||
@@ -26,6 +27,6 @@ | |||
26 | /* Flags for timerfd_create. */ | 27 | /* Flags for timerfd_create. */ |
27 | #define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS | 28 | #define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS |
28 | /* Flags for timerfd_settime. */ | 29 | /* Flags for timerfd_settime. */ |
29 | #define TFD_SETTIME_FLAGS TFD_TIMER_ABSTIME | 30 | #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) |
30 | 31 | ||
31 | #endif /* _LINUX_TIMERFD_H */ | 32 | #endif /* _LINUX_TIMERFD_H */ |
diff --git a/include/linux/timerqueue.h b/include/linux/timerqueue.h index a520fd70a59f..5088727478fd 100644 --- a/include/linux/timerqueue.h +++ b/include/linux/timerqueue.h | |||
@@ -39,7 +39,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) | |||
39 | 39 | ||
40 | static inline void timerqueue_init(struct timerqueue_node *node) | 40 | static inline void timerqueue_init(struct timerqueue_node *node) |
41 | { | 41 | { |
42 | RB_CLEAR_NODE(&node->node); | 42 | rb_init_node(&node->node); |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline void timerqueue_init_head(struct timerqueue_head *head) | 45 | static inline void timerqueue_init_head(struct timerqueue_head *head) |
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index a5b994a204d2..f2d90091cc20 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
@@ -101,7 +101,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
101 | * Limiting values for messages | 101 | * Limiting values for messages |
102 | */ | 102 | */ |
103 | 103 | ||
104 | #define TIPC_MAX_USER_MSG_SIZE 66000 | 104 | #define TIPC_MAX_USER_MSG_SIZE 66000U |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * Message importance levels | 107 | * Message importance levels |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index ebcfa4ebdbf8..e95f5236611f 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -469,33 +469,6 @@ static inline int tracehook_get_signal(struct task_struct *task, | |||
469 | } | 469 | } |
470 | 470 | ||
471 | /** | 471 | /** |
472 | * tracehook_notify_jctl - report about job control stop/continue | ||
473 | * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED | ||
474 | * @why: %CLD_STOPPED or %CLD_CONTINUED | ||
475 | * | ||
476 | * This is called when we might call do_notify_parent_cldstop(). | ||
477 | * | ||
478 | * @notify is zero if we would not ordinarily send a %SIGCHLD, | ||
479 | * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD. | ||
480 | * | ||
481 | * @why is %CLD_STOPPED when about to stop for job control; | ||
482 | * we are already in %TASK_STOPPED state, about to call schedule(). | ||
483 | * It might also be that we have just exited (check %PF_EXITING), | ||
484 | * but need to report that a group-wide stop is complete. | ||
485 | * | ||
486 | * @why is %CLD_CONTINUED when waking up after job control stop and | ||
487 | * ready to make a delayed @notify report. | ||
488 | * | ||
489 | * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal. | ||
490 | * | ||
491 | * Called with the siglock held. | ||
492 | */ | ||
493 | static inline int tracehook_notify_jctl(int notify, int why) | ||
494 | { | ||
495 | return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; | ||
496 | } | ||
497 | |||
498 | /** | ||
499 | * tracehook_finish_jctl - report about return from job control stop | 472 | * tracehook_finish_jctl - report about return from job control stop |
500 | * | 473 | * |
501 | * This is called by do_signal_stop() after wakeup. | 474 | * This is called by do_signal_stop() after wakeup. |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 97c84a58efb8..d530a4460a0b 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -29,7 +29,7 @@ struct tracepoint_func { | |||
29 | 29 | ||
30 | struct tracepoint { | 30 | struct tracepoint { |
31 | const char *name; /* Tracepoint name */ | 31 | const char *name; /* Tracepoint name */ |
32 | int state; /* State. */ | 32 | struct jump_label_key key; |
33 | void (*regfunc)(void); | 33 | void (*regfunc)(void); |
34 | void (*unregfunc)(void); | 34 | void (*unregfunc)(void); |
35 | struct tracepoint_func __rcu *funcs; | 35 | struct tracepoint_func __rcu *funcs; |
@@ -146,9 +146,7 @@ void tracepoint_update_probe_range(struct tracepoint * const *begin, | |||
146 | extern struct tracepoint __tracepoint_##name; \ | 146 | extern struct tracepoint __tracepoint_##name; \ |
147 | static inline void trace_##name(proto) \ | 147 | static inline void trace_##name(proto) \ |
148 | { \ | 148 | { \ |
149 | JUMP_LABEL(&__tracepoint_##name.state, do_trace); \ | 149 | if (static_branch(&__tracepoint_##name.key)) \ |
150 | return; \ | ||
151 | do_trace: \ | ||
152 | __DO_TRACE(&__tracepoint_##name, \ | 150 | __DO_TRACE(&__tracepoint_##name, \ |
153 | TP_PROTO(data_proto), \ | 151 | TP_PROTO(data_proto), \ |
154 | TP_ARGS(data_args), \ | 152 | TP_ARGS(data_args), \ |
@@ -176,14 +174,14 @@ do_trace: \ | |||
176 | * structures, so we create an array of pointers that will be used for iteration | 174 | * structures, so we create an array of pointers that will be used for iteration |
177 | * on the tracepoints. | 175 | * on the tracepoints. |
178 | */ | 176 | */ |
179 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | 177 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
180 | static const char __tpstrtab_##name[] \ | 178 | static const char __tpstrtab_##name[] \ |
181 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 179 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
182 | struct tracepoint __tracepoint_##name \ | 180 | struct tracepoint __tracepoint_##name \ |
183 | __attribute__((section("__tracepoints"))) = \ | 181 | __attribute__((section("__tracepoints"))) = \ |
184 | { __tpstrtab_##name, 0, reg, unreg, NULL }; \ | 182 | { __tpstrtab_##name, JUMP_LABEL_INIT, reg, unreg, NULL };\ |
185 | static struct tracepoint * const __tracepoint_ptr_##name __used \ | 183 | static struct tracepoint * const __tracepoint_ptr_##name __used \ |
186 | __attribute__((section("__tracepoints_ptrs"))) = \ | 184 | __attribute__((section("__tracepoints_ptrs"))) = \ |
187 | &__tracepoint_##name; | 185 | &__tracepoint_##name; |
188 | 186 | ||
189 | #define DEFINE_TRACE(name) \ | 187 | #define DEFINE_TRACE(name) \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 9f469c700550..d6f05292e456 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -50,6 +50,8 @@ | |||
50 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 50 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ |
51 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 51 | #define N_GSM0710 21 /* GSM 0710 Mux */ |
52 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | 52 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ |
53 | #define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */ | ||
54 | #define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */ | ||
53 | 55 | ||
54 | /* | 56 | /* |
55 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 57 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
@@ -472,6 +474,7 @@ extern int tty_add_file(struct tty_struct *tty, struct file *file); | |||
472 | extern void free_tty_struct(struct tty_struct *tty); | 474 | extern void free_tty_struct(struct tty_struct *tty); |
473 | extern void initialize_tty_struct(struct tty_struct *tty, | 475 | extern void initialize_tty_struct(struct tty_struct *tty, |
474 | struct tty_driver *driver, int idx); | 476 | struct tty_driver *driver, int idx); |
477 | extern void deinitialize_tty_struct(struct tty_struct *tty); | ||
475 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, | 478 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, |
476 | int first_ok); | 479 | int first_ok); |
477 | extern int tty_release(struct inode *inode, struct file *filp); | 480 | extern int tty_release(struct inode *inode, struct file *filp); |
@@ -525,6 +528,7 @@ extern int tty_set_ldisc(struct tty_struct *tty, int ldisc); | |||
525 | extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty); | 528 | extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty); |
526 | extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty); | 529 | extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty); |
527 | extern void tty_ldisc_init(struct tty_struct *tty); | 530 | extern void tty_ldisc_init(struct tty_struct *tty); |
531 | extern void tty_ldisc_deinit(struct tty_struct *tty); | ||
528 | extern void tty_ldisc_begin(void); | 532 | extern void tty_ldisc_begin(void); |
529 | /* This last one is just for the tty layer internals and shouldn't be used elsewhere */ | 533 | /* This last one is just for the tty layer internals and shouldn't be used elsewhere */ |
530 | extern void tty_ldisc_enable(struct tty_struct *tty); | 534 | extern void tty_ldisc_enable(struct tty_struct *tty); |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index d512d98dfb7d..5ca0951e1855 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -93,8 +93,8 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
93 | * Safely read from address @src to the buffer at @dst. If a kernel fault | 93 | * Safely read from address @src to the buffer at @dst. If a kernel fault |
94 | * happens, handle that and return -EFAULT. | 94 | * happens, handle that and return -EFAULT. |
95 | */ | 95 | */ |
96 | extern long probe_kernel_read(void *dst, void *src, size_t size); | 96 | extern long probe_kernel_read(void *dst, const void *src, size_t size); |
97 | extern long __probe_kernel_read(void *dst, void *src, size_t size); | 97 | extern long __probe_kernel_read(void *dst, const void *src, size_t size); |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * probe_kernel_write(): safely attempt to write to a location | 100 | * probe_kernel_write(): safely attempt to write to a location |
@@ -105,7 +105,7 @@ extern long __probe_kernel_read(void *dst, void *src, size_t size); | |||
105 | * Safely write to address @dst from the buffer at @src. If a kernel fault | 105 | * Safely write to address @dst from the buffer at @src. If a kernel fault |
106 | * happens, handle that and return -EFAULT. | 106 | * happens, handle that and return -EFAULT. |
107 | */ | 107 | */ |
108 | extern long notrace probe_kernel_write(void *dst, void *src, size_t size); | 108 | extern long notrace probe_kernel_write(void *dst, const void *src, size_t size); |
109 | extern long notrace __probe_kernel_write(void *dst, void *src, size_t size); | 109 | extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size); |
110 | 110 | ||
111 | #endif /* __LINUX_UACCESS_H__ */ | 111 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 65f78ca5d88e..73c7df489607 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -806,8 +806,10 @@ struct usbdrv_wrap { | |||
806 | * @resume: Called when the device is being resumed by the system. | 806 | * @resume: Called when the device is being resumed by the system. |
807 | * @reset_resume: Called when the suspended device has been reset instead | 807 | * @reset_resume: Called when the suspended device has been reset instead |
808 | * of being resumed. | 808 | * of being resumed. |
809 | * @pre_reset: Called by usb_reset_device() when the device | 809 | * @pre_reset: Called by usb_reset_device() when the device is about to be |
810 | * is about to be reset. | 810 | * reset. This routine must not return until the driver has no active |
811 | * URBs for the device, and no more URBs may be submitted until the | ||
812 | * post_reset method is called. | ||
811 | * @post_reset: Called by usb_reset_device() after the device | 813 | * @post_reset: Called by usb_reset_device() after the device |
812 | * has been reset | 814 | * has been reset |
813 | * @id_table: USB drivers use ID table to support hotplugging. | 815 | * @id_table: USB drivers use ID table to support hotplugging. |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index b72f305ce6bd..0fd3fbdd8283 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -579,7 +579,7 @@ struct usb_ss_ep_comp_descriptor { | |||
579 | 579 | ||
580 | __u8 bMaxBurst; | 580 | __u8 bMaxBurst; |
581 | __u8 bmAttributes; | 581 | __u8 bmAttributes; |
582 | __u16 wBytesPerInterval; | 582 | __le16 wBytesPerInterval; |
583 | } __attribute__ ((packed)); | 583 | } __attribute__ ((packed)); |
584 | 584 | ||
585 | #define USB_DT_SS_EP_COMP_SIZE 6 | 585 | #define USB_DT_SS_EP_COMP_SIZE 6 |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 882a084a8411..b78cba466d3d 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -37,6 +37,14 @@ | |||
37 | #include <linux/usb/ch9.h> | 37 | #include <linux/usb/ch9.h> |
38 | #include <linux/usb/gadget.h> | 38 | #include <linux/usb/gadget.h> |
39 | 39 | ||
40 | /* | ||
41 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | ||
42 | * wish to delay the data/status stages of the control transfer till they | ||
43 | * are ready. The control transfer will then be kept from completing till | ||
44 | * all the function drivers that requested for USB_GADGET_DELAYED_STAUS | ||
45 | * invoke usb_composite_setup_continue(). | ||
46 | */ | ||
47 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | ||
40 | 48 | ||
41 | struct usb_configuration; | 49 | struct usb_configuration; |
42 | 50 | ||
@@ -285,6 +293,7 @@ struct usb_composite_driver { | |||
285 | extern int usb_composite_probe(struct usb_composite_driver *driver, | 293 | extern int usb_composite_probe(struct usb_composite_driver *driver, |
286 | int (*bind)(struct usb_composite_dev *cdev)); | 294 | int (*bind)(struct usb_composite_dev *cdev)); |
287 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 295 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
296 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | ||
288 | 297 | ||
289 | 298 | ||
290 | /** | 299 | /** |
@@ -342,7 +351,12 @@ struct usb_composite_dev { | |||
342 | */ | 351 | */ |
343 | unsigned deactivations; | 352 | unsigned deactivations; |
344 | 353 | ||
345 | /* protects at least deactivation count */ | 354 | /* the composite driver won't complete the control transfer's |
355 | * data/status stages till delayed_status is zero. | ||
356 | */ | ||
357 | int delayed_status; | ||
358 | |||
359 | /* protects deactivations and delayed_status counts*/ | ||
346 | spinlock_t lock; | 360 | spinlock_t lock; |
347 | }; | 361 | }; |
348 | 362 | ||
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index e49dfd45baa4..7cc95ee3606b 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -25,10 +25,15 @@ | |||
25 | struct ehci_caps { | 25 | struct ehci_caps { |
26 | /* these fields are specified as 8 and 16 bit registers, | 26 | /* these fields are specified as 8 and 16 bit registers, |
27 | * but some hosts can't perform 8 or 16 bit PCI accesses. | 27 | * but some hosts can't perform 8 or 16 bit PCI accesses. |
28 | * some hosts treat caplength and hciversion as parts of a 32-bit | ||
29 | * register, others treat them as two separate registers, this | ||
30 | * affects the memory map for big endian controllers. | ||
28 | */ | 31 | */ |
29 | u32 hc_capbase; | 32 | u32 hc_capbase; |
30 | #define HC_LENGTH(p) (((p)>>00)&0x00ff) /* bits 7:0 */ | 33 | #define HC_LENGTH(ehci, p) (0x00ff&((p) >> /* bits 7:0 / offset 00h */ \ |
31 | #define HC_VERSION(p) (((p)>>16)&0xffff) /* bits 31:16 */ | 34 | (ehci_big_endian_capbase(ehci) ? 24 : 0))) |
35 | #define HC_VERSION(ehci, p) (0xffff&((p) >> /* bits 31:16 / offset 02h */ \ | ||
36 | (ehci_big_endian_capbase(ehci) ? 0 : 16))) | ||
32 | u32 hcs_params; /* HCSPARAMS - offset 0x4 */ | 37 | u32 hcs_params; /* HCSPARAMS - offset 0x4 */ |
33 | #define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */ | 38 | #define HCS_DEBUG_PORT(p) (((p)>>20)&0xf) /* bits 23:20, debug port? */ |
34 | #define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ | 39 | #define HCS_INDICATOR(p) ((p)&(1 << 16)) /* true: has port indicators */ |
@@ -52,7 +57,7 @@ struct ehci_caps { | |||
52 | #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ | 57 | #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ |
53 | #define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ | 58 | #define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ |
54 | u8 portroute[8]; /* nibbles for routing - offset 0xC */ | 59 | u8 portroute[8]; /* nibbles for routing - offset 0xC */ |
55 | } __attribute__ ((packed)); | 60 | }; |
56 | 61 | ||
57 | 62 | ||
58 | /* Section 2.3 Host Controller Operational Registers */ | 63 | /* Section 2.3 Host Controller Operational Registers */ |
@@ -150,7 +155,7 @@ struct ehci_regs { | |||
150 | #define PORT_CSC (1<<1) /* connect status change */ | 155 | #define PORT_CSC (1<<1) /* connect status change */ |
151 | #define PORT_CONNECT (1<<0) /* device connected */ | 156 | #define PORT_CONNECT (1<<0) /* device connected */ |
152 | #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) | 157 | #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) |
153 | } __attribute__ ((packed)); | 158 | }; |
154 | 159 | ||
155 | #define USBMODE 0x68 /* USB Device mode */ | 160 | #define USBMODE 0x68 /* USB Device mode */ |
156 | #define USBMODE_SDIS (1<<3) /* Stream disable */ | 161 | #define USBMODE_SDIS (1<<3) /* Stream disable */ |
@@ -194,7 +199,7 @@ struct ehci_dbg_port { | |||
194 | u32 data47; | 199 | u32 data47; |
195 | u32 address; | 200 | u32 address; |
196 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | 201 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) |
197 | } __attribute__ ((packed)); | 202 | }; |
198 | 203 | ||
199 | #ifdef CONFIG_EARLY_PRINTK_DBGP | 204 | #ifdef CONFIG_EARLY_PRINTK_DBGP |
200 | #include <linux/init.h> | 205 | #include <linux/init.h> |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index e538172c0f64..dd1571db55e7 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -890,8 +890,8 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) | |||
890 | /* utility wrapping a simple endpoint selection policy */ | 890 | /* utility wrapping a simple endpoint selection policy */ |
891 | 891 | ||
892 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 892 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
893 | struct usb_endpoint_descriptor *) __devinit; | 893 | struct usb_endpoint_descriptor *); |
894 | 894 | ||
895 | extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; | 895 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); |
896 | 896 | ||
897 | #endif /* __LINUX_USB_GADGET_H */ | 897 | #endif /* __LINUX_USB_GADGET_H */ |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 3657403eac18..00311fe9d0df 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) 2008 Google, Inc. | 3 | * Copyright (C) 2008 Google, Inc. |
4 | * Author: Brian Swetland <swetland@google.com> | 4 | * Author: Brian Swetland <swetland@google.com> |
5 | * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. | 5 | * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved. |
6 | * | 6 | * |
7 | * This software is licensed under the terms of the GNU General Public | 7 | * This software is licensed under the terms of the GNU General Public |
8 | * License version 2, as published by the Free Software Foundation, and | 8 | * License version 2, as published by the Free Software Foundation, and |
@@ -54,6 +54,64 @@ enum otg_control_type { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * PHY used in | ||
58 | * | ||
59 | * INVALID_PHY Unsupported PHY | ||
60 | * CI_45NM_INTEGRATED_PHY Chipidea 45nm integrated PHY | ||
61 | * SNPS_28NM_INTEGRATED_PHY Synopsis 28nm integrated PHY | ||
62 | * | ||
63 | */ | ||
64 | enum msm_usb_phy_type { | ||
65 | INVALID_PHY = 0, | ||
66 | CI_45NM_INTEGRATED_PHY, | ||
67 | SNPS_28NM_INTEGRATED_PHY, | ||
68 | }; | ||
69 | |||
70 | #define IDEV_CHG_MAX 1500 | ||
71 | #define IUNIT 100 | ||
72 | |||
73 | /** | ||
74 | * Different states involved in USB charger detection. | ||
75 | * | ||
76 | * USB_CHG_STATE_UNDEFINED USB charger is not connected or detection | ||
77 | * process is not yet started. | ||
78 | * USB_CHG_STATE_WAIT_FOR_DCD Waiting for Data pins contact. | ||
79 | * USB_CHG_STATE_DCD_DONE Data pin contact is detected. | ||
80 | * USB_CHG_STATE_PRIMARY_DONE Primary detection is completed (Detects | ||
81 | * between SDP and DCP/CDP). | ||
82 | * USB_CHG_STATE_SECONDARY_DONE Secondary detection is completed (Detects | ||
83 | * between DCP and CDP). | ||
84 | * USB_CHG_STATE_DETECTED USB charger type is determined. | ||
85 | * | ||
86 | */ | ||
87 | enum usb_chg_state { | ||
88 | USB_CHG_STATE_UNDEFINED = 0, | ||
89 | USB_CHG_STATE_WAIT_FOR_DCD, | ||
90 | USB_CHG_STATE_DCD_DONE, | ||
91 | USB_CHG_STATE_PRIMARY_DONE, | ||
92 | USB_CHG_STATE_SECONDARY_DONE, | ||
93 | USB_CHG_STATE_DETECTED, | ||
94 | }; | ||
95 | |||
96 | /** | ||
97 | * USB charger types | ||
98 | * | ||
99 | * USB_INVALID_CHARGER Invalid USB charger. | ||
100 | * USB_SDP_CHARGER Standard downstream port. Refers to a downstream port | ||
101 | * on USB2.0 compliant host/hub. | ||
102 | * USB_DCP_CHARGER Dedicated charger port (AC charger/ Wall charger). | ||
103 | * USB_CDP_CHARGER Charging downstream port. Enumeration can happen and | ||
104 | * IDEV_CHG_MAX can be drawn irrespective of USB state. | ||
105 | * | ||
106 | */ | ||
107 | enum usb_chg_type { | ||
108 | USB_INVALID_CHARGER = 0, | ||
109 | USB_SDP_CHARGER, | ||
110 | USB_DCP_CHARGER, | ||
111 | USB_CDP_CHARGER, | ||
112 | }; | ||
113 | |||
114 | /** | ||
57 | * struct msm_otg_platform_data - platform device data | 115 | * struct msm_otg_platform_data - platform device data |
58 | * for msm_otg driver. | 116 | * for msm_otg driver. |
59 | * @phy_init_seq: PHY configuration sequence. val, reg pairs | 117 | * @phy_init_seq: PHY configuration sequence. val, reg pairs |
@@ -64,7 +122,8 @@ enum otg_control_type { | |||
64 | * @otg_control: OTG switch controlled by user/Id pin | 122 | * @otg_control: OTG switch controlled by user/Id pin |
65 | * @default_mode: Default operational mode. Applicable only if | 123 | * @default_mode: Default operational mode. Applicable only if |
66 | * OTG switch is controller by user. | 124 | * OTG switch is controller by user. |
67 | * | 125 | * @pclk_src_name: pclk is derived from ebi1_usb_clk in case of 7x27 and 8k |
126 | * dfab_usb_hs_clk in case of 8660 and 8960. | ||
68 | */ | 127 | */ |
69 | struct msm_otg_platform_data { | 128 | struct msm_otg_platform_data { |
70 | int *phy_init_seq; | 129 | int *phy_init_seq; |
@@ -73,7 +132,9 @@ struct msm_otg_platform_data { | |||
73 | enum usb_mode_type mode; | 132 | enum usb_mode_type mode; |
74 | enum otg_control_type otg_control; | 133 | enum otg_control_type otg_control; |
75 | enum usb_mode_type default_mode; | 134 | enum usb_mode_type default_mode; |
135 | enum msm_usb_phy_type phy_type; | ||
76 | void (*setup_gpio)(enum usb_otg_state state); | 136 | void (*setup_gpio)(enum usb_otg_state state); |
137 | char *pclk_src_name; | ||
77 | }; | 138 | }; |
78 | 139 | ||
79 | /** | 140 | /** |
@@ -83,6 +144,7 @@ struct msm_otg_platform_data { | |||
83 | * @irq: IRQ number assigned for HSUSB controller. | 144 | * @irq: IRQ number assigned for HSUSB controller. |
84 | * @clk: clock struct of usb_hs_clk. | 145 | * @clk: clock struct of usb_hs_clk. |
85 | * @pclk: clock struct of usb_hs_pclk. | 146 | * @pclk: clock struct of usb_hs_pclk. |
147 | * @pclk_src: pclk source for voting. | ||
86 | * @phy_reset_clk: clock struct of usb_phy_clk. | 148 | * @phy_reset_clk: clock struct of usb_phy_clk. |
87 | * @core_clk: clock struct of usb_hs_core_clk. | 149 | * @core_clk: clock struct of usb_hs_core_clk. |
88 | * @regs: ioremapped register base address. | 150 | * @regs: ioremapped register base address. |
@@ -90,7 +152,12 @@ struct msm_otg_platform_data { | |||
90 | * @sm_work: OTG state machine work. | 152 | * @sm_work: OTG state machine work. |
91 | * @in_lpm: indicates low power mode (LPM) state. | 153 | * @in_lpm: indicates low power mode (LPM) state. |
92 | * @async_int: Async interrupt arrived. | 154 | * @async_int: Async interrupt arrived. |
93 | * | 155 | * @cur_power: The amount of mA available from downstream port. |
156 | * @chg_work: Charger detection work. | ||
157 | * @chg_state: The state of charger detection process. | ||
158 | * @chg_type: The type of charger attached. | ||
159 | * @dcd_retires: The retry count used to track Data contact | ||
160 | * detection process. | ||
94 | */ | 161 | */ |
95 | struct msm_otg { | 162 | struct msm_otg { |
96 | struct otg_transceiver otg; | 163 | struct otg_transceiver otg; |
@@ -98,6 +165,7 @@ struct msm_otg { | |||
98 | int irq; | 165 | int irq; |
99 | struct clk *clk; | 166 | struct clk *clk; |
100 | struct clk *pclk; | 167 | struct clk *pclk; |
168 | struct clk *pclk_src; | ||
101 | struct clk *phy_reset_clk; | 169 | struct clk *phy_reset_clk; |
102 | struct clk *core_clk; | 170 | struct clk *core_clk; |
103 | void __iomem *regs; | 171 | void __iomem *regs; |
@@ -107,6 +175,11 @@ struct msm_otg { | |||
107 | struct work_struct sm_work; | 175 | struct work_struct sm_work; |
108 | atomic_t in_lpm; | 176 | atomic_t in_lpm; |
109 | int async_int; | 177 | int async_int; |
178 | unsigned cur_power; | ||
179 | struct delayed_work chg_work; | ||
180 | enum usb_chg_state chg_state; | ||
181 | enum usb_chg_type chg_type; | ||
182 | u8 dcd_retries; | ||
110 | }; | 183 | }; |
111 | 184 | ||
112 | #endif | 185 | #endif |
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h index 7d1babbff071..6e97a2d3d39f 100644 --- a/include/linux/usb/msm_hsusb_hw.h +++ b/include/linux/usb/msm_hsusb_hw.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define USB_PORTSC (MSM_USB_BASE + 0x0184) | 24 | #define USB_PORTSC (MSM_USB_BASE + 0x0184) |
25 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) | 25 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) |
26 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) | 26 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) |
27 | #define USB_PHY_CTRL (MSM_USB_BASE + 0x0240) | ||
27 | 28 | ||
28 | #define USBCMD_RESET 2 | 29 | #define USBCMD_RESET 2 |
29 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) | 30 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) |
@@ -42,6 +43,7 @@ | |||
42 | 43 | ||
43 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ | 44 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ |
44 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ | 45 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ |
46 | #define PHY_RETEN (1 << 1) /* PHY retention enable/disable */ | ||
45 | 47 | ||
46 | /* OTG definitions */ | 48 | /* OTG definitions */ |
47 | #define OTGSC_INTSTS_MASK (0x7f << 16) | 49 | #define OTGSC_INTSTS_MASK (0x7f << 16) |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 6e40718f5abe..d87f44f5b04e 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -168,6 +168,7 @@ otg_shutdown(struct otg_transceiver *otg) | |||
168 | #ifdef CONFIG_USB_OTG_UTILS | 168 | #ifdef CONFIG_USB_OTG_UTILS |
169 | extern struct otg_transceiver *otg_get_transceiver(void); | 169 | extern struct otg_transceiver *otg_get_transceiver(void); |
170 | extern void otg_put_transceiver(struct otg_transceiver *); | 170 | extern void otg_put_transceiver(struct otg_transceiver *); |
171 | extern const char *otg_state_string(enum usb_otg_state state); | ||
171 | #else | 172 | #else |
172 | static inline struct otg_transceiver *otg_get_transceiver(void) | 173 | static inline struct otg_transceiver *otg_get_transceiver(void) |
173 | { | 174 | { |
@@ -177,6 +178,11 @@ static inline struct otg_transceiver *otg_get_transceiver(void) | |||
177 | static inline void otg_put_transceiver(struct otg_transceiver *x) | 178 | static inline void otg_put_transceiver(struct otg_transceiver *x) |
178 | { | 179 | { |
179 | } | 180 | } |
181 | |||
182 | static inline const char *otg_state_string(enum usb_otg_state state) | ||
183 | { | ||
184 | return NULL; | ||
185 | } | ||
180 | #endif | 186 | #endif |
181 | 187 | ||
182 | /* Context: can sleep */ | 188 | /* Context: can sleep */ |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h new file mode 100644 index 000000000000..3a7f1d982dd6 --- /dev/null +++ b/include/linux/usb/renesas_usbhs.h | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | * Renesas USB | ||
3 | * | ||
4 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
5 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
15 | * | ||
16 | */ | ||
17 | #ifndef RENESAS_USB_H | ||
18 | #define RENESAS_USB_H | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/usb/ch9.h> | ||
21 | |||
22 | /* | ||
23 | * module type | ||
24 | * | ||
25 | * it will be return value from get_id | ||
26 | */ | ||
27 | enum { | ||
28 | USBHS_HOST = 0, | ||
29 | USBHS_GADGET, | ||
30 | USBHS_MAX, | ||
31 | }; | ||
32 | |||
33 | /* | ||
34 | * callback functions table for driver | ||
35 | * | ||
36 | * These functions are called from platform for driver. | ||
37 | * Callback function's pointer will be set before | ||
38 | * renesas_usbhs_platform_callback :: hardware_init was called | ||
39 | */ | ||
40 | struct renesas_usbhs_driver_callback { | ||
41 | int (*notify_hotplug)(struct platform_device *pdev); | ||
42 | }; | ||
43 | |||
44 | /* | ||
45 | * callback functions for platform | ||
46 | * | ||
47 | * These functions are called from driver for platform | ||
48 | */ | ||
49 | struct renesas_usbhs_platform_callback { | ||
50 | |||
51 | /* | ||
52 | * option: | ||
53 | * | ||
54 | * Hardware init function for platform. | ||
55 | * it is called when driver was probed. | ||
56 | */ | ||
57 | int (*hardware_init)(struct platform_device *pdev); | ||
58 | |||
59 | /* | ||
60 | * option: | ||
61 | * | ||
62 | * Hardware exit function for platform. | ||
63 | * it is called when driver was removed | ||
64 | */ | ||
65 | void (*hardware_exit)(struct platform_device *pdev); | ||
66 | |||
67 | /* | ||
68 | * option: | ||
69 | * | ||
70 | * Phy reset for platform | ||
71 | */ | ||
72 | void (*phy_reset)(struct platform_device *pdev); | ||
73 | |||
74 | /* | ||
75 | * get USB ID function | ||
76 | * - USBHS_HOST | ||
77 | * - USBHS_GADGET | ||
78 | */ | ||
79 | int (*get_id)(struct platform_device *pdev); | ||
80 | |||
81 | /* | ||
82 | * get VBUS status function. | ||
83 | */ | ||
84 | int (*get_vbus)(struct platform_device *pdev); | ||
85 | }; | ||
86 | |||
87 | /* | ||
88 | * parameters for renesas usbhs | ||
89 | * | ||
90 | * some register needs USB chip specific parameters. | ||
91 | * This struct show it to driver | ||
92 | */ | ||
93 | struct renesas_usbhs_driver_param { | ||
94 | /* | ||
95 | * pipe settings | ||
96 | */ | ||
97 | u32 *pipe_type; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */ | ||
98 | int pipe_size; /* pipe_type array size */ | ||
99 | |||
100 | /* | ||
101 | * option: | ||
102 | * | ||
103 | * for BUSWAIT :: BWAIT | ||
104 | * */ | ||
105 | int buswait_bwait; | ||
106 | |||
107 | /* | ||
108 | * option: | ||
109 | * | ||
110 | * delay time from notify_hotplug callback | ||
111 | */ | ||
112 | int detection_delay; | ||
113 | }; | ||
114 | |||
115 | /* | ||
116 | * option: | ||
117 | * | ||
118 | * platform information for renesas_usbhs driver. | ||
119 | */ | ||
120 | struct renesas_usbhs_platform_info { | ||
121 | /* | ||
122 | * option: | ||
123 | * | ||
124 | * platform set these functions before | ||
125 | * call platform_add_devices if needed | ||
126 | */ | ||
127 | struct renesas_usbhs_platform_callback platform_callback; | ||
128 | |||
129 | /* | ||
130 | * driver set these callback functions pointer. | ||
131 | * platform can use it on callback functions | ||
132 | */ | ||
133 | struct renesas_usbhs_driver_callback driver_callback; | ||
134 | |||
135 | /* | ||
136 | * option: | ||
137 | * | ||
138 | * driver use these param for some register | ||
139 | */ | ||
140 | struct renesas_usbhs_driver_param driver_param; | ||
141 | }; | ||
142 | |||
143 | /* | ||
144 | * macro for platform | ||
145 | */ | ||
146 | #define renesas_usbhs_get_info(pdev)\ | ||
147 | ((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data) | ||
148 | |||
149 | #define renesas_usbhs_call_notify_hotplug(pdev) \ | ||
150 | ({ \ | ||
151 | struct renesas_usbhs_driver_callback *dc; \ | ||
152 | dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \ | ||
153 | if (dc && dc->notify_hotplug) \ | ||
154 | dc->notify_hotplug(pdev); \ | ||
155 | }) | ||
156 | #endif /* RENESAS_USB_H */ | ||
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 05ef52861988..88fceb718c77 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
@@ -256,6 +256,8 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */ | |||
256 | #define FLAG_RNDIS_PHYM_NOT_WIRELESS 0x0001 | 256 | #define FLAG_RNDIS_PHYM_NOT_WIRELESS 0x0001 |
257 | #define FLAG_RNDIS_PHYM_WIRELESS 0x0002 | 257 | #define FLAG_RNDIS_PHYM_WIRELESS 0x0002 |
258 | 258 | ||
259 | /* Flags for driver_info::data */ | ||
260 | #define RNDIS_DRIVER_DATA_POLL_STATUS 1 /* poll status before control */ | ||
259 | 261 | ||
260 | extern void rndis_status(struct usbnet *dev, struct urb *urb); | 262 | extern void rndis_status(struct usbnet *dev, struct urb *urb); |
261 | extern int | 263 | extern int |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 71693d4a4fe1..17df3600bcef 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -62,7 +62,9 @@ | |||
62 | US_FLAG(NO_READ_DISC_INFO, 0x00040000) \ | 62 | US_FLAG(NO_READ_DISC_INFO, 0x00040000) \ |
63 | /* cannot handle READ_DISC_INFO */ \ | 63 | /* cannot handle READ_DISC_INFO */ \ |
64 | US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ | 64 | US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ |
65 | /* cannot handle READ_CAPACITY_16 */ | 65 | /* cannot handle READ_CAPACITY_16 */ \ |
66 | US_FLAG(INITIAL_READ10, 0x00100000) \ | ||
67 | /* Initial READ(10) (and others) must be retried */ | ||
66 | 68 | ||
67 | #define US_FLAG(name, value) US_FL_##name = value , | 69 | #define US_FLAG(name, value) US_FL_##name = value , |
68 | enum { US_DO_ALL_FLAGS }; | 70 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/uvcvideo.h b/include/linux/uvcvideo.h new file mode 100644 index 000000000000..f46a53f060d7 --- /dev/null +++ b/include/linux/uvcvideo.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef __LINUX_UVCVIDEO_H_ | ||
2 | #define __LINUX_UVCVIDEO_H_ | ||
3 | |||
4 | #include <linux/ioctl.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | /* | ||
8 | * Dynamic controls | ||
9 | */ | ||
10 | |||
11 | /* Data types for UVC control data */ | ||
12 | #define UVC_CTRL_DATA_TYPE_RAW 0 | ||
13 | #define UVC_CTRL_DATA_TYPE_SIGNED 1 | ||
14 | #define UVC_CTRL_DATA_TYPE_UNSIGNED 2 | ||
15 | #define UVC_CTRL_DATA_TYPE_BOOLEAN 3 | ||
16 | #define UVC_CTRL_DATA_TYPE_ENUM 4 | ||
17 | #define UVC_CTRL_DATA_TYPE_BITMASK 5 | ||
18 | |||
19 | /* Control flags */ | ||
20 | #define UVC_CTRL_FLAG_SET_CUR (1 << 0) | ||
21 | #define UVC_CTRL_FLAG_GET_CUR (1 << 1) | ||
22 | #define UVC_CTRL_FLAG_GET_MIN (1 << 2) | ||
23 | #define UVC_CTRL_FLAG_GET_MAX (1 << 3) | ||
24 | #define UVC_CTRL_FLAG_GET_RES (1 << 4) | ||
25 | #define UVC_CTRL_FLAG_GET_DEF (1 << 5) | ||
26 | /* Control should be saved at suspend and restored at resume. */ | ||
27 | #define UVC_CTRL_FLAG_RESTORE (1 << 6) | ||
28 | /* Control can be updated by the camera. */ | ||
29 | #define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7) | ||
30 | |||
31 | #define UVC_CTRL_FLAG_GET_RANGE \ | ||
32 | (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \ | ||
33 | UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \ | ||
34 | UVC_CTRL_FLAG_GET_DEF) | ||
35 | |||
36 | struct uvc_menu_info { | ||
37 | __u32 value; | ||
38 | __u8 name[32]; | ||
39 | }; | ||
40 | |||
41 | struct uvc_xu_control_mapping { | ||
42 | __u32 id; | ||
43 | __u8 name[32]; | ||
44 | __u8 entity[16]; | ||
45 | __u8 selector; | ||
46 | |||
47 | __u8 size; | ||
48 | __u8 offset; | ||
49 | __u32 v4l2_type; | ||
50 | __u32 data_type; | ||
51 | |||
52 | struct uvc_menu_info __user *menu_info; | ||
53 | __u32 menu_count; | ||
54 | |||
55 | __u32 reserved[4]; | ||
56 | }; | ||
57 | |||
58 | struct uvc_xu_control_query { | ||
59 | __u8 unit; | ||
60 | __u8 selector; | ||
61 | __u8 query; | ||
62 | __u16 size; | ||
63 | __u8 __user *data; | ||
64 | }; | ||
65 | |||
66 | #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping) | ||
67 | #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query) | ||
68 | |||
69 | #endif | ||
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h index de5c15921025..5ea7f753a348 100644 --- a/include/linux/v4l2-mediabus.h +++ b/include/linux/v4l2-mediabus.h | |||
@@ -89,6 +89,9 @@ enum v4l2_mbus_pixelcode { | |||
89 | V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010, | 89 | V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010, |
90 | V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011, | 90 | V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011, |
91 | V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012, | 91 | V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012, |
92 | |||
93 | /* JPEG compressed formats - next is 0x4002 */ | ||
94 | V4L2_MBUS_FMT_JPEG_1X8 = 0x4001, | ||
92 | }; | 95 | }; |
93 | 96 | ||
94 | /** | 97 | /** |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index be82c8ead1af..8a4c309d2344 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -311,6 +311,9 @@ struct v4l2_pix_format { | |||
311 | #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ | 311 | #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ |
312 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ | 312 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
313 | 313 | ||
314 | /* Grey bit-packed formats */ | ||
315 | #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */ | ||
316 | |||
314 | /* Palette formats */ | 317 | /* Palette formats */ |
315 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ | 318 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
316 | 319 | ||
@@ -333,6 +336,7 @@ struct v4l2_pix_format { | |||
333 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ | 336 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ |
334 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ | 337 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ |
335 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 338 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
339 | #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ | ||
336 | 340 | ||
337 | /* two planes -- one Y, one Cr + Cb interleaved */ | 341 | /* two planes -- one Y, one Cr + Cb interleaved */ |
338 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 342 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index aff5b4f74041..710885749605 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -51,6 +51,13 @@ struct virtqueue { | |||
51 | * This re-enables callbacks; it returns "false" if there are pending | 51 | * This re-enables callbacks; it returns "false" if there are pending |
52 | * buffers in the queue, to detect a possible race between the driver | 52 | * buffers in the queue, to detect a possible race between the driver |
53 | * checking for more work, and enabling callbacks. | 53 | * checking for more work, and enabling callbacks. |
54 | * virtqueue_enable_cb_delayed: restart callbacks after disable_cb. | ||
55 | * vq: the struct virtqueue we're talking about. | ||
56 | * This re-enables callbacks but hints to the other side to delay | ||
57 | * interrupts until most of the available buffers have been processed; | ||
58 | * it returns "false" if there are many pending buffers in the queue, | ||
59 | * to detect a possible race between the driver checking for more work, | ||
60 | * and enabling callbacks. | ||
54 | * virtqueue_detach_unused_buf: detach first unused buffer | 61 | * virtqueue_detach_unused_buf: detach first unused buffer |
55 | * vq: the struct virtqueue we're talking about. | 62 | * vq: the struct virtqueue we're talking about. |
56 | * Returns NULL or the "data" token handed to add_buf | 63 | * Returns NULL or the "data" token handed to add_buf |
@@ -86,6 +93,8 @@ void virtqueue_disable_cb(struct virtqueue *vq); | |||
86 | 93 | ||
87 | bool virtqueue_enable_cb(struct virtqueue *vq); | 94 | bool virtqueue_enable_cb(struct virtqueue *vq); |
88 | 95 | ||
96 | bool virtqueue_enable_cb_delayed(struct virtqueue *vq); | ||
97 | |||
89 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); | 98 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); |
90 | 99 | ||
91 | /** | 100 | /** |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index e68b439b2860..277c4ad44e84 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
@@ -1,7 +1,30 @@ | |||
1 | #ifndef _LINUX_VIRTIO_9P_H | 1 | #ifndef _LINUX_VIRTIO_9P_H |
2 | #define _LINUX_VIRTIO_9P_H | 2 | #define _LINUX_VIRTIO_9P_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. |
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of IBM nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. */ | ||
5 | #include <linux/types.h> | 28 | #include <linux/types.h> |
6 | #include <linux/virtio_ids.h> | 29 | #include <linux/virtio_ids.h> |
7 | #include <linux/virtio_config.h> | 30 | #include <linux/virtio_config.h> |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index a50ecd1b81a2..652dc8bea921 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -1,7 +1,30 @@ | |||
1 | #ifndef _LINUX_VIRTIO_BALLOON_H | 1 | #ifndef _LINUX_VIRTIO_BALLOON_H |
2 | #define _LINUX_VIRTIO_BALLOON_H | 2 | #define _LINUX_VIRTIO_BALLOON_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. |
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of IBM nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. */ | ||
5 | #include <linux/virtio_ids.h> | 28 | #include <linux/virtio_ids.h> |
6 | #include <linux/virtio_config.h> | 29 | #include <linux/virtio_config.h> |
7 | 30 | ||
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 167720d695ed..e0edb40ca7aa 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -1,7 +1,30 @@ | |||
1 | #ifndef _LINUX_VIRTIO_BLK_H | 1 | #ifndef _LINUX_VIRTIO_BLK_H |
2 | #define _LINUX_VIRTIO_BLK_H | 2 | #define _LINUX_VIRTIO_BLK_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. |
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of IBM nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. */ | ||
5 | #include <linux/types.h> | 28 | #include <linux/types.h> |
6 | #include <linux/virtio_ids.h> | 29 | #include <linux/virtio_ids.h> |
7 | #include <linux/virtio_config.h> | 30 | #include <linux/virtio_config.h> |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 800617b4ddd5..39c88c5ad19d 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -1,7 +1,30 @@ | |||
1 | #ifndef _LINUX_VIRTIO_CONFIG_H | 1 | #ifndef _LINUX_VIRTIO_CONFIG_H |
2 | #define _LINUX_VIRTIO_CONFIG_H | 2 | #define _LINUX_VIRTIO_CONFIG_H |
3 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 3 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
4 | * anyone can use the definitions to implement compatible drivers/servers. */ | 4 | * anyone can use the definitions to implement compatible drivers/servers. |
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of IBM nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. */ | ||
5 | 28 | ||
6 | /* Virtio devices use a standardized configuration space to define their | 29 | /* Virtio devices use a standardized configuration space to define their |
7 | * features and pass configuration information, but each implementation can | 30 | * features and pass configuration information, but each implementation can |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index e4d333543a33..bdf4b0034739 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -5,7 +5,31 @@ | |||
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | /* | 6 | /* |
7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
8 | * anyone can use the definitions to implement compatible drivers/servers. | 8 | * anyone can use the definitions to implement compatible drivers/servers: |
9 | * | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions | ||
13 | * are met: | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer in the | ||
18 | * documentation and/or other materials provided with the distribution. | ||
19 | * 3. Neither the name of IBM nor the names of its contributors | ||
20 | * may be used to endorse or promote products derived from this software | ||
21 | * without specific prior written permission. | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
32 | * SUCH DAMAGE. | ||
9 | * | 33 | * |
10 | * Copyright (C) Red Hat, Inc., 2009, 2010, 2011 | 34 | * Copyright (C) Red Hat, Inc., 2009, 2010, 2011 |
11 | * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011 | 35 | * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011 |
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h index 06660c0a78d7..85bb0bb66ffc 100644 --- a/include/linux/virtio_ids.h +++ b/include/linux/virtio_ids.h | |||
@@ -5,7 +5,29 @@ | |||
5 | * | 5 | * |
6 | * This header is BSD licensed so anyone can use the definitions to implement | 6 | * This header is BSD licensed so anyone can use the definitions to implement |
7 | * compatible drivers/servers. | 7 | * compatible drivers/servers. |
8 | */ | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | ||
10 | * modification, are permitted provided that the following conditions | ||
11 | * are met: | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * 2. Redistributions in binary form must reproduce the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer in the | ||
16 | * documentation and/or other materials provided with the distribution. | ||
17 | * 3. Neither the name of IBM nor the names of its contributors | ||
18 | * may be used to endorse or promote products derived from this software | ||
19 | * without specific prior written permission. | ||
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
23 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
30 | * SUCH DAMAGE. */ | ||
9 | 31 | ||
10 | #define VIRTIO_ID_NET 1 /* virtio net */ | 32 | #define VIRTIO_ID_NET 1 /* virtio net */ |
11 | #define VIRTIO_ID_BLOCK 2 /* virtio block */ | 33 | #define VIRTIO_ID_BLOCK 2 /* virtio block */ |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 085e42298ce5..136040bba3e3 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -1,7 +1,30 @@ | |||
1 | #ifndef _LINUX_VIRTIO_NET_H | 1 | #ifndef _LINUX_VIRTIO_NET_H |
2 | #define _LINUX_VIRTIO_NET_H | 2 | #define _LINUX_VIRTIO_NET_H |
3 | /* This header is BSD licensed so anyone can use the definitions to implement | 3 | /* This header is BSD licensed so anyone can use the definitions to implement |
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. |
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions | ||
8 | * are met: | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the name of IBM nor the names of its contributors | ||
15 | * may be used to endorse or promote products derived from this software | ||
16 | * without specific prior written permission. | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
20 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
27 | * SUCH DAMAGE. */ | ||
5 | #include <linux/types.h> | 28 | #include <linux/types.h> |
6 | #include <linux/virtio_ids.h> | 29 | #include <linux/virtio_ids.h> |
7 | #include <linux/virtio_config.h> | 30 | #include <linux/virtio_config.h> |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index 9a3d7c48c622..ea66f3f60d63 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
@@ -11,6 +11,29 @@ | |||
11 | * | 11 | * |
12 | * This header is BSD licensed so anyone can use the definitions to implement | 12 | * This header is BSD licensed so anyone can use the definitions to implement |
13 | * compatible drivers/servers. | 13 | * compatible drivers/servers. |
14 | * | ||
15 | * Redistribution and use in source and binary forms, with or without | ||
16 | * modification, are permitted provided that the following conditions | ||
17 | * are met: | ||
18 | * 1. Redistributions of source code must retain the above copyright | ||
19 | * notice, this list of conditions and the following disclaimer. | ||
20 | * 2. Redistributions in binary form must reproduce the above copyright | ||
21 | * notice, this list of conditions and the following disclaimer in the | ||
22 | * documentation and/or other materials provided with the distribution. | ||
23 | * 3. Neither the name of IBM nor the names of its contributors | ||
24 | * may be used to endorse or promote products derived from this software | ||
25 | * without specific prior written permission. | ||
26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
29 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
36 | * SUCH DAMAGE. | ||
14 | */ | 37 | */ |
15 | 38 | ||
16 | #ifndef _LINUX_VIRTIO_PCI_H | 39 | #ifndef _LINUX_VIRTIO_PCI_H |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index e4d144b132b5..4a32cb6da425 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -7,6 +7,29 @@ | |||
7 | * This header is BSD licensed so anyone can use the definitions to implement | 7 | * This header is BSD licensed so anyone can use the definitions to implement |
8 | * compatible drivers/servers. | 8 | * compatible drivers/servers. |
9 | * | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * 1. Redistributions of source code must retain the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer. | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in the | ||
17 | * documentation and/or other materials provided with the distribution. | ||
18 | * 3. Neither the name of IBM nor the names of its contributors | ||
19 | * may be used to endorse or promote products derived from this software | ||
20 | * without specific prior written permission. | ||
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND | ||
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
24 | * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE | ||
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
31 | * SUCH DAMAGE. | ||
32 | * | ||
10 | * Copyright Rusty Russell IBM Corporation 2007. */ | 33 | * Copyright Rusty Russell IBM Corporation 2007. */ |
11 | #include <linux/types.h> | 34 | #include <linux/types.h> |
12 | 35 | ||
@@ -29,6 +52,12 @@ | |||
29 | /* We support indirect buffer descriptors */ | 52 | /* We support indirect buffer descriptors */ |
30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 | 53 | #define VIRTIO_RING_F_INDIRECT_DESC 28 |
31 | 54 | ||
55 | /* The Guest publishes the used index for which it expects an interrupt | ||
56 | * at the end of the avail ring. Host should ignore the avail->flags field. */ | ||
57 | /* The Host publishes the avail index for which it expects a kick | ||
58 | * at the end of the used ring. Guest should ignore the used->flags field. */ | ||
59 | #define VIRTIO_RING_F_EVENT_IDX 29 | ||
60 | |||
32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ | 61 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ |
33 | struct vring_desc { | 62 | struct vring_desc { |
34 | /* Address (guest-physical). */ | 63 | /* Address (guest-physical). */ |
@@ -83,6 +112,7 @@ struct vring { | |||
83 | * __u16 avail_flags; | 112 | * __u16 avail_flags; |
84 | * __u16 avail_idx; | 113 | * __u16 avail_idx; |
85 | * __u16 available[num]; | 114 | * __u16 available[num]; |
115 | * __u16 used_event_idx; | ||
86 | * | 116 | * |
87 | * // Padding to the next align boundary. | 117 | * // Padding to the next align boundary. |
88 | * char pad[]; | 118 | * char pad[]; |
@@ -91,8 +121,14 @@ struct vring { | |||
91 | * __u16 used_flags; | 121 | * __u16 used_flags; |
92 | * __u16 used_idx; | 122 | * __u16 used_idx; |
93 | * struct vring_used_elem used[num]; | 123 | * struct vring_used_elem used[num]; |
124 | * __u16 avail_event_idx; | ||
94 | * }; | 125 | * }; |
95 | */ | 126 | */ |
127 | /* We publish the used event index at the end of the available ring, and vice | ||
128 | * versa. They are at the end for backwards compatibility. */ | ||
129 | #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num]) | ||
130 | #define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num]) | ||
131 | |||
96 | static inline void vring_init(struct vring *vr, unsigned int num, void *p, | 132 | static inline void vring_init(struct vring *vr, unsigned int num, void *p, |
97 | unsigned long align) | 133 | unsigned long align) |
98 | { | 134 | { |
@@ -107,7 +143,21 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) | |||
107 | { | 143 | { |
108 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) | 144 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) |
109 | + align - 1) & ~(align - 1)) | 145 | + align - 1) & ~(align - 1)) |
110 | + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; | 146 | + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num; |
147 | } | ||
148 | |||
149 | /* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */ | ||
150 | /* Assuming a given event_idx value from the other size, if | ||
151 | * we have just incremented index from old to new_idx, | ||
152 | * should we trigger an event? */ | ||
153 | static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old) | ||
154 | { | ||
155 | /* Note: Xen has similar logic for notification hold-off | ||
156 | * in include/xen/interface/io/ring.h with req_event and req_prod | ||
157 | * corresponding to event_idx + 1 and new_idx respectively. | ||
158 | * Note also that req_event and req_prod in Xen start at 1, | ||
159 | * event indexes in virtio start at 0. */ | ||
160 | return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old); | ||
111 | } | 161 | } |
112 | 162 | ||
113 | #ifdef __KERNEL__ | 163 | #ifdef __KERNEL__ |
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h new file mode 100644 index 000000000000..03b90cdc1921 --- /dev/null +++ b/include/linux/vm_event_item.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef VM_EVENT_ITEM_H_INCLUDED | ||
2 | #define VM_EVENT_ITEM_H_INCLUDED | ||
3 | |||
4 | #ifdef CONFIG_ZONE_DMA | ||
5 | #define DMA_ZONE(xx) xx##_DMA, | ||
6 | #else | ||
7 | #define DMA_ZONE(xx) | ||
8 | #endif | ||
9 | |||
10 | #ifdef CONFIG_ZONE_DMA32 | ||
11 | #define DMA32_ZONE(xx) xx##_DMA32, | ||
12 | #else | ||
13 | #define DMA32_ZONE(xx) | ||
14 | #endif | ||
15 | |||
16 | #ifdef CONFIG_HIGHMEM | ||
17 | #define HIGHMEM_ZONE(xx) , xx##_HIGH | ||
18 | #else | ||
19 | #define HIGHMEM_ZONE(xx) | ||
20 | #endif | ||
21 | |||
22 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE | ||
23 | |||
24 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | ||
25 | FOR_ALL_ZONES(PGALLOC), | ||
26 | PGFREE, PGACTIVATE, PGDEACTIVATE, | ||
27 | PGFAULT, PGMAJFAULT, | ||
28 | FOR_ALL_ZONES(PGREFILL), | ||
29 | FOR_ALL_ZONES(PGSTEAL), | ||
30 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | ||
31 | FOR_ALL_ZONES(PGSCAN_DIRECT), | ||
32 | #ifdef CONFIG_NUMA | ||
33 | PGSCAN_ZONE_RECLAIM_FAILED, | ||
34 | #endif | ||
35 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | ||
36 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, | ||
37 | KSWAPD_SKIP_CONGESTION_WAIT, | ||
38 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | ||
39 | #ifdef CONFIG_COMPACTION | ||
40 | COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED, | ||
41 | COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS, | ||
42 | #endif | ||
43 | #ifdef CONFIG_HUGETLB_PAGE | ||
44 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | ||
45 | #endif | ||
46 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ | ||
47 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ | ||
48 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ | ||
49 | UNEVICTABLE_PGMLOCKED, | ||
50 | UNEVICTABLE_PGMUNLOCKED, | ||
51 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | ||
52 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | ||
53 | UNEVICTABLE_MLOCKFREED, | ||
54 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
55 | THP_FAULT_ALLOC, | ||
56 | THP_FAULT_FALLBACK, | ||
57 | THP_COLLAPSE_ALLOC, | ||
58 | THP_COLLAPSE_ALLOC_FAILED, | ||
59 | THP_SPLIT, | ||
60 | #endif | ||
61 | NR_VM_EVENT_ITEMS | ||
62 | }; | ||
63 | |||
64 | #endif /* VM_EVENT_ITEM_H_INCLUDED */ | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 2b3831b58aa4..bcd942fa611c 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -5,69 +5,9 @@ | |||
5 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
8 | #include <linux/vm_event_item.h> | ||
8 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
9 | 10 | ||
10 | #ifdef CONFIG_ZONE_DMA | ||
11 | #define DMA_ZONE(xx) xx##_DMA, | ||
12 | #else | ||
13 | #define DMA_ZONE(xx) | ||
14 | #endif | ||
15 | |||
16 | #ifdef CONFIG_ZONE_DMA32 | ||
17 | #define DMA32_ZONE(xx) xx##_DMA32, | ||
18 | #else | ||
19 | #define DMA32_ZONE(xx) | ||
20 | #endif | ||
21 | |||
22 | #ifdef CONFIG_HIGHMEM | ||
23 | #define HIGHMEM_ZONE(xx) , xx##_HIGH | ||
24 | #else | ||
25 | #define HIGHMEM_ZONE(xx) | ||
26 | #endif | ||
27 | |||
28 | |||
29 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE | ||
30 | |||
31 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | ||
32 | FOR_ALL_ZONES(PGALLOC), | ||
33 | PGFREE, PGACTIVATE, PGDEACTIVATE, | ||
34 | PGFAULT, PGMAJFAULT, | ||
35 | FOR_ALL_ZONES(PGREFILL), | ||
36 | FOR_ALL_ZONES(PGSTEAL), | ||
37 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | ||
38 | FOR_ALL_ZONES(PGSCAN_DIRECT), | ||
39 | #ifdef CONFIG_NUMA | ||
40 | PGSCAN_ZONE_RECLAIM_FAILED, | ||
41 | #endif | ||
42 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | ||
43 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, | ||
44 | KSWAPD_SKIP_CONGESTION_WAIT, | ||
45 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | ||
46 | #ifdef CONFIG_COMPACTION | ||
47 | COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED, | ||
48 | COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS, | ||
49 | #endif | ||
50 | #ifdef CONFIG_HUGETLB_PAGE | ||
51 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | ||
52 | #endif | ||
53 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ | ||
54 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ | ||
55 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ | ||
56 | UNEVICTABLE_PGMLOCKED, | ||
57 | UNEVICTABLE_PGMUNLOCKED, | ||
58 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | ||
59 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | ||
60 | UNEVICTABLE_MLOCKFREED, | ||
61 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | ||
62 | THP_FAULT_ALLOC, | ||
63 | THP_FAULT_FALLBACK, | ||
64 | THP_COLLAPSE_ALLOC, | ||
65 | THP_COLLAPSE_ALLOC_FAILED, | ||
66 | THP_SPLIT, | ||
67 | #endif | ||
68 | NR_VM_EVENT_ITEMS | ||
69 | }; | ||
70 | |||
71 | extern int sysctl_stat_interval; | 11 | extern int sysctl_stat_interval; |
72 | 12 | ||
73 | #ifdef CONFIG_VM_EVENT_COUNTERS | 13 | #ifdef CONFIG_VM_EVENT_COUNTERS |
@@ -261,6 +201,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
261 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 201 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
262 | 202 | ||
263 | void refresh_cpu_vm_stats(int); | 203 | void refresh_cpu_vm_stats(int); |
204 | void refresh_zone_stat_thresholds(void); | ||
264 | 205 | ||
265 | int calculate_pressure_threshold(struct zone *zone); | 206 | int calculate_pressure_threshold(struct zone *zone); |
266 | int calculate_normal_threshold(struct zone *zone); | 207 | int calculate_normal_threshold(struct zone *zone); |
@@ -313,6 +254,10 @@ static inline void __dec_zone_page_state(struct page *page, | |||
313 | #define set_pgdat_percpu_threshold(pgdat, callback) { } | 254 | #define set_pgdat_percpu_threshold(pgdat, callback) { } |
314 | 255 | ||
315 | static inline void refresh_cpu_vm_stats(int cpu) { } | 256 | static inline void refresh_cpu_vm_stats(int cpu) { } |
316 | #endif | 257 | static inline void refresh_zone_stat_thresholds(void) { } |
258 | |||
259 | #endif /* CONFIG_SMP */ | ||
260 | |||
261 | extern const char * const vmstat_text[]; | ||
317 | 262 | ||
318 | #endif /* _LINUX_VMSTAT_H */ | 263 | #endif /* _LINUX_VMSTAT_H */ |
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h index bebb8efea0a6..4b697395326e 100644 --- a/include/linux/wl12xx.h +++ b/include/linux/wl12xx.h | |||
@@ -24,12 +24,26 @@ | |||
24 | #ifndef _LINUX_WL12XX_H | 24 | #ifndef _LINUX_WL12XX_H |
25 | #define _LINUX_WL12XX_H | 25 | #define _LINUX_WL12XX_H |
26 | 26 | ||
27 | /* The board reference clock values */ | 27 | /* Reference clock values */ |
28 | enum { | 28 | enum { |
29 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ | 29 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ |
30 | WL12XX_REFCLOCK_26 = 1, /* 26 MHz */ | 30 | WL12XX_REFCLOCK_26 = 1, /* 26 MHz */ |
31 | WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */ | 31 | WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */ |
32 | WL12XX_REFCLOCK_54 = 3, /* 54 MHz */ | 32 | WL12XX_REFCLOCK_52 = 3, /* 52 MHz */ |
33 | WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */ | ||
34 | WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */ | ||
35 | }; | ||
36 | |||
37 | /* TCXO clock values */ | ||
38 | enum { | ||
39 | WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */ | ||
40 | WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */ | ||
41 | WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */ | ||
42 | WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */ | ||
43 | WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */ | ||
44 | WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */ | ||
45 | WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */ | ||
46 | WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */ | ||
33 | }; | 47 | }; |
34 | 48 | ||
35 | struct wl12xx_platform_data { | 49 | struct wl12xx_platform_data { |
@@ -38,8 +52,13 @@ struct wl12xx_platform_data { | |||
38 | int irq; | 52 | int irq; |
39 | bool use_eeprom; | 53 | bool use_eeprom; |
40 | int board_ref_clock; | 54 | int board_ref_clock; |
55 | int board_tcxo_clock; | ||
56 | unsigned long platform_quirks; | ||
41 | }; | 57 | }; |
42 | 58 | ||
59 | /* Platform does not support level trigger interrupts */ | ||
60 | #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) | ||
61 | |||
43 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | 62 | #ifdef CONFIG_WL12XX_PLATFORM_DATA |
44 | 63 | ||
45 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); | 64 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 6050783005bd..aed54c50aa66 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -13,10 +13,6 @@ | |||
13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ | 13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ |
14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ | 14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | |||
20 | /* Namespaces */ | 16 | /* Namespaces */ |
21 | #define XATTR_OS2_PREFIX "os2." | 17 | #define XATTR_OS2_PREFIX "os2." |
22 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) | 18 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) |
@@ -53,6 +49,10 @@ | |||
53 | #define XATTR_CAPS_SUFFIX "capability" | 49 | #define XATTR_CAPS_SUFFIX "capability" |
54 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 50 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
55 | 51 | ||
52 | #ifdef __KERNEL__ | ||
53 | |||
54 | #include <linux/types.h> | ||
55 | |||
56 | struct inode; | 56 | struct inode; |
57 | struct dentry; | 57 | struct dentry; |
58 | 58 | ||
diff --git a/include/media/m5mols.h b/include/media/m5mols.h new file mode 100644 index 000000000000..2d7e7ca2313d --- /dev/null +++ b/include/media/m5mols.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Driver header for M-5MOLS 8M Pixel camera sensor with ISP | ||
3 | * | ||
4 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
5 | * Author: HeungJun Kim, riverful.kim@samsung.com | ||
6 | * | ||
7 | * Copyright (C) 2009 Samsung Electronics Co., Ltd. | ||
8 | * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef MEDIA_M5MOLS_H | ||
17 | #define MEDIA_M5MOLS_H | ||
18 | |||
19 | /** | ||
20 | * struct m5mols_platform_data - platform data for M-5MOLS driver | ||
21 | * @irq: GPIO getting the irq pin of M-5MOLS | ||
22 | * @gpio_reset: GPIO driving the reset pin of M-5MOLS | ||
23 | * @reset_polarity: active state for gpio_rst pin, 0 or 1 | ||
24 | * @set_power: an additional callback to the board setup code | ||
25 | * to be called after enabling and before disabling | ||
26 | * the sensor's supply regulators | ||
27 | */ | ||
28 | struct m5mols_platform_data { | ||
29 | int irq; | ||
30 | int gpio_reset; | ||
31 | u8 reset_polarity; | ||
32 | int (*set_power)(struct device *dev, int on); | ||
33 | }; | ||
34 | |||
35 | #endif /* MEDIA_M5MOLS_H */ | ||
diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h new file mode 100644 index 000000000000..5e27f9be6b95 --- /dev/null +++ b/include/media/mt9v032.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _MEDIA_MT9V032_H | ||
2 | #define _MEDIA_MT9V032_H | ||
3 | |||
4 | struct v4l2_subdev; | ||
5 | |||
6 | struct mt9v032_platform_data { | ||
7 | unsigned int clk_pol:1; | ||
8 | |||
9 | void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate); | ||
10 | }; | ||
11 | |||
12 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 2963263f31e2..60536c74c1ea 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
@@ -40,10 +40,12 @@ enum rc_driver_type { | |||
40 | * @driver_name: name of the hardware driver which registered this device | 40 | * @driver_name: name of the hardware driver which registered this device |
41 | * @map_name: name of the default keymap | 41 | * @map_name: name of the default keymap |
42 | * @rc_map: current scan/key table | 42 | * @rc_map: current scan/key table |
43 | * @lock: used to ensure we've filled in all protocol details before | ||
44 | * anyone can call show_protocols or store_protocols | ||
43 | * @devno: unique remote control device number | 45 | * @devno: unique remote control device number |
44 | * @raw: additional data for raw pulse/space devices | 46 | * @raw: additional data for raw pulse/space devices |
45 | * @input_dev: the input child device used to communicate events to userspace | 47 | * @input_dev: the input child device used to communicate events to userspace |
46 | * @driver_type: specifies if protocol decoding is done in hardware or software | 48 | * @driver_type: specifies if protocol decoding is done in hardware or software |
47 | * @idle: used to keep track of RX state | 49 | * @idle: used to keep track of RX state |
48 | * @allowed_protos: bitmask with the supported RC_TYPE_* protocols | 50 | * @allowed_protos: bitmask with the supported RC_TYPE_* protocols |
49 | * @scanmask: some hardware decoders are not capable of providing the full | 51 | * @scanmask: some hardware decoders are not capable of providing the full |
@@ -86,7 +88,8 @@ struct rc_dev { | |||
86 | struct input_id input_id; | 88 | struct input_id input_id; |
87 | char *driver_name; | 89 | char *driver_name; |
88 | const char *map_name; | 90 | const char *map_name; |
89 | struct rc_map rc_map; | 91 | struct rc_map rc_map; |
92 | struct mutex lock; | ||
90 | unsigned long devno; | 93 | unsigned long devno; |
91 | struct ir_raw_event_ctrl *raw; | 94 | struct ir_raw_event_ctrl *raw; |
92 | struct input_dev *input_dev; | 95 | struct input_dev *input_dev; |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 9184751f19c0..4e1409ec2613 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -136,6 +136,7 @@ void rc_map_init(void); | |||
136 | #define RC_MAP_TERRATEC_SLIM "rc-terratec-slim" | 136 | #define RC_MAP_TERRATEC_SLIM "rc-terratec-slim" |
137 | #define RC_MAP_TERRATEC_SLIM_2 "rc-terratec-slim-2" | 137 | #define RC_MAP_TERRATEC_SLIM_2 "rc-terratec-slim-2" |
138 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" | 138 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" |
139 | #define RC_MAP_TIVO "rc-tivo" | ||
139 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" | 140 | #define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand" |
140 | #define RC_MAP_TREKSTOR "rc-trekstor" | 141 | #define RC_MAP_TREKSTOR "rc-trekstor" |
141 | #define RC_MAP_TT_1500 "rc-tt-1500" | 142 | #define RC_MAP_TT_1500 "rc-tt-1500" |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index f80b5372baf3..238bd334fd83 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -80,6 +80,11 @@ struct soc_camera_host_ops { | |||
80 | int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *); | 80 | int (*cropcap)(struct soc_camera_device *, struct v4l2_cropcap *); |
81 | int (*get_crop)(struct soc_camera_device *, struct v4l2_crop *); | 81 | int (*get_crop)(struct soc_camera_device *, struct v4l2_crop *); |
82 | int (*set_crop)(struct soc_camera_device *, struct v4l2_crop *); | 82 | int (*set_crop)(struct soc_camera_device *, struct v4l2_crop *); |
83 | /* | ||
84 | * The difference to .set_crop() is, that .set_livecrop is not allowed | ||
85 | * to change the output sizes | ||
86 | */ | ||
87 | int (*set_livecrop)(struct soc_camera_device *, struct v4l2_crop *); | ||
83 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); | 88 | int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *); |
84 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); | 89 | int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); |
85 | void (*init_videobuf)(struct videobuf_queue *, | 90 | void (*init_videobuf)(struct videobuf_queue *, |
@@ -104,6 +109,12 @@ struct soc_camera_host_ops { | |||
104 | #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) | 109 | #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) |
105 | #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) | 110 | #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) |
106 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) | 111 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) |
112 | #define SOCAM_MIPI_1LANE (1 << 5) | ||
113 | #define SOCAM_MIPI_2LANE (1 << 6) | ||
114 | #define SOCAM_MIPI_3LANE (1 << 7) | ||
115 | #define SOCAM_MIPI_4LANE (1 << 8) | ||
116 | #define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ | ||
117 | SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) | ||
107 | 118 | ||
108 | struct i2c_board_info; | 119 | struct i2c_board_info; |
109 | struct regulator_bulk_data; | 120 | struct regulator_bulk_data; |
@@ -268,6 +279,7 @@ static inline unsigned long soc_camera_bus_param_compatible( | |||
268 | unsigned long camera_flags, unsigned long bus_flags) | 279 | unsigned long camera_flags, unsigned long bus_flags) |
269 | { | 280 | { |
270 | unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode; | 281 | unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode; |
282 | unsigned long mipi; | ||
271 | 283 | ||
272 | common_flags = camera_flags & bus_flags; | 284 | common_flags = camera_flags & bus_flags; |
273 | 285 | ||
@@ -277,8 +289,9 @@ static inline unsigned long soc_camera_bus_param_compatible( | |||
277 | data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); | 289 | data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW); |
278 | mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE); | 290 | mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE); |
279 | buswidth = common_flags & SOCAM_DATAWIDTH_MASK; | 291 | buswidth = common_flags & SOCAM_DATAWIDTH_MASK; |
292 | mipi = common_flags & SOCAM_MIPI; | ||
280 | 293 | ||
281 | return (!hsync || !vsync || !pclk || !data || !mode || !buswidth) ? 0 : | 294 | return ((!hsync || !vsync || !pclk || !data || !mode || !buswidth) && !mipi) ? 0 : |
282 | common_flags; | 295 | common_flags; |
283 | } | 296 | } |
284 | 297 | ||
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 0ecefe227b76..6d7a4fd00fc0 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -25,4 +25,54 @@ struct soc_camera_platform_info { | |||
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static inline void soc_camera_platform_release(struct platform_device **pdev) | ||
29 | { | ||
30 | *pdev = NULL; | ||
31 | } | ||
32 | |||
33 | static inline int soc_camera_platform_add(const struct soc_camera_link *icl, | ||
34 | struct device *dev, | ||
35 | struct platform_device **pdev, | ||
36 | struct soc_camera_link *plink, | ||
37 | void (*release)(struct device *dev), | ||
38 | int id) | ||
39 | { | ||
40 | struct soc_camera_platform_info *info = plink->priv; | ||
41 | int ret; | ||
42 | |||
43 | if (icl != plink) | ||
44 | return -ENODEV; | ||
45 | |||
46 | if (*pdev) | ||
47 | return -EBUSY; | ||
48 | |||
49 | *pdev = platform_device_alloc("soc_camera_platform", id); | ||
50 | if (!*pdev) | ||
51 | return -ENOMEM; | ||
52 | |||
53 | info->dev = dev; | ||
54 | |||
55 | (*pdev)->dev.platform_data = info; | ||
56 | (*pdev)->dev.release = release; | ||
57 | |||
58 | ret = platform_device_add(*pdev); | ||
59 | if (ret < 0) { | ||
60 | platform_device_put(*pdev); | ||
61 | *pdev = NULL; | ||
62 | info->dev = NULL; | ||
63 | } | ||
64 | |||
65 | return ret; | ||
66 | } | ||
67 | |||
68 | static inline void soc_camera_platform_del(const struct soc_camera_link *icl, | ||
69 | struct platform_device *pdev, | ||
70 | const struct soc_camera_link *plink) | ||
71 | { | ||
72 | if (icl != plink || !pdev) | ||
73 | return; | ||
74 | |||
75 | platform_device_unregister(pdev); | ||
76 | } | ||
77 | |||
28 | #endif /* __SOC_CAMERA_H__ */ | 78 | #endif /* __SOC_CAMERA_H__ */ |
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index b338108ec305..fae432544b41 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h | |||
@@ -16,18 +16,24 @@ | |||
16 | 16 | ||
17 | /** | 17 | /** |
18 | * enum soc_mbus_packing - data packing types on the media-bus | 18 | * enum soc_mbus_packing - data packing types on the media-bus |
19 | * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM | 19 | * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM, one |
20 | * sample represents one pixel | ||
20 | * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the | 21 | * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the |
21 | * possibly incomplete byte high bits are padding | 22 | * possibly incomplete byte high bits are padding |
22 | * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding | 23 | * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding |
23 | * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended | 24 | * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended |
24 | * to 16 bits | 25 | * to 16 bits |
26 | * @SOC_MBUS_PACKING_VARIABLE: compressed formats with variable packing | ||
27 | * @SOC_MBUS_PACKING_1_5X8: used for packed YUV 4:2:0 formats, where 4 | ||
28 | * pixels occupy 6 bytes in RAM | ||
25 | */ | 29 | */ |
26 | enum soc_mbus_packing { | 30 | enum soc_mbus_packing { |
27 | SOC_MBUS_PACKING_NONE, | 31 | SOC_MBUS_PACKING_NONE, |
28 | SOC_MBUS_PACKING_2X8_PADHI, | 32 | SOC_MBUS_PACKING_2X8_PADHI, |
29 | SOC_MBUS_PACKING_2X8_PADLO, | 33 | SOC_MBUS_PACKING_2X8_PADLO, |
30 | SOC_MBUS_PACKING_EXTEND16, | 34 | SOC_MBUS_PACKING_EXTEND16, |
35 | SOC_MBUS_PACKING_VARIABLE, | ||
36 | SOC_MBUS_PACKING_1_5X8, | ||
31 | }; | 37 | }; |
32 | 38 | ||
33 | /** | 39 | /** |
@@ -57,9 +63,24 @@ struct soc_mbus_pixelfmt { | |||
57 | u8 bits_per_sample; | 63 | u8 bits_per_sample; |
58 | }; | 64 | }; |
59 | 65 | ||
66 | /** | ||
67 | * struct soc_mbus_lookup - Lookup FOURCC IDs by mediabus codes for pass-through | ||
68 | * @code: mediabus pixel-code | ||
69 | * @fmt: pixel format description | ||
70 | */ | ||
71 | struct soc_mbus_lookup { | ||
72 | enum v4l2_mbus_pixelcode code; | ||
73 | struct soc_mbus_pixelfmt fmt; | ||
74 | }; | ||
75 | |||
76 | const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( | ||
77 | enum v4l2_mbus_pixelcode code, | ||
78 | const struct soc_mbus_lookup *lookup, | ||
79 | int n); | ||
60 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( | 80 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( |
61 | enum v4l2_mbus_pixelcode code); | 81 | enum v4l2_mbus_pixelcode code); |
62 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); | 82 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); |
63 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf); | 83 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, |
84 | unsigned int *numerator, unsigned int *denominator); | ||
64 | 85 | ||
65 | #endif | 86 | #endif |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 8266d5ade2ff..c7c40f1d2624 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -62,6 +62,8 @@ struct v4l2_file_operations { | |||
62 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 62 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
63 | long (*ioctl) (struct file *, unsigned int, unsigned long); | 63 | long (*ioctl) (struct file *, unsigned int, unsigned long); |
64 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 64 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
65 | unsigned long (*get_unmapped_area) (struct file *, unsigned long, | ||
66 | unsigned long, unsigned long, unsigned long); | ||
65 | int (*mmap) (struct file *, struct vm_area_struct *); | 67 | int (*mmap) (struct file *, struct vm_area_struct *); |
66 | int (*open) (struct file *); | 68 | int (*open) (struct file *); |
67 | int (*release) (struct file *); | 69 | int (*release) (struct file *); |
@@ -126,8 +128,8 @@ struct video_device | |||
126 | struct mutex *lock; | 128 | struct mutex *lock; |
127 | }; | 129 | }; |
128 | 130 | ||
129 | #define media_entity_to_video_device(entity) \ | 131 | #define media_entity_to_video_device(__e) \ |
130 | container_of(entity, struct video_device, entity) | 132 | container_of(__e, struct video_device, entity) |
131 | /* dev to video-device */ | 133 | /* dev to video-device */ |
132 | #define to_video_device(cd) container_of(cd, struct video_device, dev) | 134 | #define to_video_device(cd) container_of(cd, struct video_device, dev) |
133 | 135 | ||
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h index 07cf4b9d0a65..bf365721d6b0 100644 --- a/include/media/videobuf-dvb.h +++ b/include/media/videobuf-dvb.h | |||
@@ -4,6 +4,9 @@ | |||
4 | #include <dvb_net.h> | 4 | #include <dvb_net.h> |
5 | #include <dvb_frontend.h> | 5 | #include <dvb_frontend.h> |
6 | 6 | ||
7 | #ifndef _VIDEOBUF_DVB_H_ | ||
8 | #define _VIDEOBUF_DVB_H_ | ||
9 | |||
7 | struct videobuf_dvb { | 10 | struct videobuf_dvb { |
8 | /* filling that the job of the driver */ | 11 | /* filling that the job of the driver */ |
9 | char *name; | 12 | char *name; |
@@ -54,6 +57,7 @@ void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f); | |||
54 | struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id); | 57 | struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id); |
55 | int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); | 58 | int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); |
56 | 59 | ||
60 | #endif /* _VIDEOBUF_DVB_H_ */ | ||
57 | 61 | ||
58 | /* | 62 | /* |
59 | * Local variables: | 63 | * Local variables: |
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index c0d47ad4b103..3c4109777aff 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h | |||
@@ -131,7 +131,7 @@ | |||
131 | * ~~~~~~~~~~~~~~~~~~~~~~~~~ | 131 | * ~~~~~~~~~~~~~~~~~~~~~~~~~ |
132 | * | 132 | * |
133 | * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be | 133 | * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be |
134 | * used. A pointer to a &struct ubi_set_prop_req object is expected to be | 134 | * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be |
135 | * passed. The object describes which property should be set, and to which value | 135 | * passed. The object describes which property should be set, and to which value |
136 | * it should be set. | 136 | * it should be set. |
137 | */ | 137 | */ |
@@ -186,7 +186,8 @@ | |||
186 | /* Check if LEB is mapped command */ | 186 | /* Check if LEB is mapped command */ |
187 | #define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) | 187 | #define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) |
188 | /* Set an UBI volume property */ | 188 | /* Set an UBI volume property */ |
189 | #define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req) | 189 | #define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \ |
190 | struct ubi_set_vol_prop_req) | ||
190 | 191 | ||
191 | /* Maximum MTD device name length supported by UBI */ | 192 | /* Maximum MTD device name length supported by UBI */ |
192 | #define MAX_UBI_MTD_NAME_LEN 127 | 193 | #define MAX_UBI_MTD_NAME_LEN 127 |
@@ -223,13 +224,14 @@ enum { | |||
223 | }; | 224 | }; |
224 | 225 | ||
225 | /* | 226 | /* |
226 | * UBI set property ioctl constants | 227 | * UBI set volume property ioctl constants. |
227 | * | 228 | * |
228 | * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and | 229 | * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0) |
229 | * erase individual eraseblocks on dynamic volumes | 230 | * user to directly write and erase individual |
231 | * eraseblocks on dynamic volumes | ||
230 | */ | 232 | */ |
231 | enum { | 233 | enum { |
232 | UBI_PROP_DIRECT_WRITE = 1, | 234 | UBI_VOL_PROP_DIRECT_WRITE = 1, |
233 | }; | 235 | }; |
234 | 236 | ||
235 | /** | 237 | /** |
@@ -308,7 +310,7 @@ struct ubi_mkvol_req { | |||
308 | __s16 name_len; | 310 | __s16 name_len; |
309 | __s8 padding2[4]; | 311 | __s8 padding2[4]; |
310 | char name[UBI_MAX_VOLUME_NAME + 1]; | 312 | char name[UBI_MAX_VOLUME_NAME + 1]; |
311 | } __attribute__ ((packed)); | 313 | } __packed; |
312 | 314 | ||
313 | /** | 315 | /** |
314 | * struct ubi_rsvol_req - a data structure used in volume re-size requests. | 316 | * struct ubi_rsvol_req - a data structure used in volume re-size requests. |
@@ -324,7 +326,7 @@ struct ubi_mkvol_req { | |||
324 | struct ubi_rsvol_req { | 326 | struct ubi_rsvol_req { |
325 | __s64 bytes; | 327 | __s64 bytes; |
326 | __s32 vol_id; | 328 | __s32 vol_id; |
327 | } __attribute__ ((packed)); | 329 | } __packed; |
328 | 330 | ||
329 | /** | 331 | /** |
330 | * struct ubi_rnvol_req - volumes re-name request. | 332 | * struct ubi_rnvol_req - volumes re-name request. |
@@ -366,7 +368,7 @@ struct ubi_rnvol_req { | |||
366 | __s8 padding2[2]; | 368 | __s8 padding2[2]; |
367 | char name[UBI_MAX_VOLUME_NAME + 1]; | 369 | char name[UBI_MAX_VOLUME_NAME + 1]; |
368 | } ents[UBI_MAX_RNVOL]; | 370 | } ents[UBI_MAX_RNVOL]; |
369 | } __attribute__ ((packed)); | 371 | } __packed; |
370 | 372 | ||
371 | /** | 373 | /** |
372 | * struct ubi_leb_change_req - a data structure used in atomic LEB change | 374 | * struct ubi_leb_change_req - a data structure used in atomic LEB change |
@@ -381,7 +383,7 @@ struct ubi_leb_change_req { | |||
381 | __s32 bytes; | 383 | __s32 bytes; |
382 | __s8 dtype; | 384 | __s8 dtype; |
383 | __s8 padding[7]; | 385 | __s8 padding[7]; |
384 | } __attribute__ ((packed)); | 386 | } __packed; |
385 | 387 | ||
386 | /** | 388 | /** |
387 | * struct ubi_map_req - a data structure used in map LEB requests. | 389 | * struct ubi_map_req - a data structure used in map LEB requests. |
@@ -393,20 +395,20 @@ struct ubi_map_req { | |||
393 | __s32 lnum; | 395 | __s32 lnum; |
394 | __s8 dtype; | 396 | __s8 dtype; |
395 | __s8 padding[3]; | 397 | __s8 padding[3]; |
396 | } __attribute__ ((packed)); | 398 | } __packed; |
397 | 399 | ||
398 | 400 | ||
399 | /** | 401 | /** |
400 | * struct ubi_set_prop_req - a data structure used to set an ubi volume | 402 | * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume |
401 | * property. | 403 | * property. |
402 | * @property: property to set (%UBI_PROP_DIRECT_WRITE) | 404 | * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE) |
403 | * @padding: reserved for future, not used, has to be zeroed | 405 | * @padding: reserved for future, not used, has to be zeroed |
404 | * @value: value to set | 406 | * @value: value to set |
405 | */ | 407 | */ |
406 | struct ubi_set_prop_req { | 408 | struct ubi_set_vol_prop_req { |
407 | __u8 property; | 409 | __u8 property; |
408 | __u8 padding[7]; | 410 | __u8 padding[7]; |
409 | __u64 value; | 411 | __u64 value; |
410 | } __attribute__ ((packed)); | 412 | } __packed; |
411 | 413 | ||
412 | #endif /* __UBI_USER_H__ */ | 414 | #endif /* __UBI_USER_H__ */ |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index d2df55b0c213..008711e8e78f 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -241,10 +241,10 @@ enum p9_open_mode_t { | |||
241 | 241 | ||
242 | /** | 242 | /** |
243 | * enum p9_perm_t - 9P permissions | 243 | * enum p9_perm_t - 9P permissions |
244 | * @P9_DMDIR: mode bite for directories | 244 | * @P9_DMDIR: mode bit for directories |
245 | * @P9_DMAPPEND: mode bit for is append-only | 245 | * @P9_DMAPPEND: mode bit for is append-only |
246 | * @P9_DMEXCL: mode bit for excluse use (only one open handle allowed) | 246 | * @P9_DMEXCL: mode bit for excluse use (only one open handle allowed) |
247 | * @P9_DMMOUNT: mode bite for mount points | 247 | * @P9_DMMOUNT: mode bit for mount points |
248 | * @P9_DMAUTH: mode bit for authentication file | 248 | * @P9_DMAUTH: mode bit for authentication file |
249 | * @P9_DMTMP: mode bit for non-backed-up files | 249 | * @P9_DMTMP: mode bit for non-backed-up files |
250 | * @P9_DMSYMLINK: mode bit for symbolic links (9P2000.u) | 250 | * @P9_DMSYMLINK: mode bit for symbolic links (9P2000.u) |
@@ -362,7 +362,7 @@ struct p9_qid { | |||
362 | }; | 362 | }; |
363 | 363 | ||
364 | /** | 364 | /** |
365 | * struct p9_stat - file system metadata information | 365 | * struct p9_wstat - file system metadata information |
366 | * @size: length prefix for this stat structure instance | 366 | * @size: length prefix for this stat structure instance |
367 | * @type: the type of the server (equivalent to a major number) | 367 | * @type: the type of the server (equivalent to a major number) |
368 | * @dev: the sub-type of the server (equivalent to a minor number) | 368 | * @dev: the sub-type of the server (equivalent to a minor number) |
@@ -687,10 +687,10 @@ struct p9_rwstat { | |||
687 | * @size: prefixed length of the structure | 687 | * @size: prefixed length of the structure |
688 | * @id: protocol operating identifier of type &p9_msg_t | 688 | * @id: protocol operating identifier of type &p9_msg_t |
689 | * @tag: transaction id of the request | 689 | * @tag: transaction id of the request |
690 | * @offset: used by marshalling routines to track currentposition in buffer | 690 | * @offset: used by marshalling routines to track current position in buffer |
691 | * @capacity: used by marshalling routines to track total malloc'd capacity | 691 | * @capacity: used by marshalling routines to track total malloc'd capacity |
692 | * @pubuf: Payload user buffer given by the caller | 692 | * @pubuf: Payload user buffer given by the caller |
693 | * @pubuf: Payload kernel buffer given by the caller | 693 | * @pkbuf: Payload kernel buffer given by the caller |
694 | * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write. | 694 | * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write. |
695 | * @private: For transport layer's use. | 695 | * @private: For transport layer's use. |
696 | * @sdata: payload | 696 | * @sdata: payload |
@@ -714,7 +714,7 @@ struct p9_fcall { | |||
714 | size_t pbuf_size; | 714 | size_t pbuf_size; |
715 | void *private; | 715 | void *private; |
716 | 716 | ||
717 | uint8_t *sdata; | 717 | u8 *sdata; |
718 | }; | 718 | }; |
719 | 719 | ||
720 | struct p9_idpool; | 720 | struct p9_idpool; |
@@ -728,7 +728,6 @@ void p9_idpool_put(int id, struct p9_idpool *p); | |||
728 | int p9_idpool_check(int id, struct p9_idpool *p); | 728 | int p9_idpool_check(int id, struct p9_idpool *p); |
729 | 729 | ||
730 | int p9_error_init(void); | 730 | int p9_error_init(void); |
731 | int p9_errstr2errno(char *, int); | ||
732 | int p9_trans_fd_init(void); | 731 | int p9_trans_fd_init(void); |
733 | void p9_trans_fd_exit(void); | 732 | void p9_trans_fd_exit(void); |
734 | #endif /* NET_9P_H */ | 733 | #endif /* NET_9P_H */ |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 051a99f79769..d26d5e98a173 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -60,7 +60,7 @@ enum p9_trans_status { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /** | 62 | /** |
63 | * enum p9_req_status_t - virtio request status | 63 | * enum p9_req_status_t - status of a request |
64 | * @REQ_STATUS_IDLE: request slot unused | 64 | * @REQ_STATUS_IDLE: request slot unused |
65 | * @REQ_STATUS_ALLOC: request has been allocated but not sent | 65 | * @REQ_STATUS_ALLOC: request has been allocated but not sent |
66 | * @REQ_STATUS_UNSENT: request waiting to be sent | 66 | * @REQ_STATUS_UNSENT: request waiting to be sent |
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h index 8f08c736c4c3..d8549fb9c742 100644 --- a/include/net/9p/transport.h +++ b/include/net/9p/transport.h | |||
@@ -41,6 +41,7 @@ | |||
41 | * @pref: Preferences of this transport | 41 | * @pref: Preferences of this transport |
42 | * @def: set if this transport should be considered the default | 42 | * @def: set if this transport should be considered the default |
43 | * @create: member function to create a new connection on this transport | 43 | * @create: member function to create a new connection on this transport |
44 | * @close: member function to discard a connection on this transport | ||
44 | * @request: member function to issue a request to the transport | 45 | * @request: member function to issue a request to the transport |
45 | * @cancel: member function to cancel a request (if it hasn't been sent) | 46 | * @cancel: member function to cancel a request (if it hasn't been sent) |
46 | * | 47 | * |
@@ -48,7 +49,7 @@ | |||
48 | * transport module with the 9P core network module and used by the client | 49 | * transport module with the 9P core network module and used by the client |
49 | * to instantiate a new connection on a transport. | 50 | * to instantiate a new connection on a transport. |
50 | * | 51 | * |
51 | * BUGS: the transport module list isn't protected. | 52 | * The transport module list is protected by v9fs_trans_lock. |
52 | */ | 53 | */ |
53 | 54 | ||
54 | struct p9_trans_module { | 55 | struct p9_trans_module { |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 23710aa6a181..582e4ae70753 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -42,8 +42,6 @@ struct prefix_info { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | 44 | ||
45 | #ifdef __KERNEL__ | ||
46 | |||
47 | #include <linux/netdevice.h> | 45 | #include <linux/netdevice.h> |
48 | #include <net/if_inet6.h> | 46 | #include <net/if_inet6.h> |
49 | #include <net/ipv6.h> | 47 | #include <net/ipv6.h> |
@@ -61,16 +59,16 @@ extern int addrconf_set_dstaddr(struct net *net, | |||
61 | void __user *arg); | 59 | void __user *arg); |
62 | 60 | ||
63 | extern int ipv6_chk_addr(struct net *net, | 61 | extern int ipv6_chk_addr(struct net *net, |
64 | struct in6_addr *addr, | 62 | const struct in6_addr *addr, |
65 | struct net_device *dev, | 63 | struct net_device *dev, |
66 | int strict); | 64 | int strict); |
67 | 65 | ||
68 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 66 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
69 | extern int ipv6_chk_home_addr(struct net *net, | 67 | extern int ipv6_chk_home_addr(struct net *net, |
70 | struct in6_addr *addr); | 68 | const struct in6_addr *addr); |
71 | #endif | 69 | #endif |
72 | 70 | ||
73 | extern int ipv6_chk_prefix(struct in6_addr *addr, | 71 | extern int ipv6_chk_prefix(const struct in6_addr *addr, |
74 | struct net_device *dev); | 72 | struct net_device *dev); |
75 | 73 | ||
76 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, | 74 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, |
@@ -89,9 +87,9 @@ extern int ipv6_get_lladdr(struct net_device *dev, | |||
89 | extern int ipv6_rcv_saddr_equal(const struct sock *sk, | 87 | extern int ipv6_rcv_saddr_equal(const struct sock *sk, |
90 | const struct sock *sk2); | 88 | const struct sock *sk2); |
91 | extern void addrconf_join_solict(struct net_device *dev, | 89 | extern void addrconf_join_solict(struct net_device *dev, |
92 | struct in6_addr *addr); | 90 | const struct in6_addr *addr); |
93 | extern void addrconf_leave_solict(struct inet6_dev *idev, | 91 | extern void addrconf_leave_solict(struct inet6_dev *idev, |
94 | struct in6_addr *addr); | 92 | const struct in6_addr *addr); |
95 | 93 | ||
96 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, | 94 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, |
97 | unsigned unit) | 95 | unsigned unit) |
@@ -158,15 +156,15 @@ extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); | |||
158 | /* | 156 | /* |
159 | * anycast prototypes (anycast.c) | 157 | * anycast prototypes (anycast.c) |
160 | */ | 158 | */ |
161 | extern int ipv6_sock_ac_join(struct sock *sk,int ifindex,struct in6_addr *addr); | 159 | extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); |
162 | extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex,struct in6_addr *addr); | 160 | extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); |
163 | extern void ipv6_sock_ac_close(struct sock *sk); | 161 | extern void ipv6_sock_ac_close(struct sock *sk); |
164 | extern int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex); | 162 | extern int inet6_ac_check(struct sock *sk, const struct in6_addr *addr, int ifindex); |
165 | 163 | ||
166 | extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); | 164 | extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); |
167 | extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr); | 165 | extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
168 | extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | 166 | extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev, |
169 | struct in6_addr *addr); | 167 | const struct in6_addr *addr); |
170 | 168 | ||
171 | 169 | ||
172 | /* Device notifier */ | 170 | /* Device notifier */ |
@@ -285,4 +283,3 @@ extern void if6_proc_exit(void); | |||
285 | #endif | 283 | #endif |
286 | 284 | ||
287 | #endif | 285 | #endif |
288 | #endif | ||
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h index 00c2eaa07c25..03e6e9453623 100644 --- a/include/net/af_rxrpc.h +++ b/include/net/af_rxrpc.h | |||
@@ -12,8 +12,6 @@ | |||
12 | #ifndef _NET_RXRPC_H | 12 | #ifndef _NET_RXRPC_H |
13 | #define _NET_RXRPC_H | 13 | #define _NET_RXRPC_H |
14 | 14 | ||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #include <linux/rxrpc.h> | 15 | #include <linux/rxrpc.h> |
18 | 16 | ||
19 | struct rxrpc_call; | 17 | struct rxrpc_call; |
@@ -53,5 +51,4 @@ extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, | |||
53 | unsigned long); | 51 | unsigned long); |
54 | extern int rxrpc_kernel_reject_call(struct socket *); | 52 | extern int rxrpc_kernel_reject_call(struct socket *); |
55 | 53 | ||
56 | #endif /* __KERNEL__ */ | ||
57 | #endif /* _NET_RXRPC_H */ | 54 | #endif /* _NET_RXRPC_H */ |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 18e5c3f67580..91ab5b01678a 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -41,7 +41,6 @@ struct unix_skb_parms { | |||
41 | spin_lock_nested(&unix_sk(s)->lock, \ | 41 | spin_lock_nested(&unix_sk(s)->lock, \ |
42 | SINGLE_DEPTH_NESTING) | 42 | SINGLE_DEPTH_NESTING) |
43 | 43 | ||
44 | #ifdef __KERNEL__ | ||
45 | /* The AF_UNIX socket */ | 44 | /* The AF_UNIX socket */ |
46 | struct unix_sock { | 45 | struct unix_sock { |
47 | /* WARNING: sk has to be the first member */ | 46 | /* WARNING: sk has to be the first member */ |
@@ -72,4 +71,3 @@ static inline int unix_sysctl_register(struct net *net) { return 0; } | |||
72 | static inline void unix_sysctl_unregister(struct net *net) {} | 71 | static inline void unix_sysctl_unregister(struct net *net) {} |
73 | #endif | 72 | #endif |
74 | #endif | 73 | #endif |
75 | #endif | ||
diff --git a/include/net/atmclip.h b/include/net/atmclip.h index 467c531b8a7e..497ef6444a7a 100644 --- a/include/net/atmclip.h +++ b/include/net/atmclip.h | |||
@@ -54,8 +54,6 @@ struct clip_priv { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | 56 | ||
57 | #ifdef __KERNEL__ | ||
58 | extern struct neigh_table *clip_tbl_hook; | 57 | extern struct neigh_table *clip_tbl_hook; |
59 | #endif | ||
60 | 58 | ||
61 | #endif | 59 | #endif |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 2c0d309c7381..0c20227e57f6 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -246,6 +246,15 @@ enum { | |||
246 | #define HCI_AT_GENERAL_BONDING 0x04 | 246 | #define HCI_AT_GENERAL_BONDING 0x04 |
247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | 247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
248 | 248 | ||
249 | /* Link Key types */ | ||
250 | #define HCI_LK_COMBINATION 0x00 | ||
251 | #define HCI_LK_LOCAL_UNIT 0x01 | ||
252 | #define HCI_LK_REMOTE_UNIT 0x02 | ||
253 | #define HCI_LK_DEBUG_COMBINATION 0x03 | ||
254 | #define HCI_LK_UNAUTH_COMBINATION 0x04 | ||
255 | #define HCI_LK_AUTH_COMBINATION 0x05 | ||
256 | #define HCI_LK_CHANGED_COMBINATION 0x06 | ||
257 | |||
249 | /* ----- HCI Commands ---- */ | 258 | /* ----- HCI Commands ---- */ |
250 | #define HCI_OP_NOP 0x0000 | 259 | #define HCI_OP_NOP 0x0000 |
251 | 260 | ||
@@ -428,6 +437,18 @@ struct hci_rp_user_confirm_reply { | |||
428 | 437 | ||
429 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d | 438 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d |
430 | 439 | ||
440 | #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 | ||
441 | struct hci_cp_remote_oob_data_reply { | ||
442 | bdaddr_t bdaddr; | ||
443 | __u8 hash[16]; | ||
444 | __u8 randomizer[16]; | ||
445 | } __packed; | ||
446 | |||
447 | #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 | ||
448 | struct hci_cp_remote_oob_data_neg_reply { | ||
449 | bdaddr_t bdaddr; | ||
450 | } __packed; | ||
451 | |||
431 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 | 452 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 |
432 | struct hci_cp_io_capability_neg_reply { | 453 | struct hci_cp_io_capability_neg_reply { |
433 | bdaddr_t bdaddr; | 454 | bdaddr_t bdaddr; |
@@ -537,15 +558,17 @@ struct hci_cp_delete_stored_link_key { | |||
537 | __u8 delete_all; | 558 | __u8 delete_all; |
538 | } __packed; | 559 | } __packed; |
539 | 560 | ||
561 | #define HCI_MAX_NAME_LENGTH 248 | ||
562 | |||
540 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 563 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
541 | struct hci_cp_write_local_name { | 564 | struct hci_cp_write_local_name { |
542 | __u8 name[248]; | 565 | __u8 name[HCI_MAX_NAME_LENGTH]; |
543 | } __packed; | 566 | } __packed; |
544 | 567 | ||
545 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 | 568 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 |
546 | struct hci_rp_read_local_name { | 569 | struct hci_rp_read_local_name { |
547 | __u8 status; | 570 | __u8 status; |
548 | __u8 name[248]; | 571 | __u8 name[HCI_MAX_NAME_LENGTH]; |
549 | } __packed; | 572 | } __packed; |
550 | 573 | ||
551 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 | 574 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 |
@@ -602,6 +625,14 @@ struct hci_cp_host_buffer_size { | |||
602 | 625 | ||
603 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 | 626 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 |
604 | 627 | ||
628 | #define HCI_MAX_EIR_LENGTH 240 | ||
629 | |||
630 | #define HCI_OP_WRITE_EIR 0x0c52 | ||
631 | struct hci_cp_write_eir { | ||
632 | uint8_t fec; | ||
633 | uint8_t data[HCI_MAX_EIR_LENGTH]; | ||
634 | } __packed; | ||
635 | |||
605 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 636 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
606 | struct hci_rp_read_ssp_mode { | 637 | struct hci_rp_read_ssp_mode { |
607 | __u8 status; | 638 | __u8 status; |
@@ -613,6 +644,13 @@ struct hci_cp_write_ssp_mode { | |||
613 | __u8 mode; | 644 | __u8 mode; |
614 | } __packed; | 645 | } __packed; |
615 | 646 | ||
647 | #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 | ||
648 | struct hci_rp_read_local_oob_data { | ||
649 | __u8 status; | ||
650 | __u8 hash[16]; | ||
651 | __u8 randomizer[16]; | ||
652 | } __packed; | ||
653 | |||
616 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | 654 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
617 | 655 | ||
618 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 656 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
@@ -747,7 +785,7 @@ struct hci_ev_auth_complete { | |||
747 | struct hci_ev_remote_name { | 785 | struct hci_ev_remote_name { |
748 | __u8 status; | 786 | __u8 status; |
749 | bdaddr_t bdaddr; | 787 | bdaddr_t bdaddr; |
750 | __u8 name[248]; | 788 | __u8 name[HCI_MAX_NAME_LENGTH]; |
751 | } __packed; | 789 | } __packed; |
752 | 790 | ||
753 | #define HCI_EV_ENCRYPT_CHANGE 0x08 | 791 | #define HCI_EV_ENCRYPT_CHANGE 0x08 |
@@ -955,6 +993,11 @@ struct hci_ev_user_confirm_req { | |||
955 | __le32 passkey; | 993 | __le32 passkey; |
956 | } __packed; | 994 | } __packed; |
957 | 995 | ||
996 | #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 | ||
997 | struct hci_ev_remote_oob_data_request { | ||
998 | bdaddr_t bdaddr; | ||
999 | } __packed; | ||
1000 | |||
958 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 1001 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
959 | struct hci_ev_simple_pair_complete { | 1002 | struct hci_ev_simple_pair_complete { |
960 | __u8 status; | 1003 | __u8 status; |
@@ -1033,7 +1076,6 @@ struct hci_sco_hdr { | |||
1033 | __u8 dlen; | 1076 | __u8 dlen; |
1034 | } __packed; | 1077 | } __packed; |
1035 | 1078 | ||
1036 | #ifdef __KERNEL__ | ||
1037 | #include <linux/skbuff.h> | 1079 | #include <linux/skbuff.h> |
1038 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | 1080 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
1039 | { | 1081 | { |
@@ -1049,7 +1091,6 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
1049 | { | 1091 | { |
1050 | return (struct hci_sco_hdr *) skb->data; | 1092 | return (struct hci_sco_hdr *) skb->data; |
1051 | } | 1093 | } |
1052 | #endif | ||
1053 | 1094 | ||
1054 | /* Command opcode pack/unpack */ | 1095 | /* Command opcode pack/unpack */ |
1055 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1096 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 441dadbf6a89..6c994c004d15 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -82,6 +82,13 @@ struct link_key { | |||
82 | u8 pin_len; | 82 | u8 pin_len; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | struct oob_data { | ||
86 | struct list_head list; | ||
87 | bdaddr_t bdaddr; | ||
88 | u8 hash[16]; | ||
89 | u8 randomizer[16]; | ||
90 | }; | ||
91 | |||
85 | #define NUM_REASSEMBLY 4 | 92 | #define NUM_REASSEMBLY 4 |
86 | struct hci_dev { | 93 | struct hci_dev { |
87 | struct list_head list; | 94 | struct list_head list; |
@@ -94,7 +101,8 @@ struct hci_dev { | |||
94 | __u8 bus; | 101 | __u8 bus; |
95 | __u8 dev_type; | 102 | __u8 dev_type; |
96 | bdaddr_t bdaddr; | 103 | bdaddr_t bdaddr; |
97 | __u8 dev_name[248]; | 104 | __u8 dev_name[HCI_MAX_NAME_LENGTH]; |
105 | __u8 eir[HCI_MAX_EIR_LENGTH]; | ||
98 | __u8 dev_class[3]; | 106 | __u8 dev_class[3]; |
99 | __u8 major_class; | 107 | __u8 major_class; |
100 | __u8 minor_class; | 108 | __u8 minor_class; |
@@ -118,6 +126,8 @@ struct hci_dev { | |||
118 | __u16 sniff_min_interval; | 126 | __u16 sniff_min_interval; |
119 | __u16 sniff_max_interval; | 127 | __u16 sniff_max_interval; |
120 | 128 | ||
129 | unsigned int auto_accept_delay; | ||
130 | |||
121 | unsigned long quirks; | 131 | unsigned long quirks; |
122 | 132 | ||
123 | atomic_t cmd_cnt; | 133 | atomic_t cmd_cnt; |
@@ -169,6 +179,8 @@ struct hci_dev { | |||
169 | 179 | ||
170 | struct list_head link_keys; | 180 | struct list_head link_keys; |
171 | 181 | ||
182 | struct list_head remote_oob_data; | ||
183 | |||
172 | struct hci_dev_stats stat; | 184 | struct hci_dev_stats stat; |
173 | 185 | ||
174 | struct sk_buff_head driver_init; | 186 | struct sk_buff_head driver_init; |
@@ -216,6 +228,7 @@ struct hci_conn { | |||
216 | __u16 pkt_type; | 228 | __u16 pkt_type; |
217 | __u16 link_policy; | 229 | __u16 link_policy; |
218 | __u32 link_mode; | 230 | __u32 link_mode; |
231 | __u8 key_type; | ||
219 | __u8 auth_type; | 232 | __u8 auth_type; |
220 | __u8 sec_level; | 233 | __u8 sec_level; |
221 | __u8 pending_sec_level; | 234 | __u8 pending_sec_level; |
@@ -235,6 +248,7 @@ struct hci_conn { | |||
235 | 248 | ||
236 | struct timer_list disc_timer; | 249 | struct timer_list disc_timer; |
237 | struct timer_list idle_timer; | 250 | struct timer_list idle_timer; |
251 | struct timer_list auto_accept_timer; | ||
238 | 252 | ||
239 | struct work_struct work_add; | 253 | struct work_struct work_add; |
240 | struct work_struct work_del; | 254 | struct work_struct work_del; |
@@ -408,6 +422,7 @@ void hci_conn_check_pending(struct hci_dev *hdev); | |||
408 | 422 | ||
409 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type); | 423 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type); |
410 | int hci_conn_check_link_mode(struct hci_conn *conn); | 424 | int hci_conn_check_link_mode(struct hci_conn *conn); |
425 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); | ||
411 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); | 426 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); |
412 | int hci_conn_change_link_key(struct hci_conn *conn); | 427 | int hci_conn_change_link_key(struct hci_conn *conn); |
413 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); | 428 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); |
@@ -501,10 +516,17 @@ int hci_uuids_clear(struct hci_dev *hdev); | |||
501 | 516 | ||
502 | int hci_link_keys_clear(struct hci_dev *hdev); | 517 | int hci_link_keys_clear(struct hci_dev *hdev); |
503 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 518 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
504 | int hci_add_link_key(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr, | 519 | int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, |
505 | u8 *key, u8 type, u8 pin_len); | 520 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); |
506 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 521 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
507 | 522 | ||
523 | int hci_remote_oob_data_clear(struct hci_dev *hdev); | ||
524 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, | ||
525 | bdaddr_t *bdaddr); | ||
526 | int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | ||
527 | u8 *randomizer); | ||
528 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
529 | |||
508 | void hci_del_off_timer(struct hci_dev *hdev); | 530 | void hci_del_off_timer(struct hci_dev *hdev); |
509 | 531 | ||
510 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 532 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
@@ -754,19 +776,27 @@ int mgmt_index_removed(u16 index); | |||
754 | int mgmt_powered(u16 index, u8 powered); | 776 | int mgmt_powered(u16 index, u8 powered); |
755 | int mgmt_discoverable(u16 index, u8 discoverable); | 777 | int mgmt_discoverable(u16 index, u8 discoverable); |
756 | int mgmt_connectable(u16 index, u8 connectable); | 778 | int mgmt_connectable(u16 index, u8 connectable); |
757 | int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type); | 779 | int mgmt_new_key(u16 index, struct link_key *key, u8 persistent); |
758 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); | 780 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); |
759 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); | 781 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); |
760 | int mgmt_disconnect_failed(u16 index); | 782 | int mgmt_disconnect_failed(u16 index); |
761 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); | 783 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); |
762 | int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr); | 784 | int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr, u8 secure); |
763 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 785 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
764 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 786 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
765 | int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value); | 787 | int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value, |
788 | u8 confirm_hint); | ||
766 | int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 789 | int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
767 | int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, | 790 | int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, |
768 | u8 status); | 791 | u8 status); |
769 | int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status); | 792 | int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status); |
793 | int mgmt_set_local_name_complete(u16 index, u8 *name, u8 status); | ||
794 | int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer, | ||
795 | u8 status); | ||
796 | int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi, | ||
797 | u8 *eir); | ||
798 | int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); | ||
799 | int mgmt_discovering(u16 index, u8 discovering); | ||
770 | 800 | ||
771 | /* HCI info for socket */ | 801 | /* HCI info for socket */ |
772 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 802 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 4f4bff1eaed6..d09c9b1118e3 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -276,63 +276,17 @@ struct l2cap_conn_param_update_rsp { | |||
276 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 | 276 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 |
277 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 | 277 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 |
278 | 278 | ||
279 | /* ----- L2CAP connections ----- */ | 279 | /* ----- L2CAP channels and connections ----- */ |
280 | struct l2cap_chan_list { | ||
281 | struct sock *head; | ||
282 | rwlock_t lock; | ||
283 | long num; | ||
284 | }; | ||
285 | |||
286 | struct l2cap_conn { | ||
287 | struct hci_conn *hcon; | ||
288 | |||
289 | bdaddr_t *dst; | ||
290 | bdaddr_t *src; | ||
291 | |||
292 | unsigned int mtu; | ||
293 | |||
294 | __u32 feat_mask; | ||
295 | |||
296 | __u8 info_state; | ||
297 | __u8 info_ident; | ||
298 | |||
299 | struct timer_list info_timer; | ||
300 | |||
301 | spinlock_t lock; | ||
302 | |||
303 | struct sk_buff *rx_skb; | ||
304 | __u32 rx_len; | ||
305 | __u8 rx_ident; | ||
306 | __u8 tx_ident; | ||
307 | |||
308 | __u8 disc_reason; | ||
309 | |||
310 | struct l2cap_chan_list chan_list; | ||
311 | }; | ||
312 | |||
313 | struct sock_del_list { | ||
314 | struct sock *sk; | ||
315 | struct list_head list; | ||
316 | }; | ||
317 | |||
318 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 | ||
319 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 | ||
320 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 | ||
321 | |||
322 | /* ----- L2CAP channel and socket info ----- */ | ||
323 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | ||
324 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | ||
325 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | ||
326 | #define BUSY_QUEUE(sk) (&l2cap_pi(sk)->busy_queue) | ||
327 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | ||
328 | |||
329 | struct srej_list { | 280 | struct srej_list { |
330 | __u8 tx_seq; | 281 | __u8 tx_seq; |
331 | struct list_head list; | 282 | struct list_head list; |
332 | }; | 283 | }; |
333 | 284 | ||
334 | struct l2cap_pinfo { | 285 | struct l2cap_chan { |
335 | struct bt_sock bt; | 286 | struct sock *sk; |
287 | |||
288 | struct l2cap_conn *conn; | ||
289 | |||
336 | __le16 psm; | 290 | __le16 psm; |
337 | __u16 dcid; | 291 | __u16 dcid; |
338 | __u16 scid; | 292 | __u16 scid; |
@@ -341,17 +295,29 @@ struct l2cap_pinfo { | |||
341 | __u16 omtu; | 295 | __u16 omtu; |
342 | __u16 flush_to; | 296 | __u16 flush_to; |
343 | __u8 mode; | 297 | __u8 mode; |
344 | __u8 num_conf_req; | ||
345 | __u8 num_conf_rsp; | ||
346 | 298 | ||
347 | __u8 fcs; | 299 | __le16 sport; |
300 | |||
348 | __u8 sec_level; | 301 | __u8 sec_level; |
349 | __u8 role_switch; | 302 | __u8 role_switch; |
350 | __u8 force_reliable; | 303 | __u8 force_reliable; |
351 | __u8 flushable; | 304 | __u8 flushable; |
352 | 305 | ||
306 | __u8 ident; | ||
307 | |||
353 | __u8 conf_req[64]; | 308 | __u8 conf_req[64]; |
354 | __u8 conf_len; | 309 | __u8 conf_len; |
310 | __u8 num_conf_req; | ||
311 | __u8 num_conf_rsp; | ||
312 | |||
313 | __u8 fcs; | ||
314 | |||
315 | __u8 tx_win; | ||
316 | __u8 max_tx; | ||
317 | __u16 retrans_timeout; | ||
318 | __u16 monitor_timeout; | ||
319 | __u16 mps; | ||
320 | |||
355 | __u8 conf_state; | 321 | __u8 conf_state; |
356 | __u16 conn_state; | 322 | __u16 conn_state; |
357 | 323 | ||
@@ -369,30 +335,61 @@ struct l2cap_pinfo { | |||
369 | __u16 partial_sdu_len; | 335 | __u16 partial_sdu_len; |
370 | struct sk_buff *sdu; | 336 | struct sk_buff *sdu; |
371 | 337 | ||
372 | __u8 ident; | ||
373 | |||
374 | __u8 tx_win; | ||
375 | __u8 max_tx; | ||
376 | __u8 remote_tx_win; | 338 | __u8 remote_tx_win; |
377 | __u8 remote_max_tx; | 339 | __u8 remote_max_tx; |
378 | __u16 retrans_timeout; | ||
379 | __u16 monitor_timeout; | ||
380 | __u16 remote_mps; | 340 | __u16 remote_mps; |
381 | __u16 mps; | ||
382 | |||
383 | __le16 sport; | ||
384 | 341 | ||
385 | struct timer_list retrans_timer; | 342 | struct timer_list retrans_timer; |
386 | struct timer_list monitor_timer; | 343 | struct timer_list monitor_timer; |
387 | struct timer_list ack_timer; | 344 | struct timer_list ack_timer; |
388 | struct sk_buff_head tx_queue; | 345 | struct sk_buff *tx_send_head; |
389 | struct sk_buff_head srej_queue; | 346 | struct sk_buff_head tx_q; |
390 | struct sk_buff_head busy_queue; | 347 | struct sk_buff_head srej_q; |
348 | struct sk_buff_head busy_q; | ||
391 | struct work_struct busy_work; | 349 | struct work_struct busy_work; |
392 | struct srej_list srej_l; | 350 | struct list_head srej_l; |
393 | struct l2cap_conn *conn; | 351 | |
394 | struct sock *next_c; | 352 | struct list_head list; |
395 | struct sock *prev_c; | 353 | struct list_head global_l; |
354 | }; | ||
355 | |||
356 | struct l2cap_conn { | ||
357 | struct hci_conn *hcon; | ||
358 | |||
359 | bdaddr_t *dst; | ||
360 | bdaddr_t *src; | ||
361 | |||
362 | unsigned int mtu; | ||
363 | |||
364 | __u32 feat_mask; | ||
365 | |||
366 | __u8 info_state; | ||
367 | __u8 info_ident; | ||
368 | |||
369 | struct timer_list info_timer; | ||
370 | |||
371 | spinlock_t lock; | ||
372 | |||
373 | struct sk_buff *rx_skb; | ||
374 | __u32 rx_len; | ||
375 | __u8 tx_ident; | ||
376 | |||
377 | __u8 disc_reason; | ||
378 | |||
379 | struct list_head chan_l; | ||
380 | rwlock_t chan_lock; | ||
381 | }; | ||
382 | |||
383 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 | ||
384 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 | ||
385 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 | ||
386 | |||
387 | /* ----- L2CAP socket info ----- */ | ||
388 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | ||
389 | |||
390 | struct l2cap_pinfo { | ||
391 | struct bt_sock bt; | ||
392 | struct l2cap_chan *chan; | ||
396 | }; | 393 | }; |
397 | 394 | ||
398 | #define L2CAP_CONF_REQ_SENT 0x01 | 395 | #define L2CAP_CONF_REQ_SENT 0x01 |
@@ -419,24 +416,23 @@ struct l2cap_pinfo { | |||
419 | #define L2CAP_CONN_RNR_SENT 0x0200 | 416 | #define L2CAP_CONN_RNR_SENT 0x0200 |
420 | #define L2CAP_CONN_SAR_RETRY 0x0400 | 417 | #define L2CAP_CONN_SAR_RETRY 0x0400 |
421 | 418 | ||
422 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 419 | #define __mod_retrans_timer() mod_timer(&chan->retrans_timer, \ |
423 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | 420 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); |
424 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ | 421 | #define __mod_monitor_timer() mod_timer(&chan->monitor_timer, \ |
425 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | 422 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); |
426 | #define __mod_ack_timer() mod_timer(&l2cap_pi(sk)->ack_timer, \ | 423 | #define __mod_ack_timer() mod_timer(&chan->ack_timer, \ |
427 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | 424 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); |
428 | 425 | ||
429 | static inline int l2cap_tx_window_full(struct sock *sk) | 426 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) |
430 | { | 427 | { |
431 | struct l2cap_pinfo *pi = l2cap_pi(sk); | ||
432 | int sub; | 428 | int sub; |
433 | 429 | ||
434 | sub = (pi->next_tx_seq - pi->expected_ack_seq) % 64; | 430 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; |
435 | 431 | ||
436 | if (sub < 0) | 432 | if (sub < 0) |
437 | sub += 64; | 433 | sub += 64; |
438 | 434 | ||
439 | return sub == pi->remote_tx_win; | 435 | return sub == ch->remote_tx_win; |
440 | } | 436 | } |
441 | 437 | ||
442 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) | 438 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) |
@@ -446,24 +442,24 @@ static inline int l2cap_tx_window_full(struct sock *sk) | |||
446 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) | 442 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) |
447 | 443 | ||
448 | extern int disable_ertm; | 444 | extern int disable_ertm; |
449 | extern const struct proto_ops l2cap_sock_ops; | ||
450 | extern struct bt_sock_list l2cap_sk_list; | ||
451 | 445 | ||
452 | int l2cap_init_sockets(void); | 446 | int l2cap_init_sockets(void); |
453 | void l2cap_cleanup_sockets(void); | 447 | void l2cap_cleanup_sockets(void); |
454 | 448 | ||
455 | u8 l2cap_get_ident(struct l2cap_conn *conn); | ||
456 | void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data); | 449 | void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data); |
457 | int l2cap_build_conf_req(struct sock *sk, void *data); | 450 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); |
458 | int __l2cap_wait_ack(struct sock *sk); | 451 | int __l2cap_wait_ack(struct sock *sk); |
459 | 452 | ||
460 | struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len); | 453 | struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
461 | struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len); | 454 | struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
462 | struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen); | 455 | struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len, u16 control, u16 sdulen); |
463 | int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, size_t len); | 456 | int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
464 | void l2cap_do_send(struct sock *sk, struct sk_buff *skb); | 457 | void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb); |
465 | void l2cap_streaming_send(struct sock *sk); | 458 | void l2cap_streaming_send(struct l2cap_chan *chan); |
466 | int l2cap_ertm_send(struct sock *sk); | 459 | int l2cap_ertm_send(struct l2cap_chan *chan); |
460 | |||
461 | int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); | ||
462 | int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); | ||
467 | 463 | ||
468 | void l2cap_sock_set_timer(struct sock *sk, long timeout); | 464 | void l2cap_sock_set_timer(struct sock *sk, long timeout); |
469 | void l2cap_sock_clear_timer(struct sock *sk); | 465 | void l2cap_sock_clear_timer(struct sock *sk); |
@@ -472,8 +468,10 @@ void l2cap_sock_kill(struct sock *sk); | |||
472 | void l2cap_sock_init(struct sock *sk, struct sock *parent); | 468 | void l2cap_sock_init(struct sock *sk, struct sock *parent); |
473 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, | 469 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, |
474 | int proto, gfp_t prio); | 470 | int proto, gfp_t prio); |
475 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err); | 471 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err); |
476 | void l2cap_chan_del(struct sock *sk, int err); | 472 | struct l2cap_chan *l2cap_chan_create(struct sock *sk); |
477 | int l2cap_do_connect(struct sock *sk); | 473 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
474 | void l2cap_chan_destroy(struct l2cap_chan *chan); | ||
475 | int l2cap_chan_connect(struct l2cap_chan *chan); | ||
478 | 476 | ||
479 | #endif /* __L2CAP_H */ | 477 | #endif /* __L2CAP_H */ |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 5fabfa886b3e..4899286ed4e4 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -41,6 +41,10 @@ struct mgmt_rp_read_index_list { | |||
41 | __le16 index[0]; | 41 | __le16 index[0]; |
42 | } __packed; | 42 | } __packed; |
43 | 43 | ||
44 | /* Reserve one extra byte for names in management messages so that they | ||
45 | * are always guaranteed to be nul-terminated */ | ||
46 | #define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1) | ||
47 | |||
44 | #define MGMT_OP_READ_INFO 0x0004 | 48 | #define MGMT_OP_READ_INFO 0x0004 |
45 | struct mgmt_rp_read_info { | 49 | struct mgmt_rp_read_info { |
46 | __u8 type; | 50 | __u8 type; |
@@ -55,6 +59,7 @@ struct mgmt_rp_read_info { | |||
55 | __u16 manufacturer; | 59 | __u16 manufacturer; |
56 | __u8 hci_ver; | 60 | __u8 hci_ver; |
57 | __u16 hci_rev; | 61 | __u16 hci_rev; |
62 | __u8 name[MGMT_MAX_NAME_LENGTH]; | ||
58 | } __packed; | 63 | } __packed; |
59 | 64 | ||
60 | struct mgmt_mode { | 65 | struct mgmt_mode { |
@@ -167,6 +172,33 @@ struct mgmt_rp_user_confirm_reply { | |||
167 | 172 | ||
168 | #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016 | 173 | #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016 |
169 | 174 | ||
175 | #define MGMT_OP_SET_LOCAL_NAME 0x0017 | ||
176 | struct mgmt_cp_set_local_name { | ||
177 | __u8 name[MGMT_MAX_NAME_LENGTH]; | ||
178 | } __packed; | ||
179 | |||
180 | #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018 | ||
181 | struct mgmt_rp_read_local_oob_data { | ||
182 | __u8 hash[16]; | ||
183 | __u8 randomizer[16]; | ||
184 | } __packed; | ||
185 | |||
186 | #define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019 | ||
187 | struct mgmt_cp_add_remote_oob_data { | ||
188 | bdaddr_t bdaddr; | ||
189 | __u8 hash[16]; | ||
190 | __u8 randomizer[16]; | ||
191 | } __packed; | ||
192 | |||
193 | #define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A | ||
194 | struct mgmt_cp_remove_remote_oob_data { | ||
195 | bdaddr_t bdaddr; | ||
196 | } __packed; | ||
197 | |||
198 | #define MGMT_OP_START_DISCOVERY 0x001B | ||
199 | |||
200 | #define MGMT_OP_STOP_DISCOVERY 0x001C | ||
201 | |||
170 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 202 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
171 | struct mgmt_ev_cmd_complete { | 203 | struct mgmt_ev_cmd_complete { |
172 | __le16 opcode; | 204 | __le16 opcode; |
@@ -198,8 +230,8 @@ struct mgmt_ev_controller_error { | |||
198 | 230 | ||
199 | #define MGMT_EV_NEW_KEY 0x000A | 231 | #define MGMT_EV_NEW_KEY 0x000A |
200 | struct mgmt_ev_new_key { | 232 | struct mgmt_ev_new_key { |
233 | __u8 store_hint; | ||
201 | struct mgmt_key_info key; | 234 | struct mgmt_key_info key; |
202 | __u8 old_key_type; | ||
203 | } __packed; | 235 | } __packed; |
204 | 236 | ||
205 | #define MGMT_EV_CONNECTED 0x000B | 237 | #define MGMT_EV_CONNECTED 0x000B |
@@ -221,11 +253,13 @@ struct mgmt_ev_connect_failed { | |||
221 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E | 253 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E |
222 | struct mgmt_ev_pin_code_request { | 254 | struct mgmt_ev_pin_code_request { |
223 | bdaddr_t bdaddr; | 255 | bdaddr_t bdaddr; |
256 | __u8 secure; | ||
224 | } __packed; | 257 | } __packed; |
225 | 258 | ||
226 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F | 259 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F |
227 | struct mgmt_ev_user_confirm_request { | 260 | struct mgmt_ev_user_confirm_request { |
228 | bdaddr_t bdaddr; | 261 | bdaddr_t bdaddr; |
262 | __u8 confirm_hint; | ||
229 | __le32 value; | 263 | __le32 value; |
230 | } __packed; | 264 | } __packed; |
231 | 265 | ||
@@ -234,3 +268,24 @@ struct mgmt_ev_auth_failed { | |||
234 | bdaddr_t bdaddr; | 268 | bdaddr_t bdaddr; |
235 | __u8 status; | 269 | __u8 status; |
236 | } __packed; | 270 | } __packed; |
271 | |||
272 | #define MGMT_EV_LOCAL_NAME_CHANGED 0x0011 | ||
273 | struct mgmt_ev_local_name_changed { | ||
274 | __u8 name[MGMT_MAX_NAME_LENGTH]; | ||
275 | } __packed; | ||
276 | |||
277 | #define MGMT_EV_DEVICE_FOUND 0x0012 | ||
278 | struct mgmt_ev_device_found { | ||
279 | bdaddr_t bdaddr; | ||
280 | __u8 dev_class[3]; | ||
281 | __s8 rssi; | ||
282 | __u8 eir[HCI_MAX_EIR_LENGTH]; | ||
283 | } __packed; | ||
284 | |||
285 | #define MGMT_EV_REMOTE_NAME 0x0013 | ||
286 | struct mgmt_ev_remote_name { | ||
287 | bdaddr_t bdaddr; | ||
288 | __u8 name[MGMT_MAX_NAME_LENGTH]; | ||
289 | } __packed; | ||
290 | |||
291 | #define MGMT_EV_DISCOVERING 0x0014 | ||
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index 8eff83b95366..c011281d92c0 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <net/caif/cfcnfg.h> | 11 | #include <net/caif/cfcnfg.h> |
12 | #include <linux/caif/caif_socket.h> | 12 | #include <linux/caif/caif_socket.h> |
13 | #include <linux/if.h> | 13 | #include <linux/if.h> |
14 | #include <linux/net.h> | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * struct caif_param - CAIF parameters. | 17 | * struct caif_param - CAIF parameters. |
@@ -62,46 +63,45 @@ struct caif_connect_request { | |||
62 | * E.g. CAIF Socket will call this function for each socket it connects | 63 | * E.g. CAIF Socket will call this function for each socket it connects |
63 | * and have one client_layer instance for each socket. | 64 | * and have one client_layer instance for each socket. |
64 | */ | 65 | */ |
65 | int caif_connect_client(struct caif_connect_request *conn_req, | 66 | int caif_connect_client(struct net *net, |
67 | struct caif_connect_request *conn_req, | ||
66 | struct cflayer *client_layer, int *ifindex, | 68 | struct cflayer *client_layer, int *ifindex, |
67 | int *headroom, int *tailroom); | 69 | int *headroom, int *tailroom); |
68 | 70 | ||
69 | /** | 71 | /** |
70 | * caif_disconnect_client - Disconnects a client from the CAIF stack. | 72 | * caif_disconnect_client - Disconnects a client from the CAIF stack. |
71 | * | 73 | * |
72 | * @client_layer: Client layer to be removed. | 74 | * @client_layer: Client layer to be disconnected. |
73 | */ | 75 | */ |
74 | int caif_disconnect_client(struct cflayer *client_layer); | 76 | int caif_disconnect_client(struct net *net, struct cflayer *client_layer); |
77 | |||
75 | 78 | ||
76 | /** | 79 | /** |
77 | * caif_release_client - Release adaptation layer reference to client. | 80 | * caif_client_register_refcnt - register ref-count functions provided by client. |
78 | * | 81 | * |
79 | * @client_layer: Client layer. | 82 | * @adapt_layer: Client layer using CAIF Stack. |
83 | * @hold: Function provided by client layer increasing ref-count | ||
84 | * @put: Function provided by client layer decreasing ref-count | ||
80 | * | 85 | * |
81 | * Releases a client/adaptation layer use of the caif stack. | 86 | * Client of the CAIF Stack must register functions for reference counting. |
82 | * This function must be used after caif_disconnect_client to | 87 | * These functions are called by the CAIF Stack for every upstream packet, |
83 | * decrease the reference count of the service layer. | 88 | * and must therefore be implemented efficiently. |
84 | */ | ||
85 | void caif_release_client(struct cflayer *client_layer); | ||
86 | |||
87 | /** | ||
88 | * connect_req_to_link_param - Translate configuration parameters | ||
89 | * from socket format to internal format. | ||
90 | * @cnfg: Pointer to configuration handler | ||
91 | * @con_req: Configuration parameters supplied in function | ||
92 | * caif_connect_client | ||
93 | * @channel_setup_param: Parameters supplied to the CAIF Core stack for | ||
94 | * setting up channels. | ||
95 | * | 89 | * |
90 | * Client should call caif_free_client when reference count degrease to zero. | ||
96 | */ | 91 | */ |
97 | int connect_req_to_link_param(struct cfcnfg *cnfg, | ||
98 | struct caif_connect_request *con_req, | ||
99 | struct cfctrl_link_param *channel_setup_param); | ||
100 | 92 | ||
93 | void caif_client_register_refcnt(struct cflayer *adapt_layer, | ||
94 | void (*hold)(struct cflayer *lyr), | ||
95 | void (*put)(struct cflayer *lyr)); | ||
101 | /** | 96 | /** |
102 | * get_caif_conf() - Get the configuration handler. | 97 | * caif_free_client - Free memory used to manage the client in the CAIF Stack. |
98 | * | ||
99 | * @client_layer: Client layer to be removed. | ||
100 | * | ||
101 | * This function must be called from client layer in order to free memory. | ||
102 | * Caller must guarantee that no packets are in flight upstream when calling | ||
103 | * this function. | ||
103 | */ | 104 | */ |
104 | struct cfcnfg *get_caif_conf(void); | 105 | void caif_free_client(struct cflayer *adap_layer); |
105 | |||
106 | 106 | ||
107 | #endif /* CAIF_DEV_H_ */ | 107 | #endif /* CAIF_DEV_H_ */ |
diff --git a/include/net/caif/caif_layer.h b/include/net/caif/caif_layer.h index c8b07a904e78..35bc7883cf97 100644 --- a/include/net/caif/caif_layer.h +++ b/include/net/caif/caif_layer.h | |||
@@ -15,7 +15,6 @@ struct cfpktq; | |||
15 | struct caif_payload_info; | 15 | struct caif_payload_info; |
16 | struct caif_packet_funcs; | 16 | struct caif_packet_funcs; |
17 | 17 | ||
18 | |||
19 | #define CAIF_LAYER_NAME_SZ 16 | 18 | #define CAIF_LAYER_NAME_SZ 16 |
20 | 19 | ||
21 | /** | 20 | /** |
@@ -33,7 +32,6 @@ do { \ | |||
33 | } \ | 32 | } \ |
34 | } while (0) | 33 | } while (0) |
35 | 34 | ||
36 | |||
37 | /** | 35 | /** |
38 | * enum caif_ctrlcmd - CAIF Stack Control Signaling sent in layer.ctrlcmd(). | 36 | * enum caif_ctrlcmd - CAIF Stack Control Signaling sent in layer.ctrlcmd(). |
39 | * | 37 | * |
@@ -141,7 +139,7 @@ enum caif_direction { | |||
141 | * - All layers must use this structure. If embedding it, then place this | 139 | * - All layers must use this structure. If embedding it, then place this |
142 | * structure first in the layer specific structure. | 140 | * structure first in the layer specific structure. |
143 | * | 141 | * |
144 | * - Each layer should not depend on any others layer private data. | 142 | * - Each layer should not depend on any others layer's private data. |
145 | * | 143 | * |
146 | * - In order to send data upwards do | 144 | * - In order to send data upwards do |
147 | * layer->up->receive(layer->up, packet); | 145 | * layer->up->receive(layer->up, packet); |
@@ -155,16 +153,23 @@ struct cflayer { | |||
155 | struct list_head node; | 153 | struct list_head node; |
156 | 154 | ||
157 | /* | 155 | /* |
158 | * receive() - Receive Function. | 156 | * receive() - Receive Function (non-blocking). |
159 | * Contract: Each layer must implement a receive function passing the | 157 | * Contract: Each layer must implement a receive function passing the |
160 | * CAIF packets upwards in the stack. | 158 | * CAIF packets upwards in the stack. |
161 | * Packet handling rules: | 159 | * Packet handling rules: |
162 | * - The CAIF packet (cfpkt) cannot be accessed after | 160 | * - The CAIF packet (cfpkt) ownership is passed to the |
163 | * passing it to the next layer using up->receive(). | 161 | * called receive function. This means that the the |
162 | * packet cannot be accessed after passing it to the | ||
163 | * above layer using up->receive(). | ||
164 | * | ||
164 | * - If parsing of the packet fails, the packet must be | 165 | * - If parsing of the packet fails, the packet must be |
165 | * destroyed and -1 returned from the function. | 166 | * destroyed and negative error code returned |
167 | * from the function. | ||
168 | * EXCEPTION: If the framing layer (cffrml) returns | ||
169 | * -EILSEQ, the packet is not freed. | ||
170 | * | ||
166 | * - If parsing succeeds (and above layers return OK) then | 171 | * - If parsing succeeds (and above layers return OK) then |
167 | * the function must return a value > 0. | 172 | * the function must return a value >= 0. |
168 | * | 173 | * |
169 | * Returns result < 0 indicates an error, 0 or positive value | 174 | * Returns result < 0 indicates an error, 0 or positive value |
170 | * indicates success. | 175 | * indicates success. |
@@ -176,7 +181,7 @@ struct cflayer { | |||
176 | int (*receive)(struct cflayer *layr, struct cfpkt *cfpkt); | 181 | int (*receive)(struct cflayer *layr, struct cfpkt *cfpkt); |
177 | 182 | ||
178 | /* | 183 | /* |
179 | * transmit() - Transmit Function. | 184 | * transmit() - Transmit Function (non-blocking). |
180 | * Contract: Each layer must implement a transmit function passing the | 185 | * Contract: Each layer must implement a transmit function passing the |
181 | * CAIF packet downwards in the stack. | 186 | * CAIF packet downwards in the stack. |
182 | * Packet handling rules: | 187 | * Packet handling rules: |
@@ -185,15 +190,16 @@ struct cflayer { | |||
185 | * cannot be accessed after passing it to the below | 190 | * cannot be accessed after passing it to the below |
186 | * layer using dn->transmit(). | 191 | * layer using dn->transmit(). |
187 | * | 192 | * |
188 | * - If transmit fails, however, the ownership is returned | 193 | * - Upon error the packet ownership is still passed on, |
189 | * to thecaller. The caller of "dn->transmit()" must | 194 | * so the packet shall be freed where error is detected. |
190 | * destroy or resend packet. | 195 | * Callers of the transmit function shall not free packets, |
196 | * but errors shall be returned. | ||
191 | * | 197 | * |
192 | * - Return value less than zero means error, zero or | 198 | * - Return value less than zero means error, zero or |
193 | * greater than zero means OK. | 199 | * greater than zero means OK. |
194 | * | 200 | * |
195 | * result < 0 indicates an error, 0 or positive value | 201 | * Returns result < 0 indicates an error, 0 or positive value |
196 | * indicate success. | 202 | * indicates success. |
197 | * | 203 | * |
198 | * @layr: Pointer to the current layer the receive function | 204 | * @layr: Pointer to the current layer the receive function |
199 | * isimplemented for (this pointer). | 205 | * isimplemented for (this pointer). |
@@ -202,7 +208,7 @@ struct cflayer { | |||
202 | int (*transmit) (struct cflayer *layr, struct cfpkt *cfpkt); | 208 | int (*transmit) (struct cflayer *layr, struct cfpkt *cfpkt); |
203 | 209 | ||
204 | /* | 210 | /* |
205 | * cttrlcmd() - Control Function upwards in CAIF Stack. | 211 | * cttrlcmd() - Control Function upwards in CAIF Stack (non-blocking). |
206 | * Used for signaling responses (CAIF_CTRLCMD_*_RSP) | 212 | * Used for signaling responses (CAIF_CTRLCMD_*_RSP) |
207 | * and asynchronous events from the modem (CAIF_CTRLCMD_*_IND) | 213 | * and asynchronous events from the modem (CAIF_CTRLCMD_*_IND) |
208 | * | 214 | * |
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index f33d36341132..3e93a4a4b677 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h | |||
@@ -46,6 +46,12 @@ enum cfcnfg_phy_preference { | |||
46 | }; | 46 | }; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * cfcnfg_create() - Get the CAIF configuration object given network. | ||
50 | * @net: Network for the CAIF configuration object. | ||
51 | */ | ||
52 | struct cfcnfg *get_cfcnfg(struct net *net); | ||
53 | |||
54 | /** | ||
49 | * cfcnfg_create() - Create the CAIF configuration object. | 55 | * cfcnfg_create() - Create the CAIF configuration object. |
50 | */ | 56 | */ |
51 | struct cfcnfg *cfcnfg_create(void); | 57 | struct cfcnfg *cfcnfg_create(void); |
@@ -65,17 +71,15 @@ void cfcnfg_remove(struct cfcnfg *cfg); | |||
65 | * @dev: Pointer to link layer device | 71 | * @dev: Pointer to link layer device |
66 | * @phy_layer: Specify the physical layer. The transmit function | 72 | * @phy_layer: Specify the physical layer. The transmit function |
67 | * MUST be set in the structure. | 73 | * MUST be set in the structure. |
68 | * @phyid: The assigned physical ID for this layer, used in | ||
69 | * cfcnfg_add_adapt_layer to specify PHY for the link. | ||
70 | * @pref: The phy (link layer) preference. | 74 | * @pref: The phy (link layer) preference. |
71 | * @fcs: Specify if checksum is used in CAIF Framing Layer. | 75 | * @fcs: Specify if checksum is used in CAIF Framing Layer. |
72 | * @stx: Specify if Start Of Frame extension is used. | 76 | * @stx: Specify if Start Of Frame eXtention is used. |
73 | */ | 77 | */ |
74 | 78 | ||
75 | void | 79 | void |
76 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | 80 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, |
77 | struct net_device *dev, struct cflayer *phy_layer, | 81 | struct net_device *dev, struct cflayer *phy_layer, |
78 | u16 *phyid, enum cfcnfg_phy_preference pref, | 82 | enum cfcnfg_phy_preference pref, |
79 | bool fcs, bool stx); | 83 | bool fcs, bool stx); |
80 | 84 | ||
81 | /** | 85 | /** |
@@ -88,61 +92,12 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | |||
88 | int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer); | 92 | int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer); |
89 | 93 | ||
90 | /** | 94 | /** |
91 | * cfcnfg_disconn_adapt_layer - Disconnects an adaptation layer. | 95 | * cfcnfg_set_phy_state() - Set the state of the physical interface device. |
92 | * | ||
93 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
94 | * cfcnfg_create(). | ||
95 | * @adap_layer: Adaptation layer to be removed. | ||
96 | */ | ||
97 | int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, | ||
98 | struct cflayer *adap_layer); | ||
99 | |||
100 | /** | ||
101 | * cfcnfg_release_adap_layer - Used by client to release the adaptation layer. | ||
102 | * | ||
103 | * @adap_layer: Adaptation layer. | ||
104 | */ | ||
105 | void cfcnfg_release_adap_layer(struct cflayer *adap_layer); | ||
106 | |||
107 | /** | ||
108 | * cfcnfg_add_adaptation_layer - Add an adaptation layer to the CAIF stack. | ||
109 | * | ||
110 | * The adaptation Layer is where the interface to application or higher-level | ||
111 | * driver functionality is implemented. | ||
112 | * | ||
113 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
114 | * cfcnfg_create(). | ||
115 | * @param: Link setup parameters. | ||
116 | * @adap_layer: Specify the adaptation layer; the receive and | ||
117 | * flow-control functions MUST be set in the structure. | ||
118 | * @ifindex: Link layer interface index used for this connection. | ||
119 | * @proto_head: Protocol head-space needed by CAIF protocol, | ||
120 | * excluding link layer. | ||
121 | * @proto_tail: Protocol tail-space needed by CAIF protocol, | ||
122 | * excluding link layer. | ||
123 | */ | ||
124 | int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, | ||
125 | struct cfctrl_link_param *param, | ||
126 | struct cflayer *adap_layer, | ||
127 | int *ifindex, | ||
128 | int *proto_head, | ||
129 | int *proto_tail); | ||
130 | |||
131 | /** | ||
132 | * cfcnfg_get_phyid() - Get physical ID, given type. | ||
133 | * Returns one of the physical interfaces matching the given type. | ||
134 | * Zero if no match is found. | ||
135 | * @cnfg: Configuration object | 96 | * @cnfg: Configuration object |
136 | * @phy_pref: Caif Link Layer preference | 97 | * @phy_layer: Physical Layer representation |
98 | * @up: State of device | ||
137 | */ | 99 | */ |
138 | struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg, | 100 | int cfcnfg_set_phy_state(struct cfcnfg *cnfg, struct cflayer *phy_layer, |
139 | enum cfcnfg_phy_preference phy_pref); | 101 | bool up); |
140 | 102 | ||
141 | /** | ||
142 | * cfcnfg_get_id_from_ifi() - Get the Physical Identifier of ifindex, | ||
143 | * it matches caif physical id with the kernel interface id. | ||
144 | * @cnfg: Configuration object | ||
145 | * @ifi: ifindex obtained from socket.c bindtodevice. | ||
146 | */ | ||
147 | int cfcnfg_get_id_from_ifi(struct cfcnfg *cnfg, int ifi); | ||
148 | #endif /* CFCNFG_H_ */ | 103 | #endif /* CFCNFG_H_ */ |
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index e54f6396fa4c..9e5425b4a1d7 100644 --- a/include/net/caif/cfctrl.h +++ b/include/net/caif/cfctrl.h | |||
@@ -121,19 +121,10 @@ int cfctrl_linkup_request(struct cflayer *cfctrl, | |||
121 | struct cflayer *user_layer); | 121 | struct cflayer *user_layer); |
122 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, | 122 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, |
123 | struct cflayer *client); | 123 | struct cflayer *client); |
124 | void cfctrl_sleep_req(struct cflayer *cfctrl); | 124 | |
125 | void cfctrl_wake_req(struct cflayer *cfctrl); | ||
126 | void cfctrl_getstartreason_req(struct cflayer *cfctrl); | ||
127 | struct cflayer *cfctrl_create(void); | 125 | struct cflayer *cfctrl_create(void); |
128 | void cfctrl_set_dnlayer(struct cflayer *this, struct cflayer *dn); | ||
129 | void cfctrl_set_uplayer(struct cflayer *this, struct cflayer *up); | ||
130 | struct cfctrl_rsp *cfctrl_get_respfuncs(struct cflayer *layer); | 126 | struct cfctrl_rsp *cfctrl_get_respfuncs(struct cflayer *layer); |
131 | bool cfctrl_req_eq(struct cfctrl_request_info *r1, | 127 | int cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer); |
132 | struct cfctrl_request_info *r2); | 128 | void cfctrl_remove(struct cflayer *layr); |
133 | void cfctrl_insert_req(struct cfctrl *ctrl, | ||
134 | struct cfctrl_request_info *req); | ||
135 | struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, | ||
136 | struct cfctrl_request_info *req); | ||
137 | void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer); | ||
138 | 129 | ||
139 | #endif /* CFCTRL_H_ */ | 130 | #endif /* CFCTRL_H_ */ |
diff --git a/include/net/caif/cffrml.h b/include/net/caif/cffrml.h index 3f14d2e1ce61..afac1a48cce7 100644 --- a/include/net/caif/cffrml.h +++ b/include/net/caif/cffrml.h | |||
@@ -7,10 +7,15 @@ | |||
7 | #ifndef CFFRML_H_ | 7 | #ifndef CFFRML_H_ |
8 | #define CFFRML_H_ | 8 | #define CFFRML_H_ |
9 | #include <net/caif/caif_layer.h> | 9 | #include <net/caif/caif_layer.h> |
10 | #include <linux/netdevice.h> | ||
10 | 11 | ||
11 | struct cffrml; | 12 | struct cffrml; |
12 | struct cflayer *cffrml_create(u16 phyid, bool DoFCS); | 13 | struct cflayer *cffrml_create(u16 phyid, bool use_fcs); |
14 | void cffrml_free(struct cflayer *layr); | ||
13 | void cffrml_set_uplayer(struct cflayer *this, struct cflayer *up); | 15 | void cffrml_set_uplayer(struct cflayer *this, struct cflayer *up); |
14 | void cffrml_set_dnlayer(struct cflayer *this, struct cflayer *dn); | 16 | void cffrml_set_dnlayer(struct cflayer *this, struct cflayer *dn); |
17 | void cffrml_put(struct cflayer *layr); | ||
18 | void cffrml_hold(struct cflayer *layr); | ||
19 | int cffrml_refcnt_read(struct cflayer *layr); | ||
15 | 20 | ||
16 | #endif /* CFFRML_H_ */ | 21 | #endif /* CFFRML_H_ */ |
diff --git a/include/net/caif/cfmuxl.h b/include/net/caif/cfmuxl.h index 4e1b4f33423e..5847a196b8ad 100644 --- a/include/net/caif/cfmuxl.h +++ b/include/net/caif/cfmuxl.h | |||
@@ -16,7 +16,5 @@ int cfmuxl_set_uplayer(struct cflayer *layr, struct cflayer *up, u8 linkid); | |||
16 | struct cflayer *cfmuxl_remove_dnlayer(struct cflayer *layr, u8 phyid); | 16 | struct cflayer *cfmuxl_remove_dnlayer(struct cflayer *layr, u8 phyid); |
17 | int cfmuxl_set_dnlayer(struct cflayer *layr, struct cflayer *up, u8 phyid); | 17 | int cfmuxl_set_dnlayer(struct cflayer *layr, struct cflayer *up, u8 phyid); |
18 | struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 linkid); | 18 | struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 linkid); |
19 | bool cfmuxl_is_phy_inuse(struct cflayer *layr, u8 phyid); | ||
20 | u8 cfmuxl_get_phyid(struct cflayer *layr, u8 channel_id); | ||
21 | 19 | ||
22 | #endif /* CFMUXL_H_ */ | 20 | #endif /* CFMUXL_H_ */ |
diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h index fbc681beff52..6bd200a4754a 100644 --- a/include/net/caif/cfpkt.h +++ b/include/net/caif/cfpkt.h | |||
@@ -16,12 +16,6 @@ struct cfpkt; | |||
16 | */ | 16 | */ |
17 | struct cfpkt *cfpkt_create(u16 len); | 17 | struct cfpkt *cfpkt_create(u16 len); |
18 | 18 | ||
19 | /* Create a CAIF packet. | ||
20 | * data Data to copy. | ||
21 | * len Length of packet to be created | ||
22 | * @return New packet. | ||
23 | */ | ||
24 | struct cfpkt *cfpkt_create_uplink(const unsigned char *data, unsigned int len); | ||
25 | /* | 19 | /* |
26 | * Destroy a CAIF Packet. | 20 | * Destroy a CAIF Packet. |
27 | * pkt Packet to be destoyed. | 21 | * pkt Packet to be destoyed. |
@@ -181,22 +175,6 @@ u16 cfpkt_iterate(struct cfpkt *pkt, | |||
181 | u16 (*iter_func)(u16 chks, void *buf, u16 len), | 175 | u16 (*iter_func)(u16 chks, void *buf, u16 len), |
182 | u16 data); | 176 | u16 data); |
183 | 177 | ||
184 | /* Append by giving user access to packet buffer | ||
185 | * cfpkt Packet to append to | ||
186 | * buf Buffer inside pkt that user shall copy data into | ||
187 | * buflen Length of buffer and number of bytes added to packet | ||
188 | * @return 0 on error, 1 on success | ||
189 | */ | ||
190 | int cfpkt_raw_append(struct cfpkt *cfpkt, void **buf, unsigned int buflen); | ||
191 | |||
192 | /* Extract by giving user access to packet buffer | ||
193 | * cfpkt Packet to extract from | ||
194 | * buf Buffer inside pkt that user shall copy data from | ||
195 | * buflen Length of buffer and number of bytes removed from packet | ||
196 | * @return 0 on error, 1 on success | ||
197 | */ | ||
198 | int cfpkt_raw_extract(struct cfpkt *cfpkt, void **buf, unsigned int buflen); | ||
199 | |||
200 | /* Map from a "native" packet (e.g. Linux Socket Buffer) to a CAIF packet. | 178 | /* Map from a "native" packet (e.g. Linux Socket Buffer) to a CAIF packet. |
201 | * dir - Direction indicating whether this packet is to be sent or received. | 179 | * dir - Direction indicating whether this packet is to be sent or received. |
202 | * nativepkt - The native packet to be transformed to a CAIF packet | 180 | * nativepkt - The native packet to be transformed to a CAIF packet |
@@ -210,59 +188,6 @@ struct cfpkt *cfpkt_fromnative(enum caif_direction dir, void *nativepkt); | |||
210 | */ | 188 | */ |
211 | void *cfpkt_tonative(struct cfpkt *pkt); | 189 | void *cfpkt_tonative(struct cfpkt *pkt); |
212 | 190 | ||
213 | /* | ||
214 | * Insert a packet in the packet queue. | ||
215 | * pktq Packet queue to insert into | ||
216 | * pkt Packet to be inserted in queue | ||
217 | * prio Priority of packet | ||
218 | */ | ||
219 | void cfpkt_queue(struct cfpktq *pktq, struct cfpkt *pkt, | ||
220 | unsigned short prio); | ||
221 | |||
222 | /* | ||
223 | * Remove a packet from the packet queue. | ||
224 | * pktq Packet queue to fetch packets from. | ||
225 | * @return Dequeued packet. | ||
226 | */ | ||
227 | struct cfpkt *cfpkt_dequeue(struct cfpktq *pktq); | ||
228 | |||
229 | /* | ||
230 | * Peek into a packet from the packet queue. | ||
231 | * pktq Packet queue to fetch packets from. | ||
232 | * @return Peeked packet. | ||
233 | */ | ||
234 | struct cfpkt *cfpkt_qpeek(struct cfpktq *pktq); | ||
235 | |||
236 | /* | ||
237 | * Initiates the packet queue. | ||
238 | * @return Pointer to new packet queue. | ||
239 | */ | ||
240 | struct cfpktq *cfpktq_create(void); | ||
241 | |||
242 | /* | ||
243 | * Get the number of packets in the queue. | ||
244 | * pktq Packet queue to fetch count from. | ||
245 | * @return Number of packets in queue. | ||
246 | */ | ||
247 | int cfpkt_qcount(struct cfpktq *pktq); | ||
248 | |||
249 | /* | ||
250 | * Put content of packet into buffer for debuging purposes. | ||
251 | * pkt Packet to copy data from | ||
252 | * buf Buffer to copy data into | ||
253 | * buflen Length of data to copy | ||
254 | * @return Pointer to copied data | ||
255 | */ | ||
256 | char *cfpkt_log_pkt(struct cfpkt *pkt, char *buf, int buflen); | ||
257 | |||
258 | /* | ||
259 | * Clones a packet and releases the original packet. | ||
260 | * This is used for taking ownership of a packet e.g queueing. | ||
261 | * pkt Packet to clone and release. | ||
262 | * @return Cloned packet. | ||
263 | */ | ||
264 | struct cfpkt *cfpkt_clone_release(struct cfpkt *pkt); | ||
265 | |||
266 | 191 | ||
267 | /* | 192 | /* |
268 | * Returns packet information for a packet. | 193 | * Returns packet information for a packet. |
@@ -270,5 +195,4 @@ struct cfpkt *cfpkt_clone_release(struct cfpkt *pkt); | |||
270 | * @return Packet information | 195 | * @return Packet information |
271 | */ | 196 | */ |
272 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); | 197 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); |
273 | /*! @} */ | ||
274 | #endif /* CFPKT_H_ */ | 198 | #endif /* CFPKT_H_ */ |
diff --git a/include/net/caif/cfsrvl.h b/include/net/caif/cfsrvl.h index b1fa87ee0992..0f5905241843 100644 --- a/include/net/caif/cfsrvl.h +++ b/include/net/caif/cfsrvl.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/stddef.h> | 10 | #include <linux/stddef.h> |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/kref.h> | 12 | #include <linux/kref.h> |
13 | #include <linux/rculist.h> | ||
13 | 14 | ||
14 | struct cfsrvl { | 15 | struct cfsrvl { |
15 | struct cflayer layer; | 16 | struct cflayer layer; |
@@ -17,12 +18,13 @@ struct cfsrvl { | |||
17 | bool phy_flow_on; | 18 | bool phy_flow_on; |
18 | bool modem_flow_on; | 19 | bool modem_flow_on; |
19 | bool supports_flowctrl; | 20 | bool supports_flowctrl; |
20 | void (*release)(struct kref *); | 21 | void (*release)(struct cflayer *layer); |
21 | struct dev_info dev_info; | 22 | struct dev_info dev_info; |
22 | struct kref ref; | 23 | void (*hold)(struct cflayer *lyr); |
24 | void (*put)(struct cflayer *lyr); | ||
25 | struct rcu_head rcu; | ||
23 | }; | 26 | }; |
24 | 27 | ||
25 | void cfsrvl_release(struct kref *kref); | ||
26 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); | 28 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); |
27 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); | 29 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); |
28 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); | 30 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); |
@@ -30,8 +32,12 @@ struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info); | |||
30 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info, | 32 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info, |
31 | int mtu_size); | 33 | int mtu_size); |
32 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); | 34 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); |
35 | |||
36 | void cfsrvl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | ||
37 | int phyid); | ||
38 | |||
33 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); | 39 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); |
34 | void cfservl_destroy(struct cflayer *layer); | 40 | |
35 | void cfsrvl_init(struct cfsrvl *service, | 41 | void cfsrvl_init(struct cfsrvl *service, |
36 | u8 channel_id, | 42 | u8 channel_id, |
37 | struct dev_info *dev_info, | 43 | struct dev_info *dev_info, |
@@ -41,23 +47,19 @@ u8 cfsrvl_getphyid(struct cflayer *layer); | |||
41 | 47 | ||
42 | static inline void cfsrvl_get(struct cflayer *layr) | 48 | static inline void cfsrvl_get(struct cflayer *layr) |
43 | { | 49 | { |
44 | struct cfsrvl *s; | 50 | struct cfsrvl *s = container_of(layr, struct cfsrvl, layer); |
45 | if (layr == NULL) | 51 | if (layr == NULL || layr->up == NULL || s->hold == NULL) |
46 | return; | 52 | return; |
47 | s = container_of(layr, struct cfsrvl, layer); | 53 | |
48 | kref_get(&s->ref); | 54 | s->hold(layr->up); |
49 | } | 55 | } |
50 | 56 | ||
51 | static inline void cfsrvl_put(struct cflayer *layr) | 57 | static inline void cfsrvl_put(struct cflayer *layr) |
52 | { | 58 | { |
53 | struct cfsrvl *s; | 59 | struct cfsrvl *s = container_of(layr, struct cfsrvl, layer); |
54 | if (layr == NULL) | 60 | if (layr == NULL || layr->up == NULL || s->hold == NULL) |
55 | return; | 61 | return; |
56 | s = container_of(layr, struct cfsrvl, layer); | ||
57 | 62 | ||
58 | WARN_ON(!s->release); | 63 | s->put(layr->up); |
59 | if (s->release) | ||
60 | kref_put(&s->ref, s->release); | ||
61 | } | 64 | } |
62 | |||
63 | #endif /* CFSRVL_H_ */ | 65 | #endif /* CFSRVL_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b2b9d28cb4ab..0589f554788a 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -387,6 +387,7 @@ enum plink_actions { | |||
387 | * @listen_interval: listen interval or -1 for no change | 387 | * @listen_interval: listen interval or -1 for no change |
388 | * @aid: AID or zero for no change | 388 | * @aid: AID or zero for no change |
389 | * @plink_action: plink action to take | 389 | * @plink_action: plink action to take |
390 | * @plink_state: set the peer link state for a station | ||
390 | * @ht_capa: HT capabilities of station | 391 | * @ht_capa: HT capabilities of station |
391 | */ | 392 | */ |
392 | struct station_parameters { | 393 | struct station_parameters { |
@@ -397,6 +398,7 @@ struct station_parameters { | |||
397 | u16 aid; | 398 | u16 aid; |
398 | u8 supported_rates_len; | 399 | u8 supported_rates_len; |
399 | u8 plink_action; | 400 | u8 plink_action; |
401 | u8 plink_state; | ||
400 | struct ieee80211_ht_cap *ht_capa; | 402 | struct ieee80211_ht_cap *ht_capa; |
401 | }; | 403 | }; |
402 | 404 | ||
@@ -422,6 +424,8 @@ struct station_parameters { | |||
422 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | 424 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled |
423 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled | 425 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled |
424 | * @STATION_INFO_RX_BITRATE: @rxrate fields are filled | 426 | * @STATION_INFO_RX_BITRATE: @rxrate fields are filled |
427 | * @STATION_INFO_BSS_PARAM: @bss_param filled | ||
428 | * @STATION_INFO_CONNECTED_TIME: @connected_time filled | ||
425 | */ | 429 | */ |
426 | enum station_info_flags { | 430 | enum station_info_flags { |
427 | STATION_INFO_INACTIVE_TIME = 1<<0, | 431 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -439,6 +443,8 @@ enum station_info_flags { | |||
439 | STATION_INFO_RX_DROP_MISC = 1<<12, | 443 | STATION_INFO_RX_DROP_MISC = 1<<12, |
440 | STATION_INFO_SIGNAL_AVG = 1<<13, | 444 | STATION_INFO_SIGNAL_AVG = 1<<13, |
441 | STATION_INFO_RX_BITRATE = 1<<14, | 445 | STATION_INFO_RX_BITRATE = 1<<14, |
446 | STATION_INFO_BSS_PARAM = 1<<15, | ||
447 | STATION_INFO_CONNECTED_TIME = 1<<16 | ||
442 | }; | 448 | }; |
443 | 449 | ||
444 | /** | 450 | /** |
@@ -473,11 +479,43 @@ struct rate_info { | |||
473 | }; | 479 | }; |
474 | 480 | ||
475 | /** | 481 | /** |
482 | * enum station_info_rate_flags - bitrate info flags | ||
483 | * | ||
484 | * Used by the driver to indicate the specific rate transmission | ||
485 | * type for 802.11n transmissions. | ||
486 | * | ||
487 | * @BSS_PARAM_FLAGS_CTS_PROT: whether CTS protection is enabled | ||
488 | * @BSS_PARAM_FLAGS_SHORT_PREAMBLE: whether short preamble is enabled | ||
489 | * @BSS_PARAM_FLAGS_SHORT_SLOT_TIME: whether short slot time is enabled | ||
490 | */ | ||
491 | enum bss_param_flags { | ||
492 | BSS_PARAM_FLAGS_CTS_PROT = 1<<0, | ||
493 | BSS_PARAM_FLAGS_SHORT_PREAMBLE = 1<<1, | ||
494 | BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 1<<2, | ||
495 | }; | ||
496 | |||
497 | /** | ||
498 | * struct sta_bss_parameters - BSS parameters for the attached station | ||
499 | * | ||
500 | * Information about the currently associated BSS | ||
501 | * | ||
502 | * @flags: bitflag of flags from &enum bss_param_flags | ||
503 | * @dtim_period: DTIM period for the BSS | ||
504 | * @beacon_interval: beacon interval | ||
505 | */ | ||
506 | struct sta_bss_parameters { | ||
507 | u8 flags; | ||
508 | u8 dtim_period; | ||
509 | u16 beacon_interval; | ||
510 | }; | ||
511 | |||
512 | /** | ||
476 | * struct station_info - station information | 513 | * struct station_info - station information |
477 | * | 514 | * |
478 | * Station information filled by driver for get_station() and dump_station. | 515 | * Station information filled by driver for get_station() and dump_station. |
479 | * | 516 | * |
480 | * @filled: bitflag of flags from &enum station_info_flags | 517 | * @filled: bitflag of flags from &enum station_info_flags |
518 | * @connected_time: time(in secs) since a station is last connected | ||
481 | * @inactive_time: time since last station activity (tx/rx) in milliseconds | 519 | * @inactive_time: time since last station activity (tx/rx) in milliseconds |
482 | * @rx_bytes: bytes received from this station | 520 | * @rx_bytes: bytes received from this station |
483 | * @tx_bytes: bytes transmitted to this station | 521 | * @tx_bytes: bytes transmitted to this station |
@@ -493,6 +531,7 @@ struct rate_info { | |||
493 | * @tx_retries: cumulative retry counts | 531 | * @tx_retries: cumulative retry counts |
494 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | 532 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) |
495 | * @rx_dropped_misc: Dropped for un-specified reason. | 533 | * @rx_dropped_misc: Dropped for un-specified reason. |
534 | * @bss_param: current BSS parameters | ||
496 | * @generation: generation number for nl80211 dumps. | 535 | * @generation: generation number for nl80211 dumps. |
497 | * This number should increase every time the list of stations | 536 | * This number should increase every time the list of stations |
498 | * changes, i.e. when a station is added or removed, so that | 537 | * changes, i.e. when a station is added or removed, so that |
@@ -500,6 +539,7 @@ struct rate_info { | |||
500 | */ | 539 | */ |
501 | struct station_info { | 540 | struct station_info { |
502 | u32 filled; | 541 | u32 filled; |
542 | u32 connected_time; | ||
503 | u32 inactive_time; | 543 | u32 inactive_time; |
504 | u32 rx_bytes; | 544 | u32 rx_bytes; |
505 | u32 tx_bytes; | 545 | u32 tx_bytes; |
@@ -515,6 +555,7 @@ struct station_info { | |||
515 | u32 tx_retries; | 555 | u32 tx_retries; |
516 | u32 tx_failed; | 556 | u32 tx_failed; |
517 | u32 rx_dropped_misc; | 557 | u32 rx_dropped_misc; |
558 | struct sta_bss_parameters bss_param; | ||
518 | 559 | ||
519 | int generation; | 560 | int generation; |
520 | }; | 561 | }; |
@@ -655,8 +696,10 @@ struct mesh_config { | |||
655 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 696 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
656 | * @path_sel_proto: which path selection protocol to use | 697 | * @path_sel_proto: which path selection protocol to use |
657 | * @path_metric: which metric to use | 698 | * @path_metric: which metric to use |
658 | * @vendor_ie: vendor information elements (optional) | 699 | * @ie: vendor information elements (optional) |
659 | * @vendor_ie_len: length of vendor information elements | 700 | * @ie_len: length of vendor information elements |
701 | * @is_authenticated: this mesh requires authentication | ||
702 | * @is_secure: this mesh uses security | ||
660 | * | 703 | * |
661 | * These parameters are fixed when the mesh is created. | 704 | * These parameters are fixed when the mesh is created. |
662 | */ | 705 | */ |
@@ -665,8 +708,10 @@ struct mesh_setup { | |||
665 | u8 mesh_id_len; | 708 | u8 mesh_id_len; |
666 | u8 path_sel_proto; | 709 | u8 path_sel_proto; |
667 | u8 path_metric; | 710 | u8 path_metric; |
668 | const u8 *vendor_ie; | 711 | const u8 *ie; |
669 | u8 vendor_ie_len; | 712 | u8 ie_len; |
713 | bool is_authenticated; | ||
714 | bool is_secure; | ||
670 | }; | 715 | }; |
671 | 716 | ||
672 | /** | 717 | /** |
@@ -753,6 +798,35 @@ struct cfg80211_scan_request { | |||
753 | }; | 798 | }; |
754 | 799 | ||
755 | /** | 800 | /** |
801 | * struct cfg80211_sched_scan_request - scheduled scan request description | ||
802 | * | ||
803 | * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) | ||
804 | * @n_ssids: number of SSIDs | ||
805 | * @n_channels: total number of channels to scan | ||
806 | * @interval: interval between each scheduled scan cycle | ||
807 | * @ie: optional information element(s) to add into Probe Request or %NULL | ||
808 | * @ie_len: length of ie in octets | ||
809 | * @wiphy: the wiphy this was for | ||
810 | * @dev: the interface | ||
811 | * @channels: channels to scan | ||
812 | */ | ||
813 | struct cfg80211_sched_scan_request { | ||
814 | struct cfg80211_ssid *ssids; | ||
815 | int n_ssids; | ||
816 | u32 n_channels; | ||
817 | u32 interval; | ||
818 | const u8 *ie; | ||
819 | size_t ie_len; | ||
820 | |||
821 | /* internal */ | ||
822 | struct wiphy *wiphy; | ||
823 | struct net_device *dev; | ||
824 | |||
825 | /* keep last */ | ||
826 | struct ieee80211_channel *channels[0]; | ||
827 | }; | ||
828 | |||
829 | /** | ||
756 | * enum cfg80211_signal_type - signal type | 830 | * enum cfg80211_signal_type - signal type |
757 | * | 831 | * |
758 | * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available | 832 | * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available |
@@ -1048,6 +1122,38 @@ struct cfg80211_pmksa { | |||
1048 | }; | 1122 | }; |
1049 | 1123 | ||
1050 | /** | 1124 | /** |
1125 | * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern | ||
1126 | * @mask: bitmask where to match pattern and where to ignore bytes, | ||
1127 | * one bit per byte, in same format as nl80211 | ||
1128 | * @pattern: bytes to match where bitmask is 1 | ||
1129 | * @pattern_len: length of pattern (in bytes) | ||
1130 | * | ||
1131 | * Internal note: @mask and @pattern are allocated in one chunk of | ||
1132 | * memory, free @mask only! | ||
1133 | */ | ||
1134 | struct cfg80211_wowlan_trig_pkt_pattern { | ||
1135 | u8 *mask, *pattern; | ||
1136 | int pattern_len; | ||
1137 | }; | ||
1138 | |||
1139 | /** | ||
1140 | * struct cfg80211_wowlan - Wake on Wireless-LAN support info | ||
1141 | * | ||
1142 | * This structure defines the enabled WoWLAN triggers for the device. | ||
1143 | * @any: wake up on any activity -- special trigger if device continues | ||
1144 | * operating as normal during suspend | ||
1145 | * @disconnect: wake up if getting disconnected | ||
1146 | * @magic_pkt: wake up on receiving magic packet | ||
1147 | * @patterns: wake up on receiving packet matching a pattern | ||
1148 | * @n_patterns: number of patterns | ||
1149 | */ | ||
1150 | struct cfg80211_wowlan { | ||
1151 | bool any, disconnect, magic_pkt; | ||
1152 | struct cfg80211_wowlan_trig_pkt_pattern *patterns; | ||
1153 | int n_patterns; | ||
1154 | }; | ||
1155 | |||
1156 | /** | ||
1051 | * struct cfg80211_ops - backend description for wireless configuration | 1157 | * struct cfg80211_ops - backend description for wireless configuration |
1052 | * | 1158 | * |
1053 | * This struct is registered by fullmac card drivers and/or wireless stacks | 1159 | * This struct is registered by fullmac card drivers and/or wireless stacks |
@@ -1060,7 +1166,9 @@ struct cfg80211_pmksa { | |||
1060 | * wireless extensions but this is subject to reevaluation as soon as this | 1166 | * wireless extensions but this is subject to reevaluation as soon as this |
1061 | * code is used more widely and we have a first user without wext. | 1167 | * code is used more widely and we have a first user without wext. |
1062 | * | 1168 | * |
1063 | * @suspend: wiphy device needs to be suspended | 1169 | * @suspend: wiphy device needs to be suspended. The variable @wow will |
1170 | * be %NULL or contain the enabled Wake-on-Wireless triggers that are | ||
1171 | * configured for the device. | ||
1064 | * @resume: wiphy device needs to be resumed | 1172 | * @resume: wiphy device needs to be resumed |
1065 | * | 1173 | * |
1066 | * @add_virtual_intf: create a new virtual interface with the given name, | 1174 | * @add_virtual_intf: create a new virtual interface with the given name, |
@@ -1187,6 +1295,10 @@ struct cfg80211_pmksa { | |||
1187 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 | 1295 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 |
1188 | * allows the driver to adjust the dynamic ps timeout value. | 1296 | * allows the driver to adjust the dynamic ps timeout value. |
1189 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | 1297 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. |
1298 | * @sched_scan_start: Tell the driver to start a scheduled scan. | ||
1299 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled | ||
1300 | * scan. The driver_initiated flag specifies whether the driver | ||
1301 | * itself has informed that the scan has stopped. | ||
1190 | * | 1302 | * |
1191 | * @mgmt_frame_register: Notify driver that a management frame type was | 1303 | * @mgmt_frame_register: Notify driver that a management frame type was |
1192 | * registered. Note that this callback may not sleep, and cannot run | 1304 | * registered. Note that this callback may not sleep, and cannot run |
@@ -1204,7 +1316,7 @@ struct cfg80211_pmksa { | |||
1204 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | 1316 | * @get_ringparam: Get tx and rx ring current and maximum sizes. |
1205 | */ | 1317 | */ |
1206 | struct cfg80211_ops { | 1318 | struct cfg80211_ops { |
1207 | int (*suspend)(struct wiphy *wiphy); | 1319 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
1208 | int (*resume)(struct wiphy *wiphy); | 1320 | int (*resume)(struct wiphy *wiphy); |
1209 | 1321 | ||
1210 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, | 1322 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
@@ -1373,6 +1485,11 @@ struct cfg80211_ops { | |||
1373 | int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx); | 1485 | int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx); |
1374 | void (*get_ringparam)(struct wiphy *wiphy, | 1486 | void (*get_ringparam)(struct wiphy *wiphy, |
1375 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); | 1487 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); |
1488 | |||
1489 | int (*sched_scan_start)(struct wiphy *wiphy, | ||
1490 | struct net_device *dev, | ||
1491 | struct cfg80211_sched_scan_request *request); | ||
1492 | int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev); | ||
1376 | }; | 1493 | }; |
1377 | 1494 | ||
1378 | /* | 1495 | /* |
@@ -1404,6 +1521,10 @@ struct cfg80211_ops { | |||
1404 | * hints read the documenation for regulatory_hint_found_beacon() | 1521 | * hints read the documenation for regulatory_hint_found_beacon() |
1405 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this | 1522 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this |
1406 | * wiphy at all | 1523 | * wiphy at all |
1524 | * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface | ||
1525 | * combinations for this device. This flag is used for backward | ||
1526 | * compatibility only until all drivers advertise combinations and | ||
1527 | * they will always be enforced. | ||
1407 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled | 1528 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled |
1408 | * by default -- this flag will be set depending on the kernel's default | 1529 | * by default -- this flag will be set depending on the kernel's default |
1409 | * on wiphy_new(), but can be changed by the driver if it has a good | 1530 | * on wiphy_new(), but can be changed by the driver if it has a good |
@@ -1415,8 +1536,9 @@ struct cfg80211_ops { | |||
1415 | * control port protocol ethertype. The device also honours the | 1536 | * control port protocol ethertype. The device also honours the |
1416 | * control_port_no_encrypt flag. | 1537 | * control_port_no_encrypt flag. |
1417 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | 1538 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. |
1418 | * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate | 1539 | * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing |
1419 | * unicast and multicast TX keys. | 1540 | * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. |
1541 | * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. | ||
1420 | */ | 1542 | */ |
1421 | enum wiphy_flags { | 1543 | enum wiphy_flags { |
1422 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1544 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
@@ -1428,7 +1550,83 @@ enum wiphy_flags { | |||
1428 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1550 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
1429 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | 1551 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), |
1430 | WIPHY_FLAG_IBSS_RSN = BIT(8), | 1552 | WIPHY_FLAG_IBSS_RSN = BIT(8), |
1431 | WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9), | 1553 | WIPHY_FLAG_MESH_AUTH = BIT(10), |
1554 | WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), | ||
1555 | WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), | ||
1556 | }; | ||
1557 | |||
1558 | /** | ||
1559 | * struct ieee80211_iface_limit - limit on certain interface types | ||
1560 | * @max: maximum number of interfaces of these types | ||
1561 | * @types: interface types (bits) | ||
1562 | */ | ||
1563 | struct ieee80211_iface_limit { | ||
1564 | u16 max; | ||
1565 | u16 types; | ||
1566 | }; | ||
1567 | |||
1568 | /** | ||
1569 | * struct ieee80211_iface_combination - possible interface combination | ||
1570 | * @limits: limits for the given interface types | ||
1571 | * @n_limits: number of limitations | ||
1572 | * @num_different_channels: can use up to this many different channels | ||
1573 | * @max_interfaces: maximum number of interfaces in total allowed in this | ||
1574 | * group | ||
1575 | * @beacon_int_infra_match: In this combination, the beacon intervals | ||
1576 | * between infrastructure and AP types must match. This is required | ||
1577 | * only in special cases. | ||
1578 | * | ||
1579 | * These examples can be expressed as follows: | ||
1580 | * | ||
1581 | * Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total: | ||
1582 | * | ||
1583 | * struct ieee80211_iface_limit limits1[] = { | ||
1584 | * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), }, | ||
1585 | * { .max = 1, .types = BIT(NL80211_IFTYPE_AP}, }, | ||
1586 | * }; | ||
1587 | * struct ieee80211_iface_combination combination1 = { | ||
1588 | * .limits = limits1, | ||
1589 | * .n_limits = ARRAY_SIZE(limits1), | ||
1590 | * .max_interfaces = 2, | ||
1591 | * .beacon_int_infra_match = true, | ||
1592 | * }; | ||
1593 | * | ||
1594 | * | ||
1595 | * Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total: | ||
1596 | * | ||
1597 | * struct ieee80211_iface_limit limits2[] = { | ||
1598 | * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) | | ||
1599 | * BIT(NL80211_IFTYPE_P2P_GO), }, | ||
1600 | * }; | ||
1601 | * struct ieee80211_iface_combination combination2 = { | ||
1602 | * .limits = limits2, | ||
1603 | * .n_limits = ARRAY_SIZE(limits2), | ||
1604 | * .max_interfaces = 8, | ||
1605 | * .num_different_channels = 1, | ||
1606 | * }; | ||
1607 | * | ||
1608 | * | ||
1609 | * Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total. | ||
1610 | * This allows for an infrastructure connection and three P2P connections. | ||
1611 | * | ||
1612 | * struct ieee80211_iface_limit limits3[] = { | ||
1613 | * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), }, | ||
1614 | * { .max = 3, .types = BIT(NL80211_IFTYPE_P2P_GO) | | ||
1615 | * BIT(NL80211_IFTYPE_P2P_CLIENT), }, | ||
1616 | * }; | ||
1617 | * struct ieee80211_iface_combination combination3 = { | ||
1618 | * .limits = limits3, | ||
1619 | * .n_limits = ARRAY_SIZE(limits3), | ||
1620 | * .max_interfaces = 4, | ||
1621 | * .num_different_channels = 2, | ||
1622 | * }; | ||
1623 | */ | ||
1624 | struct ieee80211_iface_combination { | ||
1625 | const struct ieee80211_iface_limit *limits; | ||
1626 | u32 num_different_channels; | ||
1627 | u16 max_interfaces; | ||
1628 | u8 n_limits; | ||
1629 | bool beacon_int_infra_match; | ||
1432 | }; | 1630 | }; |
1433 | 1631 | ||
1434 | struct mac_address { | 1632 | struct mac_address { |
@@ -1440,6 +1638,38 @@ struct ieee80211_txrx_stypes { | |||
1440 | }; | 1638 | }; |
1441 | 1639 | ||
1442 | /** | 1640 | /** |
1641 | * enum wiphy_wowlan_support_flags - WoWLAN support flags | ||
1642 | * @WIPHY_WOWLAN_ANY: supports wakeup for the special "any" | ||
1643 | * trigger that keeps the device operating as-is and | ||
1644 | * wakes up the host on any activity, for example a | ||
1645 | * received packet that passed filtering; note that the | ||
1646 | * packet should be preserved in that case | ||
1647 | * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet | ||
1648 | * (see nl80211.h) | ||
1649 | * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect | ||
1650 | */ | ||
1651 | enum wiphy_wowlan_support_flags { | ||
1652 | WIPHY_WOWLAN_ANY = BIT(0), | ||
1653 | WIPHY_WOWLAN_MAGIC_PKT = BIT(1), | ||
1654 | WIPHY_WOWLAN_DISCONNECT = BIT(2), | ||
1655 | }; | ||
1656 | |||
1657 | /** | ||
1658 | * struct wiphy_wowlan_support - WoWLAN support data | ||
1659 | * @flags: see &enum wiphy_wowlan_support_flags | ||
1660 | * @n_patterns: number of supported wakeup patterns | ||
1661 | * (see nl80211.h for the pattern definition) | ||
1662 | * @pattern_max_len: maximum length of each pattern | ||
1663 | * @pattern_min_len: minimum length of each pattern | ||
1664 | */ | ||
1665 | struct wiphy_wowlan_support { | ||
1666 | u32 flags; | ||
1667 | int n_patterns; | ||
1668 | int pattern_max_len; | ||
1669 | int pattern_min_len; | ||
1670 | }; | ||
1671 | |||
1672 | /** | ||
1443 | * struct wiphy - wireless hardware description | 1673 | * struct wiphy - wireless hardware description |
1444 | * @reg_notifier: the driver's regulatory notification callback, | 1674 | * @reg_notifier: the driver's regulatory notification callback, |
1445 | * note that if your driver uses wiphy_apply_custom_regulatory() | 1675 | * note that if your driver uses wiphy_apply_custom_regulatory() |
@@ -1476,6 +1706,11 @@ struct ieee80211_txrx_stypes { | |||
1476 | * @priv: driver private data (sized according to wiphy_new() parameter) | 1706 | * @priv: driver private data (sized according to wiphy_new() parameter) |
1477 | * @interface_modes: bitmask of interfaces types valid for this wiphy, | 1707 | * @interface_modes: bitmask of interfaces types valid for this wiphy, |
1478 | * must be set by driver | 1708 | * must be set by driver |
1709 | * @iface_combinations: Valid interface combinations array, should not | ||
1710 | * list single interface types. | ||
1711 | * @n_iface_combinations: number of entries in @iface_combinations array. | ||
1712 | * @software_iftypes: bitmask of software interface types, these are not | ||
1713 | * subject to any restrictions since they are purely managed in SW. | ||
1479 | * @flags: wiphy flags, see &enum wiphy_flags | 1714 | * @flags: wiphy flags, see &enum wiphy_flags |
1480 | * @bss_priv_size: each BSS struct has private data allocated with it, | 1715 | * @bss_priv_size: each BSS struct has private data allocated with it, |
1481 | * this variable determines its size | 1716 | * this variable determines its size |
@@ -1506,6 +1741,8 @@ struct ieee80211_txrx_stypes { | |||
1506 | * | 1741 | * |
1507 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation | 1742 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation |
1508 | * may request, if implemented. | 1743 | * may request, if implemented. |
1744 | * | ||
1745 | * @wowlan: WoWLAN support information | ||
1509 | */ | 1746 | */ |
1510 | struct wiphy { | 1747 | struct wiphy { |
1511 | /* assign these fields before you register the wiphy */ | 1748 | /* assign these fields before you register the wiphy */ |
@@ -1518,6 +1755,10 @@ struct wiphy { | |||
1518 | 1755 | ||
1519 | const struct ieee80211_txrx_stypes *mgmt_stypes; | 1756 | const struct ieee80211_txrx_stypes *mgmt_stypes; |
1520 | 1757 | ||
1758 | const struct ieee80211_iface_combination *iface_combinations; | ||
1759 | int n_iface_combinations; | ||
1760 | u16 software_iftypes; | ||
1761 | |||
1521 | u16 n_addresses; | 1762 | u16 n_addresses; |
1522 | 1763 | ||
1523 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1764 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
@@ -1543,6 +1784,8 @@ struct wiphy { | |||
1543 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 1784 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
1544 | u32 hw_version; | 1785 | u32 hw_version; |
1545 | 1786 | ||
1787 | struct wiphy_wowlan_support wowlan; | ||
1788 | |||
1546 | u16 max_remain_on_channel_duration; | 1789 | u16 max_remain_on_channel_duration; |
1547 | 1790 | ||
1548 | u8 max_num_pmkids; | 1791 | u8 max_num_pmkids; |
@@ -1726,6 +1969,8 @@ struct cfg80211_cached_keys; | |||
1726 | * @mgmt_registrations_lock: lock for the list | 1969 | * @mgmt_registrations_lock: lock for the list |
1727 | * @mtx: mutex used to lock data in this struct | 1970 | * @mtx: mutex used to lock data in this struct |
1728 | * @cleanup_work: work struct used for cleanup that can't be done directly | 1971 | * @cleanup_work: work struct used for cleanup that can't be done directly |
1972 | * @beacon_interval: beacon interval used on this device for transmitting | ||
1973 | * beacons, 0 when not valid | ||
1729 | */ | 1974 | */ |
1730 | struct wireless_dev { | 1975 | struct wireless_dev { |
1731 | struct wiphy *wiphy; | 1976 | struct wiphy *wiphy; |
@@ -1766,6 +2011,8 @@ struct wireless_dev { | |||
1766 | bool ps; | 2011 | bool ps; |
1767 | int ps_timeout; | 2012 | int ps_timeout; |
1768 | 2013 | ||
2014 | int beacon_interval; | ||
2015 | |||
1769 | #ifdef CONFIG_CFG80211_WEXT | 2016 | #ifdef CONFIG_CFG80211_WEXT |
1770 | /* wext data */ | 2017 | /* wext data */ |
1771 | struct { | 2018 | struct { |
@@ -1991,10 +2238,12 @@ int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, | |||
1991 | * @addr: The device MAC address. | 2238 | * @addr: The device MAC address. |
1992 | * @iftype: The device interface type. | 2239 | * @iftype: The device interface type. |
1993 | * @extra_headroom: The hardware extra headroom for SKBs in the @list. | 2240 | * @extra_headroom: The hardware extra headroom for SKBs in the @list. |
2241 | * @has_80211_header: Set it true if SKB is with IEEE 802.11 header. | ||
1994 | */ | 2242 | */ |
1995 | void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, | 2243 | void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, |
1996 | const u8 *addr, enum nl80211_iftype iftype, | 2244 | const u8 *addr, enum nl80211_iftype iftype, |
1997 | const unsigned int extra_headroom); | 2245 | const unsigned int extra_headroom, |
2246 | bool has_80211_header); | ||
1998 | 2247 | ||
1999 | /** | 2248 | /** |
2000 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame | 2249 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame |
@@ -2214,6 +2463,24 @@ int cfg80211_wext_siwpmksa(struct net_device *dev, | |||
2214 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); | 2463 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); |
2215 | 2464 | ||
2216 | /** | 2465 | /** |
2466 | * cfg80211_sched_scan_results - notify that new scan results are available | ||
2467 | * | ||
2468 | * @wiphy: the wiphy which got scheduled scan results | ||
2469 | */ | ||
2470 | void cfg80211_sched_scan_results(struct wiphy *wiphy); | ||
2471 | |||
2472 | /** | ||
2473 | * cfg80211_sched_scan_stopped - notify that the scheduled scan has stopped | ||
2474 | * | ||
2475 | * @wiphy: the wiphy on which the scheduled scan stopped | ||
2476 | * | ||
2477 | * The driver can call this function to inform cfg80211 that the | ||
2478 | * scheduled scan had to be stopped, for whatever reason. The driver | ||
2479 | * is then called back via the sched_scan_stop operation when done. | ||
2480 | */ | ||
2481 | void cfg80211_sched_scan_stopped(struct wiphy *wiphy); | ||
2482 | |||
2483 | /** | ||
2217 | * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame | 2484 | * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame |
2218 | * | 2485 | * |
2219 | * @wiphy: the wiphy reporting the BSS | 2486 | * @wiphy: the wiphy reporting the BSS |
@@ -2450,6 +2717,22 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
2450 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); | 2717 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); |
2451 | 2718 | ||
2452 | /** | 2719 | /** |
2720 | * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate | ||
2721 | * | ||
2722 | * @dev: network device | ||
2723 | * @macaddr: the MAC address of the new candidate | ||
2724 | * @ie: information elements advertised by the peer candidate | ||
2725 | * @ie_len: lenght of the information elements buffer | ||
2726 | * @gfp: allocation flags | ||
2727 | * | ||
2728 | * This function notifies cfg80211 that the mesh peer candidate has been | ||
2729 | * detected, most likely via a beacon or, less likely, via a probe response. | ||
2730 | * cfg80211 then sends a notification to userspace. | ||
2731 | */ | ||
2732 | void cfg80211_notify_new_peer_candidate(struct net_device *dev, | ||
2733 | const u8 *macaddr, const u8 *ie, u8 ie_len, gfp_t gfp); | ||
2734 | |||
2735 | /** | ||
2453 | * DOC: RFkill integration | 2736 | * DOC: RFkill integration |
2454 | * | 2737 | * |
2455 | * RFkill integration in cfg80211 is almost invisible to drivers, | 2738 | * RFkill integration in cfg80211 is almost invisible to drivers, |
@@ -2596,6 +2879,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
2596 | * cfg80211_roamed - notify cfg80211 of roaming | 2879 | * cfg80211_roamed - notify cfg80211 of roaming |
2597 | * | 2880 | * |
2598 | * @dev: network device | 2881 | * @dev: network device |
2882 | * @channel: the channel of the new AP | ||
2599 | * @bssid: the BSSID of the new AP | 2883 | * @bssid: the BSSID of the new AP |
2600 | * @req_ie: association request IEs (maybe be %NULL) | 2884 | * @req_ie: association request IEs (maybe be %NULL) |
2601 | * @req_ie_len: association request IEs length | 2885 | * @req_ie_len: association request IEs length |
@@ -2606,7 +2890,9 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | |||
2606 | * It should be called by the underlying driver whenever it roamed | 2890 | * It should be called by the underlying driver whenever it roamed |
2607 | * from one AP to another while connected. | 2891 | * from one AP to another while connected. |
2608 | */ | 2892 | */ |
2609 | void cfg80211_roamed(struct net_device *dev, const u8 *bssid, | 2893 | void cfg80211_roamed(struct net_device *dev, |
2894 | struct ieee80211_channel *channel, | ||
2895 | const u8 *bssid, | ||
2610 | const u8 *req_ie, size_t req_ie_len, | 2896 | const u8 *req_ie, size_t req_ie_len, |
2611 | const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); | 2897 | const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); |
2612 | 2898 | ||
@@ -2667,6 +2953,15 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
2667 | struct station_info *sinfo, gfp_t gfp); | 2953 | struct station_info *sinfo, gfp_t gfp); |
2668 | 2954 | ||
2669 | /** | 2955 | /** |
2956 | * cfg80211_del_sta - notify userspace about deletion of a station | ||
2957 | * | ||
2958 | * @dev: the netdev | ||
2959 | * @mac_addr: the station's address | ||
2960 | * @gfp: allocation flags | ||
2961 | */ | ||
2962 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | ||
2963 | |||
2964 | /** | ||
2670 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 2965 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
2671 | * @dev: network device | 2966 | * @dev: network device |
2672 | * @freq: Frequency on which the frame was received in MHz | 2967 | * @freq: Frequency on which the frame was received in MHz |
diff --git a/include/net/compat.h b/include/net/compat.h index 28d5428ec6a2..9ee75edcc295 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -43,6 +43,8 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | |||
43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); | 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); |
45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); | 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); |
46 | extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, | ||
47 | unsigned, unsigned); | ||
46 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); | 48 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); |
47 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, | 49 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, |
48 | unsigned, unsigned, | 50 | unsigned, unsigned, |
diff --git a/include/net/dst.h b/include/net/dst.h index 75b95df4afe7..7d15d238b6ec 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -16,13 +16,6 @@ | |||
16 | #include <net/neighbour.h> | 16 | #include <net/neighbour.h> |
17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
18 | 18 | ||
19 | /* | ||
20 | * 0 - no debugging messages | ||
21 | * 1 - rare events and bugs (default) | ||
22 | * 2 - trace mode. | ||
23 | */ | ||
24 | #define RT_CACHE_DEBUG 0 | ||
25 | |||
26 | #define DST_GC_MIN (HZ/10) | 19 | #define DST_GC_MIN (HZ/10) |
27 | #define DST_GC_INC (HZ/2) | 20 | #define DST_GC_INC (HZ/2) |
28 | #define DST_GC_MAX (120*HZ) | 21 | #define DST_GC_MAX (120*HZ) |
@@ -92,8 +85,6 @@ struct dst_entry { | |||
92 | }; | 85 | }; |
93 | }; | 86 | }; |
94 | 87 | ||
95 | #ifdef __KERNEL__ | ||
96 | |||
97 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); | 88 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); |
98 | extern const u32 dst_default_metrics[RTAX_MAX]; | 89 | extern const u32 dst_default_metrics[RTAX_MAX]; |
99 | 90 | ||
@@ -120,6 +111,8 @@ static inline u32 *dst_metrics_write_ptr(struct dst_entry *dst) | |||
120 | { | 111 | { |
121 | unsigned long p = dst->_metrics; | 112 | unsigned long p = dst->_metrics; |
122 | 113 | ||
114 | BUG_ON(!p); | ||
115 | |||
123 | if (p & DST_METRICS_READ_ONLY) | 116 | if (p & DST_METRICS_READ_ONLY) |
124 | return dst->ops->cow_metrics(dst, p); | 117 | return dst->ops->cow_metrics(dst, p); |
125 | return __DST_METRICS_PTR(p); | 118 | return __DST_METRICS_PTR(p); |
@@ -352,7 +345,8 @@ static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb) | |||
352 | } | 345 | } |
353 | 346 | ||
354 | extern int dst_discard(struct sk_buff *skb); | 347 | extern int dst_discard(struct sk_buff *skb); |
355 | extern void *dst_alloc(struct dst_ops * ops, int initial_ref); | 348 | extern void *dst_alloc(struct dst_ops * ops, struct net_device *dev, |
349 | int initial_ref, int initial_obsolete, int flags); | ||
356 | extern void __dst_free(struct dst_entry * dst); | 350 | extern void __dst_free(struct dst_entry * dst); |
357 | extern struct dst_entry *dst_destroy(struct dst_entry * dst); | 351 | extern struct dst_entry *dst_destroy(struct dst_entry * dst); |
358 | 352 | ||
@@ -438,6 +432,5 @@ extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig | |||
438 | const struct flowi *fl, struct sock *sk, | 432 | const struct flowi *fl, struct sock *sk, |
439 | int flags); | 433 | int flags); |
440 | #endif | 434 | #endif |
441 | #endif | ||
442 | 435 | ||
443 | #endif /* _NET_DST_H */ | 436 | #endif /* _NET_DST_H */ |
diff --git a/include/net/flow.h b/include/net/flow.h index 7fe5a0f9483a..c6d5fe5ec1bf 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -26,8 +26,8 @@ struct flowi_common { | |||
26 | 26 | ||
27 | union flowi_uli { | 27 | union flowi_uli { |
28 | struct { | 28 | struct { |
29 | __be16 sport; | ||
30 | __be16 dport; | 29 | __be16 dport; |
30 | __be16 sport; | ||
31 | } ports; | 31 | } ports; |
32 | 32 | ||
33 | struct { | 33 | struct { |
@@ -36,8 +36,8 @@ union flowi_uli { | |||
36 | } icmpt; | 36 | } icmpt; |
37 | 37 | ||
38 | struct { | 38 | struct { |
39 | __le16 sport; | ||
40 | __le16 dport; | 39 | __le16 dport; |
40 | __le16 sport; | ||
41 | } dnports; | 41 | } dnports; |
42 | 42 | ||
43 | __be32 spi; | 43 | __be32 spi; |
@@ -70,6 +70,27 @@ struct flowi4 { | |||
70 | #define fl4_gre_key uli.gre_key | 70 | #define fl4_gre_key uli.gre_key |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static inline void flowi4_init_output(struct flowi4 *fl4, int oif, | ||
74 | __u32 mark, __u8 tos, __u8 scope, | ||
75 | __u8 proto, __u8 flags, | ||
76 | __be32 daddr, __be32 saddr, | ||
77 | __be16 dport, __be32 sport) | ||
78 | { | ||
79 | fl4->flowi4_oif = oif; | ||
80 | fl4->flowi4_iif = 0; | ||
81 | fl4->flowi4_mark = mark; | ||
82 | fl4->flowi4_tos = tos; | ||
83 | fl4->flowi4_scope = scope; | ||
84 | fl4->flowi4_proto = proto; | ||
85 | fl4->flowi4_flags = flags; | ||
86 | fl4->flowi4_secid = 0; | ||
87 | fl4->daddr = daddr; | ||
88 | fl4->saddr = saddr; | ||
89 | fl4->fl4_dport = dport; | ||
90 | fl4->fl4_sport = sport; | ||
91 | } | ||
92 | |||
93 | |||
73 | struct flowi6 { | 94 | struct flowi6 { |
74 | struct flowi_common __fl_common; | 95 | struct flowi_common __fl_common; |
75 | #define flowi6_oif __fl_common.flowic_oif | 96 | #define flowi6_oif __fl_common.flowic_oif |
diff --git a/include/net/garp.h b/include/net/garp.h index f4c295984c45..834d8add9e5f 100644 --- a/include/net/garp.h +++ b/include/net/garp.h | |||
@@ -104,10 +104,12 @@ struct garp_applicant { | |||
104 | struct sk_buff_head queue; | 104 | struct sk_buff_head queue; |
105 | struct sk_buff *pdu; | 105 | struct sk_buff *pdu; |
106 | struct rb_root gid; | 106 | struct rb_root gid; |
107 | struct rcu_head rcu; | ||
107 | }; | 108 | }; |
108 | 109 | ||
109 | struct garp_port { | 110 | struct garp_port { |
110 | struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1]; | 111 | struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1]; |
112 | struct rcu_head rcu; | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | extern int garp_register_application(struct garp_application *app); | 115 | extern int garp_register_application(struct garp_application *app); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index b4c7c1cbcf40..d420f28b6d60 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -260,7 +260,7 @@ static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) | |||
260 | 260 | ||
261 | /** | 261 | /** |
262 | * gennlmsg_data - head of message payload | 262 | * gennlmsg_data - head of message payload |
263 | * @gnlh: genetlink messsage header | 263 | * @gnlh: genetlink message header |
264 | */ | 264 | */ |
265 | static inline void *genlmsg_data(const struct genlmsghdr *gnlh) | 265 | static inline void *genlmsg_data(const struct genlmsghdr *gnlh) |
266 | { | 266 | { |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index fccc2180c61b..11cf373970a9 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -30,8 +30,6 @@ | |||
30 | #define IF_PREFIX_ONLINK 0x01 | 30 | #define IF_PREFIX_ONLINK 0x01 |
31 | #define IF_PREFIX_AUTOCONF 0x02 | 31 | #define IF_PREFIX_AUTOCONF 0x02 |
32 | 32 | ||
33 | #ifdef __KERNEL__ | ||
34 | |||
35 | enum { | 33 | enum { |
36 | INET6_IFADDR_STATE_DAD, | 34 | INET6_IFADDR_STATE_DAD, |
37 | INET6_IFADDR_STATE_POSTDAD, | 35 | INET6_IFADDR_STATE_POSTDAD, |
@@ -156,8 +154,8 @@ struct ifacaddr6 { | |||
156 | struct ipv6_devstat { | 154 | struct ipv6_devstat { |
157 | struct proc_dir_entry *proc_dir_entry; | 155 | struct proc_dir_entry *proc_dir_entry; |
158 | DEFINE_SNMP_STAT(struct ipstats_mib, ipv6); | 156 | DEFINE_SNMP_STAT(struct ipstats_mib, ipv6); |
159 | DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6); | 157 | DEFINE_SNMP_STAT_ATOMIC(struct icmpv6_mib_device, icmpv6dev); |
160 | DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); | 158 | DEFINE_SNMP_STAT_ATOMIC(struct icmpv6msg_mib_device, icmpv6msgdev); |
161 | }; | 159 | }; |
162 | 160 | ||
163 | struct inet6_dev { | 161 | struct inet6_dev { |
@@ -196,7 +194,7 @@ struct inet6_dev { | |||
196 | struct rcu_head rcu; | 194 | struct rcu_head rcu; |
197 | }; | 195 | }; |
198 | 196 | ||
199 | static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) | 197 | static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf) |
200 | { | 198 | { |
201 | /* | 199 | /* |
202 | * +-------+-------+-------+-------+-------+-------+ | 200 | * +-------+-------+-------+-------+-------+-------+ |
@@ -210,7 +208,7 @@ static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) | |||
210 | memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); | 208 | memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); |
211 | } | 209 | } |
212 | 210 | ||
213 | static inline void ipv6_tr_mc_map(struct in6_addr *addr, char *buf) | 211 | static inline void ipv6_tr_mc_map(const struct in6_addr *addr, char *buf) |
214 | { | 212 | { |
215 | /* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */ | 213 | /* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */ |
216 | 214 | ||
@@ -303,4 +301,3 @@ static inline int ipv6_ipgre_mc_map(const struct in6_addr *addr, | |||
303 | } | 301 | } |
304 | 302 | ||
305 | #endif | 303 | #endif |
306 | #endif | ||
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index ff013505236b..3207e58ee019 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
@@ -41,5 +41,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | |||
41 | 41 | ||
42 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 42 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
43 | 43 | ||
44 | extern int inet6_csk_xmit(struct sk_buff *skb); | 44 | extern int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); |
45 | #endif /* _INET6_CONNECTION_SOCK_H */ | 45 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 6ac4e3b5007f..e6db62e756dc 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -36,7 +36,7 @@ struct tcp_congestion_ops; | |||
36 | * (i.e. things that depend on the address family) | 36 | * (i.e. things that depend on the address family) |
37 | */ | 37 | */ |
38 | struct inet_connection_sock_af_ops { | 38 | struct inet_connection_sock_af_ops { |
39 | int (*queue_xmit)(struct sk_buff *skb); | 39 | int (*queue_xmit)(struct sk_buff *skb, struct flowi *fl); |
40 | void (*send_check)(struct sock *sk, struct sk_buff *skb); | 40 | void (*send_check)(struct sock *sk, struct sk_buff *skb); |
41 | int (*rebuild_header)(struct sock *sk); | 41 | int (*rebuild_header)(struct sock *sk); |
42 | int (*conn_request)(struct sock *sk, struct sk_buff *skb); | 42 | int (*conn_request)(struct sock *sk, struct sk_buff *skb); |
@@ -249,7 +249,11 @@ extern int inet_csk_bind_conflict(const struct sock *sk, | |||
249 | extern int inet_csk_get_port(struct sock *sk, unsigned short snum); | 249 | extern int inet_csk_get_port(struct sock *sk, unsigned short snum); |
250 | 250 | ||
251 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, | 251 | extern struct dst_entry* inet_csk_route_req(struct sock *sk, |
252 | struct flowi4 *fl4, | ||
252 | const struct request_sock *req); | 253 | const struct request_sock *req); |
254 | extern struct dst_entry* inet_csk_route_child_sock(struct sock *sk, | ||
255 | struct sock *newsk, | ||
256 | const struct request_sock *req); | ||
253 | 257 | ||
254 | static inline void inet_csk_reqsk_queue_add(struct sock *sk, | 258 | static inline void inet_csk_reqsk_queue_add(struct sock *sk, |
255 | struct request_sock *req, | 259 | struct request_sock *req, |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 7a37369f8ea3..caaff5f5f39f 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -57,7 +57,15 @@ struct ip_options { | |||
57 | unsigned char __data[0]; | 57 | unsigned char __data[0]; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) | 60 | struct ip_options_rcu { |
61 | struct rcu_head rcu; | ||
62 | struct ip_options opt; | ||
63 | }; | ||
64 | |||
65 | struct ip_options_data { | ||
66 | struct ip_options_rcu opt; | ||
67 | char data[40]; | ||
68 | }; | ||
61 | 69 | ||
62 | struct inet_request_sock { | 70 | struct inet_request_sock { |
63 | struct request_sock req; | 71 | struct request_sock req; |
@@ -78,7 +86,7 @@ struct inet_request_sock { | |||
78 | acked : 1, | 86 | acked : 1, |
79 | no_srccheck: 1; | 87 | no_srccheck: 1; |
80 | kmemcheck_bitfield_end(flags); | 88 | kmemcheck_bitfield_end(flags); |
81 | struct ip_options *opt; | 89 | struct ip_options_rcu *opt; |
82 | }; | 90 | }; |
83 | 91 | ||
84 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | 92 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) |
@@ -88,17 +96,21 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | |||
88 | 96 | ||
89 | struct inet_cork { | 97 | struct inet_cork { |
90 | unsigned int flags; | 98 | unsigned int flags; |
91 | unsigned int fragsize; | 99 | __be32 addr; |
92 | struct ip_options *opt; | 100 | struct ip_options *opt; |
101 | unsigned int fragsize; | ||
93 | struct dst_entry *dst; | 102 | struct dst_entry *dst; |
94 | int length; /* Total length of all frames */ | 103 | int length; /* Total length of all frames */ |
95 | __be32 addr; | ||
96 | struct flowi fl; | ||
97 | struct page *page; | 104 | struct page *page; |
98 | u32 off; | 105 | u32 off; |
99 | u8 tx_flags; | 106 | u8 tx_flags; |
100 | }; | 107 | }; |
101 | 108 | ||
109 | struct inet_cork_full { | ||
110 | struct inet_cork base; | ||
111 | struct flowi fl; | ||
112 | }; | ||
113 | |||
102 | struct ip_mc_socklist; | 114 | struct ip_mc_socklist; |
103 | struct ipv6_pinfo; | 115 | struct ipv6_pinfo; |
104 | struct rtable; | 116 | struct rtable; |
@@ -140,7 +152,7 @@ struct inet_sock { | |||
140 | __be16 inet_sport; | 152 | __be16 inet_sport; |
141 | __u16 inet_id; | 153 | __u16 inet_id; |
142 | 154 | ||
143 | struct ip_options *opt; | 155 | struct ip_options_rcu __rcu *inet_opt; |
144 | __u8 tos; | 156 | __u8 tos; |
145 | __u8 min_ttl; | 157 | __u8 min_ttl; |
146 | __u8 mc_ttl; | 158 | __u8 mc_ttl; |
@@ -156,7 +168,7 @@ struct inet_sock { | |||
156 | int mc_index; | 168 | int mc_index; |
157 | __be32 mc_addr; | 169 | __be32 mc_addr; |
158 | struct ip_mc_socklist __rcu *mc_list; | 170 | struct ip_mc_socklist __rcu *mc_list; |
159 | struct inet_cork cork; | 171 | struct inet_cork_full cork; |
160 | }; | 172 | }; |
161 | 173 | ||
162 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ | 174 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index e6dd8da6b2ad..8a159cc3d68b 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -80,7 +80,7 @@ static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | |||
80 | return inet_getpeer(&daddr, create); | 80 | return inet_getpeer(&daddr, create); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) | 83 | static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, int create) |
84 | { | 84 | { |
85 | struct inetpeer_addr daddr; | 85 | struct inetpeer_addr daddr; |
86 | 86 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 7c416583b710..66dd49149208 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -52,7 +52,7 @@ static inline unsigned int ip_hdrlen(const struct sk_buff *skb) | |||
52 | struct ipcm_cookie { | 52 | struct ipcm_cookie { |
53 | __be32 addr; | 53 | __be32 addr; |
54 | int oif; | 54 | int oif; |
55 | struct ip_options *opt; | 55 | struct ip_options_rcu *opt; |
56 | __u8 tx_flags; | 56 | __u8 tx_flags; |
57 | }; | 57 | }; |
58 | 58 | ||
@@ -92,7 +92,7 @@ extern int igmp_mc_proc_init(void); | |||
92 | 92 | ||
93 | extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | 93 | extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, |
94 | __be32 saddr, __be32 daddr, | 94 | __be32 saddr, __be32 daddr, |
95 | struct ip_options *opt); | 95 | struct ip_options_rcu *opt); |
96 | extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, | 96 | extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, |
97 | struct packet_type *pt, struct net_device *orig_dev); | 97 | struct packet_type *pt, struct net_device *orig_dev); |
98 | extern int ip_local_deliver(struct sk_buff *skb); | 98 | extern int ip_local_deliver(struct sk_buff *skb); |
@@ -104,9 +104,9 @@ extern int ip_do_nat(struct sk_buff *skb); | |||
104 | extern void ip_send_check(struct iphdr *ip); | 104 | extern void ip_send_check(struct iphdr *ip); |
105 | extern int __ip_local_out(struct sk_buff *skb); | 105 | extern int __ip_local_out(struct sk_buff *skb); |
106 | extern int ip_local_out(struct sk_buff *skb); | 106 | extern int ip_local_out(struct sk_buff *skb); |
107 | extern int ip_queue_xmit(struct sk_buff *skb); | 107 | extern int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl); |
108 | extern void ip_init(void); | 108 | extern void ip_init(void); |
109 | extern int ip_append_data(struct sock *sk, | 109 | extern int ip_append_data(struct sock *sk, struct flowi4 *fl4, |
110 | int getfrag(void *from, char *to, int offset, int len, | 110 | int getfrag(void *from, char *to, int offset, int len, |
111 | int odd, struct sk_buff *skb), | 111 | int odd, struct sk_buff *skb), |
112 | void *from, int len, int protolen, | 112 | void *from, int len, int protolen, |
@@ -114,15 +114,17 @@ extern int ip_append_data(struct sock *sk, | |||
114 | struct rtable **rt, | 114 | struct rtable **rt, |
115 | unsigned int flags); | 115 | unsigned int flags); |
116 | extern int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb); | 116 | extern int ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb); |
117 | extern ssize_t ip_append_page(struct sock *sk, struct page *page, | 117 | extern ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, |
118 | int offset, size_t size, int flags); | 118 | int offset, size_t size, int flags); |
119 | extern struct sk_buff *__ip_make_skb(struct sock *sk, | 119 | extern struct sk_buff *__ip_make_skb(struct sock *sk, |
120 | struct flowi4 *fl4, | ||
120 | struct sk_buff_head *queue, | 121 | struct sk_buff_head *queue, |
121 | struct inet_cork *cork); | 122 | struct inet_cork *cork); |
122 | extern int ip_send_skb(struct sk_buff *skb); | 123 | extern int ip_send_skb(struct sk_buff *skb); |
123 | extern int ip_push_pending_frames(struct sock *sk); | 124 | extern int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4); |
124 | extern void ip_flush_pending_frames(struct sock *sk); | 125 | extern void ip_flush_pending_frames(struct sock *sk); |
125 | extern struct sk_buff *ip_make_skb(struct sock *sk, | 126 | extern struct sk_buff *ip_make_skb(struct sock *sk, |
127 | struct flowi4 *fl4, | ||
126 | int getfrag(void *from, char *to, int offset, int len, | 128 | int getfrag(void *from, char *to, int offset, int len, |
127 | int odd, struct sk_buff *skb), | 129 | int odd, struct sk_buff *skb), |
128 | void *from, int length, int transhdrlen, | 130 | void *from, int length, int transhdrlen, |
@@ -130,9 +132,9 @@ extern struct sk_buff *ip_make_skb(struct sock *sk, | |||
130 | struct rtable **rtp, | 132 | struct rtable **rtp, |
131 | unsigned int flags); | 133 | unsigned int flags); |
132 | 134 | ||
133 | static inline struct sk_buff *ip_finish_skb(struct sock *sk) | 135 | static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4) |
134 | { | 136 | { |
135 | return __ip_make_skb(sk, &sk->sk_write_queue, &inet_sk(sk)->cork); | 137 | return __ip_make_skb(sk, fl4, &sk->sk_write_queue, &inet_sk(sk)->cork.base); |
136 | } | 138 | } |
137 | 139 | ||
138 | /* datagram.c */ | 140 | /* datagram.c */ |
@@ -172,8 +174,8 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
172 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; | 174 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; |
173 | } | 175 | } |
174 | 176 | ||
175 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | 177 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
176 | unsigned int len); | 178 | struct ip_reply_arg *arg, unsigned int len); |
177 | 179 | ||
178 | struct ipv4_config { | 180 | struct ipv4_config { |
179 | int log_martians; | 181 | int log_martians; |
@@ -416,14 +418,15 @@ extern int ip_forward(struct sk_buff *skb); | |||
416 | * Functions provided by ip_options.c | 418 | * Functions provided by ip_options.c |
417 | */ | 419 | */ |
418 | 420 | ||
419 | extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag); | 421 | extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, |
422 | __be32 daddr, struct rtable *rt, int is_frag); | ||
420 | extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); | 423 | extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); |
421 | extern void ip_options_fragment(struct sk_buff *skb); | 424 | extern void ip_options_fragment(struct sk_buff *skb); |
422 | extern int ip_options_compile(struct net *net, | 425 | extern int ip_options_compile(struct net *net, |
423 | struct ip_options *opt, struct sk_buff *skb); | 426 | struct ip_options *opt, struct sk_buff *skb); |
424 | extern int ip_options_get(struct net *net, struct ip_options **optp, | 427 | extern int ip_options_get(struct net *net, struct ip_options_rcu **optp, |
425 | unsigned char *data, int optlen); | 428 | unsigned char *data, int optlen); |
426 | extern int ip_options_get_from_user(struct net *net, struct ip_options **optp, | 429 | extern int ip_options_get_from_user(struct net *net, struct ip_options_rcu **optp, |
427 | unsigned char __user *data, int optlen); | 430 | unsigned char __user *data, int optlen); |
428 | extern void ip_options_undo(struct ip_options * opt); | 431 | extern void ip_options_undo(struct ip_options * opt); |
429 | extern void ip_forward_options(struct sk_buff *skb); | 432 | extern void ip_forward_options(struct sk_buff *skb); |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index bc3cde0a810c..477ef75f3873 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -13,8 +13,6 @@ | |||
13 | #ifndef _IP6_FIB_H | 13 | #ifndef _IP6_FIB_H |
14 | #define _IP6_FIB_H | 14 | #define _IP6_FIB_H |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #include <linux/ipv6_route.h> | 16 | #include <linux/ipv6_route.h> |
19 | #include <linux/rtnetlink.h> | 17 | #include <linux/rtnetlink.h> |
20 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
@@ -42,6 +40,7 @@ struct fib6_config { | |||
42 | 40 | ||
43 | struct in6_addr fc_dst; | 41 | struct in6_addr fc_dst; |
44 | struct in6_addr fc_src; | 42 | struct in6_addr fc_src; |
43 | struct in6_addr fc_prefsrc; | ||
45 | struct in6_addr fc_gateway; | 44 | struct in6_addr fc_gateway; |
46 | 45 | ||
47 | unsigned long fc_expires; | 46 | unsigned long fc_expires; |
@@ -107,6 +106,7 @@ struct rt6_info { | |||
107 | struct rt6key rt6i_dst ____cacheline_aligned_in_smp; | 106 | struct rt6key rt6i_dst ____cacheline_aligned_in_smp; |
108 | u32 rt6i_flags; | 107 | u32 rt6i_flags; |
109 | struct rt6key rt6i_src; | 108 | struct rt6key rt6i_src; |
109 | struct rt6key rt6i_prefsrc; | ||
110 | u32 rt6i_metric; | 110 | u32 rt6i_metric; |
111 | u32 rt6i_peer_genid; | 111 | u32 rt6i_peer_genid; |
112 | 112 | ||
@@ -196,12 +196,12 @@ extern struct dst_entry *fib6_rule_lookup(struct net *net, | |||
196 | pol_lookup_t lookup); | 196 | pol_lookup_t lookup); |
197 | 197 | ||
198 | extern struct fib6_node *fib6_lookup(struct fib6_node *root, | 198 | extern struct fib6_node *fib6_lookup(struct fib6_node *root, |
199 | struct in6_addr *daddr, | 199 | const struct in6_addr *daddr, |
200 | struct in6_addr *saddr); | 200 | const struct in6_addr *saddr); |
201 | 201 | ||
202 | struct fib6_node *fib6_locate(struct fib6_node *root, | 202 | struct fib6_node *fib6_locate(struct fib6_node *root, |
203 | struct in6_addr *daddr, int dst_len, | 203 | const struct in6_addr *daddr, int dst_len, |
204 | struct in6_addr *saddr, int src_len); | 204 | const struct in6_addr *saddr, int src_len); |
205 | 205 | ||
206 | extern void fib6_clean_all(struct net *net, | 206 | extern void fib6_clean_all(struct net *net, |
207 | int (*func)(struct rt6_info *, void *arg), | 207 | int (*func)(struct rt6_info *, void *arg), |
@@ -238,4 +238,3 @@ static inline void fib6_rules_cleanup(void) | |||
238 | } | 238 | } |
239 | #endif | 239 | #endif |
240 | #endif | 240 | #endif |
241 | #endif | ||
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index c850e5fb967c..5e91b72fc718 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -21,8 +21,6 @@ struct route_info { | |||
21 | __u8 prefix[0]; /* 0,8 or 16 */ | 21 | __u8 prefix[0]; /* 0,8 or 16 */ |
22 | }; | 22 | }; |
23 | 23 | ||
24 | #ifdef __KERNEL__ | ||
25 | |||
26 | #include <net/flow.h> | 24 | #include <net/flow.h> |
27 | #include <net/ip6_fib.h> | 25 | #include <net/ip6_fib.h> |
28 | #include <net/sock.h> | 26 | #include <net/sock.h> |
@@ -84,6 +82,12 @@ extern int ip6_route_add(struct fib6_config *cfg); | |||
84 | extern int ip6_ins_rt(struct rt6_info *); | 82 | extern int ip6_ins_rt(struct rt6_info *); |
85 | extern int ip6_del_rt(struct rt6_info *); | 83 | extern int ip6_del_rt(struct rt6_info *); |
86 | 84 | ||
85 | extern int ip6_route_get_saddr(struct net *net, | ||
86 | struct rt6_info *rt, | ||
87 | const struct in6_addr *daddr, | ||
88 | unsigned int prefs, | ||
89 | struct in6_addr *saddr); | ||
90 | |||
87 | extern struct rt6_info *rt6_lookup(struct net *net, | 91 | extern struct rt6_info *rt6_lookup(struct net *net, |
88 | const struct in6_addr *daddr, | 92 | const struct in6_addr *daddr, |
89 | const struct in6_addr *saddr, | 93 | const struct in6_addr *saddr, |
@@ -106,9 +110,9 @@ extern int ip6_dst_hoplimit(struct dst_entry *dst); | |||
106 | * support functions for ND | 110 | * support functions for ND |
107 | * | 111 | * |
108 | */ | 112 | */ |
109 | extern struct rt6_info * rt6_get_dflt_router(struct in6_addr *addr, | 113 | extern struct rt6_info * rt6_get_dflt_router(const struct in6_addr *addr, |
110 | struct net_device *dev); | 114 | struct net_device *dev); |
111 | extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, | 115 | extern struct rt6_info * rt6_add_dflt_router(const struct in6_addr *gwaddr, |
112 | struct net_device *dev, | 116 | struct net_device *dev, |
113 | unsigned int pref); | 117 | unsigned int pref); |
114 | 118 | ||
@@ -116,17 +120,17 @@ extern void rt6_purge_dflt_routers(struct net *net); | |||
116 | 120 | ||
117 | extern int rt6_route_rcv(struct net_device *dev, | 121 | extern int rt6_route_rcv(struct net_device *dev, |
118 | u8 *opt, int len, | 122 | u8 *opt, int len, |
119 | struct in6_addr *gwaddr); | 123 | const struct in6_addr *gwaddr); |
120 | 124 | ||
121 | extern void rt6_redirect(struct in6_addr *dest, | 125 | extern void rt6_redirect(const struct in6_addr *dest, |
122 | struct in6_addr *src, | 126 | const struct in6_addr *src, |
123 | struct in6_addr *saddr, | 127 | const struct in6_addr *saddr, |
124 | struct neighbour *neigh, | 128 | struct neighbour *neigh, |
125 | u8 *lladdr, | 129 | u8 *lladdr, |
126 | int on_link); | 130 | int on_link); |
127 | 131 | ||
128 | extern void rt6_pmtu_discovery(struct in6_addr *daddr, | 132 | extern void rt6_pmtu_discovery(const struct in6_addr *daddr, |
129 | struct in6_addr *saddr, | 133 | const struct in6_addr *saddr, |
130 | struct net_device *dev, | 134 | struct net_device *dev, |
131 | u32 pmtu); | 135 | u32 pmtu); |
132 | 136 | ||
@@ -141,6 +145,7 @@ struct rt6_rtnl_dump_arg { | |||
141 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); | 145 | extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); |
142 | extern void rt6_ifdown(struct net *net, struct net_device *dev); | 146 | extern void rt6_ifdown(struct net *net, struct net_device *dev); |
143 | extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); | 147 | extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); |
148 | extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); | ||
144 | 149 | ||
145 | 150 | ||
146 | /* | 151 | /* |
@@ -186,4 +191,3 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
186 | } | 191 | } |
187 | 192 | ||
188 | #endif | 193 | #endif |
189 | #endif | ||
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index e5d66ec88cf6..10422ef14e28 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -160,7 +160,8 @@ struct fib_table { | |||
160 | struct hlist_node tb_hlist; | 160 | struct hlist_node tb_hlist; |
161 | u32 tb_id; | 161 | u32 tb_id; |
162 | int tb_default; | 162 | int tb_default; |
163 | unsigned char tb_data[0]; | 163 | int tb_num_default; |
164 | unsigned long tb_data[0]; | ||
164 | }; | 165 | }; |
165 | 166 | ||
166 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, | 167 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, |
@@ -227,9 +228,9 @@ extern struct fib_table *fib_get_table(struct net *net, u32 id); | |||
227 | /* Exported by fib_frontend.c */ | 228 | /* Exported by fib_frontend.c */ |
228 | extern const struct nla_policy rtm_ipv4_policy[]; | 229 | extern const struct nla_policy rtm_ipv4_policy[]; |
229 | extern void ip_fib_init(void); | 230 | extern void ip_fib_init(void); |
230 | extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, | 231 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, |
231 | struct net_device *dev, __be32 *spec_dst, | 232 | u8 tos, int oif, struct net_device *dev, |
232 | u32 *itag, u32 mark); | 233 | __be32 *spec_dst, u32 *itag); |
233 | extern void fib_select_default(struct fib_result *res); | 234 | extern void fib_select_default(struct fib_result *res); |
234 | 235 | ||
235 | /* Exported by fib_semantics.c */ | 236 | /* Exported by fib_semantics.c */ |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 86aefed6140b..481f856c650f 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -8,9 +8,6 @@ | |||
8 | 8 | ||
9 | #include <linux/ip_vs.h> /* definitions shared with userland */ | 9 | #include <linux/ip_vs.h> /* definitions shared with userland */ |
10 | 10 | ||
11 | /* old ipvsadm versions still include this file directly */ | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | #include <asm/types.h> /* for __uXX types */ | 11 | #include <asm/types.h> /* for __uXX types */ |
15 | 12 | ||
16 | #include <linux/sysctl.h> /* for ctl_path */ | 13 | #include <linux/sysctl.h> /* for ctl_path */ |
@@ -668,9 +665,7 @@ struct ip_vs_dest { | |||
668 | struct dst_entry *dst_cache; /* destination cache entry */ | 665 | struct dst_entry *dst_cache; /* destination cache entry */ |
669 | u32 dst_rtos; /* RT_TOS(tos) for dst */ | 666 | u32 dst_rtos; /* RT_TOS(tos) for dst */ |
670 | u32 dst_cookie; | 667 | u32 dst_cookie; |
671 | #ifdef CONFIG_IP_VS_IPV6 | 668 | union nf_inet_addr dst_saddr; |
672 | struct in6_addr dst_saddr; | ||
673 | #endif | ||
674 | 669 | ||
675 | /* for virtual service */ | 670 | /* for virtual service */ |
676 | struct ip_vs_service *svc; /* service it belongs to */ | 671 | struct ip_vs_service *svc; /* service it belongs to */ |
@@ -802,7 +797,8 @@ struct netns_ipvs { | |||
802 | struct list_head rs_table[IP_VS_RTAB_SIZE]; | 797 | struct list_head rs_table[IP_VS_RTAB_SIZE]; |
803 | /* ip_vs_app */ | 798 | /* ip_vs_app */ |
804 | struct list_head app_list; | 799 | struct list_head app_list; |
805 | 800 | /* ip_vs_ftp */ | |
801 | struct ip_vs_app *ftp_app; | ||
806 | /* ip_vs_proto */ | 802 | /* ip_vs_proto */ |
807 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ | 803 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ |
808 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; | 804 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; |
@@ -1256,7 +1252,8 @@ extern int ip_vs_tunnel_xmit | |||
1256 | extern int ip_vs_dr_xmit | 1252 | extern int ip_vs_dr_xmit |
1257 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1253 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
1258 | extern int ip_vs_icmp_xmit | 1254 | extern int ip_vs_icmp_xmit |
1259 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, int offset); | 1255 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, |
1256 | int offset, unsigned int hooknum); | ||
1260 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); | 1257 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); |
1261 | 1258 | ||
1262 | #ifdef CONFIG_IP_VS_IPV6 | 1259 | #ifdef CONFIG_IP_VS_IPV6 |
@@ -1270,7 +1267,7 @@ extern int ip_vs_dr_xmit_v6 | |||
1270 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1267 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
1271 | extern int ip_vs_icmp_xmit_v6 | 1268 | extern int ip_vs_icmp_xmit_v6 |
1272 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1269 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, |
1273 | int offset); | 1270 | int offset, unsigned int hooknum); |
1274 | #endif | 1271 | #endif |
1275 | 1272 | ||
1276 | #ifdef CONFIG_SYSCTL | 1273 | #ifdef CONFIG_SYSCTL |
@@ -1432,6 +1429,4 @@ ip_vs_dest_conn_overhead(struct ip_vs_dest *dest) | |||
1432 | atomic_read(&dest->inactconns); | 1429 | atomic_read(&dest->inactconns); |
1433 | } | 1430 | } |
1434 | 1431 | ||
1435 | #endif /* __KERNEL__ */ | ||
1436 | |||
1437 | #endif /* _NET_IP_VS_H */ | 1432 | #endif /* _NET_IP_VS_H */ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 34200f9e6805..c033ed00df7d 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -77,11 +77,9 @@ | |||
77 | /* | 77 | /* |
78 | * Addr scopes | 78 | * Addr scopes |
79 | */ | 79 | */ |
80 | #ifdef __KERNEL__ | ||
81 | #define IPV6_ADDR_MC_SCOPE(a) \ | 80 | #define IPV6_ADDR_MC_SCOPE(a) \ |
82 | ((a)->s6_addr[1] & 0x0f) /* nonstandard */ | 81 | ((a)->s6_addr[1] & 0x0f) /* nonstandard */ |
83 | #define __IPV6_ADDR_SCOPE_INVALID -1 | 82 | #define __IPV6_ADDR_SCOPE_INVALID -1 |
84 | #endif | ||
85 | #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 | 83 | #define IPV6_ADDR_SCOPE_NODELOCAL 0x01 |
86 | #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 | 84 | #define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 |
87 | #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 | 85 | #define IPV6_ADDR_SCOPE_SITELOCAL 0x05 |
@@ -91,14 +89,12 @@ | |||
91 | /* | 89 | /* |
92 | * Addr flags | 90 | * Addr flags |
93 | */ | 91 | */ |
94 | #ifdef __KERNEL__ | ||
95 | #define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \ | 92 | #define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \ |
96 | ((a)->s6_addr[1] & 0x10) | 93 | ((a)->s6_addr[1] & 0x10) |
97 | #define IPV6_ADDR_MC_FLAG_PREFIX(a) \ | 94 | #define IPV6_ADDR_MC_FLAG_PREFIX(a) \ |
98 | ((a)->s6_addr[1] & 0x20) | 95 | ((a)->s6_addr[1] & 0x20) |
99 | #define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \ | 96 | #define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \ |
100 | ((a)->s6_addr[1] & 0x40) | 97 | ((a)->s6_addr[1] & 0x40) |
101 | #endif | ||
102 | 98 | ||
103 | /* | 99 | /* |
104 | * fragmentation header | 100 | * fragmentation header |
@@ -113,8 +109,6 @@ struct frag_hdr { | |||
113 | 109 | ||
114 | #define IP6_MF 0x0001 | 110 | #define IP6_MF 0x0001 |
115 | 111 | ||
116 | #ifdef __KERNEL__ | ||
117 | |||
118 | #include <net/sock.h> | 112 | #include <net/sock.h> |
119 | 113 | ||
120 | /* sysctls */ | 114 | /* sysctls */ |
@@ -129,6 +123,15 @@ extern struct ctl_path net_ipv6_ctl_path[]; | |||
129 | SNMP_INC_STATS##modifier((net)->mib.statname##_statistics, (field));\ | 123 | SNMP_INC_STATS##modifier((net)->mib.statname##_statistics, (field));\ |
130 | }) | 124 | }) |
131 | 125 | ||
126 | /* per device counters are atomic_long_t */ | ||
127 | #define _DEVINCATOMIC(net, statname, modifier, idev, field) \ | ||
128 | ({ \ | ||
129 | struct inet6_dev *_idev = (idev); \ | ||
130 | if (likely(_idev != NULL)) \ | ||
131 | SNMP_INC_STATS_ATOMIC_LONG((_idev)->stats.statname##dev, (field)); \ | ||
132 | SNMP_INC_STATS##modifier((net)->mib.statname##_statistics, (field));\ | ||
133 | }) | ||
134 | |||
132 | #define _DEVADD(net, statname, modifier, idev, field, val) \ | 135 | #define _DEVADD(net, statname, modifier, idev, field, val) \ |
133 | ({ \ | 136 | ({ \ |
134 | struct inet6_dev *_idev = (idev); \ | 137 | struct inet6_dev *_idev = (idev); \ |
@@ -160,16 +163,16 @@ extern struct ctl_path net_ipv6_ctl_path[]; | |||
160 | #define IP6_UPD_PO_STATS_BH(net, idev,field,val) \ | 163 | #define IP6_UPD_PO_STATS_BH(net, idev,field,val) \ |
161 | _DEVUPD(net, ipv6, 64_BH, idev, field, val) | 164 | _DEVUPD(net, ipv6, 64_BH, idev, field, val) |
162 | #define ICMP6_INC_STATS(net, idev, field) \ | 165 | #define ICMP6_INC_STATS(net, idev, field) \ |
163 | _DEVINC(net, icmpv6, , idev, field) | 166 | _DEVINCATOMIC(net, icmpv6, , idev, field) |
164 | #define ICMP6_INC_STATS_BH(net, idev, field) \ | 167 | #define ICMP6_INC_STATS_BH(net, idev, field) \ |
165 | _DEVINC(net, icmpv6, _BH, idev, field) | 168 | _DEVINCATOMIC(net, icmpv6, _BH, idev, field) |
166 | 169 | ||
167 | #define ICMP6MSGOUT_INC_STATS(net, idev, field) \ | 170 | #define ICMP6MSGOUT_INC_STATS(net, idev, field) \ |
168 | _DEVINC(net, icmpv6msg, , idev, field +256) | 171 | _DEVINCATOMIC(net, icmpv6msg, , idev, field +256) |
169 | #define ICMP6MSGOUT_INC_STATS_BH(net, idev, field) \ | 172 | #define ICMP6MSGOUT_INC_STATS_BH(net, idev, field) \ |
170 | _DEVINC(net, icmpv6msg, _BH, idev, field +256) | 173 | _DEVINCATOMIC(net, icmpv6msg, _BH, idev, field +256) |
171 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ | 174 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ |
172 | _DEVINC(net, icmpv6msg, _BH, idev, field) | 175 | _DEVINCATOMIC(net, icmpv6msg, _BH, idev, field) |
173 | 176 | ||
174 | struct ip6_ra_chain { | 177 | struct ip6_ra_chain { |
175 | struct ip6_ra_chain *next; | 178 | struct ip6_ra_chain *next; |
@@ -376,8 +379,8 @@ enum ip6_defrag_users { | |||
376 | struct ip6_create_arg { | 379 | struct ip6_create_arg { |
377 | __be32 id; | 380 | __be32 id; |
378 | u32 user; | 381 | u32 user; |
379 | struct in6_addr *src; | 382 | const struct in6_addr *src; |
380 | struct in6_addr *dst; | 383 | const struct in6_addr *dst; |
381 | }; | 384 | }; |
382 | 385 | ||
383 | void ip6_frag_init(struct inet_frag_queue *q, void *a); | 386 | void ip6_frag_init(struct inet_frag_queue *q, void *a); |
@@ -667,5 +670,4 @@ extern int ipv6_static_sysctl_register(void); | |||
667 | extern void ipv6_static_sysctl_unregister(void); | 670 | extern void ipv6_static_sysctl_unregister(void); |
668 | #endif | 671 | #endif |
669 | 672 | ||
670 | #endif /* __KERNEL__ */ | ||
671 | #endif /* _NET_IPV6_H */ | 673 | #endif /* _NET_IPV6_H */ |
diff --git a/include/net/ipx.h b/include/net/ipx.h index 05d7e4a88b49..c1fec6b464cc 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -80,7 +80,6 @@ struct ipx_route { | |||
80 | atomic_t refcnt; | 80 | atomic_t refcnt; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #ifdef __KERNEL__ | ||
84 | struct ipx_cb { | 83 | struct ipx_cb { |
85 | u8 ipx_tctrl; | 84 | u8 ipx_tctrl; |
86 | __be32 ipx_dest_net; | 85 | __be32 ipx_dest_net; |
@@ -116,7 +115,6 @@ static inline struct ipx_sock *ipx_sk(struct sock *sk) | |||
116 | } | 115 | } |
117 | 116 | ||
118 | #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0])) | 117 | #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0])) |
119 | #endif | ||
120 | 118 | ||
121 | #define IPX_MIN_EPHEMERAL_SOCKET 0x4000 | 119 | #define IPX_MIN_EPHEMERAL_SOCKET 0x4000 |
122 | #define IPX_MAX_EPHEMERAL_SOCKET 0x7fff | 120 | #define IPX_MAX_EPHEMERAL_SOCKET 0x7fff |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 025d4cc7bbf8..e6d6a66a8f71 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -537,6 +537,21 @@ struct ieee80211_tx_info { | |||
537 | }; | 537 | }; |
538 | }; | 538 | }; |
539 | 539 | ||
540 | /** | ||
541 | * struct ieee80211_sched_scan_ies - scheduled scan IEs | ||
542 | * | ||
543 | * This structure is used to pass the appropriate IEs to be used in scheduled | ||
544 | * scans for all bands. It contains both the IEs passed from the userspace | ||
545 | * and the ones generated by mac80211. | ||
546 | * | ||
547 | * @ie: array with the IEs for each supported band | ||
548 | * @len: array with the total length of the IEs for each band | ||
549 | */ | ||
550 | struct ieee80211_sched_scan_ies { | ||
551 | u8 *ie[IEEE80211_NUM_BANDS]; | ||
552 | size_t len[IEEE80211_NUM_BANDS]; | ||
553 | }; | ||
554 | |||
540 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) | 555 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) |
541 | { | 556 | { |
542 | return (struct ieee80211_tx_info *)skb->cb; | 557 | return (struct ieee80211_tx_info *)skb->cb; |
@@ -1606,6 +1621,18 @@ enum ieee80211_ampdu_mlme_action { | |||
1606 | * you should ensure to cancel it on this callback. | 1621 | * you should ensure to cancel it on this callback. |
1607 | * Must be implemented and can sleep. | 1622 | * Must be implemented and can sleep. |
1608 | * | 1623 | * |
1624 | * @suspend: Suspend the device; mac80211 itself will quiesce before and | ||
1625 | * stop transmitting and doing any other configuration, and then | ||
1626 | * ask the device to suspend. This is only invoked when WoWLAN is | ||
1627 | * configured, otherwise the device is deconfigured completely and | ||
1628 | * reconfigured at resume time. | ||
1629 | * | ||
1630 | * @resume: If WoWLAN was configured, this indicates that mac80211 is | ||
1631 | * now resuming its operation, after this the device must be fully | ||
1632 | * functional again. If this returns an error, the only way out is | ||
1633 | * to also unregister the device. If it returns 1, then mac80211 | ||
1634 | * will also go through the regular complete restart on resume. | ||
1635 | * | ||
1609 | * @add_interface: Called when a netdevice attached to the hardware is | 1636 | * @add_interface: Called when a netdevice attached to the hardware is |
1610 | * enabled. Because it is not called for monitor mode devices, @start | 1637 | * enabled. Because it is not called for monitor mode devices, @start |
1611 | * and @stop must be implemented. | 1638 | * and @stop must be implemented. |
@@ -1681,6 +1708,13 @@ enum ieee80211_ampdu_mlme_action { | |||
1681 | * any error unless this callback returned a negative error code. | 1708 | * any error unless this callback returned a negative error code. |
1682 | * The callback can sleep. | 1709 | * The callback can sleep. |
1683 | * | 1710 | * |
1711 | * @sched_scan_start: Ask the hardware to start scanning repeatedly at | ||
1712 | * specific intervals. The driver must call the | ||
1713 | * ieee80211_sched_scan_results() function whenever it finds results. | ||
1714 | * This process will continue until sched_scan_stop is called. | ||
1715 | * | ||
1716 | * @sched_scan_stop: Tell the hardware to stop an ongoing scheduled scan. | ||
1717 | * | ||
1684 | * @sw_scan_start: Notifier function that is called just before a software scan | 1718 | * @sw_scan_start: Notifier function that is called just before a software scan |
1685 | * is started. Can be NULL, if the driver doesn't need this notification. | 1719 | * is started. Can be NULL, if the driver doesn't need this notification. |
1686 | * The callback can sleep. | 1720 | * The callback can sleep. |
@@ -1819,11 +1853,22 @@ enum ieee80211_ampdu_mlme_action { | |||
1819 | * @set_ringparam: Set tx and rx ring sizes. | 1853 | * @set_ringparam: Set tx and rx ring sizes. |
1820 | * | 1854 | * |
1821 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | 1855 | * @get_ringparam: Get tx and rx ring current and maximum sizes. |
1856 | * | ||
1857 | * @tx_frames_pending: Check if there is any pending frame in the hardware | ||
1858 | * queues before entering power save. | ||
1859 | * | ||
1860 | * @set_bitrate_mask: Set a mask of rates to be used for rate control selection | ||
1861 | * when transmitting a frame. Currently only legacy rates are handled. | ||
1862 | * The callback can sleep. | ||
1822 | */ | 1863 | */ |
1823 | struct ieee80211_ops { | 1864 | struct ieee80211_ops { |
1824 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1865 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
1825 | int (*start)(struct ieee80211_hw *hw); | 1866 | int (*start)(struct ieee80211_hw *hw); |
1826 | void (*stop)(struct ieee80211_hw *hw); | 1867 | void (*stop)(struct ieee80211_hw *hw); |
1868 | #ifdef CONFIG_PM | ||
1869 | int (*suspend)(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); | ||
1870 | int (*resume)(struct ieee80211_hw *hw); | ||
1871 | #endif | ||
1827 | int (*add_interface)(struct ieee80211_hw *hw, | 1872 | int (*add_interface)(struct ieee80211_hw *hw, |
1828 | struct ieee80211_vif *vif); | 1873 | struct ieee80211_vif *vif); |
1829 | int (*change_interface)(struct ieee80211_hw *hw, | 1874 | int (*change_interface)(struct ieee80211_hw *hw, |
@@ -1854,6 +1899,12 @@ struct ieee80211_ops { | |||
1854 | u32 iv32, u16 *phase1key); | 1899 | u32 iv32, u16 *phase1key); |
1855 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1900 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1856 | struct cfg80211_scan_request *req); | 1901 | struct cfg80211_scan_request *req); |
1902 | int (*sched_scan_start)(struct ieee80211_hw *hw, | ||
1903 | struct ieee80211_vif *vif, | ||
1904 | struct cfg80211_sched_scan_request *req, | ||
1905 | struct ieee80211_sched_scan_ies *ies); | ||
1906 | void (*sched_scan_stop)(struct ieee80211_hw *hw, | ||
1907 | struct ieee80211_vif *vif); | ||
1857 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1908 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
1858 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | 1909 | void (*sw_scan_complete)(struct ieee80211_hw *hw); |
1859 | int (*get_stats)(struct ieee80211_hw *hw, | 1910 | int (*get_stats)(struct ieee80211_hw *hw, |
@@ -1906,6 +1957,9 @@ struct ieee80211_ops { | |||
1906 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 1957 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
1907 | void (*get_ringparam)(struct ieee80211_hw *hw, | 1958 | void (*get_ringparam)(struct ieee80211_hw *hw, |
1908 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); | 1959 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); |
1960 | bool (*tx_frames_pending)(struct ieee80211_hw *hw); | ||
1961 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
1962 | const struct cfg80211_bitrate_mask *mask); | ||
1909 | }; | 1963 | }; |
1910 | 1964 | ||
1911 | /** | 1965 | /** |
@@ -2223,6 +2277,19 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, | |||
2223 | #define IEEE80211_TX_STATUS_HEADROOM 13 | 2277 | #define IEEE80211_TX_STATUS_HEADROOM 13 |
2224 | 2278 | ||
2225 | /** | 2279 | /** |
2280 | * ieee80211_sta_set_tim - set the TIM bit for a sleeping station | ||
2281 | * @sta: &struct ieee80211_sta pointer for the sleeping station | ||
2282 | * | ||
2283 | * If a driver buffers frames for a powersave station instead of passing | ||
2284 | * them back to mac80211 for retransmission, the station needs to be told | ||
2285 | * to wake up using the TIM bitmap in the beacon. | ||
2286 | * | ||
2287 | * This function sets the station's TIM bit - it will be cleared when the | ||
2288 | * station wakes up. | ||
2289 | */ | ||
2290 | void ieee80211_sta_set_tim(struct ieee80211_sta *sta); | ||
2291 | |||
2292 | /** | ||
2226 | * ieee80211_tx_status - transmit status callback | 2293 | * ieee80211_tx_status - transmit status callback |
2227 | * | 2294 | * |
2228 | * Call this function for all transmitted frames after they have been | 2295 | * Call this function for all transmitted frames after they have been |
@@ -2276,6 +2343,17 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
2276 | struct sk_buff *skb); | 2343 | struct sk_buff *skb); |
2277 | 2344 | ||
2278 | /** | 2345 | /** |
2346 | * ieee80211_report_low_ack - report non-responding station | ||
2347 | * | ||
2348 | * When operating in AP-mode, call this function to report a non-responding | ||
2349 | * connected STA. | ||
2350 | * | ||
2351 | * @sta: the non-responding connected sta | ||
2352 | * @num_packets: number of packets sent to @sta without a response | ||
2353 | */ | ||
2354 | void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); | ||
2355 | |||
2356 | /** | ||
2279 | * ieee80211_beacon_get_tim - beacon generation function | 2357 | * ieee80211_beacon_get_tim - beacon generation function |
2280 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 2358 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
2281 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2359 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
@@ -2545,6 +2623,28 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
2545 | void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); | 2623 | void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); |
2546 | 2624 | ||
2547 | /** | 2625 | /** |
2626 | * ieee80211_sched_scan_results - got results from scheduled scan | ||
2627 | * | ||
2628 | * When a scheduled scan is running, this function needs to be called by the | ||
2629 | * driver whenever there are new scan results available. | ||
2630 | * | ||
2631 | * @hw: the hardware that is performing scheduled scans | ||
2632 | */ | ||
2633 | void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | ||
2634 | |||
2635 | /** | ||
2636 | * ieee80211_sched_scan_stopped - inform that the scheduled scan has stopped | ||
2637 | * | ||
2638 | * When a scheduled scan is running, this function can be called by | ||
2639 | * the driver if it needs to stop the scan to perform another task. | ||
2640 | * Usual scenarios are drivers that cannot continue the scheduled scan | ||
2641 | * while associating, for instance. | ||
2642 | * | ||
2643 | * @hw: the hardware that is performing scheduled scans | ||
2644 | */ | ||
2645 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | ||
2646 | |||
2647 | /** | ||
2548 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 2648 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
2549 | * | 2649 | * |
2550 | * This function iterates over the interfaces associated with a given | 2650 | * This function iterates over the interfaces associated with a given |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index e0e594f8e9d9..62beeb97c4b1 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -42,8 +42,6 @@ enum { | |||
42 | #define ND_REACHABLE_TIME (30*HZ) | 42 | #define ND_REACHABLE_TIME (30*HZ) |
43 | #define ND_RETRANS_TIMER HZ | 43 | #define ND_RETRANS_TIMER HZ |
44 | 44 | ||
45 | #ifdef __KERNEL__ | ||
46 | |||
47 | #include <linux/compiler.h> | 45 | #include <linux/compiler.h> |
48 | #include <linux/icmpv6.h> | 46 | #include <linux/icmpv6.h> |
49 | #include <linux/in6.h> | 47 | #include <linux/in6.h> |
@@ -102,7 +100,8 @@ extern void ndisc_send_redirect(struct sk_buff *skb, | |||
102 | struct neighbour *neigh, | 100 | struct neighbour *neigh, |
103 | const struct in6_addr *target); | 101 | const struct in6_addr *target); |
104 | 102 | ||
105 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); | 103 | extern int ndisc_mc_map(const struct in6_addr *addr, char *buf, |
104 | struct net_device *dev, int dir); | ||
106 | 105 | ||
107 | extern struct sk_buff *ndisc_build_skb(struct net_device *dev, | 106 | extern struct sk_buff *ndisc_build_skb(struct net_device *dev, |
108 | const struct in6_addr *daddr, | 107 | const struct in6_addr *daddr, |
@@ -155,8 +154,4 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s | |||
155 | return ERR_PTR(-ENODEV); | 154 | return ERR_PTR(-ENODEV); |
156 | } | 155 | } |
157 | 156 | ||
158 | |||
159 | #endif /* __KERNEL__ */ | ||
160 | |||
161 | |||
162 | #endif | 157 | #endif |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 3ae491932bc8..2bf9ed9ef26b 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
8 | #include <linux/workqueue.h> | 8 | #include <linux/workqueue.h> |
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/sysctl.h> | ||
10 | 11 | ||
11 | #include <net/netns/core.h> | 12 | #include <net/netns/core.h> |
12 | #include <net/netns/mib.h> | 13 | #include <net/netns/mib.h> |
@@ -119,6 +120,7 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | |||
119 | extern struct list_head net_namespace_list; | 120 | extern struct list_head net_namespace_list; |
120 | 121 | ||
121 | extern struct net *get_net_ns_by_pid(pid_t pid); | 122 | extern struct net *get_net_ns_by_pid(pid_t pid); |
123 | extern struct net *get_net_ns_by_fd(int pid); | ||
122 | 124 | ||
123 | #ifdef CONFIG_NET_NS | 125 | #ifdef CONFIG_NET_NS |
124 | extern void __put_net(struct net *net); | 126 | extern void __put_net(struct net *net); |
diff --git a/include/net/net_ratelimit.h b/include/net/net_ratelimit.h new file mode 100644 index 000000000000..7727b4247daf --- /dev/null +++ b/include/net/net_ratelimit.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _LINUX_NET_RATELIMIT_H | ||
2 | #define _LINUX_NET_RATELIMIT_H | ||
3 | |||
4 | #include <linux/ratelimit.h> | ||
5 | |||
6 | extern struct ratelimit_state net_ratelimit_state; | ||
7 | |||
8 | #endif /* _LINUX_NET_RATELIMIT_H */ | ||
diff --git a/include/net/netevent.h b/include/net/netevent.h index 22b239c17eaa..086f8a5b59dc 100644 --- a/include/net/netevent.h +++ b/include/net/netevent.h | |||
@@ -10,7 +10,6 @@ | |||
10 | * | 10 | * |
11 | * Changes: | 11 | * Changes: |
12 | */ | 12 | */ |
13 | #ifdef __KERNEL__ | ||
14 | 13 | ||
15 | struct dst_entry; | 14 | struct dst_entry; |
16 | 15 | ||
@@ -29,4 +28,3 @@ extern int unregister_netevent_notifier(struct notifier_block *nb); | |||
29 | extern int call_netevent_notifiers(unsigned long val, void *v); | 28 | extern int call_netevent_notifiers(unsigned long val, void *v); |
30 | 29 | ||
31 | #endif | 30 | #endif |
32 | #endif | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index d0d13378991e..c7c42e7acc31 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -14,7 +14,6 @@ | |||
14 | 14 | ||
15 | #include <linux/netfilter/nf_conntrack_common.h> | 15 | #include <linux/netfilter/nf_conntrack_common.h> |
16 | 16 | ||
17 | #ifdef __KERNEL__ | ||
18 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
19 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
20 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
@@ -326,5 +325,4 @@ do { \ | |||
326 | #define MODULE_ALIAS_NFCT_HELPER(helper) \ | 325 | #define MODULE_ALIAS_NFCT_HELPER(helper) \ |
327 | MODULE_ALIAS("nfct-helper-" helper) | 326 | MODULE_ALIAS("nfct-helper-" helper) |
328 | 327 | ||
329 | #endif /* __KERNEL__ */ | ||
330 | #endif /* _NF_CONNTRACK_H */ | 328 | #endif /* _NF_CONNTRACK_H */ |
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 4ee44c84a304..7ca6bdd5bae6 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -104,8 +104,6 @@ struct nf_conntrack_tuple_mask { | |||
104 | } src; | 104 | } src; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | #ifdef __KERNEL__ | ||
108 | |||
109 | static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) | 107 | static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) |
110 | { | 108 | { |
111 | #ifdef DEBUG | 109 | #ifdef DEBUG |
@@ -148,8 +146,6 @@ struct nf_conntrack_tuple_hash { | |||
148 | struct nf_conntrack_tuple tuple; | 146 | struct nf_conntrack_tuple tuple; |
149 | }; | 147 | }; |
150 | 148 | ||
151 | #endif /* __KERNEL__ */ | ||
152 | |||
153 | static inline bool __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, | 149 | static inline bool __nf_ct_tuple_src_equal(const struct nf_conntrack_tuple *t1, |
154 | const struct nf_conntrack_tuple *t2) | 150 | const struct nf_conntrack_tuple *t2) |
155 | { | 151 | { |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index aff80b190c12..0346b0070864 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -48,7 +48,6 @@ struct nf_nat_multi_range_compat { | |||
48 | struct nf_nat_range range[1]; | 48 | struct nf_nat_range range[1]; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #ifdef __KERNEL__ | ||
52 | #include <linux/list.h> | 51 | #include <linux/list.h> |
53 | #include <linux/netfilter/nf_conntrack_pptp.h> | 52 | #include <linux/netfilter/nf_conntrack_pptp.h> |
54 | #include <net/netfilter/nf_conntrack_extend.h> | 53 | #include <net/netfilter/nf_conntrack_extend.h> |
@@ -93,7 +92,4 @@ static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct) | |||
93 | #endif | 92 | #endif |
94 | } | 93 | } |
95 | 94 | ||
96 | #else /* !__KERNEL__: iptables wants this to compile. */ | ||
97 | #define nf_nat_multi_range nf_nat_multi_range_compat | ||
98 | #endif /*__KERNEL__*/ | ||
99 | #endif | 95 | #endif |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 8a3906a08f5f..02740a94f108 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -290,7 +290,7 @@ static inline int nlmsg_padlen(int payload) | |||
290 | 290 | ||
291 | /** | 291 | /** |
292 | * nlmsg_data - head of message payload | 292 | * nlmsg_data - head of message payload |
293 | * @nlh: netlink messsage header | 293 | * @nlh: netlink message header |
294 | */ | 294 | */ |
295 | static inline void *nlmsg_data(const struct nlmsghdr *nlh) | 295 | static inline void *nlmsg_data(const struct nlmsghdr *nlh) |
296 | { | 296 | { |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 542195d9469e..d786b4fc02a4 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -54,6 +54,8 @@ struct netns_ipv4 { | |||
54 | int sysctl_rt_cache_rebuild_count; | 54 | int sysctl_rt_cache_rebuild_count; |
55 | int current_rt_cache_rebuild_count; | 55 | int current_rt_cache_rebuild_count; |
56 | 56 | ||
57 | unsigned int sysctl_ping_group_range[2]; | ||
58 | |||
57 | atomic_t rt_genid; | 59 | atomic_t rt_genid; |
58 | atomic_t dev_addr_genid; | 60 | atomic_t dev_addr_genid; |
59 | 61 | ||
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 13649eb57413..8639de5750f6 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -51,7 +51,7 @@ void phonet_address_notify(int event, struct net_device *dev, u8 addr); | |||
51 | int phonet_route_add(struct net_device *dev, u8 daddr); | 51 | int phonet_route_add(struct net_device *dev, u8 daddr); |
52 | int phonet_route_del(struct net_device *dev, u8 daddr); | 52 | int phonet_route_del(struct net_device *dev, u8 daddr); |
53 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); | 53 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); |
54 | struct net_device *phonet_route_get(struct net *net, u8 daddr); | 54 | struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr); |
55 | struct net_device *phonet_route_output(struct net *net, u8 daddr); | 55 | struct net_device *phonet_route_output(struct net *net, u8 daddr); |
56 | 56 | ||
57 | #define PN_NO_ADDR 0xff | 57 | #define PN_NO_ADDR 0xff |
diff --git a/include/net/ping.h b/include/net/ping.h new file mode 100644 index 000000000000..682b5ae9af51 --- /dev/null +++ b/include/net/ping.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * INET An implementation of the TCP/IP protocol suite for the LINUX | ||
3 | * operating system. INET is implemented using the BSD Socket | ||
4 | * interface as the means of communication with the user level. | ||
5 | * | ||
6 | * Definitions for the "ping" module. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef _PING_H | ||
14 | #define _PING_H | ||
15 | |||
16 | #include <net/netns/hash.h> | ||
17 | |||
18 | /* PING_HTABLE_SIZE must be power of 2 */ | ||
19 | #define PING_HTABLE_SIZE 64 | ||
20 | #define PING_HTABLE_MASK (PING_HTABLE_SIZE-1) | ||
21 | |||
22 | #define ping_portaddr_for_each_entry(__sk, node, list) \ | ||
23 | hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node) | ||
24 | |||
25 | /* | ||
26 | * gid_t is either uint or ushort. We want to pass it to | ||
27 | * proc_dointvec_minmax(), so it must not be larger than MAX_INT | ||
28 | */ | ||
29 | #define GID_T_MAX (((gid_t)~0U) >> 1) | ||
30 | |||
31 | struct ping_table { | ||
32 | struct hlist_nulls_head hash[PING_HTABLE_SIZE]; | ||
33 | rwlock_t lock; | ||
34 | }; | ||
35 | |||
36 | struct ping_iter_state { | ||
37 | struct seq_net_private p; | ||
38 | int bucket; | ||
39 | }; | ||
40 | |||
41 | extern struct proto ping_prot; | ||
42 | |||
43 | |||
44 | extern void ping_rcv(struct sk_buff *); | ||
45 | extern void ping_err(struct sk_buff *, u32 info); | ||
46 | |||
47 | #ifdef CONFIG_PROC_FS | ||
48 | extern int __init ping_proc_init(void); | ||
49 | extern void ping_proc_exit(void); | ||
50 | #endif | ||
51 | |||
52 | void __init ping_init(void); | ||
53 | |||
54 | |||
55 | #endif /* _PING_H */ | ||
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index f6b9b830df8c..cf7577234457 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _NET_RAWV6_H | 1 | #ifndef _NET_RAWV6_H |
2 | #define _NET_RAWV6_H | 2 | #define _NET_RAWV6_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <net/protocol.h> | 4 | #include <net/protocol.h> |
7 | 5 | ||
8 | void raw6_icmp_error(struct sk_buff *, int nexthdr, | 6 | void raw6_icmp_error(struct sk_buff *, int nexthdr, |
@@ -20,5 +18,3 @@ int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock, | |||
20 | #endif | 18 | #endif |
21 | 19 | ||
22 | #endif | 20 | #endif |
23 | |||
24 | #endif | ||
diff --git a/include/net/route.h b/include/net/route.h index 8fce0621cad1..db7b3432f07c 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -35,16 +35,8 @@ | |||
35 | #include <linux/cache.h> | 35 | #include <linux/cache.h> |
36 | #include <linux/security.h> | 36 | #include <linux/security.h> |
37 | 37 | ||
38 | #ifndef __KERNEL__ | ||
39 | #warning This file is not supposed to be used outside of kernel. | ||
40 | #endif | ||
41 | |||
42 | #define RTO_ONLINK 0x01 | 38 | #define RTO_ONLINK 0x01 |
43 | 39 | ||
44 | #define RTO_CONN 0 | ||
45 | /* RTO_CONN is not used (being alias for 0), but preserved not to break | ||
46 | * some modules referring to it. */ | ||
47 | |||
48 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) | 40 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) |
49 | 41 | ||
50 | struct fib_nh; | 42 | struct fib_nh; |
@@ -60,7 +52,7 @@ struct rtable { | |||
60 | int rt_genid; | 52 | int rt_genid; |
61 | unsigned rt_flags; | 53 | unsigned rt_flags; |
62 | __u16 rt_type; | 54 | __u16 rt_type; |
63 | __u8 rt_tos; | 55 | __u8 rt_key_tos; |
64 | 56 | ||
65 | __be32 rt_dst; /* Path destination */ | 57 | __be32 rt_dst; /* Path destination */ |
66 | __be32 rt_src; /* Path source */ | 58 | __be32 rt_src; /* Path source */ |
@@ -123,7 +115,7 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | |||
123 | __be32 src, struct net_device *dev); | 115 | __be32 src, struct net_device *dev); |
124 | extern void rt_cache_flush(struct net *net, int how); | 116 | extern void rt_cache_flush(struct net *net, int how); |
125 | extern void rt_cache_flush_batch(struct net *net); | 117 | extern void rt_cache_flush_batch(struct net *net); |
126 | extern struct rtable *__ip_route_output_key(struct net *, const struct flowi4 *flp); | 118 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
127 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 119 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
128 | struct sock *sk); | 120 | struct sock *sk); |
129 | extern struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig); | 121 | extern struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_orig); |
@@ -145,40 +137,33 @@ static inline struct rtable *ip_route_output(struct net *net, __be32 daddr, | |||
145 | return ip_route_output_key(net, &fl4); | 137 | return ip_route_output_key(net, &fl4); |
146 | } | 138 | } |
147 | 139 | ||
148 | static inline struct rtable *ip_route_output_ports(struct net *net, struct sock *sk, | 140 | static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi4 *fl4, |
141 | struct sock *sk, | ||
149 | __be32 daddr, __be32 saddr, | 142 | __be32 daddr, __be32 saddr, |
150 | __be16 dport, __be16 sport, | 143 | __be16 dport, __be16 sport, |
151 | __u8 proto, __u8 tos, int oif) | 144 | __u8 proto, __u8 tos, int oif) |
152 | { | 145 | { |
153 | struct flowi4 fl4 = { | 146 | flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos, |
154 | .flowi4_oif = oif, | 147 | RT_SCOPE_UNIVERSE, proto, |
155 | .flowi4_flags = sk ? inet_sk_flowi_flags(sk) : 0, | 148 | sk ? inet_sk_flowi_flags(sk) : 0, |
156 | .flowi4_mark = sk ? sk->sk_mark : 0, | 149 | daddr, saddr, dport, sport); |
157 | .daddr = daddr, | ||
158 | .saddr = saddr, | ||
159 | .flowi4_tos = tos, | ||
160 | .flowi4_proto = proto, | ||
161 | .fl4_dport = dport, | ||
162 | .fl4_sport = sport, | ||
163 | }; | ||
164 | if (sk) | 150 | if (sk) |
165 | security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); | 151 | security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); |
166 | return ip_route_output_flow(net, &fl4, sk); | 152 | return ip_route_output_flow(net, fl4, sk); |
167 | } | 153 | } |
168 | 154 | ||
169 | static inline struct rtable *ip_route_output_gre(struct net *net, | 155 | static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 *fl4, |
170 | __be32 daddr, __be32 saddr, | 156 | __be32 daddr, __be32 saddr, |
171 | __be32 gre_key, __u8 tos, int oif) | 157 | __be32 gre_key, __u8 tos, int oif) |
172 | { | 158 | { |
173 | struct flowi4 fl4 = { | 159 | memset(fl4, 0, sizeof(*fl4)); |
174 | .flowi4_oif = oif, | 160 | fl4->flowi4_oif = oif; |
175 | .daddr = daddr, | 161 | fl4->daddr = daddr; |
176 | .saddr = saddr, | 162 | fl4->saddr = saddr; |
177 | .flowi4_tos = tos, | 163 | fl4->flowi4_tos = tos; |
178 | .flowi4_proto = IPPROTO_GRE, | 164 | fl4->flowi4_proto = IPPROTO_GRE; |
179 | .fl4_gre_key = gre_key, | 165 | fl4->fl4_gre_key = gre_key; |
180 | }; | 166 | return ip_route_output_key(net, fl4); |
181 | return ip_route_output_key(net, &fl4); | ||
182 | } | 167 | } |
183 | 168 | ||
184 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, | 169 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, |
@@ -196,14 +181,15 @@ static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 s | |||
196 | return ip_route_input_common(skb, dst, src, tos, devin, true); | 181 | return ip_route_input_common(skb, dst, src, tos, devin, true); |
197 | } | 182 | } |
198 | 183 | ||
199 | extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); | 184 | extern unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph, |
185 | unsigned short new_mtu, struct net_device *dev); | ||
200 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 186 | extern void ip_rt_send_redirect(struct sk_buff *skb); |
201 | 187 | ||
202 | extern unsigned inet_addr_type(struct net *net, __be32 addr); | 188 | extern unsigned inet_addr_type(struct net *net, __be32 addr); |
203 | extern unsigned inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 189 | extern unsigned inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); |
204 | extern void ip_rt_multicast_event(struct in_device *); | 190 | extern void ip_rt_multicast_event(struct in_device *); |
205 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); | 191 | extern int ip_rt_ioctl(struct net *, unsigned int cmd, void __user *arg); |
206 | extern void ip_rt_get_source(u8 *src, struct rtable *rt); | 192 | extern void ip_rt_get_source(u8 *src, struct sk_buff *skb, struct rtable *rt); |
207 | extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); | 193 | extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); |
208 | 194 | ||
209 | struct in_ifaddr; | 195 | struct in_ifaddr; |
@@ -225,78 +211,93 @@ static inline char rt_tos2priority(u8 tos) | |||
225 | return ip_tos2prio[IPTOS_TOS(tos)>>1]; | 211 | return ip_tos2prio[IPTOS_TOS(tos)>>1]; |
226 | } | 212 | } |
227 | 213 | ||
228 | static inline struct rtable *ip_route_connect(__be32 dst, __be32 src, u32 tos, | 214 | /* ip_route_connect() and ip_route_newports() work in tandem whilst |
215 | * binding a socket for a new outgoing connection. | ||
216 | * | ||
217 | * In order to use IPSEC properly, we must, in the end, have a | ||
218 | * route that was looked up using all available keys including source | ||
219 | * and destination ports. | ||
220 | * | ||
221 | * However, if a source port needs to be allocated (the user specified | ||
222 | * a wildcard source port) we need to obtain addressing information | ||
223 | * in order to perform that allocation. | ||
224 | * | ||
225 | * So ip_route_connect() looks up a route using wildcarded source and | ||
226 | * destination ports in the key, simply so that we can get a pair of | ||
227 | * addresses to use for port allocation. | ||
228 | * | ||
229 | * Later, once the ports are allocated, ip_route_newports() will make | ||
230 | * another route lookup if needed to make sure we catch any IPSEC | ||
231 | * rules keyed on the port information. | ||
232 | * | ||
233 | * The callers allocate the flow key on their stack, and must pass in | ||
234 | * the same flowi4 object to both the ip_route_connect() and the | ||
235 | * ip_route_newports() calls. | ||
236 | */ | ||
237 | |||
238 | static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, | ||
239 | u32 tos, int oif, u8 protocol, | ||
240 | __be16 sport, __be16 dport, | ||
241 | struct sock *sk, bool can_sleep) | ||
242 | { | ||
243 | __u8 flow_flags = 0; | ||
244 | |||
245 | if (inet_sk(sk)->transparent) | ||
246 | flow_flags |= FLOWI_FLAG_ANYSRC; | ||
247 | if (protocol == IPPROTO_TCP) | ||
248 | flow_flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
249 | if (can_sleep) | ||
250 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
251 | |||
252 | flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, | ||
253 | protocol, flow_flags, dst, src, dport, sport); | ||
254 | } | ||
255 | |||
256 | static inline struct rtable *ip_route_connect(struct flowi4 *fl4, | ||
257 | __be32 dst, __be32 src, u32 tos, | ||
229 | int oif, u8 protocol, | 258 | int oif, u8 protocol, |
230 | __be16 sport, __be16 dport, | 259 | __be16 sport, __be16 dport, |
231 | struct sock *sk, bool can_sleep) | 260 | struct sock *sk, bool can_sleep) |
232 | { | 261 | { |
233 | struct flowi4 fl4 = { | ||
234 | .flowi4_oif = oif, | ||
235 | .flowi4_mark = sk->sk_mark, | ||
236 | .daddr = dst, | ||
237 | .saddr = src, | ||
238 | .flowi4_tos = tos, | ||
239 | .flowi4_proto = protocol, | ||
240 | .fl4_sport = sport, | ||
241 | .fl4_dport = dport, | ||
242 | }; | ||
243 | struct net *net = sock_net(sk); | 262 | struct net *net = sock_net(sk); |
244 | struct rtable *rt; | 263 | struct rtable *rt; |
245 | 264 | ||
246 | if (inet_sk(sk)->transparent) | 265 | ip_route_connect_init(fl4, dst, src, tos, oif, protocol, |
247 | fl4.flowi4_flags |= FLOWI_FLAG_ANYSRC; | 266 | sport, dport, sk, can_sleep); |
248 | if (protocol == IPPROTO_TCP) | ||
249 | fl4.flowi4_flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
250 | if (can_sleep) | ||
251 | fl4.flowi4_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
252 | 267 | ||
253 | if (!dst || !src) { | 268 | if (!dst || !src) { |
254 | rt = __ip_route_output_key(net, &fl4); | 269 | rt = __ip_route_output_key(net, fl4); |
255 | if (IS_ERR(rt)) | 270 | if (IS_ERR(rt)) |
256 | return rt; | 271 | return rt; |
257 | fl4.daddr = rt->rt_dst; | ||
258 | fl4.saddr = rt->rt_src; | ||
259 | ip_rt_put(rt); | 272 | ip_rt_put(rt); |
260 | } | 273 | } |
261 | security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); | 274 | security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); |
262 | return ip_route_output_flow(net, &fl4, sk); | 275 | return ip_route_output_flow(net, fl4, sk); |
263 | } | 276 | } |
264 | 277 | ||
265 | static inline struct rtable *ip_route_newports(struct rtable *rt, | 278 | static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt, |
266 | u8 protocol, __be16 orig_sport, | 279 | __be16 orig_sport, __be16 orig_dport, |
267 | __be16 orig_dport, __be16 sport, | 280 | __be16 sport, __be16 dport, |
268 | __be16 dport, struct sock *sk) | 281 | struct sock *sk) |
269 | { | 282 | { |
270 | if (sport != orig_sport || dport != orig_dport) { | 283 | if (sport != orig_sport || dport != orig_dport) { |
271 | struct flowi4 fl4 = { | 284 | fl4->fl4_dport = dport; |
272 | .flowi4_oif = rt->rt_oif, | 285 | fl4->fl4_sport = sport; |
273 | .flowi4_mark = rt->rt_mark, | ||
274 | .daddr = rt->rt_dst, | ||
275 | .saddr = rt->rt_src, | ||
276 | .flowi4_tos = rt->rt_tos, | ||
277 | .flowi4_proto = protocol, | ||
278 | .fl4_sport = sport, | ||
279 | .fl4_dport = dport | ||
280 | }; | ||
281 | if (inet_sk(sk)->transparent) | ||
282 | fl4.flowi4_flags |= FLOWI_FLAG_ANYSRC; | ||
283 | if (protocol == IPPROTO_TCP) | ||
284 | fl4.flowi4_flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
285 | ip_rt_put(rt); | 286 | ip_rt_put(rt); |
286 | security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); | 287 | security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); |
287 | return ip_route_output_flow(sock_net(sk), &fl4, sk); | 288 | return ip_route_output_flow(sock_net(sk), fl4, sk); |
288 | } | 289 | } |
289 | return rt; | 290 | return rt; |
290 | } | 291 | } |
291 | 292 | ||
292 | extern void rt_bind_peer(struct rtable *rt, int create); | 293 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); |
293 | 294 | ||
294 | static inline struct inet_peer *rt_get_peer(struct rtable *rt) | 295 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) |
295 | { | 296 | { |
296 | if (rt->peer) | 297 | if (rt->peer) |
297 | return rt->peer; | 298 | return rt->peer; |
298 | 299 | ||
299 | rt_bind_peer(rt, 0); | 300 | rt_bind_peer(rt, daddr, 0); |
300 | return rt->peer; | 301 | return rt->peer; |
301 | } | 302 | } |
302 | 303 | ||
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index c01dc99def07..dd6847e5d6e4 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -73,7 +73,6 @@ typedef enum { | |||
73 | SCTP_CMD_INIT_FAILED, /* High level, do init failure work. */ | 73 | SCTP_CMD_INIT_FAILED, /* High level, do init failure work. */ |
74 | SCTP_CMD_REPORT_DUP, /* Report a duplicate TSN. */ | 74 | SCTP_CMD_REPORT_DUP, /* Report a duplicate TSN. */ |
75 | SCTP_CMD_STRIKE, /* Mark a strike against a transport. */ | 75 | SCTP_CMD_STRIKE, /* Mark a strike against a transport. */ |
76 | SCTP_CMD_TRANSMIT, /* Transmit the outqueue. */ | ||
77 | SCTP_CMD_HB_TIMERS_START, /* Start the heartbeat timers. */ | 76 | SCTP_CMD_HB_TIMERS_START, /* Start the heartbeat timers. */ |
78 | SCTP_CMD_HB_TIMER_UPDATE, /* Update a heartbeat timers. */ | 77 | SCTP_CMD_HB_TIMER_UPDATE, /* Update a heartbeat timers. */ |
79 | SCTP_CMD_HB_TIMERS_STOP, /* Stop the heartbeat timers. */ | 78 | SCTP_CMD_HB_TIMERS_STOP, /* Stop the heartbeat timers. */ |
@@ -108,6 +107,7 @@ typedef enum { | |||
108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ | 107 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ |
109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ | 108 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ |
110 | SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ | 109 | SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ |
110 | SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/ | ||
111 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
112 | } sctp_verb_t; | 112 | } sctp_verb_t; |
113 | 113 | ||
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index c70d8ccc55cb..942b864f6135 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -150,7 +150,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(OTHER, sctp_event_other_t, other) | |||
150 | SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) | 150 | SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) |
151 | 151 | ||
152 | 152 | ||
153 | #define sctp_chunk_is_control(a) (a->chunk_hdr->type != SCTP_CID_DATA) | ||
154 | #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA) | 153 | #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA) |
155 | 154 | ||
156 | /* Calculate the actual data size in a data chunk */ | 155 | /* Calculate the actual data size in a data chunk */ |
@@ -188,15 +187,14 @@ typedef enum { | |||
188 | /* SCTP state defines for internal state machine */ | 187 | /* SCTP state defines for internal state machine */ |
189 | typedef enum { | 188 | typedef enum { |
190 | 189 | ||
191 | SCTP_STATE_EMPTY = 0, | 190 | SCTP_STATE_CLOSED = 0, |
192 | SCTP_STATE_CLOSED = 1, | 191 | SCTP_STATE_COOKIE_WAIT = 1, |
193 | SCTP_STATE_COOKIE_WAIT = 2, | 192 | SCTP_STATE_COOKIE_ECHOED = 2, |
194 | SCTP_STATE_COOKIE_ECHOED = 3, | 193 | SCTP_STATE_ESTABLISHED = 3, |
195 | SCTP_STATE_ESTABLISHED = 4, | 194 | SCTP_STATE_SHUTDOWN_PENDING = 4, |
196 | SCTP_STATE_SHUTDOWN_PENDING = 5, | 195 | SCTP_STATE_SHUTDOWN_SENT = 5, |
197 | SCTP_STATE_SHUTDOWN_SENT = 6, | 196 | SCTP_STATE_SHUTDOWN_RECEIVED = 6, |
198 | SCTP_STATE_SHUTDOWN_RECEIVED = 7, | 197 | SCTP_STATE_SHUTDOWN_ACK_SENT = 7, |
199 | SCTP_STATE_SHUTDOWN_ACK_SENT = 8, | ||
200 | 198 | ||
201 | } sctp_state_t; | 199 | } sctp_state_t; |
202 | 200 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 505845ddb0be..b2c2366676a7 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -115,7 +115,6 @@ | |||
115 | * sctp/protocol.c | 115 | * sctp/protocol.c |
116 | */ | 116 | */ |
117 | extern struct sock *sctp_get_ctl_sock(void); | 117 | extern struct sock *sctp_get_ctl_sock(void); |
118 | extern void sctp_local_addr_free(struct rcu_head *head); | ||
119 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, | 118 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, |
120 | sctp_scope_t, gfp_t gfp, | 119 | sctp_scope_t, gfp_t gfp, |
121 | int flags); | 120 | int flags); |
@@ -531,7 +530,6 @@ _sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length), member) | |||
531 | 530 | ||
532 | #define _sctp_walk_params(pos, chunk, end, member)\ | 531 | #define _sctp_walk_params(pos, chunk, end, member)\ |
533 | for (pos.v = chunk->member;\ | 532 | for (pos.v = chunk->member;\ |
534 | pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ | ||
535 | pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\ | 533 | pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\ |
536 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ | 534 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ |
537 | pos.v += WORD_ROUND(ntohs(pos.p->length))) | 535 | pos.v += WORD_ROUND(ntohs(pos.p->length))) |
@@ -542,7 +540,6 @@ _sctp_walk_errors((err), (chunk_hdr), ntohs((chunk_hdr)->length)) | |||
542 | #define _sctp_walk_errors(err, chunk_hdr, end)\ | 540 | #define _sctp_walk_errors(err, chunk_hdr, end)\ |
543 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ | 541 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ |
544 | sizeof(sctp_chunkhdr_t));\ | 542 | sizeof(sctp_chunkhdr_t));\ |
545 | (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ | ||
546 | (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\ | 543 | (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\ |
547 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ | 544 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ |
548 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) | 545 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 9352d12f02de..9148632b8204 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -165,6 +165,7 @@ sctp_state_fn_t sctp_sf_do_prm_requestheartbeat; | |||
165 | sctp_state_fn_t sctp_sf_do_prm_asconf; | 165 | sctp_state_fn_t sctp_sf_do_prm_asconf; |
166 | 166 | ||
167 | /* Prototypes for other event state functions. */ | 167 | /* Prototypes for other event state functions. */ |
168 | sctp_state_fn_t sctp_sf_do_no_pending_tsn; | ||
168 | sctp_state_fn_t sctp_sf_do_9_2_start_shutdown; | 169 | sctp_state_fn_t sctp_sf_do_9_2_start_shutdown; |
169 | sctp_state_fn_t sctp_sf_do_9_2_shutdown_ack; | 170 | sctp_state_fn_t sctp_sf_do_9_2_shutdown_ack; |
170 | sctp_state_fn_t sctp_sf_ignore_other; | 171 | sctp_state_fn_t sctp_sf_ignore_other; |
@@ -232,9 +233,7 @@ struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, | |||
232 | const struct sctp_chunk *, | 233 | const struct sctp_chunk *, |
233 | struct sctp_paramhdr *); | 234 | struct sctp_paramhdr *); |
234 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, | 235 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, |
235 | const struct sctp_transport *, | 236 | const struct sctp_transport *); |
236 | const void *payload, | ||
237 | const size_t paylen); | ||
238 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, | 237 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, |
239 | const struct sctp_chunk *, | 238 | const struct sctp_chunk *, |
240 | const void *payload, | 239 | const void *payload, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0f6e60a9c308..7df327a6d564 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -564,19 +564,15 @@ struct sctp_af { | |||
564 | int optname, | 564 | int optname, |
565 | char __user *optval, | 565 | char __user *optval, |
566 | int __user *optlen); | 566 | int __user *optlen); |
567 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, | 567 | void (*get_dst) (struct sctp_transport *t, |
568 | union sctp_addr *daddr, | 568 | union sctp_addr *saddr, |
569 | union sctp_addr *saddr); | 569 | struct flowi *fl, |
570 | struct sock *sk); | ||
570 | void (*get_saddr) (struct sctp_sock *sk, | 571 | void (*get_saddr) (struct sctp_sock *sk, |
571 | struct sctp_association *asoc, | 572 | struct sctp_transport *t, |
572 | struct dst_entry *dst, | 573 | struct flowi *fl); |
573 | union sctp_addr *daddr, | ||
574 | union sctp_addr *saddr); | ||
575 | void (*copy_addrlist) (struct list_head *, | 574 | void (*copy_addrlist) (struct list_head *, |
576 | struct net_device *); | 575 | struct net_device *); |
577 | void (*dst_saddr) (union sctp_addr *saddr, | ||
578 | struct dst_entry *dst, | ||
579 | __be16 port); | ||
580 | int (*cmp_addr) (const union sctp_addr *addr1, | 576 | int (*cmp_addr) (const union sctp_addr *addr1, |
581 | const union sctp_addr *addr2); | 577 | const union sctp_addr *addr2); |
582 | void (*addr_copy) (union sctp_addr *dst, | 578 | void (*addr_copy) (union sctp_addr *dst, |
@@ -898,6 +894,7 @@ struct sctp_transport { | |||
898 | /* Is this structure kfree()able? */ | 894 | /* Is this structure kfree()able? */ |
899 | malloced:1; | 895 | malloced:1; |
900 | 896 | ||
897 | struct flowi fl; | ||
901 | 898 | ||
902 | /* This is the peer's IP address and port. */ | 899 | /* This is the peer's IP address and port. */ |
903 | union sctp_addr ipaddr; | 900 | union sctp_addr ipaddr; |
@@ -1061,7 +1058,7 @@ void sctp_transport_set_owner(struct sctp_transport *, | |||
1061 | struct sctp_association *); | 1058 | struct sctp_association *); |
1062 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | 1059 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, |
1063 | struct sctp_sock *); | 1060 | struct sctp_sock *); |
1064 | void sctp_transport_pmtu(struct sctp_transport *); | 1061 | void sctp_transport_pmtu(struct sctp_transport *, struct sock *sk); |
1065 | void sctp_transport_free(struct sctp_transport *); | 1062 | void sctp_transport_free(struct sctp_transport *); |
1066 | void sctp_transport_reset_timers(struct sctp_transport *); | 1063 | void sctp_transport_reset_timers(struct sctp_transport *); |
1067 | void sctp_transport_hold(struct sctp_transport *); | 1064 | void sctp_transport_hold(struct sctp_transport *); |
@@ -1400,7 +1397,7 @@ int sctp_has_association(const union sctp_addr *laddr, | |||
1400 | int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, | 1397 | int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, |
1401 | sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, | 1398 | sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, |
1402 | struct sctp_chunk **err_chunk); | 1399 | struct sctp_chunk **err_chunk); |
1403 | int sctp_process_init(struct sctp_association *, sctp_cid_t cid, | 1400 | int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, |
1404 | const union sctp_addr *peer, | 1401 | const union sctp_addr *peer, |
1405 | sctp_init_chunk_t *init, gfp_t gfp); | 1402 | sctp_init_chunk_t *init, gfp_t gfp); |
1406 | __u32 sctp_generate_tag(const struct sctp_endpoint *); | 1403 | __u32 sctp_generate_tag(const struct sctp_endpoint *); |
@@ -1996,7 +1993,7 @@ void sctp_assoc_clean_asconf_ack_cache(const struct sctp_association *asoc); | |||
1996 | struct sctp_chunk *sctp_assoc_lookup_asconf_ack( | 1993 | struct sctp_chunk *sctp_assoc_lookup_asconf_ack( |
1997 | const struct sctp_association *asoc, | 1994 | const struct sctp_association *asoc, |
1998 | __be32 serial); | 1995 | __be32 serial); |
1999 | 1996 | void sctp_asconf_queue_teardown(struct sctp_association *asoc); | |
2000 | 1997 | ||
2001 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, | 1998 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, |
2002 | const union sctp_addr *ss2); | 1999 | const union sctp_addr *ss2); |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index 7ea12e8e6676..99b027b2adce 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
@@ -132,6 +132,9 @@ struct sctp_ulpevent *sctp_ulpevent_make_authkey( | |||
132 | const struct sctp_association *asoc, __u16 key_id, | 132 | const struct sctp_association *asoc, __u16 key_id, |
133 | __u32 indication, gfp_t gfp); | 133 | __u32 indication, gfp_t gfp); |
134 | 134 | ||
135 | struct sctp_ulpevent *sctp_ulpevent_make_sender_dry_event( | ||
136 | const struct sctp_association *asoc, gfp_t gfp); | ||
137 | |||
135 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, | 138 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, |
136 | struct msghdr *); | 139 | struct msghdr *); |
137 | __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event); | 140 | __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event); |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index e73ebdae323d..32fd51274037 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -91,6 +91,7 @@ typedef __s32 sctp_assoc_t; | |||
91 | #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */ | 91 | #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */ |
92 | #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ | 92 | #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ |
93 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ | 93 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ |
94 | #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ | ||
94 | 95 | ||
95 | /* Internal Socket Options. Some of the sctp library functions are | 96 | /* Internal Socket Options. Some of the sctp library functions are |
96 | * implemented using these socket options. | 97 | * implemented using these socket options. |
@@ -353,6 +354,20 @@ struct sctp_authkey_event { | |||
353 | 354 | ||
354 | enum { SCTP_AUTH_NEWKEY = 0, }; | 355 | enum { SCTP_AUTH_NEWKEY = 0, }; |
355 | 356 | ||
357 | /* | ||
358 | * 6.1.9. SCTP_SENDER_DRY_EVENT | ||
359 | * | ||
360 | * When the SCTP stack has no more user data to send or retransmit, this | ||
361 | * notification is given to the user. Also, at the time when a user app | ||
362 | * subscribes to this event, if there is no data to be sent or | ||
363 | * retransmit, the stack will immediately send up this notification. | ||
364 | */ | ||
365 | struct sctp_sender_dry_event { | ||
366 | __u16 sender_dry_type; | ||
367 | __u16 sender_dry_flags; | ||
368 | __u32 sender_dry_length; | ||
369 | sctp_assoc_t sender_dry_assoc_id; | ||
370 | }; | ||
356 | 371 | ||
357 | /* | 372 | /* |
358 | * Described in Section 7.3 | 373 | * Described in Section 7.3 |
@@ -368,6 +383,7 @@ struct sctp_event_subscribe { | |||
368 | __u8 sctp_partial_delivery_event; | 383 | __u8 sctp_partial_delivery_event; |
369 | __u8 sctp_adaptation_layer_event; | 384 | __u8 sctp_adaptation_layer_event; |
370 | __u8 sctp_authentication_event; | 385 | __u8 sctp_authentication_event; |
386 | __u8 sctp_sender_dry_event; | ||
371 | }; | 387 | }; |
372 | 388 | ||
373 | /* | 389 | /* |
@@ -391,6 +407,7 @@ union sctp_notification { | |||
391 | struct sctp_adaptation_event sn_adaptation_event; | 407 | struct sctp_adaptation_event sn_adaptation_event; |
392 | struct sctp_pdapi_event sn_pdapi_event; | 408 | struct sctp_pdapi_event sn_pdapi_event; |
393 | struct sctp_authkey_event sn_authkey_event; | 409 | struct sctp_authkey_event sn_authkey_event; |
410 | struct sctp_sender_dry_event sn_sender_dry_event; | ||
394 | }; | 411 | }; |
395 | 412 | ||
396 | /* Section 5.3.1 | 413 | /* Section 5.3.1 |
@@ -407,7 +424,9 @@ enum sctp_sn_type { | |||
407 | SCTP_SHUTDOWN_EVENT, | 424 | SCTP_SHUTDOWN_EVENT, |
408 | SCTP_PARTIAL_DELIVERY_EVENT, | 425 | SCTP_PARTIAL_DELIVERY_EVENT, |
409 | SCTP_ADAPTATION_INDICATION, | 426 | SCTP_ADAPTATION_INDICATION, |
410 | SCTP_AUTHENTICATION_INDICATION, | 427 | SCTP_AUTHENTICATION_EVENT, |
428 | #define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT | ||
429 | SCTP_SENDER_DRY_EVENT, | ||
411 | }; | 430 | }; |
412 | 431 | ||
413 | /* Notification error codes used to fill up the error fields in some | 432 | /* Notification error codes used to fill up the error fields in some |
@@ -669,6 +688,18 @@ struct sctp_authchunks { | |||
669 | }; | 688 | }; |
670 | 689 | ||
671 | /* | 690 | /* |
691 | * 8.2.6. Get the Current Identifiers of Associations | ||
692 | * (SCTP_GET_ASSOC_ID_LIST) | ||
693 | * | ||
694 | * This option gets the current list of SCTP association identifiers of | ||
695 | * the SCTP associations handled by a one-to-many style socket. | ||
696 | */ | ||
697 | struct sctp_assoc_ids { | ||
698 | __u32 gaids_number_of_ids; | ||
699 | sctp_assoc_t gaids_assoc_id[]; | ||
700 | }; | ||
701 | |||
702 | /* | ||
672 | * 8.3, 8.5 get all peer/local addresses in an association. | 703 | * 8.3, 8.5 get all peer/local addresses in an association. |
673 | * This parameter struct is used by SCTP_GET_PEER_ADDRS and | 704 | * This parameter struct is used by SCTP_GET_PEER_ADDRS and |
674 | * SCTP_GET_LOCAL_ADDRS socket options used internally to implement | 705 | * SCTP_GET_LOCAL_ADDRS socket options used internally to implement |
diff --git a/include/net/snmp.h b/include/net/snmp.h index 27461d6dd46f..479083a78b0c 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -72,14 +72,24 @@ struct icmpmsg_mib { | |||
72 | 72 | ||
73 | /* ICMP6 (IPv6-ICMP) */ | 73 | /* ICMP6 (IPv6-ICMP) */ |
74 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX | 74 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX |
75 | /* per network ns counters */ | ||
75 | struct icmpv6_mib { | 76 | struct icmpv6_mib { |
76 | unsigned long mibs[ICMP6_MIB_MAX]; | 77 | unsigned long mibs[ICMP6_MIB_MAX]; |
77 | }; | 78 | }; |
79 | /* per device counters, (shared on all cpus) */ | ||
80 | struct icmpv6_mib_device { | ||
81 | atomic_long_t mibs[ICMP6_MIB_MAX]; | ||
82 | }; | ||
78 | 83 | ||
79 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX | 84 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX |
85 | /* per network ns counters */ | ||
80 | struct icmpv6msg_mib { | 86 | struct icmpv6msg_mib { |
81 | unsigned long mibs[ICMP6MSG_MIB_MAX]; | 87 | unsigned long mibs[ICMP6MSG_MIB_MAX]; |
82 | }; | 88 | }; |
89 | /* per device counters, (shared on all cpus) */ | ||
90 | struct icmpv6msg_mib_device { | ||
91 | atomic_long_t mibs[ICMP6MSG_MIB_MAX]; | ||
92 | }; | ||
83 | 93 | ||
84 | 94 | ||
85 | /* TCP */ | 95 | /* TCP */ |
@@ -114,6 +124,8 @@ struct linux_xfrm_mib { | |||
114 | */ | 124 | */ |
115 | #define DEFINE_SNMP_STAT(type, name) \ | 125 | #define DEFINE_SNMP_STAT(type, name) \ |
116 | __typeof__(type) __percpu *name[2] | 126 | __typeof__(type) __percpu *name[2] |
127 | #define DEFINE_SNMP_STAT_ATOMIC(type, name) \ | ||
128 | __typeof__(type) *name | ||
117 | #define DECLARE_SNMP_STAT(type, name) \ | 129 | #define DECLARE_SNMP_STAT(type, name) \ |
118 | extern __typeof__(type) __percpu *name[2] | 130 | extern __typeof__(type) __percpu *name[2] |
119 | 131 | ||
@@ -124,6 +136,8 @@ struct linux_xfrm_mib { | |||
124 | __this_cpu_inc(mib[0]->mibs[field]) | 136 | __this_cpu_inc(mib[0]->mibs[field]) |
125 | #define SNMP_INC_STATS_USER(mib, field) \ | 137 | #define SNMP_INC_STATS_USER(mib, field) \ |
126 | this_cpu_inc(mib[1]->mibs[field]) | 138 | this_cpu_inc(mib[1]->mibs[field]) |
139 | #define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \ | ||
140 | atomic_long_inc(&mib->mibs[field]) | ||
127 | #define SNMP_INC_STATS(mib, field) \ | 141 | #define SNMP_INC_STATS(mib, field) \ |
128 | this_cpu_inc(mib[!in_softirq()]->mibs[field]) | 142 | this_cpu_inc(mib[!in_softirq()]->mibs[field]) |
129 | #define SNMP_DEC_STATS(mib, field) \ | 143 | #define SNMP_DEC_STATS(mib, field) \ |
diff --git a/include/net/sock.h b/include/net/sock.h index 01810a3f19df..f2046e404a61 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/mm.h> | 52 | #include <linux/mm.h> |
53 | #include <linux/security.h> | 53 | #include <linux/security.h> |
54 | #include <linux/slab.h> | 54 | #include <linux/slab.h> |
55 | #include <linux/uaccess.h> | ||
55 | 56 | ||
56 | #include <linux/filter.h> | 57 | #include <linux/filter.h> |
57 | #include <linux/rculist_nulls.h> | 58 | #include <linux/rculist_nulls.h> |
@@ -1389,6 +1390,59 @@ static inline void sk_nocaps_add(struct sock *sk, int flags) | |||
1389 | sk->sk_route_caps &= ~flags; | 1390 | sk->sk_route_caps &= ~flags; |
1390 | } | 1391 | } |
1391 | 1392 | ||
1393 | static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, | ||
1394 | char __user *from, char *to, | ||
1395 | int copy, int offset) | ||
1396 | { | ||
1397 | if (skb->ip_summed == CHECKSUM_NONE) { | ||
1398 | int err = 0; | ||
1399 | __wsum csum = csum_and_copy_from_user(from, to, copy, 0, &err); | ||
1400 | if (err) | ||
1401 | return err; | ||
1402 | skb->csum = csum_block_add(skb->csum, csum, offset); | ||
1403 | } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { | ||
1404 | if (!access_ok(VERIFY_READ, from, copy) || | ||
1405 | __copy_from_user_nocache(to, from, copy)) | ||
1406 | return -EFAULT; | ||
1407 | } else if (copy_from_user(to, from, copy)) | ||
1408 | return -EFAULT; | ||
1409 | |||
1410 | return 0; | ||
1411 | } | ||
1412 | |||
1413 | static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb, | ||
1414 | char __user *from, int copy) | ||
1415 | { | ||
1416 | int err, offset = skb->len; | ||
1417 | |||
1418 | err = skb_do_copy_data_nocache(sk, skb, from, skb_put(skb, copy), | ||
1419 | copy, offset); | ||
1420 | if (err) | ||
1421 | __skb_trim(skb, offset); | ||
1422 | |||
1423 | return err; | ||
1424 | } | ||
1425 | |||
1426 | static inline int skb_copy_to_page_nocache(struct sock *sk, char __user *from, | ||
1427 | struct sk_buff *skb, | ||
1428 | struct page *page, | ||
1429 | int off, int copy) | ||
1430 | { | ||
1431 | int err; | ||
1432 | |||
1433 | err = skb_do_copy_data_nocache(sk, skb, from, page_address(page) + off, | ||
1434 | copy, skb->len); | ||
1435 | if (err) | ||
1436 | return err; | ||
1437 | |||
1438 | skb->len += copy; | ||
1439 | skb->data_len += copy; | ||
1440 | skb->truesize += copy; | ||
1441 | sk->sk_wmem_queued += copy; | ||
1442 | sk_mem_charge(sk, copy); | ||
1443 | return 0; | ||
1444 | } | ||
1445 | |||
1392 | static inline int skb_copy_to_page(struct sock *sk, char __user *from, | 1446 | static inline int skb_copy_to_page(struct sock *sk, char __user *from, |
1393 | struct sk_buff *skb, struct page *page, | 1447 | struct sk_buff *skb, struct page *page, |
1394 | int off, int copy) | 1448 | int off, int copy) |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index a8122dc56410..5271a741c3a3 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * IPv6 transport protocols | 7 | * IPv6 transport protocols |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | extern struct proto rawv6_prot; | 10 | extern struct proto rawv6_prot; |
13 | extern struct proto udpv6_prot; | 11 | extern struct proto udpv6_prot; |
14 | extern struct proto udplitev6_prot; | 12 | extern struct proto udplitev6_prot; |
@@ -57,5 +55,3 @@ extern const struct inet_connection_sock_af_ops ipv4_specific; | |||
57 | extern void inet6_destroy_sock(struct sock *sk); | 55 | extern void inet6_destroy_sock(struct sock *sk); |
58 | 56 | ||
59 | #endif | 57 | #endif |
60 | |||
61 | #endif | ||
diff --git a/include/net/wimax.h b/include/net/wimax.h index c799ba7b708b..7328d5019d88 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
@@ -250,7 +250,6 @@ | |||
250 | 250 | ||
251 | #ifndef __NET__WIMAX_H__ | 251 | #ifndef __NET__WIMAX_H__ |
252 | #define __NET__WIMAX_H__ | 252 | #define __NET__WIMAX_H__ |
253 | #ifdef __KERNEL__ | ||
254 | 253 | ||
255 | #include <linux/wimax.h> | 254 | #include <linux/wimax.h> |
256 | #include <net/genetlink.h> | 255 | #include <net/genetlink.h> |
@@ -518,8 +517,4 @@ extern ssize_t wimax_msg_len(struct sk_buff *); | |||
518 | extern int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state); | 517 | extern int wimax_rfkill(struct wimax_dev *, enum wimax_rf_state); |
519 | extern int wimax_reset(struct wimax_dev *); | 518 | extern int wimax_reset(struct wimax_dev *); |
520 | 519 | ||
521 | #else | ||
522 | /* You might be looking for linux/wimax.h */ | ||
523 | #error This file should not be included from user space. | ||
524 | #endif /* #ifdef __KERNEL__ */ | ||
525 | #endif /* #ifndef __NET__WIMAX_H__ */ | 520 | #endif /* #ifndef __NET__WIMAX_H__ */ |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 20afeaa39395..b203e14d26b7 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -958,6 +958,15 @@ struct sec_path { | |||
958 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; | 958 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; |
959 | }; | 959 | }; |
960 | 960 | ||
961 | static inline int secpath_exists(struct sk_buff *skb) | ||
962 | { | ||
963 | #ifdef CONFIG_XFRM | ||
964 | return skb->sp != NULL; | ||
965 | #else | ||
966 | return 0; | ||
967 | #endif | ||
968 | } | ||
969 | |||
961 | static inline struct sec_path * | 970 | static inline struct sec_path * |
962 | secpath_get(struct sec_path *sp) | 971 | secpath_get(struct sec_path *sp) |
963 | { | 972 | { |
@@ -1468,7 +1477,7 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | |||
1468 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); | 1477 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); |
1469 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); | 1478 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); |
1470 | extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); | 1479 | extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); |
1471 | extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr); | 1480 | extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr); |
1472 | extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1481 | extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
1473 | extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1482 | extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
1474 | extern int xfrm6_output(struct sk_buff *skb); | 1483 | extern int xfrm6_output(struct sk_buff *skb); |
@@ -1563,8 +1572,8 @@ static inline int xfrm_addr_cmp(const xfrm_address_t *a, | |||
1563 | case AF_INET: | 1572 | case AF_INET: |
1564 | return (__force u32)a->a4 - (__force u32)b->a4; | 1573 | return (__force u32)a->a4 - (__force u32)b->a4; |
1565 | case AF_INET6: | 1574 | case AF_INET6: |
1566 | return ipv6_addr_cmp((struct in6_addr *)a, | 1575 | return ipv6_addr_cmp((const struct in6_addr *)a, |
1567 | (struct in6_addr *)b); | 1576 | (const struct in6_addr *)b); |
1568 | } | 1577 | } |
1569 | } | 1578 | } |
1570 | 1579 | ||
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 3fd5064dd43a..7b82080eb02c 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -56,7 +56,7 @@ struct pcmcia_driver { | |||
56 | int (*resume) (struct pcmcia_device *dev); | 56 | int (*resume) (struct pcmcia_device *dev); |
57 | 57 | ||
58 | struct module *owner; | 58 | struct module *owner; |
59 | struct pcmcia_device_id *id_table; | 59 | const struct pcmcia_device_id *id_table; |
60 | struct device_driver drv; | 60 | struct device_driver drv; |
61 | struct pcmcia_dynids dynids; | 61 | struct pcmcia_dynids dynids; |
62 | }; | 62 | }; |
diff --git a/include/rdma/Kbuild b/include/rdma/Kbuild index e7c043216558..ea56f76c0c22 100644 --- a/include/rdma/Kbuild +++ b/include/rdma/Kbuild | |||
@@ -1 +1,6 @@ | |||
1 | header-y += ib_user_cm.h | ||
1 | header-y += ib_user_mad.h | 2 | header-y += ib_user_mad.h |
3 | header-y += ib_user_sa.h | ||
4 | header-y += ib_user_verbs.h | ||
5 | header-y += rdma_netlink.h | ||
6 | header-y += rdma_user_cm.h | ||
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index b5fc9f39122b..ae8c68f30f1b 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -217,18 +217,19 @@ static inline enum ib_mtu iboe_get_mtu(int mtu) | |||
217 | static inline int iboe_get_rate(struct net_device *dev) | 217 | static inline int iboe_get_rate(struct net_device *dev) |
218 | { | 218 | { |
219 | struct ethtool_cmd cmd; | 219 | struct ethtool_cmd cmd; |
220 | u32 speed; | ||
220 | 221 | ||
221 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings || | 222 | if (dev_ethtool_get_settings(dev, &cmd)) |
222 | dev->ethtool_ops->get_settings(dev, &cmd)) | ||
223 | return IB_RATE_PORT_CURRENT; | 223 | return IB_RATE_PORT_CURRENT; |
224 | 224 | ||
225 | if (cmd.speed >= 40000) | 225 | speed = ethtool_cmd_speed(&cmd); |
226 | if (speed >= 40000) | ||
226 | return IB_RATE_40_GBPS; | 227 | return IB_RATE_40_GBPS; |
227 | else if (cmd.speed >= 30000) | 228 | else if (speed >= 30000) |
228 | return IB_RATE_30_GBPS; | 229 | return IB_RATE_30_GBPS; |
229 | else if (cmd.speed >= 20000) | 230 | else if (speed >= 20000) |
230 | return IB_RATE_20_GBPS; | 231 | return IB_RATE_20_GBPS; |
231 | else if (cmd.speed >= 10000) | 232 | else if (speed >= 10000) |
232 | return IB_RATE_10_GBPS; | 233 | return IB_RATE_10_GBPS; |
233 | else | 234 | else |
234 | return IB_RATE_PORT_CURRENT; | 235 | return IB_RATE_PORT_CURRENT; |
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h index bd3d380781e0..f79014aa28f9 100644 --- a/include/rdma/ib_user_cm.h +++ b/include/rdma/ib_user_cm.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #ifndef IB_USER_CM_H | 34 | #ifndef IB_USER_CM_H |
35 | #define IB_USER_CM_H | 35 | #define IB_USER_CM_H |
36 | 36 | ||
37 | #include <linux/types.h> | ||
37 | #include <rdma/ib_user_sa.h> | 38 | #include <rdma/ib_user_sa.h> |
38 | 39 | ||
39 | #define IB_USER_CM_ABI_VERSION 5 | 40 | #define IB_USER_CM_ABI_VERSION 5 |
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h index cbb822e8d791..2d0191c90f9e 100644 --- a/include/rdma/iw_cm.h +++ b/include/rdma/iw_cm.h | |||
@@ -46,18 +46,9 @@ enum iw_cm_event_type { | |||
46 | IW_CM_EVENT_CLOSE /* close complete */ | 46 | IW_CM_EVENT_CLOSE /* close complete */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | enum iw_cm_event_status { | ||
50 | IW_CM_EVENT_STATUS_OK = 0, /* request successful */ | ||
51 | IW_CM_EVENT_STATUS_ACCEPTED = 0, /* connect request accepted */ | ||
52 | IW_CM_EVENT_STATUS_REJECTED, /* connect request rejected */ | ||
53 | IW_CM_EVENT_STATUS_TIMEOUT, /* the operation timed out */ | ||
54 | IW_CM_EVENT_STATUS_RESET, /* reset from remote peer */ | ||
55 | IW_CM_EVENT_STATUS_EINVAL, /* asynchronous failure for bad parm */ | ||
56 | }; | ||
57 | |||
58 | struct iw_cm_event { | 49 | struct iw_cm_event { |
59 | enum iw_cm_event_type event; | 50 | enum iw_cm_event_type event; |
60 | enum iw_cm_event_status status; | 51 | int status; |
61 | struct sockaddr_in local_addr; | 52 | struct sockaddr_in local_addr; |
62 | struct sockaddr_in remote_addr; | 53 | struct sockaddr_in remote_addr; |
63 | void *private_data; | 54 | void *private_data; |
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 4fae90304648..26977c149c41 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
@@ -111,6 +111,20 @@ struct rdma_cm_event { | |||
111 | } param; | 111 | } param; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | enum rdma_cm_state { | ||
115 | RDMA_CM_IDLE, | ||
116 | RDMA_CM_ADDR_QUERY, | ||
117 | RDMA_CM_ADDR_RESOLVED, | ||
118 | RDMA_CM_ROUTE_QUERY, | ||
119 | RDMA_CM_ROUTE_RESOLVED, | ||
120 | RDMA_CM_CONNECT, | ||
121 | RDMA_CM_DISCONNECT, | ||
122 | RDMA_CM_ADDR_BOUND, | ||
123 | RDMA_CM_LISTEN, | ||
124 | RDMA_CM_DEVICE_REMOVAL, | ||
125 | RDMA_CM_DESTROYING | ||
126 | }; | ||
127 | |||
114 | struct rdma_cm_id; | 128 | struct rdma_cm_id; |
115 | 129 | ||
116 | /** | 130 | /** |
@@ -130,6 +144,7 @@ struct rdma_cm_id { | |||
130 | rdma_cm_event_handler event_handler; | 144 | rdma_cm_event_handler event_handler; |
131 | struct rdma_route route; | 145 | struct rdma_route route; |
132 | enum rdma_port_space ps; | 146 | enum rdma_port_space ps; |
147 | enum ib_qp_type qp_type; | ||
133 | u8 port_num; | 148 | u8 port_num; |
134 | }; | 149 | }; |
135 | 150 | ||
@@ -140,9 +155,11 @@ struct rdma_cm_id { | |||
140 | * returned rdma_id. | 155 | * returned rdma_id. |
141 | * @context: User specified context associated with the id. | 156 | * @context: User specified context associated with the id. |
142 | * @ps: RDMA port space. | 157 | * @ps: RDMA port space. |
158 | * @qp_type: type of queue pair associated with the id. | ||
143 | */ | 159 | */ |
144 | struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, | 160 | struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, |
145 | void *context, enum rdma_port_space ps); | 161 | void *context, enum rdma_port_space ps, |
162 | enum ib_qp_type qp_type); | ||
146 | 163 | ||
147 | /** | 164 | /** |
148 | * rdma_destroy_id - Destroys an RDMA identifier. | 165 | * rdma_destroy_id - Destroys an RDMA identifier. |
@@ -329,4 +346,14 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr); | |||
329 | */ | 346 | */ |
330 | void rdma_set_service_type(struct rdma_cm_id *id, int tos); | 347 | void rdma_set_service_type(struct rdma_cm_id *id, int tos); |
331 | 348 | ||
349 | /** | ||
350 | * rdma_set_reuseaddr - Allow the reuse of local addresses when binding | ||
351 | * the rdma_cm_id. | ||
352 | * @id: Communication identifier to configure. | ||
353 | * @reuse: Value indicating if the bound address is reusable. | ||
354 | * | ||
355 | * Reuse must be set before an address is bound to the id. | ||
356 | */ | ||
357 | int rdma_set_reuseaddr(struct rdma_cm_id *id, int reuse); | ||
358 | |||
332 | #endif /* RDMA_CM_H */ | 359 | #endif /* RDMA_CM_H */ |
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h new file mode 100644 index 000000000000..3c5363ab867b --- /dev/null +++ b/include/rdma/rdma_netlink.h | |||
@@ -0,0 +1,92 @@ | |||
1 | #ifndef _RDMA_NETLINK_H | ||
2 | #define _RDMA_NETLINK_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | enum { | ||
7 | RDMA_NL_RDMA_CM = 1 | ||
8 | }; | ||
9 | |||
10 | #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10) | ||
11 | #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) | ||
12 | #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) | ||
13 | |||
14 | enum { | ||
15 | RDMA_NL_RDMA_CM_ID_STATS = 0, | ||
16 | RDMA_NL_RDMA_CM_NUM_OPS | ||
17 | }; | ||
18 | |||
19 | enum { | ||
20 | RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, | ||
21 | RDMA_NL_RDMA_CM_ATTR_DST_ADDR, | ||
22 | RDMA_NL_RDMA_CM_NUM_ATTR, | ||
23 | }; | ||
24 | |||
25 | struct rdma_cm_id_stats { | ||
26 | __u32 qp_num; | ||
27 | __u32 bound_dev_if; | ||
28 | __u32 port_space; | ||
29 | __s32 pid; | ||
30 | __u8 cm_state; | ||
31 | __u8 node_type; | ||
32 | __u8 port_num; | ||
33 | __u8 qp_type; | ||
34 | }; | ||
35 | |||
36 | #ifdef __KERNEL__ | ||
37 | |||
38 | #include <linux/netlink.h> | ||
39 | |||
40 | struct ibnl_client_cbs { | ||
41 | int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); | ||
42 | }; | ||
43 | |||
44 | int ibnl_init(void); | ||
45 | void ibnl_cleanup(void); | ||
46 | |||
47 | /** | ||
48 | * Add a a client to the list of IB netlink exporters. | ||
49 | * @index: Index of the added client | ||
50 | * @nops: Number of supported ops by the added client. | ||
51 | * @cb_table: A table for op->callback | ||
52 | * | ||
53 | * Returns 0 on success or a negative error code. | ||
54 | */ | ||
55 | int ibnl_add_client(int index, int nops, | ||
56 | const struct ibnl_client_cbs cb_table[]); | ||
57 | |||
58 | /** | ||
59 | * Remove a client from IB netlink. | ||
60 | * @index: Index of the removed IB client. | ||
61 | * | ||
62 | * Returns 0 on success or a negative error code. | ||
63 | */ | ||
64 | int ibnl_remove_client(int index); | ||
65 | |||
66 | /** | ||
67 | * Put a new message in a supplied skb. | ||
68 | * @skb: The netlink skb. | ||
69 | * @nlh: Pointer to put the header of the new netlink message. | ||
70 | * @seq: The message sequence number. | ||
71 | * @len: The requested message length to allocate. | ||
72 | * @client: Calling IB netlink client. | ||
73 | * @op: message content op. | ||
74 | * Returns the allocated buffer on success and NULL on failure. | ||
75 | */ | ||
76 | void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, | ||
77 | int len, int client, int op); | ||
78 | /** | ||
79 | * Put a new attribute in a supplied skb. | ||
80 | * @skb: The netlink skb. | ||
81 | * @nlh: Header of the netlink message to append the attribute to. | ||
82 | * @len: The length of the attribute data. | ||
83 | * @data: The attribute data to put. | ||
84 | * @type: The attribute type. | ||
85 | * Returns the 0 and a negative error code on failure. | ||
86 | */ | ||
87 | int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, | ||
88 | int len, void *data, int type); | ||
89 | |||
90 | #endif /* __KERNEL__ */ | ||
91 | |||
92 | #endif /* _RDMA_NETLINK_H */ | ||
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index 1d165022c02d..fc82c1896f75 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -221,8 +221,9 @@ enum { | |||
221 | 221 | ||
222 | /* Option details */ | 222 | /* Option details */ |
223 | enum { | 223 | enum { |
224 | RDMA_OPTION_ID_TOS = 0, | 224 | RDMA_OPTION_ID_TOS = 0, |
225 | RDMA_OPTION_IB_PATH = 1 | 225 | RDMA_OPTION_ID_REUSEADDR = 1, |
226 | RDMA_OPTION_IB_PATH = 1 | ||
226 | }; | 227 | }; |
227 | 228 | ||
228 | struct rdma_ucm_set_option { | 229 | struct rdma_ucm_set_option { |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 8f6bb9c7f3eb..ee866060f8a4 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -604,6 +604,7 @@ struct sas_domain_function_template { | |||
604 | int (*lldd_clear_aca)(struct domain_device *, u8 *lun); | 604 | int (*lldd_clear_aca)(struct domain_device *, u8 *lun); |
605 | int (*lldd_clear_task_set)(struct domain_device *, u8 *lun); | 605 | int (*lldd_clear_task_set)(struct domain_device *, u8 *lun); |
606 | int (*lldd_I_T_nexus_reset)(struct domain_device *); | 606 | int (*lldd_I_T_nexus_reset)(struct domain_device *); |
607 | int (*lldd_ata_soft_reset)(struct domain_device *); | ||
607 | int (*lldd_lu_reset)(struct domain_device *, u8 *lun); | 608 | int (*lldd_lu_reset)(struct domain_device *, u8 *lun); |
608 | int (*lldd_query_task)(struct sas_task *); | 609 | int (*lldd_query_task)(struct sas_task *); |
609 | 610 | ||
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index d6e7994aa634..81dd12edc38c 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define MSG_SIMPLE_TAG 0x20 | 9 | #define MSG_SIMPLE_TAG 0x20 |
10 | #define MSG_HEAD_TAG 0x21 | 10 | #define MSG_HEAD_TAG 0x21 |
11 | #define MSG_ORDERED_TAG 0x22 | 11 | #define MSG_ORDERED_TAG 0x22 |
12 | #define MSG_ACA_TAG 0x24 /* unsupported */ | ||
12 | 13 | ||
13 | #define SCSI_NO_TAG (-1) /* identify no tag in use */ | 14 | #define SCSI_NO_TAG (-1) /* identify no tag in use */ |
14 | 15 | ||
diff --git a/include/sound/ak4641.h b/include/sound/ak4641.h new file mode 100644 index 000000000000..96d1991c811d --- /dev/null +++ b/include/sound/ak4641.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * AK4641 ALSA SoC Codec driver | ||
3 | * | ||
4 | * Copyright 2009 Philipp Zabel | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __AK4641_H | ||
12 | #define __AK4641_H | ||
13 | |||
14 | /** | ||
15 | * struct ak4641_platform_data - platform specific AK4641 configuration | ||
16 | * @gpio_power: GPIO to control external power to AK4641 | ||
17 | * @gpio_npdn: GPIO connected to AK4641 nPDN pin | ||
18 | * | ||
19 | * Both GPIO parameters are optional. | ||
20 | */ | ||
21 | struct ak4641_platform_data { | ||
22 | int gpio_power; | ||
23 | int gpio_npdn; | ||
24 | }; | ||
25 | |||
26 | #endif /* __AK4641_H */ | ||
diff --git a/include/sound/control.h b/include/sound/control.h index 404acb859cee..1a94a216ed99 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -113,6 +113,7 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, v | |||
113 | void snd_ctl_free_one(struct snd_kcontrol * kcontrol); | 113 | void snd_ctl_free_one(struct snd_kcontrol * kcontrol); |
114 | int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); | 114 | int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); |
115 | int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); | 115 | int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); |
116 | int snd_ctl_replace(struct snd_card *card, struct snd_kcontrol *kcontrol, bool add_on_replace); | ||
116 | int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); | 117 | int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); |
117 | int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); | 118 | int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); |
118 | int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, | 119 | int snd_ctl_activate_id(struct snd_card *card, struct snd_ctl_elem_id *id, |
diff --git a/include/sound/max98095.h b/include/sound/max98095.h new file mode 100644 index 000000000000..7513a42dd4aa --- /dev/null +++ b/include/sound/max98095.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Platform data for MAX98095 | ||
3 | * | ||
4 | * Copyright 2011 Maxim Integrated Products | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef __SOUND_MAX98095_PDATA_H__ | ||
14 | #define __SOUND_MAX98095_PDATA_H__ | ||
15 | |||
16 | /* Equalizer filter response configuration */ | ||
17 | struct max98095_eq_cfg { | ||
18 | const char *name; | ||
19 | unsigned int rate; | ||
20 | u16 band1[5]; | ||
21 | u16 band2[5]; | ||
22 | u16 band3[5]; | ||
23 | u16 band4[5]; | ||
24 | u16 band5[5]; | ||
25 | }; | ||
26 | |||
27 | /* Biquad filter response configuration */ | ||
28 | struct max98095_biquad_cfg { | ||
29 | const char *name; | ||
30 | unsigned int rate; | ||
31 | u16 band1[5]; | ||
32 | u16 band2[5]; | ||
33 | }; | ||
34 | |||
35 | /* codec platform data */ | ||
36 | struct max98095_pdata { | ||
37 | |||
38 | /* Equalizers for DAI1 and DAI2 */ | ||
39 | struct max98095_eq_cfg *eq_cfg; | ||
40 | unsigned int eq_cfgcnt; | ||
41 | |||
42 | /* Biquad filter for DAI1 and DAI2 */ | ||
43 | struct max98095_biquad_cfg *bq_cfg; | ||
44 | unsigned int bq_cfgcnt; | ||
45 | |||
46 | /* Analog/digital microphone configuration: | ||
47 | * 0 = analog microphone input (normal setting) | ||
48 | * 1 = digital microphone input | ||
49 | */ | ||
50 | unsigned int digmic_left_mode:1; | ||
51 | unsigned int digmic_right_mode:1; | ||
52 | }; | ||
53 | |||
54 | #endif | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index f72c1039a6fb..c46e7d89561d 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -24,7 +24,7 @@ | |||
24 | * SoC dynamic audio power management | 24 | * SoC dynamic audio power management |
25 | * | 25 | * |
26 | * We can have up to 4 power domains | 26 | * We can have up to 4 power domains |
27 | * 1. Codec domain - VREF, VMID | 27 | * 1. Codec domain - VREF, VMID |
28 | * Usually controlled at codec probe/remove, although can be set | 28 | * Usually controlled at codec probe/remove, although can be set |
29 | * at stream time if power is not needed for sidetone, etc. | 29 | * at stream time if power is not needed for sidetone, etc. |
30 | * 2. Platform/Machine domain - physically connected inputs and outputs | 30 | * 2. Platform/Machine domain - physically connected inputs and outputs |
@@ -39,30 +39,30 @@ | |||
39 | 39 | ||
40 | /* codec domain */ | 40 | /* codec domain */ |
41 | #define SND_SOC_DAPM_VMID(wname) \ | 41 | #define SND_SOC_DAPM_VMID(wname) \ |
42 | { .id = snd_soc_dapm_vmid, .name = wname, .kcontrols = NULL, \ | 42 | { .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ |
43 | .num_kcontrols = 0} | 43 | .num_kcontrols = 0} |
44 | 44 | ||
45 | /* platform domain */ | 45 | /* platform domain */ |
46 | #define SND_SOC_DAPM_INPUT(wname) \ | 46 | #define SND_SOC_DAPM_INPUT(wname) \ |
47 | { .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \ | 47 | { .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ |
48 | .num_kcontrols = 0, .reg = SND_SOC_NOPM } | 48 | .num_kcontrols = 0, .reg = SND_SOC_NOPM } |
49 | #define SND_SOC_DAPM_OUTPUT(wname) \ | 49 | #define SND_SOC_DAPM_OUTPUT(wname) \ |
50 | { .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \ | 50 | { .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ |
51 | .num_kcontrols = 0, .reg = SND_SOC_NOPM } | 51 | .num_kcontrols = 0, .reg = SND_SOC_NOPM } |
52 | #define SND_SOC_DAPM_MIC(wname, wevent) \ | 52 | #define SND_SOC_DAPM_MIC(wname, wevent) \ |
53 | { .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \ | 53 | { .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ |
54 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 54 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
55 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 55 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
56 | #define SND_SOC_DAPM_HP(wname, wevent) \ | 56 | #define SND_SOC_DAPM_HP(wname, wevent) \ |
57 | { .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \ | 57 | { .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ |
58 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 58 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
59 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} | 59 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} |
60 | #define SND_SOC_DAPM_SPK(wname, wevent) \ | 60 | #define SND_SOC_DAPM_SPK(wname, wevent) \ |
61 | { .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \ | 61 | { .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ |
62 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 62 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
63 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} | 63 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} |
64 | #define SND_SOC_DAPM_LINE(wname, wevent) \ | 64 | #define SND_SOC_DAPM_LINE(wname, wevent) \ |
65 | { .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \ | 65 | { .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ |
66 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 66 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
67 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} | 67 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} |
68 | 68 | ||
@@ -70,91 +70,91 @@ | |||
70 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ | 70 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ |
71 | wcontrols, wncontrols) \ | 71 | wcontrols, wncontrols) \ |
72 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 72 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
73 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 73 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
74 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ | 74 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ |
75 | wcontrols, wncontrols) \ | 75 | wcontrols, wncontrols) \ |
76 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 76 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ |
77 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 77 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
78 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ | 78 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ |
79 | wcontrols, wncontrols)\ | 79 | wcontrols, wncontrols)\ |
80 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 80 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
81 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} | 81 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
82 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ | 82 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ |
83 | wcontrols, wncontrols)\ | 83 | wcontrols, wncontrols)\ |
84 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 84 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ |
85 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 85 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ |
86 | .num_kcontrols = wncontrols} | 86 | .num_kcontrols = wncontrols} |
87 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ | 87 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ |
88 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 88 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ |
89 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0} | 89 | .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} |
90 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ | 90 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ |
91 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 91 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ |
92 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 92 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} |
93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 93 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 94 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
95 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 95 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} |
96 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 96 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
97 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 97 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
98 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 98 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} |
99 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 99 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
100 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 100 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ |
101 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 101 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ |
102 | .num_kcontrols = 1} | 102 | .num_kcontrols = 1} |
103 | 103 | ||
104 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 104 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
105 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ | 105 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ |
106 | wcontrols) \ | 106 | wcontrols) \ |
107 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 107 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
108 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 108 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} |
109 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ | 109 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ |
110 | wcontrols)\ | 110 | wcontrols)\ |
111 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 111 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
112 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 112 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} |
113 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ | 113 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ |
114 | wcontrols)\ | 114 | wcontrols)\ |
115 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 115 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ |
116 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | 116 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ |
117 | .num_kcontrols = ARRAY_SIZE(wcontrols)} | 117 | .num_kcontrols = ARRAY_SIZE(wcontrols)} |
118 | 118 | ||
119 | /* path domain with event - event handler must return 0 for success */ | 119 | /* path domain with event - event handler must return 0 for success */ |
120 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ | 120 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ |
121 | wncontrols, wevent, wflags) \ | 121 | wncontrols, wevent, wflags) \ |
122 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 122 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
123 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 123 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ |
124 | .event = wevent, .event_flags = wflags} | 124 | .event = wevent, .event_flags = wflags} |
125 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ | 125 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ |
126 | wncontrols, wevent, wflags) \ | 126 | wncontrols, wevent, wflags) \ |
127 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 127 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ |
128 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 128 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ |
129 | .event = wevent, .event_flags = wflags} | 129 | .event = wevent, .event_flags = wflags} |
130 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ | 130 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ |
131 | wncontrols, wevent, wflags) \ | 131 | wncontrols, wevent, wflags) \ |
132 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 132 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
133 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ | 133 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ |
134 | .event = wevent, .event_flags = wflags} | 134 | .event = wevent, .event_flags = wflags} |
135 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ | 135 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ |
136 | wcontrols, wncontrols, wevent, wflags) \ | 136 | wcontrols, wncontrols, wevent, wflags) \ |
137 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 137 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
138 | .invert = winvert, .kcontrols = wcontrols, \ | 138 | .invert = winvert, .kcontrol_news = wcontrols, \ |
139 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} | 139 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} |
140 | #define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ | 140 | #define SND_SOC_DAPM_MICBIAS_E(wname, wreg, wshift, winvert, wevent, wflags) \ |
141 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 141 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ |
142 | .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \ | 142 | .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0, \ |
143 | .event = wevent, .event_flags = wflags} | 143 | .event = wevent, .event_flags = wflags} |
144 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ | 144 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ |
145 | wevent, wflags) \ | 145 | wevent, wflags) \ |
146 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 146 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ |
147 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 147 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ |
148 | .event = wevent, .event_flags = wflags} | 148 | .event = wevent, .event_flags = wflags} |
149 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 149 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
150 | wevent, wflags) \ | 150 | wevent, wflags) \ |
151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
152 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 152 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ |
153 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
155 | wevent, wflags) \ | 155 | wevent, wflags) \ |
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
157 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ | 157 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ |
158 | .event = wevent, .event_flags = wflags} | 158 | .event = wevent, .event_flags = wflags} |
159 | 159 | ||
160 | /* additional sequencing control within an event type */ | 160 | /* additional sequencing control within an event type */ |
@@ -173,26 +173,26 @@ | |||
173 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 173 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
174 | wevent, wflags) \ | 174 | wevent, wflags) \ |
175 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 175 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ |
176 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 176 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ |
177 | .event = wevent, .event_flags = wflags} | 177 | .event = wevent, .event_flags = wflags} |
178 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 178 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
179 | wevent, wflags) \ | 179 | wevent, wflags) \ |
180 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 180 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
181 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 181 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ |
182 | .event = wevent, .event_flags = wflags} | 182 | .event = wevent, .event_flags = wflags} |
183 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ | 183 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ |
184 | wcontrols, wevent, wflags) \ | 184 | wcontrols, wevent, wflags) \ |
185 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 185 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ |
186 | .invert = winvert, .kcontrols = wcontrols, \ | 186 | .invert = winvert, .kcontrol_news = wcontrols, \ |
187 | .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} | 187 | .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} |
188 | 188 | ||
189 | /* events that are pre and post DAPM */ | 189 | /* events that are pre and post DAPM */ |
190 | #define SND_SOC_DAPM_PRE(wname, wevent) \ | 190 | #define SND_SOC_DAPM_PRE(wname, wevent) \ |
191 | { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ | 191 | { .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ |
192 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 192 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
193 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} | 193 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} |
194 | #define SND_SOC_DAPM_POST(wname, wevent) \ | 194 | #define SND_SOC_DAPM_POST(wname, wevent) \ |
195 | { .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \ | 195 | { .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ |
196 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 196 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
197 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} | 197 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} |
198 | 198 | ||
@@ -232,7 +232,7 @@ | |||
232 | 232 | ||
233 | /* generic widgets */ | 233 | /* generic widgets */ |
234 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 234 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
235 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ | 235 | { .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ |
236 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ | 236 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ |
237 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 237 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
238 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 238 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
@@ -356,7 +356,8 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card); | |||
356 | 356 | ||
357 | /* dapm sys fs - used by the core */ | 357 | /* dapm sys fs - used by the core */ |
358 | int snd_soc_dapm_sys_add(struct device *dev); | 358 | int snd_soc_dapm_sys_add(struct device *dev); |
359 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm); | 359 | void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, |
360 | struct dentry *parent); | ||
360 | 361 | ||
361 | /* dapm audio pin control and status */ | 362 | /* dapm audio pin control and status */ |
362 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, | 363 | int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, |
@@ -472,7 +473,8 @@ struct snd_soc_dapm_widget { | |||
472 | 473 | ||
473 | /* kcontrols that relate to this widget */ | 474 | /* kcontrols that relate to this widget */ |
474 | int num_kcontrols; | 475 | int num_kcontrols; |
475 | const struct snd_kcontrol_new *kcontrols; | 476 | const struct snd_kcontrol_new *kcontrol_news; |
477 | struct snd_kcontrol **kcontrols; | ||
476 | 478 | ||
477 | /* widget input and outputs */ | 479 | /* widget input and outputs */ |
478 | struct list_head sources; | 480 | struct list_head sources; |
@@ -516,4 +518,10 @@ struct snd_soc_dapm_context { | |||
516 | #endif | 518 | #endif |
517 | }; | 519 | }; |
518 | 520 | ||
521 | /* A list of widgets associated with an object, typically a snd_kcontrol */ | ||
522 | struct snd_soc_dapm_widget_list { | ||
523 | int num_widgets; | ||
524 | struct snd_soc_dapm_widget *widgets[0]; | ||
525 | }; | ||
526 | |||
519 | #endif | 527 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index bfa4836ea107..f1de3e0c75bc 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -248,7 +248,7 @@ typedef int (*hw_write_t)(void *,const char* ,int); | |||
248 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 248 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
249 | 249 | ||
250 | enum snd_soc_control_type { | 250 | enum snd_soc_control_type { |
251 | SND_SOC_CUSTOM, | 251 | SND_SOC_CUSTOM = 1, |
252 | SND_SOC_I2C, | 252 | SND_SOC_I2C, |
253 | SND_SOC_SPI, | 253 | SND_SOC_SPI, |
254 | }; | 254 | }; |
@@ -278,6 +278,10 @@ int snd_soc_register_codec(struct device *dev, | |||
278 | void snd_soc_unregister_codec(struct device *dev); | 278 | void snd_soc_unregister_codec(struct device *dev); |
279 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, | 279 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, |
280 | unsigned int reg); | 280 | unsigned int reg); |
281 | int snd_soc_codec_readable_register(struct snd_soc_codec *codec, | ||
282 | unsigned int reg); | ||
283 | int snd_soc_codec_writable_register(struct snd_soc_codec *codec, | ||
284 | unsigned int reg); | ||
281 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | 285 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, |
282 | int addr_bits, int data_bits, | 286 | int addr_bits, int data_bits, |
283 | enum snd_soc_control_type control); | 287 | enum snd_soc_control_type control); |
@@ -292,6 +296,8 @@ int snd_soc_default_volatile_register(struct snd_soc_codec *codec, | |||
292 | unsigned int reg); | 296 | unsigned int reg); |
293 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, | 297 | int snd_soc_default_readable_register(struct snd_soc_codec *codec, |
294 | unsigned int reg); | 298 | unsigned int reg); |
299 | int snd_soc_default_writable_register(struct snd_soc_codec *codec, | ||
300 | unsigned int reg); | ||
295 | 301 | ||
296 | /* Utility functions to get clock rates from various things */ | 302 | /* Utility functions to get clock rates from various things */ |
297 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 303 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
@@ -523,6 +529,7 @@ struct snd_soc_codec { | |||
523 | size_t reg_size; /* reg_cache_size * reg_word_size */ | 529 | size_t reg_size; /* reg_cache_size * reg_word_size */ |
524 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 530 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
525 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 531 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
532 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
526 | 533 | ||
527 | /* runtime */ | 534 | /* runtime */ |
528 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 535 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
@@ -539,10 +546,12 @@ struct snd_soc_codec { | |||
539 | 546 | ||
540 | /* codec IO */ | 547 | /* codec IO */ |
541 | void *control_data; /* codec control (i2c/3wire) data */ | 548 | void *control_data; /* codec control (i2c/3wire) data */ |
549 | enum snd_soc_control_type control_type; | ||
542 | hw_write_t hw_write; | 550 | hw_write_t hw_write; |
543 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); | 551 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
544 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); | 552 | unsigned int (*read)(struct snd_soc_codec *, unsigned int); |
545 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 553 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
554 | int (*bulk_write_raw)(struct snd_soc_codec *, unsigned int, const void *, size_t); | ||
546 | void *reg_cache; | 555 | void *reg_cache; |
547 | const void *reg_def_copy; | 556 | const void *reg_def_copy; |
548 | const struct snd_soc_cache_ops *cache_ops; | 557 | const struct snd_soc_cache_ops *cache_ops; |
@@ -568,7 +577,9 @@ struct snd_soc_codec_driver { | |||
568 | pm_message_t state); | 577 | pm_message_t state); |
569 | int (*resume)(struct snd_soc_codec *); | 578 | int (*resume)(struct snd_soc_codec *); |
570 | 579 | ||
571 | /* Default DAPM setup, added after probe() is run */ | 580 | /* Default control and setup, added after probe() is run */ |
581 | const struct snd_kcontrol_new *controls; | ||
582 | int num_controls; | ||
572 | const struct snd_soc_dapm_widget *dapm_widgets; | 583 | const struct snd_soc_dapm_widget *dapm_widgets; |
573 | int num_dapm_widgets; | 584 | int num_dapm_widgets; |
574 | const struct snd_soc_dapm_route *dapm_routes; | 585 | const struct snd_soc_dapm_route *dapm_routes; |
@@ -587,6 +598,7 @@ struct snd_soc_codec_driver { | |||
587 | size_t, unsigned int); | 598 | size_t, unsigned int); |
588 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 599 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
589 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 600 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
601 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | ||
590 | short reg_cache_size; | 602 | short reg_cache_size; |
591 | short reg_cache_step; | 603 | short reg_cache_step; |
592 | short reg_word_size; | 604 | short reg_word_size; |
@@ -690,6 +702,8 @@ struct snd_soc_aux_dev { | |||
690 | /* SoC card */ | 702 | /* SoC card */ |
691 | struct snd_soc_card { | 703 | struct snd_soc_card { |
692 | const char *name; | 704 | const char *name; |
705 | const char *long_name; | ||
706 | const char *driver_name; | ||
693 | struct device *dev; | 707 | struct device *dev; |
694 | struct snd_card *snd_card; | 708 | struct snd_card *snd_card; |
695 | struct module *owner; | 709 | struct module *owner; |
@@ -737,12 +751,15 @@ struct snd_soc_card { | |||
737 | struct snd_soc_pcm_runtime *rtd_aux; | 751 | struct snd_soc_pcm_runtime *rtd_aux; |
738 | int num_aux_rtd; | 752 | int num_aux_rtd; |
739 | 753 | ||
754 | const struct snd_kcontrol_new *controls; | ||
755 | int num_controls; | ||
756 | |||
740 | /* | 757 | /* |
741 | * Card-specific routes and widgets. | 758 | * Card-specific routes and widgets. |
742 | */ | 759 | */ |
743 | struct snd_soc_dapm_widget *dapm_widgets; | 760 | const struct snd_soc_dapm_widget *dapm_widgets; |
744 | int num_dapm_widgets; | 761 | int num_dapm_widgets; |
745 | struct snd_soc_dapm_route *dapm_routes; | 762 | const struct snd_soc_dapm_route *dapm_routes; |
746 | int num_dapm_routes; | 763 | int num_dapm_routes; |
747 | 764 | ||
748 | struct work_struct deferred_resume_work; | 765 | struct work_struct deferred_resume_work; |
@@ -805,7 +822,7 @@ struct soc_enum { | |||
805 | unsigned char shift_r; | 822 | unsigned char shift_r; |
806 | unsigned int max; | 823 | unsigned int max; |
807 | unsigned int mask; | 824 | unsigned int mask; |
808 | const char **texts; | 825 | const char * const *texts; |
809 | const unsigned int *values; | 826 | const unsigned int *values; |
810 | void *dapm; | 827 | void *dapm; |
811 | }; | 828 | }; |
@@ -814,6 +831,8 @@ struct soc_enum { | |||
814 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); | 831 | unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); |
815 | unsigned int snd_soc_write(struct snd_soc_codec *codec, | 832 | unsigned int snd_soc_write(struct snd_soc_codec *codec, |
816 | unsigned int reg, unsigned int val); | 833 | unsigned int reg, unsigned int val); |
834 | unsigned int snd_soc_bulk_write_raw(struct snd_soc_codec *codec, | ||
835 | unsigned int reg, const void *data, size_t len); | ||
817 | 836 | ||
818 | /* device driver data */ | 837 | /* device driver data */ |
819 | 838 | ||
@@ -871,6 +890,9 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
871 | INIT_LIST_HEAD(&card->dapm_list); | 890 | INIT_LIST_HEAD(&card->dapm_list); |
872 | } | 891 | } |
873 | 892 | ||
893 | int snd_soc_util_init(void); | ||
894 | void snd_soc_util_exit(void); | ||
895 | |||
874 | #include <sound/soc-dai.h> | 896 | #include <sound/soc-dai.h> |
875 | 897 | ||
876 | #ifdef CONFIG_DEBUG_FS | 898 | #ifdef CONFIG_DEBUG_FS |
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index 5718a02d3afb..d2ea112fc20f 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -26,29 +26,37 @@ | |||
26 | #include <media/v4l2-dev.h> | 26 | #include <media/v4l2-dev.h> |
27 | #include <media/v4l2-ioctl.h> | 27 | #include <media/v4l2-ioctl.h> |
28 | 28 | ||
29 | #define TEA575X_FMIF 10700 | ||
30 | |||
31 | #define TEA575X_DATA (1 << 0) | ||
32 | #define TEA575X_CLK (1 << 1) | ||
33 | #define TEA575X_WREN (1 << 2) | ||
34 | #define TEA575X_MOST (1 << 3) | ||
35 | |||
29 | struct snd_tea575x; | 36 | struct snd_tea575x; |
30 | 37 | ||
31 | struct snd_tea575x_ops { | 38 | struct snd_tea575x_ops { |
32 | void (*write)(struct snd_tea575x *tea, unsigned int val); | 39 | void (*set_pins)(struct snd_tea575x *tea, u8 pins); |
33 | unsigned int (*read)(struct snd_tea575x *tea); | 40 | u8 (*get_pins)(struct snd_tea575x *tea); |
34 | void (*mute)(struct snd_tea575x *tea, unsigned int mute); | 41 | void (*set_direction)(struct snd_tea575x *tea, bool output); |
35 | }; | 42 | }; |
36 | 43 | ||
37 | struct snd_tea575x { | 44 | struct snd_tea575x { |
38 | struct snd_card *card; | ||
39 | struct video_device *vd; /* video device */ | 45 | struct video_device *vd; /* video device */ |
40 | int dev_nr; /* requested device number + 1 */ | 46 | bool tea5759; /* 5759 chip is present */ |
41 | int tea5759; /* 5759 chip is present */ | 47 | bool mute; /* Device is muted? */ |
42 | int mute; /* Device is muted? */ | 48 | bool stereo; /* receiving stereo */ |
43 | unsigned int freq_fixup; /* crystal onboard */ | 49 | bool tuned; /* tuned to a station */ |
44 | unsigned int val; /* hw value */ | 50 | unsigned int val; /* hw value */ |
45 | unsigned long freq; /* frequency */ | 51 | unsigned long freq; /* frequency */ |
46 | unsigned long in_use; /* set if the device is in use */ | 52 | unsigned long in_use; /* set if the device is in use */ |
47 | struct snd_tea575x_ops *ops; | 53 | struct snd_tea575x_ops *ops; |
48 | void *private_data; | 54 | void *private_data; |
55 | u8 card[32]; | ||
56 | u8 bus_info[32]; | ||
49 | }; | 57 | }; |
50 | 58 | ||
51 | void snd_tea575x_init(struct snd_tea575x *tea); | 59 | int snd_tea575x_init(struct snd_tea575x *tea); |
52 | void snd_tea575x_exit(struct snd_tea575x *tea); | 60 | void snd_tea575x_exit(struct snd_tea575x *tea); |
53 | 61 | ||
54 | #endif /* __SOUND_TEA575X_TUNER_H */ | 62 | #endif /* __SOUND_TEA575X_TUNER_H */ |
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h index 6c6649656798..0b94192a8cdf 100644 --- a/include/sound/tlv320dac33-plat.h +++ b/include/sound/tlv320dac33-plat.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Platform header for Texas Instruments TLV320DAC33 codec driver | 2 | * Platform header for Texas Instruments TLV320DAC33 codec driver |
3 | * | 3 | * |
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | 4 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
5 | * | 5 | * |
6 | * Copyright: (C) 2009 Nokia Corporation | 6 | * Copyright: (C) 2009 Nokia Corporation |
7 | * | 7 | * |
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index e29fde6b5cbe..89beccb57edd 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) Nokia Corporation | 4 | * Copyright (C) Nokia Corporation |
5 | * | 5 | * |
6 | * Written by Peter Ujfalusi <peter.ujfalusi@nokia.com> | 6 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License | 9 | * modify it under the terms of the GNU General Public License |
diff --git a/include/sound/wm8915.h b/include/sound/wm8915.h new file mode 100644 index 000000000000..5817d762f6f3 --- /dev/null +++ b/include/sound/wm8915.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/sound/wm8915.h -- Platform data for WM8915 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM8903_H | ||
12 | #define __LINUX_SND_WM8903_H | ||
13 | |||
14 | enum wm8915_inmode { | ||
15 | WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */ | ||
16 | WM8915_INVERTING = 1, /* IN1xN */ | ||
17 | WM8915_NON_INVERTING = 2, /* IN1xP */ | ||
18 | WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */ | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * ReTune Mobile configurations are specified with a label, sample | ||
23 | * rate and set of values to write (the enable bits will be ignored). | ||
24 | * | ||
25 | * Configurations are expected to be generated using the ReTune Mobile | ||
26 | * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ | ||
27 | */ | ||
28 | struct wm8915_retune_mobile_config { | ||
29 | const char *name; | ||
30 | int rate; | ||
31 | u16 regs[20]; | ||
32 | }; | ||
33 | |||
34 | #define WM8915_SET_DEFAULT 0x10000 | ||
35 | |||
36 | struct wm8915_pdata { | ||
37 | int irq_flags; /** Set IRQ trigger flags; default active low */ | ||
38 | |||
39 | int ldo_ena; /** GPIO for LDO1; -1 for none */ | ||
40 | |||
41 | int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */ | ||
42 | |||
43 | enum wm8915_inmode inl_mode; | ||
44 | enum wm8915_inmode inr_mode; | ||
45 | |||
46 | u32 spkmute_seq; /** Value for register 0x802 */ | ||
47 | |||
48 | int gpio_base; | ||
49 | u32 gpio_default[5]; | ||
50 | |||
51 | int num_retune_mobile_cfgs; | ||
52 | struct wm8915_retune_mobile_config *retune_mobile_cfgs; | ||
53 | }; | ||
54 | |||
55 | #endif | ||
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h index 2b5306c503fb..1750bed7c2f6 100644 --- a/include/sound/wm8962.h +++ b/include/sound/wm8962.h | |||
@@ -14,6 +14,28 @@ | |||
14 | /* Use to set GPIO default values to zero */ | 14 | /* Use to set GPIO default values to zero */ |
15 | #define WM8962_GPIO_SET 0x10000 | 15 | #define WM8962_GPIO_SET 0x10000 |
16 | 16 | ||
17 | #define WM8962_GPIO_FN_CLKOUT 0 | ||
18 | #define WM8962_GPIO_FN_LOGIC 1 | ||
19 | #define WM8962_GPIO_FN_SDOUT 2 | ||
20 | #define WM8962_GPIO_FN_IRQ 3 | ||
21 | #define WM8962_GPIO_FN_THERMAL 4 | ||
22 | #define WM8962_GPIO_FN_PLL2_LOCK 6 | ||
23 | #define WM8962_GPIO_FN_PLL3_LOCK 7 | ||
24 | #define WM8962_GPIO_FN_FLL_LOCK 9 | ||
25 | #define WM8962_GPIO_FN_DRC_ACT 10 | ||
26 | #define WM8962_GPIO_FN_WSEQ_DONE 11 | ||
27 | #define WM8962_GPIO_FN_ALC_NG_ACT 12 | ||
28 | #define WM8962_GPIO_FN_ALC_PEAK_LIMIT 13 | ||
29 | #define WM8962_GPIO_FN_ALC_SATURATION 14 | ||
30 | #define WM8962_GPIO_FN_ALC_LEVEL_THR 15 | ||
31 | #define WM8962_GPIO_FN_ALC_LEVEL_LOCK 16 | ||
32 | #define WM8962_GPIO_FN_FIFO_ERR 17 | ||
33 | #define WM8962_GPIO_FN_OPCLK 18 | ||
34 | #define WM8962_GPIO_FN_DMICCLK 19 | ||
35 | #define WM8962_GPIO_FN_DMICDAT 20 | ||
36 | #define WM8962_GPIO_FN_MICD 21 | ||
37 | #define WM8962_GPIO_FN_MICSCD 22 | ||
38 | |||
17 | struct wm8962_pdata { | 39 | struct wm8962_pdata { |
18 | int gpio_base; | 40 | int gpio_base; |
19 | u32 gpio_init[WM8962_MAX_GPIO]; | 41 | u32 gpio_init[WM8962_MAX_GPIO]; |
diff --git a/include/staging/altera.h b/include/staging/altera.h deleted file mode 100644 index 94c0c6181daf..000000000000 --- a/include/staging/altera.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | * altera.h | ||
3 | * | ||
4 | * altera FPGA driver | ||
5 | * | ||
6 | * Copyright (C) Altera Corporation 1998-2001 | ||
7 | * Copyright (C) 2010 NetUP Inc. | ||
8 | * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | #ifndef _ALTERA_H_ | ||
27 | #define _ALTERA_H_ | ||
28 | |||
29 | struct altera_config { | ||
30 | void *dev; | ||
31 | u8 *action; | ||
32 | int (*jtag_io) (void *dev, int tms, int tdi, int tdo); | ||
33 | }; | ||
34 | |||
35 | #if defined(CONFIG_ALTERA_STAPL) || \ | ||
36 | (defined(CONFIG_ALTERA_STAPL_MODULE) && defined(MODULE)) | ||
37 | |||
38 | extern int altera_init(struct altera_config *config, const struct firmware *fw); | ||
39 | #else | ||
40 | |||
41 | static inline int altera_init(struct altera_config *config, | ||
42 | const struct firmware *fw) | ||
43 | { | ||
44 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | ||
45 | return 0; | ||
46 | } | ||
47 | #endif /* CONFIG_ALTERA_STAPL */ | ||
48 | |||
49 | #endif /* _ALTERA_H_ */ | ||
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1d3b5b2f0dbc..561ac99def5a 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -98,6 +98,7 @@ enum transport_state_table { | |||
98 | TRANSPORT_REMOVE = 14, | 98 | TRANSPORT_REMOVE = 14, |
99 | TRANSPORT_FREE = 15, | 99 | TRANSPORT_FREE = 15, |
100 | TRANSPORT_NEW_CMD_MAP = 16, | 100 | TRANSPORT_NEW_CMD_MAP = 16, |
101 | TRANSPORT_FREE_CMD_INTR = 17, | ||
101 | }; | 102 | }; |
102 | 103 | ||
103 | /* Used for struct se_cmd->se_cmd_flags */ | 104 | /* Used for struct se_cmd->se_cmd_flags */ |
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h index dc78f77f9450..747e1404dca0 100644 --- a/include/target/target_core_fabric_ops.h +++ b/include/target/target_core_fabric_ops.h | |||
@@ -77,7 +77,6 @@ struct target_core_fabric_ops { | |||
77 | u16 (*set_fabric_sense_len)(struct se_cmd *, u32); | 77 | u16 (*set_fabric_sense_len)(struct se_cmd *, u32); |
78 | u16 (*get_fabric_sense_len)(void); | 78 | u16 (*get_fabric_sense_len)(void); |
79 | int (*is_state_remove)(struct se_cmd *); | 79 | int (*is_state_remove)(struct se_cmd *); |
80 | u64 (*pack_lun)(unsigned int); | ||
81 | /* | 80 | /* |
82 | * fabric module calls for target_core_fabric_configfs.c | 81 | * fabric module calls for target_core_fabric_configfs.c |
83 | */ | 82 | */ |
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index 59aa464f6ee2..24a1c6cb83c3 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h | |||
@@ -172,6 +172,7 @@ extern int transport_generic_handle_cdb_map(struct se_cmd *); | |||
172 | extern int transport_generic_handle_data(struct se_cmd *); | 172 | extern int transport_generic_handle_data(struct se_cmd *); |
173 | extern void transport_new_cmd_failure(struct se_cmd *); | 173 | extern void transport_new_cmd_failure(struct se_cmd *); |
174 | extern int transport_generic_handle_tmr(struct se_cmd *); | 174 | extern int transport_generic_handle_tmr(struct se_cmd *); |
175 | extern void transport_generic_free_cmd_intr(struct se_cmd *); | ||
175 | extern void __transport_stop_task_timer(struct se_task *, unsigned long *); | 176 | extern void __transport_stop_task_timer(struct se_task *, unsigned long *); |
176 | extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]); | 177 | extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]); |
177 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, | 178 | extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, |
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index f445cff66ab7..4114129f0794 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -28,7 +28,7 @@ struct extent_buffer; | |||
28 | { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) | 28 | { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" }) |
29 | 29 | ||
30 | #define __show_root_type(obj) \ | 30 | #define __show_root_type(obj) \ |
31 | __print_symbolic(obj, \ | 31 | __print_symbolic_u64(obj, \ |
32 | { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ | 32 | { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \ |
33 | { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ | 33 | { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \ |
34 | { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ | 34 | { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \ |
@@ -125,7 +125,7 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, | |||
125 | ); | 125 | ); |
126 | 126 | ||
127 | #define __show_map_type(type) \ | 127 | #define __show_map_type(type) \ |
128 | __print_symbolic(type, \ | 128 | __print_symbolic_u64(type, \ |
129 | { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \ | 129 | { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \ |
130 | { EXTENT_MAP_HOLE, "HOLE" }, \ | 130 | { EXTENT_MAP_HOLE, "HOLE" }, \ |
131 | { EXTENT_MAP_INLINE, "INLINE" }, \ | 131 | { EXTENT_MAP_INLINE, "INLINE" }, \ |
diff --git a/include/trace/events/gpio.h b/include/trace/events/gpio.h new file mode 100644 index 000000000000..927a8ad9e51b --- /dev/null +++ b/include/trace/events/gpio.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM gpio | ||
3 | |||
4 | #if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_GPIO_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | |||
9 | TRACE_EVENT(gpio_direction, | ||
10 | |||
11 | TP_PROTO(unsigned gpio, int in, int err), | ||
12 | |||
13 | TP_ARGS(gpio, in, err), | ||
14 | |||
15 | TP_STRUCT__entry( | ||
16 | __field(unsigned, gpio) | ||
17 | __field(int, in) | ||
18 | __field(int, err) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->gpio = gpio; | ||
23 | __entry->in = in; | ||
24 | __entry->err = err; | ||
25 | ), | ||
26 | |||
27 | TP_printk("%u %3s (%d)", __entry->gpio, | ||
28 | __entry->in ? "in" : "out", __entry->err) | ||
29 | ); | ||
30 | |||
31 | TRACE_EVENT(gpio_value, | ||
32 | |||
33 | TP_PROTO(unsigned gpio, int get, int value), | ||
34 | |||
35 | TP_ARGS(gpio, get, value), | ||
36 | |||
37 | TP_STRUCT__entry( | ||
38 | __field(unsigned, gpio) | ||
39 | __field(int, get) | ||
40 | __field(int, value) | ||
41 | ), | ||
42 | |||
43 | TP_fast_assign( | ||
44 | __entry->gpio = gpio; | ||
45 | __entry->get = get; | ||
46 | __entry->value = value; | ||
47 | ), | ||
48 | |||
49 | TP_printk("%u %3s %d", __entry->gpio, | ||
50 | __entry->get ? "get" : "set", __entry->value) | ||
51 | ); | ||
52 | |||
53 | #endif /* if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */ | ||
54 | |||
55 | /* This part must be outside protection */ | ||
56 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index 1c09820df585..ae045ca7d356 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h | |||
@@ -20,8 +20,7 @@ struct softirq_action; | |||
20 | softirq_name(BLOCK_IOPOLL), \ | 20 | softirq_name(BLOCK_IOPOLL), \ |
21 | softirq_name(TASKLET), \ | 21 | softirq_name(TASKLET), \ |
22 | softirq_name(SCHED), \ | 22 | softirq_name(SCHED), \ |
23 | softirq_name(HRTIMER), \ | 23 | softirq_name(HRTIMER)) |
24 | softirq_name(RCU)) | ||
25 | 24 | ||
26 | /** | 25 | /** |
27 | * irq_handler_entry - called immediately before the irq action handler | 26 | * irq_handler_entry - called immediately before the irq action handler |
diff --git a/include/trace/events/net.h b/include/trace/events/net.h index 5f247f5ffc56..f99645d05a8f 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h | |||
@@ -12,22 +12,24 @@ | |||
12 | TRACE_EVENT(net_dev_xmit, | 12 | TRACE_EVENT(net_dev_xmit, |
13 | 13 | ||
14 | TP_PROTO(struct sk_buff *skb, | 14 | TP_PROTO(struct sk_buff *skb, |
15 | int rc), | 15 | int rc, |
16 | struct net_device *dev, | ||
17 | unsigned int skb_len), | ||
16 | 18 | ||
17 | TP_ARGS(skb, rc), | 19 | TP_ARGS(skb, rc, dev, skb_len), |
18 | 20 | ||
19 | TP_STRUCT__entry( | 21 | TP_STRUCT__entry( |
20 | __field( void *, skbaddr ) | 22 | __field( void *, skbaddr ) |
21 | __field( unsigned int, len ) | 23 | __field( unsigned int, len ) |
22 | __field( int, rc ) | 24 | __field( int, rc ) |
23 | __string( name, skb->dev->name ) | 25 | __string( name, dev->name ) |
24 | ), | 26 | ), |
25 | 27 | ||
26 | TP_fast_assign( | 28 | TP_fast_assign( |
27 | __entry->skbaddr = skb; | 29 | __entry->skbaddr = skb; |
28 | __entry->len = skb->len; | 30 | __entry->len = skb_len; |
29 | __entry->rc = rc; | 31 | __entry->rc = rc; |
30 | __assign_str(name, skb->dev->name); | 32 | __assign_str(name, dev->name); |
31 | ), | 33 | ), |
32 | 34 | ||
33 | TP_printk("dev=%s skbaddr=%p len=%u rc=%d", | 35 | TP_printk("dev=%s skbaddr=%p len=%u rc=%d", |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 3e68366d485a..533c49f48047 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -205,6 +205,19 @@ | |||
205 | ftrace_print_symbols_seq(p, value, symbols); \ | 205 | ftrace_print_symbols_seq(p, value, symbols); \ |
206 | }) | 206 | }) |
207 | 207 | ||
208 | #undef __print_symbolic_u64 | ||
209 | #if BITS_PER_LONG == 32 | ||
210 | #define __print_symbolic_u64(value, symbol_array...) \ | ||
211 | ({ \ | ||
212 | static const struct trace_print_flags_u64 symbols[] = \ | ||
213 | { symbol_array, { -1, NULL } }; \ | ||
214 | ftrace_print_symbols_seq_u64(p, value, symbols); \ | ||
215 | }) | ||
216 | #else | ||
217 | #define __print_symbolic_u64(value, symbol_array...) \ | ||
218 | __print_symbolic(value, symbol_array) | ||
219 | #endif | ||
220 | |||
208 | #undef __print_hex | 221 | #undef __print_hex |
209 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) | 222 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) |
210 | 223 | ||
diff --git a/include/video/newport.h b/include/video/newport.h index 3d7c4b492ec6..de980a3b60c9 100644 --- a/include/video/newport.h +++ b/include/video/newport.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * newport.h: Defines and register layout for NEWPORT graphics | 3 | * newport.h: Defines and register layout for NEWPORT graphics |
4 | * hardware. | 4 | * hardware. |
5 | * | 5 | * |
6 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | 6 | * Copyright (C) 1996 David S. Miller (davem@davemloft.net) |
7 | * | 7 | * |
8 | * Ulf Carlsson - Compatibility with the IRIX structures added | 8 | * Ulf Carlsson - Compatibility with the IRIX structures added |
9 | */ | 9 | */ |
diff --git a/include/video/omap-panel-generic-dpi.h b/include/video/omap-panel-generic-dpi.h new file mode 100644 index 000000000000..127e3f20328e --- /dev/null +++ b/include/video/omap-panel-generic-dpi.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Header for generic DPI panel driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Canonical Ltd. | ||
5 | * Author: Bryan Wu <bryan.wu@canonical.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef __OMAP_PANEL_GENERIC_DPI_H | ||
21 | #define __OMAP_PANEL_GENERIC_DPI_H | ||
22 | |||
23 | struct omap_dss_device; | ||
24 | |||
25 | /** | ||
26 | * struct panel_generic_dpi_data - panel driver configuration data | ||
27 | * @name: panel name | ||
28 | * @platform_enable: platform specific panel enable function | ||
29 | * @platform_disable: platform specific panel disable function | ||
30 | */ | ||
31 | struct panel_generic_dpi_data { | ||
32 | const char *name; | ||
33 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
34 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
35 | }; | ||
36 | |||
37 | #endif /* __OMAP_PANEL_GENERIC_DPI_H */ | ||
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h new file mode 100644 index 000000000000..921ae9327228 --- /dev/null +++ b/include/video/omap-panel-nokia-dsi.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef __OMAP_NOKIA_DSI_PANEL_H | ||
2 | #define __OMAP_NOKIA_DSI_PANEL_H | ||
3 | |||
4 | struct omap_dss_device; | ||
5 | |||
6 | /** | ||
7 | * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration | ||
8 | * @name: panel name | ||
9 | * @use_ext_te: use external TE | ||
10 | * @ext_te_gpio: external TE GPIO | ||
11 | * @esd_interval: interval of ESD checks, 0 = disabled (ms) | ||
12 | * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) | ||
13 | * @max_backlight_level: maximum backlight level | ||
14 | * @set_backlight: pointer to backlight set function | ||
15 | * @get_backlight: pointer to backlight get function | ||
16 | */ | ||
17 | struct nokia_dsi_panel_data { | ||
18 | const char *name; | ||
19 | |||
20 | int reset_gpio; | ||
21 | |||
22 | bool use_ext_te; | ||
23 | int ext_te_gpio; | ||
24 | |||
25 | unsigned esd_interval; | ||
26 | unsigned ulps_timeout; | ||
27 | |||
28 | int max_backlight_level; | ||
29 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
30 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
31 | }; | ||
32 | |||
33 | #endif /* __OMAP_NOKIA_DSI_PANEL_H */ | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h new file mode 100644 index 000000000000..892b97f8e157 --- /dev/null +++ b/include/video/omapdss.h | |||
@@ -0,0 +1,641 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Nokia Corporation | ||
3 | * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License version 2 as published by | ||
7 | * the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #ifndef __OMAP_OMAPDSS_H | ||
19 | #define __OMAP_OMAPDSS_H | ||
20 | |||
21 | #include <linux/list.h> | ||
22 | #include <linux/kobject.h> | ||
23 | #include <linux/device.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <asm/atomic.h> | ||
26 | |||
27 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | ||
28 | #define DISPC_IRQ_VSYNC (1 << 1) | ||
29 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) | ||
30 | #define DISPC_IRQ_EVSYNC_ODD (1 << 3) | ||
31 | #define DISPC_IRQ_ACBIAS_COUNT_STAT (1 << 4) | ||
32 | #define DISPC_IRQ_PROG_LINE_NUM (1 << 5) | ||
33 | #define DISPC_IRQ_GFX_FIFO_UNDERFLOW (1 << 6) | ||
34 | #define DISPC_IRQ_GFX_END_WIN (1 << 7) | ||
35 | #define DISPC_IRQ_PAL_GAMMA_MASK (1 << 8) | ||
36 | #define DISPC_IRQ_OCP_ERR (1 << 9) | ||
37 | #define DISPC_IRQ_VID1_FIFO_UNDERFLOW (1 << 10) | ||
38 | #define DISPC_IRQ_VID1_END_WIN (1 << 11) | ||
39 | #define DISPC_IRQ_VID2_FIFO_UNDERFLOW (1 << 12) | ||
40 | #define DISPC_IRQ_VID2_END_WIN (1 << 13) | ||
41 | #define DISPC_IRQ_SYNC_LOST (1 << 14) | ||
42 | #define DISPC_IRQ_SYNC_LOST_DIGIT (1 << 15) | ||
43 | #define DISPC_IRQ_WAKEUP (1 << 16) | ||
44 | #define DISPC_IRQ_SYNC_LOST2 (1 << 17) | ||
45 | #define DISPC_IRQ_VSYNC2 (1 << 18) | ||
46 | #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) | ||
47 | #define DISPC_IRQ_FRAMEDONE2 (1 << 22) | ||
48 | |||
49 | struct omap_dss_device; | ||
50 | struct omap_overlay_manager; | ||
51 | |||
52 | enum omap_display_type { | ||
53 | OMAP_DISPLAY_TYPE_NONE = 0, | ||
54 | OMAP_DISPLAY_TYPE_DPI = 1 << 0, | ||
55 | OMAP_DISPLAY_TYPE_DBI = 1 << 1, | ||
56 | OMAP_DISPLAY_TYPE_SDI = 1 << 2, | ||
57 | OMAP_DISPLAY_TYPE_DSI = 1 << 3, | ||
58 | OMAP_DISPLAY_TYPE_VENC = 1 << 4, | ||
59 | OMAP_DISPLAY_TYPE_HDMI = 1 << 5, | ||
60 | }; | ||
61 | |||
62 | enum omap_plane { | ||
63 | OMAP_DSS_GFX = 0, | ||
64 | OMAP_DSS_VIDEO1 = 1, | ||
65 | OMAP_DSS_VIDEO2 = 2 | ||
66 | }; | ||
67 | |||
68 | enum omap_channel { | ||
69 | OMAP_DSS_CHANNEL_LCD = 0, | ||
70 | OMAP_DSS_CHANNEL_DIGIT = 1, | ||
71 | OMAP_DSS_CHANNEL_LCD2 = 2, | ||
72 | }; | ||
73 | |||
74 | enum omap_color_mode { | ||
75 | OMAP_DSS_COLOR_CLUT1 = 1 << 0, /* BITMAP 1 */ | ||
76 | OMAP_DSS_COLOR_CLUT2 = 1 << 1, /* BITMAP 2 */ | ||
77 | OMAP_DSS_COLOR_CLUT4 = 1 << 2, /* BITMAP 4 */ | ||
78 | OMAP_DSS_COLOR_CLUT8 = 1 << 3, /* BITMAP 8 */ | ||
79 | OMAP_DSS_COLOR_RGB12U = 1 << 4, /* RGB12, 16-bit container */ | ||
80 | OMAP_DSS_COLOR_ARGB16 = 1 << 5, /* ARGB16 */ | ||
81 | OMAP_DSS_COLOR_RGB16 = 1 << 6, /* RGB16 */ | ||
82 | OMAP_DSS_COLOR_RGB24U = 1 << 7, /* RGB24, 32-bit container */ | ||
83 | OMAP_DSS_COLOR_RGB24P = 1 << 8, /* RGB24, 24-bit container */ | ||
84 | OMAP_DSS_COLOR_YUV2 = 1 << 9, /* YUV2 4:2:2 co-sited */ | ||
85 | OMAP_DSS_COLOR_UYVY = 1 << 10, /* UYVY 4:2:2 co-sited */ | ||
86 | OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */ | ||
87 | OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */ | ||
88 | OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */ | ||
89 | OMAP_DSS_COLOR_NV12 = 1 << 14, /* NV12 format: YUV 4:2:0 */ | ||
90 | OMAP_DSS_COLOR_RGBA16 = 1 << 15, /* RGBA16 - 4444 */ | ||
91 | OMAP_DSS_COLOR_RGBX16 = 1 << 16, /* RGBx16 - 4444 */ | ||
92 | OMAP_DSS_COLOR_ARGB16_1555 = 1 << 17, /* ARGB16 - 1555 */ | ||
93 | OMAP_DSS_COLOR_XRGB16_1555 = 1 << 18, /* xRGB16 - 1555 */ | ||
94 | }; | ||
95 | |||
96 | enum omap_lcd_display_type { | ||
97 | OMAP_DSS_LCD_DISPLAY_STN, | ||
98 | OMAP_DSS_LCD_DISPLAY_TFT, | ||
99 | }; | ||
100 | |||
101 | enum omap_dss_load_mode { | ||
102 | OMAP_DSS_LOAD_CLUT_AND_FRAME = 0, | ||
103 | OMAP_DSS_LOAD_CLUT_ONLY = 1, | ||
104 | OMAP_DSS_LOAD_FRAME_ONLY = 2, | ||
105 | OMAP_DSS_LOAD_CLUT_ONCE_FRAME = 3, | ||
106 | }; | ||
107 | |||
108 | enum omap_dss_trans_key_type { | ||
109 | OMAP_DSS_COLOR_KEY_GFX_DST = 0, | ||
110 | OMAP_DSS_COLOR_KEY_VID_SRC = 1, | ||
111 | }; | ||
112 | |||
113 | enum omap_rfbi_te_mode { | ||
114 | OMAP_DSS_RFBI_TE_MODE_1 = 1, | ||
115 | OMAP_DSS_RFBI_TE_MODE_2 = 2, | ||
116 | }; | ||
117 | |||
118 | enum omap_panel_config { | ||
119 | OMAP_DSS_LCD_IVS = 1<<0, | ||
120 | OMAP_DSS_LCD_IHS = 1<<1, | ||
121 | OMAP_DSS_LCD_IPC = 1<<2, | ||
122 | OMAP_DSS_LCD_IEO = 1<<3, | ||
123 | OMAP_DSS_LCD_RF = 1<<4, | ||
124 | OMAP_DSS_LCD_ONOFF = 1<<5, | ||
125 | |||
126 | OMAP_DSS_LCD_TFT = 1<<20, | ||
127 | }; | ||
128 | |||
129 | enum omap_dss_venc_type { | ||
130 | OMAP_DSS_VENC_TYPE_COMPOSITE, | ||
131 | OMAP_DSS_VENC_TYPE_SVIDEO, | ||
132 | }; | ||
133 | |||
134 | enum omap_display_caps { | ||
135 | OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, | ||
136 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, | ||
137 | }; | ||
138 | |||
139 | enum omap_dss_update_mode { | ||
140 | OMAP_DSS_UPDATE_DISABLED = 0, | ||
141 | OMAP_DSS_UPDATE_AUTO, | ||
142 | OMAP_DSS_UPDATE_MANUAL, | ||
143 | }; | ||
144 | |||
145 | enum omap_dss_display_state { | ||
146 | OMAP_DSS_DISPLAY_DISABLED = 0, | ||
147 | OMAP_DSS_DISPLAY_ACTIVE, | ||
148 | OMAP_DSS_DISPLAY_SUSPENDED, | ||
149 | }; | ||
150 | |||
151 | /* XXX perhaps this should be removed */ | ||
152 | enum omap_dss_overlay_managers { | ||
153 | OMAP_DSS_OVL_MGR_LCD, | ||
154 | OMAP_DSS_OVL_MGR_TV, | ||
155 | OMAP_DSS_OVL_MGR_LCD2, | ||
156 | }; | ||
157 | |||
158 | enum omap_dss_rotation_type { | ||
159 | OMAP_DSS_ROT_DMA = 0, | ||
160 | OMAP_DSS_ROT_VRFB = 1, | ||
161 | }; | ||
162 | |||
163 | /* clockwise rotation angle */ | ||
164 | enum omap_dss_rotation_angle { | ||
165 | OMAP_DSS_ROT_0 = 0, | ||
166 | OMAP_DSS_ROT_90 = 1, | ||
167 | OMAP_DSS_ROT_180 = 2, | ||
168 | OMAP_DSS_ROT_270 = 3, | ||
169 | }; | ||
170 | |||
171 | enum omap_overlay_caps { | ||
172 | OMAP_DSS_OVL_CAP_SCALE = 1 << 0, | ||
173 | OMAP_DSS_OVL_CAP_DISPC = 1 << 1, | ||
174 | }; | ||
175 | |||
176 | enum omap_overlay_manager_caps { | ||
177 | OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, | ||
178 | }; | ||
179 | |||
180 | enum omap_dss_clk_source { | ||
181 | OMAP_DSS_CLK_SRC_FCK = 0, /* OMAP2/3: DSS1_ALWON_FCLK | ||
182 | * OMAP4: DSS_FCLK */ | ||
183 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, /* OMAP3: DSI1_PLL_FCLK | ||
184 | * OMAP4: PLL1_CLK1 */ | ||
185 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK | ||
186 | * OMAP4: PLL1_CLK2 */ | ||
187 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, /* OMAP4: PLL2_CLK1 */ | ||
188 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */ | ||
189 | }; | ||
190 | |||
191 | /* RFBI */ | ||
192 | |||
193 | struct rfbi_timings { | ||
194 | int cs_on_time; | ||
195 | int cs_off_time; | ||
196 | int we_on_time; | ||
197 | int we_off_time; | ||
198 | int re_on_time; | ||
199 | int re_off_time; | ||
200 | int we_cycle_time; | ||
201 | int re_cycle_time; | ||
202 | int cs_pulse_width; | ||
203 | int access_time; | ||
204 | |||
205 | int clk_div; | ||
206 | |||
207 | u32 tim[5]; /* set by rfbi_convert_timings() */ | ||
208 | |||
209 | int converted; | ||
210 | }; | ||
211 | |||
212 | void omap_rfbi_write_command(const void *buf, u32 len); | ||
213 | void omap_rfbi_read_data(void *buf, u32 len); | ||
214 | void omap_rfbi_write_data(const void *buf, u32 len); | ||
215 | void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width, | ||
216 | u16 x, u16 y, | ||
217 | u16 w, u16 h); | ||
218 | int omap_rfbi_enable_te(bool enable, unsigned line); | ||
219 | int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, | ||
220 | unsigned hs_pulse_time, unsigned vs_pulse_time, | ||
221 | int hs_pol_inv, int vs_pol_inv, int extif_div); | ||
222 | void rfbi_bus_lock(void); | ||
223 | void rfbi_bus_unlock(void); | ||
224 | |||
225 | /* DSI */ | ||
226 | void dsi_bus_lock(struct omap_dss_device *dssdev); | ||
227 | void dsi_bus_unlock(struct omap_dss_device *dssdev); | ||
228 | int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, | ||
229 | int len); | ||
230 | int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, | ||
231 | u8 dcs_cmd); | ||
232 | int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
233 | u8 param); | ||
234 | int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, | ||
235 | u8 *data, int len); | ||
236 | int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
237 | u8 *buf, int buflen); | ||
238 | int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
239 | u8 *data); | ||
240 | int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, | ||
241 | u8 *data1, u8 *data2); | ||
242 | int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, | ||
243 | u16 len); | ||
244 | int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); | ||
245 | int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); | ||
246 | |||
247 | /* Board specific data */ | ||
248 | struct omap_dss_board_info { | ||
249 | int (*get_last_off_on_transaction_id)(struct device *dev); | ||
250 | int num_devices; | ||
251 | struct omap_dss_device **devices; | ||
252 | struct omap_dss_device *default_device; | ||
253 | void (*dsi_mux_pads)(bool enable); | ||
254 | }; | ||
255 | |||
256 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | ||
257 | /* Init with the board info */ | ||
258 | extern int omap_display_init(struct omap_dss_board_info *board_data); | ||
259 | #else | ||
260 | static inline int omap_display_init(struct omap_dss_board_info *board_data) | ||
261 | { | ||
262 | return 0; | ||
263 | } | ||
264 | #endif | ||
265 | |||
266 | struct omap_display_platform_data { | ||
267 | struct omap_dss_board_info *board_data; | ||
268 | /* TODO: Additional members to be added when PM is considered */ | ||
269 | |||
270 | bool (*opt_clock_available)(const char *clk_role); | ||
271 | }; | ||
272 | |||
273 | struct omap_video_timings { | ||
274 | /* Unit: pixels */ | ||
275 | u16 x_res; | ||
276 | /* Unit: pixels */ | ||
277 | u16 y_res; | ||
278 | /* Unit: KHz */ | ||
279 | u32 pixel_clock; | ||
280 | /* Unit: pixel clocks */ | ||
281 | u16 hsw; /* Horizontal synchronization pulse width */ | ||
282 | /* Unit: pixel clocks */ | ||
283 | u16 hfp; /* Horizontal front porch */ | ||
284 | /* Unit: pixel clocks */ | ||
285 | u16 hbp; /* Horizontal back porch */ | ||
286 | /* Unit: line clocks */ | ||
287 | u16 vsw; /* Vertical synchronization pulse width */ | ||
288 | /* Unit: line clocks */ | ||
289 | u16 vfp; /* Vertical front porch */ | ||
290 | /* Unit: line clocks */ | ||
291 | u16 vbp; /* Vertical back porch */ | ||
292 | }; | ||
293 | |||
294 | #ifdef CONFIG_OMAP2_DSS_VENC | ||
295 | /* Hardcoded timings for tv modes. Venc only uses these to | ||
296 | * identify the mode, and does not actually use the configs | ||
297 | * itself. However, the configs should be something that | ||
298 | * a normal monitor can also show */ | ||
299 | extern const struct omap_video_timings omap_dss_pal_timings; | ||
300 | extern const struct omap_video_timings omap_dss_ntsc_timings; | ||
301 | #endif | ||
302 | |||
303 | struct omap_overlay_info { | ||
304 | bool enabled; | ||
305 | |||
306 | u32 paddr; | ||
307 | void __iomem *vaddr; | ||
308 | u32 p_uv_addr; /* for NV12 format */ | ||
309 | u16 screen_width; | ||
310 | u16 width; | ||
311 | u16 height; | ||
312 | enum omap_color_mode color_mode; | ||
313 | u8 rotation; | ||
314 | enum omap_dss_rotation_type rotation_type; | ||
315 | bool mirror; | ||
316 | |||
317 | u16 pos_x; | ||
318 | u16 pos_y; | ||
319 | u16 out_width; /* if 0, out_width == width */ | ||
320 | u16 out_height; /* if 0, out_height == height */ | ||
321 | u8 global_alpha; | ||
322 | u8 pre_mult_alpha; | ||
323 | }; | ||
324 | |||
325 | struct omap_overlay { | ||
326 | struct kobject kobj; | ||
327 | struct list_head list; | ||
328 | |||
329 | /* static fields */ | ||
330 | const char *name; | ||
331 | int id; | ||
332 | enum omap_color_mode supported_modes; | ||
333 | enum omap_overlay_caps caps; | ||
334 | |||
335 | /* dynamic fields */ | ||
336 | struct omap_overlay_manager *manager; | ||
337 | struct omap_overlay_info info; | ||
338 | |||
339 | /* if true, info has been changed, but not applied() yet */ | ||
340 | bool info_dirty; | ||
341 | |||
342 | int (*set_manager)(struct omap_overlay *ovl, | ||
343 | struct omap_overlay_manager *mgr); | ||
344 | int (*unset_manager)(struct omap_overlay *ovl); | ||
345 | |||
346 | int (*set_overlay_info)(struct omap_overlay *ovl, | ||
347 | struct omap_overlay_info *info); | ||
348 | void (*get_overlay_info)(struct omap_overlay *ovl, | ||
349 | struct omap_overlay_info *info); | ||
350 | |||
351 | int (*wait_for_go)(struct omap_overlay *ovl); | ||
352 | }; | ||
353 | |||
354 | struct omap_overlay_manager_info { | ||
355 | u32 default_color; | ||
356 | |||
357 | enum omap_dss_trans_key_type trans_key_type; | ||
358 | u32 trans_key; | ||
359 | bool trans_enabled; | ||
360 | |||
361 | bool alpha_enabled; | ||
362 | }; | ||
363 | |||
364 | struct omap_overlay_manager { | ||
365 | struct kobject kobj; | ||
366 | struct list_head list; | ||
367 | |||
368 | /* static fields */ | ||
369 | const char *name; | ||
370 | int id; | ||
371 | enum omap_overlay_manager_caps caps; | ||
372 | int num_overlays; | ||
373 | struct omap_overlay **overlays; | ||
374 | enum omap_display_type supported_displays; | ||
375 | |||
376 | /* dynamic fields */ | ||
377 | struct omap_dss_device *device; | ||
378 | struct omap_overlay_manager_info info; | ||
379 | |||
380 | bool device_changed; | ||
381 | /* if true, info has been changed but not applied() yet */ | ||
382 | bool info_dirty; | ||
383 | |||
384 | int (*set_device)(struct omap_overlay_manager *mgr, | ||
385 | struct omap_dss_device *dssdev); | ||
386 | int (*unset_device)(struct omap_overlay_manager *mgr); | ||
387 | |||
388 | int (*set_manager_info)(struct omap_overlay_manager *mgr, | ||
389 | struct omap_overlay_manager_info *info); | ||
390 | void (*get_manager_info)(struct omap_overlay_manager *mgr, | ||
391 | struct omap_overlay_manager_info *info); | ||
392 | |||
393 | int (*apply)(struct omap_overlay_manager *mgr); | ||
394 | int (*wait_for_go)(struct omap_overlay_manager *mgr); | ||
395 | int (*wait_for_vsync)(struct omap_overlay_manager *mgr); | ||
396 | |||
397 | int (*enable)(struct omap_overlay_manager *mgr); | ||
398 | int (*disable)(struct omap_overlay_manager *mgr); | ||
399 | }; | ||
400 | |||
401 | struct omap_dss_device { | ||
402 | struct device dev; | ||
403 | |||
404 | enum omap_display_type type; | ||
405 | |||
406 | enum omap_channel channel; | ||
407 | |||
408 | union { | ||
409 | struct { | ||
410 | u8 data_lines; | ||
411 | } dpi; | ||
412 | |||
413 | struct { | ||
414 | u8 channel; | ||
415 | u8 data_lines; | ||
416 | } rfbi; | ||
417 | |||
418 | struct { | ||
419 | u8 datapairs; | ||
420 | } sdi; | ||
421 | |||
422 | struct { | ||
423 | u8 clk_lane; | ||
424 | u8 clk_pol; | ||
425 | u8 data1_lane; | ||
426 | u8 data1_pol; | ||
427 | u8 data2_lane; | ||
428 | u8 data2_pol; | ||
429 | u8 data3_lane; | ||
430 | u8 data3_pol; | ||
431 | u8 data4_lane; | ||
432 | u8 data4_pol; | ||
433 | |||
434 | int module; | ||
435 | |||
436 | bool ext_te; | ||
437 | u8 ext_te_gpio; | ||
438 | } dsi; | ||
439 | |||
440 | struct { | ||
441 | enum omap_dss_venc_type type; | ||
442 | bool invert_polarity; | ||
443 | } venc; | ||
444 | } phy; | ||
445 | |||
446 | struct { | ||
447 | struct { | ||
448 | struct { | ||
449 | u16 lck_div; | ||
450 | u16 pck_div; | ||
451 | enum omap_dss_clk_source lcd_clk_src; | ||
452 | } channel; | ||
453 | |||
454 | enum omap_dss_clk_source dispc_fclk_src; | ||
455 | } dispc; | ||
456 | |||
457 | struct { | ||
458 | u16 regn; | ||
459 | u16 regm; | ||
460 | u16 regm_dispc; | ||
461 | u16 regm_dsi; | ||
462 | |||
463 | u16 lp_clk_div; | ||
464 | enum omap_dss_clk_source dsi_fclk_src; | ||
465 | } dsi; | ||
466 | |||
467 | struct { | ||
468 | u16 regn; | ||
469 | u16 regm2; | ||
470 | } hdmi; | ||
471 | } clocks; | ||
472 | |||
473 | struct { | ||
474 | struct omap_video_timings timings; | ||
475 | |||
476 | int acbi; /* ac-bias pin transitions per interrupt */ | ||
477 | /* Unit: line clocks */ | ||
478 | int acb; /* ac-bias pin frequency */ | ||
479 | |||
480 | enum omap_panel_config config; | ||
481 | } panel; | ||
482 | |||
483 | struct { | ||
484 | u8 pixel_size; | ||
485 | struct rfbi_timings rfbi_timings; | ||
486 | } ctrl; | ||
487 | |||
488 | int reset_gpio; | ||
489 | |||
490 | int max_backlight_level; | ||
491 | |||
492 | const char *name; | ||
493 | |||
494 | /* used to match device to driver */ | ||
495 | const char *driver_name; | ||
496 | |||
497 | void *data; | ||
498 | |||
499 | struct omap_dss_driver *driver; | ||
500 | |||
501 | /* helper variable for driver suspend/resume */ | ||
502 | bool activate_after_resume; | ||
503 | |||
504 | enum omap_display_caps caps; | ||
505 | |||
506 | struct omap_overlay_manager *manager; | ||
507 | |||
508 | enum omap_dss_display_state state; | ||
509 | |||
510 | /* platform specific */ | ||
511 | int (*platform_enable)(struct omap_dss_device *dssdev); | ||
512 | void (*platform_disable)(struct omap_dss_device *dssdev); | ||
513 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
514 | int (*get_backlight)(struct omap_dss_device *dssdev); | ||
515 | }; | ||
516 | |||
517 | struct omap_dss_driver { | ||
518 | struct device_driver driver; | ||
519 | |||
520 | int (*probe)(struct omap_dss_device *); | ||
521 | void (*remove)(struct omap_dss_device *); | ||
522 | |||
523 | int (*enable)(struct omap_dss_device *display); | ||
524 | void (*disable)(struct omap_dss_device *display); | ||
525 | int (*suspend)(struct omap_dss_device *display); | ||
526 | int (*resume)(struct omap_dss_device *display); | ||
527 | int (*run_test)(struct omap_dss_device *display, int test); | ||
528 | |||
529 | int (*set_update_mode)(struct omap_dss_device *dssdev, | ||
530 | enum omap_dss_update_mode); | ||
531 | enum omap_dss_update_mode (*get_update_mode)( | ||
532 | struct omap_dss_device *dssdev); | ||
533 | |||
534 | int (*update)(struct omap_dss_device *dssdev, | ||
535 | u16 x, u16 y, u16 w, u16 h); | ||
536 | int (*sync)(struct omap_dss_device *dssdev); | ||
537 | |||
538 | int (*enable_te)(struct omap_dss_device *dssdev, bool enable); | ||
539 | int (*get_te)(struct omap_dss_device *dssdev); | ||
540 | |||
541 | u8 (*get_rotate)(struct omap_dss_device *dssdev); | ||
542 | int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate); | ||
543 | |||
544 | bool (*get_mirror)(struct omap_dss_device *dssdev); | ||
545 | int (*set_mirror)(struct omap_dss_device *dssdev, bool enable); | ||
546 | |||
547 | int (*memory_read)(struct omap_dss_device *dssdev, | ||
548 | void *buf, size_t size, | ||
549 | u16 x, u16 y, u16 w, u16 h); | ||
550 | |||
551 | void (*get_resolution)(struct omap_dss_device *dssdev, | ||
552 | u16 *xres, u16 *yres); | ||
553 | void (*get_dimensions)(struct omap_dss_device *dssdev, | ||
554 | u32 *width, u32 *height); | ||
555 | int (*get_recommended_bpp)(struct omap_dss_device *dssdev); | ||
556 | |||
557 | int (*check_timings)(struct omap_dss_device *dssdev, | ||
558 | struct omap_video_timings *timings); | ||
559 | void (*set_timings)(struct omap_dss_device *dssdev, | ||
560 | struct omap_video_timings *timings); | ||
561 | void (*get_timings)(struct omap_dss_device *dssdev, | ||
562 | struct omap_video_timings *timings); | ||
563 | |||
564 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); | ||
565 | u32 (*get_wss)(struct omap_dss_device *dssdev); | ||
566 | }; | ||
567 | |||
568 | int omap_dss_register_driver(struct omap_dss_driver *); | ||
569 | void omap_dss_unregister_driver(struct omap_dss_driver *); | ||
570 | |||
571 | void omap_dss_get_device(struct omap_dss_device *dssdev); | ||
572 | void omap_dss_put_device(struct omap_dss_device *dssdev); | ||
573 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) | ||
574 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); | ||
575 | struct omap_dss_device *omap_dss_find_device(void *data, | ||
576 | int (*match)(struct omap_dss_device *dssdev, void *data)); | ||
577 | |||
578 | int omap_dss_start_device(struct omap_dss_device *dssdev); | ||
579 | void omap_dss_stop_device(struct omap_dss_device *dssdev); | ||
580 | |||
581 | int omap_dss_get_num_overlay_managers(void); | ||
582 | struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); | ||
583 | |||
584 | int omap_dss_get_num_overlays(void); | ||
585 | struct omap_overlay *omap_dss_get_overlay(int num); | ||
586 | |||
587 | void omapdss_default_get_resolution(struct omap_dss_device *dssdev, | ||
588 | u16 *xres, u16 *yres); | ||
589 | int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); | ||
590 | |||
591 | typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); | ||
592 | int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); | ||
593 | int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); | ||
594 | |||
595 | int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); | ||
596 | int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, | ||
597 | unsigned long timeout); | ||
598 | |||
599 | #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) | ||
600 | #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) | ||
601 | |||
602 | void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, | ||
603 | bool enable); | ||
604 | int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable); | ||
605 | |||
606 | int omap_dsi_prepare_update(struct omap_dss_device *dssdev, | ||
607 | u16 *x, u16 *y, u16 *w, u16 *h, | ||
608 | bool enlarge_update_area); | ||
609 | int omap_dsi_update(struct omap_dss_device *dssdev, | ||
610 | int channel, | ||
611 | u16 x, u16 y, u16 w, u16 h, | ||
612 | void (*callback)(int, void *), void *data); | ||
613 | int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); | ||
614 | int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); | ||
615 | void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); | ||
616 | |||
617 | int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); | ||
618 | void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, | ||
619 | bool disconnect_lanes, bool enter_ulps); | ||
620 | |||
621 | int omapdss_dpi_display_enable(struct omap_dss_device *dssdev); | ||
622 | void omapdss_dpi_display_disable(struct omap_dss_device *dssdev); | ||
623 | void dpi_set_timings(struct omap_dss_device *dssdev, | ||
624 | struct omap_video_timings *timings); | ||
625 | int dpi_check_timings(struct omap_dss_device *dssdev, | ||
626 | struct omap_video_timings *timings); | ||
627 | |||
628 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev); | ||
629 | void omapdss_sdi_display_disable(struct omap_dss_device *dssdev); | ||
630 | |||
631 | int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev); | ||
632 | void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev); | ||
633 | int omap_rfbi_prepare_update(struct omap_dss_device *dssdev, | ||
634 | u16 *x, u16 *y, u16 *w, u16 *h); | ||
635 | int omap_rfbi_update(struct omap_dss_device *dssdev, | ||
636 | u16 x, u16 y, u16 w, u16 h, | ||
637 | void (*callback)(void *), void *data); | ||
638 | int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size, | ||
639 | int data_lines); | ||
640 | |||
641 | #endif | ||
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 2c8d369190b3..d964e68fc61d 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_SH_MOBILE_LCDC_H__ | 2 | #define __ASM_SH_MOBILE_LCDC_H__ |
3 | 3 | ||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <video/sh_mobile_meram.h> | ||
5 | 6 | ||
6 | enum { | 7 | enum { |
7 | RGB8, /* 24bpp, 8:8:8 */ | 8 | RGB8, /* 24bpp, 8:8:8 */ |
@@ -87,11 +88,13 @@ struct sh_mobile_lcdc_chan_cfg { | |||
87 | struct sh_mobile_lcdc_bl_info bl_info; | 88 | struct sh_mobile_lcdc_bl_info bl_info; |
88 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ | 89 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ |
89 | int nonstd; | 90 | int nonstd; |
91 | struct sh_mobile_meram_cfg *meram_cfg; | ||
90 | }; | 92 | }; |
91 | 93 | ||
92 | struct sh_mobile_lcdc_info { | 94 | struct sh_mobile_lcdc_info { |
93 | int clock_source; | 95 | int clock_source; |
94 | struct sh_mobile_lcdc_chan_cfg ch[2]; | 96 | struct sh_mobile_lcdc_chan_cfg ch[2]; |
97 | struct sh_mobile_meram_info *meram_dev; | ||
95 | }; | 98 | }; |
96 | 99 | ||
97 | #endif /* __ASM_SH_MOBILE_LCDC_H__ */ | 100 | #endif /* __ASM_SH_MOBILE_LCDC_H__ */ |
diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h new file mode 100644 index 000000000000..af602d602b28 --- /dev/null +++ b/include/video/sh_mobile_meram.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifndef __VIDEO_SH_MOBILE_MERAM_H__ | ||
2 | #define __VIDEO_SH_MOBILE_MERAM_H__ | ||
3 | |||
4 | /* For sh_mobile_meram_info.addr_mode */ | ||
5 | enum { | ||
6 | SH_MOBILE_MERAM_MODE0 = 0, | ||
7 | SH_MOBILE_MERAM_MODE1 | ||
8 | }; | ||
9 | |||
10 | enum { | ||
11 | SH_MOBILE_MERAM_PF_NV = 0, | ||
12 | SH_MOBILE_MERAM_PF_RGB, | ||
13 | SH_MOBILE_MERAM_PF_NV24 | ||
14 | }; | ||
15 | |||
16 | |||
17 | struct sh_mobile_meram_priv; | ||
18 | struct sh_mobile_meram_ops; | ||
19 | |||
20 | struct sh_mobile_meram_info { | ||
21 | int addr_mode; | ||
22 | struct sh_mobile_meram_ops *ops; | ||
23 | struct sh_mobile_meram_priv *priv; | ||
24 | struct platform_device *pdev; | ||
25 | }; | ||
26 | |||
27 | /* icb config */ | ||
28 | struct sh_mobile_meram_icb { | ||
29 | int marker_icb; /* ICB # for Marker ICB */ | ||
30 | int cache_icb; /* ICB # for Cache ICB */ | ||
31 | int meram_offset; /* MERAM Buffer Offset to use */ | ||
32 | int meram_size; /* MERAM Buffer Size to use */ | ||
33 | |||
34 | int cache_unit; /* bytes to cache per ICB */ | ||
35 | }; | ||
36 | |||
37 | struct sh_mobile_meram_cfg { | ||
38 | struct sh_mobile_meram_icb icb[2]; | ||
39 | int pixelformat; | ||
40 | int current_reg; | ||
41 | }; | ||
42 | |||
43 | struct module; | ||
44 | struct sh_mobile_meram_ops { | ||
45 | struct module *module; | ||
46 | /* register usage of meram */ | ||
47 | int (*meram_register)(struct sh_mobile_meram_info *meram_dev, | ||
48 | struct sh_mobile_meram_cfg *cfg, | ||
49 | int xres, int yres, int pixelformat, | ||
50 | unsigned long base_addr_y, | ||
51 | unsigned long base_addr_c, | ||
52 | unsigned long *icb_addr_y, | ||
53 | unsigned long *icb_addr_c, int *pitch); | ||
54 | |||
55 | /* unregister usage of meram */ | ||
56 | int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, | ||
57 | struct sh_mobile_meram_cfg *cfg); | ||
58 | |||
59 | /* update meram settings */ | ||
60 | int (*meram_update)(struct sh_mobile_meram_info *meram_dev, | ||
61 | struct sh_mobile_meram_cfg *cfg, | ||
62 | unsigned long base_addr_y, | ||
63 | unsigned long base_addr_c, | ||
64 | unsigned long *icb_addr_y, | ||
65 | unsigned long *icb_addr_c); | ||
66 | }; | ||
67 | |||
68 | #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ | ||
diff --git a/include/xen/events.h b/include/xen/events.h index f1b87ad48ac7..9af21e19545a 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -85,7 +85,8 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi, | |||
85 | int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); | 85 | int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); |
86 | /* Bind an PSI pirq to an irq. */ | 86 | /* Bind an PSI pirq to an irq. */ |
87 | int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, | 87 | int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, |
88 | int pirq, int vector, const char *name); | 88 | int pirq, int vector, const char *name, |
89 | domid_t domid); | ||
89 | #endif | 90 | #endif |
90 | 91 | ||
91 | /* De-allocates the above mentioned physical interrupt. */ | 92 | /* De-allocates the above mentioned physical interrupt. */ |
@@ -94,4 +95,10 @@ int xen_destroy_irq(int irq); | |||
94 | /* Return irq from pirq */ | 95 | /* Return irq from pirq */ |
95 | int xen_irq_from_pirq(unsigned pirq); | 96 | int xen_irq_from_pirq(unsigned pirq); |
96 | 97 | ||
98 | /* Return the pirq allocated to the irq. */ | ||
99 | int xen_pirq_from_irq(unsigned irq); | ||
100 | |||
101 | /* Determine whether to ignore this IRQ if it is passed to a guest. */ | ||
102 | int xen_test_irq_shared(int irq); | ||
103 | |||
97 | #endif /* _XEN_EVENTS_H */ | 104 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 61e523af3c46..3d5d6db864fe 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -45,6 +45,19 @@ typedef uint64_t blkif_sector_t; | |||
45 | #define BLKIF_OP_WRITE_BARRIER 2 | 45 | #define BLKIF_OP_WRITE_BARRIER 2 |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Recognised if "feature-flush-cache" is present in backend xenbus | ||
49 | * info. A flush will ask the underlying storage hardware to flush its | ||
50 | * non-volatile caches as appropriate. The "feature-flush-cache" node | ||
51 | * contains a boolean indicating whether flush requests are likely to | ||
52 | * succeed or fail. Either way, a flush request may fail at any time | ||
53 | * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying | ||
54 | * block-device hardware. The boolean simply indicates whether or not it | ||
55 | * is worthwhile for the frontend to attempt flushes. If a backend does | ||
56 | * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the | ||
57 | * "feature-flush-cache" node! | ||
58 | */ | ||
59 | #define BLKIF_OP_FLUSH_DISKCACHE 3 | ||
60 | /* | ||
48 | * Maximum scatter/gather segments per request. | 61 | * Maximum scatter/gather segments per request. |
49 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. | 62 | * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. |
50 | * NB. This could be 12 if the ring indexes weren't stored in the same page. | 63 | * NB. This could be 12 if the ring indexes weren't stored in the same page. |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index b33257bc7e83..70213b4515eb 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #define __HYPERVISOR_event_channel_op 32 | 58 | #define __HYPERVISOR_event_channel_op 32 |
59 | #define __HYPERVISOR_physdev_op 33 | 59 | #define __HYPERVISOR_physdev_op 33 |
60 | #define __HYPERVISOR_hvm_op 34 | 60 | #define __HYPERVISOR_hvm_op 34 |
61 | #define __HYPERVISOR_tmem_op 38 | ||
61 | 62 | ||
62 | /* Architecture-specific hypercall definitions. */ | 63 | /* Architecture-specific hypercall definitions. */ |
63 | #define __HYPERVISOR_arch_0 48 | 64 | #define __HYPERVISOR_arch_0 48 |
@@ -461,6 +462,27 @@ typedef uint8_t xen_domain_handle_t[16]; | |||
461 | #define __mk_unsigned_long(x) x ## UL | 462 | #define __mk_unsigned_long(x) x ## UL |
462 | #define mk_unsigned_long(x) __mk_unsigned_long(x) | 463 | #define mk_unsigned_long(x) __mk_unsigned_long(x) |
463 | 464 | ||
465 | #define TMEM_SPEC_VERSION 1 | ||
466 | |||
467 | struct tmem_op { | ||
468 | uint32_t cmd; | ||
469 | int32_t pool_id; | ||
470 | union { | ||
471 | struct { /* for cmd == TMEM_NEW_POOL */ | ||
472 | uint64_t uuid[2]; | ||
473 | uint32_t flags; | ||
474 | } new; | ||
475 | struct { | ||
476 | uint64_t oid[3]; | ||
477 | uint32_t index; | ||
478 | uint32_t tmem_offset; | ||
479 | uint32_t pfn_offset; | ||
480 | uint32_t len; | ||
481 | GUEST_HANDLE(void) gmfn; /* guest machine page frame */ | ||
482 | } gen; | ||
483 | } u; | ||
484 | }; | ||
485 | |||
464 | #else /* __ASSEMBLY__ */ | 486 | #else /* __ASSEMBLY__ */ |
465 | 487 | ||
466 | /* In assembly code we cannot use C numeric constant suffixes. */ | 488 | /* In assembly code we cannot use C numeric constant suffixes. */ |