diff options
Diffstat (limited to 'include')
520 files changed, 11002 insertions, 4161 deletions
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index c433d5e27679..c1ea8436961f 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h | |||
@@ -53,14 +53,14 @@ | |||
53 | * | 53 | * |
54 | * Note: The order of these include files is important. | 54 | * Note: The order of these include files is important. |
55 | */ | 55 | */ |
56 | #include "platform/acenv.h" /* Environment-specific items */ | 56 | #include <acpi/platform/acenv.h> /* Environment-specific items */ |
57 | #include "acnames.h" /* Common ACPI names and strings */ | 57 | #include <acpi/acnames.h> /* Common ACPI names and strings */ |
58 | #include "actypes.h" /* ACPICA data types and structures */ | 58 | #include <acpi/actypes.h> /* ACPICA data types and structures */ |
59 | #include "acexcep.h" /* ACPICA exceptions */ | 59 | #include <acpi/acexcep.h> /* ACPICA exceptions */ |
60 | #include "actbl.h" /* ACPI table definitions */ | 60 | #include <acpi/actbl.h> /* ACPI table definitions */ |
61 | #include "acoutput.h" /* Error output and Debug macros */ | 61 | #include <acpi/acoutput.h> /* Error output and Debug macros */ |
62 | #include "acrestyp.h" /* Resource Descriptor structs */ | 62 | #include <acpi/acrestyp.h> /* Resource Descriptor structs */ |
63 | #include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */ | 63 | #include <acpi/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */ |
64 | #include "acpixf.h" /* ACPI core subsystem external interfaces */ | 64 | #include <acpi/acpixf.h> /* ACPI core subsystem external interfaces */ |
65 | 65 | ||
66 | #endif /* __ACPI_H__ */ | 66 | #endif /* __ACPI_H__ */ |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 0650f5fa7ce9..1222ba93d80a 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -47,8 +47,8 @@ | |||
47 | #ifndef __ACPIOSXF_H__ | 47 | #ifndef __ACPIOSXF_H__ |
48 | #define __ACPIOSXF_H__ | 48 | #define __ACPIOSXF_H__ |
49 | 49 | ||
50 | #include "platform/acenv.h" | 50 | #include <acpi/platform/acenv.h> |
51 | #include "actypes.h" | 51 | #include <acpi/actypes.h> |
52 | 52 | ||
53 | /* Types for acpi_os_execute */ | 53 | /* Types for acpi_os_execute */ |
54 | 54 | ||
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 26a92fc28a59..51405d32ac64 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -49,9 +49,9 @@ | |||
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20120711 | 50 | #define ACPI_CA_VERSION 0x20120711 |
51 | 51 | ||
52 | #include "acconfig.h" | 52 | #include <acpi/acconfig.h> |
53 | #include "actypes.h" | 53 | #include <acpi/actypes.h> |
54 | #include "actbl.h" | 54 | #include <acpi/actbl.h> |
55 | 55 | ||
56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
57 | 57 | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 560a9f272f34..89cee88dd2a5 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -138,7 +138,7 @@ | |||
138 | /*! [Begin] no source code translation */ | 138 | /*! [Begin] no source code translation */ |
139 | 139 | ||
140 | #if defined(_LINUX) || defined(__linux__) | 140 | #if defined(_LINUX) || defined(__linux__) |
141 | #include "aclinux.h" | 141 | #include <acpi/platform/aclinux.h> |
142 | 142 | ||
143 | #elif defined(_AED_EFI) | 143 | #elif defined(_AED_EFI) |
144 | #include "acefi.h" | 144 | #include "acefi.h" |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 7509be30ca01..85d5d8f38452 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -106,7 +106,7 @@ | |||
106 | 106 | ||
107 | /* Linux uses GCC */ | 107 | /* Linux uses GCC */ |
108 | 108 | ||
109 | #include "acgcc.h" | 109 | #include <acpi/platform/acgcc.h> |
110 | 110 | ||
111 | 111 | ||
112 | #ifdef __KERNEL__ | 112 | #ifdef __KERNEL__ |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 64ec644808bc..555d0337ad95 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/cpu.h> | 5 | #include <linux/cpu.h> |
6 | #include <linux/cpuidle.h> | ||
7 | #include <linux/thermal.h> | 6 | #include <linux/thermal.h> |
8 | #include <asm/acpi.h> | 7 | #include <asm/acpi.h> |
9 | 8 | ||
@@ -59,13 +58,11 @@ struct acpi_processor_cx { | |||
59 | u8 entry_method; | 58 | u8 entry_method; |
60 | u8 index; | 59 | u8 index; |
61 | u32 latency; | 60 | u32 latency; |
62 | u32 power; | ||
63 | u8 bm_sts_skip; | 61 | u8 bm_sts_skip; |
64 | char desc[ACPI_CX_DESC_LEN]; | 62 | char desc[ACPI_CX_DESC_LEN]; |
65 | }; | 63 | }; |
66 | 64 | ||
67 | struct acpi_processor_power { | 65 | struct acpi_processor_power { |
68 | struct cpuidle_device dev; | ||
69 | struct acpi_processor_cx *state; | 66 | struct acpi_processor_cx *state; |
70 | unsigned long bm_check_timestamp; | 67 | unsigned long bm_check_timestamp; |
71 | u32 default_state; | 68 | u32 default_state; |
@@ -325,12 +322,10 @@ extern void acpi_processor_reevaluate_tstate(struct acpi_processor *pr, | |||
325 | extern const struct file_operations acpi_processor_throttling_fops; | 322 | extern const struct file_operations acpi_processor_throttling_fops; |
326 | extern void acpi_processor_throttling_init(void); | 323 | extern void acpi_processor_throttling_init(void); |
327 | /* in processor_idle.c */ | 324 | /* in processor_idle.c */ |
328 | int acpi_processor_power_init(struct acpi_processor *pr, | 325 | int acpi_processor_power_init(struct acpi_processor *pr); |
329 | struct acpi_device *device); | 326 | int acpi_processor_power_exit(struct acpi_processor *pr); |
330 | int acpi_processor_cst_has_changed(struct acpi_processor *pr); | 327 | int acpi_processor_cst_has_changed(struct acpi_processor *pr); |
331 | int acpi_processor_hotplug(struct acpi_processor *pr); | 328 | int acpi_processor_hotplug(struct acpi_processor *pr); |
332 | int acpi_processor_power_exit(struct acpi_processor *pr, | ||
333 | struct acpi_device *device); | ||
334 | int acpi_processor_suspend(struct device *dev); | 329 | int acpi_processor_suspend(struct device *dev); |
335 | int acpi_processor_resume(struct device *dev); | 330 | int acpi_processor_resume(struct device *dev); |
336 | extern struct cpuidle_driver acpi_idle_driver; | 331 | extern struct cpuidle_driver acpi_idle_driver; |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index c5d2e5dd871b..d2ee86b4c091 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
@@ -1,45 +1 @@ | |||
1 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | include include/uapi/asm-generic/Kbuild.asm | |
2 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
3 | header-y += kvm.h | ||
4 | endif | ||
5 | |||
6 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | ||
7 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | ||
8 | header-y += kvm_para.h | ||
9 | endif | ||
10 | |||
11 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | ||
12 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | ||
13 | header-y += a.out.h | ||
14 | endif | ||
15 | |||
16 | header-y += auxvec.h | ||
17 | header-y += bitsperlong.h | ||
18 | header-y += byteorder.h | ||
19 | header-y += errno.h | ||
20 | header-y += fcntl.h | ||
21 | header-y += ioctl.h | ||
22 | header-y += ioctls.h | ||
23 | header-y += ipcbuf.h | ||
24 | header-y += mman.h | ||
25 | header-y += msgbuf.h | ||
26 | header-y += param.h | ||
27 | header-y += poll.h | ||
28 | header-y += posix_types.h | ||
29 | header-y += ptrace.h | ||
30 | header-y += resource.h | ||
31 | header-y += sembuf.h | ||
32 | header-y += setup.h | ||
33 | header-y += shmbuf.h | ||
34 | header-y += sigcontext.h | ||
35 | header-y += siginfo.h | ||
36 | header-y += signal.h | ||
37 | header-y += socket.h | ||
38 | header-y += sockios.h | ||
39 | header-y += stat.h | ||
40 | header-y += statfs.h | ||
41 | header-y += swab.h | ||
42 | header-y += termbits.h | ||
43 | header-y += termios.h | ||
44 | header-y += types.h | ||
45 | header-y += unistd.h | ||
diff --git a/include/asm-generic/bitops/builtin-__ffs.h b/include/asm-generic/bitops/builtin-__ffs.h new file mode 100644 index 000000000000..90041e3a41f0 --- /dev/null +++ b/include/asm-generic/bitops/builtin-__ffs.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_ | ||
3 | |||
4 | /** | ||
5 | * __ffs - find first bit in word. | ||
6 | * @word: The word to search | ||
7 | * | ||
8 | * Undefined if no bit exists, so code should check against 0 first. | ||
9 | */ | ||
10 | static __always_inline unsigned long __ffs(unsigned long word) | ||
11 | { | ||
12 | return __builtin_ctzl(word); | ||
13 | } | ||
14 | |||
15 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-__fls.h b/include/asm-generic/bitops/builtin-__fls.h new file mode 100644 index 000000000000..0248f386635f --- /dev/null +++ b/include/asm-generic/bitops/builtin-__fls.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_BUILTIN___FLS_H_ | ||
3 | |||
4 | /** | ||
5 | * __fls - find last (most-significant) set bit in a long word | ||
6 | * @word: the word to search | ||
7 | * | ||
8 | * Undefined if no set bit exists, so code should check against 0 first. | ||
9 | */ | ||
10 | static __always_inline unsigned long __fls(unsigned long word) | ||
11 | { | ||
12 | return (sizeof(word) * 8) - 1 - __builtin_clzl(word); | ||
13 | } | ||
14 | |||
15 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-ffs.h b/include/asm-generic/bitops/builtin-ffs.h new file mode 100644 index 000000000000..064825829e1c --- /dev/null +++ b/include/asm-generic/bitops/builtin-ffs.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_ | ||
3 | |||
4 | /** | ||
5 | * ffs - find first bit set | ||
6 | * @x: the word to search | ||
7 | * | ||
8 | * This is defined the same way as | ||
9 | * the libc and compiler builtin ffs routines, therefore | ||
10 | * differs in spirit from the above ffz (man ffs). | ||
11 | */ | ||
12 | static __always_inline int ffs(int x) | ||
13 | { | ||
14 | return __builtin_ffs(x); | ||
15 | } | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-generic/bitops/builtin-fls.h b/include/asm-generic/bitops/builtin-fls.h new file mode 100644 index 000000000000..eda652d0ac7f --- /dev/null +++ b/include/asm-generic/bitops/builtin-fls.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ | ||
2 | #define _ASM_GENERIC_BITOPS_BUILTIN_FLS_H_ | ||
3 | |||
4 | /** | ||
5 | * fls - find last (most-significant) bit set | ||
6 | * @x: the word to search | ||
7 | * | ||
8 | * This is defined the same way as ffs. | ||
9 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. | ||
10 | */ | ||
11 | static __always_inline int fls(int x) | ||
12 | { | ||
13 | return x ? sizeof(x) * 8 - __builtin_clz(x) : 0; | ||
14 | } | ||
15 | |||
16 | #endif | ||
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 365ea09ed3b0..a9432fc6b8ba 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -60,6 +60,8 @@ struct device_node; | |||
60 | * @get: returns value for signal "offset"; for output signals this | 60 | * @get: returns value for signal "offset"; for output signals this |
61 | * returns either the value actually sensed, or zero | 61 | * returns either the value actually sensed, or zero |
62 | * @direction_output: configures signal "offset" as output, or returns error | 62 | * @direction_output: configures signal "offset" as output, or returns error |
63 | * @set_debounce: optional hook for setting debounce time for specified gpio in | ||
64 | * interrupt triggered gpio chips | ||
63 | * @set: assigns output value for signal "offset" | 65 | * @set: assigns output value for signal "offset" |
64 | * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; | 66 | * @to_irq: optional hook supporting non-static gpio_to_irq() mappings; |
65 | * implementation may not sleep | 67 | * implementation may not sleep |
diff --git a/include/clocksource/arm_generic.h b/include/clocksource/arm_generic.h new file mode 100644 index 000000000000..5b41b0d27f0f --- /dev/null +++ b/include/clocksource/arm_generic.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 ARM Ltd. | ||
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 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #ifndef __CLKSOURCE_ARM_GENERIC_H | ||
17 | #define __CLKSOURCE_ARM_GENERIC_H | ||
18 | |||
19 | extern int arm_generic_timer_init(void); | ||
20 | |||
21 | #endif | ||
diff --git a/include/drm/drm.h b/include/drm/drm.h index e51035a3757f..1e3481edf062 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
@@ -628,7 +628,7 @@ struct drm_prime_handle { | |||
628 | __s32 fd; | 628 | __s32 fd; |
629 | }; | 629 | }; |
630 | 630 | ||
631 | #include "drm_mode.h" | 631 | #include <drm/drm_mode.h> |
632 | 632 | ||
633 | #define DRM_IOCTL_BASE 'd' | 633 | #define DRM_IOCTL_BASE 'd' |
634 | #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) | 634 | #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d5f0c163eef1..3fd82809b2d4 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -72,7 +72,8 @@ | |||
72 | #include <linux/workqueue.h> | 72 | #include <linux/workqueue.h> |
73 | #include <linux/poll.h> | 73 | #include <linux/poll.h> |
74 | #include <asm/pgalloc.h> | 74 | #include <asm/pgalloc.h> |
75 | #include "drm.h" | 75 | #include <drm/drm.h> |
76 | #include <drm/drm_sarea.h> | ||
76 | 77 | ||
77 | #include <linux/idr.h> | 78 | #include <linux/idr.h> |
78 | 79 | ||
@@ -84,9 +85,9 @@ struct module; | |||
84 | struct drm_file; | 85 | struct drm_file; |
85 | struct drm_device; | 86 | struct drm_device; |
86 | 87 | ||
87 | #include "drm_os_linux.h" | 88 | #include <drm/drm_os_linux.h> |
88 | #include "drm_hashtab.h" | 89 | #include <drm/drm_hashtab.h> |
89 | #include "drm_mm.h" | 90 | #include <drm/drm_mm.h> |
90 | 91 | ||
91 | #define DRM_UT_CORE 0x01 | 92 | #define DRM_UT_CORE 0x01 |
92 | #define DRM_UT_DRIVER 0x02 | 93 | #define DRM_UT_DRIVER 0x02 |
@@ -426,8 +427,8 @@ struct drm_prime_file_private { | |||
426 | /** File private data */ | 427 | /** File private data */ |
427 | struct drm_file { | 428 | struct drm_file { |
428 | int authenticated; | 429 | int authenticated; |
429 | pid_t pid; | 430 | struct pid *pid; |
430 | uid_t uid; | 431 | kuid_t uid; |
431 | drm_magic_t magic; | 432 | drm_magic_t magic; |
432 | unsigned long ioctl_count; | 433 | unsigned long ioctl_count; |
433 | struct list_head lhead; | 434 | struct list_head lhead; |
@@ -675,7 +676,7 @@ struct drm_gem_object { | |||
675 | struct dma_buf_attachment *import_attach; | 676 | struct dma_buf_attachment *import_attach; |
676 | }; | 677 | }; |
677 | 678 | ||
678 | #include "drm_crtc.h" | 679 | #include <drm/drm_crtc.h> |
679 | 680 | ||
680 | /* per-master structure */ | 681 | /* per-master structure */ |
681 | struct drm_master { | 682 | struct drm_master { |
@@ -1303,7 +1304,7 @@ extern void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *v | |||
1303 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); | 1304 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1304 | 1305 | ||
1305 | /* Memory management support (drm_memory.h) */ | 1306 | /* Memory management support (drm_memory.h) */ |
1306 | #include "drm_memory.h" | 1307 | #include <drm/drm_memory.h> |
1307 | extern void drm_free_agp(DRM_AGP_MEM * handle, int pages); | 1308 | extern void drm_free_agp(DRM_AGP_MEM * handle, int pages); |
1308 | extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); | 1309 | extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); |
1309 | extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, | 1310 | extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, |
@@ -1613,7 +1614,7 @@ void drm_gem_vm_open(struct vm_area_struct *vma); | |||
1613 | void drm_gem_vm_close(struct vm_area_struct *vma); | 1614 | void drm_gem_vm_close(struct vm_area_struct *vma); |
1614 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); | 1615 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); |
1615 | 1616 | ||
1616 | #include "drm_global.h" | 1617 | #include <drm/drm_global.h> |
1617 | 1618 | ||
1618 | static inline void | 1619 | static inline void |
1619 | drm_gem_object_reference(struct drm_gem_object *obj) | 1620 | drm_gem_object_reference(struct drm_gem_object *obj) |
@@ -1722,7 +1723,7 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
1722 | { | 1723 | { |
1723 | } | 1724 | } |
1724 | 1725 | ||
1725 | #include "drm_mem_util.h" | 1726 | #include <drm/drm_mem_util.h> |
1726 | 1727 | ||
1727 | extern int drm_fill_in_dev(struct drm_device *dev, | 1728 | extern int drm_fill_in_dev(struct drm_device *dev, |
1728 | const struct pci_device_id *ent, | 1729 | const struct pci_device_id *ent, |
diff --git a/include/drm/drm_buffer.h b/include/drm/drm_buffer.h index 322dbff3f861..c80d3a340b94 100644 --- a/include/drm/drm_buffer.h +++ b/include/drm/drm_buffer.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef _DRM_BUFFER_H_ | 35 | #ifndef _DRM_BUFFER_H_ |
36 | #define _DRM_BUFFER_H_ | 36 | #define _DRM_BUFFER_H_ |
37 | 37 | ||
38 | #include "drmP.h" | 38 | #include <drm/drmP.h> |
39 | 39 | ||
40 | struct drm_buffer { | 40 | struct drm_buffer { |
41 | int iterator; | 41 | int iterator; |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8e405b82707d..1816bb31273a 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | #include <linux/fb.h> | 32 | #include <linux/fb.h> |
33 | #include <drm/drm_mode.h> | ||
33 | 34 | ||
34 | #include <drm/drm_fourcc.h> | 35 | #include <drm/drm_fourcc.h> |
35 | 36 | ||
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h index 7dc385233805..b0c11a7809bb 100644 --- a/include/drm/drm_encoder_slave.h +++ b/include/drm/drm_encoder_slave.h | |||
@@ -27,8 +27,8 @@ | |||
27 | #ifndef __DRM_ENCODER_SLAVE_H__ | 27 | #ifndef __DRM_ENCODER_SLAVE_H__ |
28 | #define __DRM_ENCODER_SLAVE_H__ | 28 | #define __DRM_ENCODER_SLAVE_H__ |
29 | 29 | ||
30 | #include "drmP.h" | 30 | #include <drm/drmP.h> |
31 | #include "drm_crtc.h" | 31 | #include <drm/drm_crtc.h> |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver | 34 | * struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver |
diff --git a/include/drm/drm_memory.h b/include/drm/drm_memory.h index 15af9b32ae42..4baf57a207e7 100644 --- a/include/drm/drm_memory.h +++ b/include/drm/drm_memory.h | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | #include <linux/highmem.h> | 36 | #include <linux/highmem.h> |
37 | #include <linux/vmalloc.h> | 37 | #include <linux/vmalloc.h> |
38 | #include "drmP.h" | 38 | #include <drm/drmP.h> |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Cut down version of drm_memory_debug.h, which used to be called | 41 | * Cut down version of drm_memory_debug.h, which used to be called |
diff --git a/include/drm/drm_sarea.h b/include/drm/drm_sarea.h index 1d1a858a203d..413a5642d49f 100644 --- a/include/drm/drm_sarea.h +++ b/include/drm/drm_sarea.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #ifndef _DRM_SAREA_H_ | 32 | #ifndef _DRM_SAREA_H_ |
33 | #define _DRM_SAREA_H_ | 33 | #define _DRM_SAREA_H_ |
34 | 34 | ||
35 | #include "drm.h" | 35 | #include <drm/drm.h> |
36 | 36 | ||
37 | /* SAREA area needs to be at least a page */ | 37 | /* SAREA area needs to be at least a page */ |
38 | #if defined(__alpha__) | 38 | #if defined(__alpha__) |
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h index c20b00181530..1f2acdfbfd6d 100644 --- a/include/drm/exynos_drm.h +++ b/include/drm/exynos_drm.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #ifndef _EXYNOS_DRM_H_ | 29 | #ifndef _EXYNOS_DRM_H_ |
30 | #define _EXYNOS_DRM_H_ | 30 | #define _EXYNOS_DRM_H_ |
31 | 31 | ||
32 | #include "drm.h" | 32 | #include <drm/drm.h> |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * User-desired buffer creation information structure. | 35 | * User-desired buffer creation information structure. |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index e737607e055e..a940d4e18917 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #ifndef _I915_DRM_H_ | 27 | #ifndef _I915_DRM_H_ |
28 | #define _I915_DRM_H_ | 28 | #define _I915_DRM_H_ |
29 | 29 | ||
30 | #include "drm.h" | 30 | #include <drm/drm.h> |
31 | 31 | ||
32 | /* Please note that modifications to all structs defined here are | 32 | /* Please note that modifications to all structs defined here are |
33 | * subject to backwards-compatibility constraints. | 33 | * subject to backwards-compatibility constraints. |
diff --git a/include/drm/mga_drm.h b/include/drm/mga_drm.h index fca817009e13..2375bfd6e5e9 100644 --- a/include/drm/mga_drm.h +++ b/include/drm/mga_drm.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef __MGA_DRM_H__ | 35 | #ifndef __MGA_DRM_H__ |
36 | #define __MGA_DRM_H__ | 36 | #define __MGA_DRM_H__ |
37 | 37 | ||
38 | #include "drm.h" | 38 | #include <drm/drm.h> |
39 | 39 | ||
40 | /* WARNING: If you change any of these defines, make sure to change the | 40 | /* WARNING: If you change any of these defines, make sure to change the |
41 | * defines in the Xserver file (mga_sarea.h) | 41 | * defines in the Xserver file (mga_sarea.h) |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index dc3a8cd7db8a..4766c0f6a838 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #ifndef __RADEON_DRM_H__ | 33 | #ifndef __RADEON_DRM_H__ |
34 | #define __RADEON_DRM_H__ | 34 | #define __RADEON_DRM_H__ |
35 | 35 | ||
36 | #include "drm.h" | 36 | #include <drm/drm.h> |
37 | 37 | ||
38 | /* WARNING: If you change any of these defines, make sure to change the | 38 | /* WARNING: If you change any of these defines, make sure to change the |
39 | * defines in the X server file (radeon_sarea.h) | 39 | * defines in the X server file (radeon_sarea.h) |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index e15f2a89a270..e8028ade567f 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #ifndef _TTM_BO_API_H_ | 31 | #ifndef _TTM_BO_API_H_ |
32 | #define _TTM_BO_API_H_ | 32 | #define _TTM_BO_API_H_ |
33 | 33 | ||
34 | #include "drm_hashtab.h" | 34 | #include <drm/drm_hashtab.h> |
35 | #include <linux/kref.h> | 35 | #include <linux/kref.h> |
36 | #include <linux/list.h> | 36 | #include <linux/list.h> |
37 | #include <linux/wait.h> | 37 | #include <linux/wait.h> |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 084e8989a6e1..d803b92b0324 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -30,14 +30,14 @@ | |||
30 | #ifndef _TTM_BO_DRIVER_H_ | 30 | #ifndef _TTM_BO_DRIVER_H_ |
31 | #define _TTM_BO_DRIVER_H_ | 31 | #define _TTM_BO_DRIVER_H_ |
32 | 32 | ||
33 | #include "ttm/ttm_bo_api.h" | 33 | #include <ttm/ttm_bo_api.h> |
34 | #include "ttm/ttm_memory.h" | 34 | #include <ttm/ttm_memory.h> |
35 | #include "ttm/ttm_module.h" | 35 | #include <ttm/ttm_module.h> |
36 | #include "drm_mm.h" | 36 | #include <drm/drm_mm.h> |
37 | #include "drm_global.h" | 37 | #include <drm/drm_global.h> |
38 | #include "linux/workqueue.h" | 38 | #include <linux/workqueue.h> |
39 | #include "linux/fs.h" | 39 | #include <linux/fs.h> |
40 | #include "linux/spinlock.h" | 40 | #include <linux/spinlock.h> |
41 | 41 | ||
42 | struct ttm_backend_func { | 42 | struct ttm_backend_func { |
43 | /** | 43 | /** |
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h index 26cc7f9ffa41..1926cae373ba 100644 --- a/include/drm/ttm/ttm_execbuf_util.h +++ b/include/drm/ttm/ttm_execbuf_util.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #ifndef _TTM_EXECBUF_UTIL_H_ | 31 | #ifndef _TTM_EXECBUF_UTIL_H_ |
32 | #define _TTM_EXECBUF_UTIL_H_ | 32 | #define _TTM_EXECBUF_UTIL_H_ |
33 | 33 | ||
34 | #include "ttm/ttm_bo_api.h" | 34 | #include <ttm/ttm_bo_api.h> |
35 | #include <linux/list.h> | 35 | #include <linux/list.h> |
36 | 36 | ||
37 | /** | 37 | /** |
diff --git a/include/drm/ttm/ttm_lock.h b/include/drm/ttm/ttm_lock.h index 2e7f0c941b5d..2902beb5f689 100644 --- a/include/drm/ttm/ttm_lock.h +++ b/include/drm/ttm/ttm_lock.h | |||
@@ -49,7 +49,7 @@ | |||
49 | #ifndef _TTM_LOCK_H_ | 49 | #ifndef _TTM_LOCK_H_ |
50 | #define _TTM_LOCK_H_ | 50 | #define _TTM_LOCK_H_ |
51 | 51 | ||
52 | #include "ttm/ttm_object.h" | 52 | #include <ttm/ttm_object.h> |
53 | #include <linux/wait.h> | 53 | #include <linux/wait.h> |
54 | #include <linux/atomic.h> | 54 | #include <linux/atomic.h> |
55 | 55 | ||
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h index e46054e5255b..b01c563b2751 100644 --- a/include/drm/ttm/ttm_object.h +++ b/include/drm/ttm/ttm_object.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #define _TTM_OBJECT_H_ | 38 | #define _TTM_OBJECT_H_ |
39 | 39 | ||
40 | #include <linux/list.h> | 40 | #include <linux/list.h> |
41 | #include "drm_hashtab.h" | 41 | #include <drm/drm_hashtab.h> |
42 | #include <linux/kref.h> | 42 | #include <linux/kref.h> |
43 | #include <ttm/ttm_memory.h> | 43 | #include <ttm/ttm_memory.h> |
44 | 44 | ||
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 5fe27400d176..706b962c6467 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #ifndef TTM_PAGE_ALLOC | 26 | #ifndef TTM_PAGE_ALLOC |
27 | #define TTM_PAGE_ALLOC | 27 | #define TTM_PAGE_ALLOC |
28 | 28 | ||
29 | #include "ttm_bo_driver.h" | 29 | #include <drm/ttm/ttm_bo_driver.h> |
30 | #include "ttm_memory.h" | 30 | #include <drm/ttm/ttm_memory.h> |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Initialize pool allocator. | 33 | * Initialize pool allocator. |
diff --git a/include/drm/via_drm.h b/include/drm/via_drm.h index 79b3b6e0f6b3..8b0533ccbd5a 100644 --- a/include/drm/via_drm.h +++ b/include/drm/via_drm.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef _VIA_DRM_H_ | 24 | #ifndef _VIA_DRM_H_ |
25 | #define _VIA_DRM_H_ | 25 | #define _VIA_DRM_H_ |
26 | 26 | ||
27 | #include "drm.h" | 27 | #include <drm/drm.h> |
28 | 28 | ||
29 | /* WARNING: These defines must be the same as what the Xserver uses. | 29 | /* WARNING: These defines must be the same as what the Xserver uses. |
30 | * if you change them, you must change the defines in the Xserver. | 30 | * if you change them, you must change the defines in the Xserver. |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index fa217607c582..e149e8be9065 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -20,8 +20,6 @@ header-y += netfilter_ipv6/ | |||
20 | header-y += usb/ | 20 | header-y += usb/ |
21 | header-y += wimax/ | 21 | header-y += wimax/ |
22 | 22 | ||
23 | objhdr-y += version.h | ||
24 | |||
25 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | 23 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
26 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ | 24 | $(srctree)/include/asm-$(SRCARCH)/a.out.h \ |
27 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) | 25 | $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),) |
@@ -84,7 +82,6 @@ header-y += capability.h | |||
84 | header-y += capi.h | 82 | header-y += capi.h |
85 | header-y += cciss_defs.h | 83 | header-y += cciss_defs.h |
86 | header-y += cciss_ioctl.h | 84 | header-y += cciss_ioctl.h |
87 | header-y += cdk.h | ||
88 | header-y += cdrom.h | 85 | header-y += cdrom.h |
89 | header-y += cgroupstats.h | 86 | header-y += cgroupstats.h |
90 | header-y += chio.h | 87 | header-y += chio.h |
@@ -93,7 +90,6 @@ header-y += cn_proc.h | |||
93 | header-y += coda.h | 90 | header-y += coda.h |
94 | header-y += coda_psdev.h | 91 | header-y += coda_psdev.h |
95 | header-y += coff.h | 92 | header-y += coff.h |
96 | header-y += comstats.h | ||
97 | header-y += connector.h | 93 | header-y += connector.h |
98 | header-y += const.h | 94 | header-y += const.h |
99 | header-y += cramfs_fs.h | 95 | header-y += cramfs_fs.h |
@@ -140,7 +136,6 @@ header-y += fuse.h | |||
140 | header-y += futex.h | 136 | header-y += futex.h |
141 | header-y += gameport.h | 137 | header-y += gameport.h |
142 | header-y += gen_stats.h | 138 | header-y += gen_stats.h |
143 | header-y += generic_serial.h | ||
144 | header-y += genetlink.h | 139 | header-y += genetlink.h |
145 | header-y += gfs2_ondisk.h | 140 | header-y += gfs2_ondisk.h |
146 | header-y += gigaset_dev.h | 141 | header-y += gigaset_dev.h |
@@ -195,6 +190,7 @@ header-y += in_route.h | |||
195 | header-y += sock_diag.h | 190 | header-y += sock_diag.h |
196 | header-y += inet_diag.h | 191 | header-y += inet_diag.h |
197 | header-y += unix_diag.h | 192 | header-y += unix_diag.h |
193 | header-y += packet_diag.h | ||
198 | header-y += inotify.h | 194 | header-y += inotify.h |
199 | header-y += input.h | 195 | header-y += input.h |
200 | header-y += ioctl.h | 196 | header-y += ioctl.h |
@@ -362,6 +358,7 @@ header-y += sysctl.h | |||
362 | header-y += sysinfo.h | 358 | header-y += sysinfo.h |
363 | header-y += taskstats.h | 359 | header-y += taskstats.h |
364 | header-y += tcp.h | 360 | header-y += tcp.h |
361 | header-y += tcp_metrics.h | ||
365 | header-y += telephony.h | 362 | header-y += telephony.h |
366 | header-y += termios.h | 363 | header-y += termios.h |
367 | header-y += time.h | 364 | header-y += time.h |
@@ -372,6 +369,7 @@ header-y += tipc.h | |||
372 | header-y += tipc_config.h | 369 | header-y += tipc_config.h |
373 | header-y += toshiba.h | 370 | header-y += toshiba.h |
374 | header-y += tty.h | 371 | header-y += tty.h |
372 | header-y += tty_flags.h | ||
375 | header-y += types.h | 373 | header-y += types.h |
376 | header-y += udf_fs_i.h | 374 | header-y += udf_fs_i.h |
377 | header-y += udp.h | 375 | header-y += udp.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4f2a76224509..90be98981102 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -138,9 +138,9 @@ void acpi_penalize_isa_irq(int irq, int active); | |||
138 | void acpi_pci_irq_disable (struct pci_dev *dev); | 138 | void acpi_pci_irq_disable (struct pci_dev *dev); |
139 | 139 | ||
140 | struct acpi_pci_driver { | 140 | struct acpi_pci_driver { |
141 | struct acpi_pci_driver *next; | 141 | struct list_head node; |
142 | int (*add)(acpi_handle handle); | 142 | int (*add)(struct acpi_pci_root *root); |
143 | void (*remove)(acpi_handle handle); | 143 | void (*remove)(struct acpi_pci_root *root); |
144 | }; | 144 | }; |
145 | 145 | ||
146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | 146 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); |
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index fe1d7b283cb6..854b7294f6c6 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
@@ -244,6 +244,7 @@ struct dma_chan; | |||
244 | * indicates no delay and the device will be suspended immediately. | 244 | * indicates no delay and the device will be suspended immediately. |
245 | * @rt: indicates the controller should run the message pump with realtime | 245 | * @rt: indicates the controller should run the message pump with realtime |
246 | * priority to minimise the transfer latency on the bus. | 246 | * priority to minimise the transfer latency on the bus. |
247 | * @chipselects: list of <num_chipselects> chip select gpios | ||
247 | */ | 248 | */ |
248 | struct pl022_ssp_controller { | 249 | struct pl022_ssp_controller { |
249 | u16 bus_id; | 250 | u16 bus_id; |
@@ -254,6 +255,7 @@ struct pl022_ssp_controller { | |||
254 | void *dma_tx_param; | 255 | void *dma_tx_param; |
255 | int autosuspend_delay; | 256 | int autosuspend_delay; |
256 | bool rt; | 257 | bool rt; |
258 | int *chipselects; | ||
257 | }; | 259 | }; |
258 | 260 | ||
259 | /** | 261 | /** |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index d117b29d1062..f612c783170f 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -205,7 +205,6 @@ struct amba_pl011_data { | |||
205 | void *dma_tx_param; | 205 | void *dma_tx_param; |
206 | void (*init) (void); | 206 | void (*init) (void); |
207 | void (*exit) (void); | 207 | void (*exit) (void); |
208 | void (*reset) (void); | ||
209 | }; | 208 | }; |
210 | #endif | 209 | #endif |
211 | 210 | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 5713d3ac381a..408da9502177 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -77,6 +77,9 @@ enum { | |||
77 | ATA_ID_EIDE_PIO_IORDY = 68, | 77 | ATA_ID_EIDE_PIO_IORDY = 68, |
78 | ATA_ID_ADDITIONAL_SUPP = 69, | 78 | ATA_ID_ADDITIONAL_SUPP = 69, |
79 | ATA_ID_QUEUE_DEPTH = 75, | 79 | ATA_ID_QUEUE_DEPTH = 75, |
80 | ATA_ID_SATA_CAPABILITY = 76, | ||
81 | ATA_ID_SATA_CAPABILITY_2 = 77, | ||
82 | ATA_ID_FEATURE_SUPP = 78, | ||
80 | ATA_ID_MAJOR_VER = 80, | 83 | ATA_ID_MAJOR_VER = 80, |
81 | ATA_ID_COMMAND_SET_1 = 82, | 84 | ATA_ID_COMMAND_SET_1 = 82, |
82 | ATA_ID_COMMAND_SET_2 = 83, | 85 | ATA_ID_COMMAND_SET_2 = 83, |
@@ -292,6 +295,13 @@ enum { | |||
292 | 295 | ||
293 | /* READ_LOG_EXT pages */ | 296 | /* READ_LOG_EXT pages */ |
294 | ATA_LOG_SATA_NCQ = 0x10, | 297 | ATA_LOG_SATA_NCQ = 0x10, |
298 | ATA_LOG_SATA_ID_DEV_DATA = 0x30, | ||
299 | ATA_LOG_SATA_SETTINGS = 0x08, | ||
300 | ATA_LOG_DEVSLP_MDAT = 0x30, | ||
301 | ATA_LOG_DEVSLP_MDAT_MASK = 0x1F, | ||
302 | ATA_LOG_DEVSLP_DETO = 0x31, | ||
303 | ATA_LOG_DEVSLP_VALID = 0x37, | ||
304 | ATA_LOG_DEVSLP_VALID_MASK = 0x80, | ||
295 | 305 | ||
296 | /* READ/WRITE LONG (obsolete) */ | 306 | /* READ/WRITE LONG (obsolete) */ |
297 | ATA_CMD_READ_LONG = 0x22, | 307 | ATA_CMD_READ_LONG = 0x22, |
@@ -345,6 +355,7 @@ enum { | |||
345 | SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */ | 355 | SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */ |
346 | SATA_AN = 0x05, /* Asynchronous Notification */ | 356 | SATA_AN = 0x05, /* Asynchronous Notification */ |
347 | SATA_SSP = 0x06, /* Software Settings Preservation */ | 357 | SATA_SSP = 0x06, /* Software Settings Preservation */ |
358 | SATA_DEVSLP = 0x09, /* Device Sleep */ | ||
348 | 359 | ||
349 | /* feature values for SET_MAX */ | 360 | /* feature values for SET_MAX */ |
350 | ATA_SET_MAX_ADDR = 0x00, | 361 | ATA_SET_MAX_ADDR = 0x00, |
@@ -558,15 +569,17 @@ static inline int ata_is_data(u8 prot) | |||
558 | #define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) | 569 | #define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) |
559 | #define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) | 570 | #define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) |
560 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) | 571 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) |
561 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) | 572 | #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) |
562 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) | 573 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) |
563 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) | 574 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) |
564 | #define ata_id_has_atapi_AN(id) \ | 575 | #define ata_id_has_atapi_AN(id) \ |
565 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | 576 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ |
566 | ((id)[78] & (1 << 5)) ) | 577 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ |
578 | ((id)[ATA_ID_FEATURE_SUPP] & (1 << 5))) | ||
567 | #define ata_id_has_fpdma_aa(id) \ | 579 | #define ata_id_has_fpdma_aa(id) \ |
568 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | 580 | ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ |
569 | ((id)[78] & (1 << 2)) ) | 581 | ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ |
582 | ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2))) | ||
570 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) | 583 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) |
571 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) | 584 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) |
572 | #define ata_id_u32(id,n) \ | 585 | #define ata_id_u32(id,n) \ |
@@ -578,11 +591,12 @@ static inline int ata_is_data(u8 prot) | |||
578 | ((u64) (id)[(n) + 0]) ) | 591 | ((u64) (id)[(n) + 0]) ) |
579 | 592 | ||
580 | #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) | 593 | #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) |
581 | #define ata_id_has_da(id) ((id)[77] & (1 << 4)) | 594 | #define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) |
595 | #define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)) | ||
582 | 596 | ||
583 | static inline bool ata_id_has_hipm(const u16 *id) | 597 | static inline bool ata_id_has_hipm(const u16 *id) |
584 | { | 598 | { |
585 | u16 val = id[76]; | 599 | u16 val = id[ATA_ID_SATA_CAPABILITY]; |
586 | 600 | ||
587 | if (val == 0 || val == 0xffff) | 601 | if (val == 0 || val == 0xffff) |
588 | return false; | 602 | return false; |
@@ -592,7 +606,7 @@ static inline bool ata_id_has_hipm(const u16 *id) | |||
592 | 606 | ||
593 | static inline bool ata_id_has_dipm(const u16 *id) | 607 | static inline bool ata_id_has_dipm(const u16 *id) |
594 | { | 608 | { |
595 | u16 val = id[78]; | 609 | u16 val = id[ATA_ID_FEATURE_SUPP]; |
596 | 610 | ||
597 | if (val == 0 || val == 0xffff) | 611 | if (val == 0 || val == 0xffff) |
598 | return false; | 612 | return false; |
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h index 1d14b1dc1aee..89a931babecf 100644 --- a/include/linux/atmel_tc.h +++ b/include/linux/atmel_tc.h | |||
@@ -63,7 +63,7 @@ struct atmel_tc { | |||
63 | struct platform_device *pdev; | 63 | struct platform_device *pdev; |
64 | struct resource *iomem; | 64 | struct resource *iomem; |
65 | void __iomem *regs; | 65 | void __iomem *regs; |
66 | struct atmel_tcb_config *tcb_config; | 66 | const struct atmel_tcb_config *tcb_config; |
67 | int irq[3]; | 67 | int irq[3]; |
68 | struct clk *clk[3]; | 68 | struct clk *clk[3]; |
69 | struct list_head node; | 69 | struct list_head node; |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 36abf2aa7e68..e7c836d961ea 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -442,6 +442,8 @@ struct audit_krule { | |||
442 | struct audit_field { | 442 | struct audit_field { |
443 | u32 type; | 443 | u32 type; |
444 | u32 val; | 444 | u32 val; |
445 | kuid_t uid; | ||
446 | kgid_t gid; | ||
445 | u32 op; | 447 | u32 op; |
446 | char *lsm_str; | 448 | char *lsm_str; |
447 | void *lsm_rule; | 449 | void *lsm_rule; |
@@ -525,10 +527,11 @@ static inline void audit_ptrace(struct task_struct *t) | |||
525 | extern unsigned int audit_serial(void); | 527 | extern unsigned int audit_serial(void); |
526 | extern int auditsc_get_stamp(struct audit_context *ctx, | 528 | extern int auditsc_get_stamp(struct audit_context *ctx, |
527 | struct timespec *t, unsigned int *serial); | 529 | struct timespec *t, unsigned int *serial); |
528 | extern int audit_set_loginuid(uid_t loginuid); | 530 | extern int audit_set_loginuid(kuid_t loginuid); |
529 | #define audit_get_loginuid(t) ((t)->loginuid) | 531 | #define audit_get_loginuid(t) ((t)->loginuid) |
530 | #define audit_get_sessionid(t) ((t)->sessionid) | 532 | #define audit_get_sessionid(t) ((t)->sessionid) |
531 | extern void audit_log_task_context(struct audit_buffer *ab); | 533 | extern void audit_log_task_context(struct audit_buffer *ab); |
534 | extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk); | ||
532 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 535 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
533 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); | 536 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); |
534 | extern int __audit_bprm(struct linux_binprm *bprm); | 537 | extern int __audit_bprm(struct linux_binprm *bprm); |
@@ -637,9 +640,10 @@ extern int audit_signals; | |||
637 | #define audit_core_dumps(i) do { ; } while (0) | 640 | #define audit_core_dumps(i) do { ; } while (0) |
638 | #define audit_seccomp(i,s,c) do { ; } while (0) | 641 | #define audit_seccomp(i,s,c) do { ; } while (0) |
639 | #define auditsc_get_stamp(c,t,s) (0) | 642 | #define auditsc_get_stamp(c,t,s) (0) |
640 | #define audit_get_loginuid(t) (-1) | 643 | #define audit_get_loginuid(t) (INVALID_UID) |
641 | #define audit_get_sessionid(t) (-1) | 644 | #define audit_get_sessionid(t) (-1) |
642 | #define audit_log_task_context(b) do { ; } while (0) | 645 | #define audit_log_task_context(b) do { ; } while (0) |
646 | #define audit_log_task_info(b, t) do { ; } while (0) | ||
643 | #define audit_ipc_obj(i) ((void)0) | 647 | #define audit_ipc_obj(i) ((void)0) |
644 | #define audit_ipc_set_perm(q,u,g,m) ((void)0) | 648 | #define audit_ipc_set_perm(q,u,g,m) ((void)0) |
645 | #define audit_bprm(p) ({ 0; }) | 649 | #define audit_bprm(p) ({ 0; }) |
@@ -700,10 +704,10 @@ extern void audit_log_secctx(struct audit_buffer *ab, u32 secid); | |||
700 | extern int audit_update_lsm_rules(void); | 704 | extern int audit_update_lsm_rules(void); |
701 | 705 | ||
702 | /* Private API (for audit.c only) */ | 706 | /* Private API (for audit.c only) */ |
703 | extern int audit_filter_user(struct netlink_skb_parms *cb); | 707 | extern int audit_filter_user(void); |
704 | extern int audit_filter_type(int type); | 708 | extern int audit_filter_type(int type); |
705 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 709 | extern int audit_receive_filter(int type, int pid, int seq, |
706 | void *data, size_t datasz, uid_t loginuid, | 710 | void *data, size_t datasz, kuid_t loginuid, |
707 | u32 sessionid, u32 sid); | 711 | u32 sessionid, u32 sid); |
708 | extern int audit_enabled; | 712 | extern int audit_enabled; |
709 | #else | 713 | #else |
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index 22ea563ba3eb..18fff11fb3ea 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
@@ -3,7 +3,20 @@ | |||
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | unsigned bcd2bin(unsigned char val) __attribute_const__; | 6 | #define bcd2bin(x) \ |
7 | unsigned char bin2bcd(unsigned val) __attribute_const__; | 7 | (__builtin_constant_p((u8 )(x)) ? \ |
8 | const_bcd2bin(x) : \ | ||
9 | _bcd2bin(x)) | ||
10 | |||
11 | #define bin2bcd(x) \ | ||
12 | (__builtin_constant_p((u8 )(x)) ? \ | ||
13 | const_bin2bcd(x) : \ | ||
14 | _bin2bcd(x)) | ||
15 | |||
16 | #define const_bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10) | ||
17 | #define const_bin2bcd(x) ((((x) / 10) << 4) + (x) % 10) | ||
18 | |||
19 | unsigned _bcd2bin(unsigned char val) __attribute_const__; | ||
20 | unsigned char _bin2bcd(unsigned val) __attribute_const__; | ||
8 | 21 | ||
9 | #endif /* _BCD_H */ | 22 | #endif /* _BCD_H */ |
diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h new file mode 100644 index 000000000000..25680fe0903c --- /dev/null +++ b/include/linux/bcm2835_timer.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Simon Arlott | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __BCM2835_TIMER_H | ||
16 | #define __BCM2835_TIMER_H | ||
17 | |||
18 | #include <asm/mach/time.h> | ||
19 | |||
20 | extern struct sys_timer bcm2835_timer; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 1954a4e305a3..4180eb78d575 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/bcma/bcma_driver_gmac_cmn.h> | 10 | #include <linux/bcma/bcma_driver_gmac_cmn.h> |
11 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | 11 | #include <linux/ssb/ssb.h> /* SPROM sharing */ |
12 | 12 | ||
13 | #include "bcma_regs.h" | 13 | #include <linux/bcma/bcma_regs.h> |
14 | 14 | ||
15 | struct bcma_device; | 15 | struct bcma_device; |
16 | struct bcma_bus; | 16 | struct bcma_bus; |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index d323a4b4143c..6ba45d2b99db 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -100,6 +100,7 @@ | |||
100 | #define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ | 100 | #define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ |
101 | #define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */ | 101 | #define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */ |
102 | #define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */ | 102 | #define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */ |
103 | #define BCMA_CC_CHIPST_5357_NAND_BOOT BIT(4) /* NAND boot, valid for CC rev 38 and/or BCM5357 */ | ||
103 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ | 104 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ |
104 | #define BCMA_CC_JCMD_START 0x80000000 | 105 | #define BCMA_CC_JCMD_START 0x80000000 |
105 | #define BCMA_CC_JCMD_BUSY 0x80000000 | 106 | #define BCMA_CC_JCMD_BUSY 0x80000000 |
@@ -266,6 +267,29 @@ | |||
266 | #define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004 | 267 | #define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004 |
267 | #define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1 | 268 | #define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1 |
268 | #define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001 | 269 | #define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001 |
270 | /* Block 0x140 - 0x190 registers are chipset specific */ | ||
271 | #define BCMA_CC_4706_FLASHSCFG 0x18C /* Flash struct configuration */ | ||
272 | #define BCMA_CC_4706_FLASHSCFG_MASK 0x000000ff | ||
273 | #define BCMA_CC_4706_FLASHSCFG_SF1 0x00000001 /* 2nd serial flash present */ | ||
274 | #define BCMA_CC_4706_FLASHSCFG_PF1 0x00000002 /* 2nd parallel flash present */ | ||
275 | #define BCMA_CC_4706_FLASHSCFG_SF1_TYPE 0x00000004 /* 2nd serial flash type : 0 : ST, 1 : Atmel */ | ||
276 | #define BCMA_CC_4706_FLASHSCFG_NF1 0x00000008 /* 2nd NAND flash present */ | ||
277 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_MASK 0x000000f0 | ||
278 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_4MB 0x00000010 /* 4MB */ | ||
279 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_8MB 0x00000020 /* 8MB */ | ||
280 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_16MB 0x00000030 /* 16MB */ | ||
281 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_32MB 0x00000040 /* 32MB */ | ||
282 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_64MB 0x00000050 /* 64MB */ | ||
283 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_128MB 0x00000060 /* 128MB */ | ||
284 | #define BCMA_CC_4706_FLASHSCFG_1ST_MADDR_SEG_256MB 0x00000070 /* 256MB */ | ||
285 | /* NAND flash registers for BCM4706 (corerev = 31) */ | ||
286 | #define BCMA_CC_NFLASH_CTL 0x01A0 | ||
287 | #define BCMA_CC_NFLASH_CTL_ERR 0x08000000 | ||
288 | #define BCMA_CC_NFLASH_CONF 0x01A4 | ||
289 | #define BCMA_CC_NFLASH_COL_ADDR 0x01A8 | ||
290 | #define BCMA_CC_NFLASH_ROW_ADDR 0x01AC | ||
291 | #define BCMA_CC_NFLASH_DATA 0x01B0 | ||
292 | #define BCMA_CC_NFLASH_WAITCNT0 0x01B4 | ||
269 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ | 293 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ |
270 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 294 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
271 | #define BCMA_CC_UART0_DATA 0x0300 | 295 | #define BCMA_CC_UART0_DATA 0x0300 |
@@ -325,6 +349,60 @@ | |||
325 | #define BCMA_CC_PLLCTL_ADDR 0x0660 | 349 | #define BCMA_CC_PLLCTL_ADDR 0x0660 |
326 | #define BCMA_CC_PLLCTL_DATA 0x0664 | 350 | #define BCMA_CC_PLLCTL_DATA 0x0664 |
327 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ | 351 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ |
352 | /* NAND flash MLC controller registers (corerev >= 38) */ | ||
353 | #define BCMA_CC_NAND_REVISION 0x0C00 | ||
354 | #define BCMA_CC_NAND_CMD_START 0x0C04 | ||
355 | #define BCMA_CC_NAND_CMD_ADDR_X 0x0C08 | ||
356 | #define BCMA_CC_NAND_CMD_ADDR 0x0C0C | ||
357 | #define BCMA_CC_NAND_CMD_END_ADDR 0x0C10 | ||
358 | #define BCMA_CC_NAND_CS_NAND_SELECT 0x0C14 | ||
359 | #define BCMA_CC_NAND_CS_NAND_XOR 0x0C18 | ||
360 | #define BCMA_CC_NAND_SPARE_RD0 0x0C20 | ||
361 | #define BCMA_CC_NAND_SPARE_RD4 0x0C24 | ||
362 | #define BCMA_CC_NAND_SPARE_RD8 0x0C28 | ||
363 | #define BCMA_CC_NAND_SPARE_RD12 0x0C2C | ||
364 | #define BCMA_CC_NAND_SPARE_WR0 0x0C30 | ||
365 | #define BCMA_CC_NAND_SPARE_WR4 0x0C34 | ||
366 | #define BCMA_CC_NAND_SPARE_WR8 0x0C38 | ||
367 | #define BCMA_CC_NAND_SPARE_WR12 0x0C3C | ||
368 | #define BCMA_CC_NAND_ACC_CONTROL 0x0C40 | ||
369 | #define BCMA_CC_NAND_CONFIG 0x0C48 | ||
370 | #define BCMA_CC_NAND_TIMING_1 0x0C50 | ||
371 | #define BCMA_CC_NAND_TIMING_2 0x0C54 | ||
372 | #define BCMA_CC_NAND_SEMAPHORE 0x0C58 | ||
373 | #define BCMA_CC_NAND_DEVID 0x0C60 | ||
374 | #define BCMA_CC_NAND_DEVID_X 0x0C64 | ||
375 | #define BCMA_CC_NAND_BLOCK_LOCK_STATUS 0x0C68 | ||
376 | #define BCMA_CC_NAND_INTFC_STATUS 0x0C6C | ||
377 | #define BCMA_CC_NAND_ECC_CORR_ADDR_X 0x0C70 | ||
378 | #define BCMA_CC_NAND_ECC_CORR_ADDR 0x0C74 | ||
379 | #define BCMA_CC_NAND_ECC_UNC_ADDR_X 0x0C78 | ||
380 | #define BCMA_CC_NAND_ECC_UNC_ADDR 0x0C7C | ||
381 | #define BCMA_CC_NAND_READ_ERROR_COUNT 0x0C80 | ||
382 | #define BCMA_CC_NAND_CORR_STAT_THRESHOLD 0x0C84 | ||
383 | #define BCMA_CC_NAND_READ_ADDR_X 0x0C90 | ||
384 | #define BCMA_CC_NAND_READ_ADDR 0x0C94 | ||
385 | #define BCMA_CC_NAND_PAGE_PROGRAM_ADDR_X 0x0C98 | ||
386 | #define BCMA_CC_NAND_PAGE_PROGRAM_ADDR 0x0C9C | ||
387 | #define BCMA_CC_NAND_COPY_BACK_ADDR_X 0x0CA0 | ||
388 | #define BCMA_CC_NAND_COPY_BACK_ADDR 0x0CA4 | ||
389 | #define BCMA_CC_NAND_BLOCK_ERASE_ADDR_X 0x0CA8 | ||
390 | #define BCMA_CC_NAND_BLOCK_ERASE_ADDR 0x0CAC | ||
391 | #define BCMA_CC_NAND_INV_READ_ADDR_X 0x0CB0 | ||
392 | #define BCMA_CC_NAND_INV_READ_ADDR 0x0CB4 | ||
393 | #define BCMA_CC_NAND_BLK_WR_PROTECT 0x0CC0 | ||
394 | #define BCMA_CC_NAND_ACC_CONTROL_CS1 0x0CD0 | ||
395 | #define BCMA_CC_NAND_CONFIG_CS1 0x0CD4 | ||
396 | #define BCMA_CC_NAND_TIMING_1_CS1 0x0CD8 | ||
397 | #define BCMA_CC_NAND_TIMING_2_CS1 0x0CDC | ||
398 | #define BCMA_CC_NAND_SPARE_RD16 0x0D30 | ||
399 | #define BCMA_CC_NAND_SPARE_RD20 0x0D34 | ||
400 | #define BCMA_CC_NAND_SPARE_RD24 0x0D38 | ||
401 | #define BCMA_CC_NAND_SPARE_RD28 0x0D3C | ||
402 | #define BCMA_CC_NAND_CACHE_ADDR 0x0D40 | ||
403 | #define BCMA_CC_NAND_CACHE_DATA 0x0D44 | ||
404 | #define BCMA_CC_NAND_CTRL_CONFIG 0x0D48 | ||
405 | #define BCMA_CC_NAND_CTRL_STATUS 0x0D4C | ||
328 | 406 | ||
329 | /* Divider allocation in 4716/47162/5356 */ | 407 | /* Divider allocation in 4716/47162/5356 */ |
330 | #define BCMA_CC_PMU5_MAINPLL_CPU 1 | 408 | #define BCMA_CC_PMU5_MAINPLL_CPU 1 |
@@ -415,6 +493,13 @@ | |||
415 | /* 4313 Chip specific ChipControl register bits */ | 493 | /* 4313 Chip specific ChipControl register bits */ |
416 | #define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */ | 494 | #define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */ |
417 | 495 | ||
496 | /* BCM5357 ChipControl register bits */ | ||
497 | #define BCMA_CHIPCTL_5357_EXTPA BIT(14) | ||
498 | #define BCMA_CHIPCTL_5357_ANT_MUX_2O3 BIT(15) | ||
499 | #define BCMA_CHIPCTL_5357_NFLASH BIT(16) | ||
500 | #define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18) | ||
501 | #define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19) | ||
502 | |||
418 | /* Data for the PMU, if available. | 503 | /* Data for the PMU, if available. |
419 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 504 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
420 | */ | 505 | */ |
@@ -430,6 +515,26 @@ struct bcma_pflash { | |||
430 | u32 window_size; | 515 | u32 window_size; |
431 | }; | 516 | }; |
432 | 517 | ||
518 | #ifdef CONFIG_BCMA_SFLASH | ||
519 | struct bcma_sflash { | ||
520 | bool present; | ||
521 | u32 window; | ||
522 | u32 blocksize; | ||
523 | u16 numblocks; | ||
524 | u32 size; | ||
525 | }; | ||
526 | #endif | ||
527 | |||
528 | #ifdef CONFIG_BCMA_NFLASH | ||
529 | struct mtd_info; | ||
530 | |||
531 | struct bcma_nflash { | ||
532 | bool present; | ||
533 | |||
534 | struct mtd_info *mtd; | ||
535 | }; | ||
536 | #endif | ||
537 | |||
433 | struct bcma_serial_port { | 538 | struct bcma_serial_port { |
434 | void *regs; | 539 | void *regs; |
435 | unsigned long clockspeed; | 540 | unsigned long clockspeed; |
@@ -450,6 +555,12 @@ struct bcma_drv_cc { | |||
450 | struct bcma_chipcommon_pmu pmu; | 555 | struct bcma_chipcommon_pmu pmu; |
451 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 556 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
452 | struct bcma_pflash pflash; | 557 | struct bcma_pflash pflash; |
558 | #ifdef CONFIG_BCMA_SFLASH | ||
559 | struct bcma_sflash sflash; | ||
560 | #endif | ||
561 | #ifdef CONFIG_BCMA_NFLASH | ||
562 | struct bcma_nflash nflash; | ||
563 | #endif | ||
453 | 564 | ||
454 | int nr_serial_ports; | 565 | int nr_serial_ports; |
455 | struct bcma_serial_port serial_ports[4]; | 566 | struct bcma_serial_port serial_ports[4]; |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 5a71d5719640..6c9cb93ae3de 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -11,11 +11,13 @@ | |||
11 | #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | 11 | #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ |
12 | #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | 12 | #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ |
13 | #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ | 13 | #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ |
14 | #define BCMA_CLKCTLST_EXTRESREQ_SHIFT 8 | ||
14 | #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ | 15 | #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ |
15 | #define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */ | 16 | #define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */ |
16 | #define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */ | 17 | #define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */ |
17 | #define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */ | 18 | #define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */ |
18 | #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ | 19 | #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ |
20 | #define BCMA_CLKCTLST_EXTRESST_SHIFT 24 | ||
19 | /* Is there any BCM4328 on BCMA bus? */ | 21 | /* Is there any BCM4328 on BCMA bus? */ |
20 | #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ | 22 | #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ |
21 | #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ | 23 | #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ |
@@ -83,4 +85,6 @@ | |||
83 | * (2 ZettaBytes), high 32 bits | 85 | * (2 ZettaBytes), high 32 bits |
84 | */ | 86 | */ |
85 | 87 | ||
88 | #define BCMA_SFLASH 0x1c000000 | ||
89 | |||
86 | #endif /* LINUX_BCMA_REGS_H_ */ | 90 | #endif /* LINUX_BCMA_REGS_H_ */ |
diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h deleted file mode 100644 index 1dc3ab0523fd..000000000000 --- a/include/linux/cd1400.h +++ /dev/null | |||
@@ -1,292 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * cd1400.h -- cd1400 UART hardware info. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | /*****************************************************************************/ | ||
25 | #ifndef _CD1400_H | ||
26 | #define _CD1400_H | ||
27 | /*****************************************************************************/ | ||
28 | |||
29 | /* | ||
30 | * Define the number of async ports per cd1400 uart chip. | ||
31 | */ | ||
32 | #define CD1400_PORTS 4 | ||
33 | |||
34 | /* | ||
35 | * Define the cd1400 uarts internal FIFO sizes. | ||
36 | */ | ||
37 | #define CD1400_TXFIFOSIZE 12 | ||
38 | #define CD1400_RXFIFOSIZE 12 | ||
39 | |||
40 | /* | ||
41 | * Local RX FIFO thresh hold level. Also define the RTS thresh hold | ||
42 | * based on the RX thresh hold. | ||
43 | */ | ||
44 | #define FIFO_RXTHRESHOLD 6 | ||
45 | #define FIFO_RTSTHRESHOLD 7 | ||
46 | |||
47 | /*****************************************************************************/ | ||
48 | |||
49 | /* | ||
50 | * Define the cd1400 register addresses. These are all the valid | ||
51 | * registers with the cd1400. Some are global, some virtual, some | ||
52 | * per port. | ||
53 | */ | ||
54 | #define GFRCR 0x40 | ||
55 | #define CAR 0x68 | ||
56 | #define GCR 0x4b | ||
57 | #define SVRR 0x67 | ||
58 | #define RICR 0x44 | ||
59 | #define TICR 0x45 | ||
60 | #define MICR 0x46 | ||
61 | #define RIR 0x6b | ||
62 | #define TIR 0x6a | ||
63 | #define MIR 0x69 | ||
64 | #define PPR 0x7e | ||
65 | |||
66 | #define RIVR 0x43 | ||
67 | #define TIVR 0x42 | ||
68 | #define MIVR 0x41 | ||
69 | #define TDR 0x63 | ||
70 | #define RDSR 0x62 | ||
71 | #define MISR 0x4c | ||
72 | #define EOSRR 0x60 | ||
73 | |||
74 | #define LIVR 0x18 | ||
75 | #define CCR 0x05 | ||
76 | #define SRER 0x06 | ||
77 | #define COR1 0x08 | ||
78 | #define COR2 0x09 | ||
79 | #define COR3 0x0a | ||
80 | #define COR4 0x1e | ||
81 | #define COR5 0x1f | ||
82 | #define CCSR 0x0b | ||
83 | #define RDCR 0x0e | ||
84 | #define SCHR1 0x1a | ||
85 | #define SCHR2 0x1b | ||
86 | #define SCHR3 0x1c | ||
87 | #define SCHR4 0x1d | ||
88 | #define SCRL 0x22 | ||
89 | #define SCRH 0x23 | ||
90 | #define LNC 0x24 | ||
91 | #define MCOR1 0x15 | ||
92 | #define MCOR2 0x16 | ||
93 | #define RTPR 0x21 | ||
94 | #define MSVR1 0x6c | ||
95 | #define MSVR2 0x6d | ||
96 | #define PSVR 0x6f | ||
97 | #define RBPR 0x78 | ||
98 | #define RCOR 0x7c | ||
99 | #define TBPR 0x72 | ||
100 | #define TCOR 0x76 | ||
101 | |||
102 | /*****************************************************************************/ | ||
103 | |||
104 | /* | ||
105 | * Define the set of baud rate clock divisors. | ||
106 | */ | ||
107 | #define CD1400_CLK0 8 | ||
108 | #define CD1400_CLK1 32 | ||
109 | #define CD1400_CLK2 128 | ||
110 | #define CD1400_CLK3 512 | ||
111 | #define CD1400_CLK4 2048 | ||
112 | |||
113 | #define CD1400_NUMCLKS 5 | ||
114 | |||
115 | /*****************************************************************************/ | ||
116 | |||
117 | /* | ||
118 | * Define the clock pre-scalar value to be a 5 ms clock. This should be | ||
119 | * OK for now. It would probably be better to make it 10 ms, but we | ||
120 | * can't fit that divisor into 8 bits! | ||
121 | */ | ||
122 | #define PPR_SCALAR 244 | ||
123 | |||
124 | /*****************************************************************************/ | ||
125 | |||
126 | /* | ||
127 | * Define values used to set character size options. | ||
128 | */ | ||
129 | #define COR1_CHL5 0x00 | ||
130 | #define COR1_CHL6 0x01 | ||
131 | #define COR1_CHL7 0x02 | ||
132 | #define COR1_CHL8 0x03 | ||
133 | |||
134 | /* | ||
135 | * Define values used to set the number of stop bits. | ||
136 | */ | ||
137 | #define COR1_STOP1 0x00 | ||
138 | #define COR1_STOP15 0x04 | ||
139 | #define COR1_STOP2 0x08 | ||
140 | |||
141 | /* | ||
142 | * Define values used to set the parity scheme in use. | ||
143 | */ | ||
144 | #define COR1_PARNONE 0x00 | ||
145 | #define COR1_PARFORCE 0x20 | ||
146 | #define COR1_PARENB 0x40 | ||
147 | #define COR1_PARIGNORE 0x10 | ||
148 | |||
149 | #define COR1_PARODD 0x80 | ||
150 | #define COR1_PAREVEN 0x00 | ||
151 | |||
152 | #define COR2_IXM 0x80 | ||
153 | #define COR2_TXIBE 0x40 | ||
154 | #define COR2_ETC 0x20 | ||
155 | #define COR2_LLM 0x10 | ||
156 | #define COR2_RLM 0x08 | ||
157 | #define COR2_RTSAO 0x04 | ||
158 | #define COR2_CTSAE 0x02 | ||
159 | |||
160 | #define COR3_SCDRNG 0x80 | ||
161 | #define COR3_SCD34 0x40 | ||
162 | #define COR3_FCT 0x20 | ||
163 | #define COR3_SCD12 0x10 | ||
164 | |||
165 | /* | ||
166 | * Define values used by COR4. | ||
167 | */ | ||
168 | #define COR4_BRKINT 0x08 | ||
169 | #define COR4_IGNBRK 0x18 | ||
170 | |||
171 | /*****************************************************************************/ | ||
172 | |||
173 | /* | ||
174 | * Define the modem control register values. | ||
175 | * Note that the actual hardware is a little different to the conventional | ||
176 | * pin names on the cd1400. | ||
177 | */ | ||
178 | #define MSVR1_DTR 0x01 | ||
179 | #define MSVR1_DSR 0x10 | ||
180 | #define MSVR1_RI 0x20 | ||
181 | #define MSVR1_CTS 0x40 | ||
182 | #define MSVR1_DCD 0x80 | ||
183 | |||
184 | #define MSVR2_RTS 0x02 | ||
185 | #define MSVR2_DSR 0x10 | ||
186 | #define MSVR2_RI 0x20 | ||
187 | #define MSVR2_CTS 0x40 | ||
188 | #define MSVR2_DCD 0x80 | ||
189 | |||
190 | #define MCOR1_DCD 0x80 | ||
191 | #define MCOR1_CTS 0x40 | ||
192 | #define MCOR1_RI 0x20 | ||
193 | #define MCOR1_DSR 0x10 | ||
194 | |||
195 | #define MCOR2_DCD 0x80 | ||
196 | #define MCOR2_CTS 0x40 | ||
197 | #define MCOR2_RI 0x20 | ||
198 | #define MCOR2_DSR 0x10 | ||
199 | |||
200 | /*****************************************************************************/ | ||
201 | |||
202 | /* | ||
203 | * Define the bits used with the service (interrupt) enable register. | ||
204 | */ | ||
205 | #define SRER_NNDT 0x01 | ||
206 | #define SRER_TXEMPTY 0x02 | ||
207 | #define SRER_TXDATA 0x04 | ||
208 | #define SRER_RXDATA 0x10 | ||
209 | #define SRER_MODEM 0x80 | ||
210 | |||
211 | /*****************************************************************************/ | ||
212 | |||
213 | /* | ||
214 | * Define operational commands for the command register. | ||
215 | */ | ||
216 | #define CCR_RESET 0x80 | ||
217 | #define CCR_CORCHANGE 0x4e | ||
218 | #define CCR_SENDCH 0x20 | ||
219 | #define CCR_CHANCTRL 0x10 | ||
220 | |||
221 | #define CCR_TXENABLE (CCR_CHANCTRL | 0x08) | ||
222 | #define CCR_TXDISABLE (CCR_CHANCTRL | 0x04) | ||
223 | #define CCR_RXENABLE (CCR_CHANCTRL | 0x02) | ||
224 | #define CCR_RXDISABLE (CCR_CHANCTRL | 0x01) | ||
225 | |||
226 | #define CCR_SENDSCHR1 (CCR_SENDCH | 0x01) | ||
227 | #define CCR_SENDSCHR2 (CCR_SENDCH | 0x02) | ||
228 | #define CCR_SENDSCHR3 (CCR_SENDCH | 0x03) | ||
229 | #define CCR_SENDSCHR4 (CCR_SENDCH | 0x04) | ||
230 | |||
231 | #define CCR_RESETCHAN (CCR_RESET | 0x00) | ||
232 | #define CCR_RESETFULL (CCR_RESET | 0x01) | ||
233 | #define CCR_TXFLUSHFIFO (CCR_RESET | 0x02) | ||
234 | |||
235 | #define CCR_MAXWAIT 10000 | ||
236 | |||
237 | /*****************************************************************************/ | ||
238 | |||
239 | /* | ||
240 | * Define the valid acknowledgement types (for hw ack cycle). | ||
241 | */ | ||
242 | #define ACK_TYPMASK 0x07 | ||
243 | #define ACK_TYPTX 0x02 | ||
244 | #define ACK_TYPMDM 0x01 | ||
245 | #define ACK_TYPRXGOOD 0x03 | ||
246 | #define ACK_TYPRXBAD 0x07 | ||
247 | |||
248 | #define SVRR_RX 0x01 | ||
249 | #define SVRR_TX 0x02 | ||
250 | #define SVRR_MDM 0x04 | ||
251 | |||
252 | #define ST_OVERRUN 0x01 | ||
253 | #define ST_FRAMING 0x02 | ||
254 | #define ST_PARITY 0x04 | ||
255 | #define ST_BREAK 0x08 | ||
256 | #define ST_SCHAR1 0x10 | ||
257 | #define ST_SCHAR2 0x20 | ||
258 | #define ST_SCHAR3 0x30 | ||
259 | #define ST_SCHAR4 0x40 | ||
260 | #define ST_RANGE 0x70 | ||
261 | #define ST_SCHARMASK 0x70 | ||
262 | #define ST_TIMEOUT 0x80 | ||
263 | |||
264 | #define MISR_DCD 0x80 | ||
265 | #define MISR_CTS 0x40 | ||
266 | #define MISR_RI 0x20 | ||
267 | #define MISR_DSR 0x10 | ||
268 | |||
269 | /*****************************************************************************/ | ||
270 | |||
271 | /* | ||
272 | * Defines for the CCSR status register. | ||
273 | */ | ||
274 | #define CCSR_RXENABLED 0x80 | ||
275 | #define CCSR_RXFLOWON 0x40 | ||
276 | #define CCSR_RXFLOWOFF 0x20 | ||
277 | #define CCSR_TXENABLED 0x08 | ||
278 | #define CCSR_TXFLOWON 0x04 | ||
279 | #define CCSR_TXFLOWOFF 0x02 | ||
280 | |||
281 | /*****************************************************************************/ | ||
282 | |||
283 | /* | ||
284 | * Define the embedded commands. | ||
285 | */ | ||
286 | #define ETC_CMD 0x00 | ||
287 | #define ETC_STARTBREAK 0x81 | ||
288 | #define ETC_DELAY 0x82 | ||
289 | #define ETC_STOPBREAK 0x83 | ||
290 | |||
291 | /*****************************************************************************/ | ||
292 | #endif | ||
diff --git a/include/linux/cdk.h b/include/linux/cdk.h deleted file mode 100644 index 80093a8d4f64..000000000000 --- a/include/linux/cdk.h +++ /dev/null | |||
@@ -1,486 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * cdk.h -- CDK interface definitions. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | /*****************************************************************************/ | ||
25 | #ifndef _CDK_H | ||
26 | #define _CDK_H | ||
27 | /*****************************************************************************/ | ||
28 | |||
29 | #pragma pack(2) | ||
30 | |||
31 | /* | ||
32 | * The following set of definitions is used to communicate with the | ||
33 | * shared memory interface of the Stallion intelligent multiport serial | ||
34 | * boards. The definitions in this file are taken directly from the | ||
35 | * document titled "Generic Stackable Interface, Downloader and | ||
36 | * Communications Development Kit". | ||
37 | */ | ||
38 | |||
39 | /* | ||
40 | * Define the set of important shared memory addresses. These are | ||
41 | * required to initialize the board and get things started. All of these | ||
42 | * addresses are relative to the start of the shared memory. | ||
43 | */ | ||
44 | #define CDK_SIGADDR 0x200 | ||
45 | #define CDK_FEATADDR 0x280 | ||
46 | #define CDK_CDKADDR 0x300 | ||
47 | #define CDK_RDYADDR 0x262 | ||
48 | |||
49 | #define CDK_ALIVEMARKER 13 | ||
50 | |||
51 | /* | ||
52 | * On hardware power up the ROMs located on the EasyConnection 8/64 will | ||
53 | * fill out the following signature information into shared memory. This | ||
54 | * way the host system can quickly determine that the board is present | ||
55 | * and is operational. | ||
56 | */ | ||
57 | typedef struct cdkecpsig { | ||
58 | unsigned long magic; | ||
59 | unsigned short romver; | ||
60 | unsigned short cputype; | ||
61 | unsigned char panelid[8]; | ||
62 | } cdkecpsig_t; | ||
63 | |||
64 | #define ECP_MAGIC 0x21504345 | ||
65 | |||
66 | /* | ||
67 | * On hardware power up the ROMs located on the ONboard, Stallion and | ||
68 | * Brumbys will fill out the following signature information into shared | ||
69 | * memory. This way the host system can quickly determine that the board | ||
70 | * is present and is operational. | ||
71 | */ | ||
72 | typedef struct cdkonbsig { | ||
73 | unsigned short magic0; | ||
74 | unsigned short magic1; | ||
75 | unsigned short magic2; | ||
76 | unsigned short magic3; | ||
77 | unsigned short romver; | ||
78 | unsigned short memoff; | ||
79 | unsigned short memseg; | ||
80 | unsigned short amask0; | ||
81 | unsigned short pic; | ||
82 | unsigned short status; | ||
83 | unsigned short btype; | ||
84 | unsigned short clkticks; | ||
85 | unsigned short clkspeed; | ||
86 | unsigned short amask1; | ||
87 | unsigned short amask2; | ||
88 | } cdkonbsig_t; | ||
89 | |||
90 | #define ONB_MAGIC0 0xf2a7 | ||
91 | #define ONB_MAGIC1 0xa149 | ||
92 | #define ONB_MAGIC2 0x6352 | ||
93 | #define ONB_MAGIC3 0xf121 | ||
94 | |||
95 | /* | ||
96 | * Define the feature area structure. The feature area is the set of | ||
97 | * startup parameters used by the slave image when it starts executing. | ||
98 | * They allow for the specification of buffer sizes, debug trace, etc. | ||
99 | */ | ||
100 | typedef struct cdkfeature { | ||
101 | unsigned long debug; | ||
102 | unsigned long banner; | ||
103 | unsigned long etype; | ||
104 | unsigned long nrdevs; | ||
105 | unsigned long brdspec; | ||
106 | unsigned long txrqsize; | ||
107 | unsigned long rxrqsize; | ||
108 | unsigned long flags; | ||
109 | } cdkfeature_t; | ||
110 | |||
111 | #define ETYP_DDK 0 | ||
112 | #define ETYP_CDK 1 | ||
113 | |||
114 | /* | ||
115 | * Define the CDK header structure. This is the info that the slave | ||
116 | * environment sets up after it has been downloaded and started. It | ||
117 | * essentially provides a memory map for the shared memory interface. | ||
118 | */ | ||
119 | typedef struct cdkhdr { | ||
120 | unsigned short command; | ||
121 | unsigned short status; | ||
122 | unsigned short port; | ||
123 | unsigned short mode; | ||
124 | unsigned long cmd_buf[14]; | ||
125 | unsigned short alive_cnt; | ||
126 | unsigned short intrpt_mode; | ||
127 | unsigned char intrpt_id[8]; | ||
128 | unsigned char ver_release; | ||
129 | unsigned char ver_modification; | ||
130 | unsigned char ver_fix; | ||
131 | unsigned char deadman_restart; | ||
132 | unsigned short deadman; | ||
133 | unsigned short nrdevs; | ||
134 | unsigned long memp; | ||
135 | unsigned long hostp; | ||
136 | unsigned long slavep; | ||
137 | unsigned char hostreq; | ||
138 | unsigned char slavereq; | ||
139 | unsigned char cmd_reserved[30]; | ||
140 | } cdkhdr_t; | ||
141 | |||
142 | #define MODE_DDK 0 | ||
143 | #define MODE_CDK 1 | ||
144 | |||
145 | #define IMD_INTR 0x0 | ||
146 | #define IMD_PPINTR 0x1 | ||
147 | #define IMD_POLL 0xff | ||
148 | |||
149 | /* | ||
150 | * Define the memory mapping structure. This structure is pointed to by | ||
151 | * the memp field in the stlcdkhdr struct. As many as these structures | ||
152 | * as required are laid out in shared memory to define how the rest of | ||
153 | * shared memory is divided up. There will be one for each port. | ||
154 | */ | ||
155 | typedef struct cdkmem { | ||
156 | unsigned short dtype; | ||
157 | unsigned long offset; | ||
158 | } cdkmem_t; | ||
159 | |||
160 | #define TYP_UNDEFINED 0x0 | ||
161 | #define TYP_ASYNCTRL 0x1 | ||
162 | #define TYP_ASYNC 0x20 | ||
163 | #define TYP_PARALLEL 0x40 | ||
164 | #define TYP_SYNCX21 0x60 | ||
165 | |||
166 | /*****************************************************************************/ | ||
167 | |||
168 | /* | ||
169 | * Following is a set of defines and structures used to actually deal | ||
170 | * with the serial ports on the board. Firstly is the set of commands | ||
171 | * that can be applied to ports. | ||
172 | */ | ||
173 | #define ASYCMD (((unsigned long) 'a') << 8) | ||
174 | |||
175 | #define A_NULL (ASYCMD | 0) | ||
176 | #define A_FLUSH (ASYCMD | 1) | ||
177 | #define A_BREAK (ASYCMD | 2) | ||
178 | #define A_GETPORT (ASYCMD | 3) | ||
179 | #define A_SETPORT (ASYCMD | 4) | ||
180 | #define A_SETPORTF (ASYCMD | 5) | ||
181 | #define A_SETPORTFTX (ASYCMD | 6) | ||
182 | #define A_SETPORTFRX (ASYCMD | 7) | ||
183 | #define A_GETSIGNALS (ASYCMD | 8) | ||
184 | #define A_SETSIGNALS (ASYCMD | 9) | ||
185 | #define A_SETSIGNALSF (ASYCMD | 10) | ||
186 | #define A_SETSIGNALSFTX (ASYCMD | 11) | ||
187 | #define A_SETSIGNALSFRX (ASYCMD | 12) | ||
188 | #define A_GETNOTIFY (ASYCMD | 13) | ||
189 | #define A_SETNOTIFY (ASYCMD | 14) | ||
190 | #define A_NOTIFY (ASYCMD | 15) | ||
191 | #define A_PORTCTRL (ASYCMD | 16) | ||
192 | #define A_GETSTATS (ASYCMD | 17) | ||
193 | #define A_RQSTATE (ASYCMD | 18) | ||
194 | #define A_FLOWSTATE (ASYCMD | 19) | ||
195 | #define A_CLEARSTATS (ASYCMD | 20) | ||
196 | |||
197 | /* | ||
198 | * Define those arguments used for simple commands. | ||
199 | */ | ||
200 | #define FLUSHRX 0x1 | ||
201 | #define FLUSHTX 0x2 | ||
202 | |||
203 | #define BREAKON -1 | ||
204 | #define BREAKOFF -2 | ||
205 | |||
206 | /* | ||
207 | * Define the port setting structure, and all those defines that go along | ||
208 | * with it. Basically this structure defines the characteristics of this | ||
209 | * port: baud rate, chars, parity, input/output char cooking etc. | ||
210 | */ | ||
211 | typedef struct asyport { | ||
212 | unsigned long baudout; | ||
213 | unsigned long baudin; | ||
214 | unsigned long iflag; | ||
215 | unsigned long oflag; | ||
216 | unsigned long lflag; | ||
217 | unsigned long pflag; | ||
218 | unsigned long flow; | ||
219 | unsigned long spare1; | ||
220 | unsigned short vtime; | ||
221 | unsigned short vmin; | ||
222 | unsigned short txlo; | ||
223 | unsigned short txhi; | ||
224 | unsigned short rxlo; | ||
225 | unsigned short rxhi; | ||
226 | unsigned short rxhog; | ||
227 | unsigned short spare2; | ||
228 | unsigned char csize; | ||
229 | unsigned char stopbs; | ||
230 | unsigned char parity; | ||
231 | unsigned char stopin; | ||
232 | unsigned char startin; | ||
233 | unsigned char stopout; | ||
234 | unsigned char startout; | ||
235 | unsigned char parmark; | ||
236 | unsigned char brkmark; | ||
237 | unsigned char cc[11]; | ||
238 | } asyport_t; | ||
239 | |||
240 | #define PT_STOP1 0x0 | ||
241 | #define PT_STOP15 0x1 | ||
242 | #define PT_STOP2 0x2 | ||
243 | |||
244 | #define PT_NOPARITY 0x0 | ||
245 | #define PT_ODDPARITY 0x1 | ||
246 | #define PT_EVENPARITY 0x2 | ||
247 | #define PT_MARKPARITY 0x3 | ||
248 | #define PT_SPACEPARITY 0x4 | ||
249 | |||
250 | #define F_NONE 0x0 | ||
251 | #define F_IXON 0x1 | ||
252 | #define F_IXOFF 0x2 | ||
253 | #define F_IXANY 0x4 | ||
254 | #define F_IOXANY 0x8 | ||
255 | #define F_RTSFLOW 0x10 | ||
256 | #define F_CTSFLOW 0x20 | ||
257 | #define F_DTRFLOW 0x40 | ||
258 | #define F_DCDFLOW 0x80 | ||
259 | #define F_DSROFLOW 0x100 | ||
260 | #define F_DSRIFLOW 0x200 | ||
261 | |||
262 | #define FI_NORX 0x1 | ||
263 | #define FI_RAW 0x2 | ||
264 | #define FI_ISTRIP 0x4 | ||
265 | #define FI_UCLC 0x8 | ||
266 | #define FI_INLCR 0x10 | ||
267 | #define FI_ICRNL 0x20 | ||
268 | #define FI_IGNCR 0x40 | ||
269 | #define FI_IGNBREAK 0x80 | ||
270 | #define FI_DSCRDBREAK 0x100 | ||
271 | #define FI_1MARKBREAK 0x200 | ||
272 | #define FI_2MARKBREAK 0x400 | ||
273 | #define FI_XCHNGBREAK 0x800 | ||
274 | #define FI_IGNRXERRS 0x1000 | ||
275 | #define FI_DSCDRXERRS 0x2000 | ||
276 | #define FI_1MARKRXERRS 0x4000 | ||
277 | #define FI_2MARKRXERRS 0x8000 | ||
278 | #define FI_XCHNGRXERRS 0x10000 | ||
279 | #define FI_DSCRDNULL 0x20000 | ||
280 | |||
281 | #define FO_OLCUC 0x1 | ||
282 | #define FO_ONLCR 0x2 | ||
283 | #define FO_OOCRNL 0x4 | ||
284 | #define FO_ONOCR 0x8 | ||
285 | #define FO_ONLRET 0x10 | ||
286 | #define FO_ONL 0x20 | ||
287 | #define FO_OBS 0x40 | ||
288 | #define FO_OVT 0x80 | ||
289 | #define FO_OFF 0x100 | ||
290 | #define FO_OTAB1 0x200 | ||
291 | #define FO_OTAB2 0x400 | ||
292 | #define FO_OTAB3 0x800 | ||
293 | #define FO_OCR1 0x1000 | ||
294 | #define FO_OCR2 0x2000 | ||
295 | #define FO_OCR3 0x4000 | ||
296 | #define FO_OFILL 0x8000 | ||
297 | #define FO_ODELL 0x10000 | ||
298 | |||
299 | #define P_RTSLOCK 0x1 | ||
300 | #define P_CTSLOCK 0x2 | ||
301 | #define P_MAPRTS 0x4 | ||
302 | #define P_MAPCTS 0x8 | ||
303 | #define P_LOOPBACK 0x10 | ||
304 | #define P_DTRFOLLOW 0x20 | ||
305 | #define P_FAKEDCD 0x40 | ||
306 | |||
307 | #define P_RXIMIN 0x10000 | ||
308 | #define P_RXITIME 0x20000 | ||
309 | #define P_RXTHOLD 0x40000 | ||
310 | |||
311 | /* | ||
312 | * Define a structure to communicate serial port signal and data state | ||
313 | * information. | ||
314 | */ | ||
315 | typedef struct asysigs { | ||
316 | unsigned long data; | ||
317 | unsigned long signal; | ||
318 | unsigned long sigvalue; | ||
319 | } asysigs_t; | ||
320 | |||
321 | #define DT_TXBUSY 0x1 | ||
322 | #define DT_TXEMPTY 0x2 | ||
323 | #define DT_TXLOW 0x4 | ||
324 | #define DT_TXHIGH 0x8 | ||
325 | #define DT_TXFULL 0x10 | ||
326 | #define DT_TXHOG 0x20 | ||
327 | #define DT_TXFLOWED 0x40 | ||
328 | #define DT_TXBREAK 0x80 | ||
329 | |||
330 | #define DT_RXBUSY 0x100 | ||
331 | #define DT_RXEMPTY 0x200 | ||
332 | #define DT_RXLOW 0x400 | ||
333 | #define DT_RXHIGH 0x800 | ||
334 | #define DT_RXFULL 0x1000 | ||
335 | #define DT_RXHOG 0x2000 | ||
336 | #define DT_RXFLOWED 0x4000 | ||
337 | #define DT_RXBREAK 0x8000 | ||
338 | |||
339 | #define SG_DTR 0x1 | ||
340 | #define SG_DCD 0x2 | ||
341 | #define SG_RTS 0x4 | ||
342 | #define SG_CTS 0x8 | ||
343 | #define SG_DSR 0x10 | ||
344 | #define SG_RI 0x20 | ||
345 | |||
346 | /* | ||
347 | * Define the notification setting structure. This is used to tell the | ||
348 | * port what events we want to be informed about. Fields here use the | ||
349 | * same defines as for the asysigs structure above. | ||
350 | */ | ||
351 | typedef struct asynotify { | ||
352 | unsigned long ctrl; | ||
353 | unsigned long data; | ||
354 | unsigned long signal; | ||
355 | unsigned long sigvalue; | ||
356 | } asynotify_t; | ||
357 | |||
358 | /* | ||
359 | * Define the port control structure. It is used to do fine grain | ||
360 | * control operations on the port. | ||
361 | */ | ||
362 | typedef struct { | ||
363 | unsigned long rxctrl; | ||
364 | unsigned long txctrl; | ||
365 | char rximdch; | ||
366 | char tximdch; | ||
367 | char spare1; | ||
368 | char spare2; | ||
369 | } asyctrl_t; | ||
370 | |||
371 | #define CT_ENABLE 0x1 | ||
372 | #define CT_DISABLE 0x2 | ||
373 | #define CT_STOP 0x4 | ||
374 | #define CT_START 0x8 | ||
375 | #define CT_STARTFLOW 0x10 | ||
376 | #define CT_STOPFLOW 0x20 | ||
377 | #define CT_SENDCHR 0x40 | ||
378 | |||
379 | /* | ||
380 | * Define the stats structure kept for each port. This is a useful set | ||
381 | * of data collected for each port on the slave. The A_GETSTATS command | ||
382 | * is used to retrieve this data from the slave. | ||
383 | */ | ||
384 | typedef struct asystats { | ||
385 | unsigned long opens; | ||
386 | unsigned long txchars; | ||
387 | unsigned long rxchars; | ||
388 | unsigned long txringq; | ||
389 | unsigned long rxringq; | ||
390 | unsigned long txmsgs; | ||
391 | unsigned long rxmsgs; | ||
392 | unsigned long txflushes; | ||
393 | unsigned long rxflushes; | ||
394 | unsigned long overruns; | ||
395 | unsigned long framing; | ||
396 | unsigned long parity; | ||
397 | unsigned long ringover; | ||
398 | unsigned long lost; | ||
399 | unsigned long rxstart; | ||
400 | unsigned long rxstop; | ||
401 | unsigned long txstart; | ||
402 | unsigned long txstop; | ||
403 | unsigned long dcdcnt; | ||
404 | unsigned long dtrcnt; | ||
405 | unsigned long ctscnt; | ||
406 | unsigned long rtscnt; | ||
407 | unsigned long dsrcnt; | ||
408 | unsigned long ricnt; | ||
409 | unsigned long txbreaks; | ||
410 | unsigned long rxbreaks; | ||
411 | unsigned long signals; | ||
412 | unsigned long state; | ||
413 | unsigned long hwid; | ||
414 | } asystats_t; | ||
415 | |||
416 | /*****************************************************************************/ | ||
417 | |||
418 | /* | ||
419 | * All command and control communication with a device on the slave is | ||
420 | * via a control block in shared memory. Each device has its own control | ||
421 | * block, defined by the following structure. The control block allows | ||
422 | * the host to open, close and control the device on the slave. | ||
423 | */ | ||
424 | typedef struct cdkctrl { | ||
425 | unsigned char open; | ||
426 | unsigned char close; | ||
427 | unsigned long openarg; | ||
428 | unsigned long closearg; | ||
429 | unsigned long cmd; | ||
430 | unsigned long status; | ||
431 | unsigned long args[32]; | ||
432 | } cdkctrl_t; | ||
433 | |||
434 | /* | ||
435 | * Each device on the slave passes data to and from the host via a ring | ||
436 | * queue in shared memory. Define a ring queue structure to hold the | ||
437 | * vital information about each ring queue. Two ring queues will be | ||
438 | * allocated for each port, one for receive data and one for transmit | ||
439 | * data. | ||
440 | */ | ||
441 | typedef struct cdkasyrq { | ||
442 | unsigned long offset; | ||
443 | unsigned short size; | ||
444 | unsigned short head; | ||
445 | unsigned short tail; | ||
446 | } cdkasyrq_t; | ||
447 | |||
448 | /* | ||
449 | * Each asynchronous port is defined in shared memory by the following | ||
450 | * structure. It contains a control block to command a device, and also | ||
451 | * the necessary data channel information as well. | ||
452 | */ | ||
453 | typedef struct cdkasy { | ||
454 | cdkctrl_t ctrl; | ||
455 | unsigned short notify; | ||
456 | asynotify_t changed; | ||
457 | unsigned short receive; | ||
458 | cdkasyrq_t rxq; | ||
459 | unsigned short transmit; | ||
460 | cdkasyrq_t txq; | ||
461 | } cdkasy_t; | ||
462 | |||
463 | #pragma pack() | ||
464 | |||
465 | /*****************************************************************************/ | ||
466 | |||
467 | /* | ||
468 | * Define the set of ioctls used by the driver to do special things | ||
469 | * to the board. These include interrupting it, and initializing | ||
470 | * the driver after board startup and shutdown. | ||
471 | */ | ||
472 | #include <linux/ioctl.h> | ||
473 | |||
474 | #define STL_BINTR _IO('s',20) | ||
475 | #define STL_BSTART _IO('s',21) | ||
476 | #define STL_BSTOP _IO('s',22) | ||
477 | #define STL_BRESET _IO('s',23) | ||
478 | |||
479 | /* | ||
480 | * Define a set of ioctl extensions, used to get at special stuff. | ||
481 | */ | ||
482 | #define STL_GETPFLAG _IO('s',80) | ||
483 | #define STL_SETPFLAG _IO('s',81) | ||
484 | |||
485 | /*****************************************************************************/ | ||
486 | #endif | ||
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index d021610efd65..cf6f4d998a76 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -12,8 +12,8 @@ | |||
12 | #ifndef CEPH_FS_H | 12 | #ifndef CEPH_FS_H |
13 | #define CEPH_FS_H | 13 | #define CEPH_FS_H |
14 | 14 | ||
15 | #include "msgr.h" | 15 | #include <linux/ceph/msgr.h> |
16 | #include "rados.h" | 16 | #include <linux/ceph/rados.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * subprotocol versions. when specific messages types or high-level | 19 | * subprotocol versions. when specific messages types or high-level |
diff --git a/include/linux/ceph/debugfs.h b/include/linux/ceph/debugfs.h index 2a79702e092b..1df086d7882d 100644 --- a/include/linux/ceph/debugfs.h +++ b/include/linux/ceph/debugfs.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef _FS_CEPH_DEBUGFS_H | 1 | #ifndef _FS_CEPH_DEBUGFS_H |
2 | #define _FS_CEPH_DEBUGFS_H | 2 | #define _FS_CEPH_DEBUGFS_H |
3 | 3 | ||
4 | #include "ceph_debug.h" | 4 | #include <linux/ceph/ceph_debug.h> |
5 | #include "types.h" | 5 | #include <linux/ceph/types.h> |
6 | 6 | ||
7 | #define CEPH_DEFINE_SHOW_FUNC(name) \ | 7 | #define CEPH_DEFINE_SHOW_FUNC(name) \ |
8 | static int name##_open(struct inode *inode, struct file *file) \ | 8 | static int name##_open(struct inode *inode, struct file *file) \ |
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 4bbf2db45f46..63d092822bad 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/time.h> | 6 | #include <linux/time.h> |
7 | #include <asm/unaligned.h> | 7 | #include <asm/unaligned.h> |
8 | 8 | ||
9 | #include "types.h" | 9 | #include <linux/ceph/types.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * in all cases, | 12 | * in all cases, |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 42624789b06f..6470792b13d3 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _FS_CEPH_LIBCEPH_H | 1 | #ifndef _FS_CEPH_LIBCEPH_H |
2 | #define _FS_CEPH_LIBCEPH_H | 2 | #define _FS_CEPH_LIBCEPH_H |
3 | 3 | ||
4 | #include "ceph_debug.h" | 4 | #include <linux/ceph/ceph_debug.h> |
5 | 5 | ||
6 | #include <asm/unaligned.h> | 6 | #include <asm/unaligned.h> |
7 | #include <linux/backing-dev.h> | 7 | #include <linux/backing-dev.h> |
@@ -15,12 +15,12 @@ | |||
15 | #include <linux/writeback.h> | 15 | #include <linux/writeback.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | 17 | ||
18 | #include "types.h" | 18 | #include <linux/ceph/types.h> |
19 | #include "messenger.h" | 19 | #include <linux/ceph/messenger.h> |
20 | #include "msgpool.h" | 20 | #include <linux/ceph/msgpool.h> |
21 | #include "mon_client.h" | 21 | #include <linux/ceph/mon_client.h> |
22 | #include "osd_client.h" | 22 | #include <linux/ceph/osd_client.h> |
23 | #include "ceph_fs.h" | 23 | #include <linux/ceph/ceph_fs.h> |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * mount options | 26 | * mount options |
diff --git a/include/linux/ceph/mdsmap.h b/include/linux/ceph/mdsmap.h index 9935fac8c107..cb15b5d867c7 100644 --- a/include/linux/ceph/mdsmap.h +++ b/include/linux/ceph/mdsmap.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _FS_CEPH_MDSMAP_H | 2 | #define _FS_CEPH_MDSMAP_H |
3 | 3 | ||
4 | #include <linux/bug.h> | 4 | #include <linux/bug.h> |
5 | #include "types.h" | 5 | #include <linux/ceph/types.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * mds map - describe servers in the mds cluster. | 8 | * mds map - describe servers in the mds cluster. |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 189ae0637634..14ba5ee738a9 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -8,8 +8,8 @@ | |||
8 | #include <linux/uio.h> | 8 | #include <linux/uio.h> |
9 | #include <linux/workqueue.h> | 9 | #include <linux/workqueue.h> |
10 | 10 | ||
11 | #include "types.h" | 11 | #include <linux/ceph/types.h> |
12 | #include "buffer.h" | 12 | #include <linux/ceph/buffer.h> |
13 | 13 | ||
14 | struct ceph_msg; | 14 | struct ceph_msg; |
15 | struct ceph_connection; | 15 | struct ceph_connection; |
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h index 2113e3850a4e..1fb93e9080b0 100644 --- a/include/linux/ceph/mon_client.h +++ b/include/linux/ceph/mon_client.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/kref.h> | 5 | #include <linux/kref.h> |
6 | #include <linux/rbtree.h> | 6 | #include <linux/rbtree.h> |
7 | 7 | ||
8 | #include "messenger.h" | 8 | #include <linux/ceph/messenger.h> |
9 | 9 | ||
10 | struct ceph_client; | 10 | struct ceph_client; |
11 | struct ceph_mount_args; | 11 | struct ceph_mount_args; |
diff --git a/include/linux/ceph/msgpool.h b/include/linux/ceph/msgpool.h index 09fa96b43436..4b0d38960726 100644 --- a/include/linux/ceph/msgpool.h +++ b/include/linux/ceph/msgpool.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _FS_CEPH_MSGPOOL | 2 | #define _FS_CEPH_MSGPOOL |
3 | 3 | ||
4 | #include <linux/mempool.h> | 4 | #include <linux/mempool.h> |
5 | #include "messenger.h" | 5 | #include <linux/ceph/messenger.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * we use memory pools for preallocating messages we may receive, to | 8 | * we use memory pools for preallocating messages we may receive, to |
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 311ef8d6aa9e..25b930bffea6 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define _FS_CEPH_OSDMAP_H | 2 | #define _FS_CEPH_OSDMAP_H |
3 | 3 | ||
4 | #include <linux/rbtree.h> | 4 | #include <linux/rbtree.h> |
5 | #include "types.h" | 5 | #include <linux/ceph/types.h> |
6 | #include "ceph_fs.h" | 6 | #include <linux/ceph/ceph_fs.h> |
7 | #include <linux/crush/crush.h> | 7 | #include <linux/crush/crush.h> |
8 | 8 | ||
9 | /* | 9 | /* |
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h index 0a99099801a4..de91fbdf127e 100644 --- a/include/linux/ceph/rados.h +++ b/include/linux/ceph/rados.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * (Reliable Autonomic Distributed Object Store). | 6 | * (Reliable Autonomic Distributed Object Store). |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "msgr.h" | 9 | #include <linux/ceph/msgr.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * osdmap encoding versions | 12 | * osdmap encoding versions |
diff --git a/include/linux/ceph/types.h b/include/linux/ceph/types.h index 28b35a005ec2..d3ff1cf2d27e 100644 --- a/include/linux/ceph/types.h +++ b/include/linux/ceph/types.h | |||
@@ -7,9 +7,9 @@ | |||
7 | #include <linux/fcntl.h> | 7 | #include <linux/fcntl.h> |
8 | #include <linux/string.h> | 8 | #include <linux/string.h> |
9 | 9 | ||
10 | #include "ceph_fs.h" | 10 | #include <linux/ceph/ceph_fs.h> |
11 | #include "ceph_frag.h" | 11 | #include <linux/ceph/ceph_frag.h> |
12 | #include "ceph_hash.h" | 12 | #include <linux/ceph/ceph_hash.h> |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * Identify inodes by both their ino AND snapshot id (a u64). | 15 | * Identify inodes by both their ino AND snapshot id (a u64). |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c90eaa803440..f8a030ced0c7 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/rwsem.h> | 17 | #include <linux/rwsem.h> |
18 | #include <linux/idr.h> | 18 | #include <linux/idr.h> |
19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
20 | #include <linux/xattr.h> | ||
20 | 21 | ||
21 | #ifdef CONFIG_CGROUPS | 22 | #ifdef CONFIG_CGROUPS |
22 | 23 | ||
@@ -45,17 +46,13 @@ extern const struct file_operations proc_cgroup_operations; | |||
45 | 46 | ||
46 | /* Define the enumeration of all builtin cgroup subsystems */ | 47 | /* Define the enumeration of all builtin cgroup subsystems */ |
47 | #define SUBSYS(_x) _x ## _subsys_id, | 48 | #define SUBSYS(_x) _x ## _subsys_id, |
49 | #define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) | ||
48 | enum cgroup_subsys_id { | 50 | enum cgroup_subsys_id { |
49 | #include <linux/cgroup_subsys.h> | 51 | #include <linux/cgroup_subsys.h> |
50 | CGROUP_BUILTIN_SUBSYS_COUNT | 52 | CGROUP_SUBSYS_COUNT, |
51 | }; | 53 | }; |
54 | #undef IS_SUBSYS_ENABLED | ||
52 | #undef SUBSYS | 55 | #undef SUBSYS |
53 | /* | ||
54 | * This define indicates the maximum number of subsystems that can be loaded | ||
55 | * at once. We limit to this many since cgroupfs_root has subsys_bits to keep | ||
56 | * track of all of them. | ||
57 | */ | ||
58 | #define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long)) | ||
59 | 56 | ||
60 | /* Per-subsystem/per-cgroup state maintained by the system. */ | 57 | /* Per-subsystem/per-cgroup state maintained by the system. */ |
61 | struct cgroup_subsys_state { | 58 | struct cgroup_subsys_state { |
@@ -216,6 +213,9 @@ struct cgroup { | |||
216 | /* List of events which userspace want to receive */ | 213 | /* List of events which userspace want to receive */ |
217 | struct list_head event_list; | 214 | struct list_head event_list; |
218 | spinlock_t event_list_lock; | 215 | spinlock_t event_list_lock; |
216 | |||
217 | /* directory xattrs */ | ||
218 | struct simple_xattrs xattrs; | ||
219 | }; | 219 | }; |
220 | 220 | ||
221 | /* | 221 | /* |
@@ -309,6 +309,9 @@ struct cftype { | |||
309 | /* CFTYPE_* flags */ | 309 | /* CFTYPE_* flags */ |
310 | unsigned int flags; | 310 | unsigned int flags; |
311 | 311 | ||
312 | /* file xattrs */ | ||
313 | struct simple_xattrs xattrs; | ||
314 | |||
312 | int (*open)(struct inode *inode, struct file *file); | 315 | int (*open)(struct inode *inode, struct file *file); |
313 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, | 316 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, |
314 | struct file *file, | 317 | struct file *file, |
@@ -394,7 +397,7 @@ struct cftype { | |||
394 | */ | 397 | */ |
395 | struct cftype_set { | 398 | struct cftype_set { |
396 | struct list_head node; /* chained at subsys->cftsets */ | 399 | struct list_head node; /* chained at subsys->cftsets */ |
397 | const struct cftype *cfts; | 400 | struct cftype *cfts; |
398 | }; | 401 | }; |
399 | 402 | ||
400 | struct cgroup_scanner { | 403 | struct cgroup_scanner { |
@@ -406,8 +409,8 @@ struct cgroup_scanner { | |||
406 | void *data; | 409 | void *data; |
407 | }; | 410 | }; |
408 | 411 | ||
409 | int cgroup_add_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); | 412 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
410 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, const struct cftype *cfts); | 413 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
411 | 414 | ||
412 | int cgroup_is_removed(const struct cgroup *cgrp); | 415 | int cgroup_is_removed(const struct cgroup *cgrp); |
413 | 416 | ||
@@ -496,6 +499,21 @@ struct cgroup_subsys { | |||
496 | */ | 499 | */ |
497 | bool __DEPRECATED_clear_css_refs; | 500 | bool __DEPRECATED_clear_css_refs; |
498 | 501 | ||
502 | /* | ||
503 | * If %false, this subsystem is properly hierarchical - | ||
504 | * configuration, resource accounting and restriction on a parent | ||
505 | * cgroup cover those of its children. If %true, hierarchy support | ||
506 | * is broken in some ways - some subsystems ignore hierarchy | ||
507 | * completely while others are only implemented half-way. | ||
508 | * | ||
509 | * It's now disallowed to create nested cgroups if the subsystem is | ||
510 | * broken and cgroup core will emit a warning message on such | ||
511 | * cases. Eventually, all subsystems will be made properly | ||
512 | * hierarchical and this will go away. | ||
513 | */ | ||
514 | bool broken_hierarchy; | ||
515 | bool warned_broken_hierarchy; | ||
516 | |||
499 | #define MAX_CGROUP_TYPE_NAMELEN 32 | 517 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
500 | const char *name; | 518 | const char *name; |
501 | 519 | ||
@@ -521,7 +539,9 @@ struct cgroup_subsys { | |||
521 | }; | 539 | }; |
522 | 540 | ||
523 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; | 541 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; |
542 | #define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option) | ||
524 | #include <linux/cgroup_subsys.h> | 543 | #include <linux/cgroup_subsys.h> |
544 | #undef IS_SUBSYS_ENABLED | ||
525 | #undef SUBSYS | 545 | #undef SUBSYS |
526 | 546 | ||
527 | static inline struct cgroup_subsys_state *cgroup_subsys_state( | 547 | static inline struct cgroup_subsys_state *cgroup_subsys_state( |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index dfae957398c3..f204a7a9cf38 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -7,73 +7,73 @@ | |||
7 | 7 | ||
8 | /* */ | 8 | /* */ |
9 | 9 | ||
10 | #ifdef CONFIG_CPUSETS | 10 | #if IS_SUBSYS_ENABLED(CONFIG_CPUSETS) |
11 | SUBSYS(cpuset) | 11 | SUBSYS(cpuset) |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | /* */ | 14 | /* */ |
15 | 15 | ||
16 | #ifdef CONFIG_CGROUP_DEBUG | 16 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEBUG) |
17 | SUBSYS(debug) | 17 | SUBSYS(debug) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | /* */ | 20 | /* */ |
21 | 21 | ||
22 | #ifdef CONFIG_CGROUP_SCHED | 22 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_SCHED) |
23 | SUBSYS(cpu_cgroup) | 23 | SUBSYS(cpu_cgroup) |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* */ | 26 | /* */ |
27 | 27 | ||
28 | #ifdef CONFIG_CGROUP_CPUACCT | 28 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_CPUACCT) |
29 | SUBSYS(cpuacct) | 29 | SUBSYS(cpuacct) |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | /* */ | 32 | /* */ |
33 | 33 | ||
34 | #ifdef CONFIG_MEMCG | 34 | #if IS_SUBSYS_ENABLED(CONFIG_MEMCG) |
35 | SUBSYS(mem_cgroup) | 35 | SUBSYS(mem_cgroup) |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* */ | 38 | /* */ |
39 | 39 | ||
40 | #ifdef CONFIG_CGROUP_DEVICE | 40 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_DEVICE) |
41 | SUBSYS(devices) | 41 | SUBSYS(devices) |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | /* */ | 44 | /* */ |
45 | 45 | ||
46 | #ifdef CONFIG_CGROUP_FREEZER | 46 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_FREEZER) |
47 | SUBSYS(freezer) | 47 | SUBSYS(freezer) |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | /* */ | 50 | /* */ |
51 | 51 | ||
52 | #ifdef CONFIG_NET_CLS_CGROUP | 52 | #if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) |
53 | SUBSYS(net_cls) | 53 | SUBSYS(net_cls) |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | /* */ | 56 | /* */ |
57 | 57 | ||
58 | #ifdef CONFIG_BLK_CGROUP | 58 | #if IS_SUBSYS_ENABLED(CONFIG_BLK_CGROUP) |
59 | SUBSYS(blkio) | 59 | SUBSYS(blkio) |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /* */ | 62 | /* */ |
63 | 63 | ||
64 | #ifdef CONFIG_CGROUP_PERF | 64 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_PERF) |
65 | SUBSYS(perf) | 65 | SUBSYS(perf) |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | /* */ | 68 | /* */ |
69 | 69 | ||
70 | #ifdef CONFIG_NETPRIO_CGROUP | 70 | #if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) |
71 | SUBSYS(net_prio) | 71 | SUBSYS(net_prio) |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | /* */ | 74 | /* */ |
75 | 75 | ||
76 | #ifdef CONFIG_CGROUP_HUGETLB | 76 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_HUGETLB) |
77 | SUBSYS(hugetlb) | 77 | SUBSYS(hugetlb) |
78 | #endif | 78 | #endif |
79 | 79 | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 77335fac943e..c12731582920 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ | 26 | #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ |
27 | #define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ | 27 | #define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ |
28 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ | 28 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ |
29 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ | ||
29 | 30 | ||
30 | struct clk_hw; | 31 | struct clk_hw; |
31 | 32 | ||
@@ -360,6 +361,11 @@ int of_clk_add_provider(struct device_node *np, | |||
360 | void of_clk_del_provider(struct device_node *np); | 361 | void of_clk_del_provider(struct device_node *np); |
361 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, | 362 | struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, |
362 | void *data); | 363 | void *data); |
364 | struct clk_onecell_data { | ||
365 | struct clk **clks; | ||
366 | unsigned int clk_num; | ||
367 | }; | ||
368 | struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); | ||
363 | const char *of_clk_get_parent_name(struct device_node *np, int index); | 369 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
364 | void of_clk_init(const struct of_device_id *matches); | 370 | void of_clk_init(const struct of_device_id *matches); |
365 | 371 | ||
diff --git a/include/linux/clk/bcm2835.h b/include/linux/clk/bcm2835.h new file mode 100644 index 000000000000..aa937f6c17da --- /dev/null +++ b/include/linux/clk/bcm2835.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Broadcom | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_CLK_BCM2835_H_ | ||
20 | #define __LINUX_CLK_BCM2835_H_ | ||
21 | |||
22 | void __init bcm2835_init_clocks(void); | ||
23 | |||
24 | #endif | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index acba894374a1..8a7096fcb01e 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -97,6 +97,8 @@ struct clock_event_device { | |||
97 | void (*broadcast)(const struct cpumask *mask); | 97 | void (*broadcast)(const struct cpumask *mask); |
98 | void (*set_mode)(enum clock_event_mode mode, | 98 | void (*set_mode)(enum clock_event_mode mode, |
99 | struct clock_event_device *); | 99 | struct clock_event_device *); |
100 | void (*suspend)(struct clock_event_device *); | ||
101 | void (*resume)(struct clock_event_device *); | ||
100 | unsigned long min_delta_ticks; | 102 | unsigned long min_delta_ticks; |
101 | unsigned long max_delta_ticks; | 103 | unsigned long max_delta_ticks; |
102 | 104 | ||
@@ -156,6 +158,9 @@ clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | |||
156 | freq, minsec); | 158 | freq, minsec); |
157 | } | 159 | } |
158 | 160 | ||
161 | extern void clockevents_suspend(void); | ||
162 | extern void clockevents_resume(void); | ||
163 | |||
159 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 164 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
160 | extern void clockevents_notify(unsigned long reason, void *arg); | 165 | extern void clockevents_notify(unsigned long reason, void *arg); |
161 | #else | 166 | #else |
@@ -164,6 +169,9 @@ extern void clockevents_notify(unsigned long reason, void *arg); | |||
164 | 169 | ||
165 | #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ | 170 | #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ |
166 | 171 | ||
172 | static inline void clockevents_suspend(void) {} | ||
173 | static inline void clockevents_resume(void) {} | ||
174 | |||
167 | #define clockevents_notify(reason, arg) do { } while (0) | 175 | #define clockevents_notify(reason, arg) do { } while (0) |
168 | 176 | ||
169 | #endif | 177 | #endif |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 09b28b7369d7..fd4e29956d1c 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -590,6 +590,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |||
590 | unsigned long liovcnt, const struct compat_iovec __user *rvec, | 590 | unsigned long liovcnt, const struct compat_iovec __user *rvec, |
591 | unsigned long riovcnt, unsigned long flags); | 591 | unsigned long riovcnt, unsigned long flags); |
592 | 592 | ||
593 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | ||
594 | compat_off_t __user *offset, compat_size_t count); | ||
595 | |||
593 | #else | 596 | #else |
594 | 597 | ||
595 | #define is_compat_task() (0) | 598 | #define is_compat_task() (0) |
diff --git a/include/linux/comstats.h b/include/linux/comstats.h deleted file mode 100644 index 3f5ea8e8026d..000000000000 --- a/include/linux/comstats.h +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * comstats.h -- Serial Port Stats. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | /*****************************************************************************/ | ||
25 | #ifndef _COMSTATS_H | ||
26 | #define _COMSTATS_H | ||
27 | /*****************************************************************************/ | ||
28 | |||
29 | /* | ||
30 | * Serial port stats structure. The structure itself is UART | ||
31 | * independent, but some fields may be UART/driver specific (for | ||
32 | * example state). | ||
33 | */ | ||
34 | |||
35 | typedef struct { | ||
36 | unsigned long brd; | ||
37 | unsigned long panel; | ||
38 | unsigned long port; | ||
39 | unsigned long hwid; | ||
40 | unsigned long type; | ||
41 | unsigned long txtotal; | ||
42 | unsigned long rxtotal; | ||
43 | unsigned long txbuffered; | ||
44 | unsigned long rxbuffered; | ||
45 | unsigned long rxoverrun; | ||
46 | unsigned long rxparity; | ||
47 | unsigned long rxframing; | ||
48 | unsigned long rxlost; | ||
49 | unsigned long txbreaks; | ||
50 | unsigned long rxbreaks; | ||
51 | unsigned long txxon; | ||
52 | unsigned long txxoff; | ||
53 | unsigned long rxxon; | ||
54 | unsigned long rxxoff; | ||
55 | unsigned long txctson; | ||
56 | unsigned long txctsoff; | ||
57 | unsigned long rxrtson; | ||
58 | unsigned long rxrtsoff; | ||
59 | unsigned long modem; | ||
60 | unsigned long state; | ||
61 | unsigned long flags; | ||
62 | unsigned long ttystate; | ||
63 | unsigned long cflags; | ||
64 | unsigned long iflags; | ||
65 | unsigned long oflags; | ||
66 | unsigned long lflags; | ||
67 | unsigned long signals; | ||
68 | } comstats_t; | ||
69 | |||
70 | |||
71 | /* | ||
72 | * Board stats structure. Returns useful info about the board. | ||
73 | */ | ||
74 | |||
75 | #define COM_MAXPANELS 8 | ||
76 | |||
77 | typedef struct { | ||
78 | unsigned long panel; | ||
79 | unsigned long type; | ||
80 | unsigned long hwid; | ||
81 | unsigned long nrports; | ||
82 | } companel_t; | ||
83 | |||
84 | typedef struct { | ||
85 | unsigned long brd; | ||
86 | unsigned long type; | ||
87 | unsigned long hwid; | ||
88 | unsigned long state; | ||
89 | unsigned long ioaddr; | ||
90 | unsigned long ioaddr2; | ||
91 | unsigned long memaddr; | ||
92 | unsigned long irq; | ||
93 | unsigned long nrpanels; | ||
94 | unsigned long nrports; | ||
95 | companel_t panels[COM_MAXPANELS]; | ||
96 | } combrd_t; | ||
97 | |||
98 | |||
99 | /* | ||
100 | * Define the ioctl operations for stats stuff. | ||
101 | */ | ||
102 | #include <linux/ioctl.h> | ||
103 | |||
104 | #define COM_GETPORTSTATS _IO('c',30) | ||
105 | #define COM_CLRPORTSTATS _IO('c',31) | ||
106 | #define COM_GETBRDSTATS _IO('c',32) | ||
107 | |||
108 | |||
109 | /* | ||
110 | * Define the set of ioctls that give user level access to the | ||
111 | * private port, panel and board structures. The argument required | ||
112 | * will be driver dependent! | ||
113 | */ | ||
114 | #define COM_READPORT _IO('c',40) | ||
115 | #define COM_READBOARD _IO('c',41) | ||
116 | #define COM_READPANEL _IO('c',42) | ||
117 | |||
118 | /*****************************************************************************/ | ||
119 | #endif | ||
diff --git a/include/linux/crush/mapper.h b/include/linux/crush/mapper.h index 71d79f44a7d0..5772dee3ecbf 100644 --- a/include/linux/crush/mapper.h +++ b/include/linux/crush/mapper.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * LGPL2 | 8 | * LGPL2 |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include "crush.h" | 11 | #include <linux/crush/crush.h> |
12 | 12 | ||
13 | extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size); | 13 | extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, int size); |
14 | extern int crush_do_rule(const struct crush_map *map, | 14 | extern int crush_do_rule(const struct crush_map *map, |
diff --git a/include/linux/device.h b/include/linux/device.h index 52a5f15a2223..86ef6ab553b1 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -536,6 +536,10 @@ extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp, | |||
536 | #else | 536 | #else |
537 | extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); | 537 | extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); |
538 | #endif | 538 | #endif |
539 | extern void devres_for_each_res(struct device *dev, dr_release_t release, | ||
540 | dr_match_t match, void *match_data, | ||
541 | void (*fn)(struct device *, void *, void *), | ||
542 | void *data); | ||
539 | extern void devres_free(void *res); | 543 | extern void devres_free(void *res); |
540 | extern void devres_add(struct device *dev, void *res); | 544 | extern void devres_add(struct device *dev, void *res); |
541 | extern void *devres_find(struct device *dev, dr_release_t release, | 545 | extern void *devres_find(struct device *dev, dr_release_t release, |
@@ -772,6 +776,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable) | |||
772 | dev->power.ignore_children = enable; | 776 | dev->power.ignore_children = enable; |
773 | } | 777 | } |
774 | 778 | ||
779 | static inline void dev_pm_syscore_device(struct device *dev, bool val) | ||
780 | { | ||
781 | #ifdef CONFIG_PM_SLEEP | ||
782 | dev->power.syscore = val; | ||
783 | #endif | ||
784 | } | ||
785 | |||
775 | static inline void device_lock(struct device *dev) | 786 | static inline void device_lock(struct device *dev) |
776 | { | 787 | { |
777 | mutex_lock(&dev->mutex); | 788 | mutex_lock(&dev->mutex); |
@@ -891,12 +902,15 @@ extern const char *dev_driver_string(const struct device *dev); | |||
891 | 902 | ||
892 | #ifdef CONFIG_PRINTK | 903 | #ifdef CONFIG_PRINTK |
893 | 904 | ||
894 | extern int __dev_printk(const char *level, const struct device *dev, | 905 | extern __printf(3, 0) |
895 | struct va_format *vaf); | 906 | int dev_vprintk_emit(int level, const struct device *dev, |
907 | const char *fmt, va_list args); | ||
908 | extern __printf(3, 4) | ||
909 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); | ||
910 | |||
896 | extern __printf(3, 4) | 911 | extern __printf(3, 4) |
897 | int dev_printk(const char *level, const struct device *dev, | 912 | int dev_printk(const char *level, const struct device *dev, |
898 | const char *fmt, ...) | 913 | const char *fmt, ...); |
899 | ; | ||
900 | extern __printf(2, 3) | 914 | extern __printf(2, 3) |
901 | int dev_emerg(const struct device *dev, const char *fmt, ...); | 915 | int dev_emerg(const struct device *dev, const char *fmt, ...); |
902 | extern __printf(2, 3) | 916 | extern __printf(2, 3) |
@@ -914,6 +928,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...); | |||
914 | 928 | ||
915 | #else | 929 | #else |
916 | 930 | ||
931 | static inline __printf(3, 0) | ||
932 | int dev_vprintk_emit(int level, const struct device *dev, | ||
933 | const char *fmt, va_list args) | ||
934 | { return 0; } | ||
935 | static inline __printf(3, 4) | ||
936 | int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) | ||
937 | { return 0; } | ||
938 | |||
917 | static inline int __dev_printk(const char *level, const struct device *dev, | 939 | static inline int __dev_printk(const char *level, const struct device *dev, |
918 | struct va_format *vaf) | 940 | struct va_format *vaf) |
919 | { return 0; } | 941 | { return 0; } |
@@ -946,6 +968,32 @@ int _dev_info(const struct device *dev, const char *fmt, ...) | |||
946 | 968 | ||
947 | #endif | 969 | #endif |
948 | 970 | ||
971 | /* | ||
972 | * Stupid hackaround for existing uses of non-printk uses dev_info | ||
973 | * | ||
974 | * Note that the definition of dev_info below is actually _dev_info | ||
975 | * and a macro is used to avoid redefining dev_info | ||
976 | */ | ||
977 | |||
978 | #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) | ||
979 | |||
980 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
981 | #define dev_dbg(dev, format, ...) \ | ||
982 | do { \ | ||
983 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
984 | } while (0) | ||
985 | #elif defined(DEBUG) | ||
986 | #define dev_dbg(dev, format, arg...) \ | ||
987 | dev_printk(KERN_DEBUG, dev, format, ##arg) | ||
988 | #else | ||
989 | #define dev_dbg(dev, format, arg...) \ | ||
990 | ({ \ | ||
991 | if (0) \ | ||
992 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
993 | 0; \ | ||
994 | }) | ||
995 | #endif | ||
996 | |||
949 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ | 997 | #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ |
950 | do { \ | 998 | do { \ |
951 | static DEFINE_RATELIMIT_STATE(_rs, \ | 999 | static DEFINE_RATELIMIT_STATE(_rs, \ |
@@ -969,33 +1017,21 @@ do { \ | |||
969 | dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) | 1017 | dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) |
970 | #define dev_info_ratelimited(dev, fmt, ...) \ | 1018 | #define dev_info_ratelimited(dev, fmt, ...) \ |
971 | dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) | 1019 | dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) |
1020 | #if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) | ||
972 | #define dev_dbg_ratelimited(dev, fmt, ...) \ | 1021 | #define dev_dbg_ratelimited(dev, fmt, ...) \ |
973 | dev_level_ratelimited(dev_dbg, dev, fmt, ##__VA_ARGS__) | 1022 | do { \ |
974 | 1023 | static DEFINE_RATELIMIT_STATE(_rs, \ | |
975 | /* | 1024 | DEFAULT_RATELIMIT_INTERVAL, \ |
976 | * Stupid hackaround for existing uses of non-printk uses dev_info | 1025 | DEFAULT_RATELIMIT_BURST); \ |
977 | * | 1026 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ |
978 | * Note that the definition of dev_info below is actually _dev_info | 1027 | if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ |
979 | * and a macro is used to avoid redefining dev_info | 1028 | __ratelimit(&_rs)) \ |
980 | */ | 1029 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ |
981 | 1030 | ##__VA_ARGS__); \ | |
982 | #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) | ||
983 | |||
984 | #if defined(CONFIG_DYNAMIC_DEBUG) | ||
985 | #define dev_dbg(dev, format, ...) \ | ||
986 | do { \ | ||
987 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | ||
988 | } while (0) | 1031 | } while (0) |
989 | #elif defined(DEBUG) | ||
990 | #define dev_dbg(dev, format, arg...) \ | ||
991 | dev_printk(KERN_DEBUG, dev, format, ##arg) | ||
992 | #else | 1032 | #else |
993 | #define dev_dbg(dev, format, arg...) \ | 1033 | #define dev_dbg_ratelimited(dev, fmt, ...) \ |
994 | ({ \ | 1034 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
995 | if (0) \ | ||
996 | dev_printk(KERN_DEBUG, dev, format, ##arg); \ | ||
997 | 0; \ | ||
998 | }) | ||
999 | #endif | 1035 | #endif |
1000 | 1036 | ||
1001 | #ifdef VERBOSE_DEBUG | 1037 | #ifdef VERBOSE_DEBUG |
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h index 81f52f2c5724..82de1f9e48b1 100644 --- a/include/linux/drbd_tag_magic.h +++ b/include/linux/drbd_tag_magic.h | |||
@@ -12,7 +12,7 @@ enum packet_types { | |||
12 | #define NL_INT64(pn, pr, member) | 12 | #define NL_INT64(pn, pr, member) |
13 | #define NL_BIT(pn, pr, member) | 13 | #define NL_BIT(pn, pr, member) |
14 | #define NL_STRING(pn, pr, member, len) | 14 | #define NL_STRING(pn, pr, member, len) |
15 | #include "drbd_nl.h" | 15 | #include <linux/drbd_nl.h> |
16 | P_nl_after_last_packet, | 16 | P_nl_after_last_packet, |
17 | }; | 17 | }; |
18 | 18 | ||
@@ -37,7 +37,7 @@ static const int tag_list_sizes[] = { | |||
37 | #define NL_INT64(pn, pr, member) + 4 + 8 | 37 | #define NL_INT64(pn, pr, member) + 4 + 8 |
38 | #define NL_BIT(pn, pr, member) + 4 + 1 | 38 | #define NL_BIT(pn, pr, member) + 4 + 1 |
39 | #define NL_STRING(pn, pr, member, len) + 4 + (len) | 39 | #define NL_STRING(pn, pr, member, len) + 4 + (len) |
40 | #include "drbd_nl.h" | 40 | #include <linux/drbd_nl.h> |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* The two highest bits are used for the tag type */ | 43 | /* The two highest bits are used for the tag type */ |
@@ -62,7 +62,7 @@ enum drbd_tags { | |||
62 | #define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr , | 62 | #define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr , |
63 | #define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr , | 63 | #define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr , |
64 | #define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr , | 64 | #define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr , |
65 | #include "drbd_nl.h" | 65 | #include <linux/drbd_nl.h> |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct tag { | 68 | struct tag { |
@@ -78,7 +78,7 @@ static const struct tag tag_descriptions[] = { | |||
78 | #define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) }, | 78 | #define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) }, |
79 | #define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) }, | 79 | #define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) }, |
80 | #define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) }, | 80 | #define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) }, |
81 | #include "drbd_nl.h" | 81 | #include <linux/drbd_nl.h> |
82 | }; | 82 | }; |
83 | 83 | ||
84 | #endif | 84 | #endif |
diff --git a/include/linux/efi-bgrt.h b/include/linux/efi-bgrt.h new file mode 100644 index 000000000000..051b21fedf68 --- /dev/null +++ b/include/linux/efi-bgrt.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef _LINUX_EFI_BGRT_H | ||
2 | #define _LINUX_EFI_BGRT_H | ||
3 | |||
4 | #ifdef CONFIG_ACPI_BGRT | ||
5 | |||
6 | #include <linux/acpi.h> | ||
7 | |||
8 | void efi_bgrt_init(void); | ||
9 | |||
10 | /* The BGRT data itself; only valid if bgrt_image != NULL. */ | ||
11 | extern void *bgrt_image; | ||
12 | extern size_t bgrt_image_size; | ||
13 | extern struct acpi_table_bgrt *bgrt_tab; | ||
14 | |||
15 | #else /* !CONFIG_ACPI_BGRT */ | ||
16 | |||
17 | static inline void efi_bgrt_init(void) {} | ||
18 | |||
19 | #endif /* !CONFIG_ACPI_BGRT */ | ||
20 | |||
21 | #endif /* _LINUX_EFI_BGRT_H */ | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index ec45ccd8708a..8670eb1eb8cd 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -496,6 +496,14 @@ extern void efi_map_pal_code (void); | |||
496 | extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); | 496 | extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); |
497 | extern void efi_gettimeofday (struct timespec *ts); | 497 | extern void efi_gettimeofday (struct timespec *ts); |
498 | extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ | 498 | extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ |
499 | #ifdef CONFIG_X86 | ||
500 | extern void efi_late_init(void); | ||
501 | extern void efi_free_boot_services(void); | ||
502 | #else | ||
503 | static inline void efi_late_init(void) {} | ||
504 | static inline void efi_free_boot_services(void) {} | ||
505 | #endif | ||
506 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | ||
499 | extern u64 efi_get_iobase (void); | 507 | extern u64 efi_get_iobase (void); |
500 | extern u32 efi_mem_type (unsigned long phys_addr); | 508 | extern u32 efi_mem_type (unsigned long phys_addr); |
501 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 509 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 999b4f52e8e5..0a05051a8924 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -387,7 +387,11 @@ typedef struct elf64_shdr { | |||
387 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | 387 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ |
388 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ | 388 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ |
389 | #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ | 389 | #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ |
390 | #define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */ | ||
390 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ | 391 | #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ |
392 | #define NT_ARM_TLS 0x401 /* ARM TLS register */ | ||
393 | #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ | ||
394 | #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ | ||
391 | 395 | ||
392 | 396 | ||
393 | /* Note header in a PT_NOTE section */ | 397 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index d426336d92d9..b006ba0a9f42 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -151,6 +151,17 @@ static inline void eth_broadcast_addr(u8 *addr) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * eth_zero_addr - Assign zero address | ||
155 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
156 | * | ||
157 | * Assign the zero address to the given address array. | ||
158 | */ | ||
159 | static inline void eth_zero_addr(u8 *addr) | ||
160 | { | ||
161 | memset(addr, 0x00, ETH_ALEN); | ||
162 | } | ||
163 | |||
164 | /** | ||
154 | * eth_hw_addr_random - Generate software assigned random Ethernet and | 165 | * eth_hw_addr_random - Generate software assigned random Ethernet and |
155 | * set device flag | 166 | * set device flag |
156 | * @dev: pointer to net_device structure | 167 | * @dev: pointer to net_device structure |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 21eff418091b..fcb4f8e60c1c 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -45,8 +45,10 @@ struct ethtool_cmd { | |||
45 | * bits) in Mbps. Please use | 45 | * bits) in Mbps. Please use |
46 | * ethtool_cmd_speed()/_set() to | 46 | * ethtool_cmd_speed()/_set() to |
47 | * access it */ | 47 | * access it */ |
48 | __u8 eth_tp_mdix; | 48 | __u8 eth_tp_mdix; /* twisted pair MDI-X status */ |
49 | __u8 reserved2; | 49 | __u8 eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set, |
50 | * link should be renegotiated if necessary | ||
51 | */ | ||
50 | __u32 lp_advertising; /* Features the link partner advertises */ | 52 | __u32 lp_advertising; /* Features the link partner advertises */ |
51 | __u32 reserved[2]; | 53 | __u32 reserved[2]; |
52 | }; | 54 | }; |
@@ -1229,10 +1231,13 @@ struct ethtool_ops { | |||
1229 | #define AUTONEG_DISABLE 0x00 | 1231 | #define AUTONEG_DISABLE 0x00 |
1230 | #define AUTONEG_ENABLE 0x01 | 1232 | #define AUTONEG_ENABLE 0x01 |
1231 | 1233 | ||
1232 | /* Mode MDI or MDI-X */ | 1234 | /* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then |
1233 | #define ETH_TP_MDI_INVALID 0x00 | 1235 | * the driver is required to renegotiate link |
1234 | #define ETH_TP_MDI 0x01 | 1236 | */ |
1235 | #define ETH_TP_MDI_X 0x02 | 1237 | #define ETH_TP_MDI_INVALID 0x00 /* status: unknown; control: unsupported */ |
1238 | #define ETH_TP_MDI 0x01 /* status: MDI; control: force MDI */ | ||
1239 | #define ETH_TP_MDI_X 0x02 /* status: MDI-X; control: force MDI-X */ | ||
1240 | #define ETH_TP_MDI_AUTO 0x03 /* control: auto-select */ | ||
1236 | 1241 | ||
1237 | /* Wake-On-Lan options. */ | 1242 | /* Wake-On-Lan options. */ |
1238 | #define WAKE_PHY (1 << 0) | 1243 | #define WAKE_PHY (1 << 0) |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index cdd401477656..7443a560c9d0 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
@@ -30,19 +30,19 @@ | |||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * The standard cable name is to help support general notifier | 32 | * The standard cable name is to help support general notifier |
33 | * and notifee device drivers to share the common names. | 33 | * and notifiee device drivers to share the common names. |
34 | * Please use standard cable names unless your notifier device has | 34 | * Please use standard cable names unless your notifier device has |
35 | * a very unique and abnormal cable or | 35 | * a very unique and abnormal cable or |
36 | * the cable type is supposed to be used with only one unique | 36 | * the cable type is supposed to be used with only one unique |
37 | * pair of notifier/notifee devices. | 37 | * pair of notifier/notifiee devices. |
38 | * | 38 | * |
39 | * Please add any other "standard" cables used with extcon dev. | 39 | * Please add any other "standard" cables used with extcon dev. |
40 | * | 40 | * |
41 | * You may add a dot and number to specify version or specification | 41 | * You may add a dot and number to specify version or specification |
42 | * of the specific cable if it is required. (e.g., "Fast-charger.18" | 42 | * of the specific cable if it is required. (e.g., "Fast-charger.18" |
43 | * and "Fast-charger.10" for 1.8A and 1.0A chargers) | 43 | * and "Fast-charger.10" for 1.8A and 1.0A chargers) |
44 | * However, the notifee and notifier should be able to handle such | 44 | * However, the notifiee and notifier should be able to handle such |
45 | * string and if the notifee can negotiate the protocol or idenify, | 45 | * string and if the notifiee can negotiate the protocol or identify, |
46 | * you don't need such convention. This convention is helpful when | 46 | * you don't need such convention. This convention is helpful when |
47 | * notifier can distinguish but notifiee cannot. | 47 | * notifier can distinguish but notifiee cannot. |
48 | */ | 48 | */ |
@@ -76,7 +76,7 @@ struct extcon_cable; | |||
76 | * struct extcon_dev - An extcon device represents one external connector. | 76 | * struct extcon_dev - An extcon device represents one external connector. |
77 | * @name The name of this extcon device. Parent device name is used | 77 | * @name The name of this extcon device. Parent device name is used |
78 | * if NULL. | 78 | * if NULL. |
79 | * @supported_cable Array of supported cable name ending with NULL. | 79 | * @supported_cable Array of supported cable names ending with NULL. |
80 | * If supported_cable is NULL, cable name related APIs | 80 | * If supported_cable is NULL, cable name related APIs |
81 | * are disabled. | 81 | * are disabled. |
82 | * @mutually_exclusive Array of mutually exclusive set of cables that cannot | 82 | * @mutually_exclusive Array of mutually exclusive set of cables that cannot |
@@ -95,7 +95,7 @@ struct extcon_cable; | |||
95 | * @state Attach/detach state of this extcon. Do not provide at | 95 | * @state Attach/detach state of this extcon. Do not provide at |
96 | * register-time | 96 | * register-time |
97 | * @nh Notifier for the state change events from this extcon | 97 | * @nh Notifier for the state change events from this extcon |
98 | * @entry To support list of extcon devices so that uses can search | 98 | * @entry To support list of extcon devices so that users can search |
99 | * for extcon devices based on the extcon name. | 99 | * for extcon devices based on the extcon name. |
100 | * @lock | 100 | * @lock |
101 | * @max_supported Internal value to store the number of cables. | 101 | * @max_supported Internal value to store the number of cables. |
@@ -199,7 +199,7 @@ extern int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state); | |||
199 | /* | 199 | /* |
200 | * get/set_cable_state access each bit of the 32b encoded state value. | 200 | * get/set_cable_state access each bit of the 32b encoded state value. |
201 | * They are used to access the status of each cable based on the cable_name | 201 | * They are used to access the status of each cable based on the cable_name |
202 | * or cable_index, which is retrived by extcon_find_cable_index | 202 | * or cable_index, which is retrieved by extcon_find_cable_index |
203 | */ | 203 | */ |
204 | extern int extcon_find_cable_index(struct extcon_dev *sdev, | 204 | extern int extcon_find_cable_index(struct extcon_dev *sdev, |
205 | const char *cable_name); | 205 | const char *cable_name); |
@@ -226,9 +226,9 @@ extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb); | |||
226 | 226 | ||
227 | /* | 227 | /* |
228 | * Following APIs are to monitor every action of a notifier. | 228 | * Following APIs are to monitor every action of a notifier. |
229 | * Registerer gets notified for every external port of a connection device. | 229 | * Registrar gets notified for every external port of a connection device. |
230 | * Probably this could be used to debug an action of notifier; however, | 230 | * Probably this could be used to debug an action of notifier; however, |
231 | * we do not recommend to use this at normal 'notifiee' device drivers who | 231 | * we do not recommend to use this for normal 'notifiee' device drivers who |
232 | * want to be notified by a specific external port of the notifier. | 232 | * want to be notified by a specific external port of the notifier. |
233 | */ | 233 | */ |
234 | extern int extcon_register_notifier(struct extcon_dev *edev, | 234 | extern int extcon_register_notifier(struct extcon_dev *edev, |
diff --git a/include/linux/extcon/extcon-adc-jack.h b/include/linux/extcon/extcon-adc-jack.h new file mode 100644 index 000000000000..20e9eef25d4c --- /dev/null +++ b/include/linux/extcon/extcon-adc-jack.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * include/linux/extcon/extcon-adc-jack.h | ||
3 | * | ||
4 | * Analog Jack extcon driver with ADC-based detection capability. | ||
5 | * | ||
6 | * Copyright (C) 2012 Samsung Electronics | ||
7 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef _EXTCON_ADC_JACK_H_ | ||
16 | #define _EXTCON_ADC_JACK_H_ __FILE__ | ||
17 | |||
18 | #include <linux/module.h> | ||
19 | #include <linux/extcon.h> | ||
20 | |||
21 | /** | ||
22 | * struct adc_jack_cond - condition to use an extcon state | ||
23 | * @state - the corresponding extcon state (if 0, this struct denotes | ||
24 | * the last adc_jack_cond element among the array) | ||
25 | * @min_adc - min adc value for this condition | ||
26 | * @max_adc - max adc value for this condition | ||
27 | * | ||
28 | * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means | ||
29 | * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and | ||
30 | * 1 are attached (1<<0 | 1<<1 == 0x3) | ||
31 | * | ||
32 | * Note that you don't need to describe condition for "no cable attached" | ||
33 | * because when no adc_jack_cond is met, state = 0 is automatically chosen. | ||
34 | */ | ||
35 | struct adc_jack_cond { | ||
36 | u32 state; /* extcon state value. 0 if invalid */ | ||
37 | u32 min_adc; | ||
38 | u32 max_adc; | ||
39 | }; | ||
40 | |||
41 | /** | ||
42 | * struct adc_jack_pdata - platform data for adc jack device. | ||
43 | * @name - name of the extcon device. If null, "adc-jack" is used. | ||
44 | * @consumer_channel - Unique name to identify the channel on the consumer | ||
45 | * side. This typically describes the channels used within | ||
46 | * the consumer. E.g. 'battery_voltage' | ||
47 | * @cable_names - array of cable names ending with null. | ||
48 | * @adc_contitions - array of struct adc_jack_cond conditions ending | ||
49 | * with .state = 0 entry. This describes how to decode | ||
50 | * adc values into extcon state. | ||
51 | * @irq_flags - irq flags used for the @irq | ||
52 | * @handling_delay_ms - in some devices, we need to read ADC value some | ||
53 | * milli-seconds after the interrupt occurs. You may | ||
54 | * describe such delays with @handling_delay_ms, which | ||
55 | * is rounded-off by jiffies. | ||
56 | */ | ||
57 | struct adc_jack_pdata { | ||
58 | const char *name; | ||
59 | const char *consumer_channel; | ||
60 | /* | ||
61 | * The last entry should be NULL | ||
62 | */ | ||
63 | const char **cable_names; | ||
64 | /* The last entry's state should be 0 */ | ||
65 | struct adc_jack_cond *adc_conditions; | ||
66 | |||
67 | unsigned long irq_flags; | ||
68 | unsigned long handling_delay_ms; /* in ms */ | ||
69 | }; | ||
70 | |||
71 | #endif /* _EXTCON_ADC_JACK_H */ | ||
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 158a41eed314..45052aa814c8 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -30,31 +30,11 @@ struct fdtable { | |||
30 | struct fdtable *next; | 30 | struct fdtable *next; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static inline void __set_close_on_exec(int fd, struct fdtable *fdt) | ||
34 | { | ||
35 | __set_bit(fd, fdt->close_on_exec); | ||
36 | } | ||
37 | |||
38 | static inline void __clear_close_on_exec(int fd, struct fdtable *fdt) | ||
39 | { | ||
40 | __clear_bit(fd, fdt->close_on_exec); | ||
41 | } | ||
42 | |||
43 | static inline bool close_on_exec(int fd, const struct fdtable *fdt) | 33 | static inline bool close_on_exec(int fd, const struct fdtable *fdt) |
44 | { | 34 | { |
45 | return test_bit(fd, fdt->close_on_exec); | 35 | return test_bit(fd, fdt->close_on_exec); |
46 | } | 36 | } |
47 | 37 | ||
48 | static inline void __set_open_fd(int fd, struct fdtable *fdt) | ||
49 | { | ||
50 | __set_bit(fd, fdt->open_fds); | ||
51 | } | ||
52 | |||
53 | static inline void __clear_open_fd(int fd, struct fdtable *fdt) | ||
54 | { | ||
55 | __clear_bit(fd, fdt->open_fds); | ||
56 | } | ||
57 | |||
58 | static inline bool fd_is_open(int fd, const struct fdtable *fdt) | 38 | static inline bool fd_is_open(int fd, const struct fdtable *fdt) |
59 | { | 39 | { |
60 | return test_bit(fd, fdt->open_fds); | 40 | return test_bit(fd, fdt->open_fds); |
@@ -93,15 +73,8 @@ struct file_operations; | |||
93 | struct vfsmount; | 73 | struct vfsmount; |
94 | struct dentry; | 74 | struct dentry; |
95 | 75 | ||
96 | extern int expand_files(struct files_struct *, int nr); | ||
97 | extern void free_fdtable_rcu(struct rcu_head *rcu); | ||
98 | extern void __init files_defer_init(void); | 76 | extern void __init files_defer_init(void); |
99 | 77 | ||
100 | static inline void free_fdtable(struct fdtable *fdt) | ||
101 | { | ||
102 | call_rcu(&fdt->rcu, free_fdtable_rcu); | ||
103 | } | ||
104 | |||
105 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) | 78 | static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) |
106 | { | 79 | { |
107 | struct file * file = NULL; | 80 | struct file * file = NULL; |
@@ -122,8 +95,20 @@ struct task_struct; | |||
122 | struct files_struct *get_files_struct(struct task_struct *); | 95 | struct files_struct *get_files_struct(struct task_struct *); |
123 | void put_files_struct(struct files_struct *fs); | 96 | void put_files_struct(struct files_struct *fs); |
124 | void reset_files_struct(struct files_struct *); | 97 | void reset_files_struct(struct files_struct *); |
98 | void daemonize_descriptors(void); | ||
125 | int unshare_files(struct files_struct **); | 99 | int unshare_files(struct files_struct **); |
126 | struct files_struct *dup_fd(struct files_struct *, int *); | 100 | struct files_struct *dup_fd(struct files_struct *, int *); |
101 | void do_close_on_exec(struct files_struct *); | ||
102 | int iterate_fd(struct files_struct *, unsigned, | ||
103 | int (*)(const void *, struct file *, unsigned), | ||
104 | const void *); | ||
105 | |||
106 | extern int __alloc_fd(struct files_struct *files, | ||
107 | unsigned start, unsigned end, unsigned flags); | ||
108 | extern void __fd_install(struct files_struct *files, | ||
109 | unsigned int fd, struct file *file); | ||
110 | extern int __close_fd(struct files_struct *files, | ||
111 | unsigned int fd); | ||
127 | 112 | ||
128 | extern struct kmem_cache *files_cachep; | 113 | extern struct kmem_cache *files_cachep; |
129 | 114 | ||
diff --git a/include/linux/file.h b/include/linux/file.h index a22408bac0d0..cbacf4faf447 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -26,15 +26,44 @@ static inline void fput_light(struct file *file, int fput_needed) | |||
26 | fput(file); | 26 | fput(file); |
27 | } | 27 | } |
28 | 28 | ||
29 | struct fd { | ||
30 | struct file *file; | ||
31 | int need_put; | ||
32 | }; | ||
33 | |||
34 | static inline void fdput(struct fd fd) | ||
35 | { | ||
36 | if (fd.need_put) | ||
37 | fput(fd.file); | ||
38 | } | ||
39 | |||
29 | extern struct file *fget(unsigned int fd); | 40 | extern struct file *fget(unsigned int fd); |
30 | extern struct file *fget_light(unsigned int fd, int *fput_needed); | 41 | extern struct file *fget_light(unsigned int fd, int *fput_needed); |
42 | |||
43 | static inline struct fd fdget(unsigned int fd) | ||
44 | { | ||
45 | int b; | ||
46 | struct file *f = fget_light(fd, &b); | ||
47 | return (struct fd){f,b}; | ||
48 | } | ||
49 | |||
31 | extern struct file *fget_raw(unsigned int fd); | 50 | extern struct file *fget_raw(unsigned int fd); |
32 | extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); | 51 | extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); |
52 | |||
53 | static inline struct fd fdget_raw(unsigned int fd) | ||
54 | { | ||
55 | int b; | ||
56 | struct file *f = fget_raw_light(fd, &b); | ||
57 | return (struct fd){f,b}; | ||
58 | } | ||
59 | |||
60 | extern int f_dupfd(unsigned int from, struct file *file, unsigned flags); | ||
61 | extern int replace_fd(unsigned fd, struct file *file, unsigned flags); | ||
33 | extern void set_close_on_exec(unsigned int fd, int flag); | 62 | extern void set_close_on_exec(unsigned int fd, int flag); |
63 | extern bool get_close_on_exec(unsigned int fd); | ||
34 | extern void put_filp(struct file *); | 64 | extern void put_filp(struct file *); |
35 | extern int alloc_fd(unsigned start, unsigned flags); | 65 | extern int get_unused_fd_flags(unsigned flags); |
36 | extern int get_unused_fd(void); | 66 | #define get_unused_fd() get_unused_fd_flags(0) |
37 | #define get_unused_fd_flags(flags) alloc_fd(0, (flags)) | ||
38 | extern void put_unused_fd(unsigned int fd); | 67 | extern void put_unused_fd(unsigned int fd); |
39 | 68 | ||
40 | extern void fd_install(unsigned int fd, struct file *file); | 69 | extern void fd_install(unsigned int fd, struct file *file); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 82b01357af8b..2ded090e10f4 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -74,6 +74,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
74 | #define BPF_LSH 0x60 | 74 | #define BPF_LSH 0x60 |
75 | #define BPF_RSH 0x70 | 75 | #define BPF_RSH 0x70 |
76 | #define BPF_NEG 0x80 | 76 | #define BPF_NEG 0x80 |
77 | #define BPF_MOD 0x90 | ||
78 | #define BPF_XOR 0xa0 | ||
79 | |||
77 | #define BPF_JA 0x00 | 80 | #define BPF_JA 0x00 |
78 | #define BPF_JEQ 0x10 | 81 | #define BPF_JEQ 0x10 |
79 | #define BPF_JGT 0x20 | 82 | #define BPF_JGT 0x20 |
@@ -196,10 +199,14 @@ enum { | |||
196 | BPF_S_ALU_MUL_K, | 199 | BPF_S_ALU_MUL_K, |
197 | BPF_S_ALU_MUL_X, | 200 | BPF_S_ALU_MUL_X, |
198 | BPF_S_ALU_DIV_X, | 201 | BPF_S_ALU_DIV_X, |
202 | BPF_S_ALU_MOD_K, | ||
203 | BPF_S_ALU_MOD_X, | ||
199 | BPF_S_ALU_AND_K, | 204 | BPF_S_ALU_AND_K, |
200 | BPF_S_ALU_AND_X, | 205 | BPF_S_ALU_AND_X, |
201 | BPF_S_ALU_OR_K, | 206 | BPF_S_ALU_OR_K, |
202 | BPF_S_ALU_OR_X, | 207 | BPF_S_ALU_OR_X, |
208 | BPF_S_ALU_XOR_K, | ||
209 | BPF_S_ALU_XOR_X, | ||
203 | BPF_S_ALU_LSH_K, | 210 | BPF_S_ALU_LSH_K, |
204 | BPF_S_ALU_LSH_X, | 211 | BPF_S_ALU_LSH_X, |
205 | BPF_S_ALU_RSH_K, | 212 | BPF_S_ALU_RSH_K, |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index db04ec5121cb..191501afd7fb 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -265,8 +265,16 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
265 | void *data, size_t length, | 265 | void *data, size_t length, |
266 | void *callback_data); | 266 | void *callback_data); |
267 | /* | 267 | /* |
268 | * Important note: Except for the FCP registers, the callback must guarantee | 268 | * This callback handles an inbound request subaction. It is called in |
269 | * that either fw_send_response() or kfree() is called on the @request. | 269 | * RCU read-side context, therefore must not sleep. |
270 | * | ||
271 | * The callback should not initiate outbound request subactions directly. | ||
272 | * Otherwise there is a danger of recursion of inbound and outbound | ||
273 | * transactions from and to the local node. | ||
274 | * | ||
275 | * The callback is responsible that either fw_send_response() or kfree() | ||
276 | * is called on the @request, except for FCP registers for which the core | ||
277 | * takes care of that. | ||
270 | */ | 278 | */ |
271 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 279 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
272 | struct fw_request *request, | 280 | struct fw_request *request, |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 1e7c01189fa6..e4279fedb93a 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -12,6 +12,9 @@ struct firmware { | |||
12 | size_t size; | 12 | size_t size; |
13 | const u8 *data; | 13 | const u8 *data; |
14 | struct page **pages; | 14 | struct page **pages; |
15 | |||
16 | /* firmware loader private fields */ | ||
17 | void *priv; | ||
15 | }; | 18 | }; |
16 | 19 | ||
17 | struct module; | 20 | struct module; |
@@ -44,6 +47,8 @@ int request_firmware_nowait( | |||
44 | void (*cont)(const struct firmware *fw, void *context)); | 47 | void (*cont)(const struct firmware *fw, void *context)); |
45 | 48 | ||
46 | void release_firmware(const struct firmware *fw); | 49 | void release_firmware(const struct firmware *fw); |
50 | int cache_firmware(const char *name); | ||
51 | int uncache_firmware(const char *name); | ||
47 | #else | 52 | #else |
48 | static inline int request_firmware(const struct firmware **fw, | 53 | static inline int request_firmware(const struct firmware **fw, |
49 | const char *name, | 54 | const char *name, |
@@ -62,6 +67,16 @@ static inline int request_firmware_nowait( | |||
62 | static inline void release_firmware(const struct firmware *fw) | 67 | static inline void release_firmware(const struct firmware *fw) |
63 | { | 68 | { |
64 | } | 69 | } |
70 | |||
71 | static inline int cache_firmware(const char *name) | ||
72 | { | ||
73 | return -ENOENT; | ||
74 | } | ||
75 | |||
76 | static inline int uncache_firmware(const char *name) | ||
77 | { | ||
78 | return -EINVAL; | ||
79 | } | ||
65 | #endif | 80 | #endif |
66 | 81 | ||
67 | #endif | 82 | #endif |
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h index 0e4e2eec5c1d..30442547b9e6 100644 --- a/include/linux/frontswap.h +++ b/include/linux/frontswap.h | |||
@@ -19,6 +19,8 @@ extern struct frontswap_ops | |||
19 | extern void frontswap_shrink(unsigned long); | 19 | extern void frontswap_shrink(unsigned long); |
20 | extern unsigned long frontswap_curr_pages(void); | 20 | extern unsigned long frontswap_curr_pages(void); |
21 | extern void frontswap_writethrough(bool); | 21 | extern void frontswap_writethrough(bool); |
22 | #define FRONTSWAP_HAS_EXCLUSIVE_GETS | ||
23 | extern void frontswap_tmem_exclusive_gets(bool); | ||
22 | 24 | ||
23 | extern void __frontswap_init(unsigned type); | 25 | extern void __frontswap_init(unsigned type); |
24 | extern int __frontswap_store(struct page *page); | 26 | extern int __frontswap_store(struct page *page); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index aa110476a95b..ca6d8c806f47 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1074,7 +1074,11 @@ struct file_handle { | |||
1074 | unsigned char f_handle[0]; | 1074 | unsigned char f_handle[0]; |
1075 | }; | 1075 | }; |
1076 | 1076 | ||
1077 | #define get_file(x) atomic_long_inc(&(x)->f_count) | 1077 | static inline struct file *get_file(struct file *f) |
1078 | { | ||
1079 | atomic_long_inc(&f->f_count); | ||
1080 | return f; | ||
1081 | } | ||
1078 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | 1082 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
1079 | #define file_count(x) atomic_long_read(&(x)->f_count) | 1083 | #define file_count(x) atomic_long_read(&(x)->f_count) |
1080 | 1084 | ||
@@ -1126,9 +1130,9 @@ static inline int file_check_writeable(struct file *filp) | |||
1126 | /* Page cache limit. The filesystems should put that into their s_maxbytes | 1130 | /* Page cache limit. The filesystems should put that into their s_maxbytes |
1127 | limits, otherwise bad things can happen in VM. */ | 1131 | limits, otherwise bad things can happen in VM. */ |
1128 | #if BITS_PER_LONG==32 | 1132 | #if BITS_PER_LONG==32 |
1129 | #define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) | 1133 | #define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) |
1130 | #elif BITS_PER_LONG==64 | 1134 | #elif BITS_PER_LONG==64 |
1131 | #define MAX_LFS_FILESIZE 0x7fffffffffffffffUL | 1135 | #define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff) |
1132 | #endif | 1136 | #endif |
1133 | 1137 | ||
1134 | #define FL_POSIX 1 | 1138 | #define FL_POSIX 1 |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 15be561e7397..a82296af413f 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -19,9 +19,11 @@ | |||
19 | 19 | ||
20 | #define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI | 20 | #define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI |
21 | PHY CLK to become stable - 10ms*/ | 21 | PHY CLK to become stable - 10ms*/ |
22 | #define FSL_USB_PHY_CLK_TIMEOUT 10000 /* uSec */ | ||
22 | #define FSL_USB_VER_OLD 0 | 23 | #define FSL_USB_VER_OLD 0 |
23 | #define FSL_USB_VER_1_6 1 | 24 | #define FSL_USB_VER_1_6 1 |
24 | #define FSL_USB_VER_2_2 2 | 25 | #define FSL_USB_VER_2_2 2 |
26 | #define FSL_USB_VER_2_4 3 | ||
25 | 27 | ||
26 | #include <linux/types.h> | 28 | #include <linux/types.h> |
27 | 29 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 55e6d63d46d0..a52f2f4fe030 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/kallsyms.h> | 10 | #include <linux/kallsyms.h> |
11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
13 | #include <linux/ptrace.h> | ||
13 | #include <linux/ktime.h> | 14 | #include <linux/ktime.h> |
14 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
@@ -18,6 +19,28 @@ | |||
18 | 19 | ||
19 | #include <asm/ftrace.h> | 20 | #include <asm/ftrace.h> |
20 | 21 | ||
22 | /* | ||
23 | * If the arch supports passing the variable contents of | ||
24 | * function_trace_op as the third parameter back from the | ||
25 | * mcount call, then the arch should define this as 1. | ||
26 | */ | ||
27 | #ifndef ARCH_SUPPORTS_FTRACE_OPS | ||
28 | #define ARCH_SUPPORTS_FTRACE_OPS 0 | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * If the arch's mcount caller does not support all of ftrace's | ||
33 | * features, then it must call an indirect function that | ||
34 | * does. Or at least does enough to prevent any unwelcomed side effects. | ||
35 | */ | ||
36 | #if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \ | ||
37 | !ARCH_SUPPORTS_FTRACE_OPS | ||
38 | # define FTRACE_FORCE_LIST_FUNC 1 | ||
39 | #else | ||
40 | # define FTRACE_FORCE_LIST_FUNC 0 | ||
41 | #endif | ||
42 | |||
43 | |||
21 | struct module; | 44 | struct module; |
22 | struct ftrace_hash; | 45 | struct ftrace_hash; |
23 | 46 | ||
@@ -29,7 +52,10 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
29 | void __user *buffer, size_t *lenp, | 52 | void __user *buffer, size_t *lenp, |
30 | loff_t *ppos); | 53 | loff_t *ppos); |
31 | 54 | ||
32 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 55 | struct ftrace_ops; |
56 | |||
57 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | ||
58 | struct ftrace_ops *op, struct pt_regs *regs); | ||
33 | 59 | ||
34 | /* | 60 | /* |
35 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are | 61 | * FTRACE_OPS_FL_* bits denote the state of ftrace_ops struct and are |
@@ -45,12 +71,33 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | |||
45 | * could be controled by following calls: | 71 | * could be controled by following calls: |
46 | * ftrace_function_local_enable | 72 | * ftrace_function_local_enable |
47 | * ftrace_function_local_disable | 73 | * ftrace_function_local_disable |
74 | * SAVE_REGS - The ftrace_ops wants regs saved at each function called | ||
75 | * and passed to the callback. If this flag is set, but the | ||
76 | * architecture does not support passing regs | ||
77 | * (ARCH_SUPPORTS_FTRACE_SAVE_REGS is not defined), then the | ||
78 | * ftrace_ops will fail to register, unless the next flag | ||
79 | * is set. | ||
80 | * SAVE_REGS_IF_SUPPORTED - This is the same as SAVE_REGS, but if the | ||
81 | * handler can handle an arch that does not save regs | ||
82 | * (the handler tests if regs == NULL), then it can set | ||
83 | * this flag instead. It will not fail registering the ftrace_ops | ||
84 | * but, the regs field will be NULL if the arch does not support | ||
85 | * passing regs to the handler. | ||
86 | * Note, if this flag is set, the SAVE_REGS flag will automatically | ||
87 | * get set upon registering the ftrace_ops, if the arch supports it. | ||
88 | * RECURSION_SAFE - The ftrace_ops can set this to tell the ftrace infrastructure | ||
89 | * that the call back has its own recursion protection. If it does | ||
90 | * not set this, then the ftrace infrastructure will add recursion | ||
91 | * protection for the caller. | ||
48 | */ | 92 | */ |
49 | enum { | 93 | enum { |
50 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 94 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
51 | FTRACE_OPS_FL_GLOBAL = 1 << 1, | 95 | FTRACE_OPS_FL_GLOBAL = 1 << 1, |
52 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, | 96 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, |
53 | FTRACE_OPS_FL_CONTROL = 1 << 3, | 97 | FTRACE_OPS_FL_CONTROL = 1 << 3, |
98 | FTRACE_OPS_FL_SAVE_REGS = 1 << 4, | ||
99 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, | ||
100 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, | ||
54 | }; | 101 | }; |
55 | 102 | ||
56 | struct ftrace_ops { | 103 | struct ftrace_ops { |
@@ -163,7 +210,8 @@ static inline int ftrace_function_local_disabled(struct ftrace_ops *ops) | |||
163 | return *this_cpu_ptr(ops->disabled); | 210 | return *this_cpu_ptr(ops->disabled); |
164 | } | 211 | } |
165 | 212 | ||
166 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 213 | extern void ftrace_stub(unsigned long a0, unsigned long a1, |
214 | struct ftrace_ops *op, struct pt_regs *regs); | ||
167 | 215 | ||
168 | #else /* !CONFIG_FUNCTION_TRACER */ | 216 | #else /* !CONFIG_FUNCTION_TRACER */ |
169 | /* | 217 | /* |
@@ -172,6 +220,10 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1); | |||
172 | */ | 220 | */ |
173 | #define register_ftrace_function(ops) ({ 0; }) | 221 | #define register_ftrace_function(ops) ({ 0; }) |
174 | #define unregister_ftrace_function(ops) ({ 0; }) | 222 | #define unregister_ftrace_function(ops) ({ 0; }) |
223 | static inline int ftrace_nr_registered_ops(void) | ||
224 | { | ||
225 | return 0; | ||
226 | } | ||
175 | static inline void clear_ftrace_function(void) { } | 227 | static inline void clear_ftrace_function(void) { } |
176 | static inline void ftrace_kill(void) { } | 228 | static inline void ftrace_kill(void) { } |
177 | static inline void ftrace_stop(void) { } | 229 | static inline void ftrace_stop(void) { } |
@@ -227,12 +279,33 @@ extern void unregister_ftrace_function_probe_all(char *glob); | |||
227 | 279 | ||
228 | extern int ftrace_text_reserved(void *start, void *end); | 280 | extern int ftrace_text_reserved(void *start, void *end); |
229 | 281 | ||
282 | extern int ftrace_nr_registered_ops(void); | ||
283 | |||
284 | /* | ||
285 | * The dyn_ftrace record's flags field is split into two parts. | ||
286 | * the first part which is '0-FTRACE_REF_MAX' is a counter of | ||
287 | * the number of callbacks that have registered the function that | ||
288 | * the dyn_ftrace descriptor represents. | ||
289 | * | ||
290 | * The second part is a mask: | ||
291 | * ENABLED - the function is being traced | ||
292 | * REGS - the record wants the function to save regs | ||
293 | * REGS_EN - the function is set up to save regs. | ||
294 | * | ||
295 | * When a new ftrace_ops is registered and wants a function to save | ||
296 | * pt_regs, the rec->flag REGS is set. When the function has been | ||
297 | * set up to save regs, the REG_EN flag is set. Once a function | ||
298 | * starts saving regs it will do so until all ftrace_ops are removed | ||
299 | * from tracing that function. | ||
300 | */ | ||
230 | enum { | 301 | enum { |
231 | FTRACE_FL_ENABLED = (1 << 30), | 302 | FTRACE_FL_ENABLED = (1UL << 29), |
303 | FTRACE_FL_REGS = (1UL << 30), | ||
304 | FTRACE_FL_REGS_EN = (1UL << 31) | ||
232 | }; | 305 | }; |
233 | 306 | ||
234 | #define FTRACE_FL_MASK (0x3UL << 30) | 307 | #define FTRACE_FL_MASK (0x7UL << 29) |
235 | #define FTRACE_REF_MAX ((1 << 30) - 1) | 308 | #define FTRACE_REF_MAX ((1UL << 29) - 1) |
236 | 309 | ||
237 | struct dyn_ftrace { | 310 | struct dyn_ftrace { |
238 | union { | 311 | union { |
@@ -244,6 +317,8 @@ struct dyn_ftrace { | |||
244 | }; | 317 | }; |
245 | 318 | ||
246 | int ftrace_force_update(void); | 319 | int ftrace_force_update(void); |
320 | int ftrace_set_filter_ip(struct ftrace_ops *ops, unsigned long ip, | ||
321 | int remove, int reset); | ||
247 | int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, | 322 | int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, |
248 | int len, int reset); | 323 | int len, int reset); |
249 | int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, | 324 | int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, |
@@ -263,9 +338,23 @@ enum { | |||
263 | FTRACE_STOP_FUNC_RET = (1 << 4), | 338 | FTRACE_STOP_FUNC_RET = (1 << 4), |
264 | }; | 339 | }; |
265 | 340 | ||
341 | /* | ||
342 | * The FTRACE_UPDATE_* enum is used to pass information back | ||
343 | * from the ftrace_update_record() and ftrace_test_record() | ||
344 | * functions. These are called by the code update routines | ||
345 | * to find out what is to be done for a given function. | ||
346 | * | ||
347 | * IGNORE - The function is already what we want it to be | ||
348 | * MAKE_CALL - Start tracing the function | ||
349 | * MODIFY_CALL - Stop saving regs for the function | ||
350 | * MODIFY_CALL_REGS - Start saving regs for the function | ||
351 | * MAKE_NOP - Stop tracing the function | ||
352 | */ | ||
266 | enum { | 353 | enum { |
267 | FTRACE_UPDATE_IGNORE, | 354 | FTRACE_UPDATE_IGNORE, |
268 | FTRACE_UPDATE_MAKE_CALL, | 355 | FTRACE_UPDATE_MAKE_CALL, |
356 | FTRACE_UPDATE_MODIFY_CALL, | ||
357 | FTRACE_UPDATE_MODIFY_CALL_REGS, | ||
269 | FTRACE_UPDATE_MAKE_NOP, | 358 | FTRACE_UPDATE_MAKE_NOP, |
270 | }; | 359 | }; |
271 | 360 | ||
@@ -317,7 +406,9 @@ extern int ftrace_dyn_arch_init(void *data); | |||
317 | extern void ftrace_replace_code(int enable); | 406 | extern void ftrace_replace_code(int enable); |
318 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | 407 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
319 | extern void ftrace_caller(void); | 408 | extern void ftrace_caller(void); |
409 | extern void ftrace_regs_caller(void); | ||
320 | extern void ftrace_call(void); | 410 | extern void ftrace_call(void); |
411 | extern void ftrace_regs_call(void); | ||
321 | extern void mcount_call(void); | 412 | extern void mcount_call(void); |
322 | 413 | ||
323 | void ftrace_modify_all_code(int command); | 414 | void ftrace_modify_all_code(int command); |
@@ -325,6 +416,15 @@ void ftrace_modify_all_code(int command); | |||
325 | #ifndef FTRACE_ADDR | 416 | #ifndef FTRACE_ADDR |
326 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) | 417 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) |
327 | #endif | 418 | #endif |
419 | |||
420 | #ifndef FTRACE_REGS_ADDR | ||
421 | #ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS | ||
422 | # define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller) | ||
423 | #else | ||
424 | # define FTRACE_REGS_ADDR FTRACE_ADDR | ||
425 | #endif | ||
426 | #endif | ||
427 | |||
328 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 428 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
329 | extern void ftrace_graph_caller(void); | 429 | extern void ftrace_graph_caller(void); |
330 | extern int ftrace_enable_ftrace_graph_caller(void); | 430 | extern int ftrace_enable_ftrace_graph_caller(void); |
@@ -380,6 +480,39 @@ extern int ftrace_make_nop(struct module *mod, | |||
380 | */ | 480 | */ |
381 | extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); | 481 | extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); |
382 | 482 | ||
483 | #ifdef ARCH_SUPPORTS_FTRACE_SAVE_REGS | ||
484 | /** | ||
485 | * ftrace_modify_call - convert from one addr to another (no nop) | ||
486 | * @rec: the mcount call site record | ||
487 | * @old_addr: the address expected to be currently called to | ||
488 | * @addr: the address to change to | ||
489 | * | ||
490 | * This is a very sensitive operation and great care needs | ||
491 | * to be taken by the arch. The operation should carefully | ||
492 | * read the location, check to see if what is read is indeed | ||
493 | * what we expect it to be, and then on success of the compare, | ||
494 | * it should write to the location. | ||
495 | * | ||
496 | * The code segment at @rec->ip should be a caller to @old_addr | ||
497 | * | ||
498 | * Return must be: | ||
499 | * 0 on success | ||
500 | * -EFAULT on error reading the location | ||
501 | * -EINVAL on a failed compare of the contents | ||
502 | * -EPERM on error writing to the location | ||
503 | * Any other value will be considered a failure. | ||
504 | */ | ||
505 | extern int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | ||
506 | unsigned long addr); | ||
507 | #else | ||
508 | /* Should never be called */ | ||
509 | static inline int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | ||
510 | unsigned long addr) | ||
511 | { | ||
512 | return -EINVAL; | ||
513 | } | ||
514 | #endif | ||
515 | |||
383 | /* May be defined in arch */ | 516 | /* May be defined in arch */ |
384 | extern int ftrace_arch_read_dyn_info(char *buf, int size); | 517 | extern int ftrace_arch_read_dyn_info(char *buf, int size); |
385 | 518 | ||
@@ -387,7 +520,7 @@ extern int skip_trace(unsigned long ip); | |||
387 | 520 | ||
388 | extern void ftrace_disable_daemon(void); | 521 | extern void ftrace_disable_daemon(void); |
389 | extern void ftrace_enable_daemon(void); | 522 | extern void ftrace_enable_daemon(void); |
390 | #else | 523 | #else /* CONFIG_DYNAMIC_FTRACE */ |
391 | static inline int skip_trace(unsigned long ip) { return 0; } | 524 | static inline int skip_trace(unsigned long ip) { return 0; } |
392 | static inline int ftrace_force_update(void) { return 0; } | 525 | static inline int ftrace_force_update(void) { return 0; } |
393 | static inline void ftrace_disable_daemon(void) { } | 526 | static inline void ftrace_disable_daemon(void) { } |
@@ -405,6 +538,10 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
405 | { | 538 | { |
406 | return 0; | 539 | return 0; |
407 | } | 540 | } |
541 | static inline unsigned long ftrace_location(unsigned long ip) | ||
542 | { | ||
543 | return 0; | ||
544 | } | ||
408 | 545 | ||
409 | /* | 546 | /* |
410 | * Again users of functions that have ftrace_ops may not | 547 | * Again users of functions that have ftrace_ops may not |
@@ -413,6 +550,7 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
413 | */ | 550 | */ |
414 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) | 551 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) |
415 | #define ftrace_set_early_filter(ops, buf, enable) do { } while (0) | 552 | #define ftrace_set_early_filter(ops, buf, enable) do { } while (0) |
553 | #define ftrace_set_filter_ip(ops, ip, remove, reset) ({ -ENODEV; }) | ||
416 | #define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; }) | 554 | #define ftrace_set_filter(ops, buf, len, reset) ({ -ENODEV; }) |
417 | #define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; }) | 555 | #define ftrace_set_notrace(ops, buf, len, reset) ({ -ENODEV; }) |
418 | #define ftrace_free_filter(ops) do { } while (0) | 556 | #define ftrace_free_filter(ops) do { } while (0) |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h deleted file mode 100644 index 79b3eb37243a..000000000000 --- a/include/linux/generic_serial.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * generic_serial.h | ||
3 | * | ||
4 | * Copyright (C) 1998 R.E.Wolff@BitWizard.nl | ||
5 | * | ||
6 | * written for the SX serial driver. | ||
7 | * | ||
8 | * Version 0.1 -- December, 1998. | ||
9 | */ | ||
10 | |||
11 | #ifndef GENERIC_SERIAL_H | ||
12 | #define GENERIC_SERIAL_H | ||
13 | |||
14 | #warning Use of this header is deprecated. | ||
15 | #warning Since nobody sets the constants defined here for you, you should not, in any case, use them. Including the header is thus pointless. | ||
16 | |||
17 | /* Flags */ | ||
18 | /* Warning: serial.h defines some ASYNC_ flags, they say they are "only" | ||
19 | used in serial.c, but they are also used in all other serial drivers. | ||
20 | Make sure they don't clash with these here... */ | ||
21 | #define GS_TX_INTEN 0x00800000 | ||
22 | #define GS_RX_INTEN 0x00400000 | ||
23 | #define GS_ACTIVE 0x00200000 | ||
24 | |||
25 | #define GS_TYPE_NORMAL 1 | ||
26 | |||
27 | #define GS_DEBUG_FLUSH 0x00000001 | ||
28 | #define GS_DEBUG_BTR 0x00000002 | ||
29 | #define GS_DEBUG_TERMIOS 0x00000004 | ||
30 | #define GS_DEBUG_STUFF 0x00000008 | ||
31 | #define GS_DEBUG_CLOSE 0x00000010 | ||
32 | #define GS_DEBUG_FLOW 0x00000020 | ||
33 | #define GS_DEBUG_WRITE 0x00000040 | ||
34 | |||
35 | #endif | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 305f23cd7cff..cab3da3d0949 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -132,11 +132,11 @@ extern void synchronize_irq(unsigned int irq); | |||
132 | struct task_struct; | 132 | struct task_struct; |
133 | 133 | ||
134 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) | 134 | #if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) |
135 | static inline void account_system_vtime(struct task_struct *tsk) | 135 | static inline void vtime_account(struct task_struct *tsk) |
136 | { | 136 | { |
137 | } | 137 | } |
138 | #else | 138 | #else |
139 | extern void account_system_vtime(struct task_struct *tsk); | 139 | extern void vtime_account(struct task_struct *tsk); |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 142 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) |
@@ -162,7 +162,7 @@ extern void rcu_nmi_exit(void); | |||
162 | */ | 162 | */ |
163 | #define __irq_enter() \ | 163 | #define __irq_enter() \ |
164 | do { \ | 164 | do { \ |
165 | account_system_vtime(current); \ | 165 | vtime_account(current); \ |
166 | add_preempt_count(HARDIRQ_OFFSET); \ | 166 | add_preempt_count(HARDIRQ_OFFSET); \ |
167 | trace_hardirq_enter(); \ | 167 | trace_hardirq_enter(); \ |
168 | } while (0) | 168 | } while (0) |
@@ -178,7 +178,7 @@ extern void irq_enter(void); | |||
178 | #define __irq_exit() \ | 178 | #define __irq_exit() \ |
179 | do { \ | 179 | do { \ |
180 | trace_hardirq_exit(); \ | 180 | trace_hardirq_exit(); \ |
181 | account_system_vtime(current); \ | 181 | vtime_account(current); \ |
182 | sub_preempt_count(HARDIRQ_OFFSET); \ | 182 | sub_preempt_count(HARDIRQ_OFFSET); \ |
183 | } while (0) | 183 | } while (0) |
184 | 184 | ||
diff --git a/include/linux/hash.h b/include/linux/hash.h index b80506bdd733..24df9e70406f 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h | |||
@@ -67,4 +67,14 @@ static inline unsigned long hash_ptr(const void *ptr, unsigned int bits) | |||
67 | { | 67 | { |
68 | return hash_long((unsigned long)ptr, bits); | 68 | return hash_long((unsigned long)ptr, bits); |
69 | } | 69 | } |
70 | |||
71 | static inline u32 hash32_ptr(const void *ptr) | ||
72 | { | ||
73 | unsigned long val = (unsigned long)ptr; | ||
74 | |||
75 | #if BITS_PER_LONG == 64 | ||
76 | val ^= (val >> 32); | ||
77 | #endif | ||
78 | return (u32)val; | ||
79 | } | ||
70 | #endif /* _LINUX_HASH_H */ | 80 | #endif /* _LINUX_HASH_H */ |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h new file mode 100644 index 000000000000..0aa5f4c42ae6 --- /dev/null +++ b/include/linux/hid-sensor-hub.h | |||
@@ -0,0 +1,160 @@ | |||
1 | /* | ||
2 | * HID Sensors Driver | ||
3 | * Copyright (c) 2012, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope 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, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | #ifndef _HID_SENSORS_HUB_H | ||
20 | #define _HID_SENSORS_HUB_H | ||
21 | |||
22 | #include <linux/hid.h> | ||
23 | #include <linux/hid-sensor-ids.h> | ||
24 | |||
25 | /** | ||
26 | * struct hid_sensor_hub_attribute_info - Attribute info | ||
27 | * @usage_id: Parent usage id of a physical device. | ||
28 | * @attrib_id: Attribute id for this attribute. | ||
29 | * @report_id: Report id in which this information resides. | ||
30 | * @index: Field index in the report. | ||
31 | * @units: Measurment unit for this attribute. | ||
32 | * @unit_expo: Exponent used in the data. | ||
33 | * @size: Size in bytes for data size. | ||
34 | */ | ||
35 | struct hid_sensor_hub_attribute_info { | ||
36 | u32 usage_id; | ||
37 | u32 attrib_id; | ||
38 | s32 report_id; | ||
39 | s32 index; | ||
40 | s32 units; | ||
41 | s32 unit_expo; | ||
42 | s32 size; | ||
43 | }; | ||
44 | |||
45 | /** | ||
46 | * struct hid_sensor_hub_device - Stores the hub instance data | ||
47 | * @hdev: Stores the hid instance. | ||
48 | * @vendor_id: Vendor id of hub device. | ||
49 | * @product_id: Product id of hub device. | ||
50 | */ | ||
51 | struct hid_sensor_hub_device { | ||
52 | struct hid_device *hdev; | ||
53 | u32 vendor_id; | ||
54 | u32 product_id; | ||
55 | }; | ||
56 | |||
57 | /** | ||
58 | * struct hid_sensor_hub_callbacks - Client callback functions | ||
59 | * @pdev: Platform device instance of the client driver. | ||
60 | * @suspend: Suspend callback. | ||
61 | * @resume: Resume callback. | ||
62 | * @capture_sample: Callback to get a sample. | ||
63 | * @send_event: Send notification to indicate all samples are | ||
64 | * captured, process and send event | ||
65 | */ | ||
66 | struct hid_sensor_hub_callbacks { | ||
67 | struct platform_device *pdev; | ||
68 | int (*suspend)(struct hid_sensor_hub_device *hsdev, void *priv); | ||
69 | int (*resume)(struct hid_sensor_hub_device *hsdev, void *priv); | ||
70 | int (*capture_sample)(struct hid_sensor_hub_device *hsdev, | ||
71 | u32 usage_id, size_t raw_len, char *raw_data, | ||
72 | void *priv); | ||
73 | int (*send_event)(struct hid_sensor_hub_device *hsdev, u32 usage_id, | ||
74 | void *priv); | ||
75 | }; | ||
76 | |||
77 | /* Registration functions */ | ||
78 | |||
79 | /** | ||
80 | * sensor_hub_register_callback() - Register client callbacks | ||
81 | * @hsdev: Hub device instance. | ||
82 | * @usage_id: Usage id of the client (E.g. 0x200076 for Gyro). | ||
83 | * @usage_callback: Callback function storage | ||
84 | * | ||
85 | * Used to register callbacks by client processing drivers. Sensor | ||
86 | * hub core driver will call these callbacks to offload processing | ||
87 | * of data streams and notifications. | ||
88 | */ | ||
89 | int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev, | ||
90 | u32 usage_id, | ||
91 | struct hid_sensor_hub_callbacks *usage_callback); | ||
92 | |||
93 | /** | ||
94 | * sensor_hub_remove_callback() - Remove client callbacks | ||
95 | * @hsdev: Hub device instance. | ||
96 | * @usage_id: Usage id of the client (E.g. 0x200076 for Gyro). | ||
97 | * | ||
98 | * If there is a callback registred, this call will remove that | ||
99 | * callbacks, so that it will stop data and event notifications. | ||
100 | */ | ||
101 | int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev, | ||
102 | u32 usage_id); | ||
103 | |||
104 | |||
105 | /* Hid sensor hub core interfaces */ | ||
106 | |||
107 | /** | ||
108 | * sensor_hub_input_get_attribute_info() - Get an attribute information | ||
109 | * @hsdev: Hub device instance. | ||
110 | * @type: Type of this attribute, input/output/feature | ||
111 | * @usage_id: Attribute usage id of parent physical device as per spec | ||
112 | * @attr_usage_id: Attribute usage id as per spec | ||
113 | * @info: return information about attribute after parsing report | ||
114 | * | ||
115 | * Parses report and returns the attribute information such as report id, | ||
116 | * field index, units and exponet etc. | ||
117 | */ | ||
118 | int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, | ||
119 | u8 type, | ||
120 | u32 usage_id, u32 attr_usage_id, | ||
121 | struct hid_sensor_hub_attribute_info *info); | ||
122 | |||
123 | /** | ||
124 | * sensor_hub_input_attr_get_raw_value() - Synchronous read request | ||
125 | * @usage_id: Attribute usage id of parent physical device as per spec | ||
126 | * @attr_usage_id: Attribute usage id as per spec | ||
127 | * @report_id: Report id to look for | ||
128 | * | ||
129 | * Issues a synchronous read request for an input attribute. Returns | ||
130 | * data upto 32 bits. Since client can get events, so this call should | ||
131 | * not be used for data paths, this will impact performance. | ||
132 | */ | ||
133 | |||
134 | int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, | ||
135 | u32 usage_id, | ||
136 | u32 attr_usage_id, u32 report_id); | ||
137 | /** | ||
138 | * sensor_hub_set_feature() - Feature set request | ||
139 | * @report_id: Report id to look for | ||
140 | * @field_index: Field index inside a report | ||
141 | * @value: Value to set | ||
142 | * | ||
143 | * Used to set a field in feature report. For example this can set polling | ||
144 | * interval, sensitivity, activate/deactivate state. | ||
145 | */ | ||
146 | int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | ||
147 | u32 field_index, s32 value); | ||
148 | |||
149 | /** | ||
150 | * sensor_hub_get_feature() - Feature get request | ||
151 | * @report_id: Report id to look for | ||
152 | * @field_index: Field index inside a report | ||
153 | * @value: Place holder for return value | ||
154 | * | ||
155 | * Used to get a field in feature report. For example this can get polling | ||
156 | * interval, sensitivity, activate/deactivate state. | ||
157 | */ | ||
158 | int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | ||
159 | u32 field_index, s32 *value); | ||
160 | #endif | ||
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h new file mode 100644 index 000000000000..ca8d7e94eb3c --- /dev/null +++ b/include/linux/hid-sensor-ids.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * HID Sensors Driver | ||
3 | * Copyright (c) 2012, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope 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, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | #ifndef _HID_SENSORS_IDS_H | ||
20 | #define _HID_SENSORS_IDS_H | ||
21 | |||
22 | #define HID_UP_SENSOR 0x00200000 | ||
23 | #define HID_MAX_PHY_DEVICES 0xFF | ||
24 | |||
25 | /* Accel 3D (200073) */ | ||
26 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 | ||
27 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 | ||
28 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 | ||
29 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 | ||
30 | |||
31 | /* ALS (200041) */ | ||
32 | #define HID_USAGE_SENSOR_ALS 0x200041 | ||
33 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | ||
34 | |||
35 | /* Gyro 3D: (200076) */ | ||
36 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | ||
37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 | ||
38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | ||
39 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | ||
40 | |||
41 | /*ORIENTATION: Compass 3D: (200083) */ | ||
42 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | ||
43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | ||
44 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | ||
45 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 | ||
46 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Z 0x200474 | ||
47 | |||
48 | #define HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH 0x200475 | ||
49 | #define HID_USAGE_SENSOR_ORIENT_COMP_TRUE_NORTH 0x200476 | ||
50 | #define HID_USAGE_SENSOR_ORIENT_MAGN_NORTH 0x200477 | ||
51 | #define HID_USAGE_SENSOR_ORIENT_TRUE_NORTH 0x200478 | ||
52 | |||
53 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE 0x200479 | ||
54 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_X 0x20047A | ||
55 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B | ||
56 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C | ||
57 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D | ||
58 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E | ||
59 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F | ||
60 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 | ||
61 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 | ||
62 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 | ||
63 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 | ||
64 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 | ||
65 | |||
66 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_X_AXIS 0x200485 | ||
67 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Y_AXIS 0x200486 | ||
68 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX_Z_AXIS 0x200487 | ||
69 | |||
70 | /* Units */ | ||
71 | #define HID_USAGE_SENSOR_UNITS_NOT_SPECIFIED 0x00 | ||
72 | #define HID_USAGE_SENSOR_UNITS_LUX 0x01 | ||
73 | #define HID_USAGE_SENSOR_UNITS_KELVIN 0x01000100 | ||
74 | #define HID_USAGE_SENSOR_UNITS_FAHRENHEIT 0x03000100 | ||
75 | #define HID_USAGE_SENSOR_UNITS_PASCAL 0xF1E1 | ||
76 | #define HID_USAGE_SENSOR_UNITS_NEWTON 0x11E1 | ||
77 | #define HID_USAGE_SENSOR_UNITS_METERS_PER_SECOND 0x11F0 | ||
78 | #define HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD 0x11E0 | ||
79 | #define HID_USAGE_SENSOR_UNITS_FARAD 0xE14F2000 | ||
80 | #define HID_USAGE_SENSOR_UNITS_AMPERE 0x01001000 | ||
81 | #define HID_USAGE_SENSOR_UNITS_WATT 0x21d1 | ||
82 | #define HID_USAGE_SENSOR_UNITS_HENRY 0x21E1E000 | ||
83 | #define HID_USAGE_SENSOR_UNITS_OHM 0x21D1E000 | ||
84 | #define HID_USAGE_SENSOR_UNITS_VOLT 0x21D1F000 | ||
85 | #define HID_USAGE_SENSOR_UNITS_HERTZ 0x01F0 | ||
86 | #define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SEC_SQRD 0x14E0 | ||
87 | #define HID_USAGE_SENSOR_UNITS_RADIANS 0x12 | ||
88 | #define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND 0x12F0 | ||
89 | #define HID_USAGE_SENSOR_UNITS_RADIANS_PER_SEC_SQRD 0x12E0 | ||
90 | #define HID_USAGE_SENSOR_UNITS_SECOND 0x0110 | ||
91 | #define HID_USAGE_SENSOR_UNITS_GAUSS 0x01E1F000 | ||
92 | #define HID_USAGE_SENSOR_UNITS_GRAM 0x0101 | ||
93 | #define HID_USAGE_SENSOR_UNITS_CENTIMETER 0x11 | ||
94 | #define HID_USAGE_SENSOR_UNITS_G 0x1A | ||
95 | #define HID_USAGE_SENSOR_UNITS_MILLISECOND 0x19 | ||
96 | #define HID_USAGE_SENSOR_UNITS_PERCENT 0x17 | ||
97 | #define HID_USAGE_SENSOR_UNITS_DEGREES 0x14 | ||
98 | #define HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND 0x15 | ||
99 | |||
100 | /* Common selectors */ | ||
101 | #define HID_USAGE_SENSOR_PROP_REPORT_INTERVAL 0x20030E | ||
102 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_ABS 0x20030F | ||
103 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_RANGE_PCT 0x200310 | ||
104 | #define HID_USAGE_SENSOR_PROP_SENSITIVITY_REL_PCT 0x200311 | ||
105 | #define HID_USAGE_SENSOR_PROP_ACCURACY 0x200312 | ||
106 | #define HID_USAGE_SENSOR_PROP_RESOLUTION 0x200313 | ||
107 | #define HID_USAGE_SENSOR_PROP_RANGE_MAXIMUM 0x200314 | ||
108 | #define HID_USAGE_SENSOR_PROP_RANGE_MINIMUM 0x200315 | ||
109 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | ||
110 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | ||
111 | |||
112 | #endif | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 42970de1b40c..7e1f37db7582 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -414,7 +414,7 @@ struct hid_field { | |||
414 | __u16 dpad; /* dpad input code */ | 414 | __u16 dpad; /* dpad input code */ |
415 | }; | 415 | }; |
416 | 416 | ||
417 | #define HID_MAX_FIELDS 128 | 417 | #define HID_MAX_FIELDS 256 |
418 | 418 | ||
419 | struct hid_report { | 419 | struct hid_report { |
420 | struct list_head list; | 420 | struct list_head list; |
@@ -626,6 +626,7 @@ struct hid_usage_id { | |||
626 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 626 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
627 | * @input_mapping: invoked on input registering before mapping an usage | 627 | * @input_mapping: invoked on input registering before mapping an usage |
628 | * @input_mapped: invoked on input registering after mapping an usage | 628 | * @input_mapped: invoked on input registering after mapping an usage |
629 | * @input_configured: invoked just before the device is registered | ||
629 | * @feature_mapping: invoked on feature registering | 630 | * @feature_mapping: invoked on feature registering |
630 | * @suspend: invoked on suspend (NULL means nop) | 631 | * @suspend: invoked on suspend (NULL means nop) |
631 | * @resume: invoked on resume if device was not reset (NULL means nop) | 632 | * @resume: invoked on resume if device was not reset (NULL means nop) |
@@ -670,6 +671,8 @@ struct hid_driver { | |||
670 | int (*input_mapped)(struct hid_device *hdev, | 671 | int (*input_mapped)(struct hid_device *hdev, |
671 | struct hid_input *hidinput, struct hid_field *field, | 672 | struct hid_input *hidinput, struct hid_field *field, |
672 | struct hid_usage *usage, unsigned long **bit, int *max); | 673 | struct hid_usage *usage, unsigned long **bit, int *max); |
674 | void (*input_configured)(struct hid_device *hdev, | ||
675 | struct hid_input *hidinput); | ||
673 | void (*feature_mapping)(struct hid_device *hdev, | 676 | void (*feature_mapping)(struct hid_device *hdev, |
674 | struct hid_field *field, | 677 | struct hid_field *field, |
675 | struct hid_usage *usage); | 678 | struct hid_usage *usage); |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 68ed7f7e1fc9..e73b852156b1 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -122,12 +122,53 @@ | |||
122 | #define REG_U32 4 | 122 | #define REG_U32 4 |
123 | #define REG_U64 8 | 123 | #define REG_U64 8 |
124 | 124 | ||
125 | /* | ||
126 | * As we look at expanding the KVP functionality to include | ||
127 | * IP injection functionality, we need to maintain binary | ||
128 | * compatibility with older daemons. | ||
129 | * | ||
130 | * The KVP opcodes are defined by the host and it was unfortunate | ||
131 | * that I chose to treat the registration operation as part of the | ||
132 | * KVP operations defined by the host. | ||
133 | * Here is the level of compatibility | ||
134 | * (between the user level daemon and the kernel KVP driver) that we | ||
135 | * will implement: | ||
136 | * | ||
137 | * An older daemon will always be supported on a newer driver. | ||
138 | * A given user level daemon will require a minimal version of the | ||
139 | * kernel driver. | ||
140 | * If we cannot handle the version differences, we will fail gracefully | ||
141 | * (this can happen when we have a user level daemon that is more | ||
142 | * advanced than the KVP driver. | ||
143 | * | ||
144 | * We will use values used in this handshake for determining if we have | ||
145 | * workable user level daemon and the kernel driver. We begin by taking the | ||
146 | * registration opcode out of the KVP opcode namespace. We will however, | ||
147 | * maintain compatibility with the existing user-level daemon code. | ||
148 | */ | ||
149 | |||
150 | /* | ||
151 | * Daemon code not supporting IP injection (legacy daemon). | ||
152 | */ | ||
153 | |||
154 | #define KVP_OP_REGISTER 4 | ||
155 | |||
156 | /* | ||
157 | * Daemon code supporting IP injection. | ||
158 | * The KVP opcode field is used to communicate the | ||
159 | * registration information; so define a namespace that | ||
160 | * will be distinct from the host defined KVP opcode. | ||
161 | */ | ||
162 | |||
163 | #define KVP_OP_REGISTER1 100 | ||
164 | |||
125 | enum hv_kvp_exchg_op { | 165 | enum hv_kvp_exchg_op { |
126 | KVP_OP_GET = 0, | 166 | KVP_OP_GET = 0, |
127 | KVP_OP_SET, | 167 | KVP_OP_SET, |
128 | KVP_OP_DELETE, | 168 | KVP_OP_DELETE, |
129 | KVP_OP_ENUMERATE, | 169 | KVP_OP_ENUMERATE, |
130 | KVP_OP_REGISTER, | 170 | KVP_OP_GET_IP_INFO, |
171 | KVP_OP_SET_IP_INFO, | ||
131 | KVP_OP_COUNT /* Number of operations, must be last. */ | 172 | KVP_OP_COUNT /* Number of operations, must be last. */ |
132 | }; | 173 | }; |
133 | 174 | ||
@@ -140,6 +181,39 @@ enum hv_kvp_exchg_pool { | |||
140 | KVP_POOL_COUNT /* Number of pools, must be last. */ | 181 | KVP_POOL_COUNT /* Number of pools, must be last. */ |
141 | }; | 182 | }; |
142 | 183 | ||
184 | /* | ||
185 | * Some Hyper-V status codes. | ||
186 | */ | ||
187 | |||
188 | #define HV_S_OK 0x00000000 | ||
189 | #define HV_E_FAIL 0x80004005 | ||
190 | #define HV_S_CONT 0x80070103 | ||
191 | #define HV_ERROR_NOT_SUPPORTED 0x80070032 | ||
192 | #define HV_ERROR_MACHINE_LOCKED 0x800704F7 | ||
193 | #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F | ||
194 | #define HV_INVALIDARG 0x80070057 | ||
195 | #define HV_GUID_NOTFOUND 0x80041002 | ||
196 | |||
197 | #define ADDR_FAMILY_NONE 0x00 | ||
198 | #define ADDR_FAMILY_IPV4 0x01 | ||
199 | #define ADDR_FAMILY_IPV6 0x02 | ||
200 | |||
201 | #define MAX_ADAPTER_ID_SIZE 128 | ||
202 | #define MAX_IP_ADDR_SIZE 1024 | ||
203 | #define MAX_GATEWAY_SIZE 512 | ||
204 | |||
205 | |||
206 | struct hv_kvp_ipaddr_value { | ||
207 | __u16 adapter_id[MAX_ADAPTER_ID_SIZE]; | ||
208 | __u8 addr_family; | ||
209 | __u8 dhcp_enabled; | ||
210 | __u16 ip_addr[MAX_IP_ADDR_SIZE]; | ||
211 | __u16 sub_net[MAX_IP_ADDR_SIZE]; | ||
212 | __u16 gate_way[MAX_GATEWAY_SIZE]; | ||
213 | __u16 dns_addr[MAX_IP_ADDR_SIZE]; | ||
214 | } __attribute__((packed)); | ||
215 | |||
216 | |||
143 | struct hv_kvp_hdr { | 217 | struct hv_kvp_hdr { |
144 | __u8 operation; | 218 | __u8 operation; |
145 | __u8 pool; | 219 | __u8 pool; |
@@ -181,16 +255,26 @@ struct hv_kvp_register { | |||
181 | }; | 255 | }; |
182 | 256 | ||
183 | struct hv_kvp_msg { | 257 | struct hv_kvp_msg { |
184 | struct hv_kvp_hdr kvp_hdr; | 258 | union { |
259 | struct hv_kvp_hdr kvp_hdr; | ||
260 | int error; | ||
261 | }; | ||
185 | union { | 262 | union { |
186 | struct hv_kvp_msg_get kvp_get; | 263 | struct hv_kvp_msg_get kvp_get; |
187 | struct hv_kvp_msg_set kvp_set; | 264 | struct hv_kvp_msg_set kvp_set; |
188 | struct hv_kvp_msg_delete kvp_delete; | 265 | struct hv_kvp_msg_delete kvp_delete; |
189 | struct hv_kvp_msg_enumerate kvp_enum_data; | 266 | struct hv_kvp_msg_enumerate kvp_enum_data; |
267 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
190 | struct hv_kvp_register kvp_register; | 268 | struct hv_kvp_register kvp_register; |
191 | } body; | 269 | } body; |
192 | } __attribute__((packed)); | 270 | } __attribute__((packed)); |
193 | 271 | ||
272 | struct hv_kvp_ip_msg { | ||
273 | __u8 operation; | ||
274 | __u8 pool; | ||
275 | struct hv_kvp_ipaddr_value kvp_ip_val; | ||
276 | } __attribute__((packed)); | ||
277 | |||
194 | #ifdef __KERNEL__ | 278 | #ifdef __KERNEL__ |
195 | #include <linux/scatterlist.h> | 279 | #include <linux/scatterlist.h> |
196 | #include <linux/list.h> | 280 | #include <linux/list.h> |
@@ -405,7 +489,7 @@ struct vmtransfer_page_range { | |||
405 | struct vmtransfer_page_packet_header { | 489 | struct vmtransfer_page_packet_header { |
406 | struct vmpacket_descriptor d; | 490 | struct vmpacket_descriptor d; |
407 | u16 xfer_pageset_id; | 491 | u16 xfer_pageset_id; |
408 | bool sender_owns_set; | 492 | u8 sender_owns_set; |
409 | u8 reserved; | 493 | u8 reserved; |
410 | u32 range_cnt; | 494 | u32 range_cnt; |
411 | struct vmtransfer_page_range ranges[1]; | 495 | struct vmtransfer_page_range ranges[1]; |
@@ -559,7 +643,7 @@ struct vmbus_channel_query_vmbus_version { | |||
559 | /* VMBus Version Supported parameters */ | 643 | /* VMBus Version Supported parameters */ |
560 | struct vmbus_channel_version_supported { | 644 | struct vmbus_channel_version_supported { |
561 | struct vmbus_channel_message_header header; | 645 | struct vmbus_channel_message_header header; |
562 | bool version_supported; | 646 | u8 version_supported; |
563 | } __packed; | 647 | } __packed; |
564 | 648 | ||
565 | /* Offer Channel parameters */ | 649 | /* Offer Channel parameters */ |
@@ -568,7 +652,7 @@ struct vmbus_channel_offer_channel { | |||
568 | struct vmbus_channel_offer offer; | 652 | struct vmbus_channel_offer offer; |
569 | u32 child_relid; | 653 | u32 child_relid; |
570 | u8 monitorid; | 654 | u8 monitorid; |
571 | bool monitor_allocated; | 655 | u8 monitor_allocated; |
572 | } __packed; | 656 | } __packed; |
573 | 657 | ||
574 | /* Rescind Offer parameters */ | 658 | /* Rescind Offer parameters */ |
@@ -704,7 +788,7 @@ struct vmbus_channel_initiate_contact { | |||
704 | 788 | ||
705 | struct vmbus_channel_version_response { | 789 | struct vmbus_channel_version_response { |
706 | struct vmbus_channel_message_header header; | 790 | struct vmbus_channel_message_header header; |
707 | bool version_supported; | 791 | u8 version_supported; |
708 | } __packed; | 792 | } __packed; |
709 | 793 | ||
710 | enum vmbus_channel_state { | 794 | enum vmbus_channel_state { |
@@ -977,11 +1061,6 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
977 | #define ICMSGHDRFLAG_REQUEST 2 | 1061 | #define ICMSGHDRFLAG_REQUEST 2 |
978 | #define ICMSGHDRFLAG_RESPONSE 4 | 1062 | #define ICMSGHDRFLAG_RESPONSE 4 |
979 | 1063 | ||
980 | #define HV_S_OK 0x00000000 | ||
981 | #define HV_E_FAIL 0x80004005 | ||
982 | #define HV_S_CONT 0x80070103 | ||
983 | #define HV_ERROR_NOT_SUPPORTED 0x80070032 | ||
984 | #define HV_ERROR_MACHINE_LOCKED 0x800704F7 | ||
985 | 1064 | ||
986 | /* | 1065 | /* |
987 | * While we want to handle util services as regular devices, | 1066 | * While we want to handle util services as regular devices, |
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h index 0767a2a6b2f1..781e6bd06c34 100644 --- a/include/linux/i2c/pcf857x.h +++ b/include/linux/i2c/pcf857x.h | |||
@@ -10,6 +10,7 @@ | |||
10 | * @setup: optional callback issued once the GPIOs are valid | 10 | * @setup: optional callback issued once the GPIOs are valid |
11 | * @teardown: optional callback issued before the GPIOs are invalidated | 11 | * @teardown: optional callback issued before the GPIOs are invalidated |
12 | * @context: optional parameter passed to setup() and teardown() | 12 | * @context: optional parameter passed to setup() and teardown() |
13 | * @irq: optional interrupt number | ||
13 | * | 14 | * |
14 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, | 15 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, |
15 | * the i2c_board_info used with the pcf875x driver must provide its | 16 | * the i2c_board_info used with the pcf875x driver must provide its |
@@ -39,6 +40,8 @@ struct pcf857x_platform_data { | |||
39 | int gpio, unsigned ngpio, | 40 | int gpio, unsigned ngpio, |
40 | void *context); | 41 | void *context); |
41 | void *context; | 42 | void *context; |
43 | |||
44 | int irq; | ||
42 | }; | 45 | }; |
43 | 46 | ||
44 | #endif /* __LINUX_PCF857X_H */ | 47 | #endif /* __LINUX_PCF857X_H */ |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 7ea898c55a60..a12a38107c1a 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -561,9 +561,6 @@ struct twl4030_bci_platform_data { | |||
561 | 561 | ||
562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ | 562 | /* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */ |
563 | struct twl4030_gpio_platform_data { | 563 | struct twl4030_gpio_platform_data { |
564 | int gpio_base; | ||
565 | unsigned irq_base, irq_end; | ||
566 | |||
567 | /* package the two LED signals as output-only GPIOs? */ | 564 | /* package the two LED signals as output-only GPIOs? */ |
568 | bool use_leds; | 565 | bool use_leds; |
569 | 566 | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index e02fc682bb68..2385119f8bb0 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -1935,36 +1935,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, | |||
1935 | } | 1935 | } |
1936 | 1936 | ||
1937 | /** | 1937 | /** |
1938 | * ieee80211_fhss_chan_to_freq - get channel frequency | ||
1939 | * @channel: the FHSS channel | ||
1940 | * | ||
1941 | * Convert IEEE802.11 FHSS channel to frequency (MHz) | ||
1942 | * Ref IEEE 802.11-2007 section 14.6 | ||
1943 | */ | ||
1944 | static inline int ieee80211_fhss_chan_to_freq(int channel) | ||
1945 | { | ||
1946 | if ((channel > 1) && (channel < 96)) | ||
1947 | return channel + 2400; | ||
1948 | else | ||
1949 | return -1; | ||
1950 | } | ||
1951 | |||
1952 | /** | ||
1953 | * ieee80211_freq_to_fhss_chan - get channel | ||
1954 | * @freq: the channels frequency | ||
1955 | * | ||
1956 | * Convert frequency (MHz) to IEEE802.11 FHSS channel | ||
1957 | * Ref IEEE 802.11-2007 section 14.6 | ||
1958 | */ | ||
1959 | static inline int ieee80211_freq_to_fhss_chan(int freq) | ||
1960 | { | ||
1961 | if ((freq > 2401) && (freq < 2496)) | ||
1962 | return freq - 2400; | ||
1963 | else | ||
1964 | return -1; | ||
1965 | } | ||
1966 | |||
1967 | /** | ||
1968 | * ieee80211_dsss_chan_to_freq - get channel center frequency | 1938 | * ieee80211_dsss_chan_to_freq - get channel center frequency |
1969 | * @channel: the DSSS channel | 1939 | * @channel: the DSSS channel |
1970 | * | 1940 | * |
@@ -2000,56 +1970,6 @@ static inline int ieee80211_freq_to_dsss_chan(int freq) | |||
2000 | return -1; | 1970 | return -1; |
2001 | } | 1971 | } |
2002 | 1972 | ||
2003 | /* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back | ||
2004 | * Ref IEEE 802.11-2007 section 18.4.6.2 | ||
2005 | * | ||
2006 | * The channels and frequencies are the same as those defined for DSSS | ||
2007 | */ | ||
2008 | #define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan) | ||
2009 | #define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq) | ||
2010 | |||
2011 | /* Convert IEEE802.11 ERP channel to frequency (MHz) and back | ||
2012 | * Ref IEEE 802.11-2007 section 19.4.2 | ||
2013 | */ | ||
2014 | #define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan) | ||
2015 | #define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq) | ||
2016 | |||
2017 | /** | ||
2018 | * ieee80211_ofdm_chan_to_freq - get channel center frequency | ||
2019 | * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz | ||
2020 | * @channel: the OFDM channel | ||
2021 | * | ||
2022 | * Convert IEEE802.11 OFDM channel to center frequency (MHz) | ||
2023 | * Ref IEEE 802.11-2007 section 17.3.8.3.2 | ||
2024 | */ | ||
2025 | static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel) | ||
2026 | { | ||
2027 | if ((channel > 0) && (channel <= 200) && | ||
2028 | (s_freq >= 4000)) | ||
2029 | return s_freq + (channel * 5); | ||
2030 | else | ||
2031 | return -1; | ||
2032 | } | ||
2033 | |||
2034 | /** | ||
2035 | * ieee80211_freq_to_ofdm_channel - get channel | ||
2036 | * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz | ||
2037 | * @freq: the frequency | ||
2038 | * | ||
2039 | * Convert frequency (MHz) to IEEE802.11 OFDM channel | ||
2040 | * Ref IEEE 802.11-2007 section 17.3.8.3.2 | ||
2041 | * | ||
2042 | * This routine selects the channel with the closest center frequency. | ||
2043 | */ | ||
2044 | static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq) | ||
2045 | { | ||
2046 | if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) && | ||
2047 | (s_freq >= 4000)) | ||
2048 | return (freq + 2 - s_freq) / 5; | ||
2049 | else | ||
2050 | return -1; | ||
2051 | } | ||
2052 | |||
2053 | /** | 1973 | /** |
2054 | * ieee80211_tu_to_usec - convert time units (TU) to microseconds | 1974 | * ieee80211_tu_to_usec - convert time units (TU) to microseconds |
2055 | * @tu: the TUs | 1975 | * @tu: the TUs |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index f0e69c6e8208..9adcc29f084a 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -92,6 +92,7 @@ | |||
92 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | 92 | #define ARPHRD_PHONET 820 /* PhoNet media type */ |
93 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | 93 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
94 | #define ARPHRD_CAIF 822 /* CAIF media type */ | 94 | #define ARPHRD_CAIF 822 /* CAIF media type */ |
95 | #define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ | ||
95 | 96 | ||
96 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 97 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
97 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 98 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index ac173bd2ab65..e4dad4ddf085 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -272,6 +272,22 @@ enum macvlan_mode { | |||
272 | 272 | ||
273 | #define MACVLAN_FLAG_NOPROMISC 1 | 273 | #define MACVLAN_FLAG_NOPROMISC 1 |
274 | 274 | ||
275 | /* VXLAN section */ | ||
276 | enum { | ||
277 | IFLA_VXLAN_UNSPEC, | ||
278 | IFLA_VXLAN_ID, | ||
279 | IFLA_VXLAN_GROUP, | ||
280 | IFLA_VXLAN_LINK, | ||
281 | IFLA_VXLAN_LOCAL, | ||
282 | IFLA_VXLAN_TTL, | ||
283 | IFLA_VXLAN_TOS, | ||
284 | IFLA_VXLAN_LEARNING, | ||
285 | IFLA_VXLAN_AGEING, | ||
286 | IFLA_VXLAN_LIMIT, | ||
287 | __IFLA_VXLAN_MAX | ||
288 | }; | ||
289 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | ||
290 | |||
275 | /* SR-IOV virtual function management section */ | 291 | /* SR-IOV virtual function management section */ |
276 | 292 | ||
277 | enum { | 293 | enum { |
@@ -398,4 +414,22 @@ struct ifla_port_vsi { | |||
398 | __u8 pad[3]; | 414 | __u8 pad[3]; |
399 | }; | 415 | }; |
400 | 416 | ||
417 | |||
418 | /* IPoIB section */ | ||
419 | |||
420 | enum { | ||
421 | IFLA_IPOIB_UNSPEC, | ||
422 | IFLA_IPOIB_PKEY, | ||
423 | IFLA_IPOIB_MODE, | ||
424 | IFLA_IPOIB_UMCAST, | ||
425 | __IFLA_IPOIB_MAX | ||
426 | }; | ||
427 | |||
428 | enum { | ||
429 | IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */ | ||
430 | IPOIB_MODE_CONNECTED = 1, /* using connected QPs */ | ||
431 | }; | ||
432 | |||
433 | #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1) | ||
434 | |||
401 | #endif /* _LINUX_IF_LINK_H */ | 435 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index aa2e167e1ef4..6d88a7f57680 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -67,6 +67,9 @@ struct team_port { | |||
67 | struct netpoll *np; | 67 | struct netpoll *np; |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | s32 priority; /* lower number ~ higher priority */ | ||
71 | u16 queue_id; | ||
72 | struct list_head qom_list; /* node in queue override mapping list */ | ||
70 | long mode_priv[0]; | 73 | long mode_priv[0]; |
71 | }; | 74 | }; |
72 | 75 | ||
@@ -105,7 +108,7 @@ struct team_mode_ops { | |||
105 | bool (*transmit)(struct team *team, struct sk_buff *skb); | 108 | bool (*transmit)(struct team *team, struct sk_buff *skb); |
106 | int (*port_enter)(struct team *team, struct team_port *port); | 109 | int (*port_enter)(struct team *team, struct team_port *port); |
107 | void (*port_leave)(struct team *team, struct team_port *port); | 110 | void (*port_leave)(struct team *team, struct team_port *port); |
108 | void (*port_change_mac)(struct team *team, struct team_port *port); | 111 | void (*port_change_dev_addr)(struct team *team, struct team_port *port); |
109 | void (*port_enabled)(struct team *team, struct team_port *port); | 112 | void (*port_enabled)(struct team *team, struct team_port *port); |
110 | void (*port_disabled)(struct team *team, struct team_port *port); | 113 | void (*port_disabled)(struct team *team, struct team_port *port); |
111 | }; | 114 | }; |
@@ -115,6 +118,7 @@ enum team_option_type { | |||
115 | TEAM_OPTION_TYPE_STRING, | 118 | TEAM_OPTION_TYPE_STRING, |
116 | TEAM_OPTION_TYPE_BINARY, | 119 | TEAM_OPTION_TYPE_BINARY, |
117 | TEAM_OPTION_TYPE_BOOL, | 120 | TEAM_OPTION_TYPE_BOOL, |
121 | TEAM_OPTION_TYPE_S32, | ||
118 | }; | 122 | }; |
119 | 123 | ||
120 | struct team_option_inst_info { | 124 | struct team_option_inst_info { |
@@ -131,6 +135,7 @@ struct team_gsetter_ctx { | |||
131 | u32 len; | 135 | u32 len; |
132 | } bin_val; | 136 | } bin_val; |
133 | bool bool_val; | 137 | bool bool_val; |
138 | s32 s32_val; | ||
134 | } data; | 139 | } data; |
135 | struct team_option_inst_info *info; | 140 | struct team_option_inst_info *info; |
136 | }; | 141 | }; |
@@ -182,6 +187,8 @@ struct team { | |||
182 | 187 | ||
183 | const struct team_mode *mode; | 188 | const struct team_mode *mode; |
184 | struct team_mode_ops ops; | 189 | struct team_mode_ops ops; |
190 | bool queue_override_enabled; | ||
191 | struct list_head *qom_lists; /* array of queue override mapping lists */ | ||
185 | long mode_priv[TEAM_MODE_PRIV_LONGS]; | 192 | long mode_priv[TEAM_MODE_PRIV_LONGS]; |
186 | }; | 193 | }; |
187 | 194 | ||
@@ -231,7 +238,7 @@ static inline struct team_port *team_get_port_by_index_rcu(struct team *team, | |||
231 | return NULL; | 238 | return NULL; |
232 | } | 239 | } |
233 | 240 | ||
234 | extern int team_port_set_team_mac(struct team_port *port); | 241 | extern int team_port_set_team_dev_addr(struct team_port *port); |
235 | extern int team_options_register(struct team *team, | 242 | extern int team_options_register(struct team *team, |
236 | const struct team_option *option, | 243 | const struct team_option *option, |
237 | size_t option_count); | 244 | size_t option_count); |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 5efff60b6f56..8c5035ac3142 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -75,6 +75,9 @@ enum { | |||
75 | IFLA_GRE_TTL, | 75 | IFLA_GRE_TTL, |
76 | IFLA_GRE_TOS, | 76 | IFLA_GRE_TOS, |
77 | IFLA_GRE_PMTUDISC, | 77 | IFLA_GRE_PMTUDISC, |
78 | IFLA_GRE_ENCAP_LIMIT, | ||
79 | IFLA_GRE_FLOWINFO, | ||
80 | IFLA_GRE_FLAGS, | ||
78 | __IFLA_GRE_MAX, | 81 | __IFLA_GRE_MAX, |
79 | }; | 82 | }; |
80 | 83 | ||
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index a810987cb80e..e6ff12dd717b 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -74,8 +74,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
74 | /* found in socket.c */ | 74 | /* found in socket.c */ |
75 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 75 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
76 | 76 | ||
77 | struct vlan_info; | ||
78 | |||
79 | static inline int is_vlan_dev(struct net_device *dev) | 77 | static inline int is_vlan_dev(struct net_device *dev) |
80 | { | 78 | { |
81 | return dev->priv_flags & IFF_802_1Q_VLAN; | 79 | return dev->priv_flags & IFF_802_1Q_VLAN; |
@@ -101,6 +99,8 @@ extern int vlan_vids_add_by_dev(struct net_device *dev, | |||
101 | const struct net_device *by_dev); | 99 | const struct net_device *by_dev); |
102 | extern void vlan_vids_del_by_dev(struct net_device *dev, | 100 | extern void vlan_vids_del_by_dev(struct net_device *dev, |
103 | const struct net_device *by_dev); | 101 | const struct net_device *by_dev); |
102 | |||
103 | extern bool vlan_uses_dev(const struct net_device *dev); | ||
104 | #else | 104 | #else |
105 | static inline struct net_device * | 105 | static inline struct net_device * |
106 | __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id) | 106 | __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id) |
@@ -151,6 +151,11 @@ static inline void vlan_vids_del_by_dev(struct net_device *dev, | |||
151 | const struct net_device *by_dev) | 151 | const struct net_device *by_dev) |
152 | { | 152 | { |
153 | } | 153 | } |
154 | |||
155 | static inline bool vlan_uses_dev(const struct net_device *dev) | ||
156 | { | ||
157 | return false; | ||
158 | } | ||
154 | #endif | 159 | #endif |
155 | 160 | ||
156 | /** | 161 | /** |
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h new file mode 100644 index 000000000000..2e4eab9868a3 --- /dev/null +++ b/include/linux/iio/adc/ad_sigma_delta.h | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * Support code for Analog Devices Sigma-Delta ADCs | ||
3 | * | ||
4 | * Copyright 2012 Analog Devices Inc. | ||
5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
6 | * | ||
7 | * Licensed under the GPL-2. | ||
8 | */ | ||
9 | #ifndef __AD_SIGMA_DELTA_H__ | ||
10 | #define __AD_SIGMA_DELTA_H__ | ||
11 | |||
12 | enum ad_sigma_delta_mode { | ||
13 | AD_SD_MODE_CONTINUOUS = 0, | ||
14 | AD_SD_MODE_SINGLE = 1, | ||
15 | AD_SD_MODE_IDLE = 2, | ||
16 | AD_SD_MODE_POWERDOWN = 3, | ||
17 | }; | ||
18 | |||
19 | /** | ||
20 | * struct ad_sigma_delta_calib_data - Calibration data for Sigma Delta devices | ||
21 | * @mode: Calibration mode. | ||
22 | * @channel: Calibration channel. | ||
23 | */ | ||
24 | struct ad_sd_calib_data { | ||
25 | unsigned int mode; | ||
26 | unsigned int channel; | ||
27 | }; | ||
28 | |||
29 | struct ad_sigma_delta; | ||
30 | struct iio_dev; | ||
31 | |||
32 | /** | ||
33 | * struct ad_sigma_delta_info - Sigma Delta driver specific callbacks and options | ||
34 | * @set_channel: Will be called to select the current channel, may be NULL. | ||
35 | * @set_mode: Will be called to select the current mode, may be NULL. | ||
36 | * @postprocess_sample: Is called for each sampled data word, can be used to | ||
37 | * modify or drop the sample data, it, may be NULL. | ||
38 | * @has_registers: true if the device has writable and readable registers, false | ||
39 | * if there is just one read-only sample data shift register. | ||
40 | * @addr_shift: Shift of the register address in the communications register. | ||
41 | * @read_mask: Mask for the communications register having the read bit set. | ||
42 | */ | ||
43 | struct ad_sigma_delta_info { | ||
44 | int (*set_channel)(struct ad_sigma_delta *, unsigned int channel); | ||
45 | int (*set_mode)(struct ad_sigma_delta *, enum ad_sigma_delta_mode mode); | ||
46 | int (*postprocess_sample)(struct ad_sigma_delta *, unsigned int raw_sample); | ||
47 | bool has_registers; | ||
48 | unsigned int addr_shift; | ||
49 | unsigned int read_mask; | ||
50 | }; | ||
51 | |||
52 | /** | ||
53 | * struct ad_sigma_delta - Sigma Delta device struct | ||
54 | * @spi: The spi device associated with the Sigma Delta device. | ||
55 | * @trig: The IIO trigger associated with the Sigma Delta device. | ||
56 | * | ||
57 | * Most of the fields are private to the sigma delta library code and should not | ||
58 | * be accessed by individual drivers. | ||
59 | */ | ||
60 | struct ad_sigma_delta { | ||
61 | struct spi_device *spi; | ||
62 | struct iio_trigger *trig; | ||
63 | |||
64 | /* private: */ | ||
65 | struct completion completion; | ||
66 | bool irq_dis; | ||
67 | |||
68 | bool bus_locked; | ||
69 | |||
70 | uint8_t comm; | ||
71 | |||
72 | const struct ad_sigma_delta_info *info; | ||
73 | |||
74 | /* | ||
75 | * DMA (thus cache coherency maintenance) requires the | ||
76 | * transfer buffers to live in their own cache lines. | ||
77 | */ | ||
78 | uint8_t data[4] ____cacheline_aligned; | ||
79 | }; | ||
80 | |||
81 | static inline int ad_sigma_delta_set_channel(struct ad_sigma_delta *sd, | ||
82 | unsigned int channel) | ||
83 | { | ||
84 | if (sd->info->set_channel) | ||
85 | return sd->info->set_channel(sd, channel); | ||
86 | |||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | static inline int ad_sigma_delta_set_mode(struct ad_sigma_delta *sd, | ||
91 | unsigned int mode) | ||
92 | { | ||
93 | if (sd->info->set_mode) | ||
94 | return sd->info->set_mode(sd, mode); | ||
95 | |||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | static inline int ad_sigma_delta_postprocess_sample(struct ad_sigma_delta *sd, | ||
100 | unsigned int raw_sample) | ||
101 | { | ||
102 | if (sd->info->postprocess_sample) | ||
103 | return sd->info->postprocess_sample(sd, raw_sample); | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | void ad_sd_set_comm(struct ad_sigma_delta *sigma_delta, uint8_t comm); | ||
109 | int ad_sd_write_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, | ||
110 | unsigned int size, unsigned int val); | ||
111 | int ad_sd_read_reg(struct ad_sigma_delta *sigma_delta, unsigned int reg, | ||
112 | unsigned int size, unsigned int *val); | ||
113 | |||
114 | int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev, | ||
115 | const struct iio_chan_spec *chan, int *val); | ||
116 | int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta, | ||
117 | const struct ad_sd_calib_data *cd, unsigned int n); | ||
118 | int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, | ||
119 | struct spi_device *spi, const struct ad_sigma_delta_info *info); | ||
120 | |||
121 | int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev); | ||
122 | void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev); | ||
123 | |||
124 | int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); | ||
125 | |||
126 | #define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
127 | _storagebits, _shift, _extend_name, _type) \ | ||
128 | { \ | ||
129 | .type = (_type), \ | ||
130 | .differential = (_channel2 == -1 ? 0 : 1), \ | ||
131 | .indexed = 1, \ | ||
132 | .channel = (_channel1), \ | ||
133 | .channel2 = (_channel2), \ | ||
134 | .address = (_address), \ | ||
135 | .extend_name = (_extend_name), \ | ||
136 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | ||
137 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | ||
138 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | ||
139 | .scan_index = (_si), \ | ||
140 | .scan_type = { \ | ||
141 | .sign = 'u', \ | ||
142 | .realbits = (_bits), \ | ||
143 | .storagebits = (_storagebits), \ | ||
144 | .shift = (_shift), \ | ||
145 | .endianness = IIO_BE, \ | ||
146 | }, \ | ||
147 | } | ||
148 | |||
149 | #define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
150 | _storagebits, _shift) \ | ||
151 | __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ | ||
152 | _storagebits, _shift, NULL, IIO_VOLTAGE) | ||
153 | |||
154 | #define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \ | ||
155 | _storagebits, _shift) \ | ||
156 | __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \ | ||
157 | _storagebits, _shift, "shorted", IIO_VOLTAGE) | ||
158 | |||
159 | #define AD_SD_CHANNEL(_si, _channel, _address, _bits, \ | ||
160 | _storagebits, _shift) \ | ||
161 | __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ | ||
162 | _storagebits, _shift, NULL, IIO_VOLTAGE) | ||
163 | |||
164 | #define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \ | ||
165 | __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \ | ||
166 | _storagebits, _shift, NULL, IIO_TEMP) | ||
167 | |||
168 | #define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \ | ||
169 | _shift) \ | ||
170 | __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ | ||
171 | _storagebits, _shift, "supply", IIO_VOLTAGE) | ||
172 | |||
173 | #endif | ||
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 8ba516fc2ec6..c629b3a1d9a9 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
@@ -36,7 +36,7 @@ struct iio_buffer; | |||
36 | * any of them not existing. | 36 | * any of them not existing. |
37 | **/ | 37 | **/ |
38 | struct iio_buffer_access_funcs { | 38 | struct iio_buffer_access_funcs { |
39 | int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp); | 39 | int (*store_to)(struct iio_buffer *buffer, u8 *data); |
40 | int (*read_first_n)(struct iio_buffer *buffer, | 40 | int (*read_first_n)(struct iio_buffer *buffer, |
41 | size_t n, | 41 | size_t n, |
42 | char __user *buf); | 42 | char __user *buf); |
@@ -118,10 +118,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev, | |||
118 | * iio_push_to_buffer() - push to a registered buffer. | 118 | * iio_push_to_buffer() - push to a registered buffer. |
119 | * @buffer: IIO buffer structure for device | 119 | * @buffer: IIO buffer structure for device |
120 | * @data: the data to push to the buffer | 120 | * @data: the data to push to the buffer |
121 | * @timestamp: timestamp to associate with the data | ||
122 | */ | 121 | */ |
123 | int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, | 122 | int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); |
124 | s64 timestamp); | ||
125 | 123 | ||
126 | int iio_update_demux(struct iio_dev *indio_dev); | 124 | int iio_update_demux(struct iio_dev *indio_dev); |
127 | 125 | ||
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index e2657e6d4d26..e875bcf0478f 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #ifndef _IIO_INKERN_CONSUMER_H_ | 10 | #ifndef _IIO_INKERN_CONSUMER_H_ |
11 | #define _IIO_INKERN_CONSUMER_H | 11 | #define _IIO_INKERN_CONSUMER_H_ |
12 | #include <linux/iio/types.h> | 12 | #include <linux/iio/types.h> |
13 | 13 | ||
14 | struct iio_dev; | 14 | struct iio_dev; |
@@ -61,7 +61,7 @@ void iio_channel_release_all(struct iio_channel *chan); | |||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * iio_read_channel_raw() - read from a given channel | 63 | * iio_read_channel_raw() - read from a given channel |
64 | * @channel: The channel being queried. | 64 | * @chan: The channel being queried. |
65 | * @val: Value read back. | 65 | * @val: Value read back. |
66 | * | 66 | * |
67 | * Note raw reads from iio channels are in adc counts and hence | 67 | * Note raw reads from iio channels are in adc counts and hence |
@@ -71,6 +71,21 @@ int iio_read_channel_raw(struct iio_channel *chan, | |||
71 | int *val); | 71 | int *val); |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * iio_read_channel_processed() - read processed value from a given channel | ||
75 | * @chan: The channel being queried. | ||
76 | * @val: Value read back. | ||
77 | * | ||
78 | * Returns an error code or 0. | ||
79 | * | ||
80 | * This function will read a processed value from a channel. A processed value | ||
81 | * means that this value will have the correct unit and not some device internal | ||
82 | * representation. If the device does not support reporting a processed value | ||
83 | * the function will query the raw value and the channels scale and offset and | ||
84 | * do the appropriate transformation. | ||
85 | */ | ||
86 | int iio_read_channel_processed(struct iio_channel *chan, int *val); | ||
87 | |||
88 | /** | ||
74 | * iio_get_channel_type() - get the type of a channel | 89 | * iio_get_channel_type() - get the type of a channel |
75 | * @channel: The channel being queried. | 90 | * @channel: The channel being queried. |
76 | * @type: The type of the channel. | 91 | * @type: The type of the channel. |
@@ -82,7 +97,7 @@ int iio_get_channel_type(struct iio_channel *channel, | |||
82 | 97 | ||
83 | /** | 98 | /** |
84 | * iio_read_channel_scale() - read the scale value for a channel | 99 | * iio_read_channel_scale() - read the scale value for a channel |
85 | * @channel: The channel being queried. | 100 | * @chan: The channel being queried. |
86 | * @val: First part of value read back. | 101 | * @val: First part of value read back. |
87 | * @val2: Second part of value read back. | 102 | * @val2: Second part of value read back. |
88 | * | 103 | * |
@@ -93,4 +108,27 @@ int iio_get_channel_type(struct iio_channel *channel, | |||
93 | int iio_read_channel_scale(struct iio_channel *chan, int *val, | 108 | int iio_read_channel_scale(struct iio_channel *chan, int *val, |
94 | int *val2); | 109 | int *val2); |
95 | 110 | ||
111 | /** | ||
112 | * iio_convert_raw_to_processed() - Converts a raw value to a processed value | ||
113 | * @chan: The channel being queried | ||
114 | * @raw: The raw IIO to convert | ||
115 | * @processed: The result of the conversion | ||
116 | * @scale: Scale factor to apply during the conversion | ||
117 | * | ||
118 | * Returns an error code or 0. | ||
119 | * | ||
120 | * This function converts a raw value to processed value for a specific channel. | ||
121 | * A raw value is the device internal representation of a sample and the value | ||
122 | * returned by iio_read_channel_raw, so the unit of that value is device | ||
123 | * depended. A processed value on the other hand is value has a normed unit | ||
124 | * according with the IIO specification. | ||
125 | * | ||
126 | * The scale factor allows to increase the precession of the returned value. For | ||
127 | * a scale factor of 1 the function will return the result in the normal IIO | ||
128 | * unit for the channel type. E.g. millivolt for voltage channels, if you want | ||
129 | * nanovolts instead pass 1000 as the scale factor. | ||
130 | */ | ||
131 | int iio_convert_raw_to_processed(struct iio_channel *chan, int raw, | ||
132 | int *processed, unsigned int scale); | ||
133 | |||
96 | #endif | 134 | #endif |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index be82936c4089..c0ae76ac4e0b 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -35,10 +35,13 @@ enum iio_chan_info_enum { | |||
35 | IIO_CHAN_INFO_FREQUENCY, | 35 | IIO_CHAN_INFO_FREQUENCY, |
36 | IIO_CHAN_INFO_PHASE, | 36 | IIO_CHAN_INFO_PHASE, |
37 | IIO_CHAN_INFO_HARDWAREGAIN, | 37 | IIO_CHAN_INFO_HARDWAREGAIN, |
38 | IIO_CHAN_INFO_HYSTERESIS, | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) | 41 | #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) |
41 | #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) | 42 | #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) |
43 | #define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \ | ||
44 | IIO_CHAN_INFO_SEPARATE_BIT(type)) | ||
42 | 45 | ||
43 | #define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ | 46 | #define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ |
44 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) | 47 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) |
@@ -100,6 +103,10 @@ enum iio_chan_info_enum { | |||
100 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | 103 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) |
101 | #define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ | 104 | #define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ |
102 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | 105 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) |
106 | #define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \ | ||
107 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
108 | #define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \ | ||
109 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
103 | 110 | ||
104 | enum iio_endian { | 111 | enum iio_endian { |
105 | IIO_CPU, | 112 | IIO_CPU, |
@@ -164,7 +171,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
164 | * IIO_ENUM() - Initialize enum extended channel attribute | 171 | * IIO_ENUM() - Initialize enum extended channel attribute |
165 | * @_name: Attribute name | 172 | * @_name: Attribute name |
166 | * @_shared: Whether the attribute is shared between all channels | 173 | * @_shared: Whether the attribute is shared between all channels |
167 | * @_e: Pointer to a iio_enum struct | 174 | * @_e: Pointer to an iio_enum struct |
168 | * | 175 | * |
169 | * This should usually be used together with IIO_ENUM_AVAILABLE() | 176 | * This should usually be used together with IIO_ENUM_AVAILABLE() |
170 | */ | 177 | */ |
@@ -180,9 +187,9 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
180 | /** | 187 | /** |
181 | * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute | 188 | * IIO_ENUM_AVAILABLE() - Initialize enum available extended channel attribute |
182 | * @_name: Attribute name ("_available" will be appended to the name) | 189 | * @_name: Attribute name ("_available" will be appended to the name) |
183 | * @_e: Pointer to a iio_enum struct | 190 | * @_e: Pointer to an iio_enum struct |
184 | * | 191 | * |
185 | * Creates a read only attribute which list all the available enum items in a | 192 | * Creates a read only attribute which lists all the available enum items in a |
186 | * space separated list. This should usually be used together with IIO_ENUM() | 193 | * space separated list. This should usually be used together with IIO_ENUM() |
187 | */ | 194 | */ |
188 | #define IIO_ENUM_AVAILABLE(_name, _e) \ | 195 | #define IIO_ENUM_AVAILABLE(_name, _e) \ |
@@ -229,6 +236,7 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
229 | * @indexed: Specify the channel has a numerical index. If not, | 236 | * @indexed: Specify the channel has a numerical index. If not, |
230 | * the channel index number will be suppressed for sysfs | 237 | * the channel index number will be suppressed for sysfs |
231 | * attributes but not for event codes. | 238 | * attributes but not for event codes. |
239 | * @output: Channel is output. | ||
232 | * @differential: Channel is differential. | 240 | * @differential: Channel is differential. |
233 | */ | 241 | */ |
234 | struct iio_chan_spec { | 242 | struct iio_chan_spec { |
@@ -255,6 +263,21 @@ struct iio_chan_spec { | |||
255 | unsigned differential:1; | 263 | unsigned differential:1; |
256 | }; | 264 | }; |
257 | 265 | ||
266 | |||
267 | /** | ||
268 | * iio_channel_has_info() - Checks whether a channel supports a info attribute | ||
269 | * @chan: The channel to be queried | ||
270 | * @type: Type of the info attribute to be checked | ||
271 | * | ||
272 | * Returns true if the channels supports reporting values for the given info | ||
273 | * attribute type, false otherwise. | ||
274 | */ | ||
275 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | ||
276 | enum iio_chan_info_enum type) | ||
277 | { | ||
278 | return chan->info_mask & IIO_CHAN_INFO_BITS(type); | ||
279 | } | ||
280 | |||
258 | #define IIO_ST(si, rb, sb, sh) \ | 281 | #define IIO_ST(si, rb, sb, sh) \ |
259 | { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } | 282 | { .sign = si, .realbits = rb, .storagebits = sb, .shift = sh } |
260 | 283 | ||
@@ -312,6 +335,9 @@ struct iio_dev; | |||
312 | * Meaning is event dependent. | 335 | * Meaning is event dependent. |
313 | * @validate_trigger: function to validate the trigger when the | 336 | * @validate_trigger: function to validate the trigger when the |
314 | * current trigger gets changed. | 337 | * current trigger gets changed. |
338 | * @update_scan_mode: function to configure device and scan buffer when | ||
339 | * channels have changed | ||
340 | * @debugfs_reg_access: function to read or write register value of device | ||
315 | **/ | 341 | **/ |
316 | struct iio_info { | 342 | struct iio_info { |
317 | struct module *driver_module; | 343 | struct module *driver_module; |
@@ -367,10 +393,10 @@ struct iio_info { | |||
367 | * scan mask is valid for the device. | 393 | * scan mask is valid for the device. |
368 | */ | 394 | */ |
369 | struct iio_buffer_setup_ops { | 395 | struct iio_buffer_setup_ops { |
370 | int (*preenable)(struct iio_dev *); | 396 | int (*preenable)(struct iio_dev *); |
371 | int (*postenable)(struct iio_dev *); | 397 | int (*postenable)(struct iio_dev *); |
372 | int (*predisable)(struct iio_dev *); | 398 | int (*predisable)(struct iio_dev *); |
373 | int (*postdisable)(struct iio_dev *); | 399 | int (*postdisable)(struct iio_dev *); |
374 | bool (*validate_scan_mask)(struct iio_dev *indio_dev, | 400 | bool (*validate_scan_mask)(struct iio_dev *indio_dev, |
375 | const unsigned long *scan_mask); | 401 | const unsigned long *scan_mask); |
376 | }; | 402 | }; |
@@ -516,6 +542,31 @@ static inline struct iio_dev *iio_device_get(struct iio_dev *indio_dev) | |||
516 | return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; | 542 | return indio_dev ? dev_to_iio_dev(get_device(&indio_dev->dev)) : NULL; |
517 | } | 543 | } |
518 | 544 | ||
545 | |||
546 | /** | ||
547 | * iio_device_set_drvdata() - Set device driver data | ||
548 | * @indio_dev: IIO device structure | ||
549 | * @data: Driver specific data | ||
550 | * | ||
551 | * Allows to attach an arbitrary pointer to an IIO device, which can later be | ||
552 | * retrieved by iio_device_get_drvdata(). | ||
553 | */ | ||
554 | static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data) | ||
555 | { | ||
556 | dev_set_drvdata(&indio_dev->dev, data); | ||
557 | } | ||
558 | |||
559 | /** | ||
560 | * iio_device_get_drvdata() - Get device driver data | ||
561 | * @indio_dev: IIO device structure | ||
562 | * | ||
563 | * Returns the data previously set with iio_device_set_drvdata() | ||
564 | */ | ||
565 | static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | ||
566 | { | ||
567 | return dev_get_drvdata(&indio_dev->dev); | ||
568 | } | ||
569 | |||
519 | /* Can we make this smaller? */ | 570 | /* Can we make this smaller? */ |
520 | #define IIO_ALIGN L1_CACHE_BYTES | 571 | #define IIO_ALIGN L1_CACHE_BYTES |
521 | /** | 572 | /** |
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h index 014d5a13b32b..25eeac762e84 100644 --- a/include/linux/iio/kfifo_buf.h +++ b/include/linux/iio/kfifo_buf.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #ifndef __LINUX_IIO_KFIFO_BUF_H__ | ||
2 | #define __LINUX_IIO_KFIFO_BUF_H__ | ||
1 | 3 | ||
2 | #include <linux/kfifo.h> | 4 | #include <linux/kfifo.h> |
3 | #include <linux/iio/iio.h> | 5 | #include <linux/iio/iio.h> |
@@ -6,3 +8,4 @@ | |||
6 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); | 8 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); |
7 | void iio_kfifo_free(struct iio_buffer *r); | 9 | void iio_kfifo_free(struct iio_buffer *r); |
8 | 10 | ||
11 | #endif | ||
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h index 400a453ff67b..809a3f08d5a5 100644 --- a/include/linux/iio/machine.h +++ b/include/linux/iio/machine.h | |||
@@ -8,6 +8,9 @@ | |||
8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef __LINUX_IIO_MACHINE_H__ | ||
12 | #define __LINUX_IIO_MACHINE_H__ | ||
13 | |||
11 | /** | 14 | /** |
12 | * struct iio_map - description of link between consumer and device channels | 15 | * struct iio_map - description of link between consumer and device channels |
13 | * @adc_channel_label: Label used to identify the channel on the provider. | 16 | * @adc_channel_label: Label used to identify the channel on the provider. |
@@ -22,3 +25,5 @@ struct iio_map { | |||
22 | const char *consumer_dev_name; | 25 | const char *consumer_dev_name; |
23 | const char *consumer_channel; | 26 | const char *consumer_channel; |
24 | }; | 27 | }; |
28 | |||
29 | #endif | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index a9819940a84c..20239da1d0f7 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -29,7 +29,7 @@ struct iio_subirq { | |||
29 | * instances of a given device. | 29 | * instances of a given device. |
30 | **/ | 30 | **/ |
31 | struct iio_trigger_ops { | 31 | struct iio_trigger_ops { |
32 | struct module *owner; | 32 | struct module *owner; |
33 | int (*set_trigger_state)(struct iio_trigger *trig, bool state); | 33 | int (*set_trigger_state)(struct iio_trigger *trig, bool state); |
34 | int (*try_reenable)(struct iio_trigger *trig); | 34 | int (*try_reenable)(struct iio_trigger *trig); |
35 | int (*validate_device)(struct iio_trigger *trig, | 35 | int (*validate_device)(struct iio_trigger *trig, |
@@ -39,7 +39,7 @@ struct iio_trigger_ops { | |||
39 | 39 | ||
40 | /** | 40 | /** |
41 | * struct iio_trigger - industrial I/O trigger device | 41 | * struct iio_trigger - industrial I/O trigger device |
42 | * | 42 | * @ops: [DRIVER] operations structure |
43 | * @id: [INTERN] unique id number | 43 | * @id: [INTERN] unique id number |
44 | * @name: [DRIVER] unique name | 44 | * @name: [DRIVER] unique name |
45 | * @dev: [DRIVER] associated device (if relevant) | 45 | * @dev: [DRIVER] associated device (if relevant) |
@@ -76,19 +76,19 @@ struct iio_trigger { | |||
76 | static inline struct iio_trigger *to_iio_trigger(struct device *d) | 76 | static inline struct iio_trigger *to_iio_trigger(struct device *d) |
77 | { | 77 | { |
78 | return container_of(d, struct iio_trigger, dev); | 78 | return container_of(d, struct iio_trigger, dev); |
79 | }; | 79 | } |
80 | 80 | ||
81 | static inline void iio_trigger_put(struct iio_trigger *trig) | 81 | static inline void iio_trigger_put(struct iio_trigger *trig) |
82 | { | 82 | { |
83 | module_put(trig->ops->owner); | 83 | module_put(trig->ops->owner); |
84 | put_device(&trig->dev); | 84 | put_device(&trig->dev); |
85 | }; | 85 | } |
86 | 86 | ||
87 | static inline void iio_trigger_get(struct iio_trigger *trig) | 87 | static inline void iio_trigger_get(struct iio_trigger *trig) |
88 | { | 88 | { |
89 | get_device(&trig->dev); | 89 | get_device(&trig->dev); |
90 | __module_get(trig->ops->owner); | 90 | __module_get(trig->ops->owner); |
91 | }; | 91 | } |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * iio_trigger_register() - register a trigger with the IIO core | 94 | * iio_trigger_register() - register a trigger with the IIO core |
@@ -104,7 +104,8 @@ void iio_trigger_unregister(struct iio_trigger *trig_info); | |||
104 | 104 | ||
105 | /** | 105 | /** |
106 | * iio_trigger_poll() - called on a trigger occurring | 106 | * iio_trigger_poll() - called on a trigger occurring |
107 | * @trig: trigger which occurred | 107 | * @trig: trigger which occurred |
108 | * @time: timestamp when trigger occurred | ||
108 | * | 109 | * |
109 | * Typically called in relevant hardware interrupt handler. | 110 | * Typically called in relevant hardware interrupt handler. |
110 | **/ | 111 | **/ |
diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h index 60d64b356945..c4f8c7409666 100644 --- a/include/linux/iio/trigger_consumer.h +++ b/include/linux/iio/trigger_consumer.h | |||
@@ -7,6 +7,15 @@ | |||
7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef __LINUX_IIO_TRIGGER_CONSUMER_H__ | ||
11 | #define __LINUX_IIO_TRIGGER_CONSUMER_H__ | ||
12 | |||
13 | #include <linux/interrupt.h> | ||
14 | #include <linux/types.h> | ||
15 | |||
16 | struct iio_dev; | ||
17 | struct iio_trigger; | ||
18 | |||
10 | /** | 19 | /** |
11 | * struct iio_poll_func - poll function pair | 20 | * struct iio_poll_func - poll function pair |
12 | * | 21 | * |
@@ -50,3 +59,5 @@ void iio_trigger_notify_done(struct iio_trigger *trig); | |||
50 | */ | 59 | */ |
51 | int iio_triggered_buffer_postenable(struct iio_dev *indio_dev); | 60 | int iio_triggered_buffer_postenable(struct iio_dev *indio_dev); |
52 | int iio_triggered_buffer_predisable(struct iio_dev *indio_dev); | 61 | int iio_triggered_buffer_predisable(struct iio_dev *indio_dev); |
62 | |||
63 | #endif | ||
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 44e397705d7f..5c647ecfd5ba 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
@@ -57,5 +57,6 @@ enum iio_modifier { | |||
57 | #define IIO_VAL_INT_PLUS_MICRO 2 | 57 | #define IIO_VAL_INT_PLUS_MICRO 2 |
58 | #define IIO_VAL_INT_PLUS_NANO 3 | 58 | #define IIO_VAL_INT_PLUS_NANO 3 |
59 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 | 59 | #define IIO_VAL_INT_PLUS_MICRO_DB 4 |
60 | #define IIO_VAL_FRACTIONAL 10 | ||
60 | 61 | ||
61 | #endif /* _IIO_TYPES_H_ */ | 62 | #endif /* _IIO_TYPES_H_ */ |
diff --git a/include/linux/ima.h b/include/linux/ima.h index 6ac8e50c6cf5..2c7223d7e73b 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -39,5 +39,32 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot) | |||
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | |||
42 | #endif /* CONFIG_IMA_H */ | 43 | #endif /* CONFIG_IMA_H */ |
44 | |||
45 | #ifdef CONFIG_IMA_APPRAISE | ||
46 | extern void ima_inode_post_setattr(struct dentry *dentry); | ||
47 | extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name, | ||
48 | const void *xattr_value, size_t xattr_value_len); | ||
49 | extern int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name); | ||
50 | #else | ||
51 | static inline void ima_inode_post_setattr(struct dentry *dentry) | ||
52 | { | ||
53 | return; | ||
54 | } | ||
55 | |||
56 | static inline int ima_inode_setxattr(struct dentry *dentry, | ||
57 | const char *xattr_name, | ||
58 | const void *xattr_value, | ||
59 | size_t xattr_value_len) | ||
60 | { | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static inline int ima_inode_removexattr(struct dentry *dentry, | ||
65 | const char *xattr_name) | ||
66 | { | ||
67 | return 0; | ||
68 | } | ||
69 | #endif /* CONFIG_IMA_APPRAISE_H */ | ||
43 | #endif /* _LINUX_IMA_H */ | 70 | #endif /* _LINUX_IMA_H */ |
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index f1362b5447fc..e788c186ed3a 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h | |||
@@ -159,6 +159,7 @@ struct inet_diag_handler { | |||
159 | struct inet_connection_sock; | 159 | struct inet_connection_sock; |
160 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | 160 | int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, |
161 | struct sk_buff *skb, struct inet_diag_req_v2 *req, | 161 | struct sk_buff *skb, struct inet_diag_req_v2 *req, |
162 | struct user_namespace *user_ns, | ||
162 | u32 pid, u32 seq, u16 nlmsg_flags, | 163 | u32 pid, u32 seq, u16 nlmsg_flags, |
163 | const struct nlmsghdr *unlh); | 164 | const struct nlmsghdr *unlh); |
164 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, | 165 | void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb, |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 67f9ddacb70c..d032780d0ce5 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -104,9 +104,14 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
104 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 104 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
105 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ | 105 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ |
106 | IN_DEV_CONF_GET((in_dev), attr)) | 106 | IN_DEV_CONF_GET((in_dev), attr)) |
107 | #define IN_DEV_ORCONF(in_dev, attr) \ | 107 | |
108 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \ | 108 | #define IN_DEV_NET_ORCONF(in_dev, net, attr) \ |
109 | (IPV4_DEVCONF_ALL(net, attr) || \ | ||
109 | IN_DEV_CONF_GET((in_dev), attr)) | 110 | IN_DEV_CONF_GET((in_dev), attr)) |
111 | |||
112 | #define IN_DEV_ORCONF(in_dev, attr) \ | ||
113 | IN_DEV_NET_ORCONF(in_dev, dev_net(in_dev->dev), attr) | ||
114 | |||
110 | #define IN_DEV_MAXCONF(in_dev, attr) \ | 115 | #define IN_DEV_MAXCONF(in_dev, attr) \ |
111 | (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \ | 116 | (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \ |
112 | IN_DEV_CONF_GET((in_dev), attr))) | 117 | IN_DEV_CONF_GET((in_dev), attr))) |
@@ -133,6 +138,8 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
133 | IN_DEV_ORCONF((in_dev), \ | 138 | IN_DEV_ORCONF((in_dev), \ |
134 | PROMOTE_SECONDARIES) | 139 | PROMOTE_SECONDARIES) |
135 | #define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET) | 140 | #define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET) |
141 | #define IN_DEV_NET_ROUTE_LOCALNET(in_dev, net) \ | ||
142 | IN_DEV_NET_ORCONF(in_dev, net, ROUTE_LOCALNET) | ||
136 | 143 | ||
137 | #define IN_DEV_RX_REDIRECTS(in_dev) \ | 144 | #define IN_DEV_RX_REDIRECTS(in_dev) \ |
138 | ((IN_DEV_FORWARD(in_dev) && \ | 145 | ((IN_DEV_FORWARD(in_dev) && \ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 89f1cb1056f0..6d087c5f57f7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -92,7 +92,7 @@ extern struct group_info init_groups; | |||
92 | 92 | ||
93 | #ifdef CONFIG_AUDITSYSCALL | 93 | #ifdef CONFIG_AUDITSYSCALL |
94 | #define INIT_IDS \ | 94 | #define INIT_IDS \ |
95 | .loginuid = -1, \ | 95 | .loginuid = INVALID_UID, \ |
96 | .sessionid = -1, | 96 | .sessionid = -1, |
97 | #else | 97 | #else |
98 | #define INIT_IDS | 98 | #define INIT_IDS |
diff --git a/include/linux/input.h b/include/linux/input.h index 725dcd0f63a4..ba4874302939 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1169,6 +1169,18 @@ struct ff_effect { | |||
1169 | #include <linux/mod_devicetable.h> | 1169 | #include <linux/mod_devicetable.h> |
1170 | 1170 | ||
1171 | /** | 1171 | /** |
1172 | * struct input_value - input value representation | ||
1173 | * @type: type of value (EV_KEY, EV_ABS, etc) | ||
1174 | * @code: the value code | ||
1175 | * @value: the value | ||
1176 | */ | ||
1177 | struct input_value { | ||
1178 | __u16 type; | ||
1179 | __u16 code; | ||
1180 | __s32 value; | ||
1181 | }; | ||
1182 | |||
1183 | /** | ||
1172 | * struct input_dev - represents an input device | 1184 | * struct input_dev - represents an input device |
1173 | * @name: name of the device | 1185 | * @name: name of the device |
1174 | * @phys: physical path to the device in the system hierarchy | 1186 | * @phys: physical path to the device in the system hierarchy |
@@ -1203,11 +1215,7 @@ struct ff_effect { | |||
1203 | * software autorepeat | 1215 | * software autorepeat |
1204 | * @timer: timer for software autorepeat | 1216 | * @timer: timer for software autorepeat |
1205 | * @rep: current values for autorepeat parameters (delay, rate) | 1217 | * @rep: current values for autorepeat parameters (delay, rate) |
1206 | * @mt: pointer to array of struct input_mt_slot holding current values | 1218 | * @mt: pointer to multitouch state |
1207 | * of tracked contacts | ||
1208 | * @mtsize: number of MT slots the device uses | ||
1209 | * @slot: MT slot currently being transmitted | ||
1210 | * @trkid: stores MT tracking ID for the current contact | ||
1211 | * @absinfo: array of &struct input_absinfo elements holding information | 1219 | * @absinfo: array of &struct input_absinfo elements holding information |
1212 | * about absolute axes (current value, min, max, flat, fuzz, | 1220 | * about absolute axes (current value, min, max, flat, fuzz, |
1213 | * resolution) | 1221 | * resolution) |
@@ -1244,7 +1252,6 @@ struct ff_effect { | |||
1244 | * last user closes the device | 1252 | * last user closes the device |
1245 | * @going_away: marks devices that are in a middle of unregistering and | 1253 | * @going_away: marks devices that are in a middle of unregistering and |
1246 | * causes input_open_device*() fail with -ENODEV. | 1254 | * causes input_open_device*() fail with -ENODEV. |
1247 | * @sync: set to %true when there were no new events since last EV_SYN | ||
1248 | * @dev: driver model's view of this device | 1255 | * @dev: driver model's view of this device |
1249 | * @h_list: list of input handles associated with the device. When | 1256 | * @h_list: list of input handles associated with the device. When |
1250 | * accessing the list dev->mutex must be held | 1257 | * accessing the list dev->mutex must be held |
@@ -1287,10 +1294,7 @@ struct input_dev { | |||
1287 | 1294 | ||
1288 | int rep[REP_CNT]; | 1295 | int rep[REP_CNT]; |
1289 | 1296 | ||
1290 | struct input_mt_slot *mt; | 1297 | struct input_mt *mt; |
1291 | int mtsize; | ||
1292 | int slot; | ||
1293 | int trkid; | ||
1294 | 1298 | ||
1295 | struct input_absinfo *absinfo; | 1299 | struct input_absinfo *absinfo; |
1296 | 1300 | ||
@@ -1312,12 +1316,14 @@ struct input_dev { | |||
1312 | unsigned int users; | 1316 | unsigned int users; |
1313 | bool going_away; | 1317 | bool going_away; |
1314 | 1318 | ||
1315 | bool sync; | ||
1316 | |||
1317 | struct device dev; | 1319 | struct device dev; |
1318 | 1320 | ||
1319 | struct list_head h_list; | 1321 | struct list_head h_list; |
1320 | struct list_head node; | 1322 | struct list_head node; |
1323 | |||
1324 | unsigned int num_vals; | ||
1325 | unsigned int max_vals; | ||
1326 | struct input_value *vals; | ||
1321 | }; | 1327 | }; |
1322 | #define to_input_dev(d) container_of(d, struct input_dev, dev) | 1328 | #define to_input_dev(d) container_of(d, struct input_dev, dev) |
1323 | 1329 | ||
@@ -1378,6 +1384,9 @@ struct input_handle; | |||
1378 | * @event: event handler. This method is being called by input core with | 1384 | * @event: event handler. This method is being called by input core with |
1379 | * interrupts disabled and dev->event_lock spinlock held and so | 1385 | * interrupts disabled and dev->event_lock spinlock held and so |
1380 | * it may not sleep | 1386 | * it may not sleep |
1387 | * @events: event sequence handler. This method is being called by | ||
1388 | * input core with interrupts disabled and dev->event_lock | ||
1389 | * spinlock held and so it may not sleep | ||
1381 | * @filter: similar to @event; separates normal event handlers from | 1390 | * @filter: similar to @event; separates normal event handlers from |
1382 | * "filters". | 1391 | * "filters". |
1383 | * @match: called after comparing device's id with handler's id_table | 1392 | * @match: called after comparing device's id with handler's id_table |
@@ -1414,6 +1423,8 @@ struct input_handler { | |||
1414 | void *private; | 1423 | void *private; |
1415 | 1424 | ||
1416 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1425 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
1426 | void (*events)(struct input_handle *handle, | ||
1427 | const struct input_value *vals, unsigned int count); | ||
1417 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1428 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
1418 | bool (*match)(struct input_handler *handler, struct input_dev *dev); | 1429 | bool (*match)(struct input_handler *handler, struct input_dev *dev); |
1419 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); | 1430 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h index f86737586e19..cc5cca774bab 100644 --- a/include/linux/input/mt.h +++ b/include/linux/input/mt.h | |||
@@ -15,12 +15,41 @@ | |||
15 | 15 | ||
16 | #define TRKID_MAX 0xffff | 16 | #define TRKID_MAX 0xffff |
17 | 17 | ||
18 | #define INPUT_MT_POINTER 0x0001 /* pointer device, e.g. trackpad */ | ||
19 | #define INPUT_MT_DIRECT 0x0002 /* direct device, e.g. touchscreen */ | ||
20 | #define INPUT_MT_DROP_UNUSED 0x0004 /* drop contacts not seen in frame */ | ||
21 | #define INPUT_MT_TRACK 0x0008 /* use in-kernel tracking */ | ||
22 | |||
18 | /** | 23 | /** |
19 | * struct input_mt_slot - represents the state of an input MT slot | 24 | * struct input_mt_slot - represents the state of an input MT slot |
20 | * @abs: holds current values of ABS_MT axes for this slot | 25 | * @abs: holds current values of ABS_MT axes for this slot |
26 | * @frame: last frame at which input_mt_report_slot_state() was called | ||
27 | * @key: optional driver designation of this slot | ||
21 | */ | 28 | */ |
22 | struct input_mt_slot { | 29 | struct input_mt_slot { |
23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | 30 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; |
31 | unsigned int frame; | ||
32 | unsigned int key; | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * struct input_mt - state of tracked contacts | ||
37 | * @trkid: stores MT tracking ID for the next contact | ||
38 | * @num_slots: number of MT slots the device uses | ||
39 | * @slot: MT slot currently being transmitted | ||
40 | * @flags: input_mt operation flags | ||
41 | * @frame: increases every time input_mt_sync_frame() is called | ||
42 | * @red: reduced cost matrix for in-kernel tracking | ||
43 | * @slots: array of slots holding current values of tracked contacts | ||
44 | */ | ||
45 | struct input_mt { | ||
46 | int trkid; | ||
47 | int num_slots; | ||
48 | int slot; | ||
49 | unsigned int flags; | ||
50 | unsigned int frame; | ||
51 | int *red; | ||
52 | struct input_mt_slot slots[]; | ||
24 | }; | 53 | }; |
25 | 54 | ||
26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | 55 | static inline void input_mt_set_value(struct input_mt_slot *slot, |
@@ -35,12 +64,18 @@ static inline int input_mt_get_value(const struct input_mt_slot *slot, | |||
35 | return slot->abs[code - ABS_MT_FIRST]; | 64 | return slot->abs[code - ABS_MT_FIRST]; |
36 | } | 65 | } |
37 | 66 | ||
38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | 67 | static inline bool input_mt_is_active(const struct input_mt_slot *slot) |
68 | { | ||
69 | return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; | ||
70 | } | ||
71 | |||
72 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, | ||
73 | unsigned int flags); | ||
39 | void input_mt_destroy_slots(struct input_dev *dev); | 74 | void input_mt_destroy_slots(struct input_dev *dev); |
40 | 75 | ||
41 | static inline int input_mt_new_trkid(struct input_dev *dev) | 76 | static inline int input_mt_new_trkid(struct input_mt *mt) |
42 | { | 77 | { |
43 | return dev->trkid++ & TRKID_MAX; | 78 | return mt->trkid++ & TRKID_MAX; |
44 | } | 79 | } |
45 | 80 | ||
46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | 81 | static inline void input_mt_slot(struct input_dev *dev, int slot) |
@@ -64,4 +99,20 @@ void input_mt_report_slot_state(struct input_dev *dev, | |||
64 | void input_mt_report_finger_count(struct input_dev *dev, int count); | 99 | void input_mt_report_finger_count(struct input_dev *dev, int count); |
65 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); | 100 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); |
66 | 101 | ||
102 | void input_mt_sync_frame(struct input_dev *dev); | ||
103 | |||
104 | /** | ||
105 | * struct input_mt_pos - contact position | ||
106 | * @x: horizontal coordinate | ||
107 | * @y: vertical coordinate | ||
108 | */ | ||
109 | struct input_mt_pos { | ||
110 | s16 x, y; | ||
111 | }; | ||
112 | |||
113 | int input_mt_assign_slots(struct input_dev *dev, int *slots, | ||
114 | const struct input_mt_pos *pos, int num_pos); | ||
115 | |||
116 | int input_mt_get_slot_by_key(struct input_dev *dev, int key); | ||
117 | |||
67 | #endif | 118 | #endif |
diff --git a/include/linux/input/tegra_kbc.h b/include/linux/input/tegra_kbc.h new file mode 100644 index 000000000000..a13025612939 --- /dev/null +++ b/include/linux/input/tegra_kbc.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Platform definitions for tegra-kbc keyboard input driver | ||
3 | * | ||
4 | * Copyright (c) 2010-2011, NVIDIA 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, 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 | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef ASMARM_ARCH_TEGRA_KBC_H | ||
22 | #define ASMARM_ARCH_TEGRA_KBC_H | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/input/matrix_keypad.h> | ||
26 | |||
27 | #define KBC_MAX_GPIO 24 | ||
28 | #define KBC_MAX_KPENT 8 | ||
29 | |||
30 | #define KBC_MAX_ROW 16 | ||
31 | #define KBC_MAX_COL 8 | ||
32 | #define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL) | ||
33 | |||
34 | enum tegra_pin_type { | ||
35 | PIN_CFG_IGNORE, | ||
36 | PIN_CFG_COL, | ||
37 | PIN_CFG_ROW, | ||
38 | }; | ||
39 | |||
40 | struct tegra_kbc_pin_cfg { | ||
41 | enum tegra_pin_type type; | ||
42 | unsigned char num; | ||
43 | }; | ||
44 | |||
45 | struct tegra_kbc_wake_key { | ||
46 | u8 row:4; | ||
47 | u8 col:4; | ||
48 | }; | ||
49 | |||
50 | struct tegra_kbc_platform_data { | ||
51 | unsigned int debounce_cnt; | ||
52 | unsigned int repeat_cnt; | ||
53 | |||
54 | struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO]; | ||
55 | const struct matrix_keymap_data *keymap_data; | ||
56 | |||
57 | u32 wakeup_key; | ||
58 | bool wakeup; | ||
59 | bool use_fn_map; | ||
60 | bool use_ghost_filter; | ||
61 | }; | ||
62 | #endif | ||
diff --git a/include/linux/integrity.h b/include/linux/integrity.h index a0c41256cb92..66c5fe9550a5 100644 --- a/include/linux/integrity.h +++ b/include/linux/integrity.h | |||
@@ -22,13 +22,14 @@ enum integrity_status { | |||
22 | 22 | ||
23 | /* List of EVM protected security xattrs */ | 23 | /* List of EVM protected security xattrs */ |
24 | #ifdef CONFIG_INTEGRITY | 24 | #ifdef CONFIG_INTEGRITY |
25 | extern int integrity_inode_alloc(struct inode *inode); | 25 | extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode); |
26 | extern void integrity_inode_free(struct inode *inode); | 26 | extern void integrity_inode_free(struct inode *inode); |
27 | 27 | ||
28 | #else | 28 | #else |
29 | static inline int integrity_inode_alloc(struct inode *inode) | 29 | static inline struct integrity_iint_cache * |
30 | integrity_inode_get(struct inode *inode) | ||
30 | { | 31 | { |
31 | return 0; | 32 | return NULL; |
32 | } | 33 | } |
33 | 34 | ||
34 | static inline void integrity_inode_free(struct inode *inode) | 35 | static inline void integrity_inode_free(struct inode *inode) |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c5f856a040b9..5e4e6170f43a 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -430,6 +430,8 @@ enum | |||
430 | NR_SOFTIRQS | 430 | NR_SOFTIRQS |
431 | }; | 431 | }; |
432 | 432 | ||
433 | #define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ)) | ||
434 | |||
433 | /* map softirq index to softirq name. update 'softirq_to_name' in | 435 | /* map softirq index to softirq name. update 'softirq_to_name' in |
434 | * kernel/softirq.c when adding a new softirq. | 436 | * kernel/softirq.c when adding a new softirq. |
435 | */ | 437 | */ |
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h index bf22b0317902..48af63c9a48d 100644 --- a/include/linux/ip6_tunnel.h +++ b/include/linux/ip6_tunnel.h | |||
@@ -31,4 +31,21 @@ struct ip6_tnl_parm { | |||
31 | struct in6_addr raddr; /* remote tunnel end-point address */ | 31 | struct in6_addr raddr; /* remote tunnel end-point address */ |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct ip6_tnl_parm2 { | ||
35 | char name[IFNAMSIZ]; /* name of tunnel device */ | ||
36 | int link; /* ifindex of underlying L2 interface */ | ||
37 | __u8 proto; /* tunnel protocol */ | ||
38 | __u8 encap_limit; /* encapsulation limit for tunnel */ | ||
39 | __u8 hop_limit; /* hop limit for tunnel */ | ||
40 | __be32 flowinfo; /* traffic class and flowlabel for tunnel */ | ||
41 | __u32 flags; /* tunnel flags */ | ||
42 | struct in6_addr laddr; /* local tunnel end-point address */ | ||
43 | struct in6_addr raddr; /* remote tunnel end-point address */ | ||
44 | |||
45 | __be16 i_flags; | ||
46 | __be16 o_flags; | ||
47 | __be32 i_key; | ||
48 | __be32 o_key; | ||
49 | }; | ||
50 | |||
34 | #endif | 51 | #endif |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 30e816148df4..ca833fdc3138 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -79,6 +79,7 @@ struct ipc_kludge { | |||
79 | 79 | ||
80 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
81 | #include <linux/spinlock.h> | 81 | #include <linux/spinlock.h> |
82 | #include <linux/uidgid.h> | ||
82 | 83 | ||
83 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ | 84 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
84 | 85 | ||
@@ -89,10 +90,10 @@ struct kern_ipc_perm | |||
89 | int deleted; | 90 | int deleted; |
90 | int id; | 91 | int id; |
91 | key_t key; | 92 | key_t key; |
92 | uid_t uid; | 93 | kuid_t uid; |
93 | gid_t gid; | 94 | kgid_t gid; |
94 | uid_t cuid; | 95 | kuid_t cuid; |
95 | gid_t cgid; | 96 | kgid_t cgid; |
96 | umode_t mode; | 97 | umode_t mode; |
97 | unsigned long seq; | 98 | unsigned long seq; |
98 | void *security; | 99 | void *security; |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 879db26ec401..0b94e91ed685 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -256,6 +256,7 @@ struct inet6_skb_parm { | |||
256 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 256 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
257 | __u16 dsthao; | 257 | __u16 dsthao; |
258 | #endif | 258 | #endif |
259 | __u16 frag_max_size; | ||
259 | 260 | ||
260 | #define IP6SKB_XFRM_TRANSFORMED 1 | 261 | #define IP6SKB_XFRM_TRANSFORMED 1 |
261 | #define IP6SKB_FORWARDED 2 | 262 | #define IP6SKB_FORWARDED 2 |
diff --git a/include/linux/irqchip/bcm2835.h b/include/linux/irqchip/bcm2835.h new file mode 100644 index 000000000000..48a859bc9dca --- /dev/null +++ b/include/linux/irqchip/bcm2835.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Broadcom | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_IRQCHIP_BCM2835_H_ | ||
20 | #define __LINUX_IRQCHIP_BCM2835_H_ | ||
21 | |||
22 | #include <asm/exception.h> | ||
23 | |||
24 | extern void bcm2835_init_irq(void); | ||
25 | |||
26 | extern asmlinkage void __exception_irq_entry bcm2835_handle_irq( | ||
27 | struct pt_regs *regs); | ||
28 | |||
29 | #endif | ||
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 9a323d12de1c..0ba014c55056 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -10,12 +10,10 @@ | |||
10 | 10 | ||
11 | struct irq_affinity_notify; | 11 | struct irq_affinity_notify; |
12 | struct proc_dir_entry; | 12 | struct proc_dir_entry; |
13 | struct timer_rand_state; | ||
14 | struct module; | 13 | struct module; |
15 | /** | 14 | /** |
16 | * struct irq_desc - interrupt descriptor | 15 | * struct irq_desc - interrupt descriptor |
17 | * @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 |
18 | * @timer_rand_state: pointer to timer rand state struct | ||
19 | * @kstat_irqs: irq stats per cpu | 17 | * @kstat_irqs: irq stats per cpu |
20 | * @handle_irq: highlevel irq-events handler | 18 | * @handle_irq: highlevel irq-events handler |
21 | * @preflow_handler: handler called before the flow handler (currently used by sparc) | 19 | * @preflow_handler: handler called before the flow handler (currently used by sparc) |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h deleted file mode 100644 index ad700a60c158..000000000000 --- a/include/linux/istallion.h +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * istallion.h -- stallion intelligent multiport serial driver. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | /*****************************************************************************/ | ||
25 | #ifndef _ISTALLION_H | ||
26 | #define _ISTALLION_H | ||
27 | /*****************************************************************************/ | ||
28 | |||
29 | /* | ||
30 | * Define important driver constants here. | ||
31 | */ | ||
32 | #define STL_MAXBRDS 4 | ||
33 | #define STL_MAXPANELS 4 | ||
34 | #define STL_MAXPORTS 64 | ||
35 | #define STL_MAXCHANS (STL_MAXPORTS + 1) | ||
36 | #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS) | ||
37 | |||
38 | |||
39 | /* | ||
40 | * Define a set of structures to hold all the board/panel/port info | ||
41 | * for our ports. These will be dynamically allocated as required at | ||
42 | * driver initialization time. | ||
43 | */ | ||
44 | |||
45 | /* | ||
46 | * Port and board structures to hold status info about each object. | ||
47 | * The board structure contains pointers to structures for each port | ||
48 | * connected to it. Panels are not distinguished here, since | ||
49 | * communication with the slave board will always be on a per port | ||
50 | * basis. | ||
51 | */ | ||
52 | struct stliport { | ||
53 | unsigned long magic; | ||
54 | struct tty_port port; | ||
55 | unsigned int portnr; | ||
56 | unsigned int panelnr; | ||
57 | unsigned int brdnr; | ||
58 | unsigned long state; | ||
59 | unsigned int devnr; | ||
60 | int baud_base; | ||
61 | int custom_divisor; | ||
62 | int closing_wait; | ||
63 | int rc; | ||
64 | int argsize; | ||
65 | void *argp; | ||
66 | unsigned int rxmarkmsk; | ||
67 | wait_queue_head_t raw_wait; | ||
68 | struct asysigs asig; | ||
69 | unsigned long addr; | ||
70 | unsigned long rxoffset; | ||
71 | unsigned long txoffset; | ||
72 | unsigned long sigs; | ||
73 | unsigned long pflag; | ||
74 | unsigned int rxsize; | ||
75 | unsigned int txsize; | ||
76 | unsigned char reqbit; | ||
77 | unsigned char portidx; | ||
78 | unsigned char portbit; | ||
79 | }; | ||
80 | |||
81 | /* | ||
82 | * Use a structure of function pointers to do board level operations. | ||
83 | * These include, enable/disable, paging shared memory, interrupting, etc. | ||
84 | */ | ||
85 | struct stlibrd { | ||
86 | unsigned long magic; | ||
87 | unsigned int brdnr; | ||
88 | unsigned int brdtype; | ||
89 | unsigned long state; | ||
90 | unsigned int nrpanels; | ||
91 | unsigned int nrports; | ||
92 | unsigned int nrdevs; | ||
93 | unsigned int iobase; | ||
94 | int iosize; | ||
95 | unsigned long memaddr; | ||
96 | void __iomem *membase; | ||
97 | unsigned long memsize; | ||
98 | int pagesize; | ||
99 | int hostoffset; | ||
100 | int slaveoffset; | ||
101 | int bitsize; | ||
102 | int enabval; | ||
103 | unsigned int panels[STL_MAXPANELS]; | ||
104 | int panelids[STL_MAXPANELS]; | ||
105 | void (*init)(struct stlibrd *brdp); | ||
106 | void (*enable)(struct stlibrd *brdp); | ||
107 | void (*reenable)(struct stlibrd *brdp); | ||
108 | void (*disable)(struct stlibrd *brdp); | ||
109 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); | ||
110 | void (*intr)(struct stlibrd *brdp); | ||
111 | void (*reset)(struct stlibrd *brdp); | ||
112 | struct stliport *ports[STL_MAXPORTS]; | ||
113 | }; | ||
114 | |||
115 | |||
116 | /* | ||
117 | * Define MAGIC numbers used for above structures. | ||
118 | */ | ||
119 | #define STLI_PORTMAGIC 0xe671c7a1 | ||
120 | #define STLI_BOARDMAGIC 0x4bc6c825 | ||
121 | |||
122 | /*****************************************************************************/ | ||
123 | #endif | ||
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 82680541576d..05e3c2c7a8cf 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -312,7 +312,13 @@ extern void jiffies_to_timespec(const unsigned long jiffies, | |||
312 | extern unsigned long timeval_to_jiffies(const struct timeval *value); | 312 | extern unsigned long timeval_to_jiffies(const struct timeval *value); |
313 | extern void jiffies_to_timeval(const unsigned long jiffies, | 313 | extern void jiffies_to_timeval(const unsigned long jiffies, |
314 | struct timeval *value); | 314 | struct timeval *value); |
315 | |||
315 | extern clock_t jiffies_to_clock_t(unsigned long x); | 316 | extern clock_t jiffies_to_clock_t(unsigned long x); |
317 | static inline clock_t jiffies_delta_to_clock_t(long delta) | ||
318 | { | ||
319 | return jiffies_to_clock_t(max(0L, delta)); | ||
320 | } | ||
321 | |||
316 | extern unsigned long clock_t_to_jiffies(unsigned long x); | 322 | extern unsigned long clock_t_to_jiffies(unsigned long x); |
317 | extern u64 jiffies_64_to_clock_t(u64 x); | 323 | extern u64 jiffies_64_to_clock_t(u64 x); |
318 | extern u64 nsec_to_clock_t(u64 x); | 324 | extern u64 nsec_to_clock_t(u64 x); |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index daf4a3a40ee0..b7c8cdc1d422 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -65,7 +65,6 @@ struct kbd_struct { | |||
65 | 65 | ||
66 | extern int kbd_init(void); | 66 | extern int kbd_init(void); |
67 | 67 | ||
68 | extern unsigned char getledstate(void); | ||
69 | extern void setledstate(struct kbd_struct *kbd, unsigned int led); | 68 | extern void setledstate(struct kbd_struct *kbd, unsigned int led); |
70 | 69 | ||
71 | extern int do_poke_blanked_console; | 70 | extern int do_poke_blanked_console; |
@@ -145,16 +144,4 @@ void compute_shiftstate(void); | |||
145 | 144 | ||
146 | extern unsigned int keymap_count; | 145 | extern unsigned int keymap_count; |
147 | 146 | ||
148 | /* console.c */ | ||
149 | |||
150 | static inline void con_schedule_flip(struct tty_struct *t) | ||
151 | { | ||
152 | unsigned long flags; | ||
153 | spin_lock_irqsave(&t->buf.lock, flags); | ||
154 | if (t->buf.tail != NULL) | ||
155 | t->buf.tail->commit = t->buf.tail->used; | ||
156 | spin_unlock_irqrestore(&t->buf.lock, flags); | ||
157 | schedule_work(&t->buf.work); | ||
158 | } | ||
159 | |||
160 | #endif | 147 | #endif |
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index 42d9e863a313..7f6fe6e015bc 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
@@ -13,6 +13,14 @@ | |||
13 | * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com> | 13 | * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com> |
14 | */ | 14 | */ |
15 | 15 | ||
16 | typedef enum { | ||
17 | KDB_REPEAT_NONE = 0, /* Do not repeat this command */ | ||
18 | KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */ | ||
19 | KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */ | ||
20 | } kdb_repeat_t; | ||
21 | |||
22 | typedef int (*kdb_func_t)(int, const char **); | ||
23 | |||
16 | #ifdef CONFIG_KGDB_KDB | 24 | #ifdef CONFIG_KGDB_KDB |
17 | #include <linux/init.h> | 25 | #include <linux/init.h> |
18 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
@@ -32,14 +40,6 @@ extern atomic_t kdb_event; | |||
32 | 40 | ||
33 | #define KDB_MAXARGS 16 /* Maximum number of arguments to a function */ | 41 | #define KDB_MAXARGS 16 /* Maximum number of arguments to a function */ |
34 | 42 | ||
35 | typedef enum { | ||
36 | KDB_REPEAT_NONE = 0, /* Do not repeat this command */ | ||
37 | KDB_REPEAT_NO_ARGS, /* Repeat the command without arguments */ | ||
38 | KDB_REPEAT_WITH_ARGS, /* Repeat the command including its arguments */ | ||
39 | } kdb_repeat_t; | ||
40 | |||
41 | typedef int (*kdb_func_t)(int, const char **); | ||
42 | |||
43 | /* KDB return codes from a command or internal kdb function */ | 43 | /* KDB return codes from a command or internal kdb function */ |
44 | #define KDB_NOTFOUND (-1) | 44 | #define KDB_NOTFOUND (-1) |
45 | #define KDB_ARGCOUNT (-2) | 45 | #define KDB_ARGCOUNT (-2) |
@@ -149,11 +149,14 @@ extern int kdb_register_repeat(char *, kdb_func_t, char *, char *, | |||
149 | short, kdb_repeat_t); | 149 | short, kdb_repeat_t); |
150 | extern int kdb_unregister(char *); | 150 | extern int kdb_unregister(char *); |
151 | #else /* ! CONFIG_KGDB_KDB */ | 151 | #else /* ! CONFIG_KGDB_KDB */ |
152 | #define kdb_printf(...) | 152 | static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; } |
153 | #define kdb_init(x) | 153 | static inline void kdb_init(int level) {} |
154 | #define kdb_register(...) | 154 | static inline int kdb_register(char *cmd, kdb_func_t func, char *usage, |
155 | #define kdb_register_repeat(...) | 155 | char *help, short minlen) { return 0; } |
156 | #define kdb_uregister(x) | 156 | static inline int kdb_register_repeat(char *cmd, kdb_func_t func, char *usage, |
157 | char *help, short minlen, | ||
158 | kdb_repeat_t repeat) { return 0; } | ||
159 | static inline int kdb_unregister(char *cmd) { return 0; } | ||
157 | #endif /* CONFIG_KGDB_KDB */ | 160 | #endif /* CONFIG_KGDB_KDB */ |
158 | enum { | 161 | enum { |
159 | KDB_NOT_INITIALIZED, | 162 | KDB_NOT_INITIALIZED, |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 2fbd9053c2df..36d12f0884c3 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -130,4 +130,12 @@ extern void account_process_tick(struct task_struct *, int user); | |||
130 | extern void account_steal_ticks(unsigned long ticks); | 130 | extern void account_steal_ticks(unsigned long ticks); |
131 | extern void account_idle_ticks(unsigned long ticks); | 131 | extern void account_idle_ticks(unsigned long ticks); |
132 | 132 | ||
133 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
134 | extern void vtime_task_switch(struct task_struct *prev); | ||
135 | extern void vtime_account_system(struct task_struct *tsk); | ||
136 | extern void vtime_account_idle(struct task_struct *tsk); | ||
137 | #else | ||
138 | static inline void vtime_task_switch(struct task_struct *prev) { } | ||
139 | #endif | ||
140 | |||
133 | #endif /* _LINUX_KERNEL_STAT_H */ | 141 | #endif /* _LINUX_KERNEL_STAT_H */ |
diff --git a/include/linux/key.h b/include/linux/key.h index cef3b315ba7c..2393b1c040b6 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/atomic.h> | 24 | #include <linux/atomic.h> |
25 | 25 | ||
26 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
27 | #include <linux/uidgid.h> | ||
27 | 28 | ||
28 | /* key handle serial number */ | 29 | /* key handle serial number */ |
29 | typedef int32_t key_serial_t; | 30 | typedef int32_t key_serial_t; |
@@ -137,8 +138,8 @@ struct key { | |||
137 | time_t revoked_at; /* time at which key was revoked */ | 138 | time_t revoked_at; /* time at which key was revoked */ |
138 | }; | 139 | }; |
139 | time_t last_used_at; /* last time used for LRU keyring discard */ | 140 | time_t last_used_at; /* last time used for LRU keyring discard */ |
140 | uid_t uid; | 141 | kuid_t uid; |
141 | gid_t gid; | 142 | kgid_t gid; |
142 | key_perm_t perm; /* access permissions */ | 143 | key_perm_t perm; /* access permissions */ |
143 | unsigned short quotalen; /* length added to quota */ | 144 | unsigned short quotalen; /* length added to quota */ |
144 | unsigned short datalen; /* payload data length | 145 | unsigned short datalen; /* payload data length |
@@ -193,7 +194,7 @@ struct key { | |||
193 | 194 | ||
194 | extern struct key *key_alloc(struct key_type *type, | 195 | extern struct key *key_alloc(struct key_type *type, |
195 | const char *desc, | 196 | const char *desc, |
196 | uid_t uid, gid_t gid, | 197 | kuid_t uid, kgid_t gid, |
197 | const struct cred *cred, | 198 | const struct cred *cred, |
198 | key_perm_t perm, | 199 | key_perm_t perm, |
199 | unsigned long flags); | 200 | unsigned long flags); |
@@ -262,7 +263,7 @@ extern int key_link(struct key *keyring, | |||
262 | extern int key_unlink(struct key *keyring, | 263 | extern int key_unlink(struct key *keyring, |
263 | struct key *key); | 264 | struct key *key); |
264 | 265 | ||
265 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 266 | extern struct key *keyring_alloc(const char *description, kuid_t uid, kgid_t gid, |
266 | const struct cred *cred, | 267 | const struct cred *cred, |
267 | unsigned long flags, | 268 | unsigned long flags, |
268 | struct key *dest); | 269 | struct key *dest); |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index c4d2fc194ede..4dff0c6ed58f 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -240,6 +240,7 @@ extern void kgdb_arch_late(void); | |||
240 | * hardware breakpoints. | 240 | * hardware breakpoints. |
241 | * @correct_hw_break: Allow an architecture to specify how to correct the | 241 | * @correct_hw_break: Allow an architecture to specify how to correct the |
242 | * hardware debug registers. | 242 | * hardware debug registers. |
243 | * @enable_nmi: Manage NMI-triggered entry to KGDB | ||
243 | */ | 244 | */ |
244 | struct kgdb_arch { | 245 | struct kgdb_arch { |
245 | unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; | 246 | unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE]; |
@@ -252,6 +253,8 @@ struct kgdb_arch { | |||
252 | void (*disable_hw_break)(struct pt_regs *regs); | 253 | void (*disable_hw_break)(struct pt_regs *regs); |
253 | void (*remove_all_hw_break)(void); | 254 | void (*remove_all_hw_break)(void); |
254 | void (*correct_hw_break)(void); | 255 | void (*correct_hw_break)(void); |
256 | |||
257 | void (*enable_nmi)(bool on); | ||
255 | }; | 258 | }; |
256 | 259 | ||
257 | /** | 260 | /** |
@@ -283,6 +286,16 @@ extern struct kgdb_arch arch_kgdb_ops; | |||
283 | 286 | ||
284 | extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs); | 287 | extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs); |
285 | 288 | ||
289 | #ifdef CONFIG_SERIAL_KGDB_NMI | ||
290 | extern int kgdb_register_nmi_console(void); | ||
291 | extern int kgdb_unregister_nmi_console(void); | ||
292 | extern bool kgdb_nmi_poll_knock(void); | ||
293 | #else | ||
294 | static inline int kgdb_register_nmi_console(void) { return 0; } | ||
295 | static inline int kgdb_unregister_nmi_console(void) { return 0; } | ||
296 | static inline bool kgdb_nmi_poll_knock(void) { return 1; } | ||
297 | #endif | ||
298 | |||
286 | extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); | 299 | extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); |
287 | extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); | 300 | extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); |
288 | extern struct kgdb_io *dbg_io_ops; | 301 | extern struct kgdb_io *dbg_io_ops; |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index b6e1f8c00577..23755ba42abc 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
39 | #include <linux/rcupdate.h> | 39 | #include <linux/rcupdate.h> |
40 | #include <linux/mutex.h> | 40 | #include <linux/mutex.h> |
41 | #include <linux/ftrace.h> | ||
41 | 42 | ||
42 | #ifdef CONFIG_KPROBES | 43 | #ifdef CONFIG_KPROBES |
43 | #include <asm/kprobes.h> | 44 | #include <asm/kprobes.h> |
@@ -48,14 +49,26 @@ | |||
48 | #define KPROBE_REENTER 0x00000004 | 49 | #define KPROBE_REENTER 0x00000004 |
49 | #define KPROBE_HIT_SSDONE 0x00000008 | 50 | #define KPROBE_HIT_SSDONE 0x00000008 |
50 | 51 | ||
52 | /* | ||
53 | * If function tracer is enabled and the arch supports full | ||
54 | * passing of pt_regs to function tracing, then kprobes can | ||
55 | * optimize on top of function tracing. | ||
56 | */ | ||
57 | #if defined(CONFIG_FUNCTION_TRACER) && defined(ARCH_SUPPORTS_FTRACE_SAVE_REGS) \ | ||
58 | && defined(ARCH_SUPPORTS_KPROBES_ON_FTRACE) | ||
59 | # define KPROBES_CAN_USE_FTRACE | ||
60 | #endif | ||
61 | |||
51 | /* Attach to insert probes on any functions which should be ignored*/ | 62 | /* Attach to insert probes on any functions which should be ignored*/ |
52 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | 63 | #define __kprobes __attribute__((__section__(".kprobes.text"))) |
64 | |||
53 | #else /* CONFIG_KPROBES */ | 65 | #else /* CONFIG_KPROBES */ |
54 | typedef int kprobe_opcode_t; | 66 | typedef int kprobe_opcode_t; |
55 | struct arch_specific_insn { | 67 | struct arch_specific_insn { |
56 | int dummy; | 68 | int dummy; |
57 | }; | 69 | }; |
58 | #define __kprobes | 70 | #define __kprobes |
71 | |||
59 | #endif /* CONFIG_KPROBES */ | 72 | #endif /* CONFIG_KPROBES */ |
60 | 73 | ||
61 | struct kprobe; | 74 | struct kprobe; |
@@ -128,6 +141,7 @@ struct kprobe { | |||
128 | * NOTE: | 141 | * NOTE: |
129 | * this flag is only for optimized_kprobe. | 142 | * this flag is only for optimized_kprobe. |
130 | */ | 143 | */ |
144 | #define KPROBE_FLAG_FTRACE 8 /* probe is using ftrace */ | ||
131 | 145 | ||
132 | /* Has this kprobe gone ? */ | 146 | /* Has this kprobe gone ? */ |
133 | static inline int kprobe_gone(struct kprobe *p) | 147 | static inline int kprobe_gone(struct kprobe *p) |
@@ -146,6 +160,13 @@ static inline int kprobe_optimized(struct kprobe *p) | |||
146 | { | 160 | { |
147 | return p->flags & KPROBE_FLAG_OPTIMIZED; | 161 | return p->flags & KPROBE_FLAG_OPTIMIZED; |
148 | } | 162 | } |
163 | |||
164 | /* Is this kprobe uses ftrace ? */ | ||
165 | static inline int kprobe_ftrace(struct kprobe *p) | ||
166 | { | ||
167 | return p->flags & KPROBE_FLAG_FTRACE; | ||
168 | } | ||
169 | |||
149 | /* | 170 | /* |
150 | * Special probe type that uses setjmp-longjmp type tricks to resume | 171 | * Special probe type that uses setjmp-longjmp type tricks to resume |
151 | * execution at a specified entry with a matching prototype corresponding | 172 | * execution at a specified entry with a matching prototype corresponding |
@@ -295,6 +316,12 @@ extern int proc_kprobes_optimization_handler(struct ctl_table *table, | |||
295 | #endif | 316 | #endif |
296 | 317 | ||
297 | #endif /* CONFIG_OPTPROBES */ | 318 | #endif /* CONFIG_OPTPROBES */ |
319 | #ifdef KPROBES_CAN_USE_FTRACE | ||
320 | extern void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, | ||
321 | struct ftrace_ops *ops, struct pt_regs *regs); | ||
322 | extern int arch_prepare_kprobe_ftrace(struct kprobe *p); | ||
323 | #endif | ||
324 | |||
298 | 325 | ||
299 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ | 326 | /* Get the kprobe at this addr (if any) - called with preemption disabled */ |
300 | struct kprobe *get_kprobe(void *addr); | 327 | struct kprobe *get_kprobe(void *addr); |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 22ccf9dee177..8d816646f766 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -14,6 +14,11 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), | |||
14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) | 14 | kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) |
15 | 15 | ||
16 | 16 | ||
17 | struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), | ||
18 | void *data, | ||
19 | unsigned int cpu, | ||
20 | const char *namefmt); | ||
21 | |||
17 | /** | 22 | /** |
18 | * kthread_run - create and wake a thread. | 23 | * kthread_run - create and wake a thread. |
19 | * @threadfn: the function to run until signal_pending(current). | 24 | * @threadfn: the function to run until signal_pending(current). |
@@ -34,9 +39,13 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), | |||
34 | 39 | ||
35 | void kthread_bind(struct task_struct *k, unsigned int cpu); | 40 | void kthread_bind(struct task_struct *k, unsigned int cpu); |
36 | int kthread_stop(struct task_struct *k); | 41 | int kthread_stop(struct task_struct *k); |
37 | int kthread_should_stop(void); | 42 | bool kthread_should_stop(void); |
43 | bool kthread_should_park(void); | ||
38 | bool kthread_freezable_should_stop(bool *was_frozen); | 44 | bool kthread_freezable_should_stop(bool *was_frozen); |
39 | void *kthread_data(struct task_struct *k); | 45 | void *kthread_data(struct task_struct *k); |
46 | int kthread_park(struct task_struct *k); | ||
47 | void kthread_unpark(struct task_struct *k); | ||
48 | void kthread_parkme(void); | ||
40 | 49 | ||
41 | int kthreadd(void *unused); | 50 | int kthreadd(void *unused); |
42 | extern struct task_struct *kthreadd_task; | 51 | extern struct task_struct *kthreadd_task; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b70b48b01098..8a59e0abe5fa 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -685,7 +685,7 @@ static inline int kvm_deassign_device(struct kvm *kvm, | |||
685 | static inline void kvm_guest_enter(void) | 685 | static inline void kvm_guest_enter(void) |
686 | { | 686 | { |
687 | BUG_ON(preemptible()); | 687 | BUG_ON(preemptible()); |
688 | account_system_vtime(current); | 688 | vtime_account(current); |
689 | current->flags |= PF_VCPU; | 689 | current->flags |= PF_VCPU; |
690 | /* KVM does not hold any references to rcu protected data when it | 690 | /* KVM does not hold any references to rcu protected data when it |
691 | * switches CPU into a guest mode. In fact switching to a guest mode | 691 | * switches CPU into a guest mode. In fact switching to a guest mode |
@@ -699,7 +699,7 @@ static inline void kvm_guest_enter(void) | |||
699 | 699 | ||
700 | static inline void kvm_guest_exit(void) | 700 | static inline void kvm_guest_exit(void) |
701 | { | 701 | { |
702 | account_system_vtime(current); | 702 | vtime_account(current); |
703 | current->flags &= ~PF_VCPU; | 703 | current->flags &= ~PF_VCPU; |
704 | } | 704 | } |
705 | 705 | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index 3aade1d8f410..c6f8dad2ceb0 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -237,4 +237,20 @@ struct gpio_led_platform_data { | |||
237 | struct platform_device *gpio_led_register_device( | 237 | struct platform_device *gpio_led_register_device( |
238 | int id, const struct gpio_led_platform_data *pdata); | 238 | int id, const struct gpio_led_platform_data *pdata); |
239 | 239 | ||
240 | enum cpu_led_event { | ||
241 | CPU_LED_IDLE_START, /* CPU enters idle */ | ||
242 | CPU_LED_IDLE_END, /* CPU idle ends */ | ||
243 | CPU_LED_START, /* Machine starts, especially resume */ | ||
244 | CPU_LED_STOP, /* Machine stops, especially suspend */ | ||
245 | CPU_LED_HALTED, /* Machine shutdown */ | ||
246 | }; | ||
247 | #ifdef CONFIG_LEDS_TRIGGER_CPU | ||
248 | extern void ledtrig_cpu(enum cpu_led_event evt); | ||
249 | #else | ||
250 | static inline void ledtrig_cpu(enum cpu_led_event evt) | ||
251 | { | ||
252 | return; | ||
253 | } | ||
254 | #endif | ||
255 | |||
240 | #endif /* __LINUX_LEDS_H_INCLUDED */ | 256 | #endif /* __LINUX_LEDS_H_INCLUDED */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 64f90e17e51d..77eeeda2b6e2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -162,6 +162,7 @@ enum { | |||
162 | ATA_DFLAG_DETACHED = (1 << 25), | 162 | ATA_DFLAG_DETACHED = (1 << 25), |
163 | 163 | ||
164 | ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ | 164 | ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ |
165 | ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ | ||
165 | 166 | ||
166 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 167 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
167 | ATA_DEV_ATA = 1, /* ATA device */ | 168 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -184,6 +185,7 @@ enum { | |||
184 | ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */ | 185 | ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */ |
185 | ATA_LFLAG_SW_ACTIVITY = (1 << 7), /* keep activity stats */ | 186 | ATA_LFLAG_SW_ACTIVITY = (1 << 7), /* keep activity stats */ |
186 | ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */ | 187 | ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */ |
188 | ATA_LFLAG_RST_ONCE = (1 << 9), /* limit recovery to one reset */ | ||
187 | 189 | ||
188 | /* struct ata_port flags */ | 190 | /* struct ata_port flags */ |
189 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ | 191 | ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ |
@@ -649,6 +651,9 @@ struct ata_device { | |||
649 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ | 651 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ |
650 | }; | 652 | }; |
651 | 653 | ||
654 | /* Identify Device Data Log (30h), SATA Settings (page 08h) */ | ||
655 | u8 sata_settings[ATA_SECT_SIZE]; | ||
656 | |||
652 | /* error history */ | 657 | /* error history */ |
653 | int spdn_cnt; | 658 | int spdn_cnt; |
654 | /* ering is CLEAR_END, read comment above CLEAR_END */ | 659 | /* ering is CLEAR_END, read comment above CLEAR_END */ |
@@ -986,8 +991,7 @@ extern int ata_host_activate(struct ata_host *host, int irq, | |||
986 | irq_handler_t irq_handler, unsigned long irq_flags, | 991 | irq_handler_t irq_handler, unsigned long irq_flags, |
987 | struct scsi_host_template *sht); | 992 | struct scsi_host_template *sht); |
988 | extern void ata_host_detach(struct ata_host *host); | 993 | extern void ata_host_detach(struct ata_host *host); |
989 | extern void ata_host_init(struct ata_host *, struct device *, | 994 | extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *); |
990 | unsigned long, struct ata_port_operations *); | ||
991 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 995 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
992 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 996 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
993 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); | 997 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
@@ -1012,6 +1016,17 @@ extern bool ata_link_offline(struct ata_link *link); | |||
1012 | #ifdef CONFIG_PM | 1016 | #ifdef CONFIG_PM |
1013 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 1017 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
1014 | extern void ata_host_resume(struct ata_host *host); | 1018 | extern void ata_host_resume(struct ata_host *host); |
1019 | extern int ata_sas_port_async_suspend(struct ata_port *ap, int *async); | ||
1020 | extern int ata_sas_port_async_resume(struct ata_port *ap, int *async); | ||
1021 | #else | ||
1022 | static inline int ata_sas_port_async_suspend(struct ata_port *ap, int *async) | ||
1023 | { | ||
1024 | return 0; | ||
1025 | } | ||
1026 | static inline int ata_sas_port_async_resume(struct ata_port *ap, int *async) | ||
1027 | { | ||
1028 | return 0; | ||
1029 | } | ||
1015 | #endif | 1030 | #endif |
1016 | extern int ata_ratelimit(void); | 1031 | extern int ata_ratelimit(void); |
1017 | extern void ata_msleep(struct ata_port *ap, unsigned int msecs); | 1032 | extern void ata_msleep(struct ata_port *ap, unsigned int msecs); |
diff --git a/include/linux/libfdt.h b/include/linux/libfdt.h index 4c0306c69b4e..a0c3bf6c9edb 100644 --- a/include/linux/libfdt.h +++ b/include/linux/libfdt.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _INCLUDE_LIBFDT_H_ | 2 | #define _INCLUDE_LIBFDT_H_ |
3 | 3 | ||
4 | #include <linux/libfdt_env.h> | 4 | #include <linux/libfdt_env.h> |
5 | #include "../../scripts/dtc/libfdt/fdt.h" | 5 | #include <> |
6 | #include "../../scripts/dtc/libfdt/libfdt.h" | 6 | #include <> |
7 | 7 | ||
8 | #endif /* _INCLUDE_LIBFDT_H_ */ | 8 | #endif /* _INCLUDE_LIBFDT_H_ */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index 11a41a8f08eb..9635116dd830 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -44,7 +44,7 @@ struct loop_device { | |||
44 | int lo_encrypt_key_size; | 44 | int lo_encrypt_key_size; |
45 | struct loop_func_table *lo_encryption; | 45 | struct loop_func_table *lo_encryption; |
46 | __u32 lo_init[2]; | 46 | __u32 lo_init[2]; |
47 | uid_t lo_key_owner; /* Who set the key */ | 47 | kuid_t lo_key_owner; /* Who set the key */ |
48 | int (*ioctl)(struct loop_device *, int cmd, | 48 | int (*ioctl)(struct loop_device *, int cmd, |
49 | unsigned long arg); | 49 | unsigned long arg); |
50 | 50 | ||
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 7cccafe50e7b..6c406845f7e2 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
@@ -377,5 +377,88 @@ static inline void mdio45_ethtool_gset(const struct mdio_if_info *mdio, | |||
377 | extern int mdio_mii_ioctl(const struct mdio_if_info *mdio, | 377 | extern int mdio_mii_ioctl(const struct mdio_if_info *mdio, |
378 | struct mii_ioctl_data *mii_data, int cmd); | 378 | struct mii_ioctl_data *mii_data, int cmd); |
379 | 379 | ||
380 | /** | ||
381 | * mmd_eee_cap_to_ethtool_sup_t | ||
382 | * @eee_cap: value of the MMD EEE Capability register | ||
383 | * | ||
384 | * A small helper function that translates MMD EEE Capability (3.20) bits | ||
385 | * to ethtool supported settings. | ||
386 | */ | ||
387 | static inline u32 mmd_eee_cap_to_ethtool_sup_t(u16 eee_cap) | ||
388 | { | ||
389 | u32 supported = 0; | ||
390 | |||
391 | if (eee_cap & MDIO_EEE_100TX) | ||
392 | supported |= SUPPORTED_100baseT_Full; | ||
393 | if (eee_cap & MDIO_EEE_1000T) | ||
394 | supported |= SUPPORTED_1000baseT_Full; | ||
395 | if (eee_cap & MDIO_EEE_10GT) | ||
396 | supported |= SUPPORTED_10000baseT_Full; | ||
397 | if (eee_cap & MDIO_EEE_1000KX) | ||
398 | supported |= SUPPORTED_1000baseKX_Full; | ||
399 | if (eee_cap & MDIO_EEE_10GKX4) | ||
400 | supported |= SUPPORTED_10000baseKX4_Full; | ||
401 | if (eee_cap & MDIO_EEE_10GKR) | ||
402 | supported |= SUPPORTED_10000baseKR_Full; | ||
403 | |||
404 | return supported; | ||
405 | } | ||
406 | |||
407 | /** | ||
408 | * mmd_eee_adv_to_ethtool_adv_t | ||
409 | * @eee_adv: value of the MMD EEE Advertisement/Link Partner Ability registers | ||
410 | * | ||
411 | * A small helper function that translates the MMD EEE Advertisment (7.60) | ||
412 | * and MMD EEE Link Partner Ability (7.61) bits to ethtool advertisement | ||
413 | * settings. | ||
414 | */ | ||
415 | static inline u32 mmd_eee_adv_to_ethtool_adv_t(u16 eee_adv) | ||
416 | { | ||
417 | u32 adv = 0; | ||
418 | |||
419 | if (eee_adv & MDIO_EEE_100TX) | ||
420 | adv |= ADVERTISED_100baseT_Full; | ||
421 | if (eee_adv & MDIO_EEE_1000T) | ||
422 | adv |= ADVERTISED_1000baseT_Full; | ||
423 | if (eee_adv & MDIO_EEE_10GT) | ||
424 | adv |= ADVERTISED_10000baseT_Full; | ||
425 | if (eee_adv & MDIO_EEE_1000KX) | ||
426 | adv |= ADVERTISED_1000baseKX_Full; | ||
427 | if (eee_adv & MDIO_EEE_10GKX4) | ||
428 | adv |= ADVERTISED_10000baseKX4_Full; | ||
429 | if (eee_adv & MDIO_EEE_10GKR) | ||
430 | adv |= ADVERTISED_10000baseKR_Full; | ||
431 | |||
432 | return adv; | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * ethtool_adv_to_mmd_eee_adv_t | ||
437 | * @adv: the ethtool advertisement settings | ||
438 | * | ||
439 | * A small helper function that translates ethtool advertisement settings | ||
440 | * to EEE advertisements for the MMD EEE Advertisement (7.60) and | ||
441 | * MMD EEE Link Partner Ability (7.61) registers. | ||
442 | */ | ||
443 | static inline u16 ethtool_adv_to_mmd_eee_adv_t(u32 adv) | ||
444 | { | ||
445 | u16 reg = 0; | ||
446 | |||
447 | if (adv & ADVERTISED_100baseT_Full) | ||
448 | reg |= MDIO_EEE_100TX; | ||
449 | if (adv & ADVERTISED_1000baseT_Full) | ||
450 | reg |= MDIO_EEE_1000T; | ||
451 | if (adv & ADVERTISED_10000baseT_Full) | ||
452 | reg |= MDIO_EEE_10GT; | ||
453 | if (adv & ADVERTISED_1000baseKX_Full) | ||
454 | reg |= MDIO_EEE_1000KX; | ||
455 | if (adv & ADVERTISED_10000baseKX4_Full) | ||
456 | reg |= MDIO_EEE_10GKX4; | ||
457 | if (adv & ADVERTISED_10000baseKR_Full) | ||
458 | reg |= MDIO_EEE_10GKR; | ||
459 | |||
460 | return reg; | ||
461 | } | ||
462 | |||
380 | #endif /* __KERNEL__ */ | 463 | #endif /* __KERNEL__ */ |
381 | #endif /* __LINUX_MDIO_H__ */ | 464 | #endif /* __LINUX_MDIO_H__ */ |
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h index dc6529202cdd..d7079413def0 100644 --- a/include/linux/mfd/abx500/ab8500-codec.h +++ b/include/linux/mfd/abx500/ab8500-codec.h | |||
@@ -23,7 +23,8 @@ enum amic_type { | |||
23 | /* Mic-biases */ | 23 | /* Mic-biases */ |
24 | enum amic_micbias { | 24 | enum amic_micbias { |
25 | AMIC_MICBIAS_VAMIC1, | 25 | AMIC_MICBIAS_VAMIC1, |
26 | AMIC_MICBIAS_VAMIC2 | 26 | AMIC_MICBIAS_VAMIC2, |
27 | AMIC_MICBIAS_UNKNOWN | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | /* Bias-voltage */ | 30 | /* Bias-voltage */ |
@@ -31,7 +32,8 @@ enum ear_cm_voltage { | |||
31 | EAR_CMV_0_95V, | 32 | EAR_CMV_0_95V, |
32 | EAR_CMV_1_10V, | 33 | EAR_CMV_1_10V, |
33 | EAR_CMV_1_27V, | 34 | EAR_CMV_1_27V, |
34 | EAR_CMV_1_58V | 35 | EAR_CMV_1_58V, |
36 | EAR_CMV_UNKNOWN | ||
35 | }; | 37 | }; |
36 | 38 | ||
37 | /* Analog microphone settings */ | 39 | /* Analog microphone settings */ |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 5b90e94399e1..c410d99bd667 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -136,6 +136,7 @@ enum prcmu_clock { | |||
136 | PRCMU_TIMCLK, | 136 | PRCMU_TIMCLK, |
137 | PRCMU_PLLSOC0, | 137 | PRCMU_PLLSOC0, |
138 | PRCMU_PLLSOC1, | 138 | PRCMU_PLLSOC1, |
139 | PRCMU_ARMSS, | ||
139 | PRCMU_PLLDDR, | 140 | PRCMU_PLLDDR, |
140 | PRCMU_PLLDSI, | 141 | PRCMU_PLLDSI, |
141 | PRCMU_DSI0CLK, | 142 | PRCMU_DSI0CLK, |
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 3d7ae4d7fd36..46c0f320ed76 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
@@ -74,6 +74,7 @@ enum max77686_regulators { | |||
74 | struct max77686_regulator_data { | 74 | struct max77686_regulator_data { |
75 | int id; | 75 | int id; |
76 | struct regulator_init_data *initdata; | 76 | struct regulator_init_data *initdata; |
77 | struct device_node *of_node; | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | enum max77686_opmode { | 80 | enum max77686_opmode { |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index f4f0dfa4698a..6823548d0c0a 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -67,7 +67,7 @@ struct max8998_regulator_data { | |||
67 | /** | 67 | /** |
68 | * struct max8998_board - packages regulator init data | 68 | * struct max8998_board - packages regulator init data |
69 | * @regulators: array of defined regulators | 69 | * @regulators: array of defined regulators |
70 | * @num_regulators: number of regultors used | 70 | * @num_regulators: number of regulators used |
71 | * @irq_base: base IRQ number for max8998, required for IRQs | 71 | * @irq_base: base IRQ number for max8998, required for IRQs |
72 | * @ono: power onoff IRQ number for max8998 | 72 | * @ono: power onoff IRQ number for max8998 |
73 | * @buck_voltage_lock: Do NOT change the values of the following six | 73 | * @buck_voltage_lock: Do NOT change the values of the following six |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index f350fd0ba1df..94514710a03f 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 |
15 | 15 | ||
16 | enum { | 16 | enum { |
17 | TPS6586X_ID_SYS, | ||
17 | TPS6586X_ID_SM_0, | 18 | TPS6586X_ID_SM_0, |
18 | TPS6586X_ID_SM_1, | 19 | TPS6586X_ID_SM_1, |
19 | TPS6586X_ID_SM_2, | 20 | TPS6586X_ID_SM_2, |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h index eaad49f7c130..ba43d4806b83 100644 --- a/include/linux/mfd/twl6040.h +++ b/include/linux/mfd/twl6040.h | |||
@@ -194,7 +194,6 @@ struct twl6040_vibra_data { | |||
194 | 194 | ||
195 | struct twl6040_platform_data { | 195 | struct twl6040_platform_data { |
196 | int audpwron_gpio; /* audio power-on gpio */ | 196 | int audpwron_gpio; /* audio power-on gpio */ |
197 | unsigned int irq_base; | ||
198 | 197 | ||
199 | struct twl6040_codec_data *codec; | 198 | struct twl6040_codec_data *codec; |
200 | struct twl6040_vibra_data *vibra; | 199 | struct twl6040_vibra_data *vibra; |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 6e1b0f973a03..6d1acb04cd17 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -54,7 +54,13 @@ enum { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | enum { | 56 | enum { |
57 | MLX4_MAX_PORTS = 2 | 57 | MLX4_PORT_CAP_IS_SM = 1 << 1, |
58 | MLX4_PORT_CAP_DEV_MGMT_SUP = 1 << 19, | ||
59 | }; | ||
60 | |||
61 | enum { | ||
62 | MLX4_MAX_PORTS = 2, | ||
63 | MLX4_MAX_PORT_PKEYS = 128 | ||
58 | }; | 64 | }; |
59 | 65 | ||
60 | /* base qkey for use in sriov tunnel-qp/proxy-qp communication. | 66 | /* base qkey for use in sriov tunnel-qp/proxy-qp communication. |
@@ -191,6 +197,25 @@ enum { | |||
191 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, | 197 | MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, |
192 | }; | 198 | }; |
193 | 199 | ||
200 | enum slave_port_state { | ||
201 | SLAVE_PORT_DOWN = 0, | ||
202 | SLAVE_PENDING_UP, | ||
203 | SLAVE_PORT_UP, | ||
204 | }; | ||
205 | |||
206 | enum slave_port_gen_event { | ||
207 | SLAVE_PORT_GEN_EVENT_DOWN = 0, | ||
208 | SLAVE_PORT_GEN_EVENT_UP, | ||
209 | SLAVE_PORT_GEN_EVENT_NONE, | ||
210 | }; | ||
211 | |||
212 | enum slave_port_state_event { | ||
213 | MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN, | ||
214 | MLX4_PORT_STATE_DEV_EVENT_PORT_UP, | ||
215 | MLX4_PORT_STATE_IB_PORT_STATE_EVENT_GID_VALID, | ||
216 | MLX4_PORT_STATE_IB_EVENT_GID_INVALID, | ||
217 | }; | ||
218 | |||
194 | enum { | 219 | enum { |
195 | MLX4_PERM_LOCAL_READ = 1 << 10, | 220 | MLX4_PERM_LOCAL_READ = 1 << 10, |
196 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | 221 | MLX4_PERM_LOCAL_WRITE = 1 << 11, |
@@ -303,6 +328,9 @@ struct mlx4_phys_caps { | |||
303 | u32 gid_phys_table_len[MLX4_MAX_PORTS + 1]; | 328 | u32 gid_phys_table_len[MLX4_MAX_PORTS + 1]; |
304 | u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1]; | 329 | u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1]; |
305 | u32 num_phys_eqs; | 330 | u32 num_phys_eqs; |
331 | u32 base_sqpn; | ||
332 | u32 base_proxy_sqpn; | ||
333 | u32 base_tunnel_sqpn; | ||
306 | }; | 334 | }; |
307 | 335 | ||
308 | struct mlx4_caps { | 336 | struct mlx4_caps { |
@@ -333,9 +361,10 @@ struct mlx4_caps { | |||
333 | int max_rq_desc_sz; | 361 | int max_rq_desc_sz; |
334 | int max_qp_init_rdma; | 362 | int max_qp_init_rdma; |
335 | int max_qp_dest_rdma; | 363 | int max_qp_dest_rdma; |
336 | int sqp_start; | 364 | u32 *qp0_proxy; |
337 | u32 base_sqpn; | 365 | u32 *qp1_proxy; |
338 | u32 base_tunnel_sqpn; | 366 | u32 *qp0_tunnel; |
367 | u32 *qp1_tunnel; | ||
339 | int num_srqs; | 368 | int num_srqs; |
340 | int max_srq_wqes; | 369 | int max_srq_wqes; |
341 | int max_srq_sge; | 370 | int max_srq_sge; |
@@ -389,6 +418,7 @@ struct mlx4_caps { | |||
389 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; | 418 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; |
390 | u32 max_counters; | 419 | u32 max_counters; |
391 | u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; | 420 | u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; |
421 | u16 sqp_demux; | ||
392 | }; | 422 | }; |
393 | 423 | ||
394 | struct mlx4_buf_list { | 424 | struct mlx4_buf_list { |
@@ -671,6 +701,10 @@ struct mlx4_init_port_param { | |||
671 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | 701 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ |
672 | if ((type) == (dev)->caps.port_mask[(port)]) | 702 | if ((type) == (dev)->caps.port_mask[(port)]) |
673 | 703 | ||
704 | #define mlx4_foreach_non_ib_transport_port(port, dev) \ | ||
705 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | ||
706 | if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB)) | ||
707 | |||
674 | #define mlx4_foreach_ib_transport_port(port, dev) \ | 708 | #define mlx4_foreach_ib_transport_port(port, dev) \ |
675 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | 709 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ |
676 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ | 710 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ |
@@ -692,7 +726,18 @@ static inline int mlx4_is_master(struct mlx4_dev *dev) | |||
692 | 726 | ||
693 | static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) | 727 | static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) |
694 | { | 728 | { |
695 | return (qpn < dev->caps.sqp_start + 8); | 729 | return (qpn < dev->phys_caps.base_sqpn + 8 + |
730 | 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev)); | ||
731 | } | ||
732 | |||
733 | static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn) | ||
734 | { | ||
735 | int guest_proxy_base = dev->phys_caps.base_proxy_sqpn + slave * 8; | ||
736 | |||
737 | if (qpn >= guest_proxy_base && qpn < guest_proxy_base + 8) | ||
738 | return 1; | ||
739 | |||
740 | return 0; | ||
696 | } | 741 | } |
697 | 742 | ||
698 | static inline int mlx4_is_mfunc(struct mlx4_dev *dev) | 743 | static inline int mlx4_is_mfunc(struct mlx4_dev *dev) |
@@ -927,6 +972,20 @@ int mlx4_flow_attach(struct mlx4_dev *dev, | |||
927 | struct mlx4_net_trans_rule *rule, u64 *reg_id); | 972 | struct mlx4_net_trans_rule *rule, u64 *reg_id); |
928 | int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); | 973 | int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); |
929 | 974 | ||
975 | void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, | ||
976 | int i, int val); | ||
977 | |||
930 | int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); | 978 | int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); |
931 | 979 | ||
980 | int mlx4_is_slave_active(struct mlx4_dev *dev, int slave); | ||
981 | int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port); | ||
982 | int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port); | ||
983 | int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr); | ||
984 | int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change); | ||
985 | enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port); | ||
986 | int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event); | ||
987 | |||
988 | void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); | ||
989 | __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); | ||
990 | |||
932 | #endif /* MLX4_DEVICE_H */ | 991 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index d813704b963b..c257e1b211be 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -45,6 +45,8 @@ enum mlx4_dev_event { | |||
45 | MLX4_DEV_EVENT_PORT_DOWN, | 45 | MLX4_DEV_EVENT_PORT_DOWN, |
46 | MLX4_DEV_EVENT_PORT_REINIT, | 46 | MLX4_DEV_EVENT_PORT_REINIT, |
47 | MLX4_DEV_EVENT_PORT_MGMT_CHANGE, | 47 | MLX4_DEV_EVENT_PORT_MGMT_CHANGE, |
48 | MLX4_DEV_EVENT_SLAVE_INIT, | ||
49 | MLX4_DEV_EVENT_SLAVE_SHUTDOWN, | ||
48 | }; | 50 | }; |
49 | 51 | ||
50 | struct mlx4_interface { | 52 | struct mlx4_interface { |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 338388ba260a..4b4ad6ffef92 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -126,7 +126,8 @@ struct mlx4_rss_context { | |||
126 | 126 | ||
127 | struct mlx4_qp_path { | 127 | struct mlx4_qp_path { |
128 | u8 fl; | 128 | u8 fl; |
129 | u8 reserved1[2]; | 129 | u8 reserved1[1]; |
130 | u8 disable_pkey_check; | ||
130 | u8 pkey_index; | 131 | u8 pkey_index; |
131 | u8 counter_index; | 132 | u8 counter_index; |
132 | u8 grh_mylmc; | 133 | u8 grh_mylmc; |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 6955045199b0..fed3def62818 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -232,7 +232,7 @@ struct of_device_id | |||
232 | char type[32]; | 232 | char type[32]; |
233 | char compatible[128]; | 233 | char compatible[128]; |
234 | #ifdef __KERNEL__ | 234 | #ifdef __KERNEL__ |
235 | void *data; | 235 | const void *data; |
236 | #else | 236 | #else |
237 | kernel_ulong_t data; | 237 | kernel_ulong_t data; |
238 | #endif | 238 | #endif |
@@ -600,4 +600,12 @@ struct x86_cpu_id { | |||
600 | #define X86_MODEL_ANY 0 | 600 | #define X86_MODEL_ANY 0 |
601 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ | 601 | #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ |
602 | 602 | ||
603 | #define IPACK_ANY_FORMAT 0xff | ||
604 | #define IPACK_ANY_ID (~0) | ||
605 | struct ipack_device_id { | ||
606 | __u8 format; /* Format version or IPACK_ANY_ID */ | ||
607 | __u32 vendor; /* Vendor ID or IPACK_ANY_ID */ | ||
608 | __u32 device; /* Device ID or IPACK_ANY_ID */ | ||
609 | }; | ||
610 | |||
603 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 611 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 2475228c1158..1f8d24bdafda 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -79,9 +79,10 @@ struct mtd_part_parser { | |||
79 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 79 | extern int register_mtd_parser(struct mtd_part_parser *parser); |
80 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); | 80 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); |
81 | 81 | ||
82 | int mtd_is_partition(struct mtd_info *mtd); | 82 | int mtd_is_partition(const struct mtd_info *mtd); |
83 | int mtd_add_partition(struct mtd_info *master, char *name, | 83 | int mtd_add_partition(struct mtd_info *master, char *name, |
84 | long long offset, long long length); | 84 | long long offset, long long length); |
85 | int mtd_del_partition(struct mtd_info *master, int partno); | 85 | int mtd_del_partition(struct mtd_info *master, int partno); |
86 | uint64_t mtd_get_device_size(const struct mtd_info *mtd); | ||
86 | 87 | ||
87 | #endif | 88 | #endif |
diff --git a/include/linux/net.h b/include/linux/net.h index 99276c3dc89a..6ab31cabef7c 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -65,6 +65,7 @@ typedef enum { | |||
65 | struct poll_table_struct; | 65 | struct poll_table_struct; |
66 | struct pipe_inode_info; | 66 | struct pipe_inode_info; |
67 | struct inode; | 67 | struct inode; |
68 | struct file; | ||
68 | struct net; | 69 | struct net; |
69 | 70 | ||
70 | #define SOCK_ASYNC_NOSPACE 0 | 71 | #define SOCK_ASYNC_NOSPACE 0 |
@@ -246,7 +247,7 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, | |||
246 | size_t len); | 247 | size_t len); |
247 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | 248 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, |
248 | size_t size, int flags); | 249 | size_t size, int flags); |
249 | extern int sock_map_fd(struct socket *sock, int flags); | 250 | extern struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname); |
250 | extern struct socket *sockfd_lookup(int fd, int *err); | 251 | extern struct socket *sockfd_lookup(int fd, int *err); |
251 | extern struct socket *sock_from_file(struct file *file, int *err); | 252 | extern struct socket *sock_from_file(struct file *file, int *err); |
252 | #define sockfd_put(sock) fput(sock->file) | 253 | #define sockfd_put(sock) fput(sock->file) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 59dc05f38247..01646aa53b0e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -338,18 +338,16 @@ struct napi_struct { | |||
338 | 338 | ||
339 | unsigned long state; | 339 | unsigned long state; |
340 | int weight; | 340 | int weight; |
341 | unsigned int gro_count; | ||
341 | int (*poll)(struct napi_struct *, int); | 342 | int (*poll)(struct napi_struct *, int); |
342 | #ifdef CONFIG_NETPOLL | 343 | #ifdef CONFIG_NETPOLL |
343 | spinlock_t poll_lock; | 344 | spinlock_t poll_lock; |
344 | int poll_owner; | 345 | int poll_owner; |
345 | #endif | 346 | #endif |
346 | |||
347 | unsigned int gro_count; | ||
348 | |||
349 | struct net_device *dev; | 347 | struct net_device *dev; |
350 | struct list_head dev_list; | ||
351 | struct sk_buff *gro_list; | 348 | struct sk_buff *gro_list; |
352 | struct sk_buff *skb; | 349 | struct sk_buff *skb; |
350 | struct list_head dev_list; | ||
353 | }; | 351 | }; |
354 | 352 | ||
355 | enum { | 353 | enum { |
@@ -906,11 +904,12 @@ struct netdev_fcoe_hbainfo { | |||
906 | * feature set might be less than what was returned by ndo_fix_features()). | 904 | * feature set might be less than what was returned by ndo_fix_features()). |
907 | * Must return >0 or -errno if it changed dev->features itself. | 905 | * Must return >0 or -errno if it changed dev->features itself. |
908 | * | 906 | * |
909 | * int (*ndo_fdb_add)(struct ndmsg *ndm, struct net_device *dev, | 907 | * int (*ndo_fdb_add)(struct ndmsg *ndm, struct nlattr *tb[], |
910 | * unsigned char *addr, u16 flags) | 908 | * struct net_device *dev, |
909 | * const unsigned char *addr, u16 flags) | ||
911 | * Adds an FDB entry to dev for addr. | 910 | * Adds an FDB entry to dev for addr. |
912 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, | 911 | * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, |
913 | * unsigned char *addr) | 912 | * const unsigned char *addr) |
914 | * Deletes the FDB entry from dev coresponding to addr. | 913 | * Deletes the FDB entry from dev coresponding to addr. |
915 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, | 914 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, |
916 | * struct net_device *dev, int idx) | 915 | * struct net_device *dev, int idx) |
@@ -1016,12 +1015,13 @@ struct net_device_ops { | |||
1016 | void (*ndo_neigh_destroy)(struct neighbour *n); | 1015 | void (*ndo_neigh_destroy)(struct neighbour *n); |
1017 | 1016 | ||
1018 | int (*ndo_fdb_add)(struct ndmsg *ndm, | 1017 | int (*ndo_fdb_add)(struct ndmsg *ndm, |
1018 | struct nlattr *tb[], | ||
1019 | struct net_device *dev, | 1019 | struct net_device *dev, |
1020 | unsigned char *addr, | 1020 | const unsigned char *addr, |
1021 | u16 flags); | 1021 | u16 flags); |
1022 | int (*ndo_fdb_del)(struct ndmsg *ndm, | 1022 | int (*ndo_fdb_del)(struct ndmsg *ndm, |
1023 | struct net_device *dev, | 1023 | struct net_device *dev, |
1024 | unsigned char *addr); | 1024 | const unsigned char *addr); |
1025 | int (*ndo_fdb_dump)(struct sk_buff *skb, | 1025 | int (*ndo_fdb_dump)(struct sk_buff *skb, |
1026 | struct netlink_callback *cb, | 1026 | struct netlink_callback *cb, |
1027 | struct net_device *dev, | 1027 | struct net_device *dev, |
@@ -1322,6 +1322,8 @@ struct net_device { | |||
1322 | /* phy device may attach itself for hardware timestamping */ | 1322 | /* phy device may attach itself for hardware timestamping */ |
1323 | struct phy_device *phydev; | 1323 | struct phy_device *phydev; |
1324 | 1324 | ||
1325 | struct lock_class_key *qdisc_tx_busylock; | ||
1326 | |||
1325 | /* group the device belongs to */ | 1327 | /* group the device belongs to */ |
1326 | int group; | 1328 | int group; |
1327 | 1329 | ||
@@ -1401,6 +1403,9 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1401 | f(dev, &dev->_tx[i], arg); | 1403 | f(dev, &dev->_tx[i], arg); |
1402 | } | 1404 | } |
1403 | 1405 | ||
1406 | extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, | ||
1407 | struct sk_buff *skb); | ||
1408 | |||
1404 | /* | 1409 | /* |
1405 | * Net namespace inlines | 1410 | * Net namespace inlines |
1406 | */ | 1411 | */ |
@@ -1553,7 +1558,7 @@ struct packet_type { | |||
1553 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | 1558 | #define NETDEV_PRE_TYPE_CHANGE 0x000E |
1554 | #define NETDEV_POST_TYPE_CHANGE 0x000F | 1559 | #define NETDEV_POST_TYPE_CHANGE 0x000F |
1555 | #define NETDEV_POST_INIT 0x0010 | 1560 | #define NETDEV_POST_INIT 0x0010 |
1556 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 1561 | #define NETDEV_UNREGISTER_FINAL 0x0011 |
1557 | #define NETDEV_RELEASE 0x0012 | 1562 | #define NETDEV_RELEASE 0x0012 |
1558 | #define NETDEV_NOTIFY_PEERS 0x0013 | 1563 | #define NETDEV_NOTIFY_PEERS 0x0013 |
1559 | #define NETDEV_JOIN 0x0014 | 1564 | #define NETDEV_JOIN 0x0014 |
@@ -2227,6 +2232,7 @@ static inline void dev_hold(struct net_device *dev) | |||
2227 | * kind of lower layer not just hardware media. | 2232 | * kind of lower layer not just hardware media. |
2228 | */ | 2233 | */ |
2229 | 2234 | ||
2235 | extern void linkwatch_init_dev(struct net_device *dev); | ||
2230 | extern void linkwatch_fire_event(struct net_device *dev); | 2236 | extern void linkwatch_fire_event(struct net_device *dev); |
2231 | extern void linkwatch_forget_dev(struct net_device *dev); | 2237 | extern void linkwatch_forget_dev(struct net_device *dev); |
2232 | 2238 | ||
@@ -2249,8 +2255,6 @@ extern void netif_carrier_on(struct net_device *dev); | |||
2249 | 2255 | ||
2250 | extern void netif_carrier_off(struct net_device *dev); | 2256 | extern void netif_carrier_off(struct net_device *dev); |
2251 | 2257 | ||
2252 | extern void netif_notify_peers(struct net_device *dev); | ||
2253 | |||
2254 | /** | 2258 | /** |
2255 | * netif_dormant_on - mark device as dormant. | 2259 | * netif_dormant_on - mark device as dormant. |
2256 | * @dev: network device | 2260 | * @dev: network device |
@@ -2560,9 +2564,9 @@ extern void __hw_addr_flush(struct netdev_hw_addr_list *list); | |||
2560 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); | 2564 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); |
2561 | 2565 | ||
2562 | /* Functions used for device addresses handling */ | 2566 | /* Functions used for device addresses handling */ |
2563 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, | 2567 | extern int dev_addr_add(struct net_device *dev, const unsigned char *addr, |
2564 | unsigned char addr_type); | 2568 | unsigned char addr_type); |
2565 | extern int dev_addr_del(struct net_device *dev, unsigned char *addr, | 2569 | extern int dev_addr_del(struct net_device *dev, const unsigned char *addr, |
2566 | unsigned char addr_type); | 2570 | unsigned char addr_type); |
2567 | extern int dev_addr_add_multiple(struct net_device *to_dev, | 2571 | extern int dev_addr_add_multiple(struct net_device *to_dev, |
2568 | struct net_device *from_dev, | 2572 | struct net_device *from_dev, |
@@ -2574,20 +2578,20 @@ extern void dev_addr_flush(struct net_device *dev); | |||
2574 | extern int dev_addr_init(struct net_device *dev); | 2578 | extern int dev_addr_init(struct net_device *dev); |
2575 | 2579 | ||
2576 | /* Functions used for unicast addresses handling */ | 2580 | /* Functions used for unicast addresses handling */ |
2577 | extern int dev_uc_add(struct net_device *dev, unsigned char *addr); | 2581 | extern int dev_uc_add(struct net_device *dev, const unsigned char *addr); |
2578 | extern int dev_uc_add_excl(struct net_device *dev, unsigned char *addr); | 2582 | extern int dev_uc_add_excl(struct net_device *dev, const unsigned char *addr); |
2579 | extern int dev_uc_del(struct net_device *dev, unsigned char *addr); | 2583 | extern int dev_uc_del(struct net_device *dev, const unsigned char *addr); |
2580 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); | 2584 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); |
2581 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); | 2585 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); |
2582 | extern void dev_uc_flush(struct net_device *dev); | 2586 | extern void dev_uc_flush(struct net_device *dev); |
2583 | extern void dev_uc_init(struct net_device *dev); | 2587 | extern void dev_uc_init(struct net_device *dev); |
2584 | 2588 | ||
2585 | /* Functions used for multicast addresses handling */ | 2589 | /* Functions used for multicast addresses handling */ |
2586 | extern int dev_mc_add(struct net_device *dev, unsigned char *addr); | 2590 | extern int dev_mc_add(struct net_device *dev, const unsigned char *addr); |
2587 | extern int dev_mc_add_global(struct net_device *dev, unsigned char *addr); | 2591 | extern int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); |
2588 | extern int dev_mc_add_excl(struct net_device *dev, unsigned char *addr); | 2592 | extern int dev_mc_add_excl(struct net_device *dev, const unsigned char *addr); |
2589 | extern int dev_mc_del(struct net_device *dev, unsigned char *addr); | 2593 | extern int dev_mc_del(struct net_device *dev, const unsigned char *addr); |
2590 | extern int dev_mc_del_global(struct net_device *dev, unsigned char *addr); | 2594 | extern int dev_mc_del_global(struct net_device *dev, const unsigned char *addr); |
2591 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | 2595 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); |
2592 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | 2596 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); |
2593 | extern void dev_mc_flush(struct net_device *dev); | 2597 | extern void dev_mc_flush(struct net_device *dev); |
@@ -2599,8 +2603,7 @@ extern void __dev_set_rx_mode(struct net_device *dev); | |||
2599 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 2603 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
2600 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 2604 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
2601 | extern void netdev_state_change(struct net_device *dev); | 2605 | extern void netdev_state_change(struct net_device *dev); |
2602 | extern int netdev_bonding_change(struct net_device *dev, | 2606 | extern void netdev_notify_peers(struct net_device *dev); |
2603 | unsigned long event); | ||
2604 | extern void netdev_features_change(struct net_device *dev); | 2607 | extern void netdev_features_change(struct net_device *dev); |
2605 | /* Load a device via the kmod */ | 2608 | /* Load a device via the kmod */ |
2606 | extern void dev_load(struct net *net, const char *name); | 2609 | extern void dev_load(struct net *net, const char *name); |
@@ -2720,9 +2723,6 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2720 | return dev->name; | 2723 | return dev->name; |
2721 | } | 2724 | } |
2722 | 2725 | ||
2723 | extern int __netdev_printk(const char *level, const struct net_device *dev, | ||
2724 | struct va_format *vaf); | ||
2725 | |||
2726 | extern __printf(3, 4) | 2726 | extern __printf(3, 4) |
2727 | int netdev_printk(const char *level, const struct net_device *dev, | 2727 | int netdev_printk(const char *level, const struct net_device *dev, |
2728 | const char *format, ...); | 2728 | const char *format, ...); |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index c613cf0d7884..1dcf2a38e51f 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -342,7 +342,7 @@ extern int nf_register_afinfo(const struct nf_afinfo *afinfo); | |||
342 | extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); | 342 | extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); |
343 | 343 | ||
344 | #include <net/flow.h> | 344 | #include <net/flow.h> |
345 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | 345 | extern void (*nf_nat_decode_session_hook)(struct sk_buff *, struct flowi *); |
346 | 346 | ||
347 | static inline void | 347 | static inline void |
348 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) | 348 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
@@ -350,13 +350,11 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) | |||
350 | #ifdef CONFIG_NF_NAT_NEEDED | 350 | #ifdef CONFIG_NF_NAT_NEEDED |
351 | void (*decodefn)(struct sk_buff *, struct flowi *); | 351 | void (*decodefn)(struct sk_buff *, struct flowi *); |
352 | 352 | ||
353 | if (family == AF_INET) { | 353 | rcu_read_lock(); |
354 | rcu_read_lock(); | 354 | decodefn = rcu_dereference(nf_nat_decode_session_hook); |
355 | decodefn = rcu_dereference(ip_nat_decode_session); | 355 | if (decodefn) |
356 | if (decodefn) | 356 | decodefn(skb, fl); |
357 | decodefn(skb, fl); | 357 | rcu_read_unlock(); |
358 | rcu_read_unlock(); | ||
359 | } | ||
360 | #endif | 358 | #endif |
361 | } | 359 | } |
362 | 360 | ||
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index 2edc64cab739..528697b3c152 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
@@ -190,6 +190,7 @@ enum ip_set_dim { | |||
190 | * If changed, new revision of iptables match/target is required. | 190 | * If changed, new revision of iptables match/target is required. |
191 | */ | 191 | */ |
192 | IPSET_DIM_MAX = 6, | 192 | IPSET_DIM_MAX = 6, |
193 | IPSET_BIT_RETURN_NOMATCH = 7, | ||
193 | }; | 194 | }; |
194 | 195 | ||
195 | /* Option flags for kernel operations */ | 196 | /* Option flags for kernel operations */ |
@@ -198,6 +199,7 @@ enum ip_set_kopt { | |||
198 | IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE), | 199 | IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE), |
199 | IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO), | 200 | IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO), |
200 | IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), | 201 | IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), |
202 | IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH), | ||
201 | }; | 203 | }; |
202 | 204 | ||
203 | #ifdef __KERNEL__ | 205 | #ifdef __KERNEL__ |
@@ -206,9 +208,15 @@ enum ip_set_kopt { | |||
206 | #include <linux/netlink.h> | 208 | #include <linux/netlink.h> |
207 | #include <linux/netfilter.h> | 209 | #include <linux/netfilter.h> |
208 | #include <linux/netfilter/x_tables.h> | 210 | #include <linux/netfilter/x_tables.h> |
211 | #include <linux/stringify.h> | ||
209 | #include <linux/vmalloc.h> | 212 | #include <linux/vmalloc.h> |
210 | #include <net/netlink.h> | 213 | #include <net/netlink.h> |
211 | 214 | ||
215 | #define _IP_SET_MODULE_DESC(a, b, c) \ | ||
216 | MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c) | ||
217 | #define IP_SET_MODULE_DESC(a, b, c) \ | ||
218 | _IP_SET_MODULE_DESC(a, __stringify(b), __stringify(c)) | ||
219 | |||
212 | /* Set features */ | 220 | /* Set features */ |
213 | enum ip_set_feature { | 221 | enum ip_set_feature { |
214 | IPSET_TYPE_IP_FLAG = 0, | 222 | IPSET_TYPE_IP_FLAG = 0, |
@@ -223,6 +231,8 @@ enum ip_set_feature { | |||
223 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), | 231 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), |
224 | IPSET_TYPE_IFACE_FLAG = 5, | 232 | IPSET_TYPE_IFACE_FLAG = 5, |
225 | IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), | 233 | IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), |
234 | IPSET_TYPE_NOMATCH_FLAG = 6, | ||
235 | IPSET_TYPE_NOMATCH = (1 << IPSET_TYPE_NOMATCH_FLAG), | ||
226 | /* Strictly speaking not a feature, but a flag for dumping: | 236 | /* Strictly speaking not a feature, but a flag for dumping: |
227 | * this settype must be dumped last */ | 237 | * this settype must be dumped last */ |
228 | IPSET_DUMP_LAST_FLAG = 7, | 238 | IPSET_DUMP_LAST_FLAG = 7, |
@@ -249,7 +259,7 @@ struct ip_set_type_variant { | |||
249 | * returns negative error code, | 259 | * returns negative error code, |
250 | * zero for no match/success to add/delete | 260 | * zero for no match/success to add/delete |
251 | * positive for matching element */ | 261 | * positive for matching element */ |
252 | int (*kadt)(struct ip_set *set, const struct sk_buff * skb, | 262 | int (*kadt)(struct ip_set *set, const struct sk_buff *skb, |
253 | const struct xt_action_param *par, | 263 | const struct xt_action_param *par, |
254 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); | 264 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); |
255 | 265 | ||
@@ -424,7 +434,8 @@ static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr) | |||
424 | return ret; | 434 | return ret; |
425 | } | 435 | } |
426 | 436 | ||
427 | static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, const struct in6_addr *ipaddrptr) | 437 | static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, |
438 | const struct in6_addr *ipaddrptr) | ||
428 | { | 439 | { |
429 | struct nlattr *__nested = ipset_nest_start(skb, type); | 440 | struct nlattr *__nested = ipset_nest_start(skb, type); |
430 | int ret; | 441 | int ret; |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index b114d35aea5e..ef9acd3c8450 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -137,50 +137,59 @@ htable_bits(u32 hashsize) | |||
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | #define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128) | 139 | #define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128) |
140 | #ifdef IP_SET_HASH_WITH_MULTI | ||
141 | #define NETS_LENGTH(family) (SET_HOST_MASK(family) + 1) | ||
142 | #else | ||
143 | #define NETS_LENGTH(family) SET_HOST_MASK(family) | ||
144 | #endif | ||
140 | 145 | ||
141 | /* Network cidr size book keeping when the hash stores different | 146 | /* Network cidr size book keeping when the hash stores different |
142 | * sized networks */ | 147 | * sized networks */ |
143 | static void | 148 | static void |
144 | add_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) | 149 | add_cidr(struct ip_set_hash *h, u8 cidr, u8 nets_length) |
145 | { | 150 | { |
146 | u8 i; | 151 | int i, j; |
147 | |||
148 | ++h->nets[cidr-1].nets; | ||
149 | |||
150 | pr_debug("add_cidr added %u: %u\n", cidr, h->nets[cidr-1].nets); | ||
151 | 152 | ||
152 | if (h->nets[cidr-1].nets > 1) | 153 | /* Add in increasing prefix order, so larger cidr first */ |
153 | return; | 154 | for (i = 0, j = -1; i < nets_length && h->nets[i].nets; i++) { |
154 | 155 | if (j != -1) | |
155 | /* New cidr size */ | 156 | continue; |
156 | for (i = 0; i < host_mask && h->nets[i].cidr; i++) { | 157 | else if (h->nets[i].cidr < cidr) |
157 | /* Add in increasing prefix order, so larger cidr first */ | 158 | j = i; |
158 | if (h->nets[i].cidr < cidr) | 159 | else if (h->nets[i].cidr == cidr) { |
159 | swap(h->nets[i].cidr, cidr); | 160 | h->nets[i].nets++; |
161 | return; | ||
162 | } | ||
163 | } | ||
164 | if (j != -1) { | ||
165 | for (; i > j; i--) { | ||
166 | h->nets[i].cidr = h->nets[i - 1].cidr; | ||
167 | h->nets[i].nets = h->nets[i - 1].nets; | ||
168 | } | ||
160 | } | 169 | } |
161 | if (i < host_mask) | 170 | h->nets[i].cidr = cidr; |
162 | h->nets[i].cidr = cidr; | 171 | h->nets[i].nets = 1; |
163 | } | 172 | } |
164 | 173 | ||
165 | static void | 174 | static void |
166 | del_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask) | 175 | del_cidr(struct ip_set_hash *h, u8 cidr, u8 nets_length) |
167 | { | 176 | { |
168 | u8 i; | 177 | u8 i, j; |
169 | |||
170 | --h->nets[cidr-1].nets; | ||
171 | 178 | ||
172 | pr_debug("del_cidr deleted %u: %u\n", cidr, h->nets[cidr-1].nets); | 179 | for (i = 0; i < nets_length - 1 && h->nets[i].cidr != cidr; i++) |
180 | ; | ||
181 | h->nets[i].nets--; | ||
173 | 182 | ||
174 | if (h->nets[cidr-1].nets != 0) | 183 | if (h->nets[i].nets != 0) |
175 | return; | 184 | return; |
176 | 185 | ||
177 | /* All entries with this cidr size deleted, so cleanup h->cidr[] */ | 186 | for (j = i; j < nets_length - 1 && h->nets[j].nets; j++) { |
178 | for (i = 0; i < host_mask - 1 && h->nets[i].cidr; i++) { | 187 | h->nets[j].cidr = h->nets[j + 1].cidr; |
179 | if (h->nets[i].cidr == cidr) | 188 | h->nets[j].nets = h->nets[j + 1].nets; |
180 | h->nets[i].cidr = cidr = h->nets[i+1].cidr; | ||
181 | } | 189 | } |
182 | h->nets[i - 1].cidr = 0; | ||
183 | } | 190 | } |
191 | #else | ||
192 | #define NETS_LENGTH(family) 0 | ||
184 | #endif | 193 | #endif |
185 | 194 | ||
186 | /* Destroy the hashtable part of the set */ | 195 | /* Destroy the hashtable part of the set */ |
@@ -202,14 +211,14 @@ ahash_destroy(struct htable *t) | |||
202 | 211 | ||
203 | /* Calculate the actual memory size of the set data */ | 212 | /* Calculate the actual memory size of the set data */ |
204 | static size_t | 213 | static size_t |
205 | ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 host_mask) | 214 | ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 nets_length) |
206 | { | 215 | { |
207 | u32 i; | 216 | u32 i; |
208 | struct htable *t = h->table; | 217 | struct htable *t = h->table; |
209 | size_t memsize = sizeof(*h) | 218 | size_t memsize = sizeof(*h) |
210 | + sizeof(*t) | 219 | + sizeof(*t) |
211 | #ifdef IP_SET_HASH_WITH_NETS | 220 | #ifdef IP_SET_HASH_WITH_NETS |
212 | + sizeof(struct ip_set_hash_nets) * host_mask | 221 | + sizeof(struct ip_set_hash_nets) * nets_length |
213 | #endif | 222 | #endif |
214 | + jhash_size(t->htable_bits) * sizeof(struct hbucket); | 223 | + jhash_size(t->htable_bits) * sizeof(struct hbucket); |
215 | 224 | ||
@@ -238,7 +247,7 @@ ip_set_hash_flush(struct ip_set *set) | |||
238 | } | 247 | } |
239 | #ifdef IP_SET_HASH_WITH_NETS | 248 | #ifdef IP_SET_HASH_WITH_NETS |
240 | memset(h->nets, 0, sizeof(struct ip_set_hash_nets) | 249 | memset(h->nets, 0, sizeof(struct ip_set_hash_nets) |
241 | * SET_HOST_MASK(set->family)); | 250 | * NETS_LENGTH(set->family)); |
242 | #endif | 251 | #endif |
243 | h->elements = 0; | 252 | h->elements = 0; |
244 | } | 253 | } |
@@ -271,9 +280,6 @@ ip_set_hash_destroy(struct ip_set *set) | |||
271 | (jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \ | 280 | (jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \ |
272 | & jhash_mask(htable_bits)) | 281 | & jhash_mask(htable_bits)) |
273 | 282 | ||
274 | #define CONCAT(a, b, c) a##b##c | ||
275 | #define TOKEN(a, b, c) CONCAT(a, b, c) | ||
276 | |||
277 | /* Type/family dependent function prototypes */ | 283 | /* Type/family dependent function prototypes */ |
278 | 284 | ||
279 | #define type_pf_data_equal TOKEN(TYPE, PF, _data_equal) | 285 | #define type_pf_data_equal TOKEN(TYPE, PF, _data_equal) |
@@ -478,7 +484,7 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
478 | } | 484 | } |
479 | 485 | ||
480 | #ifdef IP_SET_HASH_WITH_NETS | 486 | #ifdef IP_SET_HASH_WITH_NETS |
481 | add_cidr(h, CIDR(d->cidr), HOST_MASK); | 487 | add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family)); |
482 | #endif | 488 | #endif |
483 | h->elements++; | 489 | h->elements++; |
484 | out: | 490 | out: |
@@ -513,7 +519,7 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
513 | n->pos--; | 519 | n->pos--; |
514 | h->elements--; | 520 | h->elements--; |
515 | #ifdef IP_SET_HASH_WITH_NETS | 521 | #ifdef IP_SET_HASH_WITH_NETS |
516 | del_cidr(h, CIDR(d->cidr), HOST_MASK); | 522 | del_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family)); |
517 | #endif | 523 | #endif |
518 | if (n->pos + AHASH_INIT_SIZE < n->size) { | 524 | if (n->pos + AHASH_INIT_SIZE < n->size) { |
519 | void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) | 525 | void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) |
@@ -546,10 +552,10 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
546 | const struct type_pf_elem *data; | 552 | const struct type_pf_elem *data; |
547 | int i, j = 0; | 553 | int i, j = 0; |
548 | u32 key, multi = 0; | 554 | u32 key, multi = 0; |
549 | u8 host_mask = SET_HOST_MASK(set->family); | 555 | u8 nets_length = NETS_LENGTH(set->family); |
550 | 556 | ||
551 | pr_debug("test by nets\n"); | 557 | pr_debug("test by nets\n"); |
552 | for (; j < host_mask && h->nets[j].cidr && !multi; j++) { | 558 | for (; j < nets_length && h->nets[j].nets && !multi; j++) { |
553 | type_pf_data_netmask(d, h->nets[j].cidr); | 559 | type_pf_data_netmask(d, h->nets[j].cidr); |
554 | key = HKEY(d, h->initval, t->htable_bits); | 560 | key = HKEY(d, h->initval, t->htable_bits); |
555 | n = hbucket(t, key); | 561 | n = hbucket(t, key); |
@@ -604,7 +610,7 @@ type_pf_head(struct ip_set *set, struct sk_buff *skb) | |||
604 | memsize = ahash_memsize(h, with_timeout(h->timeout) | 610 | memsize = ahash_memsize(h, with_timeout(h->timeout) |
605 | ? sizeof(struct type_pf_telem) | 611 | ? sizeof(struct type_pf_telem) |
606 | : sizeof(struct type_pf_elem), | 612 | : sizeof(struct type_pf_elem), |
607 | set->family == AF_INET ? 32 : 128); | 613 | NETS_LENGTH(set->family)); |
608 | read_unlock_bh(&set->lock); | 614 | read_unlock_bh(&set->lock); |
609 | 615 | ||
610 | nested = ipset_nest_start(skb, IPSET_ATTR_DATA); | 616 | nested = ipset_nest_start(skb, IPSET_ATTR_DATA); |
@@ -690,7 +696,7 @@ nla_put_failure: | |||
690 | } | 696 | } |
691 | 697 | ||
692 | static int | 698 | static int |
693 | type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, | 699 | type_pf_kadt(struct ip_set *set, const struct sk_buff *skb, |
694 | const struct xt_action_param *par, | 700 | const struct xt_action_param *par, |
695 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); | 701 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); |
696 | static int | 702 | static int |
@@ -783,7 +789,7 @@ type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, | |||
783 | 789 | ||
784 | /* Delete expired elements from the hashtable */ | 790 | /* Delete expired elements from the hashtable */ |
785 | static void | 791 | static void |
786 | type_pf_expire(struct ip_set_hash *h) | 792 | type_pf_expire(struct ip_set_hash *h, u8 nets_length) |
787 | { | 793 | { |
788 | struct htable *t = h->table; | 794 | struct htable *t = h->table; |
789 | struct hbucket *n; | 795 | struct hbucket *n; |
@@ -798,7 +804,7 @@ type_pf_expire(struct ip_set_hash *h) | |||
798 | if (type_pf_data_expired(data)) { | 804 | if (type_pf_data_expired(data)) { |
799 | pr_debug("expired %u/%u\n", i, j); | 805 | pr_debug("expired %u/%u\n", i, j); |
800 | #ifdef IP_SET_HASH_WITH_NETS | 806 | #ifdef IP_SET_HASH_WITH_NETS |
801 | del_cidr(h, CIDR(data->cidr), HOST_MASK); | 807 | del_cidr(h, CIDR(data->cidr), nets_length); |
802 | #endif | 808 | #endif |
803 | if (j != n->pos - 1) | 809 | if (j != n->pos - 1) |
804 | /* Not last one */ | 810 | /* Not last one */ |
@@ -839,7 +845,7 @@ type_pf_tresize(struct ip_set *set, bool retried) | |||
839 | if (!retried) { | 845 | if (!retried) { |
840 | i = h->elements; | 846 | i = h->elements; |
841 | write_lock_bh(&set->lock); | 847 | write_lock_bh(&set->lock); |
842 | type_pf_expire(set->data); | 848 | type_pf_expire(set->data, NETS_LENGTH(set->family)); |
843 | write_unlock_bh(&set->lock); | 849 | write_unlock_bh(&set->lock); |
844 | if (h->elements < i) | 850 | if (h->elements < i) |
845 | return 0; | 851 | return 0; |
@@ -904,7 +910,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
904 | 910 | ||
905 | if (h->elements >= h->maxelem) | 911 | if (h->elements >= h->maxelem) |
906 | /* FIXME: when set is full, we slow down here */ | 912 | /* FIXME: when set is full, we slow down here */ |
907 | type_pf_expire(h); | 913 | type_pf_expire(h, NETS_LENGTH(set->family)); |
908 | if (h->elements >= h->maxelem) { | 914 | if (h->elements >= h->maxelem) { |
909 | if (net_ratelimit()) | 915 | if (net_ratelimit()) |
910 | pr_warning("Set %s is full, maxelem %u reached\n", | 916 | pr_warning("Set %s is full, maxelem %u reached\n", |
@@ -933,8 +939,8 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
933 | if (j != AHASH_MAX(h) + 1) { | 939 | if (j != AHASH_MAX(h) + 1) { |
934 | data = ahash_tdata(n, j); | 940 | data = ahash_tdata(n, j); |
935 | #ifdef IP_SET_HASH_WITH_NETS | 941 | #ifdef IP_SET_HASH_WITH_NETS |
936 | del_cidr(h, CIDR(data->cidr), HOST_MASK); | 942 | del_cidr(h, CIDR(data->cidr), NETS_LENGTH(set->family)); |
937 | add_cidr(h, CIDR(d->cidr), HOST_MASK); | 943 | add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family)); |
938 | #endif | 944 | #endif |
939 | type_pf_data_copy(data, d); | 945 | type_pf_data_copy(data, d); |
940 | type_pf_data_timeout_set(data, timeout); | 946 | type_pf_data_timeout_set(data, timeout); |
@@ -952,7 +958,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
952 | } | 958 | } |
953 | 959 | ||
954 | #ifdef IP_SET_HASH_WITH_NETS | 960 | #ifdef IP_SET_HASH_WITH_NETS |
955 | add_cidr(h, CIDR(d->cidr), HOST_MASK); | 961 | add_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family)); |
956 | #endif | 962 | #endif |
957 | h->elements++; | 963 | h->elements++; |
958 | out: | 964 | out: |
@@ -986,7 +992,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags) | |||
986 | n->pos--; | 992 | n->pos--; |
987 | h->elements--; | 993 | h->elements--; |
988 | #ifdef IP_SET_HASH_WITH_NETS | 994 | #ifdef IP_SET_HASH_WITH_NETS |
989 | del_cidr(h, CIDR(d->cidr), HOST_MASK); | 995 | del_cidr(h, CIDR(d->cidr), NETS_LENGTH(set->family)); |
990 | #endif | 996 | #endif |
991 | if (n->pos + AHASH_INIT_SIZE < n->size) { | 997 | if (n->pos + AHASH_INIT_SIZE < n->size) { |
992 | void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) | 998 | void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) |
@@ -1016,9 +1022,9 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
1016 | struct hbucket *n; | 1022 | struct hbucket *n; |
1017 | int i, j = 0; | 1023 | int i, j = 0; |
1018 | u32 key, multi = 0; | 1024 | u32 key, multi = 0; |
1019 | u8 host_mask = SET_HOST_MASK(set->family); | 1025 | u8 nets_length = NETS_LENGTH(set->family); |
1020 | 1026 | ||
1021 | for (; j < host_mask && h->nets[j].cidr && !multi; j++) { | 1027 | for (; j < nets_length && h->nets[j].nets && !multi; j++) { |
1022 | type_pf_data_netmask(d, h->nets[j].cidr); | 1028 | type_pf_data_netmask(d, h->nets[j].cidr); |
1023 | key = HKEY(d, h->initval, t->htable_bits); | 1029 | key = HKEY(d, h->initval, t->htable_bits); |
1024 | n = hbucket(t, key); | 1030 | n = hbucket(t, key); |
@@ -1147,7 +1153,7 @@ type_pf_gc(unsigned long ul_set) | |||
1147 | 1153 | ||
1148 | pr_debug("called\n"); | 1154 | pr_debug("called\n"); |
1149 | write_lock_bh(&set->lock); | 1155 | write_lock_bh(&set->lock); |
1150 | type_pf_expire(h); | 1156 | type_pf_expire(h, NETS_LENGTH(set->family)); |
1151 | write_unlock_bh(&set->lock); | 1157 | write_unlock_bh(&set->lock); |
1152 | 1158 | ||
1153 | h->gc.expires = jiffies + IPSET_GC_PERIOD(h->timeout) * HZ; | 1159 | h->gc.expires = jiffies + IPSET_GC_PERIOD(h->timeout) * HZ; |
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h index 0bb5a6976bf3..4b59a1584959 100644 --- a/include/linux/netfilter/nf_conntrack_amanda.h +++ b/include/linux/netfilter/nf_conntrack_amanda.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb, | 5 | extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb, |
6 | enum ip_conntrack_info ctinfo, | 6 | enum ip_conntrack_info ctinfo, |
7 | unsigned int protoff, | ||
7 | unsigned int matchoff, | 8 | unsigned int matchoff, |
8 | unsigned int matchlen, | 9 | unsigned int matchlen, |
9 | struct nf_conntrack_expect *exp); | 10 | struct nf_conntrack_expect *exp); |
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h index 3e3aa08980c3..8faf3f792d13 100644 --- a/include/linux/netfilter/nf_conntrack_ftp.h +++ b/include/linux/netfilter/nf_conntrack_ftp.h | |||
@@ -18,13 +18,17 @@ enum nf_ct_ftp_type { | |||
18 | 18 | ||
19 | #define FTP_PORT 21 | 19 | #define FTP_PORT 21 |
20 | 20 | ||
21 | #define NF_CT_FTP_SEQ_PICKUP (1 << 0) | ||
22 | |||
21 | #define NUM_SEQ_TO_REMEMBER 2 | 23 | #define NUM_SEQ_TO_REMEMBER 2 |
22 | /* This structure exists only once per master */ | 24 | /* This structure exists only once per master */ |
23 | struct nf_ct_ftp_master { | 25 | struct nf_ct_ftp_master { |
24 | /* Valid seq positions for cmd matching after newline */ | 26 | /* Valid seq positions for cmd matching after newline */ |
25 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | 27 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; |
26 | /* 0 means seq_match_aft_nl not set */ | 28 | /* 0 means seq_match_aft_nl not set */ |
27 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | 29 | u_int16_t seq_aft_nl_num[IP_CT_DIR_MAX]; |
30 | /* pickup sequence tracking, useful for conntrackd */ | ||
31 | u_int16_t flags[IP_CT_DIR_MAX]; | ||
28 | }; | 32 | }; |
29 | 33 | ||
30 | struct nf_conntrack_expect; | 34 | struct nf_conntrack_expect; |
@@ -34,6 +38,7 @@ struct nf_conntrack_expect; | |||
34 | extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb, | 38 | extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb, |
35 | enum ip_conntrack_info ctinfo, | 39 | enum ip_conntrack_info ctinfo, |
36 | enum nf_ct_ftp_type type, | 40 | enum nf_ct_ftp_type type, |
41 | unsigned int protoff, | ||
37 | unsigned int matchoff, | 42 | unsigned int matchoff, |
38 | unsigned int matchlen, | 43 | unsigned int matchlen, |
39 | struct nf_conntrack_expect *exp); | 44 | struct nf_conntrack_expect *exp); |
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h index 26f9226ea72b..f381020eee92 100644 --- a/include/linux/netfilter/nf_conntrack_h323.h +++ b/include/linux/netfilter/nf_conntrack_h323.h | |||
@@ -36,12 +36,12 @@ extern void nf_conntrack_h245_expect(struct nf_conn *new, | |||
36 | struct nf_conntrack_expect *this); | 36 | struct nf_conntrack_expect *this); |
37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, | 37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, |
38 | struct nf_conntrack_expect *this); | 38 | struct nf_conntrack_expect *this); |
39 | extern int (*set_h245_addr_hook) (struct sk_buff *skb, | 39 | extern int (*set_h245_addr_hook) (struct sk_buff *skb, unsigned int protoff, |
40 | unsigned char **data, int dataoff, | 40 | unsigned char **data, int dataoff, |
41 | H245_TransportAddress *taddr, | 41 | H245_TransportAddress *taddr, |
42 | union nf_inet_addr *addr, | 42 | union nf_inet_addr *addr, |
43 | __be16 port); | 43 | __be16 port); |
44 | extern int (*set_h225_addr_hook) (struct sk_buff *skb, | 44 | extern int (*set_h225_addr_hook) (struct sk_buff *skb, unsigned int protoff, |
45 | unsigned char **data, int dataoff, | 45 | unsigned char **data, int dataoff, |
46 | TransportAddress *taddr, | 46 | TransportAddress *taddr, |
47 | union nf_inet_addr *addr, | 47 | union nf_inet_addr *addr, |
@@ -49,40 +49,45 @@ extern int (*set_h225_addr_hook) (struct sk_buff *skb, | |||
49 | extern int (*set_sig_addr_hook) (struct sk_buff *skb, | 49 | extern int (*set_sig_addr_hook) (struct sk_buff *skb, |
50 | struct nf_conn *ct, | 50 | struct nf_conn *ct, |
51 | enum ip_conntrack_info ctinfo, | 51 | enum ip_conntrack_info ctinfo, |
52 | unsigned char **data, | 52 | unsigned int protoff, unsigned char **data, |
53 | TransportAddress *taddr, int count); | 53 | TransportAddress *taddr, int count); |
54 | extern int (*set_ras_addr_hook) (struct sk_buff *skb, | 54 | extern int (*set_ras_addr_hook) (struct sk_buff *skb, |
55 | struct nf_conn *ct, | 55 | struct nf_conn *ct, |
56 | enum ip_conntrack_info ctinfo, | 56 | enum ip_conntrack_info ctinfo, |
57 | unsigned char **data, | 57 | unsigned int protoff, unsigned char **data, |
58 | TransportAddress *taddr, int count); | 58 | TransportAddress *taddr, int count); |
59 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb, | 59 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb, |
60 | struct nf_conn *ct, | 60 | struct nf_conn *ct, |
61 | enum ip_conntrack_info ctinfo, | 61 | enum ip_conntrack_info ctinfo, |
62 | unsigned char **data, int dataoff, | 62 | unsigned int protoff, unsigned char **data, |
63 | int dataoff, | ||
63 | H245_TransportAddress *taddr, | 64 | H245_TransportAddress *taddr, |
64 | __be16 port, __be16 rtp_port, | 65 | __be16 port, __be16 rtp_port, |
65 | struct nf_conntrack_expect *rtp_exp, | 66 | struct nf_conntrack_expect *rtp_exp, |
66 | struct nf_conntrack_expect *rtcp_exp); | 67 | struct nf_conntrack_expect *rtcp_exp); |
67 | extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct, | 68 | extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct, |
68 | enum ip_conntrack_info ctinfo, | 69 | enum ip_conntrack_info ctinfo, |
70 | unsigned int protoff, | ||
69 | unsigned char **data, int dataoff, | 71 | unsigned char **data, int dataoff, |
70 | H245_TransportAddress *taddr, __be16 port, | 72 | H245_TransportAddress *taddr, __be16 port, |
71 | struct nf_conntrack_expect *exp); | 73 | struct nf_conntrack_expect *exp); |
72 | extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct, | 74 | extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct, |
73 | enum ip_conntrack_info ctinfo, | 75 | enum ip_conntrack_info ctinfo, |
76 | unsigned int protoff, | ||
74 | unsigned char **data, int dataoff, | 77 | unsigned char **data, int dataoff, |
75 | TransportAddress *taddr, __be16 port, | 78 | TransportAddress *taddr, __be16 port, |
76 | struct nf_conntrack_expect *exp); | 79 | struct nf_conntrack_expect *exp); |
77 | extern int (*nat_callforwarding_hook) (struct sk_buff *skb, | 80 | extern int (*nat_callforwarding_hook) (struct sk_buff *skb, |
78 | struct nf_conn *ct, | 81 | struct nf_conn *ct, |
79 | enum ip_conntrack_info ctinfo, | 82 | enum ip_conntrack_info ctinfo, |
83 | unsigned int protoff, | ||
80 | unsigned char **data, int dataoff, | 84 | unsigned char **data, int dataoff, |
81 | TransportAddress *taddr, | 85 | TransportAddress *taddr, |
82 | __be16 port, | 86 | __be16 port, |
83 | struct nf_conntrack_expect *exp); | 87 | struct nf_conntrack_expect *exp); |
84 | extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct, | 88 | extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct, |
85 | enum ip_conntrack_info ctinfo, | 89 | enum ip_conntrack_info ctinfo, |
90 | unsigned int protoff, | ||
86 | unsigned char **data, TransportAddress *taddr, | 91 | unsigned char **data, TransportAddress *taddr, |
87 | int idx, __be16 port, | 92 | int idx, __be16 port, |
88 | struct nf_conntrack_expect *exp); | 93 | struct nf_conntrack_expect *exp); |
diff --git a/include/linux/netfilter/nf_conntrack_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h index 8dab5968fc7e..3176a277eed1 100644 --- a/include/linux/netfilter/nf_conntrack_h323_asn1.h +++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h | |||
@@ -40,7 +40,7 @@ | |||
40 | /***************************************************************************** | 40 | /***************************************************************************** |
41 | * H.323 Types | 41 | * H.323 Types |
42 | ****************************************************************************/ | 42 | ****************************************************************************/ |
43 | #include "nf_conntrack_h323_types.h" | 43 | #include <linux/netfilter/nf_conntrack_h323_types.h> |
44 | 44 | ||
45 | typedef struct { | 45 | typedef struct { |
46 | enum { | 46 | enum { |
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h index 36282bf71b63..4bb9bae67176 100644 --- a/include/linux/netfilter/nf_conntrack_irc.h +++ b/include/linux/netfilter/nf_conntrack_irc.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb, | 8 | extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb, |
9 | enum ip_conntrack_info ctinfo, | 9 | enum ip_conntrack_info ctinfo, |
10 | unsigned int protoff, | ||
10 | unsigned int matchoff, | 11 | unsigned int matchoff, |
11 | unsigned int matchlen, | 12 | unsigned int matchlen, |
12 | struct nf_conntrack_expect *exp); | 13 | struct nf_conntrack_expect *exp); |
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h index 3bbde0c3a8a6..2ab2830316b7 100644 --- a/include/linux/netfilter/nf_conntrack_pptp.h +++ b/include/linux/netfilter/nf_conntrack_pptp.h | |||
@@ -303,12 +303,14 @@ struct nf_conntrack_expect; | |||
303 | extern int | 303 | extern int |
304 | (*nf_nat_pptp_hook_outbound)(struct sk_buff *skb, | 304 | (*nf_nat_pptp_hook_outbound)(struct sk_buff *skb, |
305 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, | 305 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
306 | unsigned int protoff, | ||
306 | struct PptpControlHeader *ctlh, | 307 | struct PptpControlHeader *ctlh, |
307 | union pptp_ctrl_union *pptpReq); | 308 | union pptp_ctrl_union *pptpReq); |
308 | 309 | ||
309 | extern int | 310 | extern int |
310 | (*nf_nat_pptp_hook_inbound)(struct sk_buff *skb, | 311 | (*nf_nat_pptp_hook_inbound)(struct sk_buff *skb, |
311 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, | 312 | struct nf_conn *ct, enum ip_conntrack_info ctinfo, |
313 | unsigned int protoff, | ||
312 | struct PptpControlHeader *ctlh, | 314 | struct PptpControlHeader *ctlh, |
313 | union pptp_ctrl_union *pptpReq); | 315 | union pptp_ctrl_union *pptpReq); |
314 | 316 | ||
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 89f2a627f3f0..387bdd02945d 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -37,10 +37,12 @@ struct sdp_media_type { | |||
37 | struct sip_handler { | 37 | struct sip_handler { |
38 | const char *method; | 38 | const char *method; |
39 | unsigned int len; | 39 | unsigned int len; |
40 | int (*request)(struct sk_buff *skb, unsigned int dataoff, | 40 | int (*request)(struct sk_buff *skb, unsigned int protoff, |
41 | unsigned int dataoff, | ||
41 | const char **dptr, unsigned int *datalen, | 42 | const char **dptr, unsigned int *datalen, |
42 | unsigned int cseq); | 43 | unsigned int cseq); |
43 | int (*response)(struct sk_buff *skb, unsigned int dataoff, | 44 | int (*response)(struct sk_buff *skb, unsigned int protoff, |
45 | unsigned int dataoff, | ||
44 | const char **dptr, unsigned int *datalen, | 46 | const char **dptr, unsigned int *datalen, |
45 | unsigned int cseq, unsigned int code); | 47 | unsigned int cseq, unsigned int code); |
46 | }; | 48 | }; |
@@ -97,19 +99,20 @@ enum sip_header_types { | |||
97 | enum sdp_header_types { | 99 | enum sdp_header_types { |
98 | SDP_HDR_UNSPEC, | 100 | SDP_HDR_UNSPEC, |
99 | SDP_HDR_VERSION, | 101 | SDP_HDR_VERSION, |
100 | SDP_HDR_OWNER_IP4, | 102 | SDP_HDR_OWNER, |
101 | SDP_HDR_CONNECTION_IP4, | 103 | SDP_HDR_CONNECTION, |
102 | SDP_HDR_OWNER_IP6, | ||
103 | SDP_HDR_CONNECTION_IP6, | ||
104 | SDP_HDR_MEDIA, | 104 | SDP_HDR_MEDIA, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 107 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
108 | unsigned int protoff, | ||
108 | unsigned int dataoff, | 109 | unsigned int dataoff, |
109 | const char **dptr, | 110 | const char **dptr, |
110 | unsigned int *datalen); | 111 | unsigned int *datalen); |
111 | extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off); | 112 | extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, |
113 | unsigned int protoff, s16 off); | ||
112 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | 114 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, |
115 | unsigned int protoff, | ||
113 | unsigned int dataoff, | 116 | unsigned int dataoff, |
114 | const char **dptr, | 117 | const char **dptr, |
115 | unsigned int *datalen, | 118 | unsigned int *datalen, |
@@ -117,6 +120,7 @@ extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | |||
117 | unsigned int matchoff, | 120 | unsigned int matchoff, |
118 | unsigned int matchlen); | 121 | unsigned int matchlen); |
119 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, | 122 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, |
123 | unsigned int protoff, | ||
120 | unsigned int dataoff, | 124 | unsigned int dataoff, |
121 | const char **dptr, | 125 | const char **dptr, |
122 | unsigned int *datalen, | 126 | unsigned int *datalen, |
@@ -125,6 +129,7 @@ extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, | |||
125 | enum sdp_header_types term, | 129 | enum sdp_header_types term, |
126 | const union nf_inet_addr *addr); | 130 | const union nf_inet_addr *addr); |
127 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | 131 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, |
132 | unsigned int protoff, | ||
128 | unsigned int dataoff, | 133 | unsigned int dataoff, |
129 | const char **dptr, | 134 | const char **dptr, |
130 | unsigned int *datalen, | 135 | unsigned int *datalen, |
@@ -132,12 +137,14 @@ extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | |||
132 | unsigned int matchlen, | 137 | unsigned int matchlen, |
133 | u_int16_t port); | 138 | u_int16_t port); |
134 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, | 139 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, |
140 | unsigned int protoff, | ||
135 | unsigned int dataoff, | 141 | unsigned int dataoff, |
136 | const char **dptr, | 142 | const char **dptr, |
137 | unsigned int *datalen, | 143 | unsigned int *datalen, |
138 | unsigned int sdpoff, | 144 | unsigned int sdpoff, |
139 | const union nf_inet_addr *addr); | 145 | const union nf_inet_addr *addr); |
140 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, | 146 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, |
147 | unsigned int protoff, | ||
141 | unsigned int dataoff, | 148 | unsigned int dataoff, |
142 | const char **dptr, | 149 | const char **dptr, |
143 | unsigned int *datalen, | 150 | unsigned int *datalen, |
diff --git a/include/linux/netfilter/nf_nat.h b/include/linux/netfilter/nf_nat.h index 8df2d13730b2..bf0cc373ffb6 100644 --- a/include/linux/netfilter/nf_nat.h +++ b/include/linux/netfilter/nf_nat.h | |||
@@ -22,4 +22,12 @@ struct nf_nat_ipv4_multi_range_compat { | |||
22 | struct nf_nat_ipv4_range range[1]; | 22 | struct nf_nat_ipv4_range range[1]; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct nf_nat_range { | ||
26 | unsigned int flags; | ||
27 | union nf_inet_addr min_addr; | ||
28 | union nf_inet_addr max_addr; | ||
29 | union nf_conntrack_man_proto min_proto; | ||
30 | union nf_conntrack_man_proto max_proto; | ||
31 | }; | ||
32 | |||
25 | #endif /* _NETFILTER_NF_NAT_H */ | 33 | #endif /* _NETFILTER_NF_NAT_H */ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index f649f7423ca2..43bfe3e1685b 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -142,9 +142,13 @@ enum ctattr_tstamp { | |||
142 | 142 | ||
143 | enum ctattr_nat { | 143 | enum ctattr_nat { |
144 | CTA_NAT_UNSPEC, | 144 | CTA_NAT_UNSPEC, |
145 | CTA_NAT_MINIP, | 145 | CTA_NAT_V4_MINIP, |
146 | CTA_NAT_MAXIP, | 146 | #define CTA_NAT_MINIP CTA_NAT_V4_MINIP |
147 | CTA_NAT_V4_MAXIP, | ||
148 | #define CTA_NAT_MAXIP CTA_NAT_V4_MAXIP | ||
147 | CTA_NAT_PROTO, | 149 | CTA_NAT_PROTO, |
150 | CTA_NAT_V6_MINIP, | ||
151 | CTA_NAT_V6_MAXIP, | ||
148 | __CTA_NAT_MAX | 152 | __CTA_NAT_MAX |
149 | }; | 153 | }; |
150 | #define CTA_NAT_MAX (__CTA_NAT_MAX - 1) | 154 | #define CTA_NAT_MAX (__CTA_NAT_MAX - 1) |
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 3b1c1360aedf..70ec8c2bc11a 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -44,6 +44,7 @@ enum nfqnl_attr_type { | |||
44 | NFQA_PAYLOAD, /* opaque data payload */ | 44 | NFQA_PAYLOAD, /* opaque data payload */ |
45 | NFQA_CT, /* nf_conntrack_netlink.h */ | 45 | NFQA_CT, /* nf_conntrack_netlink.h */ |
46 | NFQA_CT_INFO, /* enum ip_conntrack_info */ | 46 | NFQA_CT_INFO, /* enum ip_conntrack_info */ |
47 | NFQA_CAP_LEN, /* __u32 length of captured packet */ | ||
47 | 48 | ||
48 | __NFQA_MAX | 49 | __NFQA_MAX |
49 | }; | 50 | }; |
diff --git a/include/linux/netfilter/xt_time.h b/include/linux/netfilter/xt_time.h index 7c37fac576c4..095886019396 100644 --- a/include/linux/netfilter/xt_time.h +++ b/include/linux/netfilter/xt_time.h | |||
@@ -17,6 +17,9 @@ enum { | |||
17 | /* Match against local time (instead of UTC) */ | 17 | /* Match against local time (instead of UTC) */ |
18 | XT_TIME_LOCAL_TZ = 1 << 0, | 18 | XT_TIME_LOCAL_TZ = 1 << 0, |
19 | 19 | ||
20 | /* treat timestart > timestop (e.g. 23:00-01:00) as single period */ | ||
21 | XT_TIME_CONTIGUOUS = 1 << 1, | ||
22 | |||
20 | /* Shortcuts */ | 23 | /* Shortcuts */ |
21 | XT_TIME_ALL_MONTHDAYS = 0xFFFFFFFE, | 24 | XT_TIME_ALL_MONTHDAYS = 0xFFFFFFFE, |
22 | XT_TIME_ALL_WEEKDAYS = 0xFE, | 25 | XT_TIME_ALL_WEEKDAYS = 0xFE, |
@@ -24,4 +27,6 @@ enum { | |||
24 | XT_TIME_MAX_DAYTIME = 24 * 60 * 60 - 1, | 27 | XT_TIME_MAX_DAYTIME = 24 * 60 * 60 - 1, |
25 | }; | 28 | }; |
26 | 29 | ||
30 | #define XT_TIME_ALL_FLAGS (XT_TIME_LOCAL_TZ|XT_TIME_CONTIGUOUS) | ||
31 | |||
27 | #endif /* _XT_TIME_H */ | 32 | #endif /* _XT_TIME_H */ |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index e2b12801378d..b962dfc695ae 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -79,7 +79,6 @@ enum nf_ip_hook_priorities { | |||
79 | 79 | ||
80 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
81 | extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); | 81 | extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type); |
82 | extern int ip_xfrm_me_harder(struct sk_buff *skb); | ||
83 | extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, | 82 | extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, |
84 | unsigned int dataoff, u_int8_t protocol); | 83 | unsigned int dataoff, u_int8_t protocol); |
85 | #endif /*__KERNEL__*/ | 84 | #endif /*__KERNEL__*/ |
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild index bd095bc075e9..b88c0058bf73 100644 --- a/include/linux/netfilter_ipv6/Kbuild +++ b/include/linux/netfilter_ipv6/Kbuild | |||
@@ -1,6 +1,7 @@ | |||
1 | header-y += ip6_tables.h | 1 | header-y += ip6_tables.h |
2 | header-y += ip6t_HL.h | 2 | header-y += ip6t_HL.h |
3 | header-y += ip6t_LOG.h | 3 | header-y += ip6t_LOG.h |
4 | header-y += ip6t_NPT.h | ||
4 | header-y += ip6t_REJECT.h | 5 | header-y += ip6t_REJECT.h |
5 | header-y += ip6t_ah.h | 6 | header-y += ip6t_ah.h |
6 | header-y += ip6t_frag.h | 7 | header-y += ip6t_frag.h |
diff --git a/include/linux/netfilter_ipv6/ip6t_NPT.h b/include/linux/netfilter_ipv6/ip6t_NPT.h new file mode 100644 index 000000000000..f763355481b5 --- /dev/null +++ b/include/linux/netfilter_ipv6/ip6t_NPT.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __NETFILTER_IP6T_NPT | ||
2 | #define __NETFILTER_IP6T_NPT | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netfilter.h> | ||
6 | |||
7 | struct ip6t_npt_tginfo { | ||
8 | union nf_inet_addr src_pfx; | ||
9 | union nf_inet_addr dst_pfx; | ||
10 | __u8 src_pfx_len; | ||
11 | __u8 dst_pfx_len; | ||
12 | /* Used internally by the kernel */ | ||
13 | __sum16 adjustment; | ||
14 | }; | ||
15 | |||
16 | #endif /* __NETFILTER_IP6T_NPT */ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index f74dd133788f..f80c56ac4d82 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -153,6 +153,8 @@ struct nlattr { | |||
153 | 153 | ||
154 | #include <linux/capability.h> | 154 | #include <linux/capability.h> |
155 | #include <linux/skbuff.h> | 155 | #include <linux/skbuff.h> |
156 | #include <linux/export.h> | ||
157 | #include <net/scm.h> | ||
156 | 158 | ||
157 | struct net; | 159 | struct net; |
158 | 160 | ||
@@ -162,9 +164,10 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) | |||
162 | } | 164 | } |
163 | 165 | ||
164 | struct netlink_skb_parms { | 166 | struct netlink_skb_parms { |
165 | struct ucred creds; /* Skb credentials */ | 167 | struct scm_creds creds; /* Skb credentials */ |
166 | __u32 pid; | 168 | __u32 portid; |
167 | __u32 dst_group; | 169 | __u32 dst_group; |
170 | struct sock *ssk; | ||
168 | }; | 171 | }; |
169 | 172 | ||
170 | #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) | 173 | #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) |
@@ -174,17 +177,27 @@ struct netlink_skb_parms { | |||
174 | extern void netlink_table_grab(void); | 177 | extern void netlink_table_grab(void); |
175 | extern void netlink_table_ungrab(void); | 178 | extern void netlink_table_ungrab(void); |
176 | 179 | ||
180 | #define NL_CFG_F_NONROOT_RECV (1 << 0) | ||
181 | #define NL_CFG_F_NONROOT_SEND (1 << 1) | ||
182 | |||
177 | /* optional Netlink kernel configuration parameters */ | 183 | /* optional Netlink kernel configuration parameters */ |
178 | struct netlink_kernel_cfg { | 184 | struct netlink_kernel_cfg { |
179 | unsigned int groups; | 185 | unsigned int groups; |
186 | unsigned int flags; | ||
180 | void (*input)(struct sk_buff *skb); | 187 | void (*input)(struct sk_buff *skb); |
181 | struct mutex *cb_mutex; | 188 | struct mutex *cb_mutex; |
182 | void (*bind)(int group); | 189 | void (*bind)(int group); |
183 | }; | 190 | }; |
184 | 191 | ||
185 | extern struct sock *netlink_kernel_create(struct net *net, int unit, | 192 | extern struct sock *__netlink_kernel_create(struct net *net, int unit, |
186 | struct module *module, | 193 | struct module *module, |
187 | struct netlink_kernel_cfg *cfg); | 194 | struct netlink_kernel_cfg *cfg); |
195 | static inline struct sock * | ||
196 | netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg) | ||
197 | { | ||
198 | return __netlink_kernel_create(net, unit, THIS_MODULE, cfg); | ||
199 | } | ||
200 | |||
188 | extern void netlink_kernel_release(struct sock *sk); | 201 | extern void netlink_kernel_release(struct sock *sk); |
189 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); | 202 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); |
190 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 203 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
@@ -192,14 +205,14 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group) | |||
192 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | 205 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); |
193 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 206 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
194 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 207 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
195 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 208 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock); |
196 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 209 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid, |
197 | __u32 group, gfp_t allocation); | 210 | __u32 group, gfp_t allocation); |
198 | extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, | 211 | extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb, |
199 | __u32 pid, __u32 group, gfp_t allocation, | 212 | __u32 portid, __u32 group, gfp_t allocation, |
200 | int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data), | 213 | int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data), |
201 | void *filter_data); | 214 | void *filter_data); |
202 | extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 215 | extern int netlink_set_err(struct sock *ssk, __u32 portid, __u32 group, int code); |
203 | extern int netlink_register_notifier(struct notifier_block *nb); | 216 | extern int netlink_register_notifier(struct notifier_block *nb); |
204 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 217 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
205 | 218 | ||
@@ -240,12 +253,12 @@ struct netlink_callback { | |||
240 | 253 | ||
241 | struct netlink_notify { | 254 | struct netlink_notify { |
242 | struct net *net; | 255 | struct net *net; |
243 | int pid; | 256 | int portid; |
244 | int protocol; | 257 | int protocol; |
245 | }; | 258 | }; |
246 | 259 | ||
247 | struct nlmsghdr * | 260 | struct nlmsghdr * |
248 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); | 261 | __nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int flags); |
249 | 262 | ||
250 | struct netlink_dump_control { | 263 | struct netlink_dump_control { |
251 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); | 264 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); |
@@ -258,11 +271,6 @@ extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | |||
258 | const struct nlmsghdr *nlh, | 271 | const struct nlmsghdr *nlh, |
259 | struct netlink_dump_control *control); | 272 | struct netlink_dump_control *control); |
260 | 273 | ||
261 | |||
262 | #define NL_NONROOT_RECV 0x1 | ||
263 | #define NL_NONROOT_SEND 0x2 | ||
264 | extern void netlink_set_nonroot(int protocol, unsigned flag); | ||
265 | |||
266 | #endif /* __KERNEL__ */ | 274 | #endif /* __KERNEL__ */ |
267 | 275 | ||
268 | #endif /* __LINUX_NETLINK_H */ | 276 | #endif /* __LINUX_NETLINK_H */ |
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 6189f27e305b..d908d17da56d 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
@@ -183,4 +183,15 @@ struct sockaddr_nfc_llcp { | |||
183 | 183 | ||
184 | #define NFC_HEADER_SIZE 1 | 184 | #define NFC_HEADER_SIZE 1 |
185 | 185 | ||
186 | /** | ||
187 | * Pseudo-header info for raw socket packets | ||
188 | * First byte is the adapter index | ||
189 | * Second byte contains flags | ||
190 | * - 0x01 - Direction (0=RX, 1=TX) | ||
191 | * - 0x02-0x80 - Reserved | ||
192 | **/ | ||
193 | #define NFC_LLCP_RAW_HEADER_SIZE 2 | ||
194 | #define NFC_LLCP_DIRECTION_RX 0x00 | ||
195 | #define NFC_LLCP_DIRECTION_TX 0x01 | ||
196 | |||
186 | #endif /*__LINUX_NFC_H */ | 197 | #endif /*__LINUX_NFC_H */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 2f3878806403..7df9b500c804 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -565,6 +565,19 @@ | |||
565 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with | 565 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with |
566 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. | 566 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. |
567 | * | 567 | * |
568 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by | ||
569 | * its %NL80211_ATTR_WDEV identifier. It must have been created with | ||
570 | * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the | ||
571 | * P2P Device can be used for P2P operations, e.g. remain-on-channel and | ||
572 | * public action frame TX. | ||
573 | * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by | ||
574 | * its %NL80211_ATTR_WDEV identifier. | ||
575 | * | ||
576 | * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to | ||
577 | * notify userspace that AP has rejected the connection request from a | ||
578 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON | ||
579 | * is used for this. | ||
580 | * | ||
568 | * @NL80211_CMD_MAX: highest used command number | 581 | * @NL80211_CMD_MAX: highest used command number |
569 | * @__NL80211_CMD_AFTER_LAST: internal use | 582 | * @__NL80211_CMD_AFTER_LAST: internal use |
570 | */ | 583 | */ |
@@ -708,6 +721,11 @@ enum nl80211_commands { | |||
708 | 721 | ||
709 | NL80211_CMD_CH_SWITCH_NOTIFY, | 722 | NL80211_CMD_CH_SWITCH_NOTIFY, |
710 | 723 | ||
724 | NL80211_CMD_START_P2P_DEVICE, | ||
725 | NL80211_CMD_STOP_P2P_DEVICE, | ||
726 | |||
727 | NL80211_CMD_CONN_FAILED, | ||
728 | |||
711 | /* add new commands above here */ | 729 | /* add new commands above here */ |
712 | 730 | ||
713 | /* used to define NL80211_CMD_MAX below */ | 731 | /* used to define NL80211_CMD_MAX below */ |
@@ -1251,6 +1269,10 @@ enum nl80211_commands { | |||
1251 | * was used to provide the hint. For the different types of | 1269 | * was used to provide the hint. For the different types of |
1252 | * allowed user regulatory hints see nl80211_user_reg_hint_type. | 1270 | * allowed user regulatory hints see nl80211_user_reg_hint_type. |
1253 | * | 1271 | * |
1272 | * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected | ||
1273 | * the connection request from a station. nl80211_connect_failed_reason | ||
1274 | * enum has different reasons of connection failure. | ||
1275 | * | ||
1254 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1276 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1255 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1277 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1256 | */ | 1278 | */ |
@@ -1506,6 +1528,8 @@ enum nl80211_attrs { | |||
1506 | 1528 | ||
1507 | NL80211_ATTR_USER_REG_HINT_TYPE, | 1529 | NL80211_ATTR_USER_REG_HINT_TYPE, |
1508 | 1530 | ||
1531 | NL80211_ATTR_CONN_FAILED_REASON, | ||
1532 | |||
1509 | /* add attributes here, update the policy in nl80211.c */ | 1533 | /* add attributes here, update the policy in nl80211.c */ |
1510 | 1534 | ||
1511 | __NL80211_ATTR_AFTER_LAST, | 1535 | __NL80211_ATTR_AFTER_LAST, |
@@ -1575,6 +1599,10 @@ enum nl80211_attrs { | |||
1575 | * @NL80211_IFTYPE_MESH_POINT: mesh point | 1599 | * @NL80211_IFTYPE_MESH_POINT: mesh point |
1576 | * @NL80211_IFTYPE_P2P_CLIENT: P2P client | 1600 | * @NL80211_IFTYPE_P2P_CLIENT: P2P client |
1577 | * @NL80211_IFTYPE_P2P_GO: P2P group owner | 1601 | * @NL80211_IFTYPE_P2P_GO: P2P group owner |
1602 | * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev | ||
1603 | * and therefore can't be created in the normal ways, use the | ||
1604 | * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE | ||
1605 | * commands to create and destroy one | ||
1578 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined | 1606 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined |
1579 | * @NUM_NL80211_IFTYPES: number of defined interface types | 1607 | * @NUM_NL80211_IFTYPES: number of defined interface types |
1580 | * | 1608 | * |
@@ -1593,6 +1621,7 @@ enum nl80211_iftype { | |||
1593 | NL80211_IFTYPE_MESH_POINT, | 1621 | NL80211_IFTYPE_MESH_POINT, |
1594 | NL80211_IFTYPE_P2P_CLIENT, | 1622 | NL80211_IFTYPE_P2P_CLIENT, |
1595 | NL80211_IFTYPE_P2P_GO, | 1623 | NL80211_IFTYPE_P2P_GO, |
1624 | NL80211_IFTYPE_P2P_DEVICE, | ||
1596 | 1625 | ||
1597 | /* keep last */ | 1626 | /* keep last */ |
1598 | NUM_NL80211_IFTYPES, | 1627 | NUM_NL80211_IFTYPES, |
@@ -2994,12 +3023,18 @@ enum nl80211_ap_sme_features { | |||
2994 | * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested | 3023 | * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested |
2995 | * to work properly to suppport receiving regulatory hints from | 3024 | * to work properly to suppport receiving regulatory hints from |
2996 | * cellular base stations. | 3025 | * cellular base stations. |
3026 | * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active | ||
3027 | * P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel | ||
3028 | * in the interface combinations, even when it's only used for scan | ||
3029 | * and remain-on-channel. This could be due to, for example, the | ||
3030 | * remain-on-channel implementation requiring a channel context. | ||
2997 | */ | 3031 | */ |
2998 | enum nl80211_feature_flags { | 3032 | enum nl80211_feature_flags { |
2999 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3033 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
3000 | NL80211_FEATURE_HT_IBSS = 1 << 1, | 3034 | NL80211_FEATURE_HT_IBSS = 1 << 1, |
3001 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, | 3035 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, |
3002 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, | 3036 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, |
3037 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, | ||
3003 | }; | 3038 | }; |
3004 | 3039 | ||
3005 | /** | 3040 | /** |
@@ -3023,4 +3058,15 @@ enum nl80211_probe_resp_offload_support_attr { | |||
3023 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, | 3058 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, |
3024 | }; | 3059 | }; |
3025 | 3060 | ||
3061 | /** | ||
3062 | * enum nl80211_connect_failed_reason - connection request failed reasons | ||
3063 | * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be | ||
3064 | * handled by the AP is reached. | ||
3065 | * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist. | ||
3066 | */ | ||
3067 | enum nl80211_connect_failed_reason { | ||
3068 | NL80211_CONN_FAIL_MAX_CLIENTS, | ||
3069 | NL80211_CONN_FAIL_BLOCKED_CLIENT, | ||
3070 | }; | ||
3071 | |||
3026 | #endif /* __LINUX_NL80211_H */ | 3072 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/of.h b/include/linux/of.h index 1b1163225f3b..f594c528842f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -193,6 +193,8 @@ extern struct device_node *of_get_next_child(const struct device_node *node, | |||
193 | extern struct device_node *of_get_next_available_child( | 193 | extern struct device_node *of_get_next_available_child( |
194 | const struct device_node *node, struct device_node *prev); | 194 | const struct device_node *node, struct device_node *prev); |
195 | 195 | ||
196 | extern struct device_node *of_get_child_by_name(const struct device_node *node, | ||
197 | const char *name); | ||
196 | #define for_each_child_of_node(parent, child) \ | 198 | #define for_each_child_of_node(parent, child) \ |
197 | for (child = of_get_next_child(parent, NULL); child != NULL; \ | 199 | for (child = of_get_next_child(parent, NULL); child != NULL; \ |
198 | child = of_get_next_child(parent, child)) | 200 | child = of_get_next_child(parent, child)) |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 01b925ad8d78..c3cdc1025c30 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #ifdef CONFIG_OF_ADDRESS | 7 | #ifdef CONFIG_OF_ADDRESS |
8 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 8 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
9 | extern bool of_can_translate_address(struct device_node *dev); | ||
9 | extern int of_address_to_resource(struct device_node *dev, int index, | 10 | extern int of_address_to_resource(struct device_node *dev, int index, |
10 | struct resource *r); | 11 | struct resource *r); |
11 | extern struct device_node *of_find_matching_node_by_address( | 12 | extern struct device_node *of_find_matching_node_by_address( |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 1717cd935e1c..b8e241125201 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -83,6 +83,11 @@ static inline unsigned int irq_of_parse_and_map(struct device_node *dev, | |||
83 | { | 83 | { |
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | |||
87 | static inline void *of_irq_find_parent(struct device_node *child) | ||
88 | { | ||
89 | return NULL; | ||
90 | } | ||
86 | #endif /* !CONFIG_OF */ | 91 | #endif /* !CONFIG_OF */ |
87 | 92 | ||
88 | #endif /* __OF_IRQ_H */ | 93 | #endif /* __OF_IRQ_H */ |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 912c27a0f7ee..6ef49b803efb 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/phy.h> | 12 | #include <linux/phy.h> |
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | 14 | ||
15 | #ifdef CONFIG_OF | ||
15 | extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); | 16 | extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); |
16 | extern struct phy_device *of_phy_find_device(struct device_node *phy_np); | 17 | extern struct phy_device *of_phy_find_device(struct device_node *phy_np); |
17 | extern struct phy_device *of_phy_connect(struct net_device *dev, | 18 | extern struct phy_device *of_phy_connect(struct net_device *dev, |
@@ -24,4 +25,36 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | |||
24 | 25 | ||
25 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); | 26 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); |
26 | 27 | ||
28 | #else /* CONFIG_OF */ | ||
29 | int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | ||
30 | { | ||
31 | return -ENOSYS; | ||
32 | } | ||
33 | |||
34 | struct phy_device *of_phy_find_device(struct device_node *phy_np) | ||
35 | { | ||
36 | return NULL; | ||
37 | } | ||
38 | |||
39 | struct phy_device *of_phy_connect(struct net_device *dev, | ||
40 | struct device_node *phy_np, | ||
41 | void (*hndlr)(struct net_device *), | ||
42 | u32 flags, phy_interface_t iface) | ||
43 | { | ||
44 | return NULL; | ||
45 | } | ||
46 | |||
47 | struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | ||
48 | void (*hndlr)(struct net_device *), | ||
49 | phy_interface_t iface) | ||
50 | { | ||
51 | return NULL; | ||
52 | } | ||
53 | |||
54 | struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) | ||
55 | { | ||
56 | return NULL; | ||
57 | } | ||
58 | #endif /* CONFIG_OF */ | ||
59 | |||
27 | #endif /* __LINUX_OF_MDIO_H */ | 60 | #endif /* __LINUX_OF_MDIO_H */ |
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 4ff57e81051d..85af8184691a 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h | |||
@@ -220,7 +220,12 @@ struct omapfb_display_info { | |||
220 | 220 | ||
221 | #ifdef __KERNEL__ | 221 | #ifdef __KERNEL__ |
222 | 222 | ||
223 | #include <plat/board.h> | 223 | struct omap_lcd_config { |
224 | char panel_name[16]; | ||
225 | char ctrl_name[16]; | ||
226 | s16 nreset_gpio; | ||
227 | u8 data_lines; | ||
228 | }; | ||
224 | 229 | ||
225 | struct omapfb_platform_data { | 230 | struct omapfb_platform_data { |
226 | struct omap_lcd_config lcd; | 231 | struct omap_lcd_config lcd; |
diff --git a/include/linux/opp.h b/include/linux/opp.h index 2a4e5faee904..214e0ebcb84d 100644 --- a/include/linux/opp.h +++ b/include/linux/opp.h | |||
@@ -48,6 +48,14 @@ int opp_disable(struct device *dev, unsigned long freq); | |||
48 | 48 | ||
49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); | 49 | struct srcu_notifier_head *opp_get_notifier(struct device *dev); |
50 | 50 | ||
51 | #ifdef CONFIG_OF | ||
52 | int of_init_opp_table(struct device *dev); | ||
53 | #else | ||
54 | static inline int of_init_opp_table(struct device *dev) | ||
55 | { | ||
56 | return -EINVAL; | ||
57 | } | ||
58 | #endif /* CONFIG_OF */ | ||
51 | #else | 59 | #else |
52 | static inline unsigned long opp_get_voltage(struct opp *opp) | 60 | static inline unsigned long opp_get_voltage(struct opp *opp) |
53 | { | 61 | { |
diff --git a/include/linux/packet_diag.h b/include/linux/packet_diag.h new file mode 100644 index 000000000000..93f5fa94a431 --- /dev/null +++ b/include/linux/packet_diag.h | |||
@@ -0,0 +1,72 @@ | |||
1 | #ifndef __PACKET_DIAG_H__ | ||
2 | #define __PACKET_DIAG_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct packet_diag_req { | ||
7 | __u8 sdiag_family; | ||
8 | __u8 sdiag_protocol; | ||
9 | __u16 pad; | ||
10 | __u32 pdiag_ino; | ||
11 | __u32 pdiag_show; | ||
12 | __u32 pdiag_cookie[2]; | ||
13 | }; | ||
14 | |||
15 | #define PACKET_SHOW_INFO 0x00000001 /* Basic packet_sk information */ | ||
16 | #define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */ | ||
17 | #define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */ | ||
18 | #define PACKET_SHOW_FANOUT 0x00000008 | ||
19 | |||
20 | struct packet_diag_msg { | ||
21 | __u8 pdiag_family; | ||
22 | __u8 pdiag_type; | ||
23 | __u16 pdiag_num; | ||
24 | |||
25 | __u32 pdiag_ino; | ||
26 | __u32 pdiag_cookie[2]; | ||
27 | }; | ||
28 | |||
29 | enum { | ||
30 | PACKET_DIAG_INFO, | ||
31 | PACKET_DIAG_MCLIST, | ||
32 | PACKET_DIAG_RX_RING, | ||
33 | PACKET_DIAG_TX_RING, | ||
34 | PACKET_DIAG_FANOUT, | ||
35 | |||
36 | PACKET_DIAG_MAX, | ||
37 | }; | ||
38 | |||
39 | struct packet_diag_info { | ||
40 | __u32 pdi_index; | ||
41 | __u32 pdi_version; | ||
42 | __u32 pdi_reserve; | ||
43 | __u32 pdi_copy_thresh; | ||
44 | __u32 pdi_tstamp; | ||
45 | __u32 pdi_flags; | ||
46 | |||
47 | #define PDI_RUNNING 0x1 | ||
48 | #define PDI_AUXDATA 0x2 | ||
49 | #define PDI_ORIGDEV 0x4 | ||
50 | #define PDI_VNETHDR 0x8 | ||
51 | #define PDI_LOSS 0x10 | ||
52 | }; | ||
53 | |||
54 | struct packet_diag_mclist { | ||
55 | __u32 pdmc_index; | ||
56 | __u32 pdmc_count; | ||
57 | __u16 pdmc_type; | ||
58 | __u16 pdmc_alen; | ||
59 | __u8 pdmc_addr[MAX_ADDR_LEN]; | ||
60 | }; | ||
61 | |||
62 | struct packet_diag_ring { | ||
63 | __u32 pdr_block_size; | ||
64 | __u32 pdr_block_nr; | ||
65 | __u32 pdr_frame_size; | ||
66 | __u32 pdr_frame_nr; | ||
67 | __u32 pdr_retire_tmo; | ||
68 | __u32 pdr_sizeof_priv; | ||
69 | __u32 pdr_features; | ||
70 | }; | ||
71 | |||
72 | #endif | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 248fba2af98a..9a22b5efb384 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -22,19 +22,24 @@ extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle); | |||
22 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 22 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
23 | { | 23 | { |
24 | struct pci_bus *pbus = pdev->bus; | 24 | struct pci_bus *pbus = pdev->bus; |
25 | |||
25 | /* Find a PCI root bus */ | 26 | /* Find a PCI root bus */ |
26 | while (!pci_is_root_bus(pbus)) | 27 | while (!pci_is_root_bus(pbus)) |
27 | pbus = pbus->parent; | 28 | pbus = pbus->parent; |
28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 29 | |
29 | pbus->number); | 30 | return DEVICE_ACPI_HANDLE(pbus->bridge); |
30 | } | 31 | } |
31 | 32 | ||
32 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
33 | { | 34 | { |
34 | if (!pci_is_root_bus(pbus)) | 35 | struct device *dev; |
35 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); | 36 | |
36 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 37 | if (pci_is_root_bus(pbus)) |
37 | pbus->number); | 38 | dev = pbus->bridge; |
39 | else | ||
40 | dev = &pbus->self->dev; | ||
41 | |||
42 | return DEVICE_ACPI_HANDLE(dev); | ||
38 | } | 43 | } |
39 | #endif | 44 | #endif |
40 | 45 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5faa8310eec9..be1de01de1c4 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -254,10 +254,10 @@ struct pci_dev { | |||
254 | u8 revision; /* PCI revision, low byte of class word */ | 254 | u8 revision; /* PCI revision, low byte of class word */ |
255 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 255 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
256 | u8 pcie_cap; /* PCI-E capability offset */ | 256 | u8 pcie_cap; /* PCI-E capability offset */ |
257 | u8 pcie_type:4; /* PCI-E device/port type */ | ||
258 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ | 257 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ |
259 | u8 rom_base_reg; /* which config register controls the ROM */ | 258 | u8 rom_base_reg; /* which config register controls the ROM */ |
260 | u8 pin; /* which interrupt pin this device uses */ | 259 | u8 pin; /* which interrupt pin this device uses */ |
260 | u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ | ||
261 | 261 | ||
262 | struct pci_driver *driver; /* which driver has allocated this device */ | 262 | struct pci_driver *driver; /* which driver has allocated this device */ |
263 | u64 dma_mask; /* Mask of the bits of bus address this | 263 | u64 dma_mask; /* Mask of the bits of bus address this |
@@ -369,7 +369,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
369 | 369 | ||
370 | extern struct pci_dev *alloc_pci_dev(void); | 370 | extern struct pci_dev *alloc_pci_dev(void); |
371 | 371 | ||
372 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) | ||
373 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 372 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
374 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 373 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
375 | 374 | ||
@@ -596,7 +595,7 @@ struct pci_driver { | |||
596 | int (*resume_early) (struct pci_dev *dev); | 595 | int (*resume_early) (struct pci_dev *dev); |
597 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 596 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
598 | void (*shutdown) (struct pci_dev *dev); | 597 | void (*shutdown) (struct pci_dev *dev); |
599 | struct pci_error_handlers *err_handler; | 598 | const struct pci_error_handlers *err_handler; |
600 | struct device_driver driver; | 599 | struct device_driver driver; |
601 | struct pci_dynids dynids; | 600 | struct pci_dynids dynids; |
602 | }; | 601 | }; |
@@ -734,9 +733,7 @@ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); | |||
734 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | 733 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); |
735 | extern void pci_dev_put(struct pci_dev *dev); | 734 | extern void pci_dev_put(struct pci_dev *dev); |
736 | extern void pci_remove_bus(struct pci_bus *b); | 735 | extern void pci_remove_bus(struct pci_bus *b); |
737 | extern void __pci_remove_bus_device(struct pci_dev *dev); | ||
738 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 736 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
739 | extern void pci_stop_bus_device(struct pci_dev *dev); | ||
740 | void pci_setup_cardbus(struct pci_bus *bus); | 737 | void pci_setup_cardbus(struct pci_bus *bus); |
741 | extern void pci_sort_breadthfirst(void); | 738 | extern void pci_sort_breadthfirst(void); |
742 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | 739 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) |
@@ -755,6 +752,7 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev); | |||
755 | int pci_find_capability(struct pci_dev *dev, int cap); | 752 | int pci_find_capability(struct pci_dev *dev, int cap); |
756 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); | 753 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); |
757 | int pci_find_ext_capability(struct pci_dev *dev, int cap); | 754 | int pci_find_ext_capability(struct pci_dev *dev, int cap); |
755 | int pci_find_next_ext_capability(struct pci_dev *dev, int pos, int cap); | ||
758 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); | 756 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); |
759 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); | 757 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); |
760 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); | 758 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |
@@ -816,6 +814,39 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where, | |||
816 | return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); | 814 | return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); |
817 | } | 815 | } |
818 | 816 | ||
817 | int pcie_capability_read_word(struct pci_dev *dev, int pos, u16 *val); | ||
818 | int pcie_capability_read_dword(struct pci_dev *dev, int pos, u32 *val); | ||
819 | int pcie_capability_write_word(struct pci_dev *dev, int pos, u16 val); | ||
820 | int pcie_capability_write_dword(struct pci_dev *dev, int pos, u32 val); | ||
821 | int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos, | ||
822 | u16 clear, u16 set); | ||
823 | int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, | ||
824 | u32 clear, u32 set); | ||
825 | |||
826 | static inline int pcie_capability_set_word(struct pci_dev *dev, int pos, | ||
827 | u16 set) | ||
828 | { | ||
829 | return pcie_capability_clear_and_set_word(dev, pos, 0, set); | ||
830 | } | ||
831 | |||
832 | static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos, | ||
833 | u32 set) | ||
834 | { | ||
835 | return pcie_capability_clear_and_set_dword(dev, pos, 0, set); | ||
836 | } | ||
837 | |||
838 | static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, | ||
839 | u16 clear) | ||
840 | { | ||
841 | return pcie_capability_clear_and_set_word(dev, pos, clear, 0); | ||
842 | } | ||
843 | |||
844 | static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos, | ||
845 | u32 clear) | ||
846 | { | ||
847 | return pcie_capability_clear_and_set_dword(dev, pos, clear, 0); | ||
848 | } | ||
849 | |||
819 | /* user-space driven config access */ | 850 | /* user-space driven config access */ |
820 | int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); | 851 | int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); |
821 | int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); | 852 | int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); |
@@ -1013,7 +1044,6 @@ void pci_unregister_driver(struct pci_driver *dev); | |||
1013 | module_driver(__pci_driver, pci_register_driver, \ | 1044 | module_driver(__pci_driver, pci_register_driver, \ |
1014 | pci_unregister_driver) | 1045 | pci_unregister_driver) |
1015 | 1046 | ||
1016 | void pci_stop_and_remove_behind_bridge(struct pci_dev *dev); | ||
1017 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); | 1047 | struct pci_driver *pci_dev_driver(const struct pci_dev *dev); |
1018 | int pci_add_dynid(struct pci_driver *drv, | 1048 | int pci_add_dynid(struct pci_driver *drv, |
1019 | unsigned int vendor, unsigned int device, | 1049 | unsigned int vendor, unsigned int device, |
@@ -1031,6 +1061,8 @@ int pci_cfg_space_size_ext(struct pci_dev *dev); | |||
1031 | int pci_cfg_space_size(struct pci_dev *dev); | 1061 | int pci_cfg_space_size(struct pci_dev *dev); |
1032 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 1062 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
1033 | void pci_setup_bridge(struct pci_bus *bus); | 1063 | void pci_setup_bridge(struct pci_bus *bus); |
1064 | resource_size_t pcibios_window_alignment(struct pci_bus *bus, | ||
1065 | unsigned long type); | ||
1034 | 1066 | ||
1035 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) | 1067 | #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) |
1036 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) | 1068 | #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) |
@@ -1472,7 +1504,7 @@ enum pci_fixup_pass { | |||
1472 | /* Anonymous variables would be nice... */ | 1504 | /* Anonymous variables would be nice... */ |
1473 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1505 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
1474 | class_shift, hook) \ | 1506 | class_shift, hook) \ |
1475 | static const struct pci_fixup const __pci_fixup_##name __used \ | 1507 | static const struct pci_fixup __pci_fixup_##name __used \ |
1476 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1508 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
1477 | = { vendor, device, class, class_shift, hook }; | 1509 | = { vendor, device, class, class_shift, hook }; |
1478 | 1510 | ||
@@ -1650,6 +1682,15 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
1650 | return !!pci_pcie_cap(dev); | 1682 | return !!pci_pcie_cap(dev); |
1651 | } | 1683 | } |
1652 | 1684 | ||
1685 | /** | ||
1686 | * pci_pcie_type - get the PCIe device/port type | ||
1687 | * @dev: PCI device | ||
1688 | */ | ||
1689 | static inline int pci_pcie_type(const struct pci_dev *dev) | ||
1690 | { | ||
1691 | return (dev->pcie_flags_reg & PCI_EXP_FLAGS_TYPE) >> 4; | ||
1692 | } | ||
1693 | |||
1653 | void pci_request_acs(void); | 1694 | void pci_request_acs(void); |
1654 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); | 1695 | bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); |
1655 | bool pci_acs_path_enabled(struct pci_dev *start, | 1696 | bool pci_acs_path_enabled(struct pci_dev *start, |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6b4565c440c8..33880f6f4e51 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -753,6 +753,7 @@ | |||
753 | #define PCI_DEVICE_ID_HP_CISSD 0x3238 | 753 | #define PCI_DEVICE_ID_HP_CISSD 0x3238 |
754 | #define PCI_DEVICE_ID_HP_CISSE 0x323a | 754 | #define PCI_DEVICE_ID_HP_CISSE 0x323a |
755 | #define PCI_DEVICE_ID_HP_CISSF 0x323b | 755 | #define PCI_DEVICE_ID_HP_CISSF 0x323b |
756 | #define PCI_DEVICE_ID_HP_CISSH 0x323c | ||
756 | #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 | 757 | #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 |
757 | 758 | ||
758 | #define PCI_VENDOR_ID_PCTECH 0x1042 | 759 | #define PCI_VENDOR_ID_PCTECH 0x1042 |
@@ -1847,7 +1848,6 @@ | |||
1847 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 | 1848 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 |
1848 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 | 1849 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 |
1849 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | 1850 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 |
1850 | #define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530 | ||
1851 | 1851 | ||
1852 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1852 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
1853 | 1853 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 7fb75b143755..20ae747ddf34 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -549,6 +549,7 @@ | |||
549 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ | 549 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ |
550 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ | 550 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ |
551 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 551 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
552 | #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ | ||
552 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 553 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
553 | 554 | ||
554 | /* Extended Capabilities (PCI-X 2.0 and Express) */ | 555 | /* Extended Capabilities (PCI-X 2.0 and Express) */ |
@@ -677,6 +678,12 @@ | |||
677 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ | 678 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ |
678 | #define PCI_EXT_CAP_PWR_SIZEOF 16 | 679 | #define PCI_EXT_CAP_PWR_SIZEOF 16 |
679 | 680 | ||
681 | /* Vendor-Specific (VSEC, PCI_EXT_CAP_ID_VNDR) */ | ||
682 | #define PCI_VNDR_HEADER 4 /* Vendor-Specific Header */ | ||
683 | #define PCI_VNDR_HEADER_ID(x) ((x) & 0xffff) | ||
684 | #define PCI_VNDR_HEADER_REV(x) (((x) >> 16) & 0xf) | ||
685 | #define PCI_VNDR_HEADER_LEN(x) (((x) >> 20) & 0xfff) | ||
686 | |||
680 | /* | 687 | /* |
681 | * Hypertransport sub capability types | 688 | * Hypertransport sub capability types |
682 | * | 689 | * |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index 6775532b92a9..e6f91b1406d8 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
@@ -49,7 +49,7 @@ struct pcie_port_service_driver { | |||
49 | int (*resume) (struct pcie_device *dev); | 49 | int (*resume) (struct pcie_device *dev); |
50 | 50 | ||
51 | /* Service Error Recovery Handler */ | 51 | /* Service Error Recovery Handler */ |
52 | struct pci_error_handlers *err_handler; | 52 | const struct pci_error_handlers *err_handler; |
53 | 53 | ||
54 | /* Link Reset Capability - AER service driver specific */ | 54 | /* Link Reset Capability - AER service driver specific */ |
55 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); | 55 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index bdb41612bfec..599afc4bb67e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -130,8 +130,10 @@ enum perf_event_sample_format { | |||
130 | PERF_SAMPLE_STREAM_ID = 1U << 9, | 130 | PERF_SAMPLE_STREAM_ID = 1U << 9, |
131 | PERF_SAMPLE_RAW = 1U << 10, | 131 | PERF_SAMPLE_RAW = 1U << 10, |
132 | PERF_SAMPLE_BRANCH_STACK = 1U << 11, | 132 | PERF_SAMPLE_BRANCH_STACK = 1U << 11, |
133 | PERF_SAMPLE_REGS_USER = 1U << 12, | ||
134 | PERF_SAMPLE_STACK_USER = 1U << 13, | ||
133 | 135 | ||
134 | PERF_SAMPLE_MAX = 1U << 12, /* non-ABI */ | 136 | PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */ |
135 | }; | 137 | }; |
136 | 138 | ||
137 | /* | 139 | /* |
@@ -163,6 +165,15 @@ enum perf_branch_sample_type { | |||
163 | PERF_SAMPLE_BRANCH_HV) | 165 | PERF_SAMPLE_BRANCH_HV) |
164 | 166 | ||
165 | /* | 167 | /* |
168 | * Values to determine ABI of the registers dump. | ||
169 | */ | ||
170 | enum perf_sample_regs_abi { | ||
171 | PERF_SAMPLE_REGS_ABI_NONE = 0, | ||
172 | PERF_SAMPLE_REGS_ABI_32 = 1, | ||
173 | PERF_SAMPLE_REGS_ABI_64 = 2, | ||
174 | }; | ||
175 | |||
176 | /* | ||
166 | * The format of the data returned by read() on a perf event fd, | 177 | * The format of the data returned by read() on a perf event fd, |
167 | * as specified by attr.read_format: | 178 | * as specified by attr.read_format: |
168 | * | 179 | * |
@@ -194,6 +205,8 @@ enum perf_event_read_format { | |||
194 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | 205 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ |
195 | #define PERF_ATTR_SIZE_VER1 72 /* add: config2 */ | 206 | #define PERF_ATTR_SIZE_VER1 72 /* add: config2 */ |
196 | #define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ | 207 | #define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */ |
208 | #define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */ | ||
209 | /* add: sample_stack_user */ | ||
197 | 210 | ||
198 | /* | 211 | /* |
199 | * Hardware event_id to monitor via a performance monitoring event: | 212 | * Hardware event_id to monitor via a performance monitoring event: |
@@ -255,7 +268,10 @@ struct perf_event_attr { | |||
255 | exclude_host : 1, /* don't count in host */ | 268 | exclude_host : 1, /* don't count in host */ |
256 | exclude_guest : 1, /* don't count in guest */ | 269 | exclude_guest : 1, /* don't count in guest */ |
257 | 270 | ||
258 | __reserved_1 : 43; | 271 | exclude_callchain_kernel : 1, /* exclude kernel callchains */ |
272 | exclude_callchain_user : 1, /* exclude user callchains */ | ||
273 | |||
274 | __reserved_1 : 41; | ||
259 | 275 | ||
260 | union { | 276 | union { |
261 | __u32 wakeup_events; /* wakeup every n events */ | 277 | __u32 wakeup_events; /* wakeup every n events */ |
@@ -271,7 +287,21 @@ struct perf_event_attr { | |||
271 | __u64 bp_len; | 287 | __u64 bp_len; |
272 | __u64 config2; /* extension of config1 */ | 288 | __u64 config2; /* extension of config1 */ |
273 | }; | 289 | }; |
274 | __u64 branch_sample_type; /* enum branch_sample_type */ | 290 | __u64 branch_sample_type; /* enum perf_branch_sample_type */ |
291 | |||
292 | /* | ||
293 | * Defines set of user regs to dump on samples. | ||
294 | * See asm/perf_regs.h for details. | ||
295 | */ | ||
296 | __u64 sample_regs_user; | ||
297 | |||
298 | /* | ||
299 | * Defines size of the user stack to dump on samples. | ||
300 | */ | ||
301 | __u32 sample_stack_user; | ||
302 | |||
303 | /* Align to u64. */ | ||
304 | __u32 __reserved_2; | ||
275 | }; | 305 | }; |
276 | 306 | ||
277 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) | 307 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) |
@@ -550,6 +580,13 @@ enum perf_event_type { | |||
550 | * char data[size];}&& PERF_SAMPLE_RAW | 580 | * char data[size];}&& PERF_SAMPLE_RAW |
551 | * | 581 | * |
552 | * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK | 582 | * { u64 from, to, flags } lbr[nr];} && PERF_SAMPLE_BRANCH_STACK |
583 | * | ||
584 | * { u64 abi; # enum perf_sample_regs_abi | ||
585 | * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER | ||
586 | * | ||
587 | * { u64 size; | ||
588 | * char data[size]; | ||
589 | * u64 dyn_size; } && PERF_SAMPLE_STACK_USER | ||
553 | * }; | 590 | * }; |
554 | */ | 591 | */ |
555 | PERF_RECORD_SAMPLE = 9, | 592 | PERF_RECORD_SAMPLE = 9, |
@@ -611,6 +648,7 @@ struct perf_guest_info_callbacks { | |||
611 | #include <linux/static_key.h> | 648 | #include <linux/static_key.h> |
612 | #include <linux/atomic.h> | 649 | #include <linux/atomic.h> |
613 | #include <linux/sysfs.h> | 650 | #include <linux/sysfs.h> |
651 | #include <linux/perf_regs.h> | ||
614 | #include <asm/local.h> | 652 | #include <asm/local.h> |
615 | 653 | ||
616 | struct perf_callchain_entry { | 654 | struct perf_callchain_entry { |
@@ -656,6 +694,11 @@ struct perf_branch_stack { | |||
656 | struct perf_branch_entry entries[0]; | 694 | struct perf_branch_entry entries[0]; |
657 | }; | 695 | }; |
658 | 696 | ||
697 | struct perf_regs_user { | ||
698 | __u64 abi; | ||
699 | struct pt_regs *regs; | ||
700 | }; | ||
701 | |||
659 | struct task_struct; | 702 | struct task_struct; |
660 | 703 | ||
661 | /* | 704 | /* |
@@ -1135,6 +1178,8 @@ struct perf_sample_data { | |||
1135 | struct perf_callchain_entry *callchain; | 1178 | struct perf_callchain_entry *callchain; |
1136 | struct perf_raw_record *raw; | 1179 | struct perf_raw_record *raw; |
1137 | struct perf_branch_stack *br_stack; | 1180 | struct perf_branch_stack *br_stack; |
1181 | struct perf_regs_user regs_user; | ||
1182 | u64 stack_user_size; | ||
1138 | }; | 1183 | }; |
1139 | 1184 | ||
1140 | static inline void perf_sample_data_init(struct perf_sample_data *data, | 1185 | static inline void perf_sample_data_init(struct perf_sample_data *data, |
@@ -1144,7 +1189,10 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, | |||
1144 | data->addr = addr; | 1189 | data->addr = addr; |
1145 | data->raw = NULL; | 1190 | data->raw = NULL; |
1146 | data->br_stack = NULL; | 1191 | data->br_stack = NULL; |
1147 | data->period = period; | 1192 | data->period = period; |
1193 | data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; | ||
1194 | data->regs_user.regs = NULL; | ||
1195 | data->stack_user_size = 0; | ||
1148 | } | 1196 | } |
1149 | 1197 | ||
1150 | extern void perf_output_sample(struct perf_output_handle *handle, | 1198 | extern void perf_output_sample(struct perf_output_handle *handle, |
@@ -1292,8 +1340,10 @@ static inline bool has_branch_stack(struct perf_event *event) | |||
1292 | extern int perf_output_begin(struct perf_output_handle *handle, | 1340 | extern int perf_output_begin(struct perf_output_handle *handle, |
1293 | struct perf_event *event, unsigned int size); | 1341 | struct perf_event *event, unsigned int size); |
1294 | extern void perf_output_end(struct perf_output_handle *handle); | 1342 | extern void perf_output_end(struct perf_output_handle *handle); |
1295 | extern void perf_output_copy(struct perf_output_handle *handle, | 1343 | extern unsigned int perf_output_copy(struct perf_output_handle *handle, |
1296 | const void *buf, unsigned int len); | 1344 | const void *buf, unsigned int len); |
1345 | extern unsigned int perf_output_skip(struct perf_output_handle *handle, | ||
1346 | unsigned int len); | ||
1297 | extern int perf_swevent_get_recursion_context(void); | 1347 | extern int perf_swevent_get_recursion_context(void); |
1298 | extern void perf_swevent_put_recursion_context(int rctx); | 1348 | extern void perf_swevent_put_recursion_context(int rctx); |
1299 | extern void perf_event_enable(struct perf_event *event); | 1349 | extern void perf_event_enable(struct perf_event *event); |
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h new file mode 100644 index 000000000000..3c73d5fe18be --- /dev/null +++ b/include/linux/perf_regs.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef _LINUX_PERF_REGS_H | ||
2 | #define _LINUX_PERF_REGS_H | ||
3 | |||
4 | #ifdef CONFIG_HAVE_PERF_REGS | ||
5 | #include <asm/perf_regs.h> | ||
6 | u64 perf_reg_value(struct pt_regs *regs, int idx); | ||
7 | int perf_reg_validate(u64 mask); | ||
8 | u64 perf_reg_abi(struct task_struct *task); | ||
9 | #else | ||
10 | static inline u64 perf_reg_value(struct pt_regs *regs, int idx) | ||
11 | { | ||
12 | return 0; | ||
13 | } | ||
14 | |||
15 | static inline int perf_reg_validate(u64 mask) | ||
16 | { | ||
17 | return mask ? -ENOSYS : 0; | ||
18 | } | ||
19 | |||
20 | static inline u64 perf_reg_abi(struct task_struct *task) | ||
21 | { | ||
22 | return PERF_SAMPLE_REGS_ABI_NONE; | ||
23 | } | ||
24 | #endif /* CONFIG_HAVE_PERF_REGS */ | ||
25 | #endif /* _LINUX_PERF_REGS_H */ | ||
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index e9b7f4350844..4aad3cea69ae 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
17 | #include <linux/seq_file.h> | 17 | #include <linux/seq_file.h> |
18 | #include "pinctrl-state.h" | 18 | #include <linux/pinctrl/pinctrl-state.h> |
19 | 19 | ||
20 | /* This struct is private to the core and should be regarded as a cookie */ | 20 | /* This struct is private to the core and should be regarded as a cookie */ |
21 | struct pinctrl; | 21 | struct pinctrl; |
@@ -140,7 +140,7 @@ static inline struct pinctrl * __must_check devm_pinctrl_get_select( | |||
140 | s = pinctrl_lookup_state(p, name); | 140 | s = pinctrl_lookup_state(p, name); |
141 | if (IS_ERR(s)) { | 141 | if (IS_ERR(s)) { |
142 | devm_pinctrl_put(p); | 142 | devm_pinctrl_put(p); |
143 | return ERR_PTR(PTR_ERR(s)); | 143 | return ERR_CAST(s); |
144 | } | 144 | } |
145 | 145 | ||
146 | ret = pinctrl_select_state(p, s); | 146 | ret = pinctrl_select_state(p, s); |
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h index 7d22ab00343f..e5b1716f98cc 100644 --- a/include/linux/pinctrl/machine.h +++ b/include/linux/pinctrl/machine.h | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/bug.h> | 15 | #include <linux/bug.h> |
16 | 16 | ||
17 | #include "pinctrl-state.h" | 17 | #include <linux/pinctrl/pinctrl-state.h> |
18 | 18 | ||
19 | enum pinctrl_map_type { | 19 | enum pinctrl_map_type { |
20 | PIN_MAP_TYPE_INVALID, | 20 | PIN_MAP_TYPE_INVALID, |
diff --git a/include/linux/pinctrl/pinctrl-state.h b/include/linux/pinctrl/pinctrl-state.h index 634608dc6c89..b5919f8e6d1a 100644 --- a/include/linux/pinctrl/pinctrl-state.h +++ b/include/linux/pinctrl/pinctrl-state.h | |||
@@ -6,13 +6,18 @@ | |||
6 | * @PINCTRL_STATE_DEFAULT: the state the pinctrl handle shall be put | 6 | * @PINCTRL_STATE_DEFAULT: the state the pinctrl handle shall be put |
7 | * into as default, usually this means the pins are up and ready to | 7 | * into as default, usually this means the pins are up and ready to |
8 | * be used by the device driver. This state is commonly used by | 8 | * be used by the device driver. This state is commonly used by |
9 | * hogs to configure muxing and pins at boot. | 9 | * hogs to configure muxing and pins at boot, and also as a state |
10 | * to go into when returning from sleep and idle in | ||
11 | * .pm_runtime_resume() or ordinary .resume() for example. | ||
10 | * @PINCTRL_STATE_IDLE: the state the pinctrl handle shall be put into | 12 | * @PINCTRL_STATE_IDLE: the state the pinctrl handle shall be put into |
11 | * when the pins are idle. Could typically be set from a | 13 | * when the pins are idle. This is a state where the system is relaxed |
12 | * pm_runtime_suspend() operation. | 14 | * but not fully sleeping - some power may be on but clocks gated for |
15 | * example. Could typically be set from a pm_runtime_suspend() or | ||
16 | * pm_runtime_idle() operation. | ||
13 | * @PINCTRL_STATE_SLEEP: the state the pinctrl handle shall be put into | 17 | * @PINCTRL_STATE_SLEEP: the state the pinctrl handle shall be put into |
14 | * when the pins are sleeping. Could typically be set from a | 18 | * when the pins are sleeping. This is a state where the system is in |
15 | * common suspend() function. | 19 | * its lowest sleep state. Could typically be set from an |
20 | * ordinary .suspend() function. | ||
16 | */ | 21 | */ |
17 | #define PINCTRL_STATE_DEFAULT "default" | 22 | #define PINCTRL_STATE_DEFAULT "default" |
18 | #define PINCTRL_STATE_IDLE "idle" | 23 | #define PINCTRL_STATE_IDLE "idle" |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 69393a662532..7d087f03e91e 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/radix-tree.h> | 17 | #include <linux/radix-tree.h> |
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
20 | #include "pinctrl-state.h" | 20 | #include <linux/pinctrl/pinctrl-state.h> |
21 | 21 | ||
22 | struct device; | 22 | struct device; |
23 | struct pinctrl_dev; | 23 | struct pinctrl_dev; |
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index 1818dcbdd9ab..c15395031cb3 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
17 | #include "pinctrl.h" | 17 | #include <linux/pinctrl/pinctrl.h> |
18 | 18 | ||
19 | #ifdef CONFIG_PINMUX | 19 | #ifdef CONFIG_PINMUX |
20 | 20 | ||
diff --git a/include/linux/platform_data/ad5755.h b/include/linux/platform_data/ad5755.h new file mode 100644 index 000000000000..a5a1cb751874 --- /dev/null +++ b/include/linux/platform_data/ad5755.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Analog Devices Inc. | ||
3 | * | ||
4 | * Licensed under the GPL-2. | ||
5 | */ | ||
6 | #ifndef __LINUX_PLATFORM_DATA_AD5755_H__ | ||
7 | #define __LINUX_PLATFORM_DATA_AD5755_H__ | ||
8 | |||
9 | enum ad5755_mode { | ||
10 | AD5755_MODE_VOLTAGE_0V_5V = 0, | ||
11 | AD5755_MODE_VOLTAGE_0V_10V = 1, | ||
12 | AD5755_MODE_VOLTAGE_PLUSMINUS_5V = 2, | ||
13 | AD5755_MODE_VOLTAGE_PLUSMINUS_10V = 3, | ||
14 | AD5755_MODE_CURRENT_4mA_20mA = 4, | ||
15 | AD5755_MODE_CURRENT_0mA_20mA = 5, | ||
16 | AD5755_MODE_CURRENT_0mA_24mA = 6, | ||
17 | }; | ||
18 | |||
19 | enum ad5755_dc_dc_phase { | ||
20 | AD5755_DC_DC_PHASE_ALL_SAME_EDGE = 0, | ||
21 | AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE = 1, | ||
22 | AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE = 2, | ||
23 | AD5755_DC_DC_PHASE_90_DEGREE = 3, | ||
24 | }; | ||
25 | |||
26 | enum ad5755_dc_dc_freq { | ||
27 | AD5755_DC_DC_FREQ_250kHZ = 0, | ||
28 | AD5755_DC_DC_FREQ_410kHZ = 1, | ||
29 | AD5755_DC_DC_FREQ_650kHZ = 2, | ||
30 | }; | ||
31 | |||
32 | enum ad5755_dc_dc_maxv { | ||
33 | AD5755_DC_DC_MAXV_23V = 0, | ||
34 | AD5755_DC_DC_MAXV_24V5 = 1, | ||
35 | AD5755_DC_DC_MAXV_27V = 2, | ||
36 | AD5755_DC_DC_MAXV_29V5 = 3, | ||
37 | }; | ||
38 | |||
39 | enum ad5755_slew_rate { | ||
40 | AD5755_SLEW_RATE_64k = 0, | ||
41 | AD5755_SLEW_RATE_32k = 1, | ||
42 | AD5755_SLEW_RATE_16k = 2, | ||
43 | AD5755_SLEW_RATE_8k = 3, | ||
44 | AD5755_SLEW_RATE_4k = 4, | ||
45 | AD5755_SLEW_RATE_2k = 5, | ||
46 | AD5755_SLEW_RATE_1k = 6, | ||
47 | AD5755_SLEW_RATE_500 = 7, | ||
48 | AD5755_SLEW_RATE_250 = 8, | ||
49 | AD5755_SLEW_RATE_125 = 9, | ||
50 | AD5755_SLEW_RATE_64 = 10, | ||
51 | AD5755_SLEW_RATE_32 = 11, | ||
52 | AD5755_SLEW_RATE_16 = 12, | ||
53 | AD5755_SLEW_RATE_8 = 13, | ||
54 | AD5755_SLEW_RATE_4 = 14, | ||
55 | AD5755_SLEW_RATE_0_5 = 15, | ||
56 | }; | ||
57 | |||
58 | enum ad5755_slew_step_size { | ||
59 | AD5755_SLEW_STEP_SIZE_1 = 0, | ||
60 | AD5755_SLEW_STEP_SIZE_2 = 1, | ||
61 | AD5755_SLEW_STEP_SIZE_4 = 2, | ||
62 | AD5755_SLEW_STEP_SIZE_8 = 3, | ||
63 | AD5755_SLEW_STEP_SIZE_16 = 4, | ||
64 | AD5755_SLEW_STEP_SIZE_32 = 5, | ||
65 | AD5755_SLEW_STEP_SIZE_64 = 6, | ||
66 | AD5755_SLEW_STEP_SIZE_128 = 7, | ||
67 | AD5755_SLEW_STEP_SIZE_256 = 8, | ||
68 | }; | ||
69 | |||
70 | /** | ||
71 | * struct ad5755_platform_data - AD5755 DAC driver platform data | ||
72 | * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter | ||
73 | * compensation register is used. | ||
74 | * @dc_dc_phase: DC-DC converter phase. | ||
75 | * @dc_dc_freq: DC-DC converter frequency. | ||
76 | * @dc_dc_maxv: DC-DC maximum allowed boost voltage. | ||
77 | * @dac.mode: The mode to be used for the DAC output. | ||
78 | * @dac.ext_current_sense_resistor: Whether an external current sense resistor | ||
79 | * is used. | ||
80 | * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange. | ||
81 | * @dac.slew.enable: Whether to enable digital slew. | ||
82 | * @dac.slew.rate: Slew rate of the digital slew. | ||
83 | * @dac.slew.step_size: Slew step size of the digital slew. | ||
84 | **/ | ||
85 | struct ad5755_platform_data { | ||
86 | bool ext_dc_dc_compenstation_resistor; | ||
87 | enum ad5755_dc_dc_phase dc_dc_phase; | ||
88 | enum ad5755_dc_dc_freq dc_dc_freq; | ||
89 | enum ad5755_dc_dc_maxv dc_dc_maxv; | ||
90 | |||
91 | struct { | ||
92 | enum ad5755_mode mode; | ||
93 | bool ext_current_sense_resistor; | ||
94 | bool enable_voltage_overrange; | ||
95 | struct { | ||
96 | bool enable; | ||
97 | enum ad5755_slew_rate rate; | ||
98 | enum ad5755_slew_step_size step_size; | ||
99 | } slew; | ||
100 | } dac[4]; | ||
101 | }; | ||
102 | |||
103 | #endif | ||
diff --git a/include/linux/platform_data/ad7791.h b/include/linux/platform_data/ad7791.h new file mode 100644 index 000000000000..f9e4db1b82ae --- /dev/null +++ b/include/linux/platform_data/ad7791.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef __LINUX_PLATFORM_DATA_AD7791__ | ||
2 | #define __LINUX_PLATFORM_DATA_AD7791__ | ||
3 | |||
4 | /** | ||
5 | * struct ad7791_platform_data - AD7791 device platform data | ||
6 | * @buffered: If set to true configure the device for buffered input mode. | ||
7 | * @burnout_current: If set to true the 100mA burnout current is enabled. | ||
8 | * @unipolar: If set to true sample in unipolar mode, if set to false sample in | ||
9 | * bipolar mode. | ||
10 | */ | ||
11 | struct ad7791_platform_data { | ||
12 | bool buffered; | ||
13 | bool burnout_current; | ||
14 | bool unipolar; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/platform_data/asoc-imx-ssi.h b/include/linux/platform_data/asoc-imx-ssi.h new file mode 100644 index 000000000000..63f3c2804239 --- /dev/null +++ b/include/linux/platform_data/asoc-imx-ssi.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef __MACH_SSI_H | ||
2 | #define __MACH_SSI_H | ||
3 | |||
4 | struct snd_ac97; | ||
5 | |||
6 | extern unsigned char imx_ssi_fiq_start, imx_ssi_fiq_end; | ||
7 | extern unsigned long imx_ssi_fiq_base, imx_ssi_fiq_tx_buffer, imx_ssi_fiq_rx_buffer; | ||
8 | |||
9 | struct imx_ssi_platform_data { | ||
10 | unsigned int flags; | ||
11 | #define IMX_SSI_DMA (1 << 0) | ||
12 | #define IMX_SSI_USE_AC97 (1 << 1) | ||
13 | #define IMX_SSI_NET (1 << 2) | ||
14 | #define IMX_SSI_SYN (1 << 3) | ||
15 | #define IMX_SSI_USE_I2S_SLAVE (1 << 4) | ||
16 | void (*ac97_reset) (struct snd_ac97 *ac97); | ||
17 | void (*ac97_warm_reset)(struct snd_ac97 *ac97); | ||
18 | }; | ||
19 | |||
20 | #endif /* __MACH_SSI_H */ | ||
21 | |||
diff --git a/include/linux/platform_data/asoc-kirkwood.h b/include/linux/platform_data/asoc-kirkwood.h new file mode 100644 index 000000000000..d6a55bd2e578 --- /dev/null +++ b/include/linux/platform_data/asoc-kirkwood.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __PLAT_AUDIO_H | ||
2 | #define __PLAT_AUDIO_H | ||
3 | |||
4 | struct kirkwood_asoc_platform_data { | ||
5 | int burst; | ||
6 | }; | ||
7 | #endif | ||
diff --git a/include/linux/platform_data/asoc-palm27x.h b/include/linux/platform_data/asoc-palm27x.h new file mode 100644 index 000000000000..58afb30d5298 --- /dev/null +++ b/include/linux/platform_data/asoc-palm27x.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _INCLUDE_PALMASOC_H_ | ||
2 | #define _INCLUDE_PALMASOC_H_ | ||
3 | |||
4 | struct palm27x_asoc_info { | ||
5 | int jack_gpio; | ||
6 | }; | ||
7 | |||
8 | #endif | ||
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h new file mode 100644 index 000000000000..aa9875f77c40 --- /dev/null +++ b/include/linux/platform_data/asoc-s3c.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/audio.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co. Ltd | ||
4 | * Author: Jaswinder Singh <jassi.brar@samsung.com> | ||
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 | /* The machine init code calls s3c*_ac97_setup_gpio with | ||
12 | * one of these defines in order to select appropriate bank | ||
13 | * of GPIO for AC97 pins | ||
14 | */ | ||
15 | #define S3C64XX_AC97_GPD 0 | ||
16 | #define S3C64XX_AC97_GPE 1 | ||
17 | extern void s3c64xx_ac97_setup_gpio(int); | ||
18 | |||
19 | /* | ||
20 | * The machine init code calls s5p*_spdif_setup_gpio with | ||
21 | * one of these defines in order to select appropriate bank | ||
22 | * of GPIO for S/PDIF pins | ||
23 | */ | ||
24 | #define S5PC100_SPDIF_GPD 0 | ||
25 | #define S5PC100_SPDIF_GPG3 1 | ||
26 | extern void s5pc100_spdif_setup_gpio(int); | ||
27 | |||
28 | struct samsung_i2s { | ||
29 | /* If the Primary DAI has 5.1 Channels */ | ||
30 | #define QUIRK_PRI_6CHAN (1 << 0) | ||
31 | /* If the I2S block has a Stereo Overlay Channel */ | ||
32 | #define QUIRK_SEC_DAI (1 << 1) | ||
33 | /* | ||
34 | * If the I2S block has no internal prescalar or MUX (I2SMOD[10] bit) | ||
35 | * The Machine driver must provide suitably set clock to the I2S block. | ||
36 | */ | ||
37 | #define QUIRK_NO_MUXPSR (1 << 2) | ||
38 | #define QUIRK_NEED_RSTCLR (1 << 3) | ||
39 | /* Quirks of the I2S controller */ | ||
40 | u32 quirks; | ||
41 | |||
42 | /* | ||
43 | * Array of clock names that can be used to generate I2S signals. | ||
44 | * Also corresponds to clocks of I2SMOD[10] | ||
45 | */ | ||
46 | const char **src_clk; | ||
47 | dma_addr_t idma_addr; | ||
48 | }; | ||
49 | |||
50 | /** | ||
51 | * struct s3c_audio_pdata - common platform data for audio device drivers | ||
52 | * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode | ||
53 | */ | ||
54 | struct s3c_audio_pdata { | ||
55 | int (*cfg_gpio)(struct platform_device *); | ||
56 | union { | ||
57 | struct samsung_i2s i2s; | ||
58 | } type; | ||
59 | }; | ||
diff --git a/include/linux/platform_data/asoc-s3c24xx_simtec.h b/include/linux/platform_data/asoc-s3c24xx_simtec.h new file mode 100644 index 000000000000..376af5286a3e --- /dev/null +++ b/include/linux/platform_data/asoc-s3c24xx_simtec.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/audio-simtec.h | ||
2 | * | ||
3 | * Copyright 2008 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
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 | * Simtec Audio support. | ||
12 | */ | ||
13 | |||
14 | /** | ||
15 | * struct s3c24xx_audio_simtec_pdata - platform data for simtec audio | ||
16 | * @use_mpllin: Select codec clock from MPLLin | ||
17 | * @output_cdclk: Need to output CDCLK to the codec | ||
18 | * @have_mic: Set if we have a MIC socket | ||
19 | * @have_lout: Set if we have a LineOut socket | ||
20 | * @amp_gpio: GPIO pin to enable the AMP | ||
21 | * @amp_gain: Option GPIO to control AMP gain | ||
22 | */ | ||
23 | struct s3c24xx_audio_simtec_pdata { | ||
24 | unsigned int use_mpllin:1; | ||
25 | unsigned int output_cdclk:1; | ||
26 | |||
27 | unsigned int have_mic:1; | ||
28 | unsigned int have_lout:1; | ||
29 | |||
30 | int amp_gpio; | ||
31 | int amp_gain[2]; | ||
32 | |||
33 | void (*startup)(void); | ||
34 | }; | ||
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h new file mode 100644 index 000000000000..18814127809a --- /dev/null +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/mcbsp.h | ||
3 | * | ||
4 | * Defines for Multi-Channel Buffered Serial Port | ||
5 | * | ||
6 | * Copyright (C) 2002 RidgeRun, Inc. | ||
7 | * Author: Steve Johnson | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | ||
25 | #define __ASM_ARCH_OMAP_MCBSP_H | ||
26 | |||
27 | #include <linux/spinlock.h> | ||
28 | #include <linux/clk.h> | ||
29 | |||
30 | #define MCBSP_CONFIG_TYPE2 0x2 | ||
31 | #define MCBSP_CONFIG_TYPE3 0x3 | ||
32 | #define MCBSP_CONFIG_TYPE4 0x4 | ||
33 | |||
34 | /* Platform specific configuration */ | ||
35 | struct omap_mcbsp_ops { | ||
36 | void (*request)(unsigned int); | ||
37 | void (*free)(unsigned int); | ||
38 | }; | ||
39 | |||
40 | struct omap_mcbsp_platform_data { | ||
41 | struct omap_mcbsp_ops *ops; | ||
42 | u16 buffer_size; | ||
43 | u8 reg_size; | ||
44 | u8 reg_step; | ||
45 | |||
46 | /* McBSP platform and instance specific features */ | ||
47 | bool has_wakeup; /* Wakeup capability */ | ||
48 | bool has_ccr; /* Transceiver has configuration control registers */ | ||
49 | int (*enable_st_clock)(unsigned int, bool); | ||
50 | int (*set_clk_src)(struct device *dev, struct clk *clk, const char *src); | ||
51 | int (*mux_signal)(struct device *dev, const char *signal, const char *src); | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod | ||
56 | * @sidetone: name of the sidetone device | ||
57 | */ | ||
58 | struct omap_mcbsp_dev_attr { | ||
59 | const char *sidetone; | ||
60 | }; | ||
61 | |||
62 | #endif | ||
diff --git a/include/linux/platform_data/ata-pxa.h b/include/linux/platform_data/ata-pxa.h new file mode 100644 index 000000000000..6cf7df1d5830 --- /dev/null +++ b/include/linux/platform_data/ata-pxa.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Generic PXA PATA driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | ||
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, or (at your option) | ||
9 | * 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; see the file COPYING. If not, write to | ||
18 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __MACH_PATA_PXA_H__ | ||
22 | #define __MACH_PATA_PXA_H__ | ||
23 | |||
24 | struct pata_pxa_pdata { | ||
25 | /* PXA DMA DREQ<0:2> pin */ | ||
26 | uint32_t dma_dreq; | ||
27 | /* Register shift */ | ||
28 | uint32_t reg_shift; | ||
29 | /* IRQ flags */ | ||
30 | uint32_t irq_flags; | ||
31 | }; | ||
32 | |||
33 | #endif /* __MACH_PATA_PXA_H__ */ | ||
diff --git a/include/linux/platform_data/ata-samsung_cf.h b/include/linux/platform_data/ata-samsung_cf.h new file mode 100644 index 000000000000..2a3855a8372a --- /dev/null +++ b/include/linux/platform_data/ata-samsung_cf.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/ata.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Samsung CF-ATA platform_device info | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_ATA_H | ||
14 | #define __ASM_PLAT_ATA_H __FILE__ | ||
15 | |||
16 | /** | ||
17 | * struct s3c_ide_platdata - S3C IDE driver platform data. | ||
18 | * @setup_gpio: Setup the external GPIO pins to the right state for data | ||
19 | * transfer in true-ide mode. | ||
20 | */ | ||
21 | struct s3c_ide_platdata { | ||
22 | void (*setup_gpio)(void); | ||
23 | }; | ||
24 | |||
25 | /* | ||
26 | * s3c_ide_set_platdata() - Setup the platform specifc data for IDE driver. | ||
27 | * @pdata: Platform data for IDE driver. | ||
28 | */ | ||
29 | extern void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata); | ||
30 | |||
31 | /* architecture-specific IDE configuration */ | ||
32 | extern void s3c64xx_ide_setup_gpio(void); | ||
33 | extern void s5pc100_ide_setup_gpio(void); | ||
34 | extern void s5pv210_ide_setup_gpio(void); | ||
35 | |||
36 | #endif /*__ASM_PLAT_ATA_H */ | ||
diff --git a/include/linux/platform_data/atmel-aes.h b/include/linux/platform_data/atmel-aes.h index e7a1949bad26..ab68082fbcb0 100644 --- a/include/linux/platform_data/atmel-aes.h +++ b/include/linux/platform_data/atmel-aes.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_ATMEL_AES_H | 1 | #ifndef __LINUX_ATMEL_AES_H |
2 | #define __LINUX_ATMEL_AES_H | 2 | #define __LINUX_ATMEL_AES_H |
3 | 3 | ||
4 | #include <mach/at_hdmac.h> | 4 | #include <linux/platform_data/dma-atmel.h> |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * struct aes_dma_data - DMA data for AES | 7 | * struct aes_dma_data - DMA data for AES |
diff --git a/include/linux/platform_data/camera-mx1.h b/include/linux/platform_data/camera-mx1.h new file mode 100644 index 000000000000..4fd6c70314b4 --- /dev/null +++ b/include/linux/platform_data/camera-mx1.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * mx1_camera.h - i.MX1/i.MXL camera driver header file | ||
3 | * | ||
4 | * Copyright (c) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
5 | * Copyright (C) 2009, Darius Augulis <augulis.darius@gmail.com> | ||
6 | * | ||
7 | * Based on PXA camera.h file: | ||
8 | * Copyright (C) 2003, Intel Corporation | ||
9 | * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_CAMERA_H_ | ||
17 | #define __ASM_ARCH_CAMERA_H_ | ||
18 | |||
19 | #define MX1_CAMERA_DATA_HIGH 1 | ||
20 | #define MX1_CAMERA_PCLK_RISING 2 | ||
21 | #define MX1_CAMERA_VSYNC_HIGH 4 | ||
22 | |||
23 | extern unsigned char mx1_camera_sof_fiq_start, mx1_camera_sof_fiq_end; | ||
24 | |||
25 | /** | ||
26 | * struct mx1_camera_pdata - i.MX1/i.MXL camera platform data | ||
27 | * @mclk_10khz: master clock frequency in 10kHz units | ||
28 | * @flags: MX1 camera platform flags | ||
29 | */ | ||
30 | struct mx1_camera_pdata { | ||
31 | unsigned long mclk_10khz; | ||
32 | unsigned long flags; | ||
33 | }; | ||
34 | |||
35 | #endif /* __ASM_ARCH_CAMERA_H_ */ | ||
diff --git a/include/linux/platform_data/camera-mx2.h b/include/linux/platform_data/camera-mx2.h new file mode 100644 index 000000000000..7ded6f1f74bc --- /dev/null +++ b/include/linux/platform_data/camera-mx2.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * mx2-cam.h - i.MX27/i.MX25 camera driver header file | ||
3 | * | ||
4 | * Copyright (C) 2003, Intel Corporation | ||
5 | * Copyright (C) 2008, Sascha Hauer <s.hauer@pengutronix.de> | ||
6 | * Copyright (C) 2010, Baruch Siach <baruch@tkos.co.il> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef __MACH_MX2_CAM_H_ | ||
24 | #define __MACH_MX2_CAM_H_ | ||
25 | |||
26 | #define MX2_CAMERA_EXT_VSYNC (1 << 1) | ||
27 | #define MX2_CAMERA_CCIR (1 << 2) | ||
28 | #define MX2_CAMERA_CCIR_INTERLACE (1 << 3) | ||
29 | #define MX2_CAMERA_HSYNC_HIGH (1 << 4) | ||
30 | #define MX2_CAMERA_GATED_CLOCK (1 << 5) | ||
31 | #define MX2_CAMERA_INV_DATA (1 << 6) | ||
32 | #define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7) | ||
33 | |||
34 | /** | ||
35 | * struct mx2_camera_platform_data - optional platform data for mx2_camera | ||
36 | * @flags: any combination of MX2_CAMERA_* | ||
37 | * @clk: clock rate of the csi block / 2 | ||
38 | */ | ||
39 | struct mx2_camera_platform_data { | ||
40 | unsigned long flags; | ||
41 | unsigned long clk; | ||
42 | }; | ||
43 | |||
44 | #endif /* __MACH_MX2_CAM_H_ */ | ||
diff --git a/include/linux/platform_data/camera-mx3.h b/include/linux/platform_data/camera-mx3.h new file mode 100644 index 000000000000..f226ee3777e1 --- /dev/null +++ b/include/linux/platform_data/camera-mx3.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * mx3_camera.h - i.MX3x camera driver header file | ||
3 | * | ||
4 | * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de> | ||
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 | |||
17 | #ifndef _MX3_CAMERA_H_ | ||
18 | #define _MX3_CAMERA_H_ | ||
19 | |||
20 | #include <linux/device.h> | ||
21 | |||
22 | #define MX3_CAMERA_CLK_SRC 1 | ||
23 | #define MX3_CAMERA_EXT_VSYNC 2 | ||
24 | #define MX3_CAMERA_DP 4 | ||
25 | #define MX3_CAMERA_PCP 8 | ||
26 | #define MX3_CAMERA_HSP 0x10 | ||
27 | #define MX3_CAMERA_VSP 0x20 | ||
28 | #define MX3_CAMERA_DATAWIDTH_4 0x40 | ||
29 | #define MX3_CAMERA_DATAWIDTH_8 0x80 | ||
30 | #define MX3_CAMERA_DATAWIDTH_10 0x100 | ||
31 | #define MX3_CAMERA_DATAWIDTH_15 0x200 | ||
32 | |||
33 | #define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \ | ||
34 | MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15) | ||
35 | |||
36 | /** | ||
37 | * struct mx3_camera_pdata - i.MX3x camera platform data | ||
38 | * @flags: MX3_CAMERA_* flags | ||
39 | * @mclk_10khz: master clock frequency in 10kHz units | ||
40 | * @dma_dev: IPU DMA device to match against in channel allocation | ||
41 | */ | ||
42 | struct mx3_camera_pdata { | ||
43 | unsigned long flags; | ||
44 | unsigned long mclk_10khz; | ||
45 | struct device *dma_dev; | ||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/include/linux/platform_data/camera-pxa.h b/include/linux/platform_data/camera-pxa.h new file mode 100644 index 000000000000..6709b1cd7c77 --- /dev/null +++ b/include/linux/platform_data/camera-pxa.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | camera.h - PXA camera driver header file | ||
3 | |||
4 | Copyright (C) 2003, Intel Corporation | ||
5 | Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de> | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __ASM_ARCH_CAMERA_H_ | ||
23 | #define __ASM_ARCH_CAMERA_H_ | ||
24 | |||
25 | #define PXA_CAMERA_MASTER 1 | ||
26 | #define PXA_CAMERA_DATAWIDTH_4 2 | ||
27 | #define PXA_CAMERA_DATAWIDTH_5 4 | ||
28 | #define PXA_CAMERA_DATAWIDTH_8 8 | ||
29 | #define PXA_CAMERA_DATAWIDTH_9 0x10 | ||
30 | #define PXA_CAMERA_DATAWIDTH_10 0x20 | ||
31 | #define PXA_CAMERA_PCLK_EN 0x40 | ||
32 | #define PXA_CAMERA_MCLK_EN 0x80 | ||
33 | #define PXA_CAMERA_PCP 0x100 | ||
34 | #define PXA_CAMERA_HSP 0x200 | ||
35 | #define PXA_CAMERA_VSP 0x400 | ||
36 | |||
37 | struct pxacamera_platform_data { | ||
38 | unsigned long flags; | ||
39 | unsigned long mclk_10khz; | ||
40 | }; | ||
41 | |||
42 | extern void pxa_set_camera_info(struct pxacamera_platform_data *); | ||
43 | |||
44 | #endif /* __ASM_ARCH_CAMERA_H_ */ | ||
diff --git a/include/linux/platform_data/clk-realview.h b/include/linux/platform_data/clk-realview.h new file mode 100644 index 000000000000..2e426a7dbc51 --- /dev/null +++ b/include/linux/platform_data/clk-realview.h | |||
@@ -0,0 +1 @@ | |||
void realview_clk_init(void __iomem *sysbase, bool is_pb1176); | |||
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h new file mode 100644 index 000000000000..3af0da1f3be5 --- /dev/null +++ b/include/linux/platform_data/clk-ux500.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Clock definitions for ux500 platforms | ||
3 | * | ||
4 | * Copyright (C) 2012 ST-Ericsson SA | ||
5 | * Author: Ulf Hansson <ulf.hansson@linaro.org> | ||
6 | * | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | */ | ||
9 | |||
10 | #ifndef __CLK_UX500_H | ||
11 | #define __CLK_UX500_H | ||
12 | |||
13 | void u8500_clk_init(void); | ||
14 | void u9540_clk_init(void); | ||
15 | void u8540_clk_init(void); | ||
16 | |||
17 | #endif /* __CLK_UX500_H */ | ||
diff --git a/include/linux/platform_data/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h new file mode 100644 index 000000000000..5b2d0817e26a --- /dev/null +++ b/include/linux/platform_data/crypto-ux500.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | #ifndef _CRYPTO_UX500_H | ||
8 | #define _CRYPTO_UX500_H | ||
9 | #include <linux/dmaengine.h> | ||
10 | #include <plat/ste_dma40.h> | ||
11 | |||
12 | struct hash_platform_data { | ||
13 | void *mem_to_engine; | ||
14 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
15 | }; | ||
16 | |||
17 | struct cryp_platform_data { | ||
18 | struct stedma40_chan_cfg mem_to_engine; | ||
19 | struct stedma40_chan_cfg engine_to_mem; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/platform_data/dma-atmel.h b/include/linux/platform_data/dma-atmel.h new file mode 100644 index 000000000000..cab0997be3de --- /dev/null +++ b/include/linux/platform_data/dma-atmel.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Header file for the Atmel AHB DMA Controller driver | ||
3 | * | ||
4 | * Copyright (C) 2008 Atmel 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 | #ifndef AT_HDMAC_H | ||
12 | #define AT_HDMAC_H | ||
13 | |||
14 | #include <linux/dmaengine.h> | ||
15 | |||
16 | /** | ||
17 | * struct at_dma_platform_data - Controller configuration parameters | ||
18 | * @nr_channels: Number of channels supported by hardware (max 8) | ||
19 | * @cap_mask: dma_capability flags supported by the platform | ||
20 | */ | ||
21 | struct at_dma_platform_data { | ||
22 | unsigned int nr_channels; | ||
23 | dma_cap_mask_t cap_mask; | ||
24 | }; | ||
25 | |||
26 | /** | ||
27 | * struct at_dma_slave - Controller-specific information about a slave | ||
28 | * @dma_dev: required DMA master device | ||
29 | * @cfg: Platform-specific initializer for the CFG register | ||
30 | */ | ||
31 | struct at_dma_slave { | ||
32 | struct device *dma_dev; | ||
33 | u32 cfg; | ||
34 | }; | ||
35 | |||
36 | |||
37 | /* Platform-configurable bits in CFG */ | ||
38 | #define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */ | ||
39 | #define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */ | ||
40 | #define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */ | ||
41 | #define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */ | ||
42 | #define ATC_SRC_H2SEL_SW (0x0 << 9) | ||
43 | #define ATC_SRC_H2SEL_HW (0x1 << 9) | ||
44 | #define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */ | ||
45 | #define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */ | ||
46 | #define ATC_DST_H2SEL_SW (0x0 << 13) | ||
47 | #define ATC_DST_H2SEL_HW (0x1 << 13) | ||
48 | #define ATC_SOD (0x1 << 16) /* Stop On Done */ | ||
49 | #define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */ | ||
50 | #define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */ | ||
51 | #define ATC_LOCK_IF_L (0x1 << 22) /* Master Interface Arbiter Lock */ | ||
52 | #define ATC_LOCK_IF_L_CHUNK (0x0 << 22) | ||
53 | #define ATC_LOCK_IF_L_BUFFER (0x1 << 22) | ||
54 | #define ATC_AHB_PROT_MASK (0x7 << 24) /* AHB Protection */ | ||
55 | #define ATC_FIFOCFG_MASK (0x3 << 28) /* FIFO Request Configuration */ | ||
56 | #define ATC_FIFOCFG_LARGESTBURST (0x0 << 28) | ||
57 | #define ATC_FIFOCFG_HALFFIFO (0x1 << 28) | ||
58 | #define ATC_FIFOCFG_ENOUGHSPACE (0x2 << 28) | ||
59 | |||
60 | |||
61 | #endif /* AT_HDMAC_H */ | ||
diff --git a/include/linux/platform_data/dma-ep93xx.h b/include/linux/platform_data/dma-ep93xx.h new file mode 100644 index 000000000000..e82c642fa53c --- /dev/null +++ b/include/linux/platform_data/dma-ep93xx.h | |||
@@ -0,0 +1,93 @@ | |||
1 | #ifndef __ASM_ARCH_DMA_H | ||
2 | #define __ASM_ARCH_DMA_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/dmaengine.h> | ||
6 | #include <linux/dma-mapping.h> | ||
7 | |||
8 | /* | ||
9 | * M2P channels. | ||
10 | * | ||
11 | * Note that these values are also directly used for setting the PPALLOC | ||
12 | * register. | ||
13 | */ | ||
14 | #define EP93XX_DMA_I2S1 0 | ||
15 | #define EP93XX_DMA_I2S2 1 | ||
16 | #define EP93XX_DMA_AAC1 2 | ||
17 | #define EP93XX_DMA_AAC2 3 | ||
18 | #define EP93XX_DMA_AAC3 4 | ||
19 | #define EP93XX_DMA_I2S3 5 | ||
20 | #define EP93XX_DMA_UART1 6 | ||
21 | #define EP93XX_DMA_UART2 7 | ||
22 | #define EP93XX_DMA_UART3 8 | ||
23 | #define EP93XX_DMA_IRDA 9 | ||
24 | /* M2M channels */ | ||
25 | #define EP93XX_DMA_SSP 10 | ||
26 | #define EP93XX_DMA_IDE 11 | ||
27 | |||
28 | /** | ||
29 | * struct ep93xx_dma_data - configuration data for the EP93xx dmaengine | ||
30 | * @port: peripheral which is requesting the channel | ||
31 | * @direction: TX/RX channel | ||
32 | * @name: optional name for the channel, this is displayed in /proc/interrupts | ||
33 | * | ||
34 | * This information is passed as private channel parameter in a filter | ||
35 | * function. Note that this is only needed for slave/cyclic channels. For | ||
36 | * memcpy channels %NULL data should be passed. | ||
37 | */ | ||
38 | struct ep93xx_dma_data { | ||
39 | int port; | ||
40 | enum dma_transfer_direction direction; | ||
41 | const char *name; | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct ep93xx_dma_chan_data - platform specific data for a DMA channel | ||
46 | * @name: name of the channel, used for getting the right clock for the channel | ||
47 | * @base: mapped registers | ||
48 | * @irq: interrupt number used by this channel | ||
49 | */ | ||
50 | struct ep93xx_dma_chan_data { | ||
51 | const char *name; | ||
52 | void __iomem *base; | ||
53 | int irq; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct ep93xx_dma_platform_data - platform data for the dmaengine driver | ||
58 | * @channels: array of channels which are passed to the driver | ||
59 | * @num_channels: number of channels in the array | ||
60 | * | ||
61 | * This structure is passed to the DMA engine driver via platform data. For | ||
62 | * M2P channels, contract is that even channels are for TX and odd for RX. | ||
63 | * There is no requirement for the M2M channels. | ||
64 | */ | ||
65 | struct ep93xx_dma_platform_data { | ||
66 | struct ep93xx_dma_chan_data *channels; | ||
67 | size_t num_channels; | ||
68 | }; | ||
69 | |||
70 | static inline bool ep93xx_dma_chan_is_m2p(struct dma_chan *chan) | ||
71 | { | ||
72 | return !strcmp(dev_name(chan->device->dev), "ep93xx-dma-m2p"); | ||
73 | } | ||
74 | |||
75 | /** | ||
76 | * ep93xx_dma_chan_direction - returns direction the channel can be used | ||
77 | * @chan: channel | ||
78 | * | ||
79 | * This function can be used in filter functions to find out whether the | ||
80 | * channel supports given DMA direction. Only M2P channels have such | ||
81 | * limitation, for M2M channels the direction is configurable. | ||
82 | */ | ||
83 | static inline enum dma_transfer_direction | ||
84 | ep93xx_dma_chan_direction(struct dma_chan *chan) | ||
85 | { | ||
86 | if (!ep93xx_dma_chan_is_m2p(chan)) | ||
87 | return DMA_NONE; | ||
88 | |||
89 | /* even channels are for TX, odd for RX */ | ||
90 | return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; | ||
91 | } | ||
92 | |||
93 | #endif /* __ASM_ARCH_DMA_H */ | ||
diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h new file mode 100644 index 000000000000..3a3942823c20 --- /dev/null +++ b/include/linux/platform_data/dma-imx-sdma.h | |||
@@ -0,0 +1,59 @@ | |||
1 | #ifndef __MACH_MXC_SDMA_H__ | ||
2 | #define __MACH_MXC_SDMA_H__ | ||
3 | |||
4 | /** | ||
5 | * struct sdma_script_start_addrs - SDMA script start pointers | ||
6 | * | ||
7 | * start addresses of the different functions in the physical | ||
8 | * address space of the SDMA engine. | ||
9 | */ | ||
10 | struct sdma_script_start_addrs { | ||
11 | s32 ap_2_ap_addr; | ||
12 | s32 ap_2_bp_addr; | ||
13 | s32 ap_2_ap_fixed_addr; | ||
14 | s32 bp_2_ap_addr; | ||
15 | s32 loopback_on_dsp_side_addr; | ||
16 | s32 mcu_interrupt_only_addr; | ||
17 | s32 firi_2_per_addr; | ||
18 | s32 firi_2_mcu_addr; | ||
19 | s32 per_2_firi_addr; | ||
20 | s32 mcu_2_firi_addr; | ||
21 | s32 uart_2_per_addr; | ||
22 | s32 uart_2_mcu_addr; | ||
23 | s32 per_2_app_addr; | ||
24 | s32 mcu_2_app_addr; | ||
25 | s32 per_2_per_addr; | ||
26 | s32 uartsh_2_per_addr; | ||
27 | s32 uartsh_2_mcu_addr; | ||
28 | s32 per_2_shp_addr; | ||
29 | s32 mcu_2_shp_addr; | ||
30 | s32 ata_2_mcu_addr; | ||
31 | s32 mcu_2_ata_addr; | ||
32 | s32 app_2_per_addr; | ||
33 | s32 app_2_mcu_addr; | ||
34 | s32 shp_2_per_addr; | ||
35 | s32 shp_2_mcu_addr; | ||
36 | s32 mshc_2_mcu_addr; | ||
37 | s32 mcu_2_mshc_addr; | ||
38 | s32 spdif_2_mcu_addr; | ||
39 | s32 mcu_2_spdif_addr; | ||
40 | s32 asrc_2_mcu_addr; | ||
41 | s32 ext_mem_2_ipu_addr; | ||
42 | s32 descrambler_addr; | ||
43 | s32 dptc_dvfs_addr; | ||
44 | s32 utra_addr; | ||
45 | s32 ram_code_start_addr; | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * struct sdma_platform_data - platform specific data for SDMA engine | ||
50 | * | ||
51 | * @fw_name The firmware name | ||
52 | * @script_addrs SDMA scripts addresses in SDMA ROM | ||
53 | */ | ||
54 | struct sdma_platform_data { | ||
55 | char *fw_name; | ||
56 | struct sdma_script_start_addrs *script_addrs; | ||
57 | }; | ||
58 | |||
59 | #endif /* __MACH_MXC_SDMA_H__ */ | ||
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h new file mode 100644 index 000000000000..1b9080385b46 --- /dev/null +++ b/include/linux/platform_data/dma-imx.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2009 Freescale Semiconductor, Inc. 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 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_MXC_DMA_H__ | ||
10 | #define __ASM_ARCH_MXC_DMA_H__ | ||
11 | |||
12 | #include <linux/scatterlist.h> | ||
13 | #include <linux/device.h> | ||
14 | #include <linux/dmaengine.h> | ||
15 | |||
16 | /* | ||
17 | * This enumerates peripheral types. Used for SDMA. | ||
18 | */ | ||
19 | enum sdma_peripheral_type { | ||
20 | IMX_DMATYPE_SSI, /* MCU domain SSI */ | ||
21 | IMX_DMATYPE_SSI_SP, /* Shared SSI */ | ||
22 | IMX_DMATYPE_MMC, /* MMC */ | ||
23 | IMX_DMATYPE_SDHC, /* SDHC */ | ||
24 | IMX_DMATYPE_UART, /* MCU domain UART */ | ||
25 | IMX_DMATYPE_UART_SP, /* Shared UART */ | ||
26 | IMX_DMATYPE_FIRI, /* FIRI */ | ||
27 | IMX_DMATYPE_CSPI, /* MCU domain CSPI */ | ||
28 | IMX_DMATYPE_CSPI_SP, /* Shared CSPI */ | ||
29 | IMX_DMATYPE_SIM, /* SIM */ | ||
30 | IMX_DMATYPE_ATA, /* ATA */ | ||
31 | IMX_DMATYPE_CCM, /* CCM */ | ||
32 | IMX_DMATYPE_EXT, /* External peripheral */ | ||
33 | IMX_DMATYPE_MSHC, /* Memory Stick Host Controller */ | ||
34 | IMX_DMATYPE_MSHC_SP, /* Shared Memory Stick Host Controller */ | ||
35 | IMX_DMATYPE_DSP, /* DSP */ | ||
36 | IMX_DMATYPE_MEMORY, /* Memory */ | ||
37 | IMX_DMATYPE_FIFO_MEMORY,/* FIFO type Memory */ | ||
38 | IMX_DMATYPE_SPDIF, /* SPDIF */ | ||
39 | IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */ | ||
40 | IMX_DMATYPE_ASRC, /* ASRC */ | ||
41 | IMX_DMATYPE_ESAI, /* ESAI */ | ||
42 | }; | ||
43 | |||
44 | enum imx_dma_prio { | ||
45 | DMA_PRIO_HIGH = 0, | ||
46 | DMA_PRIO_MEDIUM = 1, | ||
47 | DMA_PRIO_LOW = 2 | ||
48 | }; | ||
49 | |||
50 | struct imx_dma_data { | ||
51 | int dma_request; /* DMA request line */ | ||
52 | enum sdma_peripheral_type peripheral_type; | ||
53 | int priority; | ||
54 | }; | ||
55 | |||
56 | static inline int imx_dma_is_ipu(struct dma_chan *chan) | ||
57 | { | ||
58 | return !strcmp(dev_name(chan->device->dev), "ipu-core"); | ||
59 | } | ||
60 | |||
61 | static inline int imx_dma_is_general_purpose(struct dma_chan *chan) | ||
62 | { | ||
63 | return strstr(dev_name(chan->device->dev), "sdma") || | ||
64 | !strcmp(dev_name(chan->device->dev), "imx-dma"); | ||
65 | } | ||
66 | |||
67 | #endif | ||
diff --git a/include/linux/platform_data/dma-mmp_tdma.h b/include/linux/platform_data/dma-mmp_tdma.h new file mode 100644 index 000000000000..239e0fc1bb1f --- /dev/null +++ b/include/linux/platform_data/dma-mmp_tdma.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/include/mach/sram.h | ||
3 | * | ||
4 | * SRAM Memory Management | ||
5 | * | ||
6 | * Copyright (c) 2011 Marvell Semiconductors Inc. | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_SRAM_H | ||
15 | #define __ASM_ARCH_SRAM_H | ||
16 | |||
17 | #include <linux/genalloc.h> | ||
18 | |||
19 | /* ARBITRARY: SRAM allocations are multiples of this 2^N size */ | ||
20 | #define SRAM_GRANULARITY 512 | ||
21 | |||
22 | enum sram_type { | ||
23 | MMP_SRAM_UNDEFINED = 0, | ||
24 | MMP_ASRAM, | ||
25 | MMP_ISRAM, | ||
26 | }; | ||
27 | |||
28 | struct sram_platdata { | ||
29 | char *pool_name; | ||
30 | int granularity; | ||
31 | }; | ||
32 | |||
33 | extern struct gen_pool *sram_get_gpool(char *pool_name); | ||
34 | |||
35 | #endif /* __ASM_ARCH_SRAM_H */ | ||
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h new file mode 100644 index 000000000000..2ba1f7d76eef --- /dev/null +++ b/include/linux/platform_data/dma-mv_xor.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/mv_xor.h | ||
3 | * | ||
4 | * Marvell XOR platform device data definition file. | ||
5 | */ | ||
6 | |||
7 | #ifndef __PLAT_MV_XOR_H | ||
8 | #define __PLAT_MV_XOR_H | ||
9 | |||
10 | #include <linux/dmaengine.h> | ||
11 | #include <linux/mbus.h> | ||
12 | |||
13 | #define MV_XOR_SHARED_NAME "mv_xor_shared" | ||
14 | #define MV_XOR_NAME "mv_xor" | ||
15 | |||
16 | struct mv_xor_platform_data { | ||
17 | struct platform_device *shared; | ||
18 | int hw_id; | ||
19 | dma_cap_mask_t cap_mask; | ||
20 | size_t pool_size; | ||
21 | }; | ||
22 | |||
23 | |||
24 | #endif | ||
diff --git a/include/linux/platform_data/dsp-omap.h b/include/linux/platform_data/dsp-omap.h new file mode 100644 index 000000000000..5927709b1908 --- /dev/null +++ b/include/linux/platform_data/dsp-omap.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef __OMAP_DSP_H__ | ||
2 | #define __OMAP_DSP_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct omap_dsp_platform_data { | ||
7 | void (*dsp_set_min_opp) (u8 opp_id); | ||
8 | u8 (*dsp_get_opp) (void); | ||
9 | void (*cpu_set_freq) (unsigned long f); | ||
10 | unsigned long (*cpu_get_freq) (void); | ||
11 | unsigned long mpu_speed[6]; | ||
12 | |||
13 | /* functions to write and read PRCM registers */ | ||
14 | void (*dsp_prm_write)(u32, s16 , u16); | ||
15 | u32 (*dsp_prm_read)(s16 , u16); | ||
16 | u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16); | ||
17 | void (*dsp_cm_write)(u32, s16 , u16); | ||
18 | u32 (*dsp_cm_read)(s16 , u16); | ||
19 | u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16); | ||
20 | |||
21 | void (*set_bootaddr)(u32); | ||
22 | void (*set_bootmode)(u8); | ||
23 | |||
24 | phys_addr_t phys_mempool_base; | ||
25 | phys_addr_t phys_mempool_size; | ||
26 | }; | ||
27 | |||
28 | #if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) | ||
29 | extern void omap_dsp_reserve_sdram_memblock(void); | ||
30 | #else | ||
31 | static inline void omap_dsp_reserve_sdram_memblock(void) { } | ||
32 | #endif | ||
33 | |||
34 | #endif | ||
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h new file mode 100644 index 000000000000..88af1ac28ead --- /dev/null +++ b/include/linux/platform_data/eth-netx.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-netx/include/mach/eth.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
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 | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef ASMARM_ARCH_ETH_H | ||
21 | #define ASMARM_ARCH_ETH_H | ||
22 | |||
23 | struct netxeth_platform_data { | ||
24 | unsigned int xcno; /* number of xmac/xpec engine this eth uses */ | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h new file mode 100644 index 000000000000..e8741c2678d5 --- /dev/null +++ b/include/linux/platform_data/gpio-omap.h | |||
@@ -0,0 +1,217 @@ | |||
1 | /* | ||
2 | * OMAP GPIO handling defines and functions | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 Nokia Corporation | ||
5 | * | ||
6 | * Written by Juha Yrjölä <juha.yrjola@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __ASM_ARCH_OMAP_GPIO_H | ||
25 | #define __ASM_ARCH_OMAP_GPIO_H | ||
26 | |||
27 | #include <linux/io.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | #include <mach/irqs.h> | ||
30 | |||
31 | #define OMAP1_MPUIO_BASE 0xfffb5000 | ||
32 | |||
33 | /* | ||
34 | * These are the omap15xx/16xx offsets. The omap7xx offset are | ||
35 | * OMAP_MPUIO_ / 2 offsets below. | ||
36 | */ | ||
37 | #define OMAP_MPUIO_INPUT_LATCH 0x00 | ||
38 | #define OMAP_MPUIO_OUTPUT 0x04 | ||
39 | #define OMAP_MPUIO_IO_CNTL 0x08 | ||
40 | #define OMAP_MPUIO_KBR_LATCH 0x10 | ||
41 | #define OMAP_MPUIO_KBC 0x14 | ||
42 | #define OMAP_MPUIO_GPIO_EVENT_MODE 0x18 | ||
43 | #define OMAP_MPUIO_GPIO_INT_EDGE 0x1c | ||
44 | #define OMAP_MPUIO_KBD_INT 0x20 | ||
45 | #define OMAP_MPUIO_GPIO_INT 0x24 | ||
46 | #define OMAP_MPUIO_KBD_MASKIT 0x28 | ||
47 | #define OMAP_MPUIO_GPIO_MASKIT 0x2c | ||
48 | #define OMAP_MPUIO_GPIO_DEBOUNCING 0x30 | ||
49 | #define OMAP_MPUIO_LATCH 0x34 | ||
50 | |||
51 | #define OMAP34XX_NR_GPIOS 6 | ||
52 | |||
53 | /* | ||
54 | * OMAP1510 GPIO registers | ||
55 | */ | ||
56 | #define OMAP1510_GPIO_DATA_INPUT 0x00 | ||
57 | #define OMAP1510_GPIO_DATA_OUTPUT 0x04 | ||
58 | #define OMAP1510_GPIO_DIR_CONTROL 0x08 | ||
59 | #define OMAP1510_GPIO_INT_CONTROL 0x0c | ||
60 | #define OMAP1510_GPIO_INT_MASK 0x10 | ||
61 | #define OMAP1510_GPIO_INT_STATUS 0x14 | ||
62 | #define OMAP1510_GPIO_PIN_CONTROL 0x18 | ||
63 | |||
64 | #define OMAP1510_IH_GPIO_BASE 64 | ||
65 | |||
66 | /* | ||
67 | * OMAP1610 specific GPIO registers | ||
68 | */ | ||
69 | #define OMAP1610_GPIO_REVISION 0x0000 | ||
70 | #define OMAP1610_GPIO_SYSCONFIG 0x0010 | ||
71 | #define OMAP1610_GPIO_SYSSTATUS 0x0014 | ||
72 | #define OMAP1610_GPIO_IRQSTATUS1 0x0018 | ||
73 | #define OMAP1610_GPIO_IRQENABLE1 0x001c | ||
74 | #define OMAP1610_GPIO_WAKEUPENABLE 0x0028 | ||
75 | #define OMAP1610_GPIO_DATAIN 0x002c | ||
76 | #define OMAP1610_GPIO_DATAOUT 0x0030 | ||
77 | #define OMAP1610_GPIO_DIRECTION 0x0034 | ||
78 | #define OMAP1610_GPIO_EDGE_CTRL1 0x0038 | ||
79 | #define OMAP1610_GPIO_EDGE_CTRL2 0x003c | ||
80 | #define OMAP1610_GPIO_CLEAR_IRQENABLE1 0x009c | ||
81 | #define OMAP1610_GPIO_CLEAR_WAKEUPENA 0x00a8 | ||
82 | #define OMAP1610_GPIO_CLEAR_DATAOUT 0x00b0 | ||
83 | #define OMAP1610_GPIO_SET_IRQENABLE1 0x00dc | ||
84 | #define OMAP1610_GPIO_SET_WAKEUPENA 0x00e8 | ||
85 | #define OMAP1610_GPIO_SET_DATAOUT 0x00f0 | ||
86 | |||
87 | /* | ||
88 | * OMAP7XX specific GPIO registers | ||
89 | */ | ||
90 | #define OMAP7XX_GPIO_DATA_INPUT 0x00 | ||
91 | #define OMAP7XX_GPIO_DATA_OUTPUT 0x04 | ||
92 | #define OMAP7XX_GPIO_DIR_CONTROL 0x08 | ||
93 | #define OMAP7XX_GPIO_INT_CONTROL 0x0c | ||
94 | #define OMAP7XX_GPIO_INT_MASK 0x10 | ||
95 | #define OMAP7XX_GPIO_INT_STATUS 0x14 | ||
96 | |||
97 | /* | ||
98 | * omap2+ specific GPIO registers | ||
99 | */ | ||
100 | #define OMAP24XX_GPIO_REVISION 0x0000 | ||
101 | #define OMAP24XX_GPIO_IRQSTATUS1 0x0018 | ||
102 | #define OMAP24XX_GPIO_IRQSTATUS2 0x0028 | ||
103 | #define OMAP24XX_GPIO_IRQENABLE2 0x002c | ||
104 | #define OMAP24XX_GPIO_IRQENABLE1 0x001c | ||
105 | #define OMAP24XX_GPIO_WAKE_EN 0x0020 | ||
106 | #define OMAP24XX_GPIO_CTRL 0x0030 | ||
107 | #define OMAP24XX_GPIO_OE 0x0034 | ||
108 | #define OMAP24XX_GPIO_DATAIN 0x0038 | ||
109 | #define OMAP24XX_GPIO_DATAOUT 0x003c | ||
110 | #define OMAP24XX_GPIO_LEVELDETECT0 0x0040 | ||
111 | #define OMAP24XX_GPIO_LEVELDETECT1 0x0044 | ||
112 | #define OMAP24XX_GPIO_RISINGDETECT 0x0048 | ||
113 | #define OMAP24XX_GPIO_FALLINGDETECT 0x004c | ||
114 | #define OMAP24XX_GPIO_DEBOUNCE_EN 0x0050 | ||
115 | #define OMAP24XX_GPIO_DEBOUNCE_VAL 0x0054 | ||
116 | #define OMAP24XX_GPIO_CLEARIRQENABLE1 0x0060 | ||
117 | #define OMAP24XX_GPIO_SETIRQENABLE1 0x0064 | ||
118 | #define OMAP24XX_GPIO_CLEARWKUENA 0x0080 | ||
119 | #define OMAP24XX_GPIO_SETWKUENA 0x0084 | ||
120 | #define OMAP24XX_GPIO_CLEARDATAOUT 0x0090 | ||
121 | #define OMAP24XX_GPIO_SETDATAOUT 0x0094 | ||
122 | |||
123 | #define OMAP4_GPIO_REVISION 0x0000 | ||
124 | #define OMAP4_GPIO_EOI 0x0020 | ||
125 | #define OMAP4_GPIO_IRQSTATUSRAW0 0x0024 | ||
126 | #define OMAP4_GPIO_IRQSTATUSRAW1 0x0028 | ||
127 | #define OMAP4_GPIO_IRQSTATUS0 0x002c | ||
128 | #define OMAP4_GPIO_IRQSTATUS1 0x0030 | ||
129 | #define OMAP4_GPIO_IRQSTATUSSET0 0x0034 | ||
130 | #define OMAP4_GPIO_IRQSTATUSSET1 0x0038 | ||
131 | #define OMAP4_GPIO_IRQSTATUSCLR0 0x003c | ||
132 | #define OMAP4_GPIO_IRQSTATUSCLR1 0x0040 | ||
133 | #define OMAP4_GPIO_IRQWAKEN0 0x0044 | ||
134 | #define OMAP4_GPIO_IRQWAKEN1 0x0048 | ||
135 | #define OMAP4_GPIO_IRQENABLE1 0x011c | ||
136 | #define OMAP4_GPIO_WAKE_EN 0x0120 | ||
137 | #define OMAP4_GPIO_IRQSTATUS2 0x0128 | ||
138 | #define OMAP4_GPIO_IRQENABLE2 0x012c | ||
139 | #define OMAP4_GPIO_CTRL 0x0130 | ||
140 | #define OMAP4_GPIO_OE 0x0134 | ||
141 | #define OMAP4_GPIO_DATAIN 0x0138 | ||
142 | #define OMAP4_GPIO_DATAOUT 0x013c | ||
143 | #define OMAP4_GPIO_LEVELDETECT0 0x0140 | ||
144 | #define OMAP4_GPIO_LEVELDETECT1 0x0144 | ||
145 | #define OMAP4_GPIO_RISINGDETECT 0x0148 | ||
146 | #define OMAP4_GPIO_FALLINGDETECT 0x014c | ||
147 | #define OMAP4_GPIO_DEBOUNCENABLE 0x0150 | ||
148 | #define OMAP4_GPIO_DEBOUNCINGTIME 0x0154 | ||
149 | #define OMAP4_GPIO_CLEARIRQENABLE1 0x0160 | ||
150 | #define OMAP4_GPIO_SETIRQENABLE1 0x0164 | ||
151 | #define OMAP4_GPIO_CLEARWKUENA 0x0180 | ||
152 | #define OMAP4_GPIO_SETWKUENA 0x0184 | ||
153 | #define OMAP4_GPIO_CLEARDATAOUT 0x0190 | ||
154 | #define OMAP4_GPIO_SETDATAOUT 0x0194 | ||
155 | |||
156 | #define OMAP_MAX_GPIO_LINES 192 | ||
157 | |||
158 | #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) | ||
159 | #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) | ||
160 | |||
161 | struct omap_gpio_dev_attr { | ||
162 | int bank_width; /* GPIO bank width */ | ||
163 | bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ | ||
164 | }; | ||
165 | |||
166 | struct omap_gpio_reg_offs { | ||
167 | u16 revision; | ||
168 | u16 direction; | ||
169 | u16 datain; | ||
170 | u16 dataout; | ||
171 | u16 set_dataout; | ||
172 | u16 clr_dataout; | ||
173 | u16 irqstatus; | ||
174 | u16 irqstatus2; | ||
175 | u16 irqstatus_raw0; | ||
176 | u16 irqstatus_raw1; | ||
177 | u16 irqenable; | ||
178 | u16 irqenable2; | ||
179 | u16 set_irqenable; | ||
180 | u16 clr_irqenable; | ||
181 | u16 debounce; | ||
182 | u16 debounce_en; | ||
183 | u16 ctrl; | ||
184 | u16 wkup_en; | ||
185 | u16 leveldetect0; | ||
186 | u16 leveldetect1; | ||
187 | u16 risingdetect; | ||
188 | u16 fallingdetect; | ||
189 | u16 irqctrl; | ||
190 | u16 edgectrl1; | ||
191 | u16 edgectrl2; | ||
192 | u16 pinctrl; | ||
193 | |||
194 | bool irqenable_inv; | ||
195 | }; | ||
196 | |||
197 | struct omap_gpio_platform_data { | ||
198 | int bank_type; | ||
199 | int bank_width; /* GPIO bank width */ | ||
200 | int bank_stride; /* Only needed for omap1 MPUIO */ | ||
201 | bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ | ||
202 | bool loses_context; /* whether the bank would ever lose context */ | ||
203 | bool is_mpuio; /* whether the bank is of type MPUIO */ | ||
204 | u32 non_wakeup_gpios; | ||
205 | |||
206 | struct omap_gpio_reg_offs *regs; | ||
207 | |||
208 | /* Return context loss count due to PM states changing */ | ||
209 | int (*get_context_loss_count)(struct device *dev); | ||
210 | }; | ||
211 | |||
212 | extern void omap2_gpio_prepare_for_idle(int off_mode); | ||
213 | extern void omap2_gpio_resume_after_idle(void); | ||
214 | extern void omap_set_gpio_debounce(int gpio, int enable); | ||
215 | extern void omap_set_gpio_debounce_time(int gpio, int enable); | ||
216 | |||
217 | #endif | ||
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h new file mode 100644 index 000000000000..c167e4429bc7 --- /dev/null +++ b/include/linux/platform_data/hwmon-s3c.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* linux/arch/arm/plat-s3c/include/plat/hwmon.h | ||
2 | * | ||
3 | * Copyright 2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * S3C - HWMon interface for ADC | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_ADC_HWMON_H | ||
15 | #define __ASM_ARCH_ADC_HWMON_H __FILE__ | ||
16 | |||
17 | /** | ||
18 | * s3c_hwmon_chcfg - channel configuration | ||
19 | * @name: The name to give this channel. | ||
20 | * @mult: Multiply the ADC value read by this. | ||
21 | * @div: Divide the value from the ADC by this. | ||
22 | * | ||
23 | * The value read from the ADC is converted to a value that | ||
24 | * hwmon expects (mV) by result = (value_read * @mult) / @div. | ||
25 | */ | ||
26 | struct s3c_hwmon_chcfg { | ||
27 | const char *name; | ||
28 | unsigned int mult; | ||
29 | unsigned int div; | ||
30 | }; | ||
31 | |||
32 | /** | ||
33 | * s3c_hwmon_pdata - HWMON platform data | ||
34 | * @in: One configuration for each possible channel used. | ||
35 | */ | ||
36 | struct s3c_hwmon_pdata { | ||
37 | struct s3c_hwmon_chcfg *in[8]; | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device | ||
42 | * @pd: Platform data to register to device. | ||
43 | * | ||
44 | * Register the given platform data for use with the S3C HWMON device. | ||
45 | * The call will copy the platform data, so the board definitions can | ||
46 | * make the structure itself __initdata. | ||
47 | */ | ||
48 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); | ||
49 | |||
50 | #endif /* __ASM_ARCH_ADC_HWMON_H */ | ||
51 | |||
diff --git a/include/linux/platform_data/i2c-davinci.h b/include/linux/platform_data/i2c-davinci.h new file mode 100644 index 000000000000..2312d197dfb7 --- /dev/null +++ b/include/linux/platform_data/i2c-davinci.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * DaVinci I2C controller platform_device info | ||
3 | * | ||
4 | * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com> | ||
5 | * | ||
6 | * 2007 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_ARCH_I2C_H | ||
13 | #define __ASM_ARCH_I2C_H | ||
14 | |||
15 | /* All frequencies are expressed in kHz */ | ||
16 | struct davinci_i2c_platform_data { | ||
17 | unsigned int bus_freq; /* standard bus frequency (kHz) */ | ||
18 | unsigned int bus_delay; /* post-transaction delay (usec) */ | ||
19 | unsigned int sda_pin; /* GPIO pin ID to use for SDA */ | ||
20 | unsigned int scl_pin; /* GPIO pin ID to use for SCL */ | ||
21 | }; | ||
22 | |||
23 | /* for board setup code */ | ||
24 | void davinci_init_i2c(struct davinci_i2c_platform_data *); | ||
25 | |||
26 | #endif /* __ASM_ARCH_I2C_H */ | ||
diff --git a/include/linux/platform_data/i2c-imx.h b/include/linux/platform_data/i2c-imx.h new file mode 100644 index 000000000000..8289d915e615 --- /dev/null +++ b/include/linux/platform_data/i2c-imx.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * i2c.h - i.MX I2C driver header file | ||
3 | * | ||
4 | * Copyright (c) 2008, Darius Augulis <augulis.darius@gmail.com> | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_I2C_H_ | ||
10 | #define __ASM_ARCH_I2C_H_ | ||
11 | |||
12 | /** | ||
13 | * struct imxi2c_platform_data - structure of platform data for MXC I2C driver | ||
14 | * @bitrate: Bus speed measured in Hz | ||
15 | * | ||
16 | **/ | ||
17 | struct imxi2c_platform_data { | ||
18 | u32 bitrate; | ||
19 | }; | ||
20 | |||
21 | #endif /* __ASM_ARCH_I2C_H_ */ | ||
diff --git a/include/linux/platform_data/i2c-nuc900.h b/include/linux/platform_data/i2c-nuc900.h new file mode 100644 index 000000000000..9ffb12d06e91 --- /dev/null +++ b/include/linux/platform_data/i2c-nuc900.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef __ASM_ARCH_NUC900_I2C_H | ||
2 | #define __ASM_ARCH_NUC900_I2C_H | ||
3 | |||
4 | struct nuc900_platform_i2c { | ||
5 | int bus_num; | ||
6 | unsigned long bus_freq; | ||
7 | }; | ||
8 | |||
9 | #endif /* __ASM_ARCH_NUC900_I2C_H */ | ||
diff --git a/include/linux/platform_data/i2c-s3c2410.h b/include/linux/platform_data/i2c-s3c2410.h new file mode 100644 index 000000000000..51d52e767a19 --- /dev/null +++ b/include/linux/platform_data/i2c-s3c2410.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/iic.h | ||
2 | * | ||
3 | * Copyright 2004-2009 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C - I2C Controller platform_device info | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_IIC_H | ||
14 | #define __ASM_ARCH_IIC_H __FILE__ | ||
15 | |||
16 | #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */ | ||
17 | |||
18 | /** | ||
19 | * struct s3c2410_platform_i2c - Platform data for s3c I2C. | ||
20 | * @bus_num: The bus number to use (if possible). | ||
21 | * @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER). | ||
22 | * @slave_addr: The I2C address for the slave device (if enabled). | ||
23 | * @frequency: The desired frequency in Hz of the bus. This is | ||
24 | * guaranteed to not be exceeded. If the caller does | ||
25 | * not care, use zero and the driver will select a | ||
26 | * useful default. | ||
27 | * @sda_delay: The delay (in ns) applied to SDA edges. | ||
28 | * @cfg_gpio: A callback to configure the pins for I2C operation. | ||
29 | */ | ||
30 | struct s3c2410_platform_i2c { | ||
31 | int bus_num; | ||
32 | unsigned int flags; | ||
33 | unsigned int slave_addr; | ||
34 | unsigned long frequency; | ||
35 | unsigned int sda_delay; | ||
36 | |||
37 | void (*cfg_gpio)(struct platform_device *dev); | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * s3c_i2c0_set_platdata - set platform data for i2c0 device | ||
42 | * @i2c: The platform data to set, or NULL for default data. | ||
43 | * | ||
44 | * Register the given platform data for use with the i2c0 device. This | ||
45 | * call copies the platform data, so the caller can use __initdata for | ||
46 | * their copy. | ||
47 | * | ||
48 | * This call will set cfg_gpio if is null to the default platform | ||
49 | * implementation. | ||
50 | * | ||
51 | * Any user of s3c_device_i2c0 should call this, even if it is with | ||
52 | * NULL to ensure that the device is given the default platform data | ||
53 | * as the driver will no longer carry defaults. | ||
54 | */ | ||
55 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
56 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
57 | extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
58 | extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
59 | extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
60 | extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
61 | extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
62 | extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
63 | extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c); | ||
64 | |||
65 | /* defined by architecture to configure gpio */ | ||
66 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); | ||
67 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); | ||
68 | extern void s3c_i2c2_cfg_gpio(struct platform_device *dev); | ||
69 | extern void s3c_i2c3_cfg_gpio(struct platform_device *dev); | ||
70 | extern void s3c_i2c4_cfg_gpio(struct platform_device *dev); | ||
71 | extern void s3c_i2c5_cfg_gpio(struct platform_device *dev); | ||
72 | extern void s3c_i2c6_cfg_gpio(struct platform_device *dev); | ||
73 | extern void s3c_i2c7_cfg_gpio(struct platform_device *dev); | ||
74 | |||
75 | extern struct s3c2410_platform_i2c default_i2c_data; | ||
76 | |||
77 | #endif /* __ASM_ARCH_IIC_H */ | ||
diff --git a/include/linux/platform_data/irda-pxaficp.h b/include/linux/platform_data/irda-pxaficp.h new file mode 100644 index 000000000000..3cd41f77dda4 --- /dev/null +++ b/include/linux/platform_data/irda-pxaficp.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef ASMARM_ARCH_IRDA_H | ||
2 | #define ASMARM_ARCH_IRDA_H | ||
3 | |||
4 | /* board specific transceiver capabilities */ | ||
5 | |||
6 | #define IR_OFF 1 | ||
7 | #define IR_SIRMODE 2 | ||
8 | #define IR_FIRMODE 4 | ||
9 | |||
10 | struct pxaficp_platform_data { | ||
11 | int transceiver_cap; | ||
12 | void (*transceiver_mode)(struct device *dev, int mode); | ||
13 | int (*startup)(struct device *dev); | ||
14 | void (*shutdown)(struct device *dev); | ||
15 | int gpio_pwdown; /* powerdown GPIO for the IrDA chip */ | ||
16 | bool gpio_pwdown_inverted; /* gpio_pwdown is inverted */ | ||
17 | }; | ||
18 | |||
19 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); | ||
20 | |||
21 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
22 | void pxa2xx_transceiver_mode(struct device *dev, int mode); | ||
23 | #endif | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/platform_data/keyboard-pxa930_rotary.h b/include/linux/platform_data/keyboard-pxa930_rotary.h new file mode 100644 index 000000000000..053587caffdd --- /dev/null +++ b/include/linux/platform_data/keyboard-pxa930_rotary.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __ASM_ARCH_PXA930_ROTARY_H | ||
2 | #define __ASM_ARCH_PXA930_ROTARY_H | ||
3 | |||
4 | /* NOTE: | ||
5 | * | ||
6 | * rotary can be either interpreted as a ralative input event (e.g. | ||
7 | * REL_WHEEL or REL_HWHEEL) or a specific key event (e.g. UP/DOWN | ||
8 | * or LEFT/RIGHT), depending on if up_key & down_key are assigned | ||
9 | * or rel_code is assigned a non-zero value. When all are non-zero, | ||
10 | * up_key and down_key will be preferred. | ||
11 | */ | ||
12 | struct pxa930_rotary_platform_data { | ||
13 | int up_key; | ||
14 | int down_key; | ||
15 | int rel_code; | ||
16 | }; | ||
17 | |||
18 | void __init pxa930_set_rotarykey_info(struct pxa930_rotary_platform_data *info); | ||
19 | |||
20 | #endif /* __ASM_ARCH_PXA930_ROTARY_H */ | ||
diff --git a/include/linux/platform_data/keyboard-spear.h b/include/linux/platform_data/keyboard-spear.h new file mode 100644 index 000000000000..9248e3a7e333 --- /dev/null +++ b/include/linux/platform_data/keyboard-spear.h | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 ST Microelectronics | ||
3 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
4 | * | ||
5 | * This file is licensed under the terms of the GNU General Public | ||
6 | * License version 2. This program is licensed "as is" without any | ||
7 | * warranty of any kind, whether express or implied. | ||
8 | */ | ||
9 | |||
10 | #ifndef __PLAT_KEYBOARD_H | ||
11 | #define __PLAT_KEYBOARD_H | ||
12 | |||
13 | #include <linux/bitops.h> | ||
14 | #include <linux/input.h> | ||
15 | #include <linux/input/matrix_keypad.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | #define DECLARE_9x9_KEYMAP(_name) \ | ||
19 | int _name[] = { \ | ||
20 | KEY(0, 0, KEY_ESC), \ | ||
21 | KEY(0, 1, KEY_1), \ | ||
22 | KEY(0, 2, KEY_2), \ | ||
23 | KEY(0, 3, KEY_3), \ | ||
24 | KEY(0, 4, KEY_4), \ | ||
25 | KEY(0, 5, KEY_5), \ | ||
26 | KEY(0, 6, KEY_6), \ | ||
27 | KEY(0, 7, KEY_7), \ | ||
28 | KEY(0, 8, KEY_8), \ | ||
29 | KEY(1, 0, KEY_9), \ | ||
30 | KEY(1, 1, KEY_MINUS), \ | ||
31 | KEY(1, 2, KEY_EQUAL), \ | ||
32 | KEY(1, 3, KEY_BACKSPACE), \ | ||
33 | KEY(1, 4, KEY_TAB), \ | ||
34 | KEY(1, 5, KEY_Q), \ | ||
35 | KEY(1, 6, KEY_W), \ | ||
36 | KEY(1, 7, KEY_E), \ | ||
37 | KEY(1, 8, KEY_R), \ | ||
38 | KEY(2, 0, KEY_T), \ | ||
39 | KEY(2, 1, KEY_Y), \ | ||
40 | KEY(2, 2, KEY_U), \ | ||
41 | KEY(2, 3, KEY_I), \ | ||
42 | KEY(2, 4, KEY_O), \ | ||
43 | KEY(2, 5, KEY_P), \ | ||
44 | KEY(2, 6, KEY_LEFTBRACE), \ | ||
45 | KEY(2, 7, KEY_RIGHTBRACE), \ | ||
46 | KEY(2, 8, KEY_ENTER), \ | ||
47 | KEY(3, 0, KEY_LEFTCTRL), \ | ||
48 | KEY(3, 1, KEY_A), \ | ||
49 | KEY(3, 2, KEY_S), \ | ||
50 | KEY(3, 3, KEY_D), \ | ||
51 | KEY(3, 4, KEY_F), \ | ||
52 | KEY(3, 5, KEY_G), \ | ||
53 | KEY(3, 6, KEY_H), \ | ||
54 | KEY(3, 7, KEY_J), \ | ||
55 | KEY(3, 8, KEY_K), \ | ||
56 | KEY(4, 0, KEY_L), \ | ||
57 | KEY(4, 1, KEY_SEMICOLON), \ | ||
58 | KEY(4, 2, KEY_APOSTROPHE), \ | ||
59 | KEY(4, 3, KEY_GRAVE), \ | ||
60 | KEY(4, 4, KEY_LEFTSHIFT), \ | ||
61 | KEY(4, 5, KEY_BACKSLASH), \ | ||
62 | KEY(4, 6, KEY_Z), \ | ||
63 | KEY(4, 7, KEY_X), \ | ||
64 | KEY(4, 8, KEY_C), \ | ||
65 | KEY(5, 0, KEY_V), \ | ||
66 | KEY(5, 1, KEY_B), \ | ||
67 | KEY(5, 2, KEY_N), \ | ||
68 | KEY(5, 3, KEY_M), \ | ||
69 | KEY(5, 4, KEY_COMMA), \ | ||
70 | KEY(5, 5, KEY_DOT), \ | ||
71 | KEY(5, 6, KEY_SLASH), \ | ||
72 | KEY(5, 7, KEY_RIGHTSHIFT), \ | ||
73 | KEY(5, 8, KEY_KPASTERISK), \ | ||
74 | KEY(6, 0, KEY_LEFTALT), \ | ||
75 | KEY(6, 1, KEY_SPACE), \ | ||
76 | KEY(6, 2, KEY_CAPSLOCK), \ | ||
77 | KEY(6, 3, KEY_F1), \ | ||
78 | KEY(6, 4, KEY_F2), \ | ||
79 | KEY(6, 5, KEY_F3), \ | ||
80 | KEY(6, 6, KEY_F4), \ | ||
81 | KEY(6, 7, KEY_F5), \ | ||
82 | KEY(6, 8, KEY_F6), \ | ||
83 | KEY(7, 0, KEY_F7), \ | ||
84 | KEY(7, 1, KEY_F8), \ | ||
85 | KEY(7, 2, KEY_F9), \ | ||
86 | KEY(7, 3, KEY_F10), \ | ||
87 | KEY(7, 4, KEY_NUMLOCK), \ | ||
88 | KEY(7, 5, KEY_SCROLLLOCK), \ | ||
89 | KEY(7, 6, KEY_KP7), \ | ||
90 | KEY(7, 7, KEY_KP8), \ | ||
91 | KEY(7, 8, KEY_KP9), \ | ||
92 | KEY(8, 0, KEY_KPMINUS), \ | ||
93 | KEY(8, 1, KEY_KP4), \ | ||
94 | KEY(8, 2, KEY_KP5), \ | ||
95 | KEY(8, 3, KEY_KP6), \ | ||
96 | KEY(8, 4, KEY_KPPLUS), \ | ||
97 | KEY(8, 5, KEY_KP1), \ | ||
98 | KEY(8, 6, KEY_KP2), \ | ||
99 | KEY(8, 7, KEY_KP3), \ | ||
100 | KEY(8, 8, KEY_KP0), \ | ||
101 | } | ||
102 | |||
103 | #define DECLARE_6x6_KEYMAP(_name) \ | ||
104 | int _name[] = { \ | ||
105 | KEY(0, 0, KEY_RESERVED), \ | ||
106 | KEY(0, 1, KEY_1), \ | ||
107 | KEY(0, 2, KEY_2), \ | ||
108 | KEY(0, 3, KEY_3), \ | ||
109 | KEY(0, 4, KEY_4), \ | ||
110 | KEY(0, 5, KEY_5), \ | ||
111 | KEY(1, 0, KEY_Q), \ | ||
112 | KEY(1, 1, KEY_W), \ | ||
113 | KEY(1, 2, KEY_E), \ | ||
114 | KEY(1, 3, KEY_R), \ | ||
115 | KEY(1, 4, KEY_T), \ | ||
116 | KEY(1, 5, KEY_Y), \ | ||
117 | KEY(2, 0, KEY_D), \ | ||
118 | KEY(2, 1, KEY_F), \ | ||
119 | KEY(2, 2, KEY_G), \ | ||
120 | KEY(2, 3, KEY_H), \ | ||
121 | KEY(2, 4, KEY_J), \ | ||
122 | KEY(2, 5, KEY_K), \ | ||
123 | KEY(3, 0, KEY_B), \ | ||
124 | KEY(3, 1, KEY_N), \ | ||
125 | KEY(3, 2, KEY_M), \ | ||
126 | KEY(3, 3, KEY_COMMA), \ | ||
127 | KEY(3, 4, KEY_DOT), \ | ||
128 | KEY(3, 5, KEY_SLASH), \ | ||
129 | KEY(4, 0, KEY_F6), \ | ||
130 | KEY(4, 1, KEY_F7), \ | ||
131 | KEY(4, 2, KEY_F8), \ | ||
132 | KEY(4, 3, KEY_F9), \ | ||
133 | KEY(4, 4, KEY_F10), \ | ||
134 | KEY(4, 5, KEY_NUMLOCK), \ | ||
135 | KEY(5, 0, KEY_KP2), \ | ||
136 | KEY(5, 1, KEY_KP3), \ | ||
137 | KEY(5, 2, KEY_KP0), \ | ||
138 | KEY(5, 3, KEY_KPDOT), \ | ||
139 | KEY(5, 4, KEY_RO), \ | ||
140 | KEY(5, 5, KEY_ZENKAKUHANKAKU), \ | ||
141 | } | ||
142 | |||
143 | #define KEYPAD_9x9 0 | ||
144 | #define KEYPAD_6x6 1 | ||
145 | #define KEYPAD_2x2 2 | ||
146 | |||
147 | /** | ||
148 | * struct kbd_platform_data - spear keyboard platform data | ||
149 | * keymap: pointer to keymap data (table and size) | ||
150 | * rep: enables key autorepeat | ||
151 | * mode: choose keyboard support(9x9, 6x6, 2x2) | ||
152 | * suspended_rate: rate at which keyboard would operate in suspended mode | ||
153 | * | ||
154 | * This structure is supposed to be used by platform code to supply | ||
155 | * keymaps to drivers that implement keyboards. | ||
156 | */ | ||
157 | struct kbd_platform_data { | ||
158 | const struct matrix_keymap_data *keymap; | ||
159 | bool rep; | ||
160 | unsigned int mode; | ||
161 | unsigned int suspended_rate; | ||
162 | }; | ||
163 | |||
164 | #endif /* __PLAT_KEYBOARD_H */ | ||
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h new file mode 100644 index 000000000000..1e2f4e97f428 --- /dev/null +++ b/include/linux/platform_data/keypad-ep93xx.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ARCH_EP93XX_KEYPAD_H | ||
6 | #define __ASM_ARCH_EP93XX_KEYPAD_H | ||
7 | |||
8 | struct matrix_keymap_data; | ||
9 | |||
10 | /* flags for the ep93xx_keypad driver */ | ||
11 | #define EP93XX_KEYPAD_DISABLE_3_KEY (1<<0) /* disable 3-key reset */ | ||
12 | #define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */ | ||
13 | #define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */ | ||
14 | #define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */ | ||
15 | #define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */ | ||
16 | #define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */ | ||
17 | |||
18 | /** | ||
19 | * struct ep93xx_keypad_platform_data - platform specific device structure | ||
20 | * @keymap_data: pointer to &matrix_keymap_data | ||
21 | * @debounce: debounce start count; terminal count is 0xff | ||
22 | * @prescale: row/column counter pre-scaler load value | ||
23 | * @flags: see above | ||
24 | */ | ||
25 | struct ep93xx_keypad_platform_data { | ||
26 | struct matrix_keymap_data *keymap_data; | ||
27 | unsigned int debounce; | ||
28 | unsigned int prescale; | ||
29 | unsigned int flags; | ||
30 | }; | ||
31 | |||
32 | #define EP93XX_MATRIX_ROWS (8) | ||
33 | #define EP93XX_MATRIX_COLS (8) | ||
34 | |||
35 | #endif /* __ASM_ARCH_EP93XX_KEYPAD_H */ | ||
diff --git a/include/linux/platform_data/keypad-nomadik-ske.h b/include/linux/platform_data/keypad-nomadik-ske.h new file mode 100644 index 000000000000..31382fbc07dc --- /dev/null +++ b/include/linux/platform_data/keypad-nomadik-ske.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License v2 | ||
5 | * Author: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com> | ||
6 | * | ||
7 | * ux500 Scroll key and Keypad Encoder (SKE) header | ||
8 | */ | ||
9 | |||
10 | #ifndef __SKE_H | ||
11 | #define __SKE_H | ||
12 | |||
13 | #include <linux/input/matrix_keypad.h> | ||
14 | |||
15 | /* register definitions for SKE peripheral */ | ||
16 | #define SKE_CR 0x00 | ||
17 | #define SKE_VAL0 0x04 | ||
18 | #define SKE_VAL1 0x08 | ||
19 | #define SKE_DBCR 0x0C | ||
20 | #define SKE_IMSC 0x10 | ||
21 | #define SKE_RIS 0x14 | ||
22 | #define SKE_MIS 0x18 | ||
23 | #define SKE_ICR 0x1C | ||
24 | |||
25 | /* | ||
26 | * Keypad module | ||
27 | */ | ||
28 | |||
29 | /** | ||
30 | * struct keypad_platform_data - structure for platform specific data | ||
31 | * @init: pointer to keypad init function | ||
32 | * @exit: pointer to keypad deinitialisation function | ||
33 | * @keymap_data: matrix scan code table for keycodes | ||
34 | * @krow: maximum number of rows | ||
35 | * @kcol: maximum number of columns | ||
36 | * @debounce_ms: platform specific debounce time | ||
37 | * @no_autorepeat: flag for auto repetition | ||
38 | * @wakeup_enable: allow waking up the system | ||
39 | */ | ||
40 | struct ske_keypad_platform_data { | ||
41 | int (*init)(void); | ||
42 | int (*exit)(void); | ||
43 | const struct matrix_keymap_data *keymap_data; | ||
44 | u8 krow; | ||
45 | u8 kcol; | ||
46 | u8 debounce_ms; | ||
47 | bool no_autorepeat; | ||
48 | bool wakeup_enable; | ||
49 | }; | ||
50 | #endif /*__SKE_KPD_H*/ | ||
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h new file mode 100644 index 000000000000..a6b21eddb212 --- /dev/null +++ b/include/linux/platform_data/keypad-omap.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/keypad.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> | ||
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 | #ifndef ASMARM_ARCH_KEYPAD_H | ||
11 | #define ASMARM_ARCH_KEYPAD_H | ||
12 | |||
13 | #ifndef CONFIG_ARCH_OMAP1 | ||
14 | #warning Please update the board to use matrix-keypad driver | ||
15 | #define omap_readw(reg) 0 | ||
16 | #define omap_writew(val, reg) do {} while (0) | ||
17 | #endif | ||
18 | #include <linux/input/matrix_keypad.h> | ||
19 | |||
20 | struct omap_kp_platform_data { | ||
21 | int rows; | ||
22 | int cols; | ||
23 | const struct matrix_keymap_data *keymap_data; | ||
24 | bool rep; | ||
25 | unsigned long delay; | ||
26 | bool dbounce; | ||
27 | /* specific to OMAP242x*/ | ||
28 | unsigned int *row_gpios; | ||
29 | unsigned int *col_gpios; | ||
30 | }; | ||
31 | |||
32 | /* Group (0..3) -- when multiple keys are pressed, only the | ||
33 | * keys pressed in the same group are considered as pressed. This is | ||
34 | * in order to workaround certain crappy HW designs that produce ghost | ||
35 | * keypresses. Two free bits, not used by neither row/col nor keynum, | ||
36 | * must be available for use as group bits. The below GROUP_SHIFT | ||
37 | * macro definition is based on some prior knowledge of the | ||
38 | * matrix_keypad defined KEY() macro internals. | ||
39 | */ | ||
40 | #define GROUP_SHIFT 14 | ||
41 | #define GROUP_0 (0 << GROUP_SHIFT) | ||
42 | #define GROUP_1 (1 << GROUP_SHIFT) | ||
43 | #define GROUP_2 (2 << GROUP_SHIFT) | ||
44 | #define GROUP_3 (3 << GROUP_SHIFT) | ||
45 | #define GROUP_MASK GROUP_3 | ||
46 | #if KEY_MAX & GROUP_MASK | ||
47 | #error Group bits in conflict with keynum bits | ||
48 | #endif | ||
49 | |||
50 | |||
51 | #endif | ||
52 | |||
diff --git a/include/linux/platform_data/keypad-pxa27x.h b/include/linux/platform_data/keypad-pxa27x.h new file mode 100644 index 000000000000..5ce8d5e6ea51 --- /dev/null +++ b/include/linux/platform_data/keypad-pxa27x.h | |||
@@ -0,0 +1,73 @@ | |||
1 | #ifndef __ASM_ARCH_PXA27x_KEYPAD_H | ||
2 | #define __ASM_ARCH_PXA27x_KEYPAD_H | ||
3 | |||
4 | #include <linux/input.h> | ||
5 | #include <linux/input/matrix_keypad.h> | ||
6 | |||
7 | #define MAX_MATRIX_KEY_ROWS (8) | ||
8 | #define MAX_MATRIX_KEY_COLS (8) | ||
9 | #define MATRIX_ROW_SHIFT (3) | ||
10 | #define MAX_DIRECT_KEY_NUM (8) | ||
11 | |||
12 | /* pxa3xx keypad platform specific parameters | ||
13 | * | ||
14 | * NOTE: | ||
15 | * 1. direct_key_num indicates the number of keys in the direct keypad | ||
16 | * _plus_ the number of rotary-encoder sensor inputs, this can be | ||
17 | * left as 0 if only rotary encoders are enabled, the driver will | ||
18 | * automatically calculate this | ||
19 | * | ||
20 | * 2. direct_key_map is the key code map for the direct keys, if rotary | ||
21 | * encoder(s) are enabled, direct key 0/1(2/3) will be ignored | ||
22 | * | ||
23 | * 3. rotary can be either interpreted as a relative input event (e.g. | ||
24 | * REL_WHEEL/REL_HWHEEL) or specific keys (e.g. UP/DOWN/LEFT/RIGHT) | ||
25 | * | ||
26 | * 4. matrix key and direct key will use the same debounce_interval by | ||
27 | * default, which should be sufficient in most cases | ||
28 | * | ||
29 | * pxa168 keypad platform specific parameter | ||
30 | * | ||
31 | * NOTE: | ||
32 | * clear_wakeup_event callback is a workaround required to clear the | ||
33 | * keypad interrupt. The keypad wake must be cleared in addition to | ||
34 | * reading the MI/DI bits in the KPC register. | ||
35 | */ | ||
36 | struct pxa27x_keypad_platform_data { | ||
37 | |||
38 | /* code map for the matrix keys */ | ||
39 | unsigned int matrix_key_rows; | ||
40 | unsigned int matrix_key_cols; | ||
41 | unsigned int *matrix_key_map; | ||
42 | int matrix_key_map_size; | ||
43 | |||
44 | /* direct keys */ | ||
45 | int direct_key_num; | ||
46 | unsigned int direct_key_map[MAX_DIRECT_KEY_NUM]; | ||
47 | /* the key output may be low active */ | ||
48 | int direct_key_low_active; | ||
49 | /* give board a chance to choose the start direct key */ | ||
50 | unsigned int direct_key_mask; | ||
51 | |||
52 | /* rotary encoders 0 */ | ||
53 | int enable_rotary0; | ||
54 | int rotary0_rel_code; | ||
55 | int rotary0_up_key; | ||
56 | int rotary0_down_key; | ||
57 | |||
58 | /* rotary encoders 1 */ | ||
59 | int enable_rotary1; | ||
60 | int rotary1_rel_code; | ||
61 | int rotary1_up_key; | ||
62 | int rotary1_down_key; | ||
63 | |||
64 | /* key debounce interval */ | ||
65 | unsigned int debounce_interval; | ||
66 | |||
67 | /* clear wakeup event requirement for pxa168 */ | ||
68 | void (*clear_wakeup_event)(void); | ||
69 | }; | ||
70 | |||
71 | extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info); | ||
72 | |||
73 | #endif /* __ASM_ARCH_PXA27x_KEYPAD_H */ | ||
diff --git a/include/linux/platform_data/keypad-w90p910.h b/include/linux/platform_data/keypad-w90p910.h new file mode 100644 index 000000000000..556778e8ddaa --- /dev/null +++ b/include/linux/platform_data/keypad-w90p910.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __ASM_ARCH_W90P910_KEYPAD_H | ||
2 | #define __ASM_ARCH_W90P910_KEYPAD_H | ||
3 | |||
4 | #include <linux/input/matrix_keypad.h> | ||
5 | |||
6 | extern void mfp_set_groupi(struct device *dev); | ||
7 | |||
8 | struct w90p910_keypad_platform_data { | ||
9 | const struct matrix_keymap_data *keymap_data; | ||
10 | |||
11 | unsigned int prescale; | ||
12 | unsigned int debounce; | ||
13 | }; | ||
14 | |||
15 | #endif /* __ASM_ARCH_W90P910_KEYPAD_H */ | ||
diff --git a/include/linux/platform_data/keyscan-davinci.h b/include/linux/platform_data/keyscan-davinci.h new file mode 100644 index 000000000000..7a560e05bda8 --- /dev/null +++ b/include/linux/platform_data/keyscan-davinci.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Texas Instruments, Inc | ||
3 | * | ||
4 | * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com> | ||
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 DAVINCI_KEYSCAN_H | ||
22 | #define DAVINCI_KEYSCAN_H | ||
23 | |||
24 | #include <linux/io.h> | ||
25 | |||
26 | enum davinci_matrix_types { | ||
27 | DAVINCI_KEYSCAN_MATRIX_4X4, | ||
28 | DAVINCI_KEYSCAN_MATRIX_5X3, | ||
29 | }; | ||
30 | |||
31 | struct davinci_ks_platform_data { | ||
32 | int (*device_enable)(struct device *dev); | ||
33 | unsigned short *keymap; | ||
34 | u32 keymapsize; | ||
35 | u8 rep:1; | ||
36 | u8 strobe; | ||
37 | u8 interval; | ||
38 | u8 matrix_type; | ||
39 | }; | ||
40 | |||
41 | #endif | ||
42 | |||
diff --git a/include/linux/platform_data/lcd-mipid.h b/include/linux/platform_data/lcd-mipid.h new file mode 100644 index 000000000000..8e52c6572281 --- /dev/null +++ b/include/linux/platform_data/lcd-mipid.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #ifndef __LCD_MIPID_H | ||
2 | #define __LCD_MIPID_H | ||
3 | |||
4 | enum mipid_test_num { | ||
5 | MIPID_TEST_RGB_LINES, | ||
6 | }; | ||
7 | |||
8 | enum mipid_test_result { | ||
9 | MIPID_TEST_SUCCESS, | ||
10 | MIPID_TEST_INVALID, | ||
11 | MIPID_TEST_FAILED, | ||
12 | }; | ||
13 | |||
14 | #ifdef __KERNEL__ | ||
15 | |||
16 | struct mipid_platform_data { | ||
17 | int nreset_gpio; | ||
18 | int data_lines; | ||
19 | |||
20 | void (*shutdown)(struct mipid_platform_data *pdata); | ||
21 | void (*set_bklight_level)(struct mipid_platform_data *pdata, | ||
22 | int level); | ||
23 | int (*get_bklight_level)(struct mipid_platform_data *pdata); | ||
24 | int (*get_bklight_max)(struct mipid_platform_data *pdata); | ||
25 | }; | ||
26 | |||
27 | #endif | ||
28 | |||
29 | #endif | ||
diff --git a/include/linux/platform_data/leds-kirkwood-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h new file mode 100644 index 000000000000..24b536ebdf13 --- /dev/null +++ b/include/linux/platform_data/leds-kirkwood-netxbig.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h | ||
3 | * | ||
4 | * Platform data structure for netxbig LED driver | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_LEDS_NETXBIG_H | ||
12 | #define __MACH_LEDS_NETXBIG_H | ||
13 | |||
14 | struct netxbig_gpio_ext { | ||
15 | unsigned *addr; | ||
16 | int num_addr; | ||
17 | unsigned *data; | ||
18 | int num_data; | ||
19 | unsigned enable; | ||
20 | }; | ||
21 | |||
22 | enum netxbig_led_mode { | ||
23 | NETXBIG_LED_OFF, | ||
24 | NETXBIG_LED_ON, | ||
25 | NETXBIG_LED_SATA, | ||
26 | NETXBIG_LED_TIMER1, | ||
27 | NETXBIG_LED_TIMER2, | ||
28 | NETXBIG_LED_MODE_NUM, | ||
29 | }; | ||
30 | |||
31 | #define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM | ||
32 | |||
33 | struct netxbig_led_timer { | ||
34 | unsigned long delay_on; | ||
35 | unsigned long delay_off; | ||
36 | enum netxbig_led_mode mode; | ||
37 | }; | ||
38 | |||
39 | struct netxbig_led { | ||
40 | const char *name; | ||
41 | const char *default_trigger; | ||
42 | int mode_addr; | ||
43 | int *mode_val; | ||
44 | int bright_addr; | ||
45 | }; | ||
46 | |||
47 | struct netxbig_led_platform_data { | ||
48 | struct netxbig_gpio_ext *gpio_ext; | ||
49 | struct netxbig_led_timer *timer; | ||
50 | int num_timer; | ||
51 | struct netxbig_led *leds; | ||
52 | int num_leds; | ||
53 | }; | ||
54 | |||
55 | #endif /* __MACH_LEDS_NETXBIG_H */ | ||
diff --git a/include/linux/platform_data/leds-kirkwood-ns2.h b/include/linux/platform_data/leds-kirkwood-ns2.h new file mode 100644 index 000000000000..e21272e5f668 --- /dev/null +++ b/include/linux/platform_data/leds-kirkwood-ns2.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/include/mach/leds-ns2.h | ||
3 | * | ||
4 | * Platform data structure for Network Space v2 LED driver | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_LEDS_NS2_H | ||
12 | #define __MACH_LEDS_NS2_H | ||
13 | |||
14 | struct ns2_led { | ||
15 | const char *name; | ||
16 | const char *default_trigger; | ||
17 | unsigned cmd; | ||
18 | unsigned slow; | ||
19 | }; | ||
20 | |||
21 | struct ns2_led_platform_data { | ||
22 | int num_leds; | ||
23 | struct ns2_led *leds; | ||
24 | }; | ||
25 | |||
26 | #endif /* __MACH_LEDS_NS2_H */ | ||
diff --git a/include/linux/platform_data/leds-s3c24xx.h b/include/linux/platform_data/leds-s3c24xx.h new file mode 100644 index 000000000000..d8a7672519b6 --- /dev/null +++ b/include/linux/platform_data/leds-s3c24xx.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/leds-gpio.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * S3C24XX - LEDs GPIO connector | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_LEDSGPIO_H | ||
15 | #define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h" | ||
16 | |||
17 | #define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */ | ||
18 | #define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */ | ||
19 | |||
20 | struct s3c24xx_led_platdata { | ||
21 | unsigned int gpio; | ||
22 | unsigned int flags; | ||
23 | |||
24 | char *name; | ||
25 | char *def_trigger; | ||
26 | }; | ||
27 | |||
28 | #endif /* __ASM_ARCH_LEDSGPIO_H */ | ||
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h new file mode 100644 index 000000000000..e2a41dd7690c --- /dev/null +++ b/include/linux/platform_data/max197.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Maxim MAX197 A/D Converter Driver | ||
3 | * | ||
4 | * Copyright (c) 2012 Savoir-faire Linux Inc. | ||
5 | * Vivien Didelot <vivien.didelot@savoirfairelinux.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 version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * For further information, see the Documentation/hwmon/max197 file. | ||
12 | */ | ||
13 | |||
14 | /** | ||
15 | * struct max197_platform_data - MAX197 connectivity info | ||
16 | * @convert: Function used to start a conversion with control byte ctrl. | ||
17 | * It must return the raw data, or a negative error code. | ||
18 | */ | ||
19 | struct max197_platform_data { | ||
20 | int (*convert)(u8 ctrl); | ||
21 | }; | ||
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h new file mode 100644 index 000000000000..91648bf5fc5c --- /dev/null +++ b/include/linux/platform_data/max310x.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Maxim (Dallas) MAX3107/8 serial driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
5 | * | ||
6 | * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org> | ||
7 | * Based on max3110.c, by Feng Tang <feng.tang@intel.com> | ||
8 | * Based on max3107.c, by Aavamobile | ||
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 _MAX310X_H_ | ||
17 | #define _MAX310X_H_ | ||
18 | |||
19 | /* | ||
20 | * Example board initialization data: | ||
21 | * | ||
22 | * static struct max310x_pdata max3107_pdata = { | ||
23 | * .driver_flags = MAX310X_EXT_CLK, | ||
24 | * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL, | ||
25 | * .frequency = 3686400, | ||
26 | * .gpio_base = -1, | ||
27 | * }; | ||
28 | * | ||
29 | * static struct spi_board_info spi_device_max3107[] = { | ||
30 | * { | ||
31 | * .modalias = "max3107", | ||
32 | * .irq = IRQ_EINT3, | ||
33 | * .bus_num = 1, | ||
34 | * .chip_select = 1, | ||
35 | * .platform_data = &max3107_pdata, | ||
36 | * }, | ||
37 | * }; | ||
38 | */ | ||
39 | |||
40 | #define MAX310X_MAX_UARTS 1 | ||
41 | |||
42 | /* MAX310X platform data structure */ | ||
43 | struct max310x_pdata { | ||
44 | /* Flags global to driver */ | ||
45 | const u8 driver_flags:2; | ||
46 | #define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ | ||
47 | #define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */ | ||
48 | /* Flags global to UART port */ | ||
49 | const u8 uart_flags[MAX310X_MAX_UARTS]; | ||
50 | #define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ | ||
51 | #define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */ | ||
52 | #define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction | ||
53 | * control (RS-485) | ||
54 | */ | ||
55 | /* Frequency (extrenal clock or crystal) */ | ||
56 | const int frequency; | ||
57 | /* GPIO base number (can be negative) */ | ||
58 | const int gpio_base; | ||
59 | /* Called during startup */ | ||
60 | void (*init)(void); | ||
61 | /* Called before finish */ | ||
62 | void (*exit)(void); | ||
63 | /* Suspend callback */ | ||
64 | void (*suspend)(int do_suspend); | ||
65 | }; | ||
66 | |||
67 | #endif | ||
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h new file mode 100644 index 000000000000..4b2860ae3828 --- /dev/null +++ b/include/linux/platform_data/mfd-mcp-sa11x0.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-sa1100/include/mach/mcp.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Russell King. | ||
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 | #ifndef __ASM_ARM_ARCH_MCP_H | ||
11 | #define __ASM_ARM_ARCH_MCP_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | struct mcp_plat_data { | ||
16 | u32 mccr0; | ||
17 | u32 mccr1; | ||
18 | unsigned int sclk_rate; | ||
19 | void *codec_pdata; | ||
20 | }; | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h new file mode 100644 index 000000000000..c45b1e8d4c2e --- /dev/null +++ b/include/linux/platform_data/mipi-csis.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd. | ||
3 | * | ||
4 | * S5P series MIPI CSI slave device support | ||
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 __PLAT_SAMSUNG_MIPI_CSIS_H_ | ||
12 | #define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__ | ||
13 | |||
14 | struct platform_device; | ||
15 | |||
16 | /** | ||
17 | * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver | ||
18 | * @clk_rate: bus clock frequency | ||
19 | * @lanes: number of data lanes used | ||
20 | * @alignment: data alignment in bits | ||
21 | * @hs_settle: HS-RX settle time | ||
22 | * @fixed_phy_vdd: false to enable external D-PHY regulator management in the | ||
23 | * driver or true in case this regulator has no enable function | ||
24 | * @phy_enable: pointer to a callback controlling D-PHY enable/reset | ||
25 | */ | ||
26 | struct s5p_platform_mipi_csis { | ||
27 | unsigned long clk_rate; | ||
28 | u8 lanes; | ||
29 | u8 alignment; | ||
30 | u8 hs_settle; | ||
31 | bool fixed_phy_vdd; | ||
32 | int (*phy_enable)(struct platform_device *pdev, bool on); | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control | ||
37 | * @pdev: MIPI-CSIS platform device | ||
38 | * @on: true to enable D-PHY and deassert its reset | ||
39 | * false to disable D-PHY | ||
40 | */ | ||
41 | int s5p_csis_phy_enable(struct platform_device *pdev, bool on); | ||
42 | |||
43 | #endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ | ||
diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h new file mode 100644 index 000000000000..5ba6b22ce338 --- /dev/null +++ b/include/linux/platform_data/mmc-davinci.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Board-specific MMC configuration | ||
3 | */ | ||
4 | |||
5 | #ifndef _DAVINCI_MMC_H | ||
6 | #define _DAVINCI_MMC_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/mmc/host.h> | ||
10 | |||
11 | struct davinci_mmc_config { | ||
12 | /* get_cd()/get_wp() may sleep */ | ||
13 | int (*get_cd)(int module); | ||
14 | int (*get_ro)(int module); | ||
15 | |||
16 | void (*set_power)(int module, bool on); | ||
17 | |||
18 | /* wires == 0 is equivalent to wires == 4 (4-bit parallel) */ | ||
19 | u8 wires; | ||
20 | |||
21 | u32 max_freq; | ||
22 | |||
23 | /* any additional host capabilities: OR'd in to mmc->f_caps */ | ||
24 | u32 caps; | ||
25 | |||
26 | /* Version of the MMC/SD controller */ | ||
27 | u8 version; | ||
28 | |||
29 | /* Number of sg segments */ | ||
30 | u8 nr_sg; | ||
31 | }; | ||
32 | void davinci_setup_mmc(int module, struct davinci_mmc_config *config); | ||
33 | |||
34 | enum { | ||
35 | MMC_CTLR_VERSION_1 = 0, /* DM644x and DM355 */ | ||
36 | MMC_CTLR_VERSION_2, /* DA830 */ | ||
37 | }; | ||
38 | |||
39 | #endif | ||
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h new file mode 100644 index 000000000000..aaf97481f413 --- /dev/null +++ b/include/linux/platform_data/mmc-esdhc-imx.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; version 2 | ||
7 | * of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_IMX_ESDHC_H | ||
11 | #define __ASM_ARCH_IMX_ESDHC_H | ||
12 | |||
13 | enum wp_types { | ||
14 | ESDHC_WP_NONE, /* no WP, neither controller nor gpio */ | ||
15 | ESDHC_WP_CONTROLLER, /* mmc controller internal WP */ | ||
16 | ESDHC_WP_GPIO, /* external gpio pin for WP */ | ||
17 | }; | ||
18 | |||
19 | enum cd_types { | ||
20 | ESDHC_CD_NONE, /* no CD, neither controller nor gpio */ | ||
21 | ESDHC_CD_CONTROLLER, /* mmc controller internal CD */ | ||
22 | ESDHC_CD_GPIO, /* external gpio pin for CD */ | ||
23 | ESDHC_CD_PERMANENT, /* no CD, card permanently wired to host */ | ||
24 | }; | ||
25 | |||
26 | /** | ||
27 | * struct esdhc_platform_data - platform data for esdhc on i.MX | ||
28 | * | ||
29 | * ESDHC_WP(CD)_CONTROLLER type is not available on i.MX25/35. | ||
30 | * | ||
31 | * @wp_gpio: gpio for write_protect | ||
32 | * @cd_gpio: gpio for card_detect interrupt | ||
33 | * @wp_type: type of write_protect method (see wp_types enum above) | ||
34 | * @cd_type: type of card_detect method (see cd_types enum above) | ||
35 | */ | ||
36 | |||
37 | struct esdhc_platform_data { | ||
38 | unsigned int wp_gpio; | ||
39 | unsigned int cd_gpio; | ||
40 | enum wp_types wp_type; | ||
41 | enum cd_types cd_type; | ||
42 | }; | ||
43 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | ||
diff --git a/include/linux/platform_data/mmc-msm_sdcc.h b/include/linux/platform_data/mmc-msm_sdcc.h new file mode 100644 index 000000000000..ffcd9e3a6a7e --- /dev/null +++ b/include/linux/platform_data/mmc-msm_sdcc.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/mach/mmc.h | ||
3 | */ | ||
4 | #ifndef ASMARM_MACH_MMC_H | ||
5 | #define ASMARM_MACH_MMC_H | ||
6 | |||
7 | #include <linux/mmc/host.h> | ||
8 | #include <linux/mmc/card.h> | ||
9 | #include <linux/mmc/sdio_func.h> | ||
10 | |||
11 | struct msm_mmc_gpio { | ||
12 | unsigned no; | ||
13 | const char *name; | ||
14 | }; | ||
15 | |||
16 | struct msm_mmc_gpio_data { | ||
17 | struct msm_mmc_gpio *gpio; | ||
18 | u8 size; | ||
19 | }; | ||
20 | |||
21 | struct msm_mmc_platform_data { | ||
22 | unsigned int ocr_mask; /* available voltages */ | ||
23 | u32 (*translate_vdd)(struct device *, unsigned int); | ||
24 | unsigned int (*status)(struct device *); | ||
25 | int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); | ||
26 | struct msm_mmc_gpio_data *gpio_data; | ||
27 | void (*init_card)(struct mmc_card *card); | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/platform_data/mmc-mvsdio.h b/include/linux/platform_data/mmc-mvsdio.h new file mode 100644 index 000000000000..1190efedcb94 --- /dev/null +++ b/include/linux/platform_data/mmc-mvsdio.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/mvsdio.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_MVSDIO_H | ||
10 | #define __MACH_MVSDIO_H | ||
11 | |||
12 | #include <linux/mbus.h> | ||
13 | |||
14 | struct mvsdio_platform_data { | ||
15 | unsigned int clock; | ||
16 | int gpio_card_detect; | ||
17 | int gpio_write_protect; | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/include/linux/platform_data/mmc-mxcmmc.h b/include/linux/platform_data/mmc-mxcmmc.h new file mode 100644 index 000000000000..29115f405af9 --- /dev/null +++ b/include/linux/platform_data/mmc-mxcmmc.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef ASMARM_ARCH_MMC_H | ||
2 | #define ASMARM_ARCH_MMC_H | ||
3 | |||
4 | #include <linux/mmc/host.h> | ||
5 | |||
6 | struct device; | ||
7 | |||
8 | /* board specific SDHC data, optional. | ||
9 | * If not present, a writable card with 3,3V is assumed. | ||
10 | */ | ||
11 | struct imxmmc_platform_data { | ||
12 | /* Return values for the get_ro callback should be: | ||
13 | * 0 for a read/write card | ||
14 | * 1 for a read-only card | ||
15 | * -ENOSYS when not supported (equal to NULL callback) | ||
16 | * or a negative errno value when something bad happened | ||
17 | */ | ||
18 | int (*get_ro)(struct device *); | ||
19 | |||
20 | /* board specific hook to (de)initialize the SD slot. | ||
21 | * The board code can call 'handler' on a card detection | ||
22 | * change giving data as argument. | ||
23 | */ | ||
24 | int (*init)(struct device *dev, irq_handler_t handler, void *data); | ||
25 | void (*exit)(struct device *dev, void *data); | ||
26 | |||
27 | /* available voltages. If not given, assume | ||
28 | * MMC_VDD_32_33 | MMC_VDD_33_34 | ||
29 | */ | ||
30 | unsigned int ocr_avail; | ||
31 | |||
32 | /* adjust slot voltage */ | ||
33 | void (*setpower)(struct device *, unsigned int vdd); | ||
34 | |||
35 | /* enable card detect using DAT3 */ | ||
36 | int dat3_card_detect; | ||
37 | }; | ||
38 | |||
39 | #endif | ||
diff --git a/include/linux/platform_data/mmc-pxamci.h b/include/linux/platform_data/mmc-pxamci.h new file mode 100644 index 000000000000..9eb515bb799d --- /dev/null +++ b/include/linux/platform_data/mmc-pxamci.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef ASMARM_ARCH_MMC_H | ||
2 | #define ASMARM_ARCH_MMC_H | ||
3 | |||
4 | #include <linux/mmc/host.h> | ||
5 | #include <linux/interrupt.h> | ||
6 | |||
7 | struct device; | ||
8 | struct mmc_host; | ||
9 | |||
10 | struct pxamci_platform_data { | ||
11 | unsigned int ocr_mask; /* available voltages */ | ||
12 | unsigned long detect_delay_ms; /* delay in millisecond before detecting cards after interrupt */ | ||
13 | int (*init)(struct device *, irq_handler_t , void *); | ||
14 | int (*get_ro)(struct device *); | ||
15 | void (*setpower)(struct device *, unsigned int); | ||
16 | void (*exit)(struct device *, void *); | ||
17 | int gpio_card_detect; /* gpio detecting card insertion */ | ||
18 | int gpio_card_ro; /* gpio detecting read only toggle */ | ||
19 | bool gpio_card_ro_invert; /* gpio ro is inverted */ | ||
20 | int gpio_power; /* gpio powering up MMC bus */ | ||
21 | bool gpio_power_invert; /* gpio power is inverted */ | ||
22 | }; | ||
23 | |||
24 | extern void pxa_set_mci_info(struct pxamci_platform_data *info); | ||
25 | extern void pxa3xx_set_mci2_info(struct pxamci_platform_data *info); | ||
26 | extern void pxa3xx_set_mci3_info(struct pxamci_platform_data *info); | ||
27 | |||
28 | #endif | ||
diff --git a/include/linux/platform_data/mmc-s3cmci.h b/include/linux/platform_data/mmc-s3cmci.h new file mode 100644 index 000000000000..c42d31711944 --- /dev/null +++ b/include/linux/platform_data/mmc-s3cmci.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef _ARCH_MCI_H | ||
2 | #define _ARCH_MCI_H | ||
3 | |||
4 | /** | ||
5 | * struct s3c24xx_mci_pdata - sd/mmc controller platform data | ||
6 | * @no_wprotect: Set this to indicate there is no write-protect switch. | ||
7 | * @no_detect: Set this if there is no detect switch. | ||
8 | * @wprotect_invert: Invert the default sense of the write protect switch. | ||
9 | * @detect_invert: Invert the default sense of the write protect switch. | ||
10 | * @use_dma: Set to allow the use of DMA. | ||
11 | * @gpio_detect: GPIO number for the card detect line. | ||
12 | * @gpio_wprotect: GPIO number for the write protect line. | ||
13 | * @ocr_avail: The mask of the available power states, non-zero to use. | ||
14 | * @set_power: Callback to control the power mode. | ||
15 | * | ||
16 | * The @gpio_detect is used for card detection when @no_wprotect is unset, | ||
17 | * and the default sense is that 0 returned from gpio_get_value() means | ||
18 | * that a card is inserted. If @detect_invert is set, then the value from | ||
19 | * gpio_get_value() is inverted, which makes 1 mean card inserted. | ||
20 | * | ||
21 | * The driver will use @gpio_wprotect to signal whether the card is write | ||
22 | * protected if @no_wprotect is not set. A 0 returned from gpio_get_value() | ||
23 | * means the card is read/write, and 1 means read-only. The @wprotect_invert | ||
24 | * will invert the value returned from gpio_get_value(). | ||
25 | * | ||
26 | * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set | ||
27 | * to a non-zero value, otherwise the default of 3.2-3.4V is used. | ||
28 | */ | ||
29 | struct s3c24xx_mci_pdata { | ||
30 | unsigned int no_wprotect:1; | ||
31 | unsigned int no_detect:1; | ||
32 | unsigned int wprotect_invert:1; | ||
33 | unsigned int detect_invert:1; /* set => detect active high */ | ||
34 | unsigned int use_dma:1; | ||
35 | |||
36 | unsigned int gpio_detect; | ||
37 | unsigned int gpio_wprotect; | ||
38 | unsigned long ocr_avail; | ||
39 | void (*set_power)(unsigned char power_mode, | ||
40 | unsigned short vdd); | ||
41 | }; | ||
42 | |||
43 | /** | ||
44 | * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device | ||
45 | * @pdata: The platform data | ||
46 | * | ||
47 | * Copy the platform data supplied by @pdata so that this can be marked | ||
48 | * __initdata. | ||
49 | */ | ||
50 | extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata); | ||
51 | |||
52 | #endif /* _ARCH_NCI_H */ | ||
diff --git a/include/linux/platform_data/mmc-sdhci-tegra.h b/include/linux/platform_data/mmc-sdhci-tegra.h new file mode 100644 index 000000000000..8f8430697686 --- /dev/null +++ b/include/linux/platform_data/mmc-sdhci-tegra.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Palm, Inc. | ||
3 | * Author: Yvonne Yip <y@palm.com> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | #ifndef __PLATFORM_DATA_TEGRA_SDHCI_H | ||
16 | #define __PLATFORM_DATA_TEGRA_SDHCI_H | ||
17 | |||
18 | #include <linux/mmc/host.h> | ||
19 | |||
20 | struct tegra_sdhci_platform_data { | ||
21 | int cd_gpio; | ||
22 | int wp_gpio; | ||
23 | int power_gpio; | ||
24 | int is_8bit; | ||
25 | int pm_flags; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
diff --git a/include/linux/platform_data/mouse-pxa930_trkball.h b/include/linux/platform_data/mouse-pxa930_trkball.h new file mode 100644 index 000000000000..5e0789bc4729 --- /dev/null +++ b/include/linux/platform_data/mouse-pxa930_trkball.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __ASM_ARCH_PXA930_TRKBALL_H | ||
2 | #define __ASM_ARCH_PXA930_TRKBALL_H | ||
3 | |||
4 | struct pxa930_trkball_platform_data { | ||
5 | int x_filter; | ||
6 | int y_filter; | ||
7 | }; | ||
8 | |||
9 | #endif /* __ASM_ARCH_PXA930_TRKBALL_H */ | ||
10 | |||
diff --git a/include/linux/platform_data/mtd-davinci-aemif.h b/include/linux/platform_data/mtd-davinci-aemif.h new file mode 100644 index 000000000000..05b293443097 --- /dev/null +++ b/include/linux/platform_data/mtd-davinci-aemif.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * TI DaVinci AEMIF support | ||
3 | * | ||
4 | * Copyright 2010 (C) Texas Instruments, Inc. http://www.ti.com/ | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | #ifndef _MACH_DAVINCI_AEMIF_H | ||
11 | #define _MACH_DAVINCI_AEMIF_H | ||
12 | |||
13 | #define NRCSR_OFFSET 0x00 | ||
14 | #define AWCCR_OFFSET 0x04 | ||
15 | #define A1CR_OFFSET 0x10 | ||
16 | |||
17 | #define ACR_ASIZE_MASK 0x3 | ||
18 | #define ACR_EW_MASK BIT(30) | ||
19 | #define ACR_SS_MASK BIT(31) | ||
20 | |||
21 | /* All timings in nanoseconds */ | ||
22 | struct davinci_aemif_timing { | ||
23 | u8 wsetup; | ||
24 | u8 wstrobe; | ||
25 | u8 whold; | ||
26 | |||
27 | u8 rsetup; | ||
28 | u8 rstrobe; | ||
29 | u8 rhold; | ||
30 | |||
31 | u8 ta; | ||
32 | }; | ||
33 | |||
34 | int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, | ||
35 | void __iomem *base, unsigned cs); | ||
36 | #endif | ||
diff --git a/include/linux/platform_data/mtd-davinci.h b/include/linux/platform_data/mtd-davinci.h new file mode 100644 index 000000000000..1cf555aef896 --- /dev/null +++ b/include/linux/platform_data/mtd-davinci.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * mach-davinci/nand.h | ||
3 | * | ||
4 | * Copyright © 2006 Texas Instruments. | ||
5 | * | ||
6 | * Ported to 2.6.23 Copyright © 2008 by | ||
7 | * Sander Huijsen <Shuijsen@optelecom-nkf.com> | ||
8 | * Troy Kisky <troy.kisky@boundarydevices.com> | ||
9 | * Dirk Behme <Dirk.Behme@gmail.com> | ||
10 | * | ||
11 | * -------------------------------------------------------------------------- | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | |||
28 | #ifndef __ARCH_ARM_DAVINCI_NAND_H | ||
29 | #define __ARCH_ARM_DAVINCI_NAND_H | ||
30 | |||
31 | #include <linux/mtd/nand.h> | ||
32 | |||
33 | #define NANDFCR_OFFSET 0x60 | ||
34 | #define NANDFSR_OFFSET 0x64 | ||
35 | #define NANDF1ECC_OFFSET 0x70 | ||
36 | |||
37 | /* 4-bit ECC syndrome registers */ | ||
38 | #define NAND_4BIT_ECC_LOAD_OFFSET 0xbc | ||
39 | #define NAND_4BIT_ECC1_OFFSET 0xc0 | ||
40 | #define NAND_4BIT_ECC2_OFFSET 0xc4 | ||
41 | #define NAND_4BIT_ECC3_OFFSET 0xc8 | ||
42 | #define NAND_4BIT_ECC4_OFFSET 0xcc | ||
43 | #define NAND_ERR_ADD1_OFFSET 0xd0 | ||
44 | #define NAND_ERR_ADD2_OFFSET 0xd4 | ||
45 | #define NAND_ERR_ERRVAL1_OFFSET 0xd8 | ||
46 | #define NAND_ERR_ERRVAL2_OFFSET 0xdc | ||
47 | |||
48 | /* NOTE: boards don't need to use these address bits | ||
49 | * for ALE/CLE unless they support booting from NAND. | ||
50 | * They're used unless platform data overrides them. | ||
51 | */ | ||
52 | #define MASK_ALE 0x08 | ||
53 | #define MASK_CLE 0x10 | ||
54 | |||
55 | struct davinci_nand_pdata { /* platform_data */ | ||
56 | uint32_t mask_ale; | ||
57 | uint32_t mask_cle; | ||
58 | |||
59 | /* for packages using two chipselects */ | ||
60 | uint32_t mask_chipsel; | ||
61 | |||
62 | /* board's default static partition info */ | ||
63 | struct mtd_partition *parts; | ||
64 | unsigned nr_parts; | ||
65 | |||
66 | /* none == NAND_ECC_NONE (strongly *not* advised!!) | ||
67 | * soft == NAND_ECC_SOFT | ||
68 | * else == NAND_ECC_HW, according to ecc_bits | ||
69 | * | ||
70 | * All DaVinci-family chips support 1-bit hardware ECC. | ||
71 | * Newer ones also support 4-bit ECC, but are awkward | ||
72 | * using it with large page chips. | ||
73 | */ | ||
74 | nand_ecc_modes_t ecc_mode; | ||
75 | u8 ecc_bits; | ||
76 | |||
77 | /* e.g. NAND_BUSWIDTH_16 */ | ||
78 | unsigned options; | ||
79 | /* e.g. NAND_BBT_USE_FLASH */ | ||
80 | unsigned bbt_options; | ||
81 | |||
82 | /* Main and mirror bbt descriptor overrides */ | ||
83 | struct nand_bbt_descr *bbt_td; | ||
84 | struct nand_bbt_descr *bbt_md; | ||
85 | |||
86 | /* Access timings */ | ||
87 | struct davinci_aemif_timing *timing; | ||
88 | }; | ||
89 | |||
90 | #endif /* __ARCH_ARM_DAVINCI_NAND_H */ | ||
diff --git a/include/linux/platform_data/mtd-mxc_nand.h b/include/linux/platform_data/mtd-mxc_nand.h new file mode 100644 index 000000000000..6bb96ef1600b --- /dev/null +++ b/include/linux/platform_data/mtd-mxc_nand.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Sascha Hauer, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __ASM_ARCH_NAND_H | ||
21 | #define __ASM_ARCH_NAND_H | ||
22 | |||
23 | #include <linux/mtd/partitions.h> | ||
24 | |||
25 | struct mxc_nand_platform_data { | ||
26 | unsigned int width; /* data bus width in bytes */ | ||
27 | unsigned int hw_ecc:1; /* 0 if suppress hardware ECC */ | ||
28 | unsigned int flash_bbt:1; /* set to 1 to use a flash based bbt */ | ||
29 | struct mtd_partition *parts; /* partition table */ | ||
30 | int nr_parts; /* size of parts */ | ||
31 | }; | ||
32 | #endif /* __ASM_ARCH_NAND_H */ | ||
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h new file mode 100644 index 000000000000..1a68c1e5fe53 --- /dev/null +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/nand.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Micron Technology Inc. | ||
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 | #include <plat/gpmc.h> | ||
12 | #include <linux/mtd/partitions.h> | ||
13 | |||
14 | enum nand_io { | ||
15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | ||
16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | ||
17 | NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */ | ||
18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | ||
19 | }; | ||
20 | |||
21 | struct omap_nand_platform_data { | ||
22 | int cs; | ||
23 | struct mtd_partition *parts; | ||
24 | struct gpmc_timings *gpmc_t; | ||
25 | int nr_parts; | ||
26 | bool dev_ready; | ||
27 | enum nand_io xfer_type; | ||
28 | int devsize; | ||
29 | enum omap_ecc ecc_opt; | ||
30 | struct gpmc_nand_regs reg; | ||
31 | }; | ||
32 | |||
33 | /* minimum size for IO mapping */ | ||
34 | #define NAND_IO_SIZE 4 | ||
35 | |||
36 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
37 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | ||
38 | #else | ||
39 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | #endif | ||
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h new file mode 100644 index 000000000000..c42f39f20195 --- /dev/null +++ b/include/linux/platform_data/mtd-nand-pxa3xx.h | |||
@@ -0,0 +1,79 @@ | |||
1 | #ifndef __ASM_ARCH_PXA3XX_NAND_H | ||
2 | #define __ASM_ARCH_PXA3XX_NAND_H | ||
3 | |||
4 | #include <linux/mtd/mtd.h> | ||
5 | #include <linux/mtd/partitions.h> | ||
6 | |||
7 | struct pxa3xx_nand_timing { | ||
8 | unsigned int tCH; /* Enable signal hold time */ | ||
9 | unsigned int tCS; /* Enable signal setup time */ | ||
10 | unsigned int tWH; /* ND_nWE high duration */ | ||
11 | unsigned int tWP; /* ND_nWE pulse time */ | ||
12 | unsigned int tRH; /* ND_nRE high duration */ | ||
13 | unsigned int tRP; /* ND_nRE pulse width */ | ||
14 | unsigned int tR; /* ND_nWE high to ND_nRE low for read */ | ||
15 | unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */ | ||
16 | unsigned int tAR; /* ND_ALE low to ND_nRE low delay */ | ||
17 | }; | ||
18 | |||
19 | struct pxa3xx_nand_cmdset { | ||
20 | uint16_t read1; | ||
21 | uint16_t read2; | ||
22 | uint16_t program; | ||
23 | uint16_t read_status; | ||
24 | uint16_t read_id; | ||
25 | uint16_t erase; | ||
26 | uint16_t reset; | ||
27 | uint16_t lock; | ||
28 | uint16_t unlock; | ||
29 | uint16_t lock_status; | ||
30 | }; | ||
31 | |||
32 | struct pxa3xx_nand_flash { | ||
33 | char *name; | ||
34 | uint32_t chip_id; | ||
35 | unsigned int page_per_block; /* Pages per block (PG_PER_BLK) */ | ||
36 | unsigned int page_size; /* Page size in bytes (PAGE_SZ) */ | ||
37 | unsigned int flash_width; /* Width of Flash memory (DWIDTH_M) */ | ||
38 | unsigned int dfc_width; /* Width of flash controller(DWIDTH_C) */ | ||
39 | unsigned int num_blocks; /* Number of physical blocks in Flash */ | ||
40 | |||
41 | struct pxa3xx_nand_timing *timing; /* NAND Flash timing */ | ||
42 | }; | ||
43 | |||
44 | /* | ||
45 | * Current pxa3xx_nand controller has two chip select which | ||
46 | * both be workable. | ||
47 | * | ||
48 | * Notice should be taken that: | ||
49 | * When you want to use this feature, you should not enable the | ||
50 | * keep configuration feature, for two chip select could be | ||
51 | * attached with different nand chip. The different page size | ||
52 | * and timing requirement make the keep configuration impossible. | ||
53 | */ | ||
54 | |||
55 | /* The max num of chip select current support */ | ||
56 | #define NUM_CHIP_SELECT (2) | ||
57 | struct pxa3xx_nand_platform_data { | ||
58 | |||
59 | /* the data flash bus is shared between the Static Memory | ||
60 | * Controller and the Data Flash Controller, the arbiter | ||
61 | * controls the ownership of the bus | ||
62 | */ | ||
63 | int enable_arbiter; | ||
64 | |||
65 | /* allow platform code to keep OBM/bootloader defined NFC config */ | ||
66 | int keep_config; | ||
67 | |||
68 | /* indicate how many chip selects will be used */ | ||
69 | int num_cs; | ||
70 | |||
71 | const struct mtd_partition *parts[NUM_CHIP_SELECT]; | ||
72 | unsigned int nr_parts[NUM_CHIP_SELECT]; | ||
73 | |||
74 | const struct pxa3xx_nand_flash * flash; | ||
75 | size_t num_flash; | ||
76 | }; | ||
77 | |||
78 | extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info); | ||
79 | #endif /* __ASM_ARCH_PXA3XX_NAND_H */ | ||
diff --git a/include/linux/platform_data/mtd-nand-s3c2410.h b/include/linux/platform_data/mtd-nand-s3c2410.h new file mode 100644 index 000000000000..b64115fa93a4 --- /dev/null +++ b/include/linux/platform_data/mtd-nand-s3c2410.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/nand.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - NAND device controller platform_device info | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | /** | ||
14 | * struct s3c2410_nand_set - define a set of one or more nand chips | ||
15 | * @disable_ecc: Entirely disable ECC - Dangerous | ||
16 | * @flash_bbt: Openmoko u-boot can create a Bad Block Table | ||
17 | * Setting this flag will allow the kernel to | ||
18 | * look for it at boot time and also skip the NAND | ||
19 | * scan. | ||
20 | * @options: Default value to set into 'struct nand_chip' options. | ||
21 | * @nr_chips: Number of chips in this set | ||
22 | * @nr_partitions: Number of partitions pointed to by @partitions | ||
23 | * @name: Name of set (optional) | ||
24 | * @nr_map: Map for low-layer logical to physical chip numbers (option) | ||
25 | * @partitions: The mtd partition list | ||
26 | * | ||
27 | * define a set of one or more nand chips registered with an unique mtd. Also | ||
28 | * allows to pass flag to the underlying NAND layer. 'disable_ecc' will trigger | ||
29 | * a warning at boot time. | ||
30 | */ | ||
31 | struct s3c2410_nand_set { | ||
32 | unsigned int disable_ecc:1; | ||
33 | unsigned int flash_bbt:1; | ||
34 | |||
35 | unsigned int options; | ||
36 | int nr_chips; | ||
37 | int nr_partitions; | ||
38 | char *name; | ||
39 | int *nr_map; | ||
40 | struct mtd_partition *partitions; | ||
41 | struct nand_ecclayout *ecc_layout; | ||
42 | }; | ||
43 | |||
44 | struct s3c2410_platform_nand { | ||
45 | /* timing information for controller, all times in nanoseconds */ | ||
46 | |||
47 | int tacls; /* time for active CLE/ALE to nWE/nOE */ | ||
48 | int twrph0; /* active time for nWE/nOE */ | ||
49 | int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */ | ||
50 | |||
51 | unsigned int ignore_unset_ecc:1; | ||
52 | |||
53 | int nr_sets; | ||
54 | struct s3c2410_nand_set *sets; | ||
55 | |||
56 | void (*select_chip)(struct s3c2410_nand_set *, | ||
57 | int chip); | ||
58 | }; | ||
59 | |||
60 | /** | ||
61 | * s3c_nand_set_platdata() - register NAND platform data. | ||
62 | * @nand: The NAND platform data to register with s3c_device_nand. | ||
63 | * | ||
64 | * This function copies the given NAND platform data, @nand and registers | ||
65 | * it with the s3c_device_nand. This allows @nand to be __initdata. | ||
66 | */ | ||
67 | extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand); | ||
diff --git a/include/linux/platform_data/mtd-nomadik-nand.h b/include/linux/platform_data/mtd-nomadik-nand.h new file mode 100644 index 000000000000..c3c8254c22a5 --- /dev/null +++ b/include/linux/platform_data/mtd-nomadik-nand.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __ASM_ARCH_NAND_H | ||
2 | #define __ASM_ARCH_NAND_H | ||
3 | |||
4 | struct nomadik_nand_platform_data { | ||
5 | struct mtd_partition *parts; | ||
6 | int nparts; | ||
7 | int options; | ||
8 | int (*init) (void); | ||
9 | int (*exit) (void); | ||
10 | }; | ||
11 | |||
12 | #define NAND_IO_DATA 0x40000000 | ||
13 | #define NAND_IO_CMD 0x40800000 | ||
14 | #define NAND_IO_ADDR 0x41000000 | ||
15 | |||
16 | #endif /* __ASM_ARCH_NAND_H */ | ||
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h new file mode 100644 index 000000000000..2858667d2e4f --- /dev/null +++ b/include/linux/platform_data/mtd-onenand-omap2.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/onenand.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Nokia Corporation | ||
5 | * Author: Juha Yrjola | ||
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 | #include <linux/mtd/mtd.h> | ||
13 | #include <linux/mtd/partitions.h> | ||
14 | |||
15 | #define ONENAND_SYNC_READ (1 << 0) | ||
16 | #define ONENAND_SYNC_READWRITE (1 << 1) | ||
17 | |||
18 | struct onenand_freq_info { | ||
19 | u16 maf_id; | ||
20 | u16 dev_id; | ||
21 | u16 ver_id; | ||
22 | }; | ||
23 | |||
24 | struct omap_onenand_platform_data { | ||
25 | int cs; | ||
26 | int gpio_irq; | ||
27 | struct mtd_partition *parts; | ||
28 | int nr_parts; | ||
29 | int (*onenand_setup)(void __iomem *, int *freq_ptr); | ||
30 | int (*get_freq)(const struct onenand_freq_info *freq_info, | ||
31 | bool *clk_dep); | ||
32 | int dma_channel; | ||
33 | u8 flags; | ||
34 | u8 regulator_can_sleep; | ||
35 | u8 skip_initial_unlocking; | ||
36 | }; | ||
37 | |||
38 | #define ONENAND_MAX_PARTITIONS 8 | ||
39 | |||
40 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
41 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
42 | |||
43 | extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); | ||
44 | |||
45 | #else | ||
46 | |||
47 | #define board_onenand_data NULL | ||
48 | |||
49 | static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | #endif | ||
diff --git a/include/linux/platform_data/mtd-orion_nand.h b/include/linux/platform_data/mtd-orion_nand.h new file mode 100644 index 000000000000..9f3c180834d1 --- /dev/null +++ b/include/linux/platform_data/mtd-orion_nand.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/orion_nand.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __PLAT_ORION_NAND_H | ||
10 | #define __PLAT_ORION_NAND_H | ||
11 | |||
12 | /* | ||
13 | * Device bus NAND private data | ||
14 | */ | ||
15 | struct orion_nand_data { | ||
16 | struct mtd_partition *parts; | ||
17 | int (*dev_ready)(struct mtd_info *mtd); | ||
18 | u32 nr_parts; | ||
19 | u8 ale; /* address line number connected to ALE */ | ||
20 | u8 cle; /* address line number connected to CLE */ | ||
21 | u8 width; /* buswidth */ | ||
22 | u8 chip_delay; | ||
23 | }; | ||
24 | |||
25 | |||
26 | #endif | ||
diff --git a/include/linux/platform_data/omap1_bl.h b/include/linux/platform_data/omap1_bl.h new file mode 100644 index 000000000000..881a8e92d605 --- /dev/null +++ b/include/linux/platform_data/omap1_bl.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __OMAP1_BL_H__ | ||
2 | #define __OMAP1_BL_H__ | ||
3 | |||
4 | #include <linux/device.h> | ||
5 | |||
6 | struct omap_backlight_config { | ||
7 | int default_intensity; | ||
8 | int (*set_power)(struct device *dev, int state); | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/include/linux/platform_data/pcmcia-pxa2xx_viper.h b/include/linux/platform_data/pcmcia-pxa2xx_viper.h new file mode 100644 index 000000000000..d428be4db44c --- /dev/null +++ b/include/linux/platform_data/pcmcia-pxa2xx_viper.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __ARCOM_PCMCIA_H | ||
2 | #define __ARCOM_PCMCIA_H | ||
3 | |||
4 | struct arcom_pcmcia_pdata { | ||
5 | int cd_gpio; | ||
6 | int rdy_gpio; | ||
7 | int pwr_gpio; | ||
8 | void (*reset)(int state); | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h new file mode 100644 index 000000000000..30dea251b835 --- /dev/null +++ b/include/linux/platform_data/pinctrl-coh901.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 ST-Ericsson AB | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * GPIO block resgister definitions and inline macros for | ||
5 | * U300 GPIO COH 901 335 or COH 901 571/3 | ||
6 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_U300_GPIO_U300_H | ||
10 | #define __MACH_U300_GPIO_U300_H | ||
11 | |||
12 | /** | ||
13 | * struct u300_gpio_platform - U300 GPIO platform data | ||
14 | * @ports: number of GPIO block ports | ||
15 | * @gpio_base: first GPIO number for this block (use a free range) | ||
16 | * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) | ||
17 | * @pinctrl_device: pin control device to spawn as child | ||
18 | */ | ||
19 | struct u300_gpio_platform { | ||
20 | u8 ports; | ||
21 | int gpio_base; | ||
22 | int gpio_irq_base; | ||
23 | struct platform_device *pinctrl_device; | ||
24 | }; | ||
25 | |||
26 | #endif /* __MACH_U300_GPIO_U300_H */ | ||
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h new file mode 100644 index 000000000000..b10eac89e2e9 --- /dev/null +++ b/include/linux/platform_data/remoteproc-omap.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Remote Processor - omap-specific bits | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2011 Google, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * version 2 as published by the Free Software Foundation. | ||
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 | |||
17 | #ifndef _PLAT_REMOTEPROC_H | ||
18 | #define _PLAT_REMOTEPROC_H | ||
19 | |||
20 | struct rproc_ops; | ||
21 | struct platform_device; | ||
22 | |||
23 | /* | ||
24 | * struct omap_rproc_pdata - omap remoteproc's platform data | ||
25 | * @name: the remoteproc's name | ||
26 | * @oh_name: omap hwmod device | ||
27 | * @oh_name_opt: optional, secondary omap hwmod device | ||
28 | * @firmware: name of firmware file to load | ||
29 | * @mbox_name: name of omap mailbox device to use with this rproc | ||
30 | * @ops: start/stop rproc handlers | ||
31 | * @device_enable: omap-specific handler for enabling a device | ||
32 | * @device_shutdown: omap-specific handler for shutting down a device | ||
33 | */ | ||
34 | struct omap_rproc_pdata { | ||
35 | const char *name; | ||
36 | const char *oh_name; | ||
37 | const char *oh_name_opt; | ||
38 | const char *firmware; | ||
39 | const char *mbox_name; | ||
40 | const struct rproc_ops *ops; | ||
41 | int (*device_enable) (struct platform_device *pdev); | ||
42 | int (*device_shutdown) (struct platform_device *pdev); | ||
43 | }; | ||
44 | |||
45 | #if defined(CONFIG_OMAP_REMOTEPROC) || defined(CONFIG_OMAP_REMOTEPROC_MODULE) | ||
46 | |||
47 | void __init omap_rproc_reserve_cma(void); | ||
48 | |||
49 | #else | ||
50 | |||
51 | void __init omap_rproc_reserve_cma(void) | ||
52 | { | ||
53 | } | ||
54 | |||
55 | #endif | ||
56 | |||
57 | #endif /* _PLAT_REMOTEPROC_H */ | ||
diff --git a/include/linux/platform_data/sc18is602.h b/include/linux/platform_data/sc18is602.h new file mode 100644 index 000000000000..997b06634152 --- /dev/null +++ b/include/linux/platform_data/sc18is602.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Platform data for NXP SC18IS602/603 | ||
3 | * | ||
4 | * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net> | ||
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 | * For further information, see the Documentation/spi/sc18is602 file. | ||
11 | */ | ||
12 | |||
13 | /** | ||
14 | * struct sc18is602_platform_data - sc18is602 info | ||
15 | * @clock_frequency SC18IS603 oscillator frequency | ||
16 | */ | ||
17 | struct sc18is602_platform_data { | ||
18 | u32 clock_frequency; | ||
19 | }; | ||
diff --git a/include/linux/platform_data/sccnxp.h b/include/linux/platform_data/sccnxp.h new file mode 100644 index 000000000000..7311ccd3217f --- /dev/null +++ b/include/linux/platform_data/sccnxp.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * NXP (Philips) SCC+++(SCN+++) serial driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
5 | * | ||
6 | * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __SCCNXP_H | ||
15 | #define __SCCNXP_H | ||
16 | |||
17 | #define SCCNXP_MAX_UARTS 2 | ||
18 | |||
19 | /* Output lines */ | ||
20 | #define LINE_OP0 1 | ||
21 | #define LINE_OP1 2 | ||
22 | #define LINE_OP2 3 | ||
23 | #define LINE_OP3 4 | ||
24 | #define LINE_OP4 5 | ||
25 | #define LINE_OP5 6 | ||
26 | #define LINE_OP6 7 | ||
27 | #define LINE_OP7 8 | ||
28 | |||
29 | /* Input lines */ | ||
30 | #define LINE_IP0 9 | ||
31 | #define LINE_IP1 10 | ||
32 | #define LINE_IP2 11 | ||
33 | #define LINE_IP3 12 | ||
34 | #define LINE_IP4 13 | ||
35 | #define LINE_IP5 14 | ||
36 | #define LINE_IP6 15 | ||
37 | |||
38 | /* Signals */ | ||
39 | #define DTR_OP 0 /* DTR */ | ||
40 | #define RTS_OP 4 /* RTS */ | ||
41 | #define DSR_IP 8 /* DSR */ | ||
42 | #define CTS_IP 12 /* CTS */ | ||
43 | #define DCD_IP 16 /* DCD */ | ||
44 | #define RNG_IP 20 /* RNG */ | ||
45 | |||
46 | #define DIR_OP 24 /* Special signal for control RS-485. | ||
47 | * Goes high when transmit, | ||
48 | * then goes low. | ||
49 | */ | ||
50 | |||
51 | /* Routing control signal 'sig' to line 'line' */ | ||
52 | #define MCTRL_SIG(sig, line) ((line) << (sig)) | ||
53 | |||
54 | /* | ||
55 | * Example board initialization data: | ||
56 | * | ||
57 | * static struct resource sc2892_resources[] = { | ||
58 | * DEFINE_RES_MEM(UART_PHYS_START, 0x10), | ||
59 | * DEFINE_RES_IRQ(IRQ_EXT2), | ||
60 | * }; | ||
61 | * | ||
62 | * static struct sccnxp_pdata sc2892_info = { | ||
63 | * .frequency = 3686400, | ||
64 | * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), | ||
65 | * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), | ||
66 | * }; | ||
67 | * | ||
68 | * static struct platform_device sc2892 = { | ||
69 | * .name = "sc2892", | ||
70 | * .id = -1, | ||
71 | * .resource = sc2892_resources, | ||
72 | * .num_resources = ARRAY_SIZE(sc2892_resources), | ||
73 | * .dev = { | ||
74 | * .platform_data = &sc2892_info, | ||
75 | * }, | ||
76 | * }; | ||
77 | */ | ||
78 | |||
79 | /* SCCNXP platform data structure */ | ||
80 | struct sccnxp_pdata { | ||
81 | /* Frequency (extrenal clock or crystal) */ | ||
82 | int frequency; | ||
83 | /* Shift for A0 line */ | ||
84 | const u8 reg_shift; | ||
85 | /* Modem control lines configuration */ | ||
86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; | ||
87 | /* Called during startup */ | ||
88 | void (*init)(void); | ||
89 | /* Called before finish */ | ||
90 | void (*exit)(void); | ||
91 | }; | ||
92 | |||
93 | #endif | ||
diff --git a/include/linux/platform_data/serial-imx.h b/include/linux/platform_data/serial-imx.h new file mode 100644 index 000000000000..4adec9b154dd --- /dev/null +++ b/include/linux/platform_data/serial-imx.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
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 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
16 | * MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef ASMARM_ARCH_UART_H | ||
20 | #define ASMARM_ARCH_UART_H | ||
21 | |||
22 | #define IMXUART_HAVE_RTSCTS (1<<0) | ||
23 | #define IMXUART_IRDA (1<<1) | ||
24 | |||
25 | struct imxuart_platform_data { | ||
26 | int (*init)(struct platform_device *pdev); | ||
27 | void (*exit)(struct platform_device *pdev); | ||
28 | unsigned int flags; | ||
29 | void (*irda_enable)(int enable); | ||
30 | unsigned int irda_inv_rx:1; | ||
31 | unsigned int irda_inv_tx:1; | ||
32 | unsigned short transceiver_delay; | ||
33 | }; | ||
34 | |||
35 | #endif | ||
diff --git a/include/linux/sht15.h b/include/linux/platform_data/sht15.h index f85c7c523da0..33e0fd27225e 100644 --- a/include/linux/sht15.h +++ b/include/linux/platform_data/sht15.h | |||
@@ -31,4 +31,3 @@ struct sht15_platform_data { | |||
31 | bool no_otp_reload; | 31 | bool no_otp_reload; |
32 | bool low_resolution; | 32 | bool low_resolution; |
33 | }; | 33 | }; |
34 | |||
diff --git a/include/linux/platform_data/spi-davinci.h b/include/linux/platform_data/spi-davinci.h new file mode 100644 index 000000000000..7af305b37868 --- /dev/null +++ b/include/linux/platform_data/spi-davinci.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * Copyright 2009 Texas Instruments. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H | ||
20 | #define __ARCH_ARM_DAVINCI_SPI_H | ||
21 | |||
22 | #include <mach/edma.h> | ||
23 | |||
24 | #define SPI_INTERN_CS 0xFF | ||
25 | |||
26 | enum { | ||
27 | SPI_VERSION_1, /* For DM355/DM365/DM6467 */ | ||
28 | SPI_VERSION_2, /* For DA8xx */ | ||
29 | }; | ||
30 | |||
31 | /** | ||
32 | * davinci_spi_platform_data - Platform data for SPI master device on DaVinci | ||
33 | * | ||
34 | * @version: version of the SPI IP. Different DaVinci devices have slightly | ||
35 | * varying versions of the same IP. | ||
36 | * @num_chipselect: number of chipselects supported by this SPI master | ||
37 | * @intr_line: interrupt line used to connect the SPI IP to the ARM interrupt | ||
38 | * controller withn the SoC. Possible values are 0 and 1. | ||
39 | * @chip_sel: list of GPIOs which can act as chip-selects for the SPI. | ||
40 | * SPI_INTERN_CS denotes internal SPI chip-select. Not necessary | ||
41 | * to populate if all chip-selects are internal. | ||
42 | * @cshold_bug: set this to true if the SPI controller on your chip requires | ||
43 | * a write to CSHOLD bit in between transfers (like in DM355). | ||
44 | * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any | ||
45 | * device on the bus. | ||
46 | */ | ||
47 | struct davinci_spi_platform_data { | ||
48 | u8 version; | ||
49 | u8 num_chipselect; | ||
50 | u8 intr_line; | ||
51 | u8 *chip_sel; | ||
52 | bool cshold_bug; | ||
53 | enum dma_event_q dma_event_q; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * davinci_spi_config - Per-chip-select configuration for SPI slave devices | ||
58 | * | ||
59 | * @wdelay: amount of delay between transmissions. Measured in number of | ||
60 | * SPI module clocks. | ||
61 | * @odd_parity: polarity of parity flag at the end of transmit data stream. | ||
62 | * 0 - odd parity, 1 - even parity. | ||
63 | * @parity_enable: enable transmission of parity at end of each transmit | ||
64 | * data stream. | ||
65 | * @io_type: type of IO transfer. Choose between polled, interrupt and DMA. | ||
66 | * @timer_disable: disable chip-select timers (setup and hold) | ||
67 | * @c2tdelay: chip-select setup time. Measured in number of SPI module clocks. | ||
68 | * @t2cdelay: chip-select hold time. Measured in number of SPI module clocks. | ||
69 | * @t2edelay: transmit data finished to SPI ENAn pin inactive time. Measured | ||
70 | * in number of SPI clocks. | ||
71 | * @c2edelay: chip-select active to SPI ENAn signal active time. Measured in | ||
72 | * number of SPI clocks. | ||
73 | */ | ||
74 | struct davinci_spi_config { | ||
75 | u8 wdelay; | ||
76 | u8 odd_parity; | ||
77 | u8 parity_enable; | ||
78 | #define SPI_IO_TYPE_INTR 0 | ||
79 | #define SPI_IO_TYPE_POLL 1 | ||
80 | #define SPI_IO_TYPE_DMA 2 | ||
81 | u8 io_type; | ||
82 | u8 timer_disable; | ||
83 | u8 c2tdelay; | ||
84 | u8 t2cdelay; | ||
85 | u8 t2edelay; | ||
86 | u8 c2edelay; | ||
87 | }; | ||
88 | |||
89 | #endif /* __ARCH_ARM_DAVINCI_SPI_H */ | ||
diff --git a/include/linux/platform_data/spi-ep93xx.h b/include/linux/platform_data/spi-ep93xx.h new file mode 100644 index 000000000000..9bb63ac13f04 --- /dev/null +++ b/include/linux/platform_data/spi-ep93xx.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #ifndef __ASM_MACH_EP93XX_SPI_H | ||
2 | #define __ASM_MACH_EP93XX_SPI_H | ||
3 | |||
4 | struct spi_device; | ||
5 | |||
6 | /** | ||
7 | * struct ep93xx_spi_info - EP93xx specific SPI descriptor | ||
8 | * @num_chipselect: number of chip selects on this board, must be | ||
9 | * at least one | ||
10 | * @use_dma: use DMA for the transfers | ||
11 | */ | ||
12 | struct ep93xx_spi_info { | ||
13 | int num_chipselect; | ||
14 | bool use_dma; | ||
15 | }; | ||
16 | |||
17 | /** | ||
18 | * struct ep93xx_spi_chip_ops - operation callbacks for SPI slave device | ||
19 | * @setup: setup the chip select mechanism | ||
20 | * @cleanup: cleanup the chip select mechanism | ||
21 | * @cs_control: control the device chip select | ||
22 | */ | ||
23 | struct ep93xx_spi_chip_ops { | ||
24 | int (*setup)(struct spi_device *spi); | ||
25 | void (*cleanup)(struct spi_device *spi); | ||
26 | void (*cs_control)(struct spi_device *spi, int value); | ||
27 | }; | ||
28 | |||
29 | #endif /* __ASM_MACH_EP93XX_SPI_H */ | ||
diff --git a/include/linux/platform_data/spi-imx.h b/include/linux/platform_data/spi-imx.h new file mode 100644 index 000000000000..08be445e8eb8 --- /dev/null +++ b/include/linux/platform_data/spi-imx.h | |||
@@ -0,0 +1,27 @@ | |||
1 | |||
2 | #ifndef __MACH_SPI_H_ | ||
3 | #define __MACH_SPI_H_ | ||
4 | |||
5 | /* | ||
6 | * struct spi_imx_master - device.platform_data for SPI controller devices. | ||
7 | * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio | ||
8 | * pins, numbers < 0 mean internal CSPI chipselects according | ||
9 | * to MXC_SPI_CS(). Normally you want to use gpio based chip | ||
10 | * selects as the CSPI module tries to be intelligent about | ||
11 | * when to assert the chipselect: The CSPI module deasserts the | ||
12 | * chipselect once it runs out of input data. The other problem | ||
13 | * is that it is not possible to mix between high active and low | ||
14 | * active chipselects on one single bus using the internal | ||
15 | * chipselects. Unfortunately Freescale decided to put some | ||
16 | * chipselects on dedicated pins which are not usable as gpios, | ||
17 | * so we have to support the internal chipselects. | ||
18 | * @num_chipselect: ARRAY_SIZE(chipselect) | ||
19 | */ | ||
20 | struct spi_imx_master { | ||
21 | int *chipselect; | ||
22 | int num_chipselect; | ||
23 | }; | ||
24 | |||
25 | #define MXC_SPI_CS(no) ((no) - 32) | ||
26 | |||
27 | #endif /* __MACH_SPI_H_*/ | ||
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h new file mode 100644 index 000000000000..2c4e0c128501 --- /dev/null +++ b/include/linux/platform_data/spi-nuc900.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-w90x900/include/mach/nuc900_spi.h | ||
3 | * | ||
4 | * Copyright (c) 2009 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation;version 2 of the License. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_SPI_H | ||
15 | #define __ASM_ARCH_SPI_H | ||
16 | |||
17 | extern void mfp_set_groupg(struct device *dev, const char *subname); | ||
18 | |||
19 | struct nuc900_spi_info { | ||
20 | unsigned int num_cs; | ||
21 | unsigned int lsb; | ||
22 | unsigned int txneg; | ||
23 | unsigned int rxneg; | ||
24 | unsigned int divider; | ||
25 | unsigned int sleep; | ||
26 | unsigned int txnum; | ||
27 | unsigned int txbitlen; | ||
28 | int bus_num; | ||
29 | }; | ||
30 | |||
31 | struct nuc900_spi_chip { | ||
32 | unsigned char bits_per_word; | ||
33 | }; | ||
34 | |||
35 | #endif /* __ASM_ARCH_SPI_H */ | ||
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h new file mode 100644 index 000000000000..a357eb26bd25 --- /dev/null +++ b/include/linux/platform_data/spi-omap2-mcspi.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _OMAP2_MCSPI_H | ||
2 | #define _OMAP2_MCSPI_H | ||
3 | |||
4 | #define OMAP2_MCSPI_REV 0 | ||
5 | #define OMAP3_MCSPI_REV 1 | ||
6 | #define OMAP4_MCSPI_REV 2 | ||
7 | |||
8 | #define OMAP4_MCSPI_REG_OFFSET 0x100 | ||
9 | |||
10 | struct omap2_mcspi_platform_config { | ||
11 | unsigned short num_cs; | ||
12 | unsigned int regs_offset; | ||
13 | }; | ||
14 | |||
15 | struct omap2_mcspi_dev_attr { | ||
16 | unsigned short num_chipselect; | ||
17 | }; | ||
18 | |||
19 | struct omap2_mcspi_device_config { | ||
20 | unsigned turbo_mode:1; | ||
21 | }; | ||
22 | |||
23 | #endif | ||
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h new file mode 100644 index 000000000000..ceba18d23a5a --- /dev/null +++ b/include/linux/platform_data/spi-s3c64xx.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h | ||
2 | * | ||
3 | * Copyright (C) 2009 Samsung Electronics Ltd. | ||
4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
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 __S3C64XX_PLAT_SPI_H | ||
12 | #define __S3C64XX_PLAT_SPI_H | ||
13 | |||
14 | struct platform_device; | ||
15 | |||
16 | /** | ||
17 | * struct s3c64xx_spi_csinfo - ChipSelect description | ||
18 | * @fb_delay: Slave specific feedback delay. | ||
19 | * Refer to FB_CLK_SEL register definition in SPI chapter. | ||
20 | * @line: Custom 'identity' of the CS line. | ||
21 | * | ||
22 | * This is per SPI-Slave Chipselect information. | ||
23 | * Allocate and initialize one in machine init code and make the | ||
24 | * spi_board_info.controller_data point to it. | ||
25 | */ | ||
26 | struct s3c64xx_spi_csinfo { | ||
27 | u8 fb_delay; | ||
28 | unsigned line; | ||
29 | }; | ||
30 | |||
31 | /** | ||
32 | * struct s3c64xx_spi_info - SPI Controller defining structure | ||
33 | * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field. | ||
34 | * @num_cs: Number of CS this controller emulates. | ||
35 | * @cfg_gpio: Configure pins for this SPI controller. | ||
36 | */ | ||
37 | struct s3c64xx_spi_info { | ||
38 | int src_clk_nr; | ||
39 | int num_cs; | ||
40 | int (*cfg_gpio)(void); | ||
41 | }; | ||
42 | |||
43 | /** | ||
44 | * s3c64xx_spi_set_platdata - SPI Controller configure callback by the board | ||
45 | * initialization code. | ||
46 | * @cfg_gpio: Pointer to gpio setup function. | ||
47 | * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks. | ||
48 | * @num_cs: Number of elements in the 'cs' array. | ||
49 | * | ||
50 | * Call this from machine init code for each SPI Controller that | ||
51 | * has some chips attached to it. | ||
52 | */ | ||
53 | extern void s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, | ||
54 | int num_cs); | ||
55 | extern void s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, | ||
56 | int num_cs); | ||
57 | extern void s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr, | ||
58 | int num_cs); | ||
59 | |||
60 | /* defined by architecture to configure gpio */ | ||
61 | extern int s3c64xx_spi0_cfg_gpio(void); | ||
62 | extern int s3c64xx_spi1_cfg_gpio(void); | ||
63 | extern int s3c64xx_spi2_cfg_gpio(void); | ||
64 | |||
65 | extern struct s3c64xx_spi_info s3c64xx_spi0_pdata; | ||
66 | extern struct s3c64xx_spi_info s3c64xx_spi1_pdata; | ||
67 | extern struct s3c64xx_spi_info s3c64xx_spi2_pdata; | ||
68 | #endif /* __S3C64XX_PLAT_SPI_H */ | ||
diff --git a/include/linux/platform_data/touchscreen-s3c2410.h b/include/linux/platform_data/touchscreen-s3c2410.h new file mode 100644 index 000000000000..26fdb22e0fc2 --- /dev/null +++ b/include/linux/platform_data/touchscreen-s3c2410.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/ts.h | ||
2 | * | ||
3 | * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARM_TS_H | ||
11 | #define __ASM_ARM_TS_H | ||
12 | |||
13 | struct s3c2410_ts_mach_info { | ||
14 | int delay; | ||
15 | int presc; | ||
16 | int oversampling_shift; | ||
17 | void (*cfg_gpio)(struct platform_device *dev); | ||
18 | }; | ||
19 | |||
20 | extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *); | ||
21 | |||
22 | /* defined by architecture to configure gpio */ | ||
23 | extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev); | ||
24 | |||
25 | #endif /* __ASM_ARM_TS_H */ | ||
diff --git a/include/linux/platform_data/usb-davinci.h b/include/linux/platform_data/usb-davinci.h new file mode 100644 index 000000000000..e0bc4abe69c2 --- /dev/null +++ b/include/linux/platform_data/usb-davinci.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * USB related definitions | ||
3 | * | ||
4 | * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_USB_H | ||
12 | #define __ASM_ARCH_USB_H | ||
13 | |||
14 | /* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ | ||
15 | #define CFGCHIP2_PHYCLKGD (1 << 17) | ||
16 | #define CFGCHIP2_VBUSSENSE (1 << 16) | ||
17 | #define CFGCHIP2_RESET (1 << 15) | ||
18 | #define CFGCHIP2_OTGMODE (3 << 13) | ||
19 | #define CFGCHIP2_NO_OVERRIDE (0 << 13) | ||
20 | #define CFGCHIP2_FORCE_HOST (1 << 13) | ||
21 | #define CFGCHIP2_FORCE_DEVICE (2 << 13) | ||
22 | #define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13) | ||
23 | #define CFGCHIP2_USB1PHYCLKMUX (1 << 12) | ||
24 | #define CFGCHIP2_USB2PHYCLKMUX (1 << 11) | ||
25 | #define CFGCHIP2_PHYPWRDN (1 << 10) | ||
26 | #define CFGCHIP2_OTGPWRDN (1 << 9) | ||
27 | #define CFGCHIP2_DATPOL (1 << 8) | ||
28 | #define CFGCHIP2_USB1SUSPENDM (1 << 7) | ||
29 | #define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */ | ||
30 | #define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */ | ||
31 | #define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */ | ||
32 | #define CFGCHIP2_REFFREQ (0xf << 0) | ||
33 | #define CFGCHIP2_REFFREQ_12MHZ (1 << 0) | ||
34 | #define CFGCHIP2_REFFREQ_24MHZ (2 << 0) | ||
35 | #define CFGCHIP2_REFFREQ_48MHZ (3 << 0) | ||
36 | |||
37 | struct da8xx_ohci_root_hub; | ||
38 | |||
39 | typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub, | ||
40 | unsigned port); | ||
41 | |||
42 | /* Passed as the platform data to the OHCI driver */ | ||
43 | struct da8xx_ohci_root_hub { | ||
44 | /* Switch the port power on/off */ | ||
45 | int (*set_power)(unsigned port, int on); | ||
46 | /* Read the port power status */ | ||
47 | int (*get_power)(unsigned port); | ||
48 | /* Read the port over-current indicator */ | ||
49 | int (*get_oci)(unsigned port); | ||
50 | /* Over-current indicator change notification (pass NULL to disable) */ | ||
51 | int (*ocic_notify)(da8xx_ocic_handler_t handler); | ||
52 | |||
53 | /* Time from power on to power good (in 2 ms units) */ | ||
54 | u8 potpgt; | ||
55 | }; | ||
56 | |||
57 | void davinci_setup_usb(unsigned mA, unsigned potpgt_ms); | ||
58 | |||
59 | #endif /* ifndef __ASM_ARCH_USB_H */ | ||
diff --git a/include/linux/platform_data/usb-ehci-mxc.h b/include/linux/platform_data/usb-ehci-mxc.h new file mode 100644 index 000000000000..7eb9d1329671 --- /dev/null +++ b/include/linux/platform_data/usb-ehci-mxc.h | |||
@@ -0,0 +1,59 @@ | |||
1 | #ifndef __INCLUDE_ASM_ARCH_MXC_EHCI_H | ||
2 | #define __INCLUDE_ASM_ARCH_MXC_EHCI_H | ||
3 | |||
4 | /* values for portsc field */ | ||
5 | #define MXC_EHCI_PHY_LOW_POWER_SUSPEND (1 << 23) | ||
6 | #define MXC_EHCI_FORCE_FS (1 << 24) | ||
7 | #define MXC_EHCI_UTMI_8BIT (0 << 28) | ||
8 | #define MXC_EHCI_UTMI_16BIT (1 << 28) | ||
9 | #define MXC_EHCI_SERIAL (1 << 29) | ||
10 | #define MXC_EHCI_MODE_UTMI (0 << 30) | ||
11 | #define MXC_EHCI_MODE_PHILIPS (1 << 30) | ||
12 | #define MXC_EHCI_MODE_ULPI (2 << 30) | ||
13 | #define MXC_EHCI_MODE_SERIAL (3 << 30) | ||
14 | |||
15 | /* values for flags field */ | ||
16 | #define MXC_EHCI_INTERFACE_DIFF_UNI (0 << 0) | ||
17 | #define MXC_EHCI_INTERFACE_DIFF_BI (1 << 0) | ||
18 | #define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0) | ||
19 | #define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0) | ||
20 | #define MXC_EHCI_INTERFACE_MASK (0xf) | ||
21 | |||
22 | #define MXC_EHCI_POWER_PINS_ENABLED (1 << 5) | ||
23 | #define MXC_EHCI_PWR_PIN_ACTIVE_HIGH (1 << 6) | ||
24 | #define MXC_EHCI_OC_PIN_ACTIVE_LOW (1 << 7) | ||
25 | #define MXC_EHCI_TTL_ENABLED (1 << 8) | ||
26 | |||
27 | #define MXC_EHCI_INTERNAL_PHY (1 << 9) | ||
28 | #define MXC_EHCI_IPPUE_DOWN (1 << 10) | ||
29 | #define MXC_EHCI_IPPUE_UP (1 << 11) | ||
30 | #define MXC_EHCI_WAKEUP_ENABLED (1 << 12) | ||
31 | #define MXC_EHCI_ITC_NO_THRESHOLD (1 << 13) | ||
32 | |||
33 | #define MXC_USBCTRL_OFFSET 0 | ||
34 | #define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8 | ||
35 | #define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc | ||
36 | #define MXC_USBH2CTRL_OFFSET 0x14 | ||
37 | |||
38 | #define MX5_USBOTHER_REGS_OFFSET 0x800 | ||
39 | |||
40 | /* USB_PHY_CTRL_FUNC2*/ | ||
41 | #define MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK 0x3 | ||
42 | #define MX5_USB_UTMI_PHYCTRL1_PLLDIV_SHIFT 0 | ||
43 | |||
44 | struct mxc_usbh_platform_data { | ||
45 | int (*init)(struct platform_device *pdev); | ||
46 | int (*exit)(struct platform_device *pdev); | ||
47 | |||
48 | unsigned int portsc; | ||
49 | struct usb_phy *otg; | ||
50 | }; | ||
51 | |||
52 | int mx51_initialize_usb_hw(int port, unsigned int flags); | ||
53 | int mx25_initialize_usb_hw(int port, unsigned int flags); | ||
54 | int mx31_initialize_usb_hw(int port, unsigned int flags); | ||
55 | int mx35_initialize_usb_hw(int port, unsigned int flags); | ||
56 | int mx27_initialize_usb_hw(int port, unsigned int flags); | ||
57 | |||
58 | #endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */ | ||
59 | |||
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h new file mode 100644 index 000000000000..6fc78e430420 --- /dev/null +++ b/include/linux/platform_data/usb-ehci-orion.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-orion/include/plat/ehci-orion.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __PLAT_EHCI_ORION_H | ||
10 | #define __PLAT_EHCI_ORION_H | ||
11 | |||
12 | #include <linux/mbus.h> | ||
13 | |||
14 | enum orion_ehci_phy_ver { | ||
15 | EHCI_PHY_ORION, | ||
16 | EHCI_PHY_DD, | ||
17 | EHCI_PHY_KW, | ||
18 | EHCI_PHY_NA, | ||
19 | }; | ||
20 | |||
21 | struct orion_ehci_data { | ||
22 | enum orion_ehci_phy_ver phy_version; | ||
23 | }; | ||
24 | |||
25 | |||
26 | #endif | ||
diff --git a/include/linux/platform_data/usb-ehci-s5p.h b/include/linux/platform_data/usb-ehci-s5p.h new file mode 100644 index 000000000000..5f28cae18582 --- /dev/null +++ b/include/linux/platform_data/usb-ehci-s5p.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.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 as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __PLAT_SAMSUNG_EHCI_H | ||
12 | #define __PLAT_SAMSUNG_EHCI_H __FILE__ | ||
13 | |||
14 | struct s5p_ehci_platdata { | ||
15 | int (*phy_init)(struct platform_device *pdev, int type); | ||
16 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
17 | }; | ||
18 | |||
19 | extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); | ||
20 | |||
21 | #endif /* __PLAT_SAMSUNG_EHCI_H */ | ||
diff --git a/include/linux/platform_data/usb-exynos.h b/include/linux/platform_data/usb-exynos.h new file mode 100644 index 000000000000..c256c595be5e --- /dev/null +++ b/include/linux/platform_data/usb-exynos.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * http://www.samsung.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 as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_EXYNOS_OHCI_H | ||
12 | #define __MACH_EXYNOS_OHCI_H | ||
13 | |||
14 | struct exynos4_ohci_platdata { | ||
15 | int (*phy_init)(struct platform_device *pdev, int type); | ||
16 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
17 | }; | ||
18 | |||
19 | extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd); | ||
20 | |||
21 | #endif /* __MACH_EXYNOS_OHCI_H */ | ||
diff --git a/include/linux/platform_data/usb-imx_udc.h b/include/linux/platform_data/usb-imx_udc.h new file mode 100644 index 000000000000..be273371f34a --- /dev/null +++ b/include/linux/platform_data/usb-imx_udc.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_MXC_USB | ||
16 | #define __ASM_ARCH_MXC_USB | ||
17 | |||
18 | struct imxusb_platform_data { | ||
19 | int (*init)(struct device *); | ||
20 | void (*exit)(struct device *); | ||
21 | }; | ||
22 | |||
23 | #endif /* __ASM_ARCH_MXC_USB */ | ||
diff --git a/include/linux/platform_data/usb-musb-ux500.h b/include/linux/platform_data/usb-musb-ux500.h new file mode 100644 index 000000000000..4c1cc50a595a --- /dev/null +++ b/include/linux/platform_data/usb-musb-ux500.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2011 | ||
3 | * | ||
4 | * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | #ifndef __ASM_ARCH_USB_H | ||
8 | #define __ASM_ARCH_USB_H | ||
9 | |||
10 | #include <linux/dmaengine.h> | ||
11 | |||
12 | #define UX500_MUSB_DMA_NUM_RX_CHANNELS 8 | ||
13 | #define UX500_MUSB_DMA_NUM_TX_CHANNELS 8 | ||
14 | |||
15 | struct ux500_musb_board_data { | ||
16 | void **dma_rx_param_array; | ||
17 | void **dma_tx_param_array; | ||
18 | u32 num_rx_channels; | ||
19 | u32 num_tx_channels; | ||
20 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
21 | }; | ||
22 | |||
23 | void ux500_add_usb(struct device *parent, resource_size_t base, | ||
24 | int irq, int *dma_rx_cfg, int *dma_tx_cfg); | ||
25 | #endif | ||
diff --git a/include/linux/platform_data/usb-mx2.h b/include/linux/platform_data/usb-mx2.h new file mode 100644 index 000000000000..22d0b596262c --- /dev/null +++ b/include/linux/platform_data/usb-mx2.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Martin Fuzzey <mfuzzey@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_ARCH_MX21_USBH | ||
16 | #define __ASM_ARCH_MX21_USBH | ||
17 | |||
18 | enum mx21_usbh_xcvr { | ||
19 | /* Values below as used by hardware (HWMODE register) */ | ||
20 | MX21_USBXCVR_TXDIF_RXDIF = 0, | ||
21 | MX21_USBXCVR_TXDIF_RXSE = 1, | ||
22 | MX21_USBXCVR_TXSE_RXDIF = 2, | ||
23 | MX21_USBXCVR_TXSE_RXSE = 3, | ||
24 | }; | ||
25 | |||
26 | struct mx21_usbh_platform_data { | ||
27 | enum mx21_usbh_xcvr host_xcvr; /* tranceiver mode host 1,2 ports */ | ||
28 | enum mx21_usbh_xcvr otg_xcvr; /* tranceiver mode otg (as host) port */ | ||
29 | u16 enable_host1:1, | ||
30 | enable_host2:1, | ||
31 | enable_otg_host:1, /* enable "OTG" port (as host) */ | ||
32 | host1_xcverless:1, /* traceiverless host1 port */ | ||
33 | host1_txenoe:1, /* output enable host1 transmit enable */ | ||
34 | otg_ext_xcvr:1, /* external tranceiver for OTG port */ | ||
35 | unused:10; | ||
36 | }; | ||
37 | |||
38 | #endif /* __ASM_ARCH_MX21_USBH */ | ||
diff --git a/include/linux/platform_data/usb-ohci-pxa27x.h b/include/linux/platform_data/usb-ohci-pxa27x.h new file mode 100644 index 000000000000..95b6e2a6e514 --- /dev/null +++ b/include/linux/platform_data/usb-ohci-pxa27x.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef ASMARM_ARCH_OHCI_H | ||
2 | #define ASMARM_ARCH_OHCI_H | ||
3 | |||
4 | struct device; | ||
5 | |||
6 | struct pxaohci_platform_data { | ||
7 | int (*init)(struct device *); | ||
8 | void (*exit)(struct device *); | ||
9 | |||
10 | unsigned long flags; | ||
11 | #define ENABLE_PORT1 (1 << 0) | ||
12 | #define ENABLE_PORT2 (1 << 1) | ||
13 | #define ENABLE_PORT3 (1 << 2) | ||
14 | #define ENABLE_PORT_ALL (ENABLE_PORT1 | ENABLE_PORT2 | ENABLE_PORT3) | ||
15 | |||
16 | #define POWER_SENSE_LOW (1 << 3) | ||
17 | #define POWER_CONTROL_LOW (1 << 4) | ||
18 | #define NO_OC_PROTECTION (1 << 5) | ||
19 | #define OC_MODE_GLOBAL (0 << 6) | ||
20 | #define OC_MODE_PERPORT (1 << 6) | ||
21 | |||
22 | int power_on_delay; /* Power On to Power Good time - in ms | ||
23 | * HCD must wait for this duration before | ||
24 | * accessing a powered on port | ||
25 | */ | ||
26 | int port_mode; | ||
27 | #define PMM_NPS_MODE 1 | ||
28 | #define PMM_GLOBAL_MODE 2 | ||
29 | #define PMM_PERPORT_MODE 3 | ||
30 | |||
31 | int power_budget; | ||
32 | }; | ||
33 | |||
34 | extern void pxa_set_ohci_info(struct pxaohci_platform_data *info); | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/platform_data/usb-ohci-s3c2410.h b/include/linux/platform_data/usb-ohci-s3c2410.h new file mode 100644 index 000000000000..7fa1fbefc3f2 --- /dev/null +++ b/include/linux/platform_data/usb-ohci-s3c2410.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/usb-control.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C - USB host port information | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_USBCONTROL_H | ||
14 | #define __ASM_ARCH_USBCONTROL_H | ||
15 | |||
16 | #define S3C_HCDFLG_USED (1) | ||
17 | |||
18 | struct s3c2410_hcd_port { | ||
19 | unsigned char flags; | ||
20 | unsigned char power; | ||
21 | unsigned char oc_status; | ||
22 | unsigned char oc_changed; | ||
23 | }; | ||
24 | |||
25 | struct s3c2410_hcd_info { | ||
26 | struct usb_hcd *hcd; | ||
27 | struct s3c2410_hcd_port port[2]; | ||
28 | |||
29 | void (*power_control)(int port, int to); | ||
30 | void (*enable_oc)(struct s3c2410_hcd_info *, int on); | ||
31 | void (*report_oc)(struct s3c2410_hcd_info *, int ports); | ||
32 | }; | ||
33 | |||
34 | static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports) | ||
35 | { | ||
36 | if (info->report_oc != NULL) { | ||
37 | (info->report_oc)(info, ports); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | extern void s3c_ohci_set_platdata(struct s3c2410_hcd_info *info); | ||
42 | |||
43 | #endif /*__ASM_ARCH_USBCONTROL_H */ | ||
diff --git a/include/linux/platform_data/usb-pxa3xx-ulpi.h b/include/linux/platform_data/usb-pxa3xx-ulpi.h new file mode 100644 index 000000000000..9d82cb65ea56 --- /dev/null +++ b/include/linux/platform_data/usb-pxa3xx-ulpi.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * PXA3xx U2D header | ||
3 | * | ||
4 | * Copyright (C) 2010 CompuLab Ltd. | ||
5 | * | ||
6 | * Igor Grinberg <grinberg@compulab.co.il> | ||
7 | * | ||
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 | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #ifndef __PXA310_U2D__ | ||
13 | #define __PXA310_U2D__ | ||
14 | |||
15 | #include <linux/usb/ulpi.h> | ||
16 | |||
17 | struct pxa3xx_u2d_platform_data { | ||
18 | |||
19 | #define ULPI_SER_6PIN (1 << 0) | ||
20 | #define ULPI_SER_3PIN (1 << 1) | ||
21 | unsigned int ulpi_mode; | ||
22 | |||
23 | int (*init)(struct device *); | ||
24 | void (*exit)(struct device *); | ||
25 | }; | ||
26 | |||
27 | |||
28 | /* Start PXA3xx U2D host */ | ||
29 | int pxa3xx_u2d_start_hc(struct usb_bus *host); | ||
30 | /* Stop PXA3xx U2D host */ | ||
31 | void pxa3xx_u2d_stop_hc(struct usb_bus *host); | ||
32 | |||
33 | extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info); | ||
34 | |||
35 | #endif /* __PXA310_U2D__ */ | ||
diff --git a/include/linux/platform_data/usb-s3c2410_udc.h b/include/linux/platform_data/usb-s3c2410_udc.h new file mode 100644 index 000000000000..de8e2288a509 --- /dev/null +++ b/include/linux/platform_data/usb-s3c2410_udc.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/udc.h | ||
2 | * | ||
3 | * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
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 | * Changelog: | ||
12 | * 14-Mar-2005 RTP Created file | ||
13 | * 02-Aug-2005 RTP File rename | ||
14 | * 07-Sep-2005 BJD Minor cleanups, changed cmd to enum | ||
15 | * 18-Jan-2007 HMW Add per-platform vbus_draw function | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARM_ARCH_UDC_H | ||
19 | #define __ASM_ARM_ARCH_UDC_H | ||
20 | |||
21 | enum s3c2410_udc_cmd_e { | ||
22 | S3C2410_UDC_P_ENABLE = 1, /* Pull-up enable */ | ||
23 | S3C2410_UDC_P_DISABLE = 2, /* Pull-up disable */ | ||
24 | S3C2410_UDC_P_RESET = 3, /* UDC reset, in case of */ | ||
25 | }; | ||
26 | |||
27 | struct s3c2410_udc_mach_info { | ||
28 | void (*udc_command)(enum s3c2410_udc_cmd_e); | ||
29 | void (*vbus_draw)(unsigned int ma); | ||
30 | |||
31 | unsigned int pullup_pin; | ||
32 | unsigned int pullup_pin_inverted; | ||
33 | |||
34 | unsigned int vbus_pin; | ||
35 | unsigned char vbus_pin_inverted; | ||
36 | }; | ||
37 | |||
38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); | ||
39 | |||
40 | struct s3c24xx_hsudc_platdata; | ||
41 | |||
42 | extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd); | ||
43 | |||
44 | #endif /* __ASM_ARM_ARCH_UDC_H */ | ||
diff --git a/include/linux/platform_data/video-ep93xx.h b/include/linux/platform_data/video-ep93xx.h new file mode 100644 index 000000000000..d5ae11d7c453 --- /dev/null +++ b/include/linux/platform_data/video-ep93xx.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/include/mach/fb.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ARCH_EP93XXFB_H | ||
6 | #define __ASM_ARCH_EP93XXFB_H | ||
7 | |||
8 | struct platform_device; | ||
9 | struct fb_videomode; | ||
10 | struct fb_info; | ||
11 | |||
12 | #define EP93XXFB_USE_MODEDB 0 | ||
13 | |||
14 | /* VideoAttributes flags */ | ||
15 | #define EP93XXFB_STATE_MACHINE_ENABLE (1 << 0) | ||
16 | #define EP93XXFB_PIXEL_CLOCK_ENABLE (1 << 1) | ||
17 | #define EP93XXFB_VSYNC_ENABLE (1 << 2) | ||
18 | #define EP93XXFB_PIXEL_DATA_ENABLE (1 << 3) | ||
19 | #define EP93XXFB_COMPOSITE_SYNC (1 << 4) | ||
20 | #define EP93XXFB_SYNC_VERT_HIGH (1 << 5) | ||
21 | #define EP93XXFB_SYNC_HORIZ_HIGH (1 << 6) | ||
22 | #define EP93XXFB_SYNC_BLANK_HIGH (1 << 7) | ||
23 | #define EP93XXFB_PCLK_FALLING (1 << 8) | ||
24 | #define EP93XXFB_ENABLE_AC (1 << 9) | ||
25 | #define EP93XXFB_ENABLE_LCD (1 << 10) | ||
26 | #define EP93XXFB_ENABLE_CCIR (1 << 12) | ||
27 | #define EP93XXFB_USE_PARALLEL_INTERFACE (1 << 13) | ||
28 | #define EP93XXFB_ENABLE_INTERRUPT (1 << 14) | ||
29 | #define EP93XXFB_USB_INTERLACE (1 << 16) | ||
30 | #define EP93XXFB_USE_EQUALIZATION (1 << 17) | ||
31 | #define EP93XXFB_USE_DOUBLE_HORZ (1 << 18) | ||
32 | #define EP93XXFB_USE_DOUBLE_VERT (1 << 19) | ||
33 | #define EP93XXFB_USE_BLANK_PIXEL (1 << 20) | ||
34 | #define EP93XXFB_USE_SDCSN0 (0 << 21) | ||
35 | #define EP93XXFB_USE_SDCSN1 (1 << 21) | ||
36 | #define EP93XXFB_USE_SDCSN2 (2 << 21) | ||
37 | #define EP93XXFB_USE_SDCSN3 (3 << 21) | ||
38 | |||
39 | #define EP93XXFB_ENABLE (EP93XXFB_STATE_MACHINE_ENABLE | \ | ||
40 | EP93XXFB_PIXEL_CLOCK_ENABLE | \ | ||
41 | EP93XXFB_VSYNC_ENABLE | \ | ||
42 | EP93XXFB_PIXEL_DATA_ENABLE) | ||
43 | |||
44 | struct ep93xxfb_mach_info { | ||
45 | unsigned int num_modes; | ||
46 | const struct fb_videomode *modes; | ||
47 | const struct fb_videomode *default_mode; | ||
48 | int bpp; | ||
49 | unsigned int flags; | ||
50 | |||
51 | int (*setup)(struct platform_device *pdev); | ||
52 | void (*teardown)(struct platform_device *pdev); | ||
53 | void (*blank)(int blank_mode, struct fb_info *info); | ||
54 | }; | ||
55 | |||
56 | #endif /* __ASM_ARCH_EP93XXFB_H */ | ||
diff --git a/include/linux/platform_data/video-imxfb.h b/include/linux/platform_data/video-imxfb.h new file mode 100644 index 000000000000..9de8f062ad5d --- /dev/null +++ b/include/linux/platform_data/video-imxfb.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * This structure describes the machine which we are running on. | ||
3 | */ | ||
4 | #ifndef __MACH_IMXFB_H__ | ||
5 | #define __MACH_IMXFB_H__ | ||
6 | |||
7 | #include <linux/fb.h> | ||
8 | |||
9 | #define PCR_TFT (1 << 31) | ||
10 | #define PCR_COLOR (1 << 30) | ||
11 | #define PCR_PBSIZ_1 (0 << 28) | ||
12 | #define PCR_PBSIZ_2 (1 << 28) | ||
13 | #define PCR_PBSIZ_4 (2 << 28) | ||
14 | #define PCR_PBSIZ_8 (3 << 28) | ||
15 | #define PCR_BPIX_1 (0 << 25) | ||
16 | #define PCR_BPIX_2 (1 << 25) | ||
17 | #define PCR_BPIX_4 (2 << 25) | ||
18 | #define PCR_BPIX_8 (3 << 25) | ||
19 | #define PCR_BPIX_12 (4 << 25) | ||
20 | #define PCR_BPIX_16 (5 << 25) | ||
21 | #define PCR_BPIX_18 (6 << 25) | ||
22 | #define PCR_PIXPOL (1 << 24) | ||
23 | #define PCR_FLMPOL (1 << 23) | ||
24 | #define PCR_LPPOL (1 << 22) | ||
25 | #define PCR_CLKPOL (1 << 21) | ||
26 | #define PCR_OEPOL (1 << 20) | ||
27 | #define PCR_SCLKIDLE (1 << 19) | ||
28 | #define PCR_END_SEL (1 << 18) | ||
29 | #define PCR_END_BYTE_SWAP (1 << 17) | ||
30 | #define PCR_REV_VS (1 << 16) | ||
31 | #define PCR_ACD_SEL (1 << 15) | ||
32 | #define PCR_ACD(x) (((x) & 0x7f) << 8) | ||
33 | #define PCR_SCLK_SEL (1 << 7) | ||
34 | #define PCR_SHARP (1 << 6) | ||
35 | #define PCR_PCD(x) ((x) & 0x3f) | ||
36 | |||
37 | #define PWMR_CLS(x) (((x) & 0x1ff) << 16) | ||
38 | #define PWMR_LDMSK (1 << 15) | ||
39 | #define PWMR_SCR1 (1 << 10) | ||
40 | #define PWMR_SCR0 (1 << 9) | ||
41 | #define PWMR_CC_EN (1 << 8) | ||
42 | #define PWMR_PW(x) ((x) & 0xff) | ||
43 | |||
44 | #define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26) | ||
45 | #define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16) | ||
46 | #define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8) | ||
47 | #define LSCR1_GRAY2(x) (((x) & 0xf) << 4) | ||
48 | #define LSCR1_GRAY1(x) (((x) & 0xf)) | ||
49 | |||
50 | #define DMACR_BURST (1 << 31) | ||
51 | #define DMACR_HM(x) (((x) & 0xf) << 16) | ||
52 | #define DMACR_TM(x) ((x) & 0xf) | ||
53 | |||
54 | struct imx_fb_videomode { | ||
55 | struct fb_videomode mode; | ||
56 | u32 pcr; | ||
57 | unsigned char bpp; | ||
58 | }; | ||
59 | |||
60 | struct imx_fb_platform_data { | ||
61 | struct imx_fb_videomode *mode; | ||
62 | int num_modes; | ||
63 | |||
64 | u_int cmap_greyscale:1, | ||
65 | cmap_inverse:1, | ||
66 | cmap_static:1, | ||
67 | unused:29; | ||
68 | |||
69 | u_int pwmr; | ||
70 | u_int lscr1; | ||
71 | u_int dmacr; | ||
72 | |||
73 | u_char * fixed_screen_cpu; | ||
74 | dma_addr_t fixed_screen_dma; | ||
75 | |||
76 | int (*init)(struct platform_device *); | ||
77 | void (*exit)(struct platform_device *); | ||
78 | |||
79 | void (*lcd_power)(int); | ||
80 | void (*backlight_power)(int); | ||
81 | }; | ||
82 | |||
83 | void set_imx_fb_info(struct imx_fb_platform_data *); | ||
84 | #endif /* ifndef __MACH_IMXFB_H__ */ | ||
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h new file mode 100644 index 000000000000..1f4fc81b3d8f --- /dev/null +++ b/include/linux/platform_data/video-msm_fb.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* arch/arm/mach-msm/include/mach/msm_fb.h | ||
2 | * | ||
3 | * Internal shared definitions for various MSM framebuffer parts. | ||
4 | * | ||
5 | * Copyright (C) 2007 Google Incorporated | ||
6 | * | ||
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 | ||
9 | * may be copied, distributed, and modified under those terms. | ||
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 | |||
17 | #ifndef _MSM_FB_H_ | ||
18 | #define _MSM_FB_H_ | ||
19 | |||
20 | #include <linux/device.h> | ||
21 | |||
22 | struct mddi_info; | ||
23 | |||
24 | struct msm_fb_data { | ||
25 | int xres; /* x resolution in pixels */ | ||
26 | int yres; /* y resolution in pixels */ | ||
27 | int width; /* disply width in mm */ | ||
28 | int height; /* display height in mm */ | ||
29 | unsigned output_format; | ||
30 | }; | ||
31 | |||
32 | struct msmfb_callback { | ||
33 | void (*func)(struct msmfb_callback *); | ||
34 | }; | ||
35 | |||
36 | enum { | ||
37 | MSM_MDDI_PMDH_INTERFACE, | ||
38 | MSM_MDDI_EMDH_INTERFACE, | ||
39 | MSM_EBI2_INTERFACE, | ||
40 | }; | ||
41 | |||
42 | #define MSMFB_CAP_PARTIAL_UPDATES (1 << 0) | ||
43 | |||
44 | struct msm_panel_data { | ||
45 | /* turns off the fb memory */ | ||
46 | int (*suspend)(struct msm_panel_data *); | ||
47 | /* turns on the fb memory */ | ||
48 | int (*resume)(struct msm_panel_data *); | ||
49 | /* turns off the panel */ | ||
50 | int (*blank)(struct msm_panel_data *); | ||
51 | /* turns on the panel */ | ||
52 | int (*unblank)(struct msm_panel_data *); | ||
53 | void (*wait_vsync)(struct msm_panel_data *); | ||
54 | void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *); | ||
55 | void (*clear_vsync)(struct msm_panel_data *); | ||
56 | /* from the enum above */ | ||
57 | unsigned interface_type; | ||
58 | /* data to be passed to the fb driver */ | ||
59 | struct msm_fb_data *fb_data; | ||
60 | |||
61 | /* capabilities supported by the panel */ | ||
62 | uint32_t caps; | ||
63 | }; | ||
64 | |||
65 | struct msm_mddi_client_data { | ||
66 | void (*suspend)(struct msm_mddi_client_data *); | ||
67 | void (*resume)(struct msm_mddi_client_data *); | ||
68 | void (*activate_link)(struct msm_mddi_client_data *); | ||
69 | void (*remote_write)(struct msm_mddi_client_data *, uint32_t val, | ||
70 | uint32_t reg); | ||
71 | uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg); | ||
72 | void (*auto_hibernate)(struct msm_mddi_client_data *, int); | ||
73 | /* custom data that needs to be passed from the board file to a | ||
74 | * particular client */ | ||
75 | void *private_client_data; | ||
76 | struct resource *fb_resource; | ||
77 | /* from the list above */ | ||
78 | unsigned interface_type; | ||
79 | }; | ||
80 | |||
81 | struct msm_mddi_platform_data { | ||
82 | unsigned int clk_rate; | ||
83 | void (*power_client)(struct msm_mddi_client_data *, int on); | ||
84 | |||
85 | /* fixup the mfr name, product id */ | ||
86 | void (*fixup)(uint16_t *mfr_name, uint16_t *product_id); | ||
87 | |||
88 | struct resource *fb_resource; /*optional*/ | ||
89 | /* number of clients in the list that follows */ | ||
90 | int num_clients; | ||
91 | /* array of client information of clients */ | ||
92 | struct { | ||
93 | unsigned product_id; /* mfr id in top 16 bits, product id | ||
94 | * in lower 16 bits | ||
95 | */ | ||
96 | char *name; /* the device name will be the platform | ||
97 | * device name registered for the client, | ||
98 | * it should match the name of the associated | ||
99 | * driver | ||
100 | */ | ||
101 | unsigned id; /* id for mddi client device node, will also | ||
102 | * be used as device id of panel devices, if | ||
103 | * the client device will have multiple panels | ||
104 | * space must be left here for them | ||
105 | */ | ||
106 | void *client_data; /* required private client data */ | ||
107 | unsigned int clk_rate; /* optional: if the client requires a | ||
108 | * different mddi clk rate | ||
109 | */ | ||
110 | } client_platform_data[]; | ||
111 | }; | ||
112 | |||
113 | struct mdp_blit_req; | ||
114 | struct fb_info; | ||
115 | struct mdp_device { | ||
116 | struct device dev; | ||
117 | void (*dma)(struct mdp_device *mpd, uint32_t addr, | ||
118 | uint32_t stride, uint32_t w, uint32_t h, uint32_t x, | ||
119 | uint32_t y, struct msmfb_callback *callback, int interface); | ||
120 | void (*dma_wait)(struct mdp_device *mdp); | ||
121 | int (*blit)(struct mdp_device *mdp, struct fb_info *fb, | ||
122 | struct mdp_blit_req *req); | ||
123 | void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id); | ||
124 | }; | ||
125 | |||
126 | struct class_interface; | ||
127 | int register_mdp_client(struct class_interface *class_intf); | ||
128 | |||
129 | /**** private client data structs go below this line ***/ | ||
130 | |||
131 | struct msm_mddi_bridge_platform_data { | ||
132 | /* from board file */ | ||
133 | int (*init)(struct msm_mddi_bridge_platform_data *, | ||
134 | struct msm_mddi_client_data *); | ||
135 | int (*uninit)(struct msm_mddi_bridge_platform_data *, | ||
136 | struct msm_mddi_client_data *); | ||
137 | /* passed to panel for use by the fb driver */ | ||
138 | int (*blank)(struct msm_mddi_bridge_platform_data *, | ||
139 | struct msm_mddi_client_data *); | ||
140 | int (*unblank)(struct msm_mddi_bridge_platform_data *, | ||
141 | struct msm_mddi_client_data *); | ||
142 | struct msm_fb_data fb_data; | ||
143 | }; | ||
144 | |||
145 | |||
146 | |||
147 | #endif | ||
diff --git a/include/linux/platform_data/video-mx3fb.h b/include/linux/platform_data/video-mx3fb.h new file mode 100644 index 000000000000..fdbe60001542 --- /dev/null +++ b/include/linux/platform_data/video-mx3fb.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 | ||
3 | * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_MX3FB_H__ | ||
11 | #define __ASM_ARCH_MX3FB_H__ | ||
12 | |||
13 | #include <linux/device.h> | ||
14 | #include <linux/fb.h> | ||
15 | |||
16 | /* Proprietary FB_SYNC_ flags */ | ||
17 | #define FB_SYNC_OE_ACT_HIGH 0x80000000 | ||
18 | #define FB_SYNC_CLK_INVERT 0x40000000 | ||
19 | #define FB_SYNC_DATA_INVERT 0x20000000 | ||
20 | #define FB_SYNC_CLK_IDLE_EN 0x10000000 | ||
21 | #define FB_SYNC_SHARP_MODE 0x08000000 | ||
22 | #define FB_SYNC_SWAP_RGB 0x04000000 | ||
23 | #define FB_SYNC_CLK_SEL_EN 0x02000000 | ||
24 | |||
25 | /* | ||
26 | * Specify the way your display is connected. The IPU can arbitrarily | ||
27 | * map the internal colors to the external data lines. We only support | ||
28 | * the following mappings at the moment. | ||
29 | */ | ||
30 | enum disp_data_mapping { | ||
31 | /* blue -> d[0..5], green -> d[6..11], red -> d[12..17] */ | ||
32 | IPU_DISP_DATA_MAPPING_RGB666, | ||
33 | /* blue -> d[0..4], green -> d[5..10], red -> d[11..15] */ | ||
34 | IPU_DISP_DATA_MAPPING_RGB565, | ||
35 | /* blue -> d[0..7], green -> d[8..15], red -> d[16..23] */ | ||
36 | IPU_DISP_DATA_MAPPING_RGB888, | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * struct mx3fb_platform_data - mx3fb platform data | ||
41 | * | ||
42 | * @dma_dev: pointer to the dma-device, used for dma-slave connection | ||
43 | * @mode: pointer to a platform-provided per mxc_register_fb() videomode | ||
44 | */ | ||
45 | struct mx3fb_platform_data { | ||
46 | struct device *dma_dev; | ||
47 | const char *name; | ||
48 | const struct fb_videomode *mode; | ||
49 | int num_modes; | ||
50 | enum disp_data_mapping disp_data_fmt; | ||
51 | }; | ||
52 | |||
53 | #endif | ||
diff --git a/include/linux/platform_data/video-nuc900fb.h b/include/linux/platform_data/video-nuc900fb.h new file mode 100644 index 000000000000..cec5ece765ed --- /dev/null +++ b/include/linux/platform_data/video-nuc900fb.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* linux/include/asm/arch-nuc900/fb.h | ||
2 | * | ||
3 | * Copyright (c) 2008 Nuvoton technology corporation | ||
4 | * All rights reserved. | ||
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 | * Changelog: | ||
12 | * | ||
13 | * 2008/08/26 vincen.zswan modify this file for LCD. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARM_FB_H | ||
17 | #define __ASM_ARM_FB_H | ||
18 | |||
19 | |||
20 | |||
21 | /* LCD Controller Hardware Desc */ | ||
22 | struct nuc900fb_hw { | ||
23 | unsigned int lcd_dccs; | ||
24 | unsigned int lcd_device_ctrl; | ||
25 | unsigned int lcd_mpulcd_cmd; | ||
26 | unsigned int lcd_int_cs; | ||
27 | unsigned int lcd_crtc_size; | ||
28 | unsigned int lcd_crtc_dend; | ||
29 | unsigned int lcd_crtc_hr; | ||
30 | unsigned int lcd_crtc_hsync; | ||
31 | unsigned int lcd_crtc_vr; | ||
32 | unsigned int lcd_va_baddr0; | ||
33 | unsigned int lcd_va_baddr1; | ||
34 | unsigned int lcd_va_fbctrl; | ||
35 | unsigned int lcd_va_scale; | ||
36 | unsigned int lcd_va_test; | ||
37 | unsigned int lcd_va_win; | ||
38 | unsigned int lcd_va_stuff; | ||
39 | }; | ||
40 | |||
41 | /* LCD Display Description */ | ||
42 | struct nuc900fb_display { | ||
43 | /* LCD Image type */ | ||
44 | unsigned type; | ||
45 | |||
46 | /* LCD Screen Size */ | ||
47 | unsigned short width; | ||
48 | unsigned short height; | ||
49 | |||
50 | /* LCD Screen Info */ | ||
51 | unsigned short xres; | ||
52 | unsigned short yres; | ||
53 | unsigned short bpp; | ||
54 | |||
55 | unsigned long pixclock; | ||
56 | unsigned short left_margin; | ||
57 | unsigned short right_margin; | ||
58 | unsigned short hsync_len; | ||
59 | unsigned short upper_margin; | ||
60 | unsigned short lower_margin; | ||
61 | unsigned short vsync_len; | ||
62 | |||
63 | /* hardware special register value */ | ||
64 | unsigned int dccs; | ||
65 | unsigned int devctl; | ||
66 | unsigned int fbctrl; | ||
67 | unsigned int scale; | ||
68 | }; | ||
69 | |||
70 | struct nuc900fb_mach_info { | ||
71 | struct nuc900fb_display *displays; | ||
72 | unsigned num_displays; | ||
73 | unsigned default_display; | ||
74 | /* GPIO Setting Info */ | ||
75 | unsigned gpio_dir; | ||
76 | unsigned gpio_dir_mask; | ||
77 | unsigned gpio_data; | ||
78 | unsigned gpio_data_mask; | ||
79 | }; | ||
80 | |||
81 | extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *); | ||
82 | |||
83 | #endif /* __ASM_ARM_FB_H */ | ||
diff --git a/include/linux/platform_data/video-pxafb.h b/include/linux/platform_data/video-pxafb.h new file mode 100644 index 000000000000..486b4c519ae2 --- /dev/null +++ b/include/linux/platform_data/video-pxafb.h | |||
@@ -0,0 +1,175 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pxa/include/mach/pxafb.h | ||
3 | * | ||
4 | * Support for the xscale frame buffer. | ||
5 | * | ||
6 | * Author: Jean-Frederic Clere | ||
7 | * Created: Sep 22, 2003 | ||
8 | * Copyright: jfclere@sinix.net | ||
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 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/fb.h> | ||
16 | #include <mach/regs-lcd.h> | ||
17 | |||
18 | /* | ||
19 | * Supported LCD connections | ||
20 | * | ||
21 | * bits 0 - 3: for LCD panel type: | ||
22 | * | ||
23 | * STN - for passive matrix | ||
24 | * DSTN - for dual scan passive matrix | ||
25 | * TFT - for active matrix | ||
26 | * | ||
27 | * bits 4 - 9 : for bus width | ||
28 | * bits 10-17 : for AC Bias Pin Frequency | ||
29 | * bit 18 : for output enable polarity | ||
30 | * bit 19 : for pixel clock edge | ||
31 | * bit 20 : for output pixel format when base is RGBT16 | ||
32 | */ | ||
33 | #define LCD_CONN_TYPE(_x) ((_x) & 0x0f) | ||
34 | #define LCD_CONN_WIDTH(_x) (((_x) >> 4) & 0x1f) | ||
35 | |||
36 | #define LCD_TYPE_MASK 0xf | ||
37 | #define LCD_TYPE_UNKNOWN 0 | ||
38 | #define LCD_TYPE_MONO_STN 1 | ||
39 | #define LCD_TYPE_MONO_DSTN 2 | ||
40 | #define LCD_TYPE_COLOR_STN 3 | ||
41 | #define LCD_TYPE_COLOR_DSTN 4 | ||
42 | #define LCD_TYPE_COLOR_TFT 5 | ||
43 | #define LCD_TYPE_SMART_PANEL 6 | ||
44 | #define LCD_TYPE_MAX 7 | ||
45 | |||
46 | #define LCD_MONO_STN_4BPP ((4 << 4) | LCD_TYPE_MONO_STN) | ||
47 | #define LCD_MONO_STN_8BPP ((8 << 4) | LCD_TYPE_MONO_STN) | ||
48 | #define LCD_MONO_DSTN_8BPP ((8 << 4) | LCD_TYPE_MONO_DSTN) | ||
49 | #define LCD_COLOR_STN_8BPP ((8 << 4) | LCD_TYPE_COLOR_STN) | ||
50 | #define LCD_COLOR_DSTN_16BPP ((16 << 4) | LCD_TYPE_COLOR_DSTN) | ||
51 | #define LCD_COLOR_TFT_8BPP ((8 << 4) | LCD_TYPE_COLOR_TFT) | ||
52 | #define LCD_COLOR_TFT_16BPP ((16 << 4) | LCD_TYPE_COLOR_TFT) | ||
53 | #define LCD_COLOR_TFT_18BPP ((18 << 4) | LCD_TYPE_COLOR_TFT) | ||
54 | #define LCD_SMART_PANEL_8BPP ((8 << 4) | LCD_TYPE_SMART_PANEL) | ||
55 | #define LCD_SMART_PANEL_16BPP ((16 << 4) | LCD_TYPE_SMART_PANEL) | ||
56 | #define LCD_SMART_PANEL_18BPP ((18 << 4) | LCD_TYPE_SMART_PANEL) | ||
57 | |||
58 | #define LCD_AC_BIAS_FREQ(x) (((x) & 0xff) << 10) | ||
59 | #define LCD_BIAS_ACTIVE_HIGH (0 << 18) | ||
60 | #define LCD_BIAS_ACTIVE_LOW (1 << 18) | ||
61 | #define LCD_PCLK_EDGE_RISE (0 << 19) | ||
62 | #define LCD_PCLK_EDGE_FALL (1 << 19) | ||
63 | #define LCD_ALTERNATE_MAPPING (1 << 20) | ||
64 | |||
65 | /* | ||
66 | * This structure describes the machine which we are running on. | ||
67 | * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine | ||
68 | * of linux/drivers/video/pxafb.c | ||
69 | */ | ||
70 | struct pxafb_mode_info { | ||
71 | u_long pixclock; | ||
72 | |||
73 | u_short xres; | ||
74 | u_short yres; | ||
75 | |||
76 | u_char bpp; | ||
77 | u_int cmap_greyscale:1, | ||
78 | depth:8, | ||
79 | transparency:1, | ||
80 | unused:22; | ||
81 | |||
82 | /* Parallel Mode Timing */ | ||
83 | u_char hsync_len; | ||
84 | u_char left_margin; | ||
85 | u_char right_margin; | ||
86 | |||
87 | u_char vsync_len; | ||
88 | u_char upper_margin; | ||
89 | u_char lower_margin; | ||
90 | u_char sync; | ||
91 | |||
92 | /* Smart Panel Mode Timing - see PXA27x DM 7.4.15.0.3 for details | ||
93 | * Note: | ||
94 | * 1. all parameters in nanosecond (ns) | ||
95 | * 2. a0cs{rd,wr}_set_hld are controlled by the same register bits | ||
96 | * in pxa27x and pxa3xx, initialize them to the same value or | ||
97 | * the larger one will be used | ||
98 | * 3. same to {rd,wr}_pulse_width | ||
99 | * | ||
100 | * 4. LCD_PCLK_EDGE_{RISE,FALL} controls the L_PCLK_WR polarity | ||
101 | * 5. sync & FB_SYNC_HOR_HIGH_ACT controls the L_LCLK_A0 | ||
102 | * 6. sync & FB_SYNC_VERT_HIGH_ACT controls the L_LCLK_RD | ||
103 | */ | ||
104 | unsigned a0csrd_set_hld; /* A0 and CS Setup/Hold Time before/after L_FCLK_RD */ | ||
105 | unsigned a0cswr_set_hld; /* A0 and CS Setup/Hold Time before/after L_PCLK_WR */ | ||
106 | unsigned wr_pulse_width; /* L_PCLK_WR pulse width */ | ||
107 | unsigned rd_pulse_width; /* L_FCLK_RD pulse width */ | ||
108 | unsigned cmd_inh_time; /* Command Inhibit time between two writes */ | ||
109 | unsigned op_hold_time; /* Output Hold time from L_FCLK_RD negation */ | ||
110 | }; | ||
111 | |||
112 | struct pxafb_mach_info { | ||
113 | struct pxafb_mode_info *modes; | ||
114 | unsigned int num_modes; | ||
115 | |||
116 | unsigned int lcd_conn; | ||
117 | unsigned long video_mem_size; | ||
118 | |||
119 | u_int fixed_modes:1, | ||
120 | cmap_inverse:1, | ||
121 | cmap_static:1, | ||
122 | acceleration_enabled:1, | ||
123 | unused:28; | ||
124 | |||
125 | /* The following should be defined in LCCR0 | ||
126 | * LCCR0_Act or LCCR0_Pas Active or Passive | ||
127 | * LCCR0_Sngl or LCCR0_Dual Single/Dual panel | ||
128 | * LCCR0_Mono or LCCR0_Color Mono/Color | ||
129 | * LCCR0_4PixMono or LCCR0_8PixMono (in mono single mode) | ||
130 | * LCCR0_DMADel(Tcpu) (optional) DMA request delay | ||
131 | * | ||
132 | * The following should not be defined in LCCR0: | ||
133 | * LCCR0_OUM, LCCR0_BM, LCCR0_QDM, LCCR0_DIS, LCCR0_EFM | ||
134 | * LCCR0_IUM, LCCR0_SFM, LCCR0_LDM, LCCR0_ENB | ||
135 | */ | ||
136 | u_int lccr0; | ||
137 | /* The following should be defined in LCCR3 | ||
138 | * LCCR3_OutEnH or LCCR3_OutEnL Output enable polarity | ||
139 | * LCCR3_PixRsEdg or LCCR3_PixFlEdg Pixel clock edge type | ||
140 | * LCCR3_Acb(X) AB Bias pin frequency | ||
141 | * LCCR3_DPC (optional) Double Pixel Clock mode (untested) | ||
142 | * | ||
143 | * The following should not be defined in LCCR3 | ||
144 | * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp | ||
145 | */ | ||
146 | u_int lccr3; | ||
147 | /* The following should be defined in LCCR4 | ||
148 | * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2 | ||
149 | * | ||
150 | * All other bits in LCCR4 should be left alone. | ||
151 | */ | ||
152 | u_int lccr4; | ||
153 | void (*pxafb_backlight_power)(int); | ||
154 | void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); | ||
155 | void (*smart_update)(struct fb_info *); | ||
156 | }; | ||
157 | |||
158 | void pxa_set_fb_info(struct device *, struct pxafb_mach_info *); | ||
159 | unsigned long pxafb_get_hsync_time(struct device *dev); | ||
160 | |||
161 | #ifdef CONFIG_FB_PXA_SMARTPANEL | ||
162 | extern int pxafb_smart_queue(struct fb_info *info, uint16_t *cmds, int); | ||
163 | extern int pxafb_smart_flush(struct fb_info *info); | ||
164 | #else | ||
165 | static inline int pxafb_smart_queue(struct fb_info *info, | ||
166 | uint16_t *cmds, int n) | ||
167 | { | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | static inline int pxafb_smart_flush(struct fb_info *info) | ||
172 | { | ||
173 | return 0; | ||
174 | } | ||
175 | #endif | ||
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h new file mode 100644 index 000000000000..7f399c370fe0 --- /dev/null +++ b/include/linux/platform_data/video-vt8500lcdfb.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * VT8500/WM8505 Frame Buffer platform data definitions | ||
3 | * | ||
4 | * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com> | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _VT8500FB_H | ||
17 | #define _VT8500FB_H | ||
18 | |||
19 | #include <linux/fb.h> | ||
20 | |||
21 | struct vt8500fb_platform_data { | ||
22 | struct fb_videomode mode; | ||
23 | u32 xres_virtual; | ||
24 | u32 yres_virtual; | ||
25 | u32 bpp; | ||
26 | unsigned long video_mem_phys; | ||
27 | void *video_mem_virt; | ||
28 | unsigned long video_mem_len; | ||
29 | }; | ||
30 | |||
31 | #endif /* _VT8500FB_H */ | ||
diff --git a/include/linux/platform_data/voltage-omap.h b/include/linux/platform_data/voltage-omap.h new file mode 100644 index 000000000000..5be4d5def427 --- /dev/null +++ b/include/linux/platform_data/voltage-omap.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * OMAP Voltage Management Routines | ||
3 | * | ||
4 | * Copyright (C) 2011, Texas Instruments, Inc. | ||
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 __ARCH_ARM_OMAP_VOLTAGE_H | ||
12 | #define __ARCH_ARM_OMAP_VOLTAGE_H | ||
13 | |||
14 | /** | ||
15 | * struct omap_volt_data - Omap voltage specific data. | ||
16 | * @voltage_nominal: The possible voltage value in uV | ||
17 | * @sr_efuse_offs: The offset of the efuse register(from system | ||
18 | * control module base address) from where to read | ||
19 | * the n-target value for the smartreflex module. | ||
20 | * @sr_errminlimit: Error min limit value for smartreflex. This value | ||
21 | * differs at differnet opp and thus is linked | ||
22 | * with voltage. | ||
23 | * @vp_errorgain: Error gain value for the voltage processor. This | ||
24 | * field also differs according to the voltage/opp. | ||
25 | */ | ||
26 | struct omap_volt_data { | ||
27 | u32 volt_nominal; | ||
28 | u32 sr_efuse_offs; | ||
29 | u8 sr_errminlimit; | ||
30 | u8 vp_errgain; | ||
31 | }; | ||
32 | struct voltagedomain; | ||
33 | |||
34 | struct voltagedomain *voltdm_lookup(const char *name); | ||
35 | int voltdm_scale(struct voltagedomain *voltdm, unsigned long target_volt); | ||
36 | unsigned long voltdm_get_voltage(struct voltagedomain *voltdm); | ||
37 | struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm, | ||
38 | unsigned long volt); | ||
39 | #endif | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 60e9994ef405..5711e9525a2a 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -14,11 +14,15 @@ | |||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/mod_devicetable.h> | 15 | #include <linux/mod_devicetable.h> |
16 | 16 | ||
17 | #define PLATFORM_DEVID_NONE (-1) | ||
18 | #define PLATFORM_DEVID_AUTO (-2) | ||
19 | |||
17 | struct mfd_cell; | 20 | struct mfd_cell; |
18 | 21 | ||
19 | struct platform_device { | 22 | struct platform_device { |
20 | const char * name; | 23 | const char * name; |
21 | int id; | 24 | int id; |
25 | bool id_auto; | ||
22 | struct device dev; | 26 | struct device dev; |
23 | u32 num_resources; | 27 | u32 num_resources; |
24 | struct resource * resource; | 28 | struct resource * resource; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index f067e60a3832..007e687c4f69 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -510,12 +510,14 @@ struct dev_pm_info { | |||
510 | bool is_prepared:1; /* Owned by the PM core */ | 510 | bool is_prepared:1; /* Owned by the PM core */ |
511 | bool is_suspended:1; /* Ditto */ | 511 | bool is_suspended:1; /* Ditto */ |
512 | bool ignore_children:1; | 512 | bool ignore_children:1; |
513 | bool early_init:1; /* Owned by the PM core */ | ||
513 | spinlock_t lock; | 514 | spinlock_t lock; |
514 | #ifdef CONFIG_PM_SLEEP | 515 | #ifdef CONFIG_PM_SLEEP |
515 | struct list_head entry; | 516 | struct list_head entry; |
516 | struct completion completion; | 517 | struct completion completion; |
517 | struct wakeup_source *wakeup; | 518 | struct wakeup_source *wakeup; |
518 | bool wakeup_path:1; | 519 | bool wakeup_path:1; |
520 | bool syscore:1; | ||
519 | #else | 521 | #else |
520 | unsigned int should_wakeup:1; | 522 | unsigned int should_wakeup:1; |
521 | #endif | 523 | #endif |
@@ -638,6 +640,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
638 | } while (0) | 640 | } while (0) |
639 | 641 | ||
640 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); | 642 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); |
643 | extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *)); | ||
641 | 644 | ||
642 | extern int pm_generic_prepare(struct device *dev); | 645 | extern int pm_generic_prepare(struct device *dev); |
643 | extern int pm_generic_suspend_late(struct device *dev); | 646 | extern int pm_generic_suspend_late(struct device *dev); |
@@ -677,6 +680,10 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b) | |||
677 | return 0; | 680 | return 0; |
678 | } | 681 | } |
679 | 682 | ||
683 | static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *)) | ||
684 | { | ||
685 | } | ||
686 | |||
680 | #define pm_generic_prepare NULL | 687 | #define pm_generic_prepare NULL |
681 | #define pm_generic_suspend NULL | 688 | #define pm_generic_suspend NULL |
682 | #define pm_generic_resume NULL | 689 | #define pm_generic_resume NULL |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index a7d6172922d4..7c1d252b20c0 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -114,7 +114,6 @@ struct generic_pm_domain_data { | |||
114 | struct mutex lock; | 114 | struct mutex lock; |
115 | unsigned int refcount; | 115 | unsigned int refcount; |
116 | bool need_restore; | 116 | bool need_restore; |
117 | bool always_on; | ||
118 | }; | 117 | }; |
119 | 118 | ||
120 | #ifdef CONFIG_PM_GENERIC_DOMAINS | 119 | #ifdef CONFIG_PM_GENERIC_DOMAINS |
@@ -139,36 +138,32 @@ extern int __pm_genpd_of_add_device(struct device_node *genpd_node, | |||
139 | struct device *dev, | 138 | struct device *dev, |
140 | struct gpd_timing_data *td); | 139 | struct gpd_timing_data *td); |
141 | 140 | ||
142 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | 141 | extern int __pm_genpd_name_add_device(const char *domain_name, |
143 | struct device *dev) | 142 | struct device *dev, |
144 | { | 143 | struct gpd_timing_data *td); |
145 | return __pm_genpd_add_device(genpd, dev, NULL); | ||
146 | } | ||
147 | |||
148 | static inline int pm_genpd_of_add_device(struct device_node *genpd_node, | ||
149 | struct device *dev) | ||
150 | { | ||
151 | return __pm_genpd_of_add_device(genpd_node, dev, NULL); | ||
152 | } | ||
153 | 144 | ||
154 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 145 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
155 | struct device *dev); | 146 | struct device *dev); |
156 | extern void pm_genpd_dev_always_on(struct device *dev, bool val); | ||
157 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); | 147 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); |
158 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 148 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
159 | struct generic_pm_domain *new_subdomain); | 149 | struct generic_pm_domain *new_subdomain); |
150 | extern int pm_genpd_add_subdomain_names(const char *master_name, | ||
151 | const char *subdomain_name); | ||
160 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 152 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
161 | struct generic_pm_domain *target); | 153 | struct generic_pm_domain *target); |
162 | extern int pm_genpd_add_callbacks(struct device *dev, | 154 | extern int pm_genpd_add_callbacks(struct device *dev, |
163 | struct gpd_dev_ops *ops, | 155 | struct gpd_dev_ops *ops, |
164 | struct gpd_timing_data *td); | 156 | struct gpd_timing_data *td); |
165 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | 157 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); |
166 | extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); | 158 | extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); |
167 | extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); | 159 | extern int pm_genpd_name_attach_cpuidle(const char *name, int state); |
160 | extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); | ||
161 | extern int pm_genpd_name_detach_cpuidle(const char *name); | ||
168 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 162 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
169 | struct dev_power_governor *gov, bool is_off); | 163 | struct dev_power_governor *gov, bool is_off); |
170 | 164 | ||
171 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 165 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
166 | extern int pm_genpd_name_poweron(const char *domain_name); | ||
172 | 167 | ||
173 | extern bool default_stop_ok(struct device *dev); | 168 | extern bool default_stop_ok(struct device *dev); |
174 | 169 | ||
@@ -189,8 +184,15 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd, | |||
189 | { | 184 | { |
190 | return -ENOSYS; | 185 | return -ENOSYS; |
191 | } | 186 | } |
192 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | 187 | static inline int __pm_genpd_of_add_device(struct device_node *genpd_node, |
193 | struct device *dev) | 188 | struct device *dev, |
189 | struct gpd_timing_data *td) | ||
190 | { | ||
191 | return -ENOSYS; | ||
192 | } | ||
193 | static inline int __pm_genpd_name_add_device(const char *domain_name, | ||
194 | struct device *dev, | ||
195 | struct gpd_timing_data *td) | ||
194 | { | 196 | { |
195 | return -ENOSYS; | 197 | return -ENOSYS; |
196 | } | 198 | } |
@@ -199,13 +201,17 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | |||
199 | { | 201 | { |
200 | return -ENOSYS; | 202 | return -ENOSYS; |
201 | } | 203 | } |
202 | static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {} | ||
203 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} | 204 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} |
204 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 205 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
205 | struct generic_pm_domain *new_sd) | 206 | struct generic_pm_domain *new_sd) |
206 | { | 207 | { |
207 | return -ENOSYS; | 208 | return -ENOSYS; |
208 | } | 209 | } |
210 | static inline int pm_genpd_add_subdomain_names(const char *master_name, | ||
211 | const char *subdomain_name) | ||
212 | { | ||
213 | return -ENOSYS; | ||
214 | } | ||
209 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 215 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
210 | struct generic_pm_domain *target) | 216 | struct generic_pm_domain *target) |
211 | { | 217 | { |
@@ -221,11 +227,19 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | |||
221 | { | 227 | { |
222 | return -ENOSYS; | 228 | return -ENOSYS; |
223 | } | 229 | } |
224 | static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) | 230 | static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) |
225 | { | 231 | { |
226 | return -ENOSYS; | 232 | return -ENOSYS; |
227 | } | 233 | } |
228 | static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) | 234 | static inline int pm_genpd_name_attach_cpuidle(const char *name, int state) |
235 | { | ||
236 | return -ENOSYS; | ||
237 | } | ||
238 | static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) | ||
239 | { | ||
240 | return -ENOSYS; | ||
241 | } | ||
242 | static inline int pm_genpd_name_detach_cpuidle(const char *name) | ||
229 | { | 243 | { |
230 | return -ENOSYS; | 244 | return -ENOSYS; |
231 | } | 245 | } |
@@ -237,6 +251,10 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) | |||
237 | { | 251 | { |
238 | return -ENOSYS; | 252 | return -ENOSYS; |
239 | } | 253 | } |
254 | static inline int pm_genpd_name_poweron(const char *domain_name) | ||
255 | { | ||
256 | return -ENOSYS; | ||
257 | } | ||
240 | static inline bool default_stop_ok(struct device *dev) | 258 | static inline bool default_stop_ok(struct device *dev) |
241 | { | 259 | { |
242 | return false; | 260 | return false; |
@@ -245,6 +263,24 @@ static inline bool default_stop_ok(struct device *dev) | |||
245 | #define pm_domain_always_on_gov NULL | 263 | #define pm_domain_always_on_gov NULL |
246 | #endif | 264 | #endif |
247 | 265 | ||
266 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
267 | struct device *dev) | ||
268 | { | ||
269 | return __pm_genpd_add_device(genpd, dev, NULL); | ||
270 | } | ||
271 | |||
272 | static inline int pm_genpd_of_add_device(struct device_node *genpd_node, | ||
273 | struct device *dev) | ||
274 | { | ||
275 | return __pm_genpd_of_add_device(genpd_node, dev, NULL); | ||
276 | } | ||
277 | |||
278 | static inline int pm_genpd_name_add_device(const char *domain_name, | ||
279 | struct device *dev) | ||
280 | { | ||
281 | return __pm_genpd_name_add_device(domain_name, dev, NULL); | ||
282 | } | ||
283 | |||
248 | static inline int pm_genpd_remove_callbacks(struct device *dev) | 284 | static inline int pm_genpd_remove_callbacks(struct device *dev) |
249 | { | 285 | { |
250 | return __pm_genpd_remove_callbacks(dev, true); | 286 | return __pm_genpd_remove_callbacks(dev, true); |
@@ -258,4 +294,20 @@ static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {} | |||
258 | static inline void pm_genpd_poweroff_unused(void) {} | 294 | static inline void pm_genpd_poweroff_unused(void) {} |
259 | #endif | 295 | #endif |
260 | 296 | ||
297 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP | ||
298 | extern void pm_genpd_syscore_switch(struct device *dev, bool suspend); | ||
299 | #else | ||
300 | static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {} | ||
301 | #endif | ||
302 | |||
303 | static inline void pm_genpd_syscore_poweroff(struct device *dev) | ||
304 | { | ||
305 | pm_genpd_syscore_switch(dev, true); | ||
306 | } | ||
307 | |||
308 | static inline void pm_genpd_syscore_poweron(struct device *dev) | ||
309 | { | ||
310 | pm_genpd_syscore_switch(dev, false); | ||
311 | } | ||
312 | |||
261 | #endif /* _LINUX_PM_DOMAIN_H */ | 313 | #endif /* _LINUX_PM_DOMAIN_H */ |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 11bad91c4433..7931efe71175 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -36,7 +36,13 @@ | |||
36 | struct posix_acl_entry { | 36 | struct posix_acl_entry { |
37 | short e_tag; | 37 | short e_tag; |
38 | unsigned short e_perm; | 38 | unsigned short e_perm; |
39 | unsigned int e_id; | 39 | union { |
40 | kuid_t e_uid; | ||
41 | kgid_t e_gid; | ||
42 | #ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS | ||
43 | unsigned int e_id; | ||
44 | #endif | ||
45 | }; | ||
40 | }; | 46 | }; |
41 | 47 | ||
42 | struct posix_acl { | 48 | struct posix_acl { |
diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h index 6e53c34035cd..ad93ad0f1db0 100644 --- a/include/linux/posix_acl_xattr.h +++ b/include/linux/posix_acl_xattr.h | |||
@@ -52,7 +52,21 @@ posix_acl_xattr_count(size_t size) | |||
52 | return size / sizeof(posix_acl_xattr_entry); | 52 | return size / sizeof(posix_acl_xattr_entry); |
53 | } | 53 | } |
54 | 54 | ||
55 | struct posix_acl *posix_acl_from_xattr(const void *value, size_t size); | 55 | #ifdef CONFIG_FS_POSIX_ACL |
56 | int posix_acl_to_xattr(const struct posix_acl *acl, void *buffer, size_t size); | 56 | void posix_acl_fix_xattr_from_user(void *value, size_t size); |
57 | void posix_acl_fix_xattr_to_user(void *value, size_t size); | ||
58 | #else | ||
59 | static inline void posix_acl_fix_xattr_from_user(void *value, size_t size) | ||
60 | { | ||
61 | } | ||
62 | static inline void posix_acl_fix_xattr_to_user(void *value, size_t size) | ||
63 | { | ||
64 | } | ||
65 | #endif | ||
66 | |||
67 | struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns, | ||
68 | const void *value, size_t size); | ||
69 | int posix_acl_to_xattr(struct user_namespace *user_ns, | ||
70 | const struct posix_acl *acl, void *buffer, size_t size); | ||
57 | 71 | ||
58 | #endif /* _POSIX_ACL_XATTR_H */ | 72 | #endif /* _POSIX_ACL_XATTR_H */ |
diff --git a/include/linux/power/generic-adc-battery.h b/include/linux/power/generic-adc-battery.h new file mode 100644 index 000000000000..b1ebe08533b6 --- /dev/null +++ b/include/linux/power/generic-adc-battery.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012, Anish Kumar <anish198519851985@gmail.com> | ||
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 as | ||
5 | * published by the Free Software Foundation. | ||
6 | */ | ||
7 | |||
8 | #ifndef GENERIC_ADC_BATTERY_H | ||
9 | #define GENERIC_ADC_BATTERY_H | ||
10 | |||
11 | /** | ||
12 | * struct gab_platform_data - platform_data for generic adc iio battery driver. | ||
13 | * @battery_info: recommended structure to specify static power supply | ||
14 | * parameters | ||
15 | * @cal_charge: calculate charge level. | ||
16 | * @gpio_charge_finished: gpio for the charger. | ||
17 | * @gpio_inverted: Should be 1 if the GPIO is active low otherwise 0 | ||
18 | * @jitter_delay: delay required after the interrupt to check battery | ||
19 | * status.Default set is 10ms. | ||
20 | */ | ||
21 | struct gab_platform_data { | ||
22 | struct power_supply_info battery_info; | ||
23 | int (*cal_charge)(long value); | ||
24 | int gpio_charge_finished; | ||
25 | bool gpio_inverted; | ||
26 | int jitter_delay; | ||
27 | }; | ||
28 | |||
29 | #endif /* GENERIC_ADC_BATTERY_H */ | ||
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index 3101e62a1213..4a496ebc7d73 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <plat/voltage.h> | 26 | #include <linux/platform_data/voltage-omap.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in | 29 | * Different Smartreflex IPs version. The v1 is the 65nm version used in |
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index 94048547f29a..0cc45ae1afd5 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -116,5 +116,14 @@ static inline void pps_get_ts(struct pps_event_time *ts) | |||
116 | 116 | ||
117 | #endif /* CONFIG_NTP_PPS */ | 117 | #endif /* CONFIG_NTP_PPS */ |
118 | 118 | ||
119 | /* Subtract known time delay from PPS event time(s) */ | ||
120 | static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec delta) | ||
121 | { | ||
122 | ts->ts_real = timespec_sub(ts->ts_real, delta); | ||
123 | #ifdef CONFIG_NTP_PPS | ||
124 | ts->ts_raw = timespec_sub(ts->ts_raw, delta); | ||
125 | #endif | ||
126 | } | ||
127 | |||
119 | #endif /* LINUX_PPS_KERNEL_H */ | 128 | #endif /* LINUX_PPS_KERNEL_H */ |
120 | 129 | ||
diff --git a/include/linux/projid.h b/include/linux/projid.h new file mode 100644 index 000000000000..36517b95be5c --- /dev/null +++ b/include/linux/projid.h | |||
@@ -0,0 +1,104 @@ | |||
1 | #ifndef _LINUX_PROJID_H | ||
2 | #define _LINUX_PROJID_H | ||
3 | |||
4 | /* | ||
5 | * A set of types for the internal kernel types representing project ids. | ||
6 | * | ||
7 | * The types defined in this header allow distinguishing which project ids in | ||
8 | * the kernel are values used by userspace and which project id values are | ||
9 | * the internal kernel values. With the addition of user namespaces the values | ||
10 | * can be different. Using the type system makes it possible for the compiler | ||
11 | * to detect when we overlook these differences. | ||
12 | * | ||
13 | */ | ||
14 | #include <linux/types.h> | ||
15 | |||
16 | struct user_namespace; | ||
17 | extern struct user_namespace init_user_ns; | ||
18 | |||
19 | typedef __kernel_uid32_t projid_t; | ||
20 | |||
21 | #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS | ||
22 | |||
23 | typedef struct { | ||
24 | projid_t val; | ||
25 | } kprojid_t; | ||
26 | |||
27 | static inline projid_t __kprojid_val(kprojid_t projid) | ||
28 | { | ||
29 | return projid.val; | ||
30 | } | ||
31 | |||
32 | #define KPROJIDT_INIT(value) (kprojid_t){ value } | ||
33 | |||
34 | #else | ||
35 | |||
36 | typedef projid_t kprojid_t; | ||
37 | |||
38 | static inline projid_t __kprojid_val(kprojid_t projid) | ||
39 | { | ||
40 | return projid; | ||
41 | } | ||
42 | |||
43 | #define KPROJIDT_INIT(value) ((kprojid_t) value ) | ||
44 | |||
45 | #endif | ||
46 | |||
47 | #define INVALID_PROJID KPROJIDT_INIT(-1) | ||
48 | #define OVERFLOW_PROJID 65534 | ||
49 | |||
50 | static inline bool projid_eq(kprojid_t left, kprojid_t right) | ||
51 | { | ||
52 | return __kprojid_val(left) == __kprojid_val(right); | ||
53 | } | ||
54 | |||
55 | static inline bool projid_lt(kprojid_t left, kprojid_t right) | ||
56 | { | ||
57 | return __kprojid_val(left) < __kprojid_val(right); | ||
58 | } | ||
59 | |||
60 | static inline bool projid_valid(kprojid_t projid) | ||
61 | { | ||
62 | return !projid_eq(projid, INVALID_PROJID); | ||
63 | } | ||
64 | |||
65 | #ifdef CONFIG_USER_NS | ||
66 | |||
67 | extern kprojid_t make_kprojid(struct user_namespace *from, projid_t projid); | ||
68 | |||
69 | extern projid_t from_kprojid(struct user_namespace *to, kprojid_t projid); | ||
70 | extern projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t projid); | ||
71 | |||
72 | static inline bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid) | ||
73 | { | ||
74 | return from_kprojid(ns, projid) != (projid_t)-1; | ||
75 | } | ||
76 | |||
77 | #else | ||
78 | |||
79 | static inline kprojid_t make_kprojid(struct user_namespace *from, projid_t projid) | ||
80 | { | ||
81 | return KPROJIDT_INIT(projid); | ||
82 | } | ||
83 | |||
84 | static inline projid_t from_kprojid(struct user_namespace *to, kprojid_t kprojid) | ||
85 | { | ||
86 | return __kprojid_val(kprojid); | ||
87 | } | ||
88 | |||
89 | static inline projid_t from_kprojid_munged(struct user_namespace *to, kprojid_t kprojid) | ||
90 | { | ||
91 | projid_t projid = from_kprojid(to, kprojid); | ||
92 | if (projid == (projid_t)-1) | ||
93 | projid = OVERFLOW_PROJID; | ||
94 | return projid; | ||
95 | } | ||
96 | |||
97 | static inline bool kprojid_has_mapping(struct user_namespace *ns, kprojid_t projid) | ||
98 | { | ||
99 | return true; | ||
100 | } | ||
101 | |||
102 | #endif /* CONFIG_USER_NS */ | ||
103 | |||
104 | #endif /* _LINUX_PROJID_H */ | ||
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index 945704c2ed65..f2dc6d8fc680 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #ifndef _PTP_CLOCK_KERNEL_H_ | 21 | #ifndef _PTP_CLOCK_KERNEL_H_ |
22 | #define _PTP_CLOCK_KERNEL_H_ | 22 | #define _PTP_CLOCK_KERNEL_H_ |
23 | 23 | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/pps_kernel.h> | ||
24 | #include <linux/ptp_clock.h> | 26 | #include <linux/ptp_clock.h> |
25 | 27 | ||
26 | 28 | ||
@@ -40,7 +42,9 @@ struct ptp_clock_request { | |||
40 | * struct ptp_clock_info - decribes a PTP hardware clock | 42 | * struct ptp_clock_info - decribes a PTP hardware clock |
41 | * | 43 | * |
42 | * @owner: The clock driver should set to THIS_MODULE. | 44 | * @owner: The clock driver should set to THIS_MODULE. |
43 | * @name: A short name to identify the clock. | 45 | * @name: A short "friendly name" to identify the clock and to |
46 | * help distinguish PHY based devices from MAC based ones. | ||
47 | * The string is not meant to be a unique id. | ||
44 | * @max_adj: The maximum possible frequency adjustment, in parts per billon. | 48 | * @max_adj: The maximum possible frequency adjustment, in parts per billon. |
45 | * @n_alarm: The number of programmable alarms. | 49 | * @n_alarm: The number of programmable alarms. |
46 | * @n_ext_ts: The number of external time stamp channels. | 50 | * @n_ext_ts: The number of external time stamp channels. |
@@ -92,10 +96,12 @@ struct ptp_clock; | |||
92 | /** | 96 | /** |
93 | * ptp_clock_register() - register a PTP hardware clock driver | 97 | * ptp_clock_register() - register a PTP hardware clock driver |
94 | * | 98 | * |
95 | * @info: Structure describing the new clock. | 99 | * @info: Structure describing the new clock. |
100 | * @parent: Pointer to the parent device of the new clock. | ||
96 | */ | 101 | */ |
97 | 102 | ||
98 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info); | 103 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, |
104 | struct device *parent); | ||
99 | 105 | ||
100 | /** | 106 | /** |
101 | * ptp_clock_unregister() - unregister a PTP hardware clock driver | 107 | * ptp_clock_unregister() - unregister a PTP hardware clock driver |
@@ -110,6 +116,7 @@ enum ptp_clock_events { | |||
110 | PTP_CLOCK_ALARM, | 116 | PTP_CLOCK_ALARM, |
111 | PTP_CLOCK_EXTTS, | 117 | PTP_CLOCK_EXTTS, |
112 | PTP_CLOCK_PPS, | 118 | PTP_CLOCK_PPS, |
119 | PTP_CLOCK_PPSUSR, | ||
113 | }; | 120 | }; |
114 | 121 | ||
115 | /** | 122 | /** |
@@ -117,13 +124,17 @@ enum ptp_clock_events { | |||
117 | * | 124 | * |
118 | * @type: One of the ptp_clock_events enumeration values. | 125 | * @type: One of the ptp_clock_events enumeration values. |
119 | * @index: Identifies the source of the event. | 126 | * @index: Identifies the source of the event. |
120 | * @timestamp: When the event occured. | 127 | * @timestamp: When the event occurred (%PTP_CLOCK_EXTTS only). |
128 | * @pps_times: When the event occurred (%PTP_CLOCK_PPSUSR only). | ||
121 | */ | 129 | */ |
122 | 130 | ||
123 | struct ptp_clock_event { | 131 | struct ptp_clock_event { |
124 | int type; | 132 | int type; |
125 | int index; | 133 | int index; |
126 | u64 timestamp; | 134 | union { |
135 | u64 timestamp; | ||
136 | struct pps_event_time pps_times; | ||
137 | }; | ||
127 | }; | 138 | }; |
128 | 139 | ||
129 | /** | 140 | /** |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 597e4fdb97fe..3db698aee34c 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -130,8 +130,6 @@ extern void exit_ptrace(struct task_struct *tracer); | |||
130 | #define PTRACE_MODE_READ 0x01 | 130 | #define PTRACE_MODE_READ 0x01 |
131 | #define PTRACE_MODE_ATTACH 0x02 | 131 | #define PTRACE_MODE_ATTACH 0x02 |
132 | #define PTRACE_MODE_NOAUDIT 0x04 | 132 | #define PTRACE_MODE_NOAUDIT 0x04 |
133 | /* Returns 0 on success, -errno on denial. */ | ||
134 | extern int __ptrace_may_access(struct task_struct *task, unsigned int mode); | ||
135 | /* Returns true on success, false on denial. */ | 133 | /* Returns true on success, false on denial. */ |
136 | extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); | 134 | extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); |
137 | 135 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index 524ede8a160a..dcd5721e626d 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -181,10 +181,135 @@ enum { | |||
181 | #include <linux/dqblk_v2.h> | 181 | #include <linux/dqblk_v2.h> |
182 | 182 | ||
183 | #include <linux/atomic.h> | 183 | #include <linux/atomic.h> |
184 | #include <linux/uidgid.h> | ||
185 | #include <linux/projid.h> | ||
186 | |||
187 | #undef USRQUOTA | ||
188 | #undef GRPQUOTA | ||
189 | enum quota_type { | ||
190 | USRQUOTA = 0, /* element used for user quotas */ | ||
191 | GRPQUOTA = 1, /* element used for group quotas */ | ||
192 | PRJQUOTA = 2, /* element used for project quotas */ | ||
193 | }; | ||
184 | 194 | ||
185 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 195 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ |
186 | typedef long long qsize_t; /* Type in which we store sizes */ | 196 | typedef long long qsize_t; /* Type in which we store sizes */ |
187 | 197 | ||
198 | struct kqid { /* Type in which we store the quota identifier */ | ||
199 | union { | ||
200 | kuid_t uid; | ||
201 | kgid_t gid; | ||
202 | kprojid_t projid; | ||
203 | }; | ||
204 | enum quota_type type; /* USRQUOTA (uid) or GRPQUOTA (gid) or PRJQUOTA (projid) */ | ||
205 | }; | ||
206 | |||
207 | extern bool qid_eq(struct kqid left, struct kqid right); | ||
208 | extern bool qid_lt(struct kqid left, struct kqid right); | ||
209 | extern qid_t from_kqid(struct user_namespace *to, struct kqid qid); | ||
210 | extern qid_t from_kqid_munged(struct user_namespace *to, struct kqid qid); | ||
211 | extern bool qid_valid(struct kqid qid); | ||
212 | |||
213 | /** | ||
214 | * make_kqid - Map a user-namespace, type, qid tuple into a kqid. | ||
215 | * @from: User namespace that the qid is in | ||
216 | * @type: The type of quota | ||
217 | * @qid: Quota identifier | ||
218 | * | ||
219 | * Maps a user-namespace, type qid tuple into a kernel internal | ||
220 | * kqid, and returns that kqid. | ||
221 | * | ||
222 | * When there is no mapping defined for the user-namespace, type, | ||
223 | * qid tuple an invalid kqid is returned. Callers are expected to | ||
224 | * test for and handle handle invalid kqids being returned. | ||
225 | * Invalid kqids may be tested for using qid_valid(). | ||
226 | */ | ||
227 | static inline struct kqid make_kqid(struct user_namespace *from, | ||
228 | enum quota_type type, qid_t qid) | ||
229 | { | ||
230 | struct kqid kqid; | ||
231 | |||
232 | kqid.type = type; | ||
233 | switch (type) { | ||
234 | case USRQUOTA: | ||
235 | kqid.uid = make_kuid(from, qid); | ||
236 | break; | ||
237 | case GRPQUOTA: | ||
238 | kqid.gid = make_kgid(from, qid); | ||
239 | break; | ||
240 | case PRJQUOTA: | ||
241 | kqid.projid = make_kprojid(from, qid); | ||
242 | break; | ||
243 | default: | ||
244 | BUG(); | ||
245 | } | ||
246 | return kqid; | ||
247 | } | ||
248 | |||
249 | /** | ||
250 | * make_kqid_invalid - Explicitly make an invalid kqid | ||
251 | * @type: The type of quota identifier | ||
252 | * | ||
253 | * Returns an invalid kqid with the specified type. | ||
254 | */ | ||
255 | static inline struct kqid make_kqid_invalid(enum quota_type type) | ||
256 | { | ||
257 | struct kqid kqid; | ||
258 | |||
259 | kqid.type = type; | ||
260 | switch (type) { | ||
261 | case USRQUOTA: | ||
262 | kqid.uid = INVALID_UID; | ||
263 | break; | ||
264 | case GRPQUOTA: | ||
265 | kqid.gid = INVALID_GID; | ||
266 | break; | ||
267 | case PRJQUOTA: | ||
268 | kqid.projid = INVALID_PROJID; | ||
269 | break; | ||
270 | default: | ||
271 | BUG(); | ||
272 | } | ||
273 | return kqid; | ||
274 | } | ||
275 | |||
276 | /** | ||
277 | * make_kqid_uid - Make a kqid from a kuid | ||
278 | * @uid: The kuid to make the quota identifier from | ||
279 | */ | ||
280 | static inline struct kqid make_kqid_uid(kuid_t uid) | ||
281 | { | ||
282 | struct kqid kqid; | ||
283 | kqid.type = USRQUOTA; | ||
284 | kqid.uid = uid; | ||
285 | return kqid; | ||
286 | } | ||
287 | |||
288 | /** | ||
289 | * make_kqid_gid - Make a kqid from a kgid | ||
290 | * @gid: The kgid to make the quota identifier from | ||
291 | */ | ||
292 | static inline struct kqid make_kqid_gid(kgid_t gid) | ||
293 | { | ||
294 | struct kqid kqid; | ||
295 | kqid.type = GRPQUOTA; | ||
296 | kqid.gid = gid; | ||
297 | return kqid; | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * make_kqid_projid - Make a kqid from a projid | ||
302 | * @projid: The kprojid to make the quota identifier from | ||
303 | */ | ||
304 | static inline struct kqid make_kqid_projid(kprojid_t projid) | ||
305 | { | ||
306 | struct kqid kqid; | ||
307 | kqid.type = PRJQUOTA; | ||
308 | kqid.projid = projid; | ||
309 | return kqid; | ||
310 | } | ||
311 | |||
312 | |||
188 | extern spinlock_t dq_data_lock; | 313 | extern spinlock_t dq_data_lock; |
189 | 314 | ||
190 | /* Maximal numbers of writes for quota operation (insert/delete/update) | 315 | /* Maximal numbers of writes for quota operation (insert/delete/update) |
@@ -294,10 +419,9 @@ struct dquot { | |||
294 | atomic_t dq_count; /* Use count */ | 419 | atomic_t dq_count; /* Use count */ |
295 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ | 420 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ |
296 | struct super_block *dq_sb; /* superblock this applies to */ | 421 | struct super_block *dq_sb; /* superblock this applies to */ |
297 | unsigned int dq_id; /* ID this applies to (uid, gid) */ | 422 | struct kqid dq_id; /* ID this applies to (uid, gid, projid) */ |
298 | loff_t dq_off; /* Offset of dquot on disk */ | 423 | loff_t dq_off; /* Offset of dquot on disk */ |
299 | unsigned long dq_flags; /* See DQ_* */ | 424 | unsigned long dq_flags; /* See DQ_* */ |
300 | short dq_type; /* Type of quota */ | ||
301 | struct mem_dqblk dq_dqb; /* Diskquota usage */ | 425 | struct mem_dqblk dq_dqb; /* Diskquota usage */ |
302 | }; | 426 | }; |
303 | 427 | ||
@@ -336,8 +460,8 @@ struct quotactl_ops { | |||
336 | int (*quota_sync)(struct super_block *, int); | 460 | int (*quota_sync)(struct super_block *, int); |
337 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 461 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
338 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); | 462 | int (*set_info)(struct super_block *, int, struct if_dqinfo *); |
339 | int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); | 463 | int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); |
340 | int (*set_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *); | 464 | int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); |
341 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); | 465 | int (*get_xstate)(struct super_block *, struct fs_quota_stat *); |
342 | int (*set_xstate)(struct super_block *, unsigned int, int); | 466 | int (*set_xstate)(struct super_block *, unsigned int, int); |
343 | }; | 467 | }; |
@@ -386,10 +510,10 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | |||
386 | } | 510 | } |
387 | 511 | ||
388 | #ifdef CONFIG_QUOTA_NETLINK_INTERFACE | 512 | #ifdef CONFIG_QUOTA_NETLINK_INTERFACE |
389 | extern void quota_send_warning(short type, unsigned int id, dev_t dev, | 513 | extern void quota_send_warning(struct kqid qid, dev_t dev, |
390 | const char warntype); | 514 | const char warntype); |
391 | #else | 515 | #else |
392 | static inline void quota_send_warning(short type, unsigned int id, dev_t dev, | 516 | static inline void quota_send_warning(struct kqid qid, dev_t dev, |
393 | const char warntype) | 517 | const char warntype) |
394 | { | 518 | { |
395 | return; | 519 | return; |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index ec6b65feaaba..1c50093ae656 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -44,7 +44,7 @@ void inode_sub_rsv_space(struct inode *inode, qsize_t number); | |||
44 | 44 | ||
45 | void dquot_initialize(struct inode *inode); | 45 | void dquot_initialize(struct inode *inode); |
46 | void dquot_drop(struct inode *inode); | 46 | void dquot_drop(struct inode *inode); |
47 | struct dquot *dqget(struct super_block *sb, unsigned int id, int type); | 47 | struct dquot *dqget(struct super_block *sb, struct kqid qid); |
48 | void dqput(struct dquot *dquot); | 48 | void dqput(struct dquot *dquot); |
49 | int dquot_scan_active(struct super_block *sb, | 49 | int dquot_scan_active(struct super_block *sb, |
50 | int (*fn)(struct dquot *dquot, unsigned long priv), | 50 | int (*fn)(struct dquot *dquot, unsigned long priv), |
@@ -87,9 +87,9 @@ int dquot_writeback_dquots(struct super_block *sb, int type); | |||
87 | int dquot_quota_sync(struct super_block *sb, int type); | 87 | int dquot_quota_sync(struct super_block *sb, int type); |
88 | int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 88 | int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
89 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 89 | int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
90 | int dquot_get_dqblk(struct super_block *sb, int type, qid_t id, | 90 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, |
91 | struct fs_disk_quota *di); | 91 | struct fs_disk_quota *di); |
92 | int dquot_set_dqblk(struct super_block *sb, int type, qid_t id, | 92 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, |
93 | struct fs_disk_quota *di); | 93 | struct fs_disk_quota *di); |
94 | 94 | ||
95 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); | 95 | int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 115ead2b5155..7c968e4f929e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -191,6 +191,21 @@ extern void rcu_idle_enter(void); | |||
191 | extern void rcu_idle_exit(void); | 191 | extern void rcu_idle_exit(void); |
192 | extern void rcu_irq_enter(void); | 192 | extern void rcu_irq_enter(void); |
193 | extern void rcu_irq_exit(void); | 193 | extern void rcu_irq_exit(void); |
194 | |||
195 | #ifdef CONFIG_RCU_USER_QS | ||
196 | extern void rcu_user_enter(void); | ||
197 | extern void rcu_user_exit(void); | ||
198 | extern void rcu_user_enter_after_irq(void); | ||
199 | extern void rcu_user_exit_after_irq(void); | ||
200 | extern void rcu_user_hooks_switch(struct task_struct *prev, | ||
201 | struct task_struct *next); | ||
202 | #else | ||
203 | static inline void rcu_user_enter(void) { } | ||
204 | static inline void rcu_user_exit(void) { } | ||
205 | static inline void rcu_user_enter_after_irq(void) { } | ||
206 | static inline void rcu_user_exit_after_irq(void) { } | ||
207 | #endif /* CONFIG_RCU_USER_QS */ | ||
208 | |||
194 | extern void exit_rcu(void); | 209 | extern void exit_rcu(void); |
195 | 210 | ||
196 | /** | 211 | /** |
@@ -210,14 +225,12 @@ extern void exit_rcu(void); | |||
210 | * to nest RCU_NONIDLE() wrappers, but the nesting level is currently | 225 | * to nest RCU_NONIDLE() wrappers, but the nesting level is currently |
211 | * quite limited. If deeper nesting is required, it will be necessary | 226 | * quite limited. If deeper nesting is required, it will be necessary |
212 | * to adjust DYNTICK_TASK_NESTING_VALUE accordingly. | 227 | * to adjust DYNTICK_TASK_NESTING_VALUE accordingly. |
213 | * | ||
214 | * This macro may be used from process-level code only. | ||
215 | */ | 228 | */ |
216 | #define RCU_NONIDLE(a) \ | 229 | #define RCU_NONIDLE(a) \ |
217 | do { \ | 230 | do { \ |
218 | rcu_idle_exit(); \ | 231 | rcu_irq_enter(); \ |
219 | do { a; } while (0); \ | 232 | do { a; } while (0); \ |
220 | rcu_idle_enter(); \ | 233 | rcu_irq_exit(); \ |
221 | } while (0) | 234 | } while (0) |
222 | 235 | ||
223 | /* | 236 | /* |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 7f7e00df3adf..e3bcc3f4dcb8 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -285,6 +285,7 @@ struct regmap_irq { | |||
285 | * @ack_base: Base ack address. If zero then the chip is clear on read. | 285 | * @ack_base: Base ack address. If zero then the chip is clear on read. |
286 | * @wake_base: Base address for wake enables. If zero unsupported. | 286 | * @wake_base: Base address for wake enables. If zero unsupported. |
287 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. | 287 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. |
288 | * @runtime_pm: Hold a runtime PM lock on the device when accessing it. | ||
288 | * | 289 | * |
289 | * @num_regs: Number of registers in each control bank. | 290 | * @num_regs: Number of registers in each control bank. |
290 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are | 291 | * @irqs: Descriptors for individual IRQs. Interrupt numbers are |
@@ -299,6 +300,8 @@ struct regmap_irq_chip { | |||
299 | unsigned int ack_base; | 300 | unsigned int ack_base; |
300 | unsigned int wake_base; | 301 | unsigned int wake_base; |
301 | unsigned int irq_reg_stride; | 302 | unsigned int irq_reg_stride; |
303 | unsigned int mask_invert; | ||
304 | bool runtime_pm; | ||
302 | 305 | ||
303 | int num_regs; | 306 | int num_regs; |
304 | 307 | ||
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index da339fd8c755..c43cd3556b1f 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -177,6 +177,8 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode); | |||
177 | unsigned int regulator_get_mode(struct regulator *regulator); | 177 | unsigned int regulator_get_mode(struct regulator *regulator); |
178 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | 178 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); |
179 | 179 | ||
180 | int regulator_allow_bypass(struct regulator *regulator, bool allow); | ||
181 | |||
180 | /* regulator notifier block */ | 182 | /* regulator notifier block */ |
181 | int regulator_register_notifier(struct regulator *regulator, | 183 | int regulator_register_notifier(struct regulator *regulator, |
182 | struct notifier_block *nb); | 184 | struct notifier_block *nb); |
@@ -328,6 +330,12 @@ static inline int regulator_set_optimum_mode(struct regulator *regulator, | |||
328 | return REGULATOR_MODE_NORMAL; | 330 | return REGULATOR_MODE_NORMAL; |
329 | } | 331 | } |
330 | 332 | ||
333 | static inline int regulator_allow_bypass(struct regulator *regulator, | ||
334 | bool allow) | ||
335 | { | ||
336 | return 0; | ||
337 | } | ||
338 | |||
331 | static inline int regulator_register_notifier(struct regulator *regulator, | 339 | static inline int regulator_register_notifier(struct regulator *regulator, |
332 | struct notifier_block *nb) | 340 | struct notifier_block *nb) |
333 | { | 341 | { |
@@ -352,4 +360,11 @@ static inline void regulator_set_drvdata(struct regulator *regulator, | |||
352 | 360 | ||
353 | #endif | 361 | #endif |
354 | 362 | ||
363 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | ||
364 | int new_uV, int tol_uV) | ||
365 | { | ||
366 | return regulator_set_voltage(regulator, | ||
367 | new_uV - tol_uV, new_uV + tol_uV); | ||
368 | } | ||
369 | |||
355 | #endif | 370 | #endif |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index bac4c871f3bd..7932a3bf21bd 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -32,6 +32,8 @@ enum regulator_status { | |||
32 | REGULATOR_STATUS_NORMAL, | 32 | REGULATOR_STATUS_NORMAL, |
33 | REGULATOR_STATUS_IDLE, | 33 | REGULATOR_STATUS_IDLE, |
34 | REGULATOR_STATUS_STANDBY, | 34 | REGULATOR_STATUS_STANDBY, |
35 | /* The regulator is enabled but not regulating */ | ||
36 | REGULATOR_STATUS_BYPASS, | ||
35 | /* in case that any other status doesn't apply */ | 37 | /* in case that any other status doesn't apply */ |
36 | REGULATOR_STATUS_UNDEFINED, | 38 | REGULATOR_STATUS_UNDEFINED, |
37 | }; | 39 | }; |
@@ -58,6 +60,7 @@ enum regulator_status { | |||
58 | * regulator_desc.n_voltages. Voltages may be reported in any order. | 60 | * regulator_desc.n_voltages. Voltages may be reported in any order. |
59 | * | 61 | * |
60 | * @set_current_limit: Configure a limit for a current-limited regulator. | 62 | * @set_current_limit: Configure a limit for a current-limited regulator. |
63 | * The driver should select the current closest to max_uA. | ||
61 | * @get_current_limit: Get the configured limit for a current-limited regulator. | 64 | * @get_current_limit: Get the configured limit for a current-limited regulator. |
62 | * | 65 | * |
63 | * @set_mode: Set the configured operating mode for the regulator. | 66 | * @set_mode: Set the configured operating mode for the regulator. |
@@ -67,6 +70,9 @@ enum regulator_status { | |||
67 | * @get_optimum_mode: Get the most efficient operating mode for the regulator | 70 | * @get_optimum_mode: Get the most efficient operating mode for the regulator |
68 | * when running with the specified parameters. | 71 | * when running with the specified parameters. |
69 | * | 72 | * |
73 | * @set_bypass: Set the regulator in bypass mode. | ||
74 | * @get_bypass: Get the regulator bypass mode state. | ||
75 | * | ||
70 | * @enable_time: Time taken for the regulator voltage output voltage to | 76 | * @enable_time: Time taken for the regulator voltage output voltage to |
71 | * stabilise after being enabled, in microseconds. | 77 | * stabilise after being enabled, in microseconds. |
72 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should | 78 | * @set_ramp_delay: Set the ramp delay for the regulator. The driver should |
@@ -133,6 +139,10 @@ struct regulator_ops { | |||
133 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, | 139 | unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV, |
134 | int output_uV, int load_uA); | 140 | int output_uV, int load_uA); |
135 | 141 | ||
142 | /* control and report on bypass mode */ | ||
143 | int (*set_bypass)(struct regulator_dev *dev, bool enable); | ||
144 | int (*get_bypass)(struct regulator_dev *dev, bool *enable); | ||
145 | |||
136 | /* the operations below are for configuration of regulator state when | 146 | /* the operations below are for configuration of regulator state when |
137 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ | 147 | * its parent PMIC enters a global STANDBY/HIBERNATE state */ |
138 | 148 | ||
@@ -205,6 +215,8 @@ struct regulator_desc { | |||
205 | unsigned int vsel_mask; | 215 | unsigned int vsel_mask; |
206 | unsigned int enable_reg; | 216 | unsigned int enable_reg; |
207 | unsigned int enable_mask; | 217 | unsigned int enable_mask; |
218 | unsigned int bypass_reg; | ||
219 | unsigned int bypass_mask; | ||
208 | 220 | ||
209 | unsigned int enable_time; | 221 | unsigned int enable_time; |
210 | }; | 222 | }; |
@@ -221,7 +233,8 @@ struct regulator_desc { | |||
221 | * @driver_data: private regulator data | 233 | * @driver_data: private regulator data |
222 | * @of_node: OpenFirmware node to parse for device tree bindings (may be | 234 | * @of_node: OpenFirmware node to parse for device tree bindings (may be |
223 | * NULL). | 235 | * NULL). |
224 | * @regmap: regmap to use for core regmap helpers | 236 | * @regmap: regmap to use for core regmap helpers if dev_get_regulator() is |
237 | * insufficient. | ||
225 | * @ena_gpio: GPIO controlling regulator enable. | 238 | * @ena_gpio: GPIO controlling regulator enable. |
226 | * @ena_gpio_invert: Sense for GPIO enable control. | 239 | * @ena_gpio_invert: Sense for GPIO enable control. |
227 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() | 240 | * @ena_gpio_flags: Flags to use when calling gpio_request_one() |
@@ -253,6 +266,7 @@ struct regulator_dev { | |||
253 | int exclusive; | 266 | int exclusive; |
254 | u32 use_count; | 267 | u32 use_count; |
255 | u32 open_count; | 268 | u32 open_count; |
269 | u32 bypass_count; | ||
256 | 270 | ||
257 | /* lists we belong to */ | 271 | /* lists we belong to */ |
258 | struct list_head list; /* list of all regulators */ | 272 | struct list_head list; /* list of all regulators */ |
@@ -310,6 +324,8 @@ int regulator_disable_regmap(struct regulator_dev *rdev); | |||
310 | int regulator_set_voltage_time_sel(struct regulator_dev *rdev, | 324 | int regulator_set_voltage_time_sel(struct regulator_dev *rdev, |
311 | unsigned int old_selector, | 325 | unsigned int old_selector, |
312 | unsigned int new_selector); | 326 | unsigned int new_selector); |
327 | int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable); | ||
328 | int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable); | ||
313 | 329 | ||
314 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); | 330 | void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); |
315 | 331 | ||
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h new file mode 100644 index 000000000000..5c45c85d52ca --- /dev/null +++ b/include/linux/regulator/fan53555.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * fan53555.h - Fairchild Regulator FAN53555 Driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Marvell Technology Ltd. | ||
5 | * Yunfan Zhang <yfzhang@marvell.com> | ||
6 | * | ||
7 | * This package 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 __FAN53555_H__ | ||
14 | |||
15 | /* VSEL ID */ | ||
16 | enum { | ||
17 | FAN53555_VSEL_ID_0 = 0, | ||
18 | FAN53555_VSEL_ID_1, | ||
19 | }; | ||
20 | |||
21 | /* Transition slew rate limiting from a low to high voltage. | ||
22 | * ----------------------- | ||
23 | * Bin |Slew Rate(mV/uS) | ||
24 | * ------|---------------- | ||
25 | * 000 | 64.00 | ||
26 | * ------|---------------- | ||
27 | * 001 | 32.00 | ||
28 | * ------|---------------- | ||
29 | * 010 | 16.00 | ||
30 | * ------|---------------- | ||
31 | * 011 | 8.00 | ||
32 | * ------|---------------- | ||
33 | * 100 | 4.00 | ||
34 | * ------|---------------- | ||
35 | * 101 | 2.00 | ||
36 | * ------|---------------- | ||
37 | * 110 | 1.00 | ||
38 | * ------|---------------- | ||
39 | * 111 | 0.50 | ||
40 | * ----------------------- | ||
41 | */ | ||
42 | enum { | ||
43 | FAN53555_SLEW_RATE_64MV = 0, | ||
44 | FAN53555_SLEW_RATE_32MV, | ||
45 | FAN53555_SLEW_RATE_16MV, | ||
46 | FAN53555_SLEW_RATE_8MV, | ||
47 | FAN53555_SLEW_RATE_4MV, | ||
48 | FAN53555_SLEW_RATE_2MV, | ||
49 | FAN53555_SLEW_RATE_1MV, | ||
50 | FAN53555_SLEW_RATE_0_5MV, | ||
51 | }; | ||
52 | |||
53 | struct fan53555_platform_data { | ||
54 | struct regulator_init_data *regulator; | ||
55 | unsigned int slew_rate; | ||
56 | /* Sleep VSEL ID */ | ||
57 | unsigned int sleep_vsel_id; | ||
58 | }; | ||
59 | |||
60 | #endif /* __FAN53555_H__ */ | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 40dd0a394cfa..36adbc82de6a 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -32,6 +32,7 @@ struct regulator; | |||
32 | * board/machine. | 32 | * board/machine. |
33 | * STATUS: Regulator can be enabled and disabled. | 33 | * STATUS: Regulator can be enabled and disabled. |
34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. | 34 | * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator. |
35 | * BYPASS: Regulator can be put into bypass mode | ||
35 | */ | 36 | */ |
36 | 37 | ||
37 | #define REGULATOR_CHANGE_VOLTAGE 0x1 | 38 | #define REGULATOR_CHANGE_VOLTAGE 0x1 |
@@ -39,6 +40,7 @@ struct regulator; | |||
39 | #define REGULATOR_CHANGE_MODE 0x4 | 40 | #define REGULATOR_CHANGE_MODE 0x4 |
40 | #define REGULATOR_CHANGE_STATUS 0x8 | 41 | #define REGULATOR_CHANGE_STATUS 0x8 |
41 | #define REGULATOR_CHANGE_DRMS 0x10 | 42 | #define REGULATOR_CHANGE_DRMS 0x10 |
43 | #define REGULATOR_CHANGE_BYPASS 0x20 | ||
42 | 44 | ||
43 | /** | 45 | /** |
44 | * struct regulator_state - regulator state during low power system states | 46 | * struct regulator_state - regulator state during low power system states |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 6fdf02737e9d..0ec590bb3611 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -354,6 +354,37 @@ static inline bool rfkill_blocked(struct rfkill *rfkill) | |||
354 | } | 354 | } |
355 | #endif /* RFKILL || RFKILL_MODULE */ | 355 | #endif /* RFKILL || RFKILL_MODULE */ |
356 | 356 | ||
357 | |||
358 | #ifdef CONFIG_RFKILL_LEDS | ||
359 | /** | ||
360 | * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED. | ||
361 | * This function might return a NULL pointer if registering of the | ||
362 | * LED trigger failed. Use this as "default_trigger" for the LED. | ||
363 | */ | ||
364 | const char *rfkill_get_led_trigger_name(struct rfkill *rfkill); | ||
365 | |||
366 | /** | ||
367 | * rfkill_set_led_trigger_name -- set the LED trigger name | ||
368 | * @rfkill: rfkill struct | ||
369 | * @name: LED trigger name | ||
370 | * | ||
371 | * This function sets the LED trigger name of the radio LED | ||
372 | * trigger that rfkill creates. It is optional, but if called | ||
373 | * must be called before rfkill_register() to be effective. | ||
374 | */ | ||
375 | void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); | ||
376 | #else | ||
377 | static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) | ||
378 | { | ||
379 | return NULL; | ||
380 | } | ||
381 | |||
382 | static inline void | ||
383 | rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) | ||
384 | { | ||
385 | } | ||
386 | #endif | ||
387 | |||
357 | #endif /* __KERNEL__ */ | 388 | #endif /* __KERNEL__ */ |
358 | 389 | ||
359 | #endif /* RFKILL_H */ | 390 | #endif /* RFKILL_H */ |
diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h deleted file mode 100644 index 7ca35abad387..000000000000 --- a/include/linux/sc26198.h +++ /dev/null | |||
@@ -1,533 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * sc26198.h -- SC26198 UART hardware info. | ||
5 | * | ||
6 | * Copyright (C) 1995-1998 Stallion Technologies | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | /*****************************************************************************/ | ||
24 | #ifndef _SC26198_H | ||
25 | #define _SC26198_H | ||
26 | /*****************************************************************************/ | ||
27 | |||
28 | /* | ||
29 | * Define the number of async ports per sc26198 uart device. | ||
30 | */ | ||
31 | #define SC26198_PORTS 8 | ||
32 | |||
33 | /* | ||
34 | * Baud rate timing clocks. All derived from a master 14.7456 MHz clock. | ||
35 | */ | ||
36 | #define SC26198_MASTERCLOCK 14745600L | ||
37 | #define SC26198_DCLK (SC26198_MASTERCLOCK) | ||
38 | #define SC26198_CCLK (SC26198_MASTERCLOCK / 2) | ||
39 | #define SC26198_BCLK (SC26198_MASTERCLOCK / 4) | ||
40 | |||
41 | /* | ||
42 | * Define internal FIFO sizes for the 26198 ports. | ||
43 | */ | ||
44 | #define SC26198_TXFIFOSIZE 16 | ||
45 | #define SC26198_RXFIFOSIZE 16 | ||
46 | |||
47 | /*****************************************************************************/ | ||
48 | |||
49 | /* | ||
50 | * Global register definitions. These registers are global to each 26198 | ||
51 | * device, not specific ports on it. | ||
52 | */ | ||
53 | #define TSTR 0x0d | ||
54 | #define GCCR 0x0f | ||
55 | #define ICR 0x1b | ||
56 | #define WDTRCR 0x1d | ||
57 | #define IVR 0x1f | ||
58 | #define BRGTRUA 0x84 | ||
59 | #define GPOSR 0x87 | ||
60 | #define GPOC 0x8b | ||
61 | #define UCIR 0x8c | ||
62 | #define CIR 0x8c | ||
63 | #define BRGTRUB 0x8d | ||
64 | #define GRXFIFO 0x8e | ||
65 | #define GTXFIFO 0x8e | ||
66 | #define GCCR2 0x8f | ||
67 | #define BRGTRLA 0x94 | ||
68 | #define GPOR 0x97 | ||
69 | #define GPOD 0x9b | ||
70 | #define BRGTCR 0x9c | ||
71 | #define GICR 0x9c | ||
72 | #define BRGTRLB 0x9d | ||
73 | #define GIBCR 0x9d | ||
74 | #define GITR 0x9f | ||
75 | |||
76 | /* | ||
77 | * Per port channel registers. These are the register offsets within | ||
78 | * the port address space, so need to have the port address (0 to 7) | ||
79 | * inserted in bit positions 4:6. | ||
80 | */ | ||
81 | #define MR0 0x00 | ||
82 | #define MR1 0x01 | ||
83 | #define IOPCR 0x02 | ||
84 | #define BCRBRK 0x03 | ||
85 | #define BCRCOS 0x04 | ||
86 | #define BCRX 0x06 | ||
87 | #define BCRA 0x07 | ||
88 | #define XONCR 0x08 | ||
89 | #define XOFFCR 0x09 | ||
90 | #define ARCR 0x0a | ||
91 | #define RXCSR 0x0c | ||
92 | #define TXCSR 0x0e | ||
93 | #define MR2 0x80 | ||
94 | #define SR 0x81 | ||
95 | #define SCCR 0x81 | ||
96 | #define ISR 0x82 | ||
97 | #define IMR 0x82 | ||
98 | #define TXFIFO 0x83 | ||
99 | #define RXFIFO 0x83 | ||
100 | #define IPR 0x84 | ||
101 | #define IOPIOR 0x85 | ||
102 | #define XISR 0x86 | ||
103 | |||
104 | /* | ||
105 | * For any given port calculate the address to use to access a specified | ||
106 | * register. This is only used for unusual access, mostly this is done | ||
107 | * through the assembler access routines. | ||
108 | */ | ||
109 | #define SC26198_PORTREG(port,reg) ((((port) & 0x07) << 4) | (reg)) | ||
110 | |||
111 | /*****************************************************************************/ | ||
112 | |||
113 | /* | ||
114 | * Global configuration control register bit definitions. | ||
115 | */ | ||
116 | #define GCCR_NOACK 0x00 | ||
117 | #define GCCR_IVRACK 0x02 | ||
118 | #define GCCR_IVRCHANACK 0x04 | ||
119 | #define GCCR_IVRTYPCHANACK 0x06 | ||
120 | #define GCCR_ASYNCCYCLE 0x00 | ||
121 | #define GCCR_SYNCCYCLE 0x40 | ||
122 | |||
123 | /*****************************************************************************/ | ||
124 | |||
125 | /* | ||
126 | * Mode register 0 bit definitions. | ||
127 | */ | ||
128 | #define MR0_ADDRNONE 0x00 | ||
129 | #define MR0_AUTOWAKE 0x01 | ||
130 | #define MR0_AUTODOZE 0x02 | ||
131 | #define MR0_AUTOWAKEDOZE 0x03 | ||
132 | #define MR0_SWFNONE 0x00 | ||
133 | #define MR0_SWFTX 0x04 | ||
134 | #define MR0_SWFRX 0x08 | ||
135 | #define MR0_SWFRXTX 0x0c | ||
136 | #define MR0_TXMASK 0x30 | ||
137 | #define MR0_TXEMPTY 0x00 | ||
138 | #define MR0_TXHIGH 0x10 | ||
139 | #define MR0_TXHALF 0x20 | ||
140 | #define MR0_TXRDY 0x00 | ||
141 | #define MR0_ADDRNT 0x00 | ||
142 | #define MR0_ADDRT 0x40 | ||
143 | #define MR0_SWFNT 0x00 | ||
144 | #define MR0_SWFT 0x80 | ||
145 | |||
146 | /* | ||
147 | * Mode register 1 bit definitions. | ||
148 | */ | ||
149 | #define MR1_CS5 0x00 | ||
150 | #define MR1_CS6 0x01 | ||
151 | #define MR1_CS7 0x02 | ||
152 | #define MR1_CS8 0x03 | ||
153 | #define MR1_PAREVEN 0x00 | ||
154 | #define MR1_PARODD 0x04 | ||
155 | #define MR1_PARENB 0x00 | ||
156 | #define MR1_PARFORCE 0x08 | ||
157 | #define MR1_PARNONE 0x10 | ||
158 | #define MR1_PARSPECIAL 0x18 | ||
159 | #define MR1_ERRCHAR 0x00 | ||
160 | #define MR1_ERRBLOCK 0x20 | ||
161 | #define MR1_ISRUNMASKED 0x00 | ||
162 | #define MR1_ISRMASKED 0x40 | ||
163 | #define MR1_AUTORTS 0x80 | ||
164 | |||
165 | /* | ||
166 | * Mode register 2 bit definitions. | ||
167 | */ | ||
168 | #define MR2_STOP1 0x00 | ||
169 | #define MR2_STOP15 0x01 | ||
170 | #define MR2_STOP2 0x02 | ||
171 | #define MR2_STOP916 0x03 | ||
172 | #define MR2_RXFIFORDY 0x00 | ||
173 | #define MR2_RXFIFOHALF 0x04 | ||
174 | #define MR2_RXFIFOHIGH 0x08 | ||
175 | #define MR2_RXFIFOFULL 0x0c | ||
176 | #define MR2_AUTOCTS 0x10 | ||
177 | #define MR2_TXRTS 0x20 | ||
178 | #define MR2_MODENORM 0x00 | ||
179 | #define MR2_MODEAUTOECHO 0x40 | ||
180 | #define MR2_MODELOOP 0x80 | ||
181 | #define MR2_MODEREMECHO 0xc0 | ||
182 | |||
183 | /*****************************************************************************/ | ||
184 | |||
185 | /* | ||
186 | * Baud Rate Generator (BRG) selector values. | ||
187 | */ | ||
188 | #define BRG_50 0x00 | ||
189 | #define BRG_75 0x01 | ||
190 | #define BRG_150 0x02 | ||
191 | #define BRG_200 0x03 | ||
192 | #define BRG_300 0x04 | ||
193 | #define BRG_450 0x05 | ||
194 | #define BRG_600 0x06 | ||
195 | #define BRG_900 0x07 | ||
196 | #define BRG_1200 0x08 | ||
197 | #define BRG_1800 0x09 | ||
198 | #define BRG_2400 0x0a | ||
199 | #define BRG_3600 0x0b | ||
200 | #define BRG_4800 0x0c | ||
201 | #define BRG_7200 0x0d | ||
202 | #define BRG_9600 0x0e | ||
203 | #define BRG_14400 0x0f | ||
204 | #define BRG_19200 0x10 | ||
205 | #define BRG_28200 0x11 | ||
206 | #define BRG_38400 0x12 | ||
207 | #define BRG_57600 0x13 | ||
208 | #define BRG_115200 0x14 | ||
209 | #define BRG_230400 0x15 | ||
210 | #define BRG_GIN0 0x16 | ||
211 | #define BRG_GIN1 0x17 | ||
212 | #define BRG_CT0 0x18 | ||
213 | #define BRG_CT1 0x19 | ||
214 | #define BRG_RX2TX316 0x1b | ||
215 | #define BRG_RX2TX31 0x1c | ||
216 | |||
217 | #define SC26198_MAXBAUD 921600 | ||
218 | |||
219 | /*****************************************************************************/ | ||
220 | |||
221 | /* | ||
222 | * Command register command definitions. | ||
223 | */ | ||
224 | #define CR_NULL 0x04 | ||
225 | #define CR_ADDRNORMAL 0x0c | ||
226 | #define CR_RXRESET 0x14 | ||
227 | #define CR_TXRESET 0x1c | ||
228 | #define CR_CLEARRXERR 0x24 | ||
229 | #define CR_BREAKRESET 0x2c | ||
230 | #define CR_TXSTARTBREAK 0x34 | ||
231 | #define CR_TXSTOPBREAK 0x3c | ||
232 | #define CR_RTSON 0x44 | ||
233 | #define CR_RTSOFF 0x4c | ||
234 | #define CR_ADDRINIT 0x5c | ||
235 | #define CR_RXERRBLOCK 0x6c | ||
236 | #define CR_TXSENDXON 0x84 | ||
237 | #define CR_TXSENDXOFF 0x8c | ||
238 | #define CR_GANGXONSET 0x94 | ||
239 | #define CR_GANGXOFFSET 0x9c | ||
240 | #define CR_GANGXONINIT 0xa4 | ||
241 | #define CR_GANGXOFFINIT 0xac | ||
242 | #define CR_HOSTXON 0xb4 | ||
243 | #define CR_HOSTXOFF 0xbc | ||
244 | #define CR_CANCELXOFF 0xc4 | ||
245 | #define CR_ADDRRESET 0xdc | ||
246 | #define CR_RESETALLPORTS 0xf4 | ||
247 | #define CR_RESETALL 0xfc | ||
248 | |||
249 | #define CR_RXENABLE 0x01 | ||
250 | #define CR_TXENABLE 0x02 | ||
251 | |||
252 | /*****************************************************************************/ | ||
253 | |||
254 | /* | ||
255 | * Channel status register. | ||
256 | */ | ||
257 | #define SR_RXRDY 0x01 | ||
258 | #define SR_RXFULL 0x02 | ||
259 | #define SR_TXRDY 0x04 | ||
260 | #define SR_TXEMPTY 0x08 | ||
261 | #define SR_RXOVERRUN 0x10 | ||
262 | #define SR_RXPARITY 0x20 | ||
263 | #define SR_RXFRAMING 0x40 | ||
264 | #define SR_RXBREAK 0x80 | ||
265 | |||
266 | #define SR_RXERRS (SR_RXPARITY | SR_RXFRAMING | SR_RXOVERRUN) | ||
267 | |||
268 | /*****************************************************************************/ | ||
269 | |||
270 | /* | ||
271 | * Interrupt status register and interrupt mask register bit definitions. | ||
272 | */ | ||
273 | #define IR_TXRDY 0x01 | ||
274 | #define IR_RXRDY 0x02 | ||
275 | #define IR_RXBREAK 0x04 | ||
276 | #define IR_XONXOFF 0x10 | ||
277 | #define IR_ADDRRECOG 0x20 | ||
278 | #define IR_RXWATCHDOG 0x40 | ||
279 | #define IR_IOPORT 0x80 | ||
280 | |||
281 | /*****************************************************************************/ | ||
282 | |||
283 | /* | ||
284 | * Interrupt vector register field definitions. | ||
285 | */ | ||
286 | #define IVR_CHANMASK 0x07 | ||
287 | #define IVR_TYPEMASK 0x18 | ||
288 | #define IVR_CONSTMASK 0xc0 | ||
289 | |||
290 | #define IVR_RXDATA 0x10 | ||
291 | #define IVR_RXBADDATA 0x18 | ||
292 | #define IVR_TXDATA 0x08 | ||
293 | #define IVR_OTHER 0x00 | ||
294 | |||
295 | /*****************************************************************************/ | ||
296 | |||
297 | /* | ||
298 | * BRG timer control register bit definitions. | ||
299 | */ | ||
300 | #define BRGCTCR_DISABCLK0 0x00 | ||
301 | #define BRGCTCR_ENABCLK0 0x08 | ||
302 | #define BRGCTCR_DISABCLK1 0x00 | ||
303 | #define BRGCTCR_ENABCLK1 0x80 | ||
304 | |||
305 | #define BRGCTCR_0SCLK16 0x00 | ||
306 | #define BRGCTCR_0SCLK32 0x01 | ||
307 | #define BRGCTCR_0SCLK64 0x02 | ||
308 | #define BRGCTCR_0SCLK128 0x03 | ||
309 | #define BRGCTCR_0X1 0x04 | ||
310 | #define BRGCTCR_0X12 0x05 | ||
311 | #define BRGCTCR_0IO1A 0x06 | ||
312 | #define BRGCTCR_0GIN0 0x07 | ||
313 | |||
314 | #define BRGCTCR_1SCLK16 0x00 | ||
315 | #define BRGCTCR_1SCLK32 0x10 | ||
316 | #define BRGCTCR_1SCLK64 0x20 | ||
317 | #define BRGCTCR_1SCLK128 0x30 | ||
318 | #define BRGCTCR_1X1 0x40 | ||
319 | #define BRGCTCR_1X12 0x50 | ||
320 | #define BRGCTCR_1IO1B 0x60 | ||
321 | #define BRGCTCR_1GIN1 0x70 | ||
322 | |||
323 | /*****************************************************************************/ | ||
324 | |||
325 | /* | ||
326 | * Watch dog timer enable register. | ||
327 | */ | ||
328 | #define WDTRCR_ENABALL 0xff | ||
329 | |||
330 | /*****************************************************************************/ | ||
331 | |||
332 | /* | ||
333 | * XON/XOFF interrupt status register. | ||
334 | */ | ||
335 | #define XISR_TXCHARMASK 0x03 | ||
336 | #define XISR_TXCHARNORMAL 0x00 | ||
337 | #define XISR_TXWAIT 0x01 | ||
338 | #define XISR_TXXOFFPEND 0x02 | ||
339 | #define XISR_TXXONPEND 0x03 | ||
340 | |||
341 | #define XISR_TXFLOWMASK 0x0c | ||
342 | #define XISR_TXNORMAL 0x00 | ||
343 | #define XISR_TXSTOPPEND 0x04 | ||
344 | #define XISR_TXSTARTED 0x08 | ||
345 | #define XISR_TXSTOPPED 0x0c | ||
346 | |||
347 | #define XISR_RXFLOWMASK 0x30 | ||
348 | #define XISR_RXFLOWNONE 0x00 | ||
349 | #define XISR_RXXONSENT 0x10 | ||
350 | #define XISR_RXXOFFSENT 0x20 | ||
351 | |||
352 | #define XISR_RXXONGOT 0x40 | ||
353 | #define XISR_RXXOFFGOT 0x80 | ||
354 | |||
355 | /*****************************************************************************/ | ||
356 | |||
357 | /* | ||
358 | * Current interrupt register. | ||
359 | */ | ||
360 | #define CIR_TYPEMASK 0xc0 | ||
361 | #define CIR_TYPEOTHER 0x00 | ||
362 | #define CIR_TYPETX 0x40 | ||
363 | #define CIR_TYPERXGOOD 0x80 | ||
364 | #define CIR_TYPERXBAD 0xc0 | ||
365 | |||
366 | #define CIR_RXDATA 0x80 | ||
367 | #define CIR_RXBADDATA 0x40 | ||
368 | #define CIR_TXDATA 0x40 | ||
369 | |||
370 | #define CIR_CHANMASK 0x07 | ||
371 | #define CIR_CNTMASK 0x38 | ||
372 | |||
373 | #define CIR_SUBTYPEMASK 0x38 | ||
374 | #define CIR_SUBNONE 0x00 | ||
375 | #define CIR_SUBCOS 0x08 | ||
376 | #define CIR_SUBADDR 0x10 | ||
377 | #define CIR_SUBXONXOFF 0x18 | ||
378 | #define CIR_SUBBREAK 0x28 | ||
379 | |||
380 | /*****************************************************************************/ | ||
381 | |||
382 | /* | ||
383 | * Global interrupting channel register. | ||
384 | */ | ||
385 | #define GICR_CHANMASK 0x07 | ||
386 | |||
387 | /*****************************************************************************/ | ||
388 | |||
389 | /* | ||
390 | * Global interrupting byte count register. | ||
391 | */ | ||
392 | #define GICR_COUNTMASK 0x0f | ||
393 | |||
394 | /*****************************************************************************/ | ||
395 | |||
396 | /* | ||
397 | * Global interrupting type register. | ||
398 | */ | ||
399 | #define GITR_RXMASK 0xc0 | ||
400 | #define GITR_RXNONE 0x00 | ||
401 | #define GITR_RXBADDATA 0x80 | ||
402 | #define GITR_RXGOODDATA 0xc0 | ||
403 | #define GITR_TXDATA 0x20 | ||
404 | |||
405 | #define GITR_SUBTYPEMASK 0x07 | ||
406 | #define GITR_SUBNONE 0x00 | ||
407 | #define GITR_SUBCOS 0x01 | ||
408 | #define GITR_SUBADDR 0x02 | ||
409 | #define GITR_SUBXONXOFF 0x03 | ||
410 | #define GITR_SUBBREAK 0x05 | ||
411 | |||
412 | /*****************************************************************************/ | ||
413 | |||
414 | /* | ||
415 | * Input port change register. | ||
416 | */ | ||
417 | #define IPR_CTS 0x01 | ||
418 | #define IPR_DTR 0x02 | ||
419 | #define IPR_RTS 0x04 | ||
420 | #define IPR_DCD 0x08 | ||
421 | #define IPR_CTSCHANGE 0x10 | ||
422 | #define IPR_DTRCHANGE 0x20 | ||
423 | #define IPR_RTSCHANGE 0x40 | ||
424 | #define IPR_DCDCHANGE 0x80 | ||
425 | |||
426 | #define IPR_CHANGEMASK 0xf0 | ||
427 | |||
428 | /*****************************************************************************/ | ||
429 | |||
430 | /* | ||
431 | * IO port interrupt and output register. | ||
432 | */ | ||
433 | #define IOPR_CTS 0x01 | ||
434 | #define IOPR_DTR 0x02 | ||
435 | #define IOPR_RTS 0x04 | ||
436 | #define IOPR_DCD 0x08 | ||
437 | #define IOPR_CTSCOS 0x10 | ||
438 | #define IOPR_DTRCOS 0x20 | ||
439 | #define IOPR_RTSCOS 0x40 | ||
440 | #define IOPR_DCDCOS 0x80 | ||
441 | |||
442 | /*****************************************************************************/ | ||
443 | |||
444 | /* | ||
445 | * IO port configuration register. | ||
446 | */ | ||
447 | #define IOPCR_SETCTS 0x00 | ||
448 | #define IOPCR_SETDTR 0x04 | ||
449 | #define IOPCR_SETRTS 0x10 | ||
450 | #define IOPCR_SETDCD 0x00 | ||
451 | |||
452 | #define IOPCR_SETSIGS (IOPCR_SETRTS | IOPCR_SETRTS | IOPCR_SETDTR | IOPCR_SETDCD) | ||
453 | |||
454 | /*****************************************************************************/ | ||
455 | |||
456 | /* | ||
457 | * General purpose output select register. | ||
458 | */ | ||
459 | #define GPORS_TXC1XA 0x08 | ||
460 | #define GPORS_TXC16XA 0x09 | ||
461 | #define GPORS_RXC16XA 0x0a | ||
462 | #define GPORS_TXC16XB 0x0b | ||
463 | #define GPORS_GPOR3 0x0c | ||
464 | #define GPORS_GPOR2 0x0d | ||
465 | #define GPORS_GPOR1 0x0e | ||
466 | #define GPORS_GPOR0 0x0f | ||
467 | |||
468 | /*****************************************************************************/ | ||
469 | |||
470 | /* | ||
471 | * General purpose output register. | ||
472 | */ | ||
473 | #define GPOR_0 0x01 | ||
474 | #define GPOR_1 0x02 | ||
475 | #define GPOR_2 0x04 | ||
476 | #define GPOR_3 0x08 | ||
477 | |||
478 | /*****************************************************************************/ | ||
479 | |||
480 | /* | ||
481 | * General purpose output clock register. | ||
482 | */ | ||
483 | #define GPORC_0NONE 0x00 | ||
484 | #define GPORC_0GIN0 0x01 | ||
485 | #define GPORC_0GIN1 0x02 | ||
486 | #define GPORC_0IO3A 0x02 | ||
487 | |||
488 | #define GPORC_1NONE 0x00 | ||
489 | #define GPORC_1GIN0 0x04 | ||
490 | #define GPORC_1GIN1 0x08 | ||
491 | #define GPORC_1IO3C 0x0c | ||
492 | |||
493 | #define GPORC_2NONE 0x00 | ||
494 | #define GPORC_2GIN0 0x10 | ||
495 | #define GPORC_2GIN1 0x20 | ||
496 | #define GPORC_2IO3E 0x20 | ||
497 | |||
498 | #define GPORC_3NONE 0x00 | ||
499 | #define GPORC_3GIN0 0x40 | ||
500 | #define GPORC_3GIN1 0x80 | ||
501 | #define GPORC_3IO3G 0xc0 | ||
502 | |||
503 | /*****************************************************************************/ | ||
504 | |||
505 | /* | ||
506 | * General purpose output data register. | ||
507 | */ | ||
508 | #define GPOD_0MASK 0x03 | ||
509 | #define GPOD_0SET1 0x00 | ||
510 | #define GPOD_0SET0 0x01 | ||
511 | #define GPOD_0SETR0 0x02 | ||
512 | #define GPOD_0SETIO3B 0x03 | ||
513 | |||
514 | #define GPOD_1MASK 0x0c | ||
515 | #define GPOD_1SET1 0x00 | ||
516 | #define GPOD_1SET0 0x04 | ||
517 | #define GPOD_1SETR0 0x08 | ||
518 | #define GPOD_1SETIO3D 0x0c | ||
519 | |||
520 | #define GPOD_2MASK 0x30 | ||
521 | #define GPOD_2SET1 0x00 | ||
522 | #define GPOD_2SET0 0x10 | ||
523 | #define GPOD_2SETR0 0x20 | ||
524 | #define GPOD_2SETIO3F 0x30 | ||
525 | |||
526 | #define GPOD_3MASK 0xc0 | ||
527 | #define GPOD_3SET1 0x00 | ||
528 | #define GPOD_3SET0 0x40 | ||
529 | #define GPOD_3SETR0 0x80 | ||
530 | #define GPOD_3SETIO3H 0xc0 | ||
531 | |||
532 | /*****************************************************************************/ | ||
533 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 23bddac4bad8..9d51e260bde0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -273,11 +273,11 @@ extern void init_idle_bootup_task(struct task_struct *idle); | |||
273 | extern int runqueue_is_locked(int cpu); | 273 | extern int runqueue_is_locked(int cpu); |
274 | 274 | ||
275 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 275 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
276 | extern void select_nohz_load_balancer(int stop_tick); | 276 | extern void nohz_balance_enter_idle(int cpu); |
277 | extern void set_cpu_sd_state_idle(void); | 277 | extern void set_cpu_sd_state_idle(void); |
278 | extern int get_nohz_timer_target(void); | 278 | extern int get_nohz_timer_target(void); |
279 | #else | 279 | #else |
280 | static inline void select_nohz_load_balancer(int stop_tick) { } | 280 | static inline void nohz_balance_enter_idle(int cpu) { } |
281 | static inline void set_cpu_sd_state_idle(void) { } | 281 | static inline void set_cpu_sd_state_idle(void) { } |
282 | #endif | 282 | #endif |
283 | 283 | ||
@@ -405,6 +405,7 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | |||
405 | 405 | ||
406 | extern void set_dumpable(struct mm_struct *mm, int value); | 406 | extern void set_dumpable(struct mm_struct *mm, int value); |
407 | extern int get_dumpable(struct mm_struct *mm); | 407 | extern int get_dumpable(struct mm_struct *mm); |
408 | extern int __get_dumpable(unsigned long mm_flags); | ||
408 | 409 | ||
409 | /* get/set_dumpable() values */ | 410 | /* get/set_dumpable() values */ |
410 | #define SUID_DUMPABLE_DISABLED 0 | 411 | #define SUID_DUMPABLE_DISABLED 0 |
@@ -446,6 +447,9 @@ extern int get_dumpable(struct mm_struct *mm); | |||
446 | #define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ | 447 | #define MMF_VM_HUGEPAGE 17 /* set when VM_HUGEPAGE is set on vma */ |
447 | #define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */ | 448 | #define MMF_EXE_FILE_CHANGED 18 /* see prctl_set_mm_exe_file() */ |
448 | 449 | ||
450 | #define MMF_HAS_UPROBES 19 /* has uprobes */ | ||
451 | #define MMF_RECALC_UPROBES 20 /* MMF_HAS_UPROBES can be wrong */ | ||
452 | |||
449 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | 453 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) |
450 | 454 | ||
451 | struct sighand_struct { | 455 | struct sighand_struct { |
@@ -678,11 +682,6 @@ struct signal_struct { | |||
678 | * (notably. ptrace) */ | 682 | * (notably. ptrace) */ |
679 | }; | 683 | }; |
680 | 684 | ||
681 | /* Context switch must be unlocked if interrupts are to be enabled */ | ||
682 | #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW | ||
683 | # define __ARCH_WANT_UNLOCKED_CTXSW | ||
684 | #endif | ||
685 | |||
686 | /* | 685 | /* |
687 | * Bits in flags field of signal_struct. | 686 | * Bits in flags field of signal_struct. |
688 | */ | 687 | */ |
@@ -860,7 +859,6 @@ enum cpu_idle_type { | |||
860 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 859 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
861 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ | 860 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
862 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 861 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
863 | #define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */ | ||
864 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ | 862 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ |
865 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 863 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
866 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 864 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
@@ -1417,7 +1415,7 @@ struct task_struct { | |||
1417 | 1415 | ||
1418 | struct audit_context *audit_context; | 1416 | struct audit_context *audit_context; |
1419 | #ifdef CONFIG_AUDITSYSCALL | 1417 | #ifdef CONFIG_AUDITSYSCALL |
1420 | uid_t loginuid; | 1418 | kuid_t loginuid; |
1421 | unsigned int sessionid; | 1419 | unsigned int sessionid; |
1422 | #endif | 1420 | #endif |
1423 | struct seccomp seccomp; | 1421 | struct seccomp seccomp; |
@@ -1529,6 +1527,9 @@ struct task_struct { | |||
1529 | * cache last used pipe for splice | 1527 | * cache last used pipe for splice |
1530 | */ | 1528 | */ |
1531 | struct pipe_inode_info *splice_pipe; | 1529 | struct pipe_inode_info *splice_pipe; |
1530 | |||
1531 | struct page_frag task_frag; | ||
1532 | |||
1532 | #ifdef CONFIG_TASK_DELAY_ACCT | 1533 | #ifdef CONFIG_TASK_DELAY_ACCT |
1533 | struct task_delay_info *delays; | 1534 | struct task_delay_info *delays; |
1534 | #endif | 1535 | #endif |
@@ -1885,6 +1886,14 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
1885 | 1886 | ||
1886 | #endif | 1887 | #endif |
1887 | 1888 | ||
1889 | static inline void rcu_switch(struct task_struct *prev, | ||
1890 | struct task_struct *next) | ||
1891 | { | ||
1892 | #ifdef CONFIG_RCU_USER_QS | ||
1893 | rcu_user_hooks_switch(prev, next); | ||
1894 | #endif | ||
1895 | } | ||
1896 | |||
1888 | static inline void tsk_restore_flags(struct task_struct *task, | 1897 | static inline void tsk_restore_flags(struct task_struct *task, |
1889 | unsigned long orig_flags, unsigned long flags) | 1898 | unsigned long orig_flags, unsigned long flags) |
1890 | { | 1899 | { |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 899fbb487c94..fb3c5a8fef3d 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -68,6 +68,8 @@ struct screen_info { | |||
68 | 68 | ||
69 | #define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ | 69 | #define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ |
70 | 70 | ||
71 | #define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0) | ||
72 | |||
71 | #ifdef __KERNEL__ | 73 | #ifdef __KERNEL__ |
72 | extern struct screen_info screen_info; | 74 | extern struct screen_info screen_info; |
73 | 75 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index d143b8e01954..5b50c4e1a7c2 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1436,7 +1436,7 @@ struct security_operations { | |||
1436 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | 1436 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, |
1437 | struct path *new_dir, struct dentry *new_dentry); | 1437 | struct path *new_dir, struct dentry *new_dentry); |
1438 | int (*path_chmod) (struct path *path, umode_t mode); | 1438 | int (*path_chmod) (struct path *path, umode_t mode); |
1439 | int (*path_chown) (struct path *path, uid_t uid, gid_t gid); | 1439 | int (*path_chown) (struct path *path, kuid_t uid, kgid_t gid); |
1440 | int (*path_chroot) (struct path *path); | 1440 | int (*path_chroot) (struct path *path); |
1441 | #endif | 1441 | #endif |
1442 | 1442 | ||
@@ -2831,7 +2831,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, | |||
2831 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | 2831 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
2832 | struct path *new_dir, struct dentry *new_dentry); | 2832 | struct path *new_dir, struct dentry *new_dentry); |
2833 | int security_path_chmod(struct path *path, umode_t mode); | 2833 | int security_path_chmod(struct path *path, umode_t mode); |
2834 | int security_path_chown(struct path *path, uid_t uid, gid_t gid); | 2834 | int security_path_chown(struct path *path, kuid_t uid, kgid_t gid); |
2835 | int security_path_chroot(struct path *path); | 2835 | int security_path_chroot(struct path *path); |
2836 | #else /* CONFIG_SECURITY_PATH */ | 2836 | #else /* CONFIG_SECURITY_PATH */ |
2837 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | 2837 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) |
@@ -2887,7 +2887,7 @@ static inline int security_path_chmod(struct path *path, umode_t mode) | |||
2887 | return 0; | 2887 | return 0; |
2888 | } | 2888 | } |
2889 | 2889 | ||
2890 | static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) | 2890 | static inline int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) |
2891 | { | 2891 | { |
2892 | return 0; | 2892 | return 0; |
2893 | } | 2893 | } |
@@ -3022,5 +3022,36 @@ static inline void free_secdata(void *secdata) | |||
3022 | { } | 3022 | { } |
3023 | #endif /* CONFIG_SECURITY */ | 3023 | #endif /* CONFIG_SECURITY */ |
3024 | 3024 | ||
3025 | #ifdef CONFIG_SECURITY_YAMA | ||
3026 | extern int yama_ptrace_access_check(struct task_struct *child, | ||
3027 | unsigned int mode); | ||
3028 | extern int yama_ptrace_traceme(struct task_struct *parent); | ||
3029 | extern void yama_task_free(struct task_struct *task); | ||
3030 | extern int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3, | ||
3031 | unsigned long arg4, unsigned long arg5); | ||
3032 | #else | ||
3033 | static inline int yama_ptrace_access_check(struct task_struct *child, | ||
3034 | unsigned int mode) | ||
3035 | { | ||
3036 | return 0; | ||
3037 | } | ||
3038 | |||
3039 | static inline int yama_ptrace_traceme(struct task_struct *parent) | ||
3040 | { | ||
3041 | return 0; | ||
3042 | } | ||
3043 | |||
3044 | static inline void yama_task_free(struct task_struct *task) | ||
3045 | { | ||
3046 | } | ||
3047 | |||
3048 | static inline int yama_task_prctl(int option, unsigned long arg2, | ||
3049 | unsigned long arg3, unsigned long arg4, | ||
3050 | unsigned long arg5) | ||
3051 | { | ||
3052 | return -ENOSYS; | ||
3053 | } | ||
3054 | #endif /* CONFIG_SECURITY_YAMA */ | ||
3055 | |||
3025 | #endif /* ! __LINUX_SECURITY_H */ | 3056 | #endif /* ! __LINUX_SECURITY_H */ |
3026 | 3057 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 83c44eefe698..68a04a343cad 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -13,6 +13,7 @@ struct file; | |||
13 | struct path; | 13 | struct path; |
14 | struct inode; | 14 | struct inode; |
15 | struct dentry; | 15 | struct dentry; |
16 | struct user_namespace; | ||
16 | 17 | ||
17 | struct seq_file { | 18 | struct seq_file { |
18 | char *buf; | 19 | char *buf; |
@@ -25,6 +26,9 @@ struct seq_file { | |||
25 | struct mutex lock; | 26 | struct mutex lock; |
26 | const struct seq_operations *op; | 27 | const struct seq_operations *op; |
27 | int poll_event; | 28 | int poll_event; |
29 | #ifdef CONFIG_USER_NS | ||
30 | struct user_namespace *user_ns; | ||
31 | #endif | ||
28 | void *private; | 32 | void *private; |
29 | }; | 33 | }; |
30 | 34 | ||
@@ -128,6 +132,16 @@ int seq_put_decimal_ull(struct seq_file *m, char delimiter, | |||
128 | int seq_put_decimal_ll(struct seq_file *m, char delimiter, | 132 | int seq_put_decimal_ll(struct seq_file *m, char delimiter, |
129 | long long num); | 133 | long long num); |
130 | 134 | ||
135 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) | ||
136 | { | ||
137 | #ifdef CONFIG_USER_NS | ||
138 | return seq->user_ns; | ||
139 | #else | ||
140 | extern struct user_namespace init_user_ns; | ||
141 | return &init_user_ns; | ||
142 | #endif | ||
143 | } | ||
144 | |||
131 | #define SEQ_START_TOKEN ((void *)1) | 145 | #define SEQ_START_TOKEN ((void *)1) |
132 | /* | 146 | /* |
133 | * Helpers for iteration over list_head-s in seq_files | 147 | * Helpers for iteration over list_head-s in seq_files |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 90e9f981358a..861e51de476b 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -12,9 +12,12 @@ | |||
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | #include <linux/tty_flags.h> | ||
16 | |||
15 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
16 | #include <asm/page.h> | 18 | #include <asm/page.h> |
17 | 19 | ||
20 | |||
18 | /* | 21 | /* |
19 | * Counters of the input lines (CTS, DSR, RI, CD) interrupts | 22 | * Counters of the input lines (CTS, DSR, RI, CD) interrupts |
20 | */ | 23 | */ |
@@ -83,89 +86,11 @@ struct serial_struct { | |||
83 | #define SERIAL_IO_HUB6 1 | 86 | #define SERIAL_IO_HUB6 1 |
84 | #define SERIAL_IO_MEM 2 | 87 | #define SERIAL_IO_MEM 2 |
85 | 88 | ||
86 | struct serial_uart_config { | ||
87 | char *name; | ||
88 | int dfl_xmit_fifo_size; | ||
89 | int flags; | ||
90 | }; | ||
91 | |||
92 | #define UART_CLEAR_FIFO 0x01 | 89 | #define UART_CLEAR_FIFO 0x01 |
93 | #define UART_USE_FIFO 0x02 | 90 | #define UART_USE_FIFO 0x02 |
94 | #define UART_STARTECH 0x04 | 91 | #define UART_STARTECH 0x04 |
95 | #define UART_NATSEMI 0x08 | 92 | #define UART_NATSEMI 0x08 |
96 | 93 | ||
97 | /* | ||
98 | * Definitions for async_struct (and serial_struct) flags field | ||
99 | * | ||
100 | * Define ASYNCB_* for convenient use with {test,set,clear}_bit. | ||
101 | */ | ||
102 | #define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes | ||
103 | * on the callout port */ | ||
104 | #define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */ | ||
105 | #define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */ | ||
106 | #define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */ | ||
107 | #define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */ | ||
108 | #define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */ | ||
109 | #define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */ | ||
110 | #define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during | ||
111 | * autoconfiguration */ | ||
112 | #define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */ | ||
113 | #define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */ | ||
114 | #define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */ | ||
115 | #define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */ | ||
116 | #define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */ | ||
117 | #define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */ | ||
118 | #define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety | ||
119 | * checks. Note: can be dangerous! */ | ||
120 | #define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */ | ||
121 | #define ASYNCB_LAST_USER 15 | ||
122 | |||
123 | /* Internal flags used only by kernel */ | ||
124 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | ||
125 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | ||
126 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
127 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | ||
128 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ | ||
129 | #define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */ | ||
130 | #define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */ | ||
131 | #define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */ | ||
132 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | ||
133 | #define ASYNCB_FIRST_KERNEL 22 | ||
134 | |||
135 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | ||
136 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | ||
137 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | ||
138 | #define ASYNC_SAK (1U << ASYNCB_SAK) | ||
139 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) | ||
140 | #define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI) | ||
141 | #define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI) | ||
142 | #define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST) | ||
143 | #define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ) | ||
144 | #define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT) | ||
145 | #define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT) | ||
146 | #define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP) | ||
147 | #define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD) | ||
148 | #define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI) | ||
149 | #define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY) | ||
150 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | ||
151 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | ||
152 | |||
153 | #define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) | ||
154 | #define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \ | ||
155 | ASYNC_LOW_LATENCY) | ||
156 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | ||
157 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | ||
158 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | ||
159 | |||
160 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | ||
161 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | ||
162 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | ||
163 | #define ASYNC_CLOSING (1U << ASYNCB_CLOSING) | ||
164 | #define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW) | ||
165 | #define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD) | ||
166 | #define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ) | ||
167 | #define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW) | ||
168 | #define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1)) | ||
169 | 94 | ||
170 | /* | 95 | /* |
171 | * Multiport serial configuration structure --- external structure | 96 | * Multiport serial configuration structure --- external structure |
diff --git a/include/linux/serial167.h b/include/linux/serial167.h deleted file mode 100644 index 59c81b708562..000000000000 --- a/include/linux/serial167.h +++ /dev/null | |||
@@ -1,157 +0,0 @@ | |||
1 | /* | ||
2 | * serial167.h | ||
3 | * | ||
4 | * Richard Hirst [richard@sleepie.demon.co.uk] | ||
5 | * | ||
6 | * Based on cyclades.h | ||
7 | */ | ||
8 | |||
9 | struct cyclades_monitor { | ||
10 | unsigned long int_count; | ||
11 | unsigned long char_count; | ||
12 | unsigned long char_max; | ||
13 | unsigned long char_last; | ||
14 | }; | ||
15 | |||
16 | /* | ||
17 | * This is our internal structure for each serial port's state. | ||
18 | * | ||
19 | * Many fields are paralleled by the structure used by the serial_struct | ||
20 | * structure. | ||
21 | * | ||
22 | * For definitions of the flags field, see tty.h | ||
23 | */ | ||
24 | |||
25 | struct cyclades_port { | ||
26 | int magic; | ||
27 | int type; | ||
28 | int card; | ||
29 | int line; | ||
30 | int flags; /* defined in tty.h */ | ||
31 | struct tty_struct *tty; | ||
32 | int read_status_mask; | ||
33 | int timeout; | ||
34 | int xmit_fifo_size; | ||
35 | int cor1,cor2,cor3,cor4,cor5,cor6,cor7; | ||
36 | int tbpr,tco,rbpr,rco; | ||
37 | int ignore_status_mask; | ||
38 | int close_delay; | ||
39 | int IER; /* Interrupt Enable Register */ | ||
40 | unsigned long last_active; | ||
41 | int count; /* # of fd on device */ | ||
42 | int x_char; /* to be pushed out ASAP */ | ||
43 | int x_break; | ||
44 | int blocked_open; /* # of blocked opens */ | ||
45 | unsigned char *xmit_buf; | ||
46 | int xmit_head; | ||
47 | int xmit_tail; | ||
48 | int xmit_cnt; | ||
49 | int default_threshold; | ||
50 | int default_timeout; | ||
51 | wait_queue_head_t open_wait; | ||
52 | wait_queue_head_t close_wait; | ||
53 | struct cyclades_monitor mon; | ||
54 | }; | ||
55 | |||
56 | #define CYCLADES_MAGIC 0x4359 | ||
57 | |||
58 | #define CYGETMON 0x435901 | ||
59 | #define CYGETTHRESH 0x435902 | ||
60 | #define CYSETTHRESH 0x435903 | ||
61 | #define CYGETDEFTHRESH 0x435904 | ||
62 | #define CYSETDEFTHRESH 0x435905 | ||
63 | #define CYGETTIMEOUT 0x435906 | ||
64 | #define CYSETTIMEOUT 0x435907 | ||
65 | #define CYGETDEFTIMEOUT 0x435908 | ||
66 | #define CYSETDEFTIMEOUT 0x435909 | ||
67 | |||
68 | #define CyMaxChipsPerCard 1 | ||
69 | |||
70 | /**** cd2401 registers ****/ | ||
71 | |||
72 | #define CyGFRCR (0x81) | ||
73 | #define CyCCR (0x13) | ||
74 | #define CyCLR_CHAN (0x40) | ||
75 | #define CyINIT_CHAN (0x20) | ||
76 | #define CyCHIP_RESET (0x10) | ||
77 | #define CyENB_XMTR (0x08) | ||
78 | #define CyDIS_XMTR (0x04) | ||
79 | #define CyENB_RCVR (0x02) | ||
80 | #define CyDIS_RCVR (0x01) | ||
81 | #define CyCAR (0xee) | ||
82 | #define CyIER (0x11) | ||
83 | #define CyMdmCh (0x80) | ||
84 | #define CyRxExc (0x20) | ||
85 | #define CyRxData (0x08) | ||
86 | #define CyTxMpty (0x02) | ||
87 | #define CyTxRdy (0x01) | ||
88 | #define CyLICR (0x26) | ||
89 | #define CyRISR (0x89) | ||
90 | #define CyTIMEOUT (0x80) | ||
91 | #define CySPECHAR (0x70) | ||
92 | #define CyOVERRUN (0x08) | ||
93 | #define CyPARITY (0x04) | ||
94 | #define CyFRAME (0x02) | ||
95 | #define CyBREAK (0x01) | ||
96 | #define CyREOIR (0x84) | ||
97 | #define CyTEOIR (0x85) | ||
98 | #define CyMEOIR (0x86) | ||
99 | #define CyNOTRANS (0x08) | ||
100 | #define CyRFOC (0x30) | ||
101 | #define CyRDR (0xf8) | ||
102 | #define CyTDR (0xf8) | ||
103 | #define CyMISR (0x8b) | ||
104 | #define CyRISR (0x89) | ||
105 | #define CyTISR (0x8a) | ||
106 | #define CyMSVR1 (0xde) | ||
107 | #define CyMSVR2 (0xdf) | ||
108 | #define CyDSR (0x80) | ||
109 | #define CyDCD (0x40) | ||
110 | #define CyCTS (0x20) | ||
111 | #define CyDTR (0x02) | ||
112 | #define CyRTS (0x01) | ||
113 | #define CyRTPRL (0x25) | ||
114 | #define CyRTPRH (0x24) | ||
115 | #define CyCOR1 (0x10) | ||
116 | #define CyPARITY_NONE (0x00) | ||
117 | #define CyPARITY_E (0x40) | ||
118 | #define CyPARITY_O (0xC0) | ||
119 | #define Cy_5_BITS (0x04) | ||
120 | #define Cy_6_BITS (0x05) | ||
121 | #define Cy_7_BITS (0x06) | ||
122 | #define Cy_8_BITS (0x07) | ||
123 | #define CyCOR2 (0x17) | ||
124 | #define CyETC (0x20) | ||
125 | #define CyCtsAE (0x02) | ||
126 | #define CyCOR3 (0x16) | ||
127 | #define Cy_1_STOP (0x02) | ||
128 | #define Cy_2_STOP (0x04) | ||
129 | #define CyCOR4 (0x15) | ||
130 | #define CyREC_FIFO (0x0F) /* Receive FIFO threshold */ | ||
131 | #define CyCOR5 (0x14) | ||
132 | #define CyCOR6 (0x18) | ||
133 | #define CyCOR7 (0x07) | ||
134 | #define CyRBPR (0xcb) | ||
135 | #define CyRCOR (0xc8) | ||
136 | #define CyTBPR (0xc3) | ||
137 | #define CyTCOR (0xc0) | ||
138 | #define CySCHR1 (0x1f) | ||
139 | #define CySCHR2 (0x1e) | ||
140 | #define CyTPR (0xda) | ||
141 | #define CyPILR1 (0xe3) | ||
142 | #define CyPILR2 (0xe0) | ||
143 | #define CyPILR3 (0xe1) | ||
144 | #define CyCMR (0x1b) | ||
145 | #define CyASYNC (0x02) | ||
146 | #define CyLICR (0x26) | ||
147 | #define CyLIVR (0x09) | ||
148 | #define CySCRL (0x23) | ||
149 | #define CySCRH (0x22) | ||
150 | #define CyTFTC (0x80) | ||
151 | |||
152 | |||
153 | /* max number of chars in the FIFO */ | ||
154 | |||
155 | #define CyMAX_CHAR_FIFO 12 | ||
156 | |||
157 | /***************************************************************************/ | ||
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index a416e92012ef..c174c90fb3fb 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -65,11 +65,38 @@ enum { | |||
65 | * platform device. Using these will make your driver | 65 | * platform device. Using these will make your driver |
66 | * dependent on the 8250 driver. | 66 | * dependent on the 8250 driver. |
67 | */ | 67 | */ |
68 | struct uart_port; | 68 | |
69 | struct uart_8250_port; | 69 | struct uart_8250_port { |
70 | struct uart_port port; | ||
71 | struct timer_list timer; /* "no irq" timer */ | ||
72 | struct list_head list; /* ports on this IRQ */ | ||
73 | unsigned short capabilities; /* port capabilities */ | ||
74 | unsigned short bugs; /* port bugs */ | ||
75 | unsigned int tx_loadsz; /* transmit fifo load size */ | ||
76 | unsigned char acr; | ||
77 | unsigned char ier; | ||
78 | unsigned char lcr; | ||
79 | unsigned char mcr; | ||
80 | unsigned char mcr_mask; /* mask of user bits */ | ||
81 | unsigned char mcr_force; /* mask of forced bits */ | ||
82 | unsigned char cur_iotype; /* Running I/O type */ | ||
83 | |||
84 | /* | ||
85 | * Some bits in registers are cleared on a read, so they must | ||
86 | * be saved whenever the register is read but the bits will not | ||
87 | * be immediately processed. | ||
88 | */ | ||
89 | #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS | ||
90 | unsigned char lsr_saved_flags; | ||
91 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA | ||
92 | unsigned char msr_saved_flags; | ||
93 | |||
94 | /* 8250 specific callbacks */ | ||
95 | int (*dl_read)(struct uart_8250_port *); | ||
96 | void (*dl_write)(struct uart_8250_port *, int); | ||
97 | }; | ||
70 | 98 | ||
71 | int serial8250_register_8250_port(struct uart_8250_port *); | 99 | int serial8250_register_8250_port(struct uart_8250_port *); |
72 | int serial8250_register_port(struct uart_port *); | ||
73 | void serial8250_unregister_port(int line); | 100 | void serial8250_unregister_port(int line); |
74 | void serial8250_suspend_port(int line); | 101 | void serial8250_suspend_port(int line); |
75 | void serial8250_resume_port(int line); | 102 | void serial8250_resume_port(int line); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 0253c2022e53..f9b22ec7a9f3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -48,7 +48,8 @@ | |||
48 | #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ | 48 | #define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ |
49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ | 49 | #define PORT_XR17D15X 21 /* Exar XR17D15x UART */ |
50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ | 50 | #define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ |
51 | #define PORT_MAX_8250 22 /* max port ID */ | 51 | #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ |
52 | #define PORT_MAX_8250 23 /* max port ID */ | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * ARM specific type numbers. These are not currently guaranteed | 55 | * ARM specific type numbers. These are not currently guaranteed |
@@ -193,8 +194,8 @@ | |||
193 | /* SH-SCI */ | 194 | /* SH-SCI */ |
194 | #define PORT_SCIFB 93 | 195 | #define PORT_SCIFB 93 |
195 | 196 | ||
196 | /* MAX3107 */ | 197 | /* MAX310X */ |
197 | #define PORT_MAX3107 94 | 198 | #define PORT_MAX310X 94 |
198 | 199 | ||
199 | /* High Speed UART for Medfield */ | 200 | /* High Speed UART for Medfield */ |
200 | #define PORT_MFD 95 | 201 | #define PORT_MFD 95 |
@@ -274,6 +275,7 @@ struct uart_ops { | |||
274 | int (*verify_port)(struct uart_port *, struct serial_struct *); | 275 | int (*verify_port)(struct uart_port *, struct serial_struct *); |
275 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); | 276 | int (*ioctl)(struct uart_port *, unsigned int, unsigned long); |
276 | #ifdef CONFIG_CONSOLE_POLL | 277 | #ifdef CONFIG_CONSOLE_POLL |
278 | int (*poll_init)(struct uart_port *); | ||
277 | void (*poll_put_char)(struct uart_port *, unsigned char); | 279 | void (*poll_put_char)(struct uart_port *, unsigned char); |
278 | int (*poll_get_char)(struct uart_port *); | 280 | int (*poll_get_char)(struct uart_port *); |
279 | #endif | 281 | #endif |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 8ce70d76f836..5ed325e88a81 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -40,6 +40,10 @@ | |||
40 | 40 | ||
41 | #define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ | 41 | #define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ |
42 | 42 | ||
43 | #define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */ | ||
44 | #define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */ | ||
45 | #define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */ | ||
46 | |||
43 | #define UART_FCR 2 /* Out: FIFO Control Register */ | 47 | #define UART_FCR 2 /* Out: FIFO Control Register */ |
44 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ | 48 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ |
45 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ | 49 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index bef2cf00b3be..30aa0dc60d75 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
6 | #include <linux/pagemap.h> | 6 | #include <linux/pagemap.h> |
7 | #include <linux/percpu_counter.h> | 7 | #include <linux/percpu_counter.h> |
8 | #include <linux/xattr.h> | ||
8 | 9 | ||
9 | /* inode in-kernel data */ | 10 | /* inode in-kernel data */ |
10 | 11 | ||
@@ -18,7 +19,7 @@ struct shmem_inode_info { | |||
18 | }; | 19 | }; |
19 | struct shared_policy policy; /* NUMA memory alloc policy */ | 20 | struct shared_policy policy; /* NUMA memory alloc policy */ |
20 | struct list_head swaplist; /* chain of maybes on swap */ | 21 | struct list_head swaplist; /* chain of maybes on swap */ |
21 | struct list_head xattr_list; /* list of shmem_xattr */ | 22 | struct simple_xattrs xattrs; /* list of xattrs */ |
22 | struct inode vfs_inode; | 23 | struct inode vfs_inode; |
23 | }; | 24 | }; |
24 | 25 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 7632c87da2c9..b33a3a1f205e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -846,13 +846,16 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
846 | * | 846 | * |
847 | * NULL is returned on a memory allocation failure. | 847 | * NULL is returned on a memory allocation failure. |
848 | */ | 848 | */ |
849 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 849 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri) |
850 | gfp_t pri) | ||
851 | { | 850 | { |
852 | might_sleep_if(pri & __GFP_WAIT); | 851 | might_sleep_if(pri & __GFP_WAIT); |
853 | if (skb_shared(skb)) { | 852 | if (skb_shared(skb)) { |
854 | struct sk_buff *nskb = skb_clone(skb, pri); | 853 | struct sk_buff *nskb = skb_clone(skb, pri); |
855 | kfree_skb(skb); | 854 | |
855 | if (likely(nskb)) | ||
856 | consume_skb(skb); | ||
857 | else | ||
858 | kfree_skb(skb); | ||
856 | skb = nskb; | 859 | skb = nskb; |
857 | } | 860 | } |
858 | return skb; | 861 | return skb; |
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h new file mode 100644 index 000000000000..e0106d8581d3 --- /dev/null +++ b/include/linux/smpboot.h | |||
@@ -0,0 +1,43 @@ | |||
1 | #ifndef _LINUX_SMPBOOT_H | ||
2 | #define _LINUX_SMPBOOT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct task_struct; | ||
7 | /* Cookie handed to the thread_fn*/ | ||
8 | struct smpboot_thread_data; | ||
9 | |||
10 | /** | ||
11 | * struct smp_hotplug_thread - CPU hotplug related thread descriptor | ||
12 | * @store: Pointer to per cpu storage for the task pointers | ||
13 | * @list: List head for core management | ||
14 | * @thread_should_run: Check whether the thread should run or not. Called with | ||
15 | * preemption disabled. | ||
16 | * @thread_fn: The associated thread function | ||
17 | * @setup: Optional setup function, called when the thread gets | ||
18 | * operational the first time | ||
19 | * @cleanup: Optional cleanup function, called when the thread | ||
20 | * should stop (module exit) | ||
21 | * @park: Optional park function, called when the thread is | ||
22 | * parked (cpu offline) | ||
23 | * @unpark: Optional unpark function, called when the thread is | ||
24 | * unparked (cpu online) | ||
25 | * @thread_comm: The base name of the thread | ||
26 | */ | ||
27 | struct smp_hotplug_thread { | ||
28 | struct task_struct __percpu **store; | ||
29 | struct list_head list; | ||
30 | int (*thread_should_run)(unsigned int cpu); | ||
31 | void (*thread_fn)(unsigned int cpu); | ||
32 | void (*setup)(unsigned int cpu); | ||
33 | void (*cleanup)(unsigned int cpu, bool online); | ||
34 | void (*park)(unsigned int cpu); | ||
35 | void (*unpark)(unsigned int cpu); | ||
36 | const char *thread_comm; | ||
37 | }; | ||
38 | |||
39 | int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread); | ||
40 | void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread); | ||
41 | int smpboot_thread_schedule(void); | ||
42 | |||
43 | #endif | ||
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 00bc189cb395..fdfba235f9f1 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -18,7 +18,14 @@ | |||
18 | enum | 18 | enum |
19 | { | 19 | { |
20 | IPSTATS_MIB_NUM = 0, | 20 | IPSTATS_MIB_NUM = 0, |
21 | /* frequently written fields in fast path, kept in same cache line */ | ||
21 | IPSTATS_MIB_INPKTS, /* InReceives */ | 22 | IPSTATS_MIB_INPKTS, /* InReceives */ |
23 | IPSTATS_MIB_INOCTETS, /* InOctets */ | ||
24 | IPSTATS_MIB_INDELIVERS, /* InDelivers */ | ||
25 | IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */ | ||
26 | IPSTATS_MIB_OUTPKTS, /* OutRequests */ | ||
27 | IPSTATS_MIB_OUTOCTETS, /* OutOctets */ | ||
28 | /* other fields */ | ||
22 | IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */ | 29 | IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */ |
23 | IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */ | 30 | IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */ |
24 | IPSTATS_MIB_INNOROUTES, /* InNoRoutes */ | 31 | IPSTATS_MIB_INNOROUTES, /* InNoRoutes */ |
@@ -26,9 +33,6 @@ enum | |||
26 | IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */ | 33 | IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */ |
27 | IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */ | 34 | IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */ |
28 | IPSTATS_MIB_INDISCARDS, /* InDiscards */ | 35 | IPSTATS_MIB_INDISCARDS, /* InDiscards */ |
29 | IPSTATS_MIB_INDELIVERS, /* InDelivers */ | ||
30 | IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */ | ||
31 | IPSTATS_MIB_OUTPKTS, /* OutRequests */ | ||
32 | IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */ | 36 | IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */ |
33 | IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */ | 37 | IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */ |
34 | IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */ | 38 | IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */ |
@@ -42,8 +46,6 @@ enum | |||
42 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ | 46 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ |
43 | IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ | 47 | IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ |
44 | IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ | 48 | IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ |
45 | IPSTATS_MIB_INOCTETS, /* InOctets */ | ||
46 | IPSTATS_MIB_OUTOCTETS, /* OutOctets */ | ||
47 | IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */ | 49 | IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */ |
48 | IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */ | 50 | IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */ |
49 | IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ | 51 | IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ |
@@ -239,6 +241,10 @@ enum | |||
239 | LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */ | 241 | LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */ |
240 | LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */ | 242 | LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */ |
241 | LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */ | 243 | LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */ |
244 | LINUX_MIB_TCPFASTOPENPASSIVE, /* TCPFastOpenPassive*/ | ||
245 | LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */ | ||
246 | LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */ | ||
247 | LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ | ||
242 | __LINUX_MIB_MAX | 248 | __LINUX_MIB_MAX |
243 | }; | 249 | }; |
244 | 250 | ||
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h new file mode 100644 index 000000000000..61ae1306db23 --- /dev/null +++ b/include/linux/spi/mxs-spi.h | |||
@@ -0,0 +1,150 @@ | |||
1 | /* | ||
2 | * include/linux/spi/mxs-spi.h | ||
3 | * | ||
4 | * Freescale i.MX233/i.MX28 SPI controller register definition | ||
5 | * | ||
6 | * Copyright 2008 Embedded Alley Solutions, Inc. | ||
7 | * Copyright 2009-2011 Freescale Semiconductor, Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_SPI_MXS_SPI_H__ | ||
25 | #define __LINUX_SPI_MXS_SPI_H__ | ||
26 | |||
27 | #include <linux/fsl/mxs-dma.h> | ||
28 | |||
29 | #define ssp_is_old(host) ((host)->devid == IMX23_SSP) | ||
30 | |||
31 | /* SSP registers */ | ||
32 | #define HW_SSP_CTRL0 0x000 | ||
33 | #define BM_SSP_CTRL0_RUN (1 << 29) | ||
34 | #define BM_SSP_CTRL0_SDIO_IRQ_CHECK (1 << 28) | ||
35 | #define BM_SSP_CTRL0_LOCK_CS (1 << 27) | ||
36 | #define BM_SSP_CTRL0_IGNORE_CRC (1 << 26) | ||
37 | #define BM_SSP_CTRL0_READ (1 << 25) | ||
38 | #define BM_SSP_CTRL0_DATA_XFER (1 << 24) | ||
39 | #define BP_SSP_CTRL0_BUS_WIDTH 22 | ||
40 | #define BM_SSP_CTRL0_BUS_WIDTH (0x3 << 22) | ||
41 | #define BM_SSP_CTRL0_WAIT_FOR_IRQ (1 << 21) | ||
42 | #define BM_SSP_CTRL0_WAIT_FOR_CMD (1 << 20) | ||
43 | #define BM_SSP_CTRL0_LONG_RESP (1 << 19) | ||
44 | #define BM_SSP_CTRL0_GET_RESP (1 << 17) | ||
45 | #define BM_SSP_CTRL0_ENABLE (1 << 16) | ||
46 | #define BP_SSP_CTRL0_XFER_COUNT 0 | ||
47 | #define BM_SSP_CTRL0_XFER_COUNT 0xffff | ||
48 | #define HW_SSP_CMD0 0x010 | ||
49 | #define BM_SSP_CMD0_DBL_DATA_RATE_EN (1 << 25) | ||
50 | #define BM_SSP_CMD0_SLOW_CLKING_EN (1 << 22) | ||
51 | #define BM_SSP_CMD0_CONT_CLKING_EN (1 << 21) | ||
52 | #define BM_SSP_CMD0_APPEND_8CYC (1 << 20) | ||
53 | #define BP_SSP_CMD0_BLOCK_SIZE 16 | ||
54 | #define BM_SSP_CMD0_BLOCK_SIZE (0xf << 16) | ||
55 | #define BP_SSP_CMD0_BLOCK_COUNT 8 | ||
56 | #define BM_SSP_CMD0_BLOCK_COUNT (0xff << 8) | ||
57 | #define BP_SSP_CMD0_CMD 0 | ||
58 | #define BM_SSP_CMD0_CMD 0xff | ||
59 | #define HW_SSP_CMD1 0x020 | ||
60 | #define HW_SSP_XFER_SIZE 0x030 | ||
61 | #define HW_SSP_BLOCK_SIZE 0x040 | ||
62 | #define BP_SSP_BLOCK_SIZE_BLOCK_COUNT 4 | ||
63 | #define BM_SSP_BLOCK_SIZE_BLOCK_COUNT (0xffffff << 4) | ||
64 | #define BP_SSP_BLOCK_SIZE_BLOCK_SIZE 0 | ||
65 | #define BM_SSP_BLOCK_SIZE_BLOCK_SIZE 0xf | ||
66 | #define HW_SSP_TIMING(h) (ssp_is_old(h) ? 0x050 : 0x070) | ||
67 | #define BP_SSP_TIMING_TIMEOUT 16 | ||
68 | #define BM_SSP_TIMING_TIMEOUT (0xffff << 16) | ||
69 | #define BP_SSP_TIMING_CLOCK_DIVIDE 8 | ||
70 | #define BM_SSP_TIMING_CLOCK_DIVIDE (0xff << 8) | ||
71 | #define BF_SSP_TIMING_CLOCK_DIVIDE(v) \ | ||
72 | (((v) << 8) & BM_SSP_TIMING_CLOCK_DIVIDE) | ||
73 | #define BP_SSP_TIMING_CLOCK_RATE 0 | ||
74 | #define BM_SSP_TIMING_CLOCK_RATE 0xff | ||
75 | #define BF_SSP_TIMING_CLOCK_RATE(v) \ | ||
76 | (((v) << 0) & BM_SSP_TIMING_CLOCK_RATE) | ||
77 | #define HW_SSP_CTRL1(h) (ssp_is_old(h) ? 0x060 : 0x080) | ||
78 | #define BM_SSP_CTRL1_SDIO_IRQ (1 << 31) | ||
79 | #define BM_SSP_CTRL1_SDIO_IRQ_EN (1 << 30) | ||
80 | #define BM_SSP_CTRL1_RESP_ERR_IRQ (1 << 29) | ||
81 | #define BM_SSP_CTRL1_RESP_ERR_IRQ_EN (1 << 28) | ||
82 | #define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ (1 << 27) | ||
83 | #define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN (1 << 26) | ||
84 | #define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ (1 << 25) | ||
85 | #define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN (1 << 24) | ||
86 | #define BM_SSP_CTRL1_DATA_CRC_IRQ (1 << 23) | ||
87 | #define BM_SSP_CTRL1_DATA_CRC_IRQ_EN (1 << 22) | ||
88 | #define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ (1 << 21) | ||
89 | #define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ_EN (1 << 20) | ||
90 | #define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ (1 << 17) | ||
91 | #define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN (1 << 16) | ||
92 | #define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ (1 << 15) | ||
93 | #define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ_EN (1 << 14) | ||
94 | #define BM_SSP_CTRL1_DMA_ENABLE (1 << 13) | ||
95 | #define BM_SSP_CTRL1_PHASE (1 << 10) | ||
96 | #define BM_SSP_CTRL1_POLARITY (1 << 9) | ||
97 | #define BP_SSP_CTRL1_WORD_LENGTH 4 | ||
98 | #define BM_SSP_CTRL1_WORD_LENGTH (0xf << 4) | ||
99 | #define BF_SSP_CTRL1_WORD_LENGTH(v) \ | ||
100 | (((v) << 4) & BM_SSP_CTRL1_WORD_LENGTH) | ||
101 | #define BV_SSP_CTRL1_WORD_LENGTH__FOUR_BITS 0x3 | ||
102 | #define BV_SSP_CTRL1_WORD_LENGTH__EIGHT_BITS 0x7 | ||
103 | #define BV_SSP_CTRL1_WORD_LENGTH__SIXTEEN_BITS 0xF | ||
104 | #define BP_SSP_CTRL1_SSP_MODE 0 | ||
105 | #define BM_SSP_CTRL1_SSP_MODE 0xf | ||
106 | #define BF_SSP_CTRL1_SSP_MODE(v) \ | ||
107 | (((v) << 0) & BM_SSP_CTRL1_SSP_MODE) | ||
108 | #define BV_SSP_CTRL1_SSP_MODE__SPI 0x0 | ||
109 | #define BV_SSP_CTRL1_SSP_MODE__SSI 0x1 | ||
110 | #define BV_SSP_CTRL1_SSP_MODE__SD_MMC 0x3 | ||
111 | #define BV_SSP_CTRL1_SSP_MODE__MS 0x4 | ||
112 | |||
113 | #define HW_SSP_DATA(h) (ssp_is_old(h) ? 0x070 : 0x090) | ||
114 | |||
115 | #define HW_SSP_SDRESP0(h) (ssp_is_old(h) ? 0x080 : 0x0a0) | ||
116 | #define HW_SSP_SDRESP1(h) (ssp_is_old(h) ? 0x090 : 0x0b0) | ||
117 | #define HW_SSP_SDRESP2(h) (ssp_is_old(h) ? 0x0a0 : 0x0c0) | ||
118 | #define HW_SSP_SDRESP3(h) (ssp_is_old(h) ? 0x0b0 : 0x0d0) | ||
119 | #define HW_SSP_STATUS(h) (ssp_is_old(h) ? 0x0c0 : 0x100) | ||
120 | #define BM_SSP_STATUS_CARD_DETECT (1 << 28) | ||
121 | #define BM_SSP_STATUS_SDIO_IRQ (1 << 17) | ||
122 | #define BM_SSP_STATUS_FIFO_EMPTY (1 << 5) | ||
123 | |||
124 | #define BF_SSP(value, field) (((value) << BP_SSP_##field) & BM_SSP_##field) | ||
125 | |||
126 | #define SSP_PIO_NUM 3 | ||
127 | |||
128 | enum mxs_ssp_id { | ||
129 | IMX23_SSP, | ||
130 | IMX28_SSP, | ||
131 | }; | ||
132 | |||
133 | struct mxs_ssp { | ||
134 | struct device *dev; | ||
135 | void __iomem *base; | ||
136 | struct clk *clk; | ||
137 | unsigned int clk_rate; | ||
138 | enum mxs_ssp_id devid; | ||
139 | |||
140 | int dma_channel; | ||
141 | struct dma_chan *dmach; | ||
142 | struct mxs_dma_data dma_data; | ||
143 | unsigned int dma_dir; | ||
144 | enum dma_transfer_direction slave_dirn; | ||
145 | u32 ssp_pio_words[SSP_PIO_NUM]; | ||
146 | }; | ||
147 | |||
148 | void mxs_ssp_set_clk_rate(struct mxs_ssp *ssp, unsigned int rate); | ||
149 | |||
150 | #endif /* __LINUX_SPI_MXS_SPI_H__ */ | ||
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 1a6b0045b06b..c2b02a5c86ae 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
@@ -504,7 +504,9 @@ | |||
504 | #define SSB_CHIPCO_FLASHCTL_ST_SE 0x02D8 /* Sector Erase */ | 504 | #define SSB_CHIPCO_FLASHCTL_ST_SE 0x02D8 /* Sector Erase */ |
505 | #define SSB_CHIPCO_FLASHCTL_ST_BE 0x00C7 /* Bulk Erase */ | 505 | #define SSB_CHIPCO_FLASHCTL_ST_BE 0x00C7 /* Bulk Erase */ |
506 | #define SSB_CHIPCO_FLASHCTL_ST_DP 0x00B9 /* Deep Power-down */ | 506 | #define SSB_CHIPCO_FLASHCTL_ST_DP 0x00B9 /* Deep Power-down */ |
507 | #define SSB_CHIPCO_FLASHCTL_ST_RSIG 0x03AB /* Read Electronic Signature */ | 507 | #define SSB_CHIPCO_FLASHCTL_ST_RES 0x03AB /* Read Electronic Signature */ |
508 | #define SSB_CHIPCO_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */ | ||
509 | #define SSB_CHIPCO_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */ | ||
508 | 510 | ||
509 | /* Status register bits for ST flashes */ | 511 | /* Status register bits for ST flashes */ |
510 | #define SSB_CHIPCO_FLASHSTA_ST_WIP 0x01 /* Write In Progress */ | 512 | #define SSB_CHIPCO_FLASHSTA_ST_WIP 0x01 /* Write In Progress */ |
diff --git a/include/linux/stallion.h b/include/linux/stallion.h deleted file mode 100644 index 336af33c6ea4..000000000000 --- a/include/linux/stallion.h +++ /dev/null | |||
@@ -1,147 +0,0 @@ | |||
1 | /*****************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * stallion.h -- stallion multiport serial driver. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998 Stallion Technologies | ||
7 | * Copyright (C) 1994-1996 Greg Ungerer. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | /*****************************************************************************/ | ||
25 | #ifndef _STALLION_H | ||
26 | #define _STALLION_H | ||
27 | /*****************************************************************************/ | ||
28 | |||
29 | /* | ||
30 | * Define important driver constants here. | ||
31 | */ | ||
32 | #define STL_MAXBRDS 4 | ||
33 | #define STL_MAXPANELS 4 | ||
34 | #define STL_MAXBANKS 8 | ||
35 | #define STL_PORTSPERPANEL 16 | ||
36 | #define STL_MAXPORTS 64 | ||
37 | #define STL_MAXDEVS (STL_MAXBRDS * STL_MAXPORTS) | ||
38 | |||
39 | |||
40 | /* | ||
41 | * Define a set of structures to hold all the board/panel/port info | ||
42 | * for our ports. These will be dynamically allocated as required. | ||
43 | */ | ||
44 | |||
45 | /* | ||
46 | * Define a ring queue structure for each port. This will hold the | ||
47 | * TX data waiting to be output. Characters are fed into this buffer | ||
48 | * from the line discipline (or even direct from user space!) and | ||
49 | * then fed into the UARTs during interrupts. Will use a classic ring | ||
50 | * queue here for this. The good thing about this type of ring queue | ||
51 | * is that the head and tail pointers can be updated without interrupt | ||
52 | * protection - since "write" code only needs to change the head, and | ||
53 | * interrupt code only needs to change the tail. | ||
54 | */ | ||
55 | struct stlrq { | ||
56 | char *buf; | ||
57 | char *head; | ||
58 | char *tail; | ||
59 | }; | ||
60 | |||
61 | /* | ||
62 | * Port, panel and board structures to hold status info about each. | ||
63 | * The board structure contains pointers to structures for each panel | ||
64 | * connected to it, and in turn each panel structure contains pointers | ||
65 | * for each port structure for each port on that panel. Note that | ||
66 | * the port structure also contains the board and panel number that it | ||
67 | * is associated with, this makes it (fairly) easy to get back to the | ||
68 | * board/panel info for a port. | ||
69 | */ | ||
70 | struct stlport { | ||
71 | unsigned long magic; | ||
72 | struct tty_port port; | ||
73 | unsigned int portnr; | ||
74 | unsigned int panelnr; | ||
75 | unsigned int brdnr; | ||
76 | int ioaddr; | ||
77 | int uartaddr; | ||
78 | unsigned int pagenr; | ||
79 | unsigned long istate; | ||
80 | int baud_base; | ||
81 | int custom_divisor; | ||
82 | int close_delay; | ||
83 | int closing_wait; | ||
84 | int openwaitcnt; | ||
85 | int brklen; | ||
86 | unsigned int sigs; | ||
87 | unsigned int rxignoremsk; | ||
88 | unsigned int rxmarkmsk; | ||
89 | unsigned int imr; | ||
90 | unsigned int crenable; | ||
91 | unsigned long clk; | ||
92 | unsigned long hwid; | ||
93 | void *uartp; | ||
94 | comstats_t stats; | ||
95 | struct stlrq tx; | ||
96 | }; | ||
97 | |||
98 | struct stlpanel { | ||
99 | unsigned long magic; | ||
100 | unsigned int panelnr; | ||
101 | unsigned int brdnr; | ||
102 | unsigned int pagenr; | ||
103 | unsigned int nrports; | ||
104 | int iobase; | ||
105 | void *uartp; | ||
106 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); | ||
107 | unsigned int hwid; | ||
108 | unsigned int ackmask; | ||
109 | struct stlport *ports[STL_PORTSPERPANEL]; | ||
110 | }; | ||
111 | |||
112 | struct stlbrd { | ||
113 | unsigned long magic; | ||
114 | unsigned int brdnr; | ||
115 | unsigned int brdtype; | ||
116 | unsigned int state; | ||
117 | unsigned int nrpanels; | ||
118 | unsigned int nrports; | ||
119 | unsigned int nrbnks; | ||
120 | int irq; | ||
121 | int irqtype; | ||
122 | int (*isr)(struct stlbrd *brdp); | ||
123 | unsigned int ioaddr1; | ||
124 | unsigned int ioaddr2; | ||
125 | unsigned int iosize1; | ||
126 | unsigned int iosize2; | ||
127 | unsigned int iostatus; | ||
128 | unsigned int ioctrl; | ||
129 | unsigned int ioctrlval; | ||
130 | unsigned int hwid; | ||
131 | unsigned long clk; | ||
132 | unsigned int bnkpageaddr[STL_MAXBANKS]; | ||
133 | unsigned int bnkstataddr[STL_MAXBANKS]; | ||
134 | struct stlpanel *bnk2panel[STL_MAXBANKS]; | ||
135 | struct stlpanel *panels[STL_MAXPANELS]; | ||
136 | }; | ||
137 | |||
138 | |||
139 | /* | ||
140 | * Define MAGIC numbers used for above structures. | ||
141 | */ | ||
142 | #define STL_PORTMAGIC 0x5a7182c9 | ||
143 | #define STL_PANELMAGIC 0x7ef621a1 | ||
144 | #define STL_BOARDMAGIC 0xa2267f52 | ||
145 | |||
146 | /*****************************************************************************/ | ||
147 | #endif | ||
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index b69bdb1e08b6..a1547ea3920d 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -76,7 +76,6 @@ | |||
76 | /* Platfrom data for platform device structure's platform_data field */ | 76 | /* Platfrom data for platform device structure's platform_data field */ |
77 | 77 | ||
78 | struct stmmac_mdio_bus_data { | 78 | struct stmmac_mdio_bus_data { |
79 | int bus_id; | ||
80 | int (*phy_reset)(void *priv); | 79 | int (*phy_reset)(void *priv); |
81 | unsigned int phy_mask; | 80 | unsigned int phy_mask; |
82 | int *irqs; | 81 | int *irqs; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index e872526fdc5f..8d08b3ed406d 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -25,6 +25,7 @@ extern int swiotlb_force; | |||
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 swiotlb_nr_tbl(void); | 27 | extern unsigned long swiotlb_nr_tbl(void); |
28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Enumeration for sync targets | 31 | * Enumeration for sync targets |
diff --git a/include/linux/task_work.h b/include/linux/task_work.h index fb46b03b1852..ca5a1cf27dae 100644 --- a/include/linux/task_work.h +++ b/include/linux/task_work.h | |||
@@ -18,8 +18,7 @@ void task_work_run(void); | |||
18 | 18 | ||
19 | static inline void exit_task_work(struct task_struct *task) | 19 | static inline void exit_task_work(struct task_struct *task) |
20 | { | 20 | { |
21 | if (unlikely(task->task_works)) | 21 | task_work_run(); |
22 | task_work_run(); | ||
23 | } | 22 | } |
24 | 23 | ||
25 | #endif /* _LINUX_TASK_WORK_H */ | 24 | #endif /* _LINUX_TASK_WORK_H */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index eb125a4c30b3..67c789ae719c 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -110,6 +110,7 @@ enum { | |||
110 | #define TCP_REPAIR_QUEUE 20 | 110 | #define TCP_REPAIR_QUEUE 20 |
111 | #define TCP_QUEUE_SEQ 21 | 111 | #define TCP_QUEUE_SEQ 21 |
112 | #define TCP_REPAIR_OPTIONS 22 | 112 | #define TCP_REPAIR_OPTIONS 22 |
113 | #define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ | ||
113 | 114 | ||
114 | struct tcp_repair_opt { | 115 | struct tcp_repair_opt { |
115 | __u32 opt_code; | 116 | __u32 opt_code; |
@@ -246,6 +247,7 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb) | |||
246 | /* TCP Fast Open */ | 247 | /* TCP Fast Open */ |
247 | #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ | 248 | #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ |
248 | #define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ | 249 | #define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ |
250 | #define TCP_FASTOPEN_COOKIE_SIZE 8 /* the size employed by this impl. */ | ||
249 | 251 | ||
250 | /* TCP Fast Open Cookie as stored in memory */ | 252 | /* TCP Fast Open Cookie as stored in memory */ |
251 | struct tcp_fastopen_cookie { | 253 | struct tcp_fastopen_cookie { |
@@ -312,9 +314,14 @@ struct tcp_request_sock { | |||
312 | /* Only used by TCP MD5 Signature so far. */ | 314 | /* Only used by TCP MD5 Signature so far. */ |
313 | const struct tcp_request_sock_ops *af_specific; | 315 | const struct tcp_request_sock_ops *af_specific; |
314 | #endif | 316 | #endif |
317 | struct sock *listener; /* needed for TFO */ | ||
315 | u32 rcv_isn; | 318 | u32 rcv_isn; |
316 | u32 snt_isn; | 319 | u32 snt_isn; |
317 | u32 snt_synack; /* synack sent time */ | 320 | u32 snt_synack; /* synack sent time */ |
321 | u32 rcv_nxt; /* the ack # by SYNACK. For | ||
322 | * FastOpen it's the seq# | ||
323 | * after data-in-SYN. | ||
324 | */ | ||
318 | }; | 325 | }; |
319 | 326 | ||
320 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | 327 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) |
@@ -505,14 +512,18 @@ struct tcp_sock { | |||
505 | struct tcp_md5sig_info __rcu *md5sig_info; | 512 | struct tcp_md5sig_info __rcu *md5sig_info; |
506 | #endif | 513 | #endif |
507 | 514 | ||
508 | /* TCP fastopen related information */ | ||
509 | struct tcp_fastopen_request *fastopen_req; | ||
510 | |||
511 | /* When the cookie options are generated and exchanged, then this | 515 | /* When the cookie options are generated and exchanged, then this |
512 | * object holds a reference to them (cookie_values->kref). Also | 516 | * object holds a reference to them (cookie_values->kref). Also |
513 | * contains related tcp_cookie_transactions fields. | 517 | * contains related tcp_cookie_transactions fields. |
514 | */ | 518 | */ |
515 | struct tcp_cookie_values *cookie_values; | 519 | struct tcp_cookie_values *cookie_values; |
520 | |||
521 | /* TCP fastopen related information */ | ||
522 | struct tcp_fastopen_request *fastopen_req; | ||
523 | /* fastopen_rsk points to request_sock that resulted in this big | ||
524 | * socket. Used to retransmit SYNACKs etc. | ||
525 | */ | ||
526 | struct request_sock *fastopen_rsk; | ||
516 | }; | 527 | }; |
517 | 528 | ||
518 | enum tsq_flags { | 529 | enum tsq_flags { |
@@ -552,6 +563,38 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | |||
552 | return (struct tcp_timewait_sock *)sk; | 563 | return (struct tcp_timewait_sock *)sk; |
553 | } | 564 | } |
554 | 565 | ||
566 | static inline bool tcp_passive_fastopen(const struct sock *sk) | ||
567 | { | ||
568 | return (sk->sk_state == TCP_SYN_RECV && | ||
569 | tcp_sk(sk)->fastopen_rsk != NULL); | ||
570 | } | ||
571 | |||
572 | static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) | ||
573 | { | ||
574 | return foc->len != -1; | ||
575 | } | ||
576 | |||
577 | extern void tcp_sock_destruct(struct sock *sk); | ||
578 | |||
579 | static inline int fastopen_init_queue(struct sock *sk, int backlog) | ||
580 | { | ||
581 | struct request_sock_queue *queue = | ||
582 | &inet_csk(sk)->icsk_accept_queue; | ||
583 | |||
584 | if (queue->fastopenq == NULL) { | ||
585 | queue->fastopenq = kzalloc( | ||
586 | sizeof(struct fastopen_queue), | ||
587 | sk->sk_allocation); | ||
588 | if (queue->fastopenq == NULL) | ||
589 | return -ENOMEM; | ||
590 | |||
591 | sk->sk_destruct = tcp_sock_destruct; | ||
592 | spin_lock_init(&queue->fastopenq->lock); | ||
593 | } | ||
594 | queue->fastopenq->max_qlen = backlog; | ||
595 | return 0; | ||
596 | } | ||
597 | |||
555 | #endif /* __KERNEL__ */ | 598 | #endif /* __KERNEL__ */ |
556 | 599 | ||
557 | #endif /* _LINUX_TCP_H */ | 600 | #endif /* _LINUX_TCP_H */ |
diff --git a/include/linux/tcp_metrics.h b/include/linux/tcp_metrics.h new file mode 100644 index 000000000000..cb5157b55f32 --- /dev/null +++ b/include/linux/tcp_metrics.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* tcp_metrics.h - TCP Metrics Interface */ | ||
2 | |||
3 | #ifndef _LINUX_TCP_METRICS_H | ||
4 | #define _LINUX_TCP_METRICS_H | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | |||
8 | /* NETLINK_GENERIC related info | ||
9 | */ | ||
10 | #define TCP_METRICS_GENL_NAME "tcp_metrics" | ||
11 | #define TCP_METRICS_GENL_VERSION 0x1 | ||
12 | |||
13 | enum tcp_metric_index { | ||
14 | TCP_METRIC_RTT, | ||
15 | TCP_METRIC_RTTVAR, | ||
16 | TCP_METRIC_SSTHRESH, | ||
17 | TCP_METRIC_CWND, | ||
18 | TCP_METRIC_REORDERING, | ||
19 | |||
20 | /* Always last. */ | ||
21 | __TCP_METRIC_MAX, | ||
22 | }; | ||
23 | |||
24 | #define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1) | ||
25 | |||
26 | enum { | ||
27 | TCP_METRICS_ATTR_UNSPEC, | ||
28 | TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */ | ||
29 | TCP_METRICS_ATTR_ADDR_IPV6, /* binary */ | ||
30 | TCP_METRICS_ATTR_AGE, /* msecs */ | ||
31 | TCP_METRICS_ATTR_TW_TSVAL, /* u32, raw, rcv tsval */ | ||
32 | TCP_METRICS_ATTR_TW_TS_STAMP, /* s32, sec age */ | ||
33 | TCP_METRICS_ATTR_VALS, /* nested +1, u32 */ | ||
34 | TCP_METRICS_ATTR_FOPEN_MSS, /* u16 */ | ||
35 | TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */ | ||
36 | TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */ | ||
37 | TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */ | ||
38 | |||
39 | __TCP_METRICS_ATTR_MAX, | ||
40 | }; | ||
41 | |||
42 | #define TCP_METRICS_ATTR_MAX (__TCP_METRICS_ATTR_MAX - 1) | ||
43 | |||
44 | enum { | ||
45 | TCP_METRICS_CMD_UNSPEC, | ||
46 | TCP_METRICS_CMD_GET, | ||
47 | TCP_METRICS_CMD_DEL, | ||
48 | |||
49 | __TCP_METRICS_CMD_MAX, | ||
50 | }; | ||
51 | |||
52 | #define TCP_METRICS_CMD_MAX (__TCP_METRICS_CMD_MAX - 1) | ||
53 | |||
54 | #endif /* _LINUX_TCP_METRICS_H */ | ||
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 3ca0269dd0b5..932b76392248 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
@@ -281,9 +281,10 @@ struct kim_data_s { | |||
281 | long st_kim_start(void *); | 281 | long st_kim_start(void *); |
282 | long st_kim_stop(void *); | 282 | long st_kim_stop(void *); |
283 | 283 | ||
284 | void st_kim_recv(void *, const unsigned char *, long count); | ||
285 | void st_kim_complete(void *); | 284 | void st_kim_complete(void *); |
286 | void kim_st_list_protocols(struct st_data_s *, void *); | 285 | void kim_st_list_protocols(struct st_data_s *, void *); |
286 | void st_kim_recv(void *, const unsigned char *, long); | ||
287 | |||
287 | 288 | ||
288 | /* | 289 | /* |
289 | * BTS headers | 290 | * BTS headers |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 6abd9138beda..8c5a197e1587 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -49,147 +49,112 @@ extern struct tvec_base boot_tvec_bases; | |||
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * Note that all tvec_bases are 2 byte aligned and lower bit of | 52 | * Note that all tvec_bases are at least 4 byte aligned and lower two bits |
53 | * base in timer_list is guaranteed to be zero. Use the LSB to | 53 | * of base in timer_list is guaranteed to be zero. Use them for flags. |
54 | * indicate whether the timer is deferrable. | ||
55 | * | 54 | * |
56 | * A deferrable timer will work normally when the system is busy, but | 55 | * A deferrable timer will work normally when the system is busy, but |
57 | * will not cause a CPU to come out of idle just to service it; instead, | 56 | * will not cause a CPU to come out of idle just to service it; instead, |
58 | * the timer will be serviced when the CPU eventually wakes up with a | 57 | * the timer will be serviced when the CPU eventually wakes up with a |
59 | * subsequent non-deferrable timer. | 58 | * subsequent non-deferrable timer. |
59 | * | ||
60 | * An irqsafe timer is executed with IRQ disabled and it's safe to wait for | ||
61 | * the completion of the running instance from IRQ handlers, for example, | ||
62 | * by calling del_timer_sync(). | ||
63 | * | ||
64 | * Note: The irq disabled callback execution is a special case for | ||
65 | * workqueue locking issues. It's not meant for executing random crap | ||
66 | * with interrupts disabled. Abuse is monitored! | ||
60 | */ | 67 | */ |
61 | #define TBASE_DEFERRABLE_FLAG (0x1) | 68 | #define TIMER_DEFERRABLE 0x1LU |
69 | #define TIMER_IRQSAFE 0x2LU | ||
62 | 70 | ||
63 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ | 71 | #define TIMER_FLAG_MASK 0x3LU |
72 | |||
73 | #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ | ||
64 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 74 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ |
65 | .function = (_function), \ | 75 | .function = (_function), \ |
66 | .expires = (_expires), \ | 76 | .expires = (_expires), \ |
67 | .data = (_data), \ | 77 | .data = (_data), \ |
68 | .base = &boot_tvec_bases, \ | 78 | .base = (void *)((unsigned long)&boot_tvec_bases + (_flags)), \ |
69 | .slack = -1, \ | 79 | .slack = -1, \ |
70 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 80 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
71 | __FILE__ ":" __stringify(__LINE__)) \ | 81 | __FILE__ ":" __stringify(__LINE__)) \ |
72 | } | 82 | } |
73 | 83 | ||
74 | #define TBASE_MAKE_DEFERRED(ptr) ((struct tvec_base *) \ | 84 | #define TIMER_INITIALIZER(_function, _expires, _data) \ |
75 | ((unsigned char *)(ptr) + TBASE_DEFERRABLE_FLAG)) | 85 | __TIMER_INITIALIZER((_function), (_expires), (_data), 0) |
76 | 86 | ||
77 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) {\ | 87 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) \ |
78 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 88 | __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE) |
79 | .function = (_function), \ | ||
80 | .expires = (_expires), \ | ||
81 | .data = (_data), \ | ||
82 | .base = TBASE_MAKE_DEFERRED(&boot_tvec_bases), \ | ||
83 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | ||
84 | __FILE__ ":" __stringify(__LINE__)) \ | ||
85 | } | ||
86 | 89 | ||
87 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ | 90 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ |
88 | struct timer_list _name = \ | 91 | struct timer_list _name = \ |
89 | TIMER_INITIALIZER(_function, _expires, _data) | 92 | TIMER_INITIALIZER(_function, _expires, _data) |
90 | 93 | ||
91 | void init_timer_key(struct timer_list *timer, | 94 | void init_timer_key(struct timer_list *timer, unsigned int flags, |
92 | const char *name, | 95 | const char *name, struct lock_class_key *key); |
93 | struct lock_class_key *key); | 96 | |
94 | void init_timer_deferrable_key(struct timer_list *timer, | 97 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS |
95 | const char *name, | 98 | extern void init_timer_on_stack_key(struct timer_list *timer, |
96 | struct lock_class_key *key); | 99 | unsigned int flags, const char *name, |
100 | struct lock_class_key *key); | ||
101 | extern void destroy_timer_on_stack(struct timer_list *timer); | ||
102 | #else | ||
103 | static inline void destroy_timer_on_stack(struct timer_list *timer) { } | ||
104 | static inline void init_timer_on_stack_key(struct timer_list *timer, | ||
105 | unsigned int flags, const char *name, | ||
106 | struct lock_class_key *key) | ||
107 | { | ||
108 | init_timer_key(timer, flags, name, key); | ||
109 | } | ||
110 | #endif | ||
97 | 111 | ||
98 | #ifdef CONFIG_LOCKDEP | 112 | #ifdef CONFIG_LOCKDEP |
99 | #define init_timer(timer) \ | 113 | #define __init_timer(_timer, _flags) \ |
100 | do { \ | 114 | do { \ |
101 | static struct lock_class_key __key; \ | 115 | static struct lock_class_key __key; \ |
102 | init_timer_key((timer), #timer, &__key); \ | 116 | init_timer_key((_timer), (_flags), #_timer, &__key); \ |
103 | } while (0) | 117 | } while (0) |
104 | 118 | ||
105 | #define init_timer_deferrable(timer) \ | 119 | #define __init_timer_on_stack(_timer, _flags) \ |
106 | do { \ | 120 | do { \ |
107 | static struct lock_class_key __key; \ | 121 | static struct lock_class_key __key; \ |
108 | init_timer_deferrable_key((timer), #timer, &__key); \ | 122 | init_timer_on_stack_key((_timer), (_flags), #_timer, &__key); \ |
109 | } while (0) | 123 | } while (0) |
124 | #else | ||
125 | #define __init_timer(_timer, _flags) \ | ||
126 | init_timer_key((_timer), (_flags), NULL, NULL) | ||
127 | #define __init_timer_on_stack(_timer, _flags) \ | ||
128 | init_timer_on_stack_key((_timer), (_flags), NULL, NULL) | ||
129 | #endif | ||
110 | 130 | ||
131 | #define init_timer(timer) \ | ||
132 | __init_timer((timer), 0) | ||
133 | #define init_timer_deferrable(timer) \ | ||
134 | __init_timer((timer), TIMER_DEFERRABLE) | ||
111 | #define init_timer_on_stack(timer) \ | 135 | #define init_timer_on_stack(timer) \ |
136 | __init_timer_on_stack((timer), 0) | ||
137 | |||
138 | #define __setup_timer(_timer, _fn, _data, _flags) \ | ||
112 | do { \ | 139 | do { \ |
113 | static struct lock_class_key __key; \ | 140 | __init_timer((_timer), (_flags)); \ |
114 | init_timer_on_stack_key((timer), #timer, &__key); \ | 141 | (_timer)->function = (_fn); \ |
142 | (_timer)->data = (_data); \ | ||
115 | } while (0) | 143 | } while (0) |
116 | 144 | ||
117 | #define setup_timer(timer, fn, data) \ | 145 | #define __setup_timer_on_stack(_timer, _fn, _data, _flags) \ |
118 | do { \ | 146 | do { \ |
119 | static struct lock_class_key __key; \ | 147 | __init_timer_on_stack((_timer), (_flags)); \ |
120 | setup_timer_key((timer), #timer, &__key, (fn), (data));\ | 148 | (_timer)->function = (_fn); \ |
149 | (_timer)->data = (_data); \ | ||
121 | } while (0) | 150 | } while (0) |
122 | 151 | ||
152 | #define setup_timer(timer, fn, data) \ | ||
153 | __setup_timer((timer), (fn), (data), 0) | ||
123 | #define setup_timer_on_stack(timer, fn, data) \ | 154 | #define setup_timer_on_stack(timer, fn, data) \ |
124 | do { \ | 155 | __setup_timer_on_stack((timer), (fn), (data), 0) |
125 | static struct lock_class_key __key; \ | ||
126 | setup_timer_on_stack_key((timer), #timer, &__key, \ | ||
127 | (fn), (data)); \ | ||
128 | } while (0) | ||
129 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ | 156 | #define setup_deferrable_timer_on_stack(timer, fn, data) \ |
130 | do { \ | 157 | __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE) |
131 | static struct lock_class_key __key; \ | ||
132 | setup_deferrable_timer_on_stack_key((timer), #timer, \ | ||
133 | &__key, (fn), \ | ||
134 | (data)); \ | ||
135 | } while (0) | ||
136 | #else | ||
137 | #define init_timer(timer)\ | ||
138 | init_timer_key((timer), NULL, NULL) | ||
139 | #define init_timer_deferrable(timer)\ | ||
140 | init_timer_deferrable_key((timer), NULL, NULL) | ||
141 | #define init_timer_on_stack(timer)\ | ||
142 | init_timer_on_stack_key((timer), NULL, NULL) | ||
143 | #define setup_timer(timer, fn, data)\ | ||
144 | setup_timer_key((timer), NULL, NULL, (fn), (data)) | ||
145 | #define setup_timer_on_stack(timer, fn, data)\ | ||
146 | setup_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
147 | #define setup_deferrable_timer_on_stack(timer, fn, data)\ | ||
148 | setup_deferrable_timer_on_stack_key((timer), NULL, NULL, (fn), (data)) | ||
149 | #endif | ||
150 | |||
151 | #ifdef CONFIG_DEBUG_OBJECTS_TIMERS | ||
152 | extern void init_timer_on_stack_key(struct timer_list *timer, | ||
153 | const char *name, | ||
154 | struct lock_class_key *key); | ||
155 | extern void destroy_timer_on_stack(struct timer_list *timer); | ||
156 | #else | ||
157 | static inline void destroy_timer_on_stack(struct timer_list *timer) { } | ||
158 | static inline void init_timer_on_stack_key(struct timer_list *timer, | ||
159 | const char *name, | ||
160 | struct lock_class_key *key) | ||
161 | { | ||
162 | init_timer_key(timer, name, key); | ||
163 | } | ||
164 | #endif | ||
165 | |||
166 | static inline void setup_timer_key(struct timer_list * timer, | ||
167 | const char *name, | ||
168 | struct lock_class_key *key, | ||
169 | void (*function)(unsigned long), | ||
170 | unsigned long data) | ||
171 | { | ||
172 | timer->function = function; | ||
173 | timer->data = data; | ||
174 | init_timer_key(timer, name, key); | ||
175 | } | ||
176 | |||
177 | static inline void setup_timer_on_stack_key(struct timer_list *timer, | ||
178 | const char *name, | ||
179 | struct lock_class_key *key, | ||
180 | void (*function)(unsigned long), | ||
181 | unsigned long data) | ||
182 | { | ||
183 | timer->function = function; | ||
184 | timer->data = data; | ||
185 | init_timer_on_stack_key(timer, name, key); | ||
186 | } | ||
187 | |||
188 | extern void setup_deferrable_timer_on_stack_key(struct timer_list *timer, | ||
189 | const char *name, | ||
190 | struct lock_class_key *key, | ||
191 | void (*function)(unsigned long), | ||
192 | unsigned long data); | ||
193 | 158 | ||
194 | /** | 159 | /** |
195 | * timer_pending - is a timer pending? | 160 | * timer_pending - is a timer pending? |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index c98928420100..0b1e3f218a36 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
@@ -89,8 +89,8 @@ | |||
89 | 89 | ||
90 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ | 90 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ |
91 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ | 91 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ |
92 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ | 92 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* obsoleted */ |
93 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ | 93 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* obsoleted */ |
94 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */ | 94 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */ |
95 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */ | 95 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */ |
96 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */ | 96 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */ |
@@ -115,8 +115,8 @@ | |||
115 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ | 115 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ |
116 | #define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */ | 116 | #define TIPC_CMD_SET_REMOTE_MNG 0x8003 /* tx unsigned, rx none */ |
117 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ | 117 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ |
118 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ | 118 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* obsoleted */ |
119 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ | 119 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* obsoleted */ |
120 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */ | 120 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */ |
121 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */ | 121 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */ |
122 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */ | 122 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index fec12d667211..d3cf0d6e7712 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -129,7 +129,6 @@ int arch_update_cpu_topology(void); | |||
129 | | 1*SD_BALANCE_FORK \ | 129 | | 1*SD_BALANCE_FORK \ |
130 | | 0*SD_BALANCE_WAKE \ | 130 | | 0*SD_BALANCE_WAKE \ |
131 | | 1*SD_WAKE_AFFINE \ | 131 | | 1*SD_WAKE_AFFINE \ |
132 | | 0*SD_PREFER_LOCAL \ | ||
133 | | 0*SD_SHARE_CPUPOWER \ | 132 | | 0*SD_SHARE_CPUPOWER \ |
134 | | 1*SD_SHARE_PKG_RESOURCES \ | 133 | | 1*SD_SHARE_PKG_RESOURCES \ |
135 | | 0*SD_SERIALIZE \ | 134 | | 0*SD_SERIALIZE \ |
@@ -160,7 +159,6 @@ int arch_update_cpu_topology(void); | |||
160 | | 1*SD_BALANCE_FORK \ | 159 | | 1*SD_BALANCE_FORK \ |
161 | | 0*SD_BALANCE_WAKE \ | 160 | | 0*SD_BALANCE_WAKE \ |
162 | | 1*SD_WAKE_AFFINE \ | 161 | | 1*SD_WAKE_AFFINE \ |
163 | | 0*SD_PREFER_LOCAL \ | ||
164 | | 0*SD_SHARE_CPUPOWER \ | 162 | | 0*SD_SHARE_CPUPOWER \ |
165 | | 0*SD_SHARE_PKG_RESOURCES \ | 163 | | 0*SD_SHARE_PKG_RESOURCES \ |
166 | | 0*SD_SERIALIZE \ | 164 | | 0*SD_SERIALIZE \ |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index fdc718abf83b..fcb627ff8d3e 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -32,6 +32,7 @@ | |||
32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
34 | extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); | 34 | extern int tpm_send(u32 chip_num, void *cmd, size_t buflen); |
35 | extern int tpm_get_random(u32 chip_num, u8 *data, size_t max); | ||
35 | #else | 36 | #else |
36 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | 37 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { |
37 | return -ENODEV; | 38 | return -ENODEV; |
@@ -42,5 +43,8 @@ static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { | |||
42 | static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) { | 43 | static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) { |
43 | return -ENODEV; | 44 | return -ENODEV; |
44 | } | 45 | } |
46 | static inline int tpm_get_random(u32 chip_num, u8 *data, size_t max) { | ||
47 | return -ENODEV; | ||
48 | } | ||
45 | #endif | 49 | #endif |
46 | #endif | 50 | #endif |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 802de56c41e8..2f322c38bd4d 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -136,6 +136,22 @@ static inline void tracepoint_synchronize_unregister(void) | |||
136 | postrcu; \ | 136 | postrcu; \ |
137 | } while (0) | 137 | } while (0) |
138 | 138 | ||
139 | #ifndef MODULE | ||
140 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \ | ||
141 | static inline void trace_##name##_rcuidle(proto) \ | ||
142 | { \ | ||
143 | if (static_key_false(&__tracepoint_##name.key)) \ | ||
144 | __DO_TRACE(&__tracepoint_##name, \ | ||
145 | TP_PROTO(data_proto), \ | ||
146 | TP_ARGS(data_args), \ | ||
147 | TP_CONDITION(cond), \ | ||
148 | rcu_idle_exit(), \ | ||
149 | rcu_idle_enter()); \ | ||
150 | } | ||
151 | #else | ||
152 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) | ||
153 | #endif | ||
154 | |||
139 | /* | 155 | /* |
140 | * Make sure the alignment of the structure in the __tracepoints section will | 156 | * Make sure the alignment of the structure in the __tracepoints section will |
141 | * not add unwanted padding between the beginning of the section and the | 157 | * not add unwanted padding between the beginning of the section and the |
@@ -151,16 +167,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
151 | TP_ARGS(data_args), \ | 167 | TP_ARGS(data_args), \ |
152 | TP_CONDITION(cond),,); \ | 168 | TP_CONDITION(cond),,); \ |
153 | } \ | 169 | } \ |
154 | static inline void trace_##name##_rcuidle(proto) \ | 170 | __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \ |
155 | { \ | 171 | PARAMS(cond), PARAMS(data_proto), PARAMS(data_args)) \ |
156 | if (static_key_false(&__tracepoint_##name.key)) \ | ||
157 | __DO_TRACE(&__tracepoint_##name, \ | ||
158 | TP_PROTO(data_proto), \ | ||
159 | TP_ARGS(data_args), \ | ||
160 | TP_CONDITION(cond), \ | ||
161 | rcu_idle_exit(), \ | ||
162 | rcu_idle_enter()); \ | ||
163 | } \ | ||
164 | static inline int \ | 172 | static inline int \ |
165 | register_trace_##name(void (*probe)(data_proto), void *data) \ | 173 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
166 | { \ | 174 | { \ |
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h index 7e50ac795b0b..44893e5ec8f7 100644 --- a/include/linux/tsacct_kern.h +++ b/include/linux/tsacct_kern.h | |||
@@ -10,9 +10,13 @@ | |||
10 | #include <linux/taskstats.h> | 10 | #include <linux/taskstats.h> |
11 | 11 | ||
12 | #ifdef CONFIG_TASKSTATS | 12 | #ifdef CONFIG_TASKSTATS |
13 | extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk); | 13 | extern void bacct_add_tsk(struct user_namespace *user_ns, |
14 | struct pid_namespace *pid_ns, | ||
15 | struct taskstats *stats, struct task_struct *tsk); | ||
14 | #else | 16 | #else |
15 | static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | 17 | static inline void bacct_add_tsk(struct user_namespace *user_ns, |
18 | struct pid_namespace *pid_ns, | ||
19 | struct taskstats *stats, struct task_struct *tsk) | ||
16 | {} | 20 | {} |
17 | #endif /* CONFIG_TASKSTATS */ | 21 | #endif /* CONFIG_TASKSTATS */ |
18 | 22 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 9f47ab540f65..4f6c59a5fb79 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/tty_driver.h> | 43 | #include <linux/tty_driver.h> |
44 | #include <linux/tty_ldisc.h> | 44 | #include <linux/tty_ldisc.h> |
45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
46 | #include <linux/tty_flags.h> | ||
46 | 47 | ||
47 | 48 | ||
48 | 49 | ||
@@ -103,28 +104,28 @@ struct tty_bufhead { | |||
103 | #define TTY_PARITY 3 | 104 | #define TTY_PARITY 3 |
104 | #define TTY_OVERRUN 4 | 105 | #define TTY_OVERRUN 4 |
105 | 106 | ||
106 | #define INTR_CHAR(tty) ((tty)->termios->c_cc[VINTR]) | 107 | #define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR]) |
107 | #define QUIT_CHAR(tty) ((tty)->termios->c_cc[VQUIT]) | 108 | #define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT]) |
108 | #define ERASE_CHAR(tty) ((tty)->termios->c_cc[VERASE]) | 109 | #define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE]) |
109 | #define KILL_CHAR(tty) ((tty)->termios->c_cc[VKILL]) | 110 | #define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL]) |
110 | #define EOF_CHAR(tty) ((tty)->termios->c_cc[VEOF]) | 111 | #define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF]) |
111 | #define TIME_CHAR(tty) ((tty)->termios->c_cc[VTIME]) | 112 | #define TIME_CHAR(tty) ((tty)->termios.c_cc[VTIME]) |
112 | #define MIN_CHAR(tty) ((tty)->termios->c_cc[VMIN]) | 113 | #define MIN_CHAR(tty) ((tty)->termios.c_cc[VMIN]) |
113 | #define SWTC_CHAR(tty) ((tty)->termios->c_cc[VSWTC]) | 114 | #define SWTC_CHAR(tty) ((tty)->termios.c_cc[VSWTC]) |
114 | #define START_CHAR(tty) ((tty)->termios->c_cc[VSTART]) | 115 | #define START_CHAR(tty) ((tty)->termios.c_cc[VSTART]) |
115 | #define STOP_CHAR(tty) ((tty)->termios->c_cc[VSTOP]) | 116 | #define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP]) |
116 | #define SUSP_CHAR(tty) ((tty)->termios->c_cc[VSUSP]) | 117 | #define SUSP_CHAR(tty) ((tty)->termios.c_cc[VSUSP]) |
117 | #define EOL_CHAR(tty) ((tty)->termios->c_cc[VEOL]) | 118 | #define EOL_CHAR(tty) ((tty)->termios.c_cc[VEOL]) |
118 | #define REPRINT_CHAR(tty) ((tty)->termios->c_cc[VREPRINT]) | 119 | #define REPRINT_CHAR(tty) ((tty)->termios.c_cc[VREPRINT]) |
119 | #define DISCARD_CHAR(tty) ((tty)->termios->c_cc[VDISCARD]) | 120 | #define DISCARD_CHAR(tty) ((tty)->termios.c_cc[VDISCARD]) |
120 | #define WERASE_CHAR(tty) ((tty)->termios->c_cc[VWERASE]) | 121 | #define WERASE_CHAR(tty) ((tty)->termios.c_cc[VWERASE]) |
121 | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) | 122 | #define LNEXT_CHAR(tty) ((tty)->termios.c_cc[VLNEXT]) |
122 | #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) | 123 | #define EOL2_CHAR(tty) ((tty)->termios.c_cc[VEOL2]) |
123 | 124 | ||
124 | #define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) | 125 | #define _I_FLAG(tty, f) ((tty)->termios.c_iflag & (f)) |
125 | #define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) | 126 | #define _O_FLAG(tty, f) ((tty)->termios.c_oflag & (f)) |
126 | #define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) | 127 | #define _C_FLAG(tty, f) ((tty)->termios.c_cflag & (f)) |
127 | #define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) | 128 | #define _L_FLAG(tty, f) ((tty)->termios.c_lflag & (f)) |
128 | 129 | ||
129 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) | 130 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) |
130 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) | 131 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) |
@@ -268,10 +269,11 @@ struct tty_struct { | |||
268 | struct mutex ldisc_mutex; | 269 | struct mutex ldisc_mutex; |
269 | struct tty_ldisc *ldisc; | 270 | struct tty_ldisc *ldisc; |
270 | 271 | ||
272 | struct mutex legacy_mutex; | ||
271 | struct mutex termios_mutex; | 273 | struct mutex termios_mutex; |
272 | spinlock_t ctrl_lock; | 274 | spinlock_t ctrl_lock; |
273 | /* Termios values are protected by the termios mutex */ | 275 | /* Termios values are protected by the termios mutex */ |
274 | struct ktermios *termios, *termios_locked; | 276 | struct ktermios termios, termios_locked; |
275 | struct termiox *termiox; /* May be NULL for unsupported */ | 277 | struct termiox *termiox; /* May be NULL for unsupported */ |
276 | char name[64]; | 278 | char name[64]; |
277 | struct pid *pgrp; /* Protected by ctrl lock */ | 279 | struct pid *pgrp; /* Protected by ctrl lock */ |
@@ -410,6 +412,10 @@ extern int tty_register_driver(struct tty_driver *driver); | |||
410 | extern int tty_unregister_driver(struct tty_driver *driver); | 412 | extern int tty_unregister_driver(struct tty_driver *driver); |
411 | extern struct device *tty_register_device(struct tty_driver *driver, | 413 | extern struct device *tty_register_device(struct tty_driver *driver, |
412 | unsigned index, struct device *dev); | 414 | unsigned index, struct device *dev); |
415 | extern struct device *tty_register_device_attr(struct tty_driver *driver, | ||
416 | unsigned index, struct device *device, | ||
417 | void *drvdata, | ||
418 | const struct attribute_group **attr_grp); | ||
413 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 419 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
414 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 420 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
415 | int buflen); | 421 | int buflen); |
@@ -423,7 +429,6 @@ extern void tty_unthrottle(struct tty_struct *tty); | |||
423 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); | 429 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); |
424 | extern void tty_driver_remove_tty(struct tty_driver *driver, | 430 | extern void tty_driver_remove_tty(struct tty_driver *driver, |
425 | struct tty_struct *tty); | 431 | struct tty_struct *tty); |
426 | extern void tty_shutdown(struct tty_struct *tty); | ||
427 | extern void tty_free_termios(struct tty_struct *tty); | 432 | extern void tty_free_termios(struct tty_struct *tty); |
428 | extern int is_current_pgrp_orphaned(void); | 433 | extern int is_current_pgrp_orphaned(void); |
429 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 434 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
@@ -497,6 +502,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
497 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) | 502 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) |
498 | 503 | ||
499 | extern void tty_port_init(struct tty_port *port); | 504 | extern void tty_port_init(struct tty_port *port); |
505 | extern void tty_port_link_device(struct tty_port *port, | ||
506 | struct tty_driver *driver, unsigned index); | ||
507 | extern struct device *tty_port_register_device(struct tty_port *port, | ||
508 | struct tty_driver *driver, unsigned index, | ||
509 | struct device *device); | ||
510 | extern struct device *tty_port_register_device_attr(struct tty_port *port, | ||
511 | struct tty_driver *driver, unsigned index, | ||
512 | struct device *device, void *drvdata, | ||
513 | const struct attribute_group **attr_grp); | ||
500 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 514 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
501 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 515 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
502 | extern void tty_port_put(struct tty_port *port); | 516 | extern void tty_port_put(struct tty_port *port); |
@@ -508,6 +522,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port) | |||
508 | return port; | 522 | return port; |
509 | } | 523 | } |
510 | 524 | ||
525 | /* If the cts flow control is enabled, return true. */ | ||
526 | static inline bool tty_port_cts_enabled(struct tty_port *port) | ||
527 | { | ||
528 | return port->flags & ASYNC_CTS_FLOW; | ||
529 | } | ||
530 | |||
511 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 531 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
512 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 532 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
513 | extern int tty_port_carrier_raised(struct tty_port *port); | 533 | extern int tty_port_carrier_raised(struct tty_port *port); |
@@ -521,6 +541,8 @@ extern int tty_port_close_start(struct tty_port *port, | |||
521 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | 541 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); |
522 | extern void tty_port_close(struct tty_port *port, | 542 | extern void tty_port_close(struct tty_port *port, |
523 | struct tty_struct *tty, struct file *filp); | 543 | struct tty_struct *tty, struct file *filp); |
544 | extern int tty_port_install(struct tty_port *port, struct tty_driver *driver, | ||
545 | struct tty_struct *tty); | ||
524 | extern int tty_port_open(struct tty_port *port, | 546 | extern int tty_port_open(struct tty_port *port, |
525 | struct tty_struct *tty, struct file *filp); | 547 | struct tty_struct *tty, struct file *filp); |
526 | static inline int tty_port_users(struct tty_port *port) | 548 | static inline int tty_port_users(struct tty_port *port) |
@@ -553,7 +575,7 @@ extern void tty_audit_fork(struct signal_struct *sig); | |||
553 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 575 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
554 | extern void tty_audit_push(struct tty_struct *tty); | 576 | extern void tty_audit_push(struct tty_struct *tty); |
555 | extern int tty_audit_push_task(struct task_struct *tsk, | 577 | extern int tty_audit_push_task(struct task_struct *tsk, |
556 | uid_t loginuid, u32 sessionid); | 578 | kuid_t loginuid, u32 sessionid); |
557 | #else | 579 | #else |
558 | static inline void tty_audit_add_data(struct tty_struct *tty, | 580 | static inline void tty_audit_add_data(struct tty_struct *tty, |
559 | unsigned char *data, size_t size) | 581 | unsigned char *data, size_t size) |
@@ -572,7 +594,7 @@ static inline void tty_audit_push(struct tty_struct *tty) | |||
572 | { | 594 | { |
573 | } | 595 | } |
574 | static inline int tty_audit_push_task(struct task_struct *tsk, | 596 | static inline int tty_audit_push_task(struct task_struct *tsk, |
575 | uid_t loginuid, u32 sessionid) | 597 | kuid_t loginuid, u32 sessionid) |
576 | { | 598 | { |
577 | return 0; | 599 | return 0; |
578 | } | 600 | } |
@@ -605,8 +627,12 @@ extern long vt_compat_ioctl(struct tty_struct *tty, | |||
605 | 627 | ||
606 | /* tty_mutex.c */ | 628 | /* tty_mutex.c */ |
607 | /* functions for preparation of BKL removal */ | 629 | /* functions for preparation of BKL removal */ |
608 | extern void __lockfunc tty_lock(void) __acquires(tty_lock); | 630 | extern void __lockfunc tty_lock(struct tty_struct *tty); |
609 | extern void __lockfunc tty_unlock(void) __releases(tty_lock); | 631 | extern void __lockfunc tty_unlock(struct tty_struct *tty); |
632 | extern void __lockfunc tty_lock_pair(struct tty_struct *tty, | ||
633 | struct tty_struct *tty2); | ||
634 | extern void __lockfunc tty_unlock_pair(struct tty_struct *tty, | ||
635 | struct tty_struct *tty2); | ||
610 | 636 | ||
611 | /* | 637 | /* |
612 | * this shall be called only from where BTM is held (like close) | 638 | * this shall be called only from where BTM is held (like close) |
@@ -621,9 +647,9 @@ extern void __lockfunc tty_unlock(void) __releases(tty_lock); | |||
621 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | 647 | static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, |
622 | long timeout) | 648 | long timeout) |
623 | { | 649 | { |
624 | tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */ | 650 | tty_unlock(tty); /* tty->ops->close holds the BTM, drop it while waiting */ |
625 | tty_wait_until_sent(tty, timeout); | 651 | tty_wait_until_sent(tty, timeout); |
626 | tty_lock(); | 652 | tty_lock(tty); |
627 | } | 653 | } |
628 | 654 | ||
629 | /* | 655 | /* |
@@ -638,16 +664,16 @@ static inline void tty_wait_until_sent_from_close(struct tty_struct *tty, | |||
638 | * | 664 | * |
639 | * Do not use in new code. | 665 | * Do not use in new code. |
640 | */ | 666 | */ |
641 | #define wait_event_interruptible_tty(wq, condition) \ | 667 | #define wait_event_interruptible_tty(tty, wq, condition) \ |
642 | ({ \ | 668 | ({ \ |
643 | int __ret = 0; \ | 669 | int __ret = 0; \ |
644 | if (!(condition)) { \ | 670 | if (!(condition)) { \ |
645 | __wait_event_interruptible_tty(wq, condition, __ret); \ | 671 | __wait_event_interruptible_tty(tty, wq, condition, __ret); \ |
646 | } \ | 672 | } \ |
647 | __ret; \ | 673 | __ret; \ |
648 | }) | 674 | }) |
649 | 675 | ||
650 | #define __wait_event_interruptible_tty(wq, condition, ret) \ | 676 | #define __wait_event_interruptible_tty(tty, wq, condition, ret) \ |
651 | do { \ | 677 | do { \ |
652 | DEFINE_WAIT(__wait); \ | 678 | DEFINE_WAIT(__wait); \ |
653 | \ | 679 | \ |
@@ -656,9 +682,9 @@ do { \ | |||
656 | if (condition) \ | 682 | if (condition) \ |
657 | break; \ | 683 | break; \ |
658 | if (!signal_pending(current)) { \ | 684 | if (!signal_pending(current)) { \ |
659 | tty_unlock(); \ | 685 | tty_unlock(tty); \ |
660 | schedule(); \ | 686 | schedule(); \ |
661 | tty_lock(); \ | 687 | tty_lock(tty); \ |
662 | continue; \ | 688 | continue; \ |
663 | } \ | 689 | } \ |
664 | ret = -ERESTARTSYS; \ | 690 | ret = -ERESTARTSYS; \ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 6e6dbb7447b6..dd976cfb6131 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -45,14 +45,9 @@ | |||
45 | * | 45 | * |
46 | * void (*shutdown)(struct tty_struct * tty); | 46 | * void (*shutdown)(struct tty_struct * tty); |
47 | * | 47 | * |
48 | * This routine is called synchronously when a particular tty device | 48 | * This routine is called under the tty lock when a particular tty device |
49 | * is closed for the last time freeing up the resources. | 49 | * is closed for the last time. It executes before the tty resources |
50 | * Note that tty_shutdown() is not called if ops->shutdown is defined. | 50 | * are freed so may execute while another function holds a tty kref. |
51 | * This means one is responsible to take care of calling ops->remove (e.g. | ||
52 | * via tty_driver_remove_tty) and releasing tty->termios. | ||
53 | * Note that this hook may be called from *all* the contexts where one | ||
54 | * uses tty refcounting (e.g. tty_port_tty_get). | ||
55 | * | ||
56 | * | 51 | * |
57 | * void (*cleanup)(struct tty_struct * tty); | 52 | * void (*cleanup)(struct tty_struct * tty); |
58 | * | 53 | * |
@@ -294,18 +289,18 @@ struct tty_operations { | |||
294 | struct tty_driver { | 289 | struct tty_driver { |
295 | int magic; /* magic number for this structure */ | 290 | int magic; /* magic number for this structure */ |
296 | struct kref kref; /* Reference management */ | 291 | struct kref kref; /* Reference management */ |
297 | struct cdev cdev; | 292 | struct cdev *cdevs; |
298 | struct module *owner; | 293 | struct module *owner; |
299 | const char *driver_name; | 294 | const char *driver_name; |
300 | const char *name; | 295 | const char *name; |
301 | int name_base; /* offset of printed name */ | 296 | int name_base; /* offset of printed name */ |
302 | int major; /* major device number */ | 297 | int major; /* major device number */ |
303 | int minor_start; /* start of minor device number */ | 298 | int minor_start; /* start of minor device number */ |
304 | int num; /* number of devices allocated */ | 299 | unsigned int num; /* number of devices allocated */ |
305 | short type; /* type of tty driver */ | 300 | short type; /* type of tty driver */ |
306 | short subtype; /* subtype of tty driver */ | 301 | short subtype; /* subtype of tty driver */ |
307 | struct ktermios init_termios; /* Initial termios */ | 302 | struct ktermios init_termios; /* Initial termios */ |
308 | int flags; /* tty driver flags */ | 303 | unsigned long flags; /* tty driver flags */ |
309 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ | 304 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ |
310 | struct tty_driver *other; /* only used for the PTY driver */ | 305 | struct tty_driver *other; /* only used for the PTY driver */ |
311 | 306 | ||
@@ -313,6 +308,7 @@ struct tty_driver { | |||
313 | * Pointer to the tty data structures | 308 | * Pointer to the tty data structures |
314 | */ | 309 | */ |
315 | struct tty_struct **ttys; | 310 | struct tty_struct **ttys; |
311 | struct tty_port **ports; | ||
316 | struct ktermios **termios; | 312 | struct ktermios **termios; |
317 | void *driver_state; | 313 | void *driver_state; |
318 | 314 | ||
@@ -326,7 +322,8 @@ struct tty_driver { | |||
326 | 322 | ||
327 | extern struct list_head tty_drivers; | 323 | extern struct list_head tty_drivers; |
328 | 324 | ||
329 | extern struct tty_driver *__alloc_tty_driver(int lines, struct module *owner); | 325 | extern struct tty_driver *__tty_alloc_driver(unsigned int lines, |
326 | struct module *owner, unsigned long flags); | ||
330 | extern void put_tty_driver(struct tty_driver *driver); | 327 | extern void put_tty_driver(struct tty_driver *driver); |
331 | extern void tty_set_operations(struct tty_driver *driver, | 328 | extern void tty_set_operations(struct tty_driver *driver, |
332 | const struct tty_operations *op); | 329 | const struct tty_operations *op); |
@@ -334,7 +331,21 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | |||
334 | 331 | ||
335 | extern void tty_driver_kref_put(struct tty_driver *driver); | 332 | extern void tty_driver_kref_put(struct tty_driver *driver); |
336 | 333 | ||
337 | #define alloc_tty_driver(lines) __alloc_tty_driver(lines, THIS_MODULE) | 334 | /* Use TTY_DRIVER_* flags below */ |
335 | #define tty_alloc_driver(lines, flags) \ | ||
336 | __tty_alloc_driver(lines, THIS_MODULE, flags) | ||
337 | |||
338 | /* | ||
339 | * DEPRECATED Do not use this in new code, use tty_alloc_driver instead. | ||
340 | * (And change the return value checks.) | ||
341 | */ | ||
342 | static inline struct tty_driver *alloc_tty_driver(unsigned int lines) | ||
343 | { | ||
344 | struct tty_driver *ret = tty_alloc_driver(lines, 0); | ||
345 | if (IS_ERR(ret)) | ||
346 | return NULL; | ||
347 | return ret; | ||
348 | } | ||
338 | 349 | ||
339 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | 350 | static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) |
340 | { | 351 | { |
@@ -380,6 +391,14 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
380 | * the requested timeout to the caller instead of using a simple | 391 | * the requested timeout to the caller instead of using a simple |
381 | * on/off interface. | 392 | * on/off interface. |
382 | * | 393 | * |
394 | * TTY_DRIVER_DYNAMIC_ALLOC -- do not allocate structures which are | ||
395 | * needed per line for this driver as it would waste memory. | ||
396 | * The driver will take care. | ||
397 | * | ||
398 | * TTY_DRIVER_UNNUMBERED_NODE -- do not create numbered /dev nodes. In | ||
399 | * other words create /dev/ttyprintk and not /dev/ttyprintk0. | ||
400 | * Applicable only when a driver for a single tty device is | ||
401 | * being allocated. | ||
383 | */ | 402 | */ |
384 | #define TTY_DRIVER_INSTALLED 0x0001 | 403 | #define TTY_DRIVER_INSTALLED 0x0001 |
385 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 404 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
@@ -387,6 +406,8 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
387 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 | 406 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
388 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 407 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
389 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 | 408 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 |
409 | #define TTY_DRIVER_DYNAMIC_ALLOC 0x0040 | ||
410 | #define TTY_DRIVER_UNNUMBERED_NODE 0x0080 | ||
390 | 411 | ||
391 | /* tty driver types */ | 412 | /* tty driver types */ |
392 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 | 413 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 |
diff --git a/include/linux/tty_flags.h b/include/linux/tty_flags.h new file mode 100644 index 000000000000..eefcb483a2c0 --- /dev/null +++ b/include/linux/tty_flags.h | |||
@@ -0,0 +1,78 @@ | |||
1 | #ifndef _LINUX_TTY_FLAGS_H | ||
2 | #define _LINUX_TTY_FLAGS_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for async_struct (and serial_struct) flags field also | ||
6 | * shared by the tty_port flags structures. | ||
7 | * | ||
8 | * Define ASYNCB_* for convenient use with {test,set,clear}_bit. | ||
9 | */ | ||
10 | #define ASYNCB_HUP_NOTIFY 0 /* Notify getty on hangups and closes | ||
11 | * on the callout port */ | ||
12 | #define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */ | ||
13 | #define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */ | ||
14 | #define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */ | ||
15 | #define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */ | ||
16 | #define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */ | ||
17 | #define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */ | ||
18 | #define ASYNCB_AUTO_IRQ 7 /* Do automatic IRQ during | ||
19 | * autoconfiguration */ | ||
20 | #define ASYNCB_SESSION_LOCKOUT 8 /* Lock out cua opens based on session */ | ||
21 | #define ASYNCB_PGRP_LOCKOUT 9 /* Lock out cua opens based on pgrp */ | ||
22 | #define ASYNCB_CALLOUT_NOHUP 10 /* Don't do hangups for cua device */ | ||
23 | #define ASYNCB_HARDPPS_CD 11 /* Call hardpps when CD goes high */ | ||
24 | #define ASYNCB_SPD_SHI 12 /* Use 230400 instead of 38400 bps */ | ||
25 | #define ASYNCB_LOW_LATENCY 13 /* Request low latency behaviour */ | ||
26 | #define ASYNCB_BUGGY_UART 14 /* This is a buggy UART, skip some safety | ||
27 | * checks. Note: can be dangerous! */ | ||
28 | #define ASYNCB_AUTOPROBE 15 /* Port was autoprobed by PCI or PNP code */ | ||
29 | #define ASYNCB_LAST_USER 15 | ||
30 | |||
31 | /* Internal flags used only by kernel */ | ||
32 | #define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ | ||
33 | #define ASYNCB_SUSPENDED 30 /* Serial port is suspended */ | ||
34 | #define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
35 | #define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ | ||
36 | #define ASYNCB_CLOSING 27 /* Serial port is closing */ | ||
37 | #define ASYNCB_CTS_FLOW 26 /* Do CTS flow control */ | ||
38 | #define ASYNCB_CHECK_CD 25 /* i.e., CLOCAL */ | ||
39 | #define ASYNCB_SHARE_IRQ 24 /* for multifunction cards, no longer used */ | ||
40 | #define ASYNCB_CONS_FLOW 23 /* flow control for console */ | ||
41 | #define ASYNCB_FIRST_KERNEL 22 | ||
42 | |||
43 | #define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) | ||
44 | #define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED) | ||
45 | #define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) | ||
46 | #define ASYNC_SAK (1U << ASYNCB_SAK) | ||
47 | #define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) | ||
48 | #define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI) | ||
49 | #define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI) | ||
50 | #define ASYNC_SKIP_TEST (1U << ASYNCB_SKIP_TEST) | ||
51 | #define ASYNC_AUTO_IRQ (1U << ASYNCB_AUTO_IRQ) | ||
52 | #define ASYNC_SESSION_LOCKOUT (1U << ASYNCB_SESSION_LOCKOUT) | ||
53 | #define ASYNC_PGRP_LOCKOUT (1U << ASYNCB_PGRP_LOCKOUT) | ||
54 | #define ASYNC_CALLOUT_NOHUP (1U << ASYNCB_CALLOUT_NOHUP) | ||
55 | #define ASYNC_HARDPPS_CD (1U << ASYNCB_HARDPPS_CD) | ||
56 | #define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI) | ||
57 | #define ASYNC_LOW_LATENCY (1U << ASYNCB_LOW_LATENCY) | ||
58 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | ||
59 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | ||
60 | |||
61 | #define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) | ||
62 | #define ASYNC_USR_MASK (ASYNC_SPD_MASK|ASYNC_CALLOUT_NOHUP| \ | ||
63 | ASYNC_LOW_LATENCY) | ||
64 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | ||
65 | #define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI) | ||
66 | #define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI) | ||
67 | |||
68 | #define ASYNC_INITIALIZED (1U << ASYNCB_INITIALIZED) | ||
69 | #define ASYNC_NORMAL_ACTIVE (1U << ASYNCB_NORMAL_ACTIVE) | ||
70 | #define ASYNC_BOOT_AUTOCONF (1U << ASYNCB_BOOT_AUTOCONF) | ||
71 | #define ASYNC_CLOSING (1U << ASYNCB_CLOSING) | ||
72 | #define ASYNC_CTS_FLOW (1U << ASYNCB_CTS_FLOW) | ||
73 | #define ASYNC_CHECK_CD (1U << ASYNCB_CHECK_CD) | ||
74 | #define ASYNC_SHARE_IRQ (1U << ASYNCB_SHARE_IRQ) | ||
75 | #define ASYNC_CONS_FLOW (1U << ASYNCB_CONS_FLOW) | ||
76 | #define ASYNC_INTERNAL_FLAGS (~((1U << ASYNCB_FIRST_KERNEL) - 1)) | ||
77 | |||
78 | #endif | ||
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 2aa2881b0df9..c454bbe39ee7 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -32,6 +32,7 @@ | |||
32 | * - first public version | 32 | * - first public version |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/types.h> | ||
35 | #include <linux/input.h> | 36 | #include <linux/input.h> |
36 | 37 | ||
37 | #define UINPUT_VERSION 3 | 38 | #define UINPUT_VERSION 3 |
@@ -44,14 +45,14 @@ | |||
44 | enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; | 45 | enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; |
45 | 46 | ||
46 | struct uinput_request { | 47 | struct uinput_request { |
47 | int id; | 48 | unsigned int id; |
48 | int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ | 49 | unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ |
49 | 50 | ||
50 | int retval; | 51 | int retval; |
51 | struct completion done; | 52 | struct completion done; |
52 | 53 | ||
53 | union { | 54 | union { |
54 | int effect_id; | 55 | unsigned int effect_id; |
55 | struct { | 56 | struct { |
56 | struct ff_effect *effect; | 57 | struct ff_effect *effect; |
57 | struct ff_effect *old; | 58 | struct ff_effect *old; |
@@ -77,16 +78,16 @@ struct uinput_device { | |||
77 | #endif /* __KERNEL__ */ | 78 | #endif /* __KERNEL__ */ |
78 | 79 | ||
79 | struct uinput_ff_upload { | 80 | struct uinput_ff_upload { |
80 | int request_id; | 81 | __u32 request_id; |
81 | int retval; | 82 | __s32 retval; |
82 | struct ff_effect effect; | 83 | struct ff_effect effect; |
83 | struct ff_effect old; | 84 | struct ff_effect old; |
84 | }; | 85 | }; |
85 | 86 | ||
86 | struct uinput_ff_erase { | 87 | struct uinput_ff_erase { |
87 | int request_id; | 88 | __u32 request_id; |
88 | int retval; | 89 | __s32 retval; |
89 | int effect_id; | 90 | __u32 effect_id; |
90 | }; | 91 | }; |
91 | 92 | ||
92 | /* ioctl */ | 93 | /* ioctl */ |
@@ -166,11 +167,11 @@ struct uinput_ff_erase { | |||
166 | struct uinput_user_dev { | 167 | struct uinput_user_dev { |
167 | char name[UINPUT_MAX_NAME_SIZE]; | 168 | char name[UINPUT_MAX_NAME_SIZE]; |
168 | struct input_id id; | 169 | struct input_id id; |
169 | int ff_effects_max; | 170 | __u32 ff_effects_max; |
170 | int absmax[ABS_CNT]; | 171 | __s32 absmax[ABS_CNT]; |
171 | int absmin[ABS_CNT]; | 172 | __s32 absmin[ABS_CNT]; |
172 | int absfuzz[ABS_CNT]; | 173 | __s32 absfuzz[ABS_CNT]; |
173 | int absflat[ABS_CNT]; | 174 | __s32 absflat[ABS_CNT]; |
174 | }; | 175 | }; |
175 | #endif /* __UINPUT_H_ */ | 176 | #endif /* __UINPUT_H_ */ |
176 | 177 | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index efe4b3308c74..e6f0331e3d45 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -99,25 +99,27 @@ struct xol_area { | |||
99 | 99 | ||
100 | struct uprobes_state { | 100 | struct uprobes_state { |
101 | struct xol_area *xol_area; | 101 | struct xol_area *xol_area; |
102 | atomic_t count; | ||
103 | }; | 102 | }; |
103 | |||
104 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 104 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
105 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr, bool verify); | 105 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
106 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 106 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
107 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 107 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
108 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 108 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
109 | extern int uprobe_mmap(struct vm_area_struct *vma); | 109 | extern int uprobe_mmap(struct vm_area_struct *vma); |
110 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); | 110 | extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); |
111 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | ||
111 | extern void uprobe_free_utask(struct task_struct *t); | 112 | extern void uprobe_free_utask(struct task_struct *t); |
112 | extern void uprobe_copy_process(struct task_struct *t); | 113 | extern void uprobe_copy_process(struct task_struct *t); |
113 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | 114 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); |
115 | extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch); | ||
116 | extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch); | ||
114 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
115 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 118 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
116 | extern void uprobe_notify_resume(struct pt_regs *regs); | 119 | extern void uprobe_notify_resume(struct pt_regs *regs); |
117 | extern bool uprobe_deny_signal(void); | 120 | extern bool uprobe_deny_signal(void); |
118 | extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); | 121 | extern bool __weak arch_uprobe_skip_sstep(struct arch_uprobe *aup, struct pt_regs *regs); |
119 | extern void uprobe_clear_state(struct mm_struct *mm); | 122 | extern void uprobe_clear_state(struct mm_struct *mm); |
120 | extern void uprobe_reset_state(struct mm_struct *mm); | ||
121 | #else /* !CONFIG_UPROBES */ | 123 | #else /* !CONFIG_UPROBES */ |
122 | struct uprobes_state { | 124 | struct uprobes_state { |
123 | }; | 125 | }; |
@@ -138,6 +140,10 @@ static inline void | |||
138 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) | 140 | uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) |
139 | { | 141 | { |
140 | } | 142 | } |
143 | static inline void | ||
144 | uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) | ||
145 | { | ||
146 | } | ||
141 | static inline void uprobe_notify_resume(struct pt_regs *regs) | 147 | static inline void uprobe_notify_resume(struct pt_regs *regs) |
142 | { | 148 | { |
143 | } | 149 | } |
@@ -158,8 +164,5 @@ static inline void uprobe_copy_process(struct task_struct *t) | |||
158 | static inline void uprobe_clear_state(struct mm_struct *mm) | 164 | static inline void uprobe_clear_state(struct mm_struct *mm) |
159 | { | 165 | { |
160 | } | 166 | } |
161 | static inline void uprobe_reset_state(struct mm_struct *mm) | ||
162 | { | ||
163 | } | ||
164 | #endif /* !CONFIG_UPROBES */ | 167 | #endif /* !CONFIG_UPROBES */ |
165 | #endif /* _LINUX_UPROBES_H */ | 168 | #endif /* _LINUX_UPROBES_H */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 30d1ae38eab1..07915a32fb9d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -384,6 +384,13 @@ enum usb_device_removable { | |||
384 | USB_DEVICE_FIXED, | 384 | USB_DEVICE_FIXED, |
385 | }; | 385 | }; |
386 | 386 | ||
387 | enum usb_port_connect_type { | ||
388 | USB_PORT_CONNECT_TYPE_UNKNOWN = 0, | ||
389 | USB_PORT_CONNECT_TYPE_HOT_PLUG, | ||
390 | USB_PORT_CONNECT_TYPE_HARD_WIRED, | ||
391 | USB_PORT_NOT_USED, | ||
392 | }; | ||
393 | |||
387 | /* | 394 | /* |
388 | * USB 3.0 Link Power Management (LPM) parameters. | 395 | * USB 3.0 Link Power Management (LPM) parameters. |
389 | * | 396 | * |
@@ -469,7 +476,6 @@ struct usb3_lpm_parameters { | |||
469 | * access from userspace | 476 | * access from userspace |
470 | * @usbfs_dentry: usbfs dentry entry for the device | 477 | * @usbfs_dentry: usbfs dentry entry for the device |
471 | * @maxchild: number of ports if hub | 478 | * @maxchild: number of ports if hub |
472 | * @children: child devices - USB devices that are attached to this hub | ||
473 | * @quirks: quirks of the whole device | 479 | * @quirks: quirks of the whole device |
474 | * @urbnum: number of URBs submitted for the whole device | 480 | * @urbnum: number of URBs submitted for the whole device |
475 | * @active_duration: total time device is not suspended | 481 | * @active_duration: total time device is not suspended |
@@ -543,7 +549,6 @@ struct usb_device { | |||
543 | struct list_head filelist; | 549 | struct list_head filelist; |
544 | 550 | ||
545 | int maxchild; | 551 | int maxchild; |
546 | struct usb_device **children; | ||
547 | 552 | ||
548 | u32 quirks; | 553 | u32 quirks; |
549 | atomic_t urbnum; | 554 | atomic_t urbnum; |
@@ -572,6 +577,19 @@ static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf) | |||
572 | 577 | ||
573 | extern struct usb_device *usb_get_dev(struct usb_device *dev); | 578 | extern struct usb_device *usb_get_dev(struct usb_device *dev); |
574 | extern void usb_put_dev(struct usb_device *dev); | 579 | extern void usb_put_dev(struct usb_device *dev); |
580 | extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, | ||
581 | int port1); | ||
582 | |||
583 | /** | ||
584 | * usb_hub_for_each_child - iterate over all child devices on the hub | ||
585 | * @hdev: USB device belonging to the usb hub | ||
586 | * @port1: portnum associated with child device | ||
587 | * @child: child device pointer | ||
588 | */ | ||
589 | #define usb_hub_for_each_child(hdev, port1, child) \ | ||
590 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ | ||
591 | port1 <= hdev->maxchild; \ | ||
592 | child = usb_hub_find_child(hdev, ++port1)) | ||
575 | 593 | ||
576 | /* USB device locking */ | 594 | /* USB device locking */ |
577 | #define usb_lock_device(udev) device_lock(&(udev)->dev) | 595 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
@@ -584,6 +602,16 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
584 | extern int usb_reset_device(struct usb_device *dev); | 602 | extern int usb_reset_device(struct usb_device *dev); |
585 | extern void usb_queue_reset_device(struct usb_interface *dev); | 603 | extern void usb_queue_reset_device(struct usb_interface *dev); |
586 | 604 | ||
605 | #ifdef CONFIG_ACPI | ||
606 | extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
607 | bool enable); | ||
608 | extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); | ||
609 | #else | ||
610 | static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
611 | bool enable) { return 0; } | ||
612 | static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | ||
613 | { return true; } | ||
614 | #endif | ||
587 | 615 | ||
588 | /* USB autosuspend and autoresume */ | 616 | /* USB autosuspend and autoresume */ |
589 | #ifdef CONFIG_USB_SUSPEND | 617 | #ifdef CONFIG_USB_SUSPEND |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index b6c2863b2c94..7692dc69ccf7 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -236,8 +236,8 @@ struct usb_hub_descriptor { | |||
236 | 236 | ||
237 | struct { | 237 | struct { |
238 | __u8 bHubHdrDecLat; | 238 | __u8 bHubHdrDecLat; |
239 | __u16 wHubDelay; | 239 | __le16 wHubDelay; |
240 | __u16 DeviceRemovable; | 240 | __le16 DeviceRemovable; |
241 | } __attribute__ ((packed)) ss; | 241 | } __attribute__ ((packed)) ss; |
242 | } u; | 242 | } u; |
243 | } __attribute__ ((packed)); | 243 | } __attribute__ ((packed)); |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 9d8c3b634493..f8dda0621800 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -34,6 +34,8 @@ | |||
34 | * the composite model the host can use both functions at the same time. | 34 | * the composite model the host can use both functions at the same time. |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include <linux/bcd.h> | ||
38 | #include <linux/version.h> | ||
37 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
38 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
39 | 41 | ||
@@ -46,6 +48,9 @@ | |||
46 | */ | 48 | */ |
47 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | 49 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ |
48 | 50 | ||
51 | /* big enough to hold our biggest descriptor */ | ||
52 | #define USB_COMP_EP0_BUFSIZ 1024 | ||
53 | |||
49 | struct usb_configuration; | 54 | struct usb_configuration; |
50 | 55 | ||
51 | /** | 56 | /** |
@@ -245,24 +250,31 @@ int usb_add_config(struct usb_composite_dev *, | |||
245 | void usb_remove_config(struct usb_composite_dev *, | 250 | void usb_remove_config(struct usb_composite_dev *, |
246 | struct usb_configuration *); | 251 | struct usb_configuration *); |
247 | 252 | ||
253 | /* predefined index for usb_composite_driver */ | ||
254 | enum { | ||
255 | USB_GADGET_MANUFACTURER_IDX = 0, | ||
256 | USB_GADGET_PRODUCT_IDX, | ||
257 | USB_GADGET_SERIAL_IDX, | ||
258 | USB_GADGET_FIRST_AVAIL_IDX, | ||
259 | }; | ||
260 | |||
248 | /** | 261 | /** |
249 | * struct usb_composite_driver - groups configurations into a gadget | 262 | * struct usb_composite_driver - groups configurations into a gadget |
250 | * @name: For diagnostics, identifies the driver. | 263 | * @name: For diagnostics, identifies the driver. |
251 | * @iProduct: Used as iProduct override if @dev->iProduct is not set. | ||
252 | * If NULL value of @name is taken. | ||
253 | * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is | ||
254 | * not set. If NULL a default "<system> <release> with <udc>" value | ||
255 | * will be used. | ||
256 | * @iSerialNumber: Used as iSerialNumber override if @dev->iSerialNumber is | ||
257 | * not set. | ||
258 | * @dev: Template descriptor for the device, including default device | 264 | * @dev: Template descriptor for the device, including default device |
259 | * identifiers. | 265 | * identifiers. |
260 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 266 | * @strings: tables of strings, keyed by identifiers assigned during @bind |
261 | * and language IDs provided in control requests | 267 | * and language IDs provided in control requests. Note: The first entries |
268 | * are predefined. The first entry that may be used is | ||
269 | * USB_GADGET_FIRST_AVAIL_IDX | ||
262 | * @max_speed: Highest speed the driver supports. | 270 | * @max_speed: Highest speed the driver supports. |
263 | * @needs_serial: set to 1 if the gadget needs userspace to provide | 271 | * @needs_serial: set to 1 if the gadget needs userspace to provide |
264 | * a serial number. If one is not provided, warning will be printed. | 272 | * a serial number. If one is not provided, warning will be printed. |
265 | * @unbind: Reverses bind; called as a side effect of unregistering | 273 | * @bind: (REQUIRED) Used to allocate resources that are shared across the |
274 | * whole device, such as string IDs, and add its configurations using | ||
275 | * @usb_add_config(). This may fail by returning a negative errno | ||
276 | * value; it should return zero on successful initialization. | ||
277 | * @unbind: Reverses @bind; called as a side effect of unregistering | ||
266 | * this driver. | 278 | * this driver. |
267 | * @disconnect: optional driver disconnect method | 279 | * @disconnect: optional driver disconnect method |
268 | * @suspend: Notifies when the host stops sending USB traffic, | 280 | * @suspend: Notifies when the host stops sending USB traffic, |
@@ -271,9 +283,9 @@ void usb_remove_config(struct usb_composite_dev *, | |||
271 | * before function notifications | 283 | * before function notifications |
272 | * | 284 | * |
273 | * Devices default to reporting self powered operation. Devices which rely | 285 | * Devices default to reporting self powered operation. Devices which rely |
274 | * on bus powered operation should report this in their @bind() method. | 286 | * on bus powered operation should report this in their @bind method. |
275 | * | 287 | * |
276 | * Before returning from bind, various fields in the template descriptor | 288 | * Before returning from @bind, various fields in the template descriptor |
277 | * may be overridden. These include the idVendor/idProduct/bcdDevice values | 289 | * may be overridden. These include the idVendor/idProduct/bcdDevice values |
278 | * normally to bind the appropriate host side driver, and the three strings | 290 | * normally to bind the appropriate host side driver, and the three strings |
279 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user | 291 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user |
@@ -283,14 +295,12 @@ void usb_remove_config(struct usb_composite_dev *, | |||
283 | */ | 295 | */ |
284 | struct usb_composite_driver { | 296 | struct usb_composite_driver { |
285 | const char *name; | 297 | const char *name; |
286 | const char *iProduct; | ||
287 | const char *iManufacturer; | ||
288 | const char *iSerialNumber; | ||
289 | const struct usb_device_descriptor *dev; | 298 | const struct usb_device_descriptor *dev; |
290 | struct usb_gadget_strings **strings; | 299 | struct usb_gadget_strings **strings; |
291 | enum usb_device_speed max_speed; | 300 | enum usb_device_speed max_speed; |
292 | unsigned needs_serial:1; | 301 | unsigned needs_serial:1; |
293 | 302 | ||
303 | int (*bind)(struct usb_composite_dev *cdev); | ||
294 | int (*unbind)(struct usb_composite_dev *); | 304 | int (*unbind)(struct usb_composite_dev *); |
295 | 305 | ||
296 | void (*disconnect)(struct usb_composite_dev *); | 306 | void (*disconnect)(struct usb_composite_dev *); |
@@ -298,10 +308,10 @@ struct usb_composite_driver { | |||
298 | /* global suspend hooks */ | 308 | /* global suspend hooks */ |
299 | void (*suspend)(struct usb_composite_dev *); | 309 | void (*suspend)(struct usb_composite_dev *); |
300 | void (*resume)(struct usb_composite_dev *); | 310 | void (*resume)(struct usb_composite_dev *); |
311 | struct usb_gadget_driver gadget_driver; | ||
301 | }; | 312 | }; |
302 | 313 | ||
303 | extern int usb_composite_probe(struct usb_composite_driver *driver, | 314 | extern int usb_composite_probe(struct usb_composite_driver *driver); |
304 | int (*bind)(struct usb_composite_dev *cdev)); | ||
305 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 315 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
306 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 316 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
307 | 317 | ||
@@ -310,7 +320,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
310 | * struct usb_composite_device - represents one composite usb gadget | 320 | * struct usb_composite_device - represents one composite usb gadget |
311 | * @gadget: read-only, abstracts the gadget's usb peripheral controller | 321 | * @gadget: read-only, abstracts the gadget's usb peripheral controller |
312 | * @req: used for control responses; buffer is pre-allocated | 322 | * @req: used for control responses; buffer is pre-allocated |
313 | * @bufsiz: size of buffer pre-allocated in @req | ||
314 | * @config: the currently active configuration | 323 | * @config: the currently active configuration |
315 | * | 324 | * |
316 | * One of these devices is allocated and initialized before the | 325 | * One of these devices is allocated and initialized before the |
@@ -341,7 +350,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
341 | struct usb_composite_dev { | 350 | struct usb_composite_dev { |
342 | struct usb_gadget *gadget; | 351 | struct usb_gadget *gadget; |
343 | struct usb_request *req; | 352 | struct usb_request *req; |
344 | unsigned bufsiz; | ||
345 | 353 | ||
346 | struct usb_configuration *config; | 354 | struct usb_configuration *config; |
347 | 355 | ||
@@ -352,9 +360,7 @@ struct usb_composite_dev { | |||
352 | struct list_head configs; | 360 | struct list_head configs; |
353 | struct usb_composite_driver *driver; | 361 | struct usb_composite_driver *driver; |
354 | u8 next_string_id; | 362 | u8 next_string_id; |
355 | u8 manufacturer_override; | 363 | char *def_manufacturer; |
356 | u8 product_override; | ||
357 | u8 serial_override; | ||
358 | 364 | ||
359 | /* the gadget driver won't enable the data pullup | 365 | /* the gadget driver won't enable the data pullup |
360 | * while the deactivation count is nonzero. | 366 | * while the deactivation count is nonzero. |
@@ -375,6 +381,53 @@ extern int usb_string_ids_tab(struct usb_composite_dev *c, | |||
375 | struct usb_string *str); | 381 | struct usb_string *str); |
376 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | 382 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); |
377 | 383 | ||
384 | /* | ||
385 | * Some systems will need runtime overrides for the product identifiers | ||
386 | * published in the device descriptor, either numbers or strings or both. | ||
387 | * String parameters are in UTF-8 (superset of ASCII's 7 bit characters). | ||
388 | */ | ||
389 | struct usb_composite_overwrite { | ||
390 | u16 idVendor; | ||
391 | u16 idProduct; | ||
392 | u16 bcdDevice; | ||
393 | char *serial_number; | ||
394 | char *manufacturer; | ||
395 | char *product; | ||
396 | }; | ||
397 | #define USB_GADGET_COMPOSITE_OPTIONS() \ | ||
398 | static struct usb_composite_overwrite coverwrite; \ | ||
399 | \ | ||
400 | module_param_named(idVendor, coverwrite.idVendor, ushort, S_IRUGO); \ | ||
401 | MODULE_PARM_DESC(idVendor, "USB Vendor ID"); \ | ||
402 | \ | ||
403 | module_param_named(idProduct, coverwrite.idProduct, ushort, S_IRUGO); \ | ||
404 | MODULE_PARM_DESC(idProduct, "USB Product ID"); \ | ||
405 | \ | ||
406 | module_param_named(bcdDevice, coverwrite.bcdDevice, ushort, S_IRUGO); \ | ||
407 | MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); \ | ||
408 | \ | ||
409 | module_param_named(iSerialNumber, coverwrite.serial_number, charp, \ | ||
410 | S_IRUGO); \ | ||
411 | MODULE_PARM_DESC(iSerialNumber, "SerialNumber string"); \ | ||
412 | \ | ||
413 | module_param_named(iManufacturer, coverwrite.manufacturer, charp, \ | ||
414 | S_IRUGO); \ | ||
415 | MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); \ | ||
416 | \ | ||
417 | module_param_named(iProduct, coverwrite.product, charp, S_IRUGO); \ | ||
418 | MODULE_PARM_DESC(iProduct, "USB Product string") | ||
419 | |||
420 | void usb_composite_overwrite_options(struct usb_composite_dev *cdev, | ||
421 | struct usb_composite_overwrite *covr); | ||
422 | |||
423 | static inline u16 get_default_bcdDevice(void) | ||
424 | { | ||
425 | u16 bcdDevice; | ||
426 | |||
427 | bcdDevice = bin2bcd((LINUX_VERSION_CODE >> 16 & 0xff)) << 8; | ||
428 | bcdDevice |= bin2bcd((LINUX_VERSION_CODE >> 8 & 0xff)); | ||
429 | return bcdDevice; | ||
430 | } | ||
378 | 431 | ||
379 | /* messaging utils */ | 432 | /* messaging utils */ |
380 | #define DBG(d, fmt, args...) \ | 433 | #define DBG(d, fmt, args...) \ |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index de4b9ed5d5dd..daec99af5d54 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -171,18 +171,18 @@ struct ehci_regs { | |||
171 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 171 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
172 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 172 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
173 | 173 | ||
174 | u32 reserved4[7]; | 174 | u32 reserved4[6]; |
175 | 175 | ||
176 | /* Moorestown has some non-standard registers, partially due to the fact that | 176 | /* Moorestown has some non-standard registers, partially due to the fact that |
177 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to | 177 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to |
178 | * PORTSCx | 178 | * PORTSCx |
179 | */ | 179 | */ |
180 | /* HOSTPC: offset 0x84 */ | 180 | /* HOSTPC: offset 0x84 */ |
181 | u32 hostpc[0]; /* HOSTPC extension */ | 181 | u32 hostpc[1]; /* HOSTPC extension */ |
182 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | 182 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ |
183 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | 183 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ |
184 | 184 | ||
185 | u32 reserved5[17]; | 185 | u32 reserved5[16]; |
186 | 186 | ||
187 | /* USBMODE_EX: offset 0xc8 */ | 187 | /* USBMODE_EX: offset 0xc8 */ |
188 | u32 usbmode_ex; /* USB Device mode extension */ | 188 | u32 usbmode_ex; /* USB Device mode extension */ |
@@ -221,18 +221,35 @@ extern int __init early_dbgp_init(char *s); | |||
221 | extern struct console early_dbgp_console; | 221 | extern struct console early_dbgp_console; |
222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | 222 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ |
223 | 223 | ||
224 | struct usb_hcd; | ||
225 | |||
226 | #ifdef CONFIG_XEN_DOM0 | ||
227 | extern int xen_dbgp_reset_prep(struct usb_hcd *); | ||
228 | extern int xen_dbgp_external_startup(struct usb_hcd *); | ||
229 | #else | ||
230 | static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd) | ||
231 | { | ||
232 | return 1; /* Shouldn't this be 0? */ | ||
233 | } | ||
234 | |||
235 | static inline int xen_dbgp_external_startup(struct usb_hcd *hcd) | ||
236 | { | ||
237 | return -1; | ||
238 | } | ||
239 | #endif | ||
240 | |||
224 | #ifdef CONFIG_EARLY_PRINTK_DBGP | 241 | #ifdef CONFIG_EARLY_PRINTK_DBGP |
225 | /* Call backs from ehci host driver to ehci debug driver */ | 242 | /* Call backs from ehci host driver to ehci debug driver */ |
226 | extern int dbgp_external_startup(void); | 243 | extern int dbgp_external_startup(struct usb_hcd *); |
227 | extern int dbgp_reset_prep(void); | 244 | extern int dbgp_reset_prep(struct usb_hcd *hcd); |
228 | #else | 245 | #else |
229 | static inline int dbgp_reset_prep(void) | 246 | static inline int dbgp_reset_prep(struct usb_hcd *hcd) |
230 | { | 247 | { |
231 | return 1; | 248 | return xen_dbgp_reset_prep(hcd); |
232 | } | 249 | } |
233 | static inline int dbgp_external_startup(void) | 250 | static inline int dbgp_external_startup(struct usb_hcd *hcd) |
234 | { | 251 | { |
235 | return -1; | 252 | return xen_dbgp_external_startup(hcd); |
236 | } | 253 | } |
237 | #endif | 254 | #endif |
238 | 255 | ||
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index 1894f42fe3f7..c9d09f8b7ff2 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
@@ -41,6 +41,14 @@ struct usb_ehci_pdata { | |||
41 | unsigned big_endian_mmio:1; | 41 | unsigned big_endian_mmio:1; |
42 | unsigned port_power_on:1; | 42 | unsigned port_power_on:1; |
43 | unsigned port_power_off:1; | 43 | unsigned port_power_off:1; |
44 | |||
45 | /* Turn on all power and clocks */ | ||
46 | int (*power_on)(struct platform_device *pdev); | ||
47 | /* Turn off all power and clocks */ | ||
48 | void (*power_off)(struct platform_device *pdev); | ||
49 | /* Turn on only VBUS suspend power and hotplug detection, | ||
50 | * turn off everything else */ | ||
51 | void (*power_suspend)(struct platform_device *pdev); | ||
44 | }; | 52 | }; |
45 | 53 | ||
46 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ | 54 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h new file mode 100644 index 000000000000..fc618d8d1e92 --- /dev/null +++ b/include/linux/usb/ezusb.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __EZUSB_H | ||
2 | #define __EZUSB_H | ||
3 | |||
4 | |||
5 | extern int ezusb_writememory(struct usb_device *dev, int address, | ||
6 | unsigned char *data, int length, __u8 bRequest); | ||
7 | |||
8 | extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); | ||
9 | extern int ezusb_fx2_set_reset(struct usb_device *dev, unsigned char reset_bit); | ||
10 | |||
11 | extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, | ||
12 | const char *firmware_path); | ||
13 | extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev, | ||
14 | const char *firmware_path); | ||
15 | |||
16 | #endif /* __EZUSB_H */ | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 9517466ababb..5b6e50888248 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -474,7 +474,8 @@ struct usb_gadget_ops { | |||
474 | 474 | ||
475 | /* Those two are deprecated */ | 475 | /* Those two are deprecated */ |
476 | int (*start)(struct usb_gadget_driver *, | 476 | int (*start)(struct usb_gadget_driver *, |
477 | int (*bind)(struct usb_gadget *)); | 477 | int (*bind)(struct usb_gadget *, |
478 | struct usb_gadget_driver *driver)); | ||
478 | int (*stop)(struct usb_gadget_driver *); | 479 | int (*stop)(struct usb_gadget_driver *); |
479 | }; | 480 | }; |
480 | 481 | ||
@@ -502,6 +503,8 @@ struct usb_gadget_ops { | |||
502 | * @name: Identifies the controller hardware type. Used in diagnostics | 503 | * @name: Identifies the controller hardware type. Used in diagnostics |
503 | * and sometimes configuration. | 504 | * and sometimes configuration. |
504 | * @dev: Driver model state for this abstract device. | 505 | * @dev: Driver model state for this abstract device. |
506 | * @out_epnum: last used out ep number | ||
507 | * @in_epnum: last used in ep number | ||
505 | * | 508 | * |
506 | * Gadgets have a mostly-portable "gadget driver" implementing device | 509 | * Gadgets have a mostly-portable "gadget driver" implementing device |
507 | * functions, handling all usb configurations and interfaces. Gadget | 510 | * functions, handling all usb configurations and interfaces. Gadget |
@@ -536,6 +539,8 @@ struct usb_gadget { | |||
536 | unsigned a_alt_hnp_support:1; | 539 | unsigned a_alt_hnp_support:1; |
537 | const char *name; | 540 | const char *name; |
538 | struct device dev; | 541 | struct device dev; |
542 | unsigned out_epnum; | ||
543 | unsigned in_epnum; | ||
539 | }; | 544 | }; |
540 | 545 | ||
541 | static inline void set_gadget_data(struct usb_gadget *gadget, void *data) | 546 | static inline void set_gadget_data(struct usb_gadget *gadget, void *data) |
@@ -558,14 +563,7 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
558 | */ | 563 | */ |
559 | static inline int gadget_is_dualspeed(struct usb_gadget *g) | 564 | static inline int gadget_is_dualspeed(struct usb_gadget *g) |
560 | { | 565 | { |
561 | #ifdef CONFIG_USB_GADGET_DUALSPEED | 566 | return g->max_speed >= USB_SPEED_HIGH; |
562 | /* runtime test would check "g->max_speed" ... that might be | ||
563 | * useful to work around hardware bugs, but is mostly pointless | ||
564 | */ | ||
565 | return 1; | ||
566 | #else | ||
567 | return 0; | ||
568 | #endif | ||
569 | } | 567 | } |
570 | 568 | ||
571 | /** | 569 | /** |
@@ -575,15 +573,7 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g) | |||
575 | */ | 573 | */ |
576 | static inline int gadget_is_superspeed(struct usb_gadget *g) | 574 | static inline int gadget_is_superspeed(struct usb_gadget *g) |
577 | { | 575 | { |
578 | #ifdef CONFIG_USB_GADGET_SUPERSPEED | 576 | return g->max_speed >= USB_SPEED_SUPER; |
579 | /* | ||
580 | * runtime test would check "g->max_speed" ... that might be | ||
581 | * useful to work around hardware bugs, but is mostly pointless | ||
582 | */ | ||
583 | return 1; | ||
584 | #else | ||
585 | return 0; | ||
586 | #endif | ||
587 | } | 577 | } |
588 | 578 | ||
589 | /** | 579 | /** |
@@ -781,6 +771,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
781 | * when the host is disconnected. May be called in_interrupt; this | 771 | * when the host is disconnected. May be called in_interrupt; this |
782 | * may not sleep. Some devices can't detect disconnect, so this might | 772 | * may not sleep. Some devices can't detect disconnect, so this might |
783 | * not be called except as part of controller shutdown. | 773 | * not be called except as part of controller shutdown. |
774 | * @bind: the driver's bind callback | ||
784 | * @unbind: Invoked when the driver is unbound from a gadget, | 775 | * @unbind: Invoked when the driver is unbound from a gadget, |
785 | * usually from rmmod (after a disconnect is reported). | 776 | * usually from rmmod (after a disconnect is reported). |
786 | * Called in a context that permits sleeping. | 777 | * Called in a context that permits sleeping. |
@@ -835,6 +826,8 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
835 | struct usb_gadget_driver { | 826 | struct usb_gadget_driver { |
836 | char *function; | 827 | char *function; |
837 | enum usb_device_speed max_speed; | 828 | enum usb_device_speed max_speed; |
829 | int (*bind)(struct usb_gadget *gadget, | ||
830 | struct usb_gadget_driver *driver); | ||
838 | void (*unbind)(struct usb_gadget *); | 831 | void (*unbind)(struct usb_gadget *); |
839 | int (*setup)(struct usb_gadget *, | 832 | int (*setup)(struct usb_gadget *, |
840 | const struct usb_ctrlrequest *); | 833 | const struct usb_ctrlrequest *); |
@@ -860,7 +853,6 @@ struct usb_gadget_driver { | |||
860 | /** | 853 | /** |
861 | * usb_gadget_probe_driver - probe a gadget driver | 854 | * usb_gadget_probe_driver - probe a gadget driver |
862 | * @driver: the driver being registered | 855 | * @driver: the driver being registered |
863 | * @bind: the driver's bind callback | ||
864 | * Context: can sleep | 856 | * Context: can sleep |
865 | * | 857 | * |
866 | * Call this in your gadget driver's module initialization function, | 858 | * Call this in your gadget driver's module initialization function, |
@@ -869,8 +861,7 @@ struct usb_gadget_driver { | |||
869 | * registration call returns. It's expected that the @bind() function will | 861 | * registration call returns. It's expected that the @bind() function will |
870 | * be in init sections. | 862 | * be in init sections. |
871 | */ | 863 | */ |
872 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | 864 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver); |
873 | int (*bind)(struct usb_gadget *)); | ||
874 | 865 | ||
875 | /** | 866 | /** |
876 | * usb_gadget_unregister_driver - unregister a gadget driver | 867 | * usb_gadget_unregister_driver - unregister a gadget driver |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index c5fdb148fc02..608050b2545f 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -135,8 +135,8 @@ struct usb_hcd { | |||
135 | 135 | ||
136 | unsigned int irq; /* irq allocated */ | 136 | unsigned int irq; /* irq allocated */ |
137 | void __iomem *regs; /* device memory/io */ | 137 | void __iomem *regs; /* device memory/io */ |
138 | u64 rsrc_start; /* memory/io resource start */ | 138 | resource_size_t rsrc_start; /* memory/io resource start */ |
139 | u64 rsrc_len; /* memory/io resource length */ | 139 | resource_size_t rsrc_len; /* memory/io resource length */ |
140 | unsigned power_budget; /* in mA, 0 = no limit */ | 140 | unsigned power_budget; /* in mA, 0 = no limit */ |
141 | 141 | ||
142 | /* bandwidth_mutex should be taken before adding or removing | 142 | /* bandwidth_mutex should be taken before adding or removing |
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h new file mode 100644 index 000000000000..28884c717411 --- /dev/null +++ b/include/linux/usb/nop-usb-xceiv.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef __LINUX_USB_NOP_XCEIV_H | ||
2 | #define __LINUX_USB_NOP_XCEIV_H | ||
3 | |||
4 | #include <linux/usb/otg.h> | ||
5 | |||
6 | struct nop_usb_xceiv_platform_data { | ||
7 | enum usb_phy_type type; | ||
8 | }; | ||
9 | |||
10 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | ||
11 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
12 | extern void usb_nop_xceiv_register(void); | ||
13 | extern void usb_nop_xceiv_unregister(void); | ||
14 | #else | ||
15 | static inline void usb_nop_xceiv_register(void) | ||
16 | { | ||
17 | } | ||
18 | |||
19 | static inline void usb_nop_xceiv_unregister(void) | ||
20 | { | ||
21 | } | ||
22 | #endif | ||
23 | |||
24 | #endif /* __LINUX_USB_NOP_XCEIV_H */ | ||
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h index 2808f2a9cce8..74e7755168b7 100644 --- a/include/linux/usb/ohci_pdriver.h +++ b/include/linux/usb/ohci_pdriver.h | |||
@@ -33,6 +33,14 @@ struct usb_ohci_pdata { | |||
33 | unsigned big_endian_desc:1; | 33 | unsigned big_endian_desc:1; |
34 | unsigned big_endian_mmio:1; | 34 | unsigned big_endian_mmio:1; |
35 | unsigned no_big_frame_no:1; | 35 | unsigned no_big_frame_no:1; |
36 | |||
37 | /* Turn on all power and clocks */ | ||
38 | int (*power_on)(struct platform_device *pdev); | ||
39 | /* Turn off all power and clocks */ | ||
40 | void (*power_off)(struct platform_device *pdev); | ||
41 | /* Turn on only VBUS suspend power and hotplug detection, | ||
42 | * turn off everything else */ | ||
43 | void (*power_suspend)(struct platform_device *pdev); | ||
36 | }; | 44 | }; |
37 | 45 | ||
38 | #endif /* __USB_CORE_OHCI_PDRIVER_H */ | 46 | #endif /* __USB_CORE_OHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h new file mode 100644 index 000000000000..0ea17f8ae820 --- /dev/null +++ b/include/linux/usb/omap_usb.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * omap_usb.h -- omap usb2 phy header file | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
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 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_OMAP_USB2_H | ||
20 | #define __DRIVERS_OMAP_USB2_H | ||
21 | |||
22 | #include <linux/usb/otg.h> | ||
23 | |||
24 | struct omap_usb { | ||
25 | struct usb_phy phy; | ||
26 | struct phy_companion *comparator; | ||
27 | struct device *dev; | ||
28 | u32 __iomem *control_dev; | ||
29 | struct clk *wkupclk; | ||
30 | u8 is_suspended:1; | ||
31 | }; | ||
32 | |||
33 | #define PHY_PD 0x1 | ||
34 | |||
35 | #define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) | ||
36 | |||
37 | #if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) | ||
38 | extern int omap_usb2_set_comparator(struct phy_companion *comparator); | ||
39 | #else | ||
40 | static inline int omap_usb2_set_comparator(struct phy_companion *comparator) | ||
41 | { | ||
42 | return -ENODEV; | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | #endif /* __DRIVERS_OMAP_USB_H */ | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 45824be0a2f9..e8a5fe87c6bd 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -9,56 +9,7 @@ | |||
9 | #ifndef __LINUX_USB_OTG_H | 9 | #ifndef __LINUX_USB_OTG_H |
10 | #define __LINUX_USB_OTG_H | 10 | #define __LINUX_USB_OTG_H |
11 | 11 | ||
12 | #include <linux/notifier.h> | 12 | #include <linux/usb/phy.h> |
13 | |||
14 | /* OTG defines lots of enumeration states before device reset */ | ||
15 | enum usb_otg_state { | ||
16 | OTG_STATE_UNDEFINED = 0, | ||
17 | |||
18 | /* single-role peripheral, and dual-role default-b */ | ||
19 | OTG_STATE_B_IDLE, | ||
20 | OTG_STATE_B_SRP_INIT, | ||
21 | OTG_STATE_B_PERIPHERAL, | ||
22 | |||
23 | /* extra dual-role default-b states */ | ||
24 | OTG_STATE_B_WAIT_ACON, | ||
25 | OTG_STATE_B_HOST, | ||
26 | |||
27 | /* dual-role default-a */ | ||
28 | OTG_STATE_A_IDLE, | ||
29 | OTG_STATE_A_WAIT_VRISE, | ||
30 | OTG_STATE_A_WAIT_BCON, | ||
31 | OTG_STATE_A_HOST, | ||
32 | OTG_STATE_A_SUSPEND, | ||
33 | OTG_STATE_A_PERIPHERAL, | ||
34 | OTG_STATE_A_WAIT_VFALL, | ||
35 | OTG_STATE_A_VBUS_ERR, | ||
36 | }; | ||
37 | |||
38 | enum usb_phy_events { | ||
39 | USB_EVENT_NONE, /* no events or cable disconnected */ | ||
40 | USB_EVENT_VBUS, /* vbus valid event */ | ||
41 | USB_EVENT_ID, /* id was grounded */ | ||
42 | USB_EVENT_CHARGER, /* usb dedicated charger */ | ||
43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | ||
44 | }; | ||
45 | |||
46 | /* associate a type with PHY */ | ||
47 | enum usb_phy_type { | ||
48 | USB_PHY_TYPE_UNDEFINED, | ||
49 | USB_PHY_TYPE_USB2, | ||
50 | USB_PHY_TYPE_USB3, | ||
51 | }; | ||
52 | |||
53 | struct usb_phy; | ||
54 | |||
55 | /* for transceivers connected thru an ULPI interface, the user must | ||
56 | * provide access ops | ||
57 | */ | ||
58 | struct usb_phy_io_ops { | ||
59 | int (*read)(struct usb_phy *x, u32 reg); | ||
60 | int (*write)(struct usb_phy *x, u32 val, u32 reg); | ||
61 | }; | ||
62 | 13 | ||
63 | struct usb_otg { | 14 | struct usb_otg { |
64 | u8 default_a; | 15 | u8 default_a; |
@@ -85,134 +36,9 @@ struct usb_otg { | |||
85 | 36 | ||
86 | }; | 37 | }; |
87 | 38 | ||
88 | /* | ||
89 | * the otg driver needs to interact with both device side and host side | ||
90 | * usb controllers. it decides which controller is active at a given | ||
91 | * moment, using the transceiver, ID signal, HNP and sometimes static | ||
92 | * configuration information (including "board isn't wired for otg"). | ||
93 | */ | ||
94 | struct usb_phy { | ||
95 | struct device *dev; | ||
96 | const char *label; | ||
97 | unsigned int flags; | ||
98 | |||
99 | enum usb_phy_type type; | ||
100 | enum usb_otg_state state; | ||
101 | enum usb_phy_events last_event; | ||
102 | |||
103 | struct usb_otg *otg; | ||
104 | |||
105 | struct device *io_dev; | ||
106 | struct usb_phy_io_ops *io_ops; | ||
107 | void __iomem *io_priv; | ||
108 | |||
109 | /* for notification of usb_phy_events */ | ||
110 | struct atomic_notifier_head notifier; | ||
111 | |||
112 | /* to pass extra port status to the root hub */ | ||
113 | u16 port_status; | ||
114 | u16 port_change; | ||
115 | |||
116 | /* to support controllers that have multiple transceivers */ | ||
117 | struct list_head head; | ||
118 | |||
119 | /* initialize/shutdown the OTG controller */ | ||
120 | int (*init)(struct usb_phy *x); | ||
121 | void (*shutdown)(struct usb_phy *x); | ||
122 | |||
123 | /* effective for B devices, ignored for A-peripheral */ | ||
124 | int (*set_power)(struct usb_phy *x, | ||
125 | unsigned mA); | ||
126 | |||
127 | /* for non-OTG B devices: set transceiver into suspend mode */ | ||
128 | int (*set_suspend)(struct usb_phy *x, | ||
129 | int suspend); | ||
130 | |||
131 | /* notify phy connect status change */ | ||
132 | int (*notify_connect)(struct usb_phy *x, int port); | ||
133 | int (*notify_disconnect)(struct usb_phy *x, int port); | ||
134 | }; | ||
135 | |||
136 | |||
137 | /* for board-specific init logic */ | ||
138 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | ||
139 | extern void usb_remove_phy(struct usb_phy *); | ||
140 | |||
141 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | ||
142 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
143 | extern void usb_nop_xceiv_register(void); | ||
144 | extern void usb_nop_xceiv_unregister(void); | ||
145 | #else | ||
146 | static inline void usb_nop_xceiv_register(void) | ||
147 | { | ||
148 | } | ||
149 | |||
150 | static inline void usb_nop_xceiv_unregister(void) | ||
151 | { | ||
152 | } | ||
153 | #endif | ||
154 | |||
155 | /* helpers for direct access thru low-level io interface */ | ||
156 | static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) | ||
157 | { | ||
158 | if (x->io_ops && x->io_ops->read) | ||
159 | return x->io_ops->read(x, reg); | ||
160 | |||
161 | return -EINVAL; | ||
162 | } | ||
163 | |||
164 | static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) | ||
165 | { | ||
166 | if (x->io_ops && x->io_ops->write) | ||
167 | return x->io_ops->write(x, val, reg); | ||
168 | |||
169 | return -EINVAL; | ||
170 | } | ||
171 | |||
172 | static inline int | ||
173 | usb_phy_init(struct usb_phy *x) | ||
174 | { | ||
175 | if (x->init) | ||
176 | return x->init(x); | ||
177 | |||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | static inline void | ||
182 | usb_phy_shutdown(struct usb_phy *x) | ||
183 | { | ||
184 | if (x->shutdown) | ||
185 | x->shutdown(x); | ||
186 | } | ||
187 | |||
188 | /* for usb host and peripheral controller drivers */ | ||
189 | #ifdef CONFIG_USB_OTG_UTILS | 39 | #ifdef CONFIG_USB_OTG_UTILS |
190 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | ||
191 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
192 | enum usb_phy_type type); | ||
193 | extern void usb_put_phy(struct usb_phy *); | ||
194 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
195 | extern const char *otg_state_string(enum usb_otg_state state); | 40 | extern const char *otg_state_string(enum usb_otg_state state); |
196 | #else | 41 | #else |
197 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | ||
198 | { | ||
199 | return NULL; | ||
200 | } | ||
201 | |||
202 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
203 | enum usb_phy_type type) | ||
204 | { | ||
205 | return NULL; | ||
206 | } | ||
207 | |||
208 | static inline void usb_put_phy(struct usb_phy *x) | ||
209 | { | ||
210 | } | ||
211 | |||
212 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
213 | { | ||
214 | } | ||
215 | |||
216 | static inline const char *otg_state_string(enum usb_otg_state state) | 42 | static inline const char *otg_state_string(enum usb_otg_state state) |
217 | { | 43 | { |
218 | return NULL; | 44 | return NULL; |
@@ -262,42 +88,6 @@ otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph) | |||
262 | } | 88 | } |
263 | 89 | ||
264 | static inline int | 90 | static inline int |
265 | usb_phy_set_power(struct usb_phy *x, unsigned mA) | ||
266 | { | ||
267 | if (x && x->set_power) | ||
268 | return x->set_power(x, mA); | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | /* Context: can sleep */ | ||
273 | static inline int | ||
274 | usb_phy_set_suspend(struct usb_phy *x, int suspend) | ||
275 | { | ||
276 | if (x->set_suspend != NULL) | ||
277 | return x->set_suspend(x, suspend); | ||
278 | else | ||
279 | return 0; | ||
280 | } | ||
281 | |||
282 | static inline int | ||
283 | usb_phy_notify_connect(struct usb_phy *x, int port) | ||
284 | { | ||
285 | if (x->notify_connect) | ||
286 | return x->notify_connect(x, port); | ||
287 | else | ||
288 | return 0; | ||
289 | } | ||
290 | |||
291 | static inline int | ||
292 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | ||
293 | { | ||
294 | if (x->notify_disconnect) | ||
295 | return x->notify_disconnect(x, port); | ||
296 | else | ||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int | ||
301 | otg_start_srp(struct usb_otg *otg) | 91 | otg_start_srp(struct usb_otg *otg) |
302 | { | 92 | { |
303 | if (otg && otg->start_srp) | 93 | if (otg && otg->start_srp) |
@@ -306,31 +96,7 @@ otg_start_srp(struct usb_otg *otg) | |||
306 | return -ENOTSUPP; | 96 | return -ENOTSUPP; |
307 | } | 97 | } |
308 | 98 | ||
309 | /* notifiers */ | ||
310 | static inline int | ||
311 | usb_register_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
312 | { | ||
313 | return atomic_notifier_chain_register(&x->notifier, nb); | ||
314 | } | ||
315 | |||
316 | static inline void | ||
317 | usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
318 | { | ||
319 | atomic_notifier_chain_unregister(&x->notifier, nb); | ||
320 | } | ||
321 | |||
322 | /* for OTG controller drivers (and maybe other stuff) */ | 99 | /* for OTG controller drivers (and maybe other stuff) */ |
323 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 100 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
324 | 101 | ||
325 | static inline const char *usb_phy_type_string(enum usb_phy_type type) | ||
326 | { | ||
327 | switch (type) { | ||
328 | case USB_PHY_TYPE_USB2: | ||
329 | return "USB2 PHY"; | ||
330 | case USB_PHY_TYPE_USB3: | ||
331 | return "USB3 PHY"; | ||
332 | default: | ||
333 | return "UNKNOWN PHY TYPE"; | ||
334 | } | ||
335 | } | ||
336 | #endif /* __LINUX_USB_OTG_H */ | 102 | #endif /* __LINUX_USB_OTG_H */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h new file mode 100644 index 000000000000..06b5bae35b29 --- /dev/null +++ b/include/linux/usb/phy.h | |||
@@ -0,0 +1,233 @@ | |||
1 | /* USB OTG (On The Go) defines */ | ||
2 | /* | ||
3 | * | ||
4 | * These APIs may be used between USB controllers. USB device drivers | ||
5 | * (for either host or peripheral roles) don't use these calls; they | ||
6 | * continue to use just usb_device and usb_gadget. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_USB_PHY_H | ||
10 | #define __LINUX_USB_PHY_H | ||
11 | |||
12 | #include <linux/notifier.h> | ||
13 | |||
14 | enum usb_phy_events { | ||
15 | USB_EVENT_NONE, /* no events or cable disconnected */ | ||
16 | USB_EVENT_VBUS, /* vbus valid event */ | ||
17 | USB_EVENT_ID, /* id was grounded */ | ||
18 | USB_EVENT_CHARGER, /* usb dedicated charger */ | ||
19 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | ||
20 | }; | ||
21 | |||
22 | /* associate a type with PHY */ | ||
23 | enum usb_phy_type { | ||
24 | USB_PHY_TYPE_UNDEFINED, | ||
25 | USB_PHY_TYPE_USB2, | ||
26 | USB_PHY_TYPE_USB3, | ||
27 | }; | ||
28 | |||
29 | /* OTG defines lots of enumeration states before device reset */ | ||
30 | enum usb_otg_state { | ||
31 | OTG_STATE_UNDEFINED = 0, | ||
32 | |||
33 | /* single-role peripheral, and dual-role default-b */ | ||
34 | OTG_STATE_B_IDLE, | ||
35 | OTG_STATE_B_SRP_INIT, | ||
36 | OTG_STATE_B_PERIPHERAL, | ||
37 | |||
38 | /* extra dual-role default-b states */ | ||
39 | OTG_STATE_B_WAIT_ACON, | ||
40 | OTG_STATE_B_HOST, | ||
41 | |||
42 | /* dual-role default-a */ | ||
43 | OTG_STATE_A_IDLE, | ||
44 | OTG_STATE_A_WAIT_VRISE, | ||
45 | OTG_STATE_A_WAIT_BCON, | ||
46 | OTG_STATE_A_HOST, | ||
47 | OTG_STATE_A_SUSPEND, | ||
48 | OTG_STATE_A_PERIPHERAL, | ||
49 | OTG_STATE_A_WAIT_VFALL, | ||
50 | OTG_STATE_A_VBUS_ERR, | ||
51 | }; | ||
52 | |||
53 | struct usb_phy; | ||
54 | struct usb_otg; | ||
55 | |||
56 | /* for transceivers connected thru an ULPI interface, the user must | ||
57 | * provide access ops | ||
58 | */ | ||
59 | struct usb_phy_io_ops { | ||
60 | int (*read)(struct usb_phy *x, u32 reg); | ||
61 | int (*write)(struct usb_phy *x, u32 val, u32 reg); | ||
62 | }; | ||
63 | |||
64 | struct usb_phy { | ||
65 | struct device *dev; | ||
66 | const char *label; | ||
67 | unsigned int flags; | ||
68 | |||
69 | enum usb_phy_type type; | ||
70 | enum usb_otg_state state; | ||
71 | enum usb_phy_events last_event; | ||
72 | |||
73 | struct usb_otg *otg; | ||
74 | |||
75 | struct device *io_dev; | ||
76 | struct usb_phy_io_ops *io_ops; | ||
77 | void __iomem *io_priv; | ||
78 | |||
79 | /* for notification of usb_phy_events */ | ||
80 | struct atomic_notifier_head notifier; | ||
81 | |||
82 | /* to pass extra port status to the root hub */ | ||
83 | u16 port_status; | ||
84 | u16 port_change; | ||
85 | |||
86 | /* to support controllers that have multiple transceivers */ | ||
87 | struct list_head head; | ||
88 | |||
89 | /* initialize/shutdown the OTG controller */ | ||
90 | int (*init)(struct usb_phy *x); | ||
91 | void (*shutdown)(struct usb_phy *x); | ||
92 | |||
93 | /* effective for B devices, ignored for A-peripheral */ | ||
94 | int (*set_power)(struct usb_phy *x, | ||
95 | unsigned mA); | ||
96 | |||
97 | /* for non-OTG B devices: set transceiver into suspend mode */ | ||
98 | int (*set_suspend)(struct usb_phy *x, | ||
99 | int suspend); | ||
100 | |||
101 | /* notify phy connect status change */ | ||
102 | int (*notify_connect)(struct usb_phy *x, int port); | ||
103 | int (*notify_disconnect)(struct usb_phy *x, int port); | ||
104 | }; | ||
105 | |||
106 | |||
107 | /* for board-specific init logic */ | ||
108 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); | ||
109 | extern void usb_remove_phy(struct usb_phy *); | ||
110 | |||
111 | /* helpers for direct access thru low-level io interface */ | ||
112 | static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) | ||
113 | { | ||
114 | if (x->io_ops && x->io_ops->read) | ||
115 | return x->io_ops->read(x, reg); | ||
116 | |||
117 | return -EINVAL; | ||
118 | } | ||
119 | |||
120 | static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) | ||
121 | { | ||
122 | if (x->io_ops && x->io_ops->write) | ||
123 | return x->io_ops->write(x, val, reg); | ||
124 | |||
125 | return -EINVAL; | ||
126 | } | ||
127 | |||
128 | static inline int | ||
129 | usb_phy_init(struct usb_phy *x) | ||
130 | { | ||
131 | if (x->init) | ||
132 | return x->init(x); | ||
133 | |||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static inline void | ||
138 | usb_phy_shutdown(struct usb_phy *x) | ||
139 | { | ||
140 | if (x->shutdown) | ||
141 | x->shutdown(x); | ||
142 | } | ||
143 | |||
144 | /* for usb host and peripheral controller drivers */ | ||
145 | #ifdef CONFIG_USB_OTG_UTILS | ||
146 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | ||
147 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
148 | enum usb_phy_type type); | ||
149 | extern void usb_put_phy(struct usb_phy *); | ||
150 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
151 | #else | ||
152 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | ||
153 | { | ||
154 | return NULL; | ||
155 | } | ||
156 | |||
157 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
158 | enum usb_phy_type type) | ||
159 | { | ||
160 | return NULL; | ||
161 | } | ||
162 | |||
163 | static inline void usb_put_phy(struct usb_phy *x) | ||
164 | { | ||
165 | } | ||
166 | |||
167 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
168 | { | ||
169 | } | ||
170 | |||
171 | #endif | ||
172 | |||
173 | static inline int | ||
174 | usb_phy_set_power(struct usb_phy *x, unsigned mA) | ||
175 | { | ||
176 | if (x && x->set_power) | ||
177 | return x->set_power(x, mA); | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | /* Context: can sleep */ | ||
182 | static inline int | ||
183 | usb_phy_set_suspend(struct usb_phy *x, int suspend) | ||
184 | { | ||
185 | if (x->set_suspend != NULL) | ||
186 | return x->set_suspend(x, suspend); | ||
187 | else | ||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static inline int | ||
192 | usb_phy_notify_connect(struct usb_phy *x, int port) | ||
193 | { | ||
194 | if (x->notify_connect) | ||
195 | return x->notify_connect(x, port); | ||
196 | else | ||
197 | return 0; | ||
198 | } | ||
199 | |||
200 | static inline int | ||
201 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | ||
202 | { | ||
203 | if (x->notify_disconnect) | ||
204 | return x->notify_disconnect(x, port); | ||
205 | else | ||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | /* notifiers */ | ||
210 | static inline int | ||
211 | usb_register_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
212 | { | ||
213 | return atomic_notifier_chain_register(&x->notifier, nb); | ||
214 | } | ||
215 | |||
216 | static inline void | ||
217 | usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) | ||
218 | { | ||
219 | atomic_notifier_chain_unregister(&x->notifier, nb); | ||
220 | } | ||
221 | |||
222 | static inline const char *usb_phy_type_string(enum usb_phy_type type) | ||
223 | { | ||
224 | switch (type) { | ||
225 | case USB_PHY_TYPE_USB2: | ||
226 | return "USB2 PHY"; | ||
227 | case USB_PHY_TYPE_USB3: | ||
228 | return "USB3 PHY"; | ||
229 | default: | ||
230 | return "UNKNOWN PHY TYPE"; | ||
231 | } | ||
232 | } | ||
233 | #endif /* __LINUX_USB_PHY_H */ | ||
diff --git a/include/linux/usb/phy_companion.h b/include/linux/usb/phy_companion.h new file mode 100644 index 000000000000..edd2ec23d282 --- /dev/null +++ b/include/linux/usb/phy_companion.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * phy-companion.h -- phy companion to indicate the comparator part of PHY | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
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 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_PHY_COMPANION_H | ||
20 | #define __DRIVERS_PHY_COMPANION_H | ||
21 | |||
22 | #include <linux/usb/otg.h> | ||
23 | |||
24 | /* phy_companion to take care of VBUS, ID and srp capabilities */ | ||
25 | struct phy_companion { | ||
26 | |||
27 | /* effective for A-peripheral, ignored for B devices */ | ||
28 | int (*set_vbus)(struct phy_companion *x, bool enabled); | ||
29 | |||
30 | /* for B devices only: start session with A-Host */ | ||
31 | int (*start_srp)(struct phy_companion *x); | ||
32 | }; | ||
33 | |||
34 | #endif /* __DRIVERS_PHY_COMPANION_H */ | ||
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 3e93de7ecbc3..52f944dfe2fd 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -19,8 +19,8 @@ | |||
19 | /* device can't handle its Configuration or Interface strings */ | 19 | /* device can't handle its Configuration or Interface strings */ |
20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 | 20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 |
21 | 21 | ||
22 | /*device will morph if reset, don't use reset for handling errors */ | 22 | /* device can't be reset(e.g morph devices), don't use reset */ |
23 | #define USB_QUIRK_RESET_MORPHS 0x00000010 | 23 | #define USB_QUIRK_RESET 0x00000010 |
24 | 24 | ||
25 | /* device has more interface descriptions than the bNumInterfaces count, | 25 | /* device has more interface descriptions than the bNumInterfaces count, |
26 | and can't handle talking to these interfaces */ | 26 | and can't handle talking to these interfaces */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 86c0b451745d..ef9be7e1e190 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -301,17 +301,13 @@ extern void usb_serial_port_softint(struct usb_serial_port *port); | |||
301 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | 301 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); |
302 | extern int usb_serial_resume(struct usb_interface *intf); | 302 | extern int usb_serial_resume(struct usb_interface *intf); |
303 | 303 | ||
304 | extern int ezusb_writememory(struct usb_serial *serial, int address, | ||
305 | unsigned char *data, int length, __u8 bRequest); | ||
306 | extern int ezusb_set_reset(struct usb_serial *serial, unsigned char reset_bit); | ||
307 | |||
308 | /* USB Serial console functions */ | 304 | /* USB Serial console functions */ |
309 | #ifdef CONFIG_USB_SERIAL_CONSOLE | 305 | #ifdef CONFIG_USB_SERIAL_CONSOLE |
310 | extern void usb_serial_console_init(int debug, int minor); | 306 | extern void usb_serial_console_init(int minor); |
311 | extern void usb_serial_console_exit(void); | 307 | extern void usb_serial_console_exit(void); |
312 | extern void usb_serial_console_disconnect(struct usb_serial *serial); | 308 | extern void usb_serial_console_disconnect(struct usb_serial *serial); |
313 | #else | 309 | #else |
314 | static inline void usb_serial_console_init(int debug, int minor) { } | 310 | static inline void usb_serial_console_init(int minor) { } |
315 | static inline void usb_serial_console_exit(void) { } | 311 | static inline void usb_serial_console_exit(void) { } |
316 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | 312 | static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} |
317 | #endif | 313 | #endif |
@@ -333,7 +329,7 @@ extern void usb_serial_generic_throttle(struct tty_struct *tty); | |||
333 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 329 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
334 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); | 330 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); |
335 | extern void usb_serial_generic_release(struct usb_serial *serial); | 331 | extern void usb_serial_generic_release(struct usb_serial *serial); |
336 | extern int usb_serial_generic_register(int debug); | 332 | extern int usb_serial_generic_register(void); |
337 | extern void usb_serial_generic_deregister(void); | 333 | extern void usb_serial_generic_deregister(void); |
338 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, | 334 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
339 | gfp_t mem_flags); | 335 | gfp_t mem_flags); |
@@ -355,30 +351,14 @@ extern struct usb_serial_driver usb_serial_generic_device; | |||
355 | extern struct bus_type usb_serial_bus_type; | 351 | extern struct bus_type usb_serial_bus_type; |
356 | extern struct tty_driver *usb_serial_tty_driver; | 352 | extern struct tty_driver *usb_serial_tty_driver; |
357 | 353 | ||
358 | static inline void usb_serial_debug_data(int debug, | 354 | static inline void usb_serial_debug_data(struct device *dev, |
359 | struct device *dev, | ||
360 | const char *function, int size, | 355 | const char *function, int size, |
361 | const unsigned char *data) | 356 | const unsigned char *data) |
362 | { | 357 | { |
363 | int i; | 358 | dev_dbg(dev, "%s - length = %d, data = %*ph\n", |
364 | 359 | function, size, size, data); | |
365 | if (debug) { | ||
366 | dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", | ||
367 | function, size); | ||
368 | for (i = 0; i < size; ++i) | ||
369 | printk("%.2x ", data[i]); | ||
370 | printk("\n"); | ||
371 | } | ||
372 | } | 360 | } |
373 | 361 | ||
374 | /* Use our own dbg macro */ | ||
375 | #undef dbg | ||
376 | #define dbg(format, arg...) \ | ||
377 | do { \ | ||
378 | if (debug) \ | ||
379 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | ||
380 | } while (0) | ||
381 | |||
382 | /* | 362 | /* |
383 | * Macro for reporting errors in write path to avoid inifinite loop | 363 | * Macro for reporting errors in write path to avoid inifinite loop |
384 | * when port is used as a console. | 364 | * when port is used as a console. |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h new file mode 100644 index 000000000000..176b1ca06ae4 --- /dev/null +++ b/include/linux/usb/tegra_usb_phy.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Google, Inc. | ||
3 | * | ||
4 | * This software is licensed under the terms of the GNU General Public | ||
5 | * License version 2, as published by the Free Software Foundation, and | ||
6 | * may be copied, distributed, and modified under those terms. | ||
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 | #ifndef __TEGRA_USB_PHY_H | ||
16 | #define __TEGRA_USB_PHY_H | ||
17 | |||
18 | #include <linux/clk.h> | ||
19 | #include <linux/usb/otg.h> | ||
20 | |||
21 | struct tegra_utmip_config { | ||
22 | u8 hssync_start_delay; | ||
23 | u8 elastic_limit; | ||
24 | u8 idle_wait_delay; | ||
25 | u8 term_range_adj; | ||
26 | u8 xcvr_setup; | ||
27 | u8 xcvr_lsfslew; | ||
28 | u8 xcvr_lsrslew; | ||
29 | }; | ||
30 | |||
31 | struct tegra_ulpi_config { | ||
32 | int reset_gpio; | ||
33 | const char *clk; | ||
34 | }; | ||
35 | |||
36 | enum tegra_usb_phy_port_speed { | ||
37 | TEGRA_USB_PHY_PORT_SPEED_FULL = 0, | ||
38 | TEGRA_USB_PHY_PORT_SPEED_LOW, | ||
39 | TEGRA_USB_PHY_PORT_SPEED_HIGH, | ||
40 | }; | ||
41 | |||
42 | enum tegra_usb_phy_mode { | ||
43 | TEGRA_USB_PHY_MODE_DEVICE, | ||
44 | TEGRA_USB_PHY_MODE_HOST, | ||
45 | }; | ||
46 | |||
47 | struct tegra_xtal_freq; | ||
48 | |||
49 | struct tegra_usb_phy { | ||
50 | int instance; | ||
51 | const struct tegra_xtal_freq *freq; | ||
52 | void __iomem *regs; | ||
53 | void __iomem *pad_regs; | ||
54 | struct clk *clk; | ||
55 | struct clk *pll_u; | ||
56 | struct clk *pad_clk; | ||
57 | enum tegra_usb_phy_mode mode; | ||
58 | void *config; | ||
59 | struct usb_phy *ulpi; | ||
60 | struct usb_phy u_phy; | ||
61 | struct device *dev; | ||
62 | }; | ||
63 | |||
64 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | ||
65 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); | ||
66 | |||
67 | void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy); | ||
68 | |||
69 | void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy); | ||
70 | |||
71 | void tegra_usb_phy_preresume(struct tegra_usb_phy *phy); | ||
72 | |||
73 | void tegra_usb_phy_postresume(struct tegra_usb_phy *phy); | ||
74 | |||
75 | void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, | ||
76 | enum tegra_usb_phy_port_speed port_speed); | ||
77 | |||
78 | void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy); | ||
79 | |||
80 | #endif /* __TEGRA_USB_PHY_H */ | ||
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index e84e769aaddc..bf99cd01be20 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -72,33 +72,9 @@ | |||
72 | enum { US_DO_ALL_FLAGS }; | 72 | enum { US_DO_ALL_FLAGS }; |
73 | #undef US_FLAG | 73 | #undef US_FLAG |
74 | 74 | ||
75 | /* | ||
76 | * The bias field for libusual and friends. | ||
77 | */ | ||
78 | #define USB_US_TYPE_NONE 0 | ||
79 | #define USB_US_TYPE_STOR 1 /* usb-storage */ | ||
80 | #define USB_US_TYPE_UB 2 /* ub */ | ||
81 | |||
82 | #define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF) | ||
83 | #define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF) | ||
84 | |||
85 | #include <linux/usb/storage.h> | 75 | #include <linux/usb/storage.h> |
86 | 76 | ||
87 | /* | ||
88 | */ | ||
89 | extern int usb_usual_ignore_device(struct usb_interface *intf); | 77 | extern int usb_usual_ignore_device(struct usb_interface *intf); |
90 | extern struct usb_device_id usb_storage_usb_ids[]; | 78 | extern struct usb_device_id usb_storage_usb_ids[]; |
91 | 79 | ||
92 | #ifdef CONFIG_USB_LIBUSUAL | ||
93 | |||
94 | extern void usb_usual_set_present(int type); | ||
95 | extern void usb_usual_clear_present(int type); | ||
96 | extern int usb_usual_check_type(const struct usb_device_id *, int type); | ||
97 | #else | ||
98 | |||
99 | #define usb_usual_set_present(t) do { } while(0) | ||
100 | #define usb_usual_clear_present(t) do { } while(0) | ||
101 | #define usb_usual_check_type(id, t) (0) | ||
102 | #endif /* CONFIG_USB_LIBUSUAL */ | ||
103 | |||
104 | #endif /* __LINUX_USB_USUAL_H */ | 80 | #endif /* __LINUX_USB_USUAL_H */ |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 3b74666be027..4abe28e41cbc 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -131,6 +131,19 @@ struct usbdevfs_hub_portinfo { | |||
131 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 | 131 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 |
132 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 | 132 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 |
133 | 133 | ||
134 | /* USBDEVFS_DISCONNECT_CLAIM flags & struct */ | ||
135 | |||
136 | /* disconnect-and-claim if the driver matches the driver field */ | ||
137 | #define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01 | ||
138 | /* disconnect-and-claim except when the driver matches the driver field */ | ||
139 | #define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02 | ||
140 | |||
141 | struct usbdevfs_disconnect_claim { | ||
142 | unsigned int interface; | ||
143 | unsigned int flags; | ||
144 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; | ||
145 | }; | ||
146 | |||
134 | #ifdef __KERNEL__ | 147 | #ifdef __KERNEL__ |
135 | #ifdef CONFIG_COMPAT | 148 | #ifdef CONFIG_COMPAT |
136 | #include <linux/compat.h> | 149 | #include <linux/compat.h> |
@@ -211,5 +224,6 @@ struct usbdevfs_ioctl32 { | |||
211 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | 224 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) |
212 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | 225 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) |
213 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) | 226 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) |
227 | #define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim) | ||
214 | 228 | ||
215 | #endif /* _LINUX_USBDEVICE_FS_H */ | 229 | #endif /* _LINUX_USBDEVICE_FS_H */ |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4e72922e5a75..95142cae446a 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -20,6 +20,7 @@ struct uid_gid_map { /* 64 bytes -- 1 cache line */ | |||
20 | struct user_namespace { | 20 | struct user_namespace { |
21 | struct uid_gid_map uid_map; | 21 | struct uid_gid_map uid_map; |
22 | struct uid_gid_map gid_map; | 22 | struct uid_gid_map gid_map; |
23 | struct uid_gid_map projid_map; | ||
23 | struct kref kref; | 24 | struct kref kref; |
24 | struct user_namespace *parent; | 25 | struct user_namespace *parent; |
25 | kuid_t owner; | 26 | kuid_t owner; |
@@ -49,8 +50,10 @@ static inline void put_user_ns(struct user_namespace *ns) | |||
49 | struct seq_operations; | 50 | struct seq_operations; |
50 | extern struct seq_operations proc_uid_seq_operations; | 51 | extern struct seq_operations proc_uid_seq_operations; |
51 | extern struct seq_operations proc_gid_seq_operations; | 52 | extern struct seq_operations proc_gid_seq_operations; |
53 | extern struct seq_operations proc_projid_seq_operations; | ||
52 | extern ssize_t proc_uid_map_write(struct file *, const char __user *, size_t, loff_t *); | 54 | extern ssize_t proc_uid_map_write(struct file *, const char __user *, size_t, loff_t *); |
53 | extern ssize_t proc_gid_map_write(struct file *, const char __user *, size_t, loff_t *); | 55 | extern ssize_t proc_gid_map_write(struct file *, const char __user *, size_t, loff_t *); |
56 | extern ssize_t proc_projid_map_write(struct file *, const char __user *, size_t, loff_t *); | ||
54 | #else | 57 | #else |
55 | 58 | ||
56 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | 59 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) |
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 3adeff82212f..065e3ae79ab0 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
@@ -19,6 +19,7 @@ struct w1_gpio_platform_data { | |||
19 | unsigned int pin; | 19 | unsigned int pin; |
20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
21 | void (*enable_external_pullup)(int enable); | 21 | void (*enable_external_pullup)(int enable); |
22 | unsigned int ext_pullup_enable_pin; | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | #endif /* _LINUX_W1_GPIO_H */ | 25 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index af155450cabb..2b58905d3504 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -16,6 +16,7 @@ struct workqueue_struct; | |||
16 | 16 | ||
17 | struct work_struct; | 17 | struct work_struct; |
18 | typedef void (*work_func_t)(struct work_struct *work); | 18 | typedef void (*work_func_t)(struct work_struct *work); |
19 | void delayed_work_timer_fn(unsigned long __data); | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * The first word is the work queue pointer and the flags rolled into | 22 | * The first word is the work queue pointer and the flags rolled into |
@@ -67,9 +68,18 @@ enum { | |||
67 | WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT + | 68 | WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT + |
68 | WORK_STRUCT_COLOR_BITS, | 69 | WORK_STRUCT_COLOR_BITS, |
69 | 70 | ||
71 | /* data contains off-queue information when !WORK_STRUCT_CWQ */ | ||
72 | WORK_OFFQ_FLAG_BASE = WORK_STRUCT_FLAG_BITS, | ||
73 | |||
74 | WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE), | ||
75 | |||
76 | WORK_OFFQ_FLAG_BITS = 1, | ||
77 | WORK_OFFQ_CPU_SHIFT = WORK_OFFQ_FLAG_BASE + WORK_OFFQ_FLAG_BITS, | ||
78 | |||
79 | /* convenience constants */ | ||
70 | WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, | 80 | WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, |
71 | WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, | 81 | WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, |
72 | WORK_STRUCT_NO_CPU = WORK_CPU_NONE << WORK_STRUCT_FLAG_BITS, | 82 | WORK_STRUCT_NO_CPU = (unsigned long)WORK_CPU_NONE << WORK_OFFQ_CPU_SHIFT, |
73 | 83 | ||
74 | /* bit mask for work_busy() return values */ | 84 | /* bit mask for work_busy() return values */ |
75 | WORK_BUSY_PENDING = 1 << 0, | 85 | WORK_BUSY_PENDING = 1 << 0, |
@@ -92,6 +102,7 @@ struct work_struct { | |||
92 | struct delayed_work { | 102 | struct delayed_work { |
93 | struct work_struct work; | 103 | struct work_struct work; |
94 | struct timer_list timer; | 104 | struct timer_list timer; |
105 | int cpu; | ||
95 | }; | 106 | }; |
96 | 107 | ||
97 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) | 108 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) |
@@ -115,41 +126,38 @@ struct execute_work { | |||
115 | #define __WORK_INIT_LOCKDEP_MAP(n, k) | 126 | #define __WORK_INIT_LOCKDEP_MAP(n, k) |
116 | #endif | 127 | #endif |
117 | 128 | ||
118 | #define __WORK_INITIALIZER(n, f) { \ | 129 | #define __WORK_INITIALIZER(n, f) { \ |
119 | .data = WORK_DATA_STATIC_INIT(), \ | 130 | .data = WORK_DATA_STATIC_INIT(), \ |
120 | .entry = { &(n).entry, &(n).entry }, \ | 131 | .entry = { &(n).entry, &(n).entry }, \ |
121 | .func = (f), \ | 132 | .func = (f), \ |
122 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | 133 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ |
123 | } | 134 | } |
124 | 135 | ||
125 | #define __DELAYED_WORK_INITIALIZER(n, f) { \ | 136 | #define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \ |
126 | .work = __WORK_INITIALIZER((n).work, (f)), \ | 137 | .work = __WORK_INITIALIZER((n).work, (f)), \ |
127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | 138 | .timer = __TIMER_INITIALIZER(delayed_work_timer_fn, \ |
139 | 0, (unsigned long)&(n), \ | ||
140 | (tflags) | TIMER_IRQSAFE), \ | ||
128 | } | 141 | } |
129 | 142 | ||
130 | #define __DEFERRED_WORK_INITIALIZER(n, f) { \ | 143 | #define DECLARE_WORK(n, f) \ |
131 | .work = __WORK_INITIALIZER((n).work, (f)), \ | ||
132 | .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \ | ||
133 | } | ||
134 | |||
135 | #define DECLARE_WORK(n, f) \ | ||
136 | struct work_struct n = __WORK_INITIALIZER(n, f) | 144 | struct work_struct n = __WORK_INITIALIZER(n, f) |
137 | 145 | ||
138 | #define DECLARE_DELAYED_WORK(n, f) \ | 146 | #define DECLARE_DELAYED_WORK(n, f) \ |
139 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) | 147 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, 0) |
140 | 148 | ||
141 | #define DECLARE_DEFERRED_WORK(n, f) \ | 149 | #define DECLARE_DEFERRABLE_WORK(n, f) \ |
142 | struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f) | 150 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, TIMER_DEFERRABLE) |
143 | 151 | ||
144 | /* | 152 | /* |
145 | * initialize a work item's function pointer | 153 | * initialize a work item's function pointer |
146 | */ | 154 | */ |
147 | #define PREPARE_WORK(_work, _func) \ | 155 | #define PREPARE_WORK(_work, _func) \ |
148 | do { \ | 156 | do { \ |
149 | (_work)->func = (_func); \ | 157 | (_work)->func = (_func); \ |
150 | } while (0) | 158 | } while (0) |
151 | 159 | ||
152 | #define PREPARE_DELAYED_WORK(_work, _func) \ | 160 | #define PREPARE_DELAYED_WORK(_work, _func) \ |
153 | PREPARE_WORK(&(_work)->work, (_func)) | 161 | PREPARE_WORK(&(_work)->work, (_func)) |
154 | 162 | ||
155 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 163 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
@@ -179,7 +187,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
179 | \ | 187 | \ |
180 | __init_work((_work), _onstack); \ | 188 | __init_work((_work), _onstack); \ |
181 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 189 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
182 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ | 190 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0); \ |
183 | INIT_LIST_HEAD(&(_work)->entry); \ | 191 | INIT_LIST_HEAD(&(_work)->entry); \ |
184 | PREPARE_WORK((_work), (_func)); \ | 192 | PREPARE_WORK((_work), (_func)); \ |
185 | } while (0) | 193 | } while (0) |
@@ -193,33 +201,44 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
193 | } while (0) | 201 | } while (0) |
194 | #endif | 202 | #endif |
195 | 203 | ||
196 | #define INIT_WORK(_work, _func) \ | 204 | #define INIT_WORK(_work, _func) \ |
197 | do { \ | 205 | do { \ |
198 | __INIT_WORK((_work), (_func), 0); \ | 206 | __INIT_WORK((_work), (_func), 0); \ |
199 | } while (0) | 207 | } while (0) |
200 | 208 | ||
201 | #define INIT_WORK_ONSTACK(_work, _func) \ | 209 | #define INIT_WORK_ONSTACK(_work, _func) \ |
202 | do { \ | 210 | do { \ |
203 | __INIT_WORK((_work), (_func), 1); \ | 211 | __INIT_WORK((_work), (_func), 1); \ |
204 | } while (0) | 212 | } while (0) |
205 | 213 | ||
206 | #define INIT_DELAYED_WORK(_work, _func) \ | 214 | #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ |
207 | do { \ | 215 | do { \ |
208 | INIT_WORK(&(_work)->work, (_func)); \ | 216 | INIT_WORK(&(_work)->work, (_func)); \ |
209 | init_timer(&(_work)->timer); \ | 217 | __setup_timer(&(_work)->timer, delayed_work_timer_fn, \ |
218 | (unsigned long)(_work), \ | ||
219 | (_tflags) | TIMER_IRQSAFE); \ | ||
210 | } while (0) | 220 | } while (0) |
211 | 221 | ||
212 | #define INIT_DELAYED_WORK_ONSTACK(_work, _func) \ | 222 | #define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \ |
213 | do { \ | 223 | do { \ |
214 | INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ | 224 | INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ |
215 | init_timer_on_stack(&(_work)->timer); \ | 225 | __setup_timer_on_stack(&(_work)->timer, \ |
226 | delayed_work_timer_fn, \ | ||
227 | (unsigned long)(_work), \ | ||
228 | (_tflags) | TIMER_IRQSAFE); \ | ||
216 | } while (0) | 229 | } while (0) |
217 | 230 | ||
218 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ | 231 | #define INIT_DELAYED_WORK(_work, _func) \ |
219 | do { \ | 232 | __INIT_DELAYED_WORK(_work, _func, 0) |
220 | INIT_WORK(&(_work)->work, (_func)); \ | 233 | |
221 | init_timer_deferrable(&(_work)->timer); \ | 234 | #define INIT_DELAYED_WORK_ONSTACK(_work, _func) \ |
222 | } while (0) | 235 | __INIT_DELAYED_WORK_ONSTACK(_work, _func, 0) |
236 | |||
237 | #define INIT_DEFERRABLE_WORK(_work, _func) \ | ||
238 | __INIT_DELAYED_WORK(_work, _func, TIMER_DEFERRABLE) | ||
239 | |||
240 | #define INIT_DEFERRABLE_WORK_ONSTACK(_work, _func) \ | ||
241 | __INIT_DELAYED_WORK_ONSTACK(_work, _func, TIMER_DEFERRABLE) | ||
223 | 242 | ||
224 | /** | 243 | /** |
225 | * work_pending - Find out whether a work item is currently pending | 244 | * work_pending - Find out whether a work item is currently pending |
@@ -278,10 +297,6 @@ enum { | |||
278 | * system_long_wq is similar to system_wq but may host long running | 297 | * system_long_wq is similar to system_wq but may host long running |
279 | * works. Queue flushing might take relatively long. | 298 | * works. Queue flushing might take relatively long. |
280 | * | 299 | * |
281 | * system_nrt_wq is non-reentrant and guarantees that any given work | ||
282 | * item is never executed in parallel by multiple CPUs. Queue | ||
283 | * flushing might take relatively long. | ||
284 | * | ||
285 | * system_unbound_wq is unbound workqueue. Workers are not bound to | 300 | * system_unbound_wq is unbound workqueue. Workers are not bound to |
286 | * any specific CPU, not concurrency managed, and all queued works are | 301 | * any specific CPU, not concurrency managed, and all queued works are |
287 | * executed immediately as long as max_active limit is not reached and | 302 | * executed immediately as long as max_active limit is not reached and |
@@ -289,16 +304,25 @@ enum { | |||
289 | * | 304 | * |
290 | * system_freezable_wq is equivalent to system_wq except that it's | 305 | * system_freezable_wq is equivalent to system_wq except that it's |
291 | * freezable. | 306 | * freezable. |
292 | * | ||
293 | * system_nrt_freezable_wq is equivalent to system_nrt_wq except that | ||
294 | * it's freezable. | ||
295 | */ | 307 | */ |
296 | extern struct workqueue_struct *system_wq; | 308 | extern struct workqueue_struct *system_wq; |
297 | extern struct workqueue_struct *system_long_wq; | 309 | extern struct workqueue_struct *system_long_wq; |
298 | extern struct workqueue_struct *system_nrt_wq; | ||
299 | extern struct workqueue_struct *system_unbound_wq; | 310 | extern struct workqueue_struct *system_unbound_wq; |
300 | extern struct workqueue_struct *system_freezable_wq; | 311 | extern struct workqueue_struct *system_freezable_wq; |
301 | extern struct workqueue_struct *system_nrt_freezable_wq; | 312 | |
313 | static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) | ||
314 | { | ||
315 | return system_wq; | ||
316 | } | ||
317 | |||
318 | static inline struct workqueue_struct * __deprecated __system_nrt_freezable_wq(void) | ||
319 | { | ||
320 | return system_freezable_wq; | ||
321 | } | ||
322 | |||
323 | /* equivlalent to system_wq and system_freezable_wq, deprecated */ | ||
324 | #define system_nrt_wq __system_nrt_wq() | ||
325 | #define system_nrt_freezable_wq __system_nrt_freezable_wq() | ||
302 | 326 | ||
303 | extern struct workqueue_struct * | 327 | extern struct workqueue_struct * |
304 | __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | 328 | __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, |
@@ -321,22 +345,22 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
321 | * Pointer to the allocated workqueue on success, %NULL on failure. | 345 | * Pointer to the allocated workqueue on success, %NULL on failure. |
322 | */ | 346 | */ |
323 | #ifdef CONFIG_LOCKDEP | 347 | #ifdef CONFIG_LOCKDEP |
324 | #define alloc_workqueue(fmt, flags, max_active, args...) \ | 348 | #define alloc_workqueue(fmt, flags, max_active, args...) \ |
325 | ({ \ | 349 | ({ \ |
326 | static struct lock_class_key __key; \ | 350 | static struct lock_class_key __key; \ |
327 | const char *__lock_name; \ | 351 | const char *__lock_name; \ |
328 | \ | 352 | \ |
329 | if (__builtin_constant_p(fmt)) \ | 353 | if (__builtin_constant_p(fmt)) \ |
330 | __lock_name = (fmt); \ | 354 | __lock_name = (fmt); \ |
331 | else \ | 355 | else \ |
332 | __lock_name = #fmt; \ | 356 | __lock_name = #fmt; \ |
333 | \ | 357 | \ |
334 | __alloc_workqueue_key((fmt), (flags), (max_active), \ | 358 | __alloc_workqueue_key((fmt), (flags), (max_active), \ |
335 | &__key, __lock_name, ##args); \ | 359 | &__key, __lock_name, ##args); \ |
336 | }) | 360 | }) |
337 | #else | 361 | #else |
338 | #define alloc_workqueue(fmt, flags, max_active, args...) \ | 362 | #define alloc_workqueue(fmt, flags, max_active, args...) \ |
339 | __alloc_workqueue_key((fmt), (flags), (max_active), \ | 363 | __alloc_workqueue_key((fmt), (flags), (max_active), \ |
340 | NULL, NULL, ##args) | 364 | NULL, NULL, ##args) |
341 | #endif | 365 | #endif |
342 | 366 | ||
@@ -353,46 +377,50 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
353 | * RETURNS: | 377 | * RETURNS: |
354 | * Pointer to the allocated workqueue on success, %NULL on failure. | 378 | * Pointer to the allocated workqueue on success, %NULL on failure. |
355 | */ | 379 | */ |
356 | #define alloc_ordered_workqueue(fmt, flags, args...) \ | 380 | #define alloc_ordered_workqueue(fmt, flags, args...) \ |
357 | alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) | 381 | alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) |
358 | 382 | ||
359 | #define create_workqueue(name) \ | 383 | #define create_workqueue(name) \ |
360 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 384 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
361 | #define create_freezable_workqueue(name) \ | 385 | #define create_freezable_workqueue(name) \ |
362 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 386 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
363 | #define create_singlethread_workqueue(name) \ | 387 | #define create_singlethread_workqueue(name) \ |
364 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 388 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
365 | 389 | ||
366 | extern void destroy_workqueue(struct workqueue_struct *wq); | 390 | extern void destroy_workqueue(struct workqueue_struct *wq); |
367 | 391 | ||
368 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); | 392 | extern bool queue_work_on(int cpu, struct workqueue_struct *wq, |
369 | extern int queue_work_on(int cpu, struct workqueue_struct *wq, | ||
370 | struct work_struct *work); | 393 | struct work_struct *work); |
371 | extern int queue_delayed_work(struct workqueue_struct *wq, | 394 | extern bool queue_work(struct workqueue_struct *wq, struct work_struct *work); |
395 | extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | ||
372 | struct delayed_work *work, unsigned long delay); | 396 | struct delayed_work *work, unsigned long delay); |
373 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 397 | extern bool queue_delayed_work(struct workqueue_struct *wq, |
374 | struct delayed_work *work, unsigned long delay); | 398 | struct delayed_work *work, unsigned long delay); |
399 | extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, | ||
400 | struct delayed_work *dwork, unsigned long delay); | ||
401 | extern bool mod_delayed_work(struct workqueue_struct *wq, | ||
402 | struct delayed_work *dwork, unsigned long delay); | ||
375 | 403 | ||
376 | extern void flush_workqueue(struct workqueue_struct *wq); | 404 | extern void flush_workqueue(struct workqueue_struct *wq); |
377 | extern void drain_workqueue(struct workqueue_struct *wq); | 405 | extern void drain_workqueue(struct workqueue_struct *wq); |
378 | extern void flush_scheduled_work(void); | 406 | extern void flush_scheduled_work(void); |
379 | 407 | ||
380 | extern int schedule_work(struct work_struct *work); | 408 | extern bool schedule_work_on(int cpu, struct work_struct *work); |
381 | extern int schedule_work_on(int cpu, struct work_struct *work); | 409 | extern bool schedule_work(struct work_struct *work); |
382 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); | 410 | extern bool schedule_delayed_work_on(int cpu, struct delayed_work *work, |
383 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | 411 | unsigned long delay); |
384 | unsigned long delay); | 412 | extern bool schedule_delayed_work(struct delayed_work *work, |
413 | unsigned long delay); | ||
385 | extern int schedule_on_each_cpu(work_func_t func); | 414 | extern int schedule_on_each_cpu(work_func_t func); |
386 | extern int keventd_up(void); | 415 | extern int keventd_up(void); |
387 | 416 | ||
388 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 417 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
389 | 418 | ||
390 | extern bool flush_work(struct work_struct *work); | 419 | extern bool flush_work(struct work_struct *work); |
391 | extern bool flush_work_sync(struct work_struct *work); | ||
392 | extern bool cancel_work_sync(struct work_struct *work); | 420 | extern bool cancel_work_sync(struct work_struct *work); |
393 | 421 | ||
394 | extern bool flush_delayed_work(struct delayed_work *dwork); | 422 | extern bool flush_delayed_work(struct delayed_work *dwork); |
395 | extern bool flush_delayed_work_sync(struct delayed_work *work); | 423 | extern bool cancel_delayed_work(struct delayed_work *dwork); |
396 | extern bool cancel_delayed_work_sync(struct delayed_work *dwork); | 424 | extern bool cancel_delayed_work_sync(struct delayed_work *dwork); |
397 | 425 | ||
398 | extern void workqueue_set_max_active(struct workqueue_struct *wq, | 426 | extern void workqueue_set_max_active(struct workqueue_struct *wq, |
@@ -402,27 +430,11 @@ extern unsigned int work_cpu(struct work_struct *work); | |||
402 | extern unsigned int work_busy(struct work_struct *work); | 430 | extern unsigned int work_busy(struct work_struct *work); |
403 | 431 | ||
404 | /* | 432 | /* |
405 | * Kill off a pending schedule_delayed_work(). Note that the work callback | ||
406 | * function may still be running on return from cancel_delayed_work(), unless | ||
407 | * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or | ||
408 | * cancel_work_sync() to wait on it. | ||
409 | */ | ||
410 | static inline bool cancel_delayed_work(struct delayed_work *work) | ||
411 | { | ||
412 | bool ret; | ||
413 | |||
414 | ret = del_timer_sync(&work->timer); | ||
415 | if (ret) | ||
416 | work_clear_pending(&work->work); | ||
417 | return ret; | ||
418 | } | ||
419 | |||
420 | /* | ||
421 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | 433 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, |
422 | * if it returns 0 the timer function may be running and the queueing is in | 434 | * if it returns 0 the timer function may be running and the queueing is in |
423 | * progress. | 435 | * progress. |
424 | */ | 436 | */ |
425 | static inline bool __cancel_delayed_work(struct delayed_work *work) | 437 | static inline bool __deprecated __cancel_delayed_work(struct delayed_work *work) |
426 | { | 438 | { |
427 | bool ret; | 439 | bool ret; |
428 | 440 | ||
@@ -432,6 +444,18 @@ static inline bool __cancel_delayed_work(struct delayed_work *work) | |||
432 | return ret; | 444 | return ret; |
433 | } | 445 | } |
434 | 446 | ||
447 | /* used to be different but now identical to flush_work(), deprecated */ | ||
448 | static inline bool __deprecated flush_work_sync(struct work_struct *work) | ||
449 | { | ||
450 | return flush_work(work); | ||
451 | } | ||
452 | |||
453 | /* used to be different but now identical to flush_delayed_work(), deprecated */ | ||
454 | static inline bool __deprecated flush_delayed_work_sync(struct delayed_work *dwork) | ||
455 | { | ||
456 | return flush_delayed_work(dwork); | ||
457 | } | ||
458 | |||
435 | #ifndef CONFIG_SMP | 459 | #ifndef CONFIG_SMP |
436 | static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) | 460 | static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) |
437 | { | 461 | { |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index e5d122031542..cc13e1115970 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -33,6 +33,9 @@ | |||
33 | #define XATTR_EVM_SUFFIX "evm" | 33 | #define XATTR_EVM_SUFFIX "evm" |
34 | #define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX | 34 | #define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX |
35 | 35 | ||
36 | #define XATTR_IMA_SUFFIX "ima" | ||
37 | #define XATTR_NAME_IMA XATTR_SECURITY_PREFIX XATTR_IMA_SUFFIX | ||
38 | |||
36 | #define XATTR_SELINUX_SUFFIX "selinux" | 39 | #define XATTR_SELINUX_SUFFIX "selinux" |
37 | #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX | 40 | #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX |
38 | 41 | ||
@@ -59,7 +62,9 @@ | |||
59 | 62 | ||
60 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
61 | 64 | ||
65 | #include <linux/slab.h> | ||
62 | #include <linux/types.h> | 66 | #include <linux/types.h> |
67 | #include <linux/spinlock.h> | ||
63 | 68 | ||
64 | struct inode; | 69 | struct inode; |
65 | struct dentry; | 70 | struct dentry; |
@@ -96,6 +101,52 @@ ssize_t vfs_getxattr_alloc(struct dentry *dentry, const char *name, | |||
96 | char **xattr_value, size_t size, gfp_t flags); | 101 | char **xattr_value, size_t size, gfp_t flags); |
97 | int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, | 102 | int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name, |
98 | const char *value, size_t size, gfp_t flags); | 103 | const char *value, size_t size, gfp_t flags); |
104 | |||
105 | struct simple_xattrs { | ||
106 | struct list_head head; | ||
107 | spinlock_t lock; | ||
108 | }; | ||
109 | |||
110 | struct simple_xattr { | ||
111 | struct list_head list; | ||
112 | char *name; | ||
113 | size_t size; | ||
114 | char value[0]; | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * initialize the simple_xattrs structure | ||
119 | */ | ||
120 | static inline void simple_xattrs_init(struct simple_xattrs *xattrs) | ||
121 | { | ||
122 | INIT_LIST_HEAD(&xattrs->head); | ||
123 | spin_lock_init(&xattrs->lock); | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * free all the xattrs | ||
128 | */ | ||
129 | static inline void simple_xattrs_free(struct simple_xattrs *xattrs) | ||
130 | { | ||
131 | struct simple_xattr *xattr, *node; | ||
132 | |||
133 | list_for_each_entry_safe(xattr, node, &xattrs->head, list) { | ||
134 | kfree(xattr->name); | ||
135 | kfree(xattr); | ||
136 | } | ||
137 | } | ||
138 | |||
139 | struct simple_xattr *simple_xattr_alloc(const void *value, size_t size); | ||
140 | int simple_xattr_get(struct simple_xattrs *xattrs, const char *name, | ||
141 | void *buffer, size_t size); | ||
142 | int simple_xattr_set(struct simple_xattrs *xattrs, const char *name, | ||
143 | const void *value, size_t size, int flags); | ||
144 | int simple_xattr_remove(struct simple_xattrs *xattrs, const char *name); | ||
145 | ssize_t simple_xattr_list(struct simple_xattrs *xattrs, char *buffer, | ||
146 | size_t size); | ||
147 | void simple_xattr_list_add(struct simple_xattrs *xattrs, | ||
148 | struct simple_xattr *new_xattr); | ||
149 | |||
99 | #endif /* __KERNEL__ */ | 150 | #endif /* __KERNEL__ */ |
100 | 151 | ||
101 | #endif /* _LINUX_XATTR_H */ | 152 | #endif /* _LINUX_XATTR_H */ |
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index 8787349fbafe..53cae1e11e57 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h | |||
@@ -222,6 +222,7 @@ enum { | |||
222 | * @ubi_num: UBI device number to create | 222 | * @ubi_num: UBI device number to create |
223 | * @mtd_num: MTD device number to attach | 223 | * @mtd_num: MTD device number to attach |
224 | * @vid_hdr_offset: VID header offset (use defaults if %0) | 224 | * @vid_hdr_offset: VID header offset (use defaults if %0) |
225 | * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs | ||
225 | * @padding: reserved for future, not used, has to be zeroed | 226 | * @padding: reserved for future, not used, has to be zeroed |
226 | * | 227 | * |
227 | * This data structure is used to specify MTD device UBI has to attach and the | 228 | * This data structure is used to specify MTD device UBI has to attach and the |
@@ -245,12 +246,25 @@ enum { | |||
245 | * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes | 246 | * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes |
246 | * aligned, which is OK, as UBI is clever enough to realize this is 4th | 247 | * aligned, which is OK, as UBI is clever enough to realize this is 4th |
247 | * sub-page of the first page and add needed padding. | 248 | * sub-page of the first page and add needed padding. |
249 | * | ||
250 | * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the | ||
251 | * UBI device per 1024 eraseblocks. This value is often given in an other form | ||
252 | * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The | ||
253 | * maximum expected bad eraseblocks per 1024 is then: | ||
254 | * 1024 * (1 - MinNVB / MaxNVB) | ||
255 | * Which gives 20 for most NAND devices. This limit is used in order to derive | ||
256 | * amount of eraseblock UBI reserves for handling new bad blocks. If the device | ||
257 | * has more bad eraseblocks than this limit, UBI does not reserve any physical | ||
258 | * eraseblocks for new bad eraseblocks, but attempts to use available | ||
259 | * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the | ||
260 | * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. | ||
248 | */ | 261 | */ |
249 | struct ubi_attach_req { | 262 | struct ubi_attach_req { |
250 | __s32 ubi_num; | 263 | __s32 ubi_num; |
251 | __s32 mtd_num; | 264 | __s32 mtd_num; |
252 | __s32 vid_hdr_offset; | 265 | __s32 vid_hdr_offset; |
253 | __s8 padding[12]; | 266 | __s16 max_beb_per1024; |
267 | __s8 padding[10]; | ||
254 | }; | 268 | }; |
255 | 269 | ||
256 | /** | 270 | /** |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 089a09d001d1..9e63e76b20e7 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -78,7 +78,7 @@ extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, | |||
78 | int strict); | 78 | int strict); |
79 | 79 | ||
80 | extern int ipv6_dev_get_saddr(struct net *net, | 80 | extern int ipv6_dev_get_saddr(struct net *net, |
81 | struct net_device *dev, | 81 | const struct net_device *dev, |
82 | const struct in6_addr *daddr, | 82 | const struct in6_addr *daddr, |
83 | unsigned int srcprefs, | 83 | unsigned int srcprefs, |
84 | struct in6_addr *saddr); | 84 | struct in6_addr *saddr); |
diff --git a/include/net/arp.h b/include/net/arp.h index 7f7df93f37cd..b630dae03411 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -3,6 +3,7 @@ | |||
3 | #define _ARP_H | 3 | #define _ARP_H |
4 | 4 | ||
5 | #include <linux/if_arp.h> | 5 | #include <linux/if_arp.h> |
6 | #include <linux/hash.h> | ||
6 | #include <net/neighbour.h> | 7 | #include <net/neighbour.h> |
7 | 8 | ||
8 | 9 | ||
@@ -10,7 +11,7 @@ extern struct neigh_table arp_tbl; | |||
10 | 11 | ||
11 | static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd) | 12 | static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd) |
12 | { | 13 | { |
13 | u32 val = key ^ dev->ifindex; | 14 | u32 val = key ^ hash32_ptr(dev); |
14 | 15 | ||
15 | return val * hash_rnd; | 16 | return val * hash_rnd; |
16 | } | 17 | } |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 5d2352154cf6..53539acbd81a 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -157,7 +157,7 @@ enum { | |||
157 | typedef struct ax25_uid_assoc { | 157 | typedef struct ax25_uid_assoc { |
158 | struct hlist_node uid_node; | 158 | struct hlist_node uid_node; |
159 | atomic_t refcount; | 159 | atomic_t refcount; |
160 | uid_t uid; | 160 | kuid_t uid; |
161 | ax25_address call; | 161 | ax25_address call; |
162 | } ax25_uid_assoc; | 162 | } ax25_uid_assoc; |
163 | 163 | ||
@@ -434,7 +434,7 @@ extern unsigned long ax25_display_timer(struct timer_list *); | |||
434 | 434 | ||
435 | /* ax25_uid.c */ | 435 | /* ax25_uid.c */ |
436 | extern int ax25_uid_policy; | 436 | extern int ax25_uid_policy; |
437 | extern ax25_uid_assoc *ax25_findbyuid(uid_t); | 437 | extern ax25_uid_assoc *ax25_findbyuid(kuid_t); |
438 | extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); | 438 | extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); |
439 | extern const struct file_operations ax25_uid_fops; | 439 | extern const struct file_operations ax25_uid_fops; |
440 | extern void ax25_uid_free(void); | 440 | extern void ax25_uid_free(void); |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 565d4bee1e49..ede036977ae8 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
29 | #include <net/sock.h> | 29 | #include <net/sock.h> |
30 | #include <linux/seq_file.h> | ||
30 | 31 | ||
31 | #ifndef AF_BLUETOOTH | 32 | #ifndef AF_BLUETOOTH |
32 | #define AF_BLUETOOTH 31 | 33 | #define AF_BLUETOOTH 31 |
@@ -202,6 +203,10 @@ enum { | |||
202 | struct bt_sock_list { | 203 | struct bt_sock_list { |
203 | struct hlist_head head; | 204 | struct hlist_head head; |
204 | rwlock_t lock; | 205 | rwlock_t lock; |
206 | #ifdef CONFIG_PROC_FS | ||
207 | struct file_operations fops; | ||
208 | int (* custom_seq_show)(struct seq_file *, void *); | ||
209 | #endif | ||
205 | }; | 210 | }; |
206 | 211 | ||
207 | int bt_sock_register(int proto, const struct net_proto_family *ops); | 212 | int bt_sock_register(int proto, const struct net_proto_family *ops); |
@@ -292,6 +297,11 @@ extern void hci_sock_cleanup(void); | |||
292 | extern int bt_sysfs_init(void); | 297 | extern int bt_sysfs_init(void); |
293 | extern void bt_sysfs_cleanup(void); | 298 | extern void bt_sysfs_cleanup(void); |
294 | 299 | ||
300 | extern int bt_procfs_init(struct module* module, struct net *net, const char *name, | ||
301 | struct bt_sock_list* sk_list, | ||
302 | int (* seq_show)(struct seq_file *, void *)); | ||
303 | extern void bt_procfs_cleanup(struct net *net, const char *name); | ||
304 | |||
295 | extern struct dentry *bt_debugfs; | 305 | extern struct dentry *bt_debugfs; |
296 | 306 | ||
297 | int l2cap_init(void); | 307 | int l2cap_init(void); |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index ccd723e0f783..76b2b6bdcf36 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -62,6 +62,15 @@ | |||
62 | /* First BR/EDR Controller shall have ID = 0 */ | 62 | /* First BR/EDR Controller shall have ID = 0 */ |
63 | #define HCI_BREDR_ID 0 | 63 | #define HCI_BREDR_ID 0 |
64 | 64 | ||
65 | /* AMP controller status */ | ||
66 | #define AMP_CTRL_POWERED_DOWN 0x00 | ||
67 | #define AMP_CTRL_BLUETOOTH_ONLY 0x01 | ||
68 | #define AMP_CTRL_NO_CAPACITY 0x02 | ||
69 | #define AMP_CTRL_LOW_CAPACITY 0x03 | ||
70 | #define AMP_CTRL_MEDIUM_CAPACITY 0x04 | ||
71 | #define AMP_CTRL_HIGH_CAPACITY 0x05 | ||
72 | #define AMP_CTRL_FULL_CAPACITY 0x06 | ||
73 | |||
65 | /* HCI device quirks */ | 74 | /* HCI device quirks */ |
66 | enum { | 75 | enum { |
67 | HCI_QUIRK_RESET_ON_CLOSE, | 76 | HCI_QUIRK_RESET_ON_CLOSE, |
@@ -293,8 +302,11 @@ enum { | |||
293 | 302 | ||
294 | /* ---- HCI Error Codes ---- */ | 303 | /* ---- HCI Error Codes ---- */ |
295 | #define HCI_ERROR_AUTH_FAILURE 0x05 | 304 | #define HCI_ERROR_AUTH_FAILURE 0x05 |
305 | #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 | ||
296 | #define HCI_ERROR_REJ_BAD_ADDR 0x0f | 306 | #define HCI_ERROR_REJ_BAD_ADDR 0x0f |
297 | #define HCI_ERROR_REMOTE_USER_TERM 0x13 | 307 | #define HCI_ERROR_REMOTE_USER_TERM 0x13 |
308 | #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 | ||
309 | #define HCI_ERROR_REMOTE_POWER_OFF 0x15 | ||
298 | #define HCI_ERROR_LOCAL_HOST_TERM 0x16 | 310 | #define HCI_ERROR_LOCAL_HOST_TERM 0x16 |
299 | #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 | 311 | #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 |
300 | 312 | ||
@@ -1237,6 +1249,24 @@ struct hci_ev_simple_pair_complete { | |||
1237 | bdaddr_t bdaddr; | 1249 | bdaddr_t bdaddr; |
1238 | } __packed; | 1250 | } __packed; |
1239 | 1251 | ||
1252 | #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b | ||
1253 | struct hci_ev_user_passkey_notify { | ||
1254 | bdaddr_t bdaddr; | ||
1255 | __le32 passkey; | ||
1256 | } __packed; | ||
1257 | |||
1258 | #define HCI_KEYPRESS_STARTED 0 | ||
1259 | #define HCI_KEYPRESS_ENTERED 1 | ||
1260 | #define HCI_KEYPRESS_ERASED 2 | ||
1261 | #define HCI_KEYPRESS_CLEARED 3 | ||
1262 | #define HCI_KEYPRESS_COMPLETED 4 | ||
1263 | |||
1264 | #define HCI_EV_KEYPRESS_NOTIFY 0x3c | ||
1265 | struct hci_ev_keypress_notify { | ||
1266 | bdaddr_t bdaddr; | ||
1267 | __u8 type; | ||
1268 | } __packed; | ||
1269 | |||
1240 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d | 1270 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d |
1241 | struct hci_ev_remote_host_features { | 1271 | struct hci_ev_remote_host_features { |
1242 | bdaddr_t bdaddr; | 1272 | bdaddr_t bdaddr; |
@@ -1295,6 +1325,8 @@ struct hci_ev_num_comp_blocks { | |||
1295 | } __packed; | 1325 | } __packed; |
1296 | 1326 | ||
1297 | /* Low energy meta events */ | 1327 | /* Low energy meta events */ |
1328 | #define LE_CONN_ROLE_MASTER 0x00 | ||
1329 | |||
1298 | #define HCI_EV_LE_CONN_COMPLETE 0x01 | 1330 | #define HCI_EV_LE_CONN_COMPLETE 0x01 |
1299 | struct hci_ev_le_conn_complete { | 1331 | struct hci_ev_le_conn_complete { |
1300 | __u8 status; | 1332 | __u8 status; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 475b8c04ba52..e7d454609881 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -115,12 +115,6 @@ struct oob_data { | |||
115 | u8 randomizer[16]; | 115 | u8 randomizer[16]; |
116 | }; | 116 | }; |
117 | 117 | ||
118 | struct adv_entry { | ||
119 | struct list_head list; | ||
120 | bdaddr_t bdaddr; | ||
121 | u8 bdaddr_type; | ||
122 | }; | ||
123 | |||
124 | struct le_scan_params { | 118 | struct le_scan_params { |
125 | u8 type; | 119 | u8 type; |
126 | u16 interval; | 120 | u16 interval; |
@@ -309,6 +303,8 @@ struct hci_conn { | |||
309 | __u8 pin_length; | 303 | __u8 pin_length; |
310 | __u8 enc_key_size; | 304 | __u8 enc_key_size; |
311 | __u8 io_capability; | 305 | __u8 io_capability; |
306 | __u32 passkey_notify; | ||
307 | __u8 passkey_entered; | ||
312 | __u16 disc_timeout; | 308 | __u16 disc_timeout; |
313 | unsigned long flags; | 309 | unsigned long flags; |
314 | 310 | ||
@@ -356,16 +352,16 @@ extern rwlock_t hci_cb_list_lock; | |||
356 | 352 | ||
357 | /* ----- HCI interface to upper protocols ----- */ | 353 | /* ----- HCI interface to upper protocols ----- */ |
358 | extern int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 354 | extern int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
359 | extern int l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | 355 | extern void l2cap_connect_cfm(struct hci_conn *hcon, u8 status); |
360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 356 | extern int l2cap_disconn_ind(struct hci_conn *hcon); |
361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 357 | extern void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 358 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, | 359 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
364 | u16 flags); | 360 | u16 flags); |
365 | 361 | ||
366 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 362 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
367 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 363 | extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
368 | extern int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); | 364 | extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); |
369 | extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); | 365 | extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); |
370 | 366 | ||
371 | /* ----- Inquiry cache ----- */ | 367 | /* ----- Inquiry cache ----- */ |
@@ -434,15 +430,6 @@ static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | |||
434 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); | 430 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
435 | } | 431 | } |
436 | 432 | ||
437 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | ||
438 | { | ||
439 | struct hci_conn_hash *h = &hdev->conn_hash; | ||
440 | INIT_LIST_HEAD(&h->list); | ||
441 | h->acl_num = 0; | ||
442 | h->sco_num = 0; | ||
443 | h->le_num = 0; | ||
444 | } | ||
445 | |||
446 | static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | 433 | static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) |
447 | { | 434 | { |
448 | struct hci_conn_hash *h = &hdev->conn_hash; | 435 | struct hci_conn_hash *h = &hdev->conn_hash; |
@@ -557,9 +544,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, | |||
557 | return NULL; | 544 | return NULL; |
558 | } | 545 | } |
559 | 546 | ||
560 | void hci_acl_connect(struct hci_conn *conn); | ||
561 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 547 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); |
562 | void hci_add_sco(struct hci_conn *conn, __u16 handle); | ||
563 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); | 548 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); |
564 | void hci_sco_setup(struct hci_conn *conn, __u8 status); | 549 | void hci_sco_setup(struct hci_conn *conn, __u8 status); |
565 | 550 | ||
@@ -569,7 +554,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev); | |||
569 | void hci_conn_check_pending(struct hci_dev *hdev); | 554 | void hci_conn_check_pending(struct hci_dev *hdev); |
570 | 555 | ||
571 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 556 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
572 | int hci_chan_del(struct hci_chan *chan); | 557 | void hci_chan_del(struct hci_chan *chan); |
573 | void hci_chan_list_flush(struct hci_conn *conn); | 558 | void hci_chan_list_flush(struct hci_conn *conn); |
574 | 559 | ||
575 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 560 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
@@ -587,8 +572,7 @@ void hci_conn_put_device(struct hci_conn *conn); | |||
587 | 572 | ||
588 | static inline void hci_conn_hold(struct hci_conn *conn) | 573 | static inline void hci_conn_hold(struct hci_conn *conn) |
589 | { | 574 | { |
590 | BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt), | 575 | BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); |
591 | atomic_read(&conn->refcnt) + 1); | ||
592 | 576 | ||
593 | atomic_inc(&conn->refcnt); | 577 | atomic_inc(&conn->refcnt); |
594 | cancel_delayed_work(&conn->disc_work); | 578 | cancel_delayed_work(&conn->disc_work); |
@@ -596,8 +580,7 @@ static inline void hci_conn_hold(struct hci_conn *conn) | |||
596 | 580 | ||
597 | static inline void hci_conn_put(struct hci_conn *conn) | 581 | static inline void hci_conn_put(struct hci_conn *conn) |
598 | { | 582 | { |
599 | BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt), | 583 | BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); |
600 | atomic_read(&conn->refcnt) - 1); | ||
601 | 584 | ||
602 | if (atomic_dec_and_test(&conn->refcnt)) { | 585 | if (atomic_dec_and_test(&conn->refcnt)) { |
603 | unsigned long timeo; | 586 | unsigned long timeo; |
@@ -622,11 +605,17 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
622 | /* ----- HCI Devices ----- */ | 605 | /* ----- HCI Devices ----- */ |
623 | static inline void hci_dev_put(struct hci_dev *d) | 606 | static inline void hci_dev_put(struct hci_dev *d) |
624 | { | 607 | { |
608 | BT_DBG("%s orig refcnt %d", d->name, | ||
609 | atomic_read(&d->dev.kobj.kref.refcount)); | ||
610 | |||
625 | put_device(&d->dev); | 611 | put_device(&d->dev); |
626 | } | 612 | } |
627 | 613 | ||
628 | static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) | 614 | static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) |
629 | { | 615 | { |
616 | BT_DBG("%s orig refcnt %d", d->name, | ||
617 | atomic_read(&d->dev.kobj.kref.refcount)); | ||
618 | |||
630 | get_device(&d->dev); | 619 | get_device(&d->dev); |
631 | return d; | 620 | return d; |
632 | } | 621 | } |
@@ -1012,7 +1001,7 @@ int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
1012 | u8 addr_type, u32 flags, u8 *name, u8 name_len, | 1001 | u8 addr_type, u32 flags, u8 *name, u8 name_len, |
1013 | u8 *dev_class); | 1002 | u8 *dev_class); |
1014 | int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1003 | int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1015 | u8 link_type, u8 addr_type); | 1004 | u8 link_type, u8 addr_type, u8 reason); |
1016 | int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1005 | int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1017 | u8 link_type, u8 addr_type, u8 status); | 1006 | u8 link_type, u8 addr_type, u8 status); |
1018 | int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1007 | int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
@@ -1035,6 +1024,9 @@ int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
1035 | u8 link_type, u8 addr_type, u8 status); | 1024 | u8 link_type, u8 addr_type, u8 status); |
1036 | int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1025 | int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1037 | u8 link_type, u8 addr_type, u8 status); | 1026 | u8 link_type, u8 addr_type, u8 status); |
1027 | int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, | ||
1028 | u8 link_type, u8 addr_type, u32 passkey, | ||
1029 | u8 entered); | ||
1038 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1030 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
1039 | u8 addr_type, u8 status); | 1031 | u8 addr_type, u8 status); |
1040 | int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); | 1032 | int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); |
@@ -1056,7 +1048,7 @@ int mgmt_discovering(struct hci_dev *hdev, u8 discovering); | |||
1056 | int mgmt_interleaved_discovery(struct hci_dev *hdev); | 1048 | int mgmt_interleaved_discovery(struct hci_dev *hdev); |
1057 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1049 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
1058 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1050 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
1059 | 1051 | bool mgmt_valid_hdev(struct hci_dev *hdev); | |
1060 | int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); | 1052 | int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); |
1061 | 1053 | ||
1062 | /* HCI info for socket */ | 1054 | /* HCI info for socket */ |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index a7679f8913d2..7ed8e356425a 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -433,11 +433,10 @@ struct l2cap_chan { | |||
433 | struct sock *sk; | 433 | struct sock *sk; |
434 | 434 | ||
435 | struct l2cap_conn *conn; | 435 | struct l2cap_conn *conn; |
436 | struct kref kref; | ||
436 | 437 | ||
437 | __u8 state; | 438 | __u8 state; |
438 | 439 | ||
439 | atomic_t refcnt; | ||
440 | |||
441 | __le16 psm; | 440 | __le16 psm; |
442 | __u16 dcid; | 441 | __u16 dcid; |
443 | __u16 scid; | 442 | __u16 scid; |
@@ -671,20 +670,8 @@ enum { | |||
671 | L2CAP_EV_RECV_FRAME, | 670 | L2CAP_EV_RECV_FRAME, |
672 | }; | 671 | }; |
673 | 672 | ||
674 | static inline void l2cap_chan_hold(struct l2cap_chan *c) | 673 | void l2cap_chan_hold(struct l2cap_chan *c); |
675 | { | 674 | void l2cap_chan_put(struct l2cap_chan *c); |
676 | BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt)); | ||
677 | |||
678 | atomic_inc(&c->refcnt); | ||
679 | } | ||
680 | |||
681 | static inline void l2cap_chan_put(struct l2cap_chan *c) | ||
682 | { | ||
683 | BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt)); | ||
684 | |||
685 | if (atomic_dec_and_test(&c->refcnt)) | ||
686 | kfree(c); | ||
687 | } | ||
688 | 675 | ||
689 | static inline void l2cap_chan_lock(struct l2cap_chan *chan) | 676 | static inline void l2cap_chan_lock(struct l2cap_chan *chan) |
690 | { | 677 | { |
@@ -771,7 +758,6 @@ int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); | |||
771 | 758 | ||
772 | struct l2cap_chan *l2cap_chan_create(void); | 759 | struct l2cap_chan *l2cap_chan_create(void); |
773 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); | 760 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); |
774 | void l2cap_chan_destroy(struct l2cap_chan *chan); | ||
775 | int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, | 761 | int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, |
776 | bdaddr_t *dst, u8 dst_type); | 762 | bdaddr_t *dst, u8 dst_type); |
777 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | 763 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 4348ee8bda69..22980a7c3873 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -405,7 +405,16 @@ struct mgmt_ev_device_connected { | |||
405 | __u8 eir[0]; | 405 | __u8 eir[0]; |
406 | } __packed; | 406 | } __packed; |
407 | 407 | ||
408 | #define MGMT_DEV_DISCONN_UNKNOWN 0x00 | ||
409 | #define MGMT_DEV_DISCONN_TIMEOUT 0x01 | ||
410 | #define MGMT_DEV_DISCONN_LOCAL_HOST 0x02 | ||
411 | #define MGMT_DEV_DISCONN_REMOTE 0x03 | ||
412 | |||
408 | #define MGMT_EV_DEVICE_DISCONNECTED 0x000C | 413 | #define MGMT_EV_DEVICE_DISCONNECTED 0x000C |
414 | struct mgmt_ev_device_disconnected { | ||
415 | struct mgmt_addr_info addr; | ||
416 | __u8 reason; | ||
417 | } __packed; | ||
409 | 418 | ||
410 | #define MGMT_EV_CONNECT_FAILED 0x000D | 419 | #define MGMT_EV_CONNECT_FAILED 0x000D |
411 | struct mgmt_ev_connect_failed { | 420 | struct mgmt_ev_connect_failed { |
@@ -469,3 +478,10 @@ struct mgmt_ev_device_unblocked { | |||
469 | struct mgmt_ev_device_unpaired { | 478 | struct mgmt_ev_device_unpaired { |
470 | struct mgmt_addr_info addr; | 479 | struct mgmt_addr_info addr; |
471 | } __packed; | 480 | } __packed; |
481 | |||
482 | #define MGMT_EV_PASSKEY_NOTIFY 0x0017 | ||
483 | struct mgmt_ev_passkey_notify { | ||
484 | struct mgmt_addr_info addr; | ||
485 | __le32 passkey; | ||
486 | __u8 entered; | ||
487 | } __packed; | ||
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index 8b27927b2a55..f8ba07f3e5fa 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
@@ -108,8 +108,8 @@ struct smp_cmd_security_req { | |||
108 | #define SMP_CONFIRM_FAILED 0x04 | 108 | #define SMP_CONFIRM_FAILED 0x04 |
109 | #define SMP_PAIRING_NOTSUPP 0x05 | 109 | #define SMP_PAIRING_NOTSUPP 0x05 |
110 | #define SMP_ENC_KEY_SIZE 0x06 | 110 | #define SMP_ENC_KEY_SIZE 0x06 |
111 | #define SMP_CMD_NOTSUPP 0x07 | 111 | #define SMP_CMD_NOTSUPP 0x07 |
112 | #define SMP_UNSPECIFIED 0x08 | 112 | #define SMP_UNSPECIFIED 0x08 |
113 | #define SMP_REPEATED_ATTEMPTS 0x09 | 113 | #define SMP_REPEATED_ATTEMPTS 0x09 |
114 | 114 | ||
115 | #define SMP_MIN_ENC_KEY_SIZE 7 | 115 | #define SMP_MIN_ENC_KEY_SIZE 7 |
@@ -123,8 +123,8 @@ struct smp_chan { | |||
123 | struct l2cap_conn *conn; | 123 | struct l2cap_conn *conn; |
124 | u8 preq[7]; /* SMP Pairing Request */ | 124 | u8 preq[7]; /* SMP Pairing Request */ |
125 | u8 prsp[7]; /* SMP Pairing Response */ | 125 | u8 prsp[7]; /* SMP Pairing Response */ |
126 | u8 prnd[16]; /* SMP Pairing Random (local) */ | 126 | u8 prnd[16]; /* SMP Pairing Random (local) */ |
127 | u8 rrnd[16]; /* SMP Pairing Random (remote) */ | 127 | u8 rrnd[16]; /* SMP Pairing Random (remote) */ |
128 | u8 pcnf[16]; /* SMP Pairing Confirm */ | 128 | u8 pcnf[16]; /* SMP Pairing Confirm */ |
129 | u8 tk[16]; /* SMP Temporary Key */ | 129 | u8 tk[16]; /* SMP Temporary Key */ |
130 | u8 enc_key_size; | 130 | u8 enc_key_size; |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d254e10ff30..1b4989082244 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -245,6 +245,7 @@ struct ieee80211_sta_vht_cap { | |||
245 | * rates" IE, i.e. CCK rates first, then OFDM. | 245 | * rates" IE, i.e. CCK rates first, then OFDM. |
246 | * @n_bitrates: Number of bitrates in @bitrates | 246 | * @n_bitrates: Number of bitrates in @bitrates |
247 | * @ht_cap: HT capabilities in this band | 247 | * @ht_cap: HT capabilities in this band |
248 | * @vht_cap: VHT capabilities in this band | ||
248 | */ | 249 | */ |
249 | struct ieee80211_supported_band { | 250 | struct ieee80211_supported_band { |
250 | struct ieee80211_channel *channels; | 251 | struct ieee80211_channel *channels; |
@@ -1439,7 +1440,8 @@ struct cfg80211_gtk_rekey_data { | |||
1439 | * @add_virtual_intf: create a new virtual interface with the given name, | 1440 | * @add_virtual_intf: create a new virtual interface with the given name, |
1440 | * must set the struct wireless_dev's iftype. Beware: You must create | 1441 | * must set the struct wireless_dev's iftype. Beware: You must create |
1441 | * the new netdev in the wiphy's network namespace! Returns the struct | 1442 | * the new netdev in the wiphy's network namespace! Returns the struct |
1442 | * wireless_dev, or an ERR_PTR. | 1443 | * wireless_dev, or an ERR_PTR. For P2P device wdevs, the driver must |
1444 | * also set the address member in the wdev. | ||
1443 | * | 1445 | * |
1444 | * @del_virtual_intf: remove the virtual interface | 1446 | * @del_virtual_intf: remove the virtual interface |
1445 | * | 1447 | * |
@@ -1578,9 +1580,7 @@ struct cfg80211_gtk_rekey_data { | |||
1578 | * @set_cqm_txe_config: Configure connection quality monitor TX error | 1580 | * @set_cqm_txe_config: Configure connection quality monitor TX error |
1579 | * thresholds. | 1581 | * thresholds. |
1580 | * @sched_scan_start: Tell the driver to start a scheduled scan. | 1582 | * @sched_scan_start: Tell the driver to start a scheduled scan. |
1581 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled | 1583 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan. |
1582 | * scan. The driver_initiated flag specifies whether the driver | ||
1583 | * itself has informed that the scan has stopped. | ||
1584 | * | 1584 | * |
1585 | * @mgmt_frame_register: Notify driver that a management frame type was | 1585 | * @mgmt_frame_register: Notify driver that a management frame type was |
1586 | * registered. Note that this callback may not sleep, and cannot run | 1586 | * registered. Note that this callback may not sleep, and cannot run |
@@ -1618,6 +1618,9 @@ struct cfg80211_gtk_rekey_data { | |||
1618 | * @get_channel: Get the current operating channel for the virtual interface. | 1618 | * @get_channel: Get the current operating channel for the virtual interface. |
1619 | * For monitor interfaces, it should return %NULL unless there's a single | 1619 | * For monitor interfaces, it should return %NULL unless there's a single |
1620 | * current monitoring channel. | 1620 | * current monitoring channel. |
1621 | * | ||
1622 | * @start_p2p_device: Start the given P2P device. | ||
1623 | * @stop_p2p_device: Stop the given P2P device. | ||
1621 | */ | 1624 | */ |
1622 | struct cfg80211_ops { | 1625 | struct cfg80211_ops { |
1623 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1626 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
@@ -1625,7 +1628,7 @@ struct cfg80211_ops { | |||
1625 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); | 1628 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); |
1626 | 1629 | ||
1627 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, | 1630 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, |
1628 | char *name, | 1631 | const char *name, |
1629 | enum nl80211_iftype type, | 1632 | enum nl80211_iftype type, |
1630 | u32 *flags, | 1633 | u32 *flags, |
1631 | struct vif_params *params); | 1634 | struct vif_params *params); |
@@ -1834,6 +1837,11 @@ struct cfg80211_ops { | |||
1834 | (*get_channel)(struct wiphy *wiphy, | 1837 | (*get_channel)(struct wiphy *wiphy, |
1835 | struct wireless_dev *wdev, | 1838 | struct wireless_dev *wdev, |
1836 | enum nl80211_channel_type *type); | 1839 | enum nl80211_channel_type *type); |
1840 | |||
1841 | int (*start_p2p_device)(struct wiphy *wiphy, | ||
1842 | struct wireless_dev *wdev); | ||
1843 | void (*stop_p2p_device)(struct wiphy *wiphy, | ||
1844 | struct wireless_dev *wdev); | ||
1837 | }; | 1845 | }; |
1838 | 1846 | ||
1839 | /* | 1847 | /* |
@@ -2397,6 +2405,8 @@ struct cfg80211_cached_keys; | |||
2397 | * @cleanup_work: work struct used for cleanup that can't be done directly | 2405 | * @cleanup_work: work struct used for cleanup that can't be done directly |
2398 | * @beacon_interval: beacon interval used on this device for transmitting | 2406 | * @beacon_interval: beacon interval used on this device for transmitting |
2399 | * beacons, 0 when not valid | 2407 | * beacons, 0 when not valid |
2408 | * @address: The address for this device, valid only if @netdev is %NULL | ||
2409 | * @p2p_started: true if this is a P2P Device that has been started | ||
2400 | */ | 2410 | */ |
2401 | struct wireless_dev { | 2411 | struct wireless_dev { |
2402 | struct wiphy *wiphy; | 2412 | struct wiphy *wiphy; |
@@ -2415,7 +2425,9 @@ struct wireless_dev { | |||
2415 | 2425 | ||
2416 | struct work_struct cleanup_work; | 2426 | struct work_struct cleanup_work; |
2417 | 2427 | ||
2418 | bool use_4addr; | 2428 | bool use_4addr, p2p_started; |
2429 | |||
2430 | u8 address[ETH_ALEN] __aligned(sizeof(u16)); | ||
2419 | 2431 | ||
2420 | /* currently used for IBSS and SME - might be rearranged later */ | 2432 | /* currently used for IBSS and SME - might be rearranged later */ |
2421 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 2433 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
@@ -2445,7 +2457,7 @@ struct wireless_dev { | |||
2445 | 2457 | ||
2446 | int beacon_interval; | 2458 | int beacon_interval; |
2447 | 2459 | ||
2448 | u32 ap_unexpected_nlpid; | 2460 | u32 ap_unexpected_nlportid; |
2449 | 2461 | ||
2450 | #ifdef CONFIG_CFG80211_WEXT | 2462 | #ifdef CONFIG_CFG80211_WEXT |
2451 | /* wext data */ | 2463 | /* wext data */ |
@@ -2463,6 +2475,13 @@ struct wireless_dev { | |||
2463 | #endif | 2475 | #endif |
2464 | }; | 2476 | }; |
2465 | 2477 | ||
2478 | static inline u8 *wdev_address(struct wireless_dev *wdev) | ||
2479 | { | ||
2480 | if (wdev->netdev) | ||
2481 | return wdev->netdev->dev_addr; | ||
2482 | return wdev->address; | ||
2483 | } | ||
2484 | |||
2466 | /** | 2485 | /** |
2467 | * wdev_priv - return wiphy priv from wireless_dev | 2486 | * wdev_priv - return wiphy priv from wireless_dev |
2468 | * | 2487 | * |
@@ -3342,6 +3361,25 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
3342 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | 3361 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); |
3343 | 3362 | ||
3344 | /** | 3363 | /** |
3364 | * cfg80211_conn_failed - connection request failed notification | ||
3365 | * | ||
3366 | * @dev: the netdev | ||
3367 | * @mac_addr: the station's address | ||
3368 | * @reason: the reason for connection failure | ||
3369 | * @gfp: allocation flags | ||
3370 | * | ||
3371 | * Whenever a station tries to connect to an AP and if the station | ||
3372 | * could not connect to the AP as the AP has rejected the connection | ||
3373 | * for some reasons, this function is called. | ||
3374 | * | ||
3375 | * The reason for connection failure can be any of the value from | ||
3376 | * nl80211_connect_failed_reason enum | ||
3377 | */ | ||
3378 | void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | ||
3379 | enum nl80211_connect_failed_reason reason, | ||
3380 | gfp_t gfp); | ||
3381 | |||
3382 | /** | ||
3345 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 3383 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
3346 | * @wdev: wireless device receiving the frame | 3384 | * @wdev: wireless device receiving the frame |
3347 | * @freq: Frequency on which the frame was received in MHz | 3385 | * @freq: Frequency on which the frame was received in MHz |
@@ -3530,6 +3568,22 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | |||
3530 | */ | 3568 | */ |
3531 | u32 cfg80211_calculate_bitrate(struct rate_info *rate); | 3569 | u32 cfg80211_calculate_bitrate(struct rate_info *rate); |
3532 | 3570 | ||
3571 | /** | ||
3572 | * cfg80211_unregister_wdev - remove the given wdev | ||
3573 | * @wdev: struct wireless_dev to remove | ||
3574 | * | ||
3575 | * Call this function only for wdevs that have no netdev assigned, | ||
3576 | * e.g. P2P Devices. It removes the device from the list so that | ||
3577 | * it can no longer be used. It is necessary to call this function | ||
3578 | * even when cfg80211 requests the removal of the interface by | ||
3579 | * calling the del_virtual_intf() callback. The function must also | ||
3580 | * be called when the driver wishes to unregister the wdev, e.g. | ||
3581 | * when the device is unbound from the driver. | ||
3582 | * | ||
3583 | * Requires the RTNL to be held. | ||
3584 | */ | ||
3585 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | ||
3586 | |||
3533 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3587 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3534 | 3588 | ||
3535 | /* wiphy_printk helpers, similar to dev_printk */ | 3589 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/checksum.h b/include/net/checksum.h index ba55d8b8c87c..600d1d705bb8 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
@@ -109,6 +109,9 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to) | |||
109 | struct sk_buff; | 109 | struct sk_buff; |
110 | extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, | 110 | extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, |
111 | __be32 from, __be32 to, int pseudohdr); | 111 | __be32 from, __be32 to, int pseudohdr); |
112 | extern void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, | ||
113 | const __be32 *from, const __be32 *to, | ||
114 | int pseudohdr); | ||
112 | 115 | ||
113 | static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, | 116 | static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, |
114 | __be16 from, __be16 to, | 117 | __be16 from, __be16 to, |
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index a4dc5b027bd9..b6a6eeb3905f 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
@@ -17,14 +17,16 @@ | |||
17 | #include <linux/hardirq.h> | 17 | #include <linux/hardirq.h> |
18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
19 | 19 | ||
20 | #ifdef CONFIG_CGROUPS | 20 | #if IS_ENABLED(CONFIG_NET_CLS_CGROUP) |
21 | struct cgroup_cls_state | 21 | struct cgroup_cls_state |
22 | { | 22 | { |
23 | struct cgroup_subsys_state css; | 23 | struct cgroup_subsys_state css; |
24 | u32 classid; | 24 | u32 classid; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #ifdef CONFIG_NET_CLS_CGROUP | 27 | extern void sock_update_classid(struct sock *sk); |
28 | |||
29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) | ||
28 | static inline u32 task_cls_classid(struct task_struct *p) | 30 | static inline u32 task_cls_classid(struct task_struct *p) |
29 | { | 31 | { |
30 | int classid; | 32 | int classid; |
@@ -39,32 +41,33 @@ static inline u32 task_cls_classid(struct task_struct *p) | |||
39 | 41 | ||
40 | return classid; | 42 | return classid; |
41 | } | 43 | } |
42 | #else | 44 | #elif IS_MODULE(CONFIG_NET_CLS_CGROUP) |
43 | extern int net_cls_subsys_id; | ||
44 | |||
45 | static inline u32 task_cls_classid(struct task_struct *p) | 45 | static inline u32 task_cls_classid(struct task_struct *p) |
46 | { | 46 | { |
47 | int id; | 47 | struct cgroup_subsys_state *css; |
48 | u32 classid = 0; | 48 | u32 classid = 0; |
49 | 49 | ||
50 | if (in_interrupt()) | 50 | if (in_interrupt()) |
51 | return 0; | 51 | return 0; |
52 | 52 | ||
53 | rcu_read_lock(); | 53 | rcu_read_lock(); |
54 | id = rcu_dereference_index_check(net_cls_subsys_id, | 54 | css = task_subsys_state(p, net_cls_subsys_id); |
55 | rcu_read_lock_held()); | 55 | if (css) |
56 | if (id >= 0) | 56 | classid = container_of(css, |
57 | classid = container_of(task_subsys_state(p, id), | ||
58 | struct cgroup_cls_state, css)->classid; | 57 | struct cgroup_cls_state, css)->classid; |
59 | rcu_read_unlock(); | 58 | rcu_read_unlock(); |
60 | 59 | ||
61 | return classid; | 60 | return classid; |
62 | } | 61 | } |
63 | #endif | 62 | #endif |
64 | #else | 63 | #else /* !CGROUP_NET_CLS_CGROUP */ |
64 | static inline void sock_update_classid(struct sock *sk) | ||
65 | { | ||
66 | } | ||
67 | |||
65 | static inline u32 task_cls_classid(struct task_struct *p) | 68 | static inline u32 task_cls_classid(struct task_struct *p) |
66 | { | 69 | { |
67 | return 0; | 70 | return 0; |
68 | } | 71 | } |
69 | #endif | 72 | #endif /* CGROUP_NET_CLS_CGROUP */ |
70 | #endif /* _NET_CLS_CGROUP_H */ | 73 | #endif /* _NET_CLS_CGROUP_H */ |
diff --git a/include/net/dst.h b/include/net/dst.h index 621e3513ef5e..9a7881066fb3 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -396,11 +396,15 @@ static inline void dst_confirm(struct dst_entry *dst) | |||
396 | static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, | 396 | static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, |
397 | struct sk_buff *skb) | 397 | struct sk_buff *skb) |
398 | { | 398 | { |
399 | struct hh_cache *hh; | 399 | const struct hh_cache *hh; |
400 | |||
401 | if (dst->pending_confirm) { | ||
402 | unsigned long now = jiffies; | ||
400 | 403 | ||
401 | if (unlikely(dst->pending_confirm)) { | ||
402 | n->confirmed = jiffies; | ||
403 | dst->pending_confirm = 0; | 404 | dst->pending_confirm = 0; |
405 | /* avoid dirtying neighbour */ | ||
406 | if (n->confirmed != now) | ||
407 | n->confirmed = now; | ||
404 | } | 408 | } |
405 | 409 | ||
406 | hh = &n->hh; | 410 | hh = &n->hh; |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 48905cd3884c..bdfbe68c1c3b 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -65,7 +65,7 @@ struct genl_family { | |||
65 | /** | 65 | /** |
66 | * struct genl_info - receiving information | 66 | * struct genl_info - receiving information |
67 | * @snd_seq: sending sequence number | 67 | * @snd_seq: sending sequence number |
68 | * @snd_pid: netlink pid of sender | 68 | * @snd_portid: netlink portid of sender |
69 | * @nlhdr: netlink message header | 69 | * @nlhdr: netlink message header |
70 | * @genlhdr: generic netlink message header | 70 | * @genlhdr: generic netlink message header |
71 | * @userhdr: user specific header | 71 | * @userhdr: user specific header |
@@ -75,7 +75,7 @@ struct genl_family { | |||
75 | */ | 75 | */ |
76 | struct genl_info { | 76 | struct genl_info { |
77 | u32 snd_seq; | 77 | u32 snd_seq; |
78 | u32 snd_pid; | 78 | u32 snd_portid; |
79 | struct nlmsghdr * nlhdr; | 79 | struct nlmsghdr * nlhdr; |
80 | struct genlmsghdr * genlhdr; | 80 | struct genlmsghdr * genlhdr; |
81 | void * userhdr; | 81 | void * userhdr; |
@@ -130,10 +130,10 @@ extern int genl_register_mc_group(struct genl_family *family, | |||
130 | struct genl_multicast_group *grp); | 130 | struct genl_multicast_group *grp); |
131 | extern void genl_unregister_mc_group(struct genl_family *family, | 131 | extern void genl_unregister_mc_group(struct genl_family *family, |
132 | struct genl_multicast_group *grp); | 132 | struct genl_multicast_group *grp); |
133 | extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, | 133 | extern void genl_notify(struct sk_buff *skb, struct net *net, u32 portid, |
134 | u32 group, struct nlmsghdr *nlh, gfp_t flags); | 134 | u32 group, struct nlmsghdr *nlh, gfp_t flags); |
135 | 135 | ||
136 | void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, | 136 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, |
137 | struct genl_family *family, int flags, u8 cmd); | 137 | struct genl_family *family, int flags, u8 cmd); |
138 | 138 | ||
139 | /** | 139 | /** |
@@ -183,7 +183,7 @@ static inline void *genlmsg_put_reply(struct sk_buff *skb, | |||
183 | struct genl_family *family, | 183 | struct genl_family *family, |
184 | int flags, u8 cmd) | 184 | int flags, u8 cmd) |
185 | { | 185 | { |
186 | return genlmsg_put(skb, info->snd_pid, info->snd_seq, family, | 186 | return genlmsg_put(skb, info->snd_portid, info->snd_seq, family, |
187 | flags, cmd); | 187 | flags, cmd); |
188 | } | 188 | } |
189 | 189 | ||
@@ -212,49 +212,49 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | |||
212 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns | 212 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns |
213 | * @net: the net namespace | 213 | * @net: the net namespace |
214 | * @skb: netlink message as socket buffer | 214 | * @skb: netlink message as socket buffer |
215 | * @pid: own netlink pid to avoid sending to yourself | 215 | * @portid: own netlink portid to avoid sending to yourself |
216 | * @group: multicast group id | 216 | * @group: multicast group id |
217 | * @flags: allocation flags | 217 | * @flags: allocation flags |
218 | */ | 218 | */ |
219 | static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb, | 219 | static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb, |
220 | u32 pid, unsigned int group, gfp_t flags) | 220 | u32 portid, unsigned int group, gfp_t flags) |
221 | { | 221 | { |
222 | return nlmsg_multicast(net->genl_sock, skb, pid, group, flags); | 222 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); |
223 | } | 223 | } |
224 | 224 | ||
225 | /** | 225 | /** |
226 | * genlmsg_multicast - multicast a netlink message to the default netns | 226 | * genlmsg_multicast - multicast a netlink message to the default netns |
227 | * @skb: netlink message as socket buffer | 227 | * @skb: netlink message as socket buffer |
228 | * @pid: own netlink pid to avoid sending to yourself | 228 | * @portid: own netlink portid to avoid sending to yourself |
229 | * @group: multicast group id | 229 | * @group: multicast group id |
230 | * @flags: allocation flags | 230 | * @flags: allocation flags |
231 | */ | 231 | */ |
232 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, | 232 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 portid, |
233 | unsigned int group, gfp_t flags) | 233 | unsigned int group, gfp_t flags) |
234 | { | 234 | { |
235 | return genlmsg_multicast_netns(&init_net, skb, pid, group, flags); | 235 | return genlmsg_multicast_netns(&init_net, skb, portid, group, flags); |
236 | } | 236 | } |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces | 239 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces |
240 | * @skb: netlink message as socket buffer | 240 | * @skb: netlink message as socket buffer |
241 | * @pid: own netlink pid to avoid sending to yourself | 241 | * @portid: own netlink portid to avoid sending to yourself |
242 | * @group: multicast group id | 242 | * @group: multicast group id |
243 | * @flags: allocation flags | 243 | * @flags: allocation flags |
244 | * | 244 | * |
245 | * This function must hold the RTNL or rcu_read_lock(). | 245 | * This function must hold the RTNL or rcu_read_lock(). |
246 | */ | 246 | */ |
247 | int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid, | 247 | int genlmsg_multicast_allns(struct sk_buff *skb, u32 portid, |
248 | unsigned int group, gfp_t flags); | 248 | unsigned int group, gfp_t flags); |
249 | 249 | ||
250 | /** | 250 | /** |
251 | * genlmsg_unicast - unicast a netlink message | 251 | * genlmsg_unicast - unicast a netlink message |
252 | * @skb: netlink message as socket buffer | 252 | * @skb: netlink message as socket buffer |
253 | * @pid: netlink pid of the destination socket | 253 | * @portid: netlink portid of the destination socket |
254 | */ | 254 | */ |
255 | static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid) | 255 | static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 portid) |
256 | { | 256 | { |
257 | return nlmsg_unicast(net->genl_sock, skb, pid); | 257 | return nlmsg_unicast(net->genl_sock, skb, portid); |
258 | } | 258 | } |
259 | 259 | ||
260 | /** | 260 | /** |
@@ -264,7 +264,7 @@ static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid) | |||
264 | */ | 264 | */ |
265 | static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) | 265 | static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) |
266 | { | 266 | { |
267 | return genlmsg_unicast(genl_info_net(info), skb, info->snd_pid); | 267 | return genlmsg_unicast(genl_info_net(info), skb, info->snd_portid); |
268 | } | 268 | } |
269 | 269 | ||
270 | /** | 270 | /** |
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h new file mode 100644 index 000000000000..4fd8a4b4b7ee --- /dev/null +++ b/include/net/gro_cells.h | |||
@@ -0,0 +1,103 @@ | |||
1 | #ifndef _NET_GRO_CELLS_H | ||
2 | #define _NET_GRO_CELLS_H | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/slab.h> | ||
6 | #include <linux/netdevice.h> | ||
7 | |||
8 | struct gro_cell { | ||
9 | struct sk_buff_head napi_skbs; | ||
10 | struct napi_struct napi; | ||
11 | } ____cacheline_aligned_in_smp; | ||
12 | |||
13 | struct gro_cells { | ||
14 | unsigned int gro_cells_mask; | ||
15 | struct gro_cell *cells; | ||
16 | }; | ||
17 | |||
18 | static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) | ||
19 | { | ||
20 | unsigned long flags; | ||
21 | struct gro_cell *cell = gcells->cells; | ||
22 | struct net_device *dev = skb->dev; | ||
23 | |||
24 | if (!cell || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { | ||
25 | netif_rx(skb); | ||
26 | return; | ||
27 | } | ||
28 | |||
29 | if (skb_rx_queue_recorded(skb)) | ||
30 | cell += skb_get_rx_queue(skb) & gcells->gro_cells_mask; | ||
31 | |||
32 | if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { | ||
33 | atomic_long_inc(&dev->rx_dropped); | ||
34 | kfree_skb(skb); | ||
35 | return; | ||
36 | } | ||
37 | |||
38 | spin_lock_irqsave(&cell->napi_skbs.lock, flags); | ||
39 | |||
40 | __skb_queue_tail(&cell->napi_skbs, skb); | ||
41 | if (skb_queue_len(&cell->napi_skbs) == 1) | ||
42 | napi_schedule(&cell->napi); | ||
43 | |||
44 | spin_unlock_irqrestore(&cell->napi_skbs.lock, flags); | ||
45 | } | ||
46 | |||
47 | static inline int gro_cell_poll(struct napi_struct *napi, int budget) | ||
48 | { | ||
49 | struct gro_cell *cell = container_of(napi, struct gro_cell, napi); | ||
50 | struct sk_buff *skb; | ||
51 | int work_done = 0; | ||
52 | |||
53 | while (work_done < budget) { | ||
54 | skb = skb_dequeue(&cell->napi_skbs); | ||
55 | if (!skb) | ||
56 | break; | ||
57 | |||
58 | napi_gro_receive(napi, skb); | ||
59 | work_done++; | ||
60 | } | ||
61 | |||
62 | if (work_done < budget) | ||
63 | napi_complete(napi); | ||
64 | return work_done; | ||
65 | } | ||
66 | |||
67 | static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *dev) | ||
68 | { | ||
69 | int i; | ||
70 | |||
71 | gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; | ||
72 | gcells->cells = kcalloc(sizeof(struct gro_cell), | ||
73 | gcells->gro_cells_mask + 1, | ||
74 | GFP_KERNEL); | ||
75 | if (!gcells->cells) | ||
76 | return -ENOMEM; | ||
77 | |||
78 | for (i = 0; i <= gcells->gro_cells_mask; i++) { | ||
79 | struct gro_cell *cell = gcells->cells + i; | ||
80 | |||
81 | skb_queue_head_init(&cell->napi_skbs); | ||
82 | netif_napi_add(dev, &cell->napi, gro_cell_poll, 64); | ||
83 | napi_enable(&cell->napi); | ||
84 | } | ||
85 | return 0; | ||
86 | } | ||
87 | |||
88 | static inline void gro_cells_destroy(struct gro_cells *gcells) | ||
89 | { | ||
90 | struct gro_cell *cell = gcells->cells; | ||
91 | int i; | ||
92 | |||
93 | if (!cell) | ||
94 | return; | ||
95 | for (i = 0; i <= gcells->gro_cells_mask; i++,cell++) { | ||
96 | netif_napi_del(&cell->napi); | ||
97 | skb_queue_purge(&cell->napi_skbs); | ||
98 | } | ||
99 | kfree(gcells->cells); | ||
100 | gcells->cells = NULL; | ||
101 | } | ||
102 | |||
103 | #endif | ||
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 71392545d0a1..7f0df133d119 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
@@ -183,6 +183,9 @@ struct ieee80211_radiotap_header { | |||
183 | * Contains a bitmap of known fields/flags, the flags, and | 183 | * Contains a bitmap of known fields/flags, the flags, and |
184 | * the MCS index. | 184 | * the MCS index. |
185 | * | 185 | * |
186 | * IEEE80211_RADIOTAP_AMPDU_STATUS u32, u16, u8, u8 unitless | ||
187 | * | ||
188 | * Contains the AMPDU information for the subframe. | ||
186 | */ | 189 | */ |
187 | enum ieee80211_radiotap_type { | 190 | enum ieee80211_radiotap_type { |
188 | IEEE80211_RADIOTAP_TSFT = 0, | 191 | IEEE80211_RADIOTAP_TSFT = 0, |
@@ -205,6 +208,7 @@ enum ieee80211_radiotap_type { | |||
205 | IEEE80211_RADIOTAP_DATA_RETRIES = 17, | 208 | IEEE80211_RADIOTAP_DATA_RETRIES = 17, |
206 | 209 | ||
207 | IEEE80211_RADIOTAP_MCS = 19, | 210 | IEEE80211_RADIOTAP_MCS = 19, |
211 | IEEE80211_RADIOTAP_AMPDU_STATUS = 20, | ||
208 | 212 | ||
209 | /* valid in every it_present bitmap, even vendor namespaces */ | 213 | /* valid in every it_present bitmap, even vendor namespaces */ |
210 | IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, | 214 | IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, |
@@ -270,6 +274,13 @@ enum ieee80211_radiotap_type { | |||
270 | #define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08 | 274 | #define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08 |
271 | #define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10 | 275 | #define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10 |
272 | 276 | ||
277 | /* For IEEE80211_RADIOTAP_AMPDU_STATUS */ | ||
278 | #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN 0x0001 | ||
279 | #define IEEE80211_RADIOTAP_AMPDU_IS_ZEROLEN 0x0002 | ||
280 | #define IEEE80211_RADIOTAP_AMPDU_LAST_KNOWN 0x0004 | ||
281 | #define IEEE80211_RADIOTAP_AMPDU_IS_LAST 0x0008 | ||
282 | #define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR 0x0010 | ||
283 | #define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN 0x0020 | ||
273 | 284 | ||
274 | /* helpers */ | 285 | /* helpers */ |
275 | static inline int ieee80211_get_radiotap_len(unsigned char *data) | 286 | static inline int ieee80211_get_radiotap_len(unsigned char *data) |
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index 2fa14691869c..aab73757bc4d 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -15,6 +15,8 @@ enum { | |||
15 | INET_ECN_MASK = 3, | 15 | INET_ECN_MASK = 3, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | extern int sysctl_tunnel_ecn_log; | ||
19 | |||
18 | static inline int INET_ECN_is_ce(__u8 dsfield) | 20 | static inline int INET_ECN_is_ce(__u8 dsfield) |
19 | { | 21 | { |
20 | return (dsfield & INET_ECN_MASK) == INET_ECN_CE; | 22 | return (dsfield & INET_ECN_MASK) == INET_ECN_CE; |
@@ -145,4 +147,78 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb) | |||
145 | return 0; | 147 | return 0; |
146 | } | 148 | } |
147 | 149 | ||
150 | /* | ||
151 | * RFC 6080 4.2 | ||
152 | * To decapsulate the inner header at the tunnel egress, a compliant | ||
153 | * tunnel egress MUST set the outgoing ECN field to the codepoint at the | ||
154 | * intersection of the appropriate arriving inner header (row) and outer | ||
155 | * header (column) in Figure 4 | ||
156 | * | ||
157 | * +---------+------------------------------------------------+ | ||
158 | * |Arriving | Arriving Outer Header | | ||
159 | * | Inner +---------+------------+------------+------------+ | ||
160 | * | Header | Not-ECT | ECT(0) | ECT(1) | CE | | ||
161 | * +---------+---------+------------+------------+------------+ | ||
162 | * | Not-ECT | Not-ECT |Not-ECT(!!!)|Not-ECT(!!!)| <drop>(!!!)| | ||
163 | * | ECT(0) | ECT(0) | ECT(0) | ECT(1) | CE | | ||
164 | * | ECT(1) | ECT(1) | ECT(1) (!) | ECT(1) | CE | | ||
165 | * | CE | CE | CE | CE(!!!)| CE | | ||
166 | * +---------+---------+------------+------------+------------+ | ||
167 | * | ||
168 | * Figure 4: New IP in IP Decapsulation Behaviour | ||
169 | * | ||
170 | * returns 0 on success | ||
171 | * 1 if something is broken and should be logged (!!! above) | ||
172 | * 2 if packet should be dropped | ||
173 | */ | ||
174 | static inline int INET_ECN_decapsulate(struct sk_buff *skb, | ||
175 | __u8 outer, __u8 inner) | ||
176 | { | ||
177 | if (INET_ECN_is_not_ect(inner)) { | ||
178 | switch (outer & INET_ECN_MASK) { | ||
179 | case INET_ECN_NOT_ECT: | ||
180 | return 0; | ||
181 | case INET_ECN_ECT_0: | ||
182 | case INET_ECN_ECT_1: | ||
183 | return 1; | ||
184 | case INET_ECN_CE: | ||
185 | return 2; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | if (INET_ECN_is_ce(outer)) | ||
190 | INET_ECN_set_ce(skb); | ||
191 | |||
192 | return 0; | ||
193 | } | ||
194 | |||
195 | static inline int IP_ECN_decapsulate(const struct iphdr *oiph, | ||
196 | struct sk_buff *skb) | ||
197 | { | ||
198 | __u8 inner; | ||
199 | |||
200 | if (skb->protocol == htons(ETH_P_IP)) | ||
201 | inner = ip_hdr(skb)->tos; | ||
202 | else if (skb->protocol == htons(ETH_P_IPV6)) | ||
203 | inner = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
204 | else | ||
205 | return 0; | ||
206 | |||
207 | return INET_ECN_decapsulate(skb, oiph->tos, inner); | ||
208 | } | ||
209 | |||
210 | static inline int IP6_ECN_decapsulate(const struct ipv6hdr *oipv6h, | ||
211 | struct sk_buff *skb) | ||
212 | { | ||
213 | __u8 inner; | ||
214 | |||
215 | if (skb->protocol == htons(ETH_P_IP)) | ||
216 | inner = ip_hdr(skb)->tos; | ||
217 | else if (skb->protocol == htons(ETH_P_IPV6)) | ||
218 | inner = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
219 | else | ||
220 | return 0; | ||
221 | |||
222 | return INET_ECN_decapsulate(skb, ipv6_get_dsfield(oipv6h), inner); | ||
223 | } | ||
148 | #endif | 224 | #endif |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 2431cf83aeca..32786a044718 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -29,6 +29,8 @@ struct inet_frag_queue { | |||
29 | #define INET_FRAG_COMPLETE 4 | 29 | #define INET_FRAG_COMPLETE 4 |
30 | #define INET_FRAG_FIRST_IN 2 | 30 | #define INET_FRAG_FIRST_IN 2 |
31 | #define INET_FRAG_LAST_IN 1 | 31 | #define INET_FRAG_LAST_IN 1 |
32 | |||
33 | u16 max_size; | ||
32 | }; | 34 | }; |
33 | 35 | ||
34 | #define INETFRAGS_HASHSZ 64 | 36 | #define INETFRAGS_HASHSZ 64 |
@@ -59,7 +61,7 @@ void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); | |||
59 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 61 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); |
60 | void inet_frag_destroy(struct inet_frag_queue *q, | 62 | void inet_frag_destroy(struct inet_frag_queue *q, |
61 | struct inet_frags *f, int *work); | 63 | struct inet_frags *f, int *work); |
62 | int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f); | 64 | int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force); |
63 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 65 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
64 | struct inet_frags *f, void *key, unsigned int hash) | 66 | struct inet_frags *f, void *key, unsigned int hash) |
65 | __releases(&f->lock); | 67 | __releases(&f->lock); |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 613cfa401672..256c1ed2d69a 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -101,10 +101,8 @@ struct inet_cork { | |||
101 | __be32 addr; | 101 | __be32 addr; |
102 | struct ip_options *opt; | 102 | struct ip_options *opt; |
103 | unsigned int fragsize; | 103 | unsigned int fragsize; |
104 | struct dst_entry *dst; | ||
105 | int length; /* Total length of all frames */ | 104 | int length; /* Total length of all frames */ |
106 | struct page *page; | 105 | struct dst_entry *dst; |
107 | u32 off; | ||
108 | u8 tx_flags; | 106 | u8 tx_flags; |
109 | }; | 107 | }; |
110 | 108 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 5a5d84d3d2c6..0707fb9551aa 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -42,6 +42,8 @@ struct inet_skb_parm { | |||
42 | #define IPSKB_XFRM_TRANSFORMED 4 | 42 | #define IPSKB_XFRM_TRANSFORMED 4 |
43 | #define IPSKB_FRAG_COMPLETE 8 | 43 | #define IPSKB_FRAG_COMPLETE 8 |
44 | #define IPSKB_REROUTED 16 | 44 | #define IPSKB_REROUTED 16 |
45 | |||
46 | u16 frag_max_size; | ||
45 | }; | 47 | }; |
46 | 48 | ||
47 | static inline unsigned int ip_hdrlen(const struct sk_buff *skb) | 49 | static inline unsigned int ip_hdrlen(const struct sk_buff *skb) |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 9fc7114159e8..8a2a203eb15d 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -37,6 +37,7 @@ struct fib6_config { | |||
37 | int fc_ifindex; | 37 | int fc_ifindex; |
38 | u32 fc_flags; | 38 | u32 fc_flags; |
39 | u32 fc_protocol; | 39 | u32 fc_protocol; |
40 | u32 fc_type; /* only 8 bits are used */ | ||
40 | 41 | ||
41 | struct in6_addr fc_dst; | 42 | struct in6_addr fc_dst; |
42 | struct in6_addr fc_src; | 43 | struct in6_addr fc_src; |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 358fb86f57eb..e03047f7090b 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -5,6 +5,8 @@ | |||
5 | #include <linux/netdevice.h> | 5 | #include <linux/netdevice.h> |
6 | #include <linux/ip6_tunnel.h> | 6 | #include <linux/ip6_tunnel.h> |
7 | 7 | ||
8 | #define IP6TUNNEL_ERR_TIMEO (30*HZ) | ||
9 | |||
8 | /* capable of sending packets */ | 10 | /* capable of sending packets */ |
9 | #define IP6_TNL_F_CAP_XMIT 0x10000 | 11 | #define IP6_TNL_F_CAP_XMIT 0x10000 |
10 | /* capable of receiving packets */ | 12 | /* capable of receiving packets */ |
@@ -12,15 +14,40 @@ | |||
12 | /* determine capability on a per-packet basis */ | 14 | /* determine capability on a per-packet basis */ |
13 | #define IP6_TNL_F_CAP_PER_PACKET 0x40000 | 15 | #define IP6_TNL_F_CAP_PER_PACKET 0x40000 |
14 | 16 | ||
15 | /* IPv6 tunnel */ | 17 | struct __ip6_tnl_parm { |
18 | char name[IFNAMSIZ]; /* name of tunnel device */ | ||
19 | int link; /* ifindex of underlying L2 interface */ | ||
20 | __u8 proto; /* tunnel protocol */ | ||
21 | __u8 encap_limit; /* encapsulation limit for tunnel */ | ||
22 | __u8 hop_limit; /* hop limit for tunnel */ | ||
23 | __be32 flowinfo; /* traffic class and flowlabel for tunnel */ | ||
24 | __u32 flags; /* tunnel flags */ | ||
25 | struct in6_addr laddr; /* local tunnel end-point address */ | ||
26 | struct in6_addr raddr; /* remote tunnel end-point address */ | ||
27 | |||
28 | __be16 i_flags; | ||
29 | __be16 o_flags; | ||
30 | __be32 i_key; | ||
31 | __be32 o_key; | ||
32 | }; | ||
16 | 33 | ||
34 | /* IPv6 tunnel */ | ||
17 | struct ip6_tnl { | 35 | struct ip6_tnl { |
18 | struct ip6_tnl __rcu *next; /* next tunnel in list */ | 36 | struct ip6_tnl __rcu *next; /* next tunnel in list */ |
19 | struct net_device *dev; /* virtual device associated with tunnel */ | 37 | struct net_device *dev; /* virtual device associated with tunnel */ |
20 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ | 38 | struct __ip6_tnl_parm parms; /* tunnel configuration parameters */ |
21 | struct flowi fl; /* flowi template for xmit */ | 39 | struct flowi fl; /* flowi template for xmit */ |
22 | struct dst_entry *dst_cache; /* cached dst */ | 40 | struct dst_entry *dst_cache; /* cached dst */ |
23 | u32 dst_cookie; | 41 | u32 dst_cookie; |
42 | |||
43 | int err_count; | ||
44 | unsigned long err_time; | ||
45 | |||
46 | /* These fields used only by GRE */ | ||
47 | __u32 i_seqno; /* The last seen seqno */ | ||
48 | __u32 o_seqno; /* The last output seqno */ | ||
49 | int hlen; /* Precalculated GRE header length */ | ||
50 | int mlink; | ||
24 | }; | 51 | }; |
25 | 52 | ||
26 | /* Tunnel encapsulation limit destination sub-option */ | 53 | /* Tunnel encapsulation limit destination sub-option */ |
@@ -31,4 +58,14 @@ struct ipv6_tlv_tnl_enc_lim { | |||
31 | __u8 encap_limit; /* tunnel encapsulation limit */ | 58 | __u8 encap_limit; /* tunnel encapsulation limit */ |
32 | } __packed; | 59 | } __packed; |
33 | 60 | ||
61 | struct dst_entry *ip6_tnl_dst_check(struct ip6_tnl *t); | ||
62 | void ip6_tnl_dst_reset(struct ip6_tnl *t); | ||
63 | void ip6_tnl_dst_store(struct ip6_tnl *t, struct dst_entry *dst); | ||
64 | int ip6_tnl_rcv_ctl(struct ip6_tnl *t, const struct in6_addr *laddr, | ||
65 | const struct in6_addr *raddr); | ||
66 | int ip6_tnl_xmit_ctl(struct ip6_tnl *t); | ||
67 | __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw); | ||
68 | __u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, | ||
69 | const struct in6_addr *raddr); | ||
70 | |||
34 | #endif | 71 | #endif |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 95374d1696a1..ee75ccdf5188 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -808,8 +808,6 @@ struct netns_ipvs { | |||
808 | struct list_head rs_table[IP_VS_RTAB_SIZE]; | 808 | struct list_head rs_table[IP_VS_RTAB_SIZE]; |
809 | /* ip_vs_app */ | 809 | /* ip_vs_app */ |
810 | struct list_head app_list; | 810 | struct list_head app_list; |
811 | /* ip_vs_ftp */ | ||
812 | struct ip_vs_app *ftp_app; | ||
813 | /* ip_vs_proto */ | 811 | /* ip_vs_proto */ |
814 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ | 812 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ |
815 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; | 813 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; |
@@ -890,6 +888,7 @@ struct netns_ipvs { | |||
890 | unsigned int sysctl_sync_refresh_period; | 888 | unsigned int sysctl_sync_refresh_period; |
891 | int sysctl_sync_retries; | 889 | int sysctl_sync_retries; |
892 | int sysctl_nat_icmp_send; | 890 | int sysctl_nat_icmp_send; |
891 | int sysctl_pmtu_disc; | ||
893 | 892 | ||
894 | /* ip_vs_lblc */ | 893 | /* ip_vs_lblc */ |
895 | int sysctl_lblc_expiration; | 894 | int sysctl_lblc_expiration; |
@@ -976,6 +975,11 @@ static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | |||
976 | return ipvs->sysctl_sync_sock_size; | 975 | return ipvs->sysctl_sync_sock_size; |
977 | } | 976 | } |
978 | 977 | ||
978 | static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | ||
979 | { | ||
980 | return ipvs->sysctl_pmtu_disc; | ||
981 | } | ||
982 | |||
979 | #else | 983 | #else |
980 | 984 | ||
981 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 985 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
@@ -1018,6 +1022,11 @@ static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | |||
1018 | return 0; | 1022 | return 0; |
1019 | } | 1023 | } |
1020 | 1024 | ||
1025 | static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | ||
1026 | { | ||
1027 | return 1; | ||
1028 | } | ||
1029 | |||
1021 | #endif | 1030 | #endif |
1022 | 1031 | ||
1023 | /* | 1032 | /* |
@@ -1179,7 +1188,8 @@ extern void ip_vs_service_net_cleanup(struct net *net); | |||
1179 | * (from ip_vs_app.c) | 1188 | * (from ip_vs_app.c) |
1180 | */ | 1189 | */ |
1181 | #define IP_VS_APP_MAX_PORTS 8 | 1190 | #define IP_VS_APP_MAX_PORTS 8 |
1182 | extern int register_ip_vs_app(struct net *net, struct ip_vs_app *app); | 1191 | extern struct ip_vs_app *register_ip_vs_app(struct net *net, |
1192 | struct ip_vs_app *app); | ||
1183 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); | 1193 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); |
1184 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1194 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
1185 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); | 1195 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); |
diff --git a/include/net/ipip.h b/include/net/ipip.h index a93cf6d7e94b..ddc077c51f32 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __NET_IPIP_H 1 | 2 | #define __NET_IPIP_H 1 |
3 | 3 | ||
4 | #include <linux/if_tunnel.h> | 4 | #include <linux/if_tunnel.h> |
5 | #include <net/gro_cells.h> | ||
5 | #include <net/ip.h> | 6 | #include <net/ip.h> |
6 | 7 | ||
7 | /* Keep error state on tunnel for 30 sec */ | 8 | /* Keep error state on tunnel for 30 sec */ |
@@ -36,6 +37,8 @@ struct ip_tunnel { | |||
36 | #endif | 37 | #endif |
37 | struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */ | 38 | struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */ |
38 | unsigned int prl_count; /* # of entries in PRL */ | 39 | unsigned int prl_count; /* # of entries in PRL */ |
40 | |||
41 | struct gro_cells gro_cells; | ||
39 | }; | 42 | }; |
40 | 43 | ||
41 | struct ip_tunnel_prl_entry { | 44 | struct ip_tunnel_prl_entry { |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 01c34b363a34..979bf6c13141 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */ | 34 | #define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */ |
35 | #define NEXTHDR_ROUTING 43 /* Routing header. */ | 35 | #define NEXTHDR_ROUTING 43 /* Routing header. */ |
36 | #define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */ | 36 | #define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */ |
37 | #define NEXTHDR_GRE 47 /* GRE header. */ | ||
37 | #define NEXTHDR_ESP 50 /* Encapsulating security payload. */ | 38 | #define NEXTHDR_ESP 50 /* Encapsulating security payload. */ |
38 | #define NEXTHDR_AUTH 51 /* Authentication header. */ | 39 | #define NEXTHDR_AUTH 51 /* Authentication header. */ |
39 | #define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ | 40 | #define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ |
@@ -222,7 +223,10 @@ struct ip6_flowlabel { | |||
222 | struct ipv6_txoptions *opt; | 223 | struct ipv6_txoptions *opt; |
223 | unsigned long linger; | 224 | unsigned long linger; |
224 | u8 share; | 225 | u8 share; |
225 | u32 owner; | 226 | union { |
227 | struct pid *pid; | ||
228 | kuid_t uid; | ||
229 | } owner; | ||
226 | unsigned long lastuse; | 230 | unsigned long lastuse; |
227 | unsigned long expires; | 231 | unsigned long expires; |
228 | struct net *fl_net; | 232 | struct net *fl_net; |
@@ -267,8 +271,17 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, | |||
267 | 271 | ||
268 | extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); | 272 | extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); |
269 | 273 | ||
270 | int ip6_frag_nqueues(struct net *net); | 274 | #if IS_ENABLED(CONFIG_IPV6) |
271 | int ip6_frag_mem(struct net *net); | 275 | static inline int ip6_frag_nqueues(struct net *net) |
276 | { | ||
277 | return net->ipv6.frags.nqueues; | ||
278 | } | ||
279 | |||
280 | static inline int ip6_frag_mem(struct net *net) | ||
281 | { | ||
282 | return atomic_read(&net->ipv6.frags.mem); | ||
283 | } | ||
284 | #endif | ||
272 | 285 | ||
273 | #define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */ | 286 | #define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */ |
274 | #define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */ | 287 | #define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */ |
@@ -407,6 +420,25 @@ struct ip6_create_arg { | |||
407 | void ip6_frag_init(struct inet_frag_queue *q, void *a); | 420 | void ip6_frag_init(struct inet_frag_queue *q, void *a); |
408 | bool ip6_frag_match(struct inet_frag_queue *q, void *a); | 421 | bool ip6_frag_match(struct inet_frag_queue *q, void *a); |
409 | 422 | ||
423 | /* | ||
424 | * Equivalent of ipv4 struct ip | ||
425 | */ | ||
426 | struct frag_queue { | ||
427 | struct inet_frag_queue q; | ||
428 | |||
429 | __be32 id; /* fragment id */ | ||
430 | u32 user; | ||
431 | struct in6_addr saddr; | ||
432 | struct in6_addr daddr; | ||
433 | |||
434 | int iif; | ||
435 | unsigned int csum; | ||
436 | __u16 nhoffset; | ||
437 | }; | ||
438 | |||
439 | void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq, | ||
440 | struct inet_frags *frags); | ||
441 | |||
410 | static inline bool ipv6_addr_any(const struct in6_addr *a) | 442 | static inline bool ipv6_addr_any(const struct in6_addr *a) |
411 | { | 443 | { |
412 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | 444 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 59ba38bc400f..80ffde3bb164 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
@@ -52,21 +52,16 @@ | |||
52 | /* Same for payload size. See qos.c for the smallest max data size */ | 52 | /* Same for payload size. See qos.c for the smallest max data size */ |
53 | #define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED) | 53 | #define IRCOMM_TTY_DATA_UNINITIALISED (64 - IRCOMM_TTY_HDR_UNINITIALISED) |
54 | 54 | ||
55 | /* Those are really defined in include/linux/serial.h - Jean II */ | ||
56 | #define ASYNC_B_INITIALIZED 31 /* Serial port was initialized */ | ||
57 | #define ASYNC_B_NORMAL_ACTIVE 29 /* Normal device is active */ | ||
58 | #define ASYNC_B_CLOSING 27 /* Serial port is closing */ | ||
59 | |||
60 | /* | 55 | /* |
61 | * IrCOMM TTY driver state | 56 | * IrCOMM TTY driver state |
62 | */ | 57 | */ |
63 | struct ircomm_tty_cb { | 58 | struct ircomm_tty_cb { |
64 | irda_queue_t queue; /* Must be first */ | 59 | irda_queue_t queue; /* Must be first */ |
60 | struct tty_port port; | ||
65 | magic_t magic; | 61 | magic_t magic; |
66 | 62 | ||
67 | int state; /* Connect state */ | 63 | int state; /* Connect state */ |
68 | 64 | ||
69 | struct tty_struct *tty; | ||
70 | struct ircomm_cb *ircomm; /* IrCOMM layer instance */ | 65 | struct ircomm_cb *ircomm; /* IrCOMM layer instance */ |
71 | 66 | ||
72 | struct sk_buff *tx_skb; /* Transmit buffer */ | 67 | struct sk_buff *tx_skb; /* Transmit buffer */ |
@@ -80,7 +75,6 @@ struct ircomm_tty_cb { | |||
80 | LOCAL_FLOW flow; /* IrTTP flow status */ | 75 | LOCAL_FLOW flow; /* IrTTP flow status */ |
81 | 76 | ||
82 | int line; | 77 | int line; |
83 | unsigned long flags; | ||
84 | 78 | ||
85 | __u8 dlsap_sel; | 79 | __u8 dlsap_sel; |
86 | __u8 slsap_sel; | 80 | __u8 slsap_sel; |
@@ -97,19 +91,10 @@ struct ircomm_tty_cb { | |||
97 | void *skey; | 91 | void *skey; |
98 | void *ckey; | 92 | void *ckey; |
99 | 93 | ||
100 | wait_queue_head_t open_wait; | ||
101 | wait_queue_head_t close_wait; | ||
102 | struct timer_list watchdog_timer; | 94 | struct timer_list watchdog_timer; |
103 | struct work_struct tqueue; | 95 | struct work_struct tqueue; |
104 | 96 | ||
105 | unsigned short close_delay; | ||
106 | unsigned short closing_wait; /* time to wait before closing */ | ||
107 | |||
108 | int open_count; | ||
109 | int blocked_open; /* # of blocked opens */ | ||
110 | |||
111 | /* Protect concurent access to : | 97 | /* Protect concurent access to : |
112 | * o self->open_count | ||
113 | * o self->ctrl_skb | 98 | * o self->ctrl_skb |
114 | * o self->tx_skb | 99 | * o self->tx_skb |
115 | * Maybe other things may gain to be protected as well... | 100 | * Maybe other things may gain to be protected as well... |
diff --git a/include/net/llc.h b/include/net/llc.h index f2d0fc570527..9e7d7f08ef77 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -151,7 +151,6 @@ extern int sysctl_llc2_ack_timeout; | |||
151 | extern int sysctl_llc2_busy_timeout; | 151 | extern int sysctl_llc2_busy_timeout; |
152 | extern int sysctl_llc2_p_timeout; | 152 | extern int sysctl_llc2_p_timeout; |
153 | extern int sysctl_llc2_rej_timeout; | 153 | extern int sysctl_llc2_rej_timeout; |
154 | extern int sysctl_llc_station_ack_timeout; | ||
155 | #else | 154 | #else |
156 | #define llc_sysctl_init() (0) | 155 | #define llc_sysctl_init() (0) |
157 | #define llc_sysctl_exit() do { } while(0) | 156 | #define llc_sysctl_exit() do { } while(0) |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bb86aa6f98dd..82558c8decf8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -171,6 +171,7 @@ struct ieee80211_low_level_stats { | |||
171 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | 171 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. |
172 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 172 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
173 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 173 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
174 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | ||
174 | */ | 175 | */ |
175 | enum ieee80211_bss_change { | 176 | enum ieee80211_bss_change { |
176 | BSS_CHANGED_ASSOC = 1<<0, | 177 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -190,6 +191,7 @@ enum ieee80211_bss_change { | |||
190 | BSS_CHANGED_IDLE = 1<<14, | 191 | BSS_CHANGED_IDLE = 1<<14, |
191 | BSS_CHANGED_SSID = 1<<15, | 192 | BSS_CHANGED_SSID = 1<<15, |
192 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 193 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
194 | BSS_CHANGED_PS = 1<<17, | ||
193 | 195 | ||
194 | /* when adding here, make sure to change ieee80211_reconfig */ | 196 | /* when adding here, make sure to change ieee80211_reconfig */ |
195 | }; | 197 | }; |
@@ -266,6 +268,8 @@ enum ieee80211_rssi_event { | |||
266 | * @idle: This interface is idle. There's also a global idle flag in the | 268 | * @idle: This interface is idle. There's also a global idle flag in the |
267 | * hardware config which may be more appropriate depending on what | 269 | * hardware config which may be more appropriate depending on what |
268 | * your driver/device needs to do. | 270 | * your driver/device needs to do. |
271 | * @ps: power-save mode (STA only). This flag is NOT affected by | ||
272 | * offchannel/dynamic_ps operations. | ||
269 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 273 | * @ssid: The SSID of the current vif. Only valid in AP-mode. |
270 | * @ssid_len: Length of SSID given in @ssid. | 274 | * @ssid_len: Length of SSID given in @ssid. |
271 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 275 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
@@ -296,6 +300,7 @@ struct ieee80211_bss_conf { | |||
296 | bool arp_filter_enabled; | 300 | bool arp_filter_enabled; |
297 | bool qos; | 301 | bool qos; |
298 | bool idle; | 302 | bool idle; |
303 | bool ps; | ||
299 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 304 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
300 | size_t ssid_len; | 305 | size_t ssid_len; |
301 | bool hidden_ssid; | 306 | bool hidden_ssid; |
@@ -522,9 +527,6 @@ struct ieee80211_tx_rate { | |||
522 | * (2) driver internal use (if applicable) | 527 | * (2) driver internal use (if applicable) |
523 | * (3) TX status information - driver tells mac80211 what happened | 528 | * (3) TX status information - driver tells mac80211 what happened |
524 | * | 529 | * |
525 | * The TX control's sta pointer is only valid during the ->tx call, | ||
526 | * it may be NULL. | ||
527 | * | ||
528 | * @flags: transmit info flags, defined above | 530 | * @flags: transmit info flags, defined above |
529 | * @band: the band to transmit on (use for checking for races) | 531 | * @band: the band to transmit on (use for checking for races) |
530 | * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC | 532 | * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC |
@@ -555,6 +557,7 @@ struct ieee80211_tx_info { | |||
555 | struct ieee80211_tx_rate rates[ | 557 | struct ieee80211_tx_rate rates[ |
556 | IEEE80211_TX_MAX_RATES]; | 558 | IEEE80211_TX_MAX_RATES]; |
557 | s8 rts_cts_rate_idx; | 559 | s8 rts_cts_rate_idx; |
560 | /* 3 bytes free */ | ||
558 | }; | 561 | }; |
559 | /* only needed before rate control */ | 562 | /* only needed before rate control */ |
560 | unsigned long jiffies; | 563 | unsigned long jiffies; |
@@ -562,7 +565,7 @@ struct ieee80211_tx_info { | |||
562 | /* NB: vif can be NULL for injected frames */ | 565 | /* NB: vif can be NULL for injected frames */ |
563 | struct ieee80211_vif *vif; | 566 | struct ieee80211_vif *vif; |
564 | struct ieee80211_key_conf *hw_key; | 567 | struct ieee80211_key_conf *hw_key; |
565 | struct ieee80211_sta *sta; | 568 | /* 8 bytes free */ |
566 | } control; | 569 | } control; |
567 | struct { | 570 | struct { |
568 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; | 571 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; |
@@ -673,21 +676,41 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
673 | * @RX_FLAG_HT_GF: This frame was received in a HT-greenfield transmission, if | 676 | * @RX_FLAG_HT_GF: This frame was received in a HT-greenfield transmission, if |
674 | * the driver fills this value it should add %IEEE80211_RADIOTAP_MCS_HAVE_FMT | 677 | * the driver fills this value it should add %IEEE80211_RADIOTAP_MCS_HAVE_FMT |
675 | * to hw.radiotap_mcs_details to advertise that fact | 678 | * to hw.radiotap_mcs_details to advertise that fact |
679 | * @RX_FLAG_AMPDU_DETAILS: A-MPDU details are known, in particular the reference | ||
680 | * number (@ampdu_reference) must be populated and be a distinct number for | ||
681 | * each A-MPDU | ||
682 | * @RX_FLAG_AMPDU_REPORT_ZEROLEN: driver reports 0-length subframes | ||
683 | * @RX_FLAG_AMPDU_IS_ZEROLEN: This is a zero-length subframe, for | ||
684 | * monitoring purposes only | ||
685 | * @RX_FLAG_AMPDU_LAST_KNOWN: last subframe is known, should be set on all | ||
686 | * subframes of a single A-MPDU | ||
687 | * @RX_FLAG_AMPDU_IS_LAST: this subframe is the last subframe of the A-MPDU | ||
688 | * @RX_FLAG_AMPDU_DELIM_CRC_ERROR: A delimiter CRC error has been detected | ||
689 | * on this subframe | ||
690 | * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC | ||
691 | * is stored in the @ampdu_delimiter_crc field) | ||
676 | */ | 692 | */ |
677 | enum mac80211_rx_flags { | 693 | enum mac80211_rx_flags { |
678 | RX_FLAG_MMIC_ERROR = 1<<0, | 694 | RX_FLAG_MMIC_ERROR = BIT(0), |
679 | RX_FLAG_DECRYPTED = 1<<1, | 695 | RX_FLAG_DECRYPTED = BIT(1), |
680 | RX_FLAG_MMIC_STRIPPED = 1<<3, | 696 | RX_FLAG_MMIC_STRIPPED = BIT(3), |
681 | RX_FLAG_IV_STRIPPED = 1<<4, | 697 | RX_FLAG_IV_STRIPPED = BIT(4), |
682 | RX_FLAG_FAILED_FCS_CRC = 1<<5, | 698 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
683 | RX_FLAG_FAILED_PLCP_CRC = 1<<6, | 699 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
684 | RX_FLAG_MACTIME_MPDU = 1<<7, | 700 | RX_FLAG_MACTIME_MPDU = BIT(7), |
685 | RX_FLAG_SHORTPRE = 1<<8, | 701 | RX_FLAG_SHORTPRE = BIT(8), |
686 | RX_FLAG_HT = 1<<9, | 702 | RX_FLAG_HT = BIT(9), |
687 | RX_FLAG_40MHZ = 1<<10, | 703 | RX_FLAG_40MHZ = BIT(10), |
688 | RX_FLAG_SHORT_GI = 1<<11, | 704 | RX_FLAG_SHORT_GI = BIT(11), |
689 | RX_FLAG_NO_SIGNAL_VAL = 1<<12, | 705 | RX_FLAG_NO_SIGNAL_VAL = BIT(12), |
690 | RX_FLAG_HT_GF = 1<<13, | 706 | RX_FLAG_HT_GF = BIT(13), |
707 | RX_FLAG_AMPDU_DETAILS = BIT(14), | ||
708 | RX_FLAG_AMPDU_REPORT_ZEROLEN = BIT(15), | ||
709 | RX_FLAG_AMPDU_IS_ZEROLEN = BIT(16), | ||
710 | RX_FLAG_AMPDU_LAST_KNOWN = BIT(17), | ||
711 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | ||
712 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | ||
713 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | ||
691 | }; | 714 | }; |
692 | 715 | ||
693 | /** | 716 | /** |
@@ -711,17 +734,22 @@ enum mac80211_rx_flags { | |||
711 | * HT rates are use (RX_FLAG_HT) | 734 | * HT rates are use (RX_FLAG_HT) |
712 | * @flag: %RX_FLAG_* | 735 | * @flag: %RX_FLAG_* |
713 | * @rx_flags: internal RX flags for mac80211 | 736 | * @rx_flags: internal RX flags for mac80211 |
737 | * @ampdu_reference: A-MPDU reference number, must be a different value for | ||
738 | * each A-MPDU but the same for each subframe within one A-MPDU | ||
739 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC | ||
714 | */ | 740 | */ |
715 | struct ieee80211_rx_status { | 741 | struct ieee80211_rx_status { |
716 | u64 mactime; | 742 | u64 mactime; |
717 | u32 device_timestamp; | 743 | u32 device_timestamp; |
718 | u16 flag; | 744 | u32 ampdu_reference; |
745 | u32 flag; | ||
719 | u16 freq; | 746 | u16 freq; |
720 | u8 rate_idx; | 747 | u8 rate_idx; |
721 | u8 rx_flags; | 748 | u8 rx_flags; |
722 | u8 band; | 749 | u8 band; |
723 | u8 antenna; | 750 | u8 antenna; |
724 | s8 signal; | 751 | s8 signal; |
752 | u8 ampdu_delimiter_crc; | ||
725 | }; | 753 | }; |
726 | 754 | ||
727 | /** | 755 | /** |
@@ -945,21 +973,29 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
945 | * generation in software. | 973 | * generation in software. |
946 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | 974 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates |
947 | * that the key is pairwise rather then a shared key. | 975 | * that the key is pairwise rather then a shared key. |
948 | * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a | 976 | * @IEEE80211_KEY_FLAG_SW_MGMT_TX: This flag should be set by the driver for a |
949 | * CCMP key if it requires CCMP encryption of management frames (MFP) to | 977 | * CCMP key if it requires CCMP encryption of management frames (MFP) to |
950 | * be done in software. | 978 | * be done in software. |
951 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver | 979 | * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver |
952 | * if space should be prepared for the IV, but the IV | 980 | * if space should be prepared for the IV, but the IV |
953 | * itself should not be generated. Do not set together with | 981 | * itself should not be generated. Do not set together with |
954 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. | 982 | * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key. |
983 | * @IEEE80211_KEY_FLAG_RX_MGMT: This key will be used to decrypt received | ||
984 | * management frames. The flag can help drivers that have a hardware | ||
985 | * crypto implementation that doesn't deal with management frames | ||
986 | * properly by allowing them to not upload the keys to hardware and | ||
987 | * fall back to software crypto. Note that this flag deals only with | ||
988 | * RX, if your crypto engine can't deal with TX you can also set the | ||
989 | * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. | ||
955 | */ | 990 | */ |
956 | enum ieee80211_key_flags { | 991 | enum ieee80211_key_flags { |
957 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, | 992 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, |
958 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, | 993 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, |
959 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, | 994 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, |
960 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, | 995 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, |
961 | IEEE80211_KEY_FLAG_SW_MGMT = 1<<4, | 996 | IEEE80211_KEY_FLAG_SW_MGMT_TX = 1<<4, |
962 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5, | 997 | IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5, |
998 | IEEE80211_KEY_FLAG_RX_MGMT = 1<<6, | ||
963 | }; | 999 | }; |
964 | 1000 | ||
965 | /** | 1001 | /** |
@@ -1074,6 +1110,16 @@ enum sta_notify_cmd { | |||
1074 | }; | 1110 | }; |
1075 | 1111 | ||
1076 | /** | 1112 | /** |
1113 | * struct ieee80211_tx_control - TX control data | ||
1114 | * | ||
1115 | * @sta: station table entry, this sta pointer may be NULL and | ||
1116 | * it is not allowed to copy the pointer, due to RCU. | ||
1117 | */ | ||
1118 | struct ieee80211_tx_control { | ||
1119 | struct ieee80211_sta *sta; | ||
1120 | }; | ||
1121 | |||
1122 | /** | ||
1077 | * enum ieee80211_hw_flags - hardware flags | 1123 | * enum ieee80211_hw_flags - hardware flags |
1078 | * | 1124 | * |
1079 | * These flags are used to indicate hardware capabilities to | 1125 | * These flags are used to indicate hardware capabilities to |
@@ -1203,6 +1249,10 @@ enum sta_notify_cmd { | |||
1203 | * queue mapping in order to use different queues (not just one per AC) | 1249 | * queue mapping in order to use different queues (not just one per AC) |
1204 | * for different virtual interfaces. See the doc section on HW queue | 1250 | * for different virtual interfaces. See the doc section on HW queue |
1205 | * control for more details. | 1251 | * control for more details. |
1252 | * | ||
1253 | * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any | ||
1254 | * P2P Interface. This will be honoured even if more than one interface | ||
1255 | * is supported. | ||
1206 | */ | 1256 | */ |
1207 | enum ieee80211_hw_flags { | 1257 | enum ieee80211_hw_flags { |
1208 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1258 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1230,6 +1280,7 @@ enum ieee80211_hw_flags { | |||
1230 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1280 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
1231 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | 1281 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, |
1232 | IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, | 1282 | IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, |
1283 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, | ||
1233 | }; | 1284 | }; |
1234 | 1285 | ||
1235 | /** | 1286 | /** |
@@ -1884,10 +1935,14 @@ enum ieee80211_frame_release_type { | |||
1884 | * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit | 1935 | * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit |
1885 | * to this station changed. | 1936 | * to this station changed. |
1886 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. | 1937 | * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. |
1938 | * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer | ||
1939 | * changed (in IBSS mode) due to discovering more information about | ||
1940 | * the peer. | ||
1887 | */ | 1941 | */ |
1888 | enum ieee80211_rate_control_changed { | 1942 | enum ieee80211_rate_control_changed { |
1889 | IEEE80211_RC_BW_CHANGED = BIT(0), | 1943 | IEEE80211_RC_BW_CHANGED = BIT(0), |
1890 | IEEE80211_RC_SMPS_CHANGED = BIT(1), | 1944 | IEEE80211_RC_SMPS_CHANGED = BIT(1), |
1945 | IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), | ||
1891 | }; | 1946 | }; |
1892 | 1947 | ||
1893 | /** | 1948 | /** |
@@ -2264,7 +2319,9 @@ enum ieee80211_rate_control_changed { | |||
2264 | * The callback is optional and can (should!) sleep. | 2319 | * The callback is optional and can (should!) sleep. |
2265 | */ | 2320 | */ |
2266 | struct ieee80211_ops { | 2321 | struct ieee80211_ops { |
2267 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 2322 | void (*tx)(struct ieee80211_hw *hw, |
2323 | struct ieee80211_tx_control *control, | ||
2324 | struct sk_buff *skb); | ||
2268 | int (*start)(struct ieee80211_hw *hw); | 2325 | int (*start)(struct ieee80211_hw *hw); |
2269 | void (*stop)(struct ieee80211_hw *hw); | 2326 | void (*stop)(struct ieee80211_hw *hw); |
2270 | #ifdef CONFIG_PM | 2327 | #ifdef CONFIG_PM |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 96a3b5c03e37..980d263765cf 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -49,6 +49,7 @@ enum { | |||
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/if_arp.h> | 50 | #include <linux/if_arp.h> |
51 | #include <linux/netdevice.h> | 51 | #include <linux/netdevice.h> |
52 | #include <linux/hash.h> | ||
52 | 53 | ||
53 | #include <net/neighbour.h> | 54 | #include <net/neighbour.h> |
54 | 55 | ||
@@ -134,7 +135,7 @@ static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, _ | |||
134 | { | 135 | { |
135 | const u32 *p32 = pkey; | 136 | const u32 *p32 = pkey; |
136 | 137 | ||
137 | return (((p32[0] ^ dev->ifindex) * hash_rnd[0]) + | 138 | return (((p32[0] ^ hash32_ptr(dev)) * hash_rnd[0]) + |
138 | (p32[1] * hash_rnd[1]) + | 139 | (p32[1] * hash_rnd[1]) + |
139 | (p32[2] * hash_rnd[2]) + | 140 | (p32[2] * hash_rnd[2]) + |
140 | (p32[3] * hash_rnd[3])); | 141 | (p32[3] * hash_rnd[3])); |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 344d8988842a..0dab173e27da 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -334,18 +334,22 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) | |||
334 | } | 334 | } |
335 | #endif | 335 | #endif |
336 | 336 | ||
337 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | 337 | static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb) |
338 | { | 338 | { |
339 | unsigned int seq; | 339 | unsigned int seq; |
340 | int hh_len; | 340 | int hh_len; |
341 | 341 | ||
342 | do { | 342 | do { |
343 | int hh_alen; | ||
344 | |||
345 | seq = read_seqbegin(&hh->hh_lock); | 343 | seq = read_seqbegin(&hh->hh_lock); |
346 | hh_len = hh->hh_len; | 344 | hh_len = hh->hh_len; |
347 | hh_alen = HH_DATA_ALIGN(hh_len); | 345 | if (likely(hh_len <= HH_DATA_MOD)) { |
348 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | 346 | /* this is inlined by gcc */ |
347 | memcpy(skb->data - HH_DATA_MOD, hh->hh_data, HH_DATA_MOD); | ||
348 | } else { | ||
349 | int hh_alen = HH_DATA_ALIGN(hh_len); | ||
350 | |||
351 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | ||
352 | } | ||
349 | } while (read_seqretry(&hh->hh_lock, seq)); | 353 | } while (read_seqretry(&hh->hh_lock, seq)); |
350 | 354 | ||
351 | skb_push(skb, hh_len); | 355 | skb_push(skb, hh_len); |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index fd87963a0ea5..4faf6612ecac 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <net/netns/packet.h> | 15 | #include <net/netns/packet.h> |
16 | #include <net/netns/ipv4.h> | 16 | #include <net/netns/ipv4.h> |
17 | #include <net/netns/ipv6.h> | 17 | #include <net/netns/ipv6.h> |
18 | #include <net/netns/sctp.h> | ||
18 | #include <net/netns/dccp.h> | 19 | #include <net/netns/dccp.h> |
19 | #include <net/netns/x_tables.h> | 20 | #include <net/netns/x_tables.h> |
20 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 21 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
@@ -66,6 +67,7 @@ struct net { | |||
66 | struct hlist_head *dev_name_head; | 67 | struct hlist_head *dev_name_head; |
67 | struct hlist_head *dev_index_head; | 68 | struct hlist_head *dev_index_head; |
68 | unsigned int dev_base_seq; /* protected by rtnl_mutex */ | 69 | unsigned int dev_base_seq; /* protected by rtnl_mutex */ |
70 | int ifindex; | ||
69 | 71 | ||
70 | /* core fib_rules */ | 72 | /* core fib_rules */ |
71 | struct list_head rules_ops; | 73 | struct list_head rules_ops; |
@@ -80,6 +82,9 @@ struct net { | |||
80 | #if IS_ENABLED(CONFIG_IPV6) | 82 | #if IS_ENABLED(CONFIG_IPV6) |
81 | struct netns_ipv6 ipv6; | 83 | struct netns_ipv6 ipv6; |
82 | #endif | 84 | #endif |
85 | #if defined(CONFIG_IP_SCTP) || defined(CONFIG_IP_SCTP_MODULE) | ||
86 | struct netns_sctp sctp; | ||
87 | #endif | ||
83 | #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) | 88 | #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) |
84 | struct netns_dccp dccp; | 89 | struct netns_dccp dccp; |
85 | #endif | 90 | #endif |
@@ -88,6 +93,9 @@ struct net { | |||
88 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 93 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
89 | struct netns_ct ct; | 94 | struct netns_ct ct; |
90 | #endif | 95 | #endif |
96 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | ||
97 | struct netns_nf_frag nf_frag; | ||
98 | #endif | ||
91 | struct sock *nfnl; | 99 | struct sock *nfnl; |
92 | struct sock *nfnl_stash; | 100 | struct sock *nfnl_stash; |
93 | #endif | 101 | #endif |
@@ -105,6 +113,13 @@ struct net { | |||
105 | atomic_t rt_genid; | 113 | atomic_t rt_genid; |
106 | }; | 114 | }; |
107 | 115 | ||
116 | /* | ||
117 | * ifindex generation is per-net namespace, and loopback is | ||
118 | * always the 1st device in ns (see net_dev_init), thus any | ||
119 | * loopback device should get ifindex 1 | ||
120 | */ | ||
121 | |||
122 | #define LOOPBACK_IFINDEX 1 | ||
108 | 123 | ||
109 | #include <linux/seq_file_net.h> | 124 | #include <linux/seq_file_net.h> |
110 | 125 | ||
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 4a045cda9c60..5654d292efd4 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -17,7 +17,7 @@ struct nf_conntrack_ecache { | |||
17 | unsigned long missed; /* missed events */ | 17 | unsigned long missed; /* missed events */ |
18 | u16 ctmask; /* bitmask of ct events to be delivered */ | 18 | u16 ctmask; /* bitmask of ct events to be delivered */ |
19 | u16 expmask; /* bitmask of expect events to be delivered */ | 19 | u16 expmask; /* bitmask of expect events to be delivered */ |
20 | u32 pid; /* netlink pid of destroyer */ | 20 | u32 portid; /* netlink portid of destroyer */ |
21 | struct timer_list timeout; | 21 | struct timer_list timeout; |
22 | }; | 22 | }; |
23 | 23 | ||
@@ -60,7 +60,7 @@ nf_ct_ecache_ext_add(struct nf_conn *ct, u16 ctmask, u16 expmask, gfp_t gfp) | |||
60 | /* This structure is passed to event handler */ | 60 | /* This structure is passed to event handler */ |
61 | struct nf_ct_event { | 61 | struct nf_ct_event { |
62 | struct nf_conn *ct; | 62 | struct nf_conn *ct; |
63 | u32 pid; | 63 | u32 portid; |
64 | int report; | 64 | int report; |
65 | }; | 65 | }; |
66 | 66 | ||
@@ -92,7 +92,7 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
92 | static inline int | 92 | static inline int |
93 | nf_conntrack_eventmask_report(unsigned int eventmask, | 93 | nf_conntrack_eventmask_report(unsigned int eventmask, |
94 | struct nf_conn *ct, | 94 | struct nf_conn *ct, |
95 | u32 pid, | 95 | u32 portid, |
96 | int report) | 96 | int report) |
97 | { | 97 | { |
98 | int ret = 0; | 98 | int ret = 0; |
@@ -112,11 +112,11 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
112 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) { | 112 | if (nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) { |
113 | struct nf_ct_event item = { | 113 | struct nf_ct_event item = { |
114 | .ct = ct, | 114 | .ct = ct, |
115 | .pid = e->pid ? e->pid : pid, | 115 | .portid = e->portid ? e->portid : portid, |
116 | .report = report | 116 | .report = report |
117 | }; | 117 | }; |
118 | /* This is a resent of a destroy event? If so, skip missed */ | 118 | /* This is a resent of a destroy event? If so, skip missed */ |
119 | unsigned long missed = e->pid ? 0 : e->missed; | 119 | unsigned long missed = e->portid ? 0 : e->missed; |
120 | 120 | ||
121 | if (!((eventmask | missed) & e->ctmask)) | 121 | if (!((eventmask | missed) & e->ctmask)) |
122 | goto out_unlock; | 122 | goto out_unlock; |
@@ -126,11 +126,11 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
126 | spin_lock_bh(&ct->lock); | 126 | spin_lock_bh(&ct->lock); |
127 | if (ret < 0) { | 127 | if (ret < 0) { |
128 | /* This is a destroy event that has been | 128 | /* This is a destroy event that has been |
129 | * triggered by a process, we store the PID | 129 | * triggered by a process, we store the PORTID |
130 | * to include it in the retransmission. */ | 130 | * to include it in the retransmission. */ |
131 | if (eventmask & (1 << IPCT_DESTROY) && | 131 | if (eventmask & (1 << IPCT_DESTROY) && |
132 | e->pid == 0 && pid != 0) | 132 | e->portid == 0 && portid != 0) |
133 | e->pid = pid; | 133 | e->portid = portid; |
134 | else | 134 | else |
135 | e->missed |= eventmask; | 135 | e->missed |= eventmask; |
136 | } else | 136 | } else |
@@ -145,9 +145,9 @@ out_unlock: | |||
145 | 145 | ||
146 | static inline int | 146 | static inline int |
147 | nf_conntrack_event_report(enum ip_conntrack_events event, struct nf_conn *ct, | 147 | nf_conntrack_event_report(enum ip_conntrack_events event, struct nf_conn *ct, |
148 | u32 pid, int report) | 148 | u32 portid, int report) |
149 | { | 149 | { |
150 | return nf_conntrack_eventmask_report(1 << event, ct, pid, report); | 150 | return nf_conntrack_eventmask_report(1 << event, ct, portid, report); |
151 | } | 151 | } |
152 | 152 | ||
153 | static inline int | 153 | static inline int |
@@ -158,7 +158,7 @@ nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct) | |||
158 | 158 | ||
159 | struct nf_exp_event { | 159 | struct nf_exp_event { |
160 | struct nf_conntrack_expect *exp; | 160 | struct nf_conntrack_expect *exp; |
161 | u32 pid; | 161 | u32 portid; |
162 | int report; | 162 | int report; |
163 | }; | 163 | }; |
164 | 164 | ||
@@ -172,7 +172,7 @@ extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_even | |||
172 | static inline void | 172 | static inline void |
173 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | 173 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, |
174 | struct nf_conntrack_expect *exp, | 174 | struct nf_conntrack_expect *exp, |
175 | u32 pid, | 175 | u32 portid, |
176 | int report) | 176 | int report) |
177 | { | 177 | { |
178 | struct net *net = nf_ct_exp_net(exp); | 178 | struct net *net = nf_ct_exp_net(exp); |
@@ -191,7 +191,7 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
191 | if (e->expmask & (1 << event)) { | 191 | if (e->expmask & (1 << event)) { |
192 | struct nf_exp_event item = { | 192 | struct nf_exp_event item = { |
193 | .exp = exp, | 193 | .exp = exp, |
194 | .pid = pid, | 194 | .portid = portid, |
195 | .report = report | 195 | .report = report |
196 | }; | 196 | }; |
197 | notify->fcn(1 << event, &item); | 197 | notify->fcn(1 << event, &item); |
@@ -216,20 +216,20 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | |||
216 | struct nf_conn *ct) {} | 216 | struct nf_conn *ct) {} |
217 | static inline int nf_conntrack_eventmask_report(unsigned int eventmask, | 217 | static inline int nf_conntrack_eventmask_report(unsigned int eventmask, |
218 | struct nf_conn *ct, | 218 | struct nf_conn *ct, |
219 | u32 pid, | 219 | u32 portid, |
220 | int report) { return 0; } | 220 | int report) { return 0; } |
221 | static inline int nf_conntrack_event(enum ip_conntrack_events event, | 221 | static inline int nf_conntrack_event(enum ip_conntrack_events event, |
222 | struct nf_conn *ct) { return 0; } | 222 | struct nf_conn *ct) { return 0; } |
223 | static inline int nf_conntrack_event_report(enum ip_conntrack_events event, | 223 | static inline int nf_conntrack_event_report(enum ip_conntrack_events event, |
224 | struct nf_conn *ct, | 224 | struct nf_conn *ct, |
225 | u32 pid, | 225 | u32 portid, |
226 | int report) { return 0; } | 226 | int report) { return 0; } |
227 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} | 227 | static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {} |
228 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, | 228 | static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event, |
229 | struct nf_conntrack_expect *exp) {} | 229 | struct nf_conntrack_expect *exp) {} |
230 | static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e, | 230 | static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e, |
231 | struct nf_conntrack_expect *exp, | 231 | struct nf_conntrack_expect *exp, |
232 | u32 pid, | 232 | u32 portid, |
233 | int report) {} | 233 | int report) {} |
234 | 234 | ||
235 | static inline int nf_conntrack_ecache_init(struct net *net) | 235 | static inline int nf_conntrack_ecache_init(struct net *net) |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 983f00263243..cc13f377a705 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -43,7 +43,7 @@ struct nf_conntrack_expect { | |||
43 | unsigned int class; | 43 | unsigned int class; |
44 | 44 | ||
45 | #ifdef CONFIG_NF_NAT_NEEDED | 45 | #ifdef CONFIG_NF_NAT_NEEDED |
46 | __be32 saved_ip; | 46 | union nf_inet_addr saved_addr; |
47 | /* This is the original per-proto part, used to map the | 47 | /* This is the original per-proto part, used to map the |
48 | * expected connection the way the recipient expects. */ | 48 | * expected connection the way the recipient expects. */ |
49 | union nf_conntrack_man_proto saved_proto; | 49 | union nf_conntrack_man_proto saved_proto; |
diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h index 34ec89f8dbf9..e41e472d08f2 100644 --- a/include/net/netfilter/nf_conntrack_timeout.h +++ b/include/net/netfilter/nf_conntrack_timeout.h | |||
@@ -55,6 +55,26 @@ struct nf_conn_timeout *nf_ct_timeout_ext_add(struct nf_conn *ct, | |||
55 | #endif | 55 | #endif |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static inline unsigned int * | ||
59 | nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct, | ||
60 | struct nf_conntrack_l4proto *l4proto) | ||
61 | { | ||
62 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT | ||
63 | struct nf_conn_timeout *timeout_ext; | ||
64 | unsigned int *timeouts; | ||
65 | |||
66 | timeout_ext = nf_ct_timeout_find(ct); | ||
67 | if (timeout_ext) | ||
68 | timeouts = NF_CT_TIMEOUT_EXT_DATA(timeout_ext); | ||
69 | else | ||
70 | timeouts = l4proto->get_timeouts(net); | ||
71 | |||
72 | return timeouts; | ||
73 | #else | ||
74 | return l4proto->get_timeouts(net); | ||
75 | #endif | ||
76 | } | ||
77 | |||
58 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT | 78 | #ifdef CONFIG_NF_CONNTRACK_TIMEOUT |
59 | extern int nf_conntrack_timeout_init(struct net *net); | 79 | extern int nf_conntrack_timeout_init(struct net *net); |
60 | extern void nf_conntrack_timeout_fini(struct net *net); | 80 | extern void nf_conntrack_timeout_fini(struct net *net); |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index b4de990b55f1..bd8eea720f2e 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -43,14 +43,16 @@ struct nf_conn_nat { | |||
43 | struct nf_conn *ct; | 43 | struct nf_conn *ct; |
44 | union nf_conntrack_nat_help help; | 44 | union nf_conntrack_nat_help help; |
45 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ | 45 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ |
46 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) | 46 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) || \ |
47 | defined(CONFIG_IP6_NF_TARGET_MASQUERADE) || \ | ||
48 | defined(CONFIG_IP6_NF_TARGET_MASQUERADE_MODULE) | ||
47 | int masq_index; | 49 | int masq_index; |
48 | #endif | 50 | #endif |
49 | }; | 51 | }; |
50 | 52 | ||
51 | /* Set up the info structure to map into this range. */ | 53 | /* Set up the info structure to map into this range. */ |
52 | extern unsigned int nf_nat_setup_info(struct nf_conn *ct, | 54 | extern unsigned int nf_nat_setup_info(struct nf_conn *ct, |
53 | const struct nf_nat_ipv4_range *range, | 55 | const struct nf_nat_range *range, |
54 | enum nf_nat_manip_type maniptype); | 56 | enum nf_nat_manip_type maniptype); |
55 | 57 | ||
56 | /* Is this tuple already taken? (not by us)*/ | 58 | /* Is this tuple already taken? (not by us)*/ |
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h index b13d8d18d595..972e1e47ec79 100644 --- a/include/net/netfilter/nf_nat_core.h +++ b/include/net/netfilter/nf_nat_core.h | |||
@@ -12,10 +12,7 @@ extern unsigned int nf_nat_packet(struct nf_conn *ct, | |||
12 | unsigned int hooknum, | 12 | unsigned int hooknum, |
13 | struct sk_buff *skb); | 13 | struct sk_buff *skb); |
14 | 14 | ||
15 | extern int nf_nat_icmp_reply_translation(struct nf_conn *ct, | 15 | extern int nf_xfrm_me_harder(struct sk_buff *skb, unsigned int family); |
16 | enum ip_conntrack_info ctinfo, | ||
17 | unsigned int hooknum, | ||
18 | struct sk_buff *skb); | ||
19 | 16 | ||
20 | static inline int nf_nat_initialized(struct nf_conn *ct, | 17 | static inline int nf_nat_initialized(struct nf_conn *ct, |
21 | enum nf_nat_manip_type manip) | 18 | enum nf_nat_manip_type manip) |
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 7d8fb7b46c44..b4d6bfc2af03 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
@@ -10,6 +10,7 @@ struct sk_buff; | |||
10 | extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, | 10 | extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, |
11 | struct nf_conn *ct, | 11 | struct nf_conn *ct, |
12 | enum ip_conntrack_info ctinfo, | 12 | enum ip_conntrack_info ctinfo, |
13 | unsigned int protoff, | ||
13 | unsigned int match_offset, | 14 | unsigned int match_offset, |
14 | unsigned int match_len, | 15 | unsigned int match_len, |
15 | const char *rep_buffer, | 16 | const char *rep_buffer, |
@@ -18,12 +19,13 @@ extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb, | |||
18 | static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | 19 | static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, |
19 | struct nf_conn *ct, | 20 | struct nf_conn *ct, |
20 | enum ip_conntrack_info ctinfo, | 21 | enum ip_conntrack_info ctinfo, |
22 | unsigned int protoff, | ||
21 | unsigned int match_offset, | 23 | unsigned int match_offset, |
22 | unsigned int match_len, | 24 | unsigned int match_len, |
23 | const char *rep_buffer, | 25 | const char *rep_buffer, |
24 | unsigned int rep_len) | 26 | unsigned int rep_len) |
25 | { | 27 | { |
26 | return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, | 28 | return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo, protoff, |
27 | match_offset, match_len, | 29 | match_offset, match_len, |
28 | rep_buffer, rep_len, true); | 30 | rep_buffer, rep_len, true); |
29 | } | 31 | } |
@@ -31,6 +33,7 @@ static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb, | |||
31 | extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, | 33 | extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, |
32 | struct nf_conn *ct, | 34 | struct nf_conn *ct, |
33 | enum ip_conntrack_info ctinfo, | 35 | enum ip_conntrack_info ctinfo, |
36 | unsigned int protoff, | ||
34 | unsigned int match_offset, | 37 | unsigned int match_offset, |
35 | unsigned int match_len, | 38 | unsigned int match_len, |
36 | const char *rep_buffer, | 39 | const char *rep_buffer, |
@@ -41,10 +44,12 @@ extern void nf_nat_set_seq_adjust(struct nf_conn *ct, | |||
41 | __be32 seq, s16 off); | 44 | __be32 seq, s16 off); |
42 | extern int nf_nat_seq_adjust(struct sk_buff *skb, | 45 | extern int nf_nat_seq_adjust(struct sk_buff *skb, |
43 | struct nf_conn *ct, | 46 | struct nf_conn *ct, |
44 | enum ip_conntrack_info ctinfo); | 47 | enum ip_conntrack_info ctinfo, |
48 | unsigned int protoff); | ||
45 | extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb, | 49 | extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb, |
46 | struct nf_conn *ct, | 50 | struct nf_conn *ct, |
47 | enum ip_conntrack_info ctinfo); | 51 | enum ip_conntrack_info ctinfo, |
52 | unsigned int protoff); | ||
48 | 53 | ||
49 | /* Setup NAT on this expected conntrack so it follows master, but goes | 54 | /* Setup NAT on this expected conntrack so it follows master, but goes |
50 | * to port ct->master->saved_proto. */ | 55 | * to port ct->master->saved_proto. */ |
diff --git a/include/net/netfilter/nf_nat_l3proto.h b/include/net/netfilter/nf_nat_l3proto.h new file mode 100644 index 000000000000..bd3b97e02c82 --- /dev/null +++ b/include/net/netfilter/nf_nat_l3proto.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef _NF_NAT_L3PROTO_H | ||
2 | #define _NF_NAT_L3PROTO_H | ||
3 | |||
4 | struct nf_nat_l4proto; | ||
5 | struct nf_nat_l3proto { | ||
6 | u8 l3proto; | ||
7 | |||
8 | bool (*in_range)(const struct nf_conntrack_tuple *t, | ||
9 | const struct nf_nat_range *range); | ||
10 | |||
11 | u32 (*secure_port)(const struct nf_conntrack_tuple *t, __be16); | ||
12 | |||
13 | bool (*manip_pkt)(struct sk_buff *skb, | ||
14 | unsigned int iphdroff, | ||
15 | const struct nf_nat_l4proto *l4proto, | ||
16 | const struct nf_conntrack_tuple *target, | ||
17 | enum nf_nat_manip_type maniptype); | ||
18 | |||
19 | void (*csum_update)(struct sk_buff *skb, unsigned int iphdroff, | ||
20 | __sum16 *check, | ||
21 | const struct nf_conntrack_tuple *t, | ||
22 | enum nf_nat_manip_type maniptype); | ||
23 | |||
24 | void (*csum_recalc)(struct sk_buff *skb, u8 proto, | ||
25 | void *data, __sum16 *check, | ||
26 | int datalen, int oldlen); | ||
27 | |||
28 | void (*decode_session)(struct sk_buff *skb, | ||
29 | const struct nf_conn *ct, | ||
30 | enum ip_conntrack_dir dir, | ||
31 | unsigned long statusbit, | ||
32 | struct flowi *fl); | ||
33 | |||
34 | int (*nlattr_to_range)(struct nlattr *tb[], | ||
35 | struct nf_nat_range *range); | ||
36 | }; | ||
37 | |||
38 | extern int nf_nat_l3proto_register(const struct nf_nat_l3proto *); | ||
39 | extern void nf_nat_l3proto_unregister(const struct nf_nat_l3proto *); | ||
40 | extern const struct nf_nat_l3proto *__nf_nat_l3proto_find(u8 l3proto); | ||
41 | |||
42 | extern int nf_nat_icmp_reply_translation(struct sk_buff *skb, | ||
43 | struct nf_conn *ct, | ||
44 | enum ip_conntrack_info ctinfo, | ||
45 | unsigned int hooknum); | ||
46 | extern int nf_nat_icmpv6_reply_translation(struct sk_buff *skb, | ||
47 | struct nf_conn *ct, | ||
48 | enum ip_conntrack_info ctinfo, | ||
49 | unsigned int hooknum, | ||
50 | unsigned int hdrlen); | ||
51 | |||
52 | #endif /* _NF_NAT_L3PROTO_H */ | ||
diff --git a/include/net/netfilter/nf_nat_l4proto.h b/include/net/netfilter/nf_nat_l4proto.h new file mode 100644 index 000000000000..24feb68d1bcc --- /dev/null +++ b/include/net/netfilter/nf_nat_l4proto.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* Header for use in defining a given protocol. */ | ||
2 | #ifndef _NF_NAT_L4PROTO_H | ||
3 | #define _NF_NAT_L4PROTO_H | ||
4 | #include <net/netfilter/nf_nat.h> | ||
5 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
6 | |||
7 | struct nf_nat_range; | ||
8 | struct nf_nat_l3proto; | ||
9 | |||
10 | struct nf_nat_l4proto { | ||
11 | /* Protocol number. */ | ||
12 | u8 l4proto; | ||
13 | |||
14 | /* Translate a packet to the target according to manip type. | ||
15 | * Return true if succeeded. | ||
16 | */ | ||
17 | bool (*manip_pkt)(struct sk_buff *skb, | ||
18 | const struct nf_nat_l3proto *l3proto, | ||
19 | unsigned int iphdroff, unsigned int hdroff, | ||
20 | const struct nf_conntrack_tuple *tuple, | ||
21 | enum nf_nat_manip_type maniptype); | ||
22 | |||
23 | /* Is the manipable part of the tuple between min and max incl? */ | ||
24 | bool (*in_range)(const struct nf_conntrack_tuple *tuple, | ||
25 | enum nf_nat_manip_type maniptype, | ||
26 | const union nf_conntrack_man_proto *min, | ||
27 | const union nf_conntrack_man_proto *max); | ||
28 | |||
29 | /* Alter the per-proto part of the tuple (depending on | ||
30 | * maniptype), to give a unique tuple in the given range if | ||
31 | * possible. Per-protocol part of tuple is initialized to the | ||
32 | * incoming packet. | ||
33 | */ | ||
34 | void (*unique_tuple)(const struct nf_nat_l3proto *l3proto, | ||
35 | struct nf_conntrack_tuple *tuple, | ||
36 | const struct nf_nat_range *range, | ||
37 | enum nf_nat_manip_type maniptype, | ||
38 | const struct nf_conn *ct); | ||
39 | |||
40 | int (*nlattr_to_range)(struct nlattr *tb[], | ||
41 | struct nf_nat_range *range); | ||
42 | }; | ||
43 | |||
44 | /* Protocol registration. */ | ||
45 | extern int nf_nat_l4proto_register(u8 l3proto, const struct nf_nat_l4proto *l4proto); | ||
46 | extern void nf_nat_l4proto_unregister(u8 l3proto, const struct nf_nat_l4proto *l4proto); | ||
47 | |||
48 | extern const struct nf_nat_l4proto *__nf_nat_l4proto_find(u8 l3proto, u8 l4proto); | ||
49 | |||
50 | /* Built-in protocols. */ | ||
51 | extern const struct nf_nat_l4proto nf_nat_l4proto_tcp; | ||
52 | extern const struct nf_nat_l4proto nf_nat_l4proto_udp; | ||
53 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmp; | ||
54 | extern const struct nf_nat_l4proto nf_nat_l4proto_icmpv6; | ||
55 | extern const struct nf_nat_l4proto nf_nat_l4proto_unknown; | ||
56 | |||
57 | extern bool nf_nat_l4proto_in_range(const struct nf_conntrack_tuple *tuple, | ||
58 | enum nf_nat_manip_type maniptype, | ||
59 | const union nf_conntrack_man_proto *min, | ||
60 | const union nf_conntrack_man_proto *max); | ||
61 | |||
62 | extern void nf_nat_l4proto_unique_tuple(const struct nf_nat_l3proto *l3proto, | ||
63 | struct nf_conntrack_tuple *tuple, | ||
64 | const struct nf_nat_range *range, | ||
65 | enum nf_nat_manip_type maniptype, | ||
66 | const struct nf_conn *ct, | ||
67 | u16 *rover); | ||
68 | |||
69 | extern int nf_nat_l4proto_nlattr_to_range(struct nlattr *tb[], | ||
70 | struct nf_nat_range *range); | ||
71 | |||
72 | #endif /*_NF_NAT_L4PROTO_H*/ | ||
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h deleted file mode 100644 index 7b0b51165f70..000000000000 --- a/include/net/netfilter/nf_nat_protocol.h +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* Header for use in defining a given protocol. */ | ||
2 | #ifndef _NF_NAT_PROTOCOL_H | ||
3 | #define _NF_NAT_PROTOCOL_H | ||
4 | #include <net/netfilter/nf_nat.h> | ||
5 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
6 | |||
7 | struct nf_nat_ipv4_range; | ||
8 | |||
9 | struct nf_nat_protocol { | ||
10 | /* Protocol number. */ | ||
11 | unsigned int protonum; | ||
12 | |||
13 | /* Translate a packet to the target according to manip type. | ||
14 | Return true if succeeded. */ | ||
15 | bool (*manip_pkt)(struct sk_buff *skb, | ||
16 | unsigned int iphdroff, | ||
17 | const struct nf_conntrack_tuple *tuple, | ||
18 | enum nf_nat_manip_type maniptype); | ||
19 | |||
20 | /* Is the manipable part of the tuple between min and max incl? */ | ||
21 | bool (*in_range)(const struct nf_conntrack_tuple *tuple, | ||
22 | enum nf_nat_manip_type maniptype, | ||
23 | const union nf_conntrack_man_proto *min, | ||
24 | const union nf_conntrack_man_proto *max); | ||
25 | |||
26 | /* Alter the per-proto part of the tuple (depending on | ||
27 | maniptype), to give a unique tuple in the given range if | ||
28 | possible. Per-protocol part of tuple is initialized to the | ||
29 | incoming packet. */ | ||
30 | void (*unique_tuple)(struct nf_conntrack_tuple *tuple, | ||
31 | const struct nf_nat_ipv4_range *range, | ||
32 | enum nf_nat_manip_type maniptype, | ||
33 | const struct nf_conn *ct); | ||
34 | |||
35 | int (*nlattr_to_range)(struct nlattr *tb[], | ||
36 | struct nf_nat_ipv4_range *range); | ||
37 | }; | ||
38 | |||
39 | /* Protocol registration. */ | ||
40 | extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto); | ||
41 | extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto); | ||
42 | |||
43 | /* Built-in protocols. */ | ||
44 | extern const struct nf_nat_protocol nf_nat_protocol_tcp; | ||
45 | extern const struct nf_nat_protocol nf_nat_protocol_udp; | ||
46 | extern const struct nf_nat_protocol nf_nat_protocol_icmp; | ||
47 | extern const struct nf_nat_protocol nf_nat_unknown_protocol; | ||
48 | |||
49 | extern int init_protocols(void) __init; | ||
50 | extern void cleanup_protocols(void); | ||
51 | extern const struct nf_nat_protocol *find_nat_proto(u_int16_t protonum); | ||
52 | |||
53 | extern bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple, | ||
54 | enum nf_nat_manip_type maniptype, | ||
55 | const union nf_conntrack_man_proto *min, | ||
56 | const union nf_conntrack_man_proto *max); | ||
57 | |||
58 | extern void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple, | ||
59 | const struct nf_nat_ipv4_range *range, | ||
60 | enum nf_nat_manip_type maniptype, | ||
61 | const struct nf_conn *ct, | ||
62 | u_int16_t *rover); | ||
63 | |||
64 | extern int nf_nat_proto_nlattr_to_range(struct nlattr *tb[], | ||
65 | struct nf_nat_ipv4_range *range); | ||
66 | |||
67 | #endif /*_NF_NAT_PROTO_H*/ | ||
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h deleted file mode 100644 index 2890bdc4cd92..000000000000 --- a/include/net/netfilter/nf_nat_rule.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #ifndef _NF_NAT_RULE_H | ||
2 | #define _NF_NAT_RULE_H | ||
3 | #include <net/netfilter/nf_conntrack.h> | ||
4 | #include <net/netfilter/nf_nat.h> | ||
5 | #include <linux/netfilter_ipv4/ip_tables.h> | ||
6 | |||
7 | extern int nf_nat_rule_init(void) __init; | ||
8 | extern void nf_nat_rule_cleanup(void); | ||
9 | extern int nf_nat_rule_find(struct sk_buff *skb, | ||
10 | unsigned int hooknum, | ||
11 | const struct net_device *in, | ||
12 | const struct net_device *out, | ||
13 | struct nf_conn *ct); | ||
14 | |||
15 | #endif /* _NF_NAT_RULE_H */ | ||
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index f67440970d7e..2c95d55f7914 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
@@ -110,7 +110,7 @@ struct cipso_v4_doi; | |||
110 | /* NetLabel audit information */ | 110 | /* NetLabel audit information */ |
111 | struct netlbl_audit { | 111 | struct netlbl_audit { |
112 | u32 secid; | 112 | u32 secid; |
113 | uid_t loginuid; | 113 | kuid_t loginuid; |
114 | u32 sessionid; | 114 | u32 sessionid; |
115 | }; | 115 | }; |
116 | 116 | ||
diff --git a/include/net/netlink.h b/include/net/netlink.h index 785f37a3b44e..9690b0f6698a 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -98,6 +98,10 @@ | |||
98 | * nla_put_u16(skb, type, value) add u16 attribute to skb | 98 | * nla_put_u16(skb, type, value) add u16 attribute to skb |
99 | * nla_put_u32(skb, type, value) add u32 attribute to skb | 99 | * nla_put_u32(skb, type, value) add u32 attribute to skb |
100 | * nla_put_u64(skb, type, value) add u64 attribute to skb | 100 | * nla_put_u64(skb, type, value) add u64 attribute to skb |
101 | * nla_put_s8(skb, type, value) add s8 attribute to skb | ||
102 | * nla_put_s16(skb, type, value) add s16 attribute to skb | ||
103 | * nla_put_s32(skb, type, value) add s32 attribute to skb | ||
104 | * nla_put_s64(skb, type, value) add s64 attribute to skb | ||
101 | * nla_put_string(skb, type, str) add string attribute to skb | 105 | * nla_put_string(skb, type, str) add string attribute to skb |
102 | * nla_put_flag(skb, type) add flag attribute to skb | 106 | * nla_put_flag(skb, type) add flag attribute to skb |
103 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb | 107 | * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb |
@@ -121,6 +125,10 @@ | |||
121 | * nla_get_u16(nla) get payload for a u16 attribute | 125 | * nla_get_u16(nla) get payload for a u16 attribute |
122 | * nla_get_u32(nla) get payload for a u32 attribute | 126 | * nla_get_u32(nla) get payload for a u32 attribute |
123 | * nla_get_u64(nla) get payload for a u64 attribute | 127 | * nla_get_u64(nla) get payload for a u64 attribute |
128 | * nla_get_s8(nla) get payload for a s8 attribute | ||
129 | * nla_get_s16(nla) get payload for a s16 attribute | ||
130 | * nla_get_s32(nla) get payload for a s32 attribute | ||
131 | * nla_get_s64(nla) get payload for a s64 attribute | ||
124 | * nla_get_flag(nla) return 1 if flag is true | 132 | * nla_get_flag(nla) return 1 if flag is true |
125 | * nla_get_msecs(nla) get payload for a msecs attribute | 133 | * nla_get_msecs(nla) get payload for a msecs attribute |
126 | * | 134 | * |
@@ -160,6 +168,10 @@ enum { | |||
160 | NLA_NESTED_COMPAT, | 168 | NLA_NESTED_COMPAT, |
161 | NLA_NUL_STRING, | 169 | NLA_NUL_STRING, |
162 | NLA_BINARY, | 170 | NLA_BINARY, |
171 | NLA_S8, | ||
172 | NLA_S16, | ||
173 | NLA_S32, | ||
174 | NLA_S64, | ||
163 | __NLA_TYPE_MAX, | 175 | __NLA_TYPE_MAX, |
164 | }; | 176 | }; |
165 | 177 | ||
@@ -183,6 +195,8 @@ enum { | |||
183 | * NLA_NESTED_COMPAT Minimum length of structure payload | 195 | * NLA_NESTED_COMPAT Minimum length of structure payload |
184 | * NLA_U8, NLA_U16, | 196 | * NLA_U8, NLA_U16, |
185 | * NLA_U32, NLA_U64, | 197 | * NLA_U32, NLA_U64, |
198 | * NLA_S8, NLA_S16, | ||
199 | * NLA_S32, NLA_S64, | ||
186 | * NLA_MSECS Leaving the length field zero will verify the | 200 | * NLA_MSECS Leaving the length field zero will verify the |
187 | * given type fits, using it verifies minimum length | 201 | * given type fits, using it verifies minimum length |
188 | * just like "All other" | 202 | * just like "All other" |
@@ -203,19 +217,19 @@ struct nla_policy { | |||
203 | /** | 217 | /** |
204 | * struct nl_info - netlink source information | 218 | * struct nl_info - netlink source information |
205 | * @nlh: Netlink message header of original request | 219 | * @nlh: Netlink message header of original request |
206 | * @pid: Netlink PID of requesting application | 220 | * @portid: Netlink PORTID of requesting application |
207 | */ | 221 | */ |
208 | struct nl_info { | 222 | struct nl_info { |
209 | struct nlmsghdr *nlh; | 223 | struct nlmsghdr *nlh; |
210 | struct net *nl_net; | 224 | struct net *nl_net; |
211 | u32 pid; | 225 | u32 portid; |
212 | }; | 226 | }; |
213 | 227 | ||
214 | extern int netlink_rcv_skb(struct sk_buff *skb, | 228 | extern int netlink_rcv_skb(struct sk_buff *skb, |
215 | int (*cb)(struct sk_buff *, | 229 | int (*cb)(struct sk_buff *, |
216 | struct nlmsghdr *)); | 230 | struct nlmsghdr *)); |
217 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | 231 | extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, |
218 | u32 pid, unsigned int group, int report, | 232 | u32 portid, unsigned int group, int report, |
219 | gfp_t flags); | 233 | gfp_t flags); |
220 | 234 | ||
221 | extern int nla_validate(const struct nlattr *head, | 235 | extern int nla_validate(const struct nlattr *head, |
@@ -430,7 +444,7 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh) | |||
430 | /** | 444 | /** |
431 | * nlmsg_put - Add a new netlink message to an skb | 445 | * nlmsg_put - Add a new netlink message to an skb |
432 | * @skb: socket buffer to store message in | 446 | * @skb: socket buffer to store message in |
433 | * @pid: netlink process id | 447 | * @portid: netlink process id |
434 | * @seq: sequence number of message | 448 | * @seq: sequence number of message |
435 | * @type: message type | 449 | * @type: message type |
436 | * @payload: length of message payload | 450 | * @payload: length of message payload |
@@ -439,13 +453,13 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh) | |||
439 | * Returns NULL if the tailroom of the skb is insufficient to store | 453 | * Returns NULL if the tailroom of the skb is insufficient to store |
440 | * the message header and payload. | 454 | * the message header and payload. |
441 | */ | 455 | */ |
442 | static inline struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, | 456 | static inline struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, |
443 | int type, int payload, int flags) | 457 | int type, int payload, int flags) |
444 | { | 458 | { |
445 | if (unlikely(skb_tailroom(skb) < nlmsg_total_size(payload))) | 459 | if (unlikely(skb_tailroom(skb) < nlmsg_total_size(payload))) |
446 | return NULL; | 460 | return NULL; |
447 | 461 | ||
448 | return __nlmsg_put(skb, pid, seq, type, payload, flags); | 462 | return __nlmsg_put(skb, portid, seq, type, payload, flags); |
449 | } | 463 | } |
450 | 464 | ||
451 | /** | 465 | /** |
@@ -464,7 +478,7 @@ static inline struct nlmsghdr *nlmsg_put_answer(struct sk_buff *skb, | |||
464 | int type, int payload, | 478 | int type, int payload, |
465 | int flags) | 479 | int flags) |
466 | { | 480 | { |
467 | return nlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, | 481 | return nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, |
468 | type, payload, flags); | 482 | type, payload, flags); |
469 | } | 483 | } |
470 | 484 | ||
@@ -549,18 +563,18 @@ static inline void nlmsg_free(struct sk_buff *skb) | |||
549 | * nlmsg_multicast - multicast a netlink message | 563 | * nlmsg_multicast - multicast a netlink message |
550 | * @sk: netlink socket to spread messages to | 564 | * @sk: netlink socket to spread messages to |
551 | * @skb: netlink message as socket buffer | 565 | * @skb: netlink message as socket buffer |
552 | * @pid: own netlink pid to avoid sending to yourself | 566 | * @portid: own netlink portid to avoid sending to yourself |
553 | * @group: multicast group id | 567 | * @group: multicast group id |
554 | * @flags: allocation flags | 568 | * @flags: allocation flags |
555 | */ | 569 | */ |
556 | static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, | 570 | static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, |
557 | u32 pid, unsigned int group, gfp_t flags) | 571 | u32 portid, unsigned int group, gfp_t flags) |
558 | { | 572 | { |
559 | int err; | 573 | int err; |
560 | 574 | ||
561 | NETLINK_CB(skb).dst_group = group; | 575 | NETLINK_CB(skb).dst_group = group; |
562 | 576 | ||
563 | err = netlink_broadcast(sk, skb, pid, group, flags); | 577 | err = netlink_broadcast(sk, skb, portid, group, flags); |
564 | if (err > 0) | 578 | if (err > 0) |
565 | err = 0; | 579 | err = 0; |
566 | 580 | ||
@@ -571,13 +585,13 @@ static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, | |||
571 | * nlmsg_unicast - unicast a netlink message | 585 | * nlmsg_unicast - unicast a netlink message |
572 | * @sk: netlink socket to spread message to | 586 | * @sk: netlink socket to spread message to |
573 | * @skb: netlink message as socket buffer | 587 | * @skb: netlink message as socket buffer |
574 | * @pid: netlink pid of the destination socket | 588 | * @portid: netlink portid of the destination socket |
575 | */ | 589 | */ |
576 | static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 pid) | 590 | static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 portid) |
577 | { | 591 | { |
578 | int err; | 592 | int err; |
579 | 593 | ||
580 | err = netlink_unicast(sk, skb, pid, MSG_DONTWAIT); | 594 | err = netlink_unicast(sk, skb, portid, MSG_DONTWAIT); |
581 | if (err > 0) | 595 | if (err > 0) |
582 | err = 0; | 596 | err = 0; |
583 | 597 | ||
@@ -879,6 +893,50 @@ static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value) | |||
879 | } | 893 | } |
880 | 894 | ||
881 | /** | 895 | /** |
896 | * nla_put_s8 - Add a s8 netlink attribute to a socket buffer | ||
897 | * @skb: socket buffer to add attribute to | ||
898 | * @attrtype: attribute type | ||
899 | * @value: numeric value | ||
900 | */ | ||
901 | static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value) | ||
902 | { | ||
903 | return nla_put(skb, attrtype, sizeof(s8), &value); | ||
904 | } | ||
905 | |||
906 | /** | ||
907 | * nla_put_s16 - Add a s16 netlink attribute to a socket buffer | ||
908 | * @skb: socket buffer to add attribute to | ||
909 | * @attrtype: attribute type | ||
910 | * @value: numeric value | ||
911 | */ | ||
912 | static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value) | ||
913 | { | ||
914 | return nla_put(skb, attrtype, sizeof(s16), &value); | ||
915 | } | ||
916 | |||
917 | /** | ||
918 | * nla_put_s32 - Add a s32 netlink attribute to a socket buffer | ||
919 | * @skb: socket buffer to add attribute to | ||
920 | * @attrtype: attribute type | ||
921 | * @value: numeric value | ||
922 | */ | ||
923 | static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value) | ||
924 | { | ||
925 | return nla_put(skb, attrtype, sizeof(s32), &value); | ||
926 | } | ||
927 | |||
928 | /** | ||
929 | * nla_put_s64 - Add a s64 netlink attribute to a socket buffer | ||
930 | * @skb: socket buffer to add attribute to | ||
931 | * @attrtype: attribute type | ||
932 | * @value: numeric value | ||
933 | */ | ||
934 | static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value) | ||
935 | { | ||
936 | return nla_put(skb, attrtype, sizeof(s64), &value); | ||
937 | } | ||
938 | |||
939 | /** | ||
882 | * nla_put_string - Add a string netlink attribute to a socket buffer | 940 | * nla_put_string - Add a string netlink attribute to a socket buffer |
883 | * @skb: socket buffer to add attribute to | 941 | * @skb: socket buffer to add attribute to |
884 | * @attrtype: attribute type | 942 | * @attrtype: attribute type |
@@ -994,6 +1052,46 @@ static inline __be64 nla_get_be64(const struct nlattr *nla) | |||
994 | } | 1052 | } |
995 | 1053 | ||
996 | /** | 1054 | /** |
1055 | * nla_get_s32 - return payload of s32 attribute | ||
1056 | * @nla: s32 netlink attribute | ||
1057 | */ | ||
1058 | static inline s32 nla_get_s32(const struct nlattr *nla) | ||
1059 | { | ||
1060 | return *(s32 *) nla_data(nla); | ||
1061 | } | ||
1062 | |||
1063 | /** | ||
1064 | * nla_get_s16 - return payload of s16 attribute | ||
1065 | * @nla: s16 netlink attribute | ||
1066 | */ | ||
1067 | static inline s16 nla_get_s16(const struct nlattr *nla) | ||
1068 | { | ||
1069 | return *(s16 *) nla_data(nla); | ||
1070 | } | ||
1071 | |||
1072 | /** | ||
1073 | * nla_get_s8 - return payload of s8 attribute | ||
1074 | * @nla: s8 netlink attribute | ||
1075 | */ | ||
1076 | static inline s8 nla_get_s8(const struct nlattr *nla) | ||
1077 | { | ||
1078 | return *(s8 *) nla_data(nla); | ||
1079 | } | ||
1080 | |||
1081 | /** | ||
1082 | * nla_get_s64 - return payload of s64 attribute | ||
1083 | * @nla: s64 netlink attribute | ||
1084 | */ | ||
1085 | static inline s64 nla_get_s64(const struct nlattr *nla) | ||
1086 | { | ||
1087 | s64 tmp; | ||
1088 | |||
1089 | nla_memcpy(&tmp, nla, sizeof(tmp)); | ||
1090 | |||
1091 | return tmp; | ||
1092 | } | ||
1093 | |||
1094 | /** | ||
997 | * nla_get_flag - return payload of flag attribute | 1095 | * nla_get_flag - return payload of flag attribute |
998 | * @nla: flag netlink attribute | 1096 | * @nla: flag netlink attribute |
999 | */ | 1097 | */ |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 3aecdc7a84fb..a1d83cc8bf85 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -83,6 +83,10 @@ struct netns_ct { | |||
83 | int sysctl_auto_assign_helper; | 83 | int sysctl_auto_assign_helper; |
84 | bool auto_assign_helper_warned; | 84 | bool auto_assign_helper_warned; |
85 | struct nf_ip_net nf_ct_proto; | 85 | struct nf_ip_net nf_ct_proto; |
86 | #ifdef CONFIG_NF_NAT_NEEDED | ||
87 | struct hlist_head *nat_bysource; | ||
88 | unsigned int nat_htable_size; | ||
89 | #endif | ||
86 | #ifdef CONFIG_SYSCTL | 90 | #ifdef CONFIG_SYSCTL |
87 | struct ctl_table_header *sysctl_header; | 91 | struct ctl_table_header *sysctl_header; |
88 | struct ctl_table_header *acct_sysctl_header; | 92 | struct ctl_table_header *acct_sysctl_header; |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index eb24dbccd81e..2ae2b8372cfd 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #ifndef __NETNS_IPV4_H__ | 5 | #ifndef __NETNS_IPV4_H__ |
6 | #define __NETNS_IPV4_H__ | 6 | #define __NETNS_IPV4_H__ |
7 | 7 | ||
8 | #include <linux/uidgid.h> | ||
8 | #include <net/inet_frag.h> | 9 | #include <net/inet_frag.h> |
9 | 10 | ||
10 | struct tcpm_hash_bucket; | 11 | struct tcpm_hash_bucket; |
@@ -51,8 +52,6 @@ struct netns_ipv4 { | |||
51 | struct xt_table *iptable_security; | 52 | struct xt_table *iptable_security; |
52 | #endif | 53 | #endif |
53 | struct xt_table *nat_table; | 54 | struct xt_table *nat_table; |
54 | struct hlist_head *nat_bysource; | ||
55 | unsigned int nat_htable_size; | ||
56 | #endif | 55 | #endif |
57 | 56 | ||
58 | int sysctl_icmp_echo_ignore_all; | 57 | int sysctl_icmp_echo_ignore_all; |
@@ -62,7 +61,7 @@ struct netns_ipv4 { | |||
62 | int sysctl_icmp_ratemask; | 61 | int sysctl_icmp_ratemask; |
63 | int sysctl_icmp_errors_use_inbound_ifaddr; | 62 | int sysctl_icmp_errors_use_inbound_ifaddr; |
64 | 63 | ||
65 | unsigned int sysctl_ping_group_range[2]; | 64 | kgid_t sysctl_ping_group_range[2]; |
66 | long sysctl_tcp_mem[3]; | 65 | long sysctl_tcp_mem[3]; |
67 | 66 | ||
68 | atomic_t dev_addr_genid; | 67 | atomic_t dev_addr_genid; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index df0a5456a3fd..214cb0a53359 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -42,6 +42,7 @@ struct netns_ipv6 { | |||
42 | #ifdef CONFIG_SECURITY | 42 | #ifdef CONFIG_SECURITY |
43 | struct xt_table *ip6table_security; | 43 | struct xt_table *ip6table_security; |
44 | #endif | 44 | #endif |
45 | struct xt_table *ip6table_nat; | ||
45 | #endif | 46 | #endif |
46 | struct rt6_info *ip6_null_entry; | 47 | struct rt6_info *ip6_null_entry; |
47 | struct rt6_statistics *rt6_stats; | 48 | struct rt6_statistics *rt6_stats; |
@@ -70,4 +71,12 @@ struct netns_ipv6 { | |||
70 | #endif | 71 | #endif |
71 | #endif | 72 | #endif |
72 | }; | 73 | }; |
74 | |||
75 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | ||
76 | struct netns_nf_frag { | ||
77 | struct netns_sysctl_ipv6 sysctl; | ||
78 | struct netns_frags frags; | ||
79 | }; | ||
80 | #endif | ||
81 | |||
73 | #endif | 82 | #endif |
diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h index cb4e894c0f8d..17ec2b95c062 100644 --- a/include/net/netns/packet.h +++ b/include/net/netns/packet.h | |||
@@ -5,10 +5,10 @@ | |||
5 | #define __NETNS_PACKET_H__ | 5 | #define __NETNS_PACKET_H__ |
6 | 6 | ||
7 | #include <linux/rculist.h> | 7 | #include <linux/rculist.h> |
8 | #include <linux/spinlock.h> | 8 | #include <linux/mutex.h> |
9 | 9 | ||
10 | struct netns_packet { | 10 | struct netns_packet { |
11 | spinlock_t sklist_lock; | 11 | struct mutex sklist_lock; |
12 | struct hlist_head sklist; | 12 | struct hlist_head sklist; |
13 | }; | 13 | }; |
14 | 14 | ||
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h new file mode 100644 index 000000000000..5e5eb1f9f14b --- /dev/null +++ b/include/net/netns/sctp.h | |||
@@ -0,0 +1,131 @@ | |||
1 | #ifndef __NETNS_SCTP_H__ | ||
2 | #define __NETNS_SCTP_H__ | ||
3 | |||
4 | struct sock; | ||
5 | struct proc_dir_entry; | ||
6 | struct sctp_mib; | ||
7 | struct ctl_table_header; | ||
8 | |||
9 | struct netns_sctp { | ||
10 | DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics); | ||
11 | |||
12 | #ifdef CONFIG_PROC_FS | ||
13 | struct proc_dir_entry *proc_net_sctp; | ||
14 | #endif | ||
15 | #ifdef CONFIG_SYSCTL | ||
16 | struct ctl_table_header *sysctl_header; | ||
17 | #endif | ||
18 | /* This is the global socket data structure used for responding to | ||
19 | * the Out-of-the-blue (OOTB) packets. A control sock will be created | ||
20 | * for this socket at the initialization time. | ||
21 | */ | ||
22 | struct sock *ctl_sock; | ||
23 | |||
24 | /* This is the global local address list. | ||
25 | * We actively maintain this complete list of addresses on | ||
26 | * the system by catching address add/delete events. | ||
27 | * | ||
28 | * It is a list of sctp_sockaddr_entry. | ||
29 | */ | ||
30 | struct list_head local_addr_list; | ||
31 | struct list_head addr_waitq; | ||
32 | struct timer_list addr_wq_timer; | ||
33 | struct list_head auto_asconf_splist; | ||
34 | spinlock_t addr_wq_lock; | ||
35 | |||
36 | /* Lock that protects the local_addr_list writers */ | ||
37 | spinlock_t local_addr_lock; | ||
38 | |||
39 | /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values | ||
40 | * | ||
41 | * The following protocol parameters are RECOMMENDED: | ||
42 | * | ||
43 | * RTO.Initial - 3 seconds | ||
44 | * RTO.Min - 1 second | ||
45 | * RTO.Max - 60 seconds | ||
46 | * RTO.Alpha - 1/8 (3 when converted to right shifts.) | ||
47 | * RTO.Beta - 1/4 (2 when converted to right shifts.) | ||
48 | */ | ||
49 | unsigned int rto_initial; | ||
50 | unsigned int rto_min; | ||
51 | unsigned int rto_max; | ||
52 | |||
53 | /* Note: rto_alpha and rto_beta are really defined as inverse | ||
54 | * powers of two to facilitate integer operations. | ||
55 | */ | ||
56 | int rto_alpha; | ||
57 | int rto_beta; | ||
58 | |||
59 | /* Max.Burst - 4 */ | ||
60 | int max_burst; | ||
61 | |||
62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ | ||
63 | int cookie_preserve_enable; | ||
64 | |||
65 | /* Valid.Cookie.Life - 60 seconds */ | ||
66 | unsigned int valid_cookie_life; | ||
67 | |||
68 | /* Delayed SACK timeout 200ms default*/ | ||
69 | unsigned int sack_timeout; | ||
70 | |||
71 | /* HB.interval - 30 seconds */ | ||
72 | unsigned int hb_interval; | ||
73 | |||
74 | /* Association.Max.Retrans - 10 attempts | ||
75 | * Path.Max.Retrans - 5 attempts (per destination address) | ||
76 | * Max.Init.Retransmits - 8 attempts | ||
77 | */ | ||
78 | int max_retrans_association; | ||
79 | int max_retrans_path; | ||
80 | int max_retrans_init; | ||
81 | /* Potentially-Failed.Max.Retrans sysctl value | ||
82 | * taken from: | ||
83 | * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05 | ||
84 | */ | ||
85 | int pf_retrans; | ||
86 | |||
87 | /* | ||
88 | * Policy for preforming sctp/socket accounting | ||
89 | * 0 - do socket level accounting, all assocs share sk_sndbuf | ||
90 | * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes | ||
91 | */ | ||
92 | int sndbuf_policy; | ||
93 | |||
94 | /* | ||
95 | * Policy for preforming sctp/socket accounting | ||
96 | * 0 - do socket level accounting, all assocs share sk_rcvbuf | ||
97 | * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes | ||
98 | */ | ||
99 | int rcvbuf_policy; | ||
100 | |||
101 | int default_auto_asconf; | ||
102 | |||
103 | /* Flag to indicate if addip is enabled. */ | ||
104 | int addip_enable; | ||
105 | int addip_noauth; | ||
106 | |||
107 | /* Flag to indicate if PR-SCTP is enabled. */ | ||
108 | int prsctp_enable; | ||
109 | |||
110 | /* Flag to idicate if SCTP-AUTH is enabled */ | ||
111 | int auth_enable; | ||
112 | |||
113 | /* | ||
114 | * Policy to control SCTP IPv4 address scoping | ||
115 | * 0 - Disable IPv4 address scoping | ||
116 | * 1 - Enable IPv4 address scoping | ||
117 | * 2 - Selectively allow only IPv4 private addresses | ||
118 | * 3 - Selectively allow only IPv4 link local address | ||
119 | */ | ||
120 | int scope_policy; | ||
121 | |||
122 | /* Threshold for rwnd update SACKS. Receive buffer shifted this many | ||
123 | * bits is an indicator of when to send and window update SACK. | ||
124 | */ | ||
125 | int rwnd_upd_shift; | ||
126 | |||
127 | /* Threshold for autoclose timeout, in seconds. */ | ||
128 | unsigned long max_autoclose; | ||
129 | }; | ||
130 | |||
131 | #endif /* __NETNS_SCTP_H__ */ | ||
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h index 2719dec6b5a8..2760f4f4ae9b 100644 --- a/include/net/netprio_cgroup.h +++ b/include/net/netprio_cgroup.h | |||
@@ -18,23 +18,18 @@ | |||
18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
19 | 19 | ||
20 | 20 | ||
21 | #if IS_ENABLED(CONFIG_NETPRIO_CGROUP) | ||
21 | struct netprio_map { | 22 | struct netprio_map { |
22 | struct rcu_head rcu; | 23 | struct rcu_head rcu; |
23 | u32 priomap_len; | 24 | u32 priomap_len; |
24 | u32 priomap[]; | 25 | u32 priomap[]; |
25 | }; | 26 | }; |
26 | 27 | ||
27 | #ifdef CONFIG_CGROUPS | ||
28 | |||
29 | struct cgroup_netprio_state { | 28 | struct cgroup_netprio_state { |
30 | struct cgroup_subsys_state css; | 29 | struct cgroup_subsys_state css; |
31 | u32 prioidx; | 30 | u32 prioidx; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | #ifndef CONFIG_NETPRIO_CGROUP | ||
35 | extern int net_prio_subsys_id; | ||
36 | #endif | ||
37 | |||
38 | extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); | 33 | extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); |
39 | 34 | ||
40 | #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) | 35 | #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) |
@@ -56,33 +51,28 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
56 | 51 | ||
57 | static inline u32 task_netprioidx(struct task_struct *p) | 52 | static inline u32 task_netprioidx(struct task_struct *p) |
58 | { | 53 | { |
59 | struct cgroup_netprio_state *state; | 54 | struct cgroup_subsys_state *css; |
60 | int subsys_id; | ||
61 | u32 idx = 0; | 55 | u32 idx = 0; |
62 | 56 | ||
63 | rcu_read_lock(); | 57 | rcu_read_lock(); |
64 | subsys_id = rcu_dereference_index_check(net_prio_subsys_id, | 58 | css = task_subsys_state(p, net_prio_subsys_id); |
65 | rcu_read_lock_held()); | 59 | if (css) |
66 | if (subsys_id >= 0) { | 60 | idx = container_of(css, |
67 | state = container_of(task_subsys_state(p, subsys_id), | 61 | struct cgroup_netprio_state, css)->prioidx; |
68 | struct cgroup_netprio_state, css); | ||
69 | idx = state->prioidx; | ||
70 | } | ||
71 | rcu_read_unlock(); | 62 | rcu_read_unlock(); |
72 | return idx; | 63 | return idx; |
73 | } | 64 | } |
65 | #endif | ||
74 | 66 | ||
75 | #else | 67 | #else /* !CONFIG_NETPRIO_CGROUP */ |
76 | 68 | ||
77 | static inline u32 task_netprioidx(struct task_struct *p) | 69 | static inline u32 task_netprioidx(struct task_struct *p) |
78 | { | 70 | { |
79 | return 0; | 71 | return 0; |
80 | } | 72 | } |
81 | 73 | ||
82 | #endif /* CONFIG_NETPRIO_CGROUP */ | ||
83 | |||
84 | #else | ||
85 | #define sock_update_netprioidx(sk, task) | 74 | #define sock_update_netprioidx(sk, task) |
86 | #endif | 75 | |
76 | #endif /* CONFIG_NETPRIO_CGROUP */ | ||
87 | 77 | ||
88 | #endif /* _NET_CLS_CGROUP_H */ | 78 | #endif /* _NET_CLS_CGROUP_H */ |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index f5169b04f082..e900072950cb 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -30,6 +30,11 @@ struct nfc_hci_ops { | |||
30 | int (*open) (struct nfc_hci_dev *hdev); | 30 | int (*open) (struct nfc_hci_dev *hdev); |
31 | void (*close) (struct nfc_hci_dev *hdev); | 31 | void (*close) (struct nfc_hci_dev *hdev); |
32 | int (*hci_ready) (struct nfc_hci_dev *hdev); | 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); |
33 | /* | ||
34 | * xmit must always send the complete buffer before | ||
35 | * returning. Returned result must be 0 for success | ||
36 | * or negative for failure. | ||
37 | */ | ||
33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
34 | int (*start_poll) (struct nfc_hci_dev *hdev, | 39 | int (*start_poll) (struct nfc_hci_dev *hdev, |
35 | u32 im_protocols, u32 tm_protocols); | 40 | u32 im_protocols, u32 tm_protocols); |
@@ -38,8 +43,8 @@ struct nfc_hci_ops { | |||
38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
39 | struct nfc_target *target); | 44 | struct nfc_target *target); |
40 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 45 | int (*data_exchange) (struct nfc_hci_dev *hdev, |
41 | struct nfc_target *target, | 46 | struct nfc_target *target, struct sk_buff *skb, |
42 | struct sk_buff *skb, struct sk_buff **res_skb); | 47 | data_exchange_cb_t cb, void *cb_context); |
43 | int (*check_presence)(struct nfc_hci_dev *hdev, | 48 | int (*check_presence)(struct nfc_hci_dev *hdev, |
44 | struct nfc_target *target); | 49 | struct nfc_target *target); |
45 | }; | 50 | }; |
@@ -74,7 +79,6 @@ struct nfc_hci_dev { | |||
74 | 79 | ||
75 | struct list_head msg_tx_queue; | 80 | struct list_head msg_tx_queue; |
76 | 81 | ||
77 | struct workqueue_struct *msg_tx_wq; | ||
78 | struct work_struct msg_tx_work; | 82 | struct work_struct msg_tx_work; |
79 | 83 | ||
80 | struct timer_list cmd_timer; | 84 | struct timer_list cmd_timer; |
@@ -82,13 +86,14 @@ struct nfc_hci_dev { | |||
82 | 86 | ||
83 | struct sk_buff_head rx_hcp_frags; | 87 | struct sk_buff_head rx_hcp_frags; |
84 | 88 | ||
85 | struct workqueue_struct *msg_rx_wq; | ||
86 | struct work_struct msg_rx_work; | 89 | struct work_struct msg_rx_work; |
87 | 90 | ||
88 | struct sk_buff_head msg_rx_queue; | 91 | struct sk_buff_head msg_rx_queue; |
89 | 92 | ||
90 | struct nfc_hci_ops *ops; | 93 | struct nfc_hci_ops *ops; |
91 | 94 | ||
95 | struct nfc_llc *llc; | ||
96 | |||
92 | struct nfc_hci_init_data init_data; | 97 | struct nfc_hci_init_data init_data; |
93 | 98 | ||
94 | void *clientdata; | 99 | void *clientdata; |
@@ -105,12 +110,17 @@ struct nfc_hci_dev { | |||
105 | u8 hw_mpw; | 110 | u8 hw_mpw; |
106 | u8 hw_software; | 111 | u8 hw_software; |
107 | u8 hw_bsid; | 112 | u8 hw_bsid; |
113 | |||
114 | int async_cb_type; | ||
115 | data_exchange_cb_t async_cb; | ||
116 | void *async_cb_context; | ||
108 | }; | 117 | }; |
109 | 118 | ||
110 | /* hci device allocation */ | 119 | /* hci device allocation */ |
111 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, | 120 | struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, |
112 | struct nfc_hci_init_data *init_data, | 121 | struct nfc_hci_init_data *init_data, |
113 | u32 protocols, | 122 | u32 protocols, |
123 | const char *llc_name, | ||
114 | int tx_headroom, | 124 | int tx_headroom, |
115 | int tx_tailroom, | 125 | int tx_tailroom, |
116 | int max_link_payload); | 126 | int max_link_payload); |
@@ -202,6 +212,9 @@ int nfc_hci_set_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, | |||
202 | const u8 *param, size_t param_len); | 212 | const u8 *param, size_t param_len); |
203 | int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | 213 | int nfc_hci_send_cmd(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, |
204 | const u8 *param, size_t param_len, struct sk_buff **skb); | 214 | const u8 *param, size_t param_len, struct sk_buff **skb); |
215 | int nfc_hci_send_cmd_async(struct nfc_hci_dev *hdev, u8 gate, u8 cmd, | ||
216 | const u8 *param, size_t param_len, | ||
217 | data_exchange_cb_t cb, void *cb_context); | ||
205 | int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | 218 | int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, |
206 | const u8 *param, size_t param_len); | 219 | const u8 *param, size_t param_len); |
207 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
diff --git a/include/net/nfc/llc.h b/include/net/nfc/llc.h new file mode 100644 index 000000000000..400ab7ae749d --- /dev/null +++ b/include/net/nfc/llc.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Link Layer Control manager public interface | ||
3 | * | ||
4 | * Copyright (C) 2012 Intel Corporation. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __NFC_LLC_H_ | ||
22 | #define __NFC_LLC_H_ | ||
23 | |||
24 | #include <net/nfc/hci.h> | ||
25 | #include <linux/skbuff.h> | ||
26 | |||
27 | #define LLC_NOP_NAME "nop" | ||
28 | #define LLC_SHDLC_NAME "shdlc" | ||
29 | |||
30 | typedef void (*rcv_to_hci_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
31 | typedef int (*xmit_to_drv_t) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
32 | typedef void (*llc_failure_t) (struct nfc_hci_dev *hdev, int err); | ||
33 | |||
34 | struct nfc_llc; | ||
35 | |||
36 | struct nfc_llc *nfc_llc_allocate(const char *name, struct nfc_hci_dev *hdev, | ||
37 | xmit_to_drv_t xmit_to_drv, | ||
38 | rcv_to_hci_t rcv_to_hci, int tx_headroom, | ||
39 | int tx_tailroom, llc_failure_t llc_failure); | ||
40 | void nfc_llc_free(struct nfc_llc *llc); | ||
41 | |||
42 | void nfc_llc_get_rx_head_tail_room(struct nfc_llc *llc, int *rx_headroom, | ||
43 | int *rx_tailroom); | ||
44 | |||
45 | |||
46 | int nfc_llc_start(struct nfc_llc *llc); | ||
47 | int nfc_llc_stop(struct nfc_llc *llc); | ||
48 | void nfc_llc_rcv_from_drv(struct nfc_llc *llc, struct sk_buff *skb); | ||
49 | int nfc_llc_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb); | ||
50 | |||
51 | int nfc_llc_init(void); | ||
52 | void nfc_llc_exit(void); | ||
53 | |||
54 | #endif /* __NFC_LLC_H_ */ | ||
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index 276094b91d7c..88785e5c6b2c 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define NCI_MAX_NUM_MAPPING_CONFIGS 10 | 32 | #define NCI_MAX_NUM_MAPPING_CONFIGS 10 |
33 | #define NCI_MAX_NUM_RF_CONFIGS 10 | 33 | #define NCI_MAX_NUM_RF_CONFIGS 10 |
34 | #define NCI_MAX_NUM_CONN 10 | 34 | #define NCI_MAX_NUM_CONN 10 |
35 | #define NCI_MAX_PARAM_LEN 251 | ||
35 | 36 | ||
36 | /* NCI Status Codes */ | 37 | /* NCI Status Codes */ |
37 | #define NCI_STATUS_OK 0x00 | 38 | #define NCI_STATUS_OK 0x00 |
@@ -102,6 +103,9 @@ | |||
102 | #define NCI_RF_INTERFACE_ISO_DEP 0x02 | 103 | #define NCI_RF_INTERFACE_ISO_DEP 0x02 |
103 | #define NCI_RF_INTERFACE_NFC_DEP 0x03 | 104 | #define NCI_RF_INTERFACE_NFC_DEP 0x03 |
104 | 105 | ||
106 | /* NCI Configuration Parameter Tags */ | ||
107 | #define NCI_PN_ATR_REQ_GEN_BYTES 0x29 | ||
108 | |||
105 | /* NCI Reset types */ | 109 | /* NCI Reset types */ |
106 | #define NCI_RESET_TYPE_KEEP_CONFIG 0x00 | 110 | #define NCI_RESET_TYPE_KEEP_CONFIG 0x00 |
107 | #define NCI_RESET_TYPE_RESET_CONFIG 0x01 | 111 | #define NCI_RESET_TYPE_RESET_CONFIG 0x01 |
@@ -188,6 +192,18 @@ struct nci_core_reset_cmd { | |||
188 | 192 | ||
189 | #define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01) | 193 | #define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01) |
190 | 194 | ||
195 | #define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02) | ||
196 | struct set_config_param { | ||
197 | __u8 id; | ||
198 | __u8 len; | ||
199 | __u8 val[NCI_MAX_PARAM_LEN]; | ||
200 | } __packed; | ||
201 | |||
202 | struct nci_core_set_config_cmd { | ||
203 | __u8 num_params; | ||
204 | struct set_config_param param; /* support 1 param per cmd is enough */ | ||
205 | } __packed; | ||
206 | |||
191 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 207 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
192 | struct disc_map_config { | 208 | struct disc_map_config { |
193 | __u8 rf_protocol; | 209 | __u8 rf_protocol; |
@@ -252,6 +268,13 @@ struct nci_core_init_rsp_2 { | |||
252 | __le32 manufact_specific_info; | 268 | __le32 manufact_specific_info; |
253 | } __packed; | 269 | } __packed; |
254 | 270 | ||
271 | #define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02) | ||
272 | struct nci_core_set_config_rsp { | ||
273 | __u8 status; | ||
274 | __u8 num_params; | ||
275 | __u8 params_id[0]; /* variable size array */ | ||
276 | } __packed; | ||
277 | |||
255 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | 278 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) |
256 | 279 | ||
257 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | 280 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) |
@@ -328,6 +351,11 @@ struct activation_params_nfcb_poll_iso_dep { | |||
328 | __u8 attrib_res[50]; | 351 | __u8 attrib_res[50]; |
329 | }; | 352 | }; |
330 | 353 | ||
354 | struct activation_params_poll_nfc_dep { | ||
355 | __u8 atr_res_len; | ||
356 | __u8 atr_res[63]; | ||
357 | }; | ||
358 | |||
331 | struct nci_rf_intf_activated_ntf { | 359 | struct nci_rf_intf_activated_ntf { |
332 | __u8 rf_discovery_id; | 360 | __u8 rf_discovery_id; |
333 | __u8 rf_interface; | 361 | __u8 rf_interface; |
@@ -351,6 +379,7 @@ struct nci_rf_intf_activated_ntf { | |||
351 | union { | 379 | union { |
352 | struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; | 380 | struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; |
353 | struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep; | 381 | struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep; |
382 | struct activation_params_poll_nfc_dep poll_nfc_dep; | ||
354 | } activation_params; | 383 | } activation_params; |
355 | 384 | ||
356 | } __packed; | 385 | } __packed; |
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index feba74027ff8..d705d8674949 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
@@ -54,6 +54,7 @@ enum nci_state { | |||
54 | /* NCI timeouts */ | 54 | /* NCI timeouts */ |
55 | #define NCI_RESET_TIMEOUT 5000 | 55 | #define NCI_RESET_TIMEOUT 5000 |
56 | #define NCI_INIT_TIMEOUT 5000 | 56 | #define NCI_INIT_TIMEOUT 5000 |
57 | #define NCI_SET_CONFIG_TIMEOUT 5000 | ||
57 | #define NCI_RF_DISC_TIMEOUT 5000 | 58 | #define NCI_RF_DISC_TIMEOUT 5000 |
58 | #define NCI_RF_DISC_SELECT_TIMEOUT 5000 | 59 | #define NCI_RF_DISC_SELECT_TIMEOUT 5000 |
59 | #define NCI_RF_DEACTIVATE_TIMEOUT 30000 | 60 | #define NCI_RF_DEACTIVATE_TIMEOUT 30000 |
@@ -137,6 +138,10 @@ struct nci_dev { | |||
137 | data_exchange_cb_t data_exchange_cb; | 138 | data_exchange_cb_t data_exchange_cb; |
138 | void *data_exchange_cb_context; | 139 | void *data_exchange_cb_context; |
139 | struct sk_buff *rx_data_reassembly; | 140 | struct sk_buff *rx_data_reassembly; |
141 | |||
142 | /* stored during intf_activated_ntf */ | ||
143 | __u8 remote_gb[NFC_MAX_GT_LEN]; | ||
144 | __u8 remote_gb_len; | ||
140 | }; | 145 | }; |
141 | 146 | ||
142 | /* ----- NCI Devices ----- */ | 147 | /* ----- NCI Devices ----- */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 6431f5e39022..f05b10682c9d 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -72,6 +72,7 @@ struct nfc_ops { | |||
72 | 72 | ||
73 | #define NFC_TARGET_IDX_ANY -1 | 73 | #define NFC_TARGET_IDX_ANY -1 |
74 | #define NFC_MAX_GT_LEN 48 | 74 | #define NFC_MAX_GT_LEN 48 |
75 | #define NFC_ATR_RES_GT_OFFSET 15 | ||
75 | 76 | ||
76 | struct nfc_target { | 77 | struct nfc_target { |
77 | u32 idx; | 78 | u32 idx; |
@@ -89,7 +90,7 @@ struct nfc_target { | |||
89 | }; | 90 | }; |
90 | 91 | ||
91 | struct nfc_genl_data { | 92 | struct nfc_genl_data { |
92 | u32 poll_req_pid; | 93 | u32 poll_req_portid; |
93 | struct mutex genl_data_mutex; | 94 | struct mutex genl_data_mutex; |
94 | }; | 95 | }; |
95 | 96 | ||
@@ -112,7 +113,6 @@ struct nfc_dev { | |||
112 | int tx_tailroom; | 113 | int tx_tailroom; |
113 | 114 | ||
114 | struct timer_list check_pres_timer; | 115 | struct timer_list check_pres_timer; |
115 | struct workqueue_struct *check_pres_wq; | ||
116 | struct work_struct check_pres_work; | 116 | struct work_struct check_pres_work; |
117 | 117 | ||
118 | struct nfc_ops *ops; | 118 | struct nfc_ops *ops; |
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h deleted file mode 100644 index 35e930d2f638..000000000000 --- a/include/net/nfc/shdlc.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Intel Corporation. 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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __NFC_SHDLC_H | ||
21 | #define __NFC_SHDLC_H | ||
22 | |||
23 | struct nfc_shdlc; | ||
24 | |||
25 | struct nfc_shdlc_ops { | ||
26 | int (*open) (struct nfc_shdlc *shdlc); | ||
27 | void (*close) (struct nfc_shdlc *shdlc); | ||
28 | int (*hci_ready) (struct nfc_shdlc *shdlc); | ||
29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); | ||
30 | int (*start_poll) (struct nfc_shdlc *shdlc, | ||
31 | u32 im_protocols, u32 tm_protocols); | ||
32 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, | ||
33 | struct nfc_target *target); | ||
34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | ||
35 | struct nfc_target *target); | ||
36 | int (*data_exchange) (struct nfc_shdlc *shdlc, | ||
37 | struct nfc_target *target, | ||
38 | struct sk_buff *skb, struct sk_buff **res_skb); | ||
39 | int (*check_presence)(struct nfc_shdlc *shdlc, | ||
40 | struct nfc_target *target); | ||
41 | }; | ||
42 | |||
43 | enum shdlc_state { | ||
44 | SHDLC_DISCONNECTED = 0, | ||
45 | SHDLC_CONNECTING = 1, | ||
46 | SHDLC_NEGOCIATING = 2, | ||
47 | SHDLC_CONNECTED = 3 | ||
48 | }; | ||
49 | |||
50 | struct nfc_shdlc { | ||
51 | struct mutex state_mutex; | ||
52 | enum shdlc_state state; | ||
53 | int hard_fault; | ||
54 | |||
55 | struct nfc_hci_dev *hdev; | ||
56 | |||
57 | wait_queue_head_t *connect_wq; | ||
58 | int connect_tries; | ||
59 | int connect_result; | ||
60 | struct timer_list connect_timer;/* aka T3 in spec 10.6.1 */ | ||
61 | |||
62 | u8 w; /* window size */ | ||
63 | bool srej_support; | ||
64 | |||
65 | struct timer_list t1_timer; /* send ack timeout */ | ||
66 | bool t1_active; | ||
67 | |||
68 | struct timer_list t2_timer; /* guard/retransmit timeout */ | ||
69 | bool t2_active; | ||
70 | |||
71 | int ns; /* next seq num for send */ | ||
72 | int nr; /* next expected seq num for receive */ | ||
73 | int dnr; /* oldest sent unacked seq num */ | ||
74 | |||
75 | struct sk_buff_head rcv_q; | ||
76 | |||
77 | struct sk_buff_head send_q; | ||
78 | bool rnr; /* other side is not ready to receive */ | ||
79 | |||
80 | struct sk_buff_head ack_pending_q; | ||
81 | |||
82 | struct workqueue_struct *sm_wq; | ||
83 | struct work_struct sm_work; | ||
84 | |||
85 | struct nfc_shdlc_ops *ops; | ||
86 | |||
87 | int client_headroom; | ||
88 | int client_tailroom; | ||
89 | |||
90 | void *clientdata; | ||
91 | }; | ||
92 | |||
93 | void nfc_shdlc_recv_frame(struct nfc_shdlc *shdlc, struct sk_buff *skb); | ||
94 | |||
95 | struct nfc_shdlc *nfc_shdlc_allocate(struct nfc_shdlc_ops *ops, | ||
96 | struct nfc_hci_init_data *init_data, | ||
97 | u32 protocols, | ||
98 | int tx_headroom, int tx_tailroom, | ||
99 | int max_link_payload, const char *devname); | ||
100 | |||
101 | void nfc_shdlc_free(struct nfc_shdlc *shdlc); | ||
102 | |||
103 | void nfc_shdlc_set_clientdata(struct nfc_shdlc *shdlc, void *clientdata); | ||
104 | void *nfc_shdlc_get_clientdata(struct nfc_shdlc *shdlc); | ||
105 | struct nfc_hci_dev *nfc_shdlc_get_hci_dev(struct nfc_shdlc *shdlc); | ||
106 | |||
107 | #endif /* __NFC_SHDLC_H */ | ||
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 4c0766e201e3..b01d8dd9ee7c 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -106,6 +106,34 @@ struct listen_sock { | |||
106 | struct request_sock *syn_table[0]; | 106 | struct request_sock *syn_table[0]; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /* | ||
110 | * For a TCP Fast Open listener - | ||
111 | * lock - protects the access to all the reqsk, which is co-owned by | ||
112 | * the listener and the child socket. | ||
113 | * qlen - pending TFO requests (still in TCP_SYN_RECV). | ||
114 | * max_qlen - max TFO reqs allowed before TFO is disabled. | ||
115 | * | ||
116 | * XXX (TFO) - ideally these fields can be made as part of "listen_sock" | ||
117 | * structure above. But there is some implementation difficulty due to | ||
118 | * listen_sock being part of request_sock_queue hence will be freed when | ||
119 | * a listener is stopped. But TFO related fields may continue to be | ||
120 | * accessed even after a listener is closed, until its sk_refcnt drops | ||
121 | * to 0 implying no more outstanding TFO reqs. One solution is to keep | ||
122 | * listen_opt around until sk_refcnt drops to 0. But there is some other | ||
123 | * complexity that needs to be resolved. E.g., a listener can be disabled | ||
124 | * temporarily through shutdown()->tcp_disconnect(), and re-enabled later. | ||
125 | */ | ||
126 | struct fastopen_queue { | ||
127 | struct request_sock *rskq_rst_head; /* Keep track of past TFO */ | ||
128 | struct request_sock *rskq_rst_tail; /* requests that caused RST. | ||
129 | * This is part of the defense | ||
130 | * against spoofing attack. | ||
131 | */ | ||
132 | spinlock_t lock; | ||
133 | int qlen; /* # of pending (TCP_SYN_RECV) reqs */ | ||
134 | int max_qlen; /* != 0 iff TFO is currently enabled */ | ||
135 | }; | ||
136 | |||
109 | /** struct request_sock_queue - queue of request_socks | 137 | /** struct request_sock_queue - queue of request_socks |
110 | * | 138 | * |
111 | * @rskq_accept_head - FIFO head of established children | 139 | * @rskq_accept_head - FIFO head of established children |
@@ -129,6 +157,12 @@ struct request_sock_queue { | |||
129 | u8 rskq_defer_accept; | 157 | u8 rskq_defer_accept; |
130 | /* 3 bytes hole, try to pack */ | 158 | /* 3 bytes hole, try to pack */ |
131 | struct listen_sock *listen_opt; | 159 | struct listen_sock *listen_opt; |
160 | struct fastopen_queue *fastopenq; /* This is non-NULL iff TFO has been | ||
161 | * enabled on this listener. Check | ||
162 | * max_qlen != 0 in fastopen_queue | ||
163 | * to determine if TFO is enabled | ||
164 | * right at this moment. | ||
165 | */ | ||
132 | }; | 166 | }; |
133 | 167 | ||
134 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, | 168 | extern int reqsk_queue_alloc(struct request_sock_queue *queue, |
@@ -136,6 +170,8 @@ extern int reqsk_queue_alloc(struct request_sock_queue *queue, | |||
136 | 170 | ||
137 | extern void __reqsk_queue_destroy(struct request_sock_queue *queue); | 171 | extern void __reqsk_queue_destroy(struct request_sock_queue *queue); |
138 | extern void reqsk_queue_destroy(struct request_sock_queue *queue); | 172 | extern void reqsk_queue_destroy(struct request_sock_queue *queue); |
173 | extern void reqsk_fastopen_remove(struct sock *sk, | ||
174 | struct request_sock *req, bool reset); | ||
139 | 175 | ||
140 | static inline struct request_sock * | 176 | static inline struct request_sock * |
141 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) | 177 | reqsk_queue_yank_acceptq(struct request_sock_queue *queue) |
@@ -190,19 +226,6 @@ static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue | |||
190 | return req; | 226 | return req; |
191 | } | 227 | } |
192 | 228 | ||
193 | static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queue, | ||
194 | struct sock *parent) | ||
195 | { | ||
196 | struct request_sock *req = reqsk_queue_remove(queue); | ||
197 | struct sock *child = req->sk; | ||
198 | |||
199 | WARN_ON(child == NULL); | ||
200 | |||
201 | sk_acceptq_removed(parent); | ||
202 | __reqsk_free(req); | ||
203 | return child; | ||
204 | } | ||
205 | |||
206 | static inline int reqsk_queue_removed(struct request_sock_queue *queue, | 229 | static inline int reqsk_queue_removed(struct request_sock_queue *queue, |
207 | struct request_sock *req) | 230 | struct request_sock *req) |
208 | { | 231 | { |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d9611e032418..4616f468d599 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -188,7 +188,8 @@ struct tcf_proto_ops { | |||
188 | 188 | ||
189 | unsigned long (*get)(struct tcf_proto*, u32 handle); | 189 | unsigned long (*get)(struct tcf_proto*, u32 handle); |
190 | void (*put)(struct tcf_proto*, unsigned long); | 190 | void (*put)(struct tcf_proto*, unsigned long); |
191 | int (*change)(struct tcf_proto*, unsigned long, | 191 | int (*change)(struct sk_buff *, |
192 | struct tcf_proto*, unsigned long, | ||
192 | u32 handle, struct nlattr **, | 193 | u32 handle, struct nlattr **, |
193 | unsigned long *); | 194 | unsigned long *); |
194 | int (*delete)(struct tcf_proto*, unsigned long); | 195 | int (*delete)(struct tcf_proto*, unsigned long); |
diff --git a/include/net/scm.h b/include/net/scm.h index 7dc0854f0b38..975cca01048b 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -12,6 +12,12 @@ | |||
12 | */ | 12 | */ |
13 | #define SCM_MAX_FD 253 | 13 | #define SCM_MAX_FD 253 |
14 | 14 | ||
15 | struct scm_creds { | ||
16 | u32 pid; | ||
17 | kuid_t uid; | ||
18 | kgid_t gid; | ||
19 | }; | ||
20 | |||
15 | struct scm_fp_list { | 21 | struct scm_fp_list { |
16 | short count; | 22 | short count; |
17 | short max; | 23 | short max; |
@@ -22,7 +28,7 @@ struct scm_cookie { | |||
22 | struct pid *pid; /* Skb credentials */ | 28 | struct pid *pid; /* Skb credentials */ |
23 | const struct cred *cred; | 29 | const struct cred *cred; |
24 | struct scm_fp_list *fp; /* Passed files */ | 30 | struct scm_fp_list *fp; /* Passed files */ |
25 | struct ucred creds; /* Skb credentials */ | 31 | struct scm_creds creds; /* Skb credentials */ |
26 | #ifdef CONFIG_SECURITY_NETWORK | 32 | #ifdef CONFIG_SECURITY_NETWORK |
27 | u32 secid; /* Passed security ID */ | 33 | u32 secid; /* Passed security ID */ |
28 | #endif | 34 | #endif |
@@ -49,7 +55,9 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, | |||
49 | { | 55 | { |
50 | scm->pid = get_pid(pid); | 56 | scm->pid = get_pid(pid); |
51 | scm->cred = cred ? get_cred(cred) : NULL; | 57 | scm->cred = cred ? get_cred(cred) : NULL; |
52 | cred_to_ucred(pid, cred, &scm->creds); | 58 | scm->creds.pid = pid_vnr(pid); |
59 | scm->creds.uid = cred ? cred->euid : INVALID_UID; | ||
60 | scm->creds.gid = cred ? cred->egid : INVALID_GID; | ||
53 | } | 61 | } |
54 | 62 | ||
55 | static __inline__ void scm_destroy_cred(struct scm_cookie *scm) | 63 | static __inline__ void scm_destroy_cred(struct scm_cookie *scm) |
@@ -65,7 +73,7 @@ static __inline__ void scm_destroy_cred(struct scm_cookie *scm) | |||
65 | static __inline__ void scm_destroy(struct scm_cookie *scm) | 73 | static __inline__ void scm_destroy(struct scm_cookie *scm) |
66 | { | 74 | { |
67 | scm_destroy_cred(scm); | 75 | scm_destroy_cred(scm); |
68 | if (scm && scm->fp) | 76 | if (scm->fp) |
69 | __scm_destroy(scm); | 77 | __scm_destroy(scm); |
70 | } | 78 | } |
71 | 79 | ||
@@ -112,8 +120,15 @@ static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | |||
112 | return; | 120 | return; |
113 | } | 121 | } |
114 | 122 | ||
115 | if (test_bit(SOCK_PASSCRED, &sock->flags)) | 123 | if (test_bit(SOCK_PASSCRED, &sock->flags)) { |
116 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); | 124 | struct user_namespace *current_ns = current_user_ns(); |
125 | struct ucred ucreds = { | ||
126 | .pid = scm->creds.pid, | ||
127 | .uid = from_kuid_munged(current_ns, scm->creds.uid), | ||
128 | .gid = from_kgid_munged(current_ns, scm->creds.gid), | ||
129 | }; | ||
130 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(ucreds), &ucreds); | ||
131 | } | ||
117 | 132 | ||
118 | scm_destroy_cred(scm); | 133 | scm_destroy_cred(scm); |
119 | 134 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ff499640528b..9c6414f553f9 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -114,13 +114,12 @@ | |||
114 | /* | 114 | /* |
115 | * sctp/protocol.c | 115 | * sctp/protocol.c |
116 | */ | 116 | */ |
117 | extern struct sock *sctp_get_ctl_sock(void); | 117 | extern int sctp_copy_local_addr_list(struct net *, struct sctp_bind_addr *, |
118 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, | ||
119 | sctp_scope_t, gfp_t gfp, | 118 | sctp_scope_t, gfp_t gfp, |
120 | int flags); | 119 | int flags); |
121 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 120 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
122 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 121 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); |
123 | extern void sctp_addr_wq_mgmt(struct sctp_sockaddr_entry *, int); | 122 | extern void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int); |
124 | 123 | ||
125 | /* | 124 | /* |
126 | * sctp/socket.c | 125 | * sctp/socket.c |
@@ -140,12 +139,12 @@ extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); | |||
140 | /* | 139 | /* |
141 | * sctp/primitive.c | 140 | * sctp/primitive.c |
142 | */ | 141 | */ |
143 | int sctp_primitive_ASSOCIATE(struct sctp_association *, void *arg); | 142 | int sctp_primitive_ASSOCIATE(struct net *, struct sctp_association *, void *arg); |
144 | int sctp_primitive_SHUTDOWN(struct sctp_association *, void *arg); | 143 | int sctp_primitive_SHUTDOWN(struct net *, struct sctp_association *, void *arg); |
145 | int sctp_primitive_ABORT(struct sctp_association *, void *arg); | 144 | int sctp_primitive_ABORT(struct net *, struct sctp_association *, void *arg); |
146 | int sctp_primitive_SEND(struct sctp_association *, void *arg); | 145 | int sctp_primitive_SEND(struct net *, struct sctp_association *, void *arg); |
147 | int sctp_primitive_REQUESTHEARTBEAT(struct sctp_association *, void *arg); | 146 | int sctp_primitive_REQUESTHEARTBEAT(struct net *, struct sctp_association *, void *arg); |
148 | int sctp_primitive_ASCONF(struct sctp_association *, void *arg); | 147 | int sctp_primitive_ASCONF(struct net *, struct sctp_association *, void *arg); |
149 | 148 | ||
150 | /* | 149 | /* |
151 | * sctp/input.c | 150 | * sctp/input.c |
@@ -156,7 +155,7 @@ void sctp_hash_established(struct sctp_association *); | |||
156 | void sctp_unhash_established(struct sctp_association *); | 155 | void sctp_unhash_established(struct sctp_association *); |
157 | void sctp_hash_endpoint(struct sctp_endpoint *); | 156 | void sctp_hash_endpoint(struct sctp_endpoint *); |
158 | void sctp_unhash_endpoint(struct sctp_endpoint *); | 157 | void sctp_unhash_endpoint(struct sctp_endpoint *); |
159 | struct sock *sctp_err_lookup(int family, struct sk_buff *, | 158 | struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, |
160 | struct sctphdr *, struct sctp_association **, | 159 | struct sctphdr *, struct sctp_association **, |
161 | struct sctp_transport **); | 160 | struct sctp_transport **); |
162 | void sctp_err_finish(struct sock *, struct sctp_association *); | 161 | void sctp_err_finish(struct sock *, struct sctp_association *); |
@@ -173,14 +172,14 @@ void sctp_backlog_migrate(struct sctp_association *assoc, | |||
173 | /* | 172 | /* |
174 | * sctp/proc.c | 173 | * sctp/proc.c |
175 | */ | 174 | */ |
176 | int sctp_snmp_proc_init(void); | 175 | int sctp_snmp_proc_init(struct net *net); |
177 | void sctp_snmp_proc_exit(void); | 176 | void sctp_snmp_proc_exit(struct net *net); |
178 | int sctp_eps_proc_init(void); | 177 | int sctp_eps_proc_init(struct net *net); |
179 | void sctp_eps_proc_exit(void); | 178 | void sctp_eps_proc_exit(struct net *net); |
180 | int sctp_assocs_proc_init(void); | 179 | int sctp_assocs_proc_init(struct net *net); |
181 | void sctp_assocs_proc_exit(void); | 180 | void sctp_assocs_proc_exit(struct net *net); |
182 | int sctp_remaddr_proc_init(void); | 181 | int sctp_remaddr_proc_init(struct net *net); |
183 | void sctp_remaddr_proc_exit(void); | 182 | void sctp_remaddr_proc_exit(struct net *net); |
184 | 183 | ||
185 | 184 | ||
186 | /* | 185 | /* |
@@ -222,11 +221,10 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; | |||
222 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) | 221 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) |
223 | 222 | ||
224 | /* SCTP SNMP MIB stats handlers */ | 223 | /* SCTP SNMP MIB stats handlers */ |
225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | 224 | #define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) |
226 | #define SCTP_INC_STATS(field) SNMP_INC_STATS(sctp_statistics, field) | 225 | #define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) |
227 | #define SCTP_INC_STATS_BH(field) SNMP_INC_STATS_BH(sctp_statistics, field) | 226 | #define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field) |
228 | #define SCTP_INC_STATS_USER(field) SNMP_INC_STATS_USER(sctp_statistics, field) | 227 | #define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field) |
229 | #define SCTP_DEC_STATS(field) SNMP_DEC_STATS(sctp_statistics, field) | ||
230 | 228 | ||
231 | #endif /* !TEST_FRAME */ | 229 | #endif /* !TEST_FRAME */ |
232 | 230 | ||
@@ -361,25 +359,29 @@ atomic_t sctp_dbg_objcnt_## name = ATOMIC_INIT(0) | |||
361 | #define SCTP_DBG_OBJCNT_ENTRY(name) \ | 359 | #define SCTP_DBG_OBJCNT_ENTRY(name) \ |
362 | {.label= #name, .counter= &sctp_dbg_objcnt_## name} | 360 | {.label= #name, .counter= &sctp_dbg_objcnt_## name} |
363 | 361 | ||
364 | void sctp_dbg_objcnt_init(void); | 362 | void sctp_dbg_objcnt_init(struct net *); |
365 | void sctp_dbg_objcnt_exit(void); | 363 | void sctp_dbg_objcnt_exit(struct net *); |
366 | 364 | ||
367 | #else | 365 | #else |
368 | 366 | ||
369 | #define SCTP_DBG_OBJCNT_INC(name) | 367 | #define SCTP_DBG_OBJCNT_INC(name) |
370 | #define SCTP_DBG_OBJCNT_DEC(name) | 368 | #define SCTP_DBG_OBJCNT_DEC(name) |
371 | 369 | ||
372 | static inline void sctp_dbg_objcnt_init(void) { return; } | 370 | static inline void sctp_dbg_objcnt_init(struct net *net) { return; } |
373 | static inline void sctp_dbg_objcnt_exit(void) { return; } | 371 | static inline void sctp_dbg_objcnt_exit(struct net *net) { return; } |
374 | 372 | ||
375 | #endif /* CONFIG_SCTP_DBG_OBJCOUNT */ | 373 | #endif /* CONFIG_SCTP_DBG_OBJCOUNT */ |
376 | 374 | ||
377 | #if defined CONFIG_SYSCTL | 375 | #if defined CONFIG_SYSCTL |
378 | void sctp_sysctl_register(void); | 376 | void sctp_sysctl_register(void); |
379 | void sctp_sysctl_unregister(void); | 377 | void sctp_sysctl_unregister(void); |
378 | int sctp_sysctl_net_register(struct net *net); | ||
379 | void sctp_sysctl_net_unregister(struct net *net); | ||
380 | #else | 380 | #else |
381 | static inline void sctp_sysctl_register(void) { return; } | 381 | static inline void sctp_sysctl_register(void) { return; } |
382 | static inline void sctp_sysctl_unregister(void) { return; } | 382 | static inline void sctp_sysctl_unregister(void) { return; } |
383 | static inline int sctp_sysctl_net_register(struct net *net) { return 0; } | ||
384 | static inline void sctp_sysctl_net_unregister(struct net *net) { return; } | ||
383 | #endif | 385 | #endif |
384 | 386 | ||
385 | /* Size of Supported Address Parameter for 'x' address types. */ | 387 | /* Size of Supported Address Parameter for 'x' address types. */ |
@@ -586,7 +588,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\ | |||
586 | 588 | ||
587 | extern struct proto sctp_prot; | 589 | extern struct proto sctp_prot; |
588 | extern struct proto sctpv6_prot; | 590 | extern struct proto sctpv6_prot; |
589 | extern struct proc_dir_entry *proc_net_sctp; | ||
590 | void sctp_put_port(struct sock *sk); | 591 | void sctp_put_port(struct sock *sk); |
591 | 592 | ||
592 | extern struct idr sctp_assocs_id; | 593 | extern struct idr sctp_assocs_id; |
@@ -632,21 +633,21 @@ static inline int sctp_sanity_check(void) | |||
632 | 633 | ||
633 | /* Warning: The following hash functions assume a power of two 'size'. */ | 634 | /* Warning: The following hash functions assume a power of two 'size'. */ |
634 | /* This is the hash function for the SCTP port hash table. */ | 635 | /* This is the hash function for the SCTP port hash table. */ |
635 | static inline int sctp_phashfn(__u16 lport) | 636 | static inline int sctp_phashfn(struct net *net, __u16 lport) |
636 | { | 637 | { |
637 | return lport & (sctp_port_hashsize - 1); | 638 | return (net_hash_mix(net) + lport) & (sctp_port_hashsize - 1); |
638 | } | 639 | } |
639 | 640 | ||
640 | /* This is the hash function for the endpoint hash table. */ | 641 | /* This is the hash function for the endpoint hash table. */ |
641 | static inline int sctp_ep_hashfn(__u16 lport) | 642 | static inline int sctp_ep_hashfn(struct net *net, __u16 lport) |
642 | { | 643 | { |
643 | return lport & (sctp_ep_hashsize - 1); | 644 | return (net_hash_mix(net) + lport) & (sctp_ep_hashsize - 1); |
644 | } | 645 | } |
645 | 646 | ||
646 | /* This is the hash function for the association hash table. */ | 647 | /* This is the hash function for the association hash table. */ |
647 | static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport) | 648 | static inline int sctp_assoc_hashfn(struct net *net, __u16 lport, __u16 rport) |
648 | { | 649 | { |
649 | int h = (lport << 16) + rport; | 650 | int h = (lport << 16) + rport + net_hash_mix(net); |
650 | h ^= h>>8; | 651 | h ^= h>>8; |
651 | return h & (sctp_assoc_hashsize - 1); | 652 | return h & (sctp_assoc_hashsize - 1); |
652 | } | 653 | } |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 9148632b8204..b5887e1677e4 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -77,7 +77,8 @@ typedef struct { | |||
77 | int action; | 77 | int action; |
78 | } sctp_sm_command_t; | 78 | } sctp_sm_command_t; |
79 | 79 | ||
80 | typedef sctp_disposition_t (sctp_state_fn_t) (const struct sctp_endpoint *, | 80 | typedef sctp_disposition_t (sctp_state_fn_t) (struct net *, |
81 | const struct sctp_endpoint *, | ||
81 | const struct sctp_association *, | 82 | const struct sctp_association *, |
82 | const sctp_subtype_t type, | 83 | const sctp_subtype_t type, |
83 | void *arg, | 84 | void *arg, |
@@ -178,7 +179,8 @@ sctp_state_fn_t sctp_sf_autoclose_timer_expire; | |||
178 | 179 | ||
179 | /* Prototypes for utility support functions. */ | 180 | /* Prototypes for utility support functions. */ |
180 | __u8 sctp_get_chunk_type(struct sctp_chunk *chunk); | 181 | __u8 sctp_get_chunk_type(struct sctp_chunk *chunk); |
181 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t, | 182 | const sctp_sm_table_entry_t *sctp_sm_lookup_event(struct net *, |
183 | sctp_event_t, | ||
182 | sctp_state_t, | 184 | sctp_state_t, |
183 | sctp_subtype_t); | 185 | sctp_subtype_t); |
184 | int sctp_chunk_iif(const struct sctp_chunk *); | 186 | int sctp_chunk_iif(const struct sctp_chunk *); |
@@ -268,7 +270,7 @@ void sctp_chunk_assign_ssn(struct sctp_chunk *); | |||
268 | 270 | ||
269 | /* Prototypes for statetable processing. */ | 271 | /* Prototypes for statetable processing. */ |
270 | 272 | ||
271 | int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, | 273 | int sctp_do_sm(struct net *net, sctp_event_t event_type, sctp_subtype_t subtype, |
272 | sctp_state_t state, | 274 | sctp_state_t state, |
273 | struct sctp_endpoint *, | 275 | struct sctp_endpoint *, |
274 | struct sctp_association *asoc, | 276 | struct sctp_association *asoc, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index fc5e60016e37..0fef00f5d3ce 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -102,6 +102,7 @@ struct sctp_bind_bucket { | |||
102 | unsigned short fastreuse; | 102 | unsigned short fastreuse; |
103 | struct hlist_node node; | 103 | struct hlist_node node; |
104 | struct hlist_head owner; | 104 | struct hlist_head owner; |
105 | struct net *net; | ||
105 | }; | 106 | }; |
106 | 107 | ||
107 | struct sctp_bind_hashbucket { | 108 | struct sctp_bind_hashbucket { |
@@ -118,69 +119,6 @@ struct sctp_hashbucket { | |||
118 | 119 | ||
119 | /* The SCTP globals structure. */ | 120 | /* The SCTP globals structure. */ |
120 | extern struct sctp_globals { | 121 | extern struct sctp_globals { |
121 | /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values | ||
122 | * | ||
123 | * The following protocol parameters are RECOMMENDED: | ||
124 | * | ||
125 | * RTO.Initial - 3 seconds | ||
126 | * RTO.Min - 1 second | ||
127 | * RTO.Max - 60 seconds | ||
128 | * RTO.Alpha - 1/8 (3 when converted to right shifts.) | ||
129 | * RTO.Beta - 1/4 (2 when converted to right shifts.) | ||
130 | */ | ||
131 | unsigned int rto_initial; | ||
132 | unsigned int rto_min; | ||
133 | unsigned int rto_max; | ||
134 | |||
135 | /* Note: rto_alpha and rto_beta are really defined as inverse | ||
136 | * powers of two to facilitate integer operations. | ||
137 | */ | ||
138 | int rto_alpha; | ||
139 | int rto_beta; | ||
140 | |||
141 | /* Max.Burst - 4 */ | ||
142 | int max_burst; | ||
143 | |||
144 | /* Whether Cookie Preservative is enabled(1) or not(0) */ | ||
145 | int cookie_preserve_enable; | ||
146 | |||
147 | /* Valid.Cookie.Life - 60 seconds */ | ||
148 | unsigned int valid_cookie_life; | ||
149 | |||
150 | /* Delayed SACK timeout 200ms default*/ | ||
151 | unsigned int sack_timeout; | ||
152 | |||
153 | /* HB.interval - 30 seconds */ | ||
154 | unsigned int hb_interval; | ||
155 | |||
156 | /* Association.Max.Retrans - 10 attempts | ||
157 | * Path.Max.Retrans - 5 attempts (per destination address) | ||
158 | * Max.Init.Retransmits - 8 attempts | ||
159 | */ | ||
160 | int max_retrans_association; | ||
161 | int max_retrans_path; | ||
162 | int max_retrans_init; | ||
163 | |||
164 | /* Potentially-Failed.Max.Retrans sysctl value | ||
165 | * taken from: | ||
166 | * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05 | ||
167 | */ | ||
168 | int pf_retrans; | ||
169 | |||
170 | /* | ||
171 | * Policy for preforming sctp/socket accounting | ||
172 | * 0 - do socket level accounting, all assocs share sk_sndbuf | ||
173 | * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes | ||
174 | */ | ||
175 | int sndbuf_policy; | ||
176 | |||
177 | /* | ||
178 | * Policy for preforming sctp/socket accounting | ||
179 | * 0 - do socket level accounting, all assocs share sk_rcvbuf | ||
180 | * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes | ||
181 | */ | ||
182 | int rcvbuf_policy; | ||
183 | |||
184 | /* The following variables are implementation specific. */ | 122 | /* The following variables are implementation specific. */ |
185 | 123 | ||
186 | /* Default initialization values to be applied to new associations. */ | 124 | /* Default initialization values to be applied to new associations. */ |
@@ -204,70 +142,11 @@ extern struct sctp_globals { | |||
204 | int port_hashsize; | 142 | int port_hashsize; |
205 | struct sctp_bind_hashbucket *port_hashtable; | 143 | struct sctp_bind_hashbucket *port_hashtable; |
206 | 144 | ||
207 | /* This is the global local address list. | ||
208 | * We actively maintain this complete list of addresses on | ||
209 | * the system by catching address add/delete events. | ||
210 | * | ||
211 | * It is a list of sctp_sockaddr_entry. | ||
212 | */ | ||
213 | struct list_head local_addr_list; | ||
214 | int default_auto_asconf; | ||
215 | struct list_head addr_waitq; | ||
216 | struct timer_list addr_wq_timer; | ||
217 | struct list_head auto_asconf_splist; | ||
218 | spinlock_t addr_wq_lock; | ||
219 | |||
220 | /* Lock that protects the local_addr_list writers */ | ||
221 | spinlock_t addr_list_lock; | ||
222 | |||
223 | /* Flag to indicate if addip is enabled. */ | ||
224 | int addip_enable; | ||
225 | int addip_noauth_enable; | ||
226 | |||
227 | /* Flag to indicate if PR-SCTP is enabled. */ | ||
228 | int prsctp_enable; | ||
229 | |||
230 | /* Flag to idicate if SCTP-AUTH is enabled */ | ||
231 | int auth_enable; | ||
232 | |||
233 | /* | ||
234 | * Policy to control SCTP IPv4 address scoping | ||
235 | * 0 - Disable IPv4 address scoping | ||
236 | * 1 - Enable IPv4 address scoping | ||
237 | * 2 - Selectively allow only IPv4 private addresses | ||
238 | * 3 - Selectively allow only IPv4 link local address | ||
239 | */ | ||
240 | int ipv4_scope_policy; | ||
241 | |||
242 | /* Flag to indicate whether computing and verifying checksum | 145 | /* Flag to indicate whether computing and verifying checksum |
243 | * is disabled. */ | 146 | * is disabled. */ |
244 | bool checksum_disable; | 147 | bool checksum_disable; |
245 | |||
246 | /* Threshold for rwnd update SACKS. Receive buffer shifted this many | ||
247 | * bits is an indicator of when to send and window update SACK. | ||
248 | */ | ||
249 | int rwnd_update_shift; | ||
250 | |||
251 | /* Threshold for autoclose timeout, in seconds. */ | ||
252 | unsigned long max_autoclose; | ||
253 | } sctp_globals; | 148 | } sctp_globals; |
254 | 149 | ||
255 | #define sctp_rto_initial (sctp_globals.rto_initial) | ||
256 | #define sctp_rto_min (sctp_globals.rto_min) | ||
257 | #define sctp_rto_max (sctp_globals.rto_max) | ||
258 | #define sctp_rto_alpha (sctp_globals.rto_alpha) | ||
259 | #define sctp_rto_beta (sctp_globals.rto_beta) | ||
260 | #define sctp_max_burst (sctp_globals.max_burst) | ||
261 | #define sctp_valid_cookie_life (sctp_globals.valid_cookie_life) | ||
262 | #define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable) | ||
263 | #define sctp_max_retrans_association (sctp_globals.max_retrans_association) | ||
264 | #define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) | ||
265 | #define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy) | ||
266 | #define sctp_max_retrans_path (sctp_globals.max_retrans_path) | ||
267 | #define sctp_pf_retrans (sctp_globals.pf_retrans) | ||
268 | #define sctp_max_retrans_init (sctp_globals.max_retrans_init) | ||
269 | #define sctp_sack_timeout (sctp_globals.sack_timeout) | ||
270 | #define sctp_hb_interval (sctp_globals.hb_interval) | ||
271 | #define sctp_max_instreams (sctp_globals.max_instreams) | 150 | #define sctp_max_instreams (sctp_globals.max_instreams) |
272 | #define sctp_max_outstreams (sctp_globals.max_outstreams) | 151 | #define sctp_max_outstreams (sctp_globals.max_outstreams) |
273 | #define sctp_address_families (sctp_globals.address_families) | 152 | #define sctp_address_families (sctp_globals.address_families) |
@@ -277,21 +156,7 @@ extern struct sctp_globals { | |||
277 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) | 156 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) |
278 | #define sctp_port_hashsize (sctp_globals.port_hashsize) | 157 | #define sctp_port_hashsize (sctp_globals.port_hashsize) |
279 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 158 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
280 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | ||
281 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) | ||
282 | #define sctp_auto_asconf_splist (sctp_globals.auto_asconf_splist) | ||
283 | #define sctp_addr_waitq (sctp_globals.addr_waitq) | ||
284 | #define sctp_addr_wq_timer (sctp_globals.addr_wq_timer) | ||
285 | #define sctp_addr_wq_lock (sctp_globals.addr_wq_lock) | ||
286 | #define sctp_default_auto_asconf (sctp_globals.default_auto_asconf) | ||
287 | #define sctp_scope_policy (sctp_globals.ipv4_scope_policy) | ||
288 | #define sctp_addip_enable (sctp_globals.addip_enable) | ||
289 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) | ||
290 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | ||
291 | #define sctp_auth_enable (sctp_globals.auth_enable) | ||
292 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | 159 | #define sctp_checksum_disable (sctp_globals.checksum_disable) |
293 | #define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift) | ||
294 | #define sctp_max_autoclose (sctp_globals.max_autoclose) | ||
295 | 160 | ||
296 | /* SCTP Socket type: UDP or TCP style. */ | 161 | /* SCTP Socket type: UDP or TCP style. */ |
297 | typedef enum { | 162 | typedef enum { |
@@ -1085,7 +950,7 @@ struct sctp_transport { | |||
1085 | __u64 hb_nonce; | 950 | __u64 hb_nonce; |
1086 | }; | 951 | }; |
1087 | 952 | ||
1088 | struct sctp_transport *sctp_transport_new(const union sctp_addr *, | 953 | struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, |
1089 | gfp_t); | 954 | gfp_t); |
1090 | void sctp_transport_set_owner(struct sctp_transport *, | 955 | void sctp_transport_set_owner(struct sctp_transport *, |
1091 | struct sctp_association *); | 956 | struct sctp_association *); |
@@ -1240,7 +1105,7 @@ struct sctp_bind_addr { | |||
1240 | 1105 | ||
1241 | void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); | 1106 | void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); |
1242 | void sctp_bind_addr_free(struct sctp_bind_addr *); | 1107 | void sctp_bind_addr_free(struct sctp_bind_addr *); |
1243 | int sctp_bind_addr_copy(struct sctp_bind_addr *dest, | 1108 | int sctp_bind_addr_copy(struct net *net, struct sctp_bind_addr *dest, |
1244 | const struct sctp_bind_addr *src, | 1109 | const struct sctp_bind_addr *src, |
1245 | sctp_scope_t scope, gfp_t gfp, | 1110 | sctp_scope_t scope, gfp_t gfp, |
1246 | int flags); | 1111 | int flags); |
@@ -1267,7 +1132,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, | |||
1267 | __u16 port, gfp_t gfp); | 1132 | __u16 port, gfp_t gfp); |
1268 | 1133 | ||
1269 | sctp_scope_t sctp_scope(const union sctp_addr *); | 1134 | sctp_scope_t sctp_scope(const union sctp_addr *); |
1270 | int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); | 1135 | int sctp_in_scope(struct net *net, const union sctp_addr *addr, const sctp_scope_t scope); |
1271 | int sctp_is_any(struct sock *sk, const union sctp_addr *addr); | 1136 | int sctp_is_any(struct sock *sk, const union sctp_addr *addr); |
1272 | int sctp_addr_is_valid(const union sctp_addr *addr); | 1137 | int sctp_addr_is_valid(const union sctp_addr *addr); |
1273 | int sctp_is_ep_boundall(struct sock *sk); | 1138 | int sctp_is_ep_boundall(struct sock *sk); |
@@ -1425,13 +1290,13 @@ struct sctp_association *sctp_endpoint_lookup_assoc( | |||
1425 | int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, | 1290 | int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, |
1426 | const union sctp_addr *); | 1291 | const union sctp_addr *); |
1427 | struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, | 1292 | struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, |
1428 | const union sctp_addr *); | 1293 | struct net *, const union sctp_addr *); |
1429 | int sctp_has_association(const union sctp_addr *laddr, | 1294 | int sctp_has_association(struct net *net, const union sctp_addr *laddr, |
1430 | const union sctp_addr *paddr); | 1295 | const union sctp_addr *paddr); |
1431 | 1296 | ||
1432 | int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, | 1297 | int sctp_verify_init(struct net *net, const struct sctp_association *asoc, |
1433 | sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, | 1298 | sctp_cid_t, sctp_init_chunk_t *peer_init, |
1434 | struct sctp_chunk **err_chunk); | 1299 | struct sctp_chunk *chunk, struct sctp_chunk **err_chunk); |
1435 | int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, | 1300 | int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, |
1436 | const union sctp_addr *peer, | 1301 | const union sctp_addr *peer, |
1437 | sctp_init_chunk_t *init, gfp_t gfp); | 1302 | sctp_init_chunk_t *init, gfp_t gfp); |
@@ -2013,6 +1878,7 @@ void sctp_assoc_control_transport(struct sctp_association *, | |||
2013 | sctp_transport_cmd_t, sctp_sn_error_t); | 1878 | sctp_transport_cmd_t, sctp_sn_error_t); |
2014 | struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *, __u32); | 1879 | struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *, __u32); |
2015 | struct sctp_transport *sctp_assoc_is_match(struct sctp_association *, | 1880 | struct sctp_transport *sctp_assoc_is_match(struct sctp_association *, |
1881 | struct net *, | ||
2016 | const union sctp_addr *, | 1882 | const union sctp_addr *, |
2017 | const union sctp_addr *); | 1883 | const union sctp_addr *); |
2018 | void sctp_assoc_migrate(struct sctp_association *, struct sock *); | 1884 | void sctp_assoc_migrate(struct sctp_association *, struct sock *); |
diff --git a/include/net/snmp.h b/include/net/snmp.h index 0147b901e79c..71596261fa99 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -154,13 +154,15 @@ struct linux_xfrm_mib { | |||
154 | */ | 154 | */ |
155 | #define SNMP_UPD_PO_STATS(mib, basefield, addend) \ | 155 | #define SNMP_UPD_PO_STATS(mib, basefield, addend) \ |
156 | do { \ | 156 | do { \ |
157 | this_cpu_inc(mib[0]->mibs[basefield##PKTS]); \ | 157 | __typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \ |
158 | this_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \ | 158 | this_cpu_inc(ptr[basefield##PKTS]); \ |
159 | this_cpu_add(ptr[basefield##OCTETS], addend); \ | ||
159 | } while (0) | 160 | } while (0) |
160 | #define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ | 161 | #define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ |
161 | do { \ | 162 | do { \ |
162 | __this_cpu_inc(mib[0]->mibs[basefield##PKTS]); \ | 163 | __typeof__(*mib[0]->mibs) *ptr = mib[0]->mibs; \ |
163 | __this_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \ | 164 | __this_cpu_inc(ptr[basefield##PKTS]); \ |
165 | __this_cpu_add(ptr[basefield##OCTETS], addend); \ | ||
164 | } while (0) | 166 | } while (0) |
165 | 167 | ||
166 | 168 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index adb7da20b5a1..c945fba4f543 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -247,8 +247,7 @@ struct cg_proto; | |||
247 | * @sk_stamp: time stamp of last packet received | 247 | * @sk_stamp: time stamp of last packet received |
248 | * @sk_socket: Identd and reporting IO signals | 248 | * @sk_socket: Identd and reporting IO signals |
249 | * @sk_user_data: RPC layer private data | 249 | * @sk_user_data: RPC layer private data |
250 | * @sk_sndmsg_page: cached page for sendmsg | 250 | * @sk_frag: cached page frag |
251 | * @sk_sndmsg_off: cached offset for sendmsg | ||
252 | * @sk_peek_off: current peek_offset value | 251 | * @sk_peek_off: current peek_offset value |
253 | * @sk_send_head: front of stuff to transmit | 252 | * @sk_send_head: front of stuff to transmit |
254 | * @sk_security: used by security modules | 253 | * @sk_security: used by security modules |
@@ -362,9 +361,8 @@ struct sock { | |||
362 | ktime_t sk_stamp; | 361 | ktime_t sk_stamp; |
363 | struct socket *sk_socket; | 362 | struct socket *sk_socket; |
364 | void *sk_user_data; | 363 | void *sk_user_data; |
365 | struct page *sk_sndmsg_page; | 364 | struct page_frag sk_frag; |
366 | struct sk_buff *sk_send_head; | 365 | struct sk_buff *sk_send_head; |
367 | __u32 sk_sndmsg_off; | ||
368 | __s32 sk_peek_off; | 366 | __s32 sk_peek_off; |
369 | int sk_write_pending; | 367 | int sk_write_pending; |
370 | #ifdef CONFIG_SECURITY | 368 | #ifdef CONFIG_SECURITY |
@@ -606,6 +604,15 @@ static inline void sk_add_bind_node(struct sock *sk, | |||
606 | #define sk_for_each_bound(__sk, node, list) \ | 604 | #define sk_for_each_bound(__sk, node, list) \ |
607 | hlist_for_each_entry(__sk, node, list, sk_bind_node) | 605 | hlist_for_each_entry(__sk, node, list, sk_bind_node) |
608 | 606 | ||
607 | static inline struct user_namespace *sk_user_ns(struct sock *sk) | ||
608 | { | ||
609 | /* Careful only use this in a context where these parameters | ||
610 | * can not change and must all be valid, such as recvmsg from | ||
611 | * userspace. | ||
612 | */ | ||
613 | return sk->sk_socket->file->f_cred->user_ns; | ||
614 | } | ||
615 | |||
609 | /* Sock flags */ | 616 | /* Sock flags */ |
610 | enum sock_flags { | 617 | enum sock_flags { |
611 | SOCK_DEAD, | 618 | SOCK_DEAD, |
@@ -1486,14 +1493,6 @@ extern void *sock_kmalloc(struct sock *sk, int size, | |||
1486 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 1493 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
1487 | extern void sk_send_sigurg(struct sock *sk); | 1494 | extern void sk_send_sigurg(struct sock *sk); |
1488 | 1495 | ||
1489 | #ifdef CONFIG_CGROUPS | ||
1490 | extern void sock_update_classid(struct sock *sk); | ||
1491 | #else | ||
1492 | static inline void sock_update_classid(struct sock *sk) | ||
1493 | { | ||
1494 | } | ||
1495 | #endif | ||
1496 | |||
1497 | /* | 1496 | /* |
1498 | * Functions to fill in entries in struct proto_ops when a protocol | 1497 | * Functions to fill in entries in struct proto_ops when a protocol |
1499 | * does not implement a particular function. | 1498 | * does not implement a particular function. |
@@ -1670,7 +1669,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) | |||
1670 | write_unlock_bh(&sk->sk_callback_lock); | 1669 | write_unlock_bh(&sk->sk_callback_lock); |
1671 | } | 1670 | } |
1672 | 1671 | ||
1673 | extern int sock_i_uid(struct sock *sk); | 1672 | extern kuid_t sock_i_uid(struct sock *sk); |
1674 | extern unsigned long sock_i_ino(struct sock *sk); | 1673 | extern unsigned long sock_i_ino(struct sock *sk); |
1675 | 1674 | ||
1676 | static inline struct dst_entry * | 1675 | static inline struct dst_entry * |
@@ -2025,18 +2024,23 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) | |||
2025 | 2024 | ||
2026 | struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp); | 2025 | struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp); |
2027 | 2026 | ||
2028 | static inline struct page *sk_stream_alloc_page(struct sock *sk) | 2027 | /** |
2028 | * sk_page_frag - return an appropriate page_frag | ||
2029 | * @sk: socket | ||
2030 | * | ||
2031 | * If socket allocation mode allows current thread to sleep, it means its | ||
2032 | * safe to use the per task page_frag instead of the per socket one. | ||
2033 | */ | ||
2034 | static inline struct page_frag *sk_page_frag(struct sock *sk) | ||
2029 | { | 2035 | { |
2030 | struct page *page = NULL; | 2036 | if (sk->sk_allocation & __GFP_WAIT) |
2037 | return ¤t->task_frag; | ||
2031 | 2038 | ||
2032 | page = alloc_pages(sk->sk_allocation, 0); | 2039 | return &sk->sk_frag; |
2033 | if (!page) { | ||
2034 | sk_enter_memory_pressure(sk); | ||
2035 | sk_stream_moderate_sndbuf(sk); | ||
2036 | } | ||
2037 | return page; | ||
2038 | } | 2040 | } |
2039 | 2041 | ||
2042 | extern bool sk_page_frag_refill(struct sock *sk, struct page_frag *pfrag); | ||
2043 | |||
2040 | /* | 2044 | /* |
2041 | * Default write policy as shown to user space via poll/select/SIGIO | 2045 | * Default write policy as shown to user space via poll/select/SIGIO |
2042 | */ | 2046 | */ |
@@ -2217,8 +2221,6 @@ extern int net_msg_warn; | |||
2217 | extern __u32 sysctl_wmem_max; | 2221 | extern __u32 sysctl_wmem_max; |
2218 | extern __u32 sysctl_rmem_max; | 2222 | extern __u32 sysctl_rmem_max; |
2219 | 2223 | ||
2220 | extern void sk_init(void); | ||
2221 | |||
2222 | extern int sysctl_optmem_max; | 2224 | extern int sysctl_optmem_max; |
2223 | 2225 | ||
2224 | extern __u32 sysctl_wmem_default; | 2226 | extern __u32 sysctl_wmem_default; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1f000ffe7075..6feeccd83dd7 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -98,11 +98,21 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
98 | * 15 is ~13-30min depending on RTO. | 98 | * 15 is ~13-30min depending on RTO. |
99 | */ | 99 | */ |
100 | 100 | ||
101 | #define TCP_SYN_RETRIES 5 /* number of times to retry active opening a | 101 | #define TCP_SYN_RETRIES 6 /* This is how many retries are done |
102 | * connection: ~180sec is RFC minimum */ | 102 | * when active opening a connection. |
103 | * RFC1122 says the minimum retry MUST | ||
104 | * be at least 180secs. Nevertheless | ||
105 | * this value is corresponding to | ||
106 | * 63secs of retransmission with the | ||
107 | * current initial RTO. | ||
108 | */ | ||
103 | 109 | ||
104 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a | 110 | #define TCP_SYNACK_RETRIES 5 /* This is how may retries are done |
105 | * connection: ~180sec is RFC minimum */ | 111 | * when passive opening a connection. |
112 | * This is corresponding to 31secs of | ||
113 | * retransmission with the current | ||
114 | * initial RTO. | ||
115 | */ | ||
106 | 116 | ||
107 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | 117 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT |
108 | * state, about 60 seconds */ | 118 | * state, about 60 seconds */ |
@@ -214,8 +224,24 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
214 | 224 | ||
215 | /* Bit Flags for sysctl_tcp_fastopen */ | 225 | /* Bit Flags for sysctl_tcp_fastopen */ |
216 | #define TFO_CLIENT_ENABLE 1 | 226 | #define TFO_CLIENT_ENABLE 1 |
227 | #define TFO_SERVER_ENABLE 2 | ||
217 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ | 228 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ |
218 | 229 | ||
230 | /* Process SYN data but skip cookie validation */ | ||
231 | #define TFO_SERVER_COOKIE_NOT_CHKED 0x100 | ||
232 | /* Accept SYN data w/o any cookie option */ | ||
233 | #define TFO_SERVER_COOKIE_NOT_REQD 0x200 | ||
234 | |||
235 | /* Force enable TFO on all listeners, i.e., not requiring the | ||
236 | * TCP_FASTOPEN socket option. SOCKOPT1/2 determine how to set max_qlen. | ||
237 | */ | ||
238 | #define TFO_SERVER_WO_SOCKOPT1 0x400 | ||
239 | #define TFO_SERVER_WO_SOCKOPT2 0x800 | ||
240 | /* Always create TFO child sockets on a TFO listener even when | ||
241 | * cookie/data not present. (For testing purpose!) | ||
242 | */ | ||
243 | #define TFO_SERVER_ALWAYS 0x1000 | ||
244 | |||
219 | extern struct inet_timewait_death_row tcp_death_row; | 245 | extern struct inet_timewait_death_row tcp_death_row; |
220 | 246 | ||
221 | /* sysctl variables for tcp */ | 247 | /* sysctl variables for tcp */ |
@@ -398,7 +424,8 @@ extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock * | |||
398 | const struct tcphdr *th); | 424 | const struct tcphdr *th); |
399 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 425 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, |
400 | struct request_sock *req, | 426 | struct request_sock *req, |
401 | struct request_sock **prev); | 427 | struct request_sock **prev, |
428 | bool fastopen); | ||
402 | extern int tcp_child_process(struct sock *parent, struct sock *child, | 429 | extern int tcp_child_process(struct sock *parent, struct sock *child, |
403 | struct sk_buff *skb); | 430 | struct sk_buff *skb); |
404 | extern bool tcp_use_frto(struct sock *sk); | 431 | extern bool tcp_use_frto(struct sock *sk); |
@@ -411,12 +438,6 @@ extern void tcp_metrics_init(void); | |||
411 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); | 438 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); |
412 | extern bool tcp_remember_stamp(struct sock *sk); | 439 | extern bool tcp_remember_stamp(struct sock *sk); |
413 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); | 440 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); |
414 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
415 | struct tcp_fastopen_cookie *cookie, | ||
416 | int *syn_loss, unsigned long *last_syn_loss); | ||
417 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
418 | struct tcp_fastopen_cookie *cookie, | ||
419 | bool syn_lost); | ||
420 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); | 441 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); |
421 | extern void tcp_disable_fack(struct tcp_sock *tp); | 442 | extern void tcp_disable_fack(struct tcp_sock *tp); |
422 | extern void tcp_close(struct sock *sk, long timeout); | 443 | extern void tcp_close(struct sock *sk, long timeout); |
@@ -458,7 +479,8 @@ extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, | |||
458 | extern int tcp_connect(struct sock *sk); | 479 | extern int tcp_connect(struct sock *sk); |
459 | extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, | 480 | extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, |
460 | struct request_sock *req, | 481 | struct request_sock *req, |
461 | struct request_values *rvp); | 482 | struct request_values *rvp, |
483 | struct tcp_fastopen_cookie *foc); | ||
462 | extern int tcp_disconnect(struct sock *sk, int flags); | 484 | extern int tcp_disconnect(struct sock *sk, int flags); |
463 | 485 | ||
464 | void tcp_connect_init(struct sock *sk); | 486 | void tcp_connect_init(struct sock *sk); |
@@ -527,6 +549,7 @@ extern void tcp_send_delayed_ack(struct sock *sk); | |||
527 | extern void tcp_cwnd_application_limited(struct sock *sk); | 549 | extern void tcp_cwnd_application_limited(struct sock *sk); |
528 | extern void tcp_resume_early_retransmit(struct sock *sk); | 550 | extern void tcp_resume_early_retransmit(struct sock *sk); |
529 | extern void tcp_rearm_rto(struct sock *sk); | 551 | extern void tcp_rearm_rto(struct sock *sk); |
552 | extern void tcp_reset(struct sock *sk); | ||
530 | 553 | ||
531 | /* tcp_timer.c */ | 554 | /* tcp_timer.c */ |
532 | extern void tcp_init_xmit_timers(struct sock *); | 555 | extern void tcp_init_xmit_timers(struct sock *); |
@@ -576,6 +599,7 @@ extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | |||
576 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 599 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); |
577 | extern void tcp_mtup_init(struct sock *sk); | 600 | extern void tcp_mtup_init(struct sock *sk); |
578 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); | 601 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); |
602 | extern void tcp_init_buffer_space(struct sock *sk); | ||
579 | 603 | ||
580 | static inline void tcp_bound_rto(const struct sock *sk) | 604 | static inline void tcp_bound_rto(const struct sock *sk) |
581 | { | 605 | { |
@@ -889,15 +913,21 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) | |||
889 | return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; | 913 | return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; |
890 | } | 914 | } |
891 | 915 | ||
916 | static inline bool tcp_in_cwnd_reduction(const struct sock *sk) | ||
917 | { | ||
918 | return (TCPF_CA_CWR | TCPF_CA_Recovery) & | ||
919 | (1 << inet_csk(sk)->icsk_ca_state); | ||
920 | } | ||
921 | |||
892 | /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. | 922 | /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. |
893 | * The exception is rate halving phase, when cwnd is decreasing towards | 923 | * The exception is cwnd reduction phase, when cwnd is decreasing towards |
894 | * ssthresh. | 924 | * ssthresh. |
895 | */ | 925 | */ |
896 | static inline __u32 tcp_current_ssthresh(const struct sock *sk) | 926 | static inline __u32 tcp_current_ssthresh(const struct sock *sk) |
897 | { | 927 | { |
898 | const struct tcp_sock *tp = tcp_sk(sk); | 928 | const struct tcp_sock *tp = tcp_sk(sk); |
899 | 929 | ||
900 | if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery)) | 930 | if (tcp_in_cwnd_reduction(sk)) |
901 | return tp->snd_ssthresh; | 931 | return tp->snd_ssthresh; |
902 | else | 932 | else |
903 | return max(tp->snd_ssthresh, | 933 | return max(tp->snd_ssthresh, |
@@ -1094,6 +1124,8 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
1094 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ | 1124 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ |
1095 | req->cookie_ts = 0; | 1125 | req->cookie_ts = 0; |
1096 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; | 1126 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
1127 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; | ||
1128 | tcp_rsk(req)->snt_synack = 0; | ||
1097 | req->mss = rx_opt->mss_clamp; | 1129 | req->mss = rx_opt->mss_clamp; |
1098 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1130 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
1099 | ireq->tstamp_ok = rx_opt->tstamp_ok; | 1131 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
@@ -1106,6 +1138,15 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
1106 | ireq->loc_port = tcp_hdr(skb)->dest; | 1138 | ireq->loc_port = tcp_hdr(skb)->dest; |
1107 | } | 1139 | } |
1108 | 1140 | ||
1141 | /* Compute time elapsed between SYNACK and the ACK completing 3WHS */ | ||
1142 | static inline void tcp_synack_rtt_meas(struct sock *sk, | ||
1143 | struct request_sock *req) | ||
1144 | { | ||
1145 | if (tcp_rsk(req)->snt_synack) | ||
1146 | tcp_valid_rtt_meas(sk, | ||
1147 | tcp_time_stamp - tcp_rsk(req)->snt_synack); | ||
1148 | } | ||
1149 | |||
1109 | extern void tcp_enter_memory_pressure(struct sock *sk); | 1150 | extern void tcp_enter_memory_pressure(struct sock *sk); |
1110 | 1151 | ||
1111 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) | 1152 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |
@@ -1298,15 +1339,34 @@ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff | |||
1298 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1339 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
1299 | const struct tcp_md5sig_key *key); | 1340 | const struct tcp_md5sig_key *key); |
1300 | 1341 | ||
1342 | /* From tcp_fastopen.c */ | ||
1343 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
1344 | struct tcp_fastopen_cookie *cookie, | ||
1345 | int *syn_loss, unsigned long *last_syn_loss); | ||
1346 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
1347 | struct tcp_fastopen_cookie *cookie, | ||
1348 | bool syn_lost); | ||
1301 | struct tcp_fastopen_request { | 1349 | struct tcp_fastopen_request { |
1302 | /* Fast Open cookie. Size 0 means a cookie request */ | 1350 | /* Fast Open cookie. Size 0 means a cookie request */ |
1303 | struct tcp_fastopen_cookie cookie; | 1351 | struct tcp_fastopen_cookie cookie; |
1304 | struct msghdr *data; /* data in MSG_FASTOPEN */ | 1352 | struct msghdr *data; /* data in MSG_FASTOPEN */ |
1305 | u16 copied; /* queued in tcp_connect() */ | 1353 | u16 copied; /* queued in tcp_connect() */ |
1306 | }; | 1354 | }; |
1307 | |||
1308 | void tcp_free_fastopen_req(struct tcp_sock *tp); | 1355 | void tcp_free_fastopen_req(struct tcp_sock *tp); |
1309 | 1356 | ||
1357 | extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; | ||
1358 | int tcp_fastopen_reset_cipher(void *key, unsigned int len); | ||
1359 | void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc); | ||
1360 | |||
1361 | #define TCP_FASTOPEN_KEY_LENGTH 16 | ||
1362 | |||
1363 | /* Fastopen key context */ | ||
1364 | struct tcp_fastopen_context { | ||
1365 | struct crypto_cipher __rcu *tfm; | ||
1366 | __u8 key[TCP_FASTOPEN_KEY_LENGTH]; | ||
1367 | struct rcu_head rcu; | ||
1368 | }; | ||
1369 | |||
1310 | /* write queue abstraction */ | 1370 | /* write queue abstraction */ |
1311 | static inline void tcp_write_queue_purge(struct sock *sk) | 1371 | static inline void tcp_write_queue_purge(struct sock *sk) |
1312 | { | 1372 | { |
@@ -1510,7 +1570,8 @@ struct tcp_iter_state { | |||
1510 | sa_family_t family; | 1570 | sa_family_t family; |
1511 | enum tcp_seq_states state; | 1571 | enum tcp_seq_states state; |
1512 | struct sock *syn_wait_sk; | 1572 | struct sock *syn_wait_sk; |
1513 | int bucket, offset, sbucket, num, uid; | 1573 | int bucket, offset, sbucket, num; |
1574 | kuid_t uid; | ||
1514 | loff_t last_pos; | 1575 | loff_t last_pos; |
1515 | }; | 1576 | }; |
1516 | 1577 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 639dd1316d37..6f0ba01afe73 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -263,7 +263,7 @@ struct km_event { | |||
263 | } data; | 263 | } data; |
264 | 264 | ||
265 | u32 seq; | 265 | u32 seq; |
266 | u32 pid; | 266 | u32 portid; |
267 | u32 event; | 267 | u32 event; |
268 | struct net *net; | 268 | struct net *net; |
269 | }; | 269 | }; |
@@ -313,7 +313,7 @@ extern void km_state_notify(struct xfrm_state *x, const struct km_event *c); | |||
313 | 313 | ||
314 | struct xfrm_tmpl; | 314 | struct xfrm_tmpl; |
315 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); | 315 | extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); |
316 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | 316 | extern void km_state_expired(struct xfrm_state *x, int hard, u32 portid); |
317 | extern int __xfrm_state_delete(struct xfrm_state *x); | 317 | extern int __xfrm_state_delete(struct xfrm_state *x); |
318 | 318 | ||
319 | struct xfrm_state_afinfo { | 319 | struct xfrm_state_afinfo { |
@@ -576,7 +576,7 @@ struct xfrm_mgr { | |||
576 | struct list_head list; | 576 | struct list_head list; |
577 | char *id; | 577 | char *id; |
578 | int (*notify)(struct xfrm_state *x, const struct km_event *c); | 578 | int (*notify)(struct xfrm_state *x, const struct km_event *c); |
579 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); | 579 | int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp); |
580 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); | 580 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); |
581 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 581 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
582 | int (*notify_policy)(struct xfrm_policy *x, int dir, const struct km_event *c); | 582 | int (*notify_policy)(struct xfrm_policy *x, int dir, const struct km_event *c); |
@@ -671,7 +671,7 @@ struct xfrm_spi_skb_cb { | |||
671 | /* Audit Information */ | 671 | /* Audit Information */ |
672 | struct xfrm_audit { | 672 | struct xfrm_audit { |
673 | u32 secid; | 673 | u32 secid; |
674 | uid_t loginuid; | 674 | kuid_t loginuid; |
675 | u32 sessionid; | 675 | u32 sessionid; |
676 | }; | 676 | }; |
677 | 677 | ||
@@ -690,13 +690,14 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op) | |||
690 | return audit_buf; | 690 | return audit_buf; |
691 | } | 691 | } |
692 | 692 | ||
693 | static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, | 693 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, |
694 | struct audit_buffer *audit_buf) | 694 | struct audit_buffer *audit_buf) |
695 | { | 695 | { |
696 | char *secctx; | 696 | char *secctx; |
697 | u32 secctx_len; | 697 | u32 secctx_len; |
698 | 698 | ||
699 | audit_log_format(audit_buf, " auid=%u ses=%u", auid, ses); | 699 | audit_log_format(audit_buf, " auid=%u ses=%u", |
700 | from_kuid(&init_user_ns, auid), ses); | ||
700 | if (secid != 0 && | 701 | if (secid != 0 && |
701 | security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { | 702 | security_secid_to_secctx(secid, &secctx, &secctx_len) == 0) { |
702 | audit_log_format(audit_buf, " subj=%s", secctx); | 703 | audit_log_format(audit_buf, " subj=%s", secctx); |
@@ -706,13 +707,13 @@ static inline void xfrm_audit_helper_usrinfo(uid_t auid, u32 ses, u32 secid, | |||
706 | } | 707 | } |
707 | 708 | ||
708 | extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 709 | extern void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
709 | u32 auid, u32 ses, u32 secid); | 710 | kuid_t auid, u32 ses, u32 secid); |
710 | extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 711 | extern void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
711 | u32 auid, u32 ses, u32 secid); | 712 | kuid_t auid, u32 ses, u32 secid); |
712 | extern void xfrm_audit_state_add(struct xfrm_state *x, int result, | 713 | extern void xfrm_audit_state_add(struct xfrm_state *x, int result, |
713 | u32 auid, u32 ses, u32 secid); | 714 | kuid_t auid, u32 ses, u32 secid); |
714 | extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 715 | extern void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
715 | u32 auid, u32 ses, u32 secid); | 716 | kuid_t auid, u32 ses, u32 secid); |
716 | extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 717 | extern void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
717 | struct sk_buff *skb); | 718 | struct sk_buff *skb); |
718 | extern void xfrm_audit_state_replay(struct xfrm_state *x, | 719 | extern void xfrm_audit_state_replay(struct xfrm_state *x, |
@@ -725,22 +726,22 @@ extern void xfrm_audit_state_icvfail(struct xfrm_state *x, | |||
725 | #else | 726 | #else |
726 | 727 | ||
727 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 728 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
728 | u32 auid, u32 ses, u32 secid) | 729 | kuid_t auid, u32 ses, u32 secid) |
729 | { | 730 | { |
730 | } | 731 | } |
731 | 732 | ||
732 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 733 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
733 | u32 auid, u32 ses, u32 secid) | 734 | kuid_t auid, u32 ses, u32 secid) |
734 | { | 735 | { |
735 | } | 736 | } |
736 | 737 | ||
737 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, | 738 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, |
738 | u32 auid, u32 ses, u32 secid) | 739 | kuid_t auid, u32 ses, u32 secid) |
739 | { | 740 | { |
740 | } | 741 | } |
741 | 742 | ||
742 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 743 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
743 | u32 auid, u32 ses, u32 secid) | 744 | kuid_t auid, u32 ses, u32 secid) |
744 | { | 745 | { |
745 | } | 746 | } |
746 | 747 | ||
@@ -1557,7 +1558,7 @@ extern int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | |||
1557 | #endif | 1558 | #endif |
1558 | 1559 | ||
1559 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1560 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
1560 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); | 1561 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 portid); |
1561 | extern int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 1562 | extern int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
1562 | 1563 | ||
1563 | extern void xfrm_input_init(void); | 1564 | extern void xfrm_input_init(void); |
diff --git a/include/rdma/ib_cache.h b/include/rdma/ib_cache.h index 00a2b8ec327f..ad9a3c280944 100644 --- a/include/rdma/ib_cache.h +++ b/include/rdma/ib_cache.h | |||
@@ -101,6 +101,22 @@ int ib_find_cached_pkey(struct ib_device *device, | |||
101 | u16 *index); | 101 | u16 *index); |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * ib_find_exact_cached_pkey - Returns the PKey table index where a specified | ||
105 | * PKey value occurs. Comparison uses the FULL 16 bits (incl membership bit) | ||
106 | * @device: The device to query. | ||
107 | * @port_num: The port number of the device to search for the PKey. | ||
108 | * @pkey: The PKey value to search for. | ||
109 | * @index: The index into the cached PKey table where the PKey was found. | ||
110 | * | ||
111 | * ib_find_exact_cached_pkey() searches the specified PKey table in | ||
112 | * the local software cache. | ||
113 | */ | ||
114 | int ib_find_exact_cached_pkey(struct ib_device *device, | ||
115 | u8 port_num, | ||
116 | u16 pkey, | ||
117 | u16 *index); | ||
118 | |||
119 | /** | ||
104 | * ib_get_cached_lmc - Returns a cached lmc table entry | 120 | * ib_get_cached_lmc - Returns a cached lmc table entry |
105 | * @device: The device to query. | 121 | * @device: The device to query. |
106 | * @port_num: The port number of the device to query. | 122 | * @port_num: The port number of the device to query. |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 07996af8265a..46bc045bbe15 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -614,6 +614,9 @@ enum ib_qp_type { | |||
614 | enum ib_qp_create_flags { | 614 | enum ib_qp_create_flags { |
615 | IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0, | 615 | IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0, |
616 | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1, | 616 | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1, |
617 | /* reserve bits 26-31 for low level drivers' internal use */ | ||
618 | IB_QP_CREATE_RESERVED_START = 1 << 26, | ||
619 | IB_QP_CREATE_RESERVED_END = 1 << 31, | ||
617 | }; | 620 | }; |
618 | 621 | ||
619 | struct ib_qp_init_attr { | 622 | struct ib_qp_init_attr { |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ae33706afeb0..ef937b56f9b5 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -79,7 +79,8 @@ enum phy_event { | |||
79 | PHYE_OOB_DONE = 1, | 79 | PHYE_OOB_DONE = 1, |
80 | PHYE_OOB_ERROR = 2, | 80 | PHYE_OOB_ERROR = 2, |
81 | PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */ | 81 | PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */ |
82 | PHY_NUM_EVENTS = 4, | 82 | PHYE_RESUME_TIMEOUT = 4, |
83 | PHY_NUM_EVENTS = 5, | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | enum discover_event { | 86 | enum discover_event { |
@@ -87,8 +88,10 @@ enum discover_event { | |||
87 | DISCE_REVALIDATE_DOMAIN = 1, | 88 | DISCE_REVALIDATE_DOMAIN = 1, |
88 | DISCE_PORT_GONE = 2, | 89 | DISCE_PORT_GONE = 2, |
89 | DISCE_PROBE = 3, | 90 | DISCE_PROBE = 3, |
90 | DISCE_DESTRUCT = 4, | 91 | DISCE_SUSPEND = 4, |
91 | DISC_NUM_EVENTS = 5, | 92 | DISCE_RESUME = 5, |
93 | DISCE_DESTRUCT = 6, | ||
94 | DISC_NUM_EVENTS = 7, | ||
92 | }; | 95 | }; |
93 | 96 | ||
94 | /* ---------- Expander Devices ---------- */ | 97 | /* ---------- Expander Devices ---------- */ |
@@ -128,7 +131,7 @@ struct ex_phy { | |||
128 | u8 attached_sas_addr[SAS_ADDR_SIZE]; | 131 | u8 attached_sas_addr[SAS_ADDR_SIZE]; |
129 | u8 attached_phy_id; | 132 | u8 attached_phy_id; |
130 | 133 | ||
131 | u8 phy_change_count; | 134 | int phy_change_count; |
132 | enum routing_attribute routing_attr; | 135 | enum routing_attribute routing_attr; |
133 | u8 virtual:1; | 136 | u8 virtual:1; |
134 | 137 | ||
@@ -141,7 +144,7 @@ struct ex_phy { | |||
141 | struct expander_device { | 144 | struct expander_device { |
142 | struct list_head children; | 145 | struct list_head children; |
143 | 146 | ||
144 | u16 ex_change_count; | 147 | int ex_change_count; |
145 | u16 max_route_indexes; | 148 | u16 max_route_indexes; |
146 | u8 num_phys; | 149 | u8 num_phys; |
147 | 150 | ||
@@ -169,6 +172,7 @@ struct sata_device { | |||
169 | enum ata_command_set command_set; | 172 | enum ata_command_set command_set; |
170 | struct smp_resp rps_resp; /* report_phy_sata_resp */ | 173 | struct smp_resp rps_resp; /* report_phy_sata_resp */ |
171 | u8 port_no; /* port number, if this is a PM (Port) */ | 174 | u8 port_no; /* port number, if this is a PM (Port) */ |
175 | int pm_result; | ||
172 | 176 | ||
173 | struct ata_port *ap; | 177 | struct ata_port *ap; |
174 | struct ata_host ata_host; | 178 | struct ata_host ata_host; |
@@ -182,6 +186,7 @@ struct ssp_device { | |||
182 | 186 | ||
183 | enum { | 187 | enum { |
184 | SAS_DEV_GONE, | 188 | SAS_DEV_GONE, |
189 | SAS_DEV_FOUND, /* device notified to lldd */ | ||
185 | SAS_DEV_DESTROY, | 190 | SAS_DEV_DESTROY, |
186 | SAS_DEV_EH_PENDING, | 191 | SAS_DEV_EH_PENDING, |
187 | SAS_DEV_LU_RESET, | 192 | SAS_DEV_LU_RESET, |
@@ -273,6 +278,7 @@ struct asd_sas_port { | |||
273 | enum sas_linkrate linkrate; | 278 | enum sas_linkrate linkrate; |
274 | 279 | ||
275 | struct sas_work work; | 280 | struct sas_work work; |
281 | int suspended; | ||
276 | 282 | ||
277 | /* public: */ | 283 | /* public: */ |
278 | int id; | 284 | int id; |
@@ -321,6 +327,7 @@ struct asd_sas_phy { | |||
321 | unsigned long phy_events_pending; | 327 | unsigned long phy_events_pending; |
322 | 328 | ||
323 | int error; | 329 | int error; |
330 | int suspended; | ||
324 | 331 | ||
325 | struct sas_phy *phy; | 332 | struct sas_phy *phy; |
326 | 333 | ||
@@ -687,6 +694,9 @@ struct sas_domain_function_template { | |||
687 | 694 | ||
688 | extern int sas_register_ha(struct sas_ha_struct *); | 695 | extern int sas_register_ha(struct sas_ha_struct *); |
689 | extern int sas_unregister_ha(struct sas_ha_struct *); | 696 | extern int sas_unregister_ha(struct sas_ha_struct *); |
697 | extern void sas_prep_resume_ha(struct sas_ha_struct *sas_ha); | ||
698 | extern void sas_resume_ha(struct sas_ha_struct *sas_ha); | ||
699 | extern void sas_suspend_ha(struct sas_ha_struct *sas_ha); | ||
690 | 700 | ||
691 | int sas_set_phy_speed(struct sas_phy *phy, | 701 | int sas_set_phy_speed(struct sas_phy *phy, |
692 | struct sas_phy_linkrates *rates); | 702 | struct sas_phy_linkrates *rates); |
diff --git a/include/scsi/osd_attributes.h b/include/scsi/osd_attributes.h index 56e920ade326..303ba1118a4d 100644 --- a/include/scsi/osd_attributes.h +++ b/include/scsi/osd_attributes.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __OSD_ATTRIBUTES_H__ | 1 | #ifndef __OSD_ATTRIBUTES_H__ |
2 | #define __OSD_ATTRIBUTES_H__ | 2 | #define __OSD_ATTRIBUTES_H__ |
3 | 3 | ||
4 | #include "osd_protocol.h" | 4 | #include <scsi/osd_protocol.h> |
5 | 5 | ||
6 | /* | 6 | /* |
7 | * Contains types and constants that define attribute pages and attribute | 7 | * Contains types and constants that define attribute pages and attribute |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 572fb5493661..b2e85fdd2ae0 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -14,8 +14,8 @@ | |||
14 | #ifndef __OSD_INITIATOR_H__ | 14 | #ifndef __OSD_INITIATOR_H__ |
15 | #define __OSD_INITIATOR_H__ | 15 | #define __OSD_INITIATOR_H__ |
16 | 16 | ||
17 | #include "osd_protocol.h" | 17 | #include <scsi/osd_protocol.h> |
18 | #include "osd_types.h" | 18 | #include <scsi/osd_types.h> |
19 | 19 | ||
20 | #include <linux/blkdev.h> | 20 | #include <linux/blkdev.h> |
21 | #include <scsi/scsi_device.h> | 21 | #include <scsi/scsi_device.h> |
diff --git a/include/scsi/osd_sec.h b/include/scsi/osd_sec.h index 4c09fee8ae1e..f96151c9c9e8 100644 --- a/include/scsi/osd_sec.h +++ b/include/scsi/osd_sec.h | |||
@@ -14,8 +14,8 @@ | |||
14 | #ifndef __OSD_SEC_H__ | 14 | #ifndef __OSD_SEC_H__ |
15 | #define __OSD_SEC_H__ | 15 | #define __OSD_SEC_H__ |
16 | 16 | ||
17 | #include "osd_protocol.h" | 17 | #include <scsi/osd_protocol.h> |
18 | #include "osd_types.h" | 18 | #include <scsi/osd_types.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Contains types and constants of osd capabilities and security | 21 | * Contains types and constants of osd capabilities and security |
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index 2dfbdaa0b34a..ff71a5654684 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h | |||
@@ -45,6 +45,8 @@ void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, | |||
45 | void sas_ata_schedule_reset(struct domain_device *dev); | 45 | void sas_ata_schedule_reset(struct domain_device *dev); |
46 | void sas_ata_wait_eh(struct domain_device *dev); | 46 | void sas_ata_wait_eh(struct domain_device *dev); |
47 | void sas_probe_sata(struct asd_sas_port *port); | 47 | void sas_probe_sata(struct asd_sas_port *port); |
48 | void sas_suspend_sata(struct asd_sas_port *port); | ||
49 | void sas_resume_sata(struct asd_sas_port *port); | ||
48 | void sas_ata_end_eh(struct ata_port *ap); | 50 | void sas_ata_end_eh(struct ata_port *ap); |
49 | #else | 51 | #else |
50 | 52 | ||
@@ -82,6 +84,14 @@ static inline void sas_probe_sata(struct asd_sas_port *port) | |||
82 | { | 84 | { |
83 | } | 85 | } |
84 | 86 | ||
87 | static inline void sas_suspend_sata(struct asd_sas_port *port) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | static inline void sas_resume_sata(struct asd_sas_port *port) | ||
92 | { | ||
93 | } | ||
94 | |||
85 | static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) | 95 | static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) |
86 | { | 96 | { |
87 | return 0; | 97 | return 0; |
diff --git a/include/scsi/scsi_bsg_fc.h b/include/scsi/scsi_bsg_fc.h index 91a4e4ff9a9b..3031b900b087 100644 --- a/include/scsi/scsi_bsg_fc.h +++ b/include/scsi/scsi_bsg_fc.h | |||
@@ -26,8 +26,6 @@ | |||
26 | * This file intended to be included by both kernel and user space | 26 | * This file intended to be included by both kernel and user space |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <scsi/scsi.h> | ||
30 | |||
31 | /* | 29 | /* |
32 | * FC Transport SGIO v4 BSG Message Support | 30 | * FC Transport SGIO v4 BSG Message Support |
33 | */ | 31 | */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 9895f69294fc..88fae8d20154 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -156,6 +156,7 @@ struct scsi_device { | |||
156 | unsigned is_visible:1; /* is the device visible in sysfs */ | 156 | unsigned is_visible:1; /* is the device visible in sysfs */ |
157 | unsigned can_power_off:1; /* Device supports runtime power off */ | 157 | unsigned can_power_off:1; /* Device supports runtime power off */ |
158 | unsigned wce_default_on:1; /* Cache is ON by default */ | 158 | unsigned wce_default_on:1; /* Cache is ON by default */ |
159 | unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ | ||
159 | 160 | ||
160 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 161 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
161 | struct list_head event_list; /* asserted events */ | 162 | struct list_head event_list; /* asserted events */ |
@@ -476,6 +477,9 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev) | |||
476 | 477 | ||
477 | static inline int scsi_device_protection(struct scsi_device *sdev) | 478 | static inline int scsi_device_protection(struct scsi_device *sdev) |
478 | { | 479 | { |
480 | if (sdev->no_dif) | ||
481 | return 0; | ||
482 | |||
479 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); | 483 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
480 | } | 484 | } |
481 | 485 | ||
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index b4ddd3b18b4c..cc1f3e786ad7 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h | |||
@@ -30,4 +30,5 @@ | |||
30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ | 30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ |
31 | #define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ | 31 | #define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ |
32 | #define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ | 32 | #define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ |
33 | #define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */ | ||
33 | #endif | 34 | #endif |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 5f7d5b3b1c6e..49084807eb6b 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -873,6 +873,9 @@ static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsign | |||
873 | SHOST_DIF_TYPE2_PROTECTION, | 873 | SHOST_DIF_TYPE2_PROTECTION, |
874 | SHOST_DIF_TYPE3_PROTECTION }; | 874 | SHOST_DIF_TYPE3_PROTECTION }; |
875 | 875 | ||
876 | if (target_type > SHOST_DIF_TYPE3_PROTECTION) | ||
877 | return 0; | ||
878 | |||
876 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; | 879 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; |
877 | } | 880 | } |
878 | 881 | ||
@@ -884,6 +887,9 @@ static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsign | |||
884 | SHOST_DIX_TYPE2_PROTECTION, | 887 | SHOST_DIX_TYPE2_PROTECTION, |
885 | SHOST_DIX_TYPE3_PROTECTION }; | 888 | SHOST_DIX_TYPE3_PROTECTION }; |
886 | 889 | ||
890 | if (target_type > SHOST_DIX_TYPE3_PROTECTION) | ||
891 | return 0; | ||
892 | |||
887 | return shost->prot_capabilities & cap[target_type]; | 893 | return shost->prot_capabilities & cap[target_type]; |
888 | #endif | 894 | #endif |
889 | return 0; | 895 | return 0; |
diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h index 5cb20ccb1956..62b4edab15d3 100644 --- a/include/scsi/scsi_netlink.h +++ b/include/scsi/scsi_netlink.h | |||
@@ -119,29 +119,5 @@ struct scsi_nl_host_vendor_msg { | |||
119 | (hdr)->msglen = mlen; \ | 119 | (hdr)->msglen = mlen; \ |
120 | } | 120 | } |
121 | 121 | ||
122 | |||
123 | #ifdef __KERNEL__ | ||
124 | |||
125 | #include <scsi/scsi_host.h> | ||
126 | |||
127 | /* Exported Kernel Interfaces */ | ||
128 | int scsi_nl_add_transport(u8 tport, | ||
129 | int (*msg_handler)(struct sk_buff *), | ||
130 | void (*event_handler)(struct notifier_block *, unsigned long, void *)); | ||
131 | void scsi_nl_remove_transport(u8 tport); | ||
132 | |||
133 | int scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt, | ||
134 | int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload, | ||
135 | u32 len, u32 pid), | ||
136 | void (*nlevt_handler)(struct notifier_block *nb, | ||
137 | unsigned long event, void *notify_ptr)); | ||
138 | void scsi_nl_remove_driver(u64 vendor_id); | ||
139 | |||
140 | void scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr); | ||
141 | int scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id, | ||
142 | char *data_buf, u32 data_len); | ||
143 | |||
144 | #endif /* __KERNEL__ */ | ||
145 | |||
146 | #endif /* SCSI_NETLINK_H */ | 122 | #endif /* SCSI_NETLINK_H */ |
147 | 123 | ||
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 02cbb50225bb..fdeb8dceec0f 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -28,9 +28,9 @@ | |||
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/device.h> | 29 | #include <linux/device.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include "pcm.h" | 31 | #include <sound/pcm.h> |
32 | #include "control.h" | 32 | #include <sound/control.h> |
33 | #include "info.h" | 33 | #include <sound/info.h> |
34 | 34 | ||
35 | /* maximum number of devices on the AC97 bus */ | 35 | /* maximum number of devices on the AC97 bus */ |
36 | #define AC97_BUS_MAX_DEVICES 4 | 36 | #define AC97_BUS_MAX_DEVICES 4 |
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h index d010858c33c2..a7d8dc782e7c 100644 --- a/include/sound/ad1816a.h +++ b/include/sound/ad1816a.h | |||
@@ -20,9 +20,9 @@ | |||
20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "control.h" | 23 | #include <sound/control.h> |
24 | #include "pcm.h" | 24 | #include <sound/pcm.h> |
25 | #include "timer.h" | 25 | #include <sound/timer.h> |
26 | 26 | ||
27 | #define AD1816A_REG(r) (chip->port + r) | 27 | #define AD1816A_REG(r) (chip->port + r) |
28 | 28 | ||
diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h index 575296cf7987..85ea86ea35b3 100644 --- a/include/sound/ak4531_codec.h +++ b/include/sound/ak4531_codec.h | |||
@@ -25,8 +25,8 @@ | |||
25 | * | 25 | * |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "info.h" | 28 | #include <sound/info.h> |
29 | #include "control.h" | 29 | #include <sound/control.h> |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * ASAHI KASEI - AK4531 codec | 32 | * ASAHI KASEI - AK4531 codec |
diff --git a/include/sound/emu10k1_synth.h b/include/sound/emu10k1_synth.h index 6ef61c420935..9f211e957bf9 100644 --- a/include/sound/emu10k1_synth.h +++ b/include/sound/emu10k1_synth.h | |||
@@ -20,8 +20,8 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "emu10k1.h" | 23 | #include <sound/emu10k1.h> |
24 | #include "emux_synth.h" | 24 | #include <sound/emux_synth.h> |
25 | 25 | ||
26 | /* sequencer device id */ | 26 | /* sequencer device id */ |
27 | #define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH "emu10k1-synth" | 27 | #define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH "emu10k1-synth" |
diff --git a/include/sound/emu8000.h b/include/sound/emu8000.h index c8f66bde6d95..c321302a9143 100644 --- a/include/sound/emu8000.h +++ b/include/sound/emu8000.h | |||
@@ -21,8 +21,8 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "emux_synth.h" | 24 | #include <sound/emux_synth.h> |
25 | #include "seq_kernel.h" | 25 | #include <sound/seq_kernel.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * Hardware parameters. | 28 | * Hardware parameters. |
diff --git a/include/sound/emux_legacy.h b/include/sound/emux_legacy.h index 6fe3da2a5e15..baf43fc24d39 100644 --- a/include/sound/emux_legacy.h +++ b/include/sound/emux_legacy.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "seq_oss_legacy.h" | 25 | #include <sound/seq_oss_legacy.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * awe hardware controls | 28 | * awe hardware controls |
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h index d8cb51b86c20..fb81f3722b6a 100644 --- a/include/sound/emux_synth.h +++ b/include/sound/emux_synth.h | |||
@@ -21,15 +21,15 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "seq_kernel.h" | 24 | #include <sound/seq_kernel.h> |
25 | #include "seq_device.h" | 25 | #include <sound/seq_device.h> |
26 | #include "soundfont.h" | 26 | #include <sound/soundfont.h> |
27 | #include "seq_midi_emul.h" | 27 | #include <sound/seq_midi_emul.h> |
28 | #ifdef CONFIG_SND_SEQUENCER_OSS | 28 | #ifdef CONFIG_SND_SEQUENCER_OSS |
29 | #include "seq_oss.h" | 29 | #include <sound/seq_oss.h> |
30 | #endif | 30 | #endif |
31 | #include "emux_legacy.h" | 31 | #include <sound/emux_legacy.h> |
32 | #include "seq_virmidi.h" | 32 | #include <sound/seq_virmidi.h> |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * compile flags | 35 | * compile flags |
diff --git a/include/sound/es1688.h b/include/sound/es1688.h index f752dd33dfaf..1d636a2d8896 100644 --- a/include/sound/es1688.h +++ b/include/sound/es1688.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "control.h" | 25 | #include <sound/control.h> |
26 | #include "pcm.h" | 26 | #include <sound/pcm.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | 28 | ||
29 | #define ES1688_HW_AUTO 0x0000 | 29 | #define ES1688_HW_AUTO 0x0000 |
diff --git a/include/sound/gus.h b/include/sound/gus.h index 841bb8df38c1..42905d811da7 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h | |||
@@ -22,11 +22,11 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "pcm.h" | 25 | #include <sound/pcm.h> |
26 | #include "rawmidi.h" | 26 | #include <sound/rawmidi.h> |
27 | #include "timer.h" | 27 | #include <sound/timer.h> |
28 | #include "seq_midi_emul.h" | 28 | #include <sound/seq_midi_emul.h> |
29 | #include "seq_device.h" | 29 | #include <sound/seq_device.h> |
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | 31 | ||
32 | /* IO ports */ | 32 | /* IO ports */ |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 20230db00ef1..e94209692513 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "rawmidi.h" | 25 | #include <sound/rawmidi.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | 27 | ||
28 | #define MPU401_HW_MPU401 1 /* native MPU401 */ | 28 | #define MPU401_HW_MPU401 1 /* native MPU401 */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index cdca2ab1e711..d0711bc8c914 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define snd_pcm_chip(pcm) ((pcm)->private_data) | 35 | #define snd_pcm_chip(pcm) ((pcm)->private_data) |
36 | 36 | ||
37 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 37 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
38 | #include "pcm_oss.h" | 38 | #include <sound/pcm_oss.h> |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | /* | 41 | /* |
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 6b14359d9fed..adf0885153f3 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | 31 | ||
32 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) | 32 | #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) |
33 | #include "seq_device.h" | 33 | #include <sound/seq_device.h> |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | /* | 36 | /* |
diff --git a/include/sound/sb.h b/include/sound/sb.h index 95353542256a..ba3960329646 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "pcm.h" | 25 | #include <sound/pcm.h> |
26 | #include "rawmidi.h" | 26 | #include <sound/rawmidi.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | 29 | ||
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h index af1b49e982df..7e950560e591 100644 --- a/include/sound/sb16_csp.h +++ b/include/sound/sb16_csp.h | |||
@@ -119,8 +119,8 @@ struct snd_sb_csp_info { | |||
119 | #define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) | 119 | #define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) |
120 | 120 | ||
121 | #ifdef __KERNEL__ | 121 | #ifdef __KERNEL__ |
122 | #include "sb.h" | 122 | #include <sound/sb.h> |
123 | #include "hwdep.h" | 123 | #include <sound/hwdep.h> |
124 | #include <linux/firmware.h> | 124 | #include <linux/firmware.h> |
125 | 125 | ||
126 | struct snd_sb_csp; | 126 | struct snd_sb_csp; |
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h index f352a98ce4f4..2398521f0998 100644 --- a/include/sound/seq_kernel.h +++ b/include/sound/seq_kernel.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | #include <linux/time.h> | 24 | #include <linux/time.h> |
25 | #include "asequencer.h" | 25 | #include <sound/asequencer.h> |
26 | 26 | ||
27 | typedef struct snd_seq_real_time snd_seq_real_time_t; | 27 | typedef struct snd_seq_real_time snd_seq_real_time_t; |
28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; | 28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; |
diff --git a/include/sound/seq_midi_emul.h b/include/sound/seq_midi_emul.h index d6c4615901b9..8139d8c191ed 100644 --- a/include/sound/seq_midi_emul.h +++ b/include/sound/seq_midi_emul.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "seq_kernel.h" | 25 | #include <sound/seq_kernel.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * This structure is used to keep track of the current state on each | 28 | * This structure is used to keep track of the current state on each |
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h index 5efab8b29c57..e40f43e6fc7b 100644 --- a/include/sound/seq_midi_event.h +++ b/include/sound/seq_midi_event.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "asequencer.h" | 25 | #include <sound/asequencer.h> |
26 | 26 | ||
27 | #define MAX_MIDI_EVENT_BUF 256 | 27 | #define MAX_MIDI_EVENT_BUF 256 |
28 | 28 | ||
diff --git a/include/sound/seq_oss.h b/include/sound/seq_oss.h index 9b060bbd6e02..d0b27ec6f8b8 100644 --- a/include/sound/seq_oss.h +++ b/include/sound/seq_oss.h | |||
@@ -21,8 +21,8 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "asequencer.h" | 24 | #include <sound/asequencer.h> |
25 | #include "seq_kernel.h" | 25 | #include <sound/seq_kernel.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * argument structure for synthesizer operations | 28 | * argument structure for synthesizer operations |
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h index d888433a3096..a03acd0d398a 100644 --- a/include/sound/seq_virmidi.h +++ b/include/sound/seq_virmidi.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "rawmidi.h" | 25 | #include <sound/rawmidi.h> |
26 | #include "seq_midi_event.h" | 26 | #include <sound/seq_midi_event.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * device file instance: | 29 | * device file instance: |
diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h index fa149ca77e4b..35e94b3d1ec7 100644 --- a/include/sound/snd_wavefront.h +++ b/include/sound/snd_wavefront.h | |||
@@ -1,10 +1,10 @@ | |||
1 | #ifndef __SOUND_SND_WAVEFRONT_H__ | 1 | #ifndef __SOUND_SND_WAVEFRONT_H__ |
2 | #define __SOUND_SND_WAVEFRONT_H__ | 2 | #define __SOUND_SND_WAVEFRONT_H__ |
3 | 3 | ||
4 | #include "mpu401.h" | 4 | #include <sound/mpu401.h> |
5 | #include "hwdep.h" | 5 | #include <sound/hwdep.h> |
6 | #include "rawmidi.h" | 6 | #include <sound/rawmidi.h> |
7 | #include "wavefront.h" /* generic OSS/ALSA/user-level wavefront header */ | 7 | #include <sound/wavefront.h> /* generic OSS/ALSA/user-level wavefront header */ |
8 | 8 | ||
9 | /* MIDI interface */ | 9 | /* MIDI interface */ |
10 | 10 | ||
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h index 679df0574066..7c93efdba90d 100644 --- a/include/sound/soundfont.h +++ b/include/sound/soundfont.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "sfnt_info.h" | 25 | #include <sound/sfnt_info.h> |
26 | #include "util_mem.h" | 26 | #include <sound/util_mem.h> |
27 | 27 | ||
28 | #define SF_MAX_INSTRUMENTS 128 /* maximum instrument number */ | 28 | #define SF_MAX_INSTRUMENTS 128 /* maximum instrument number */ |
29 | #define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */ | 29 | #define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */ |
diff --git a/include/sound/tea6330t.h b/include/sound/tea6330t.h index 51b282b76896..e6beec23d7f2 100644 --- a/include/sound/tea6330t.h +++ b/include/sound/tea6330t.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "i2c.h" /* generic i2c support */ | 25 | #include <sound/i2c.h> /* generic i2c support */ |
26 | 26 | ||
27 | int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer); | 27 | int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer); |
28 | int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus, | 28 | int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus, |
diff --git a/include/sound/wss.h b/include/sound/wss.h index fd01f22825cd..0c7f034f1e86 100644 --- a/include/sound/wss.h +++ b/include/sound/wss.h | |||
@@ -22,11 +22,11 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "control.h" | 25 | #include <sound/control.h> |
26 | #include "pcm.h" | 26 | #include <sound/pcm.h> |
27 | #include "timer.h" | 27 | #include <sound/timer.h> |
28 | 28 | ||
29 | #include "cs4231-regs.h" | 29 | #include <sound/cs4231-regs.h> |
30 | 30 | ||
31 | /* defines for codec.mode */ | 31 | /* defines for codec.mode */ |
32 | 32 | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index b0b4eb24d592..1905ca8dd399 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Trace files that want to automate creationg of all tracepoints defined | 2 | * Trace files that want to automate creation of all tracepoints defined |
3 | * in their file should include this file. The following are macros that the | 3 | * in their file should include this file. The following are macros that the |
4 | * trace file may define: | 4 | * trace file may define: |
5 | * | 5 | * |
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 388bcdd26d46..fde1b3e94c7d 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include "gfpflags.h" | 9 | #include <trace/events/gfpflags.h> |
10 | 10 | ||
11 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, | 11 | DECLARE_EVENT_CLASS(mm_compaction_isolate_template, |
12 | 12 | ||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 08fa27244da7..6bc943ecb841 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include "gfpflags.h" | 9 | #include <trace/events/gfpflags.h> |
10 | 10 | ||
11 | DECLARE_EVENT_CLASS(kmem_alloc, | 11 | DECLARE_EVENT_CLASS(kmem_alloc, |
12 | 12 | ||
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index bab3b87e4064..63cfcccaebb3 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/memcontrol.h> | 10 | #include <linux/memcontrol.h> |
11 | #include "gfpflags.h" | 11 | #include <trace/events/gfpflags.h> |
12 | 12 | ||
13 | #define RECLAIM_WB_ANON 0x0001u | 13 | #define RECLAIM_WB_ANON 0x0001u |
14 | #define RECLAIM_WB_FILE 0x0002u | 14 | #define RECLAIM_WB_FILE 0x0002u |
diff --git a/include/uapi/Kbuild b/include/uapi/Kbuild new file mode 100644 index 000000000000..81d2106287fe --- /dev/null +++ b/include/uapi/Kbuild | |||
@@ -0,0 +1,14 @@ | |||
1 | # UAPI Header export list | ||
2 | # Top-level Makefile calls into asm-$(ARCH) | ||
3 | # List only non-arch directories below | ||
4 | |||
5 | |||
6 | header-y += asm-generic/ | ||
7 | header-y += linux/ | ||
8 | header-y += sound/ | ||
9 | header-y += mtd/ | ||
10 | header-y += rdma/ | ||
11 | header-y += video/ | ||
12 | header-y += drm/ | ||
13 | header-y += xen/ | ||
14 | header-y += scsi/ | ||
diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/asm-generic/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/asm-generic/Kbuild.asm b/include/uapi/asm-generic/Kbuild.asm new file mode 100644 index 000000000000..fcd50b759217 --- /dev/null +++ b/include/uapi/asm-generic/Kbuild.asm | |||
@@ -0,0 +1,49 @@ | |||
1 | # | ||
2 | # Headers that are optional in usr/include/asm/ | ||
3 | # | ||
4 | opt-header += kvm.h | ||
5 | opt-header += kvm_para.h | ||
6 | opt-header += a.out.h | ||
7 | |||
8 | # | ||
9 | # Headers that are mandatory in usr/include/asm/ | ||
10 | # | ||
11 | header-y += auxvec.h | ||
12 | header-y += bitsperlong.h | ||
13 | header-y += byteorder.h | ||
14 | header-y += errno.h | ||
15 | header-y += fcntl.h | ||
16 | header-y += ioctl.h | ||
17 | header-y += ioctls.h | ||
18 | header-y += ipcbuf.h | ||
19 | header-y += mman.h | ||
20 | header-y += msgbuf.h | ||
21 | header-y += param.h | ||
22 | header-y += poll.h | ||
23 | header-y += posix_types.h | ||
24 | header-y += ptrace.h | ||
25 | header-y += resource.h | ||
26 | header-y += sembuf.h | ||
27 | header-y += setup.h | ||
28 | header-y += shmbuf.h | ||
29 | header-y += sigcontext.h | ||
30 | header-y += siginfo.h | ||
31 | header-y += signal.h | ||
32 | header-y += socket.h | ||
33 | header-y += sockios.h | ||
34 | header-y += stat.h | ||
35 | header-y += statfs.h | ||
36 | header-y += swab.h | ||
37 | header-y += termbits.h | ||
38 | header-y += termios.h | ||
39 | header-y += types.h | ||
40 | header-y += unistd.h | ||
41 | |||
42 | header-y += $(foreach hdr,$(opt-header), \ | ||
43 | $(if \ | ||
44 | $(wildcard \ | ||
45 | $(srctree)/arch/$(SRCARCH)/include/uapi/asm/$(hdr) \ | ||
46 | $(srctree)/arch/$(SRCARCH)/include/asm/$(hdr) \ | ||
47 | ), \ | ||
48 | $(hdr) \ | ||
49 | )) | ||
diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/drm/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild new file mode 100644 index 000000000000..b0fd4d03499d --- /dev/null +++ b/include/uapi/linux/Kbuild | |||
@@ -0,0 +1,24 @@ | |||
1 | # UAPI Header export list | ||
2 | header-y += byteorder/ | ||
3 | header-y += can/ | ||
4 | header-y += caif/ | ||
5 | header-y += dvb/ | ||
6 | header-y += hdlc/ | ||
7 | header-y += hsi/ | ||
8 | header-y += isdn/ | ||
9 | header-y += mmc/ | ||
10 | header-y += nfsd/ | ||
11 | header-y += raid/ | ||
12 | header-y += spi/ | ||
13 | header-y += sunrpc/ | ||
14 | header-y += tc_act/ | ||
15 | header-y += tc_ematch/ | ||
16 | header-y += netfilter/ | ||
17 | header-y += netfilter_arp/ | ||
18 | header-y += netfilter_bridge/ | ||
19 | header-y += netfilter_ipv4/ | ||
20 | header-y += netfilter_ipv6/ | ||
21 | header-y += usb/ | ||
22 | header-y += wimax/ | ||
23 | |||
24 | genhdr-y += version.h | ||
diff --git a/include/uapi/linux/byteorder/Kbuild b/include/uapi/linux/byteorder/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/byteorder/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/caif/Kbuild b/include/uapi/linux/caif/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/caif/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/can/Kbuild b/include/uapi/linux/can/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/can/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/dvb/Kbuild b/include/uapi/linux/dvb/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/dvb/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/hdlc/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/hsi/Kbuild b/include/uapi/linux/hsi/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/hsi/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/isdn/Kbuild b/include/uapi/linux/isdn/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/isdn/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/mmc/Kbuild b/include/uapi/linux/mmc/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/mmc/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild new file mode 100644 index 000000000000..4afbace8e869 --- /dev/null +++ b/include/uapi/linux/netfilter/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | # UAPI Header export list | ||
2 | header-y += ipset/ | ||
diff --git a/include/uapi/linux/netfilter/ipset/Kbuild b/include/uapi/linux/netfilter/ipset/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/netfilter/ipset/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/netfilter_arp/Kbuild b/include/uapi/linux/netfilter_arp/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/netfilter_arp/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/netfilter_bridge/Kbuild b/include/uapi/linux/netfilter_bridge/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/netfilter_bridge/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/netfilter_ipv4/Kbuild b/include/uapi/linux/netfilter_ipv4/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/netfilter_ipv4/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/netfilter_ipv6/Kbuild b/include/uapi/linux/netfilter_ipv6/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/netfilter_ipv6/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/nfsd/Kbuild b/include/uapi/linux/nfsd/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/nfsd/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/raid/Kbuild b/include/uapi/linux/raid/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/raid/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/spi/Kbuild b/include/uapi/linux/spi/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/spi/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/sunrpc/Kbuild b/include/uapi/linux/sunrpc/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/sunrpc/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/tc_act/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/tc_ematch/Kbuild b/include/uapi/linux/tc_ematch/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/tc_ematch/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/usb/Kbuild b/include/uapi/linux/usb/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/usb/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/linux/wimax/Kbuild b/include/uapi/linux/wimax/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/linux/wimax/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/mtd/Kbuild b/include/uapi/mtd/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/mtd/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/rdma/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/scsi/Kbuild b/include/uapi/scsi/Kbuild new file mode 100644 index 000000000000..29a87dd26cfb --- /dev/null +++ b/include/uapi/scsi/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | # UAPI Header export list | ||
2 | header-y += fc/ | ||
diff --git a/include/uapi/scsi/fc/Kbuild b/include/uapi/scsi/fc/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/scsi/fc/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/sound/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/video/Kbuild b/include/uapi/video/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/video/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/uapi/xen/Kbuild b/include/uapi/xen/Kbuild new file mode 100644 index 000000000000..aafaa5aa54d4 --- /dev/null +++ b/include/uapi/xen/Kbuild | |||
@@ -0,0 +1 @@ | |||
# UAPI Header export list | |||
diff --git a/include/video/epson1355.h b/include/video/epson1355.h deleted file mode 100644 index 9759f299499e..000000000000 --- a/include/video/epson1355.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * include/video/epson13xx.h -- Epson 13xx frame buffer | ||
3 | * | ||
4 | * Copyright (C) Hewlett-Packard Company. All rights reserved. | ||
5 | * | ||
6 | * Written by Christopher Hoover <ch@hpl.hp.com> | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef _EPSON13XX_H_ | ||
11 | #define _EPSON13XX_H_ | ||
12 | |||
13 | #define REG_REVISION_CODE 0x00 | ||
14 | #define REG_MEMORY_CONFIG 0x01 | ||
15 | #define REG_PANEL_TYPE 0x02 | ||
16 | #define REG_MOD_RATE 0x03 | ||
17 | #define REG_HORZ_DISP_WIDTH 0x04 | ||
18 | #define REG_HORZ_NONDISP_PERIOD 0x05 | ||
19 | #define REG_HRTC_START_POSITION 0x06 | ||
20 | #define REG_HRTC_PULSE_WIDTH 0x07 | ||
21 | #define REG_VERT_DISP_HEIGHT0 0x08 | ||
22 | #define REG_VERT_DISP_HEIGHT1 0x09 | ||
23 | #define REG_VERT_NONDISP_PERIOD 0x0A | ||
24 | #define REG_VRTC_START_POSITION 0x0B | ||
25 | #define REG_VRTC_PULSE_WIDTH 0x0C | ||
26 | #define REG_DISPLAY_MODE 0x0D | ||
27 | #define REG_SCRN1_LINE_COMPARE0 0x0E | ||
28 | #define REG_SCRN1_LINE_COMPARE1 0x0F | ||
29 | #define REG_SCRN1_DISP_START_ADDR0 0x10 | ||
30 | #define REG_SCRN1_DISP_START_ADDR1 0x11 | ||
31 | #define REG_SCRN1_DISP_START_ADDR2 0x12 | ||
32 | #define REG_SCRN2_DISP_START_ADDR0 0x13 | ||
33 | #define REG_SCRN2_DISP_START_ADDR1 0x14 | ||
34 | #define REG_SCRN2_DISP_START_ADDR2 0x15 | ||
35 | #define REG_MEM_ADDR_OFFSET0 0x16 | ||
36 | #define REG_MEM_ADDR_OFFSET1 0x17 | ||
37 | #define REG_PIXEL_PANNING 0x18 | ||
38 | #define REG_CLOCK_CONFIG 0x19 | ||
39 | #define REG_POWER_SAVE_CONFIG 0x1A | ||
40 | #define REG_MISC 0x1B | ||
41 | #define REG_MD_CONFIG_READBACK0 0x1C | ||
42 | #define REG_MD_CONFIG_READBACK1 0x1D | ||
43 | #define REG_GPIO_CONFIG0 0x1E | ||
44 | #define REG_GPIO_CONFIG1 0x1F | ||
45 | #define REG_GPIO_CONTROL0 0x20 | ||
46 | #define REG_GPIO_CONTROL1 0x21 | ||
47 | #define REG_PERF_ENHANCEMENT0 0x22 | ||
48 | #define REG_PERF_ENHANCEMENT1 0x23 | ||
49 | #define REG_LUT_ADDR 0x24 | ||
50 | #define REG_RESERVED_1 0x25 | ||
51 | #define REG_LUT_DATA 0x26 | ||
52 | #define REG_INK_CURSOR_CONTROL 0x27 | ||
53 | #define REG_CURSOR_X_POSITION0 0x28 | ||
54 | #define REG_CURSOR_X_POSITION1 0x29 | ||
55 | #define REG_CURSOR_Y_POSITION0 0x2A | ||
56 | #define REG_CURSOR_Y_POSITION1 0x2B | ||
57 | #define REG_INK_CURSOR_COLOR0_0 0x2C | ||
58 | #define REG_INK_CURSOR_COLOR0_1 0x2D | ||
59 | #define REG_INK_CURSOR_COLOR1_0 0x2E | ||
60 | #define REG_INK_CURSOR_COLOR1_1 0x2F | ||
61 | #define REG_INK_CURSOR_START_ADDR 0x30 | ||
62 | #define REG_ALTERNATE_FRM 0x31 | ||
63 | |||
64 | #endif | ||
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index f19fff8650e9..aecee9d112cb 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -190,4 +190,16 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
190 | struct gnttab_map_grant_ref *kunmap_ops, | 190 | struct gnttab_map_grant_ref *kunmap_ops, |
191 | struct page **pages, unsigned int count); | 191 | struct page **pages, unsigned int count); |
192 | 192 | ||
193 | /* Perform a batch of grant map/copy operations. Retry every batch slot | ||
194 | * for which the hypervisor returns GNTST_eagain. This is typically due | ||
195 | * to paged out target frames. | ||
196 | * | ||
197 | * Will retry for 1, 2, ... 255 ms, i.e. 256 times during 32 seconds. | ||
198 | * | ||
199 | * Return value in each iand every status field of the batch guaranteed | ||
200 | * to not be GNTST_eagain. | ||
201 | */ | ||
202 | void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count); | ||
203 | void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count); | ||
204 | |||
193 | #endif /* __ASM_GNTTAB_H__ */ | 205 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/interface/callback.h b/include/xen/interface/callback.h index 2ae3cd243264..8c5fa0e20155 100644 --- a/include/xen/interface/callback.h +++ b/include/xen/interface/callback.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #ifndef __XEN_PUBLIC_CALLBACK_H__ | 27 | #ifndef __XEN_PUBLIC_CALLBACK_H__ |
28 | #define __XEN_PUBLIC_CALLBACK_H__ | 28 | #define __XEN_PUBLIC_CALLBACK_H__ |
29 | 29 | ||
30 | #include "xen.h" | 30 | #include <xen/interface/xen.h> |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Prototype for this hypercall is: | 33 | * Prototype for this hypercall is: |
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h index a17d84433e6a..f9f8b975ae74 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h | |||
@@ -338,7 +338,7 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_dump_table); | |||
338 | #define GNTTABOP_transfer 4 | 338 | #define GNTTABOP_transfer 4 |
339 | struct gnttab_transfer { | 339 | struct gnttab_transfer { |
340 | /* IN parameters. */ | 340 | /* IN parameters. */ |
341 | unsigned long mfn; | 341 | xen_pfn_t mfn; |
342 | domid_t domid; | 342 | domid_t domid; |
343 | grant_ref_t ref; | 343 | grant_ref_t ref; |
344 | /* OUT parameters. */ | 344 | /* OUT parameters. */ |
@@ -375,7 +375,7 @@ struct gnttab_copy { | |||
375 | struct { | 375 | struct { |
376 | union { | 376 | union { |
377 | grant_ref_t ref; | 377 | grant_ref_t ref; |
378 | unsigned long gmfn; | 378 | xen_pfn_t gmfn; |
379 | } u; | 379 | } u; |
380 | domid_t domid; | 380 | domid_t domid; |
381 | uint16_t offset; | 381 | uint16_t offset; |
@@ -519,7 +519,9 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_version); | |||
519 | #define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */ | 519 | #define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */ |
520 | #define GNTST_permission_denied (-8) /* Not enough privilege for operation. */ | 520 | #define GNTST_permission_denied (-8) /* Not enough privilege for operation. */ |
521 | #define GNTST_bad_page (-9) /* Specified page was invalid for op. */ | 521 | #define GNTST_bad_page (-9) /* Specified page was invalid for op. */ |
522 | #define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary */ | 522 | #define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary. */ |
523 | #define GNTST_address_too_big (-11) /* transfer page address too large. */ | ||
524 | #define GNTST_eagain (-12) /* Operation not done; try again. */ | ||
523 | 525 | ||
524 | #define GNTTABOP_error_msgs { \ | 526 | #define GNTTABOP_error_msgs { \ |
525 | "okay", \ | 527 | "okay", \ |
@@ -532,7 +534,9 @@ DEFINE_GUEST_HANDLE_STRUCT(gnttab_get_version); | |||
532 | "no spare translation slot in the I/O MMU", \ | 534 | "no spare translation slot in the I/O MMU", \ |
533 | "permission denied", \ | 535 | "permission denied", \ |
534 | "bad page", \ | 536 | "bad page", \ |
535 | "copy arguments cross page boundary" \ | 537 | "copy arguments cross page boundary", \ |
538 | "page address size too large", \ | ||
539 | "operation not done; try again" \ | ||
536 | } | 540 | } |
537 | 541 | ||
538 | #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */ | 542 | #endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */ |
diff --git a/include/xen/interface/hvm/params.h b/include/xen/interface/hvm/params.h index 1b4f923d7086..a6c79911e729 100644 --- a/include/xen/interface/hvm/params.h +++ b/include/xen/interface/hvm/params.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __XEN_PUBLIC_HVM_PARAMS_H__ | 21 | #ifndef __XEN_PUBLIC_HVM_PARAMS_H__ |
22 | #define __XEN_PUBLIC_HVM_PARAMS_H__ | 22 | #define __XEN_PUBLIC_HVM_PARAMS_H__ |
23 | 23 | ||
24 | #include "hvm_op.h" | 24 | #include <xen/interface/hvm/hvm_op.h> |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Parameter space for HVMOP_{set,get}_param. | 27 | * Parameter space for HVMOP_{set,get}_param. |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index ee338bfde18b..01c3d62436ef 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
@@ -9,8 +9,8 @@ | |||
9 | #ifndef __XEN_PUBLIC_IO_BLKIF_H__ | 9 | #ifndef __XEN_PUBLIC_IO_BLKIF_H__ |
10 | #define __XEN_PUBLIC_IO_BLKIF_H__ | 10 | #define __XEN_PUBLIC_IO_BLKIF_H__ |
11 | 11 | ||
12 | #include "ring.h" | 12 | #include <xen/interface/io/ring.h> |
13 | #include "../grant_table.h" | 13 | #include <xen/interface/grant_table.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Front->back notifications: When enqueuing a new request, sending a | 16 | * Front->back notifications: When enqueuing a new request, sending a |
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h index cb94668f6e9f..9dfc12000980 100644 --- a/include/xen/interface/io/netif.h +++ b/include/xen/interface/io/netif.h | |||
@@ -9,8 +9,8 @@ | |||
9 | #ifndef __XEN_PUBLIC_IO_NETIF_H__ | 9 | #ifndef __XEN_PUBLIC_IO_NETIF_H__ |
10 | #define __XEN_PUBLIC_IO_NETIF_H__ | 10 | #define __XEN_PUBLIC_IO_NETIF_H__ |
11 | 11 | ||
12 | #include "ring.h" | 12 | #include <xen/interface/io/ring.h> |
13 | #include "../grant_table.h" | 13 | #include <xen/interface/grant_table.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Notifications after enqueuing any type of message should be conditional on | 16 | * Notifications after enqueuing any type of message should be conditional on |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index eac3ce153719..d8e33a93ea4d 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -31,7 +31,7 @@ struct xen_memory_reservation { | |||
31 | * OUT: GMFN bases of extents that were allocated | 31 | * OUT: GMFN bases of extents that were allocated |
32 | * (NB. This command also updates the mach_to_phys translation table) | 32 | * (NB. This command also updates the mach_to_phys translation table) |
33 | */ | 33 | */ |
34 | GUEST_HANDLE(ulong) extent_start; | 34 | GUEST_HANDLE(xen_pfn_t) extent_start; |
35 | 35 | ||
36 | /* Number of extents, and size/alignment of each (2^extent_order pages). */ | 36 | /* Number of extents, and size/alignment of each (2^extent_order pages). */ |
37 | unsigned long nr_extents; | 37 | unsigned long nr_extents; |
@@ -130,7 +130,7 @@ struct xen_machphys_mfn_list { | |||
130 | * any large discontiguities in the machine address space, 2MB gaps in | 130 | * any large discontiguities in the machine address space, 2MB gaps in |
131 | * the machphys table will be represented by an MFN base of zero. | 131 | * the machphys table will be represented by an MFN base of zero. |
132 | */ | 132 | */ |
133 | GUEST_HANDLE(ulong) extent_start; | 133 | GUEST_HANDLE(xen_pfn_t) extent_start; |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Number of extents written to the above array. This will be smaller | 136 | * Number of extents written to the above array. This will be smaller |
@@ -163,6 +163,9 @@ struct xen_add_to_physmap { | |||
163 | /* Which domain to change the mapping for. */ | 163 | /* Which domain to change the mapping for. */ |
164 | domid_t domid; | 164 | domid_t domid; |
165 | 165 | ||
166 | /* Number of pages to go through for gmfn_range */ | ||
167 | uint16_t size; | ||
168 | |||
166 | /* Source mapping space. */ | 169 | /* Source mapping space. */ |
167 | #define XENMAPSPACE_shared_info 0 /* shared info page */ | 170 | #define XENMAPSPACE_shared_info 0 /* shared info page */ |
168 | #define XENMAPSPACE_grant_table 1 /* grant table page */ | 171 | #define XENMAPSPACE_grant_table 1 /* grant table page */ |
@@ -172,7 +175,7 @@ struct xen_add_to_physmap { | |||
172 | unsigned long idx; | 175 | unsigned long idx; |
173 | 176 | ||
174 | /* GPFN where the source mapping page should appear. */ | 177 | /* GPFN where the source mapping page should appear. */ |
175 | unsigned long gpfn; | 178 | xen_pfn_t gpfn; |
176 | }; | 179 | }; |
177 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | 180 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); |
178 | 181 | ||
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 9ce788d8cf49..bfa1d50fe15b 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
@@ -258,6 +258,22 @@ struct physdev_pci_device { | |||
258 | uint8_t devfn; | 258 | uint8_t devfn; |
259 | }; | 259 | }; |
260 | 260 | ||
261 | #define PHYSDEVOP_DBGP_RESET_PREPARE 1 | ||
262 | #define PHYSDEVOP_DBGP_RESET_DONE 2 | ||
263 | |||
264 | #define PHYSDEVOP_DBGP_BUS_UNKNOWN 0 | ||
265 | #define PHYSDEVOP_DBGP_BUS_PCI 1 | ||
266 | |||
267 | #define PHYSDEVOP_dbgp_op 29 | ||
268 | struct physdev_dbgp_op { | ||
269 | /* IN */ | ||
270 | uint8_t op; | ||
271 | uint8_t bus; | ||
272 | union { | ||
273 | struct physdev_pci_device pci; | ||
274 | } u; | ||
275 | }; | ||
276 | |||
261 | /* | 277 | /* |
262 | * Notify that some PIRQ-bound event channels have been unmasked. | 278 | * Notify that some PIRQ-bound event channels have been unmasked. |
263 | * ** This command is obsolete since interface version 0x00030202 and is ** | 279 | * ** This command is obsolete since interface version 0x00030202 and is ** |
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 61fa66160983..4755b5fac9c7 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #ifndef __XEN_PUBLIC_PLATFORM_H__ | 27 | #ifndef __XEN_PUBLIC_PLATFORM_H__ |
28 | #define __XEN_PUBLIC_PLATFORM_H__ | 28 | #define __XEN_PUBLIC_PLATFORM_H__ |
29 | 29 | ||
30 | #include "xen.h" | 30 | #include <xen/interface/xen.h> |
31 | 31 | ||
32 | #define XENPF_INTERFACE_VERSION 0x03000001 | 32 | #define XENPF_INTERFACE_VERSION 0x03000001 |
33 | 33 | ||
@@ -54,7 +54,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_settime_t); | |||
54 | #define XENPF_add_memtype 31 | 54 | #define XENPF_add_memtype 31 |
55 | struct xenpf_add_memtype { | 55 | struct xenpf_add_memtype { |
56 | /* IN variables. */ | 56 | /* IN variables. */ |
57 | unsigned long mfn; | 57 | xen_pfn_t mfn; |
58 | uint64_t nr_mfns; | 58 | uint64_t nr_mfns; |
59 | uint32_t type; | 59 | uint32_t type; |
60 | /* OUT variables. */ | 60 | /* OUT variables. */ |
@@ -84,7 +84,7 @@ struct xenpf_read_memtype { | |||
84 | /* IN variables. */ | 84 | /* IN variables. */ |
85 | uint32_t reg; | 85 | uint32_t reg; |
86 | /* OUT variables. */ | 86 | /* OUT variables. */ |
87 | unsigned long mfn; | 87 | xen_pfn_t mfn; |
88 | uint64_t nr_mfns; | 88 | uint64_t nr_mfns; |
89 | uint32_t type; | 89 | uint32_t type; |
90 | }; | 90 | }; |
@@ -112,6 +112,7 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_platform_quirk_t); | |||
112 | #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ | 112 | #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ |
113 | #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ | 113 | #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ |
114 | #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ | 114 | #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ |
115 | #define XEN_FW_KBD_SHIFT_FLAGS 5 /* Int16, Fn02: Get keyboard shift flags. */ | ||
115 | struct xenpf_firmware_info { | 116 | struct xenpf_firmware_info { |
116 | /* IN variables. */ | 117 | /* IN variables. */ |
117 | uint32_t type; | 118 | uint32_t type; |
@@ -142,6 +143,8 @@ struct xenpf_firmware_info { | |||
142 | /* must refer to 128-byte buffer */ | 143 | /* must refer to 128-byte buffer */ |
143 | GUEST_HANDLE(uchar) edid; | 144 | GUEST_HANDLE(uchar) edid; |
144 | } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ | 145 | } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ |
146 | |||
147 | uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */ | ||
145 | } u; | 148 | } u; |
146 | }; | 149 | }; |
147 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t); | 150 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t); |
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h index dd55dac340de..9ce083960a25 100644 --- a/include/xen/interface/sched.h +++ b/include/xen/interface/sched.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifndef __XEN_PUBLIC_SCHED_H__ | 9 | #ifndef __XEN_PUBLIC_SCHED_H__ |
10 | #define __XEN_PUBLIC_SCHED_H__ | 10 | #define __XEN_PUBLIC_SCHED_H__ |
11 | 11 | ||
12 | #include "event_channel.h" | 12 | #include <xen/interface/event_channel.h> |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * The prototype for this hypercall is: | 15 | * The prototype for this hypercall is: |
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h index e8b6519d47e9..5f5e551cf546 100644 --- a/include/xen/interface/version.h +++ b/include/xen/interface/version.h | |||
@@ -55,9 +55,12 @@ struct xen_feature_info { | |||
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* Declares the features reported by XENVER_get_features. */ | 57 | /* Declares the features reported by XENVER_get_features. */ |
58 | #include "features.h" | 58 | #include <xen/interface/features.h> |
59 | 59 | ||
60 | /* arg == NULL; returns host memory page size. */ | 60 | /* arg == NULL; returns host memory page size. */ |
61 | #define XENVER_pagesize 7 | 61 | #define XENVER_pagesize 7 |
62 | 62 | ||
63 | /* arg == xen_domain_handle_t. */ | ||
64 | #define XENVER_guest_handle 8 | ||
65 | |||
63 | #endif /* __XEN_PUBLIC_VERSION_H__ */ | 66 | #endif /* __XEN_PUBLIC_VERSION_H__ */ |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 0801468f9abe..886a5d80a18f 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #define __XEN_PUBLIC_XEN_H__ | 10 | #define __XEN_PUBLIC_XEN_H__ |
11 | 11 | ||
12 | #include <asm/xen/interface.h> | 12 | #include <asm/xen/interface.h> |
13 | #include <asm/pvclock-abi.h> | ||
14 | 13 | ||
15 | /* | 14 | /* |
16 | * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS). | 15 | * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS). |
@@ -190,7 +189,7 @@ struct mmuext_op { | |||
190 | unsigned int cmd; | 189 | unsigned int cmd; |
191 | union { | 190 | union { |
192 | /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */ | 191 | /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */ |
193 | unsigned long mfn; | 192 | xen_pfn_t mfn; |
194 | /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */ | 193 | /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */ |
195 | unsigned long linear_addr; | 194 | unsigned long linear_addr; |
196 | } arg1; | 195 | } arg1; |
@@ -430,11 +429,11 @@ struct start_info { | |||
430 | unsigned long nr_pages; /* Total pages allocated to this domain. */ | 429 | unsigned long nr_pages; /* Total pages allocated to this domain. */ |
431 | unsigned long shared_info; /* MACHINE address of shared info struct. */ | 430 | unsigned long shared_info; /* MACHINE address of shared info struct. */ |
432 | uint32_t flags; /* SIF_xxx flags. */ | 431 | uint32_t flags; /* SIF_xxx flags. */ |
433 | unsigned long store_mfn; /* MACHINE page number of shared page. */ | 432 | xen_pfn_t store_mfn; /* MACHINE page number of shared page. */ |
434 | uint32_t store_evtchn; /* Event channel for store communication. */ | 433 | uint32_t store_evtchn; /* Event channel for store communication. */ |
435 | union { | 434 | union { |
436 | struct { | 435 | struct { |
437 | unsigned long mfn; /* MACHINE page number of console page. */ | 436 | xen_pfn_t mfn; /* MACHINE page number of console page. */ |
438 | uint32_t evtchn; /* Event channel for console page. */ | 437 | uint32_t evtchn; /* Event channel for console page. */ |
439 | } domU; | 438 | } domU; |
440 | struct { | 439 | struct { |
@@ -455,6 +454,7 @@ struct dom0_vga_console_info { | |||
455 | uint8_t video_type; | 454 | uint8_t video_type; |
456 | #define XEN_VGATYPE_TEXT_MODE_3 0x03 | 455 | #define XEN_VGATYPE_TEXT_MODE_3 0x03 |
457 | #define XEN_VGATYPE_VESA_LFB 0x23 | 456 | #define XEN_VGATYPE_VESA_LFB 0x23 |
457 | #define XEN_VGATYPE_EFI_LFB 0x70 | ||
458 | 458 | ||
459 | union { | 459 | union { |
460 | struct { | 460 | struct { |
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h index 17857fb4d550..a85316811d79 100644 --- a/include/xen/privcmd.h +++ b/include/xen/privcmd.h | |||
@@ -35,8 +35,7 @@ | |||
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | #include <linux/compiler.h> | 37 | #include <linux/compiler.h> |
38 | 38 | #include <xen/interface/xen.h> | |
39 | typedef unsigned long xen_pfn_t; | ||
40 | 39 | ||
41 | struct privcmd_hypercall { | 40 | struct privcmd_hypercall { |
42 | __u64 op; | 41 | __u64 op; |
@@ -59,13 +58,33 @@ struct privcmd_mmapbatch { | |||
59 | int num; /* number of pages to populate */ | 58 | int num; /* number of pages to populate */ |
60 | domid_t dom; /* target domain */ | 59 | domid_t dom; /* target domain */ |
61 | __u64 addr; /* virtual address */ | 60 | __u64 addr; /* virtual address */ |
62 | xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */ | 61 | xen_pfn_t __user *arr; /* array of mfns - or'd with |
62 | PRIVCMD_MMAPBATCH_*_ERROR on err */ | ||
63 | }; | ||
64 | |||
65 | #define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U | ||
66 | #define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U | ||
67 | |||
68 | struct privcmd_mmapbatch_v2 { | ||
69 | unsigned int num; /* number of pages to populate */ | ||
70 | domid_t dom; /* target domain */ | ||
71 | __u64 addr; /* virtual address */ | ||
72 | const xen_pfn_t __user *arr; /* array of mfns */ | ||
73 | int __user *err; /* array of error codes */ | ||
63 | }; | 74 | }; |
64 | 75 | ||
65 | /* | 76 | /* |
66 | * @cmd: IOCTL_PRIVCMD_HYPERCALL | 77 | * @cmd: IOCTL_PRIVCMD_HYPERCALL |
67 | * @arg: &privcmd_hypercall_t | 78 | * @arg: &privcmd_hypercall_t |
68 | * Return: Value returned from execution of the specified hypercall. | 79 | * Return: Value returned from execution of the specified hypercall. |
80 | * | ||
81 | * @cmd: IOCTL_PRIVCMD_MMAPBATCH_V2 | ||
82 | * @arg: &struct privcmd_mmapbatch_v2 | ||
83 | * Return: 0 on success (i.e., arg->err contains valid error codes for | ||
84 | * each frame). On an error other than a failed frame remap, -1 is | ||
85 | * returned and errno is set to EINVAL, EFAULT etc. As an exception, | ||
86 | * if the operation was otherwise successful but any frame failed with | ||
87 | * -ENOENT, then -1 is returned and errno is set to ENOENT. | ||
69 | */ | 88 | */ |
70 | #define IOCTL_PRIVCMD_HYPERCALL \ | 89 | #define IOCTL_PRIVCMD_HYPERCALL \ |
71 | _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) | 90 | _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) |
@@ -73,5 +92,7 @@ struct privcmd_mmapbatch { | |||
73 | _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) | 92 | _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) |
74 | #define IOCTL_PRIVCMD_MMAPBATCH \ | 93 | #define IOCTL_PRIVCMD_MMAPBATCH \ |
75 | _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) | 94 | _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) |
95 | #define IOCTL_PRIVCMD_MMAPBATCH_V2 \ | ||
96 | _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2)) | ||
76 | 97 | ||
77 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ | 98 | #endif /* __LINUX_PUBLIC_PRIVCMD_H__ */ |
diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h index 4f4d449f00f6..de8bcc641c49 100644 --- a/include/xen/swiotlb-xen.h +++ b/include/xen/swiotlb-xen.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/swiotlb.h> | 4 | #include <linux/swiotlb.h> |
5 | 5 | ||
6 | extern void xen_swiotlb_init(int verbose); | 6 | extern int xen_swiotlb_init(int verbose, bool early); |
7 | 7 | ||
8 | extern void | 8 | extern void |
9 | *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 9 | *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
@@ -23,15 +23,6 @@ extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, | |||
23 | extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, | 23 | extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, |
24 | size_t size, enum dma_data_direction dir, | 24 | size_t size, enum dma_data_direction dir, |
25 | struct dma_attrs *attrs); | 25 | struct dma_attrs *attrs); |
26 | /* | ||
27 | extern int | ||
28 | xen_swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
29 | enum dma_data_direction dir); | ||
30 | |||
31 | extern void | ||
32 | xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
33 | enum dma_data_direction dir); | ||
34 | */ | ||
35 | extern int | 26 | extern int |
36 | xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | 27 | xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, |
37 | int nelems, enum dma_data_direction dir, | 28 | int nelems, enum dma_data_direction dir, |