diff options
Diffstat (limited to 'include/linux')
305 files changed, 5716 insertions, 2023 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 01f636275057..619b5657af77 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -135,6 +135,7 @@ header-y += firewire-cdev.h | |||
135 | header-y += firewire-constants.h | 135 | header-y += firewire-constants.h |
136 | header-y += flat.h | 136 | header-y += flat.h |
137 | header-y += fs.h | 137 | header-y += fs.h |
138 | header-y += fsl_hypervisor.h | ||
138 | header-y += fuse.h | 139 | header-y += fuse.h |
139 | header-y += futex.h | 140 | header-y += futex.h |
140 | header-y += gameport.h | 141 | header-y += gameport.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1deb2a73c2da..6001b4da39dd 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -238,7 +238,6 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size); | |||
238 | extern int pnpacpi_disabled; | 238 | extern int pnpacpi_disabled; |
239 | 239 | ||
240 | #define PXM_INVAL (-1) | 240 | #define PXM_INVAL (-1) |
241 | #define NID_INVAL (-1) | ||
242 | 241 | ||
243 | int acpi_check_resource_conflict(const struct resource *res); | 242 | int acpi_check_resource_conflict(const struct resource *res); |
244 | 243 | ||
@@ -280,6 +279,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); | |||
280 | #define OSC_SB_CPUHP_OST_SUPPORT 8 | 279 | #define OSC_SB_CPUHP_OST_SUPPORT 8 |
281 | #define OSC_SB_APEI_SUPPORT 16 | 280 | #define OSC_SB_APEI_SUPPORT 16 |
282 | 281 | ||
282 | extern bool osc_sb_apei_support_acked; | ||
283 | |||
283 | /* PCI defined _OSC bits */ | 284 | /* PCI defined _OSC bits */ |
284 | /* _OSC DW1 Definition (OS Support Fields) */ | 285 | /* _OSC DW1 Definition (OS Support Fields) */ |
285 | #define OSC_EXT_PCI_CONFIG_SUPPORT 1 | 286 | #define OSC_EXT_PCI_CONFIG_SUPPORT 1 |
diff --git a/include/linux/aer.h b/include/linux/aer.h index 8414de22a779..544abdb2238c 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h | |||
@@ -51,5 +51,8 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) | |||
51 | 51 | ||
52 | extern void cper_print_aer(const char *prefix, int cper_severity, | 52 | extern void cper_print_aer(const char *prefix, int cper_severity, |
53 | struct aer_capability_regs *aer); | 53 | struct aer_capability_regs *aer); |
54 | extern int cper_severity_to_aer(int cper_severity); | ||
55 | extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, | ||
56 | int severity); | ||
54 | #endif //_AER_H_ | 57 | #endif //_AER_H_ |
55 | 58 | ||
diff --git a/include/linux/aio.h b/include/linux/aio.h index 7a8db4155281..2dcb72bff4b6 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/uio.h> | 7 | #include <linux/uio.h> |
8 | #include <linux/rcupdate.h> | 8 | #include <linux/rcupdate.h> |
9 | 9 | ||
10 | #include <asm/atomic.h> | 10 | #include <linux/atomic.h> |
11 | 11 | ||
12 | #define AIO_MAXSEGS 4 | 12 | #define AIO_MAXSEGS 4 |
13 | #define AIO_KIOGRP_NR_ATOMIC 8 | 13 | #define AIO_KIOGRP_NR_ATOMIC 8 |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 3111385b8ca7..e6e28f37d8ec 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -172,8 +172,11 @@ struct pl08x_dma_chan { | |||
172 | int phychan_hold; | 172 | int phychan_hold; |
173 | struct tasklet_struct tasklet; | 173 | struct tasklet_struct tasklet; |
174 | char *name; | 174 | char *name; |
175 | struct pl08x_channel_data *cd; | 175 | const struct pl08x_channel_data *cd; |
176 | dma_addr_t runtime_addr; | 176 | dma_addr_t src_addr; |
177 | dma_addr_t dst_addr; | ||
178 | u32 src_cctl; | ||
179 | u32 dst_cctl; | ||
177 | enum dma_data_direction runtime_direction; | 180 | enum dma_data_direction runtime_direction; |
178 | dma_cookie_t lc; | 181 | dma_cookie_t lc; |
179 | struct list_head pend_list; | 182 | struct list_head pend_list; |
@@ -202,7 +205,7 @@ struct pl08x_dma_chan { | |||
202 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 | 205 | * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 |
203 | */ | 206 | */ |
204 | struct pl08x_platform_data { | 207 | struct pl08x_platform_data { |
205 | struct pl08x_channel_data *slave_channels; | 208 | const struct pl08x_channel_data *slave_channels; |
206 | unsigned int num_slave_channels; | 209 | unsigned int num_slave_channels; |
207 | struct pl08x_channel_data memcpy_channel; | 210 | struct pl08x_channel_data memcpy_channel; |
208 | int (*get_signal)(struct pl08x_dma_chan *); | 211 | int (*get_signal)(struct pl08x_dma_chan *); |
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h new file mode 100644 index 000000000000..a6863a2dec1f --- /dev/null +++ b/include/linux/amd-iommu.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2010 Advanced Micro Devices, Inc. | ||
3 | * Author: Joerg Roedel <joerg.roedel@amd.com> | ||
4 | * Leo Duran <leo.duran@amd.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * 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 _ASM_X86_AMD_IOMMU_H | ||
21 | #define _ASM_X86_AMD_IOMMU_H | ||
22 | |||
23 | #include <linux/irqreturn.h> | ||
24 | |||
25 | #ifdef CONFIG_AMD_IOMMU | ||
26 | |||
27 | extern int amd_iommu_detect(void); | ||
28 | |||
29 | #else | ||
30 | |||
31 | static inline int amd_iommu_detect(void) { return -ENODEV; } | ||
32 | |||
33 | #endif | ||
34 | |||
35 | #endif /* _ASM_X86_AMD_IOMMU_H */ | ||
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index 69a21e0ebd33..8013a45242fe 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #ifndef _LINUX_ANON_INODES_H | 8 | #ifndef _LINUX_ANON_INODES_H |
9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
10 | 10 | ||
11 | struct file_operations; | ||
12 | |||
11 | struct file *anon_inode_getfile(const char *name, | 13 | struct file *anon_inode_getfile(const char *name, |
12 | const struct file_operations *fops, | 14 | const struct file_operations *fops, |
13 | void *priv, int flags); | 15 | void *priv, int flags); |
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 7d650a0e3d8f..7216b0daf544 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/if_arcnet.h> | 20 | #include <linux/if_arcnet.h> |
21 | 21 | ||
22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
23 | #include <linux/irqreturn.h> | ||
23 | 24 | ||
24 | #ifndef bool | 25 | #ifndef bool |
25 | #define bool int | 26 | #define bool int |
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h index 60a7c49dcb49..6e3f54f37844 100644 --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h | |||
@@ -30,6 +30,8 @@ struct ath9k_platform_data { | |||
30 | u32 gpio_val; | 30 | u32 gpio_val; |
31 | 31 | ||
32 | bool is_clk_25mhz; | 32 | bool is_clk_25mhz; |
33 | int (*get_mac_revision)(void); | ||
34 | int (*external_reset)(void); | ||
33 | }; | 35 | }; |
34 | 36 | ||
35 | #endif /* _LINUX_ATH9K_PLATFORM_H */ | 37 | #endif /* _LINUX_ATH9K_PLATFORM_H */ |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 381f4cec8260..49a83ca900ba 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -220,7 +220,7 @@ struct atm_cirange { | |||
220 | #include <linux/skbuff.h> /* struct sk_buff */ | 220 | #include <linux/skbuff.h> /* struct sk_buff */ |
221 | #include <linux/uio.h> | 221 | #include <linux/uio.h> |
222 | #include <net/sock.h> | 222 | #include <net/sock.h> |
223 | #include <asm/atomic.h> | 223 | #include <linux/atomic.h> |
224 | 224 | ||
225 | #ifdef CONFIG_PROC_FS | 225 | #ifdef CONFIG_PROC_FS |
226 | #include <linux/proc_fs.h> | 226 | #include <linux/proc_fs.h> |
diff --git a/include/linux/atomic.h b/include/linux/atomic.h index ee456c79b0e6..42b77b5446d2 100644 --- a/include/linux/atomic.h +++ b/include/linux/atomic.h | |||
@@ -1,8 +1,32 @@ | |||
1 | /* Atomic operations usable in machine independent code */ | ||
1 | #ifndef _LINUX_ATOMIC_H | 2 | #ifndef _LINUX_ATOMIC_H |
2 | #define _LINUX_ATOMIC_H | 3 | #define _LINUX_ATOMIC_H |
3 | #include <asm/atomic.h> | 4 | #include <asm/atomic.h> |
4 | 5 | ||
5 | /** | 6 | /** |
7 | * atomic_add_unless - add unless the number is already a given value | ||
8 | * @v: pointer of type atomic_t | ||
9 | * @a: the amount to add to v... | ||
10 | * @u: ...unless v is equal to u. | ||
11 | * | ||
12 | * Atomically adds @a to @v, so long as @v was not already @u. | ||
13 | * Returns non-zero if @v was not @u, and zero otherwise. | ||
14 | */ | ||
15 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | ||
16 | { | ||
17 | return __atomic_add_unless(v, a, u) != u; | ||
18 | } | ||
19 | |||
20 | /** | ||
21 | * atomic_inc_not_zero - increment unless the number is zero | ||
22 | * @v: pointer of type atomic_t | ||
23 | * | ||
24 | * Atomically increments @v by 1, so long as @v is non-zero. | ||
25 | * Returns non-zero if @v was non-zero, and zero otherwise. | ||
26 | */ | ||
27 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
28 | |||
29 | /** | ||
6 | * atomic_inc_not_zero_hint - increment if not null | 30 | * atomic_inc_not_zero_hint - increment if not null |
7 | * @v: pointer of type atomic_t | 31 | * @v: pointer of type atomic_t |
8 | * @hint: probable value of the atomic before the increment | 32 | * @hint: probable value of the atomic before the increment |
@@ -34,6 +58,32 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint) | |||
34 | } | 58 | } |
35 | #endif | 59 | #endif |
36 | 60 | ||
61 | #ifndef atomic_inc_unless_negative | ||
62 | static inline int atomic_inc_unless_negative(atomic_t *p) | ||
63 | { | ||
64 | int v, v1; | ||
65 | for (v = 0; v >= 0; v = v1) { | ||
66 | v1 = atomic_cmpxchg(p, v, v + 1); | ||
67 | if (likely(v1 == v)) | ||
68 | return 1; | ||
69 | } | ||
70 | return 0; | ||
71 | } | ||
72 | #endif | ||
73 | |||
74 | #ifndef atomic_dec_unless_positive | ||
75 | static inline int atomic_dec_unless_positive(atomic_t *p) | ||
76 | { | ||
77 | int v, v1; | ||
78 | for (v = 0; v <= 0; v = v1) { | ||
79 | v1 = atomic_cmpxchg(p, v, v - 1); | ||
80 | if (likely(v1 == v)) | ||
81 | return 1; | ||
82 | } | ||
83 | return 0; | ||
84 | } | ||
85 | #endif | ||
86 | |||
37 | #ifndef CONFIG_ARCH_HAS_ATOMIC_OR | 87 | #ifndef CONFIG_ARCH_HAS_ATOMIC_OR |
38 | static inline void atomic_or(int i, atomic_t *v) | 88 | static inline void atomic_or(int i, atomic_t *v) |
39 | { | 89 | { |
@@ -47,4 +97,8 @@ static inline void atomic_or(int i, atomic_t *v) | |||
47 | } | 97 | } |
48 | #endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */ | 98 | #endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */ |
49 | 99 | ||
100 | #include <asm-generic/atomic-long.h> | ||
101 | #ifdef CONFIG_GENERIC_ATOMIC64 | ||
102 | #include <asm-generic/atomic64.h> | ||
103 | #endif | ||
50 | #endif /* _LINUX_ATOMIC_H */ | 104 | #endif /* _LINUX_ATOMIC_H */ |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 9d339eb27881..0c8006129fb2 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -613,6 +613,12 @@ extern void audit_log_d_path(struct audit_buffer *ab, | |||
613 | extern void audit_log_key(struct audit_buffer *ab, | 613 | extern void audit_log_key(struct audit_buffer *ab, |
614 | char *key); | 614 | char *key); |
615 | extern void audit_log_lost(const char *message); | 615 | extern void audit_log_lost(const char *message); |
616 | #ifdef CONFIG_SECURITY | ||
617 | extern void audit_log_secctx(struct audit_buffer *ab, u32 secid); | ||
618 | #else | ||
619 | #define audit_log_secctx(b,s) do { ; } while (0) | ||
620 | #endif | ||
621 | |||
616 | extern int audit_update_lsm_rules(void); | 622 | extern int audit_update_lsm_rules(void); |
617 | 623 | ||
618 | /* Private API (for audit.c only) */ | 624 | /* Private API (for audit.c only) */ |
@@ -635,6 +641,7 @@ extern int audit_enabled; | |||
635 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 641 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
636 | #define audit_log_d_path(b, p, d) do { ; } while (0) | 642 | #define audit_log_d_path(b, p, d) do { ; } while (0) |
637 | #define audit_log_key(b, k) do { ; } while (0) | 643 | #define audit_log_key(b, k) do { ; } while (0) |
644 | #define audit_log_secctx(b,s) do { ; } while (0) | ||
638 | #define audit_enabled 0 | 645 | #define audit_enabled 0 |
639 | #endif | 646 | #endif |
640 | #endif | 647 | #endif |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 96f4094b706d..3b2f9cb82986 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/writeback.h> | 18 | #include <linux/writeback.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | 20 | ||
21 | struct page; | 21 | struct page; |
22 | struct device; | 22 | struct device; |
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int); | |||
40 | enum bdi_stat_item { | 40 | enum bdi_stat_item { |
41 | BDI_RECLAIMABLE, | 41 | BDI_RECLAIMABLE, |
42 | BDI_WRITEBACK, | 42 | BDI_WRITEBACK, |
43 | BDI_WRITTEN, | ||
43 | NR_BDI_STAT_ITEMS | 44 | NR_BDI_STAT_ITEMS |
44 | }; | 45 | }; |
45 | 46 | ||
@@ -57,6 +58,7 @@ struct bdi_writeback { | |||
57 | struct list_head b_dirty; /* dirty inodes */ | 58 | struct list_head b_dirty; /* dirty inodes */ |
58 | struct list_head b_io; /* parked for writeback */ | 59 | struct list_head b_io; /* parked for writeback */ |
59 | struct list_head b_more_io; /* parked for more writeback */ | 60 | struct list_head b_more_io; /* parked for more writeback */ |
61 | spinlock_t list_lock; /* protects the b_* lists */ | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | struct backing_dev_info { | 64 | struct backing_dev_info { |
@@ -71,6 +73,11 @@ struct backing_dev_info { | |||
71 | 73 | ||
72 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; | 74 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; |
73 | 75 | ||
76 | unsigned long bw_time_stamp; /* last time write bw is updated */ | ||
77 | unsigned long written_stamp; /* pages written at bw_time_stamp */ | ||
78 | unsigned long write_bandwidth; /* the estimated write bandwidth */ | ||
79 | unsigned long avg_write_bandwidth; /* further smoothed write bw */ | ||
80 | |||
74 | struct prop_local_percpu completions; | 81 | struct prop_local_percpu completions; |
75 | int dirty_exceeded; | 82 | int dirty_exceeded; |
76 | 83 | ||
@@ -106,6 +113,7 @@ int bdi_writeback_thread(void *data); | |||
106 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | 113 | int bdi_has_dirty_io(struct backing_dev_info *bdi); |
107 | void bdi_arm_supers_timer(void); | 114 | void bdi_arm_supers_timer(void); |
108 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); | 115 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); |
116 | void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2); | ||
109 | 117 | ||
110 | extern spinlock_t bdi_lock; | 118 | extern spinlock_t bdi_lock; |
111 | extern struct list_head bdi_list; | 119 | extern struct list_head bdi_list; |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 08763e4e848f..8c96654bef16 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/bcma/bcma_driver_chipcommon.h> | 7 | #include <linux/bcma/bcma_driver_chipcommon.h> |
8 | #include <linux/bcma/bcma_driver_pci.h> | 8 | #include <linux/bcma/bcma_driver_pci.h> |
9 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | ||
9 | 10 | ||
10 | #include "bcma_regs.h" | 11 | #include "bcma_regs.h" |
11 | 12 | ||
@@ -24,6 +25,11 @@ struct bcma_chipinfo { | |||
24 | u8 pkg; | 25 | u8 pkg; |
25 | }; | 26 | }; |
26 | 27 | ||
28 | enum bcma_clkmode { | ||
29 | BCMA_CLKMODE_FAST, | ||
30 | BCMA_CLKMODE_DYNAMIC, | ||
31 | }; | ||
32 | |||
27 | struct bcma_host_ops { | 33 | struct bcma_host_ops { |
28 | u8 (*read8)(struct bcma_device *core, u16 offset); | 34 | u8 (*read8)(struct bcma_device *core, u16 offset); |
29 | u16 (*read16)(struct bcma_device *core, u16 offset); | 35 | u16 (*read16)(struct bcma_device *core, u16 offset); |
@@ -31,6 +37,12 @@ struct bcma_host_ops { | |||
31 | void (*write8)(struct bcma_device *core, u16 offset, u8 value); | 37 | void (*write8)(struct bcma_device *core, u16 offset, u8 value); |
32 | void (*write16)(struct bcma_device *core, u16 offset, u16 value); | 38 | void (*write16)(struct bcma_device *core, u16 offset, u16 value); |
33 | void (*write32)(struct bcma_device *core, u16 offset, u32 value); | 39 | void (*write32)(struct bcma_device *core, u16 offset, u32 value); |
40 | #ifdef CONFIG_BCMA_BLOCKIO | ||
41 | void (*block_read)(struct bcma_device *core, void *buffer, | ||
42 | size_t count, u16 offset, u8 reg_width); | ||
43 | void (*block_write)(struct bcma_device *core, const void *buffer, | ||
44 | size_t count, u16 offset, u8 reg_width); | ||
45 | #endif | ||
34 | /* Agent ops */ | 46 | /* Agent ops */ |
35 | u32 (*aread32)(struct bcma_device *core, u16 offset); | 47 | u32 (*aread32)(struct bcma_device *core, u16 offset); |
36 | void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); | 48 | void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); |
@@ -117,6 +129,8 @@ struct bcma_device { | |||
117 | struct bcma_device_id id; | 129 | struct bcma_device_id id; |
118 | 130 | ||
119 | struct device dev; | 131 | struct device dev; |
132 | struct device *dma_dev; | ||
133 | unsigned int irq; | ||
120 | bool dev_registered; | 134 | bool dev_registered; |
121 | 135 | ||
122 | u8 core_index; | 136 | u8 core_index; |
@@ -179,6 +193,10 @@ struct bcma_bus { | |||
179 | 193 | ||
180 | struct bcma_drv_cc drv_cc; | 194 | struct bcma_drv_cc drv_cc; |
181 | struct bcma_drv_pci drv_pci; | 195 | struct bcma_drv_pci drv_pci; |
196 | |||
197 | /* We decided to share SPROM struct with SSB as long as we do not need | ||
198 | * any hacks for BCMA. This simplifies drivers code. */ | ||
199 | struct ssb_sprom sprom; | ||
182 | }; | 200 | }; |
183 | 201 | ||
184 | extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) | 202 | extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) |
@@ -208,6 +226,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value) | |||
208 | { | 226 | { |
209 | core->bus->ops->write32(core, offset, value); | 227 | core->bus->ops->write32(core, offset, value); |
210 | } | 228 | } |
229 | #ifdef CONFIG_BCMA_BLOCKIO | ||
230 | extern inline void bcma_block_read(struct bcma_device *core, void *buffer, | ||
231 | size_t count, u16 offset, u8 reg_width) | ||
232 | { | ||
233 | core->bus->ops->block_read(core, buffer, count, offset, reg_width); | ||
234 | } | ||
235 | extern inline void bcma_block_write(struct bcma_device *core, const void *buffer, | ||
236 | size_t count, u16 offset, u8 reg_width) | ||
237 | { | ||
238 | core->bus->ops->block_write(core, buffer, count, offset, reg_width); | ||
239 | } | ||
240 | #endif | ||
211 | extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) | 241 | extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) |
212 | { | 242 | { |
213 | return core->bus->ops->aread32(core, offset); | 243 | return core->bus->ops->aread32(core, offset); |
@@ -218,7 +248,24 @@ void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value) | |||
218 | core->bus->ops->awrite32(core, offset, value); | 248 | core->bus->ops->awrite32(core, offset, value); |
219 | } | 249 | } |
220 | 250 | ||
251 | #define bcma_mask32(cc, offset, mask) \ | ||
252 | bcma_write32(cc, offset, bcma_read32(cc, offset) & (mask)) | ||
253 | #define bcma_set32(cc, offset, set) \ | ||
254 | bcma_write32(cc, offset, bcma_read32(cc, offset) | (set)) | ||
255 | #define bcma_maskset32(cc, offset, mask, set) \ | ||
256 | bcma_write32(cc, offset, (bcma_read32(cc, offset) & (mask)) | (set)) | ||
257 | |||
221 | extern bool bcma_core_is_enabled(struct bcma_device *core); | 258 | extern bool bcma_core_is_enabled(struct bcma_device *core); |
259 | extern void bcma_core_disable(struct bcma_device *core, u32 flags); | ||
222 | extern int bcma_core_enable(struct bcma_device *core, u32 flags); | 260 | extern int bcma_core_enable(struct bcma_device *core, u32 flags); |
261 | extern void bcma_core_set_clockmode(struct bcma_device *core, | ||
262 | enum bcma_clkmode clkmode); | ||
263 | extern void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status, | ||
264 | bool on); | ||
265 | #define BCMA_DMA_TRANSLATION_MASK 0xC0000000 | ||
266 | #define BCMA_DMA_TRANSLATION_NONE 0x00000000 | ||
267 | #define BCMA_DMA_TRANSLATION_DMA32_CMT 0x40000000 /* Client Mode Translation for 32-bit DMA */ | ||
268 | #define BCMA_DMA_TRANSLATION_DMA64_CMT 0x80000000 /* Client Mode Translation for 64-bit DMA */ | ||
269 | extern u32 bcma_core_dma_translation(struct bcma_device *core); | ||
223 | 270 | ||
224 | #endif /* LINUX_BCMA_H_ */ | 271 | #endif /* LINUX_BCMA_H_ */ |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 083c3b6cd5ce..a0f684615ae5 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -179,15 +179,7 @@ | |||
179 | #define BCMA_CC_PROG_WAITCNT 0x0124 | 179 | #define BCMA_CC_PROG_WAITCNT 0x0124 |
180 | #define BCMA_CC_FLASH_CFG 0x0128 | 180 | #define BCMA_CC_FLASH_CFG 0x0128 |
181 | #define BCMA_CC_FLASH_WAITCNT 0x012C | 181 | #define BCMA_CC_FLASH_WAITCNT 0x012C |
182 | #define BCMA_CC_CLKCTLST 0x01E0 /* Clock control and status (rev >= 20) */ | 182 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ |
183 | #define BCMA_CC_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */ | ||
184 | #define BCMA_CC_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */ | ||
185 | #define BCMA_CC_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */ | ||
186 | #define BCMA_CC_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */ | ||
187 | #define BCMA_CC_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | ||
188 | #define BCMA_CC_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | ||
189 | #define BCMA_CC_CLKCTLST_HAVEHT 0x00010000 /* HT available */ | ||
190 | #define BCMA_CC_CLKCTLST_HAVEALP 0x00020000 /* APL available */ | ||
191 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 183 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
192 | #define BCMA_CC_UART0_DATA 0x0300 | 184 | #define BCMA_CC_UART0_DATA 0x0300 |
193 | #define BCMA_CC_UART0_IMR 0x0304 | 185 | #define BCMA_CC_UART0_IMR 0x0304 |
@@ -244,6 +236,8 @@ | |||
244 | #define BCMA_CC_REGCTL_DATA 0x065C | 236 | #define BCMA_CC_REGCTL_DATA 0x065C |
245 | #define BCMA_CC_PLLCTL_ADDR 0x0660 | 237 | #define BCMA_CC_PLLCTL_ADDR 0x0660 |
246 | #define BCMA_CC_PLLCTL_DATA 0x0664 | 238 | #define BCMA_CC_PLLCTL_DATA 0x0664 |
239 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ | ||
240 | #define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */ | ||
247 | 241 | ||
248 | /* Data for the PMU, if available. | 242 | /* Data for the PMU, if available. |
249 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 243 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index b7e191cf00ec..3871b668caf9 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
@@ -85,5 +85,7 @@ struct bcma_drv_pci { | |||
85 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) | 85 | #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) |
86 | 86 | ||
87 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); | 87 | extern void bcma_core_pci_init(struct bcma_drv_pci *pc); |
88 | extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, | ||
89 | struct bcma_device *core, bool enable); | ||
88 | 90 | ||
89 | #endif /* LINUX_BCMA_DRIVER_PCI_H_ */ | 91 | #endif /* LINUX_BCMA_DRIVER_PCI_H_ */ |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index f82d88a960ce..9faae2ae02e8 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -1,13 +1,38 @@ | |||
1 | #ifndef LINUX_BCMA_REGS_H_ | 1 | #ifndef LINUX_BCMA_REGS_H_ |
2 | #define LINUX_BCMA_REGS_H_ | 2 | #define LINUX_BCMA_REGS_H_ |
3 | 3 | ||
4 | /* Some single registers are shared between many cores */ | ||
5 | /* BCMA_CLKCTLST: ChipCommon (rev >= 20), PCIe, 80211 */ | ||
6 | #define BCMA_CLKCTLST 0x01E0 /* Clock control and status */ | ||
7 | #define BCMA_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */ | ||
8 | #define BCMA_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */ | ||
9 | #define BCMA_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */ | ||
10 | #define BCMA_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */ | ||
11 | #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ | ||
12 | #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ | ||
13 | #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ | ||
14 | #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ | ||
15 | #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_HT 0x00080000 /* RO: running on HT clock */ | ||
18 | #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ | ||
19 | /* Is there any BCM4328 on BCMA bus? */ | ||
20 | #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ | ||
21 | #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ | ||
22 | |||
4 | /* Agent registers (common for every core) */ | 23 | /* Agent registers (common for every core) */ |
5 | #define BCMA_IOCTL 0x0408 | 24 | #define BCMA_IOCTL 0x0408 /* IO control */ |
6 | #define BCMA_IOCTL_CLK 0x0001 | 25 | #define BCMA_IOCTL_CLK 0x0001 |
7 | #define BCMA_IOCTL_FGC 0x0002 | 26 | #define BCMA_IOCTL_FGC 0x0002 |
8 | #define BCMA_IOCTL_CORE_BITS 0x3FFC | 27 | #define BCMA_IOCTL_CORE_BITS 0x3FFC |
9 | #define BCMA_IOCTL_PME_EN 0x4000 | 28 | #define BCMA_IOCTL_PME_EN 0x4000 |
10 | #define BCMA_IOCTL_BIST_EN 0x8000 | 29 | #define BCMA_IOCTL_BIST_EN 0x8000 |
30 | #define BCMA_IOST 0x0500 /* IO status */ | ||
31 | #define BCMA_IOST_CORE_BITS 0x0FFF | ||
32 | #define BCMA_IOST_DMA64 0x1000 | ||
33 | #define BCMA_IOST_GATED_CLK 0x2000 | ||
34 | #define BCMA_IOST_BIST_ERROR 0x4000 | ||
35 | #define BCMA_IOST_BIST_DONE 0x8000 | ||
11 | #define BCMA_RESET_CTL 0x0800 | 36 | #define BCMA_RESET_CTL 0x0800 |
12 | #define BCMA_RESET_CTL_RESET 0x0001 | 37 | #define BCMA_RESET_CTL_RESET 0x0001 |
13 | 38 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 8845613fd7e3..fd88a3945aa1 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -111,6 +111,7 @@ extern int __must_check remove_arg_zero(struct linux_binprm *); | |||
111 | extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); | 111 | extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); |
112 | extern int flush_old_exec(struct linux_binprm * bprm); | 112 | extern int flush_old_exec(struct linux_binprm * bprm); |
113 | extern void setup_new_exec(struct linux_binprm * bprm); | 113 | extern void setup_new_exec(struct linux_binprm * bprm); |
114 | extern void would_dump(struct linux_binprm *, struct file *); | ||
114 | 115 | ||
115 | extern int suid_dumpable; | 116 | extern int suid_dumpable; |
116 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 117 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h index b4326bfa684f..ac4d9f8b52e9 100644 --- a/include/linux/bit_spinlock.h +++ b/include/linux/bit_spinlock.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/preempt.h> | 5 | #include <linux/preempt.h> |
6 | #include <asm/atomic.h> | 6 | #include <linux/atomic.h> |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * bit-based spin_lock() | 9 | * bit-based spin_lock() |
@@ -88,7 +88,7 @@ static inline int bit_spin_is_locked(int bitnum, unsigned long *addr) | |||
88 | { | 88 | { |
89 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 89 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
90 | return test_bit(bitnum, addr); | 90 | return test_bit(bitnum, addr); |
91 | #elif defined CONFIG_PREEMPT | 91 | #elif defined CONFIG_PREEMPT_COUNT |
92 | return preempt_count(); | 92 | return preempt_count(); |
93 | #else | 93 | #else |
94 | return 1; | 94 | return 1; |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index dcafe0bf0005..7ad634501e48 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -144,7 +144,9 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); | |||
144 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); | 144 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); |
145 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); | 145 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); |
146 | extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); | 146 | extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); |
147 | extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits); | ||
147 | 148 | ||
149 | #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) | ||
148 | #define BITMAP_LAST_WORD_MASK(nbits) \ | 150 | #define BITMAP_LAST_WORD_MASK(nbits) \ |
149 | ( \ | 151 | ( \ |
150 | ((nbits) % BITS_PER_LONG) ? \ | 152 | ((nbits) % BITS_PER_LONG) ? \ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1a23722e8878..0e67c45b3bc9 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -73,7 +73,7 @@ enum rq_cmd_type_bits { | |||
73 | 73 | ||
74 | /* | 74 | /* |
75 | * try to put the fields that are referenced together in the same cacheline. | 75 | * try to put the fields that are referenced together in the same cacheline. |
76 | * if you modify this structure, be sure to check block/blk-core.c:rq_init() | 76 | * if you modify this structure, be sure to check block/blk-core.c:blk_rq_init() |
77 | * as well! | 77 | * as well! |
78 | */ | 78 | */ |
79 | struct request { | 79 | struct request { |
@@ -260,8 +260,7 @@ struct queue_limits { | |||
260 | unsigned char discard_zeroes_data; | 260 | unsigned char discard_zeroes_data; |
261 | }; | 261 | }; |
262 | 262 | ||
263 | struct request_queue | 263 | struct request_queue { |
264 | { | ||
265 | /* | 264 | /* |
266 | * Together with queue_head for cacheline sharing | 265 | * Together with queue_head for cacheline sharing |
267 | */ | 266 | */ |
@@ -304,14 +303,14 @@ struct request_queue | |||
304 | void *queuedata; | 303 | void *queuedata; |
305 | 304 | ||
306 | /* | 305 | /* |
307 | * queue needs bounce pages for pages above this limit | 306 | * various queue flags, see QUEUE_* below |
308 | */ | 307 | */ |
309 | gfp_t bounce_gfp; | 308 | unsigned long queue_flags; |
310 | 309 | ||
311 | /* | 310 | /* |
312 | * various queue flags, see QUEUE_* below | 311 | * queue needs bounce pages for pages above this limit |
313 | */ | 312 | */ |
314 | unsigned long queue_flags; | 313 | gfp_t bounce_gfp; |
315 | 314 | ||
316 | /* | 315 | /* |
317 | * protects queue structures from reentrancy. ->__queue_lock should | 316 | * protects queue structures from reentrancy. ->__queue_lock should |
@@ -334,8 +333,8 @@ struct request_queue | |||
334 | unsigned int nr_congestion_off; | 333 | unsigned int nr_congestion_off; |
335 | unsigned int nr_batching; | 334 | unsigned int nr_batching; |
336 | 335 | ||
337 | void *dma_drain_buffer; | ||
338 | unsigned int dma_drain_size; | 336 | unsigned int dma_drain_size; |
337 | void *dma_drain_buffer; | ||
339 | unsigned int dma_pad_mask; | 338 | unsigned int dma_pad_mask; |
340 | unsigned int dma_alignment; | 339 | unsigned int dma_alignment; |
341 | 340 | ||
@@ -393,7 +392,7 @@ struct request_queue | |||
393 | #define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */ | 392 | #define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */ |
394 | #define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */ | 393 | #define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */ |
395 | #define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */ | 394 | #define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */ |
396 | #define QUEUE_FLAG_SAME_COMP 9 /* force complete on same CPU */ | 395 | #define QUEUE_FLAG_SAME_COMP 9 /* complete on same CPU-group */ |
397 | #define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */ | 396 | #define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */ |
398 | #define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */ | 397 | #define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */ |
399 | #define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */ | 398 | #define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */ |
@@ -403,6 +402,7 @@ struct request_queue | |||
403 | #define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ | 402 | #define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ |
404 | #define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ | 403 | #define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ |
405 | #define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ | 404 | #define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ |
405 | #define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */ | ||
406 | 406 | ||
407 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 407 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
408 | (1 << QUEUE_FLAG_STACKABLE) | \ | 408 | (1 << QUEUE_FLAG_STACKABLE) | \ |
@@ -857,12 +857,21 @@ struct request_queue *blk_alloc_queue(gfp_t); | |||
857 | struct request_queue *blk_alloc_queue_node(gfp_t, int); | 857 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
858 | extern void blk_put_queue(struct request_queue *); | 858 | extern void blk_put_queue(struct request_queue *); |
859 | 859 | ||
860 | /* | ||
861 | * Note: Code in between changing the blk_plug list/cb_list or element of such | ||
862 | * lists is preemptable, but such code can't do sleep (or be very careful), | ||
863 | * otherwise data is corrupted. For details, please check schedule() where | ||
864 | * blk_schedule_flush_plug() is called. | ||
865 | */ | ||
860 | struct blk_plug { | 866 | struct blk_plug { |
861 | unsigned long magic; | 867 | unsigned long magic; |
862 | struct list_head list; | 868 | struct list_head list; |
863 | struct list_head cb_list; | 869 | struct list_head cb_list; |
864 | unsigned int should_sort; | 870 | unsigned int should_sort; |
871 | unsigned int count; | ||
865 | }; | 872 | }; |
873 | #define BLK_MAX_REQUEST_COUNT 16 | ||
874 | |||
866 | struct blk_plug_cb { | 875 | struct blk_plug_cb { |
867 | struct list_head list; | 876 | struct list_head list; |
868 | void (*callback)(struct blk_plug_cb *); | 877 | void (*callback)(struct blk_plug_cb *); |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 503c8a6b3079..458f497738a4 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <linux/pagemap.h> | 13 | #include <linux/pagemap.h> |
14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
15 | #include <asm/atomic.h> | 15 | #include <linux/atomic.h> |
16 | 16 | ||
17 | #ifdef CONFIG_BLOCK | 17 | #ifdef CONFIG_BLOCK |
18 | 18 | ||
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 6365f041745b..563755181c1e 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define CEPH_OPT_MYIP (1<<2) /* specified my ip */ | 35 | #define CEPH_OPT_MYIP (1<<2) /* specified my ip */ |
36 | #define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ | 36 | #define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ |
37 | 37 | ||
38 | #define CEPH_OPT_DEFAULT (0); | 38 | #define CEPH_OPT_DEFAULT (0) |
39 | 39 | ||
40 | #define ceph_set_opt(client, opt) \ | 40 | #define ceph_set_opt(client, opt) \ |
41 | (client)->options->flags |= CEPH_OPT_##opt; | 41 | (client)->options->flags |= CEPH_OPT_##opt; |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 31d91a64838b..d7adf151d335 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -94,6 +94,7 @@ struct ceph_msg { | |||
94 | bool more_to_follow; | 94 | bool more_to_follow; |
95 | bool needs_out_seq; | 95 | bool needs_out_seq; |
96 | int front_max; | 96 | int front_max; |
97 | unsigned long ack_stamp; /* tx: when we were acked */ | ||
97 | 98 | ||
98 | struct ceph_msgpool *pool; | 99 | struct ceph_msgpool *pool; |
99 | }; | 100 | }; |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ab4ac0ccb857..da7e4bc34e8c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -539,7 +539,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
539 | */ | 539 | */ |
540 | #define task_subsys_state_check(task, subsys_id, __c) \ | 540 | #define task_subsys_state_check(task, subsys_id, __c) \ |
541 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ | 541 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ |
542 | rcu_read_lock_held() || \ | ||
543 | lockdep_is_held(&task->alloc_lock) || \ | 542 | lockdep_is_held(&task->alloc_lock) || \ |
544 | cgroup_lock_is_held() || (__c)) | 543 | cgroup_lock_is_held() || (__c)) |
545 | 544 | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 18a1baf31f2d..139c4db55f17 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -22,6 +22,10 @@ | |||
22 | typedef u64 cycle_t; | 22 | typedef u64 cycle_t; |
23 | struct clocksource; | 23 | struct clocksource; |
24 | 24 | ||
25 | #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA | ||
26 | #include <asm/clocksource.h> | ||
27 | #endif | ||
28 | |||
25 | /** | 29 | /** |
26 | * struct cyclecounter - hardware abstraction for a free running counter | 30 | * struct cyclecounter - hardware abstraction for a free running counter |
27 | * Provides completely state-free accessors to the underlying hardware. | 31 | * Provides completely state-free accessors to the underlying hardware. |
@@ -153,7 +157,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
153 | * @shift: cycle to nanosecond divisor (power of two) | 157 | * @shift: cycle to nanosecond divisor (power of two) |
154 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) | 158 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) |
155 | * @flags: flags describing special properties | 159 | * @flags: flags describing special properties |
156 | * @vread: vsyscall based read | 160 | * @archdata: arch-specific data |
157 | * @suspend: suspend function for the clocksource, if necessary | 161 | * @suspend: suspend function for the clocksource, if necessary |
158 | * @resume: resume function for the clocksource, if necessary | 162 | * @resume: resume function for the clocksource, if necessary |
159 | */ | 163 | */ |
@@ -169,16 +173,13 @@ struct clocksource { | |||
169 | u32 shift; | 173 | u32 shift; |
170 | u64 max_idle_ns; | 174 | u64 max_idle_ns; |
171 | 175 | ||
172 | #ifdef CONFIG_IA64 | 176 | #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA |
173 | void *fsys_mmio; /* used by fsyscall asm code */ | 177 | struct arch_clocksource_data archdata; |
174 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) | ||
175 | #else | ||
176 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0) | ||
177 | #endif | 178 | #endif |
179 | |||
178 | const char *name; | 180 | const char *name; |
179 | struct list_head list; | 181 | struct list_head list; |
180 | int rating; | 182 | int rating; |
181 | cycle_t (*vread)(void); | ||
182 | int (*enable)(struct clocksource *cs); | 183 | int (*enable)(struct clocksource *cs); |
183 | void (*disable)(struct clocksource *cs); | 184 | void (*disable)(struct clocksource *cs); |
184 | unsigned long flags; | 185 | unsigned long flags; |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index 47dac5ea8d3a..12c517b51ca2 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
@@ -53,6 +53,7 @@ struct proc_event { | |||
53 | PROC_EVENT_UID = 0x00000004, | 53 | PROC_EVENT_UID = 0x00000004, |
54 | PROC_EVENT_GID = 0x00000040, | 54 | PROC_EVENT_GID = 0x00000040, |
55 | PROC_EVENT_SID = 0x00000080, | 55 | PROC_EVENT_SID = 0x00000080, |
56 | PROC_EVENT_PTRACE = 0x00000100, | ||
56 | /* "next" should be 0x00000400 */ | 57 | /* "next" should be 0x00000400 */ |
57 | /* "last" is the last process event: exit */ | 58 | /* "last" is the last process event: exit */ |
58 | PROC_EVENT_EXIT = 0x80000000 | 59 | PROC_EVENT_EXIT = 0x80000000 |
@@ -95,6 +96,13 @@ struct proc_event { | |||
95 | __kernel_pid_t process_tgid; | 96 | __kernel_pid_t process_tgid; |
96 | } sid; | 97 | } sid; |
97 | 98 | ||
99 | struct ptrace_proc_event { | ||
100 | __kernel_pid_t process_pid; | ||
101 | __kernel_pid_t process_tgid; | ||
102 | __kernel_pid_t tracer_pid; | ||
103 | __kernel_pid_t tracer_tgid; | ||
104 | } ptrace; | ||
105 | |||
98 | struct exit_proc_event { | 106 | struct exit_proc_event { |
99 | __kernel_pid_t process_pid; | 107 | __kernel_pid_t process_pid; |
100 | __kernel_pid_t process_tgid; | 108 | __kernel_pid_t process_tgid; |
@@ -109,6 +117,7 @@ void proc_fork_connector(struct task_struct *task); | |||
109 | void proc_exec_connector(struct task_struct *task); | 117 | void proc_exec_connector(struct task_struct *task); |
110 | void proc_id_connector(struct task_struct *task, int which_id); | 118 | void proc_id_connector(struct task_struct *task, int which_id); |
111 | void proc_sid_connector(struct task_struct *task); | 119 | void proc_sid_connector(struct task_struct *task); |
120 | void proc_ptrace_connector(struct task_struct *task, int which_id); | ||
112 | void proc_exit_connector(struct task_struct *task); | 121 | void proc_exit_connector(struct task_struct *task); |
113 | #else | 122 | #else |
114 | static inline void proc_fork_connector(struct task_struct *task) | 123 | static inline void proc_fork_connector(struct task_struct *task) |
@@ -124,6 +133,10 @@ static inline void proc_id_connector(struct task_struct *task, | |||
124 | static inline void proc_sid_connector(struct task_struct *task) | 133 | static inline void proc_sid_connector(struct task_struct *task) |
125 | {} | 134 | {} |
126 | 135 | ||
136 | static inline void proc_ptrace_connector(struct task_struct *task, | ||
137 | int ptrace_id) | ||
138 | {} | ||
139 | |||
127 | static inline void proc_exit_connector(struct task_struct *task) | 140 | static inline void proc_exit_connector(struct task_struct *task) |
128 | {} | 141 | {} |
129 | #endif /* CONFIG_PROC_EVENTS */ | 142 | #endif /* CONFIG_PROC_EVENTS */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 846bb1792572..8779405e15a8 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -438,16 +438,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | |||
438 | struct compat_timespec __user *tsp, | 438 | struct compat_timespec __user *tsp, |
439 | const compat_sigset_t __user *sigmask, | 439 | const compat_sigset_t __user *sigmask, |
440 | compat_size_t sigsetsize); | 440 | compat_size_t sigsetsize); |
441 | #if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \ | ||
442 | !defined(CONFIG_NFSD_DEPRECATED) | ||
443 | union compat_nfsctl_res; | ||
444 | struct compat_nfsctl_arg; | ||
445 | asmlinkage long compat_sys_nfsservctl(int cmd, | ||
446 | struct compat_nfsctl_arg __user *arg, | ||
447 | union compat_nfsctl_res __user *res); | ||
448 | #else | ||
449 | asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); | 441 | asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); |
450 | #endif | ||
451 | asmlinkage long compat_sys_signalfd4(int ufd, | 442 | asmlinkage long compat_sys_signalfd4(int ufd, |
452 | const compat_sigset_t __user *sigmask, | 443 | const compat_sigset_t __user *sigmask, |
453 | compat_size_t sigsetsize, int flags); | 444 | compat_size_t sigsetsize, int flags); |
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 645778ad899b..3081c58d696e 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <linux/mutex.h> | 42 | #include <linux/mutex.h> |
43 | #include <linux/err.h> | 43 | #include <linux/err.h> |
44 | 44 | ||
45 | #include <asm/atomic.h> | 45 | #include <linux/atomic.h> |
46 | 46 | ||
47 | #define CONFIGFS_ITEM_NAME_LEN 20 | 47 | #define CONFIGFS_ITEM_NAME_LEN 20 |
48 | 48 | ||
diff --git a/include/linux/connector.h b/include/linux/connector.h index f696bccd48cb..0c69ad825b39 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -75,7 +75,7 @@ struct cn_msg { | |||
75 | 75 | ||
76 | #ifdef __KERNEL__ | 76 | #ifdef __KERNEL__ |
77 | 77 | ||
78 | #include <asm/atomic.h> | 78 | #include <linux/atomic.h> |
79 | 79 | ||
80 | #include <linux/list.h> | 80 | #include <linux/list.h> |
81 | #include <linux/workqueue.h> | 81 | #include <linux/workqueue.h> |
diff --git a/include/linux/cordic.h b/include/linux/cordic.h new file mode 100644 index 000000000000..f932093e20c2 --- /dev/null +++ b/include/linux/cordic.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Broadcom Corporation | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | #ifndef __CORDIC_H_ | ||
17 | #define __CORDIC_H_ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | |||
21 | /** | ||
22 | * struct cordic_iq - i/q coordinate. | ||
23 | * | ||
24 | * @i: real part of coordinate (in phase). | ||
25 | * @q: imaginary part of coordinate (quadrature). | ||
26 | */ | ||
27 | struct cordic_iq { | ||
28 | s32 i; | ||
29 | s32 q; | ||
30 | }; | ||
31 | |||
32 | /** | ||
33 | * cordic_calc_iq() - calculates the i/q coordinate for given angle. | ||
34 | * | ||
35 | * @theta: angle in degrees for which i/q coordinate is to be calculated. | ||
36 | * @coord: function output parameter holding the i/q coordinate. | ||
37 | * | ||
38 | * The function calculates the i/q coordinate for a given angle using | ||
39 | * cordic algorithm. The coordinate consists of a real (i) and an | ||
40 | * imaginary (q) part. The real part is essentially the cosine of the | ||
41 | * angle and the imaginary part is the sine of the angle. The returned | ||
42 | * values are scaled by 2^16 for precision. The range for theta is | ||
43 | * for -180 degrees to +180 degrees. Passed values outside this range are | ||
44 | * converted before doing the actual calculation. | ||
45 | */ | ||
46 | struct cordic_iq cordic_calc_iq(s32 theta); | ||
47 | |||
48 | #endif /* __CORDIC_H_ */ | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 5f09323ee880..b1a635acf72a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -70,6 +70,39 @@ enum { | |||
70 | CPU_PRI_WORKQUEUE = 5, | 70 | CPU_PRI_WORKQUEUE = 5, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | ||
74 | #define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ | ||
75 | #define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ | ||
76 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ | ||
77 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | ||
78 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | ||
79 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | ||
80 | * not handling interrupts, soon dead. | ||
81 | * Called on the dying cpu, interrupts | ||
82 | * are already disabled. Must not | ||
83 | * sleep, must not fail */ | ||
84 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
85 | * lock is dropped */ | ||
86 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
87 | * Called on the new cpu, just before | ||
88 | * enabling interrupts. Must not sleep, | ||
89 | * must not fail */ | ||
90 | |||
91 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | ||
92 | * operation in progress | ||
93 | */ | ||
94 | #define CPU_TASKS_FROZEN 0x0010 | ||
95 | |||
96 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | ||
97 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | ||
98 | #define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN) | ||
99 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | ||
100 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | ||
101 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | ||
102 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | ||
103 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
104 | |||
105 | |||
73 | #ifdef CONFIG_SMP | 106 | #ifdef CONFIG_SMP |
74 | /* Need to know about CPUs going up/down? */ | 107 | /* Need to know about CPUs going up/down? */ |
75 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | 108 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 11be48e0d168..6216115c7789 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu) | |||
324 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | 324 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ |
325 | #ifdef CONFIG_CPU_FREQ | 325 | #ifdef CONFIG_CPU_FREQ |
326 | unsigned int cpufreq_quick_get(unsigned int cpu); | 326 | unsigned int cpufreq_quick_get(unsigned int cpu); |
327 | unsigned int cpufreq_quick_get_max(unsigned int cpu); | ||
327 | #else | 328 | #else |
328 | static inline unsigned int cpufreq_quick_get(unsigned int cpu) | 329 | static inline unsigned int cpufreq_quick_get(unsigned int cpu) |
329 | { | 330 | { |
330 | return 0; | 331 | return 0; |
331 | } | 332 | } |
333 | static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) | ||
334 | { | ||
335 | return 0; | ||
336 | } | ||
332 | #endif | 337 | #endif |
333 | 338 | ||
334 | 339 | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 36719ead50e8..b51629e15cfc 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -122,6 +122,8 @@ struct cpuidle_driver { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | #ifdef CONFIG_CPU_IDLE | 124 | #ifdef CONFIG_CPU_IDLE |
125 | extern void disable_cpuidle(void); | ||
126 | extern int cpuidle_idle_call(void); | ||
125 | 127 | ||
126 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | 128 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
127 | struct cpuidle_driver *cpuidle_get_driver(void); | 129 | struct cpuidle_driver *cpuidle_get_driver(void); |
@@ -135,6 +137,8 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev); | |||
135 | extern void cpuidle_disable_device(struct cpuidle_device *dev); | 137 | extern void cpuidle_disable_device(struct cpuidle_device *dev); |
136 | 138 | ||
137 | #else | 139 | #else |
140 | static inline void disable_cpuidle(void) { } | ||
141 | static inline int cpuidle_idle_call(void) { return -ENODEV; } | ||
138 | 142 | ||
139 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) | 143 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) |
140 | {return -ENODEV; } | 144 | {return -ENODEV; } |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index b24ac56477b4..4f7a63237471 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -617,6 +617,20 @@ static inline size_t cpumask_size(void) | |||
617 | * ... use 'tmpmask' like a normal struct cpumask * ... | 617 | * ... use 'tmpmask' like a normal struct cpumask * ... |
618 | * | 618 | * |
619 | * free_cpumask_var(tmpmask); | 619 | * free_cpumask_var(tmpmask); |
620 | * | ||
621 | * | ||
622 | * However, one notable exception is there. alloc_cpumask_var() allocates | ||
623 | * only nr_cpumask_bits bits (in the other hand, real cpumask_t always has | ||
624 | * NR_CPUS bits). Therefore you don't have to dereference cpumask_var_t. | ||
625 | * | ||
626 | * cpumask_var_t tmpmask; | ||
627 | * if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL)) | ||
628 | * return -ENOMEM; | ||
629 | * | ||
630 | * var = *tmpmask; | ||
631 | * | ||
632 | * This code makes NR_CPUS length memcopy and brings to a memory corruption. | ||
633 | * cpumask_copy() provide safe copy functionality. | ||
620 | */ | 634 | */ |
621 | #ifdef CONFIG_CPUMASK_OFFSTACK | 635 | #ifdef CONFIG_CPUMASK_OFFSTACK |
622 | typedef struct cpumask *cpumask_var_t; | 636 | typedef struct cpumask *cpumask_var_t; |
diff --git a/include/linux/crc8.h b/include/linux/crc8.h new file mode 100644 index 000000000000..13c8dabb0441 --- /dev/null +++ b/include/linux/crc8.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Broadcom Corporation | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | #ifndef __CRC8_H_ | ||
17 | #define __CRC8_H_ | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | |||
21 | /* see usage of this value in crc8() description */ | ||
22 | #define CRC8_INIT_VALUE 0xFF | ||
23 | |||
24 | /* | ||
25 | * Return value of crc8() indicating valid message+crc. This is true | ||
26 | * if a CRC is inverted before transmission. The CRC computed over the | ||
27 | * whole received bitstream is _table[x], where x is the bit pattern | ||
28 | * of the modification (almost always 0xff). | ||
29 | */ | ||
30 | #define CRC8_GOOD_VALUE(_table) (_table[0xFF]) | ||
31 | |||
32 | /* required table size for crc8 algorithm */ | ||
33 | #define CRC8_TABLE_SIZE 256 | ||
34 | |||
35 | /* helper macro assuring right table size is used */ | ||
36 | #define DECLARE_CRC8_TABLE(_table) \ | ||
37 | static u8 _table[CRC8_TABLE_SIZE] | ||
38 | |||
39 | /** | ||
40 | * crc8_populate_lsb - fill crc table for given polynomial in regular bit order. | ||
41 | * | ||
42 | * @table: table to be filled. | ||
43 | * @polynomial: polynomial for which table is to be filled. | ||
44 | * | ||
45 | * This function fills the provided table according the polynomial provided for | ||
46 | * regular bit order (lsb first). Polynomials in CRC algorithms are typically | ||
47 | * represented as shown below. | ||
48 | * | ||
49 | * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1 | ||
50 | * | ||
51 | * For lsb first direction x^7 maps to the lsb. So the polynomial is as below. | ||
52 | * | ||
53 | * - lsb first: poly = 10101011(1) = 0xAB | ||
54 | */ | ||
55 | void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial); | ||
56 | |||
57 | /** | ||
58 | * crc8_populate_msb - fill crc table for given polynomial in reverse bit order. | ||
59 | * | ||
60 | * @table: table to be filled. | ||
61 | * @polynomial: polynomial for which table is to be filled. | ||
62 | * | ||
63 | * This function fills the provided table according the polynomial provided for | ||
64 | * reverse bit order (msb first). Polynomials in CRC algorithms are typically | ||
65 | * represented as shown below. | ||
66 | * | ||
67 | * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1 | ||
68 | * | ||
69 | * For msb first direction x^7 maps to the msb. So the polynomial is as below. | ||
70 | * | ||
71 | * - msb first: poly = (1)11010101 = 0xD5 | ||
72 | */ | ||
73 | void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial); | ||
74 | |||
75 | /** | ||
76 | * crc8() - calculate a crc8 over the given input data. | ||
77 | * | ||
78 | * @table: crc table used for calculation. | ||
79 | * @pdata: pointer to data buffer. | ||
80 | * @nbytes: number of bytes in data buffer. | ||
81 | * @crc: previous returned crc8 value. | ||
82 | * | ||
83 | * The CRC8 is calculated using the polynomial given in crc8_populate_msb() | ||
84 | * or crc8_populate_lsb(). | ||
85 | * | ||
86 | * The caller provides the initial value (either %CRC8_INIT_VALUE | ||
87 | * or the previous returned value) to allow for processing of | ||
88 | * discontiguous blocks of data. When generating the CRC the | ||
89 | * caller is responsible for complementing the final return value | ||
90 | * and inserting it into the byte stream. When validating a byte | ||
91 | * stream (including CRC8), a final return value of %CRC8_GOOD_VALUE | ||
92 | * indicates the byte stream data can be considered valid. | ||
93 | * | ||
94 | * Reference: | ||
95 | * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993 | ||
96 | * Williams, Ross N., ross<at>ross.net | ||
97 | * (see URL http://www.ross.net/crc/download/crc_v3.txt). | ||
98 | */ | ||
99 | u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc); | ||
100 | |||
101 | #endif /* __CRC8_H_ */ | ||
diff --git a/include/linux/cred.h b/include/linux/cred.h index 82607992f308..40308969ed00 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/key.h> | 17 | #include <linux/key.h> |
18 | #include <linux/selinux.h> | 18 | #include <linux/selinux.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | 20 | ||
21 | struct user_struct; | 21 | struct user_struct; |
22 | struct cred; | 22 | struct cred; |
@@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred) | |||
265 | /** | 265 | /** |
266 | * current_cred - Access the current task's subjective credentials | 266 | * current_cred - Access the current task's subjective credentials |
267 | * | 267 | * |
268 | * Access the subjective credentials of the current task. | 268 | * Access the subjective credentials of the current task. RCU-safe, |
269 | * since nobody else can modify it. | ||
269 | */ | 270 | */ |
270 | #define current_cred() \ | 271 | #define current_cred() \ |
271 | (current->cred) | 272 | rcu_dereference_protected(current->cred, 1) |
272 | 273 | ||
273 | /** | 274 | /** |
274 | * __task_cred - Access a task's objective credentials | 275 | * __task_cred - Access a task's objective credentials |
@@ -284,7 +285,6 @@ static inline void put_cred(const struct cred *_cred) | |||
284 | ({ \ | 285 | ({ \ |
285 | const struct task_struct *__t = (task); \ | 286 | const struct task_struct *__t = (task); \ |
286 | rcu_dereference_check(__t->real_cred, \ | 287 | rcu_dereference_check(__t->real_cred, \ |
287 | rcu_read_lock_held() || \ | ||
288 | task_is_dead(__t)); \ | 288 | task_is_dead(__t)); \ |
289 | }) | 289 | }) |
290 | 290 | ||
@@ -307,8 +307,8 @@ static inline void put_cred(const struct cred *_cred) | |||
307 | #define get_current_user() \ | 307 | #define get_current_user() \ |
308 | ({ \ | 308 | ({ \ |
309 | struct user_struct *__u; \ | 309 | struct user_struct *__u; \ |
310 | struct cred *__cred; \ | 310 | const struct cred *__cred; \ |
311 | __cred = (struct cred *) current_cred(); \ | 311 | __cred = current_cred(); \ |
312 | __u = get_uid(__cred->user); \ | 312 | __u = get_uid(__cred->user); \ |
313 | __u; \ | 313 | __u; \ |
314 | }) | 314 | }) |
@@ -322,8 +322,8 @@ static inline void put_cred(const struct cred *_cred) | |||
322 | #define get_current_groups() \ | 322 | #define get_current_groups() \ |
323 | ({ \ | 323 | ({ \ |
324 | struct group_info *__groups; \ | 324 | struct group_info *__groups; \ |
325 | struct cred *__cred; \ | 325 | const struct cred *__cred; \ |
326 | __cred = (struct cred *) current_cred(); \ | 326 | __cred = current_cred(); \ |
327 | __groups = get_group_info(__cred->group_info); \ | 327 | __groups = get_group_info(__cred->group_info); \ |
328 | __groups; \ | 328 | __groups; \ |
329 | }) | 329 | }) |
@@ -342,7 +342,7 @@ static inline void put_cred(const struct cred *_cred) | |||
342 | 342 | ||
343 | #define current_cred_xxx(xxx) \ | 343 | #define current_cred_xxx(xxx) \ |
344 | ({ \ | 344 | ({ \ |
345 | current->cred->xxx; \ | 345 | current_cred()->xxx; \ |
346 | }) | 346 | }) |
347 | 347 | ||
348 | #define current_uid() (current_cred_xxx(uid)) | 348 | #define current_uid() (current_cred_xxx(uid)) |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index a6a7a1c83f54..e5e468e9133d 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #ifndef _LINUX_CRYPTO_H | 17 | #ifndef _LINUX_CRYPTO_H |
18 | #define _LINUX_CRYPTO_H | 18 | #define _LINUX_CRYPTO_H |
19 | 19 | ||
20 | #include <asm/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h index ec78a4bbe1d5..2cd9f1cf9fa3 100644 --- a/include/linux/cryptohash.h +++ b/include/linux/cryptohash.h | |||
@@ -3,11 +3,16 @@ | |||
3 | 3 | ||
4 | #define SHA_DIGEST_WORDS 5 | 4 | #define SHA_DIGEST_WORDS 5 |
5 | #define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) | 5 | #define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) |
6 | #define SHA_WORKSPACE_WORDS 80 | 6 | #define SHA_WORKSPACE_WORDS 16 |
7 | 7 | ||
8 | void sha_init(__u32 *buf); | 8 | void sha_init(__u32 *buf); |
9 | void sha_transform(__u32 *digest, const char *data, __u32 *W); | 9 | void sha_transform(__u32 *digest, const char *data, __u32 *W); |
10 | 10 | ||
11 | #define MD5_DIGEST_WORDS 4 | ||
12 | #define MD5_MESSAGE_BYTES 64 | ||
13 | |||
14 | void md5_transform(__u32 *hash, __u32 const *in); | ||
15 | |||
11 | __u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); | 16 | __u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); |
12 | 17 | ||
13 | #endif | 18 | #endif |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h index 6fe2114f8ad2..c077aec3a6ff 100644 --- a/include/linux/cs5535.h +++ b/include/linux/cs5535.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef _CS5535_H | 11 | #ifndef _CS5535_H |
12 | #define _CS5535_H | 12 | #define _CS5535_H |
13 | 13 | ||
14 | #include <asm/msr.h> | ||
15 | |||
14 | /* MSRs */ | 16 | /* MSRs */ |
15 | #define MSR_GLIU_P2D_RO0 0x10000029 | 17 | #define MSR_GLIU_P2D_RO0 0x10000029 |
16 | 18 | ||
@@ -38,17 +40,75 @@ | |||
38 | #define MSR_MFGPT_NR 0x51400029 | 40 | #define MSR_MFGPT_NR 0x51400029 |
39 | #define MSR_MFGPT_SETUP 0x5140002B | 41 | #define MSR_MFGPT_SETUP 0x5140002B |
40 | 42 | ||
43 | #define MSR_RTC_DOMA_OFFSET 0x51400055 | ||
44 | #define MSR_RTC_MONA_OFFSET 0x51400056 | ||
45 | #define MSR_RTC_CEN_OFFSET 0x51400057 | ||
46 | |||
41 | #define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */ | 47 | #define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */ |
42 | 48 | ||
43 | #define MSR_GX_GLD_MSR_CONFIG 0xC0002001 | 49 | #define MSR_GX_GLD_MSR_CONFIG 0xC0002001 |
44 | #define MSR_GX_MSR_PADSEL 0xC0002011 | 50 | #define MSR_GX_MSR_PADSEL 0xC0002011 |
45 | 51 | ||
52 | static inline int cs5535_pic_unreqz_select_high(unsigned int group, | ||
53 | unsigned int irq) | ||
54 | { | ||
55 | uint32_t lo, hi; | ||
56 | |||
57 | rdmsr(MSR_PIC_ZSEL_HIGH, lo, hi); | ||
58 | lo &= ~(0xF << (group * 4)); | ||
59 | lo |= (irq & 0xF) << (group * 4); | ||
60 | wrmsr(MSR_PIC_ZSEL_HIGH, lo, hi); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | /* PIC registers */ | ||
65 | #define CS5536_PIC_INT_SEL1 0x4d0 | ||
66 | #define CS5536_PIC_INT_SEL2 0x4d1 | ||
67 | |||
46 | /* resource sizes */ | 68 | /* resource sizes */ |
47 | #define LBAR_GPIO_SIZE 0xFF | 69 | #define LBAR_GPIO_SIZE 0xFF |
48 | #define LBAR_MFGPT_SIZE 0x40 | 70 | #define LBAR_MFGPT_SIZE 0x40 |
49 | #define LBAR_ACPI_SIZE 0x40 | 71 | #define LBAR_ACPI_SIZE 0x40 |
50 | #define LBAR_PMS_SIZE 0x80 | 72 | #define LBAR_PMS_SIZE 0x80 |
51 | 73 | ||
74 | /* | ||
75 | * PMC registers (PMS block) | ||
76 | * It is only safe to access these registers as dword accesses. | ||
77 | * See CS5536 Specification Update erratas 17 & 18 | ||
78 | */ | ||
79 | #define CS5536_PM_SCLK 0x10 | ||
80 | #define CS5536_PM_IN_SLPCTL 0x20 | ||
81 | #define CS5536_PM_WKXD 0x34 | ||
82 | #define CS5536_PM_WKD 0x30 | ||
83 | #define CS5536_PM_SSC 0x54 | ||
84 | |||
85 | /* | ||
86 | * PM registers (ACPI block) | ||
87 | * It is only safe to access these registers as dword accesses. | ||
88 | * See CS5536 Specification Update erratas 17 & 18 | ||
89 | */ | ||
90 | #define CS5536_PM1_STS 0x00 | ||
91 | #define CS5536_PM1_EN 0x02 | ||
92 | #define CS5536_PM1_CNT 0x08 | ||
93 | #define CS5536_PM_GPE0_STS 0x18 | ||
94 | #define CS5536_PM_GPE0_EN 0x1c | ||
95 | |||
96 | /* CS5536_PM1_STS bits */ | ||
97 | #define CS5536_WAK_FLAG (1 << 15) | ||
98 | #define CS5536_PWRBTN_FLAG (1 << 8) | ||
99 | |||
100 | /* CS5536_PM1_EN bits */ | ||
101 | #define CS5536_PM_PWRBTN (1 << 8) | ||
102 | #define CS5536_PM_RTC (1 << 10) | ||
103 | |||
104 | /* CS5536_PM_GPE0_STS bits */ | ||
105 | #define CS5536_GPIOM7_PME_FLAG (1 << 31) | ||
106 | #define CS5536_GPIOM6_PME_FLAG (1 << 30) | ||
107 | |||
108 | /* CS5536_PM_GPE0_EN bits */ | ||
109 | #define CS5536_GPIOM7_PME_EN (1 << 31) | ||
110 | #define CS5536_GPIOM6_PME_EN (1 << 30) | ||
111 | |||
52 | /* VSA2 magic values */ | 112 | /* VSA2 magic values */ |
53 | #define VSA_VRC_INDEX 0xAC1C | 113 | #define VSA_VRC_INDEX 0xAC1C |
54 | #define VSA_VRC_DATA 0xAC1E | 114 | #define VSA_VRC_DATA 0xAC1E |
diff --git a/include/linux/ctype.h b/include/linux/ctype.h index a3d6ee0044f9..8acfe312f947 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h | |||
@@ -52,4 +52,13 @@ static inline unsigned char __toupper(unsigned char c) | |||
52 | #define tolower(c) __tolower(c) | 52 | #define tolower(c) __tolower(c) |
53 | #define toupper(c) __toupper(c) | 53 | #define toupper(c) __toupper(c) |
54 | 54 | ||
55 | /* | ||
56 | * Fast implementation of tolower() for internal usage. Do not use in your | ||
57 | * code. | ||
58 | */ | ||
59 | static inline char _tolower(const char c) | ||
60 | { | ||
61 | return c | 0x20; | ||
62 | } | ||
63 | |||
55 | #endif | 64 | #endif |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 19d90a55541d..62157c03caf7 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_DCACHE_H | 1 | #ifndef __LINUX_DCACHE_H |
2 | #define __LINUX_DCACHE_H | 2 | #define __LINUX_DCACHE_H |
3 | 3 | ||
4 | #include <asm/atomic.h> | 4 | #include <linux/atomic.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/rculist.h> | 6 | #include <linux/rculist.h> |
7 | #include <linux/rculist_bl.h> | 7 | #include <linux/rculist_bl.h> |
@@ -180,12 +180,12 @@ struct dentry_operations { | |||
180 | */ | 180 | */ |
181 | 181 | ||
182 | /* d_flags entries */ | 182 | /* d_flags entries */ |
183 | #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ | 183 | #define DCACHE_OP_HASH 0x0001 |
184 | #define DCACHE_NFSFS_RENAMED 0x0002 | 184 | #define DCACHE_OP_COMPARE 0x0002 |
185 | /* this dentry has been "silly renamed" and has to be deleted on the last | 185 | #define DCACHE_OP_REVALIDATE 0x0004 |
186 | * dput() */ | 186 | #define DCACHE_OP_DELETE 0x0008 |
187 | 187 | ||
188 | #define DCACHE_DISCONNECTED 0x0004 | 188 | #define DCACHE_DISCONNECTED 0x0010 |
189 | /* This dentry is possibly not currently connected to the dcache tree, in | 189 | /* This dentry is possibly not currently connected to the dcache tree, in |
190 | * which case its parent will either be itself, or will have this flag as | 190 | * which case its parent will either be itself, or will have this flag as |
191 | * well. nfsd will not use a dentry with this bit set, but will first | 191 | * well. nfsd will not use a dentry with this bit set, but will first |
@@ -196,26 +196,23 @@ struct dentry_operations { | |||
196 | * dentry into place and return that dentry rather than the passed one, | 196 | * dentry into place and return that dentry rather than the passed one, |
197 | * typically using d_splice_alias. */ | 197 | * typically using d_splice_alias. */ |
198 | 198 | ||
199 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ | 199 | #define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */ |
200 | #define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */ | 200 | #define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */ |
201 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 | ||
202 | /* Parent inode is watched by inotify */ | ||
203 | |||
204 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ | ||
205 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 | ||
206 | /* Parent inode is watched by some fsnotify listener */ | ||
207 | 201 | ||
208 | #define DCACHE_CANT_MOUNT 0x0100 | 202 | #define DCACHE_CANT_MOUNT 0x0100 |
209 | #define DCACHE_GENOCIDE 0x0200 | 203 | #define DCACHE_GENOCIDE 0x0200 |
210 | 204 | ||
211 | #define DCACHE_OP_HASH 0x1000 | 205 | #define DCACHE_NFSFS_RENAMED 0x1000 |
212 | #define DCACHE_OP_COMPARE 0x2000 | 206 | /* this dentry has been "silly renamed" and has to be deleted on the last |
213 | #define DCACHE_OP_REVALIDATE 0x4000 | 207 | * dput() */ |
214 | #define DCACHE_OP_DELETE 0x8000 | 208 | #define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ |
209 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 | ||
210 | /* Parent inode is watched by some fsnotify listener */ | ||
215 | 211 | ||
216 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ | 212 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ |
217 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ | 213 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ |
218 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ | 214 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ |
215 | #define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */ | ||
219 | #define DCACHE_MANAGED_DENTRY \ | 216 | #define DCACHE_MANAGED_DENTRY \ |
220 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 217 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
221 | 218 | ||
@@ -416,7 +413,12 @@ static inline bool d_mountpoint(struct dentry *dentry) | |||
416 | return dentry->d_flags & DCACHE_MOUNTED; | 413 | return dentry->d_flags & DCACHE_MOUNTED; |
417 | } | 414 | } |
418 | 415 | ||
419 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | 416 | static inline bool d_need_lookup(struct dentry *dentry) |
417 | { | ||
418 | return dentry->d_flags & DCACHE_NEED_LOOKUP; | ||
419 | } | ||
420 | |||
421 | extern void d_clear_need_lookup(struct dentry *dentry); | ||
420 | 422 | ||
421 | extern int sysctl_vfs_cache_pressure; | 423 | extern int sysctl_vfs_cache_pressure; |
422 | 424 | ||
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index c52280047e2c..65a2562f66b4 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
@@ -203,6 +203,7 @@ struct dcbmsg { | |||
203 | * @DCB_CMD_GFEATCFG: get DCBX features flags | 203 | * @DCB_CMD_GFEATCFG: get DCBX features flags |
204 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags | 204 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags |
205 | * @DCB_CMD_CEE_GET: get CEE aggregated configuration | 205 | * @DCB_CMD_CEE_GET: get CEE aggregated configuration |
206 | * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration | ||
206 | */ | 207 | */ |
207 | enum dcbnl_commands { | 208 | enum dcbnl_commands { |
208 | DCB_CMD_UNDEFINED, | 209 | DCB_CMD_UNDEFINED, |
@@ -246,6 +247,7 @@ enum dcbnl_commands { | |||
246 | DCB_CMD_SFEATCFG, | 247 | DCB_CMD_SFEATCFG, |
247 | 248 | ||
248 | DCB_CMD_CEE_GET, | 249 | DCB_CMD_CEE_GET, |
250 | DCB_CMD_IEEE_DEL, | ||
249 | 251 | ||
250 | __DCB_CMD_ENUM_MAX, | 252 | __DCB_CMD_ENUM_MAX, |
251 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | 253 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, |
@@ -331,18 +333,30 @@ enum ieee_attrs_app { | |||
331 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) | 333 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) |
332 | 334 | ||
333 | /** | 335 | /** |
334 | * enum cee_attrs - CEE DCBX get attributes | 336 | * enum cee_attrs - CEE DCBX get attributes. |
335 | * | 337 | * |
336 | * @DCB_ATTR_CEE_UNSPEC: unspecified | 338 | * @DCB_ATTR_CEE_UNSPEC: unspecified |
337 | * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only | 339 | * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only |
338 | * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only | 340 | * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only |
339 | * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only | 341 | * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only |
342 | * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG) | ||
343 | * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG) | ||
344 | * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG) | ||
345 | * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP) | ||
346 | * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG) | ||
347 | * | ||
348 | * An aggregated collection of the cee std negotiated parameters. | ||
340 | */ | 349 | */ |
341 | enum cee_attrs { | 350 | enum cee_attrs { |
342 | DCB_ATTR_CEE_UNSPEC, | 351 | DCB_ATTR_CEE_UNSPEC, |
343 | DCB_ATTR_CEE_PEER_PG, | 352 | DCB_ATTR_CEE_PEER_PG, |
344 | DCB_ATTR_CEE_PEER_PFC, | 353 | DCB_ATTR_CEE_PEER_PFC, |
345 | DCB_ATTR_CEE_PEER_APP_TABLE, | 354 | DCB_ATTR_CEE_PEER_APP_TABLE, |
355 | DCB_ATTR_CEE_TX_PG, | ||
356 | DCB_ATTR_CEE_RX_PG, | ||
357 | DCB_ATTR_CEE_PFC, | ||
358 | DCB_ATTR_CEE_APP_TABLE, | ||
359 | DCB_ATTR_CEE_FEAT, | ||
346 | __DCB_ATTR_CEE_MAX | 360 | __DCB_ATTR_CEE_MAX |
347 | }; | 361 | }; |
348 | #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) | 362 | #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) |
@@ -355,6 +369,13 @@ enum peer_app_attr { | |||
355 | }; | 369 | }; |
356 | #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) | 370 | #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) |
357 | 371 | ||
372 | enum cee_attrs_app { | ||
373 | DCB_ATTR_CEE_APP_UNSPEC, | ||
374 | DCB_ATTR_CEE_APP, | ||
375 | __DCB_ATTR_CEE_APP_MAX | ||
376 | }; | ||
377 | #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1) | ||
378 | |||
358 | /** | 379 | /** |
359 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | 380 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs |
360 | * | 381 | * |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index d638e85dc501..710c04302a15 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -236,6 +236,7 @@ enum dccp_packet_dequeueing_policy { | |||
236 | #ifdef __KERNEL__ | 236 | #ifdef __KERNEL__ |
237 | 237 | ||
238 | #include <linux/in.h> | 238 | #include <linux/in.h> |
239 | #include <linux/interrupt.h> | ||
239 | #include <linux/ktime.h> | 240 | #include <linux/ktime.h> |
240 | #include <linux/list.h> | 241 | #include <linux/list.h> |
241 | #include <linux/uio.h> | 242 | #include <linux/uio.h> |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 2833452ea01c..5033fb88c107 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_DEBUG_LOCKING_H | 2 | #define __LINUX_DEBUG_LOCKING_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <asm/atomic.h> | 5 | #include <linux/atomic.h> |
6 | #include <asm/system.h> | 6 | #include <asm/system.h> |
7 | 7 | ||
8 | struct task_struct; | 8 | struct task_struct; |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 4427e0454051..3fa1f3d90ce0 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -208,6 +208,49 @@ struct dm_target_callbacks { | |||
208 | int dm_register_target(struct target_type *t); | 208 | int dm_register_target(struct target_type *t); |
209 | void dm_unregister_target(struct target_type *t); | 209 | void dm_unregister_target(struct target_type *t); |
210 | 210 | ||
211 | /* | ||
212 | * Target argument parsing. | ||
213 | */ | ||
214 | struct dm_arg_set { | ||
215 | unsigned argc; | ||
216 | char **argv; | ||
217 | }; | ||
218 | |||
219 | /* | ||
220 | * The minimum and maximum value of a numeric argument, together with | ||
221 | * the error message to use if the number is found to be outside that range. | ||
222 | */ | ||
223 | struct dm_arg { | ||
224 | unsigned min; | ||
225 | unsigned max; | ||
226 | char *error; | ||
227 | }; | ||
228 | |||
229 | /* | ||
230 | * Validate the next argument, either returning it as *value or, if invalid, | ||
231 | * returning -EINVAL and setting *error. | ||
232 | */ | ||
233 | int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set, | ||
234 | unsigned *value, char **error); | ||
235 | |||
236 | /* | ||
237 | * Process the next argument as the start of a group containing between | ||
238 | * arg->min and arg->max further arguments. Either return the size as | ||
239 | * *num_args or, if invalid, return -EINVAL and set *error. | ||
240 | */ | ||
241 | int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set, | ||
242 | unsigned *num_args, char **error); | ||
243 | |||
244 | /* | ||
245 | * Return the current argument and shift to the next. | ||
246 | */ | ||
247 | const char *dm_shift_arg(struct dm_arg_set *as); | ||
248 | |||
249 | /* | ||
250 | * Move through num_args arguments. | ||
251 | */ | ||
252 | void dm_consume_args(struct dm_arg_set *as, unsigned num_args); | ||
253 | |||
211 | /*----------------------------------------------------------------- | 254 | /*----------------------------------------------------------------- |
212 | * Functions for creating and manipulating mapped devices. | 255 | * Functions for creating and manipulating mapped devices. |
213 | * Drop the reference with dm_put when you finish with the object. | 256 | * Drop the reference with dm_put when you finish with the object. |
diff --git a/include/linux/device.h b/include/linux/device.h index e4f62d8896b7..c20dfbfc49b4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
25 | #include <asm/atomic.h> | 25 | #include <linux/atomic.h> |
26 | #include <asm/device.h> | 26 | #include <asm/device.h> |
27 | 27 | ||
28 | struct device; | 28 | struct device; |
@@ -516,7 +516,7 @@ struct device_dma_parameters { | |||
516 | * minimizes board-specific #ifdefs in drivers. | 516 | * minimizes board-specific #ifdefs in drivers. |
517 | * @power: For device power management. | 517 | * @power: For device power management. |
518 | * See Documentation/power/devices.txt for details. | 518 | * See Documentation/power/devices.txt for details. |
519 | * @pwr_domain: Provide callbacks that are executed during system suspend, | 519 | * @pm_domain: Provide callbacks that are executed during system suspend, |
520 | * hibernation, system resume and during runtime PM transitions | 520 | * hibernation, system resume and during runtime PM transitions |
521 | * along with subsystem-level and driver-level callbacks. | 521 | * along with subsystem-level and driver-level callbacks. |
522 | * @numa_node: NUMA node this device is close to. | 522 | * @numa_node: NUMA node this device is close to. |
@@ -567,7 +567,7 @@ struct device { | |||
567 | void *platform_data; /* Platform specific data, device | 567 | void *platform_data; /* Platform specific data, device |
568 | core doesn't touch it */ | 568 | core doesn't touch it */ |
569 | struct dev_pm_info power; | 569 | struct dev_pm_info power; |
570 | struct dev_power_domain *pwr_domain; | 570 | struct dev_pm_domain *pm_domain; |
571 | 571 | ||
572 | #ifdef CONFIG_NUMA | 572 | #ifdef CONFIG_NUMA |
573 | int numa_node; /* NUMA node this device is close to */ | 573 | int numa_node; /* NUMA node this device is close to */ |
diff --git a/include/linux/dio.h b/include/linux/dio.h index b2dd31ca1710..2cc0fd00463f 100644 --- a/include/linux/dio.h +++ b/include/linux/dio.h | |||
@@ -254,7 +254,7 @@ static inline struct dio_driver *dio_dev_driver(const struct dio_dev *d) | |||
254 | 254 | ||
255 | #define dio_resource_start(d) ((d)->resource.start) | 255 | #define dio_resource_start(d) ((d)->resource.start) |
256 | #define dio_resource_end(d) ((d)->resource.end) | 256 | #define dio_resource_end(d) ((d)->resource.end) |
257 | #define dio_resource_len(d) ((d)->resource.end-(d)->resource.start+1) | 257 | #define dio_resource_len(d) (resource_size(&(d)->resource)) |
258 | #define dio_resource_flags(d) ((d)->resource.flags) | 258 | #define dio_resource_flags(d) ((d)->resource.flags) |
259 | 259 | ||
260 | #define dio_request_device(d, name) \ | 260 | #define dio_request_device(d, name) \ |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 3708455ee6c3..0cb8eff76bd6 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -267,9 +267,9 @@ enum { | |||
267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
268 | 268 | ||
269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
270 | #define DM_VERSION_MINOR 20 | 270 | #define DM_VERSION_MINOR 21 |
271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 0 |
272 | #define DM_VERSION_EXTRA "-ioctl (2011-02-02)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2011-07-06)" |
273 | 273 | ||
274 | /* Status bits */ | 274 | /* Status bits */ |
275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h index 298d587e349b..5e54458e920f 100644 --- a/include/linux/dm-kcopyd.h +++ b/include/linux/dm-kcopyd.h | |||
@@ -42,5 +42,20 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from, | |||
42 | unsigned num_dests, struct dm_io_region *dests, | 42 | unsigned num_dests, struct dm_io_region *dests, |
43 | unsigned flags, dm_kcopyd_notify_fn fn, void *context); | 43 | unsigned flags, dm_kcopyd_notify_fn fn, void *context); |
44 | 44 | ||
45 | /* | ||
46 | * Prepare a callback and submit it via the kcopyd thread. | ||
47 | * | ||
48 | * dm_kcopyd_prepare_callback allocates a callback structure and returns it. | ||
49 | * It must not be called from interrupt context. | ||
50 | * The returned value should be passed into dm_kcopyd_do_callback. | ||
51 | * | ||
52 | * dm_kcopyd_do_callback submits the callback. | ||
53 | * It may be called from interrupt context. | ||
54 | * The callback is issued from the kcopyd thread. | ||
55 | */ | ||
56 | void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc, | ||
57 | dm_kcopyd_notify_fn fn, void *context); | ||
58 | void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err); | ||
59 | |||
45 | #endif /* __KERNEL__ */ | 60 | #endif /* __KERNEL__ */ |
46 | #endif /* _LINUX_DM_KCOPYD_H */ | 61 | #endif /* _LINUX_DM_KCOPYD_H */ |
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h new file mode 100644 index 000000000000..95b6a82f5951 --- /dev/null +++ b/include/linux/dma-direction.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _LINUX_DMA_DIRECTION_H | ||
2 | #define _LINUX_DMA_DIRECTION_H | ||
3 | /* | ||
4 | * These definitions mirror those in pci.h, so they can be used | ||
5 | * interchangeably with their PCI_ counterparts. | ||
6 | */ | ||
7 | enum dma_data_direction { | ||
8 | DMA_BIDIRECTIONAL = 0, | ||
9 | DMA_TO_DEVICE = 1, | ||
10 | DMA_FROM_DEVICE = 2, | ||
11 | DMA_NONE = 3, | ||
12 | }; | ||
13 | #endif | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ba8319ae5fcc..347fdc32177a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -4,17 +4,9 @@ | |||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/err.h> | 5 | #include <linux/err.h> |
6 | #include <linux/dma-attrs.h> | 6 | #include <linux/dma-attrs.h> |
7 | #include <linux/dma-direction.h> | ||
7 | #include <linux/scatterlist.h> | 8 | #include <linux/scatterlist.h> |
8 | 9 | ||
9 | /* These definitions mirror those in pci.h, so they can be used | ||
10 | * interchangeably with their PCI_ counterparts */ | ||
11 | enum dma_data_direction { | ||
12 | DMA_BIDIRECTIONAL = 0, | ||
13 | DMA_TO_DEVICE = 1, | ||
14 | DMA_FROM_DEVICE = 2, | ||
15 | DMA_NONE = 3, | ||
16 | }; | ||
17 | |||
18 | struct dma_map_ops { | 10 | struct dma_map_ops { |
19 | void* (*alloc_coherent)(struct device *dev, size_t size, | 11 | void* (*alloc_coherent)(struct device *dev, size_t size, |
20 | dma_addr_t *dma_handle, gfp_t gfp); | 12 | dma_addr_t *dma_handle, gfp_t gfp); |
@@ -54,27 +46,6 @@ struct dma_map_ops { | |||
54 | 46 | ||
55 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) | 47 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) |
56 | 48 | ||
57 | typedef u64 DMA_nnBIT_MASK __deprecated; | ||
58 | |||
59 | /* | ||
60 | * NOTE: do not use the below macros in new code and do not add new definitions | ||
61 | * here. | ||
62 | * | ||
63 | * Instead, just open-code DMA_BIT_MASK(n) within your driver | ||
64 | */ | ||
65 | #define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64) | ||
66 | #define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48) | ||
67 | #define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47) | ||
68 | #define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40) | ||
69 | #define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39) | ||
70 | #define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35) | ||
71 | #define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32) | ||
72 | #define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31) | ||
73 | #define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30) | ||
74 | #define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29) | ||
75 | #define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28) | ||
76 | #define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24) | ||
77 | |||
78 | #define DMA_MASK_NONE 0x0ULL | 49 | #define DMA_MASK_NONE 0x0ULL |
79 | 50 | ||
80 | static inline int valid_dma_direction(int dma_direction) | 51 | static inline int valid_dma_direction(int dma_direction) |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index eee7addec282..8fbf40e0713c 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -23,7 +23,9 @@ | |||
23 | 23 | ||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-direction.h> |
27 | |||
28 | struct scatterlist; | ||
27 | 29 | ||
28 | /** | 30 | /** |
29 | * typedef dma_cookie_t - an opaque DMA cookie | 31 | * typedef dma_cookie_t - an opaque DMA cookie |
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index fec66bd24f22..d47bccd604e4 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -67,7 +67,7 @@ typedef struct audio_status { | |||
67 | 67 | ||
68 | 68 | ||
69 | typedef | 69 | typedef |
70 | struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ | 70 | struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */ |
71 | int vocal1; /* into left and right t at 70% each */ | 71 | int vocal1; /* into left and right t at 70% each */ |
72 | int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ | 72 | int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ |
73 | int melody; /* mixed into the left channel and */ | 73 | int melody; /* mixed into the left channel and */ |
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h new file mode 100644 index 000000000000..49638ea3b776 --- /dev/null +++ b/include/linux/dw_apb_timer.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * (C) Copyright 2009 Intel Corporation | ||
3 | * Author: Jacob Pan (jacob.jun.pan@intel.com) | ||
4 | * | ||
5 | * Shared with ARM platforms, Jamie Iles, Picochip 2011 | ||
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 | * Support for the Synopsys DesignWare APB Timers. | ||
12 | */ | ||
13 | #ifndef __DW_APB_TIMER_H__ | ||
14 | #define __DW_APB_TIMER_H__ | ||
15 | |||
16 | #include <linux/clockchips.h> | ||
17 | #include <linux/clocksource.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | |||
20 | #define APBTMRS_REG_SIZE 0x14 | ||
21 | |||
22 | struct dw_apb_timer { | ||
23 | void __iomem *base; | ||
24 | unsigned long freq; | ||
25 | int irq; | ||
26 | }; | ||
27 | |||
28 | struct dw_apb_clock_event_device { | ||
29 | struct clock_event_device ced; | ||
30 | struct dw_apb_timer timer; | ||
31 | struct irqaction irqaction; | ||
32 | void (*eoi)(struct dw_apb_timer *); | ||
33 | }; | ||
34 | |||
35 | struct dw_apb_clocksource { | ||
36 | struct dw_apb_timer timer; | ||
37 | struct clocksource cs; | ||
38 | }; | ||
39 | |||
40 | void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced); | ||
41 | void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced); | ||
42 | void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced); | ||
43 | void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced); | ||
44 | |||
45 | struct dw_apb_clock_event_device * | ||
46 | dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, | ||
47 | void __iomem *base, int irq, unsigned long freq); | ||
48 | struct dw_apb_clocksource * | ||
49 | dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base, | ||
50 | unsigned long freq); | ||
51 | void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); | ||
52 | void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); | ||
53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); | ||
54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); | ||
55 | |||
56 | #endif /* __DW_APB_TIMER_H__ */ | ||
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h new file mode 100644 index 000000000000..2224a8c0cb64 --- /dev/null +++ b/include/linux/ecryptfs.h | |||
@@ -0,0 +1,113 @@ | |||
1 | #ifndef _LINUX_ECRYPTFS_H | ||
2 | #define _LINUX_ECRYPTFS_H | ||
3 | |||
4 | /* Version verification for shared data structures w/ userspace */ | ||
5 | #define ECRYPTFS_VERSION_MAJOR 0x00 | ||
6 | #define ECRYPTFS_VERSION_MINOR 0x04 | ||
7 | #define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03 | ||
8 | /* These flags indicate which features are supported by the kernel | ||
9 | * module; userspace tools such as the mount helper read | ||
10 | * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine | ||
11 | * how to behave. */ | ||
12 | #define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001 | ||
13 | #define ECRYPTFS_VERSIONING_PUBKEY 0x00000002 | ||
14 | #define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004 | ||
15 | #define ECRYPTFS_VERSIONING_POLICY 0x00000008 | ||
16 | #define ECRYPTFS_VERSIONING_XATTR 0x00000010 | ||
17 | #define ECRYPTFS_VERSIONING_MULTKEY 0x00000020 | ||
18 | #define ECRYPTFS_VERSIONING_DEVMISC 0x00000040 | ||
19 | #define ECRYPTFS_VERSIONING_HMAC 0x00000080 | ||
20 | #define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100 | ||
21 | #define ECRYPTFS_VERSIONING_GCM 0x00000200 | ||
22 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
23 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
24 | | ECRYPTFS_VERSIONING_PUBKEY \ | ||
25 | | ECRYPTFS_VERSIONING_XATTR \ | ||
26 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
27 | | ECRYPTFS_VERSIONING_DEVMISC \ | ||
28 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
29 | #define ECRYPTFS_MAX_PASSWORD_LENGTH 64 | ||
30 | #define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH | ||
31 | #define ECRYPTFS_SALT_SIZE 8 | ||
32 | #define ECRYPTFS_SALT_SIZE_HEX (ECRYPTFS_SALT_SIZE*2) | ||
33 | /* The original signature size is only for what is stored on disk; all | ||
34 | * in-memory representations are expanded hex, so it better adapted to | ||
35 | * be passed around or referenced on the command line */ | ||
36 | #define ECRYPTFS_SIG_SIZE 8 | ||
37 | #define ECRYPTFS_SIG_SIZE_HEX (ECRYPTFS_SIG_SIZE*2) | ||
38 | #define ECRYPTFS_PASSWORD_SIG_SIZE ECRYPTFS_SIG_SIZE_HEX | ||
39 | #define ECRYPTFS_MAX_KEY_BYTES 64 | ||
40 | #define ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES 512 | ||
41 | #define ECRYPTFS_FILE_VERSION 0x03 | ||
42 | #define ECRYPTFS_MAX_PKI_NAME_BYTES 16 | ||
43 | |||
44 | #define RFC2440_CIPHER_DES3_EDE 0x02 | ||
45 | #define RFC2440_CIPHER_CAST_5 0x03 | ||
46 | #define RFC2440_CIPHER_BLOWFISH 0x04 | ||
47 | #define RFC2440_CIPHER_AES_128 0x07 | ||
48 | #define RFC2440_CIPHER_AES_192 0x08 | ||
49 | #define RFC2440_CIPHER_AES_256 0x09 | ||
50 | #define RFC2440_CIPHER_TWOFISH 0x0a | ||
51 | #define RFC2440_CIPHER_CAST_6 0x0b | ||
52 | |||
53 | #define RFC2440_CIPHER_RSA 0x01 | ||
54 | |||
55 | /** | ||
56 | * For convenience, we may need to pass around the encrypted session | ||
57 | * key between kernel and userspace because the authentication token | ||
58 | * may not be extractable. For example, the TPM may not release the | ||
59 | * private key, instead requiring the encrypted data and returning the | ||
60 | * decrypted data. | ||
61 | */ | ||
62 | struct ecryptfs_session_key { | ||
63 | #define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_DECRYPT 0x00000001 | ||
64 | #define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_ENCRYPT 0x00000002 | ||
65 | #define ECRYPTFS_CONTAINS_DECRYPTED_KEY 0x00000004 | ||
66 | #define ECRYPTFS_CONTAINS_ENCRYPTED_KEY 0x00000008 | ||
67 | u32 flags; | ||
68 | u32 encrypted_key_size; | ||
69 | u32 decrypted_key_size; | ||
70 | u8 encrypted_key[ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES]; | ||
71 | u8 decrypted_key[ECRYPTFS_MAX_KEY_BYTES]; | ||
72 | }; | ||
73 | |||
74 | struct ecryptfs_password { | ||
75 | u32 password_bytes; | ||
76 | s32 hash_algo; | ||
77 | u32 hash_iterations; | ||
78 | u32 session_key_encryption_key_bytes; | ||
79 | #define ECRYPTFS_PERSISTENT_PASSWORD 0x01 | ||
80 | #define ECRYPTFS_SESSION_KEY_ENCRYPTION_KEY_SET 0x02 | ||
81 | u32 flags; | ||
82 | /* Iterated-hash concatenation of salt and passphrase */ | ||
83 | u8 session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES]; | ||
84 | u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1]; | ||
85 | /* Always in expanded hex */ | ||
86 | u8 salt[ECRYPTFS_SALT_SIZE]; | ||
87 | }; | ||
88 | |||
89 | enum ecryptfs_token_types {ECRYPTFS_PASSWORD, ECRYPTFS_PRIVATE_KEY}; | ||
90 | |||
91 | struct ecryptfs_private_key { | ||
92 | u32 key_size; | ||
93 | u32 data_len; | ||
94 | u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1]; | ||
95 | char pki_type[ECRYPTFS_MAX_PKI_NAME_BYTES + 1]; | ||
96 | u8 data[]; | ||
97 | }; | ||
98 | |||
99 | /* May be a password or a private key */ | ||
100 | struct ecryptfs_auth_tok { | ||
101 | u16 version; /* 8-bit major and 8-bit minor */ | ||
102 | u16 token_type; | ||
103 | #define ECRYPTFS_ENCRYPT_ONLY 0x00000001 | ||
104 | u32 flags; | ||
105 | struct ecryptfs_session_key session_key; | ||
106 | u8 reserved[32]; | ||
107 | union { | ||
108 | struct ecryptfs_password password; | ||
109 | struct ecryptfs_private_key private_key; | ||
110 | } token; | ||
111 | } __attribute__ ((packed)); | ||
112 | |||
113 | #endif /* _LINUX_ECRYPTFS_H */ | ||
diff --git a/include/linux/edac.h b/include/linux/edac.h index 36c66443bdfd..4a73257b47d0 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef _LINUX_EDAC_H_ | 12 | #ifndef _LINUX_EDAC_H_ |
13 | #define _LINUX_EDAC_H_ | 13 | #define _LINUX_EDAC_H_ |
14 | 14 | ||
15 | #include <asm/atomic.h> | 15 | #include <linux/atomic.h> |
16 | #include <linux/sysdev.h> | 16 | #include <linux/sysdev.h> |
17 | 17 | ||
18 | #define EDAC_OPSTATE_INVAL -1 | 18 | #define EDAC_OPSTATE_INVAL -1 |
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h new file mode 100644 index 000000000000..06791811e49d --- /dev/null +++ b/include/linux/eeprom_93xx46.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Module: eeprom_93xx46 | ||
3 | * platform description for 93xx46 EEPROMs. | ||
4 | */ | ||
5 | |||
6 | struct eeprom_93xx46_platform_data { | ||
7 | unsigned char flags; | ||
8 | #define EE_ADDR8 0x01 /* 8 bit addr. cfg */ | ||
9 | #define EE_ADDR16 0x02 /* 16 bit addr. cfg */ | ||
10 | #define EE_READONLY 0x08 /* forbid writing */ | ||
11 | |||
12 | /* | ||
13 | * optional hooks to control additional logic | ||
14 | * before and after spi transfer. | ||
15 | */ | ||
16 | void (*prepare)(void *); | ||
17 | void (*finish)(void *); | ||
18 | }; | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index e376270cd26e..2362a0bc7f0d 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/rtc.h> | 19 | #include <linux/rtc.h> |
20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
21 | #include <linux/pfn.h> | 21 | #include <linux/pfn.h> |
22 | #include <linux/pstore.h> | ||
22 | 23 | ||
23 | #include <asm/page.h> | 24 | #include <asm/page.h> |
24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
@@ -101,6 +102,13 @@ typedef struct { | |||
101 | u64 attribute; | 102 | u64 attribute; |
102 | } efi_memory_desc_t; | 103 | } efi_memory_desc_t; |
103 | 104 | ||
105 | typedef struct { | ||
106 | efi_guid_t guid; | ||
107 | u32 headersize; | ||
108 | u32 flags; | ||
109 | u32 imagesize; | ||
110 | } efi_capsule_header_t; | ||
111 | |||
104 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); | 112 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); |
105 | 113 | ||
106 | /* | 114 | /* |
@@ -156,6 +164,9 @@ typedef struct { | |||
156 | unsigned long set_variable; | 164 | unsigned long set_variable; |
157 | unsigned long get_next_high_mono_count; | 165 | unsigned long get_next_high_mono_count; |
158 | unsigned long reset_system; | 166 | unsigned long reset_system; |
167 | unsigned long update_capsule; | ||
168 | unsigned long query_capsule_caps; | ||
169 | unsigned long query_variable_info; | ||
159 | } efi_runtime_services_t; | 170 | } efi_runtime_services_t; |
160 | 171 | ||
161 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); | 172 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); |
@@ -168,7 +179,7 @@ typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor, | |||
168 | typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, | 179 | typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, |
169 | efi_guid_t *vendor); | 180 | efi_guid_t *vendor); |
170 | typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, | 181 | typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, |
171 | unsigned long attr, unsigned long data_size, | 182 | u32 attr, unsigned long data_size, |
172 | void *data); | 183 | void *data); |
173 | typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); | 184 | typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); |
174 | typedef void efi_reset_system_t (int reset_type, efi_status_t status, | 185 | typedef void efi_reset_system_t (int reset_type, efi_status_t status, |
@@ -177,6 +188,17 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz | |||
177 | unsigned long descriptor_size, | 188 | unsigned long descriptor_size, |
178 | u32 descriptor_version, | 189 | u32 descriptor_version, |
179 | efi_memory_desc_t *virtual_map); | 190 | efi_memory_desc_t *virtual_map); |
191 | typedef efi_status_t efi_query_variable_info_t(u32 attr, | ||
192 | u64 *storage_space, | ||
193 | u64 *remaining_space, | ||
194 | u64 *max_variable_size); | ||
195 | typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **capsules, | ||
196 | unsigned long count, | ||
197 | unsigned long sg_list); | ||
198 | typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | ||
199 | unsigned long count, | ||
200 | u64 *max_size, | ||
201 | int *reset_type); | ||
180 | 202 | ||
181 | /* | 203 | /* |
182 | * EFI Configuration Table and GUID definitions | 204 | * EFI Configuration Table and GUID definitions |
@@ -211,6 +233,9 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz | |||
211 | #define UV_SYSTEM_TABLE_GUID \ | 233 | #define UV_SYSTEM_TABLE_GUID \ |
212 | EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 ) | 234 | EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 ) |
213 | 235 | ||
236 | #define LINUX_EFI_CRASH_GUID \ | ||
237 | EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 ) | ||
238 | |||
214 | typedef struct { | 239 | typedef struct { |
215 | efi_guid_t guid; | 240 | efi_guid_t guid; |
216 | unsigned long table; | 241 | unsigned long table; |
@@ -218,6 +243,13 @@ typedef struct { | |||
218 | 243 | ||
219 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) | 244 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) |
220 | 245 | ||
246 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) | ||
247 | #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20)) | ||
248 | #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10)) | ||
249 | #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00)) | ||
250 | #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10)) | ||
251 | #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02)) | ||
252 | |||
221 | typedef struct { | 253 | typedef struct { |
222 | efi_table_hdr_t hdr; | 254 | efi_table_hdr_t hdr; |
223 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ | 255 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ |
@@ -250,6 +282,7 @@ struct efi_memory_map { | |||
250 | */ | 282 | */ |
251 | extern struct efi { | 283 | extern struct efi { |
252 | efi_system_table_t *systab; /* EFI system table */ | 284 | efi_system_table_t *systab; /* EFI system table */ |
285 | unsigned int runtime_version; /* Runtime services version */ | ||
253 | unsigned long mps; /* MPS table */ | 286 | unsigned long mps; /* MPS table */ |
254 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ | 287 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ |
255 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ | 288 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ |
@@ -266,6 +299,9 @@ extern struct efi { | |||
266 | efi_get_variable_t *get_variable; | 299 | efi_get_variable_t *get_variable; |
267 | efi_get_next_variable_t *get_next_variable; | 300 | efi_get_next_variable_t *get_next_variable; |
268 | efi_set_variable_t *set_variable; | 301 | efi_set_variable_t *set_variable; |
302 | efi_query_variable_info_t *query_variable_info; | ||
303 | efi_update_capsule_t *update_capsule; | ||
304 | efi_query_capsule_caps_t *query_capsule_caps; | ||
269 | efi_get_next_high_mono_count_t *get_next_high_mono_count; | 305 | efi_get_next_high_mono_count_t *get_next_high_mono_count; |
270 | efi_reset_system_t *reset_system; | 306 | efi_reset_system_t *reset_system; |
271 | efi_set_virtual_address_map_t *set_virtual_address_map; | 307 | efi_set_virtual_address_map_t *set_virtual_address_map; |
@@ -426,6 +462,8 @@ struct efivars { | |||
426 | struct kset *kset; | 462 | struct kset *kset; |
427 | struct bin_attribute *new_var, *del_var; | 463 | struct bin_attribute *new_var, *del_var; |
428 | const struct efivar_operations *ops; | 464 | const struct efivar_operations *ops; |
465 | struct efivar_entry *walk_entry; | ||
466 | struct pstore_info efi_pstore_info; | ||
429 | }; | 467 | }; |
430 | 468 | ||
431 | int register_efivars(struct efivars *efivars, | 469 | int register_efivars(struct efivars *efivars, |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 21a8ebf2dc3a..d800d5142184 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -146,7 +146,7 @@ extern struct request *elv_rb_latter_request(struct request_queue *, struct requ | |||
146 | /* | 146 | /* |
147 | * rb support functions. | 147 | * rb support functions. |
148 | */ | 148 | */ |
149 | extern struct request *elv_rb_add(struct rb_root *, struct request *); | 149 | extern void elv_rb_add(struct rb_root *, struct request *); |
150 | extern void elv_rb_del(struct rb_root *, struct request *); | 150 | extern void elv_rb_del(struct rb_root *, struct request *); |
151 | extern struct request *elv_rb_find(struct rb_root *, sector_t); | 151 | extern struct request *elv_rb_find(struct rb_root *, sector_t); |
152 | 152 | ||
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index ab68f785fd19..05955cf09937 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -38,7 +38,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev, | |||
38 | const void *daddr, const void *saddr, unsigned len); | 38 | const void *daddr, const void *saddr, unsigned len); |
39 | extern int eth_rebuild_header(struct sk_buff *skb); | 39 | extern int eth_rebuild_header(struct sk_buff *skb); |
40 | extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 40 | extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
41 | extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh); | 41 | extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type); |
42 | extern void eth_header_cache_update(struct hh_cache *hh, | 42 | extern void eth_header_cache_update(struct hh_cache *hh, |
43 | const struct net_device *dev, | 43 | const struct net_device *dev, |
44 | const unsigned char *haddr); | 44 | const unsigned char *haddr); |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 439b173c5882..c6e427ab65fe 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -287,7 +287,7 @@ enum ethtool_stringset { | |||
287 | ETH_SS_TEST = 0, | 287 | ETH_SS_TEST = 0, |
288 | ETH_SS_STATS, | 288 | ETH_SS_STATS, |
289 | ETH_SS_PRIV_FLAGS, | 289 | ETH_SS_PRIV_FLAGS, |
290 | ETH_SS_NTUPLE_FILTERS, | 290 | ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */ |
291 | ETH_SS_FEATURES, | 291 | ETH_SS_FEATURES, |
292 | }; | 292 | }; |
293 | 293 | ||
@@ -310,9 +310,21 @@ struct ethtool_sset_info { | |||
310 | __u32's, etc. */ | 310 | __u32's, etc. */ |
311 | }; | 311 | }; |
312 | 312 | ||
313 | /** | ||
314 | * enum ethtool_test_flags - flags definition of ethtool_test | ||
315 | * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise | ||
316 | * only online tests. | ||
317 | * @ETH_TEST_FL_FAILED: Driver set this flag if test fails. | ||
318 | * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback | ||
319 | * test. | ||
320 | * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test | ||
321 | */ | ||
322 | |||
313 | enum ethtool_test_flags { | 323 | enum ethtool_test_flags { |
314 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ | 324 | ETH_TEST_FL_OFFLINE = (1 << 0), |
315 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ | 325 | ETH_TEST_FL_FAILED = (1 << 1), |
326 | ETH_TEST_FL_EXTERNAL_LB = (1 << 2), | ||
327 | ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3), | ||
316 | }; | 328 | }; |
317 | 329 | ||
318 | /* for requesting NIC test and getting results*/ | 330 | /* for requesting NIC test and getting results*/ |
@@ -714,18 +726,6 @@ enum ethtool_sfeatures_retval_bits { | |||
714 | /* needed by dev_disable_lro() */ | 726 | /* needed by dev_disable_lro() */ |
715 | extern int __ethtool_set_flags(struct net_device *dev, u32 flags); | 727 | extern int __ethtool_set_flags(struct net_device *dev, u32 flags); |
716 | 728 | ||
717 | struct ethtool_rx_ntuple_flow_spec_container { | ||
718 | struct ethtool_rx_ntuple_flow_spec fs; | ||
719 | struct list_head list; | ||
720 | }; | ||
721 | |||
722 | struct ethtool_rx_ntuple_list { | ||
723 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
724 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
725 | struct list_head list; | ||
726 | unsigned int count; | ||
727 | }; | ||
728 | |||
729 | /** | 729 | /** |
730 | * enum ethtool_phys_id_state - indicator state for physical identification | 730 | * enum ethtool_phys_id_state - indicator state for physical identification |
731 | * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated | 731 | * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated |
@@ -758,7 +758,6 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
758 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 758 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
759 | u32 ethtool_op_get_flags(struct net_device *dev); | 759 | u32 ethtool_op_get_flags(struct net_device *dev); |
760 | int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); | 760 | int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); |
761 | void ethtool_ntuple_flush(struct net_device *dev); | ||
762 | bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); | 761 | bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); |
763 | 762 | ||
764 | /** | 763 | /** |
@@ -865,7 +864,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); | |||
865 | * error code or zero. | 864 | * error code or zero. |
866 | * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code | 865 | * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code |
867 | * or zero. | 866 | * or zero. |
868 | * @get_rx_ntuple: Deprecated. | ||
869 | * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. | 867 | * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. |
870 | * Returns a negative error code or zero. | 868 | * Returns a negative error code or zero. |
871 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. | 869 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. |
@@ -944,7 +942,6 @@ struct ethtool_ops { | |||
944 | int (*reset)(struct net_device *, u32 *); | 942 | int (*reset)(struct net_device *, u32 *); |
945 | int (*set_rx_ntuple)(struct net_device *, | 943 | int (*set_rx_ntuple)(struct net_device *, |
946 | struct ethtool_rx_ntuple *); | 944 | struct ethtool_rx_ntuple *); |
947 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
948 | int (*get_rxfh_indir)(struct net_device *, | 945 | int (*get_rxfh_indir)(struct net_device *, |
949 | struct ethtool_rxfh_indir *); | 946 | struct ethtool_rxfh_indir *); |
950 | int (*set_rxfh_indir)(struct net_device *, | 947 | int (*set_rxfh_indir)(struct net_device *, |
@@ -1017,7 +1014,7 @@ struct ethtool_ops { | |||
1017 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 1014 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
1018 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 1015 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
1019 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | 1016 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ |
1020 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | 1017 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */ |
1021 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | 1018 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ |
1022 | #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ | 1019 | #define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ |
1023 | #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ | 1020 | #define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 2dfa7076e8b6..53792bf36c71 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/magic.h> | 20 | #include <linux/magic.h> |
21 | #include <linux/fs.h> | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * The second extended filesystem constants/structures | 24 | * The second extended filesystem constants/structures |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 5e06acf95d0f..67a803aee619 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -418,12 +418,11 @@ struct ext3_inode { | |||
418 | #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS | 418 | #define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS |
419 | #endif | 419 | #endif |
420 | 420 | ||
421 | #define ext3_set_bit __test_and_set_bit_le | 421 | #define ext3_set_bit __set_bit_le |
422 | #define ext3_set_bit_atomic ext2_set_bit_atomic | 422 | #define ext3_set_bit_atomic ext2_set_bit_atomic |
423 | #define ext3_clear_bit __test_and_clear_bit_le | 423 | #define ext3_clear_bit __clear_bit_le |
424 | #define ext3_clear_bit_atomic ext2_clear_bit_atomic | 424 | #define ext3_clear_bit_atomic ext2_clear_bit_atomic |
425 | #define ext3_test_bit test_bit_le | 425 | #define ext3_test_bit test_bit_le |
426 | #define ext3_find_first_zero_bit find_first_zero_bit_le | ||
427 | #define ext3_find_next_zero_bit find_next_zero_bit_le | 426 | #define ext3_find_next_zero_bit find_next_zero_bit_le |
428 | 427 | ||
429 | /* | 428 | /* |
@@ -877,7 +876,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash, | |||
877 | extern void ext3_htree_free_dir_info(struct dir_private_info *p); | 876 | extern void ext3_htree_free_dir_info(struct dir_private_info *p); |
878 | 877 | ||
879 | /* fsync.c */ | 878 | /* fsync.c */ |
880 | extern int ext3_sync_file(struct file *, int); | 879 | extern int ext3_sync_file(struct file *, loff_t, loff_t, int); |
881 | 880 | ||
882 | /* hash.c */ | 881 | /* hash.c */ |
883 | extern int ext3fs_dirhash(const char *name, int len, struct | 882 | extern int ext3fs_dirhash(const char *name, int len, struct |
@@ -913,7 +912,7 @@ extern void ext3_dirty_inode(struct inode *, int); | |||
913 | extern int ext3_change_inode_journal_flag(struct inode *, int); | 912 | extern int ext3_change_inode_journal_flag(struct inode *, int); |
914 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); | 913 | extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); |
915 | extern int ext3_can_truncate(struct inode *inode); | 914 | extern int ext3_can_truncate(struct inode *inode); |
916 | extern void ext3_truncate (struct inode *); | 915 | extern void ext3_truncate(struct inode *inode); |
917 | extern void ext3_set_inode_flags(struct inode *); | 916 | extern void ext3_set_inode_flags(struct inode *); |
918 | extern void ext3_get_inode_flags(struct ext3_inode_info *); | 917 | extern void ext3_get_inode_flags(struct ext3_inode_info *); |
919 | extern void ext3_set_aops(struct inode *inode); | 918 | extern void ext3_set_aops(struct inode *inode); |
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index 7b64ad40e4ce..c6f996f2abb6 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
8 | #include <asm/atomic.h> | 8 | #include <linux/atomic.h> |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * For explanation of the elements of this struct, see | 11 | * For explanation of the elements of this struct, see |
@@ -25,26 +25,6 @@ struct fault_attr { | |||
25 | unsigned long reject_end; | 25 | unsigned long reject_end; |
26 | 26 | ||
27 | unsigned long count; | 27 | unsigned long count; |
28 | |||
29 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | ||
30 | |||
31 | struct { | ||
32 | struct dentry *dir; | ||
33 | |||
34 | struct dentry *probability_file; | ||
35 | struct dentry *interval_file; | ||
36 | struct dentry *times_file; | ||
37 | struct dentry *space_file; | ||
38 | struct dentry *verbose_file; | ||
39 | struct dentry *task_filter_file; | ||
40 | struct dentry *stacktrace_depth_file; | ||
41 | struct dentry *require_start_file; | ||
42 | struct dentry *require_end_file; | ||
43 | struct dentry *reject_start_file; | ||
44 | struct dentry *reject_end_file; | ||
45 | } dentries; | ||
46 | |||
47 | #endif | ||
48 | }; | 28 | }; |
49 | 29 | ||
50 | #define FAULT_ATTR_INITIALIZER { \ | 30 | #define FAULT_ATTR_INITIALIZER { \ |
@@ -57,24 +37,19 @@ struct fault_attr { | |||
57 | 37 | ||
58 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER | 38 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER |
59 | int setup_fault_attr(struct fault_attr *attr, char *str); | 39 | int setup_fault_attr(struct fault_attr *attr, char *str); |
60 | void should_fail_srandom(unsigned long entropy); | ||
61 | bool should_fail(struct fault_attr *attr, ssize_t size); | 40 | bool should_fail(struct fault_attr *attr, ssize_t size); |
62 | 41 | ||
63 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | 42 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS |
64 | 43 | ||
65 | int init_fault_attr_dentries(struct fault_attr *attr, const char *name); | 44 | struct dentry *fault_create_debugfs_attr(const char *name, |
66 | void cleanup_fault_attr_dentries(struct fault_attr *attr); | 45 | struct dentry *parent, struct fault_attr *attr); |
67 | 46 | ||
68 | #else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | 47 | #else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ |
69 | 48 | ||
70 | static inline int init_fault_attr_dentries(struct fault_attr *attr, | 49 | static inline struct dentry *fault_create_debugfs_attr(const char *name, |
71 | const char *name) | 50 | struct dentry *parent, struct fault_attr *attr) |
72 | { | ||
73 | return -ENODEV; | ||
74 | } | ||
75 | |||
76 | static inline void cleanup_fault_attr_dentries(struct fault_attr *attr) | ||
77 | { | 51 | { |
52 | return ERR_PTR(-ENODEV); | ||
78 | } | 53 | } |
79 | 54 | ||
80 | #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | 55 | #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 6a8274877171..1d6836c498dd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1043,7 +1043,8 @@ extern void fb_deferred_io_open(struct fb_info *info, | |||
1043 | struct inode *inode, | 1043 | struct inode *inode, |
1044 | struct file *file); | 1044 | struct file *file); |
1045 | extern void fb_deferred_io_cleanup(struct fb_info *info); | 1045 | extern void fb_deferred_io_cleanup(struct fb_info *info); |
1046 | extern int fb_deferred_io_fsync(struct file *file, int datasync); | 1046 | extern int fb_deferred_io_fsync(struct file *file, loff_t start, |
1047 | loff_t end, int datasync); | ||
1047 | 1048 | ||
1048 | static inline bool fb_be_math(struct fb_info *info) | 1049 | static inline bool fb_be_math(struct fb_info *info) |
1049 | { | 1050 | { |
diff --git a/include/linux/fd.h b/include/linux/fd.h index f5d194af07a8..72202b1b9a6a 100644 --- a/include/linux/fd.h +++ b/include/linux/fd.h | |||
@@ -377,4 +377,26 @@ struct floppy_raw_cmd { | |||
377 | #define FDEJECT _IO(2, 0x5a) | 377 | #define FDEJECT _IO(2, 0x5a) |
378 | /* eject the disk */ | 378 | /* eject the disk */ |
379 | 379 | ||
380 | |||
381 | #ifdef __KERNEL__ | ||
382 | #ifdef CONFIG_COMPAT | ||
383 | #include <linux/compat.h> | ||
384 | |||
385 | struct compat_floppy_struct { | ||
386 | compat_uint_t size; | ||
387 | compat_uint_t sect; | ||
388 | compat_uint_t head; | ||
389 | compat_uint_t track; | ||
390 | compat_uint_t stretch; | ||
391 | unsigned char gap; | ||
392 | unsigned char rate; | ||
393 | unsigned char spec1; | ||
394 | unsigned char fmt_gap; | ||
395 | const compat_caddr_t name; | ||
396 | }; | ||
397 | |||
398 | #define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct) | ||
399 | #endif | ||
400 | #endif | ||
401 | |||
380 | #endif | 402 | #endif |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 133c0ba25e30..82163c4b32c9 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
15 | 15 | ||
16 | #include <asm/atomic.h> | 16 | #include <linux/atomic.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * The default fd array needs to be at least BITS_PER_LONG, | 19 | * The default fd array needs to be at least BITS_PER_LONG, |
@@ -60,7 +60,6 @@ struct files_struct { | |||
60 | 60 | ||
61 | #define rcu_dereference_check_fdtable(files, fdtfd) \ | 61 | #define rcu_dereference_check_fdtable(files, fdtfd) \ |
62 | (rcu_dereference_check((fdtfd), \ | 62 | (rcu_dereference_check((fdtfd), \ |
63 | rcu_read_lock_held() || \ | ||
64 | lockdep_is_held(&(files)->file_lock) || \ | 63 | lockdep_is_held(&(files)->file_lock) || \ |
65 | atomic_read(&(files)->count) == 1 || \ | 64 | atomic_read(&(files)->count) == 1 || \ |
66 | rcu_my_thread_group_empty())) | 65 | rcu_my_thread_group_empty())) |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 9ee3f9fb0b4a..741956fa5bfd 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | #include <asm/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | /* | 15 | /* |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 4ff09889c5c0..357dbfc2829e 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -30,10 +30,13 @@ | |||
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/firewire-constants.h> | 31 | #include <linux/firewire-constants.h> |
32 | 32 | ||
33 | /* available since kernel version 2.6.22 */ | ||
33 | #define FW_CDEV_EVENT_BUS_RESET 0x00 | 34 | #define FW_CDEV_EVENT_BUS_RESET 0x00 |
34 | #define FW_CDEV_EVENT_RESPONSE 0x01 | 35 | #define FW_CDEV_EVENT_RESPONSE 0x01 |
35 | #define FW_CDEV_EVENT_REQUEST 0x02 | 36 | #define FW_CDEV_EVENT_REQUEST 0x02 |
36 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 | 37 | #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 |
38 | |||
39 | /* available since kernel version 2.6.30 */ | ||
37 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 | 40 | #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 |
38 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 | 41 | #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 |
39 | 42 | ||
@@ -120,24 +123,11 @@ struct fw_cdev_event_response { | |||
120 | 123 | ||
121 | /** | 124 | /** |
122 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 | 125 | * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 |
123 | * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl | ||
124 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST | 126 | * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST |
125 | * @tcode: See &fw_cdev_event_request2 | ||
126 | * @offset: See &fw_cdev_event_request2 | ||
127 | * @handle: See &fw_cdev_event_request2 | ||
128 | * @length: See &fw_cdev_event_request2 | ||
129 | * @data: See &fw_cdev_event_request2 | ||
130 | * | 127 | * |
131 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or | 128 | * This event is sent instead of &fw_cdev_event_request2 if the kernel or |
132 | * the client implements ABI version <= 3. | 129 | * the client implements ABI version <= 3. &fw_cdev_event_request lacks |
133 | * | 130 | * essential information; use &fw_cdev_event_request2 instead. |
134 | * Unlike &fw_cdev_event_request2, the sender identity cannot be established, | ||
135 | * broadcast write requests cannot be distinguished from unicast writes, and | ||
136 | * @tcode of lock requests is %TCODE_LOCK_REQUEST. | ||
137 | * | ||
138 | * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as | ||
139 | * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send | ||
140 | * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl. | ||
141 | */ | 131 | */ |
142 | struct fw_cdev_event_request { | 132 | struct fw_cdev_event_request { |
143 | __u64 closure; | 133 | __u64 closure; |
@@ -452,29 +442,31 @@ union fw_cdev_event { | |||
452 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and | 442 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and |
453 | * %FW_CDEV_IOC_SET_ISO_CHANNELS | 443 | * %FW_CDEV_IOC_SET_ISO_CHANNELS |
454 | */ | 444 | */ |
455 | #define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */ | ||
456 | 445 | ||
457 | /** | 446 | /** |
458 | * struct fw_cdev_get_info - General purpose information ioctl | 447 | * struct fw_cdev_get_info - General purpose information ioctl |
459 | * @version: The version field is just a running serial number. Both an | 448 | * @version: The version field is just a running serial number. Both an |
460 | * input parameter (ABI version implemented by the client) and | 449 | * input parameter (ABI version implemented by the client) and |
461 | * output parameter (ABI version implemented by the kernel). | 450 | * output parameter (ABI version implemented by the kernel). |
462 | * A client must not fill in an %FW_CDEV_VERSION defined from an | 451 | * A client shall fill in the ABI @version for which the client |
463 | * included kernel header file but the actual version for which | 452 | * was implemented. This is necessary for forward compatibility. |
464 | * the client was implemented. This is necessary for forward | 453 | * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration |
465 | * compatibility. We never break backwards compatibility, but | ||
466 | * may add more structs, events, and ioctls in later revisions. | ||
467 | * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration | ||
468 | * ROM will be copied into that user space address. In either | 454 | * ROM will be copied into that user space address. In either |
469 | * case, @rom_length is updated with the actual length of the | 455 | * case, @rom_length is updated with the actual length of the |
470 | * configuration ROM. | 456 | * Configuration ROM. |
471 | * @rom: If non-zero, address of a buffer to be filled by a copy of the | 457 | * @rom: If non-zero, address of a buffer to be filled by a copy of the |
472 | * device's configuration ROM | 458 | * device's Configuration ROM |
473 | * @bus_reset: If non-zero, address of a buffer to be filled by a | 459 | * @bus_reset: If non-zero, address of a buffer to be filled by a |
474 | * &struct fw_cdev_event_bus_reset with the current state | 460 | * &struct fw_cdev_event_bus_reset with the current state |
475 | * of the bus. This does not cause a bus reset to happen. | 461 | * of the bus. This does not cause a bus reset to happen. |
476 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events | 462 | * @bus_reset_closure: Value of &closure in this and subsequent bus reset events |
477 | * @card: The index of the card this device belongs to | 463 | * @card: The index of the card this device belongs to |
464 | * | ||
465 | * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client | ||
466 | * performs right after it opened a /dev/fw* file. | ||
467 | * | ||
468 | * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2) | ||
469 | * is started by this ioctl. | ||
478 | */ | 470 | */ |
479 | struct fw_cdev_get_info { | 471 | struct fw_cdev_get_info { |
480 | __u32 version; | 472 | __u32 version; |
@@ -612,7 +604,7 @@ struct fw_cdev_initiate_bus_reset { | |||
612 | * @handle: Handle to the descriptor, written by the kernel | 604 | * @handle: Handle to the descriptor, written by the kernel |
613 | * | 605 | * |
614 | * Add a descriptor block and optionally a preceding immediate key to the local | 606 | * Add a descriptor block and optionally a preceding immediate key to the local |
615 | * node's configuration ROM. | 607 | * node's Configuration ROM. |
616 | * | 608 | * |
617 | * The @key field specifies the upper 8 bits of the descriptor root directory | 609 | * The @key field specifies the upper 8 bits of the descriptor root directory |
618 | * pointer and the @data and @length fields specify the contents. The @key | 610 | * pointer and the @data and @length fields specify the contents. The @key |
@@ -627,9 +619,9 @@ struct fw_cdev_initiate_bus_reset { | |||
627 | * If successful, the kernel adds the descriptor and writes back a @handle to | 619 | * If successful, the kernel adds the descriptor and writes back a @handle to |
628 | * the kernel-side object to be used for later removal of the descriptor block | 620 | * the kernel-side object to be used for later removal of the descriptor block |
629 | * and immediate key. The kernel will also generate a bus reset to signal the | 621 | * and immediate key. The kernel will also generate a bus reset to signal the |
630 | * change of the configuration ROM to other nodes. | 622 | * change of the Configuration ROM to other nodes. |
631 | * | 623 | * |
632 | * This ioctl affects the configuration ROMs of all local nodes. | 624 | * This ioctl affects the Configuration ROMs of all local nodes. |
633 | * The ioctl only succeeds on device files which represent a local node. | 625 | * The ioctl only succeeds on device files which represent a local node. |
634 | */ | 626 | */ |
635 | struct fw_cdev_add_descriptor { | 627 | struct fw_cdev_add_descriptor { |
@@ -641,13 +633,13 @@ struct fw_cdev_add_descriptor { | |||
641 | }; | 633 | }; |
642 | 634 | ||
643 | /** | 635 | /** |
644 | * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM | 636 | * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM |
645 | * @handle: Handle to the descriptor, as returned by the kernel when the | 637 | * @handle: Handle to the descriptor, as returned by the kernel when the |
646 | * descriptor was added | 638 | * descriptor was added |
647 | * | 639 | * |
648 | * Remove a descriptor block and accompanying immediate key from the local | 640 | * Remove a descriptor block and accompanying immediate key from the local |
649 | * nodes' configuration ROMs. The kernel will also generate a bus reset to | 641 | * nodes' Configuration ROMs. The kernel will also generate a bus reset to |
650 | * signal the change of the configuration ROM to other nodes. | 642 | * signal the change of the Configuration ROM to other nodes. |
651 | */ | 643 | */ |
652 | struct fw_cdev_remove_descriptor { | 644 | struct fw_cdev_remove_descriptor { |
653 | __u32 handle; | 645 | __u32 handle; |
@@ -863,13 +855,8 @@ struct fw_cdev_stop_iso { | |||
863 | * @local_time: system time, in microseconds since the Epoch | 855 | * @local_time: system time, in microseconds since the Epoch |
864 | * @cycle_timer: Cycle Time register contents | 856 | * @cycle_timer: Cycle Time register contents |
865 | * | 857 | * |
866 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer | 858 | * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME |
867 | * and also the system clock (%CLOCK_REALTIME). This allows to express the | 859 | * and only with microseconds resolution. |
868 | * receive time of an isochronous packet as a system time. | ||
869 | * | ||
870 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and | ||
871 | * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register | ||
872 | * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394. | ||
873 | * | 860 | * |
874 | * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- | 861 | * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- |
875 | * monotonic) @cycle_timer values on certain controllers. | 862 | * monotonic) @cycle_timer values on certain controllers. |
@@ -886,10 +873,17 @@ struct fw_cdev_get_cycle_timer { | |||
886 | * @clk_id: input parameter, clock from which to get the system time | 873 | * @clk_id: input parameter, clock from which to get the system time |
887 | * @cycle_timer: Cycle Time register contents | 874 | * @cycle_timer: Cycle Time register contents |
888 | * | 875 | * |
889 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like | 876 | * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer |
890 | * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' | 877 | * and also the system clock. This allows to correlate reception time of |
891 | * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME | 878 | * isochronous packets with system time. |
892 | * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. | 879 | * |
880 | * @clk_id lets you choose a clock like with POSIX' clock_gettime function. | ||
881 | * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC | ||
882 | * and Linux' %CLOCK_MONOTONIC_RAW. | ||
883 | * | ||
884 | * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and | ||
885 | * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register | ||
886 | * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394. | ||
893 | */ | 887 | */ |
894 | struct fw_cdev_get_cycle_timer2 { | 888 | struct fw_cdev_get_cycle_timer2 { |
895 | __s64 tv_sec; | 889 | __s64 tv_sec; |
@@ -1011,4 +1005,6 @@ struct fw_cdev_receive_phy_packets { | |||
1011 | __u64 closure; | 1005 | __u64 closure; |
1012 | }; | 1006 | }; |
1013 | 1007 | ||
1008 | #define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */ | ||
1009 | |||
1014 | #endif /* _LINUX_FIREWIRE_CDEV_H */ | 1010 | #endif /* _LINUX_FIREWIRE_CDEV_H */ |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 5e6f42789afe..84ccf8e04fa6 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/workqueue.h> | 15 | #include <linux/workqueue.h> |
16 | 16 | ||
17 | #include <asm/atomic.h> | 17 | #include <linux/atomic.h> |
18 | #include <asm/byteorder.h> | 18 | #include <asm/byteorder.h> |
19 | 19 | ||
20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | 20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b5b979247863..178cdb4f1d4a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -32,7 +32,9 @@ | |||
32 | #define SEEK_SET 0 /* seek relative to beginning of file */ | 32 | #define SEEK_SET 0 /* seek relative to beginning of file */ |
33 | #define SEEK_CUR 1 /* seek relative to current file position */ | 33 | #define SEEK_CUR 1 /* seek relative to current file position */ |
34 | #define SEEK_END 2 /* seek relative to end of file */ | 34 | #define SEEK_END 2 /* seek relative to end of file */ |
35 | #define SEEK_MAX SEEK_END | 35 | #define SEEK_DATA 3 /* seek to the next data */ |
36 | #define SEEK_HOLE 4 /* seek to the next hole */ | ||
37 | #define SEEK_MAX SEEK_HOLE | ||
36 | 38 | ||
37 | struct fstrim_range { | 39 | struct fstrim_range { |
38 | __u64 start; | 40 | __u64 start; |
@@ -63,6 +65,7 @@ struct inodes_stat_t { | |||
63 | #define MAY_ACCESS 16 | 65 | #define MAY_ACCESS 16 |
64 | #define MAY_OPEN 32 | 66 | #define MAY_OPEN 32 |
65 | #define MAY_CHDIR 64 | 67 | #define MAY_CHDIR 64 |
68 | #define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */ | ||
66 | 69 | ||
67 | /* | 70 | /* |
68 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | 71 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond |
@@ -376,7 +379,6 @@ struct inodes_stat_t { | |||
376 | 379 | ||
377 | #include <linux/linkage.h> | 380 | #include <linux/linkage.h> |
378 | #include <linux/wait.h> | 381 | #include <linux/wait.h> |
379 | #include <linux/types.h> | ||
380 | #include <linux/kdev_t.h> | 382 | #include <linux/kdev_t.h> |
381 | #include <linux/dcache.h> | 383 | #include <linux/dcache.h> |
382 | #include <linux/path.h> | 384 | #include <linux/path.h> |
@@ -392,8 +394,9 @@ struct inodes_stat_t { | |||
392 | #include <linux/semaphore.h> | 394 | #include <linux/semaphore.h> |
393 | #include <linux/fiemap.h> | 395 | #include <linux/fiemap.h> |
394 | #include <linux/rculist_bl.h> | 396 | #include <linux/rculist_bl.h> |
397 | #include <linux/shrinker.h> | ||
398 | #include <linux/atomic.h> | ||
395 | 399 | ||
396 | #include <asm/atomic.h> | ||
397 | #include <asm/byteorder.h> | 400 | #include <asm/byteorder.h> |
398 | 401 | ||
399 | struct export_operations; | 402 | struct export_operations; |
@@ -735,22 +738,54 @@ static inline int mapping_writably_mapped(struct address_space *mapping) | |||
735 | struct posix_acl; | 738 | struct posix_acl; |
736 | #define ACL_NOT_CACHED ((void *)(-1)) | 739 | #define ACL_NOT_CACHED ((void *)(-1)) |
737 | 740 | ||
741 | #define IOP_FASTPERM 0x0001 | ||
742 | #define IOP_LOOKUP 0x0002 | ||
743 | #define IOP_NOFOLLOW 0x0004 | ||
744 | |||
745 | /* | ||
746 | * Keep mostly read-only and often accessed (especially for | ||
747 | * the RCU path lookup and 'stat' data) fields at the beginning | ||
748 | * of the 'struct inode' | ||
749 | */ | ||
738 | struct inode { | 750 | struct inode { |
739 | /* RCU path lookup touches following: */ | ||
740 | umode_t i_mode; | 751 | umode_t i_mode; |
752 | unsigned short i_opflags; | ||
741 | uid_t i_uid; | 753 | uid_t i_uid; |
742 | gid_t i_gid; | 754 | gid_t i_gid; |
755 | unsigned int i_flags; | ||
756 | |||
757 | #ifdef CONFIG_FS_POSIX_ACL | ||
758 | struct posix_acl *i_acl; | ||
759 | struct posix_acl *i_default_acl; | ||
760 | #endif | ||
761 | |||
743 | const struct inode_operations *i_op; | 762 | const struct inode_operations *i_op; |
744 | struct super_block *i_sb; | 763 | struct super_block *i_sb; |
764 | struct address_space *i_mapping; | ||
745 | 765 | ||
746 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
747 | unsigned int i_flags; | ||
748 | unsigned long i_state; | ||
749 | #ifdef CONFIG_SECURITY | 766 | #ifdef CONFIG_SECURITY |
750 | void *i_security; | 767 | void *i_security; |
751 | #endif | 768 | #endif |
752 | struct mutex i_mutex; | ||
753 | 769 | ||
770 | /* Stat data, not accessed from path walking */ | ||
771 | unsigned long i_ino; | ||
772 | unsigned int i_nlink; | ||
773 | dev_t i_rdev; | ||
774 | loff_t i_size; | ||
775 | struct timespec i_atime; | ||
776 | struct timespec i_mtime; | ||
777 | struct timespec i_ctime; | ||
778 | unsigned int i_blkbits; | ||
779 | blkcnt_t i_blocks; | ||
780 | |||
781 | #ifdef __NEED_I_SIZE_ORDERED | ||
782 | seqcount_t i_size_seqcount; | ||
783 | #endif | ||
784 | |||
785 | /* Misc */ | ||
786 | unsigned long i_state; | ||
787 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
788 | struct mutex i_mutex; | ||
754 | 789 | ||
755 | unsigned long dirtied_when; /* jiffies of first dirtying */ | 790 | unsigned long dirtied_when; /* jiffies of first dirtying */ |
756 | 791 | ||
@@ -762,25 +797,12 @@ struct inode { | |||
762 | struct list_head i_dentry; | 797 | struct list_head i_dentry; |
763 | struct rcu_head i_rcu; | 798 | struct rcu_head i_rcu; |
764 | }; | 799 | }; |
765 | unsigned long i_ino; | ||
766 | atomic_t i_count; | 800 | atomic_t i_count; |
767 | unsigned int i_nlink; | ||
768 | dev_t i_rdev; | ||
769 | unsigned int i_blkbits; | ||
770 | u64 i_version; | 801 | u64 i_version; |
771 | loff_t i_size; | ||
772 | #ifdef __NEED_I_SIZE_ORDERED | ||
773 | seqcount_t i_size_seqcount; | ||
774 | #endif | ||
775 | struct timespec i_atime; | ||
776 | struct timespec i_mtime; | ||
777 | struct timespec i_ctime; | ||
778 | blkcnt_t i_blocks; | ||
779 | unsigned short i_bytes; | 802 | unsigned short i_bytes; |
780 | struct rw_semaphore i_alloc_sem; | 803 | atomic_t i_dio_count; |
781 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 804 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
782 | struct file_lock *i_flock; | 805 | struct file_lock *i_flock; |
783 | struct address_space *i_mapping; | ||
784 | struct address_space i_data; | 806 | struct address_space i_data; |
785 | #ifdef CONFIG_QUOTA | 807 | #ifdef CONFIG_QUOTA |
786 | struct dquot *i_dquot[MAXQUOTAS]; | 808 | struct dquot *i_dquot[MAXQUOTAS]; |
@@ -803,10 +825,6 @@ struct inode { | |||
803 | atomic_t i_readcount; /* struct files open RO */ | 825 | atomic_t i_readcount; /* struct files open RO */ |
804 | #endif | 826 | #endif |
805 | atomic_t i_writecount; | 827 | atomic_t i_writecount; |
806 | #ifdef CONFIG_FS_POSIX_ACL | ||
807 | struct posix_acl *i_acl; | ||
808 | struct posix_acl *i_default_acl; | ||
809 | #endif | ||
810 | void *i_private; /* fs or device private pointer */ | 828 | void *i_private; /* fs or device private pointer */ |
811 | }; | 829 | }; |
812 | 830 | ||
@@ -1069,12 +1087,12 @@ struct file_lock_operations { | |||
1069 | }; | 1087 | }; |
1070 | 1088 | ||
1071 | struct lock_manager_operations { | 1089 | struct lock_manager_operations { |
1072 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 1090 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); |
1073 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 1091 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
1074 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1092 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
1075 | void (*fl_release_private)(struct file_lock *); | 1093 | void (*lm_release_private)(struct file_lock *); |
1076 | void (*fl_break)(struct file_lock *); | 1094 | void (*lm_break)(struct file_lock *); |
1077 | int (*fl_change)(struct file_lock **, int); | 1095 | int (*lm_change)(struct file_lock **, int); |
1078 | }; | 1096 | }; |
1079 | 1097 | ||
1080 | struct lock_manager { | 1098 | struct lock_manager { |
@@ -1396,6 +1414,11 @@ struct super_block { | |||
1396 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1414 | struct list_head s_dentry_lru; /* unused dentry lru */ |
1397 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1415 | int s_nr_dentry_unused; /* # of dentry on lru */ |
1398 | 1416 | ||
1417 | /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */ | ||
1418 | spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp; | ||
1419 | struct list_head s_inode_lru; /* unused inode lru */ | ||
1420 | int s_nr_inodes_unused; /* # of inodes on lru */ | ||
1421 | |||
1399 | struct block_device *s_bdev; | 1422 | struct block_device *s_bdev; |
1400 | struct backing_dev_info *s_bdi; | 1423 | struct backing_dev_info *s_bdi; |
1401 | struct mtd_info *s_mtd; | 1424 | struct mtd_info *s_mtd; |
@@ -1438,8 +1461,14 @@ struct super_block { | |||
1438 | * Saved pool identifier for cleancache (-1 means none) | 1461 | * Saved pool identifier for cleancache (-1 means none) |
1439 | */ | 1462 | */ |
1440 | int cleancache_poolid; | 1463 | int cleancache_poolid; |
1464 | |||
1465 | struct shrinker s_shrink; /* per-sb shrinker handle */ | ||
1441 | }; | 1466 | }; |
1442 | 1467 | ||
1468 | /* superblock cache pruning functions */ | ||
1469 | extern void prune_icache_sb(struct super_block *sb, int nr_to_scan); | ||
1470 | extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan); | ||
1471 | |||
1443 | extern struct timespec current_fs_time(struct super_block *sb); | 1472 | extern struct timespec current_fs_time(struct super_block *sb); |
1444 | 1473 | ||
1445 | /* | 1474 | /* |
@@ -1454,10 +1483,6 @@ enum { | |||
1454 | #define vfs_check_frozen(sb, level) \ | 1483 | #define vfs_check_frozen(sb, level) \ |
1455 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) | 1484 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) |
1456 | 1485 | ||
1457 | #define get_fs_excl() atomic_inc(¤t->fs_excl) | ||
1458 | #define put_fs_excl() atomic_dec(¤t->fs_excl) | ||
1459 | #define has_fs_excl() atomic_read(¤t->fs_excl) | ||
1460 | |||
1461 | /* | 1486 | /* |
1462 | * until VFS tracks user namespaces for inodes, just make all files | 1487 | * until VFS tracks user namespaces for inodes, just make all files |
1463 | * belong to init_user_ns | 1488 | * belong to init_user_ns |
@@ -1490,7 +1515,6 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1490 | /* | 1515 | /* |
1491 | * VFS file helper functions. | 1516 | * VFS file helper functions. |
1492 | */ | 1517 | */ |
1493 | extern int file_permission(struct file *, int); | ||
1494 | extern void inode_init_owner(struct inode *inode, const struct inode *dir, | 1518 | extern void inode_init_owner(struct inode *inode, const struct inode *dir, |
1495 | mode_t mode); | 1519 | mode_t mode); |
1496 | /* | 1520 | /* |
@@ -1538,11 +1562,6 @@ struct block_device_operations; | |||
1538 | #define HAVE_COMPAT_IOCTL 1 | 1562 | #define HAVE_COMPAT_IOCTL 1 |
1539 | #define HAVE_UNLOCKED_IOCTL 1 | 1563 | #define HAVE_UNLOCKED_IOCTL 1 |
1540 | 1564 | ||
1541 | /* | ||
1542 | * NOTE: | ||
1543 | * all file operations except setlease can be called without | ||
1544 | * the big kernel lock held in all filesystems. | ||
1545 | */ | ||
1546 | struct file_operations { | 1565 | struct file_operations { |
1547 | struct module *owner; | 1566 | struct module *owner; |
1548 | loff_t (*llseek) (struct file *, loff_t, int); | 1567 | loff_t (*llseek) (struct file *, loff_t, int); |
@@ -1558,7 +1577,7 @@ struct file_operations { | |||
1558 | int (*open) (struct inode *, struct file *); | 1577 | int (*open) (struct inode *, struct file *); |
1559 | int (*flush) (struct file *, fl_owner_t id); | 1578 | int (*flush) (struct file *, fl_owner_t id); |
1560 | int (*release) (struct inode *, struct file *); | 1579 | int (*release) (struct inode *, struct file *); |
1561 | int (*fsync) (struct file *, int datasync); | 1580 | int (*fsync) (struct file *, loff_t, loff_t, int datasync); |
1562 | int (*aio_fsync) (struct kiocb *, int datasync); | 1581 | int (*aio_fsync) (struct kiocb *, int datasync); |
1563 | int (*fasync) (int, struct file *, int); | 1582 | int (*fasync) (int, struct file *, int); |
1564 | int (*lock) (struct file *, int, struct file_lock *); | 1583 | int (*lock) (struct file *, int, struct file_lock *); |
@@ -1573,13 +1592,11 @@ struct file_operations { | |||
1573 | loff_t len); | 1592 | loff_t len); |
1574 | }; | 1593 | }; |
1575 | 1594 | ||
1576 | #define IPERM_FLAG_RCU 0x0001 | ||
1577 | |||
1578 | struct inode_operations { | 1595 | struct inode_operations { |
1579 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1596 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
1580 | void * (*follow_link) (struct dentry *, struct nameidata *); | 1597 | void * (*follow_link) (struct dentry *, struct nameidata *); |
1581 | int (*permission) (struct inode *, int, unsigned int); | 1598 | int (*permission) (struct inode *, int); |
1582 | int (*check_acl)(struct inode *, int, unsigned int); | 1599 | struct posix_acl * (*get_acl)(struct inode *, int); |
1583 | 1600 | ||
1584 | int (*readlink) (struct dentry *, char __user *,int); | 1601 | int (*readlink) (struct dentry *, char __user *,int); |
1585 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1602 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
@@ -1645,6 +1662,8 @@ struct super_operations { | |||
1645 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1662 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
1646 | #endif | 1663 | #endif |
1647 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 1664 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
1665 | int (*nr_cached_objects)(struct super_block *); | ||
1666 | void (*free_cached_objects)(struct super_block *, int); | ||
1648 | }; | 1667 | }; |
1649 | 1668 | ||
1650 | /* | 1669 | /* |
@@ -1693,6 +1712,10 @@ struct super_operations { | |||
1693 | * set during data writeback, and cleared with a wakeup | 1712 | * set during data writeback, and cleared with a wakeup |
1694 | * on the bit address once it is done. | 1713 | * on the bit address once it is done. |
1695 | * | 1714 | * |
1715 | * I_REFERENCED Marks the inode as recently references on the LRU list. | ||
1716 | * | ||
1717 | * I_DIO_WAKEUP Never set. Only used as a key for wait_on_bit(). | ||
1718 | * | ||
1696 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1719 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1697 | */ | 1720 | */ |
1698 | #define I_DIRTY_SYNC (1 << 0) | 1721 | #define I_DIRTY_SYNC (1 << 0) |
@@ -1706,6 +1729,8 @@ struct super_operations { | |||
1706 | #define __I_SYNC 7 | 1729 | #define __I_SYNC 7 |
1707 | #define I_SYNC (1 << __I_SYNC) | 1730 | #define I_SYNC (1 << __I_SYNC) |
1708 | #define I_REFERENCED (1 << 8) | 1731 | #define I_REFERENCED (1 << 8) |
1732 | #define __I_DIO_WAKEUP 9 | ||
1733 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) | ||
1709 | 1734 | ||
1710 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1735 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1711 | 1736 | ||
@@ -1816,7 +1841,6 @@ struct file_system_type { | |||
1816 | struct lock_class_key i_lock_key; | 1841 | struct lock_class_key i_lock_key; |
1817 | struct lock_class_key i_mutex_key; | 1842 | struct lock_class_key i_mutex_key; |
1818 | struct lock_class_key i_mutex_dir_key; | 1843 | struct lock_class_key i_mutex_dir_key; |
1819 | struct lock_class_key i_alloc_sem_key; | ||
1820 | }; | 1844 | }; |
1821 | 1845 | ||
1822 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, | 1846 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, |
@@ -1837,6 +1861,8 @@ void kill_litter_super(struct super_block *sb); | |||
1837 | void deactivate_super(struct super_block *sb); | 1861 | void deactivate_super(struct super_block *sb); |
1838 | void deactivate_locked_super(struct super_block *sb); | 1862 | void deactivate_locked_super(struct super_block *sb); |
1839 | int set_anon_super(struct super_block *s, void *data); | 1863 | int set_anon_super(struct super_block *s, void *data); |
1864 | int get_anon_bdev(dev_t *); | ||
1865 | void free_anon_bdev(dev_t); | ||
1840 | struct super_block *sget(struct file_system_type *type, | 1866 | struct super_block *sget(struct file_system_type *type, |
1841 | int (*test)(struct super_block *,void *), | 1867 | int (*test)(struct super_block *,void *), |
1842 | int (*set)(struct super_block *,void *), | 1868 | int (*set)(struct super_block *,void *), |
@@ -1869,6 +1895,7 @@ extern int register_filesystem(struct file_system_type *); | |||
1869 | extern int unregister_filesystem(struct file_system_type *); | 1895 | extern int unregister_filesystem(struct file_system_type *); |
1870 | extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); | 1896 | extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); |
1871 | #define kern_mount(type) kern_mount_data(type, NULL) | 1897 | #define kern_mount(type) kern_mount_data(type, NULL) |
1898 | extern void kern_unmount(struct vfsmount *mnt); | ||
1872 | extern int may_umount_tree(struct vfsmount *); | 1899 | extern int may_umount_tree(struct vfsmount *); |
1873 | extern int may_umount(struct vfsmount *); | 1900 | extern int may_umount(struct vfsmount *); |
1874 | extern long do_mount(char *, char *, char *, unsigned long, void *); | 1901 | extern long do_mount(char *, char *, char *, unsigned long, void *); |
@@ -2188,16 +2215,38 @@ extern sector_t bmap(struct inode *, sector_t); | |||
2188 | #endif | 2215 | #endif |
2189 | extern int notify_change(struct dentry *, struct iattr *); | 2216 | extern int notify_change(struct dentry *, struct iattr *); |
2190 | extern int inode_permission(struct inode *, int); | 2217 | extern int inode_permission(struct inode *, int); |
2191 | extern int generic_permission(struct inode *, int, unsigned int, | 2218 | extern int generic_permission(struct inode *, int); |
2192 | int (*check_acl)(struct inode *, int, unsigned int)); | ||
2193 | 2219 | ||
2194 | static inline bool execute_ok(struct inode *inode) | 2220 | static inline bool execute_ok(struct inode *inode) |
2195 | { | 2221 | { |
2196 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); | 2222 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
2197 | } | 2223 | } |
2198 | 2224 | ||
2199 | extern int get_write_access(struct inode *); | 2225 | /* |
2200 | extern int deny_write_access(struct file *); | 2226 | * get_write_access() gets write permission for a file. |
2227 | * put_write_access() releases this write permission. | ||
2228 | * This is used for regular files. | ||
2229 | * We cannot support write (and maybe mmap read-write shared) accesses and | ||
2230 | * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode | ||
2231 | * can have the following values: | ||
2232 | * 0: no writers, no VM_DENYWRITE mappings | ||
2233 | * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist | ||
2234 | * > 0: (i_writecount) users are writing to the file. | ||
2235 | * | ||
2236 | * Normally we operate on that counter with atomic_{inc,dec} and it's safe | ||
2237 | * except for the cases where we don't hold i_writecount yet. Then we need to | ||
2238 | * use {get,deny}_write_access() - these functions check the sign and refuse | ||
2239 | * to do the change if sign is wrong. | ||
2240 | */ | ||
2241 | static inline int get_write_access(struct inode *inode) | ||
2242 | { | ||
2243 | return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY; | ||
2244 | } | ||
2245 | static inline int deny_write_access(struct file *file) | ||
2246 | { | ||
2247 | struct inode *inode = file->f_path.dentry->d_inode; | ||
2248 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; | ||
2249 | } | ||
2201 | static inline void put_write_access(struct inode * inode) | 2250 | static inline void put_write_access(struct inode * inode) |
2202 | { | 2251 | { |
2203 | atomic_dec(&inode->i_writecount); | 2252 | atomic_dec(&inode->i_writecount); |
@@ -2276,17 +2325,25 @@ extern void __iget(struct inode * inode); | |||
2276 | extern void iget_failed(struct inode *); | 2325 | extern void iget_failed(struct inode *); |
2277 | extern void end_writeback(struct inode *); | 2326 | extern void end_writeback(struct inode *); |
2278 | extern void __destroy_inode(struct inode *); | 2327 | extern void __destroy_inode(struct inode *); |
2279 | extern struct inode *new_inode(struct super_block *); | 2328 | extern struct inode *new_inode_pseudo(struct super_block *sb); |
2329 | extern struct inode *new_inode(struct super_block *sb); | ||
2280 | extern void free_inode_nonrcu(struct inode *inode); | 2330 | extern void free_inode_nonrcu(struct inode *inode); |
2281 | extern int should_remove_suid(struct dentry *); | 2331 | extern int should_remove_suid(struct dentry *); |
2282 | extern int file_remove_suid(struct file *); | 2332 | extern int file_remove_suid(struct file *); |
2283 | 2333 | ||
2284 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 2334 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
2285 | extern void remove_inode_hash(struct inode *); | ||
2286 | static inline void insert_inode_hash(struct inode *inode) | 2335 | static inline void insert_inode_hash(struct inode *inode) |
2287 | { | 2336 | { |
2288 | __insert_inode_hash(inode, inode->i_ino); | 2337 | __insert_inode_hash(inode, inode->i_ino); |
2289 | } | 2338 | } |
2339 | |||
2340 | extern void __remove_inode_hash(struct inode *); | ||
2341 | static inline void remove_inode_hash(struct inode *inode) | ||
2342 | { | ||
2343 | if (!inode_unhashed(inode)) | ||
2344 | __remove_inode_hash(inode); | ||
2345 | } | ||
2346 | |||
2290 | extern void inode_sb_list_add(struct inode *inode); | 2347 | extern void inode_sb_list_add(struct inode *inode); |
2291 | 2348 | ||
2292 | #ifdef CONFIG_BLOCK | 2349 | #ifdef CONFIG_BLOCK |
@@ -2317,7 +2374,8 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
2317 | /* fs/block_dev.c */ | 2374 | /* fs/block_dev.c */ |
2318 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2375 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
2319 | unsigned long nr_segs, loff_t pos); | 2376 | unsigned long nr_segs, loff_t pos); |
2320 | extern int blkdev_fsync(struct file *filp, int datasync); | 2377 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
2378 | int datasync); | ||
2321 | 2379 | ||
2322 | /* fs/splice.c */ | 2380 | /* fs/splice.c */ |
2323 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2381 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
@@ -2368,6 +2426,8 @@ enum { | |||
2368 | }; | 2426 | }; |
2369 | 2427 | ||
2370 | void dio_end_io(struct bio *bio, int error); | 2428 | void dio_end_io(struct bio *bio, int error); |
2429 | void inode_dio_wait(struct inode *inode); | ||
2430 | void inode_dio_done(struct inode *inode); | ||
2371 | 2431 | ||
2372 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 2432 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
2373 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 2433 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
@@ -2375,14 +2435,17 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | |||
2375 | dio_submit_t submit_io, int flags); | 2435 | dio_submit_t submit_io, int flags); |
2376 | 2436 | ||
2377 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2437 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
2378 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 2438 | struct inode *inode, const struct iovec *iov, loff_t offset, |
2379 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | 2439 | unsigned long nr_segs, get_block_t get_block) |
2380 | dio_iodone_t end_io) | ||
2381 | { | 2440 | { |
2382 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 2441 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, |
2383 | nr_segs, get_block, end_io, NULL, | 2442 | offset, nr_segs, get_block, NULL, NULL, |
2384 | DIO_LOCKING | DIO_SKIP_HOLES); | 2443 | DIO_LOCKING | DIO_SKIP_HOLES); |
2385 | } | 2444 | } |
2445 | #else | ||
2446 | static inline void inode_dio_wait(struct inode *inode) | ||
2447 | { | ||
2448 | } | ||
2386 | #endif | 2449 | #endif |
2387 | 2450 | ||
2388 | extern const struct file_operations generic_ro_fops; | 2451 | extern const struct file_operations generic_ro_fops; |
@@ -2432,6 +2495,8 @@ extern struct super_block *get_active_super(struct block_device *bdev); | |||
2432 | extern struct super_block *user_get_super(dev_t); | 2495 | extern struct super_block *user_get_super(dev_t); |
2433 | extern void drop_super(struct super_block *sb); | 2496 | extern void drop_super(struct super_block *sb); |
2434 | extern void iterate_supers(void (*)(struct super_block *, void *), void *); | 2497 | extern void iterate_supers(void (*)(struct super_block *, void *), void *); |
2498 | extern void iterate_supers_type(struct file_system_type *, | ||
2499 | void (*)(struct super_block *, void *), void *); | ||
2435 | 2500 | ||
2436 | extern int dcache_dir_open(struct inode *, struct file *); | 2501 | extern int dcache_dir_open(struct inode *, struct file *); |
2437 | extern int dcache_dir_close(struct inode *, struct file *); | 2502 | extern int dcache_dir_close(struct inode *, struct file *); |
@@ -2444,7 +2509,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *); | |||
2444 | extern int simple_unlink(struct inode *, struct dentry *); | 2509 | extern int simple_unlink(struct inode *, struct dentry *); |
2445 | extern int simple_rmdir(struct inode *, struct dentry *); | 2510 | extern int simple_rmdir(struct inode *, struct dentry *); |
2446 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 2511 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); |
2447 | extern int noop_fsync(struct file *, int); | 2512 | extern int noop_fsync(struct file *, loff_t, loff_t, int); |
2448 | extern int simple_empty(struct dentry *); | 2513 | extern int simple_empty(struct dentry *); |
2449 | extern int simple_readpage(struct file *file, struct page *page); | 2514 | extern int simple_readpage(struct file *file, struct page *page); |
2450 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | 2515 | extern int simple_write_begin(struct file *file, struct address_space *mapping, |
@@ -2469,7 +2534,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count, | |||
2469 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, | 2534 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, |
2470 | const void __user *from, size_t count); | 2535 | const void __user *from, size_t count); |
2471 | 2536 | ||
2472 | extern int generic_file_fsync(struct file *, int); | 2537 | extern int generic_file_fsync(struct file *, loff_t, loff_t, int); |
2473 | 2538 | ||
2474 | extern int generic_check_addressable(unsigned, u64); | 2539 | extern int generic_check_addressable(unsigned, u64); |
2475 | 2540 | ||
diff --git a/include/linux/fsl_hypervisor.h b/include/linux/fsl_hypervisor.h new file mode 100644 index 000000000000..1cebaeeeef57 --- /dev/null +++ b/include/linux/fsl_hypervisor.h | |||
@@ -0,0 +1,241 @@ | |||
1 | /* | ||
2 | * Freescale hypervisor ioctl and kernel interface | ||
3 | * | ||
4 | * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. | ||
5 | * Author: Timur Tabi <timur@freescale.com> | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions are met: | ||
9 | * * Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * * Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * * Neither the name of Freescale Semiconductor nor the | ||
15 | * names of its contributors may be used to endorse or promote products | ||
16 | * derived from this software without specific prior written permission. | ||
17 | * | ||
18 | * | ||
19 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
20 | * GNU General Public License ("GPL") as published by the Free Software | ||
21 | * Foundation, either version 2 of that License or (at your option) any | ||
22 | * later version. | ||
23 | * | ||
24 | * This software is provided by Freescale Semiconductor "as is" and any | ||
25 | * express or implied warranties, including, but not limited to, the implied | ||
26 | * warranties of merchantability and fitness for a particular purpose are | ||
27 | * disclaimed. In no event shall Freescale Semiconductor be liable for any | ||
28 | * direct, indirect, incidental, special, exemplary, or consequential damages | ||
29 | * (including, but not limited to, procurement of substitute goods or services; | ||
30 | * loss of use, data, or profits; or business interruption) however caused and | ||
31 | * on any theory of liability, whether in contract, strict liability, or tort | ||
32 | * (including negligence or otherwise) arising in any way out of the use of this | ||
33 | * software, even if advised of the possibility of such damage. | ||
34 | * | ||
35 | * This file is used by the Freescale hypervisor management driver. It can | ||
36 | * also be included by applications that need to communicate with the driver | ||
37 | * via the ioctl interface. | ||
38 | */ | ||
39 | |||
40 | #ifndef FSL_HYPERVISOR_H | ||
41 | #define FSL_HYPERVISOR_H | ||
42 | |||
43 | #include <linux/types.h> | ||
44 | |||
45 | /** | ||
46 | * struct fsl_hv_ioctl_restart - restart a partition | ||
47 | * @ret: return error code from the hypervisor | ||
48 | * @partition: the ID of the partition to restart, or -1 for the | ||
49 | * calling partition | ||
50 | * | ||
51 | * Used by FSL_HV_IOCTL_PARTITION_RESTART | ||
52 | */ | ||
53 | struct fsl_hv_ioctl_restart { | ||
54 | __u32 ret; | ||
55 | __u32 partition; | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * struct fsl_hv_ioctl_status - get a partition's status | ||
60 | * @ret: return error code from the hypervisor | ||
61 | * @partition: the ID of the partition to query, or -1 for the | ||
62 | * calling partition | ||
63 | * @status: The returned status of the partition | ||
64 | * | ||
65 | * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS | ||
66 | * | ||
67 | * Values of 'status': | ||
68 | * 0 = Stopped | ||
69 | * 1 = Running | ||
70 | * 2 = Starting | ||
71 | * 3 = Stopping | ||
72 | */ | ||
73 | struct fsl_hv_ioctl_status { | ||
74 | __u32 ret; | ||
75 | __u32 partition; | ||
76 | __u32 status; | ||
77 | }; | ||
78 | |||
79 | /** | ||
80 | * struct fsl_hv_ioctl_start - start a partition | ||
81 | * @ret: return error code from the hypervisor | ||
82 | * @partition: the ID of the partition to control | ||
83 | * @entry_point: The offset within the guest IMA to start execution | ||
84 | * @load: If non-zero, reload the partition's images before starting | ||
85 | * | ||
86 | * Used by FSL_HV_IOCTL_PARTITION_START | ||
87 | */ | ||
88 | struct fsl_hv_ioctl_start { | ||
89 | __u32 ret; | ||
90 | __u32 partition; | ||
91 | __u32 entry_point; | ||
92 | __u32 load; | ||
93 | }; | ||
94 | |||
95 | /** | ||
96 | * struct fsl_hv_ioctl_stop - stop a partition | ||
97 | * @ret: return error code from the hypervisor | ||
98 | * @partition: the ID of the partition to stop, or -1 for the calling | ||
99 | * partition | ||
100 | * | ||
101 | * Used by FSL_HV_IOCTL_PARTITION_STOP | ||
102 | */ | ||
103 | struct fsl_hv_ioctl_stop { | ||
104 | __u32 ret; | ||
105 | __u32 partition; | ||
106 | }; | ||
107 | |||
108 | /** | ||
109 | * struct fsl_hv_ioctl_memcpy - copy memory between partitions | ||
110 | * @ret: return error code from the hypervisor | ||
111 | * @source: the partition ID of the source partition, or -1 for this | ||
112 | * partition | ||
113 | * @target: the partition ID of the target partition, or -1 for this | ||
114 | * partition | ||
115 | * @reserved: reserved, must be set to 0 | ||
116 | * @local_addr: user-space virtual address of a buffer in the local | ||
117 | * partition | ||
118 | * @remote_addr: guest physical address of a buffer in the | ||
119 | * remote partition | ||
120 | * @count: the number of bytes to copy. Both the local and remote | ||
121 | * buffers must be at least 'count' bytes long | ||
122 | * | ||
123 | * Used by FSL_HV_IOCTL_MEMCPY | ||
124 | * | ||
125 | * The 'local' partition is the partition that calls this ioctl. The | ||
126 | * 'remote' partition is a different partition. The data is copied from | ||
127 | * the 'source' paritition' to the 'target' partition. | ||
128 | * | ||
129 | * The buffer in the remote partition must be guest physically | ||
130 | * contiguous. | ||
131 | * | ||
132 | * This ioctl does not support copying memory between two remote | ||
133 | * partitions or within the same partition, so either 'source' or | ||
134 | * 'target' (but not both) must be -1. In other words, either | ||
135 | * | ||
136 | * source == local and target == remote | ||
137 | * or | ||
138 | * source == remote and target == local | ||
139 | */ | ||
140 | struct fsl_hv_ioctl_memcpy { | ||
141 | __u32 ret; | ||
142 | __u32 source; | ||
143 | __u32 target; | ||
144 | __u32 reserved; /* padding to ensure local_vaddr is aligned */ | ||
145 | __u64 local_vaddr; | ||
146 | __u64 remote_paddr; | ||
147 | __u64 count; | ||
148 | }; | ||
149 | |||
150 | /** | ||
151 | * struct fsl_hv_ioctl_doorbell - ring a doorbell | ||
152 | * @ret: return error code from the hypervisor | ||
153 | * @doorbell: the handle of the doorbell to ring doorbell | ||
154 | * | ||
155 | * Used by FSL_HV_IOCTL_DOORBELL | ||
156 | */ | ||
157 | struct fsl_hv_ioctl_doorbell { | ||
158 | __u32 ret; | ||
159 | __u32 doorbell; | ||
160 | }; | ||
161 | |||
162 | /** | ||
163 | * struct fsl_hv_ioctl_prop - get/set a device tree property | ||
164 | * @ret: return error code from the hypervisor | ||
165 | * @handle: handle of partition whose tree to access | ||
166 | * @path: virtual address of path name of node to access | ||
167 | * @propname: virtual address of name of property to access | ||
168 | * @propval: virtual address of property data buffer | ||
169 | * @proplen: Size of property data buffer | ||
170 | * @reserved: reserved, must be set to 0 | ||
171 | * | ||
172 | * Used by FSL_HV_IOCTL_DOORBELL | ||
173 | */ | ||
174 | struct fsl_hv_ioctl_prop { | ||
175 | __u32 ret; | ||
176 | __u32 handle; | ||
177 | __u64 path; | ||
178 | __u64 propname; | ||
179 | __u64 propval; | ||
180 | __u32 proplen; | ||
181 | __u32 reserved; /* padding to ensure structure is aligned */ | ||
182 | }; | ||
183 | |||
184 | /* The ioctl type, documented in ioctl-number.txt */ | ||
185 | #define FSL_HV_IOCTL_TYPE 0xAF | ||
186 | |||
187 | /* Restart another partition */ | ||
188 | #define FSL_HV_IOCTL_PARTITION_RESTART \ | ||
189 | _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart) | ||
190 | |||
191 | /* Get a partition's status */ | ||
192 | #define FSL_HV_IOCTL_PARTITION_GET_STATUS \ | ||
193 | _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status) | ||
194 | |||
195 | /* Boot another partition */ | ||
196 | #define FSL_HV_IOCTL_PARTITION_START \ | ||
197 | _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start) | ||
198 | |||
199 | /* Stop this or another partition */ | ||
200 | #define FSL_HV_IOCTL_PARTITION_STOP \ | ||
201 | _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop) | ||
202 | |||
203 | /* Copy data from one partition to another */ | ||
204 | #define FSL_HV_IOCTL_MEMCPY \ | ||
205 | _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy) | ||
206 | |||
207 | /* Ring a doorbell */ | ||
208 | #define FSL_HV_IOCTL_DOORBELL \ | ||
209 | _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell) | ||
210 | |||
211 | /* Get a property from another guest's device tree */ | ||
212 | #define FSL_HV_IOCTL_GETPROP \ | ||
213 | _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop) | ||
214 | |||
215 | /* Set a property in another guest's device tree */ | ||
216 | #define FSL_HV_IOCTL_SETPROP \ | ||
217 | _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop) | ||
218 | |||
219 | #ifdef __KERNEL__ | ||
220 | |||
221 | /** | ||
222 | * fsl_hv_event_register() - register a callback for failover events | ||
223 | * @nb: pointer to caller-supplied notifier_block structure | ||
224 | * | ||
225 | * This function is called by device drivers to register their callback | ||
226 | * functions for fail-over events. | ||
227 | * | ||
228 | * The caller should allocate a notifier_block object and initialize the | ||
229 | * 'priority' and 'notifier_call' fields. | ||
230 | */ | ||
231 | int fsl_hv_failover_register(struct notifier_block *nb); | ||
232 | |||
233 | /** | ||
234 | * fsl_hv_event_unregister() - unregister a callback for failover events | ||
235 | * @nb: the same 'nb' used in previous fsl_hv_failover_register call | ||
236 | */ | ||
237 | int fsl_hv_failover_unregister(struct notifier_block *nb); | ||
238 | |||
239 | #endif | ||
240 | |||
241 | #endif | ||
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 69ad89b50489..91d0e0a34ef3 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily | 22 | * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 9d88e1cb5dbb..f0c0e8a47ae6 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | #include <asm/ftrace.h> | 20 | #include <asm/ftrace.h> |
21 | 21 | ||
22 | struct ftrace_hash; | ||
23 | |||
22 | #ifdef CONFIG_FUNCTION_TRACER | 24 | #ifdef CONFIG_FUNCTION_TRACER |
23 | 25 | ||
24 | extern int ftrace_enabled; | 26 | extern int ftrace_enabled; |
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, | |||
29 | 31 | ||
30 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 32 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); |
31 | 33 | ||
32 | struct ftrace_hash; | ||
33 | |||
34 | enum { | 34 | enum { |
35 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 35 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
36 | FTRACE_OPS_FL_GLOBAL = 1 << 1, | 36 | FTRACE_OPS_FL_GLOBAL = 1 << 1, |
@@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write, | |||
123 | struct ftrace_func_command { | 123 | struct ftrace_func_command { |
124 | struct list_head list; | 124 | struct list_head list; |
125 | char *name; | 125 | char *name; |
126 | int (*func)(char *func, char *cmd, | 126 | int (*func)(struct ftrace_hash *hash, |
127 | char *func, char *cmd, | ||
127 | char *params, int enable); | 128 | char *params, int enable); |
128 | }; | 129 | }; |
129 | 130 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 59d3ef100eb9..96efa6794ea5 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -76,6 +76,7 @@ struct trace_iterator { | |||
76 | struct trace_entry *ent; | 76 | struct trace_entry *ent; |
77 | unsigned long lost_events; | 77 | unsigned long lost_events; |
78 | int leftover; | 78 | int leftover; |
79 | int ent_size; | ||
79 | int cpu; | 80 | int cpu; |
80 | u64 ts; | 81 | u64 ts; |
81 | 82 | ||
@@ -129,6 +130,10 @@ void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, | |||
129 | void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, | 130 | void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, |
130 | struct ring_buffer_event *event, | 131 | struct ring_buffer_event *event, |
131 | unsigned long flags, int pc); | 132 | unsigned long flags, int pc); |
133 | void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer, | ||
134 | struct ring_buffer_event *event, | ||
135 | unsigned long flags, int pc, | ||
136 | struct pt_regs *regs); | ||
132 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, | 137 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, |
133 | struct ring_buffer_event *event); | 138 | struct ring_buffer_event *event); |
134 | 139 | ||
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 5bbebda78b02..5e98eeb2af3b 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -1,8 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | * Basic general purpose allocator for managing special purpose memory | 2 | * Basic general purpose allocator for managing special purpose |
3 | * not managed by the regular kmalloc/kfree interface. | 3 | * memory, for example, memory that is not managed by the regular |
4 | * Uses for this includes on-device special memory, uncached memory | 4 | * kmalloc/kfree interface. Uses for this includes on-device special |
5 | * etc. | 5 | * memory, uncached memory etc. |
6 | * | ||
7 | * It is safe to use the allocator in NMI handlers and other special | ||
8 | * unblockable contexts that could otherwise deadlock on locks. This | ||
9 | * is implemented by using atomic operations and retries on any | ||
10 | * conflicts. The disadvantage is that there may be livelocks in | ||
11 | * extreme cases. For better scalability, one allocator can be used | ||
12 | * for each CPU. | ||
13 | * | ||
14 | * The lockless operation only works if there is enough memory | ||
15 | * available. If new memory is added to the pool a lock has to be | ||
16 | * still taken. So any user relying on locklessness has to ensure | ||
17 | * that sufficient memory is preallocated. | ||
18 | * | ||
19 | * The basic atomic operation of this allocator is cmpxchg on long. | ||
20 | * On architectures that don't have NMI-safe cmpxchg implementation, | ||
21 | * the allocator can NOT be used in NMI handler. So code uses the | ||
22 | * allocator in NMI handler should depend on | ||
23 | * CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. | ||
6 | * | 24 | * |
7 | * This source code is licensed under the GNU General Public License, | 25 | * This source code is licensed under the GNU General Public License, |
8 | * Version 2. See the file COPYING for more details. | 26 | * Version 2. See the file COPYING for more details. |
@@ -15,7 +33,7 @@ | |||
15 | * General purpose special memory pool descriptor. | 33 | * General purpose special memory pool descriptor. |
16 | */ | 34 | */ |
17 | struct gen_pool { | 35 | struct gen_pool { |
18 | rwlock_t lock; | 36 | spinlock_t lock; |
19 | struct list_head chunks; /* list of chunks in this pool */ | 37 | struct list_head chunks; /* list of chunks in this pool */ |
20 | int min_alloc_order; /* minimum allocation order */ | 38 | int min_alloc_order; /* minimum allocation order */ |
21 | }; | 39 | }; |
@@ -24,8 +42,8 @@ struct gen_pool { | |||
24 | * General purpose special memory pool chunk descriptor. | 42 | * General purpose special memory pool chunk descriptor. |
25 | */ | 43 | */ |
26 | struct gen_pool_chunk { | 44 | struct gen_pool_chunk { |
27 | spinlock_t lock; | ||
28 | struct list_head next_chunk; /* next chunk in pool */ | 45 | struct list_head next_chunk; /* next chunk in pool */ |
46 | atomic_t avail; | ||
29 | phys_addr_t phys_addr; /* physical starting address of memory chunk */ | 47 | phys_addr_t phys_addr; /* physical starting address of memory chunk */ |
30 | unsigned long start_addr; /* starting address of memory chunk */ | 48 | unsigned long start_addr; /* starting address of memory chunk */ |
31 | unsigned long end_addr; /* ending address of memory chunk */ | 49 | unsigned long end_addr; /* ending address of memory chunk */ |
@@ -56,4 +74,8 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr, | |||
56 | extern void gen_pool_destroy(struct gen_pool *); | 74 | extern void gen_pool_destroy(struct gen_pool *); |
57 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 75 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
58 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 76 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
77 | extern void gen_pool_for_each_chunk(struct gen_pool *, | ||
78 | void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *); | ||
79 | extern size_t gen_pool_avail(struct gen_pool *); | ||
80 | extern size_t gen_pool_size(struct gen_pool *); | ||
59 | #endif /* __GENALLOC_H__ */ | 81 | #endif /* __GENALLOC_H__ */ |
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h index 0437e377b555..b6d657544ef1 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
@@ -10,6 +10,5 @@ extern const struct xattr_handler generic_acl_default_handler; | |||
10 | 10 | ||
11 | int generic_acl_init(struct inode *, struct inode *); | 11 | int generic_acl_init(struct inode *, struct inode *); |
12 | int generic_acl_chmod(struct inode *); | 12 | int generic_acl_chmod(struct inode *); |
13 | int generic_check_acl(struct inode *inode, int mask, unsigned int flags); | ||
14 | 13 | ||
15 | #endif /* LINUX_GENERIC_ACL_H */ | 14 | #endif /* LINUX_GENERIC_ACL_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 300d7582006e..02fa4697a0e5 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -420,7 +420,7 @@ static inline int get_disk_ro(struct gendisk *disk) | |||
420 | 420 | ||
421 | extern void disk_block_events(struct gendisk *disk); | 421 | extern void disk_block_events(struct gendisk *disk); |
422 | extern void disk_unblock_events(struct gendisk *disk); | 422 | extern void disk_unblock_events(struct gendisk *disk); |
423 | extern void disk_check_events(struct gendisk *disk); | 423 | extern void disk_flush_events(struct gendisk *disk, unsigned int mask); |
424 | extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); | 424 | extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); |
425 | 425 | ||
426 | /* drivers/char/random.c */ | 426 | /* drivers/char/random.c */ |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index cb4089254f01..3a76faf6a3ee 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -92,7 +92,7 @@ struct vm_area_struct; | |||
92 | */ | 92 | */ |
93 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) | 93 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) |
94 | 94 | ||
95 | #define __GFP_BITS_SHIFT 23 /* Room for 23 __GFP_FOO bits */ | 95 | #define __GFP_BITS_SHIFT 24 /* Room for N __GFP_FOO bits */ |
96 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 96 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
97 | 97 | ||
98 | /* This equals 0, but use constants in case they ever change */ | 98 | /* This equals 0, but use constants in case they ever change */ |
diff --git a/include/linux/gsmmux.h b/include/linux/gsmmux.h index 378de4195caf..c25e9477f7c3 100644 --- a/include/linux/gsmmux.h +++ b/include/linux/gsmmux.h | |||
@@ -21,5 +21,16 @@ struct gsm_config | |||
21 | #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config) | 21 | #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config) |
22 | #define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config) | 22 | #define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config) |
23 | 23 | ||
24 | struct gsm_netconfig { | ||
25 | unsigned int adaption; /* Adaption to use in network mode */ | ||
26 | unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */ | ||
27 | unsigned short unused2; | ||
28 | char if_name[IFNAMSIZ]; /* interface name format string */ | ||
29 | __u8 unused[28]; /* For future use */ | ||
30 | }; | ||
31 | |||
32 | #define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig) | ||
33 | #define GSMIOC_DISABLE_NET _IO('G', 3) | ||
34 | |||
24 | 35 | ||
25 | #endif | 36 | #endif |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index ba362171e8ae..f743883f769e 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -93,7 +93,7 @@ | |||
93 | */ | 93 | */ |
94 | #define in_nmi() (preempt_count() & NMI_MASK) | 94 | #define in_nmi() (preempt_count() & NMI_MASK) |
95 | 95 | ||
96 | #if defined(CONFIG_PREEMPT) | 96 | #if defined(CONFIG_PREEMPT_COUNT) |
97 | # define PREEMPT_CHECK_OFFSET 1 | 97 | # define PREEMPT_CHECK_OFFSET 1 |
98 | #else | 98 | #else |
99 | # define PREEMPT_CHECK_OFFSET 0 | 99 | # define PREEMPT_CHECK_OFFSET 0 |
@@ -115,7 +115,7 @@ | |||
115 | #define in_atomic_preempt_off() \ | 115 | #define in_atomic_preempt_off() \ |
116 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) | 116 | ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) |
117 | 117 | ||
118 | #ifdef CONFIG_PREEMPT | 118 | #ifdef CONFIG_PREEMPT_COUNT |
119 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 119 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
120 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | 120 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) |
121 | #else | 121 | #else |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 42f7e2fb501f..9cf8e7ae7450 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -453,7 +453,8 @@ struct hid_input { | |||
453 | 453 | ||
454 | enum hid_type { | 454 | enum hid_type { |
455 | HID_TYPE_OTHER = 0, | 455 | HID_TYPE_OTHER = 0, |
456 | HID_TYPE_USBMOUSE | 456 | HID_TYPE_USBMOUSE, |
457 | HID_TYPE_USBNONE | ||
457 | }; | 458 | }; |
458 | 459 | ||
459 | struct hid_driver; | 460 | struct hid_driver; |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 59225ef27d15..19644e0016bd 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -231,6 +231,9 @@ struct hstate { | |||
231 | struct huge_bootmem_page { | 231 | struct huge_bootmem_page { |
232 | struct list_head list; | 232 | struct list_head list; |
233 | struct hstate *hstate; | 233 | struct hstate *hstate; |
234 | #ifdef CONFIG_HIGHMEM | ||
235 | phys_addr_t phys; | ||
236 | #endif | ||
234 | }; | 237 | }; |
235 | 238 | ||
236 | struct page *alloc_huge_page_node(struct hstate *h, int nid); | 239 | struct page *alloc_huge_page_node(struct hstate *h, int nid); |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index d1e55fed2c7d..6ae9c631a1be 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -73,6 +73,7 @@ static inline unsigned long hw_breakpoint_len(struct perf_event *bp) | |||
73 | extern struct perf_event * | 73 | extern struct perf_event * |
74 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 74 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
75 | perf_overflow_handler_t triggered, | 75 | perf_overflow_handler_t triggered, |
76 | void *context, | ||
76 | struct task_struct *tsk); | 77 | struct task_struct *tsk); |
77 | 78 | ||
78 | /* FIXME: only change from the attr, and don't unregister */ | 79 | /* FIXME: only change from the attr, and don't unregister */ |
@@ -85,11 +86,13 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr); | |||
85 | extern struct perf_event * | 86 | extern struct perf_event * |
86 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 87 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
87 | perf_overflow_handler_t triggered, | 88 | perf_overflow_handler_t triggered, |
89 | void *context, | ||
88 | int cpu); | 90 | int cpu); |
89 | 91 | ||
90 | extern struct perf_event * __percpu * | 92 | extern struct perf_event * __percpu * |
91 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 93 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
92 | perf_overflow_handler_t triggered); | 94 | perf_overflow_handler_t triggered, |
95 | void *context); | ||
93 | 96 | ||
94 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 97 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
95 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 98 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
@@ -115,6 +118,7 @@ static inline int __init init_hw_breakpoint(void) { return 0; } | |||
115 | static inline struct perf_event * | 118 | static inline struct perf_event * |
116 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 119 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
117 | perf_overflow_handler_t triggered, | 120 | perf_overflow_handler_t triggered, |
121 | void *context, | ||
118 | struct task_struct *tsk) { return NULL; } | 122 | struct task_struct *tsk) { return NULL; } |
119 | static inline int | 123 | static inline int |
120 | modify_user_hw_breakpoint(struct perf_event *bp, | 124 | modify_user_hw_breakpoint(struct perf_event *bp, |
@@ -122,10 +126,12 @@ modify_user_hw_breakpoint(struct perf_event *bp, | |||
122 | static inline struct perf_event * | 126 | static inline struct perf_event * |
123 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 127 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
124 | perf_overflow_handler_t triggered, | 128 | perf_overflow_handler_t triggered, |
129 | void *context, | ||
125 | int cpu) { return NULL; } | 130 | int cpu) { return NULL; } |
126 | static inline struct perf_event * __percpu * | 131 | static inline struct perf_event * __percpu * |
127 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 132 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
128 | perf_overflow_handler_t triggered) { return NULL; } | 133 | perf_overflow_handler_t triggered, |
134 | void *context) { return NULL; } | ||
129 | static inline int | 135 | static inline int |
130 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 136 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
131 | static inline int | 137 | static inline int |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 9bede7633f74..b4b0eef5fddf 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
@@ -25,7 +25,7 @@ | |||
25 | * there is always data available. *OBSOLETE* | 25 | * there is always data available. *OBSOLETE* |
26 | * @data_read: Read data from the RNG device. | 26 | * @data_read: Read data from the RNG device. |
27 | * Returns the number of lower random bytes in "data". | 27 | * Returns the number of lower random bytes in "data". |
28 | * Must not be NULL. *OSOLETE* | 28 | * Must not be NULL. *OBSOLETE* |
29 | * @read: New API. drivers can fill up to max bytes of data | 29 | * @read: New API. drivers can fill up to max bytes of data |
30 | * into the buffer. The buffer is aligned for any type. | 30 | * into the buffer. The buffer is aligned for any type. |
31 | * @priv: Private data, for use by the RNG driver. | 31 | * @priv: Private data, for use by the RNG driver. |
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index 7472449cbb74..0aa0cbd676f7 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -3,6 +3,33 @@ | |||
3 | 3 | ||
4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
5 | 5 | ||
6 | /* | ||
7 | * Version 2 of the I2C peripheral unit has a different register | ||
8 | * layout and extra registers. The ID register in the V2 peripheral | ||
9 | * unit on the OMAP4430 reports the same ID as the V1 peripheral | ||
10 | * unit on the OMAP3530, so we must inform the driver which IP | ||
11 | * version we know it is running on from platform / cpu-specific | ||
12 | * code using these constants in the hwmod class definition. | ||
13 | */ | ||
14 | |||
15 | #define OMAP_I2C_IP_VERSION_1 1 | ||
16 | #define OMAP_I2C_IP_VERSION_2 2 | ||
17 | |||
18 | /* struct omap_i2c_bus_platform_data .flags meanings */ | ||
19 | |||
20 | #define OMAP_I2C_FLAG_NO_FIFO BIT(0) | ||
21 | #define OMAP_I2C_FLAG_SIMPLE_CLOCK BIT(1) | ||
22 | #define OMAP_I2C_FLAG_16BIT_DATA_REG BIT(2) | ||
23 | #define OMAP_I2C_FLAG_RESET_REGS_POSTIDLE BIT(3) | ||
24 | #define OMAP_I2C_FLAG_APPLY_ERRATA_I207 BIT(4) | ||
25 | #define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK BIT(5) | ||
26 | #define OMAP_I2C_FLAG_FORCE_19200_INT_CLK BIT(6) | ||
27 | /* how the CPU address bus must be translated for I2C unit access */ | ||
28 | #define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0 | ||
29 | #define OMAP_I2C_FLAG_BUS_SHIFT_1 BIT(7) | ||
30 | #define OMAP_I2C_FLAG_BUS_SHIFT_2 BIT(8) | ||
31 | #define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7 | ||
32 | |||
6 | struct omap_i2c_bus_platform_data { | 33 | struct omap_i2c_bus_platform_data { |
7 | u32 clkrate; | 34 | u32 clkrate; |
8 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | 35 | void (*set_mpu_wkup_lat)(struct device *dev, long set); |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index ba4f88624fcd..114c0f6fc63d 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -657,28 +657,41 @@ struct twl4030_power_data { | |||
657 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 657 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
658 | extern int twl4030_remove_script(u8 flags); | 658 | extern int twl4030_remove_script(u8 flags); |
659 | 659 | ||
660 | struct twl4030_codec_audio_data { | 660 | struct twl4030_codec_data { |
661 | unsigned int digimic_delay; /* in ms */ | 661 | unsigned int digimic_delay; /* in ms */ |
662 | unsigned int ramp_delay_value; | 662 | unsigned int ramp_delay_value; |
663 | unsigned int offset_cncl_path; | 663 | unsigned int offset_cncl_path; |
664 | unsigned int check_defaults:1; | 664 | unsigned int check_defaults:1; |
665 | unsigned int reset_registers:1; | 665 | unsigned int reset_registers:1; |
666 | unsigned int hs_extmute:1; | 666 | unsigned int hs_extmute:1; |
667 | u16 hs_left_step; | ||
668 | u16 hs_right_step; | ||
669 | u16 hf_left_step; | ||
670 | u16 hf_right_step; | ||
667 | void (*set_hs_extmute)(int mute); | 671 | void (*set_hs_extmute)(int mute); |
668 | }; | 672 | }; |
669 | 673 | ||
670 | struct twl4030_codec_vibra_data { | 674 | struct twl4030_vibra_data { |
671 | unsigned int coexist; | 675 | unsigned int coexist; |
676 | |||
677 | /* twl6040 */ | ||
678 | unsigned int vibldrv_res; /* left driver resistance */ | ||
679 | unsigned int vibrdrv_res; /* right driver resistance */ | ||
680 | unsigned int viblmotor_res; /* left motor resistance */ | ||
681 | unsigned int vibrmotor_res; /* right motor resistance */ | ||
682 | int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | ||
683 | int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | ||
672 | }; | 684 | }; |
673 | 685 | ||
674 | struct twl4030_codec_data { | 686 | struct twl4030_audio_data { |
675 | unsigned int audio_mclk; | 687 | unsigned int audio_mclk; |
676 | struct twl4030_codec_audio_data *audio; | 688 | struct twl4030_codec_data *codec; |
677 | struct twl4030_codec_vibra_data *vibra; | 689 | struct twl4030_vibra_data *vibra; |
678 | 690 | ||
679 | /* twl6040 */ | 691 | /* twl6040 */ |
680 | int audpwron_gpio; /* audio power-on gpio */ | 692 | int audpwron_gpio; /* audio power-on gpio */ |
681 | int naudint_irq; /* audio interrupt */ | 693 | int naudint_irq; /* audio interrupt */ |
694 | unsigned int irq_base; | ||
682 | }; | 695 | }; |
683 | 696 | ||
684 | struct twl4030_platform_data { | 697 | struct twl4030_platform_data { |
@@ -690,7 +703,7 @@ struct twl4030_platform_data { | |||
690 | struct twl4030_keypad_data *keypad; | 703 | struct twl4030_keypad_data *keypad; |
691 | struct twl4030_usb_data *usb; | 704 | struct twl4030_usb_data *usb; |
692 | struct twl4030_power_data *power; | 705 | struct twl4030_power_data *power; |
693 | struct twl4030_codec_data *codec; | 706 | struct twl4030_audio_data *audio; |
694 | 707 | ||
695 | /* Common LDO regulators for TWL4030/TWL6030 */ | 708 | /* Common LDO regulators for TWL4030/TWL6030 */ |
696 | struct regulator_init_data *vdac; | 709 | struct regulator_init_data *vdac; |
diff --git a/include/linux/i8253.h b/include/linux/i8253.h new file mode 100644 index 000000000000..e6bb36a97519 --- /dev/null +++ b/include/linux/i8253.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Machine specific IO port address definition for generic. | ||
7 | * Written by Osamu Tomita <tomita@cinet.co.jp> | ||
8 | */ | ||
9 | #ifndef __LINUX_I8253_H | ||
10 | #define __LINUX_I8253_H | ||
11 | |||
12 | #include <linux/param.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/timex.h> | ||
15 | |||
16 | /* i8253A PIT registers */ | ||
17 | #define PIT_MODE 0x43 | ||
18 | #define PIT_CH0 0x40 | ||
19 | #define PIT_CH2 0x42 | ||
20 | |||
21 | #define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ) | ||
22 | |||
23 | extern raw_spinlock_t i8253_lock; | ||
24 | extern struct clock_event_device i8253_clockevent; | ||
25 | extern void clockevent_i8253_init(bool oneshot); | ||
26 | |||
27 | extern void setup_pit_timer(void); | ||
28 | |||
29 | #endif /* __LINUX_I8253_H */ | ||
diff --git a/include/linux/idr.h b/include/linux/idr.h index 13a801f3d028..255491cf522e 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -146,6 +146,10 @@ void ida_remove(struct ida *ida, int id); | |||
146 | void ida_destroy(struct ida *ida); | 146 | void ida_destroy(struct ida *ida); |
147 | void ida_init(struct ida *ida); | 147 | void ida_init(struct ida *ida); |
148 | 148 | ||
149 | int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end, | ||
150 | gfp_t gfp_mask); | ||
151 | void ida_simple_remove(struct ida *ida, unsigned int id); | ||
152 | |||
149 | void __init idr_init_cache(void); | 153 | void __init idr_init_cache(void); |
150 | 154 | ||
151 | #endif /* __IDR_H__ */ | 155 | #endif /* __IDR_H__ */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index bf56b6f78270..54c878960872 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -117,8 +117,19 @@ | |||
117 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
118 | 118 | ||
119 | #define IEEE80211_QOS_CTL_LEN 2 | 119 | #define IEEE80211_QOS_CTL_LEN 2 |
120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 120 | /* 1d tag mask */ |
121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
122 | /* TID mask */ | ||
123 | #define IEEE80211_QOS_CTL_TID_MASK 0x000f | ||
124 | /* EOSP */ | ||
125 | #define IEEE80211_QOS_CTL_EOSP 0x0010 | ||
126 | /* ACK policy */ | ||
127 | #define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL 0x0000 | ||
128 | #define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020 | ||
129 | #define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040 | ||
130 | #define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 | ||
131 | /* A-MSDU 802.11n */ | ||
132 | #define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 | ||
122 | 133 | ||
123 | /* U-APSD queue for WMM IEs sent by AP */ | 134 | /* U-APSD queue for WMM IEs sent by AP */ |
124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | 135 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) |
@@ -1423,9 +1434,6 @@ enum ieee80211_sa_query_action { | |||
1423 | }; | 1434 | }; |
1424 | 1435 | ||
1425 | 1436 | ||
1426 | /* A-MSDU 802.11n */ | ||
1427 | #define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 | ||
1428 | |||
1429 | /* cipher suite selectors */ | 1437 | /* cipher suite selectors */ |
1430 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 | 1438 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 |
1431 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 | 1439 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 |
@@ -1445,6 +1453,43 @@ enum ieee80211_sa_query_action { | |||
1445 | 1453 | ||
1446 | #define WLAN_PMKID_LEN 16 | 1454 | #define WLAN_PMKID_LEN 16 |
1447 | 1455 | ||
1456 | /* | ||
1457 | * WMM/802.11e Tspec Element | ||
1458 | */ | ||
1459 | #define IEEE80211_WMM_IE_TSPEC_TID_MASK 0x0F | ||
1460 | #define IEEE80211_WMM_IE_TSPEC_TID_SHIFT 1 | ||
1461 | |||
1462 | enum ieee80211_tspec_status_code { | ||
1463 | IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED = 0, | ||
1464 | IEEE80211_TSPEC_STATUS_ADDTS_INVAL_PARAMS = 0x1, | ||
1465 | }; | ||
1466 | |||
1467 | struct ieee80211_tspec_ie { | ||
1468 | u8 element_id; | ||
1469 | u8 len; | ||
1470 | u8 oui[3]; | ||
1471 | u8 oui_type; | ||
1472 | u8 oui_subtype; | ||
1473 | u8 version; | ||
1474 | __le16 tsinfo; | ||
1475 | u8 tsinfo_resvd; | ||
1476 | __le16 nominal_msdu; | ||
1477 | __le16 max_msdu; | ||
1478 | __le32 min_service_int; | ||
1479 | __le32 max_service_int; | ||
1480 | __le32 inactivity_int; | ||
1481 | __le32 suspension_int; | ||
1482 | __le32 service_start_time; | ||
1483 | __le32 min_data_rate; | ||
1484 | __le32 mean_data_rate; | ||
1485 | __le32 peak_data_rate; | ||
1486 | __le32 max_burst_size; | ||
1487 | __le32 delay_bound; | ||
1488 | __le32 min_phy_rate; | ||
1489 | __le16 sba; | ||
1490 | __le16 medium_time; | ||
1491 | } __packed; | ||
1492 | |||
1448 | /** | 1493 | /** |
1449 | * ieee80211_get_qos_ctl - get pointer to qos control bytes | 1494 | * ieee80211_get_qos_ctl - get pointer to qos control bytes |
1450 | * @hdr: the frame | 1495 | * @hdr: the frame |
diff --git a/include/linux/if.h b/include/linux/if.h index 3bc63e6a02f7..03489ca92ded 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ | 76 | #define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ |
77 | #define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch | 77 | #define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch |
78 | * datapath port */ | 78 | * datapath port */ |
79 | #define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing | ||
80 | * skbs on transmit */ | ||
79 | 81 | ||
80 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 82 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
81 | #define IF_GET_PROTO 0x0002 | 83 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 0065ffd3226b..a3d99ff6e3b5 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -78,10 +78,15 @@ | |||
78 | */ | 78 | */ |
79 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | 79 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ |
80 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 80 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
81 | #define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */ | ||
81 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 82 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
83 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ | ||
82 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ | 84 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ |
83 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 85 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
84 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ | 86 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ |
87 | #define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
88 | #define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
89 | #define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
85 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | 90 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ |
86 | 91 | ||
87 | /* | 92 | /* |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 7b318630139f..c1486060f5ed 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -49,6 +49,12 @@ struct sockaddr_ll { | |||
49 | #define PACKET_VNET_HDR 15 | 49 | #define PACKET_VNET_HDR 15 |
50 | #define PACKET_TX_TIMESTAMP 16 | 50 | #define PACKET_TX_TIMESTAMP 16 |
51 | #define PACKET_TIMESTAMP 17 | 51 | #define PACKET_TIMESTAMP 17 |
52 | #define PACKET_FANOUT 18 | ||
53 | |||
54 | #define PACKET_FANOUT_HASH 0 | ||
55 | #define PACKET_FANOUT_LB 1 | ||
56 | #define PACKET_FANOUT_CPU 2 | ||
57 | #define PACKET_FANOUT_FLAG_DEFRAG 0x8000 | ||
52 | 58 | ||
53 | struct tpacket_stats { | 59 | struct tpacket_stats { |
54 | unsigned int tp_packets; | 60 | unsigned int tp_packets; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index affa27380b72..44da4822bcab 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -91,25 +91,6 @@ struct vlan_group { | |||
91 | struct rcu_head rcu; | 91 | struct rcu_head rcu; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, | ||
95 | u16 vlan_id) | ||
96 | { | ||
97 | struct net_device **array; | ||
98 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | ||
99 | return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL; | ||
100 | } | ||
101 | |||
102 | static inline void vlan_group_set_device(struct vlan_group *vg, | ||
103 | u16 vlan_id, | ||
104 | struct net_device *dev) | ||
105 | { | ||
106 | struct net_device **array; | ||
107 | if (!vg) | ||
108 | return; | ||
109 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | ||
110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | ||
111 | } | ||
112 | |||
113 | static inline int is_vlan_dev(struct net_device *dev) | 94 | static inline int is_vlan_dev(struct net_device *dev) |
114 | { | 95 | { |
115 | return dev->priv_flags & IFF_802_1Q_VLAN; | 96 | return dev->priv_flags & IFF_802_1Q_VLAN; |
@@ -119,35 +100,18 @@ static inline int is_vlan_dev(struct net_device *dev) | |||
119 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 100 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
120 | 101 | ||
121 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 102 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
122 | /* Must be invoked with rcu_read_lock or with RTNL. */ | ||
123 | static inline struct net_device *vlan_find_dev(struct net_device *real_dev, | ||
124 | u16 vlan_id) | ||
125 | { | ||
126 | struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp); | ||
127 | |||
128 | if (grp) | ||
129 | return vlan_group_get_device(grp, vlan_id); | ||
130 | |||
131 | return NULL; | ||
132 | } | ||
133 | 103 | ||
104 | extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, | ||
105 | u16 vlan_id); | ||
134 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | 106 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
135 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); | 107 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); |
136 | 108 | ||
137 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | ||
138 | u16 vlan_tci, int polling); | ||
139 | extern bool vlan_do_receive(struct sk_buff **skb); | 109 | extern bool vlan_do_receive(struct sk_buff **skb); |
140 | extern struct sk_buff *vlan_untag(struct sk_buff *skb); | 110 | extern struct sk_buff *vlan_untag(struct sk_buff *skb); |
141 | extern gro_result_t | ||
142 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | ||
143 | unsigned int vlan_tci, struct sk_buff *skb); | ||
144 | extern gro_result_t | ||
145 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | ||
146 | unsigned int vlan_tci); | ||
147 | 111 | ||
148 | #else | 112 | #else |
149 | static inline struct net_device *vlan_find_dev(struct net_device *real_dev, | 113 | static inline struct net_device * |
150 | u16 vlan_id) | 114 | __vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id) |
151 | { | 115 | { |
152 | return NULL; | 116 | return NULL; |
153 | } | 117 | } |
@@ -164,13 +128,6 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev) | |||
164 | return 0; | 128 | return 0; |
165 | } | 129 | } |
166 | 130 | ||
167 | static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | ||
168 | u16 vlan_tci, int polling) | ||
169 | { | ||
170 | BUG(); | ||
171 | return NET_XMIT_SUCCESS; | ||
172 | } | ||
173 | |||
174 | static inline bool vlan_do_receive(struct sk_buff **skb) | 131 | static inline bool vlan_do_receive(struct sk_buff **skb) |
175 | { | 132 | { |
176 | if ((*skb)->vlan_tci & VLAN_VID_MASK) | 133 | if ((*skb)->vlan_tci & VLAN_VID_MASK) |
@@ -182,49 +139,9 @@ static inline struct sk_buff *vlan_untag(struct sk_buff *skb) | |||
182 | { | 139 | { |
183 | return skb; | 140 | return skb; |
184 | } | 141 | } |
185 | |||
186 | static inline gro_result_t | ||
187 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | ||
188 | unsigned int vlan_tci, struct sk_buff *skb) | ||
189 | { | ||
190 | return GRO_DROP; | ||
191 | } | ||
192 | |||
193 | static inline gro_result_t | ||
194 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | ||
195 | unsigned int vlan_tci) | ||
196 | { | ||
197 | return GRO_DROP; | ||
198 | } | ||
199 | #endif | 142 | #endif |
200 | 143 | ||
201 | /** | 144 | /** |
202 | * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration | ||
203 | * @skb: buffer | ||
204 | * @grp: vlan group | ||
205 | * @vlan_tci: VLAN TCI as received from the card | ||
206 | */ | ||
207 | static inline int vlan_hwaccel_rx(struct sk_buff *skb, | ||
208 | struct vlan_group *grp, | ||
209 | u16 vlan_tci) | ||
210 | { | ||
211 | return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0); | ||
212 | } | ||
213 | |||
214 | /** | ||
215 | * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration | ||
216 | * @skb: buffer | ||
217 | * @grp: vlan group | ||
218 | * @vlan_tci: VLAN TCI as received from the card | ||
219 | */ | ||
220 | static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, | ||
221 | struct vlan_group *grp, | ||
222 | u16 vlan_tci) | ||
223 | { | ||
224 | return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * vlan_insert_tag - regular VLAN tag inserting | 145 | * vlan_insert_tag - regular VLAN tag inserting |
229 | * @skb: skbuff to tag | 146 | * @skb: skbuff to tag |
230 | * @vlan_tci: VLAN TCI to insert | 147 | * @vlan_tci: VLAN TCI to insert |
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h index c4335faebb63..2cf55afbcd4e 100644 --- a/include/linux/inet_lro.h +++ b/include/linux/inet_lro.h | |||
@@ -50,7 +50,6 @@ struct net_lro_desc { | |||
50 | struct skb_frag_struct *next_frag; | 50 | struct skb_frag_struct *next_frag; |
51 | struct iphdr *iph; | 51 | struct iphdr *iph; |
52 | struct tcphdr *tcph; | 52 | struct tcphdr *tcph; |
53 | struct vlan_group *vgrp; | ||
54 | __wsum data_csum; | 53 | __wsum data_csum; |
55 | __be32 tcp_rcv_tsecr; | 54 | __be32 tcp_rcv_tsecr; |
56 | __be32 tcp_rcv_tsval; | 55 | __be32 tcp_rcv_tsval; |
@@ -60,7 +59,6 @@ struct net_lro_desc { | |||
60 | u16 ip_tot_len; | 59 | u16 ip_tot_len; |
61 | u16 tcp_saw_tstamp; /* timestamps enabled */ | 60 | u16 tcp_saw_tstamp; /* timestamps enabled */ |
62 | __be16 tcp_window; | 61 | __be16 tcp_window; |
63 | u16 vlan_tag; | ||
64 | int pkt_aggr_cnt; /* counts aggregated packets */ | 62 | int pkt_aggr_cnt; /* counts aggregated packets */ |
65 | int vlan_packet; | 63 | int vlan_packet; |
66 | int mss; | 64 | int mss; |
@@ -137,16 +135,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr, | |||
137 | void *priv); | 135 | void *priv); |
138 | 136 | ||
139 | /* | 137 | /* |
140 | * Processes a SKB with VLAN HW acceleration support | ||
141 | */ | ||
142 | |||
143 | void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr, | ||
144 | struct sk_buff *skb, | ||
145 | struct vlan_group *vgrp, | ||
146 | u16 vlan_tag, | ||
147 | void *priv); | ||
148 | |||
149 | /* | ||
150 | * Processes a fragment list | 138 | * Processes a fragment list |
151 | * | 139 | * |
152 | * This functions aggregate fragments and generate SKBs do pass | 140 | * This functions aggregate fragments and generate SKBs do pass |
@@ -165,13 +153,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr, | |||
165 | struct skb_frag_struct *frags, | 153 | struct skb_frag_struct *frags, |
166 | int len, int true_size, void *priv, __wsum sum); | 154 | int len, int true_size, void *priv, __wsum sum); |
167 | 155 | ||
168 | void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr, | ||
169 | struct skb_frag_struct *frags, | ||
170 | int len, int true_size, | ||
171 | struct vlan_group *vgrp, | ||
172 | u16 vlan_tag, | ||
173 | void *priv, __wsum sum); | ||
174 | |||
175 | /* | 156 | /* |
176 | * Forward all aggregated SKBs held by lro_mgr to network stack | 157 | * Forward all aggregated SKBs held by lro_mgr to network stack |
177 | */ | 158 | */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 580f70c02391..d14e058aaeed 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -176,7 +176,6 @@ extern struct cred init_cred; | |||
176 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ | 176 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ |
177 | .journal_info = NULL, \ | 177 | .journal_info = NULL, \ |
178 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 178 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
179 | .fs_excl = ATOMIC_INIT(0), \ | ||
180 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ | 179 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ |
181 | .timer_slack_ns = 50000, /* 50 usec default slack */ \ | 180 | .timer_slack_ns = 50000, /* 50 usec default slack */ \ |
182 | .pids = { \ | 181 | .pids = { \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 771d6d85667d..a637e7814334 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -119,9 +119,9 @@ struct input_keymap_entry { | |||
119 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ | 119 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ |
120 | #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ | 120 | #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ |
121 | 121 | ||
122 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ | 122 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */ |
123 | #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ | 123 | #define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */ |
124 | #define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ | 124 | #define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */ |
125 | 125 | ||
126 | #define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ | 126 | #define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ |
127 | #define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ | 127 | #define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ |
@@ -438,6 +438,8 @@ struct input_keymap_entry { | |||
438 | #define KEY_WIMAX 246 | 438 | #define KEY_WIMAX 246 |
439 | #define KEY_RFKILL 247 /* Key that controls all radios */ | 439 | #define KEY_RFKILL 247 /* Key that controls all radios */ |
440 | 440 | ||
441 | #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ | ||
442 | |||
441 | /* Code 255 is reserved for special needs of AT keyboard driver */ | 443 | /* Code 255 is reserved for special needs of AT keyboard driver */ |
442 | 444 | ||
443 | #define BTN_MISC 0x100 | 445 | #define BTN_MISC 0x100 |
diff --git a/include/linux/input/kxtj9.h b/include/linux/input/kxtj9.h new file mode 100644 index 000000000000..f6bac89537b8 --- /dev/null +++ b/include/linux/input/kxtj9.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Kionix, Inc. | ||
3 | * Written by Chris Hudson <chudson@kionix.com> | ||
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 | * 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 | ||
17 | * 02111-1307, USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __KXTJ9_H__ | ||
21 | #define __KXTJ9_H__ | ||
22 | |||
23 | #define KXTJ9_I2C_ADDR 0x0F | ||
24 | |||
25 | struct kxtj9_platform_data { | ||
26 | unsigned int min_interval; /* minimum poll interval (in milli-seconds) */ | ||
27 | |||
28 | /* | ||
29 | * By default, x is axis 0, y is axis 1, z is axis 2; these can be | ||
30 | * changed to account for sensor orientation within the host device. | ||
31 | */ | ||
32 | u8 axis_map_x; | ||
33 | u8 axis_map_y; | ||
34 | u8 axis_map_z; | ||
35 | |||
36 | /* | ||
37 | * Each axis can be negated to account for sensor orientation within | ||
38 | * the host device. | ||
39 | */ | ||
40 | bool negate_x; | ||
41 | bool negate_y; | ||
42 | bool negate_z; | ||
43 | |||
44 | /* CTRL_REG1: set resolution, g-range, data ready enable */ | ||
45 | /* Output resolution: 8-bit valid or 12-bit valid */ | ||
46 | #define RES_8BIT 0 | ||
47 | #define RES_12BIT (1 << 6) | ||
48 | u8 res_12bit; | ||
49 | /* Output g-range: +/-2g, 4g, or 8g */ | ||
50 | #define KXTJ9_G_2G 0 | ||
51 | #define KXTJ9_G_4G (1 << 3) | ||
52 | #define KXTJ9_G_8G (1 << 4) | ||
53 | u8 g_range; | ||
54 | |||
55 | /* DATA_CTRL_REG: controls the output data rate of the part */ | ||
56 | #define ODR12_5F 0 | ||
57 | #define ODR25F 1 | ||
58 | #define ODR50F 2 | ||
59 | #define ODR100F 3 | ||
60 | #define ODR200F 4 | ||
61 | #define ODR400F 5 | ||
62 | #define ODR800F 6 | ||
63 | u8 data_odr_init; | ||
64 | |||
65 | int (*init)(void); | ||
66 | void (*exit)(void); | ||
67 | int (*power_on)(void); | ||
68 | int (*power_off)(void); | ||
69 | }; | ||
70 | #endif /* __KXTJ9_H__ */ | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index f6efed0039ed..a103732b7588 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/kref.h> | 17 | #include <linux/kref.h> |
18 | #include <linux/workqueue.h> | 18 | #include <linux/workqueue.h> |
19 | 19 | ||
20 | #include <asm/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
22 | #include <asm/system.h> | 22 | #include <asm/system.h> |
23 | #include <trace/events/irq.h> | 23 | #include <trace/events/irq.h> |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index b2eee896dcbc..5037a0ad2312 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -5,6 +5,14 @@ | |||
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | 6 | ||
7 | struct cfq_queue; | 7 | struct cfq_queue; |
8 | struct cfq_ttime { | ||
9 | unsigned long last_end_request; | ||
10 | |||
11 | unsigned long ttime_total; | ||
12 | unsigned long ttime_samples; | ||
13 | unsigned long ttime_mean; | ||
14 | }; | ||
15 | |||
8 | struct cfq_io_context { | 16 | struct cfq_io_context { |
9 | void *key; | 17 | void *key; |
10 | 18 | ||
@@ -12,11 +20,7 @@ struct cfq_io_context { | |||
12 | 20 | ||
13 | struct io_context *ioc; | 21 | struct io_context *ioc; |
14 | 22 | ||
15 | unsigned long last_end_request; | 23 | struct cfq_ttime ttime; |
16 | |||
17 | unsigned long ttime_total; | ||
18 | unsigned long ttime_samples; | ||
19 | unsigned long ttime_mean; | ||
20 | 24 | ||
21 | struct list_head queue_list; | 25 | struct list_head queue_list; |
22 | struct hlist_node cic_list; | 26 | struct hlist_node cic_list; |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 0a2ba4098996..9940319d6f9d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __LINUX_IOMMU_H | 19 | #ifndef __LINUX_IOMMU_H |
20 | #define __LINUX_IOMMU_H | 20 | #define __LINUX_IOMMU_H |
21 | 21 | ||
22 | #include <linux/errno.h> | ||
23 | |||
22 | #define IOMMU_READ (1) | 24 | #define IOMMU_READ (1) |
23 | #define IOMMU_WRITE (2) | 25 | #define IOMMU_WRITE (2) |
24 | #define IOMMU_CACHE (4) /* DMA cache coherency */ | 26 | #define IOMMU_CACHE (4) /* DMA cache coherency */ |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index e9bb22cba764..9d57a71775b5 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -109,6 +109,36 @@ struct resource_list { | |||
109 | /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ | 109 | /* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ |
110 | #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ | 110 | #define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ |
111 | 111 | ||
112 | |||
113 | /* helpers to define resources */ | ||
114 | #define DEFINE_RES_NAMED(_start, _size, _name, _flags) \ | ||
115 | { \ | ||
116 | .start = (_start), \ | ||
117 | .end = (_start) + (_size) - 1, \ | ||
118 | .name = (_name), \ | ||
119 | .flags = (_flags), \ | ||
120 | } | ||
121 | |||
122 | #define DEFINE_RES_IO_NAMED(_start, _size, _name) \ | ||
123 | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO) | ||
124 | #define DEFINE_RES_IO(_start, _size) \ | ||
125 | DEFINE_RES_IO_NAMED((_start), (_size), NULL) | ||
126 | |||
127 | #define DEFINE_RES_MEM_NAMED(_start, _size, _name) \ | ||
128 | DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM) | ||
129 | #define DEFINE_RES_MEM(_start, _size) \ | ||
130 | DEFINE_RES_MEM_NAMED((_start), (_size), NULL) | ||
131 | |||
132 | #define DEFINE_RES_IRQ_NAMED(_irq, _name) \ | ||
133 | DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ) | ||
134 | #define DEFINE_RES_IRQ(_irq) \ | ||
135 | DEFINE_RES_IRQ_NAMED((_irq), NULL) | ||
136 | |||
137 | #define DEFINE_RES_DMA_NAMED(_dma, _name) \ | ||
138 | DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) | ||
139 | #define DEFINE_RES_DMA(_dma) \ | ||
140 | DEFINE_RES_DMA_NAMED((_dma), NULL) | ||
141 | |||
112 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ | 142 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ |
113 | extern struct resource ioport_resource; | 143 | extern struct resource ioport_resource; |
114 | extern struct resource iomem_resource; | 144 | extern struct resource iomem_resource; |
@@ -132,6 +162,7 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
132 | resource_size_t, | 162 | resource_size_t, |
133 | resource_size_t), | 163 | resource_size_t), |
134 | void *alignf_data); | 164 | void *alignf_data); |
165 | struct resource *lookup_resource(struct resource *root, resource_size_t start); | ||
135 | int adjust_resource(struct resource *res, resource_size_t start, | 166 | int adjust_resource(struct resource *res, resource_size_t start, |
136 | resource_size_t size); | 167 | resource_size_t size); |
137 | resource_size_t resource_alignment(struct resource *res); | 168 | resource_size_t resource_alignment(struct resource *res); |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index a6d1655f9607..8a297a5e794c 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -44,6 +44,11 @@ struct ipc_namespace { | |||
44 | size_t shm_ctlall; | 44 | size_t shm_ctlall; |
45 | int shm_ctlmni; | 45 | int shm_ctlmni; |
46 | int shm_tot; | 46 | int shm_tot; |
47 | /* | ||
48 | * Defines whether IPC_RMID is forced for _all_ shm segments regardless | ||
49 | * of shmctl() | ||
50 | */ | ||
51 | int shm_rmid_forced; | ||
47 | 52 | ||
48 | struct notifier_block ipcns_nb; | 53 | struct notifier_block ipcns_nb; |
49 | 54 | ||
@@ -72,6 +77,7 @@ extern int register_ipcns_notifier(struct ipc_namespace *); | |||
72 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); | 77 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); |
73 | extern void unregister_ipcns_notifier(struct ipc_namespace *); | 78 | extern void unregister_ipcns_notifier(struct ipc_namespace *); |
74 | extern int ipcns_notify(unsigned long); | 79 | extern int ipcns_notify(unsigned long); |
80 | extern void shm_destroy_orphaned(struct ipc_namespace *ns); | ||
75 | #else /* CONFIG_SYSVIPC */ | 81 | #else /* CONFIG_SYSVIPC */ |
76 | static inline int register_ipcns_notifier(struct ipc_namespace *ns) | 82 | static inline int register_ipcns_notifier(struct ipc_namespace *ns) |
77 | { return 0; } | 83 | { return 0; } |
@@ -79,6 +85,7 @@ static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns) | |||
79 | { return 0; } | 85 | { return 0; } |
80 | static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } | 86 | static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } |
81 | static inline int ipcns_notify(unsigned long l) { return 0; } | 87 | static inline int ipcns_notify(unsigned long l) { return 0; } |
88 | static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {} | ||
82 | #endif /* CONFIG_SYSVIPC */ | 89 | #endif /* CONFIG_SYSVIPC */ |
83 | 90 | ||
84 | #ifdef CONFIG_POSIX_MQUEUE | 91 | #ifdef CONFIG_POSIX_MQUEUE |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 16d6f54ef1dd..59517300a315 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -97,11 +97,6 @@ enum { | |||
97 | 97 | ||
98 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) | 98 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) |
99 | 99 | ||
100 | static inline __deprecated bool CHECK_IRQ_PER_CPU(unsigned int status) | ||
101 | { | ||
102 | return status & IRQ_PER_CPU; | ||
103 | } | ||
104 | |||
105 | /* | 100 | /* |
106 | * Return value for chip->irq_set_affinity() | 101 | * Return value for chip->irq_set_affinity() |
107 | * | 102 | * |
@@ -114,14 +109,18 @@ enum { | |||
114 | }; | 109 | }; |
115 | 110 | ||
116 | struct msi_desc; | 111 | struct msi_desc; |
112 | struct irq_domain; | ||
117 | 113 | ||
118 | /** | 114 | /** |
119 | * struct irq_data - per irq and irq chip data passed down to chip functions | 115 | * struct irq_data - per irq and irq chip data passed down to chip functions |
120 | * @irq: interrupt number | 116 | * @irq: interrupt number |
117 | * @hwirq: hardware interrupt number, local to the interrupt domain | ||
121 | * @node: node index useful for balancing | 118 | * @node: node index useful for balancing |
122 | * @state_use_accessors: status information for irq chip functions. | 119 | * @state_use_accessors: status information for irq chip functions. |
123 | * Use accessor functions to deal with it | 120 | * Use accessor functions to deal with it |
124 | * @chip: low level interrupt hardware access | 121 | * @chip: low level interrupt hardware access |
122 | * @domain: Interrupt translation domain; responsible for mapping | ||
123 | * between hwirq number and linux irq number. | ||
125 | * @handler_data: per-IRQ data for the irq_chip methods | 124 | * @handler_data: per-IRQ data for the irq_chip methods |
126 | * @chip_data: platform-specific per-chip private data for the chip | 125 | * @chip_data: platform-specific per-chip private data for the chip |
127 | * methods, to allow shared chip implementations | 126 | * methods, to allow shared chip implementations |
@@ -134,9 +133,11 @@ struct msi_desc; | |||
134 | */ | 133 | */ |
135 | struct irq_data { | 134 | struct irq_data { |
136 | unsigned int irq; | 135 | unsigned int irq; |
136 | unsigned long hwirq; | ||
137 | unsigned int node; | 137 | unsigned int node; |
138 | unsigned int state_use_accessors; | 138 | unsigned int state_use_accessors; |
139 | struct irq_chip *chip; | 139 | struct irq_chip *chip; |
140 | struct irq_domain *domain; | ||
140 | void *handler_data; | 141 | void *handler_data; |
141 | void *chip_data; | 142 | void *chip_data; |
142 | struct msi_desc *msi_desc; | 143 | struct msi_desc *msi_desc; |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h new file mode 100644 index 000000000000..e807ad687a07 --- /dev/null +++ b/include/linux/irqdomain.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * irq_domain - IRQ translation domains | ||
3 | * | ||
4 | * Translation infrastructure between hw and linux irq numbers. This is | ||
5 | * helpful for interrupt controllers to implement mapping between hardware | ||
6 | * irq numbers and the Linux irq number space. | ||
7 | * | ||
8 | * irq_domains also have a hook for translating device tree interrupt | ||
9 | * representation into a hardware irq number that can be mapped back to a | ||
10 | * Linux irq number without any extra platform support code. | ||
11 | * | ||
12 | * irq_domain is expected to be embedded in an interrupt controller's private | ||
13 | * data structure. | ||
14 | */ | ||
15 | #ifndef _LINUX_IRQDOMAIN_H | ||
16 | #define _LINUX_IRQDOMAIN_H | ||
17 | |||
18 | #include <linux/irq.h> | ||
19 | #include <linux/mod_devicetable.h> | ||
20 | |||
21 | #ifdef CONFIG_IRQ_DOMAIN | ||
22 | struct device_node; | ||
23 | struct irq_domain; | ||
24 | |||
25 | /** | ||
26 | * struct irq_domain_ops - Methods for irq_domain objects | ||
27 | * @to_irq: (optional) given a local hardware irq number, return the linux | ||
28 | * irq number. If to_irq is not implemented, then the irq_domain | ||
29 | * will use this translation: irq = (domain->irq_base + hwirq) | ||
30 | * @dt_translate: Given a device tree node and interrupt specifier, decode | ||
31 | * the hardware irq number and linux irq type value. | ||
32 | */ | ||
33 | struct irq_domain_ops { | ||
34 | unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq); | ||
35 | |||
36 | #ifdef CONFIG_OF | ||
37 | int (*dt_translate)(struct irq_domain *d, struct device_node *node, | ||
38 | const u32 *intspec, unsigned int intsize, | ||
39 | unsigned long *out_hwirq, unsigned int *out_type); | ||
40 | #endif /* CONFIG_OF */ | ||
41 | }; | ||
42 | |||
43 | /** | ||
44 | * struct irq_domain - Hardware interrupt number translation object | ||
45 | * @list: Element in global irq_domain list. | ||
46 | * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator | ||
47 | * of the irq_domain is responsible for allocating the array of | ||
48 | * irq_desc structures. | ||
49 | * @nr_irq: Number of irqs managed by the irq domain | ||
50 | * @ops: pointer to irq_domain methods | ||
51 | * @priv: private data pointer for use by owner. Not touched by irq_domain | ||
52 | * core code. | ||
53 | * @of_node: (optional) Pointer to device tree nodes associated with the | ||
54 | * irq_domain. Used when decoding device tree interrupt specifiers. | ||
55 | */ | ||
56 | struct irq_domain { | ||
57 | struct list_head list; | ||
58 | unsigned int irq_base; | ||
59 | unsigned int nr_irq; | ||
60 | const struct irq_domain_ops *ops; | ||
61 | void *priv; | ||
62 | struct device_node *of_node; | ||
63 | }; | ||
64 | |||
65 | /** | ||
66 | * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number | ||
67 | * | ||
68 | * Returns the linux irq number associated with a hardware irq. By default, | ||
69 | * the mapping is irq == domain->irq_base + hwirq, but this mapping can | ||
70 | * be overridden if the irq_domain implements a .to_irq() hook. | ||
71 | */ | ||
72 | static inline unsigned int irq_domain_to_irq(struct irq_domain *d, | ||
73 | unsigned long hwirq) | ||
74 | { | ||
75 | return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq; | ||
76 | } | ||
77 | |||
78 | extern void irq_domain_add(struct irq_domain *domain); | ||
79 | extern void irq_domain_del(struct irq_domain *domain); | ||
80 | #endif /* CONFIG_IRQ_DOMAIN */ | ||
81 | |||
82 | #if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ) | ||
83 | extern void irq_domain_add_simple(struct device_node *controller, int irq_base); | ||
84 | extern void irq_domain_generate_simple(const struct of_device_id *match, | ||
85 | u64 phys_base, unsigned int irq_start); | ||
86 | #else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */ | ||
87 | static inline void irq_domain_generate_simple(const struct of_device_id *match, | ||
88 | u64 phys_base, unsigned int irq_start) { } | ||
89 | #endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */ | ||
90 | |||
91 | #endif /* _LINUX_IRQDOMAIN_H */ | ||
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h index f1e6c184f14f..f0a2f8b0aa13 100644 --- a/include/linux/iscsi_boot_sysfs.h +++ b/include/linux/iscsi_boot_sysfs.h | |||
@@ -92,6 +92,13 @@ struct iscsi_boot_kobj { | |||
92 | * properties. | 92 | * properties. |
93 | */ | 93 | */ |
94 | mode_t (*is_visible) (void *data, int type); | 94 | mode_t (*is_visible) (void *data, int type); |
95 | |||
96 | /* | ||
97 | * Driver specific release function. | ||
98 | * | ||
99 | * The function should free the data passed in. | ||
100 | */ | ||
101 | void (*release) (void *data); | ||
95 | }; | 102 | }; |
96 | 103 | ||
97 | struct iscsi_boot_kset { | 104 | struct iscsi_boot_kset { |
@@ -103,18 +110,21 @@ struct iscsi_boot_kobj * | |||
103 | iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, | 110 | iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, |
104 | void *data, | 111 | void *data, |
105 | ssize_t (*show) (void *data, int type, char *buf), | 112 | ssize_t (*show) (void *data, int type, char *buf), |
106 | mode_t (*is_visible) (void *data, int type)); | 113 | mode_t (*is_visible) (void *data, int type), |
114 | void (*release) (void *data)); | ||
107 | 115 | ||
108 | struct iscsi_boot_kobj * | 116 | struct iscsi_boot_kobj * |
109 | iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, | 117 | iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, |
110 | void *data, | 118 | void *data, |
111 | ssize_t (*show) (void *data, int type, char *buf), | 119 | ssize_t (*show) (void *data, int type, char *buf), |
112 | mode_t (*is_visible) (void *data, int type)); | 120 | mode_t (*is_visible) (void *data, int type), |
121 | void (*release) (void *data)); | ||
113 | struct iscsi_boot_kobj * | 122 | struct iscsi_boot_kobj * |
114 | iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, | 123 | iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, |
115 | void *data, | 124 | void *data, |
116 | ssize_t (*show) (void *data, int type, char *buf), | 125 | ssize_t (*show) (void *data, int type, char *buf), |
117 | mode_t (*is_visible) (void *data, int type)); | 126 | mode_t (*is_visible) (void *data, int type), |
127 | void (*release) (void *data)); | ||
118 | 128 | ||
119 | struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); | 129 | struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); |
120 | struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); | 130 | struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index e06965081ba5..e6a5e34bed4f 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -940,7 +940,6 @@ extern int journal_force_commit(journal_t *); | |||
940 | */ | 940 | */ |
941 | struct journal_head *journal_add_journal_head(struct buffer_head *bh); | 941 | struct journal_head *journal_add_journal_head(struct buffer_head *bh); |
942 | struct journal_head *journal_grab_journal_head(struct buffer_head *bh); | 942 | struct journal_head *journal_grab_journal_head(struct buffer_head *bh); |
943 | void journal_remove_journal_head(struct buffer_head *bh); | ||
944 | void journal_put_journal_head(struct journal_head *jh); | 943 | void journal_put_journal_head(struct journal_head *jh); |
945 | 944 | ||
946 | /* | 945 | /* |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index d087c2e7b2aa..38f307b8c334 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1329,12 +1329,6 @@ extern int jbd_blocks_per_page(struct inode *inode); | |||
1329 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) | 1329 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) |
1330 | #define JBUFFER_TRACE(jh, info) do {} while (0) | 1330 | #define JBUFFER_TRACE(jh, info) do {} while (0) |
1331 | 1331 | ||
1332 | /* | ||
1333 | * jbd2_dev_to_name is a utility function used by the jbd2 and ext4 | ||
1334 | * tracing infrastructure to map a dev_t to a device name. | ||
1335 | */ | ||
1336 | extern const char *jbd2_dev_to_name(dev_t device); | ||
1337 | |||
1338 | #endif /* __KERNEL__ */ | 1332 | #endif /* __KERNEL__ */ |
1339 | 1333 | ||
1340 | #endif /* _LINUX_JBD2_H */ | 1334 | #endif /* _LINUX_JBD2_H */ |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index 44e95d0a721f..423cb6d78ee0 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -45,7 +45,7 @@ struct journal_head { | |||
45 | * has been cowed | 45 | * has been cowed |
46 | * [jbd_lock_bh_state()] | 46 | * [jbd_lock_bh_state()] |
47 | */ | 47 | */ |
48 | unsigned b_cow_tid; | 48 | tid_t b_cow_tid; |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * Copy of the buffer data frozen for writing to the log. | 51 | * Copy of the buffer data frozen for writing to the log. |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 83e745f3ead7..66f23dc5e76a 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -54,7 +54,7 @@ extern void jump_label_apply_nops(struct module *mod); | |||
54 | 54 | ||
55 | #else | 55 | #else |
56 | 56 | ||
57 | #include <asm/atomic.h> | 57 | #include <linux/atomic.h> |
58 | 58 | ||
59 | #define JUMP_LABEL_INIT {ATOMIC_INIT(0)} | 59 | #define JUMP_LABEL_INIT {ATOMIC_INIT(0)} |
60 | 60 | ||
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h new file mode 100644 index 000000000000..067eda0e4b32 --- /dev/null +++ b/include/linux/kconfig.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef __LINUX_KCONFIG_H | ||
2 | #define __LINUX_KCONFIG_H | ||
3 | |||
4 | #include <generated/autoconf.h> | ||
5 | |||
6 | /* | ||
7 | * Helper macros to use CONFIG_ options in C expressions. Note that | ||
8 | * these only work with boolean and tristate options. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', | ||
13 | * 0 otherwise. | ||
14 | * | ||
15 | */ | ||
16 | #define IS_ENABLED(option) \ | ||
17 | (__enabled_ ## option || __enabled_ ## option ## _MODULE) | ||
18 | |||
19 | /* | ||
20 | * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 | ||
21 | * otherwise. For boolean options, this is equivalent to | ||
22 | * IS_ENABLED(CONFIG_FOO). | ||
23 | */ | ||
24 | #define IS_BUILTIN(option) __enabled_ ## option | ||
25 | |||
26 | /* | ||
27 | * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0 | ||
28 | * otherwise. | ||
29 | */ | ||
30 | #define IS_MODULE(option) __enabled_ ## option ## _MODULE | ||
31 | |||
32 | #endif /* __LINUX_KCONFIG_H */ | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index aadff7cc2b84..529d9a0c75a5 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #ifdef CONFIG_KGDB_KDB | 16 | #ifdef CONFIG_KGDB_KDB |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | 20 | ||
21 | #define KDB_POLL_FUNC_MAX 5 | 21 | #define KDB_POLL_FUNC_MAX 5 |
22 | extern int kdb_poll_idx; | 22 | extern int kdb_poll_idx; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 953352a88336..46ac9a50528d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -56,6 +56,14 @@ | |||
56 | 56 | ||
57 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 57 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
59 | #define DIV_ROUND_UP_ULL(ll,d) \ | ||
60 | ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; }) | ||
61 | |||
62 | #if BITS_PER_LONG == 32 | ||
63 | # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d) | ||
64 | #else | ||
65 | # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d) | ||
66 | #endif | ||
59 | 67 | ||
60 | /* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ | 68 | /* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ |
61 | #define roundup(x, y) ( \ | 69 | #define roundup(x, y) ( \ |
@@ -121,7 +129,7 @@ extern int _cond_resched(void); | |||
121 | # define might_resched() do { } while (0) | 129 | # define might_resched() do { } while (0) |
122 | #endif | 130 | #endif |
123 | 131 | ||
124 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 132 | #ifdef CONFIG_DEBUG_ATOMIC_SLEEP |
125 | void __might_sleep(const char *file, int line, int preempt_offset); | 133 | void __might_sleep(const char *file, int line, int preempt_offset); |
126 | /** | 134 | /** |
127 | * might_sleep - annotation for functions that can sleep | 135 | * might_sleep - annotation for functions that can sleep |
@@ -646,29 +654,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
646 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | 654 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
647 | (type *)( (char *)__mptr - offsetof(type,member) );}) | 655 | (type *)( (char *)__mptr - offsetof(type,member) );}) |
648 | 656 | ||
649 | struct sysinfo; | ||
650 | extern int do_sysinfo(struct sysinfo *info); | ||
651 | |||
652 | #endif /* __KERNEL__ */ | ||
653 | |||
654 | #define SI_LOAD_SHIFT 16 | ||
655 | struct sysinfo { | ||
656 | long uptime; /* Seconds since boot */ | ||
657 | unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ | ||
658 | unsigned long totalram; /* Total usable main memory size */ | ||
659 | unsigned long freeram; /* Available memory size */ | ||
660 | unsigned long sharedram; /* Amount of shared memory */ | ||
661 | unsigned long bufferram; /* Memory used by buffers */ | ||
662 | unsigned long totalswap; /* Total swap space size */ | ||
663 | unsigned long freeswap; /* swap space still available */ | ||
664 | unsigned short procs; /* Number of current processes */ | ||
665 | unsigned short pad; /* explicit padding for m68k */ | ||
666 | unsigned long totalhigh; /* Total high memory size */ | ||
667 | unsigned long freehigh; /* Available high memory size */ | ||
668 | unsigned int mem_unit; /* Memory unit size in bytes */ | ||
669 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | ||
670 | }; | ||
671 | |||
672 | #ifdef __CHECKER__ | 657 | #ifdef __CHECKER__ |
673 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | 658 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) |
674 | #define BUILD_BUG_ON_ZERO(e) (0) | 659 | #define BUILD_BUG_ON_ZERO(e) (0) |
@@ -736,4 +721,27 @@ extern int __build_bug_on_failed; | |||
736 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD | 721 | # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD |
737 | #endif | 722 | #endif |
738 | 723 | ||
724 | struct sysinfo; | ||
725 | extern int do_sysinfo(struct sysinfo *info); | ||
726 | |||
727 | #endif /* __KERNEL__ */ | ||
728 | |||
729 | #define SI_LOAD_SHIFT 16 | ||
730 | struct sysinfo { | ||
731 | long uptime; /* Seconds since boot */ | ||
732 | unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ | ||
733 | unsigned long totalram; /* Total usable main memory size */ | ||
734 | unsigned long freeram; /* Available memory size */ | ||
735 | unsigned long sharedram; /* Amount of shared memory */ | ||
736 | unsigned long bufferram; /* Memory used by buffers */ | ||
737 | unsigned long totalswap; /* Total swap space size */ | ||
738 | unsigned long freeswap; /* swap space still available */ | ||
739 | unsigned short procs; /* Number of current processes */ | ||
740 | unsigned short pad; /* explicit padding for m68k */ | ||
741 | unsigned long totalhigh; /* Total high memory size */ | ||
742 | unsigned long freehigh; /* Available high memory size */ | ||
743 | unsigned int mem_unit; /* Memory unit size in bytes */ | ||
744 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | ||
745 | }; | ||
746 | |||
739 | #endif | 747 | #endif |
diff --git a/include/linux/key.h b/include/linux/key.h index 6ea4eebd3467..183a6af7715d 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/rcupdate.h> | 21 | #include <linux/rcupdate.h> |
22 | #include <linux/sysctl.h> | 22 | #include <linux/sysctl.h> |
23 | #include <linux/rwsem.h> | 23 | #include <linux/rwsem.h> |
24 | #include <asm/atomic.h> | 24 | #include <linux/atomic.h> |
25 | 25 | ||
26 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
27 | 27 | ||
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 10ca03d0a250..fa391835508d 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/serial_8250.h> | 16 | #include <linux/serial_8250.h> |
17 | #include <linux/linkage.h> | 17 | #include <linux/linkage.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #ifdef CONFIG_HAVE_ARCH_KGDB | 20 | #ifdef CONFIG_HAVE_ARCH_KGDB |
21 | #include <asm/kgdb.h> | 21 | #include <asm/kgdb.h> |
22 | #endif | 22 | #endif |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 9229b64ee3aa..668729cc0fe9 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/kobject_ns.h> | 25 | #include <linux/kobject_ns.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
28 | #include <asm/atomic.h> | 28 | #include <linux/atomic.h> |
29 | 29 | ||
30 | #define UEVENT_HELPER_PATH_LEN 256 | 30 | #define UEVENT_HELPER_PATH_LEN 256 |
31 | #define UEVENT_NUM_ENVP 32 /* number of env pointers */ | 31 | #define UEVENT_NUM_ENVP 32 /* number of env pointers */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 55ef181521ff..2c366b52f505 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -161,6 +161,7 @@ struct kvm_pit_config { | |||
161 | #define KVM_EXIT_NMI 16 | 161 | #define KVM_EXIT_NMI 16 |
162 | #define KVM_EXIT_INTERNAL_ERROR 17 | 162 | #define KVM_EXIT_INTERNAL_ERROR 17 |
163 | #define KVM_EXIT_OSI 18 | 163 | #define KVM_EXIT_OSI 18 |
164 | #define KVM_EXIT_PAPR_HCALL 19 | ||
164 | 165 | ||
165 | /* For KVM_EXIT_INTERNAL_ERROR */ | 166 | /* For KVM_EXIT_INTERNAL_ERROR */ |
166 | #define KVM_INTERNAL_ERROR_EMULATION 1 | 167 | #define KVM_INTERNAL_ERROR_EMULATION 1 |
@@ -264,6 +265,11 @@ struct kvm_run { | |||
264 | struct { | 265 | struct { |
265 | __u64 gprs[32]; | 266 | __u64 gprs[32]; |
266 | } osi; | 267 | } osi; |
268 | struct { | ||
269 | __u64 nr; | ||
270 | __u64 ret; | ||
271 | __u64 args[9]; | ||
272 | } papr_hcall; | ||
267 | /* Fix the size of the union. */ | 273 | /* Fix the size of the union. */ |
268 | char padding[256]; | 274 | char padding[256]; |
269 | }; | 275 | }; |
@@ -544,6 +550,9 @@ struct kvm_ppc_pvinfo { | |||
544 | #define KVM_CAP_TSC_CONTROL 60 | 550 | #define KVM_CAP_TSC_CONTROL 60 |
545 | #define KVM_CAP_GET_TSC_KHZ 61 | 551 | #define KVM_CAP_GET_TSC_KHZ 61 |
546 | #define KVM_CAP_PPC_BOOKE_SREGS 62 | 552 | #define KVM_CAP_PPC_BOOKE_SREGS 62 |
553 | #define KVM_CAP_SPAPR_TCE 63 | ||
554 | #define KVM_CAP_PPC_SMT 64 | ||
555 | #define KVM_CAP_PPC_RMA 65 | ||
547 | 556 | ||
548 | #ifdef KVM_CAP_IRQ_ROUTING | 557 | #ifdef KVM_CAP_IRQ_ROUTING |
549 | 558 | ||
@@ -746,6 +755,9 @@ struct kvm_clock_data { | |||
746 | /* Available with KVM_CAP_XCRS */ | 755 | /* Available with KVM_CAP_XCRS */ |
747 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) | 756 | #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) |
748 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) | 757 | #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) |
758 | #define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce) | ||
759 | /* Available with KVM_CAP_RMA */ | ||
760 | #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) | ||
749 | 761 | ||
750 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 762 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
751 | 763 | ||
@@ -773,20 +785,14 @@ struct kvm_assigned_pci_dev { | |||
773 | 785 | ||
774 | struct kvm_assigned_irq { | 786 | struct kvm_assigned_irq { |
775 | __u32 assigned_dev_id; | 787 | __u32 assigned_dev_id; |
776 | __u32 host_irq; | 788 | __u32 host_irq; /* ignored (legacy field) */ |
777 | __u32 guest_irq; | 789 | __u32 guest_irq; |
778 | __u32 flags; | 790 | __u32 flags; |
779 | union { | 791 | union { |
780 | struct { | ||
781 | __u32 addr_lo; | ||
782 | __u32 addr_hi; | ||
783 | __u32 data; | ||
784 | } guest_msi; | ||
785 | __u32 reserved[12]; | 792 | __u32 reserved[12]; |
786 | }; | 793 | }; |
787 | }; | 794 | }; |
788 | 795 | ||
789 | |||
790 | struct kvm_assigned_msix_nr { | 796 | struct kvm_assigned_msix_nr { |
791 | __u32 assigned_dev_id; | 797 | __u32 assigned_dev_id; |
792 | __u16 entry_nr; | 798 | __u16 entry_nr; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 31ebb59cbd2f..eabb21a30c34 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #define KVM_REQ_DEACTIVATE_FPU 10 | 47 | #define KVM_REQ_DEACTIVATE_FPU 10 |
48 | #define KVM_REQ_EVENT 11 | 48 | #define KVM_REQ_EVENT 11 |
49 | #define KVM_REQ_APF_HALT 12 | 49 | #define KVM_REQ_APF_HALT 12 |
50 | #define KVM_REQ_STEAL_UPDATE 13 | ||
50 | 51 | ||
51 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 52 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
52 | 53 | ||
@@ -326,12 +327,17 @@ static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | |||
326 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } | 327 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |
327 | 328 | ||
328 | extern struct page *bad_page; | 329 | extern struct page *bad_page; |
330 | extern struct page *fault_page; | ||
331 | |||
329 | extern pfn_t bad_pfn; | 332 | extern pfn_t bad_pfn; |
333 | extern pfn_t fault_pfn; | ||
330 | 334 | ||
331 | int is_error_page(struct page *page); | 335 | int is_error_page(struct page *page); |
332 | int is_error_pfn(pfn_t pfn); | 336 | int is_error_pfn(pfn_t pfn); |
333 | int is_hwpoison_pfn(pfn_t pfn); | 337 | int is_hwpoison_pfn(pfn_t pfn); |
334 | int is_fault_pfn(pfn_t pfn); | 338 | int is_fault_pfn(pfn_t pfn); |
339 | int is_noslot_pfn(pfn_t pfn); | ||
340 | int is_invalid_pfn(pfn_t pfn); | ||
335 | int kvm_is_error_hva(unsigned long addr); | 341 | int kvm_is_error_hva(unsigned long addr); |
336 | int kvm_set_memory_region(struct kvm *kvm, | 342 | int kvm_set_memory_region(struct kvm *kvm, |
337 | struct kvm_userspace_memory_region *mem, | 343 | struct kvm_userspace_memory_region *mem, |
@@ -381,6 +387,8 @@ int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, | |||
381 | int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data, | 387 | int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data, |
382 | unsigned long len); | 388 | unsigned long len); |
383 | int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); | 389 | int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); |
390 | int kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
391 | void *data, unsigned long len); | ||
384 | int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, | 392 | int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, |
385 | int offset, int len); | 393 | int offset, int len); |
386 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | 394 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, |
diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h index 58592fa67d24..8eb12357a110 100644 --- a/include/linux/led-lm3530.h +++ b/include/linux/led-lm3530.h | |||
@@ -84,6 +84,8 @@ enum lm3530_als_mode { | |||
84 | * @brt_ramp_rise: rate of rise of led current | 84 | * @brt_ramp_rise: rate of rise of led current |
85 | * @als1_resistor_sel: internal resistance from ALS1 input to ground | 85 | * @als1_resistor_sel: internal resistance from ALS1 input to ground |
86 | * @als2_resistor_sel: internal resistance from ALS2 input to ground | 86 | * @als2_resistor_sel: internal resistance from ALS2 input to ground |
87 | * @als_vmin: als input voltage calibrated for max brightness in mV | ||
88 | * @als_vmax: als input voltage calibrated for min brightness in mV | ||
87 | * @brt_val: brightness value (0-255) | 89 | * @brt_val: brightness value (0-255) |
88 | */ | 90 | */ |
89 | struct lm3530_platform_data { | 91 | struct lm3530_platform_data { |
@@ -101,6 +103,9 @@ struct lm3530_platform_data { | |||
101 | u8 als1_resistor_sel; | 103 | u8 als1_resistor_sel; |
102 | u8 als2_resistor_sel; | 104 | u8 als2_resistor_sel; |
103 | 105 | ||
106 | u32 als_vmin; | ||
107 | u32 als_vmax; | ||
108 | |||
104 | u8 brt_val; | 109 | u8 brt_val; |
105 | }; | 110 | }; |
106 | 111 | ||
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index 2fb1dcbcb5aa..9962c6bb1311 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
@@ -59,8 +59,6 @@ struct lguest_data { | |||
59 | unsigned long reserve_mem; | 59 | unsigned long reserve_mem; |
60 | /* KHz for the TSC clock. */ | 60 | /* KHz for the TSC clock. */ |
61 | u32 tsc_khz; | 61 | u32 tsc_khz; |
62 | /* Page where the top-level pagetable is */ | ||
63 | unsigned long pgdir; | ||
64 | 62 | ||
65 | /* Fields initialized by the Guest at boot: */ | 63 | /* Fields initialized by the Guest at boot: */ |
66 | /* Instruction range to suppress interrupts even if enabled */ | 64 | /* Instruction range to suppress interrupts even if enabled */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5a9926b34072..efd6f9800762 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -74,6 +74,16 @@ | |||
74 | 74 | ||
75 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) | 75 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) |
76 | 76 | ||
77 | #define ata_print_version_once(dev, version) \ | ||
78 | ({ \ | ||
79 | static bool __print_once; \ | ||
80 | \ | ||
81 | if (!__print_once) { \ | ||
82 | __print_once = true; \ | ||
83 | ata_print_version(dev, version); \ | ||
84 | } \ | ||
85 | }) | ||
86 | |||
77 | /* NEW: debug levels */ | 87 | /* NEW: debug levels */ |
78 | #define HAVE_LIBATA_MSG 1 | 88 | #define HAVE_LIBATA_MSG 1 |
79 | 89 | ||
@@ -1244,20 +1254,50 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1244 | /* | 1254 | /* |
1245 | * printk helpers | 1255 | * printk helpers |
1246 | */ | 1256 | */ |
1247 | #define ata_port_printk(ap, lv, fmt, args...) \ | 1257 | __attribute__((format (printf, 3, 4))) |
1248 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1258 | int ata_port_printk(const struct ata_port *ap, const char *level, |
1249 | 1259 | const char *fmt, ...); | |
1250 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1260 | __attribute__((format (printf, 3, 4))) |
1251 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ | 1261 | int ata_link_printk(const struct ata_link *link, const char *level, |
1252 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1262 | const char *fmt, ...); |
1253 | (link)->pmp , ##args); \ | 1263 | __attribute__((format (printf, 3, 4))) |
1254 | else \ | 1264 | int ata_dev_printk(const struct ata_device *dev, const char *level, |
1255 | printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ | 1265 | const char *fmt, ...); |
1256 | } while(0) | 1266 | |
1257 | 1267 | #define ata_port_err(ap, fmt, ...) \ | |
1258 | #define ata_dev_printk(dev, lv, fmt, args...) \ | 1268 | ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__) |
1259 | printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ | 1269 | #define ata_port_warn(ap, fmt, ...) \ |
1260 | (dev)->link->pmp + (dev)->devno , ##args) | 1270 | ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__) |
1271 | #define ata_port_notice(ap, fmt, ...) \ | ||
1272 | ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1273 | #define ata_port_info(ap, fmt, ...) \ | ||
1274 | ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1275 | #define ata_port_dbg(ap, fmt, ...) \ | ||
1276 | ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1277 | |||
1278 | #define ata_link_err(link, fmt, ...) \ | ||
1279 | ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1280 | #define ata_link_warn(link, fmt, ...) \ | ||
1281 | ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1282 | #define ata_link_notice(link, fmt, ...) \ | ||
1283 | ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1284 | #define ata_link_info(link, fmt, ...) \ | ||
1285 | ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1286 | #define ata_link_dbg(link, fmt, ...) \ | ||
1287 | ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1288 | |||
1289 | #define ata_dev_err(dev, fmt, ...) \ | ||
1290 | ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1291 | #define ata_dev_warn(dev, fmt, ...) \ | ||
1292 | ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1293 | #define ata_dev_notice(dev, fmt, ...) \ | ||
1294 | ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1295 | #define ata_dev_info(dev, fmt, ...) \ | ||
1296 | ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1297 | #define ata_dev_dbg(dev, fmt, ...) \ | ||
1298 | ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1299 | |||
1300 | void ata_print_version(const struct device *dev, const char *version); | ||
1261 | 1301 | ||
1262 | /* | 1302 | /* |
1263 | * ata_eh_info helpers | 1303 | * ata_eh_info helpers |
diff --git a/include/linux/llist.h b/include/linux/llist.h new file mode 100644 index 000000000000..aa0c8b5b3cd0 --- /dev/null +++ b/include/linux/llist.h | |||
@@ -0,0 +1,126 @@ | |||
1 | #ifndef LLIST_H | ||
2 | #define LLIST_H | ||
3 | /* | ||
4 | * Lock-less NULL terminated single linked list | ||
5 | * | ||
6 | * If there are multiple producers and multiple consumers, llist_add | ||
7 | * can be used in producers and llist_del_all can be used in | ||
8 | * consumers. They can work simultaneously without lock. But | ||
9 | * llist_del_first can not be used here. Because llist_del_first | ||
10 | * depends on list->first->next does not changed if list->first is not | ||
11 | * changed during its operation, but llist_del_first, llist_add, | ||
12 | * llist_add (or llist_del_all, llist_add, llist_add) sequence in | ||
13 | * another consumer may violate that. | ||
14 | * | ||
15 | * If there are multiple producers and one consumer, llist_add can be | ||
16 | * used in producers and llist_del_all or llist_del_first can be used | ||
17 | * in the consumer. | ||
18 | * | ||
19 | * This can be summarized as follow: | ||
20 | * | ||
21 | * | add | del_first | del_all | ||
22 | * add | - | - | - | ||
23 | * del_first | | L | L | ||
24 | * del_all | | | - | ||
25 | * | ||
26 | * Where "-" stands for no lock is needed, while "L" stands for lock | ||
27 | * is needed. | ||
28 | * | ||
29 | * The list entries deleted via llist_del_all can be traversed with | ||
30 | * traversing function such as llist_for_each etc. But the list | ||
31 | * entries can not be traversed safely before deleted from the list. | ||
32 | * The order of deleted entries is from the newest to the oldest added | ||
33 | * one. If you want to traverse from the oldest to the newest, you | ||
34 | * must reverse the order by yourself before traversing. | ||
35 | * | ||
36 | * The basic atomic operation of this list is cmpxchg on long. On | ||
37 | * architectures that don't have NMI-safe cmpxchg implementation, the | ||
38 | * list can NOT be used in NMI handler. So code uses the list in NMI | ||
39 | * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. | ||
40 | */ | ||
41 | |||
42 | struct llist_head { | ||
43 | struct llist_node *first; | ||
44 | }; | ||
45 | |||
46 | struct llist_node { | ||
47 | struct llist_node *next; | ||
48 | }; | ||
49 | |||
50 | #define LLIST_HEAD_INIT(name) { NULL } | ||
51 | #define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name) | ||
52 | |||
53 | /** | ||
54 | * init_llist_head - initialize lock-less list head | ||
55 | * @head: the head for your lock-less list | ||
56 | */ | ||
57 | static inline void init_llist_head(struct llist_head *list) | ||
58 | { | ||
59 | list->first = NULL; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * llist_entry - get the struct of this entry | ||
64 | * @ptr: the &struct llist_node pointer. | ||
65 | * @type: the type of the struct this is embedded in. | ||
66 | * @member: the name of the llist_node within the struct. | ||
67 | */ | ||
68 | #define llist_entry(ptr, type, member) \ | ||
69 | container_of(ptr, type, member) | ||
70 | |||
71 | /** | ||
72 | * llist_for_each - iterate over some deleted entries of a lock-less list | ||
73 | * @pos: the &struct llist_node to use as a loop cursor | ||
74 | * @node: the first entry of deleted list entries | ||
75 | * | ||
76 | * In general, some entries of the lock-less list can be traversed | ||
77 | * safely only after being deleted from list, so start with an entry | ||
78 | * instead of list head. | ||
79 | * | ||
80 | * If being used on entries deleted from lock-less list directly, the | ||
81 | * traverse order is from the newest to the oldest added entry. If | ||
82 | * you want to traverse from the oldest to the newest, you must | ||
83 | * reverse the order by yourself before traversing. | ||
84 | */ | ||
85 | #define llist_for_each(pos, node) \ | ||
86 | for ((pos) = (node); pos; (pos) = (pos)->next) | ||
87 | |||
88 | /** | ||
89 | * llist_for_each_entry - iterate over some deleted entries of lock-less list of given type | ||
90 | * @pos: the type * to use as a loop cursor. | ||
91 | * @node: the fist entry of deleted list entries. | ||
92 | * @member: the name of the llist_node with the struct. | ||
93 | * | ||
94 | * In general, some entries of the lock-less list can be traversed | ||
95 | * safely only after being removed from list, so start with an entry | ||
96 | * instead of list head. | ||
97 | * | ||
98 | * If being used on entries deleted from lock-less list directly, the | ||
99 | * traverse order is from the newest to the oldest added entry. If | ||
100 | * you want to traverse from the oldest to the newest, you must | ||
101 | * reverse the order by yourself before traversing. | ||
102 | */ | ||
103 | #define llist_for_each_entry(pos, node, member) \ | ||
104 | for ((pos) = llist_entry((node), typeof(*(pos)), member); \ | ||
105 | &(pos)->member != NULL; \ | ||
106 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) | ||
107 | |||
108 | /** | ||
109 | * llist_empty - tests whether a lock-less list is empty | ||
110 | * @head: the list to test | ||
111 | * | ||
112 | * Not guaranteed to be accurate or up to date. Just a quick way to | ||
113 | * test whether the list is empty without deleting something from the | ||
114 | * list. | ||
115 | */ | ||
116 | static inline int llist_empty(const struct llist_head *head) | ||
117 | { | ||
118 | return ACCESS_ONCE(head->first) == NULL; | ||
119 | } | ||
120 | |||
121 | void llist_add(struct llist_node *new, struct llist_head *head); | ||
122 | void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last, | ||
123 | struct llist_head *head); | ||
124 | struct llist_node *llist_del_first(struct llist_head *head); | ||
125 | struct llist_node *llist_del_all(struct llist_head *head); | ||
126 | #endif /* LLIST_H */ | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 50940da6adf3..3b535db00a94 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -39,6 +39,16 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
39 | struct mem_cgroup *mem_cont, | 39 | struct mem_cgroup *mem_cont, |
40 | int active, int file); | 40 | int active, int file); |
41 | 41 | ||
42 | struct memcg_scanrecord { | ||
43 | struct mem_cgroup *mem; /* scanend memory cgroup */ | ||
44 | struct mem_cgroup *root; /* scan target hierarchy root */ | ||
45 | int context; /* scanning context (see memcontrol.c) */ | ||
46 | unsigned long nr_scanned[2]; /* the number of scanned pages */ | ||
47 | unsigned long nr_rotated[2]; /* the number of rotated pages */ | ||
48 | unsigned long nr_freed[2]; /* the number of freed pages */ | ||
49 | unsigned long elapsed; /* nsec of time elapsed while scanning */ | ||
50 | }; | ||
51 | |||
42 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 52 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
43 | /* | 53 | /* |
44 | * All "charge" functions with gfp_mask should use GFP_KERNEL or | 54 | * All "charge" functions with gfp_mask should use GFP_KERNEL or |
@@ -76,8 +86,6 @@ extern void mem_cgroup_uncharge_end(void); | |||
76 | 86 | ||
77 | extern void mem_cgroup_uncharge_page(struct page *page); | 87 | extern void mem_cgroup_uncharge_page(struct page *page); |
78 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 88 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
79 | extern int mem_cgroup_shmem_charge_fallback(struct page *page, | ||
80 | struct mm_struct *mm, gfp_t gfp_mask); | ||
81 | 89 | ||
82 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 90 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
83 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 91 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
@@ -111,8 +119,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | |||
111 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 119 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); |
112 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 120 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
113 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, | 121 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
114 | struct zone *zone, | 122 | int nid, int zid, unsigned int lrumask); |
115 | enum lru_list lru); | ||
116 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | 123 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, |
117 | struct zone *zone); | 124 | struct zone *zone); |
118 | struct zone_reclaim_stat* | 125 | struct zone_reclaim_stat* |
@@ -120,6 +127,15 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page); | |||
120 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | 127 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, |
121 | struct task_struct *p); | 128 | struct task_struct *p); |
122 | 129 | ||
130 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
131 | gfp_t gfp_mask, bool noswap, | ||
132 | struct memcg_scanrecord *rec); | ||
133 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
134 | gfp_t gfp_mask, bool noswap, | ||
135 | struct zone *zone, | ||
136 | struct memcg_scanrecord *rec, | ||
137 | unsigned long *nr_scanned); | ||
138 | |||
123 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 139 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
124 | extern int do_swap_account; | 140 | extern int do_swap_account; |
125 | #endif | 141 | #endif |
@@ -207,12 +223,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page) | |||
207 | { | 223 | { |
208 | } | 224 | } |
209 | 225 | ||
210 | static inline int mem_cgroup_shmem_charge_fallback(struct page *page, | ||
211 | struct mm_struct *mm, gfp_t gfp_mask) | ||
212 | { | ||
213 | return 0; | ||
214 | } | ||
215 | |||
216 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) | 226 | static inline void mem_cgroup_add_lru_list(struct page *page, int lru) |
217 | { | 227 | { |
218 | } | 228 | } |
@@ -313,8 +323,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | |||
313 | } | 323 | } |
314 | 324 | ||
315 | static inline unsigned long | 325 | static inline unsigned long |
316 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, | 326 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid, |
317 | enum lru_list lru) | 327 | unsigned int lru_mask) |
318 | { | 328 | { |
319 | return 0; | 329 | return 0; |
320 | } | 330 | } |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 8122018d3000..0b8e2a742600 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -68,12 +68,19 @@ static inline void zone_seqlock_init(struct zone *zone) | |||
68 | extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); | 68 | extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); |
69 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); | 69 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); |
70 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | 70 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); |
71 | /* need some defines for these for archs that don't support it */ | ||
72 | extern void online_page(struct page *page); | ||
73 | /* VM interface that may be used by firmware interface */ | 71 | /* VM interface that may be used by firmware interface */ |
74 | extern int online_pages(unsigned long, unsigned long); | 72 | extern int online_pages(unsigned long, unsigned long); |
75 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 73 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
76 | 74 | ||
75 | typedef void (*online_page_callback_t)(struct page *page); | ||
76 | |||
77 | extern int set_online_page_callback(online_page_callback_t callback); | ||
78 | extern int restore_online_page_callback(online_page_callback_t callback); | ||
79 | |||
80 | extern void __online_page_set_limits(struct page *page); | ||
81 | extern void __online_page_increment_counters(struct page *page); | ||
82 | extern void __online_page_free(struct page *page); | ||
83 | |||
77 | #ifdef CONFIG_MEMORY_HOTREMOVE | 84 | #ifdef CONFIG_MEMORY_HOTREMOVE |
78 | extern bool is_pageblock_removable_nolock(struct page *page); | 85 | extern bool is_pageblock_removable_nolock(struct page *page); |
79 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 86 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
diff --git a/include/linux/mfd/aat2870.h b/include/linux/mfd/aat2870.h new file mode 100644 index 000000000000..f7316c29bdec --- /dev/null +++ b/include/linux/mfd/aat2870.h | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mfd/aat2870.h | ||
3 | * | ||
4 | * Copyright (c) 2011, NVIDIA Corporation. | ||
5 | * Author: Jin Park <jinyoungp@nvidia.com> | ||
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, but | ||
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * 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., 51 Franklin St, Fifth Floor, Boston, MA | ||
19 | * 02110-1301 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef __LINUX_MFD_AAT2870_H | ||
23 | #define __LINUX_MFD_AAT2870_H | ||
24 | |||
25 | #include <linux/debugfs.h> | ||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | /* Register offsets */ | ||
29 | #define AAT2870_BL_CH_EN 0x00 | ||
30 | #define AAT2870_BLM 0x01 | ||
31 | #define AAT2870_BLS 0x02 | ||
32 | #define AAT2870_BL1 0x03 | ||
33 | #define AAT2870_BL2 0x04 | ||
34 | #define AAT2870_BL3 0x05 | ||
35 | #define AAT2870_BL4 0x06 | ||
36 | #define AAT2870_BL5 0x07 | ||
37 | #define AAT2870_BL6 0x08 | ||
38 | #define AAT2870_BL7 0x09 | ||
39 | #define AAT2870_BL8 0x0A | ||
40 | #define AAT2870_FLR 0x0B | ||
41 | #define AAT2870_FM 0x0C | ||
42 | #define AAT2870_FS 0x0D | ||
43 | #define AAT2870_ALS_CFG0 0x0E | ||
44 | #define AAT2870_ALS_CFG1 0x0F | ||
45 | #define AAT2870_ALS_CFG2 0x10 | ||
46 | #define AAT2870_AMB 0x11 | ||
47 | #define AAT2870_ALS0 0x12 | ||
48 | #define AAT2870_ALS1 0x13 | ||
49 | #define AAT2870_ALS2 0x14 | ||
50 | #define AAT2870_ALS3 0x15 | ||
51 | #define AAT2870_ALS4 0x16 | ||
52 | #define AAT2870_ALS5 0x17 | ||
53 | #define AAT2870_ALS6 0x18 | ||
54 | #define AAT2870_ALS7 0x19 | ||
55 | #define AAT2870_ALS8 0x1A | ||
56 | #define AAT2870_ALS9 0x1B | ||
57 | #define AAT2870_ALSA 0x1C | ||
58 | #define AAT2870_ALSB 0x1D | ||
59 | #define AAT2870_ALSC 0x1E | ||
60 | #define AAT2870_ALSD 0x1F | ||
61 | #define AAT2870_ALSE 0x20 | ||
62 | #define AAT2870_ALSF 0x21 | ||
63 | #define AAT2870_SUB_SET 0x22 | ||
64 | #define AAT2870_SUB_CTRL 0x23 | ||
65 | #define AAT2870_LDO_AB 0x24 | ||
66 | #define AAT2870_LDO_CD 0x25 | ||
67 | #define AAT2870_LDO_EN 0x26 | ||
68 | #define AAT2870_REG_NUM 0x27 | ||
69 | |||
70 | /* Device IDs */ | ||
71 | enum aat2870_id { | ||
72 | AAT2870_ID_BL, | ||
73 | AAT2870_ID_LDOA, | ||
74 | AAT2870_ID_LDOB, | ||
75 | AAT2870_ID_LDOC, | ||
76 | AAT2870_ID_LDOD | ||
77 | }; | ||
78 | |||
79 | /* Backlight channels */ | ||
80 | #define AAT2870_BL_CH1 0x01 | ||
81 | #define AAT2870_BL_CH2 0x02 | ||
82 | #define AAT2870_BL_CH3 0x04 | ||
83 | #define AAT2870_BL_CH4 0x08 | ||
84 | #define AAT2870_BL_CH5 0x10 | ||
85 | #define AAT2870_BL_CH6 0x20 | ||
86 | #define AAT2870_BL_CH7 0x40 | ||
87 | #define AAT2870_BL_CH8 0x80 | ||
88 | #define AAT2870_BL_CH_ALL 0xFF | ||
89 | |||
90 | /* Backlight current magnitude (mA) */ | ||
91 | enum aat2870_current { | ||
92 | AAT2870_CURRENT_0_45 = 1, | ||
93 | AAT2870_CURRENT_0_90, | ||
94 | AAT2870_CURRENT_1_80, | ||
95 | AAT2870_CURRENT_2_70, | ||
96 | AAT2870_CURRENT_3_60, | ||
97 | AAT2870_CURRENT_4_50, | ||
98 | AAT2870_CURRENT_5_40, | ||
99 | AAT2870_CURRENT_6_30, | ||
100 | AAT2870_CURRENT_7_20, | ||
101 | AAT2870_CURRENT_8_10, | ||
102 | AAT2870_CURRENT_9_00, | ||
103 | AAT2870_CURRENT_9_90, | ||
104 | AAT2870_CURRENT_10_8, | ||
105 | AAT2870_CURRENT_11_7, | ||
106 | AAT2870_CURRENT_12_6, | ||
107 | AAT2870_CURRENT_13_5, | ||
108 | AAT2870_CURRENT_14_4, | ||
109 | AAT2870_CURRENT_15_3, | ||
110 | AAT2870_CURRENT_16_2, | ||
111 | AAT2870_CURRENT_17_1, | ||
112 | AAT2870_CURRENT_18_0, | ||
113 | AAT2870_CURRENT_18_9, | ||
114 | AAT2870_CURRENT_19_8, | ||
115 | AAT2870_CURRENT_20_7, | ||
116 | AAT2870_CURRENT_21_6, | ||
117 | AAT2870_CURRENT_22_5, | ||
118 | AAT2870_CURRENT_23_4, | ||
119 | AAT2870_CURRENT_24_3, | ||
120 | AAT2870_CURRENT_25_2, | ||
121 | AAT2870_CURRENT_26_1, | ||
122 | AAT2870_CURRENT_27_0, | ||
123 | AAT2870_CURRENT_27_9 | ||
124 | }; | ||
125 | |||
126 | struct aat2870_register { | ||
127 | bool readable; | ||
128 | bool writeable; | ||
129 | u8 value; | ||
130 | }; | ||
131 | |||
132 | struct aat2870_data { | ||
133 | struct device *dev; | ||
134 | struct i2c_client *client; | ||
135 | |||
136 | struct mutex io_lock; | ||
137 | struct aat2870_register *reg_cache; /* register cache */ | ||
138 | int en_pin; /* enable GPIO pin (if < 0, ignore this value) */ | ||
139 | bool is_enable; | ||
140 | |||
141 | /* init and uninit for platform specified */ | ||
142 | int (*init)(struct aat2870_data *aat2870); | ||
143 | void (*uninit)(struct aat2870_data *aat2870); | ||
144 | |||
145 | /* i2c io funcntions */ | ||
146 | int (*read)(struct aat2870_data *aat2870, u8 addr, u8 *val); | ||
147 | int (*write)(struct aat2870_data *aat2870, u8 addr, u8 val); | ||
148 | int (*update)(struct aat2870_data *aat2870, u8 addr, u8 mask, u8 val); | ||
149 | |||
150 | /* for debugfs */ | ||
151 | struct dentry *dentry_root; | ||
152 | struct dentry *dentry_reg; | ||
153 | }; | ||
154 | |||
155 | struct aat2870_subdev_info { | ||
156 | int id; | ||
157 | const char *name; | ||
158 | void *platform_data; | ||
159 | }; | ||
160 | |||
161 | struct aat2870_platform_data { | ||
162 | int en_pin; /* enable GPIO pin (if < 0, ignore this value) */ | ||
163 | |||
164 | struct aat2870_subdev_info *subdevs; | ||
165 | int num_subdevs; | ||
166 | |||
167 | /* init and uninit for platform specified */ | ||
168 | int (*init)(struct aat2870_data *aat2870); | ||
169 | void (*uninit)(struct aat2870_data *aat2870); | ||
170 | }; | ||
171 | |||
172 | struct aat2870_bl_platform_data { | ||
173 | /* backlight channels, default is AAT2870_BL_CH_ALL */ | ||
174 | int channels; | ||
175 | /* backlight current magnitude, default is AAT2870_CURRENT_27_9 */ | ||
176 | int max_current; | ||
177 | /* maximum brightness, default is 255 */ | ||
178 | int max_brightness; | ||
179 | }; | ||
180 | |||
181 | #endif /* __LINUX_MFD_AAT2870_H */ | ||
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index b31843075198..838c6b487cc5 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define AB8500_INTERRUPT 0xE | 28 | #define AB8500_INTERRUPT 0xE |
29 | #define AB8500_RTC 0xF | 29 | #define AB8500_RTC 0xF |
30 | #define AB8500_MISC 0x10 | 30 | #define AB8500_MISC 0x10 |
31 | #define AB8500_DEVELOPMENT 0x11 | ||
31 | #define AB8500_DEBUG 0x12 | 32 | #define AB8500_DEBUG 0x12 |
32 | #define AB8500_PROD_TEST 0x13 | 33 | #define AB8500_PROD_TEST 0x13 |
33 | #define AB8500_OTP_EMUL 0x15 | 34 | #define AB8500_OTP_EMUL 0x15 |
@@ -74,13 +75,6 @@ | |||
74 | #define AB8500_INT_ACC_DETECT_21DB_F 37 | 75 | #define AB8500_INT_ACC_DETECT_21DB_F 37 |
75 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | 76 | #define AB8500_INT_ACC_DETECT_21DB_R 38 |
76 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | 77 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 |
77 | #define AB8500_INT_ACC_DETECT_1DB_F 33 | ||
78 | #define AB8500_INT_ACC_DETECT_1DB_R 34 | ||
79 | #define AB8500_INT_ACC_DETECT_22DB_F 35 | ||
80 | #define AB8500_INT_ACC_DETECT_22DB_R 36 | ||
81 | #define AB8500_INT_ACC_DETECT_21DB_F 37 | ||
82 | #define AB8500_INT_ACC_DETECT_21DB_R 38 | ||
83 | #define AB8500_INT_GP_SW_ADC_CONV_END 39 | ||
84 | #define AB8500_INT_GPIO6R 40 | 78 | #define AB8500_INT_GPIO6R 40 |
85 | #define AB8500_INT_GPIO7R 41 | 79 | #define AB8500_INT_GPIO7R 41 |
86 | #define AB8500_INT_GPIO8R 42 | 80 | #define AB8500_INT_GPIO8R 42 |
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h index 60931d089422..0bbd13dbe336 100644 --- a/include/linux/mfd/max8997.h +++ b/include/linux/mfd/max8997.h | |||
@@ -107,11 +107,16 @@ struct max8997_platform_data { | |||
107 | unsigned int buck5_voltage[8]; | 107 | unsigned int buck5_voltage[8]; |
108 | bool buck5_gpiodvs; | 108 | bool buck5_gpiodvs; |
109 | 109 | ||
110 | /* ---- Charger control ---- */ | ||
111 | /* eoc stands for 'end of charge' */ | ||
112 | int eoc_mA; /* 50 ~ 200mA by 10mA step */ | ||
113 | /* charge Full Timeout */ | ||
114 | int timeout; /* 0 (no timeout), 5, 6, 7 hours */ | ||
115 | |||
110 | /* MUIC: Not implemented */ | 116 | /* MUIC: Not implemented */ |
111 | /* HAPTIC: Not implemented */ | 117 | /* HAPTIC: Not implemented */ |
112 | /* RTC: Not implemented */ | 118 | /* RTC: Not implemented */ |
113 | /* Flash: Not implemented */ | 119 | /* Flash: Not implemented */ |
114 | /* Charger control: Not implemented */ | ||
115 | }; | 120 | }; |
116 | 121 | ||
117 | #endif /* __LINUX_MFD_MAX8998_H */ | 122 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index 61daa167b576..f4f0dfa4698a 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -87,6 +87,15 @@ struct max8998_regulator_data { | |||
87 | * @wakeup: Allow to wake up from suspend | 87 | * @wakeup: Allow to wake up from suspend |
88 | * @rtc_delay: LP3974 RTC chip bug that requires delay after a register | 88 | * @rtc_delay: LP3974 RTC chip bug that requires delay after a register |
89 | * write before reading it. | 89 | * write before reading it. |
90 | * @eoc: End of Charge Level in percent: 10% ~ 45% by 5% step | ||
91 | * If it equals 0, leave it unchanged. | ||
92 | * Otherwise, it is a invalid value. | ||
93 | * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable. | ||
94 | * If it equals 0, leave it unchanged. | ||
95 | * Otherwise, it is a invalid value. | ||
96 | * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable. | ||
97 | * If it equals 0, leave it unchanged. | ||
98 | * Otherwise, leave it unchanged. | ||
90 | */ | 99 | */ |
91 | struct max8998_platform_data { | 100 | struct max8998_platform_data { |
92 | struct max8998_regulator_data *regulators; | 101 | struct max8998_regulator_data *regulators; |
@@ -107,6 +116,9 @@ struct max8998_platform_data { | |||
107 | int buck2_default_idx; | 116 | int buck2_default_idx; |
108 | bool wakeup; | 117 | bool wakeup; |
109 | bool rtc_delay; | 118 | bool rtc_delay; |
119 | int eoc; | ||
120 | int restart; | ||
121 | int timeout; | ||
110 | }; | 122 | }; |
111 | 123 | ||
112 | #endif /* __LINUX_MFD_MAX8998_H */ | 124 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/pm8xxx/rtc.h b/include/linux/mfd/pm8xxx/rtc.h new file mode 100644 index 000000000000..14f1983eaecc --- /dev/null +++ b/include/linux/mfd/pm8xxx/rtc.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | */ | ||
12 | |||
13 | #ifndef __RTC_PM8XXX_H__ | ||
14 | #define __RTC_PM8XXX_H__ | ||
15 | |||
16 | #define PM8XXX_RTC_DEV_NAME "rtc-pm8xxx" | ||
17 | /** | ||
18 | * struct pm8xxx_rtc_pdata - RTC driver platform data | ||
19 | * @rtc_write_enable: variable stating RTC write capability | ||
20 | */ | ||
21 | struct pm8xxx_rtc_platform_data { | ||
22 | bool rtc_write_enable; | ||
23 | }; | ||
24 | |||
25 | #endif /* __RTC_PM8XXX_H__ */ | ||
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index e762c270d8d4..be1af7c42e57 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
@@ -57,6 +57,7 @@ struct stmpe_variant_info; | |||
57 | * @irq_lock: IRQ bus lock | 57 | * @irq_lock: IRQ bus lock |
58 | * @dev: device, mostly for dev_dbg() | 58 | * @dev: device, mostly for dev_dbg() |
59 | * @i2c: i2c client | 59 | * @i2c: i2c client |
60 | * @partnum: part number | ||
60 | * @variant: the detected STMPE model number | 61 | * @variant: the detected STMPE model number |
61 | * @regs: list of addresses of registers which are at different addresses on | 62 | * @regs: list of addresses of registers which are at different addresses on |
62 | * different variants. Indexed by one of STMPE_IDX_*. | 63 | * different variants. Indexed by one of STMPE_IDX_*. |
@@ -121,6 +122,8 @@ struct stmpe_keypad_platform_data { | |||
121 | * @norequest_mask: bitmask specifying which GPIOs should _not_ be | 122 | * @norequest_mask: bitmask specifying which GPIOs should _not_ be |
122 | * requestable due to different usage (e.g. touch, keypad) | 123 | * requestable due to different usage (e.g. touch, keypad) |
123 | * STMPE_GPIO_NOREQ_* macros can be used here. | 124 | * STMPE_GPIO_NOREQ_* macros can be used here. |
125 | * @setup: board specific setup callback. | ||
126 | * @remove: board specific remove callback | ||
124 | */ | 127 | */ |
125 | struct stmpe_gpio_platform_data { | 128 | struct stmpe_gpio_platform_data { |
126 | int gpio_base; | 129 | int gpio_base; |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 5a90266c3a5a..0dc98044d8b7 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -68,6 +68,11 @@ | |||
68 | * controller and report the event to the driver. | 68 | * controller and report the event to the driver. |
69 | */ | 69 | */ |
70 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) | 70 | #define TMIO_MMC_HAS_COLD_CD (1 << 3) |
71 | /* | ||
72 | * Some controllers require waiting for the SD bus to become | ||
73 | * idle before writing to some registers. | ||
74 | */ | ||
75 | #define TMIO_MMC_HAS_IDLE_WAIT (1 << 4) | ||
71 | 76 | ||
72 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 77 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
73 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 78 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
@@ -80,6 +85,8 @@ struct tmio_mmc_dma { | |||
80 | int alignment_shift; | 85 | int alignment_shift; |
81 | }; | 86 | }; |
82 | 87 | ||
88 | struct tmio_mmc_host; | ||
89 | |||
83 | /* | 90 | /* |
84 | * data for the MMC controller | 91 | * data for the MMC controller |
85 | */ | 92 | */ |
@@ -94,6 +101,7 @@ struct tmio_mmc_data { | |||
94 | void (*set_pwr)(struct platform_device *host, int state); | 101 | void (*set_pwr)(struct platform_device *host, int state); |
95 | void (*set_clk_div)(struct platform_device *host, int state); | 102 | void (*set_clk_div)(struct platform_device *host, int state); |
96 | int (*get_cd)(struct platform_device *host); | 103 | int (*get_cd)(struct platform_device *host); |
104 | int (*write16_hook)(struct tmio_mmc_host *host, int addr); | ||
97 | }; | 105 | }; |
98 | 106 | ||
99 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) | 107 | static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 8bb85b930c07..82b4c8801a4f 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -269,7 +269,7 @@ | |||
269 | #define LDO1_SEL_MASK 0xFC | 269 | #define LDO1_SEL_MASK 0xFC |
270 | #define LDO3_SEL_MASK 0x7C | 270 | #define LDO3_SEL_MASK 0x7C |
271 | #define LDO_MIN_VOLT 1000 | 271 | #define LDO_MIN_VOLT 1000 |
272 | #define LDO_MAX_VOLT 3300; | 272 | #define LDO_MAX_VOLT 3300 |
273 | 273 | ||
274 | 274 | ||
275 | /*Register VDIG1 (0x80) register.RegisterDescription */ | 275 | /*Register VDIG1 (0x80) register.RegisterDescription */ |
@@ -791,6 +791,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask); | |||
791 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); | 791 | void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); |
792 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, | 792 | int tps65910_irq_init(struct tps65910 *tps65910, int irq, |
793 | struct tps65910_platform_data *pdata); | 793 | struct tps65910_platform_data *pdata); |
794 | int tps65910_irq_exit(struct tps65910 *tps65910); | ||
794 | 795 | ||
795 | static inline int tps65910_chip_id(struct tps65910 *tps65910) | 796 | static inline int tps65910_chip_id(struct tps65910 *tps65910) |
796 | { | 797 | { |
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h new file mode 100644 index 000000000000..aaceab402ec5 --- /dev/null +++ b/include/linux/mfd/tps65912.h | |||
@@ -0,0 +1,327 @@ | |||
1 | /* | ||
2 | * tps65912.h -- TI TPS6591x | ||
3 | * | ||
4 | * Copyright 2011 Texas Instruments Inc. | ||
5 | * | ||
6 | * Author: Margarita Olaya <magi@slimlogic.co.uk> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_MFD_TPS65912_H | ||
16 | #define __LINUX_MFD_TPS65912_H | ||
17 | |||
18 | /* TPS regulator type list */ | ||
19 | #define REGULATOR_LDO 0 | ||
20 | #define REGULATOR_DCDC 1 | ||
21 | |||
22 | /* | ||
23 | * List of registers for TPS65912 | ||
24 | */ | ||
25 | |||
26 | #define TPS65912_DCDC1_CTRL 0x00 | ||
27 | #define TPS65912_DCDC2_CTRL 0x01 | ||
28 | #define TPS65912_DCDC3_CTRL 0x02 | ||
29 | #define TPS65912_DCDC4_CTRL 0x03 | ||
30 | #define TPS65912_DCDC1_OP 0x04 | ||
31 | #define TPS65912_DCDC1_AVS 0x05 | ||
32 | #define TPS65912_DCDC1_LIMIT 0x06 | ||
33 | #define TPS65912_DCDC2_OP 0x07 | ||
34 | #define TPS65912_DCDC2_AVS 0x08 | ||
35 | #define TPS65912_DCDC2_LIMIT 0x09 | ||
36 | #define TPS65912_DCDC3_OP 0x0A | ||
37 | #define TPS65912_DCDC3_AVS 0x0B | ||
38 | #define TPS65912_DCDC3_LIMIT 0x0C | ||
39 | #define TPS65912_DCDC4_OP 0x0D | ||
40 | #define TPS65912_DCDC4_AVS 0x0E | ||
41 | #define TPS65912_DCDC4_LIMIT 0x0F | ||
42 | #define TPS65912_LDO1_OP 0x10 | ||
43 | #define TPS65912_LDO1_AVS 0x11 | ||
44 | #define TPS65912_LDO1_LIMIT 0x12 | ||
45 | #define TPS65912_LDO2_OP 0x13 | ||
46 | #define TPS65912_LDO2_AVS 0x14 | ||
47 | #define TPS65912_LDO2_LIMIT 0x15 | ||
48 | #define TPS65912_LDO3_OP 0x16 | ||
49 | #define TPS65912_LDO3_AVS 0x17 | ||
50 | #define TPS65912_LDO3_LIMIT 0x18 | ||
51 | #define TPS65912_LDO4_OP 0x19 | ||
52 | #define TPS65912_LDO4_AVS 0x1A | ||
53 | #define TPS65912_LDO4_LIMIT 0x1B | ||
54 | #define TPS65912_LDO5 0x1C | ||
55 | #define TPS65912_LDO6 0x1D | ||
56 | #define TPS65912_LDO7 0x1E | ||
57 | #define TPS65912_LDO8 0x1F | ||
58 | #define TPS65912_LDO9 0x20 | ||
59 | #define TPS65912_LDO10 0x21 | ||
60 | #define TPS65912_THRM 0x22 | ||
61 | #define TPS65912_CLK32OUT 0x23 | ||
62 | #define TPS65912_DEVCTRL 0x24 | ||
63 | #define TPS65912_DEVCTRL2 0x25 | ||
64 | #define TPS65912_I2C_SPI_CFG 0x26 | ||
65 | #define TPS65912_KEEP_ON 0x27 | ||
66 | #define TPS65912_KEEP_ON2 0x28 | ||
67 | #define TPS65912_SET_OFF1 0x29 | ||
68 | #define TPS65912_SET_OFF2 0x2A | ||
69 | #define TPS65912_DEF_VOLT 0x2B | ||
70 | #define TPS65912_DEF_VOLT_MAPPING 0x2C | ||
71 | #define TPS65912_DISCHARGE 0x2D | ||
72 | #define TPS65912_DISCHARGE2 0x2E | ||
73 | #define TPS65912_EN1_SET1 0x2F | ||
74 | #define TPS65912_EN1_SET2 0x30 | ||
75 | #define TPS65912_EN2_SET1 0x31 | ||
76 | #define TPS65912_EN2_SET2 0x32 | ||
77 | #define TPS65912_EN3_SET1 0x33 | ||
78 | #define TPS65912_EN3_SET2 0x34 | ||
79 | #define TPS65912_EN4_SET1 0x35 | ||
80 | #define TPS65912_EN4_SET2 0x36 | ||
81 | #define TPS65912_PGOOD 0x37 | ||
82 | #define TPS65912_PGOOD2 0x38 | ||
83 | #define TPS65912_INT_STS 0x39 | ||
84 | #define TPS65912_INT_MSK 0x3A | ||
85 | #define TPS65912_INT_STS2 0x3B | ||
86 | #define TPS65912_INT_MSK2 0x3C | ||
87 | #define TPS65912_INT_STS3 0x3D | ||
88 | #define TPS65912_INT_MSK3 0x3E | ||
89 | #define TPS65912_INT_STS4 0x3F | ||
90 | #define TPS65912_INT_MSK4 0x40 | ||
91 | #define TPS65912_GPIO1 0x41 | ||
92 | #define TPS65912_GPIO2 0x42 | ||
93 | #define TPS65912_GPIO3 0x43 | ||
94 | #define TPS65912_GPIO4 0x44 | ||
95 | #define TPS65912_GPIO5 0x45 | ||
96 | #define TPS65912_VMON 0x46 | ||
97 | #define TPS65912_LEDA_CTRL1 0x47 | ||
98 | #define TPS65912_LEDA_CTRL2 0x48 | ||
99 | #define TPS65912_LEDA_CTRL3 0x49 | ||
100 | #define TPS65912_LEDA_CTRL4 0x4A | ||
101 | #define TPS65912_LEDA_CTRL5 0x4B | ||
102 | #define TPS65912_LEDA_CTRL6 0x4C | ||
103 | #define TPS65912_LEDA_CTRL7 0x4D | ||
104 | #define TPS65912_LEDA_CTRL8 0x4E | ||
105 | #define TPS65912_LEDB_CTRL1 0x4F | ||
106 | #define TPS65912_LEDB_CTRL2 0x50 | ||
107 | #define TPS65912_LEDB_CTRL3 0x51 | ||
108 | #define TPS65912_LEDB_CTRL4 0x52 | ||
109 | #define TPS65912_LEDB_CTRL5 0x53 | ||
110 | #define TPS65912_LEDB_CTRL6 0x54 | ||
111 | #define TPS65912_LEDB_CTRL7 0x55 | ||
112 | #define TPS65912_LEDB_CTRL8 0x56 | ||
113 | #define TPS65912_LEDC_CTRL1 0x57 | ||
114 | #define TPS65912_LEDC_CTRL2 0x58 | ||
115 | #define TPS65912_LEDC_CTRL3 0x59 | ||
116 | #define TPS65912_LEDC_CTRL4 0x5A | ||
117 | #define TPS65912_LEDC_CTRL5 0x5B | ||
118 | #define TPS65912_LEDC_CTRL6 0x5C | ||
119 | #define TPS65912_LEDC_CTRL7 0x5D | ||
120 | #define TPS65912_LEDC_CTRL8 0x5E | ||
121 | #define TPS65912_LED_RAMP_UP_TIME 0x5F | ||
122 | #define TPS65912_LED_RAMP_DOWN_TIME 0x60 | ||
123 | #define TPS65912_LED_SEQ_EN 0x61 | ||
124 | #define TPS65912_LOADSWITCH 0x62 | ||
125 | #define TPS65912_SPARE 0x63 | ||
126 | #define TPS65912_VERNUM 0x64 | ||
127 | #define TPS6591X_MAX_REGISTER 0x64 | ||
128 | |||
129 | /* IRQ Definitions */ | ||
130 | #define TPS65912_IRQ_PWRHOLD_F 0 | ||
131 | #define TPS65912_IRQ_VMON 1 | ||
132 | #define TPS65912_IRQ_PWRON 2 | ||
133 | #define TPS65912_IRQ_PWRON_LP 3 | ||
134 | #define TPS65912_IRQ_PWRHOLD_R 4 | ||
135 | #define TPS65912_IRQ_HOTDIE 5 | ||
136 | #define TPS65912_IRQ_GPIO1_R 6 | ||
137 | #define TPS65912_IRQ_GPIO1_F 7 | ||
138 | #define TPS65912_IRQ_GPIO2_R 8 | ||
139 | #define TPS65912_IRQ_GPIO2_F 9 | ||
140 | #define TPS65912_IRQ_GPIO3_R 10 | ||
141 | #define TPS65912_IRQ_GPIO3_F 11 | ||
142 | #define TPS65912_IRQ_GPIO4_R 12 | ||
143 | #define TPS65912_IRQ_GPIO4_F 13 | ||
144 | #define TPS65912_IRQ_GPIO5_R 14 | ||
145 | #define TPS65912_IRQ_GPIO5_F 15 | ||
146 | #define TPS65912_IRQ_PGOOD_DCDC1 16 | ||
147 | #define TPS65912_IRQ_PGOOD_DCDC2 17 | ||
148 | #define TPS65912_IRQ_PGOOD_DCDC3 18 | ||
149 | #define TPS65912_IRQ_PGOOD_DCDC4 19 | ||
150 | #define TPS65912_IRQ_PGOOD_LDO1 20 | ||
151 | #define TPS65912_IRQ_PGOOD_LDO2 21 | ||
152 | #define TPS65912_IRQ_PGOOD_LDO3 22 | ||
153 | #define TPS65912_IRQ_PGOOD_LDO4 23 | ||
154 | #define TPS65912_IRQ_PGOOD_LDO5 24 | ||
155 | #define TPS65912_IRQ_PGOOD_LDO6 25 | ||
156 | #define TPS65912_IRQ_PGOOD_LDO7 26 | ||
157 | #define TPS65912_IRQ_PGOOD_LD08 27 | ||
158 | #define TPS65912_IRQ_PGOOD_LDO9 28 | ||
159 | #define TPS65912_IRQ_PGOOD_LDO10 29 | ||
160 | |||
161 | #define TPS65912_NUM_IRQ 30 | ||
162 | |||
163 | /* GPIO 1 and 2 Register Definitions */ | ||
164 | #define GPIO_SLEEP_MASK 0x80 | ||
165 | #define GPIO_SLEEP_SHIFT 7 | ||
166 | #define GPIO_DEB_MASK 0x10 | ||
167 | #define GPIO_DEB_SHIFT 4 | ||
168 | #define GPIO_CFG_MASK 0x04 | ||
169 | #define GPIO_CFG_SHIFT 2 | ||
170 | #define GPIO_STS_MASK 0x02 | ||
171 | #define GPIO_STS_SHIFT 1 | ||
172 | #define GPIO_SET_MASK 0x01 | ||
173 | #define GPIO_SET_SHIFT 0 | ||
174 | |||
175 | /* GPIO 3 Register Definitions */ | ||
176 | #define GPIO3_SLEEP_MASK 0x80 | ||
177 | #define GPIO3_SLEEP_SHIFT 7 | ||
178 | #define GPIO3_SEL_MASK 0x40 | ||
179 | #define GPIO3_SEL_SHIFT 6 | ||
180 | #define GPIO3_ODEN_MASK 0x20 | ||
181 | #define GPIO3_ODEN_SHIFT 5 | ||
182 | #define GPIO3_DEB_MASK 0x10 | ||
183 | #define GPIO3_DEB_SHIFT 4 | ||
184 | #define GPIO3_PDEN_MASK 0x08 | ||
185 | #define GPIO3_PDEN_SHIFT 3 | ||
186 | #define GPIO3_CFG_MASK 0x04 | ||
187 | #define GPIO3_CFG_SHIFT 2 | ||
188 | #define GPIO3_STS_MASK 0x02 | ||
189 | #define GPIO3_STS_SHIFT 1 | ||
190 | #define GPIO3_SET_MASK 0x01 | ||
191 | #define GPIO3_SET_SHIFT 0 | ||
192 | |||
193 | /* GPIO 4 Register Definitions */ | ||
194 | #define GPIO4_SLEEP_MASK 0x80 | ||
195 | #define GPIO4_SLEEP_SHIFT 7 | ||
196 | #define GPIO4_SEL_MASK 0x40 | ||
197 | #define GPIO4_SEL_SHIFT 6 | ||
198 | #define GPIO4_ODEN_MASK 0x20 | ||
199 | #define GPIO4_ODEN_SHIFT 5 | ||
200 | #define GPIO4_DEB_MASK 0x10 | ||
201 | #define GPIO4_DEB_SHIFT 4 | ||
202 | #define GPIO4_PDEN_MASK 0x08 | ||
203 | #define GPIO4_PDEN_SHIFT 3 | ||
204 | #define GPIO4_CFG_MASK 0x04 | ||
205 | #define GPIO4_CFG_SHIFT 2 | ||
206 | #define GPIO4_STS_MASK 0x02 | ||
207 | #define GPIO4_STS_SHIFT 1 | ||
208 | #define GPIO4_SET_MASK 0x01 | ||
209 | #define GPIO4_SET_SHIFT 0 | ||
210 | |||
211 | /* Register THERM (0x80) register.RegisterDescription */ | ||
212 | #define THERM_THERM_HD_MASK 0x20 | ||
213 | #define THERM_THERM_HD_SHIFT 5 | ||
214 | #define THERM_THERM_TS_MASK 0x10 | ||
215 | #define THERM_THERM_TS_SHIFT 4 | ||
216 | #define THERM_THERM_HDSEL_MASK 0x0C | ||
217 | #define THERM_THERM_HDSEL_SHIFT 2 | ||
218 | #define THERM_RSVD1_MASK 0x02 | ||
219 | #define THERM_RSVD1_SHIFT 1 | ||
220 | #define THERM_THERM_STATE_MASK 0x01 | ||
221 | #define THERM_THERM_STATE_SHIFT 0 | ||
222 | |||
223 | /* Register DCDCCTRL1 register.RegisterDescription */ | ||
224 | #define DCDCCTRL_VCON_ENABLE_MASK 0x80 | ||
225 | #define DCDCCTRL_VCON_ENABLE_SHIFT 7 | ||
226 | #define DCDCCTRL_VCON_RANGE1_MASK 0x40 | ||
227 | #define DCDCCTRL_VCON_RANGE1_SHIFT 6 | ||
228 | #define DCDCCTRL_VCON_RANGE0_MASK 0x20 | ||
229 | #define DCDCCTRL_VCON_RANGE0_SHIFT 5 | ||
230 | #define DCDCCTRL_TSTEP2_MASK 0x10 | ||
231 | #define DCDCCTRL_TSTEP2_SHIFT 4 | ||
232 | #define DCDCCTRL_TSTEP1_MASK 0x08 | ||
233 | #define DCDCCTRL_TSTEP1_SHIFT 3 | ||
234 | #define DCDCCTRL_TSTEP0_MASK 0x04 | ||
235 | #define DCDCCTRL_TSTEP0_SHIFT 2 | ||
236 | #define DCDCCTRL_DCDC1_MODE_MASK 0x02 | ||
237 | #define DCDCCTRL_DCDC1_MODE_SHIFT 1 | ||
238 | |||
239 | /* Register DCDCCTRL2 and DCDCCTRL3 register.RegisterDescription */ | ||
240 | #define DCDCCTRL_TSTEP2_MASK 0x10 | ||
241 | #define DCDCCTRL_TSTEP2_SHIFT 4 | ||
242 | #define DCDCCTRL_TSTEP1_MASK 0x08 | ||
243 | #define DCDCCTRL_TSTEP1_SHIFT 3 | ||
244 | #define DCDCCTRL_TSTEP0_MASK 0x04 | ||
245 | #define DCDCCTRL_TSTEP0_SHIFT 2 | ||
246 | #define DCDCCTRL_DCDC_MODE_MASK 0x02 | ||
247 | #define DCDCCTRL_DCDC_MODE_SHIFT 1 | ||
248 | #define DCDCCTRL_RSVD0_MASK 0x01 | ||
249 | #define DCDCCTRL_RSVD0_SHIFT 0 | ||
250 | |||
251 | /* Register DCDCCTRL4 register.RegisterDescription */ | ||
252 | #define DCDCCTRL_RAMP_TIME_MASK 0x01 | ||
253 | #define DCDCCTRL_RAMP_TIME_SHIFT 0 | ||
254 | |||
255 | /* Register DCDCx_AVS */ | ||
256 | #define DCDC_AVS_ENABLE_MASK 0x80 | ||
257 | #define DCDC_AVS_ENABLE_SHIFT 7 | ||
258 | #define DCDC_AVS_ECO_MASK 0x40 | ||
259 | #define DCDC_AVS_ECO_SHIFT 6 | ||
260 | |||
261 | /* Register DCDCx_LIMIT */ | ||
262 | #define DCDC_LIMIT_RANGE_MASK 0xC0 | ||
263 | #define DCDC_LIMIT_RANGE_SHIFT 6 | ||
264 | #define DCDC_LIMIT_MAX_SEL_MASK 0x3F | ||
265 | #define DCDC_LIMIT_MAX_SEL_SHIFT 0 | ||
266 | |||
267 | /** | ||
268 | * struct tps65912_board | ||
269 | * Board platform dat may be used to initialize regulators. | ||
270 | */ | ||
271 | struct tps65912_board { | ||
272 | int is_dcdc1_avs; | ||
273 | int is_dcdc2_avs; | ||
274 | int is_dcdc3_avs; | ||
275 | int is_dcdc4_avs; | ||
276 | int irq; | ||
277 | int irq_base; | ||
278 | int gpio_base; | ||
279 | struct regulator_init_data *tps65912_pmic_init_data; | ||
280 | }; | ||
281 | |||
282 | /** | ||
283 | * struct tps65912 - tps65912 sub-driver chip access routines | ||
284 | */ | ||
285 | |||
286 | struct tps65912 { | ||
287 | struct device *dev; | ||
288 | /* for read/write acces */ | ||
289 | struct mutex io_mutex; | ||
290 | |||
291 | /* For device IO interfaces: I2C or SPI */ | ||
292 | void *control_data; | ||
293 | |||
294 | int (*read)(struct tps65912 *tps65912, u8 reg, int size, void *dest); | ||
295 | int (*write)(struct tps65912 *tps65912, u8 reg, int size, void *src); | ||
296 | |||
297 | /* Client devices */ | ||
298 | struct tps65912_pmic *pmic; | ||
299 | |||
300 | /* GPIO Handling */ | ||
301 | struct gpio_chip gpio; | ||
302 | |||
303 | /* IRQ Handling */ | ||
304 | struct mutex irq_lock; | ||
305 | int chip_irq; | ||
306 | int irq_base; | ||
307 | int irq_num; | ||
308 | u32 irq_mask; | ||
309 | }; | ||
310 | |||
311 | struct tps65912_platform_data { | ||
312 | int irq; | ||
313 | int irq_base; | ||
314 | }; | ||
315 | |||
316 | unsigned int tps_chip(void); | ||
317 | |||
318 | int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask); | ||
319 | int tps65912_clear_bits(struct tps65912 *tps65912, u8 reg, u8 mask); | ||
320 | int tps65912_reg_read(struct tps65912 *tps65912, u8 reg); | ||
321 | int tps65912_reg_write(struct tps65912 *tps65912, u8 reg, u8 val); | ||
322 | int tps65912_device_init(struct tps65912 *tps65912); | ||
323 | void tps65912_device_exit(struct tps65912 *tps65912); | ||
324 | int tps65912_irq_init(struct tps65912 *tps65912, int irq, | ||
325 | struct tps65912_platform_data *pdata); | ||
326 | |||
327 | #endif /* __LINUX_MFD_TPS65912_H */ | ||
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-audio.h index 5cc16bbd1da1..3d22b72df076 100644 --- a/include/linux/mfd/twl4030-codec.h +++ b/include/linux/mfd/twl4030-audio.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * MFD driver for twl4030 codec submodule | 2 | * MFD driver for twl4030 audio submodule |
3 | * | 3 | * |
4 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> | 4 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> |
5 | * | 5 | * |
@@ -259,14 +259,14 @@ | |||
259 | #define TWL4030_VIBRA_DIR_SEL 0x20 | 259 | #define TWL4030_VIBRA_DIR_SEL 0x20 |
260 | 260 | ||
261 | /* TWL4030 codec resource IDs */ | 261 | /* TWL4030 codec resource IDs */ |
262 | enum twl4030_codec_res { | 262 | enum twl4030_audio_res { |
263 | TWL4030_CODEC_RES_POWER = 0, | 263 | TWL4030_AUDIO_RES_POWER = 0, |
264 | TWL4030_CODEC_RES_APLL, | 264 | TWL4030_AUDIO_RES_APLL, |
265 | TWL4030_CODEC_RES_MAX, | 265 | TWL4030_AUDIO_RES_MAX, |
266 | }; | 266 | }; |
267 | 267 | ||
268 | int twl4030_codec_disable_resource(enum twl4030_codec_res id); | 268 | int twl4030_audio_disable_resource(enum twl4030_audio_res id); |
269 | int twl4030_codec_enable_resource(enum twl4030_codec_res id); | 269 | int twl4030_audio_enable_resource(enum twl4030_audio_res id); |
270 | unsigned int twl4030_codec_get_mclk(void); | 270 | unsigned int twl4030_audio_get_mclk(void); |
271 | 271 | ||
272 | #endif /* End of __TWL4030_CODEC_H__ */ | 272 | #endif /* End of __TWL4030_CODEC_H__ */ |
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h new file mode 100644 index 000000000000..4c806f6d663e --- /dev/null +++ b/include/linux/mfd/twl6040.h | |||
@@ -0,0 +1,228 @@ | |||
1 | /* | ||
2 | * MFD driver for twl6040 | ||
3 | * | ||
4 | * Authors: Jorge Eduardo Candelaria <jorge.candelaria@ti.com> | ||
5 | * Misael Lopez Cruz <misael.lopez@ti.com> | ||
6 | * | ||
7 | * Copyright: (C) 2011 Texas Instruments, 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 version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * 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 | ||
21 | * 02110-1301 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __TWL6040_CODEC_H__ | ||
26 | #define __TWL6040_CODEC_H__ | ||
27 | |||
28 | #include <linux/interrupt.h> | ||
29 | #include <linux/mfd/core.h> | ||
30 | |||
31 | #define TWL6040_REG_ASICID 0x01 | ||
32 | #define TWL6040_REG_ASICREV 0x02 | ||
33 | #define TWL6040_REG_INTID 0x03 | ||
34 | #define TWL6040_REG_INTMR 0x04 | ||
35 | #define TWL6040_REG_NCPCTL 0x05 | ||
36 | #define TWL6040_REG_LDOCTL 0x06 | ||
37 | #define TWL6040_REG_HPPLLCTL 0x07 | ||
38 | #define TWL6040_REG_LPPLLCTL 0x08 | ||
39 | #define TWL6040_REG_LPPLLDIV 0x09 | ||
40 | #define TWL6040_REG_AMICBCTL 0x0A | ||
41 | #define TWL6040_REG_DMICBCTL 0x0B | ||
42 | #define TWL6040_REG_MICLCTL 0x0C | ||
43 | #define TWL6040_REG_MICRCTL 0x0D | ||
44 | #define TWL6040_REG_MICGAIN 0x0E | ||
45 | #define TWL6040_REG_LINEGAIN 0x0F | ||
46 | #define TWL6040_REG_HSLCTL 0x10 | ||
47 | #define TWL6040_REG_HSRCTL 0x11 | ||
48 | #define TWL6040_REG_HSGAIN 0x12 | ||
49 | #define TWL6040_REG_EARCTL 0x13 | ||
50 | #define TWL6040_REG_HFLCTL 0x14 | ||
51 | #define TWL6040_REG_HFLGAIN 0x15 | ||
52 | #define TWL6040_REG_HFRCTL 0x16 | ||
53 | #define TWL6040_REG_HFRGAIN 0x17 | ||
54 | #define TWL6040_REG_VIBCTLL 0x18 | ||
55 | #define TWL6040_REG_VIBDATL 0x19 | ||
56 | #define TWL6040_REG_VIBCTLR 0x1A | ||
57 | #define TWL6040_REG_VIBDATR 0x1B | ||
58 | #define TWL6040_REG_HKCTL1 0x1C | ||
59 | #define TWL6040_REG_HKCTL2 0x1D | ||
60 | #define TWL6040_REG_GPOCTL 0x1E | ||
61 | #define TWL6040_REG_ALB 0x1F | ||
62 | #define TWL6040_REG_DLB 0x20 | ||
63 | #define TWL6040_REG_TRIM1 0x28 | ||
64 | #define TWL6040_REG_TRIM2 0x29 | ||
65 | #define TWL6040_REG_TRIM3 0x2A | ||
66 | #define TWL6040_REG_HSOTRIM 0x2B | ||
67 | #define TWL6040_REG_HFOTRIM 0x2C | ||
68 | #define TWL6040_REG_ACCCTL 0x2D | ||
69 | #define TWL6040_REG_STATUS 0x2E | ||
70 | |||
71 | #define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1) | ||
72 | |||
73 | #define TWL6040_VIOREGNUM 18 | ||
74 | #define TWL6040_VDDREGNUM 21 | ||
75 | |||
76 | /* INTID (0x03) fields */ | ||
77 | |||
78 | #define TWL6040_THINT 0x01 | ||
79 | #define TWL6040_PLUGINT 0x02 | ||
80 | #define TWL6040_UNPLUGINT 0x04 | ||
81 | #define TWL6040_HOOKINT 0x08 | ||
82 | #define TWL6040_HFINT 0x10 | ||
83 | #define TWL6040_VIBINT 0x20 | ||
84 | #define TWL6040_READYINT 0x40 | ||
85 | |||
86 | /* INTMR (0x04) fields */ | ||
87 | |||
88 | #define TWL6040_THMSK 0x01 | ||
89 | #define TWL6040_PLUGMSK 0x02 | ||
90 | #define TWL6040_HOOKMSK 0x08 | ||
91 | #define TWL6040_HFMSK 0x10 | ||
92 | #define TWL6040_VIBMSK 0x20 | ||
93 | #define TWL6040_READYMSK 0x40 | ||
94 | #define TWL6040_ALLINT_MSK 0x7B | ||
95 | |||
96 | /* NCPCTL (0x05) fields */ | ||
97 | |||
98 | #define TWL6040_NCPENA 0x01 | ||
99 | #define TWL6040_NCPOPEN 0x40 | ||
100 | |||
101 | /* LDOCTL (0x06) fields */ | ||
102 | |||
103 | #define TWL6040_LSLDOENA 0x01 | ||
104 | #define TWL6040_HSLDOENA 0x04 | ||
105 | #define TWL6040_REFENA 0x40 | ||
106 | #define TWL6040_OSCENA 0x80 | ||
107 | |||
108 | /* HPPLLCTL (0x07) fields */ | ||
109 | |||
110 | #define TWL6040_HPLLENA 0x01 | ||
111 | #define TWL6040_HPLLRST 0x02 | ||
112 | #define TWL6040_HPLLBP 0x04 | ||
113 | #define TWL6040_HPLLSQRENA 0x08 | ||
114 | #define TWL6040_MCLK_12000KHZ (0 << 5) | ||
115 | #define TWL6040_MCLK_19200KHZ (1 << 5) | ||
116 | #define TWL6040_MCLK_26000KHZ (2 << 5) | ||
117 | #define TWL6040_MCLK_38400KHZ (3 << 5) | ||
118 | #define TWL6040_MCLK_MSK 0x60 | ||
119 | |||
120 | /* LPPLLCTL (0x08) fields */ | ||
121 | |||
122 | #define TWL6040_LPLLENA 0x01 | ||
123 | #define TWL6040_LPLLRST 0x02 | ||
124 | #define TWL6040_LPLLSEL 0x04 | ||
125 | #define TWL6040_LPLLFIN 0x08 | ||
126 | #define TWL6040_HPLLSEL 0x10 | ||
127 | |||
128 | /* HSLCTL (0x10) fields */ | ||
129 | |||
130 | #define TWL6040_HSDACMODEL 0x02 | ||
131 | #define TWL6040_HSDRVMODEL 0x08 | ||
132 | |||
133 | /* HSRCTL (0x11) fields */ | ||
134 | |||
135 | #define TWL6040_HSDACMODER 0x02 | ||
136 | #define TWL6040_HSDRVMODER 0x08 | ||
137 | |||
138 | /* VIBCTLL (0x18) fields */ | ||
139 | |||
140 | #define TWL6040_VIBENAL 0x01 | ||
141 | #define TWL6040_VIBCTRLL 0x04 | ||
142 | #define TWL6040_VIBCTRLLP 0x08 | ||
143 | #define TWL6040_VIBCTRLLN 0x10 | ||
144 | |||
145 | /* VIBDATL (0x19) fields */ | ||
146 | |||
147 | #define TWL6040_VIBDAT_MAX 0x64 | ||
148 | |||
149 | /* VIBCTLR (0x1A) fields */ | ||
150 | |||
151 | #define TWL6040_VIBENAR 0x01 | ||
152 | #define TWL6040_VIBCTRLR 0x04 | ||
153 | #define TWL6040_VIBCTRLRP 0x08 | ||
154 | #define TWL6040_VIBCTRLRN 0x10 | ||
155 | |||
156 | /* GPOCTL (0x1E) fields */ | ||
157 | |||
158 | #define TWL6040_GPO1 0x01 | ||
159 | #define TWL6040_GPO2 0x02 | ||
160 | #define TWL6040_GPO3 0x03 | ||
161 | |||
162 | /* ACCCTL (0x2D) fields */ | ||
163 | |||
164 | #define TWL6040_I2CSEL 0x01 | ||
165 | #define TWL6040_RESETSPLIT 0x04 | ||
166 | #define TWL6040_INTCLRMODE 0x08 | ||
167 | |||
168 | /* STATUS (0x2E) fields */ | ||
169 | |||
170 | #define TWL6040_PLUGCOMP 0x02 | ||
171 | #define TWL6040_VIBLOCDET 0x10 | ||
172 | #define TWL6040_VIBROCDET 0x20 | ||
173 | #define TWL6040_TSHUTDET 0x40 | ||
174 | |||
175 | #define TWL6040_CELLS 2 | ||
176 | |||
177 | #define TWL6040_REV_ES1_0 0x00 | ||
178 | #define TWL6040_REV_ES1_1 0x01 | ||
179 | #define TWL6040_REV_ES1_2 0x02 | ||
180 | |||
181 | #define TWL6040_IRQ_TH 0 | ||
182 | #define TWL6040_IRQ_PLUG 1 | ||
183 | #define TWL6040_IRQ_HOOK 2 | ||
184 | #define TWL6040_IRQ_HF 3 | ||
185 | #define TWL6040_IRQ_VIB 4 | ||
186 | #define TWL6040_IRQ_READY 5 | ||
187 | |||
188 | /* PLL selection */ | ||
189 | #define TWL6040_SYSCLK_SEL_LPPLL 0 | ||
190 | #define TWL6040_SYSCLK_SEL_HPPLL 1 | ||
191 | |||
192 | struct twl6040 { | ||
193 | struct device *dev; | ||
194 | struct mutex mutex; | ||
195 | struct mutex io_mutex; | ||
196 | struct mutex irq_mutex; | ||
197 | struct mfd_cell cells[TWL6040_CELLS]; | ||
198 | struct completion ready; | ||
199 | |||
200 | int audpwron; | ||
201 | int power_count; | ||
202 | int rev; | ||
203 | |||
204 | int pll; | ||
205 | unsigned int sysclk; | ||
206 | |||
207 | unsigned int irq; | ||
208 | unsigned int irq_base; | ||
209 | u8 irq_masks_cur; | ||
210 | u8 irq_masks_cache; | ||
211 | }; | ||
212 | |||
213 | int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg); | ||
214 | int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, | ||
215 | u8 val); | ||
216 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, | ||
217 | u8 mask); | ||
218 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, | ||
219 | u8 mask); | ||
220 | int twl6040_power(struct twl6040 *twl6040, int on); | ||
221 | int twl6040_set_pll(struct twl6040 *twl6040, int pll_id, | ||
222 | unsigned int freq_in, unsigned int freq_out); | ||
223 | int twl6040_get_pll(struct twl6040 *twl6040); | ||
224 | unsigned int twl6040_get_sysclk(struct twl6040 *twl6040); | ||
225 | int twl6040_irq_init(struct twl6040 *twl6040); | ||
226 | void twl6040_irq_exit(struct twl6040 *twl6040); | ||
227 | |||
228 | #endif /* End of __TWL6040_CODEC_H__ */ | ||
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 0d515ee1c247..8dda8ded5cda 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/list.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * Register values. | 23 | * Register values. |
@@ -234,9 +235,111 @@ | |||
234 | #define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ | 235 | #define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ |
235 | #define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */ | 236 | #define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */ |
236 | 237 | ||
238 | /* | ||
239 | * R16528 (0x4090) - Clock Control 1 | ||
240 | */ | ||
241 | #define WM831X_CLKOUT_ENA 0x8000 /* CLKOUT_ENA */ | ||
242 | #define WM831X_CLKOUT_ENA_MASK 0x8000 /* CLKOUT_ENA */ | ||
243 | #define WM831X_CLKOUT_ENA_SHIFT 15 /* CLKOUT_ENA */ | ||
244 | #define WM831X_CLKOUT_ENA_WIDTH 1 /* CLKOUT_ENA */ | ||
245 | #define WM831X_CLKOUT_OD 0x2000 /* CLKOUT_OD */ | ||
246 | #define WM831X_CLKOUT_OD_MASK 0x2000 /* CLKOUT_OD */ | ||
247 | #define WM831X_CLKOUT_OD_SHIFT 13 /* CLKOUT_OD */ | ||
248 | #define WM831X_CLKOUT_OD_WIDTH 1 /* CLKOUT_OD */ | ||
249 | #define WM831X_CLKOUT_SLOT_MASK 0x0700 /* CLKOUT_SLOT - [10:8] */ | ||
250 | #define WM831X_CLKOUT_SLOT_SHIFT 8 /* CLKOUT_SLOT - [10:8] */ | ||
251 | #define WM831X_CLKOUT_SLOT_WIDTH 3 /* CLKOUT_SLOT - [10:8] */ | ||
252 | #define WM831X_CLKOUT_SLPSLOT_MASK 0x0070 /* CLKOUT_SLPSLOT - [6:4] */ | ||
253 | #define WM831X_CLKOUT_SLPSLOT_SHIFT 4 /* CLKOUT_SLPSLOT - [6:4] */ | ||
254 | #define WM831X_CLKOUT_SLPSLOT_WIDTH 3 /* CLKOUT_SLPSLOT - [6:4] */ | ||
255 | #define WM831X_CLKOUT_SRC 0x0001 /* CLKOUT_SRC */ | ||
256 | #define WM831X_CLKOUT_SRC_MASK 0x0001 /* CLKOUT_SRC */ | ||
257 | #define WM831X_CLKOUT_SRC_SHIFT 0 /* CLKOUT_SRC */ | ||
258 | #define WM831X_CLKOUT_SRC_WIDTH 1 /* CLKOUT_SRC */ | ||
259 | |||
260 | /* | ||
261 | * R16529 (0x4091) - Clock Control 2 | ||
262 | */ | ||
263 | #define WM831X_XTAL_INH 0x8000 /* XTAL_INH */ | ||
264 | #define WM831X_XTAL_INH_MASK 0x8000 /* XTAL_INH */ | ||
265 | #define WM831X_XTAL_INH_SHIFT 15 /* XTAL_INH */ | ||
266 | #define WM831X_XTAL_INH_WIDTH 1 /* XTAL_INH */ | ||
267 | #define WM831X_XTAL_ENA 0x2000 /* XTAL_ENA */ | ||
268 | #define WM831X_XTAL_ENA_MASK 0x2000 /* XTAL_ENA */ | ||
269 | #define WM831X_XTAL_ENA_SHIFT 13 /* XTAL_ENA */ | ||
270 | #define WM831X_XTAL_ENA_WIDTH 1 /* XTAL_ENA */ | ||
271 | #define WM831X_XTAL_BKUPENA 0x1000 /* XTAL_BKUPENA */ | ||
272 | #define WM831X_XTAL_BKUPENA_MASK 0x1000 /* XTAL_BKUPENA */ | ||
273 | #define WM831X_XTAL_BKUPENA_SHIFT 12 /* XTAL_BKUPENA */ | ||
274 | #define WM831X_XTAL_BKUPENA_WIDTH 1 /* XTAL_BKUPENA */ | ||
275 | #define WM831X_FLL_AUTO 0x0080 /* FLL_AUTO */ | ||
276 | #define WM831X_FLL_AUTO_MASK 0x0080 /* FLL_AUTO */ | ||
277 | #define WM831X_FLL_AUTO_SHIFT 7 /* FLL_AUTO */ | ||
278 | #define WM831X_FLL_AUTO_WIDTH 1 /* FLL_AUTO */ | ||
279 | #define WM831X_FLL_AUTO_FREQ_MASK 0x0007 /* FLL_AUTO_FREQ - [2:0] */ | ||
280 | #define WM831X_FLL_AUTO_FREQ_SHIFT 0 /* FLL_AUTO_FREQ - [2:0] */ | ||
281 | #define WM831X_FLL_AUTO_FREQ_WIDTH 3 /* FLL_AUTO_FREQ - [2:0] */ | ||
282 | |||
283 | /* | ||
284 | * R16530 (0x4092) - FLL Control 1 | ||
285 | */ | ||
286 | #define WM831X_FLL_FRAC 0x0004 /* FLL_FRAC */ | ||
287 | #define WM831X_FLL_FRAC_MASK 0x0004 /* FLL_FRAC */ | ||
288 | #define WM831X_FLL_FRAC_SHIFT 2 /* FLL_FRAC */ | ||
289 | #define WM831X_FLL_FRAC_WIDTH 1 /* FLL_FRAC */ | ||
290 | #define WM831X_FLL_OSC_ENA 0x0002 /* FLL_OSC_ENA */ | ||
291 | #define WM831X_FLL_OSC_ENA_MASK 0x0002 /* FLL_OSC_ENA */ | ||
292 | #define WM831X_FLL_OSC_ENA_SHIFT 1 /* FLL_OSC_ENA */ | ||
293 | #define WM831X_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */ | ||
294 | #define WM831X_FLL_ENA 0x0001 /* FLL_ENA */ | ||
295 | #define WM831X_FLL_ENA_MASK 0x0001 /* FLL_ENA */ | ||
296 | #define WM831X_FLL_ENA_SHIFT 0 /* FLL_ENA */ | ||
297 | #define WM831X_FLL_ENA_WIDTH 1 /* FLL_ENA */ | ||
298 | |||
299 | /* | ||
300 | * R16531 (0x4093) - FLL Control 2 | ||
301 | */ | ||
302 | #define WM831X_FLL_OUTDIV_MASK 0x3F00 /* FLL_OUTDIV - [13:8] */ | ||
303 | #define WM831X_FLL_OUTDIV_SHIFT 8 /* FLL_OUTDIV - [13:8] */ | ||
304 | #define WM831X_FLL_OUTDIV_WIDTH 6 /* FLL_OUTDIV - [13:8] */ | ||
305 | #define WM831X_FLL_CTRL_RATE_MASK 0x0070 /* FLL_CTRL_RATE - [6:4] */ | ||
306 | #define WM831X_FLL_CTRL_RATE_SHIFT 4 /* FLL_CTRL_RATE - [6:4] */ | ||
307 | #define WM831X_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [6:4] */ | ||
308 | #define WM831X_FLL_FRATIO_MASK 0x0007 /* FLL_FRATIO - [2:0] */ | ||
309 | #define WM831X_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [2:0] */ | ||
310 | #define WM831X_FLL_FRATIO_WIDTH 3 /* FLL_FRATIO - [2:0] */ | ||
311 | |||
312 | /* | ||
313 | * R16532 (0x4094) - FLL Control 3 | ||
314 | */ | ||
315 | #define WM831X_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */ | ||
316 | #define WM831X_FLL_K_SHIFT 0 /* FLL_K - [15:0] */ | ||
317 | #define WM831X_FLL_K_WIDTH 16 /* FLL_K - [15:0] */ | ||
318 | |||
319 | /* | ||
320 | * R16533 (0x4095) - FLL Control 4 | ||
321 | */ | ||
322 | #define WM831X_FLL_N_MASK 0x7FE0 /* FLL_N - [14:5] */ | ||
323 | #define WM831X_FLL_N_SHIFT 5 /* FLL_N - [14:5] */ | ||
324 | #define WM831X_FLL_N_WIDTH 10 /* FLL_N - [14:5] */ | ||
325 | #define WM831X_FLL_GAIN_MASK 0x000F /* FLL_GAIN - [3:0] */ | ||
326 | #define WM831X_FLL_GAIN_SHIFT 0 /* FLL_GAIN - [3:0] */ | ||
327 | #define WM831X_FLL_GAIN_WIDTH 4 /* FLL_GAIN - [3:0] */ | ||
328 | |||
329 | /* | ||
330 | * R16534 (0x4096) - FLL Control 5 | ||
331 | */ | ||
332 | #define WM831X_FLL_CLK_REF_DIV_MASK 0x0018 /* FLL_CLK_REF_DIV - [4:3] */ | ||
333 | #define WM831X_FLL_CLK_REF_DIV_SHIFT 3 /* FLL_CLK_REF_DIV - [4:3] */ | ||
334 | #define WM831X_FLL_CLK_REF_DIV_WIDTH 2 /* FLL_CLK_REF_DIV - [4:3] */ | ||
335 | #define WM831X_FLL_CLK_SRC_MASK 0x0003 /* FLL_CLK_SRC - [1:0] */ | ||
336 | #define WM831X_FLL_CLK_SRC_SHIFT 0 /* FLL_CLK_SRC - [1:0] */ | ||
337 | #define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */ | ||
338 | |||
237 | struct regulator_dev; | 339 | struct regulator_dev; |
238 | 340 | ||
239 | #define WM831X_NUM_IRQ_REGS 5 | 341 | #define WM831X_NUM_IRQ_REGS 5 |
342 | #define WM831X_NUM_GPIO_REGS 16 | ||
240 | 343 | ||
241 | enum wm831x_parent { | 344 | enum wm831x_parent { |
242 | WM8310 = 0x8310, | 345 | WM8310 = 0x8310, |
@@ -248,6 +351,12 @@ enum wm831x_parent { | |||
248 | WM8326 = 0x8326, | 351 | WM8326 = 0x8326, |
249 | }; | 352 | }; |
250 | 353 | ||
354 | struct wm831x; | ||
355 | enum wm831x_auxadc; | ||
356 | |||
357 | typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x, | ||
358 | enum wm831x_auxadc input); | ||
359 | |||
251 | struct wm831x { | 360 | struct wm831x { |
252 | struct mutex io_lock; | 361 | struct mutex io_lock; |
253 | 362 | ||
@@ -261,7 +370,7 @@ struct wm831x { | |||
261 | 370 | ||
262 | int irq; /* Our chip IRQ */ | 371 | int irq; /* Our chip IRQ */ |
263 | struct mutex irq_lock; | 372 | struct mutex irq_lock; |
264 | unsigned int irq_base; | 373 | int irq_base; |
265 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ | 374 | int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ |
266 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ | 375 | int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ |
267 | 376 | ||
@@ -272,8 +381,13 @@ struct wm831x { | |||
272 | 381 | ||
273 | int num_gpio; | 382 | int num_gpio; |
274 | 383 | ||
384 | /* Used by the interrupt controller code to post writes */ | ||
385 | int gpio_update[WM831X_NUM_GPIO_REGS]; | ||
386 | |||
275 | struct mutex auxadc_lock; | 387 | struct mutex auxadc_lock; |
276 | struct completion auxadc_done; | 388 | struct list_head auxadc_pending; |
389 | u16 auxadc_active; | ||
390 | wm831x_auxadc_read_fn auxadc_read; | ||
277 | 391 | ||
278 | /* The WM831x has a security key blocking access to certain | 392 | /* The WM831x has a security key blocking access to certain |
279 | * registers. The mutex is taken by the accessors for locking | 393 | * registers. The mutex is taken by the accessors for locking |
@@ -300,5 +414,6 @@ void wm831x_device_exit(struct wm831x *wm831x); | |||
300 | int wm831x_device_suspend(struct wm831x *wm831x); | 414 | int wm831x_device_suspend(struct wm831x *wm831x); |
301 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 415 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
302 | void wm831x_irq_exit(struct wm831x *wm831x); | 416 | void wm831x_irq_exit(struct wm831x *wm831x); |
417 | void wm831x_auxadc_init(struct wm831x *wm831x); | ||
303 | 418 | ||
304 | #endif | 419 | #endif |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index ff42d700293f..0ba24599fe51 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -120,6 +120,9 @@ struct wm831x_pdata { | |||
120 | /** Put the /IRQ line into CMOS mode */ | 120 | /** Put the /IRQ line into CMOS mode */ |
121 | bool irq_cmos; | 121 | bool irq_cmos; |
122 | 122 | ||
123 | /** Disable the touchscreen */ | ||
124 | bool disable_touch; | ||
125 | |||
123 | int irq_base; | 126 | int irq_base; |
124 | int gpio_base; | 127 | int gpio_base; |
125 | int gpio_defaults[WM831X_GPIO_NUM]; | 128 | int gpio_defaults[WM831X_GPIO_NUM]; |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 359fba880274..103113a2fd18 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -128,6 +128,8 @@ | |||
128 | /* 1000BASE-T Control register */ | 128 | /* 1000BASE-T Control register */ |
129 | #define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ | 129 | #define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ |
130 | #define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ | 130 | #define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ |
131 | #define CTL1000_AS_MASTER 0x0800 | ||
132 | #define CTL1000_ENABLE_MASTER 0x1000 | ||
131 | 133 | ||
132 | /* 1000BASE-T Status register */ | 134 | /* 1000BASE-T Status register */ |
133 | #define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ | 135 | #define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 9a18667c13cc..b56e4587208d 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -123,6 +123,9 @@ enum { | |||
123 | /* debug commands */ | 123 | /* debug commands */ |
124 | MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, | 124 | MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, |
125 | MLX4_CMD_SET_DEBUG_MSG = 0x2b, | 125 | MLX4_CMD_SET_DEBUG_MSG = 0x2b, |
126 | |||
127 | /* statistics commands */ | ||
128 | MLX4_CMD_QUERY_IF_STAT = 0X54, | ||
126 | }; | 129 | }; |
127 | 130 | ||
128 | enum { | 131 | enum { |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 8985768e2c0d..53ef894bfa05 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/completion.h> | 37 | #include <linux/completion.h> |
38 | #include <linux/radix-tree.h> | 38 | #include <linux/radix-tree.h> |
39 | 39 | ||
40 | #include <asm/atomic.h> | 40 | #include <linux/atomic.h> |
41 | 41 | ||
42 | #define MAX_MSIX_P_PORT 17 | 42 | #define MAX_MSIX_P_PORT 17 |
43 | #define MAX_MSIX 64 | 43 | #define MAX_MSIX 64 |
@@ -58,22 +58,28 @@ enum { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | enum { | 60 | enum { |
61 | MLX4_DEV_CAP_FLAG_RC = 1 << 0, | 61 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, |
62 | MLX4_DEV_CAP_FLAG_UC = 1 << 1, | 62 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, |
63 | MLX4_DEV_CAP_FLAG_UD = 1 << 2, | 63 | MLX4_DEV_CAP_FLAG_UD = 1LL << 2, |
64 | MLX4_DEV_CAP_FLAG_SRQ = 1 << 6, | 64 | MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, |
65 | MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, | 65 | MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, |
66 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, | 66 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, |
67 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, | 67 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9, |
68 | MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, | 68 | MLX4_DEV_CAP_FLAG_DPDP = 1LL << 12, |
69 | MLX4_DEV_CAP_FLAG_BLH = 1 << 15, | 69 | MLX4_DEV_CAP_FLAG_BLH = 1LL << 15, |
70 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, | 70 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1LL << 16, |
71 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, | 71 | MLX4_DEV_CAP_FLAG_APM = 1LL << 17, |
72 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | 72 | MLX4_DEV_CAP_FLAG_ATOMIC = 1LL << 18, |
73 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, | 73 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1LL << 19, |
74 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, | 74 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1LL << 20, |
75 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, | 75 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21, |
76 | MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 | 76 | MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30, |
77 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32, | ||
78 | MLX4_DEV_CAP_FLAG_WOL = 1LL << 38, | ||
79 | MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, | ||
80 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, | ||
81 | MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, | ||
82 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 | ||
77 | }; | 83 | }; |
78 | 84 | ||
79 | enum { | 85 | enum { |
@@ -253,15 +259,10 @@ struct mlx4_caps { | |||
253 | int mtt_entry_sz; | 259 | int mtt_entry_sz; |
254 | u32 max_msg_sz; | 260 | u32 max_msg_sz; |
255 | u32 page_size_cap; | 261 | u32 page_size_cap; |
256 | u32 flags; | 262 | u64 flags; |
257 | u32 bmme_flags; | 263 | u32 bmme_flags; |
258 | u32 reserved_lkey; | 264 | u32 reserved_lkey; |
259 | u16 stat_rate_support; | 265 | u16 stat_rate_support; |
260 | int udp_rss; | ||
261 | int loopback_support; | ||
262 | int vep_uc_steering; | ||
263 | int vep_mc_steering; | ||
264 | int wol; | ||
265 | u8 port_width_cap[MLX4_MAX_PORTS + 1]; | 266 | u8 port_width_cap[MLX4_MAX_PORTS + 1]; |
266 | int max_gso_sz; | 267 | int max_gso_sz; |
267 | int reserved_qps_cnt[MLX4_NUM_QP_REGION]; | 268 | int reserved_qps_cnt[MLX4_NUM_QP_REGION]; |
@@ -274,6 +275,7 @@ struct mlx4_caps { | |||
274 | u8 supported_type[MLX4_MAX_PORTS + 1]; | 275 | u8 supported_type[MLX4_MAX_PORTS + 1]; |
275 | u32 port_mask; | 276 | u32 port_mask; |
276 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; | 277 | enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; |
278 | u32 max_counters; | ||
277 | }; | 279 | }; |
278 | 280 | ||
279 | struct mlx4_buf_list { | 281 | struct mlx4_buf_list { |
@@ -438,6 +440,17 @@ union mlx4_ext_av { | |||
438 | struct mlx4_eth_av eth; | 440 | struct mlx4_eth_av eth; |
439 | }; | 441 | }; |
440 | 442 | ||
443 | struct mlx4_counter { | ||
444 | u8 reserved1[3]; | ||
445 | u8 counter_mode; | ||
446 | __be32 num_ifc; | ||
447 | u32 reserved2[2]; | ||
448 | __be64 rx_frames; | ||
449 | __be64 rx_bytes; | ||
450 | __be64 tx_frames; | ||
451 | __be64 tx_bytes; | ||
452 | }; | ||
453 | |||
441 | struct mlx4_dev { | 454 | struct mlx4_dev { |
442 | struct pci_dev *pdev; | 455 | struct pci_dev *pdev; |
443 | unsigned long flags; | 456 | unsigned long flags; |
@@ -568,4 +581,7 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec); | |||
568 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); | 581 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); |
569 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); | 582 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); |
570 | 583 | ||
584 | int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); | ||
585 | void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); | ||
586 | |||
571 | #endif /* MLX4_DEVICE_H */ | 587 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 9e9eb21056ca..4001c8249dbb 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -54,7 +54,8 @@ enum mlx4_qp_optpar { | |||
54 | MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, | 54 | MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, |
55 | MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, | 55 | MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, |
56 | MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, | 56 | MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, |
57 | MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16 | 57 | MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16, |
58 | MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20 | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | enum mlx4_qp_state { | 61 | enum mlx4_qp_state { |
@@ -99,7 +100,7 @@ struct mlx4_qp_path { | |||
99 | u8 fl; | 100 | u8 fl; |
100 | u8 reserved1[2]; | 101 | u8 reserved1[2]; |
101 | u8 pkey_index; | 102 | u8 pkey_index; |
102 | u8 reserved2; | 103 | u8 counter_index; |
103 | u8 grh_mylmc; | 104 | u8 grh_mylmc; |
104 | __be16 rlid; | 105 | __be16 rlid; |
105 | u8 ackto; | 106 | u8 ackto; |
@@ -111,8 +112,7 @@ struct mlx4_qp_path { | |||
111 | u8 sched_queue; | 112 | u8 sched_queue; |
112 | u8 vlan_index; | 113 | u8 vlan_index; |
113 | u8 reserved3[2]; | 114 | u8 reserved3[2]; |
114 | u8 counter_index; | 115 | u8 reserved4[2]; |
115 | u8 reserved4; | ||
116 | u8 dmac[6]; | 116 | u8 dmac[6]; |
117 | }; | 117 | }; |
118 | 118 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9670f71d7be9..fd599f4bb846 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/range.h> | 15 | #include <linux/range.h> |
16 | #include <linux/pfn.h> | 16 | #include <linux/pfn.h> |
17 | #include <linux/bit_spinlock.h> | 17 | #include <linux/bit_spinlock.h> |
18 | #include <linux/shrinker.h> | ||
18 | 19 | ||
19 | struct mempolicy; | 20 | struct mempolicy; |
20 | struct anon_vma; | 21 | struct anon_vma; |
@@ -636,7 +637,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
636 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 637 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
637 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) | 638 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) |
638 | 639 | ||
639 | static inline enum zone_type page_zonenum(struct page *page) | 640 | static inline enum zone_type page_zonenum(const struct page *page) |
640 | { | 641 | { |
641 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 642 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
642 | } | 643 | } |
@@ -664,15 +665,15 @@ static inline int zone_to_nid(struct zone *zone) | |||
664 | } | 665 | } |
665 | 666 | ||
666 | #ifdef NODE_NOT_IN_PAGE_FLAGS | 667 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
667 | extern int page_to_nid(struct page *page); | 668 | extern int page_to_nid(const struct page *page); |
668 | #else | 669 | #else |
669 | static inline int page_to_nid(struct page *page) | 670 | static inline int page_to_nid(const struct page *page) |
670 | { | 671 | { |
671 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; | 672 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; |
672 | } | 673 | } |
673 | #endif | 674 | #endif |
674 | 675 | ||
675 | static inline struct zone *page_zone(struct page *page) | 676 | static inline struct zone *page_zone(const struct page *page) |
676 | { | 677 | { |
677 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 678 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
678 | } | 679 | } |
@@ -717,9 +718,9 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
717 | */ | 718 | */ |
718 | #include <linux/vmstat.h> | 719 | #include <linux/vmstat.h> |
719 | 720 | ||
720 | static __always_inline void *lowmem_page_address(struct page *page) | 721 | static __always_inline void *lowmem_page_address(const struct page *page) |
721 | { | 722 | { |
722 | return __va(PFN_PHYS(page_to_pfn(page))); | 723 | return __va(PFN_PHYS(page_to_pfn((struct page *)page))); |
723 | } | 724 | } |
724 | 725 | ||
725 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) | 726 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) |
@@ -910,6 +911,8 @@ unsigned long unmap_vmas(struct mmu_gather *tlb, | |||
910 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | 911 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry |
911 | * @pte_hole: if set, called for each hole at all levels | 912 | * @pte_hole: if set, called for each hole at all levels |
912 | * @hugetlb_entry: if set, called for each hugetlb entry | 913 | * @hugetlb_entry: if set, called for each hugetlb entry |
914 | * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry | ||
915 | * is used. | ||
913 | * | 916 | * |
914 | * (see walk_page_range for more details) | 917 | * (see walk_page_range for more details) |
915 | */ | 918 | */ |
@@ -959,6 +962,8 @@ int invalidate_inode_page(struct page *page); | |||
959 | #ifdef CONFIG_MMU | 962 | #ifdef CONFIG_MMU |
960 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 963 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
961 | unsigned long address, unsigned int flags); | 964 | unsigned long address, unsigned int flags); |
965 | extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, | ||
966 | unsigned long address, unsigned int fault_flags); | ||
962 | #else | 967 | #else |
963 | static inline int handle_mm_fault(struct mm_struct *mm, | 968 | static inline int handle_mm_fault(struct mm_struct *mm, |
964 | struct vm_area_struct *vma, unsigned long address, | 969 | struct vm_area_struct *vma, unsigned long address, |
@@ -968,6 +973,14 @@ static inline int handle_mm_fault(struct mm_struct *mm, | |||
968 | BUG(); | 973 | BUG(); |
969 | return VM_FAULT_SIGBUS; | 974 | return VM_FAULT_SIGBUS; |
970 | } | 975 | } |
976 | static inline int fixup_user_fault(struct task_struct *tsk, | ||
977 | struct mm_struct *mm, unsigned long address, | ||
978 | unsigned int fault_flags) | ||
979 | { | ||
980 | /* should never happen if there's no MMU */ | ||
981 | BUG(); | ||
982 | return -EFAULT; | ||
983 | } | ||
971 | #endif | 984 | #endif |
972 | 985 | ||
973 | extern int make_pages_present(unsigned long addr, unsigned long end); | 986 | extern int make_pages_present(unsigned long addr, unsigned long end); |
@@ -1121,44 +1134,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1121 | } | 1134 | } |
1122 | #endif | 1135 | #endif |
1123 | 1136 | ||
1124 | /* | ||
1125 | * This struct is used to pass information from page reclaim to the shrinkers. | ||
1126 | * We consolidate the values for easier extention later. | ||
1127 | */ | ||
1128 | struct shrink_control { | ||
1129 | gfp_t gfp_mask; | ||
1130 | |||
1131 | /* How many slab objects shrinker() should scan and try to reclaim */ | ||
1132 | unsigned long nr_to_scan; | ||
1133 | }; | ||
1134 | |||
1135 | /* | ||
1136 | * A callback you can register to apply pressure to ageable caches. | ||
1137 | * | ||
1138 | * 'sc' is passed shrink_control which includes a count 'nr_to_scan' | ||
1139 | * and a 'gfpmask'. It should look through the least-recently-used | ||
1140 | * 'nr_to_scan' entries and attempt to free them up. It should return | ||
1141 | * the number of objects which remain in the cache. If it returns -1, it means | ||
1142 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). | ||
1143 | * | ||
1144 | * The 'gfpmask' refers to the allocation we are currently trying to | ||
1145 | * fulfil. | ||
1146 | * | ||
1147 | * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is | ||
1148 | * querying the cache size, so a fastpath for that case is appropriate. | ||
1149 | */ | ||
1150 | struct shrinker { | ||
1151 | int (*shrink)(struct shrinker *, struct shrink_control *sc); | ||
1152 | int seeks; /* seeks to recreate an obj */ | ||
1153 | |||
1154 | /* These are for internal use */ | ||
1155 | struct list_head list; | ||
1156 | long nr; /* objs pending delete */ | ||
1157 | }; | ||
1158 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | ||
1159 | extern void register_shrinker(struct shrinker *); | ||
1160 | extern void unregister_shrinker(struct shrinker *); | ||
1161 | |||
1162 | int vma_wants_writenotify(struct vm_area_struct *vma); | 1137 | int vma_wants_writenotify(struct vm_area_struct *vma); |
1163 | 1138 | ||
1164 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, | 1139 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, |
@@ -1313,6 +1288,7 @@ extern void remove_active_range(unsigned int nid, unsigned long start_pfn, | |||
1313 | unsigned long end_pfn); | 1288 | unsigned long end_pfn); |
1314 | extern void remove_all_active_ranges(void); | 1289 | extern void remove_all_active_ranges(void); |
1315 | void sort_node_map(void); | 1290 | void sort_node_map(void); |
1291 | unsigned long node_map_pfn_alignment(void); | ||
1316 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, | 1292 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, |
1317 | unsigned long end_pfn); | 1293 | unsigned long end_pfn); |
1318 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | 1294 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, |
@@ -1445,8 +1421,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t); | |||
1445 | 1421 | ||
1446 | extern unsigned long do_brk(unsigned long, unsigned long); | 1422 | extern unsigned long do_brk(unsigned long, unsigned long); |
1447 | 1423 | ||
1448 | /* filemap.c */ | 1424 | /* truncate.c */ |
1449 | extern unsigned long page_unuse(struct page *); | ||
1450 | extern void truncate_inode_pages(struct address_space *, loff_t); | 1425 | extern void truncate_inode_pages(struct address_space *, loff_t); |
1451 | extern void truncate_inode_pages_range(struct address_space *, | 1426 | extern void truncate_inode_pages_range(struct address_space *, |
1452 | loff_t lstart, loff_t lend); | 1427 | loff_t lstart, loff_t lend); |
@@ -1633,6 +1608,7 @@ enum mf_flags { | |||
1633 | }; | 1608 | }; |
1634 | extern void memory_failure(unsigned long pfn, int trapno); | 1609 | extern void memory_failure(unsigned long pfn, int trapno); |
1635 | extern int __memory_failure(unsigned long pfn, int trapno, int flags); | 1610 | extern int __memory_failure(unsigned long pfn, int trapno, int flags); |
1611 | extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); | ||
1636 | extern int unpoison_memory(unsigned long pfn); | 1612 | extern int unpoison_memory(unsigned long pfn); |
1637 | extern int sysctl_memory_failure_early_kill; | 1613 | extern int sysctl_memory_failure_early_kill; |
1638 | extern int sysctl_memory_failure_recovery; | 1614 | extern int sysctl_memory_failure_recovery; |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 027935c86c68..774b8952deb4 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -30,23 +30,61 @@ struct address_space; | |||
30 | * moment. Note that we have no way to track which tasks are using | 30 | * moment. Note that we have no way to track which tasks are using |
31 | * a page, though if it is a pagecache page, rmap structures can tell us | 31 | * a page, though if it is a pagecache page, rmap structures can tell us |
32 | * who is mapping it. | 32 | * who is mapping it. |
33 | * | ||
34 | * The objects in struct page are organized in double word blocks in | ||
35 | * order to allows us to use atomic double word operations on portions | ||
36 | * of struct page. That is currently only used by slub but the arrangement | ||
37 | * allows the use of atomic double word operations on the flags/mapping | ||
38 | * and lru list pointers also. | ||
33 | */ | 39 | */ |
34 | struct page { | 40 | struct page { |
41 | /* First double word block */ | ||
35 | unsigned long flags; /* Atomic flags, some possibly | 42 | unsigned long flags; /* Atomic flags, some possibly |
36 | * updated asynchronously */ | 43 | * updated asynchronously */ |
37 | atomic_t _count; /* Usage count, see below. */ | 44 | struct address_space *mapping; /* If low bit clear, points to |
38 | union { | 45 | * inode address_space, or NULL. |
39 | atomic_t _mapcount; /* Count of ptes mapped in mms, | 46 | * If page mapped as anonymous |
40 | * to show when page is mapped | 47 | * memory, low bit is set, and |
41 | * & limit reverse map searches. | 48 | * it points to anon_vma object: |
49 | * see PAGE_MAPPING_ANON below. | ||
42 | */ | 50 | */ |
43 | struct { /* SLUB */ | 51 | /* Second double word */ |
44 | u16 inuse; | 52 | struct { |
45 | u16 objects; | 53 | union { |
54 | pgoff_t index; /* Our offset within mapping. */ | ||
55 | void *freelist; /* slub first free object */ | ||
56 | }; | ||
57 | |||
58 | union { | ||
59 | /* Used for cmpxchg_double in slub */ | ||
60 | unsigned long counters; | ||
61 | |||
62 | struct { | ||
63 | |||
64 | union { | ||
65 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
66 | * to show when page is mapped | ||
67 | * & limit reverse map searches. | ||
68 | */ | ||
69 | |||
70 | struct { | ||
71 | unsigned inuse:16; | ||
72 | unsigned objects:15; | ||
73 | unsigned frozen:1; | ||
74 | }; | ||
75 | }; | ||
76 | atomic_t _count; /* Usage count, see below. */ | ||
77 | }; | ||
46 | }; | 78 | }; |
47 | }; | 79 | }; |
80 | |||
81 | /* Third double word block */ | ||
82 | struct list_head lru; /* Pageout list, eg. active_list | ||
83 | * protected by zone->lru_lock ! | ||
84 | */ | ||
85 | |||
86 | /* Remainder is not double word aligned */ | ||
48 | union { | 87 | union { |
49 | struct { | ||
50 | unsigned long private; /* Mapping-private opaque data: | 88 | unsigned long private; /* Mapping-private opaque data: |
51 | * usually used for buffer_heads | 89 | * usually used for buffer_heads |
52 | * if PagePrivate set; used for | 90 | * if PagePrivate set; used for |
@@ -54,27 +92,13 @@ struct page { | |||
54 | * indicates order in the buddy | 92 | * indicates order in the buddy |
55 | * system if PG_buddy is set. | 93 | * system if PG_buddy is set. |
56 | */ | 94 | */ |
57 | struct address_space *mapping; /* If low bit clear, points to | ||
58 | * inode address_space, or NULL. | ||
59 | * If page mapped as anonymous | ||
60 | * memory, low bit is set, and | ||
61 | * it points to anon_vma object: | ||
62 | * see PAGE_MAPPING_ANON below. | ||
63 | */ | ||
64 | }; | ||
65 | #if USE_SPLIT_PTLOCKS | 95 | #if USE_SPLIT_PTLOCKS |
66 | spinlock_t ptl; | 96 | spinlock_t ptl; |
67 | #endif | 97 | #endif |
68 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ | 98 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ |
69 | struct page *first_page; /* Compound tail pages */ | 99 | struct page *first_page; /* Compound tail pages */ |
70 | }; | ||
71 | union { | ||
72 | pgoff_t index; /* Our offset within mapping. */ | ||
73 | void *freelist; /* SLUB: freelist req. slab lock */ | ||
74 | }; | 100 | }; |
75 | struct list_head lru; /* Pageout list, eg. active_list | 101 | |
76 | * protected by zone->lru_lock ! | ||
77 | */ | ||
78 | /* | 102 | /* |
79 | * On machines where all RAM is mapped into kernel address space, | 103 | * On machines where all RAM is mapped into kernel address space, |
80 | * we can simply calculate the virtual address. On machines with | 104 | * we can simply calculate the virtual address. On machines with |
@@ -100,7 +124,16 @@ struct page { | |||
100 | */ | 124 | */ |
101 | void *shadow; | 125 | void *shadow; |
102 | #endif | 126 | #endif |
103 | }; | 127 | } |
128 | /* | ||
129 | * If another subsystem starts using the double word pairing for atomic | ||
130 | * operations on struct page then it must change the #if to ensure | ||
131 | * proper alignment of the page struct. | ||
132 | */ | ||
133 | #if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL) | ||
134 | __attribute__((__aligned__(2*sizeof(unsigned long)))) | ||
135 | #endif | ||
136 | ; | ||
104 | 137 | ||
105 | typedef unsigned long __nocast vm_flags_t; | 138 | typedef unsigned long __nocast vm_flags_t; |
106 | 139 | ||
diff --git a/include/linux/mman.h b/include/linux/mman.h index 9872d6ca58ae..8b74e9b1d0ad 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/percpu_counter.h> | 15 | #include <linux/percpu_counter.h> |
16 | 16 | ||
17 | #include <asm/atomic.h> | 17 | #include <linux/atomic.h> |
18 | 18 | ||
19 | extern int sysctl_overcommit_memory; | 19 | extern int sysctl_overcommit_memory; |
20 | extern int sysctl_overcommit_ratio; | 20 | extern int sysctl_overcommit_ratio; |
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h index 39d787c229cb..23acc3baa07d 100644 --- a/include/linux/mmc/boot.h +++ b/include/linux/mmc/boot.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef MMC_BOOT_H | 1 | #ifndef LINUX_MMC_BOOT_H |
2 | #define MMC_BOOT_H | 2 | #define LINUX_MMC_BOOT_H |
3 | 3 | ||
4 | enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, | 4 | enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, |
5 | MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; | 5 | MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; |
6 | 6 | ||
7 | #endif | 7 | #endif /* LINUX_MMC_BOOT_H */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 6ad43554ac05..b460fc2af8a1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -403,4 +403,4 @@ extern void mmc_unregister_driver(struct mmc_driver *); | |||
403 | extern void mmc_fixup_device(struct mmc_card *card, | 403 | extern void mmc_fixup_device(struct mmc_card *card, |
404 | const struct mmc_fixup *table); | 404 | const struct mmc_fixup *table); |
405 | 405 | ||
406 | #endif | 406 | #endif /* LINUX_MMC_CARD_H */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index b6718e549a51..b8b1b7a311f1 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -117,6 +117,7 @@ struct mmc_data { | |||
117 | 117 | ||
118 | unsigned int sg_len; /* size of scatter list */ | 118 | unsigned int sg_len; /* size of scatter list */ |
119 | struct scatterlist *sg; /* I/O scatter list */ | 119 | struct scatterlist *sg; /* I/O scatter list */ |
120 | s32 host_cookie; /* host private data */ | ||
120 | }; | 121 | }; |
121 | 122 | ||
122 | struct mmc_request { | 123 | struct mmc_request { |
@@ -125,13 +126,16 @@ struct mmc_request { | |||
125 | struct mmc_data *data; | 126 | struct mmc_data *data; |
126 | struct mmc_command *stop; | 127 | struct mmc_command *stop; |
127 | 128 | ||
128 | void *done_data; /* completion data */ | 129 | struct completion completion; |
129 | void (*done)(struct mmc_request *);/* completion function */ | 130 | void (*done)(struct mmc_request *);/* completion function */ |
130 | }; | 131 | }; |
131 | 132 | ||
132 | struct mmc_host; | 133 | struct mmc_host; |
133 | struct mmc_card; | 134 | struct mmc_card; |
135 | struct mmc_async_req; | ||
134 | 136 | ||
137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, | ||
138 | struct mmc_async_req *, int *); | ||
135 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 139 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
136 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 140 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
137 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | 141 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); |
@@ -155,6 +159,7 @@ extern int mmc_can_trim(struct mmc_card *card); | |||
155 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); | 159 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); |
156 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | 160 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, |
157 | unsigned int nr); | 161 | unsigned int nr); |
162 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | ||
158 | 163 | ||
159 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 164 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
160 | 165 | ||
@@ -179,4 +184,4 @@ static inline void mmc_claim_host(struct mmc_host *host) | |||
179 | 184 | ||
180 | extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); | 185 | extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); |
181 | 186 | ||
182 | #endif | 187 | #endif /* LINUX_MMC_CORE_H */ |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index bdd7ceeb99e4..6b46819705d1 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -11,8 +11,8 @@ | |||
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _LINUX_MMC_DW_MMC_H_ | 14 | #ifndef LINUX_MMC_DW_MMC_H |
15 | #define _LINUX_MMC_DW_MMC_H_ | 15 | #define LINUX_MMC_DW_MMC_H |
16 | 16 | ||
17 | #define MAX_MCI_SLOTS 2 | 17 | #define MAX_MCI_SLOTS 2 |
18 | 18 | ||
@@ -48,6 +48,7 @@ struct mmc_data; | |||
48 | * @data: The data currently being transferred, or NULL if no data | 48 | * @data: The data currently being transferred, or NULL if no data |
49 | * transfer is in progress. | 49 | * transfer is in progress. |
50 | * @use_dma: Whether DMA channel is initialized or not. | 50 | * @use_dma: Whether DMA channel is initialized or not. |
51 | * @using_dma: Whether DMA is in use for the current transfer. | ||
51 | * @sg_dma: Bus address of DMA buffer. | 52 | * @sg_dma: Bus address of DMA buffer. |
52 | * @sg_cpu: Virtual address of DMA buffer. | 53 | * @sg_cpu: Virtual address of DMA buffer. |
53 | * @dma_ops: Pointer to platform-specific DMA callbacks. | 54 | * @dma_ops: Pointer to platform-specific DMA callbacks. |
@@ -74,7 +75,11 @@ struct mmc_data; | |||
74 | * @pdev: Platform device associated with the MMC controller. | 75 | * @pdev: Platform device associated with the MMC controller. |
75 | * @pdata: Platform data associated with the MMC controller. | 76 | * @pdata: Platform data associated with the MMC controller. |
76 | * @slot: Slots sharing this MMC controller. | 77 | * @slot: Slots sharing this MMC controller. |
78 | * @fifo_depth: depth of FIFO. | ||
77 | * @data_shift: log2 of FIFO item size. | 79 | * @data_shift: log2 of FIFO item size. |
80 | * @part_buf_start: Start index in part_buf. | ||
81 | * @part_buf_count: Bytes of partial data in part_buf. | ||
82 | * @part_buf: Simple buffer for partial fifo reads/writes. | ||
78 | * @push_data: Pointer to FIFO push function. | 83 | * @push_data: Pointer to FIFO push function. |
79 | * @pull_data: Pointer to FIFO pull function. | 84 | * @pull_data: Pointer to FIFO pull function. |
80 | * @quirks: Set of quirks that apply to specific versions of the IP. | 85 | * @quirks: Set of quirks that apply to specific versions of the IP. |
@@ -117,6 +122,7 @@ struct dw_mci { | |||
117 | 122 | ||
118 | /* DMA interface members*/ | 123 | /* DMA interface members*/ |
119 | int use_dma; | 124 | int use_dma; |
125 | int using_dma; | ||
120 | 126 | ||
121 | dma_addr_t sg_dma; | 127 | dma_addr_t sg_dma; |
122 | void *sg_cpu; | 128 | void *sg_cpu; |
@@ -131,7 +137,7 @@ struct dw_mci { | |||
131 | u32 stop_cmdr; | 137 | u32 stop_cmdr; |
132 | u32 dir_status; | 138 | u32 dir_status; |
133 | struct tasklet_struct tasklet; | 139 | struct tasklet_struct tasklet; |
134 | struct tasklet_struct card_tasklet; | 140 | struct work_struct card_work; |
135 | unsigned long pending_events; | 141 | unsigned long pending_events; |
136 | unsigned long completed_events; | 142 | unsigned long completed_events; |
137 | enum dw_mci_state state; | 143 | enum dw_mci_state state; |
@@ -146,7 +152,15 @@ struct dw_mci { | |||
146 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | 152 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; |
147 | 153 | ||
148 | /* FIFO push and pull */ | 154 | /* FIFO push and pull */ |
155 | int fifo_depth; | ||
149 | int data_shift; | 156 | int data_shift; |
157 | u8 part_buf_start; | ||
158 | u8 part_buf_count; | ||
159 | union { | ||
160 | u16 part_buf16; | ||
161 | u32 part_buf32; | ||
162 | u64 part_buf; | ||
163 | }; | ||
150 | void (*push_data)(struct dw_mci *host, void *buf, int cnt); | 164 | void (*push_data)(struct dw_mci *host, void *buf, int cnt); |
151 | void (*pull_data)(struct dw_mci *host, void *buf, int cnt); | 165 | void (*pull_data)(struct dw_mci *host, void *buf, int cnt); |
152 | 166 | ||
@@ -196,6 +210,12 @@ struct dw_mci_board { | |||
196 | unsigned int bus_hz; /* Bus speed */ | 210 | unsigned int bus_hz; /* Bus speed */ |
197 | 211 | ||
198 | unsigned int caps; /* Capabilities */ | 212 | unsigned int caps; /* Capabilities */ |
213 | /* | ||
214 | * Override fifo depth. If 0, autodetect it from the FIFOTH register, | ||
215 | * but note that this may not be reliable after a bootloader has used | ||
216 | * it. | ||
217 | */ | ||
218 | unsigned int fifo_depth; | ||
199 | 219 | ||
200 | /* delay in mS before detecting cards after interrupt */ | 220 | /* delay in mS before detecting cards after interrupt */ |
201 | u32 detect_delay_ms; | 221 | u32 detect_delay_ms; |
@@ -219,4 +239,4 @@ struct dw_mci_board { | |||
219 | struct block_settings *blk_settings; | 239 | struct block_settings *blk_settings; |
220 | }; | 240 | }; |
221 | 241 | ||
222 | #endif /* _LINUX_MMC_DW_MMC_H_ */ | 242 | #endif /* LINUX_MMC_DW_MMC_H */ |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1ee4424462eb..1d09562ccf73 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -56,8 +56,6 @@ struct mmc_ios { | |||
56 | #define MMC_TIMING_UHS_SDR104 4 | 56 | #define MMC_TIMING_UHS_SDR104 4 |
57 | #define MMC_TIMING_UHS_DDR50 5 | 57 | #define MMC_TIMING_UHS_DDR50 5 |
58 | 58 | ||
59 | unsigned char ddr; /* dual data rate used */ | ||
60 | |||
61 | #define MMC_SDR_MODE 0 | 59 | #define MMC_SDR_MODE 0 |
62 | #define MMC_1_2V_DDR_MODE 1 | 60 | #define MMC_1_2V_DDR_MODE 1 |
63 | #define MMC_1_8V_DDR_MODE 2 | 61 | #define MMC_1_8V_DDR_MODE 2 |
@@ -106,6 +104,15 @@ struct mmc_host_ops { | |||
106 | */ | 104 | */ |
107 | int (*enable)(struct mmc_host *host); | 105 | int (*enable)(struct mmc_host *host); |
108 | int (*disable)(struct mmc_host *host, int lazy); | 106 | int (*disable)(struct mmc_host *host, int lazy); |
107 | /* | ||
108 | * It is optional for the host to implement pre_req and post_req in | ||
109 | * order to support double buffering of requests (prepare one | ||
110 | * request while another request is active). | ||
111 | */ | ||
112 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | ||
113 | int err); | ||
114 | void (*pre_req)(struct mmc_host *host, struct mmc_request *req, | ||
115 | bool is_first_req); | ||
109 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 116 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
110 | /* | 117 | /* |
111 | * Avoid calling these three functions too often or in a "fast path", | 118 | * Avoid calling these three functions too often or in a "fast path", |
@@ -139,11 +146,22 @@ struct mmc_host_ops { | |||
139 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 146 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
140 | int (*execute_tuning)(struct mmc_host *host); | 147 | int (*execute_tuning)(struct mmc_host *host); |
141 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 148 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
149 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | ||
142 | }; | 150 | }; |
143 | 151 | ||
144 | struct mmc_card; | 152 | struct mmc_card; |
145 | struct device; | 153 | struct device; |
146 | 154 | ||
155 | struct mmc_async_req { | ||
156 | /* active mmc request */ | ||
157 | struct mmc_request *mrq; | ||
158 | /* | ||
159 | * Check error status of completed mmc request. | ||
160 | * Returns 0 if success otherwise non zero. | ||
161 | */ | ||
162 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); | ||
163 | }; | ||
164 | |||
147 | struct mmc_host { | 165 | struct mmc_host { |
148 | struct device *parent; | 166 | struct device *parent; |
149 | struct device class_dev; | 167 | struct device class_dev; |
@@ -231,6 +249,7 @@ struct mmc_host { | |||
231 | unsigned int max_req_size; /* maximum number of bytes in one req */ | 249 | unsigned int max_req_size; /* maximum number of bytes in one req */ |
232 | unsigned int max_blk_size; /* maximum size of one mmc block */ | 250 | unsigned int max_blk_size; /* maximum size of one mmc block */ |
233 | unsigned int max_blk_count; /* maximum number of blocks in one req */ | 251 | unsigned int max_blk_count; /* maximum number of blocks in one req */ |
252 | unsigned int max_discard_to; /* max. discard timeout in ms */ | ||
234 | 253 | ||
235 | /* private data */ | 254 | /* private data */ |
236 | spinlock_t lock; /* lock for claim and bus ops */ | 255 | spinlock_t lock; /* lock for claim and bus ops */ |
@@ -281,6 +300,8 @@ struct mmc_host { | |||
281 | 300 | ||
282 | struct dentry *debugfs_root; | 301 | struct dentry *debugfs_root; |
283 | 302 | ||
303 | struct mmc_async_req *areq; /* active async req */ | ||
304 | |||
284 | unsigned long private[0] ____cacheline_aligned; | 305 | unsigned long private[0] ____cacheline_aligned; |
285 | }; | 306 | }; |
286 | 307 | ||
@@ -373,5 +394,4 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
373 | { | 394 | { |
374 | return host->caps & MMC_CAP_CMD23; | 395 | return host->caps & MMC_CAP_CMD23; |
375 | } | 396 | } |
376 | #endif | 397 | #endif /* LINUX_MMC_HOST_H */ |
377 | |||
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h index 5baf2983a12f..8fa5bc5f8059 100644 --- a/include/linux/mmc/ioctl.h +++ b/include/linux/mmc/ioctl.h | |||
@@ -51,4 +51,4 @@ struct mmc_ioc_cmd { | |||
51 | * block device operations. | 51 | * block device operations. |
52 | */ | 52 | */ |
53 | #define MMC_IOC_MAX_BYTES (512L * 256) | 53 | #define MMC_IOC_MAX_BYTES (512L * 256) |
54 | #endif /* LINUX_MMC_IOCTL_H */ | 54 | #endif /* LINUX_MMC_IOCTL_H */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index ac26a685cca8..5a794cb503ea 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -21,8 +21,8 @@ | |||
21 | * 15 May 2002 | 21 | * 15 May 2002 |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef MMC_MMC_H | 24 | #ifndef LINUX_MMC_MMC_H |
25 | #define MMC_MMC_H | 25 | #define LINUX_MMC_MMC_H |
26 | 26 | ||
27 | /* Standard MMC commands (4.1) type argument response */ | 27 | /* Standard MMC commands (4.1) type argument response */ |
28 | /* class 1 */ | 28 | /* class 1 */ |
@@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode) | |||
140 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | 140 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ |
141 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 141 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
142 | 142 | ||
143 | #define R1_STATE_IDLE 0 | ||
144 | #define R1_STATE_READY 1 | ||
145 | #define R1_STATE_IDENT 2 | ||
146 | #define R1_STATE_STBY 3 | ||
147 | #define R1_STATE_TRAN 4 | ||
148 | #define R1_STATE_DATA 5 | ||
149 | #define R1_STATE_RCV 6 | ||
150 | #define R1_STATE_PRG 7 | ||
151 | #define R1_STATE_DIS 8 | ||
152 | |||
143 | /* | 153 | /* |
144 | * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS | 154 | * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS |
145 | * R1 is the low order byte; R2 is the next highest byte, when present. | 155 | * R1 is the low order byte; R2 is the next highest byte, when present. |
@@ -327,5 +337,4 @@ struct _mmc_csd { | |||
327 | #define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ | 337 | #define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ |
328 | #define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ | 338 | #define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ |
329 | 339 | ||
330 | #endif /* MMC_MMC_PROTOCOL_H */ | 340 | #endif /* LINUX_MMC_MMC_H */ |
331 | |||
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h index d37aac49cf9a..4a139204c20c 100644 --- a/include/linux/mmc/pm.h +++ b/include/linux/mmc/pm.h | |||
@@ -27,4 +27,4 @@ typedef unsigned int mmc_pm_flag_t; | |||
27 | #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ | 27 | #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ |
28 | #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ | 28 | #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ |
29 | 29 | ||
30 | #endif | 30 | #endif /* LINUX_MMC_PM_H */ |
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h index 7d35d52c3df3..1ebcf9ba1256 100644 --- a/include/linux/mmc/sd.h +++ b/include/linux/mmc/sd.h | |||
@@ -9,8 +9,8 @@ | |||
9 | * your option) any later version. | 9 | * your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef MMC_SD_H | 12 | #ifndef LINUX_MMC_SD_H |
13 | #define MMC_SD_H | 13 | #define LINUX_MMC_SD_H |
14 | 14 | ||
15 | /* SD commands type argument response */ | 15 | /* SD commands type argument response */ |
16 | /* class 0 */ | 16 | /* class 0 */ |
@@ -91,5 +91,4 @@ | |||
91 | #define SD_SWITCH_ACCESS_DEF 0 | 91 | #define SD_SWITCH_ACCESS_DEF 0 |
92 | #define SD_SWITCH_ACCESS_HS 1 | 92 | #define SD_SWITCH_ACCESS_HS 1 |
93 | 93 | ||
94 | #endif | 94 | #endif /* LINUX_MMC_SD_H */ |
95 | |||
diff --git a/include/linux/mmc/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h deleted file mode 100644 index 548d59d404cb..000000000000 --- a/include/linux/mmc/sdhci-pltfm.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * Platform data declarations for the sdhci-pltfm driver. | ||
3 | * | ||
4 | * Copyright (c) 2010 MontaVista Software, LLC. | ||
5 | * | ||
6 | * Author: Anton Vorontsov <avorontsov@ru.mvista.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 (at | ||
11 | * your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef _SDHCI_PLTFM_H | ||
15 | #define _SDHCI_PLTFM_H | ||
16 | |||
17 | struct sdhci_ops; | ||
18 | struct sdhci_host; | ||
19 | |||
20 | /** | ||
21 | * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks | ||
22 | * @ops: optional pointer to the platform-provided SDHCI ops | ||
23 | * @quirks: optional SDHCI quirks | ||
24 | * @init: optional hook that is called during device probe, before the | ||
25 | * driver tries to access any SDHCI registers | ||
26 | * @exit: optional hook that is called during device removal | ||
27 | */ | ||
28 | struct sdhci_pltfm_data { | ||
29 | struct sdhci_ops *ops; | ||
30 | unsigned int quirks; | ||
31 | int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata); | ||
32 | void (*exit)(struct sdhci_host *host); | ||
33 | }; | ||
34 | |||
35 | #endif /* _SDHCI_PLTFM_H */ | ||
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h index 9188c973f3e1..5cdc96da9dd5 100644 --- a/include/linux/mmc/sdhci-spear.h +++ b/include/linux/mmc/sdhci-spear.h | |||
@@ -11,8 +11,8 @@ | |||
11 | * warranty of any kind, whether express or implied. | 11 | * warranty of any kind, whether express or implied. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef MMC_SDHCI_SPEAR_H | 14 | #ifndef LINUX_MMC_SDHCI_SPEAR_H |
15 | #define MMC_SDHCI_SPEAR_H | 15 | #define LINUX_MMC_SDHCI_SPEAR_H |
16 | 16 | ||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | /* | 18 | /* |
@@ -39,4 +39,4 @@ sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data) | |||
39 | pdev->dev.platform_data = data; | 39 | pdev->dev.platform_data = data; |
40 | } | 40 | } |
41 | 41 | ||
42 | #endif /* MMC_SDHCI_SPEAR_H */ | 42 | #endif /* LINUX_MMC_SDHCI_SPEAR_H */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 6a68c4eb4e44..5666f3abfab7 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -8,8 +8,8 @@ | |||
8 | * the Free Software Foundation; either version 2 of the License, or (at | 8 | * the Free Software Foundation; either version 2 of the License, or (at |
9 | * your option) any later version. | 9 | * your option) any later version. |
10 | */ | 10 | */ |
11 | #ifndef __SDHCI_H | 11 | #ifndef LINUX_MMC_SDHCI_H |
12 | #define __SDHCI_H | 12 | #define LINUX_MMC_SDHCI_H |
13 | 13 | ||
14 | #include <linux/scatterlist.h> | 14 | #include <linux/scatterlist.h> |
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
@@ -162,4 +162,4 @@ struct sdhci_host { | |||
162 | 162 | ||
163 | unsigned long private[0] ____cacheline_aligned; | 163 | unsigned long private[0] ____cacheline_aligned; |
164 | }; | 164 | }; |
165 | #endif /* __SDHCI_H */ | 165 | #endif /* LINUX_MMC_SDHCI_H */ |
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 245cdacee544..2a2e9905a247 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
@@ -9,8 +9,8 @@ | |||
9 | * your option) any later version. | 9 | * your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef MMC_SDIO_H | 12 | #ifndef LINUX_MMC_SDIO_H |
13 | #define MMC_SDIO_H | 13 | #define LINUX_MMC_SDIO_H |
14 | 14 | ||
15 | /* SDIO commands type argument response */ | 15 | /* SDIO commands type argument response */ |
16 | #define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ | 16 | #define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ |
@@ -161,5 +161,4 @@ | |||
161 | 161 | ||
162 | #define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */ | 162 | #define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */ |
163 | 163 | ||
164 | #endif | 164 | #endif /* LINUX_MMC_SDIO_H */ |
165 | |||
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 31baaf82f458..50f0bc952328 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
@@ -9,8 +9,8 @@ | |||
9 | * your option) any later version. | 9 | * your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef MMC_SDIO_FUNC_H | 12 | #ifndef LINUX_MMC_SDIO_FUNC_H |
13 | #define MMC_SDIO_FUNC_H | 13 | #define LINUX_MMC_SDIO_FUNC_H |
14 | 14 | ||
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | #include <linux/mod_devicetable.h> | 16 | #include <linux/mod_devicetable.h> |
@@ -161,5 +161,4 @@ extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b, | |||
161 | extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); | 161 | extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); |
162 | extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); | 162 | extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); |
163 | 163 | ||
164 | #endif | 164 | #endif /* LINUX_MMC_SDIO_FUNC_H */ |
165 | |||
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index a36ab3bc7b03..9f03feedc8e7 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
@@ -2,8 +2,8 @@ | |||
2 | * SDIO Classes, Interface Types, Manufacturer IDs, etc. | 2 | * SDIO Classes, Interface Types, Manufacturer IDs, etc. |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef MMC_SDIO_IDS_H | 5 | #ifndef LINUX_MMC_SDIO_IDS_H |
6 | #define MMC_SDIO_IDS_H | 6 | #define LINUX_MMC_SDIO_IDS_H |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * Standard SDIO Function Interfaces | 9 | * Standard SDIO Function Interfaces |
@@ -44,4 +44,4 @@ | |||
44 | #define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 | 44 | #define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 |
45 | #define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 | 45 | #define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 |
46 | 46 | ||
47 | #endif | 47 | #endif /* LINUX_MMC_SDIO_IDS_H */ |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 9eb9b4b96f55..0222cd8ebe76 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -11,8 +11,8 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef __SH_MMCIF_H__ | 14 | #ifndef LINUX_MMC_SH_MMCIF_H |
15 | #define __SH_MMCIF_H__ | 15 | #define LINUX_MMC_SH_MMCIF_H |
16 | 16 | ||
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
@@ -220,4 +220,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base) | |||
220 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 220 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
221 | } | 221 | } |
222 | 222 | ||
223 | #endif /* __SH_MMCIF_H__ */ | 223 | #endif /* LINUX_MMC_SH_MMCIF_H */ |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index faf32b6ec185..bd50b365167f 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __SH_MOBILE_SDHI_H__ | 1 | #ifndef LINUX_MMC_SH_MOBILE_SDHI_H |
2 | #define __SH_MOBILE_SDHI_H__ | 2 | #define LINUX_MMC_SH_MOBILE_SDHI_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
@@ -17,4 +17,4 @@ struct sh_mobile_sdhi_info { | |||
17 | int (*get_cd)(struct platform_device *pdev); | 17 | int (*get_cd)(struct platform_device *pdev); |
18 | }; | 18 | }; |
19 | 19 | ||
20 | #endif /* __SH_MOBILE_SDHI_H__ */ | 20 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ |
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h index 19490b942db0..a1c1f321e519 100644 --- a/include/linux/mmc/tmio.h +++ b/include/linux/mmc/tmio.h | |||
@@ -12,8 +12,8 @@ | |||
12 | * | 12 | * |
13 | * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 | 13 | * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 |
14 | */ | 14 | */ |
15 | #ifndef _LINUX_MMC_TMIO_H_ | 15 | #ifndef LINUX_MMC_TMIO_H |
16 | #define _LINUX_MMC_TMIO_H_ | 16 | #define LINUX_MMC_TMIO_H |
17 | 17 | ||
18 | #define CTL_SD_CMD 0x00 | 18 | #define CTL_SD_CMD 0x00 |
19 | #define CTL_ARG_REG 0x04 | 19 | #define CTL_ARG_REG 0x04 |
@@ -21,6 +21,7 @@ | |||
21 | #define CTL_XFER_BLK_COUNT 0xa | 21 | #define CTL_XFER_BLK_COUNT 0xa |
22 | #define CTL_RESPONSE 0x0c | 22 | #define CTL_RESPONSE 0x0c |
23 | #define CTL_STATUS 0x1c | 23 | #define CTL_STATUS 0x1c |
24 | #define CTL_STATUS2 0x1e | ||
24 | #define CTL_IRQ_MASK 0x20 | 25 | #define CTL_IRQ_MASK 0x20 |
25 | #define CTL_SD_CARD_CLK_CTL 0x24 | 26 | #define CTL_SD_CARD_CLK_CTL 0x24 |
26 | #define CTL_SD_XFER_LEN 0x26 | 27 | #define CTL_SD_XFER_LEN 0x26 |
@@ -30,6 +31,7 @@ | |||
30 | #define CTL_TRANSACTION_CTL 0x34 | 31 | #define CTL_TRANSACTION_CTL 0x34 |
31 | #define CTL_SDIO_STATUS 0x36 | 32 | #define CTL_SDIO_STATUS 0x36 |
32 | #define CTL_SDIO_IRQ_MASK 0x38 | 33 | #define CTL_SDIO_IRQ_MASK 0x38 |
34 | #define CTL_DMA_ENABLE 0xd8 | ||
33 | #define CTL_RESET_SD 0xe0 | 35 | #define CTL_RESET_SD 0xe0 |
34 | #define CTL_SDIO_REGS 0x100 | 36 | #define CTL_SDIO_REGS 0x100 |
35 | #define CTL_CLK_AND_WAIT_CTL 0x138 | 37 | #define CTL_CLK_AND_WAIT_CTL 0x138 |
@@ -60,4 +62,4 @@ | |||
60 | 62 | ||
61 | #define TMIO_BBS 512 /* Boot block size */ | 63 | #define TMIO_BBS 512 /* Boot block size */ |
62 | 64 | ||
63 | #endif /* _LINUX_MMC_TMIO_H_ */ | 65 | #endif /* LINUX_MMC_TMIO_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 9f7c3ebcbbad..be1ac8d7789b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/pageblock-flags.h> | 17 | #include <linux/pageblock-flags.h> |
18 | #include <generated/bounds.h> | 18 | #include <generated/bounds.h> |
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | 21 | ||
22 | /* Free memory management - zoned buddy allocator. */ | 22 | /* Free memory management - zoned buddy allocator. */ |
@@ -158,6 +158,12 @@ static inline int is_unevictable_lru(enum lru_list l) | |||
158 | return (l == LRU_UNEVICTABLE); | 158 | return (l == LRU_UNEVICTABLE); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* Mask used at gathering information at once (see memcontrol.c) */ | ||
162 | #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) | ||
163 | #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) | ||
164 | #define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) | ||
165 | #define LRU_ALL ((1 << NR_LRU_LISTS) - 1) | ||
166 | |||
161 | enum zone_watermarks { | 167 | enum zone_watermarks { |
162 | WMARK_MIN, | 168 | WMARK_MIN, |
163 | WMARK_LOW, | 169 | WMARK_LOW, |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index 0b89efc6f215..29304855652d 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
@@ -18,7 +18,6 @@ struct proc_mounts { | |||
18 | struct seq_file m; /* must be the first element */ | 18 | struct seq_file m; /* must be the first element */ |
19 | struct mnt_namespace *ns; | 19 | struct mnt_namespace *ns; |
20 | struct path root; | 20 | struct path root; |
21 | int event; | ||
22 | }; | 21 | }; |
23 | 22 | ||
24 | struct fs_struct; | 23 | struct fs_struct; |
diff --git a/include/linux/module.h b/include/linux/module.h index d9ca2d5dc6d0..1c30087a2d81 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -48,10 +48,18 @@ struct modversion_info | |||
48 | 48 | ||
49 | struct module; | 49 | struct module; |
50 | 50 | ||
51 | struct module_kobject { | ||
52 | struct kobject kobj; | ||
53 | struct module *mod; | ||
54 | struct kobject *drivers_dir; | ||
55 | struct module_param_attrs *mp; | ||
56 | }; | ||
57 | |||
51 | struct module_attribute { | 58 | struct module_attribute { |
52 | struct attribute attr; | 59 | struct attribute attr; |
53 | ssize_t (*show)(struct module_attribute *, struct module *, char *); | 60 | ssize_t (*show)(struct module_attribute *, struct module_kobject *, |
54 | ssize_t (*store)(struct module_attribute *, struct module *, | 61 | char *); |
62 | ssize_t (*store)(struct module_attribute *, struct module_kobject *, | ||
55 | const char *, size_t count); | 63 | const char *, size_t count); |
56 | void (*setup)(struct module *, const char *); | 64 | void (*setup)(struct module *, const char *); |
57 | int (*test)(struct module *); | 65 | int (*test)(struct module *); |
@@ -65,15 +73,9 @@ struct module_version_attribute { | |||
65 | } __attribute__ ((__aligned__(sizeof(void *)))); | 73 | } __attribute__ ((__aligned__(sizeof(void *)))); |
66 | 74 | ||
67 | extern ssize_t __modver_version_show(struct module_attribute *, | 75 | extern ssize_t __modver_version_show(struct module_attribute *, |
68 | struct module *, char *); | 76 | struct module_kobject *, char *); |
69 | 77 | ||
70 | struct module_kobject | 78 | extern struct module_attribute module_uevent; |
71 | { | ||
72 | struct kobject kobj; | ||
73 | struct module *mod; | ||
74 | struct kobject *drivers_dir; | ||
75 | struct module_param_attrs *mp; | ||
76 | }; | ||
77 | 79 | ||
78 | /* These are either module local, or the kernel's dummy ones. */ | 80 | /* These are either module local, or the kernel's dummy ones. */ |
79 | extern int init_module(void); | 81 | extern int init_module(void); |
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index c1f40c2f7ffb..b2be02ebf453 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
@@ -5,7 +5,12 @@ | |||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/elf.h> | 6 | #include <linux/elf.h> |
7 | 7 | ||
8 | /* These must be implemented by the specific architecture */ | 8 | /* These may be implemented by architectures that need to hook into the |
9 | * module loader code. Architectures that don't need to do anything special | ||
10 | * can just rely on the 'weak' default hooks defined in kernel/module.c. | ||
11 | * Note, however, that at least one of apply_relocate or apply_relocate_add | ||
12 | * must be implemented by each architecture. | ||
13 | */ | ||
9 | 14 | ||
10 | /* Adjust arch-specific sections. Return 0 on success. */ | 15 | /* Adjust arch-specific sections. Return 0 on success. */ |
11 | int module_frob_arch_sections(Elf_Ehdr *hdr, | 16 | int module_frob_arch_sections(Elf_Ehdr *hdr, |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 604f122a2326..33fe53d78110 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/seqlock.h> | 16 | #include <linux/seqlock.h> |
17 | #include <asm/atomic.h> | 17 | #include <linux/atomic.h> |
18 | 18 | ||
19 | struct super_block; | 19 | struct super_block; |
20 | struct vfsmount; | 20 | struct vfsmount; |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 15da0e99f48a..db4836bed514 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -155,12 +155,14 @@ struct ubi_device_info { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | /* | 157 | /* |
158 | * enum - volume notification types. | 158 | * Volume notification types. |
159 | * @UBI_VOLUME_ADDED: volume has been added | 159 | * @UBI_VOLUME_ADDED: a volume has been added (an UBI device was attached or a |
160 | * @UBI_VOLUME_REMOVED: start volume volume | 160 | * volume was created) |
161 | * @UBI_VOLUME_RESIZED: volume size has been re-sized | 161 | * @UBI_VOLUME_REMOVED: a volume has been removed (an UBI device was detached |
162 | * @UBI_VOLUME_RENAMED: volume name has been re-named | 162 | * or a volume was removed) |
163 | * @UBI_VOLUME_UPDATED: volume name has been updated | 163 | * @UBI_VOLUME_RESIZED: a volume has been re-sized |
164 | * @UBI_VOLUME_RENAMED: a volume has been re-named | ||
165 | * @UBI_VOLUME_UPDATED: data has been written to a volume | ||
164 | * | 166 | * |
165 | * These constants define which type of event has happened when a volume | 167 | * These constants define which type of event has happened when a volume |
166 | * notification function is invoked. | 168 | * notification function is invoked. |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index a940fe435aca..9121595a8ebf 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/lockdep.h> | 16 | #include <linux/lockdep.h> |
17 | 17 | ||
18 | #include <asm/atomic.h> | 18 | #include <linux/atomic.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Simple, straightforward mutexes with strict semantics: | 21 | * Simple, straightforward mutexes with strict semantics: |
@@ -92,7 +92,7 @@ do { \ | |||
92 | \ | 92 | \ |
93 | __mutex_init((mutex), #mutex, &__key); \ | 93 | __mutex_init((mutex), #mutex, &__key); \ |
94 | } while (0) | 94 | } while (0) |
95 | # define mutex_destroy(mutex) do { } while (0) | 95 | static inline void mutex_destroy(struct mutex *lock) {} |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 98 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
diff --git a/include/linux/namei.h b/include/linux/namei.h index eba45ea10298..76fe2c62ae71 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -48,7 +48,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
48 | */ | 48 | */ |
49 | #define LOOKUP_FOLLOW 0x0001 | 49 | #define LOOKUP_FOLLOW 0x0001 |
50 | #define LOOKUP_DIRECTORY 0x0002 | 50 | #define LOOKUP_DIRECTORY 0x0002 |
51 | #define LOOKUP_CONTINUE 0x0004 | ||
52 | 51 | ||
53 | #define LOOKUP_PARENT 0x0010 | 52 | #define LOOKUP_PARENT 0x0010 |
54 | #define LOOKUP_REVAL 0x0020 | 53 | #define LOOKUP_REVAL 0x0020 |
@@ -75,9 +74,11 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *); | |||
75 | 74 | ||
76 | extern int kern_path(const char *, unsigned, struct path *); | 75 | extern int kern_path(const char *, unsigned, struct path *); |
77 | 76 | ||
77 | extern struct dentry *kern_path_create(int, const char *, struct path *, int); | ||
78 | extern struct dentry *user_path_create(int, const char __user *, struct path *, int); | ||
78 | extern int kern_path_parent(const char *, struct nameidata *); | 79 | extern int kern_path_parent(const char *, struct nameidata *); |
79 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 80 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
80 | const char *, unsigned int, struct nameidata *); | 81 | const char *, unsigned int, struct path *); |
81 | 82 | ||
82 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | 83 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, |
83 | int (*open)(struct inode *, struct file *)); | 84 | int (*open)(struct inode *, struct file *)); |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9e19477991ad..ddee79bb8f15 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -34,8 +34,7 @@ | |||
34 | #include <linux/pm_qos_params.h> | 34 | #include <linux/pm_qos_params.h> |
35 | #include <linux/timer.h> | 35 | #include <linux/timer.h> |
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/mm.h> | 37 | #include <linux/atomic.h> |
38 | #include <asm/atomic.h> | ||
39 | #include <asm/cache.h> | 38 | #include <asm/cache.h> |
40 | #include <asm/byteorder.h> | 39 | #include <asm/byteorder.h> |
41 | 40 | ||
@@ -61,11 +60,6 @@ struct wireless_dev; | |||
61 | #define SET_ETHTOOL_OPS(netdev,ops) \ | 60 | #define SET_ETHTOOL_OPS(netdev,ops) \ |
62 | ( (netdev)->ethtool_ops = (ops) ) | 61 | ( (netdev)->ethtool_ops = (ops) ) |
63 | 62 | ||
64 | #define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev | ||
65 | functions are available. */ | ||
66 | #define HAVE_FREE_NETDEV /* free_netdev() */ | ||
67 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ | ||
68 | |||
69 | /* hardware address assignment types */ | 63 | /* hardware address assignment types */ |
70 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ | 64 | #define NET_ADDR_PERM 0 /* address is permanent (default) */ |
71 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ | 65 | #define NET_ADDR_RANDOM 1 /* address is generated randomly */ |
@@ -258,21 +252,8 @@ struct netdev_hw_addr_list { | |||
258 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) | 252 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) |
259 | 253 | ||
260 | struct hh_cache { | 254 | struct hh_cache { |
261 | struct hh_cache *hh_next; /* Next entry */ | 255 | u16 hh_len; |
262 | atomic_t hh_refcnt; /* number of users */ | 256 | u16 __pad; |
263 | /* | ||
264 | * We want hh_output, hh_len, hh_lock and hh_data be a in a separate | ||
265 | * cache line on SMP. | ||
266 | * They are mostly read, but hh_refcnt may be changed quite frequently, | ||
267 | * incurring cache line ping pongs. | ||
268 | */ | ||
269 | __be16 hh_type ____cacheline_aligned_in_smp; | ||
270 | /* protocol identifier, f.e ETH_P_IP | ||
271 | * NOTE: For VLANs, this will be the | ||
272 | * encapuslated type. --BLG | ||
273 | */ | ||
274 | u16 hh_len; /* length of header */ | ||
275 | int (*hh_output)(struct sk_buff *skb); | ||
276 | seqlock_t hh_lock; | 257 | seqlock_t hh_lock; |
277 | 258 | ||
278 | /* cached hardware header; allow for machine alignment needs. */ | 259 | /* cached hardware header; allow for machine alignment needs. */ |
@@ -284,12 +265,6 @@ struct hh_cache { | |||
284 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 265 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; |
285 | }; | 266 | }; |
286 | 267 | ||
287 | static inline void hh_cache_put(struct hh_cache *hh) | ||
288 | { | ||
289 | if (atomic_dec_and_test(&hh->hh_refcnt)) | ||
290 | kfree(hh); | ||
291 | } | ||
292 | |||
293 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. | 268 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. |
294 | * Alternative is: | 269 | * Alternative is: |
295 | * dev->hard_header_len ? (dev->hard_header_len + | 270 | * dev->hard_header_len ? (dev->hard_header_len + |
@@ -314,8 +289,7 @@ struct header_ops { | |||
314 | const void *saddr, unsigned len); | 289 | const void *saddr, unsigned len); |
315 | int (*parse)(const struct sk_buff *skb, unsigned char *haddr); | 290 | int (*parse)(const struct sk_buff *skb, unsigned char *haddr); |
316 | int (*rebuild)(struct sk_buff *skb); | 291 | int (*rebuild)(struct sk_buff *skb); |
317 | #define HAVE_HEADER_CACHE | 292 | int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type); |
318 | int (*cache)(const struct neighbour *neigh, struct hh_cache *hh); | ||
319 | void (*cache_update)(struct hh_cache *hh, | 293 | void (*cache_update)(struct hh_cache *hh, |
320 | const struct net_device *dev, | 294 | const struct net_device *dev, |
321 | const unsigned char *haddr); | 295 | const unsigned char *haddr); |
@@ -556,7 +530,7 @@ struct netdev_queue { | |||
556 | struct Qdisc *qdisc; | 530 | struct Qdisc *qdisc; |
557 | unsigned long state; | 531 | unsigned long state; |
558 | struct Qdisc *qdisc_sleeping; | 532 | struct Qdisc *qdisc_sleeping; |
559 | #ifdef CONFIG_RPS | 533 | #if defined(CONFIG_RPS) || defined(CONFIG_XPS) |
560 | struct kobject kobj; | 534 | struct kobject kobj; |
561 | #endif | 535 | #endif |
562 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | 536 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) |
@@ -794,12 +768,6 @@ struct netdev_tc_txq { | |||
794 | * 3. Update dev->stats asynchronously and atomically, and define | 768 | * 3. Update dev->stats asynchronously and atomically, and define |
795 | * neither operation. | 769 | * neither operation. |
796 | * | 770 | * |
797 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); | ||
798 | * If device support VLAN receive acceleration | ||
799 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called | ||
800 | * when vlan groups for the device changes. Note: grp is NULL | ||
801 | * if no vlan's groups are being used. | ||
802 | * | ||
803 | * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); | 771 | * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); |
804 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) | 772 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) |
805 | * this function is called when a VLAN id is registered. | 773 | * this function is called when a VLAN id is registered. |
@@ -888,7 +856,6 @@ struct netdev_tc_txq { | |||
888 | * Must return >0 or -errno if it changed dev->features itself. | 856 | * Must return >0 or -errno if it changed dev->features itself. |
889 | * | 857 | * |
890 | */ | 858 | */ |
891 | #define HAVE_NET_DEVICE_OPS | ||
892 | struct net_device_ops { | 859 | struct net_device_ops { |
893 | int (*ndo_init)(struct net_device *dev); | 860 | int (*ndo_init)(struct net_device *dev); |
894 | void (*ndo_uninit)(struct net_device *dev); | 861 | void (*ndo_uninit)(struct net_device *dev); |
@@ -919,8 +886,6 @@ struct net_device_ops { | |||
919 | struct rtnl_link_stats64 *storage); | 886 | struct rtnl_link_stats64 *storage); |
920 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 887 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
921 | 888 | ||
922 | void (*ndo_vlan_rx_register)(struct net_device *dev, | ||
923 | struct vlan_group *grp); | ||
924 | void (*ndo_vlan_rx_add_vid)(struct net_device *dev, | 889 | void (*ndo_vlan_rx_add_vid)(struct net_device *dev, |
925 | unsigned short vid); | 890 | unsigned short vid); |
926 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | 891 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, |
@@ -1167,7 +1132,7 @@ struct net_device { | |||
1167 | spinlock_t addr_list_lock; | 1132 | spinlock_t addr_list_lock; |
1168 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ | 1133 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ |
1169 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ | 1134 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ |
1170 | int uc_promisc; | 1135 | bool uc_promisc; |
1171 | unsigned int promiscuity; | 1136 | unsigned int promiscuity; |
1172 | unsigned int allmulti; | 1137 | unsigned int allmulti; |
1173 | 1138 | ||
@@ -1214,7 +1179,7 @@ struct net_device { | |||
1214 | 1179 | ||
1215 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 1180 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
1216 | 1181 | ||
1217 | #ifdef CONFIG_RPS | 1182 | #if defined(CONFIG_RPS) || defined(CONFIG_XPS) |
1218 | struct kset *queues_kset; | 1183 | struct kset *queues_kset; |
1219 | 1184 | ||
1220 | struct netdev_rx_queue *_rx; | 1185 | struct netdev_rx_queue *_rx; |
@@ -1342,9 +1307,6 @@ struct net_device { | |||
1342 | /* max exchange id for FCoE LRO by ddp */ | 1307 | /* max exchange id for FCoE LRO by ddp */ |
1343 | unsigned int fcoe_ddp_xid; | 1308 | unsigned int fcoe_ddp_xid; |
1344 | #endif | 1309 | #endif |
1345 | /* n-tuple filter list attached to this device */ | ||
1346 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; | ||
1347 | |||
1348 | /* phy device may attach itself for hardware timestamping */ | 1310 | /* phy device may attach itself for hardware timestamping */ |
1349 | struct phy_device *phydev; | 1311 | struct phy_device *phydev; |
1350 | 1312 | ||
@@ -1557,9 +1519,41 @@ struct packet_type { | |||
1557 | struct list_head list; | 1519 | struct list_head list; |
1558 | }; | 1520 | }; |
1559 | 1521 | ||
1560 | #include <linux/interrupt.h> | ||
1561 | #include <linux/notifier.h> | 1522 | #include <linux/notifier.h> |
1562 | 1523 | ||
1524 | /* netdevice notifier chain. Please remember to update the rtnetlink | ||
1525 | * notification exclusion list in rtnetlink_event() when adding new | ||
1526 | * types. | ||
1527 | */ | ||
1528 | #define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ | ||
1529 | #define NETDEV_DOWN 0x0002 | ||
1530 | #define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface | ||
1531 | detected a hardware crash and restarted | ||
1532 | - we can use this eg to kick tcp sessions | ||
1533 | once done */ | ||
1534 | #define NETDEV_CHANGE 0x0004 /* Notify device state change */ | ||
1535 | #define NETDEV_REGISTER 0x0005 | ||
1536 | #define NETDEV_UNREGISTER 0x0006 | ||
1537 | #define NETDEV_CHANGEMTU 0x0007 | ||
1538 | #define NETDEV_CHANGEADDR 0x0008 | ||
1539 | #define NETDEV_GOING_DOWN 0x0009 | ||
1540 | #define NETDEV_CHANGENAME 0x000A | ||
1541 | #define NETDEV_FEAT_CHANGE 0x000B | ||
1542 | #define NETDEV_BONDING_FAILOVER 0x000C | ||
1543 | #define NETDEV_PRE_UP 0x000D | ||
1544 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | ||
1545 | #define NETDEV_POST_TYPE_CHANGE 0x000F | ||
1546 | #define NETDEV_POST_INIT 0x0010 | ||
1547 | #define NETDEV_UNREGISTER_BATCH 0x0011 | ||
1548 | #define NETDEV_RELEASE 0x0012 | ||
1549 | #define NETDEV_NOTIFY_PEERS 0x0013 | ||
1550 | #define NETDEV_JOIN 0x0014 | ||
1551 | |||
1552 | extern int register_netdevice_notifier(struct notifier_block *nb); | ||
1553 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | ||
1554 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | ||
1555 | |||
1556 | |||
1563 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1557 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1564 | 1558 | ||
1565 | 1559 | ||
@@ -1642,12 +1636,9 @@ static inline void unregister_netdevice(struct net_device *dev) | |||
1642 | extern int netdev_refcnt_read(const struct net_device *dev); | 1636 | extern int netdev_refcnt_read(const struct net_device *dev); |
1643 | extern void free_netdev(struct net_device *dev); | 1637 | extern void free_netdev(struct net_device *dev); |
1644 | extern void synchronize_net(void); | 1638 | extern void synchronize_net(void); |
1645 | extern int register_netdevice_notifier(struct notifier_block *nb); | ||
1646 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | ||
1647 | extern int init_dummy_netdev(struct net_device *dev); | 1639 | extern int init_dummy_netdev(struct net_device *dev); |
1648 | extern void netdev_resync_ops(struct net_device *dev); | 1640 | extern void netdev_resync_ops(struct net_device *dev); |
1649 | 1641 | ||
1650 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | ||
1651 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1642 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1652 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1643 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
1653 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | 1644 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); |
@@ -1688,9 +1679,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) | |||
1688 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, | 1679 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, |
1689 | unsigned int offset) | 1680 | unsigned int offset) |
1690 | { | 1681 | { |
1682 | if (!pskb_may_pull(skb, hlen)) | ||
1683 | return NULL; | ||
1684 | |||
1691 | NAPI_GRO_CB(skb)->frag0 = NULL; | 1685 | NAPI_GRO_CB(skb)->frag0 = NULL; |
1692 | NAPI_GRO_CB(skb)->frag0_len = 0; | 1686 | NAPI_GRO_CB(skb)->frag0_len = 0; |
1693 | return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; | 1687 | return skb->data + offset; |
1694 | } | 1688 | } |
1695 | 1689 | ||
1696 | static inline void *skb_gro_mac_header(struct sk_buff *skb) | 1690 | static inline void *skb_gro_mac_header(struct sk_buff *skb) |
@@ -1780,8 +1774,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, | |||
1780 | 1774 | ||
1781 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); | 1775 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); |
1782 | 1776 | ||
1783 | #define HAVE_NETIF_QUEUE | ||
1784 | |||
1785 | extern void __netif_schedule(struct Qdisc *q); | 1777 | extern void __netif_schedule(struct Qdisc *q); |
1786 | 1778 | ||
1787 | static inline void netif_schedule_queue(struct netdev_queue *txq) | 1779 | static inline void netif_schedule_queue(struct netdev_queue *txq) |
@@ -2057,10 +2049,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb); | |||
2057 | */ | 2049 | */ |
2058 | extern void dev_kfree_skb_any(struct sk_buff *skb); | 2050 | extern void dev_kfree_skb_any(struct sk_buff *skb); |
2059 | 2051 | ||
2060 | #define HAVE_NETIF_RX 1 | ||
2061 | extern int netif_rx(struct sk_buff *skb); | 2052 | extern int netif_rx(struct sk_buff *skb); |
2062 | extern int netif_rx_ni(struct sk_buff *skb); | 2053 | extern int netif_rx_ni(struct sk_buff *skb); |
2063 | #define HAVE_NETIF_RECEIVE_SKB 1 | ||
2064 | extern int netif_receive_skb(struct sk_buff *skb); | 2054 | extern int netif_receive_skb(struct sk_buff *skb); |
2065 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | 2055 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
2066 | struct sk_buff *skb); | 2056 | struct sk_buff *skb); |
@@ -2240,7 +2230,6 @@ extern void netif_device_attach(struct net_device *dev); | |||
2240 | /* | 2230 | /* |
2241 | * Network interface message level settings | 2231 | * Network interface message level settings |
2242 | */ | 2232 | */ |
2243 | #define HAVE_NETIF_MSG 1 | ||
2244 | 2233 | ||
2245 | enum { | 2234 | enum { |
2246 | NETIF_MSG_DRV = 0x0001, | 2235 | NETIF_MSG_DRV = 0x0001, |
@@ -2558,7 +2547,6 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev) | |||
2558 | return (dev->features & ~dev->hw_features) | dev->wanted_features; | 2547 | return (dev->features & ~dev->hw_features) | dev->wanted_features; |
2559 | } | 2548 | } |
2560 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); | 2549 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); |
2561 | u32 netdev_fix_features(struct net_device *dev, u32 features); | ||
2562 | int __netdev_update_features(struct net_device *dev); | 2550 | int __netdev_update_features(struct net_device *dev); |
2563 | void netdev_update_features(struct net_device *dev); | 2551 | void netdev_update_features(struct net_device *dev); |
2564 | void netdev_change_features(struct net_device *dev); | 2552 | void netdev_change_features(struct net_device *dev); |
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index 5a262e3ae715..3540c6e262f7 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
@@ -104,6 +104,8 @@ enum { | |||
104 | IPSET_ATTR_NAMEREF, | 104 | IPSET_ATTR_NAMEREF, |
105 | IPSET_ATTR_IP2, | 105 | IPSET_ATTR_IP2, |
106 | IPSET_ATTR_CIDR2, | 106 | IPSET_ATTR_CIDR2, |
107 | IPSET_ATTR_IP2_TO, | ||
108 | IPSET_ATTR_IFACE, | ||
107 | __IPSET_ATTR_ADT_MAX, | 109 | __IPSET_ATTR_ADT_MAX, |
108 | }; | 110 | }; |
109 | #define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) | 111 | #define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) |
@@ -142,12 +144,18 @@ enum ipset_errno { | |||
142 | enum ipset_cmd_flags { | 144 | enum ipset_cmd_flags { |
143 | IPSET_FLAG_BIT_EXIST = 0, | 145 | IPSET_FLAG_BIT_EXIST = 0, |
144 | IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST), | 146 | IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST), |
147 | IPSET_FLAG_BIT_LIST_SETNAME = 1, | ||
148 | IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME), | ||
149 | IPSET_FLAG_BIT_LIST_HEADER = 2, | ||
150 | IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER), | ||
145 | }; | 151 | }; |
146 | 152 | ||
147 | /* Flags at CADT attribute level */ | 153 | /* Flags at CADT attribute level */ |
148 | enum ipset_cadt_flags { | 154 | enum ipset_cadt_flags { |
149 | IPSET_FLAG_BIT_BEFORE = 0, | 155 | IPSET_FLAG_BIT_BEFORE = 0, |
150 | IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), | 156 | IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), |
157 | IPSET_FLAG_BIT_PHYSDEV = 1, | ||
158 | IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV), | ||
151 | }; | 159 | }; |
152 | 160 | ||
153 | /* Commands with settype-specific attributes */ | 161 | /* Commands with settype-specific attributes */ |
@@ -165,6 +173,7 @@ enum ipset_adt { | |||
165 | #include <linux/ipv6.h> | 173 | #include <linux/ipv6.h> |
166 | #include <linux/netlink.h> | 174 | #include <linux/netlink.h> |
167 | #include <linux/netfilter.h> | 175 | #include <linux/netfilter.h> |
176 | #include <linux/netfilter/x_tables.h> | ||
168 | #include <linux/vmalloc.h> | 177 | #include <linux/vmalloc.h> |
169 | #include <net/netlink.h> | 178 | #include <net/netlink.h> |
170 | 179 | ||
@@ -206,6 +215,8 @@ enum ip_set_feature { | |||
206 | IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG), | 215 | IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG), |
207 | IPSET_TYPE_NAME_FLAG = 4, | 216 | IPSET_TYPE_NAME_FLAG = 4, |
208 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), | 217 | IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), |
218 | IPSET_TYPE_IFACE_FLAG = 5, | ||
219 | IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG), | ||
209 | /* Strictly speaking not a feature, but a flag for dumping: | 220 | /* Strictly speaking not a feature, but a flag for dumping: |
210 | * this settype must be dumped last */ | 221 | * this settype must be dumped last */ |
211 | IPSET_DUMP_LAST_FLAG = 7, | 222 | IPSET_DUMP_LAST_FLAG = 7, |
@@ -214,7 +225,17 @@ enum ip_set_feature { | |||
214 | 225 | ||
215 | struct ip_set; | 226 | struct ip_set; |
216 | 227 | ||
217 | typedef int (*ipset_adtfn)(struct ip_set *set, void *value, u32 timeout); | 228 | typedef int (*ipset_adtfn)(struct ip_set *set, void *value, |
229 | u32 timeout, u32 flags); | ||
230 | |||
231 | /* Kernel API function options */ | ||
232 | struct ip_set_adt_opt { | ||
233 | u8 family; /* Actual protocol family */ | ||
234 | u8 dim; /* Dimension of match/target */ | ||
235 | u8 flags; /* Direction and negation flags */ | ||
236 | u32 cmdflags; /* Command-like flags */ | ||
237 | u32 timeout; /* Timeout value */ | ||
238 | }; | ||
218 | 239 | ||
219 | /* Set type, variant-specific part */ | 240 | /* Set type, variant-specific part */ |
220 | struct ip_set_type_variant { | 241 | struct ip_set_type_variant { |
@@ -223,14 +244,15 @@ struct ip_set_type_variant { | |||
223 | * zero for no match/success to add/delete | 244 | * zero for no match/success to add/delete |
224 | * positive for matching element */ | 245 | * positive for matching element */ |
225 | int (*kadt)(struct ip_set *set, const struct sk_buff * skb, | 246 | int (*kadt)(struct ip_set *set, const struct sk_buff * skb, |
226 | enum ipset_adt adt, u8 pf, u8 dim, u8 flags); | 247 | const struct xt_action_param *par, |
248 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); | ||
227 | 249 | ||
228 | /* Userspace: test/add/del entries | 250 | /* Userspace: test/add/del entries |
229 | * returns negative error code, | 251 | * returns negative error code, |
230 | * zero for no match/success to add/delete | 252 | * zero for no match/success to add/delete |
231 | * positive for matching element */ | 253 | * positive for matching element */ |
232 | int (*uadt)(struct ip_set *set, struct nlattr *tb[], | 254 | int (*uadt)(struct ip_set *set, struct nlattr *tb[], |
233 | enum ipset_adt adt, u32 *lineno, u32 flags); | 255 | enum ipset_adt adt, u32 *lineno, u32 flags, bool retried); |
234 | 256 | ||
235 | /* Low level add/del/test functions */ | 257 | /* Low level add/del/test functions */ |
236 | ipset_adtfn adt[IPSET_ADT_MAX]; | 258 | ipset_adtfn adt[IPSET_ADT_MAX]; |
@@ -268,8 +290,8 @@ struct ip_set_type { | |||
268 | u8 dimension; | 290 | u8 dimension; |
269 | /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ | 291 | /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ |
270 | u8 family; | 292 | u8 family; |
271 | /* Type revision */ | 293 | /* Type revisions */ |
272 | u8 revision; | 294 | u8 revision_min, revision_max; |
273 | 295 | ||
274 | /* Create set */ | 296 | /* Create set */ |
275 | int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); | 297 | int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); |
@@ -300,6 +322,8 @@ struct ip_set { | |||
300 | const struct ip_set_type_variant *variant; | 322 | const struct ip_set_type_variant *variant; |
301 | /* The actual INET family of the set */ | 323 | /* The actual INET family of the set */ |
302 | u8 family; | 324 | u8 family; |
325 | /* The type revision */ | ||
326 | u8 revision; | ||
303 | /* The type specific data */ | 327 | /* The type specific data */ |
304 | void *data; | 328 | void *data; |
305 | }; | 329 | }; |
@@ -307,21 +331,25 @@ struct ip_set { | |||
307 | /* register and unregister set references */ | 331 | /* register and unregister set references */ |
308 | extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); | 332 | extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); |
309 | extern void ip_set_put_byindex(ip_set_id_t index); | 333 | extern void ip_set_put_byindex(ip_set_id_t index); |
310 | extern const char * ip_set_name_byindex(ip_set_id_t index); | 334 | extern const char *ip_set_name_byindex(ip_set_id_t index); |
311 | extern ip_set_id_t ip_set_nfnl_get(const char *name); | 335 | extern ip_set_id_t ip_set_nfnl_get(const char *name); |
312 | extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); | 336 | extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); |
313 | extern void ip_set_nfnl_put(ip_set_id_t index); | 337 | extern void ip_set_nfnl_put(ip_set_id_t index); |
314 | 338 | ||
315 | /* API for iptables set match, and SET target */ | 339 | /* API for iptables set match, and SET target */ |
340 | |||
316 | extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb, | 341 | extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb, |
317 | u8 family, u8 dim, u8 flags); | 342 | const struct xt_action_param *par, |
343 | const struct ip_set_adt_opt *opt); | ||
318 | extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb, | 344 | extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb, |
319 | u8 family, u8 dim, u8 flags); | 345 | const struct xt_action_param *par, |
346 | const struct ip_set_adt_opt *opt); | ||
320 | extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb, | 347 | extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb, |
321 | u8 family, u8 dim, u8 flags); | 348 | const struct xt_action_param *par, |
349 | const struct ip_set_adt_opt *opt); | ||
322 | 350 | ||
323 | /* Utility functions */ | 351 | /* Utility functions */ |
324 | extern void * ip_set_alloc(size_t size); | 352 | extern void *ip_set_alloc(size_t size); |
325 | extern void ip_set_free(void *members); | 353 | extern void ip_set_free(void *members); |
326 | extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); | 354 | extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); |
327 | extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); | 355 | extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); |
@@ -331,7 +359,7 @@ ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr) | |||
331 | { | 359 | { |
332 | __be32 ip; | 360 | __be32 ip; |
333 | int ret = ip_set_get_ipaddr4(nla, &ip); | 361 | int ret = ip_set_get_ipaddr4(nla, &ip); |
334 | 362 | ||
335 | if (ret) | 363 | if (ret) |
336 | return ret; | 364 | return ret; |
337 | *ipaddr = ntohl(ip); | 365 | *ipaddr = ntohl(ip); |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index ac3c822eb39a..b89fb79cb44f 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
@@ -5,6 +5,11 @@ | |||
5 | #include <linux/jhash.h> | 5 | #include <linux/jhash.h> |
6 | #include <linux/netfilter/ipset/ip_set_timeout.h> | 6 | #include <linux/netfilter/ipset/ip_set_timeout.h> |
7 | 7 | ||
8 | #define CONCAT(a, b, c) a##b##c | ||
9 | #define TOKEN(a, b, c) CONCAT(a, b, c) | ||
10 | |||
11 | #define type_pf_next TOKEN(TYPE, PF, _elem) | ||
12 | |||
8 | /* Hashing which uses arrays to resolve clashing. The hash table is resized | 13 | /* Hashing which uses arrays to resolve clashing. The hash table is resized |
9 | * (doubled) when searching becomes too long. | 14 | * (doubled) when searching becomes too long. |
10 | * Internally jhash is used with the assumption that the size of the | 15 | * Internally jhash is used with the assumption that the size of the |
@@ -23,7 +28,32 @@ | |||
23 | /* Number of elements to store in an initial array block */ | 28 | /* Number of elements to store in an initial array block */ |
24 | #define AHASH_INIT_SIZE 4 | 29 | #define AHASH_INIT_SIZE 4 |
25 | /* Max number of elements to store in an array block */ | 30 | /* Max number of elements to store in an array block */ |
26 | #define AHASH_MAX_SIZE (3*4) | 31 | #define AHASH_MAX_SIZE (3*AHASH_INIT_SIZE) |
32 | |||
33 | /* Max number of elements can be tuned */ | ||
34 | #ifdef IP_SET_HASH_WITH_MULTI | ||
35 | #define AHASH_MAX(h) ((h)->ahash_max) | ||
36 | |||
37 | static inline u8 | ||
38 | tune_ahash_max(u8 curr, u32 multi) | ||
39 | { | ||
40 | u32 n; | ||
41 | |||
42 | if (multi < curr) | ||
43 | return curr; | ||
44 | |||
45 | n = curr + AHASH_INIT_SIZE; | ||
46 | /* Currently, at listing one hash bucket must fit into a message. | ||
47 | * Therefore we have a hard limit here. | ||
48 | */ | ||
49 | return n > curr && n <= 64 ? n : curr; | ||
50 | } | ||
51 | #define TUNE_AHASH_MAX(h, multi) \ | ||
52 | ((h)->ahash_max = tune_ahash_max((h)->ahash_max, multi)) | ||
53 | #else | ||
54 | #define AHASH_MAX(h) AHASH_MAX_SIZE | ||
55 | #define TUNE_AHASH_MAX(h, multi) | ||
56 | #endif | ||
27 | 57 | ||
28 | /* A hash bucket */ | 58 | /* A hash bucket */ |
29 | struct hbucket { | 59 | struct hbucket { |
@@ -38,7 +68,7 @@ struct htable { | |||
38 | struct hbucket bucket[0]; /* hashtable buckets */ | 68 | struct hbucket bucket[0]; /* hashtable buckets */ |
39 | }; | 69 | }; |
40 | 70 | ||
41 | #define hbucket(h, i) &((h)->bucket[i]) | 71 | #define hbucket(h, i) (&((h)->bucket[i])) |
42 | 72 | ||
43 | /* Book-keeping of the prefixes added to the set */ | 73 | /* Book-keeping of the prefixes added to the set */ |
44 | struct ip_set_hash_nets { | 74 | struct ip_set_hash_nets { |
@@ -54,9 +84,16 @@ struct ip_set_hash { | |||
54 | u32 initval; /* random jhash init value */ | 84 | u32 initval; /* random jhash init value */ |
55 | u32 timeout; /* timeout value, if enabled */ | 85 | u32 timeout; /* timeout value, if enabled */ |
56 | struct timer_list gc; /* garbage collection when timeout enabled */ | 86 | struct timer_list gc; /* garbage collection when timeout enabled */ |
87 | struct type_pf_next next; /* temporary storage for uadd */ | ||
88 | #ifdef IP_SET_HASH_WITH_MULTI | ||
89 | u8 ahash_max; /* max elements in an array block */ | ||
90 | #endif | ||
57 | #ifdef IP_SET_HASH_WITH_NETMASK | 91 | #ifdef IP_SET_HASH_WITH_NETMASK |
58 | u8 netmask; /* netmask value for subnets to store */ | 92 | u8 netmask; /* netmask value for subnets to store */ |
59 | #endif | 93 | #endif |
94 | #ifdef IP_SET_HASH_WITH_RBTREE | ||
95 | struct rb_root rbtree; | ||
96 | #endif | ||
60 | #ifdef IP_SET_HASH_WITH_NETS | 97 | #ifdef IP_SET_HASH_WITH_NETS |
61 | struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */ | 98 | struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */ |
62 | #endif | 99 | #endif |
@@ -194,17 +231,24 @@ ip_set_hash_destroy(struct ip_set *set) | |||
194 | del_timer_sync(&h->gc); | 231 | del_timer_sync(&h->gc); |
195 | 232 | ||
196 | ahash_destroy(h->table); | 233 | ahash_destroy(h->table); |
234 | #ifdef IP_SET_HASH_WITH_RBTREE | ||
235 | rbtree_destroy(&h->rbtree); | ||
236 | #endif | ||
197 | kfree(h); | 237 | kfree(h); |
198 | 238 | ||
199 | set->data = NULL; | 239 | set->data = NULL; |
200 | } | 240 | } |
201 | 241 | ||
202 | #define HKEY(data, initval, htable_bits) \ | ||
203 | (jhash2((u32 *)(data), sizeof(struct type_pf_elem)/sizeof(u32), initval) \ | ||
204 | & jhash_mask(htable_bits)) | ||
205 | |||
206 | #endif /* _IP_SET_AHASH_H */ | 242 | #endif /* _IP_SET_AHASH_H */ |
207 | 243 | ||
244 | #ifndef HKEY_DATALEN | ||
245 | #define HKEY_DATALEN sizeof(struct type_pf_elem) | ||
246 | #endif | ||
247 | |||
248 | #define HKEY(data, initval, htable_bits) \ | ||
249 | (jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \ | ||
250 | & jhash_mask(htable_bits)) | ||
251 | |||
208 | #define CONCAT(a, b, c) a##b##c | 252 | #define CONCAT(a, b, c) a##b##c |
209 | #define TOKEN(a, b, c) CONCAT(a, b, c) | 253 | #define TOKEN(a, b, c) CONCAT(a, b, c) |
210 | 254 | ||
@@ -217,6 +261,7 @@ ip_set_hash_destroy(struct ip_set *set) | |||
217 | #define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask) | 261 | #define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask) |
218 | #define type_pf_data_list TOKEN(TYPE, PF, _data_list) | 262 | #define type_pf_data_list TOKEN(TYPE, PF, _data_list) |
219 | #define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) | 263 | #define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) |
264 | #define type_pf_data_next TOKEN(TYPE, PF, _data_next) | ||
220 | 265 | ||
221 | #define type_pf_elem TOKEN(TYPE, PF, _elem) | 266 | #define type_pf_elem TOKEN(TYPE, PF, _elem) |
222 | #define type_pf_telem TOKEN(TYPE, PF, _telem) | 267 | #define type_pf_telem TOKEN(TYPE, PF, _telem) |
@@ -262,12 +307,13 @@ ip_set_hash_destroy(struct ip_set *set) | |||
262 | /* Add an element to the hash table when resizing the set: | 307 | /* Add an element to the hash table when resizing the set: |
263 | * we spare the maintenance of the internal counters. */ | 308 | * we spare the maintenance of the internal counters. */ |
264 | static int | 309 | static int |
265 | type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value) | 310 | type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value, |
311 | u8 ahash_max) | ||
266 | { | 312 | { |
267 | if (n->pos >= n->size) { | 313 | if (n->pos >= n->size) { |
268 | void *tmp; | 314 | void *tmp; |
269 | 315 | ||
270 | if (n->size >= AHASH_MAX_SIZE) | 316 | if (n->size >= ahash_max) |
271 | /* Trigger rehashing */ | 317 | /* Trigger rehashing */ |
272 | return -EAGAIN; | 318 | return -EAGAIN; |
273 | 319 | ||
@@ -322,7 +368,7 @@ retry: | |||
322 | for (j = 0; j < n->pos; j++) { | 368 | for (j = 0; j < n->pos; j++) { |
323 | data = ahash_data(n, j); | 369 | data = ahash_data(n, j); |
324 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 370 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
325 | ret = type_pf_elem_add(m, data); | 371 | ret = type_pf_elem_add(m, data, AHASH_MAX(h)); |
326 | if (ret < 0) { | 372 | if (ret < 0) { |
327 | read_unlock_bh(&set->lock); | 373 | read_unlock_bh(&set->lock); |
328 | ahash_destroy(t); | 374 | ahash_destroy(t); |
@@ -346,17 +392,20 @@ retry: | |||
346 | return 0; | 392 | return 0; |
347 | } | 393 | } |
348 | 394 | ||
395 | static inline void | ||
396 | type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d); | ||
397 | |||
349 | /* Add an element to a hash and update the internal counters when succeeded, | 398 | /* Add an element to a hash and update the internal counters when succeeded, |
350 | * otherwise report the proper error code. */ | 399 | * otherwise report the proper error code. */ |
351 | static int | 400 | static int |
352 | type_pf_add(struct ip_set *set, void *value, u32 timeout) | 401 | type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags) |
353 | { | 402 | { |
354 | struct ip_set_hash *h = set->data; | 403 | struct ip_set_hash *h = set->data; |
355 | struct htable *t; | 404 | struct htable *t; |
356 | const struct type_pf_elem *d = value; | 405 | const struct type_pf_elem *d = value; |
357 | struct hbucket *n; | 406 | struct hbucket *n; |
358 | int i, ret = 0; | 407 | int i, ret = 0; |
359 | u32 key; | 408 | u32 key, multi = 0; |
360 | 409 | ||
361 | if (h->elements >= h->maxelem) | 410 | if (h->elements >= h->maxelem) |
362 | return -IPSET_ERR_HASH_FULL; | 411 | return -IPSET_ERR_HASH_FULL; |
@@ -366,14 +415,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout) | |||
366 | key = HKEY(value, h->initval, t->htable_bits); | 415 | key = HKEY(value, h->initval, t->htable_bits); |
367 | n = hbucket(t, key); | 416 | n = hbucket(t, key); |
368 | for (i = 0; i < n->pos; i++) | 417 | for (i = 0; i < n->pos; i++) |
369 | if (type_pf_data_equal(ahash_data(n, i), d)) { | 418 | if (type_pf_data_equal(ahash_data(n, i), d, &multi)) { |
370 | ret = -IPSET_ERR_EXIST; | 419 | ret = -IPSET_ERR_EXIST; |
371 | goto out; | 420 | goto out; |
372 | } | 421 | } |
373 | 422 | TUNE_AHASH_MAX(h, multi); | |
374 | ret = type_pf_elem_add(n, value); | 423 | ret = type_pf_elem_add(n, value, AHASH_MAX(h)); |
375 | if (ret != 0) | 424 | if (ret != 0) { |
425 | if (ret == -EAGAIN) | ||
426 | type_pf_data_next(h, d); | ||
376 | goto out; | 427 | goto out; |
428 | } | ||
377 | 429 | ||
378 | #ifdef IP_SET_HASH_WITH_NETS | 430 | #ifdef IP_SET_HASH_WITH_NETS |
379 | add_cidr(h, d->cidr, HOST_MASK); | 431 | add_cidr(h, d->cidr, HOST_MASK); |
@@ -388,7 +440,7 @@ out: | |||
388 | * and free up space if possible. | 440 | * and free up space if possible. |
389 | */ | 441 | */ |
390 | static int | 442 | static int |
391 | type_pf_del(struct ip_set *set, void *value, u32 timeout) | 443 | type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags) |
392 | { | 444 | { |
393 | struct ip_set_hash *h = set->data; | 445 | struct ip_set_hash *h = set->data; |
394 | struct htable *t = h->table; | 446 | struct htable *t = h->table; |
@@ -396,13 +448,13 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout) | |||
396 | struct hbucket *n; | 448 | struct hbucket *n; |
397 | int i; | 449 | int i; |
398 | struct type_pf_elem *data; | 450 | struct type_pf_elem *data; |
399 | u32 key; | 451 | u32 key, multi = 0; |
400 | 452 | ||
401 | key = HKEY(value, h->initval, t->htable_bits); | 453 | key = HKEY(value, h->initval, t->htable_bits); |
402 | n = hbucket(t, key); | 454 | n = hbucket(t, key); |
403 | for (i = 0; i < n->pos; i++) { | 455 | for (i = 0; i < n->pos; i++) { |
404 | data = ahash_data(n, i); | 456 | data = ahash_data(n, i); |
405 | if (!type_pf_data_equal(data, d)) | 457 | if (!type_pf_data_equal(data, d, &multi)) |
406 | continue; | 458 | continue; |
407 | if (i != n->pos - 1) | 459 | if (i != n->pos - 1) |
408 | /* Not last one */ | 460 | /* Not last one */ |
@@ -443,17 +495,17 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
443 | struct hbucket *n; | 495 | struct hbucket *n; |
444 | const struct type_pf_elem *data; | 496 | const struct type_pf_elem *data; |
445 | int i, j = 0; | 497 | int i, j = 0; |
446 | u32 key; | 498 | u32 key, multi = 0; |
447 | u8 host_mask = SET_HOST_MASK(set->family); | 499 | u8 host_mask = SET_HOST_MASK(set->family); |
448 | 500 | ||
449 | pr_debug("test by nets\n"); | 501 | pr_debug("test by nets\n"); |
450 | for (; j < host_mask && h->nets[j].cidr; j++) { | 502 | for (; j < host_mask && h->nets[j].cidr && !multi; j++) { |
451 | type_pf_data_netmask(d, h->nets[j].cidr); | 503 | type_pf_data_netmask(d, h->nets[j].cidr); |
452 | key = HKEY(d, h->initval, t->htable_bits); | 504 | key = HKEY(d, h->initval, t->htable_bits); |
453 | n = hbucket(t, key); | 505 | n = hbucket(t, key); |
454 | for (i = 0; i < n->pos; i++) { | 506 | for (i = 0; i < n->pos; i++) { |
455 | data = ahash_data(n, i); | 507 | data = ahash_data(n, i); |
456 | if (type_pf_data_equal(data, d)) | 508 | if (type_pf_data_equal(data, d, &multi)) |
457 | return 1; | 509 | return 1; |
458 | } | 510 | } |
459 | } | 511 | } |
@@ -463,7 +515,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
463 | 515 | ||
464 | /* Test whether the element is added to the set */ | 516 | /* Test whether the element is added to the set */ |
465 | static int | 517 | static int |
466 | type_pf_test(struct ip_set *set, void *value, u32 timeout) | 518 | type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags) |
467 | { | 519 | { |
468 | struct ip_set_hash *h = set->data; | 520 | struct ip_set_hash *h = set->data; |
469 | struct htable *t = h->table; | 521 | struct htable *t = h->table; |
@@ -471,7 +523,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout) | |||
471 | struct hbucket *n; | 523 | struct hbucket *n; |
472 | const struct type_pf_elem *data; | 524 | const struct type_pf_elem *data; |
473 | int i; | 525 | int i; |
474 | u32 key; | 526 | u32 key, multi = 0; |
475 | 527 | ||
476 | #ifdef IP_SET_HASH_WITH_NETS | 528 | #ifdef IP_SET_HASH_WITH_NETS |
477 | /* If we test an IP address and not a network address, | 529 | /* If we test an IP address and not a network address, |
@@ -484,7 +536,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout) | |||
484 | n = hbucket(t, key); | 536 | n = hbucket(t, key); |
485 | for (i = 0; i < n->pos; i++) { | 537 | for (i = 0; i < n->pos; i++) { |
486 | data = ahash_data(n, i); | 538 | data = ahash_data(n, i); |
487 | if (type_pf_data_equal(data, d)) | 539 | if (type_pf_data_equal(data, d, &multi)) |
488 | return 1; | 540 | return 1; |
489 | } | 541 | } |
490 | return 0; | 542 | return 0; |
@@ -586,10 +638,11 @@ nla_put_failure: | |||
586 | 638 | ||
587 | static int | 639 | static int |
588 | type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, | 640 | type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, |
589 | enum ipset_adt adt, u8 pf, u8 dim, u8 flags); | 641 | const struct xt_action_param *par, |
642 | enum ipset_adt adt, const struct ip_set_adt_opt *opt); | ||
590 | static int | 643 | static int |
591 | type_pf_uadt(struct ip_set *set, struct nlattr *tb[], | 644 | type_pf_uadt(struct ip_set *set, struct nlattr *tb[], |
592 | enum ipset_adt adt, u32 *lineno, u32 flags); | 645 | enum ipset_adt adt, u32 *lineno, u32 flags, bool retried); |
593 | 646 | ||
594 | static const struct ip_set_type_variant type_pf_variant = { | 647 | static const struct ip_set_type_variant type_pf_variant = { |
595 | .kadt = type_pf_kadt, | 648 | .kadt = type_pf_kadt, |
@@ -640,14 +693,14 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout) | |||
640 | 693 | ||
641 | static int | 694 | static int |
642 | type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, | 695 | type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, |
643 | u32 timeout) | 696 | u8 ahash_max, u32 timeout) |
644 | { | 697 | { |
645 | struct type_pf_elem *data; | 698 | struct type_pf_elem *data; |
646 | 699 | ||
647 | if (n->pos >= n->size) { | 700 | if (n->pos >= n->size) { |
648 | void *tmp; | 701 | void *tmp; |
649 | 702 | ||
650 | if (n->size >= AHASH_MAX_SIZE) | 703 | if (n->size >= ahash_max) |
651 | /* Trigger rehashing */ | 704 | /* Trigger rehashing */ |
652 | return -EAGAIN; | 705 | return -EAGAIN; |
653 | 706 | ||
@@ -752,7 +805,7 @@ retry: | |||
752 | for (j = 0; j < n->pos; j++) { | 805 | for (j = 0; j < n->pos; j++) { |
753 | data = ahash_tdata(n, j); | 806 | data = ahash_tdata(n, j); |
754 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 807 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
755 | ret = type_pf_elem_tadd(m, data, | 808 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), |
756 | type_pf_data_timeout(data)); | 809 | type_pf_data_timeout(data)); |
757 | if (ret < 0) { | 810 | if (ret < 0) { |
758 | read_unlock_bh(&set->lock); | 811 | read_unlock_bh(&set->lock); |
@@ -776,15 +829,16 @@ retry: | |||
776 | } | 829 | } |
777 | 830 | ||
778 | static int | 831 | static int |
779 | type_pf_tadd(struct ip_set *set, void *value, u32 timeout) | 832 | type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags) |
780 | { | 833 | { |
781 | struct ip_set_hash *h = set->data; | 834 | struct ip_set_hash *h = set->data; |
782 | struct htable *t = h->table; | 835 | struct htable *t = h->table; |
783 | const struct type_pf_elem *d = value; | 836 | const struct type_pf_elem *d = value; |
784 | struct hbucket *n; | 837 | struct hbucket *n; |
785 | struct type_pf_elem *data; | 838 | struct type_pf_elem *data; |
786 | int ret = 0, i, j = AHASH_MAX_SIZE + 1; | 839 | int ret = 0, i, j = AHASH_MAX(h) + 1; |
787 | u32 key; | 840 | bool flag_exist = flags & IPSET_FLAG_EXIST; |
841 | u32 key, multi = 0; | ||
788 | 842 | ||
789 | if (h->elements >= h->maxelem) | 843 | if (h->elements >= h->maxelem) |
790 | /* FIXME: when set is full, we slow down here */ | 844 | /* FIXME: when set is full, we slow down here */ |
@@ -798,18 +852,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout) | |||
798 | n = hbucket(t, key); | 852 | n = hbucket(t, key); |
799 | for (i = 0; i < n->pos; i++) { | 853 | for (i = 0; i < n->pos; i++) { |
800 | data = ahash_tdata(n, i); | 854 | data = ahash_tdata(n, i); |
801 | if (type_pf_data_equal(data, d)) { | 855 | if (type_pf_data_equal(data, d, &multi)) { |
802 | if (type_pf_data_expired(data)) | 856 | if (type_pf_data_expired(data) || flag_exist) |
803 | j = i; | 857 | j = i; |
804 | else { | 858 | else { |
805 | ret = -IPSET_ERR_EXIST; | 859 | ret = -IPSET_ERR_EXIST; |
806 | goto out; | 860 | goto out; |
807 | } | 861 | } |
808 | } else if (j == AHASH_MAX_SIZE + 1 && | 862 | } else if (j == AHASH_MAX(h) + 1 && |
809 | type_pf_data_expired(data)) | 863 | type_pf_data_expired(data)) |
810 | j = i; | 864 | j = i; |
811 | } | 865 | } |
812 | if (j != AHASH_MAX_SIZE + 1) { | 866 | if (j != AHASH_MAX(h) + 1) { |
813 | data = ahash_tdata(n, j); | 867 | data = ahash_tdata(n, j); |
814 | #ifdef IP_SET_HASH_WITH_NETS | 868 | #ifdef IP_SET_HASH_WITH_NETS |
815 | del_cidr(h, data->cidr, HOST_MASK); | 869 | del_cidr(h, data->cidr, HOST_MASK); |
@@ -819,9 +873,13 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout) | |||
819 | type_pf_data_timeout_set(data, timeout); | 873 | type_pf_data_timeout_set(data, timeout); |
820 | goto out; | 874 | goto out; |
821 | } | 875 | } |
822 | ret = type_pf_elem_tadd(n, d, timeout); | 876 | TUNE_AHASH_MAX(h, multi); |
823 | if (ret != 0) | 877 | ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout); |
878 | if (ret != 0) { | ||
879 | if (ret == -EAGAIN) | ||
880 | type_pf_data_next(h, d); | ||
824 | goto out; | 881 | goto out; |
882 | } | ||
825 | 883 | ||
826 | #ifdef IP_SET_HASH_WITH_NETS | 884 | #ifdef IP_SET_HASH_WITH_NETS |
827 | add_cidr(h, d->cidr, HOST_MASK); | 885 | add_cidr(h, d->cidr, HOST_MASK); |
@@ -833,7 +891,7 @@ out: | |||
833 | } | 891 | } |
834 | 892 | ||
835 | static int | 893 | static int |
836 | type_pf_tdel(struct ip_set *set, void *value, u32 timeout) | 894 | type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags) |
837 | { | 895 | { |
838 | struct ip_set_hash *h = set->data; | 896 | struct ip_set_hash *h = set->data; |
839 | struct htable *t = h->table; | 897 | struct htable *t = h->table; |
@@ -841,13 +899,13 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout) | |||
841 | struct hbucket *n; | 899 | struct hbucket *n; |
842 | int i; | 900 | int i; |
843 | struct type_pf_elem *data; | 901 | struct type_pf_elem *data; |
844 | u32 key; | 902 | u32 key, multi = 0; |
845 | 903 | ||
846 | key = HKEY(value, h->initval, t->htable_bits); | 904 | key = HKEY(value, h->initval, t->htable_bits); |
847 | n = hbucket(t, key); | 905 | n = hbucket(t, key); |
848 | for (i = 0; i < n->pos; i++) { | 906 | for (i = 0; i < n->pos; i++) { |
849 | data = ahash_tdata(n, i); | 907 | data = ahash_tdata(n, i); |
850 | if (!type_pf_data_equal(data, d)) | 908 | if (!type_pf_data_equal(data, d, &multi)) |
851 | continue; | 909 | continue; |
852 | if (type_pf_data_expired(data)) | 910 | if (type_pf_data_expired(data)) |
853 | return -IPSET_ERR_EXIST; | 911 | return -IPSET_ERR_EXIST; |
@@ -887,16 +945,16 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
887 | struct type_pf_elem *data; | 945 | struct type_pf_elem *data; |
888 | struct hbucket *n; | 946 | struct hbucket *n; |
889 | int i, j = 0; | 947 | int i, j = 0; |
890 | u32 key; | 948 | u32 key, multi = 0; |
891 | u8 host_mask = SET_HOST_MASK(set->family); | 949 | u8 host_mask = SET_HOST_MASK(set->family); |
892 | 950 | ||
893 | for (; j < host_mask && h->nets[j].cidr; j++) { | 951 | for (; j < host_mask && h->nets[j].cidr && !multi; j++) { |
894 | type_pf_data_netmask(d, h->nets[j].cidr); | 952 | type_pf_data_netmask(d, h->nets[j].cidr); |
895 | key = HKEY(d, h->initval, t->htable_bits); | 953 | key = HKEY(d, h->initval, t->htable_bits); |
896 | n = hbucket(t, key); | 954 | n = hbucket(t, key); |
897 | for (i = 0; i < n->pos; i++) { | 955 | for (i = 0; i < n->pos; i++) { |
898 | data = ahash_tdata(n, i); | 956 | data = ahash_tdata(n, i); |
899 | if (type_pf_data_equal(data, d)) | 957 | if (type_pf_data_equal(data, d, &multi)) |
900 | return !type_pf_data_expired(data); | 958 | return !type_pf_data_expired(data); |
901 | } | 959 | } |
902 | } | 960 | } |
@@ -905,14 +963,14 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout) | |||
905 | #endif | 963 | #endif |
906 | 964 | ||
907 | static int | 965 | static int |
908 | type_pf_ttest(struct ip_set *set, void *value, u32 timeout) | 966 | type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags) |
909 | { | 967 | { |
910 | struct ip_set_hash *h = set->data; | 968 | struct ip_set_hash *h = set->data; |
911 | struct htable *t = h->table; | 969 | struct htable *t = h->table; |
912 | struct type_pf_elem *data, *d = value; | 970 | struct type_pf_elem *data, *d = value; |
913 | struct hbucket *n; | 971 | struct hbucket *n; |
914 | int i; | 972 | int i; |
915 | u32 key; | 973 | u32 key, multi = 0; |
916 | 974 | ||
917 | #ifdef IP_SET_HASH_WITH_NETS | 975 | #ifdef IP_SET_HASH_WITH_NETS |
918 | if (d->cidr == SET_HOST_MASK(set->family)) | 976 | if (d->cidr == SET_HOST_MASK(set->family)) |
@@ -922,7 +980,7 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout) | |||
922 | n = hbucket(t, key); | 980 | n = hbucket(t, key); |
923 | for (i = 0; i < n->pos; i++) { | 981 | for (i = 0; i < n->pos; i++) { |
924 | data = ahash_tdata(n, i); | 982 | data = ahash_tdata(n, i); |
925 | if (type_pf_data_equal(data, d)) | 983 | if (type_pf_data_equal(data, d, &multi)) |
926 | return !type_pf_data_expired(data); | 984 | return !type_pf_data_expired(data); |
927 | } | 985 | } |
928 | return 0; | 986 | return 0; |
@@ -1030,6 +1088,8 @@ type_pf_gc_init(struct ip_set *set) | |||
1030 | IPSET_GC_PERIOD(h->timeout)); | 1088 | IPSET_GC_PERIOD(h->timeout)); |
1031 | } | 1089 | } |
1032 | 1090 | ||
1091 | #undef HKEY_DATALEN | ||
1092 | #undef HKEY | ||
1033 | #undef type_pf_data_equal | 1093 | #undef type_pf_data_equal |
1034 | #undef type_pf_data_isnull | 1094 | #undef type_pf_data_isnull |
1035 | #undef type_pf_data_copy | 1095 | #undef type_pf_data_copy |
diff --git a/include/linux/netfilter/ipset/ip_set_hash.h b/include/linux/netfilter/ipset/ip_set_hash.h index b86f15c04524..e2a9fae767f6 100644 --- a/include/linux/netfilter/ipset/ip_set_hash.h +++ b/include/linux/netfilter/ipset/ip_set_hash.h | |||
@@ -11,6 +11,10 @@ enum { | |||
11 | IPSET_ERR_INVALID_PROTO, | 11 | IPSET_ERR_INVALID_PROTO, |
12 | /* Protocol missing but must be specified */ | 12 | /* Protocol missing but must be specified */ |
13 | IPSET_ERR_MISSING_PROTO, | 13 | IPSET_ERR_MISSING_PROTO, |
14 | /* Range not supported */ | ||
15 | IPSET_ERR_HASH_RANGE_UNSUPPORTED, | ||
16 | /* Invalid range */ | ||
17 | IPSET_ERR_HASH_RANGE, | ||
14 | }; | 18 | }; |
15 | 19 | ||
16 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h index bcdd40ad39ed..47923205a4ad 100644 --- a/include/linux/netfilter/ipset/ip_set_timeout.h +++ b/include/linux/netfilter/ipset/ip_set_timeout.h | |||
@@ -22,6 +22,9 @@ | |||
22 | 22 | ||
23 | #define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT) | 23 | #define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT) |
24 | 24 | ||
25 | #define opt_timeout(opt, map) \ | ||
26 | (with_timeout((opt)->timeout) ? (opt)->timeout : (map)->timeout) | ||
27 | |||
25 | static inline unsigned int | 28 | static inline unsigned int |
26 | ip_set_timeout_uget(struct nlattr *tb) | 29 | ip_set_timeout_uget(struct nlattr *tb) |
27 | { | 30 | { |
@@ -75,7 +78,7 @@ ip_set_timeout_set(u32 timeout) | |||
75 | static inline u32 | 78 | static inline u32 |
76 | ip_set_timeout_get(unsigned long timeout) | 79 | ip_set_timeout_get(unsigned long timeout) |
77 | { | 80 | { |
78 | return timeout == IPSET_ELEM_PERMANENT ? 0 : | 81 | return timeout == IPSET_ELEM_PERMANENT ? 0 : |
79 | jiffies_to_msecs(timeout - jiffies)/1000; | 82 | jiffies_to_msecs(timeout - jiffies)/1000; |
80 | } | 83 | } |
81 | 84 | ||
diff --git a/include/linux/netfilter/ipset/pfxlen.h b/include/linux/netfilter/ipset/pfxlen.h index 0e1fb50da562..199fd11fedc0 100644 --- a/include/linux/netfilter/ipset/pfxlen.h +++ b/include/linux/netfilter/ipset/pfxlen.h | |||
@@ -2,7 +2,8 @@ | |||
2 | #define _PFXLEN_H | 2 | #define _PFXLEN_H |
3 | 3 | ||
4 | #include <asm/byteorder.h> | 4 | #include <asm/byteorder.h> |
5 | #include <linux/netfilter.h> | 5 | #include <linux/netfilter.h> |
6 | #include <net/tcp.h> | ||
6 | 7 | ||
7 | /* Prefixlen maps, by Jan Engelhardt */ | 8 | /* Prefixlen maps, by Jan Engelhardt */ |
8 | extern const union nf_inet_addr ip_set_netmask_map[]; | 9 | extern const union nf_inet_addr ip_set_netmask_map[]; |
@@ -32,4 +33,12 @@ ip_set_hostmask6(u8 pfxlen) | |||
32 | return &ip_set_hostmask_map[pfxlen].ip6[0]; | 33 | return &ip_set_hostmask_map[pfxlen].ip6[0]; |
33 | } | 34 | } |
34 | 35 | ||
36 | extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr); | ||
37 | |||
38 | #define ip_set_mask_from_to(from, to, cidr) \ | ||
39 | do { \ | ||
40 | from &= ip_set_hostmask(cidr); \ | ||
41 | to = from | ~ip_set_hostmask(cidr); \ | ||
42 | } while (0) | ||
43 | |||
35 | #endif /*_PFXLEN_H */ | 44 | #endif /*_PFXLEN_H */ |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 2b11fc1a86be..74d33861473c 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -60,6 +60,9 @@ struct nfnl_callback { | |||
60 | int (*call)(struct sock *nl, struct sk_buff *skb, | 60 | int (*call)(struct sock *nl, struct sk_buff *skb, |
61 | const struct nlmsghdr *nlh, | 61 | const struct nlmsghdr *nlh, |
62 | const struct nlattr * const cda[]); | 62 | const struct nlattr * const cda[]); |
63 | int (*call_rcu)(struct sock *nl, struct sk_buff *skb, | ||
64 | const struct nlmsghdr *nlh, | ||
65 | const struct nlattr * const cda[]); | ||
63 | const struct nla_policy *policy; /* netlink attribute policy */ | 66 | const struct nla_policy *policy; /* netlink attribute policy */ |
64 | const u_int16_t attr_count; /* number of nlattr's */ | 67 | const u_int16_t attr_count; /* number of nlattr's */ |
65 | }; | 68 | }; |
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index af94e0014ebd..24b32e6c009e 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -8,6 +8,7 @@ enum nfqnl_msg_types { | |||
8 | NFQNL_MSG_PACKET, /* packet from kernel to userspace */ | 8 | NFQNL_MSG_PACKET, /* packet from kernel to userspace */ |
9 | NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ | 9 | NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ |
10 | NFQNL_MSG_CONFIG, /* connect to a particular queue */ | 10 | NFQNL_MSG_CONFIG, /* connect to a particular queue */ |
11 | NFQNL_MSG_VERDICT_BATCH, /* batchv from userspace to kernel */ | ||
11 | 12 | ||
12 | NFQNL_MSG_MAX | 13 | NFQNL_MSG_MAX |
13 | }; | 14 | }; |
diff --git a/include/linux/netfilter/xt_set.h b/include/linux/netfilter/xt_set.h index 081f1ded2842..c0405ac92870 100644 --- a/include/linux/netfilter/xt_set.h +++ b/include/linux/netfilter/xt_set.h | |||
@@ -35,7 +35,7 @@ struct xt_set_info_target_v0 { | |||
35 | struct xt_set_info_v0 del_set; | 35 | struct xt_set_info_v0 del_set; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | /* Revision 1: current interface to netfilter/iptables */ | 38 | /* Revision 1 match and target */ |
39 | 39 | ||
40 | struct xt_set_info { | 40 | struct xt_set_info { |
41 | ip_set_id_t index; | 41 | ip_set_id_t index; |
@@ -44,13 +44,22 @@ struct xt_set_info { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | /* match and target infos */ | 46 | /* match and target infos */ |
47 | struct xt_set_info_match { | 47 | struct xt_set_info_match_v1 { |
48 | struct xt_set_info match_set; | 48 | struct xt_set_info match_set; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct xt_set_info_target { | 51 | struct xt_set_info_target_v1 { |
52 | struct xt_set_info add_set; | 52 | struct xt_set_info add_set; |
53 | struct xt_set_info del_set; | 53 | struct xt_set_info del_set; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | /* Revision 2 target */ | ||
57 | |||
58 | struct xt_set_info_target_v2 { | ||
59 | struct xt_set_info add_set; | ||
60 | struct xt_set_info del_set; | ||
61 | u32 flags; | ||
62 | u32 timeout; | ||
63 | }; | ||
64 | |||
56 | #endif /*_XT_SET_H*/ | 65 | #endif /*_XT_SET_H*/ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index a9dd89552f9c..180540a84d37 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #define MAX_LINKS 32 | 29 | #define MAX_LINKS 32 |
30 | 30 | ||
31 | struct sockaddr_nl { | 31 | struct sockaddr_nl { |
32 | sa_family_t nl_family; /* AF_NETLINK */ | 32 | __kernel_sa_family_t nl_family; /* AF_NETLINK */ |
33 | unsigned short nl_pad; /* zero */ | 33 | unsigned short nl_pad; /* zero */ |
34 | __u32 nl_pid; /* port ID */ | 34 | __u32 nl_pid; /* port ID */ |
35 | __u32 nl_groups; /* multicast groups mask */ | 35 | __u32 nl_groups; /* multicast groups mask */ |
@@ -49,6 +49,7 @@ struct nlmsghdr { | |||
49 | #define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ | 49 | #define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ |
50 | #define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ | 50 | #define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ |
51 | #define NLM_F_ECHO 8 /* Echo this request */ | 51 | #define NLM_F_ECHO 8 /* Echo this request */ |
52 | #define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */ | ||
52 | 53 | ||
53 | /* Modifiers to GET request */ | 54 | /* Modifiers to GET request */ |
54 | #define NLM_F_ROOT 0x100 /* specify tree root */ | 55 | #define NLM_F_ROOT 0x100 /* specify tree root */ |
@@ -221,7 +222,9 @@ struct netlink_callback { | |||
221 | int (*dump)(struct sk_buff * skb, | 222 | int (*dump)(struct sk_buff * skb, |
222 | struct netlink_callback *cb); | 223 | struct netlink_callback *cb); |
223 | int (*done)(struct netlink_callback *cb); | 224 | int (*done)(struct netlink_callback *cb); |
224 | int family; | 225 | u16 family; |
226 | u16 min_dump_alloc; | ||
227 | unsigned int prev_seq, seq; | ||
225 | long args[6]; | 228 | long args[6]; |
226 | }; | 229 | }; |
227 | 230 | ||
@@ -259,7 +262,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
259 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 262 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
260 | const struct nlmsghdr *nlh, | 263 | const struct nlmsghdr *nlh, |
261 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), | 264 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), |
262 | int (*done)(struct netlink_callback*)); | 265 | int (*done)(struct netlink_callback*), |
266 | u16 min_dump_alloc); | ||
263 | 267 | ||
264 | 268 | ||
265 | #define NL_NONROOT_RECV 0x1 | 269 | #define NL_NONROOT_RECV 0x1 |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 79358bb712c6..5dfa091c3347 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -40,8 +40,6 @@ struct netpoll_info { | |||
40 | struct netpoll *netpoll; | 40 | struct netpoll *netpoll; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | void netpoll_poll_dev(struct net_device *dev); | ||
44 | void netpoll_poll(struct netpoll *np); | ||
45 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 43 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
46 | void netpoll_print_options(struct netpoll *np); | 44 | void netpoll_print_options(struct netpoll *np); |
47 | int netpoll_parse_options(struct netpoll *np, char *opt); | 45 | int netpoll_parse_options(struct netpoll *np, char *opt); |
diff --git a/include/linux/nfc.h b/include/linux/nfc.h new file mode 100644 index 000000000000..330a4c5db588 --- /dev/null +++ b/include/linux/nfc.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Instituto Nokia de Tecnologia | ||
3 | * | ||
4 | * Authors: | ||
5 | * Lauro Ramos Venancio <lauro.venancio@openbossa.org> | ||
6 | * Aloisio Almeida Jr <aloisio.almeida@openbossa.org> | ||
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 | ||
20 | * Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_NFC_H | ||
25 | #define __LINUX_NFC_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #include <linux/socket.h> | ||
29 | |||
30 | #define NFC_GENL_NAME "nfc" | ||
31 | #define NFC_GENL_VERSION 1 | ||
32 | |||
33 | #define NFC_GENL_MCAST_EVENT_NAME "events" | ||
34 | |||
35 | /** | ||
36 | * enum nfc_commands - supported nfc commands | ||
37 | * | ||
38 | * @NFC_CMD_UNSPEC: unspecified command | ||
39 | * | ||
40 | * @NFC_CMD_GET_DEVICE: request information about a device (requires | ||
41 | * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices | ||
42 | * @NFC_CMD_START_POLL: start polling for targets using the given protocols | ||
43 | * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS) | ||
44 | * @NFC_CMD_STOP_POLL: stop polling for targets (requires | ||
45 | * %NFC_ATTR_DEVICE_INDEX) | ||
46 | * @NFC_CMD_GET_TARGET: dump all targets found by the previous poll (requires | ||
47 | * %NFC_ATTR_DEVICE_INDEX) | ||
48 | * @NFC_EVENT_TARGETS_FOUND: event emitted when a new target is found | ||
49 | * (it sends %NFC_ATTR_DEVICE_INDEX) | ||
50 | * @NFC_EVENT_DEVICE_ADDED: event emitted when a new device is registred | ||
51 | * (it sends %NFC_ATTR_DEVICE_NAME, %NFC_ATTR_DEVICE_INDEX and | ||
52 | * %NFC_ATTR_PROTOCOLS) | ||
53 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed | ||
54 | * (it sends %NFC_ATTR_DEVICE_INDEX) | ||
55 | */ | ||
56 | enum nfc_commands { | ||
57 | NFC_CMD_UNSPEC, | ||
58 | NFC_CMD_GET_DEVICE, | ||
59 | NFC_CMD_START_POLL, | ||
60 | NFC_CMD_STOP_POLL, | ||
61 | NFC_CMD_GET_TARGET, | ||
62 | NFC_EVENT_TARGETS_FOUND, | ||
63 | NFC_EVENT_DEVICE_ADDED, | ||
64 | NFC_EVENT_DEVICE_REMOVED, | ||
65 | /* private: internal use only */ | ||
66 | __NFC_CMD_AFTER_LAST | ||
67 | }; | ||
68 | #define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1) | ||
69 | |||
70 | /** | ||
71 | * enum nfc_attrs - supported nfc attributes | ||
72 | * | ||
73 | * @NFC_ATTR_UNSPEC: unspecified attribute | ||
74 | * | ||
75 | * @NFC_ATTR_DEVICE_INDEX: index of nfc device | ||
76 | * @NFC_ATTR_DEVICE_NAME: device name, max 8 chars | ||
77 | * @NFC_ATTR_PROTOCOLS: nfc protocols - bitwise or-ed combination from | ||
78 | * NFC_PROTO_*_MASK constants | ||
79 | * @NFC_ATTR_TARGET_INDEX: index of the nfc target | ||
80 | * @NFC_ATTR_TARGET_SENS_RES: NFC-A targets extra information such as NFCID | ||
81 | * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the | ||
82 | * target is not NFC-Forum compliant) | ||
83 | */ | ||
84 | enum nfc_attrs { | ||
85 | NFC_ATTR_UNSPEC, | ||
86 | NFC_ATTR_DEVICE_INDEX, | ||
87 | NFC_ATTR_DEVICE_NAME, | ||
88 | NFC_ATTR_PROTOCOLS, | ||
89 | NFC_ATTR_TARGET_INDEX, | ||
90 | NFC_ATTR_TARGET_SENS_RES, | ||
91 | NFC_ATTR_TARGET_SEL_RES, | ||
92 | /* private: internal use only */ | ||
93 | __NFC_ATTR_AFTER_LAST | ||
94 | }; | ||
95 | #define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1) | ||
96 | |||
97 | #define NFC_DEVICE_NAME_MAXSIZE 8 | ||
98 | |||
99 | /* NFC protocols */ | ||
100 | #define NFC_PROTO_JEWEL 1 | ||
101 | #define NFC_PROTO_MIFARE 2 | ||
102 | #define NFC_PROTO_FELICA 3 | ||
103 | #define NFC_PROTO_ISO14443 4 | ||
104 | #define NFC_PROTO_NFC_DEP 5 | ||
105 | |||
106 | #define NFC_PROTO_MAX 6 | ||
107 | |||
108 | /* NFC protocols masks used in bitsets */ | ||
109 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) | ||
110 | #define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE) | ||
111 | #define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA) | ||
112 | #define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443) | ||
113 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) | ||
114 | |||
115 | struct sockaddr_nfc { | ||
116 | sa_family_t sa_family; | ||
117 | __u32 dev_idx; | ||
118 | __u32 target_idx; | ||
119 | __u32 nfc_protocol; | ||
120 | }; | ||
121 | |||
122 | /* NFC socket protocols */ | ||
123 | #define NFC_SOCKPROTO_RAW 0 | ||
124 | #define NFC_SOCKPROTO_MAX 1 | ||
125 | |||
126 | #endif /*__LINUX_NFC_H */ | ||
diff --git a/include/linux/nfs.h b/include/linux/nfs.h index f387919bbc59..8c6ee44914cb 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #define NFS_MNT_VERSION 1 | 29 | #define NFS_MNT_VERSION 1 |
30 | #define NFS_MNT3_VERSION 3 | 30 | #define NFS_MNT3_VERSION 3 |
31 | 31 | ||
32 | #define NFS_PIPE_DIRNAME "/nfs" | ||
33 | |||
32 | /* | 34 | /* |
33 | * NFS stats. The good thing with these values is that NFSv3 errors are | 35 | * NFS stats. The good thing with these values is that NFSv3 errors are |
34 | * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which | 36 | * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 504b289ba680..76f99e8714f3 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -563,6 +563,10 @@ enum { | |||
563 | NFSPROC4_CLNT_GETDEVICEINFO, | 563 | NFSPROC4_CLNT_GETDEVICEINFO, |
564 | NFSPROC4_CLNT_LAYOUTCOMMIT, | 564 | NFSPROC4_CLNT_LAYOUTCOMMIT, |
565 | NFSPROC4_CLNT_LAYOUTRETURN, | 565 | NFSPROC4_CLNT_LAYOUTRETURN, |
566 | NFSPROC4_CLNT_SECINFO_NO_NAME, | ||
567 | NFSPROC4_CLNT_TEST_STATEID, | ||
568 | NFSPROC4_CLNT_FREE_STATEID, | ||
569 | NFSPROC4_CLNT_GETDEVICELIST, | ||
566 | }; | 570 | }; |
567 | 571 | ||
568 | /* nfs41 types */ | 572 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1b93b9c60e55..eaac770f886e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -85,7 +85,7 @@ struct nfs_lock_context { | |||
85 | struct nfs4_state; | 85 | struct nfs4_state; |
86 | struct nfs_open_context { | 86 | struct nfs_open_context { |
87 | struct nfs_lock_context lock_context; | 87 | struct nfs_lock_context lock_context; |
88 | struct path path; | 88 | struct dentry *dentry; |
89 | struct rpc_cred *cred; | 89 | struct rpc_cred *cred; |
90 | struct nfs4_state *state; | 90 | struct nfs4_state *state; |
91 | fmode_t mode; | 91 | fmode_t mode; |
@@ -99,9 +99,10 @@ struct nfs_open_context { | |||
99 | 99 | ||
100 | struct nfs_open_dir_context { | 100 | struct nfs_open_dir_context { |
101 | struct rpc_cred *cred; | 101 | struct rpc_cred *cred; |
102 | unsigned long attr_gencount; | ||
102 | __u64 dir_cookie; | 103 | __u64 dir_cookie; |
103 | __u64 dup_cookie; | 104 | __u64 dup_cookie; |
104 | int duped; | 105 | signed char duped; |
105 | }; | 106 | }; |
106 | 107 | ||
107 | /* | 108 | /* |
@@ -360,7 +361,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | |||
360 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | 361 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); |
361 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); | 362 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); |
362 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 363 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
363 | extern int nfs_permission(struct inode *, int, unsigned int); | 364 | extern int nfs_permission(struct inode *, int); |
364 | extern int nfs_open(struct inode *, struct file *); | 365 | extern int nfs_open(struct inode *, struct file *); |
365 | extern int nfs_release(struct inode *, struct file *); | 366 | extern int nfs_release(struct inode *, struct file *); |
366 | extern int nfs_attribute_timeout(struct inode *inode); | 367 | extern int nfs_attribute_timeout(struct inode *inode); |
@@ -372,7 +373,7 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | |||
372 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 373 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
373 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 374 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
374 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); | 375 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); |
375 | extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); | 376 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode); |
376 | extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); | 377 | extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); |
377 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); | 378 | extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); |
378 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); | 379 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); |
@@ -568,12 +569,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); | |||
568 | extern int nfs3_proc_setacl(struct inode *inode, int type, | 569 | extern int nfs3_proc_setacl(struct inode *inode, int type, |
569 | struct posix_acl *acl); | 570 | struct posix_acl *acl); |
570 | extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | 571 | extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, |
571 | mode_t mode); | 572 | umode_t mode); |
572 | extern void nfs3_forget_cached_acls(struct inode *inode); | 573 | extern void nfs3_forget_cached_acls(struct inode *inode); |
573 | #else | 574 | #else |
574 | static inline int nfs3_proc_set_default_acl(struct inode *dir, | 575 | static inline int nfs3_proc_set_default_acl(struct inode *dir, |
575 | struct inode *inode, | 576 | struct inode *inode, |
576 | mode_t mode) | 577 | umode_t mode) |
577 | { | 578 | { |
578 | return 0; | 579 | return 0; |
579 | } | 580 | } |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 87694ca86914..b5479df8378d 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/nfs_xdr.h> | 7 | #include <linux/nfs_xdr.h> |
8 | #include <linux/sunrpc/xprt.h> | 8 | #include <linux/sunrpc/xprt.h> |
9 | 9 | ||
10 | #include <asm/atomic.h> | 10 | #include <linux/atomic.h> |
11 | 11 | ||
12 | struct nfs4_session; | 12 | struct nfs4_session; |
13 | struct nfs_iostats; | 13 | struct nfs_iostats; |
@@ -16,6 +16,7 @@ struct nfs4_sequence_args; | |||
16 | struct nfs4_sequence_res; | 16 | struct nfs4_sequence_res; |
17 | struct nfs_server; | 17 | struct nfs_server; |
18 | struct nfs4_minor_version_ops; | 18 | struct nfs4_minor_version_ops; |
19 | struct server_scope; | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * The nfs_client identifies our client state to the server. | 22 | * The nfs_client identifies our client state to the server. |
@@ -77,12 +78,13 @@ struct nfs_client { | |||
77 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | 78 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ |
78 | u32 cl_exchange_flags; | 79 | u32 cl_exchange_flags; |
79 | struct nfs4_session *cl_session; /* sharred session */ | 80 | struct nfs4_session *cl_session; /* sharred session */ |
80 | struct list_head cl_layouts; | ||
81 | #endif /* CONFIG_NFS_V4 */ | 81 | #endif /* CONFIG_NFS_V4 */ |
82 | 82 | ||
83 | #ifdef CONFIG_NFS_FSCACHE | 83 | #ifdef CONFIG_NFS_FSCACHE |
84 | struct fscache_cookie *fscache; /* client index cache cookie */ | 84 | struct fscache_cookie *fscache; /* client index cache cookie */ |
85 | #endif | 85 | #endif |
86 | |||
87 | struct server_scope *server_scope; /* from exchange_id */ | ||
86 | }; | 88 | }; |
87 | 89 | ||
88 | /* | 90 | /* |
@@ -129,8 +131,9 @@ struct nfs_server { | |||
129 | struct fscache_cookie *fscache; /* superblock cookie */ | 131 | struct fscache_cookie *fscache; /* superblock cookie */ |
130 | #endif | 132 | #endif |
131 | 133 | ||
134 | u32 pnfs_blksize; /* layout_blksize attr */ | ||
132 | #ifdef CONFIG_NFS_V4 | 135 | #ifdef CONFIG_NFS_V4 |
133 | u32 attr_bitmask[2];/* V4 bitmask representing the set | 136 | u32 attr_bitmask[3];/* V4 bitmask representing the set |
134 | of attributes supported on this | 137 | of attributes supported on this |
135 | filesystem */ | 138 | filesystem */ |
136 | u32 cache_consistency_bitmask[2]; | 139 | u32 cache_consistency_bitmask[2]; |
@@ -143,12 +146,14 @@ struct nfs_server { | |||
143 | filesystem */ | 146 | filesystem */ |
144 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ | 147 | struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ |
145 | struct rpc_wait_queue roc_rpcwaitq; | 148 | struct rpc_wait_queue roc_rpcwaitq; |
149 | void *pnfs_ld_data; /* per mount point data */ | ||
146 | 150 | ||
147 | /* the following fields are protected by nfs_client->cl_lock */ | 151 | /* the following fields are protected by nfs_client->cl_lock */ |
148 | struct rb_root state_owners; | 152 | struct rb_root state_owners; |
149 | struct rb_root openowner_id; | 153 | struct rb_root openowner_id; |
150 | struct rb_root lockowner_id; | 154 | struct rb_root lockowner_id; |
151 | #endif | 155 | #endif |
156 | struct list_head layouts; | ||
152 | struct list_head delegations; | 157 | struct list_head delegations; |
153 | void (*destroy)(struct nfs_server *); | 158 | void (*destroy)(struct nfs_server *); |
154 | 159 | ||
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 25311b3bedf8..e2791a27a901 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -55,20 +55,28 @@ struct nfs_page { | |||
55 | struct nfs_writeverf wb_verf; /* Commit cookie */ | 55 | struct nfs_writeverf wb_verf; /* Commit cookie */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct nfs_pageio_descriptor; | ||
59 | struct nfs_pageio_ops { | ||
60 | void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *); | ||
61 | bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); | ||
62 | int (*pg_doio)(struct nfs_pageio_descriptor *); | ||
63 | }; | ||
64 | |||
58 | struct nfs_pageio_descriptor { | 65 | struct nfs_pageio_descriptor { |
59 | struct list_head pg_list; | 66 | struct list_head pg_list; |
60 | unsigned long pg_bytes_written; | 67 | unsigned long pg_bytes_written; |
61 | size_t pg_count; | 68 | size_t pg_count; |
62 | size_t pg_bsize; | 69 | size_t pg_bsize; |
63 | unsigned int pg_base; | 70 | unsigned int pg_base; |
64 | char pg_moreio; | 71 | unsigned char pg_moreio : 1, |
72 | pg_recoalesce : 1; | ||
65 | 73 | ||
66 | struct inode *pg_inode; | 74 | struct inode *pg_inode; |
67 | int (*pg_doio)(struct nfs_pageio_descriptor *); | 75 | const struct nfs_pageio_ops *pg_ops; |
68 | int pg_ioflags; | 76 | int pg_ioflags; |
69 | int pg_error; | 77 | int pg_error; |
78 | const struct rpc_call_ops *pg_rpc_callops; | ||
70 | struct pnfs_layout_segment *pg_lseg; | 79 | struct pnfs_layout_segment *pg_lseg; |
71 | bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); | ||
72 | }; | 80 | }; |
73 | 81 | ||
74 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 82 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
@@ -85,7 +93,7 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst, | |||
85 | pgoff_t idx_start, unsigned int npages, int tag); | 93 | pgoff_t idx_start, unsigned int npages, int tag); |
86 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | 94 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, |
87 | struct inode *inode, | 95 | struct inode *inode, |
88 | int (*doio)(struct nfs_pageio_descriptor *desc), | 96 | const struct nfs_pageio_ops *pg_ops, |
89 | size_t bsize, | 97 | size_t bsize, |
90 | int how); | 98 | int how); |
91 | extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, | 99 | extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, |
@@ -100,7 +108,6 @@ extern void nfs_unlock_request(struct nfs_page *req); | |||
100 | extern int nfs_set_page_tag_locked(struct nfs_page *req); | 108 | extern int nfs_set_page_tag_locked(struct nfs_page *req); |
101 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); | 109 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); |
102 | 110 | ||
103 | |||
104 | /* | 111 | /* |
105 | * Lock the page of an asynchronous request without getting a new reference | 112 | * Lock the page of an asynchronous request without getting a new reference |
106 | */ | 113 | */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 00848d86ffb2..abd615d74a29 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -122,6 +122,7 @@ struct nfs_fsinfo { | |||
122 | struct timespec time_delta; /* server time granularity */ | 122 | struct timespec time_delta; /* server time granularity */ |
123 | __u32 lease_time; /* in seconds */ | 123 | __u32 lease_time; /* in seconds */ |
124 | __u32 layouttype; /* supported pnfs layout driver */ | 124 | __u32 layouttype; /* supported pnfs layout driver */ |
125 | __u32 blksize; /* preferred pnfs io block size */ | ||
125 | }; | 126 | }; |
126 | 127 | ||
127 | struct nfs_fsstat { | 128 | struct nfs_fsstat { |
@@ -235,6 +236,17 @@ struct nfs4_layoutget { | |||
235 | gfp_t gfp_flags; | 236 | gfp_t gfp_flags; |
236 | }; | 237 | }; |
237 | 238 | ||
239 | struct nfs4_getdevicelist_args { | ||
240 | const struct nfs_fh *fh; | ||
241 | u32 layoutclass; | ||
242 | struct nfs4_sequence_args seq_args; | ||
243 | }; | ||
244 | |||
245 | struct nfs4_getdevicelist_res { | ||
246 | struct pnfs_devicelist *devlist; | ||
247 | struct nfs4_sequence_res seq_res; | ||
248 | }; | ||
249 | |||
238 | struct nfs4_getdeviceinfo_args { | 250 | struct nfs4_getdeviceinfo_args { |
239 | struct pnfs_device *pdev; | 251 | struct pnfs_device *pdev; |
240 | struct nfs4_sequence_args seq_args; | 252 | struct nfs4_sequence_args seq_args; |
@@ -257,21 +269,23 @@ struct nfs4_layoutcommit_res { | |||
257 | struct nfs_fattr *fattr; | 269 | struct nfs_fattr *fattr; |
258 | const struct nfs_server *server; | 270 | const struct nfs_server *server; |
259 | struct nfs4_sequence_res seq_res; | 271 | struct nfs4_sequence_res seq_res; |
272 | int status; | ||
260 | }; | 273 | }; |
261 | 274 | ||
262 | struct nfs4_layoutcommit_data { | 275 | struct nfs4_layoutcommit_data { |
263 | struct rpc_task task; | 276 | struct rpc_task task; |
264 | struct nfs_fattr fattr; | 277 | struct nfs_fattr fattr; |
265 | struct pnfs_layout_segment *lseg; | 278 | struct list_head lseg_list; |
266 | struct rpc_cred *cred; | 279 | struct rpc_cred *cred; |
267 | struct nfs4_layoutcommit_args args; | 280 | struct nfs4_layoutcommit_args args; |
268 | struct nfs4_layoutcommit_res res; | 281 | struct nfs4_layoutcommit_res res; |
269 | }; | 282 | }; |
270 | 283 | ||
271 | struct nfs4_layoutreturn_args { | 284 | struct nfs4_layoutreturn_args { |
272 | __u32 layout_type; | 285 | struct pnfs_layout_hdr *layout; |
273 | struct inode *inode; | 286 | struct inode *inode; |
274 | nfs4_stateid stateid; | 287 | nfs4_stateid stateid; |
288 | __u32 layout_type; | ||
275 | struct nfs4_sequence_args seq_args; | 289 | struct nfs4_sequence_args seq_args; |
276 | }; | 290 | }; |
277 | 291 | ||
@@ -759,6 +773,11 @@ struct nfs3_getaclres { | |||
759 | struct posix_acl * acl_default; | 773 | struct posix_acl * acl_default; |
760 | }; | 774 | }; |
761 | 775 | ||
776 | struct nfs4_string { | ||
777 | unsigned int len; | ||
778 | char *data; | ||
779 | }; | ||
780 | |||
762 | #ifdef CONFIG_NFS_V4 | 781 | #ifdef CONFIG_NFS_V4 |
763 | 782 | ||
764 | typedef u64 clientid4; | 783 | typedef u64 clientid4; |
@@ -942,18 +961,13 @@ struct nfs4_server_caps_arg { | |||
942 | }; | 961 | }; |
943 | 962 | ||
944 | struct nfs4_server_caps_res { | 963 | struct nfs4_server_caps_res { |
945 | u32 attr_bitmask[2]; | 964 | u32 attr_bitmask[3]; |
946 | u32 acl_bitmask; | 965 | u32 acl_bitmask; |
947 | u32 has_links; | 966 | u32 has_links; |
948 | u32 has_symlinks; | 967 | u32 has_symlinks; |
949 | struct nfs4_sequence_res seq_res; | 968 | struct nfs4_sequence_res seq_res; |
950 | }; | 969 | }; |
951 | 970 | ||
952 | struct nfs4_string { | ||
953 | unsigned int len; | ||
954 | char *data; | ||
955 | }; | ||
956 | |||
957 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 | 971 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 |
958 | struct nfs4_pathname { | 972 | struct nfs4_pathname { |
959 | unsigned int ncomponents; | 973 | unsigned int ncomponents; |
@@ -1060,6 +1074,7 @@ struct server_scope { | |||
1060 | struct nfs41_exchange_id_res { | 1074 | struct nfs41_exchange_id_res { |
1061 | struct nfs_client *client; | 1075 | struct nfs_client *client; |
1062 | u32 flags; | 1076 | u32 flags; |
1077 | struct server_scope *server_scope; | ||
1063 | }; | 1078 | }; |
1064 | 1079 | ||
1065 | struct nfs41_create_session_args { | 1080 | struct nfs41_create_session_args { |
@@ -1083,6 +1098,34 @@ struct nfs41_reclaim_complete_args { | |||
1083 | struct nfs41_reclaim_complete_res { | 1098 | struct nfs41_reclaim_complete_res { |
1084 | struct nfs4_sequence_res seq_res; | 1099 | struct nfs4_sequence_res seq_res; |
1085 | }; | 1100 | }; |
1101 | |||
1102 | #define SECINFO_STYLE_CURRENT_FH 0 | ||
1103 | #define SECINFO_STYLE_PARENT 1 | ||
1104 | struct nfs41_secinfo_no_name_args { | ||
1105 | int style; | ||
1106 | struct nfs4_sequence_args seq_args; | ||
1107 | }; | ||
1108 | |||
1109 | struct nfs41_test_stateid_args { | ||
1110 | nfs4_stateid *stateid; | ||
1111 | struct nfs4_sequence_args seq_args; | ||
1112 | }; | ||
1113 | |||
1114 | struct nfs41_test_stateid_res { | ||
1115 | unsigned int status; | ||
1116 | struct nfs4_sequence_res seq_res; | ||
1117 | }; | ||
1118 | |||
1119 | struct nfs41_free_stateid_args { | ||
1120 | nfs4_stateid *stateid; | ||
1121 | struct nfs4_sequence_args seq_args; | ||
1122 | }; | ||
1123 | |||
1124 | struct nfs41_free_stateid_res { | ||
1125 | unsigned int status; | ||
1126 | struct nfs4_sequence_res seq_res; | ||
1127 | }; | ||
1128 | |||
1086 | #endif /* CONFIG_NFS_V4_1 */ | 1129 | #endif /* CONFIG_NFS_V4_1 */ |
1087 | 1130 | ||
1088 | struct nfs_page; | 1131 | struct nfs_page; |
@@ -1096,6 +1139,7 @@ struct nfs_read_data { | |||
1096 | struct rpc_cred *cred; | 1139 | struct rpc_cred *cred; |
1097 | struct nfs_fattr fattr; /* fattr storage */ | 1140 | struct nfs_fattr fattr; /* fattr storage */ |
1098 | struct list_head pages; /* Coalesced read requests */ | 1141 | struct list_head pages; /* Coalesced read requests */ |
1142 | struct list_head list; /* lists of struct nfs_read_data */ | ||
1099 | struct nfs_page *req; /* multi ops per nfs_page */ | 1143 | struct nfs_page *req; /* multi ops per nfs_page */ |
1100 | struct page **pagevec; | 1144 | struct page **pagevec; |
1101 | unsigned int npages; /* Max length of pagevec */ | 1145 | unsigned int npages; /* Max length of pagevec */ |
@@ -1119,6 +1163,7 @@ struct nfs_write_data { | |||
1119 | struct nfs_fattr fattr; | 1163 | struct nfs_fattr fattr; |
1120 | struct nfs_writeverf verf; | 1164 | struct nfs_writeverf verf; |
1121 | struct list_head pages; /* Coalesced requests we wish to flush */ | 1165 | struct list_head pages; /* Coalesced requests we wish to flush */ |
1166 | struct list_head list; /* lists of struct nfs_write_data */ | ||
1122 | struct nfs_page *req; /* multi ops per nfs_page */ | 1167 | struct nfs_page *req; /* multi ops per nfs_page */ |
1123 | struct page **pagevec; | 1168 | struct page **pagevec; |
1124 | unsigned int npages; /* Max length of pagevec */ | 1169 | unsigned int npages; /* Max length of pagevec */ |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 84058ec69390..8a31a20efe7e 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -133,8 +133,6 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp); | |||
133 | int nfsd_export_init(void); | 133 | int nfsd_export_init(void); |
134 | void nfsd_export_shutdown(void); | 134 | void nfsd_export_shutdown(void); |
135 | void nfsd_export_flush(void); | 135 | void nfsd_export_flush(void); |
136 | void exp_readlock(void); | ||
137 | void exp_readunlock(void); | ||
138 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, | 136 | struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, |
139 | struct path *); | 137 | struct path *); |
140 | struct svc_export * rqst_exp_parent(struct svc_rqst *, | 138 | struct svc_export * rqst_exp_parent(struct svc_rqst *, |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index c7ccaae15af6..8ad70dcac3f9 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> | 7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> |
8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> | 8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> |
9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> | 9 | * Copyright 2008 Michael Buesch <m@bues.ch> |
10 | * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> | 10 | * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> |
11 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> | 11 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> |
12 | * Copyright 2008 Colin McCabe <colin@cozybit.com> | 12 | * Copyright 2008 Colin McCabe <colin@cozybit.com> |
@@ -247,7 +247,8 @@ | |||
247 | * passed, all channels allowed for the current regulatory domain | 247 | * passed, all channels allowed for the current regulatory domain |
248 | * are used. Extra IEs can also be passed from the userspace by | 248 | * are used. Extra IEs can also be passed from the userspace by |
249 | * using the %NL80211_ATTR_IE attribute. | 249 | * using the %NL80211_ATTR_IE attribute. |
250 | * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan | 250 | * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT |
251 | * if scheduled scan is not running. | ||
251 | * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan | 252 | * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan |
252 | * results available. | 253 | * results available. |
253 | * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has | 254 | * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has |
@@ -483,6 +484,14 @@ | |||
483 | * more background information, see | 484 | * more background information, see |
484 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. | 485 | * http://wireless.kernel.org/en/users/Documentation/WoWLAN. |
485 | * | 486 | * |
487 | * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver | ||
488 | * the necessary information for supporting GTK rekey offload. This | ||
489 | * feature is typically used during WoWLAN. The configuration data | ||
490 | * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and | ||
491 | * contains the data in sub-attributes). After rekeying happened, | ||
492 | * this command may also be sent by the driver as an MLME event to | ||
493 | * inform userspace of the new replay counter. | ||
494 | * | ||
486 | * @NL80211_CMD_MAX: highest used command number | 495 | * @NL80211_CMD_MAX: highest used command number |
487 | * @__NL80211_CMD_AFTER_LAST: internal use | 496 | * @__NL80211_CMD_AFTER_LAST: internal use |
488 | */ | 497 | */ |
@@ -605,6 +614,8 @@ enum nl80211_commands { | |||
605 | NL80211_CMD_SCHED_SCAN_RESULTS, | 614 | NL80211_CMD_SCHED_SCAN_RESULTS, |
606 | NL80211_CMD_SCHED_SCAN_STOPPED, | 615 | NL80211_CMD_SCHED_SCAN_STOPPED, |
607 | 616 | ||
617 | NL80211_CMD_SET_REKEY_OFFLOAD, | ||
618 | |||
608 | /* add new commands above here */ | 619 | /* add new commands above here */ |
609 | 620 | ||
610 | /* used to define NL80211_CMD_MAX below */ | 621 | /* used to define NL80211_CMD_MAX below */ |
@@ -745,8 +756,12 @@ enum nl80211_commands { | |||
745 | * | 756 | * |
746 | * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with | 757 | * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with |
747 | * a single scan request, a wiphy attribute. | 758 | * a single scan request, a wiphy attribute. |
759 | * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can | ||
760 | * scan with a single scheduled scan request, a wiphy attribute. | ||
748 | * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements | 761 | * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements |
749 | * that can be added to a scan request | 762 | * that can be added to a scan request |
763 | * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information | ||
764 | * elements that can be added to a scheduled scan request | ||
750 | * | 765 | * |
751 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 766 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
752 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 767 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
@@ -978,8 +993,8 @@ enum nl80211_commands { | |||
978 | * driving the peer link management state machine. | 993 | * driving the peer link management state machine. |
979 | * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. | 994 | * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. |
980 | * | 995 | * |
981 | * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities, | 996 | * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy |
982 | * the supported WoWLAN triggers | 997 | * capabilities, the supported WoWLAN triggers |
983 | * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to | 998 | * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to |
984 | * indicate which WoW triggers should be enabled. This is also | 999 | * indicate which WoW triggers should be enabled. This is also |
985 | * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN | 1000 | * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN |
@@ -996,6 +1011,14 @@ enum nl80211_commands { | |||
996 | * are managed in software: interfaces of these types aren't subject to | 1011 | * are managed in software: interfaces of these types aren't subject to |
997 | * any restrictions in their number or combinations. | 1012 | * any restrictions in their number or combinations. |
998 | * | 1013 | * |
1014 | * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information | ||
1015 | * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. | ||
1016 | * | ||
1017 | * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, | ||
1018 | * nested array attribute containing an entry for each band, with the entry | ||
1019 | * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but | ||
1020 | * without the length restriction (at most %NL80211_MAX_SUPP_RATES). | ||
1021 | * | ||
999 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1022 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1000 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1023 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1001 | */ | 1024 | */ |
@@ -1194,6 +1217,13 @@ enum nl80211_attrs { | |||
1194 | NL80211_ATTR_INTERFACE_COMBINATIONS, | 1217 | NL80211_ATTR_INTERFACE_COMBINATIONS, |
1195 | NL80211_ATTR_SOFTWARE_IFTYPES, | 1218 | NL80211_ATTR_SOFTWARE_IFTYPES, |
1196 | 1219 | ||
1220 | NL80211_ATTR_REKEY_DATA, | ||
1221 | |||
1222 | NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, | ||
1223 | NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, | ||
1224 | |||
1225 | NL80211_ATTR_SCAN_SUPP_RATES, | ||
1226 | |||
1197 | /* add attributes here, update the policy in nl80211.c */ | 1227 | /* add attributes here, update the policy in nl80211.c */ |
1198 | 1228 | ||
1199 | __NL80211_ATTR_AFTER_LAST, | 1229 | __NL80211_ATTR_AFTER_LAST, |
@@ -2239,6 +2269,16 @@ struct nl80211_wowlan_pattern_support { | |||
2239 | * | 2269 | * |
2240 | * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute | 2270 | * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute |
2241 | * carrying a &struct nl80211_wowlan_pattern_support. | 2271 | * carrying a &struct nl80211_wowlan_pattern_support. |
2272 | * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be | ||
2273 | * used when setting, used only to indicate that GTK rekeying is supported | ||
2274 | * by the device (flag) | ||
2275 | * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if | ||
2276 | * done by the device) (flag) | ||
2277 | * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request | ||
2278 | * packet (flag) | ||
2279 | * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) | ||
2280 | * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released | ||
2281 | * (on devices that have rfkill in the device) (flag) | ||
2242 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers | 2282 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers |
2243 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number | 2283 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number |
2244 | */ | 2284 | */ |
@@ -2248,6 +2288,11 @@ enum nl80211_wowlan_triggers { | |||
2248 | NL80211_WOWLAN_TRIG_DISCONNECT, | 2288 | NL80211_WOWLAN_TRIG_DISCONNECT, |
2249 | NL80211_WOWLAN_TRIG_MAGIC_PKT, | 2289 | NL80211_WOWLAN_TRIG_MAGIC_PKT, |
2250 | NL80211_WOWLAN_TRIG_PKT_PATTERN, | 2290 | NL80211_WOWLAN_TRIG_PKT_PATTERN, |
2291 | NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED, | ||
2292 | NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE, | ||
2293 | NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, | ||
2294 | NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, | ||
2295 | NL80211_WOWLAN_TRIG_RFKILL_RELEASE, | ||
2251 | 2296 | ||
2252 | /* keep last */ | 2297 | /* keep last */ |
2253 | NUM_NL80211_WOWLAN_TRIG, | 2298 | NUM_NL80211_WOWLAN_TRIG, |
@@ -2361,4 +2406,28 @@ enum nl80211_plink_state { | |||
2361 | MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 | 2406 | MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 |
2362 | }; | 2407 | }; |
2363 | 2408 | ||
2409 | #define NL80211_KCK_LEN 16 | ||
2410 | #define NL80211_KEK_LEN 16 | ||
2411 | #define NL80211_REPLAY_CTR_LEN 8 | ||
2412 | |||
2413 | /** | ||
2414 | * enum nl80211_rekey_data - attributes for GTK rekey offload | ||
2415 | * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes | ||
2416 | * @NL80211_REKEY_DATA_KEK: key encryption key (binary) | ||
2417 | * @NL80211_REKEY_DATA_KCK: key confirmation key (binary) | ||
2418 | * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary) | ||
2419 | * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal) | ||
2420 | * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal) | ||
2421 | */ | ||
2422 | enum nl80211_rekey_data { | ||
2423 | __NL80211_REKEY_DATA_INVALID, | ||
2424 | NL80211_REKEY_DATA_KEK, | ||
2425 | NL80211_REKEY_DATA_KCK, | ||
2426 | NL80211_REKEY_DATA_REPLAY_CTR, | ||
2427 | |||
2428 | /* keep last */ | ||
2429 | NUM_NL80211_REKEY_DATA, | ||
2430 | MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 | ||
2431 | }; | ||
2432 | |||
2364 | #endif /* __LINUX_NL80211_H */ | 2433 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index dba35e413371..7afc36334d52 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -66,6 +66,8 @@ | |||
66 | * int num_online_nodes() Number of online Nodes | 66 | * int num_online_nodes() Number of online Nodes |
67 | * int num_possible_nodes() Number of all possible Nodes | 67 | * int num_possible_nodes() Number of all possible Nodes |
68 | * | 68 | * |
69 | * int node_random(mask) Random node with set bit in mask | ||
70 | * | ||
69 | * int node_online(node) Is some node online? | 71 | * int node_online(node) Is some node online? |
70 | * int node_possible(node) Is some node possible? | 72 | * int node_possible(node) Is some node possible? |
71 | * | 73 | * |
@@ -430,6 +432,7 @@ static inline void node_set_offline(int nid) | |||
430 | node_clear_state(nid, N_ONLINE); | 432 | node_clear_state(nid, N_ONLINE); |
431 | nr_online_nodes = num_node_state(N_ONLINE); | 433 | nr_online_nodes = num_node_state(N_ONLINE); |
432 | } | 434 | } |
435 | |||
433 | #else | 436 | #else |
434 | 437 | ||
435 | static inline int node_state(int node, enum node_states state) | 438 | static inline int node_state(int node, enum node_states state) |
@@ -460,6 +463,16 @@ static inline int num_node_state(enum node_states state) | |||
460 | 463 | ||
461 | #define node_set_online(node) node_set_state((node), N_ONLINE) | 464 | #define node_set_online(node) node_set_state((node), N_ONLINE) |
462 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | 465 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) |
466 | |||
467 | #endif | ||
468 | |||
469 | #if defined(CONFIG_NUMA) && (MAX_NUMNODES > 1) | ||
470 | extern int node_random(const nodemask_t *maskp); | ||
471 | #else | ||
472 | static inline int node_random(const nodemask_t *mask) | ||
473 | { | ||
474 | return 0; | ||
475 | } | ||
463 | #endif | 476 | #endif |
464 | 477 | ||
465 | #define node_online_map node_states[N_ONLINE] | 478 | #define node_online_map node_states[N_ONLINE] |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index c0688b0168b3..d65746efc954 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -185,80 +185,17 @@ static inline int notifier_to_errno(int ret) | |||
185 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... | 185 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... |
186 | */ | 186 | */ |
187 | 187 | ||
188 | /* netdevice notifier chain. Please remember to update the rtnetlink | 188 | /* CPU notfiers are defined in include/linux/cpu.h. */ |
189 | * notification exclusion list in rtnetlink_event() when adding new | ||
190 | * types. | ||
191 | */ | ||
192 | #define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ | ||
193 | #define NETDEV_DOWN 0x0002 | ||
194 | #define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface | ||
195 | detected a hardware crash and restarted | ||
196 | - we can use this eg to kick tcp sessions | ||
197 | once done */ | ||
198 | #define NETDEV_CHANGE 0x0004 /* Notify device state change */ | ||
199 | #define NETDEV_REGISTER 0x0005 | ||
200 | #define NETDEV_UNREGISTER 0x0006 | ||
201 | #define NETDEV_CHANGEMTU 0x0007 | ||
202 | #define NETDEV_CHANGEADDR 0x0008 | ||
203 | #define NETDEV_GOING_DOWN 0x0009 | ||
204 | #define NETDEV_CHANGENAME 0x000A | ||
205 | #define NETDEV_FEAT_CHANGE 0x000B | ||
206 | #define NETDEV_BONDING_FAILOVER 0x000C | ||
207 | #define NETDEV_PRE_UP 0x000D | ||
208 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | ||
209 | #define NETDEV_POST_TYPE_CHANGE 0x000F | ||
210 | #define NETDEV_POST_INIT 0x0010 | ||
211 | #define NETDEV_UNREGISTER_BATCH 0x0011 | ||
212 | #define NETDEV_RELEASE 0x0012 | ||
213 | #define NETDEV_NOTIFY_PEERS 0x0013 | ||
214 | #define NETDEV_JOIN 0x0014 | ||
215 | |||
216 | #define SYS_DOWN 0x0001 /* Notify of system down */ | ||
217 | #define SYS_RESTART SYS_DOWN | ||
218 | #define SYS_HALT 0x0002 /* Notify of system halt */ | ||
219 | #define SYS_POWER_OFF 0x0003 /* Notify of system power off */ | ||
220 | 189 | ||
221 | #define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ | 190 | /* netdevice notifiers are defined in include/linux/netdevice.h */ |
222 | 191 | ||
223 | #define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ | 192 | /* reboot notifiers are defined in include/linux/reboot.h. */ |
224 | #define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */ | ||
225 | #define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */ | ||
226 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ | ||
227 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | ||
228 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | ||
229 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | ||
230 | * not handling interrupts, soon dead. | ||
231 | * Called on the dying cpu, interrupts | ||
232 | * are already disabled. Must not | ||
233 | * sleep, must not fail */ | ||
234 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | ||
235 | * lock is dropped */ | ||
236 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
237 | * Called on the new cpu, just before | ||
238 | * enabling interrupts. Must not sleep, | ||
239 | * must not fail */ | ||
240 | 193 | ||
241 | /* Used for CPU hotplug events occurring while tasks are frozen due to a suspend | 194 | /* Hibernation and suspend events are defined in include/linux/suspend.h. */ |
242 | * operation in progress | ||
243 | */ | ||
244 | #define CPU_TASKS_FROZEN 0x0010 | ||
245 | 195 | ||
246 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | 196 | /* Virtual Terminal events are defined in include/linux/vt.h. */ |
247 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | ||
248 | #define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN) | ||
249 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | ||
250 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | ||
251 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | ||
252 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | ||
253 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
254 | 197 | ||
255 | /* Hibernation and suspend events */ | 198 | #define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ |
256 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | ||
257 | #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ | ||
258 | #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */ | ||
259 | #define PM_POST_SUSPEND 0x0004 /* Suspend finished */ | ||
260 | #define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */ | ||
261 | #define PM_POST_RESTORE 0x0006 /* Restore failed */ | ||
262 | 199 | ||
263 | /* Console keyboard events. | 200 | /* Console keyboard events. |
264 | * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and | 201 | * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and |
@@ -271,12 +208,5 @@ static inline int notifier_to_errno(int ret) | |||
271 | 208 | ||
272 | extern struct blocking_notifier_head reboot_notifier_list; | 209 | extern struct blocking_notifier_head reboot_notifier_list; |
273 | 210 | ||
274 | /* Virtual Terminal events. */ | ||
275 | #define VT_ALLOCATE 0x0001 /* Console got allocated */ | ||
276 | #define VT_DEALLOCATE 0x0002 /* Console will be deallocated */ | ||
277 | #define VT_WRITE 0x0003 /* A char got output */ | ||
278 | #define VT_UPDATE 0x0004 /* A bigger update occurred */ | ||
279 | #define VT_PREWRITE 0x0005 /* A char is about to be written to the console */ | ||
280 | |||
281 | #endif /* __KERNEL__ */ | 211 | #endif /* __KERNEL__ */ |
282 | #endif /* _LINUX_NOTIFIER_H */ | 212 | #endif /* _LINUX_NOTIFIER_H */ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 50d20aba57d3..cc37a55ad004 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new); | |||
68 | void free_nsproxy(struct nsproxy *ns); | 68 | void free_nsproxy(struct nsproxy *ns); |
69 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, | 69 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, |
70 | struct fs_struct *); | 70 | struct fs_struct *); |
71 | int __init nsproxy_cache_init(void); | ||
71 | 72 | ||
72 | static inline void put_nsproxy(struct nsproxy *ns) | 73 | static inline void put_nsproxy(struct nsproxy *ns) |
73 | { | 74 | { |
diff --git a/include/linux/of.h b/include/linux/of.h index bfc0ed1b0ced..9180dc5cb00b 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -195,6 +195,14 @@ extern struct device_node *of_find_node_with_property( | |||
195 | extern struct property *of_find_property(const struct device_node *np, | 195 | extern struct property *of_find_property(const struct device_node *np, |
196 | const char *name, | 196 | const char *name, |
197 | int *lenp); | 197 | int *lenp); |
198 | extern int of_property_read_u32_array(const struct device_node *np, | ||
199 | const char *propname, | ||
200 | u32 *out_values, | ||
201 | size_t sz); | ||
202 | |||
203 | extern int of_property_read_string(struct device_node *np, | ||
204 | const char *propname, | ||
205 | const char **out_string); | ||
198 | extern int of_device_is_compatible(const struct device_node *device, | 206 | extern int of_device_is_compatible(const struct device_node *device, |
199 | const char *); | 207 | const char *); |
200 | extern int of_device_is_available(const struct device_node *device); | 208 | extern int of_device_is_available(const struct device_node *device); |
@@ -227,12 +235,41 @@ extern void of_attach_node(struct device_node *); | |||
227 | extern void of_detach_node(struct device_node *); | 235 | extern void of_detach_node(struct device_node *); |
228 | #endif | 236 | #endif |
229 | 237 | ||
230 | #else | 238 | #else /* CONFIG_OF */ |
231 | 239 | ||
232 | static inline bool of_have_populated_dt(void) | 240 | static inline bool of_have_populated_dt(void) |
233 | { | 241 | { |
234 | return false; | 242 | return false; |
235 | } | 243 | } |
236 | 244 | ||
245 | static inline int of_property_read_u32_array(const struct device_node *np, | ||
246 | const char *propname, | ||
247 | u32 *out_values, size_t sz) | ||
248 | { | ||
249 | return -ENOSYS; | ||
250 | } | ||
251 | |||
252 | static inline int of_property_read_string(struct device_node *np, | ||
253 | const char *propname, | ||
254 | const char **out_string) | ||
255 | { | ||
256 | return -ENOSYS; | ||
257 | } | ||
258 | |||
259 | static inline const void *of_get_property(const struct device_node *node, | ||
260 | const char *name, | ||
261 | int *lenp) | ||
262 | { | ||
263 | return NULL; | ||
264 | } | ||
265 | |||
237 | #endif /* CONFIG_OF */ | 266 | #endif /* CONFIG_OF */ |
267 | |||
268 | static inline int of_property_read_u32(const struct device_node *np, | ||
269 | const char *propname, | ||
270 | u32 *out_value) | ||
271 | { | ||
272 | return of_property_read_u32_array(np, propname, out_value, 1); | ||
273 | } | ||
274 | |||
238 | #endif /* _LINUX_OF_H */ | 275 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 2feda6ee6140..3118623c2c1f 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -1,11 +1,16 @@ | |||
1 | #ifndef __OF_ADDRESS_H | 1 | #ifndef __OF_ADDRESS_H |
2 | #define __OF_ADDRESS_H | 2 | #define __OF_ADDRESS_H |
3 | #include <linux/ioport.h> | 3 | #include <linux/ioport.h> |
4 | #include <linux/errno.h> | ||
4 | #include <linux/of.h> | 5 | #include <linux/of.h> |
5 | 6 | ||
6 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 7 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
7 | extern int of_address_to_resource(struct device_node *dev, int index, | 8 | extern int of_address_to_resource(struct device_node *dev, int index, |
8 | struct resource *r); | 9 | struct resource *r); |
10 | extern struct device_node *of_find_matching_node_by_address( | ||
11 | struct device_node *from, | ||
12 | const struct of_device_id *matches, | ||
13 | u64 base_address); | ||
9 | extern void __iomem *of_iomap(struct device_node *device, int index); | 14 | extern void __iomem *of_iomap(struct device_node *device, int index); |
10 | 15 | ||
11 | /* Extract an address from a device, returns the region size and | 16 | /* Extract an address from a device, returns the region size and |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 6598c04dab01..52280a2b5e63 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
@@ -46,8 +46,9 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | |||
46 | return container_of(gc, struct of_mm_gpio_chip, gc); | 46 | return container_of(gc, struct of_mm_gpio_chip, gc); |
47 | } | 47 | } |
48 | 48 | ||
49 | extern int of_get_gpio_flags(struct device_node *np, int index, | 49 | extern int of_get_named_gpio_flags(struct device_node *np, |
50 | enum of_gpio_flags *flags); | 50 | const char *list_name, int index, enum of_gpio_flags *flags); |
51 | |||
51 | extern unsigned int of_gpio_count(struct device_node *np); | 52 | extern unsigned int of_gpio_count(struct device_node *np); |
52 | 53 | ||
53 | extern int of_mm_gpiochip_add(struct device_node *np, | 54 | extern int of_mm_gpiochip_add(struct device_node *np, |
@@ -56,12 +57,14 @@ extern int of_mm_gpiochip_add(struct device_node *np, | |||
56 | extern void of_gpiochip_add(struct gpio_chip *gc); | 57 | extern void of_gpiochip_add(struct gpio_chip *gc); |
57 | extern void of_gpiochip_remove(struct gpio_chip *gc); | 58 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
58 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); | 59 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); |
60 | extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, | ||
61 | const void *gpio_spec, u32 *flags); | ||
59 | 62 | ||
60 | #else /* CONFIG_OF_GPIO */ | 63 | #else /* CONFIG_OF_GPIO */ |
61 | 64 | ||
62 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 65 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
63 | static inline int of_get_gpio_flags(struct device_node *np, int index, | 66 | static inline int of_get_named_gpio_flags(struct device_node *np, |
64 | enum of_gpio_flags *flags) | 67 | const char *list_name, int index, enum of_gpio_flags *flags) |
65 | { | 68 | { |
66 | return -ENOSYS; | 69 | return -ENOSYS; |
67 | } | 70 | } |
@@ -71,13 +74,51 @@ static inline unsigned int of_gpio_count(struct device_node *np) | |||
71 | return 0; | 74 | return 0; |
72 | } | 75 | } |
73 | 76 | ||
77 | static inline int of_gpio_simple_xlate(struct gpio_chip *gc, | ||
78 | struct device_node *np, | ||
79 | const void *gpio_spec, u32 *flags) | ||
80 | { | ||
81 | return -ENOSYS; | ||
82 | } | ||
83 | |||
74 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } | 84 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } |
75 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | 85 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } |
76 | 86 | ||
77 | #endif /* CONFIG_OF_GPIO */ | 87 | #endif /* CONFIG_OF_GPIO */ |
78 | 88 | ||
79 | /** | 89 | /** |
80 | * of_get_gpio - Get a GPIO number to use with GPIO API | 90 | * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API |
91 | * @np: device node to get GPIO from | ||
92 | * @index: index of the GPIO | ||
93 | * @flags: a flags pointer to fill in | ||
94 | * | ||
95 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | ||
96 | * value on the error condition. If @flags is not NULL the function also fills | ||
97 | * in flags for the GPIO. | ||
98 | */ | ||
99 | static inline int of_get_gpio_flags(struct device_node *np, int index, | ||
100 | enum of_gpio_flags *flags) | ||
101 | { | ||
102 | return of_get_named_gpio_flags(np, "gpios", index, flags); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * of_get_named_gpio() - Get a GPIO number to use with GPIO API | ||
107 | * @np: device node to get GPIO from | ||
108 | * @propname: Name of property containing gpio specifier(s) | ||
109 | * @index: index of the GPIO | ||
110 | * | ||
111 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | ||
112 | * value on the error condition. | ||
113 | */ | ||
114 | static inline int of_get_named_gpio(struct device_node *np, | ||
115 | const char *propname, int index) | ||
116 | { | ||
117 | return of_get_named_gpio_flags(np, propname, index, NULL); | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * of_get_gpio() - Get a GPIO number to use with GPIO API | ||
81 | * @np: device node to get GPIO from | 122 | * @np: device node to get GPIO from |
82 | * @index: index of the GPIO | 123 | * @index: index of the GPIO |
83 | * | 124 | * |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index e6955f5d1f08..cd2e61ce4e83 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -63,6 +63,9 @@ extern int of_irq_map_one(struct device_node *device, int index, | |||
63 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | 63 | extern unsigned int irq_create_of_mapping(struct device_node *controller, |
64 | const u32 *intspec, | 64 | const u32 *intspec, |
65 | unsigned int intsize); | 65 | unsigned int intsize); |
66 | #ifdef CONFIG_IRQ_DOMAIN | ||
67 | extern void irq_dispose_mapping(unsigned int irq); | ||
68 | #endif | ||
66 | extern int of_irq_to_resource(struct device_node *dev, int index, | 69 | extern int of_irq_to_resource(struct device_node *dev, int index, |
67 | struct resource *r); | 70 | struct resource *r); |
68 | extern int of_irq_count(struct device_node *dev); | 71 | extern int of_irq_count(struct device_node *dev); |
@@ -70,6 +73,7 @@ extern int of_irq_to_resource_table(struct device_node *dev, | |||
70 | struct resource *res, int nr_irqs); | 73 | struct resource *res, int nr_irqs); |
71 | extern struct device_node *of_irq_find_parent(struct device_node *child); | 74 | extern struct device_node *of_irq_find_parent(struct device_node *child); |
72 | 75 | ||
76 | |||
73 | #endif /* CONFIG_OF_IRQ */ | 77 | #endif /* CONFIG_OF_IRQ */ |
74 | #endif /* CONFIG_OF */ | 78 | #endif /* CONFIG_OF */ |
75 | #endif /* __OF_IRQ_H */ | 79 | #endif /* __OF_IRQ_H */ |
diff --git a/include/linux/of_net.h b/include/linux/of_net.h index e913081fb52a..f47464188710 100644 --- a/include/linux/of_net.h +++ b/include/linux/of_net.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #ifdef CONFIG_OF_NET | 10 | #ifdef CONFIG_OF_NET |
11 | #include <linux/of.h> | 11 | #include <linux/of.h> |
12 | extern const int of_get_phy_mode(struct device_node *np); | ||
12 | extern const void *of_get_mac_address(struct device_node *np); | 13 | extern const void *of_get_mac_address(struct device_node *np); |
13 | #endif | 14 | #endif |
14 | 15 | ||
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 85a27b650d76..f93e21700d3e 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -6,4 +6,9 @@ | |||
6 | struct pci_dev; | 6 | struct pci_dev; |
7 | struct of_irq; | 7 | struct of_irq; |
8 | int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | 8 | int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
9 | |||
10 | struct device_node; | ||
11 | struct device_node *of_pci_find_child_device(struct device_node *parent, | ||
12 | unsigned int devfn); | ||
13 | |||
9 | #endif | 14 | #endif |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index fb51ae38cea7..5a6f458a4bb7 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -20,6 +20,40 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * struct of_dev_auxdata - lookup table entry for device names & platform_data | ||
24 | * @compatible: compatible value of node to match against node | ||
25 | * @phys_addr: Start address of registers to match against node | ||
26 | * @name: Name to assign for matching nodes | ||
27 | * @platform_data: platform_data to assign for matching nodes | ||
28 | * | ||
29 | * This lookup table allows the caller of of_platform_populate() to override | ||
30 | * the names of devices when creating devices from the device tree. The table | ||
31 | * should be terminated with an empty entry. It also allows the platform_data | ||
32 | * pointer to be set. | ||
33 | * | ||
34 | * The reason for this functionality is that some Linux infrastructure uses | ||
35 | * the device name to look up a specific device, but the Linux-specific names | ||
36 | * are not encoded into the device tree, so the kernel needs to provide specific | ||
37 | * values. | ||
38 | * | ||
39 | * Note: Using an auxdata lookup table should be considered a last resort when | ||
40 | * converting a platform to use the DT. Normally the automatically generated | ||
41 | * device name will not matter, and drivers should obtain data from the device | ||
42 | * node instead of from an anonymouns platform_data pointer. | ||
43 | */ | ||
44 | struct of_dev_auxdata { | ||
45 | char *compatible; | ||
46 | resource_size_t phys_addr; | ||
47 | char *name; | ||
48 | void *platform_data; | ||
49 | }; | ||
50 | |||
51 | /* Macro to simplify populating a lookup table */ | ||
52 | #define OF_DEV_AUXDATA(_compat,_phys,_name,_pdata) \ | ||
53 | { .compatible = _compat, .phys_addr = _phys, .name = _name, \ | ||
54 | .platform_data = _pdata } | ||
55 | |||
56 | /** | ||
23 | * of_platform_driver - Legacy of-aware driver for platform devices. | 57 | * of_platform_driver - Legacy of-aware driver for platform devices. |
24 | * | 58 | * |
25 | * An of_platform_driver driver is attached to a basic platform_device on | 59 | * An of_platform_driver driver is attached to a basic platform_device on |
@@ -40,6 +74,8 @@ struct of_platform_driver | |||
40 | #define to_of_platform_driver(drv) \ | 74 | #define to_of_platform_driver(drv) \ |
41 | container_of(drv,struct of_platform_driver, driver) | 75 | container_of(drv,struct of_platform_driver, driver) |
42 | 76 | ||
77 | extern const struct of_device_id of_default_bus_match_table[]; | ||
78 | |||
43 | /* Platform drivers register/unregister */ | 79 | /* Platform drivers register/unregister */ |
44 | extern struct platform_device *of_device_alloc(struct device_node *np, | 80 | extern struct platform_device *of_device_alloc(struct device_node *np, |
45 | const char *bus_id, | 81 | const char *bus_id, |
@@ -55,6 +91,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, | |||
55 | extern int of_platform_bus_probe(struct device_node *root, | 91 | extern int of_platform_bus_probe(struct device_node *root, |
56 | const struct of_device_id *matches, | 92 | const struct of_device_id *matches, |
57 | struct device *parent); | 93 | struct device *parent); |
94 | extern int of_platform_populate(struct device_node *root, | ||
95 | const struct of_device_id *matches, | ||
96 | const struct of_dev_auxdata *lookup, | ||
97 | struct device *parent); | ||
58 | #endif /* !CONFIG_SPARC */ | 98 | #endif /* !CONFIG_SPARC */ |
59 | 99 | ||
60 | #endif /* CONFIG_OF_DEVICE */ | 100 | #endif /* CONFIG_OF_DEVICE */ |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 4952fb874ad3..13b7b02e599a 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -64,10 +64,6 @@ static inline void oom_killer_enable(void) | |||
64 | oom_killer_disabled = false; | 64 | oom_killer_disabled = false; |
65 | } | 65 | } |
66 | 66 | ||
67 | /* The badness from the OOM killer */ | ||
68 | extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem, | ||
69 | const nodemask_t *nodemask, unsigned long uptime); | ||
70 | |||
71 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 67 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
72 | 68 | ||
73 | /* sysctls */ | 69 | /* sysctls */ |
diff --git a/include/linux/opp.h b/include/linux/opp.h index 5449945d589f..7020e9736fc5 100644 --- a/include/linux/opp.h +++ b/include/linux/opp.h | |||
@@ -94,12 +94,20 @@ static inline int opp_disable(struct device *dev, unsigned long freq) | |||
94 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) | 94 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) |
95 | int opp_init_cpufreq_table(struct device *dev, | 95 | int opp_init_cpufreq_table(struct device *dev, |
96 | struct cpufreq_frequency_table **table); | 96 | struct cpufreq_frequency_table **table); |
97 | void opp_free_cpufreq_table(struct device *dev, | ||
98 | struct cpufreq_frequency_table **table); | ||
97 | #else | 99 | #else |
98 | static inline int opp_init_cpufreq_table(struct device *dev, | 100 | static inline int opp_init_cpufreq_table(struct device *dev, |
99 | struct cpufreq_frequency_table **table) | 101 | struct cpufreq_frequency_table **table) |
100 | { | 102 | { |
101 | return -EINVAL; | 103 | return -EINVAL; |
102 | } | 104 | } |
105 | |||
106 | static inline | ||
107 | void opp_free_cpufreq_table(struct device *dev, | ||
108 | struct cpufreq_frequency_table **table) | ||
109 | { | ||
110 | } | ||
103 | #endif /* CONFIG_CPU_FREQ */ | 111 | #endif /* CONFIG_CPU_FREQ */ |
104 | 112 | ||
105 | #endif /* __LINUX_OPP_H__ */ | 113 | #endif /* __LINUX_OPP_H__ */ |
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 7f5cfd3b37dd..49c8727eeb57 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/printk.h> | 20 | #include <linux/printk.h> |
21 | #include <asm/atomic.h> | 21 | #include <linux/atomic.h> |
22 | 22 | ||
23 | /* Each escaped entry is prefixed by ESCAPE_CODE | 23 | /* Each escaped entry is prefixed by ESCAPE_CODE |
24 | * then one of the following codes, then the | 24 | * then one of the following codes, then the |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6081493db68f..e90a673be67e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -124,9 +124,6 @@ enum pageflags { | |||
124 | 124 | ||
125 | /* SLOB */ | 125 | /* SLOB */ |
126 | PG_slob_free = PG_private, | 126 | PG_slob_free = PG_private, |
127 | |||
128 | /* SLUB */ | ||
129 | PG_slub_frozen = PG_active, | ||
130 | }; | 127 | }; |
131 | 128 | ||
132 | #ifndef __GENERATING_BOUNDS_H | 129 | #ifndef __GENERATING_BOUNDS_H |
@@ -135,7 +132,7 @@ enum pageflags { | |||
135 | * Macros to create function definitions for page flags | 132 | * Macros to create function definitions for page flags |
136 | */ | 133 | */ |
137 | #define TESTPAGEFLAG(uname, lname) \ | 134 | #define TESTPAGEFLAG(uname, lname) \ |
138 | static inline int Page##uname(struct page *page) \ | 135 | static inline int Page##uname(const struct page *page) \ |
139 | { return test_bit(PG_##lname, &page->flags); } | 136 | { return test_bit(PG_##lname, &page->flags); } |
140 | 137 | ||
141 | #define SETPAGEFLAG(uname, lname) \ | 138 | #define SETPAGEFLAG(uname, lname) \ |
@@ -173,7 +170,7 @@ static inline int __TestClearPage##uname(struct page *page) \ | |||
173 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) | 170 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) |
174 | 171 | ||
175 | #define PAGEFLAG_FALSE(uname) \ | 172 | #define PAGEFLAG_FALSE(uname) \ |
176 | static inline int Page##uname(struct page *page) \ | 173 | static inline int Page##uname(const struct page *page) \ |
177 | { return 0; } | 174 | { return 0; } |
178 | 175 | ||
179 | #define TESTSCFLAG(uname, lname) \ | 176 | #define TESTSCFLAG(uname, lname) \ |
@@ -212,8 +209,6 @@ PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | |||
212 | 209 | ||
213 | __PAGEFLAG(SlobFree, slob_free) | 210 | __PAGEFLAG(SlobFree, slob_free) |
214 | 211 | ||
215 | __PAGEFLAG(SlubFrozen, slub_frozen) | ||
216 | |||
217 | /* | 212 | /* |
218 | * Private page markings that may be used by the filesystem that owns the page | 213 | * Private page markings that may be used by the filesystem that owns the page |
219 | * for its own purposes. | 214 | * for its own purposes. |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 716875e53520..cfaaa6949b8b 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -134,7 +134,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
134 | VM_BUG_ON(in_interrupt()); | 134 | VM_BUG_ON(in_interrupt()); |
135 | 135 | ||
136 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) | 136 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) |
137 | # ifdef CONFIG_PREEMPT | 137 | # ifdef CONFIG_PREEMPT_COUNT |
138 | VM_BUG_ON(!in_atomic()); | 138 | VM_BUG_ON(!in_atomic()); |
139 | # endif | 139 | # endif |
140 | /* | 140 | /* |
@@ -172,7 +172,7 @@ static inline int page_cache_add_speculative(struct page *page, int count) | |||
172 | VM_BUG_ON(in_interrupt()); | 172 | VM_BUG_ON(in_interrupt()); |
173 | 173 | ||
174 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) | 174 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) |
175 | # ifdef CONFIG_PREEMPT | 175 | # ifdef CONFIG_PREEMPT_COUNT |
176 | VM_BUG_ON(!in_atomic()); | 176 | VM_BUG_ON(!in_atomic()); |
177 | # endif | 177 | # endif |
178 | VM_BUG_ON(page_count(page) == 0); | 178 | VM_BUG_ON(page_count(page) == 0); |
@@ -255,26 +255,24 @@ static inline struct page *grab_cache_page(struct address_space *mapping, | |||
255 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, | 255 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, |
256 | pgoff_t index); | 256 | pgoff_t index); |
257 | extern struct page * read_cache_page_async(struct address_space *mapping, | 257 | extern struct page * read_cache_page_async(struct address_space *mapping, |
258 | pgoff_t index, filler_t *filler, | 258 | pgoff_t index, filler_t *filler, void *data); |
259 | void *data); | ||
260 | extern struct page * read_cache_page(struct address_space *mapping, | 259 | extern struct page * read_cache_page(struct address_space *mapping, |
261 | pgoff_t index, filler_t *filler, | 260 | pgoff_t index, filler_t *filler, void *data); |
262 | void *data); | ||
263 | extern struct page * read_cache_page_gfp(struct address_space *mapping, | 261 | extern struct page * read_cache_page_gfp(struct address_space *mapping, |
264 | pgoff_t index, gfp_t gfp_mask); | 262 | pgoff_t index, gfp_t gfp_mask); |
265 | extern int read_cache_pages(struct address_space *mapping, | 263 | extern int read_cache_pages(struct address_space *mapping, |
266 | struct list_head *pages, filler_t *filler, void *data); | 264 | struct list_head *pages, filler_t *filler, void *data); |
267 | 265 | ||
268 | static inline struct page *read_mapping_page_async( | 266 | static inline struct page *read_mapping_page_async( |
269 | struct address_space *mapping, | 267 | struct address_space *mapping, |
270 | pgoff_t index, void *data) | 268 | pgoff_t index, void *data) |
271 | { | 269 | { |
272 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | 270 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; |
273 | return read_cache_page_async(mapping, index, filler, data); | 271 | return read_cache_page_async(mapping, index, filler, data); |
274 | } | 272 | } |
275 | 273 | ||
276 | static inline struct page *read_mapping_page(struct address_space *mapping, | 274 | static inline struct page *read_mapping_page(struct address_space *mapping, |
277 | pgoff_t index, void *data) | 275 | pgoff_t index, void *data) |
278 | { | 276 | { |
279 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | 277 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; |
280 | return read_cache_page(mapping, index, filler, data); | 278 | return read_cache_page(mapping, index, filler, data); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c446b5ca2d38..f27893b3b724 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -49,7 +49,7 @@ | |||
49 | #include <linux/compiler.h> | 49 | #include <linux/compiler.h> |
50 | #include <linux/errno.h> | 50 | #include <linux/errno.h> |
51 | #include <linux/kobject.h> | 51 | #include <linux/kobject.h> |
52 | #include <asm/atomic.h> | 52 | #include <linux/atomic.h> |
53 | #include <linux/device.h> | 53 | #include <linux/device.h> |
54 | #include <linux/io.h> | 54 | #include <linux/io.h> |
55 | #include <linux/irqreturn.h> | 55 | #include <linux/irqreturn.h> |
@@ -843,8 +843,8 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type); | |||
843 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | 843 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); |
844 | 844 | ||
845 | enum pci_obff_signal_type { | 845 | enum pci_obff_signal_type { |
846 | PCI_EXP_OBFF_SIGNAL_L0, | 846 | PCI_EXP_OBFF_SIGNAL_L0 = 0, |
847 | PCI_EXP_OBFF_SIGNAL_ALWAYS, | 847 | PCI_EXP_OBFF_SIGNAL_ALWAYS = 1, |
848 | }; | 848 | }; |
849 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | 849 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); |
850 | void pci_disable_obff(struct pci_dev *dev); | 850 | void pci_disable_obff(struct pci_dev *dev); |
@@ -879,7 +879,7 @@ void pdev_enable_device(struct pci_dev *); | |||
879 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); | 879 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); |
880 | int pci_enable_resources(struct pci_dev *, int mask); | 880 | int pci_enable_resources(struct pci_dev *, int mask); |
881 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 881 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
882 | int (*)(struct pci_dev *, u8, u8)); | 882 | int (*)(const struct pci_dev *, u8, u8)); |
883 | #define HAVE_PCI_REQ_REGIONS 2 | 883 | #define HAVE_PCI_REQ_REGIONS 2 |
884 | int __must_check pci_request_regions(struct pci_dev *, const char *); | 884 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
885 | int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); | 885 | int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); |
@@ -1589,5 +1589,44 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); | |||
1589 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | 1589 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, |
1590 | unsigned int len, const char *kw); | 1590 | unsigned int len, const char *kw); |
1591 | 1591 | ||
1592 | /* PCI <-> OF binding helpers */ | ||
1593 | #ifdef CONFIG_OF | ||
1594 | struct device_node; | ||
1595 | extern void pci_set_of_node(struct pci_dev *dev); | ||
1596 | extern void pci_release_of_node(struct pci_dev *dev); | ||
1597 | extern void pci_set_bus_of_node(struct pci_bus *bus); | ||
1598 | extern void pci_release_bus_of_node(struct pci_bus *bus); | ||
1599 | |||
1600 | /* Arch may override this (weak) */ | ||
1601 | extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); | ||
1602 | |||
1603 | static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) | ||
1604 | { | ||
1605 | return pdev ? pdev->dev.of_node : NULL; | ||
1606 | } | ||
1607 | |||
1608 | static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | ||
1609 | { | ||
1610 | return bus ? bus->dev.of_node : NULL; | ||
1611 | } | ||
1612 | |||
1613 | #else /* CONFIG_OF */ | ||
1614 | static inline void pci_set_of_node(struct pci_dev *dev) { } | ||
1615 | static inline void pci_release_of_node(struct pci_dev *dev) { } | ||
1616 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } | ||
1617 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } | ||
1618 | #endif /* CONFIG_OF */ | ||
1619 | |||
1620 | /** | ||
1621 | * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device | ||
1622 | * @pdev: the PCI device | ||
1623 | * | ||
1624 | * if the device is PCIE, return NULL | ||
1625 | * if the device isn't connected to a PCIe bridge (that is its parent is a | ||
1626 | * legacy PCI bridge and the bridge is directly connected to bus 0), return its | ||
1627 | * parent | ||
1628 | */ | ||
1629 | struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev); | ||
1630 | |||
1592 | #endif /* __KERNEL__ */ | 1631 | #endif /* __KERNEL__ */ |
1593 | #endif /* LINUX_PCI_H */ | 1632 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f8910e155566..ae96bbe54518 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1308,6 +1308,7 @@ | |||
1308 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 | 1308 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 |
1309 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 | 1309 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 |
1310 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 | 1310 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 |
1311 | #define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062 | ||
1311 | #define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 | 1312 | #define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 |
1312 | 1313 | ||
1313 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ | 1314 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ |
@@ -2103,6 +2104,9 @@ | |||
2103 | #define PCI_DEVICE_ID_TIGON3_5761E 0x1680 | 2104 | #define PCI_DEVICE_ID_TIGON3_5761E 0x1680 |
2104 | #define PCI_DEVICE_ID_TIGON3_5761 0x1681 | 2105 | #define PCI_DEVICE_ID_TIGON3_5761 0x1681 |
2105 | #define PCI_DEVICE_ID_TIGON3_5764 0x1684 | 2106 | #define PCI_DEVICE_ID_TIGON3_5764 0x1684 |
2107 | #define PCI_DEVICE_ID_NX2_57800 0x168a | ||
2108 | #define PCI_DEVICE_ID_NX2_57840 0x168d | ||
2109 | #define PCI_DEVICE_ID_NX2_57810 0x168e | ||
2106 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | 2110 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 |
2107 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 2111 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
2108 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 | 2112 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 |
@@ -2110,11 +2114,17 @@ | |||
2110 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | 2114 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b |
2111 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 2115 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
2112 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d | 2116 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d |
2117 | #define PCI_DEVICE_ID_NX2_57800_MF 0x16a5 | ||
2113 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 | 2118 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 |
2114 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 | 2119 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 |
2115 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 2120 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
2121 | #define PCI_DEVICE_ID_NX2_57800_VF 0x16a9 | ||
2116 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | 2122 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa |
2123 | #define PCI_DEVICE_ID_NX2_57840_MF 0x16ab | ||
2117 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac | 2124 | #define PCI_DEVICE_ID_NX2_5708S 0x16ac |
2125 | #define PCI_DEVICE_ID_NX2_57840_VF 0x16ad | ||
2126 | #define PCI_DEVICE_ID_NX2_57810_MF 0x16ae | ||
2127 | #define PCI_DEVICE_ID_NX2_57810_VF 0x16af | ||
2118 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 | 2128 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 |
2119 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 | 2129 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 |
2120 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd | 2130 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd |
@@ -2699,6 +2709,16 @@ | |||
2699 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2709 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
2700 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 | 2710 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 |
2701 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f | 2711 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f |
2712 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB0 0x3c20 | ||
2713 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB1 0x3c21 | ||
2714 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB2 0x3c22 | ||
2715 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB3 0x3c23 | ||
2716 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB4 0x3c24 | ||
2717 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB5 0x3c25 | ||
2718 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB6 0x3c26 | ||
2719 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27 | ||
2720 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e | ||
2721 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f | ||
2702 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2722 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
2703 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2723 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
2704 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2724 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
@@ -2822,7 +2842,11 @@ | |||
2822 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 | 2842 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 |
2823 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 | 2843 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 |
2824 | #define PCI_DEVICE_ID_NETMOS_9865 0x9865 | 2844 | #define PCI_DEVICE_ID_NETMOS_9865 0x9865 |
2845 | #define PCI_DEVICE_ID_NETMOS_9900 0x9900 | ||
2825 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 | 2846 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 |
2847 | #define PCI_DEVICE_ID_NETMOS_9904 0x9904 | ||
2848 | #define PCI_DEVICE_ID_NETMOS_9912 0x9912 | ||
2849 | #define PCI_DEVICE_ID_NETMOS_9922 0x9922 | ||
2826 | 2850 | ||
2827 | #define PCI_VENDOR_ID_3COM_2 0xa727 | 2851 | #define PCI_VENDOR_ID_3COM_2 0xa727 |
2828 | 2852 | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index e0786e35f247..245bafdafd5e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -61,7 +61,7 @@ enum perf_hw_id { | |||
61 | /* | 61 | /* |
62 | * Generalized hardware cache events: | 62 | * Generalized hardware cache events: |
63 | * | 63 | * |
64 | * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x | 64 | * { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x |
65 | * { read, write, prefetch } x | 65 | * { read, write, prefetch } x |
66 | * { accesses, misses } | 66 | * { accesses, misses } |
67 | */ | 67 | */ |
@@ -72,6 +72,7 @@ enum perf_hw_cache_id { | |||
72 | PERF_COUNT_HW_CACHE_DTLB = 3, | 72 | PERF_COUNT_HW_CACHE_DTLB = 3, |
73 | PERF_COUNT_HW_CACHE_ITLB = 4, | 73 | PERF_COUNT_HW_CACHE_ITLB = 4, |
74 | PERF_COUNT_HW_CACHE_BPU = 5, | 74 | PERF_COUNT_HW_CACHE_BPU = 5, |
75 | PERF_COUNT_HW_CACHE_NODE = 6, | ||
75 | 76 | ||
76 | PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ | 77 | PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ |
77 | }; | 78 | }; |
@@ -508,7 +509,7 @@ struct perf_guest_info_callbacks { | |||
508 | #include <linux/cpu.h> | 509 | #include <linux/cpu.h> |
509 | #include <linux/irq_work.h> | 510 | #include <linux/irq_work.h> |
510 | #include <linux/jump_label.h> | 511 | #include <linux/jump_label.h> |
511 | #include <asm/atomic.h> | 512 | #include <linux/atomic.h> |
512 | #include <asm/local.h> | 513 | #include <asm/local.h> |
513 | 514 | ||
514 | #define PERF_MAX_STACK_DEPTH 255 | 515 | #define PERF_MAX_STACK_DEPTH 255 |
@@ -536,6 +537,16 @@ struct perf_branch_stack { | |||
536 | 537 | ||
537 | struct task_struct; | 538 | struct task_struct; |
538 | 539 | ||
540 | /* | ||
541 | * extra PMU register associated with an event | ||
542 | */ | ||
543 | struct hw_perf_event_extra { | ||
544 | u64 config; /* register value */ | ||
545 | unsigned int reg; /* register address or index */ | ||
546 | int alloc; /* extra register already allocated */ | ||
547 | int idx; /* index in shared_regs->regs[] */ | ||
548 | }; | ||
549 | |||
539 | /** | 550 | /** |
540 | * struct hw_perf_event - performance event hardware details: | 551 | * struct hw_perf_event - performance event hardware details: |
541 | */ | 552 | */ |
@@ -549,9 +560,7 @@ struct hw_perf_event { | |||
549 | unsigned long event_base; | 560 | unsigned long event_base; |
550 | int idx; | 561 | int idx; |
551 | int last_cpu; | 562 | int last_cpu; |
552 | unsigned int extra_reg; | 563 | struct hw_perf_event_extra extra_reg; |
553 | u64 extra_config; | ||
554 | int extra_alloc; | ||
555 | }; | 564 | }; |
556 | struct { /* software */ | 565 | struct { /* software */ |
557 | struct hrtimer hrtimer; | 566 | struct hrtimer hrtimer; |
@@ -680,36 +689,9 @@ enum perf_event_active_state { | |||
680 | }; | 689 | }; |
681 | 690 | ||
682 | struct file; | 691 | struct file; |
683 | |||
684 | #define PERF_BUFFER_WRITABLE 0x01 | ||
685 | |||
686 | struct perf_buffer { | ||
687 | atomic_t refcount; | ||
688 | struct rcu_head rcu_head; | ||
689 | #ifdef CONFIG_PERF_USE_VMALLOC | ||
690 | struct work_struct work; | ||
691 | int page_order; /* allocation order */ | ||
692 | #endif | ||
693 | int nr_pages; /* nr of data pages */ | ||
694 | int writable; /* are we writable */ | ||
695 | |||
696 | atomic_t poll; /* POLL_ for wakeups */ | ||
697 | |||
698 | local_t head; /* write position */ | ||
699 | local_t nest; /* nested writers */ | ||
700 | local_t events; /* event limit */ | ||
701 | local_t wakeup; /* wakeup stamp */ | ||
702 | local_t lost; /* nr records lost */ | ||
703 | |||
704 | long watermark; /* wakeup watermark */ | ||
705 | |||
706 | struct perf_event_mmap_page *user_page; | ||
707 | void *data_pages[0]; | ||
708 | }; | ||
709 | |||
710 | struct perf_sample_data; | 692 | struct perf_sample_data; |
711 | 693 | ||
712 | typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | 694 | typedef void (*perf_overflow_handler_t)(struct perf_event *, |
713 | struct perf_sample_data *, | 695 | struct perf_sample_data *, |
714 | struct pt_regs *regs); | 696 | struct pt_regs *regs); |
715 | 697 | ||
@@ -745,6 +727,8 @@ struct perf_cgroup { | |||
745 | }; | 727 | }; |
746 | #endif | 728 | #endif |
747 | 729 | ||
730 | struct ring_buffer; | ||
731 | |||
748 | /** | 732 | /** |
749 | * struct perf_event - performance event kernel representation: | 733 | * struct perf_event - performance event kernel representation: |
750 | */ | 734 | */ |
@@ -834,7 +818,7 @@ struct perf_event { | |||
834 | atomic_t mmap_count; | 818 | atomic_t mmap_count; |
835 | int mmap_locked; | 819 | int mmap_locked; |
836 | struct user_struct *mmap_user; | 820 | struct user_struct *mmap_user; |
837 | struct perf_buffer *buffer; | 821 | struct ring_buffer *rb; |
838 | 822 | ||
839 | /* poll related */ | 823 | /* poll related */ |
840 | wait_queue_head_t waitq; | 824 | wait_queue_head_t waitq; |
@@ -855,6 +839,7 @@ struct perf_event { | |||
855 | u64 id; | 839 | u64 id; |
856 | 840 | ||
857 | perf_overflow_handler_t overflow_handler; | 841 | perf_overflow_handler_t overflow_handler; |
842 | void *overflow_handler_context; | ||
858 | 843 | ||
859 | #ifdef CONFIG_EVENT_TRACING | 844 | #ifdef CONFIG_EVENT_TRACING |
860 | struct ftrace_event_call *tp_event; | 845 | struct ftrace_event_call *tp_event; |
@@ -919,8 +904,8 @@ struct perf_event_context { | |||
919 | u64 parent_gen; | 904 | u64 parent_gen; |
920 | u64 generation; | 905 | u64 generation; |
921 | int pin_count; | 906 | int pin_count; |
922 | struct rcu_head rcu_head; | ||
923 | int nr_cgroups; /* cgroup events present */ | 907 | int nr_cgroups; /* cgroup events present */ |
908 | struct rcu_head rcu_head; | ||
924 | }; | 909 | }; |
925 | 910 | ||
926 | /* | 911 | /* |
@@ -945,13 +930,11 @@ struct perf_cpu_context { | |||
945 | 930 | ||
946 | struct perf_output_handle { | 931 | struct perf_output_handle { |
947 | struct perf_event *event; | 932 | struct perf_event *event; |
948 | struct perf_buffer *buffer; | 933 | struct ring_buffer *rb; |
949 | unsigned long wakeup; | 934 | unsigned long wakeup; |
950 | unsigned long size; | 935 | unsigned long size; |
951 | void *addr; | 936 | void *addr; |
952 | int page; | 937 | int page; |
953 | int nmi; | ||
954 | int sample; | ||
955 | }; | 938 | }; |
956 | 939 | ||
957 | #ifdef CONFIG_PERF_EVENTS | 940 | #ifdef CONFIG_PERF_EVENTS |
@@ -972,13 +955,15 @@ extern void perf_pmu_disable(struct pmu *pmu); | |||
972 | extern void perf_pmu_enable(struct pmu *pmu); | 955 | extern void perf_pmu_enable(struct pmu *pmu); |
973 | extern int perf_event_task_disable(void); | 956 | extern int perf_event_task_disable(void); |
974 | extern int perf_event_task_enable(void); | 957 | extern int perf_event_task_enable(void); |
958 | extern int perf_event_refresh(struct perf_event *event, int refresh); | ||
975 | extern void perf_event_update_userpage(struct perf_event *event); | 959 | extern void perf_event_update_userpage(struct perf_event *event); |
976 | extern int perf_event_release_kernel(struct perf_event *event); | 960 | extern int perf_event_release_kernel(struct perf_event *event); |
977 | extern struct perf_event * | 961 | extern struct perf_event * |
978 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | 962 | perf_event_create_kernel_counter(struct perf_event_attr *attr, |
979 | int cpu, | 963 | int cpu, |
980 | struct task_struct *task, | 964 | struct task_struct *task, |
981 | perf_overflow_handler_t callback); | 965 | perf_overflow_handler_t callback, |
966 | void *context); | ||
982 | extern u64 perf_event_read_value(struct perf_event *event, | 967 | extern u64 perf_event_read_value(struct perf_event *event, |
983 | u64 *enabled, u64 *running); | 968 | u64 *enabled, u64 *running); |
984 | 969 | ||
@@ -1018,7 +1003,7 @@ extern void perf_prepare_sample(struct perf_event_header *header, | |||
1018 | struct perf_event *event, | 1003 | struct perf_event *event, |
1019 | struct pt_regs *regs); | 1004 | struct pt_regs *regs); |
1020 | 1005 | ||
1021 | extern int perf_event_overflow(struct perf_event *event, int nmi, | 1006 | extern int perf_event_overflow(struct perf_event *event, |
1022 | struct perf_sample_data *data, | 1007 | struct perf_sample_data *data, |
1023 | struct pt_regs *regs); | 1008 | struct pt_regs *regs); |
1024 | 1009 | ||
@@ -1037,7 +1022,7 @@ static inline int is_software_event(struct perf_event *event) | |||
1037 | 1022 | ||
1038 | extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 1023 | extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
1039 | 1024 | ||
1040 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 1025 | extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); |
1041 | 1026 | ||
1042 | #ifndef perf_arch_fetch_caller_regs | 1027 | #ifndef perf_arch_fetch_caller_regs |
1043 | static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } | 1028 | static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } |
@@ -1059,7 +1044,7 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs) | |||
1059 | } | 1044 | } |
1060 | 1045 | ||
1061 | static __always_inline void | 1046 | static __always_inline void |
1062 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | 1047 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) |
1063 | { | 1048 | { |
1064 | struct pt_regs hot_regs; | 1049 | struct pt_regs hot_regs; |
1065 | 1050 | ||
@@ -1068,7 +1053,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | |||
1068 | perf_fetch_caller_regs(&hot_regs); | 1053 | perf_fetch_caller_regs(&hot_regs); |
1069 | regs = &hot_regs; | 1054 | regs = &hot_regs; |
1070 | } | 1055 | } |
1071 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1056 | __perf_sw_event(event_id, nr, regs, addr); |
1072 | } | 1057 | } |
1073 | } | 1058 | } |
1074 | 1059 | ||
@@ -1082,7 +1067,7 @@ static inline void perf_event_task_sched_in(struct task_struct *task) | |||
1082 | 1067 | ||
1083 | static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | 1068 | static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) |
1084 | { | 1069 | { |
1085 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | 1070 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); |
1086 | 1071 | ||
1087 | __perf_event_task_sched_out(task, next); | 1072 | __perf_event_task_sched_out(task, next); |
1088 | } | 1073 | } |
@@ -1143,8 +1128,7 @@ extern void perf_bp_event(struct perf_event *event, void *data); | |||
1143 | #endif | 1128 | #endif |
1144 | 1129 | ||
1145 | extern int perf_output_begin(struct perf_output_handle *handle, | 1130 | extern int perf_output_begin(struct perf_output_handle *handle, |
1146 | struct perf_event *event, unsigned int size, | 1131 | struct perf_event *event, unsigned int size); |
1147 | int nmi, int sample); | ||
1148 | extern void perf_output_end(struct perf_output_handle *handle); | 1132 | extern void perf_output_end(struct perf_output_handle *handle); |
1149 | extern void perf_output_copy(struct perf_output_handle *handle, | 1133 | extern void perf_output_copy(struct perf_output_handle *handle, |
1150 | const void *buf, unsigned int len); | 1134 | const void *buf, unsigned int len); |
@@ -1166,10 +1150,13 @@ static inline void perf_event_delayed_put(struct task_struct *task) { } | |||
1166 | static inline void perf_event_print_debug(void) { } | 1150 | static inline void perf_event_print_debug(void) { } |
1167 | static inline int perf_event_task_disable(void) { return -EINVAL; } | 1151 | static inline int perf_event_task_disable(void) { return -EINVAL; } |
1168 | static inline int perf_event_task_enable(void) { return -EINVAL; } | 1152 | static inline int perf_event_task_enable(void) { return -EINVAL; } |
1153 | static inline int perf_event_refresh(struct perf_event *event, int refresh) | ||
1154 | { | ||
1155 | return -EINVAL; | ||
1156 | } | ||
1169 | 1157 | ||
1170 | static inline void | 1158 | static inline void |
1171 | perf_sw_event(u32 event_id, u64 nr, int nmi, | 1159 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } |
1172 | struct pt_regs *regs, u64 addr) { } | ||
1173 | static inline void | 1160 | static inline void |
1174 | perf_bp_event(struct perf_event *event, void *data) { } | 1161 | perf_bp_event(struct perf_event *event, void *data) { } |
1175 | 1162 | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index 7da5fa845959..54fc4138955f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
27 | #include <linux/mod_devicetable.h> | 27 | #include <linux/mod_devicetable.h> |
28 | 28 | ||
29 | #include <asm/atomic.h> | 29 | #include <linux/atomic.h> |
30 | 30 | ||
31 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ | 31 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ |
32 | SUPPORTED_10baseT_Full | \ | 32 | SUPPORTED_10baseT_Full | \ |
@@ -53,6 +53,7 @@ | |||
53 | 53 | ||
54 | /* Interface Mode definitions */ | 54 | /* Interface Mode definitions */ |
55 | typedef enum { | 55 | typedef enum { |
56 | PHY_INTERFACE_MODE_NA, | ||
56 | PHY_INTERFACE_MODE_MII, | 57 | PHY_INTERFACE_MODE_MII, |
57 | PHY_INTERFACE_MODE_GMII, | 58 | PHY_INTERFACE_MODE_GMII, |
58 | PHY_INTERFACE_MODE_SGMII, | 59 | PHY_INTERFACE_MODE_SGMII, |
@@ -62,7 +63,8 @@ typedef enum { | |||
62 | PHY_INTERFACE_MODE_RGMII_ID, | 63 | PHY_INTERFACE_MODE_RGMII_ID, |
63 | PHY_INTERFACE_MODE_RGMII_RXID, | 64 | PHY_INTERFACE_MODE_RGMII_RXID, |
64 | PHY_INTERFACE_MODE_RGMII_TXID, | 65 | PHY_INTERFACE_MODE_RGMII_TXID, |
65 | PHY_INTERFACE_MODE_RTBI | 66 | PHY_INTERFACE_MODE_RTBI, |
67 | PHY_INTERFACE_MODE_SMII, | ||
66 | } phy_interface_t; | 68 | } phy_interface_t; |
67 | 69 | ||
68 | 70 | ||
diff --git a/include/linux/platform_data/fsa9480.h b/include/linux/platform_data/fsa9480.h new file mode 100644 index 000000000000..72dddcb4bed1 --- /dev/null +++ b/include/linux/platform_data/fsa9480.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Samsung Electronics | ||
3 | * Minkyu Kang <mk7.kang@samsung.com> | ||
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 _FSA9480_H_ | ||
11 | #define _FSA9480_H_ | ||
12 | |||
13 | #define FSA9480_ATTACHED 1 | ||
14 | #define FSA9480_DETACHED 0 | ||
15 | |||
16 | struct fsa9480_platform_data { | ||
17 | void (*cfg_gpio) (void); | ||
18 | void (*usb_cb) (u8 attached); | ||
19 | void (*uart_cb) (u8 attached); | ||
20 | void (*charger_cb) (u8 attached); | ||
21 | void (*jig_cb) (u8 attached); | ||
22 | void (*reset_cb) (void); | ||
23 | void (*usb_power) (u8 on); | ||
24 | int wakeup; | ||
25 | }; | ||
26 | |||
27 | #endif /* _FSA9480_H_ */ | ||
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h new file mode 100644 index 000000000000..abd286215279 --- /dev/null +++ b/include/linux/platform_data/ntc_thermistor.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * ntc_thermistor.h - NTC Thermistors | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electronics | ||
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | #ifndef _LINUX_NTC_H | ||
22 | #define _LINUX_NTC_H | ||
23 | |||
24 | enum ntc_thermistor_type { | ||
25 | TYPE_NCPXXWB473, | ||
26 | TYPE_NCPXXWL333, | ||
27 | }; | ||
28 | |||
29 | struct ntc_thermistor_platform_data { | ||
30 | /* | ||
31 | * One (not both) of read_uV and read_ohm should be provided and only | ||
32 | * one of the two should be provided. | ||
33 | * Both functions should return negative value for an error case. | ||
34 | * | ||
35 | * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use | ||
36 | * read_uV() | ||
37 | * | ||
38 | * How to setup pullup_ohm, pulldown_ohm, and connect is | ||
39 | * described at Documentation/hwmon/ntc | ||
40 | * | ||
41 | * pullup/down_ohm: 0 for infinite / not-connected | ||
42 | */ | ||
43 | int (*read_uV)(void); | ||
44 | unsigned int pullup_uV; | ||
45 | |||
46 | unsigned int pullup_ohm; | ||
47 | unsigned int pulldown_ohm; | ||
48 | enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; | ||
49 | |||
50 | int (*read_ohm)(void); | ||
51 | }; | ||
52 | |||
53 | #endif /* _LINUX_NTC_H */ | ||
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h new file mode 100644 index 000000000000..51ad0995abac --- /dev/null +++ b/include/linux/platform_data/pxa_sdhci.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * include/linux/platform_data/pxa_sdhci.h | ||
3 | * | ||
4 | * Copyright 2010 Marvell | ||
5 | * Zhangfei Gao <zhangfei.gao@marvell.com> | ||
6 | * | ||
7 | * PXA Platform - SDHCI platform data definitions | ||
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 _PXA_SDHCI_H_ | ||
15 | #define _PXA_SDHCI_H_ | ||
16 | |||
17 | /* pxa specific flag */ | ||
18 | /* Require clock free running */ | ||
19 | #define PXA_FLAG_ENABLE_CLOCK_GATING (1<<0) | ||
20 | /* card always wired to host, like on-chip emmc */ | ||
21 | #define PXA_FLAG_CARD_PERMANENT (1<<1) | ||
22 | /* Board design supports 8-bit data on SD/SDIO BUS */ | ||
23 | #define PXA_FLAG_SD_8_BIT_CAPABLE_SLOT (1<<2) | ||
24 | |||
25 | /* | ||
26 | * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI | ||
27 | * @flags: flags for platform requirement | ||
28 | * @clk_delay_cycles: | ||
29 | * mmp2: each step is roughly 100ps, 5bits width | ||
30 | * pxa910: each step is 1ns, 4bits width | ||
31 | * @clk_delay_sel: select clk_delay, used on pxa910 | ||
32 | * 0: choose feedback clk | ||
33 | * 1: choose feedback clk + delay value | ||
34 | * 2: choose internal clk | ||
35 | * @clk_delay_enable: enable clk_delay or not, used on pxa910 | ||
36 | * @ext_cd_gpio: gpio pin used for external CD line | ||
37 | * @ext_cd_gpio_invert: invert values for external CD gpio line | ||
38 | * @max_speed: the maximum speed supported | ||
39 | * @host_caps: Standard MMC host capabilities bit field. | ||
40 | * @quirks: quirks of platfrom | ||
41 | * @pm_caps: pm_caps of platfrom | ||
42 | */ | ||
43 | struct sdhci_pxa_platdata { | ||
44 | unsigned int flags; | ||
45 | unsigned int clk_delay_cycles; | ||
46 | unsigned int clk_delay_sel; | ||
47 | bool clk_delay_enable; | ||
48 | unsigned int ext_cd_gpio; | ||
49 | bool ext_cd_gpio_invert; | ||
50 | unsigned int max_speed; | ||
51 | unsigned int host_caps; | ||
52 | unsigned int quirks; | ||
53 | unsigned int pm_caps; | ||
54 | }; | ||
55 | |||
56 | struct sdhci_pxa { | ||
57 | u8 clk_enable; | ||
58 | u8 power_mode; | ||
59 | }; | ||
60 | #endif /* _PXA_SDHCI_H_ */ | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index ede1a80e3358..27bb05aae70d 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -42,6 +42,7 @@ extern void platform_device_unregister(struct platform_device *); | |||
42 | extern struct bus_type platform_bus_type; | 42 | extern struct bus_type platform_bus_type; |
43 | extern struct device platform_bus; | 43 | extern struct device platform_bus; |
44 | 44 | ||
45 | extern void arch_setup_pdev_archdata(struct platform_device *); | ||
45 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | 46 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); |
46 | extern int platform_get_irq(struct platform_device *, unsigned int); | 47 | extern int platform_get_irq(struct platform_device *, unsigned int); |
47 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); | 48 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); |
diff --git a/include/linux/plist.h b/include/linux/plist.h index c9b9f322c8d8..aa0fb390bd29 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -77,14 +77,9 @@ | |||
77 | 77 | ||
78 | #include <linux/kernel.h> | 78 | #include <linux/kernel.h> |
79 | #include <linux/list.h> | 79 | #include <linux/list.h> |
80 | #include <linux/spinlock_types.h> | ||
81 | 80 | ||
82 | struct plist_head { | 81 | struct plist_head { |
83 | struct list_head node_list; | 82 | struct list_head node_list; |
84 | #ifdef CONFIG_DEBUG_PI_LIST | ||
85 | raw_spinlock_t *rawlock; | ||
86 | spinlock_t *spinlock; | ||
87 | #endif | ||
88 | }; | 83 | }; |
89 | 84 | ||
90 | struct plist_node { | 85 | struct plist_node { |
@@ -93,37 +88,13 @@ struct plist_node { | |||
93 | struct list_head node_list; | 88 | struct list_head node_list; |
94 | }; | 89 | }; |
95 | 90 | ||
96 | #ifdef CONFIG_DEBUG_PI_LIST | ||
97 | # define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock | ||
98 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock | ||
99 | #else | ||
100 | # define PLIST_HEAD_LOCK_INIT(_lock) | ||
101 | # define PLIST_HEAD_LOCK_INIT_RAW(_lock) | ||
102 | #endif | ||
103 | |||
104 | #define _PLIST_HEAD_INIT(head) \ | ||
105 | .node_list = LIST_HEAD_INIT((head).node_list) | ||
106 | |||
107 | /** | 91 | /** |
108 | * PLIST_HEAD_INIT - static struct plist_head initializer | 92 | * PLIST_HEAD_INIT - static struct plist_head initializer |
109 | * @head: struct plist_head variable name | 93 | * @head: struct plist_head variable name |
110 | * @_lock: lock to initialize for this list | ||
111 | */ | ||
112 | #define PLIST_HEAD_INIT(head, _lock) \ | ||
113 | { \ | ||
114 | _PLIST_HEAD_INIT(head), \ | ||
115 | PLIST_HEAD_LOCK_INIT(&(_lock)) \ | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * PLIST_HEAD_INIT_RAW - static struct plist_head initializer | ||
120 | * @head: struct plist_head variable name | ||
121 | * @_lock: lock to initialize for this list | ||
122 | */ | 94 | */ |
123 | #define PLIST_HEAD_INIT_RAW(head, _lock) \ | 95 | #define PLIST_HEAD_INIT(head) \ |
124 | { \ | 96 | { \ |
125 | _PLIST_HEAD_INIT(head), \ | 97 | .node_list = LIST_HEAD_INIT((head).node_list) \ |
126 | PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \ | ||
127 | } | 98 | } |
128 | 99 | ||
129 | /** | 100 | /** |
@@ -141,31 +112,11 @@ struct plist_node { | |||
141 | /** | 112 | /** |
142 | * plist_head_init - dynamic struct plist_head initializer | 113 | * plist_head_init - dynamic struct plist_head initializer |
143 | * @head: &struct plist_head pointer | 114 | * @head: &struct plist_head pointer |
144 | * @lock: spinlock protecting the list (debugging) | ||
145 | */ | 115 | */ |
146 | static inline void | 116 | static inline void |
147 | plist_head_init(struct plist_head *head, spinlock_t *lock) | 117 | plist_head_init(struct plist_head *head) |
148 | { | 118 | { |
149 | INIT_LIST_HEAD(&head->node_list); | 119 | INIT_LIST_HEAD(&head->node_list); |
150 | #ifdef CONFIG_DEBUG_PI_LIST | ||
151 | head->spinlock = lock; | ||
152 | head->rawlock = NULL; | ||
153 | #endif | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * plist_head_init_raw - dynamic struct plist_head initializer | ||
158 | * @head: &struct plist_head pointer | ||
159 | * @lock: raw_spinlock protecting the list (debugging) | ||
160 | */ | ||
161 | static inline void | ||
162 | plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) | ||
163 | { | ||
164 | INIT_LIST_HEAD(&head->node_list); | ||
165 | #ifdef CONFIG_DEBUG_PI_LIST | ||
166 | head->rawlock = lock; | ||
167 | head->spinlock = NULL; | ||
168 | #endif | ||
169 | } | 120 | } |
170 | 121 | ||
171 | /** | 122 | /** |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 411e4f4be52b..f7c84c9abd30 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -461,8 +461,8 @@ struct dev_pm_info { | |||
461 | unsigned long active_jiffies; | 461 | unsigned long active_jiffies; |
462 | unsigned long suspended_jiffies; | 462 | unsigned long suspended_jiffies; |
463 | unsigned long accounting_timestamp; | 463 | unsigned long accounting_timestamp; |
464 | void *subsys_data; /* Owned by the subsystem. */ | ||
465 | #endif | 464 | #endif |
465 | void *subsys_data; /* Owned by the subsystem. */ | ||
466 | }; | 466 | }; |
467 | 467 | ||
468 | extern void update_pm_runtime_accounting(struct device *dev); | 468 | extern void update_pm_runtime_accounting(struct device *dev); |
@@ -472,7 +472,7 @@ extern void update_pm_runtime_accounting(struct device *dev); | |||
472 | * hibernation, system resume and during runtime PM transitions along with | 472 | * hibernation, system resume and during runtime PM transitions along with |
473 | * subsystem-level and driver-level callbacks. | 473 | * subsystem-level and driver-level callbacks. |
474 | */ | 474 | */ |
475 | struct dev_power_domain { | 475 | struct dev_pm_domain { |
476 | struct dev_pm_ops ops; | 476 | struct dev_pm_ops ops; |
477 | }; | 477 | }; |
478 | 478 | ||
@@ -553,11 +553,17 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
553 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); | 553 | extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); |
554 | 554 | ||
555 | extern int pm_generic_prepare(struct device *dev); | 555 | extern int pm_generic_prepare(struct device *dev); |
556 | extern int pm_generic_suspend_noirq(struct device *dev); | ||
556 | extern int pm_generic_suspend(struct device *dev); | 557 | extern int pm_generic_suspend(struct device *dev); |
558 | extern int pm_generic_resume_noirq(struct device *dev); | ||
557 | extern int pm_generic_resume(struct device *dev); | 559 | extern int pm_generic_resume(struct device *dev); |
560 | extern int pm_generic_freeze_noirq(struct device *dev); | ||
558 | extern int pm_generic_freeze(struct device *dev); | 561 | extern int pm_generic_freeze(struct device *dev); |
562 | extern int pm_generic_thaw_noirq(struct device *dev); | ||
559 | extern int pm_generic_thaw(struct device *dev); | 563 | extern int pm_generic_thaw(struct device *dev); |
564 | extern int pm_generic_restore_noirq(struct device *dev); | ||
560 | extern int pm_generic_restore(struct device *dev); | 565 | extern int pm_generic_restore(struct device *dev); |
566 | extern int pm_generic_poweroff_noirq(struct device *dev); | ||
561 | extern int pm_generic_poweroff(struct device *dev); | 567 | extern int pm_generic_poweroff(struct device *dev); |
562 | extern void pm_generic_complete(struct device *dev); | 568 | extern void pm_generic_complete(struct device *dev); |
563 | 569 | ||
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h new file mode 100644 index 000000000000..21097cb086fe --- /dev/null +++ b/include/linux/pm_domain.h | |||
@@ -0,0 +1,108 @@ | |||
1 | /* | ||
2 | * pm_domain.h - Definitions and headers related to device power domains. | ||
3 | * | ||
4 | * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp. | ||
5 | * | ||
6 | * This file is released under the GPLv2. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_PM_DOMAIN_H | ||
10 | #define _LINUX_PM_DOMAIN_H | ||
11 | |||
12 | #include <linux/device.h> | ||
13 | |||
14 | enum gpd_status { | ||
15 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | ||
16 | GPD_STATE_BUSY, /* Something is happening to the PM domain */ | ||
17 | GPD_STATE_REPEAT, /* Power off in progress, to be repeated */ | ||
18 | GPD_STATE_POWER_OFF, /* PM domain is off */ | ||
19 | }; | ||
20 | |||
21 | struct dev_power_governor { | ||
22 | bool (*power_down_ok)(struct dev_pm_domain *domain); | ||
23 | }; | ||
24 | |||
25 | struct generic_pm_domain { | ||
26 | struct dev_pm_domain domain; /* PM domain operations */ | ||
27 | struct list_head gpd_list_node; /* Node in the global PM domains list */ | ||
28 | struct list_head sd_node; /* Node in the parent's subdomain list */ | ||
29 | struct generic_pm_domain *parent; /* Parent PM domain */ | ||
30 | struct list_head sd_list; /* List of dubdomains */ | ||
31 | struct list_head dev_list; /* List of devices */ | ||
32 | struct mutex lock; | ||
33 | struct dev_power_governor *gov; | ||
34 | struct work_struct power_off_work; | ||
35 | unsigned int in_progress; /* Number of devices being suspended now */ | ||
36 | unsigned int sd_count; /* Number of subdomains with power "on" */ | ||
37 | enum gpd_status status; /* Current state of the domain */ | ||
38 | wait_queue_head_t status_wait_queue; | ||
39 | struct task_struct *poweroff_task; /* Powering off task */ | ||
40 | unsigned int resume_count; /* Number of devices being resumed */ | ||
41 | unsigned int device_count; /* Number of devices */ | ||
42 | unsigned int suspended_count; /* System suspend device counter */ | ||
43 | unsigned int prepared_count; /* Suspend counter of prepared devices */ | ||
44 | bool suspend_power_off; /* Power status before system suspend */ | ||
45 | int (*power_off)(struct generic_pm_domain *domain); | ||
46 | int (*power_on)(struct generic_pm_domain *domain); | ||
47 | int (*start_device)(struct device *dev); | ||
48 | int (*stop_device)(struct device *dev); | ||
49 | bool (*active_wakeup)(struct device *dev); | ||
50 | }; | ||
51 | |||
52 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | ||
53 | { | ||
54 | return container_of(pd, struct generic_pm_domain, domain); | ||
55 | } | ||
56 | |||
57 | struct dev_list_entry { | ||
58 | struct list_head node; | ||
59 | struct device *dev; | ||
60 | bool need_restore; | ||
61 | }; | ||
62 | |||
63 | #ifdef CONFIG_PM_GENERIC_DOMAINS | ||
64 | extern int pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
65 | struct device *dev); | ||
66 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | ||
67 | struct device *dev); | ||
68 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | ||
69 | struct generic_pm_domain *new_subdomain); | ||
70 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | ||
71 | struct generic_pm_domain *target); | ||
72 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | ||
73 | struct dev_power_governor *gov, bool is_off); | ||
74 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | ||
75 | extern void pm_genpd_poweroff_unused(void); | ||
76 | extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd); | ||
77 | #else | ||
78 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | ||
79 | struct device *dev) | ||
80 | { | ||
81 | return -ENOSYS; | ||
82 | } | ||
83 | static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | ||
84 | struct device *dev) | ||
85 | { | ||
86 | return -ENOSYS; | ||
87 | } | ||
88 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | ||
89 | struct generic_pm_domain *new_sd) | ||
90 | { | ||
91 | return -ENOSYS; | ||
92 | } | ||
93 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | ||
94 | struct generic_pm_domain *target) | ||
95 | { | ||
96 | return -ENOSYS; | ||
97 | } | ||
98 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | ||
99 | struct dev_power_governor *gov, bool is_off) {} | ||
100 | static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) | ||
101 | { | ||
102 | return -ENOSYS; | ||
103 | } | ||
104 | static inline void pm_genpd_poweroff_unused(void) {} | ||
105 | static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {} | ||
106 | #endif | ||
107 | |||
108 | #endif /* _LINUX_PM_DOMAIN_H */ | ||
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 878cf84baeb1..daac05d751b2 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev) | |||
82 | && !dev->power.disable_depth; | 82 | && !dev->power.disable_depth; |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline bool pm_runtime_status_suspended(struct device *dev) | ||
86 | { | ||
87 | return dev->power.runtime_status == RPM_SUSPENDED; | ||
88 | } | ||
89 | |||
85 | static inline bool pm_runtime_enabled(struct device *dev) | 90 | static inline bool pm_runtime_enabled(struct device *dev) |
86 | { | 91 | { |
87 | return !dev->power.disable_depth; | 92 | return !dev->power.disable_depth; |
@@ -130,6 +135,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {} | |||
130 | static inline bool device_run_wake(struct device *dev) { return false; } | 135 | static inline bool device_run_wake(struct device *dev) { return false; } |
131 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 136 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
132 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 137 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
138 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | ||
133 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 139 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
134 | 140 | ||
135 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | 141 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } |
@@ -247,41 +253,41 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev) | |||
247 | 253 | ||
248 | struct pm_clk_notifier_block { | 254 | struct pm_clk_notifier_block { |
249 | struct notifier_block nb; | 255 | struct notifier_block nb; |
250 | struct dev_power_domain *pwr_domain; | 256 | struct dev_pm_domain *pm_domain; |
251 | char *con_ids[]; | 257 | char *con_ids[]; |
252 | }; | 258 | }; |
253 | 259 | ||
254 | #ifdef CONFIG_PM_RUNTIME_CLK | 260 | #ifdef CONFIG_PM_CLK |
255 | extern int pm_runtime_clk_init(struct device *dev); | 261 | extern int pm_clk_init(struct device *dev); |
256 | extern void pm_runtime_clk_destroy(struct device *dev); | 262 | extern void pm_clk_destroy(struct device *dev); |
257 | extern int pm_runtime_clk_add(struct device *dev, const char *con_id); | 263 | extern int pm_clk_add(struct device *dev, const char *con_id); |
258 | extern void pm_runtime_clk_remove(struct device *dev, const char *con_id); | 264 | extern void pm_clk_remove(struct device *dev, const char *con_id); |
259 | extern int pm_runtime_clk_suspend(struct device *dev); | 265 | extern int pm_clk_suspend(struct device *dev); |
260 | extern int pm_runtime_clk_resume(struct device *dev); | 266 | extern int pm_clk_resume(struct device *dev); |
261 | #else | 267 | #else |
262 | static inline int pm_runtime_clk_init(struct device *dev) | 268 | static inline int pm_clk_init(struct device *dev) |
263 | { | 269 | { |
264 | return -EINVAL; | 270 | return -EINVAL; |
265 | } | 271 | } |
266 | static inline void pm_runtime_clk_destroy(struct device *dev) | 272 | static inline void pm_clk_destroy(struct device *dev) |
267 | { | 273 | { |
268 | } | 274 | } |
269 | static inline int pm_runtime_clk_add(struct device *dev, const char *con_id) | 275 | static inline int pm_clk_add(struct device *dev, const char *con_id) |
270 | { | 276 | { |
271 | return -EINVAL; | 277 | return -EINVAL; |
272 | } | 278 | } |
273 | static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id) | 279 | static inline void pm_clk_remove(struct device *dev, const char *con_id) |
274 | { | 280 | { |
275 | } | 281 | } |
276 | #define pm_runtime_clock_suspend NULL | 282 | #define pm_clk_suspend NULL |
277 | #define pm_runtime_clock_resume NULL | 283 | #define pm_clk_resume NULL |
278 | #endif | 284 | #endif |
279 | 285 | ||
280 | #ifdef CONFIG_HAVE_CLK | 286 | #ifdef CONFIG_HAVE_CLK |
281 | extern void pm_runtime_clk_add_notifier(struct bus_type *bus, | 287 | extern void pm_clk_add_notifier(struct bus_type *bus, |
282 | struct pm_clk_notifier_block *clknb); | 288 | struct pm_clk_notifier_block *clknb); |
283 | #else | 289 | #else |
284 | static inline void pm_runtime_clk_add_notifier(struct bus_type *bus, | 290 | static inline void pm_clk_add_notifier(struct bus_type *bus, |
285 | struct pm_clk_notifier_block *clknb) | 291 | struct pm_clk_notifier_block *clknb) |
286 | { | 292 | { |
287 | } | 293 | } |
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h index 76efbdd01622..435dd5fa7453 100644 --- a/include/linux/pnfs_osd_xdr.h +++ b/include/linux/pnfs_osd_xdr.h | |||
@@ -41,9 +41,6 @@ | |||
41 | 41 | ||
42 | #include <linux/nfs_fs.h> | 42 | #include <linux/nfs_fs.h> |
43 | #include <linux/nfs_page.h> | 43 | #include <linux/nfs_page.h> |
44 | #include <scsi/osd_protocol.h> | ||
45 | |||
46 | #define PNFS_OSD_OSDNAME_MAXSIZE 256 | ||
47 | 44 | ||
48 | /* | 45 | /* |
49 | * draft-ietf-nfsv4-minorversion-22 | 46 | * draft-ietf-nfsv4-minorversion-22 |
@@ -99,12 +96,6 @@ struct pnfs_osd_objid { | |||
99 | #define _DEVID_HI(oid_device_id) \ | 96 | #define _DEVID_HI(oid_device_id) \ |
100 | (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) | 97 | (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) |
101 | 98 | ||
102 | static inline int | ||
103 | pnfs_osd_objid_xdr_sz(void) | ||
104 | { | ||
105 | return (NFS4_DEVICEID4_SIZE / 4) + 2 + 2; | ||
106 | } | ||
107 | |||
108 | enum pnfs_osd_version { | 99 | enum pnfs_osd_version { |
109 | PNFS_OSD_MISSING = 0, | 100 | PNFS_OSD_MISSING = 0, |
110 | PNFS_OSD_VERSION_1 = 1, | 101 | PNFS_OSD_VERSION_1 = 1, |
@@ -189,8 +180,6 @@ struct pnfs_osd_targetid { | |||
189 | struct nfs4_string oti_scsi_device_id; | 180 | struct nfs4_string oti_scsi_device_id; |
190 | }; | 181 | }; |
191 | 182 | ||
192 | enum { PNFS_OSD_TARGETID_MAX = 1 + PNFS_OSD_OSDNAME_MAXSIZE / 4 }; | ||
193 | |||
194 | /* struct netaddr4 { | 183 | /* struct netaddr4 { |
195 | * // see struct rpcb in RFC1833 | 184 | * // see struct rpcb in RFC1833 |
196 | * string r_netid<>; // network id | 185 | * string r_netid<>; // network id |
@@ -207,12 +196,6 @@ struct pnfs_osd_targetaddr { | |||
207 | struct pnfs_osd_net_addr ota_netaddr; | 196 | struct pnfs_osd_net_addr ota_netaddr; |
208 | }; | 197 | }; |
209 | 198 | ||
210 | enum { | ||
211 | NETWORK_ID_MAX = 16 / 4, | ||
212 | UNIVERSAL_ADDRESS_MAX = 64 / 4, | ||
213 | PNFS_OSD_TARGETADDR_MAX = 3 + NETWORK_ID_MAX + UNIVERSAL_ADDRESS_MAX, | ||
214 | }; | ||
215 | |||
216 | struct pnfs_osd_deviceaddr { | 199 | struct pnfs_osd_deviceaddr { |
217 | struct pnfs_osd_targetid oda_targetid; | 200 | struct pnfs_osd_targetid oda_targetid; |
218 | struct pnfs_osd_targetaddr oda_targetaddr; | 201 | struct pnfs_osd_targetaddr oda_targetaddr; |
@@ -222,15 +205,6 @@ struct pnfs_osd_deviceaddr { | |||
222 | struct nfs4_string oda_osdname; | 205 | struct nfs4_string oda_osdname; |
223 | }; | 206 | }; |
224 | 207 | ||
225 | enum { | ||
226 | ODA_OSDNAME_MAX = PNFS_OSD_OSDNAME_MAXSIZE / 4, | ||
227 | PNFS_OSD_DEVICEADDR_MAX = | ||
228 | PNFS_OSD_TARGETID_MAX + PNFS_OSD_TARGETADDR_MAX + | ||
229 | 2 /*oda_lun*/ + | ||
230 | 1 + OSD_SYSTEMID_LEN + | ||
231 | 1 + ODA_OSDNAME_MAX, | ||
232 | }; | ||
233 | |||
234 | /* LAYOUTCOMMIT: layoutupdate */ | 208 | /* LAYOUTCOMMIT: layoutupdate */ |
235 | 209 | ||
236 | /* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { | 210 | /* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { |
@@ -279,7 +253,7 @@ struct pnfs_osd_ioerr { | |||
279 | u32 oer_errno; | 253 | u32 oer_errno; |
280 | }; | 254 | }; |
281 | 255 | ||
282 | /* OSD XDR API */ | 256 | /* OSD XDR Client API */ |
283 | /* Layout helpers */ | 257 | /* Layout helpers */ |
284 | /* Layout decoding is done in two parts: | 258 | /* Layout decoding is done in two parts: |
285 | * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part | 259 | * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part |
@@ -337,8 +311,7 @@ extern int | |||
337 | pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, | 311 | pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, |
338 | struct pnfs_osd_layoutupdate *lou); | 312 | struct pnfs_osd_layoutupdate *lou); |
339 | 313 | ||
340 | /* osd_ioerror encoding/decoding (layout_return) */ | 314 | /* osd_ioerror encoding (layout_return) */ |
341 | /* Client */ | ||
342 | extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); | 315 | extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); |
343 | extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); | 316 | extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); |
344 | 317 | ||
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 1bc1338b817b..195aafc6cd07 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -50,7 +50,7 @@ static inline resource_size_t pnp_resource_len(struct resource *res) | |||
50 | { | 50 | { |
51 | if (res->start == 0 && res->end == 0) | 51 | if (res->start == 0 && res->end == 0) |
52 | return 0; | 52 | return 0; |
53 | return res->end - res->start + 1; | 53 | return resource_size(res); |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
diff --git a/include/linux/poison.h b/include/linux/poison.h index 2110a81c5e2a..79159de0e341 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -40,6 +40,12 @@ | |||
40 | #define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */ | 40 | #define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */ |
41 | #define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */ | 41 | #define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */ |
42 | 42 | ||
43 | #ifdef CONFIG_PHYS_ADDR_T_64BIT | ||
44 | #define MEMBLOCK_INACTIVE 0x3a84fb0144c9e71bULL | ||
45 | #else | ||
46 | #define MEMBLOCK_INACTIVE 0x44c9e71bUL | ||
47 | #endif | ||
48 | |||
43 | #define SLUB_RED_INACTIVE 0xbb | 49 | #define SLUB_RED_INACTIVE 0xbb |
44 | #define SLUB_RED_ACTIVE 0xcc | 50 | #define SLUB_RED_ACTIVE 0xcc |
45 | 51 | ||
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 54211c1cd926..b7681102a4b9 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define __LINUX_POSIX_ACL_H | 9 | #define __LINUX_POSIX_ACL_H |
10 | 10 | ||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/rcupdate.h> | ||
12 | 13 | ||
13 | #define ACL_UNDEFINED_ID (-1) | 14 | #define ACL_UNDEFINED_ID (-1) |
14 | 15 | ||
@@ -38,7 +39,10 @@ struct posix_acl_entry { | |||
38 | }; | 39 | }; |
39 | 40 | ||
40 | struct posix_acl { | 41 | struct posix_acl { |
41 | atomic_t a_refcount; | 42 | union { |
43 | atomic_t a_refcount; | ||
44 | struct rcu_head a_rcu; | ||
45 | }; | ||
42 | unsigned int a_count; | 46 | unsigned int a_count; |
43 | struct posix_acl_entry a_entries[0]; | 47 | struct posix_acl_entry a_entries[0]; |
44 | }; | 48 | }; |
@@ -65,7 +69,7 @@ static inline void | |||
65 | posix_acl_release(struct posix_acl *acl) | 69 | posix_acl_release(struct posix_acl *acl) |
66 | { | 70 | { |
67 | if (acl && atomic_dec_and_test(&acl->a_refcount)) | 71 | if (acl && atomic_dec_and_test(&acl->a_refcount)) |
68 | kfree(acl); | 72 | kfree_rcu(acl, a_rcu); |
69 | } | 73 | } |
70 | 74 | ||
71 | 75 | ||
@@ -73,32 +77,33 @@ posix_acl_release(struct posix_acl *acl) | |||
73 | 77 | ||
74 | extern void posix_acl_init(struct posix_acl *, int); | 78 | extern void posix_acl_init(struct posix_acl *, int); |
75 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); | 79 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); |
76 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); | ||
77 | extern int posix_acl_valid(const struct posix_acl *); | 80 | extern int posix_acl_valid(const struct posix_acl *); |
78 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 81 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
79 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); | 82 | extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); |
80 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 83 | extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); |
81 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); | 84 | extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *); |
82 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | 85 | extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); |
83 | 86 | ||
84 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 87 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
85 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 88 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
86 | 89 | ||
87 | #ifdef CONFIG_FS_POSIX_ACL | 90 | #ifdef CONFIG_FS_POSIX_ACL |
88 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | 91 | static inline struct posix_acl **acl_by_type(struct inode *inode, int type) |
89 | { | 92 | { |
90 | struct posix_acl **p, *acl; | ||
91 | switch (type) { | 93 | switch (type) { |
92 | case ACL_TYPE_ACCESS: | 94 | case ACL_TYPE_ACCESS: |
93 | p = &inode->i_acl; | 95 | return &inode->i_acl; |
94 | break; | ||
95 | case ACL_TYPE_DEFAULT: | 96 | case ACL_TYPE_DEFAULT: |
96 | p = &inode->i_default_acl; | 97 | return &inode->i_default_acl; |
97 | break; | ||
98 | default: | 98 | default: |
99 | return ERR_PTR(-EINVAL); | 99 | BUG(); |
100 | } | 100 | } |
101 | acl = ACCESS_ONCE(*p); | 101 | } |
102 | |||
103 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | ||
104 | { | ||
105 | struct posix_acl **p = acl_by_type(inode, type); | ||
106 | struct posix_acl *acl = ACCESS_ONCE(*p); | ||
102 | if (acl) { | 107 | if (acl) { |
103 | spin_lock(&inode->i_lock); | 108 | spin_lock(&inode->i_lock); |
104 | acl = *p; | 109 | acl = *p; |
@@ -109,41 +114,20 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | |||
109 | return acl; | 114 | return acl; |
110 | } | 115 | } |
111 | 116 | ||
112 | static inline int negative_cached_acl(struct inode *inode, int type) | 117 | static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) |
113 | { | 118 | { |
114 | struct posix_acl **p, *acl; | 119 | return rcu_dereference(*acl_by_type(inode, type)); |
115 | switch (type) { | ||
116 | case ACL_TYPE_ACCESS: | ||
117 | p = &inode->i_acl; | ||
118 | break; | ||
119 | case ACL_TYPE_DEFAULT: | ||
120 | p = &inode->i_default_acl; | ||
121 | break; | ||
122 | default: | ||
123 | BUG(); | ||
124 | } | ||
125 | acl = ACCESS_ONCE(*p); | ||
126 | if (acl) | ||
127 | return 0; | ||
128 | return 1; | ||
129 | } | 120 | } |
130 | 121 | ||
131 | static inline void set_cached_acl(struct inode *inode, | 122 | static inline void set_cached_acl(struct inode *inode, |
132 | int type, | 123 | int type, |
133 | struct posix_acl *acl) | 124 | struct posix_acl *acl) |
134 | { | 125 | { |
135 | struct posix_acl *old = NULL; | 126 | struct posix_acl **p = acl_by_type(inode, type); |
127 | struct posix_acl *old; | ||
136 | spin_lock(&inode->i_lock); | 128 | spin_lock(&inode->i_lock); |
137 | switch (type) { | 129 | old = *p; |
138 | case ACL_TYPE_ACCESS: | 130 | rcu_assign_pointer(*p, posix_acl_dup(acl)); |
139 | old = inode->i_acl; | ||
140 | inode->i_acl = posix_acl_dup(acl); | ||
141 | break; | ||
142 | case ACL_TYPE_DEFAULT: | ||
143 | old = inode->i_default_acl; | ||
144 | inode->i_default_acl = posix_acl_dup(acl); | ||
145 | break; | ||
146 | } | ||
147 | spin_unlock(&inode->i_lock); | 131 | spin_unlock(&inode->i_lock); |
148 | if (old != ACL_NOT_CACHED) | 132 | if (old != ACL_NOT_CACHED) |
149 | posix_acl_release(old); | 133 | posix_acl_release(old); |
@@ -151,18 +135,11 @@ static inline void set_cached_acl(struct inode *inode, | |||
151 | 135 | ||
152 | static inline void forget_cached_acl(struct inode *inode, int type) | 136 | static inline void forget_cached_acl(struct inode *inode, int type) |
153 | { | 137 | { |
154 | struct posix_acl *old = NULL; | 138 | struct posix_acl **p = acl_by_type(inode, type); |
139 | struct posix_acl *old; | ||
155 | spin_lock(&inode->i_lock); | 140 | spin_lock(&inode->i_lock); |
156 | switch (type) { | 141 | old = *p; |
157 | case ACL_TYPE_ACCESS: | 142 | *p = ACL_NOT_CACHED; |
158 | old = inode->i_acl; | ||
159 | inode->i_acl = ACL_NOT_CACHED; | ||
160 | break; | ||
161 | case ACL_TYPE_DEFAULT: | ||
162 | old = inode->i_default_acl; | ||
163 | inode->i_default_acl = ACL_NOT_CACHED; | ||
164 | break; | ||
165 | } | ||
166 | spin_unlock(&inode->i_lock); | 143 | spin_unlock(&inode->i_lock); |
167 | if (old != ACL_NOT_CACHED) | 144 | if (old != ACL_NOT_CACHED) |
168 | posix_acl_release(old); | 145 | posix_acl_release(old); |
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/bq20z75.h index b0843b68af92..1398eb004e83 100644 --- a/include/linux/power/bq20z75.h +++ b/include/linux/power/bq20z75.h | |||
@@ -29,11 +29,14 @@ | |||
29 | * @battery_detect: GPIO which is used to detect battery presence | 29 | * @battery_detect: GPIO which is used to detect battery presence |
30 | * @battery_detect_present: gpio state when battery is present (0 / 1) | 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) |
31 | * @i2c_retry_count: # of times to retry on i2c IO failure | 31 | * @i2c_retry_count: # of times to retry on i2c IO failure |
32 | * @poll_retry_count: # of times to retry looking for new status after | ||
33 | * external change notification | ||
32 | */ | 34 | */ |
33 | struct bq20z75_platform_data { | 35 | struct bq20z75_platform_data { |
34 | int battery_detect; | 36 | int battery_detect; |
35 | int battery_detect_present; | 37 | int battery_detect_present; |
36 | int i2c_retry_count; | 38 | int i2c_retry_count; |
39 | int poll_retry_count; | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | #endif | 42 | #endif |
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h index 7995deb8bfc1..fe99211fb2b8 100644 --- a/include/linux/power/max17042_battery.h +++ b/include/linux/power/max17042_battery.h | |||
@@ -23,8 +23,99 @@ | |||
23 | #ifndef __MAX17042_BATTERY_H_ | 23 | #ifndef __MAX17042_BATTERY_H_ |
24 | #define __MAX17042_BATTERY_H_ | 24 | #define __MAX17042_BATTERY_H_ |
25 | 25 | ||
26 | #define MAX17042_STATUS_BattAbsent (1 << 3) | ||
27 | #define MAX17042_BATTERY_FULL (100) | ||
28 | #define MAX17042_DEFAULT_SNS_RESISTOR (10000) | ||
29 | |||
30 | enum max17042_register { | ||
31 | MAX17042_STATUS = 0x00, | ||
32 | MAX17042_VALRT_Th = 0x01, | ||
33 | MAX17042_TALRT_Th = 0x02, | ||
34 | MAX17042_SALRT_Th = 0x03, | ||
35 | MAX17042_AtRate = 0x04, | ||
36 | MAX17042_RepCap = 0x05, | ||
37 | MAX17042_RepSOC = 0x06, | ||
38 | MAX17042_Age = 0x07, | ||
39 | MAX17042_TEMP = 0x08, | ||
40 | MAX17042_VCELL = 0x09, | ||
41 | MAX17042_Current = 0x0A, | ||
42 | MAX17042_AvgCurrent = 0x0B, | ||
43 | MAX17042_Qresidual = 0x0C, | ||
44 | MAX17042_SOC = 0x0D, | ||
45 | MAX17042_AvSOC = 0x0E, | ||
46 | MAX17042_RemCap = 0x0F, | ||
47 | MAX17402_FullCAP = 0x10, | ||
48 | MAX17042_TTE = 0x11, | ||
49 | MAX17042_V_empty = 0x12, | ||
50 | |||
51 | MAX17042_RSLOW = 0x14, | ||
52 | |||
53 | MAX17042_AvgTA = 0x16, | ||
54 | MAX17042_Cycles = 0x17, | ||
55 | MAX17042_DesignCap = 0x18, | ||
56 | MAX17042_AvgVCELL = 0x19, | ||
57 | MAX17042_MinMaxTemp = 0x1A, | ||
58 | MAX17042_MinMaxVolt = 0x1B, | ||
59 | MAX17042_MinMaxCurr = 0x1C, | ||
60 | MAX17042_CONFIG = 0x1D, | ||
61 | MAX17042_ICHGTerm = 0x1E, | ||
62 | MAX17042_AvCap = 0x1F, | ||
63 | MAX17042_ManName = 0x20, | ||
64 | MAX17042_DevName = 0x21, | ||
65 | MAX17042_DevChem = 0x22, | ||
66 | |||
67 | MAX17042_TempNom = 0x24, | ||
68 | MAX17042_TempCold = 0x25, | ||
69 | MAX17042_TempHot = 0x26, | ||
70 | MAX17042_AIN = 0x27, | ||
71 | MAX17042_LearnCFG = 0x28, | ||
72 | MAX17042_SHFTCFG = 0x29, | ||
73 | MAX17042_RelaxCFG = 0x2A, | ||
74 | MAX17042_MiscCFG = 0x2B, | ||
75 | MAX17042_TGAIN = 0x2C, | ||
76 | MAx17042_TOFF = 0x2D, | ||
77 | MAX17042_CGAIN = 0x2E, | ||
78 | MAX17042_COFF = 0x2F, | ||
79 | |||
80 | MAX17042_Q_empty = 0x33, | ||
81 | MAX17042_T_empty = 0x34, | ||
82 | |||
83 | MAX17042_RCOMP0 = 0x38, | ||
84 | MAX17042_TempCo = 0x39, | ||
85 | MAX17042_Rx = 0x3A, | ||
86 | MAX17042_T_empty0 = 0x3B, | ||
87 | MAX17042_TaskPeriod = 0x3C, | ||
88 | MAX17042_FSTAT = 0x3D, | ||
89 | |||
90 | MAX17042_SHDNTIMER = 0x3F, | ||
91 | |||
92 | MAX17042_VFRemCap = 0x4A, | ||
93 | |||
94 | MAX17042_QH = 0x4D, | ||
95 | MAX17042_QL = 0x4E, | ||
96 | }; | ||
97 | |||
98 | /* | ||
99 | * used for setting a register to a desired value | ||
100 | * addr : address for a register | ||
101 | * data : setting value for the register | ||
102 | */ | ||
103 | struct max17042_reg_data { | ||
104 | u8 addr; | ||
105 | u16 data; | ||
106 | }; | ||
107 | |||
26 | struct max17042_platform_data { | 108 | struct max17042_platform_data { |
109 | struct max17042_reg_data *init_data; | ||
110 | int num_init_data; /* Number of enties in init_data array */ | ||
27 | bool enable_current_sense; | 111 | bool enable_current_sense; |
112 | |||
113 | /* | ||
114 | * R_sns in micro-ohms. | ||
115 | * default 10000 (if r_sns = 0) as it is the recommended value by | ||
116 | * the datasheet although it can be changed by board designers. | ||
117 | */ | ||
118 | unsigned int r_sns; | ||
28 | }; | 119 | }; |
29 | 120 | ||
30 | #endif /* __MAX17042_BATTERY_H_ */ | 121 | #endif /* __MAX17042_BATTERY_H_ */ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 2e681d9555bd..58969b2a8a82 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -27,6 +27,21 @@ | |||
27 | 27 | ||
28 | asmlinkage void preempt_schedule(void); | 28 | asmlinkage void preempt_schedule(void); |
29 | 29 | ||
30 | #define preempt_check_resched() \ | ||
31 | do { \ | ||
32 | if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ | ||
33 | preempt_schedule(); \ | ||
34 | } while (0) | ||
35 | |||
36 | #else /* !CONFIG_PREEMPT */ | ||
37 | |||
38 | #define preempt_check_resched() do { } while (0) | ||
39 | |||
40 | #endif /* CONFIG_PREEMPT */ | ||
41 | |||
42 | |||
43 | #ifdef CONFIG_PREEMPT_COUNT | ||
44 | |||
30 | #define preempt_disable() \ | 45 | #define preempt_disable() \ |
31 | do { \ | 46 | do { \ |
32 | inc_preempt_count(); \ | 47 | inc_preempt_count(); \ |
@@ -39,12 +54,6 @@ do { \ | |||
39 | dec_preempt_count(); \ | 54 | dec_preempt_count(); \ |
40 | } while (0) | 55 | } while (0) |
41 | 56 | ||
42 | #define preempt_check_resched() \ | ||
43 | do { \ | ||
44 | if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ | ||
45 | preempt_schedule(); \ | ||
46 | } while (0) | ||
47 | |||
48 | #define preempt_enable() \ | 57 | #define preempt_enable() \ |
49 | do { \ | 58 | do { \ |
50 | preempt_enable_no_resched(); \ | 59 | preempt_enable_no_resched(); \ |
@@ -80,18 +89,17 @@ do { \ | |||
80 | preempt_check_resched(); \ | 89 | preempt_check_resched(); \ |
81 | } while (0) | 90 | } while (0) |
82 | 91 | ||
83 | #else | 92 | #else /* !CONFIG_PREEMPT_COUNT */ |
84 | 93 | ||
85 | #define preempt_disable() do { } while (0) | 94 | #define preempt_disable() do { } while (0) |
86 | #define preempt_enable_no_resched() do { } while (0) | 95 | #define preempt_enable_no_resched() do { } while (0) |
87 | #define preempt_enable() do { } while (0) | 96 | #define preempt_enable() do { } while (0) |
88 | #define preempt_check_resched() do { } while (0) | ||
89 | 97 | ||
90 | #define preempt_disable_notrace() do { } while (0) | 98 | #define preempt_disable_notrace() do { } while (0) |
91 | #define preempt_enable_no_resched_notrace() do { } while (0) | 99 | #define preempt_enable_no_resched_notrace() do { } while (0) |
92 | #define preempt_enable_notrace() do { } while (0) | 100 | #define preempt_enable_notrace() do { } while (0) |
93 | 101 | ||
94 | #endif | 102 | #endif /* CONFIG_PREEMPT_COUNT */ |
95 | 103 | ||
96 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 104 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
97 | 105 | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e7576cf9e32d..643b96c7a94f 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
6 | #include <linux/spinlock.h> | 6 | #include <linux/spinlock.h> |
7 | #include <linux/magic.h> | 7 | #include <linux/magic.h> |
8 | #include <asm/atomic.h> | 8 | #include <linux/atomic.h> |
9 | 9 | ||
10 | struct net; | 10 | struct net; |
11 | struct completion; | 11 | struct completion; |
@@ -50,8 +50,6 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer, | |||
50 | 50 | ||
51 | struct proc_dir_entry { | 51 | struct proc_dir_entry { |
52 | unsigned int low_ino; | 52 | unsigned int low_ino; |
53 | unsigned int namelen; | ||
54 | const char *name; | ||
55 | mode_t mode; | 53 | mode_t mode; |
56 | nlink_t nlink; | 54 | nlink_t nlink; |
57 | uid_t uid; | 55 | uid_t uid; |
@@ -73,9 +71,11 @@ struct proc_dir_entry { | |||
73 | write_proc_t *write_proc; | 71 | write_proc_t *write_proc; |
74 | atomic_t count; /* use count */ | 72 | atomic_t count; /* use count */ |
75 | int pde_users; /* number of callers into module in progress */ | 73 | int pde_users; /* number of callers into module in progress */ |
76 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | ||
77 | struct completion *pde_unload_completion; | 74 | struct completion *pde_unload_completion; |
78 | struct list_head pde_openers; /* who did ->open, but not ->release */ | 75 | struct list_head pde_openers; /* who did ->open, but not ->release */ |
76 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | ||
77 | u8 namelen; | ||
78 | char name[]; | ||
79 | }; | 79 | }; |
80 | 80 | ||
81 | enum kcore_type { | 81 | enum kcore_type { |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 2455ef2683f0..cc03bbf5c4b8 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -38,9 +38,12 @@ struct pstore_info { | |||
38 | int (*open)(struct pstore_info *psi); | 38 | int (*open)(struct pstore_info *psi); |
39 | int (*close)(struct pstore_info *psi); | 39 | int (*close)(struct pstore_info *psi); |
40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 40 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
41 | struct timespec *time); | 41 | struct timespec *time, struct pstore_info *psi); |
42 | u64 (*write)(enum pstore_type_id type, size_t size); | 42 | u64 (*write)(enum pstore_type_id type, unsigned int part, |
43 | int (*erase)(u64 id); | 43 | size_t size, struct pstore_info *psi); |
44 | int (*erase)(enum pstore_type_id type, u64 id, | ||
45 | struct pstore_info *psi); | ||
46 | void *data; | ||
44 | }; | 47 | }; |
45 | 48 | ||
46 | #ifdef CONFIG_PSTORE | 49 | #ifdef CONFIG_PSTORE |
diff --git a/include/linux/pti.h b/include/linux/pti.h index 81af667bb2d5..b3ea01a3197e 100644 --- a/include/linux/pti.h +++ b/include/linux/pti.h | |||
@@ -36,7 +36,8 @@ struct pti_masterchannel { | |||
36 | 36 | ||
37 | /* the following functions are defined in misc/pti.c */ | 37 | /* the following functions are defined in misc/pti.c */ |
38 | void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count); | 38 | void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count); |
39 | struct pti_masterchannel *pti_request_masterchannel(u8 type); | 39 | struct pti_masterchannel *pti_request_masterchannel(u8 type, |
40 | const char *thread_name); | ||
40 | void pti_release_masterchannel(struct pti_masterchannel *mc); | 41 | void pti_release_masterchannel(struct pti_masterchannel *mc); |
41 | 42 | ||
42 | #endif /*PTI_H_*/ | 43 | #endif /*PTI_H_*/ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 9178d5cc0b01..800f113bea66 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -47,6 +47,13 @@ | |||
47 | #define PTRACE_GETREGSET 0x4204 | 47 | #define PTRACE_GETREGSET 0x4204 |
48 | #define PTRACE_SETREGSET 0x4205 | 48 | #define PTRACE_SETREGSET 0x4205 |
49 | 49 | ||
50 | #define PTRACE_SEIZE 0x4206 | ||
51 | #define PTRACE_INTERRUPT 0x4207 | ||
52 | #define PTRACE_LISTEN 0x4208 | ||
53 | |||
54 | /* flags in @data for PTRACE_SEIZE */ | ||
55 | #define PTRACE_SEIZE_DEVEL 0x80000000 /* temp flag for development */ | ||
56 | |||
50 | /* options set using PTRACE_SETOPTIONS */ | 57 | /* options set using PTRACE_SETOPTIONS */ |
51 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | 58 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
52 | #define PTRACE_O_TRACEFORK 0x00000002 | 59 | #define PTRACE_O_TRACEFORK 0x00000002 |
@@ -65,6 +72,7 @@ | |||
65 | #define PTRACE_EVENT_EXEC 4 | 72 | #define PTRACE_EVENT_EXEC 4 |
66 | #define PTRACE_EVENT_VFORK_DONE 5 | 73 | #define PTRACE_EVENT_VFORK_DONE 5 |
67 | #define PTRACE_EVENT_EXIT 6 | 74 | #define PTRACE_EVENT_EXIT 6 |
75 | #define PTRACE_EVENT_STOP 7 | ||
68 | 76 | ||
69 | #include <asm/ptrace.h> | 77 | #include <asm/ptrace.h> |
70 | 78 | ||
@@ -77,16 +85,22 @@ | |||
77 | * flags. When the a task is stopped the ptracer owns task->ptrace. | 85 | * flags. When the a task is stopped the ptracer owns task->ptrace. |
78 | */ | 86 | */ |
79 | 87 | ||
88 | #define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */ | ||
80 | #define PT_PTRACED 0x00000001 | 89 | #define PT_PTRACED 0x00000001 |
81 | #define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ | 90 | #define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ |
82 | #define PT_TRACESYSGOOD 0x00000004 | 91 | #define PT_TRACESYSGOOD 0x00000004 |
83 | #define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */ | 92 | #define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */ |
84 | #define PT_TRACE_FORK 0x00000010 | 93 | |
85 | #define PT_TRACE_VFORK 0x00000020 | 94 | /* PT_TRACE_* event enable flags */ |
86 | #define PT_TRACE_CLONE 0x00000040 | 95 | #define PT_EVENT_FLAG_SHIFT 4 |
87 | #define PT_TRACE_EXEC 0x00000080 | 96 | #define PT_EVENT_FLAG(event) (1 << (PT_EVENT_FLAG_SHIFT + (event) - 1)) |
88 | #define PT_TRACE_VFORK_DONE 0x00000100 | 97 | |
89 | #define PT_TRACE_EXIT 0x00000200 | 98 | #define PT_TRACE_FORK PT_EVENT_FLAG(PTRACE_EVENT_FORK) |
99 | #define PT_TRACE_VFORK PT_EVENT_FLAG(PTRACE_EVENT_VFORK) | ||
100 | #define PT_TRACE_CLONE PT_EVENT_FLAG(PTRACE_EVENT_CLONE) | ||
101 | #define PT_TRACE_EXEC PT_EVENT_FLAG(PTRACE_EVENT_EXEC) | ||
102 | #define PT_TRACE_VFORK_DONE PT_EVENT_FLAG(PTRACE_EVENT_VFORK_DONE) | ||
103 | #define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT) | ||
90 | 104 | ||
91 | #define PT_TRACE_MASK 0x000003f4 | 105 | #define PT_TRACE_MASK 0x000003f4 |
92 | 106 | ||
@@ -105,7 +119,7 @@ extern long arch_ptrace(struct task_struct *child, long request, | |||
105 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 119 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
106 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 120 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
107 | extern void ptrace_disable(struct task_struct *); | 121 | extern void ptrace_disable(struct task_struct *); |
108 | extern int ptrace_check_attach(struct task_struct *task, int kill); | 122 | extern int ptrace_check_attach(struct task_struct *task, bool ignore_state); |
109 | extern int ptrace_request(struct task_struct *child, long request, | 123 | extern int ptrace_request(struct task_struct *child, long request, |
110 | unsigned long addr, unsigned long data); | 124 | unsigned long addr, unsigned long data); |
111 | extern void ptrace_notify(int exit_code); | 125 | extern void ptrace_notify(int exit_code); |
@@ -122,7 +136,7 @@ extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); | |||
122 | 136 | ||
123 | static inline int ptrace_reparented(struct task_struct *child) | 137 | static inline int ptrace_reparented(struct task_struct *child) |
124 | { | 138 | { |
125 | return child->real_parent != child->parent; | 139 | return !same_thread_group(child->real_parent, child->parent); |
126 | } | 140 | } |
127 | 141 | ||
128 | static inline void ptrace_unlink(struct task_struct *child) | 142 | static inline void ptrace_unlink(struct task_struct *child) |
@@ -137,36 +151,56 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, | |||
137 | unsigned long data); | 151 | unsigned long data); |
138 | 152 | ||
139 | /** | 153 | /** |
140 | * task_ptrace - return %PT_* flags that apply to a task | 154 | * ptrace_parent - return the task that is tracing the given task |
141 | * @task: pointer to &task_struct in question | 155 | * @task: task to consider |
142 | * | 156 | * |
143 | * Returns the %PT_* flags that apply to @task. | 157 | * Returns %NULL if no one is tracing @task, or the &struct task_struct |
158 | * pointer to its tracer. | ||
159 | * | ||
160 | * Must called under rcu_read_lock(). The pointer returned might be kept | ||
161 | * live only by RCU. During exec, this may be called with task_lock() held | ||
162 | * on @task, still held from when check_unsafe_exec() was called. | ||
144 | */ | 163 | */ |
145 | static inline int task_ptrace(struct task_struct *task) | 164 | static inline struct task_struct *ptrace_parent(struct task_struct *task) |
146 | { | 165 | { |
147 | return task->ptrace; | 166 | if (unlikely(task->ptrace)) |
167 | return rcu_dereference(task->parent); | ||
168 | return NULL; | ||
169 | } | ||
170 | |||
171 | /** | ||
172 | * ptrace_event_enabled - test whether a ptrace event is enabled | ||
173 | * @task: ptracee of interest | ||
174 | * @event: %PTRACE_EVENT_* to test | ||
175 | * | ||
176 | * Test whether @event is enabled for ptracee @task. | ||
177 | * | ||
178 | * Returns %true if @event is enabled, %false otherwise. | ||
179 | */ | ||
180 | static inline bool ptrace_event_enabled(struct task_struct *task, int event) | ||
181 | { | ||
182 | return task->ptrace & PT_EVENT_FLAG(event); | ||
148 | } | 183 | } |
149 | 184 | ||
150 | /** | 185 | /** |
151 | * ptrace_event - possibly stop for a ptrace event notification | 186 | * ptrace_event - possibly stop for a ptrace event notification |
152 | * @mask: %PT_* bit to check in @current->ptrace | 187 | * @event: %PTRACE_EVENT_* value to report |
153 | * @event: %PTRACE_EVENT_* value to report if @mask is set | ||
154 | * @message: value for %PTRACE_GETEVENTMSG to return | 188 | * @message: value for %PTRACE_GETEVENTMSG to return |
155 | * | 189 | * |
156 | * This checks the @mask bit to see if ptrace wants stops for this event. | 190 | * Check whether @event is enabled and, if so, report @event and @message |
157 | * If so we stop, reporting @event and @message to the ptrace parent. | 191 | * to the ptrace parent. |
158 | * | ||
159 | * Returns nonzero if we did a ptrace notification, zero if not. | ||
160 | * | 192 | * |
161 | * Called without locks. | 193 | * Called without locks. |
162 | */ | 194 | */ |
163 | static inline int ptrace_event(int mask, int event, unsigned long message) | 195 | static inline void ptrace_event(int event, unsigned long message) |
164 | { | 196 | { |
165 | if (mask && likely(!(current->ptrace & mask))) | 197 | if (unlikely(ptrace_event_enabled(current, event))) { |
166 | return 0; | 198 | current->ptrace_message = message; |
167 | current->ptrace_message = message; | 199 | ptrace_notify((event << 8) | SIGTRAP); |
168 | ptrace_notify((event << 8) | SIGTRAP); | 200 | } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) { |
169 | return 1; | 201 | /* legacy EXEC report via SIGTRAP */ |
202 | send_sig(SIGTRAP, current, 0); | ||
203 | } | ||
170 | } | 204 | } |
171 | 205 | ||
172 | /** | 206 | /** |
@@ -183,16 +217,24 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
183 | { | 217 | { |
184 | INIT_LIST_HEAD(&child->ptrace_entry); | 218 | INIT_LIST_HEAD(&child->ptrace_entry); |
185 | INIT_LIST_HEAD(&child->ptraced); | 219 | INIT_LIST_HEAD(&child->ptraced); |
186 | child->parent = child->real_parent; | 220 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
221 | atomic_set(&child->ptrace_bp_refcnt, 1); | ||
222 | #endif | ||
223 | child->jobctl = 0; | ||
187 | child->ptrace = 0; | 224 | child->ptrace = 0; |
188 | if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { | 225 | child->parent = child->real_parent; |
226 | |||
227 | if (unlikely(ptrace) && current->ptrace) { | ||
189 | child->ptrace = current->ptrace; | 228 | child->ptrace = current->ptrace; |
190 | __ptrace_link(child, current->parent); | 229 | __ptrace_link(child, current->parent); |
191 | } | ||
192 | 230 | ||
193 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 231 | if (child->ptrace & PT_SEIZED) |
194 | atomic_set(&child->ptrace_bp_refcnt, 1); | 232 | task_set_jobctl_pending(child, JOBCTL_TRAP_STOP); |
195 | #endif | 233 | else |
234 | sigaddset(&child->pending.signal, SIGSTOP); | ||
235 | |||
236 | set_tsk_thread_flag(child, TIF_SIGPENDING); | ||
237 | } | ||
196 | } | 238 | } |
197 | 239 | ||
198 | /** | 240 | /** |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 9a85412e0db6..cb7855699037 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -180,7 +180,7 @@ enum { | |||
180 | #include <linux/dqblk_v1.h> | 180 | #include <linux/dqblk_v1.h> |
181 | #include <linux/dqblk_v2.h> | 181 | #include <linux/dqblk_v2.h> |
182 | 182 | ||
183 | #include <asm/atomic.h> | 183 | #include <linux/atomic.h> |
184 | 184 | ||
185 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 185 | 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 */ | 186 | typedef long long qsize_t; /* Type in which we store sizes */ |
@@ -415,13 +415,5 @@ struct quota_module_name { | |||
415 | {QFMT_VFS_V0, "quota_v2"},\ | 415 | {QFMT_VFS_V0, "quota_v2"},\ |
416 | {0, NULL}} | 416 | {0, NULL}} |
417 | 417 | ||
418 | #else | ||
419 | |||
420 | # /* nodep */ include <sys/cdefs.h> | ||
421 | |||
422 | __BEGIN_DECLS | ||
423 | long quotactl __P ((unsigned int, const char *, int, caddr_t)); | ||
424 | __END_DECLS | ||
425 | |||
426 | #endif /* __KERNEL__ */ | 418 | #endif /* __KERNEL__ */ |
427 | #endif /* _QUOTA_ */ | 419 | #endif /* _QUOTA_ */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 23241c2fecce..9d4539c52e53 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -39,7 +39,15 @@ | |||
39 | * when it is shrunk, before we rcu free the node. See shrink code for | 39 | * when it is shrunk, before we rcu free the node. See shrink code for |
40 | * details. | 40 | * details. |
41 | */ | 41 | */ |
42 | #define RADIX_TREE_INDIRECT_PTR 1 | 42 | #define RADIX_TREE_INDIRECT_PTR 1 |
43 | /* | ||
44 | * A common use of the radix tree is to store pointers to struct pages; | ||
45 | * but shmem/tmpfs needs also to store swap entries in the same tree: | ||
46 | * those are marked as exceptional entries to distinguish them. | ||
47 | * EXCEPTIONAL_ENTRY tests the bit, EXCEPTIONAL_SHIFT shifts content past it. | ||
48 | */ | ||
49 | #define RADIX_TREE_EXCEPTIONAL_ENTRY 2 | ||
50 | #define RADIX_TREE_EXCEPTIONAL_SHIFT 2 | ||
43 | 51 | ||
44 | #define radix_tree_indirect_to_ptr(ptr) \ | 52 | #define radix_tree_indirect_to_ptr(ptr) \ |
45 | radix_tree_indirect_to_ptr((void __force *)(ptr)) | 53 | radix_tree_indirect_to_ptr((void __force *)(ptr)) |
@@ -174,6 +182,28 @@ static inline int radix_tree_deref_retry(void *arg) | |||
174 | } | 182 | } |
175 | 183 | ||
176 | /** | 184 | /** |
185 | * radix_tree_exceptional_entry - radix_tree_deref_slot gave exceptional entry? | ||
186 | * @arg: value returned by radix_tree_deref_slot | ||
187 | * Returns: 0 if well-aligned pointer, non-0 if exceptional entry. | ||
188 | */ | ||
189 | static inline int radix_tree_exceptional_entry(void *arg) | ||
190 | { | ||
191 | /* Not unlikely because radix_tree_exception often tested first */ | ||
192 | return (unsigned long)arg & RADIX_TREE_EXCEPTIONAL_ENTRY; | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * radix_tree_exception - radix_tree_deref_slot returned either exception? | ||
197 | * @arg: value returned by radix_tree_deref_slot | ||
198 | * Returns: 0 if well-aligned pointer, non-0 if either kind of exception. | ||
199 | */ | ||
200 | static inline int radix_tree_exception(void *arg) | ||
201 | { | ||
202 | return unlikely((unsigned long)arg & | ||
203 | (RADIX_TREE_INDIRECT_PTR | RADIX_TREE_EXCEPTIONAL_ENTRY)); | ||
204 | } | ||
205 | |||
206 | /** | ||
177 | * radix_tree_replace_slot - replace item in a slot | 207 | * radix_tree_replace_slot - replace item in a slot |
178 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot | 208 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot |
179 | * @item: new item to store in the slot. | 209 | * @item: new item to store in the slot. |
@@ -194,8 +224,8 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
194 | unsigned int | 224 | unsigned int |
195 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 225 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
196 | unsigned long first_index, unsigned int max_items); | 226 | unsigned long first_index, unsigned int max_items); |
197 | unsigned int | 227 | unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root, |
198 | radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, | 228 | void ***results, unsigned long *indices, |
199 | unsigned long first_index, unsigned int max_items); | 229 | unsigned long first_index, unsigned int max_items); |
200 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, | 230 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, |
201 | unsigned long index, unsigned long max_scan); | 231 | unsigned long index, unsigned long max_scan); |
@@ -222,6 +252,7 @@ unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root, | |||
222 | unsigned long nr_to_tag, | 252 | unsigned long nr_to_tag, |
223 | unsigned int fromtag, unsigned int totag); | 253 | unsigned int fromtag, unsigned int totag); |
224 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | 254 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); |
255 | unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item); | ||
225 | 256 | ||
226 | static inline void radix_tree_preload_end(void) | 257 | static inline void radix_tree_preload_end(void) |
227 | { | 258 | { |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 75cbf4f62fe8..9e65d9e20662 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -245,10 +245,16 @@ struct mdp_superblock_1 { | |||
245 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ | 245 | __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ |
246 | __u8 devflags; /* per-device flags. Only one defined...*/ | 246 | __u8 devflags; /* per-device flags. Only one defined...*/ |
247 | #define WriteMostly1 1 /* mask for writemostly flag in above */ | 247 | #define WriteMostly1 1 /* mask for writemostly flag in above */ |
248 | __u8 pad2[64-57]; /* set to 0 when writing */ | 248 | /* Bad block log. If there are any bad blocks the feature flag is set. |
249 | * If offset and size are non-zero, that space is reserved and available | ||
250 | */ | ||
251 | __u8 bblog_shift; /* shift from sectors to block size */ | ||
252 | __le16 bblog_size; /* number of sectors reserved for list */ | ||
253 | __le32 bblog_offset; /* sector offset from superblock to bblog, | ||
254 | * signed - not unsigned */ | ||
249 | 255 | ||
250 | /* array state information - 64 bytes */ | 256 | /* array state information - 64 bytes */ |
251 | __le64 utime; /* 40 bits second, 24 btes microseconds */ | 257 | __le64 utime; /* 40 bits second, 24 bits microseconds */ |
252 | __le64 events; /* incremented when superblock updated */ | 258 | __le64 events; /* incremented when superblock updated */ |
253 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ | 259 | __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ |
254 | __le32 sb_csum; /* checksum up to devs[max_dev] */ | 260 | __le32 sb_csum; /* checksum up to devs[max_dev] */ |
@@ -270,8 +276,8 @@ struct mdp_superblock_1 { | |||
270 | * must be honoured | 276 | * must be honoured |
271 | */ | 277 | */ |
272 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | 278 | #define MD_FEATURE_RESHAPE_ACTIVE 4 |
279 | #define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */ | ||
273 | 280 | ||
274 | #define MD_FEATURE_ALL (1|2|4) | 281 | #define MD_FEATURE_ALL (1|2|4|8) |
275 | 282 | ||
276 | #endif | 283 | #endif |
277 | |||
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h index 0ae68a2c1212..484fef81cd3a 100644 --- a/include/linux/ramoops.h +++ b/include/linux/ramoops.h | |||
@@ -10,6 +10,8 @@ | |||
10 | struct ramoops_platform_data { | 10 | struct ramoops_platform_data { |
11 | unsigned long mem_size; | 11 | unsigned long mem_size; |
12 | unsigned long mem_address; | 12 | unsigned long mem_address; |
13 | unsigned long record_size; | ||
14 | int dump_oops; | ||
13 | }; | 15 | }; |
14 | 16 | ||
15 | #endif | 17 | #endif |
diff --git a/include/linux/random.h b/include/linux/random.h index fb7ab9de5f36..d13059f3ea32 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -57,17 +57,6 @@ extern void add_interrupt_randomness(int irq); | |||
57 | extern void get_random_bytes(void *buf, int nbytes); | 57 | extern void get_random_bytes(void *buf, int nbytes); |
58 | void generate_random_uuid(unsigned char uuid_out[16]); | 58 | void generate_random_uuid(unsigned char uuid_out[16]); |
59 | 59 | ||
60 | extern __u32 secure_ip_id(__be32 daddr); | ||
61 | extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); | ||
62 | extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, | ||
63 | __be16 dport); | ||
64 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | ||
65 | __be16 sport, __be16 dport); | ||
66 | extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, | ||
67 | __be16 sport, __be16 dport); | ||
68 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, | ||
69 | __be16 sport, __be16 dport); | ||
70 | |||
71 | #ifndef MODULE | 60 | #ifndef MODULE |
72 | extern const struct file_operations random_fops, urandom_fops; | 61 | extern const struct file_operations random_fops, urandom_fops; |
73 | #endif | 62 | #endif |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index e3beb315517a..d079290843a9 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
183 | struct list_head *last = list->prev; | 183 | struct list_head *last = list->prev; |
184 | struct list_head *at = head->next; | 184 | struct list_head *at = head->next; |
185 | 185 | ||
186 | if (list_empty(head)) | 186 | if (list_empty(list)) |
187 | return; | 187 | return; |
188 | 188 | ||
189 | /* "first" and "last" tracking list, so initialize it. */ | 189 | /* "first" and "last" tracking list, so initialize it. */ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 99f9aa7c2804..8f4f881a0ad8 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -239,7 +239,7 @@ extern int rcu_read_lock_bh_held(void); | |||
239 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot | 239 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot |
240 | * and while lockdep is disabled. | 240 | * and while lockdep is disabled. |
241 | */ | 241 | */ |
242 | #ifdef CONFIG_PREEMPT | 242 | #ifdef CONFIG_PREEMPT_COUNT |
243 | static inline int rcu_read_lock_sched_held(void) | 243 | static inline int rcu_read_lock_sched_held(void) |
244 | { | 244 | { |
245 | int lockdep_opinion = 0; | 245 | int lockdep_opinion = 0; |
@@ -250,12 +250,12 @@ static inline int rcu_read_lock_sched_held(void) | |||
250 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); | 250 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); |
251 | return lockdep_opinion || preempt_count() != 0 || irqs_disabled(); | 251 | return lockdep_opinion || preempt_count() != 0 || irqs_disabled(); |
252 | } | 252 | } |
253 | #else /* #ifdef CONFIG_PREEMPT */ | 253 | #else /* #ifdef CONFIG_PREEMPT_COUNT */ |
254 | static inline int rcu_read_lock_sched_held(void) | 254 | static inline int rcu_read_lock_sched_held(void) |
255 | { | 255 | { |
256 | return 1; | 256 | return 1; |
257 | } | 257 | } |
258 | #endif /* #else #ifdef CONFIG_PREEMPT */ | 258 | #endif /* #else #ifdef CONFIG_PREEMPT_COUNT */ |
259 | 259 | ||
260 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 260 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
261 | 261 | ||
@@ -276,17 +276,17 @@ static inline int rcu_read_lock_bh_held(void) | |||
276 | return 1; | 276 | return 1; |
277 | } | 277 | } |
278 | 278 | ||
279 | #ifdef CONFIG_PREEMPT | 279 | #ifdef CONFIG_PREEMPT_COUNT |
280 | static inline int rcu_read_lock_sched_held(void) | 280 | static inline int rcu_read_lock_sched_held(void) |
281 | { | 281 | { |
282 | return preempt_count() != 0 || irqs_disabled(); | 282 | return preempt_count() != 0 || irqs_disabled(); |
283 | } | 283 | } |
284 | #else /* #ifdef CONFIG_PREEMPT */ | 284 | #else /* #ifdef CONFIG_PREEMPT_COUNT */ |
285 | static inline int rcu_read_lock_sched_held(void) | 285 | static inline int rcu_read_lock_sched_held(void) |
286 | { | 286 | { |
287 | return 1; | 287 | return 1; |
288 | } | 288 | } |
289 | #endif /* #else #ifdef CONFIG_PREEMPT */ | 289 | #endif /* #else #ifdef CONFIG_PREEMPT_COUNT */ |
290 | 290 | ||
291 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 291 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
292 | 292 | ||
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 3005d5a7fce5..e0879a70e830 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -39,6 +39,11 @@ | |||
39 | 39 | ||
40 | #include <linux/notifier.h> | 40 | #include <linux/notifier.h> |
41 | 41 | ||
42 | #define SYS_DOWN 0x0001 /* Notify of system down */ | ||
43 | #define SYS_RESTART SYS_DOWN | ||
44 | #define SYS_HALT 0x0002 /* Notify of system halt */ | ||
45 | #define SYS_POWER_OFF 0x0003 /* Notify of system power off */ | ||
46 | |||
42 | extern int register_reboot_notifier(struct notifier_block *); | 47 | extern int register_reboot_notifier(struct notifier_block *); |
43 | extern int unregister_reboot_notifier(struct notifier_block *); | 48 | extern int unregister_reboot_notifier(struct notifier_block *); |
44 | 49 | ||
diff --git a/include/linux/regmap.h b/include/linux/regmap.h new file mode 100644 index 000000000000..60a65cd7e1a0 --- /dev/null +++ b/include/linux/regmap.h | |||
@@ -0,0 +1,82 @@ | |||
1 | #ifndef __LINUX_REGMAP_H | ||
2 | #define __LINUX_REGMAP_H | ||
3 | |||
4 | /* | ||
5 | * Register map access API | ||
6 | * | ||
7 | * Copyright 2011 Wolfson Microelectronics plc | ||
8 | * | ||
9 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
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 | #include <linux/device.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/module.h> | ||
19 | |||
20 | struct i2c_client; | ||
21 | struct spi_device; | ||
22 | |||
23 | struct regmap_config { | ||
24 | int reg_bits; | ||
25 | int val_bits; | ||
26 | }; | ||
27 | |||
28 | typedef int (*regmap_hw_write)(struct device *dev, const void *data, | ||
29 | size_t count); | ||
30 | typedef int (*regmap_hw_gather_write)(struct device *dev, | ||
31 | const void *reg, size_t reg_len, | ||
32 | const void *val, size_t val_len); | ||
33 | typedef int (*regmap_hw_read)(struct device *dev, | ||
34 | const void *reg_buf, size_t reg_size, | ||
35 | void *val_buf, size_t val_size); | ||
36 | |||
37 | /** | ||
38 | * Description of a hardware bus for the register map infrastructure. | ||
39 | * | ||
40 | * @list: Internal use. | ||
41 | * @type: Bus type, used to identify bus to be used for a device. | ||
42 | * @write: Write operation. | ||
43 | * @gather_write: Write operation with split register/value, return -ENOTSUPP | ||
44 | * if not implemented on a given device. | ||
45 | * @read: Read operation. Data is returned in the buffer used to transmit | ||
46 | * data. | ||
47 | * @owner: Module with the bus implementation, used to pin the implementation | ||
48 | * in memory. | ||
49 | * @read_flag_mask: Mask to be set in the top byte of the register when doing | ||
50 | * a read. | ||
51 | */ | ||
52 | struct regmap_bus { | ||
53 | struct list_head list; | ||
54 | struct bus_type *type; | ||
55 | regmap_hw_write write; | ||
56 | regmap_hw_gather_write gather_write; | ||
57 | regmap_hw_read read; | ||
58 | struct module *owner; | ||
59 | u8 read_flag_mask; | ||
60 | }; | ||
61 | |||
62 | struct regmap *regmap_init(struct device *dev, | ||
63 | const struct regmap_bus *bus, | ||
64 | const struct regmap_config *config); | ||
65 | struct regmap *regmap_init_i2c(struct i2c_client *i2c, | ||
66 | const struct regmap_config *config); | ||
67 | struct regmap *regmap_init_spi(struct spi_device *dev, | ||
68 | const struct regmap_config *config); | ||
69 | |||
70 | void regmap_exit(struct regmap *map); | ||
71 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | ||
72 | int regmap_raw_write(struct regmap *map, unsigned int reg, | ||
73 | const void *val, size_t val_len); | ||
74 | int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); | ||
75 | int regmap_raw_read(struct regmap *map, unsigned int reg, | ||
76 | void *val, size_t val_len); | ||
77 | int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, | ||
78 | size_t val_count); | ||
79 | int regmap_update_bits(struct regmap *map, unsigned int reg, | ||
80 | unsigned int mask, unsigned int val); | ||
81 | |||
82 | #endif | ||
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 9e87c1cb7270..26f6ea4444e3 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -122,6 +122,9 @@ struct regulator; | |||
122 | struct regulator_bulk_data { | 122 | struct regulator_bulk_data { |
123 | const char *supply; | 123 | const char *supply; |
124 | struct regulator *consumer; | 124 | struct regulator *consumer; |
125 | |||
126 | /* Internal use */ | ||
127 | int ret; | ||
125 | }; | 128 | }; |
126 | 129 | ||
127 | #if defined(CONFIG_REGULATOR) | 130 | #if defined(CONFIG_REGULATOR) |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 6c433b89c80d..1a80bc77517d 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -188,18 +188,16 @@ struct regulator_dev { | |||
188 | 188 | ||
189 | /* lists we belong to */ | 189 | /* lists we belong to */ |
190 | struct list_head list; /* list of all regulators */ | 190 | struct list_head list; /* list of all regulators */ |
191 | struct list_head slist; /* list of supplied regulators */ | ||
192 | 191 | ||
193 | /* lists we own */ | 192 | /* lists we own */ |
194 | struct list_head consumer_list; /* consumers we supply */ | 193 | struct list_head consumer_list; /* consumers we supply */ |
195 | struct list_head supply_list; /* regulators we supply */ | ||
196 | 194 | ||
197 | struct blocking_notifier_head notifier; | 195 | struct blocking_notifier_head notifier; |
198 | struct mutex mutex; /* consumer lock */ | 196 | struct mutex mutex; /* consumer lock */ |
199 | struct module *owner; | 197 | struct module *owner; |
200 | struct device dev; | 198 | struct device dev; |
201 | struct regulation_constraints *constraints; | 199 | struct regulation_constraints *constraints; |
202 | struct regulator_dev *supply; /* for tree */ | 200 | struct regulator *supply; /* for tree */ |
203 | 201 | ||
204 | void *reg_data; /* regulator_dev data */ | 202 | void *reg_data; /* regulator_dev data */ |
205 | 203 | ||
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 3fd8c4506bbb..f096b80e73d8 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
@@ -59,11 +59,7 @@ extern const struct xattr_handler reiserfs_posix_acl_access_handler; | |||
59 | #else | 59 | #else |
60 | 60 | ||
61 | #define reiserfs_cache_default_acl(inode) 0 | 61 | #define reiserfs_cache_default_acl(inode) 0 |
62 | 62 | #define reiserfs_get_acl NULL | |
63 | static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) | ||
64 | { | ||
65 | return NULL; | ||
66 | } | ||
67 | 63 | ||
68 | static inline int reiserfs_acl_chmod(struct inode *inode) | 64 | static inline int reiserfs_acl_chmod(struct inode *inode) |
69 | { | 65 | { |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index eca75df00fed..96d465f8d3e6 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -2332,7 +2332,9 @@ __u32 keyed_hash(const signed char *msg, int len); | |||
2332 | __u32 yura_hash(const signed char *msg, int len); | 2332 | __u32 yura_hash(const signed char *msg, int len); |
2333 | __u32 r5_hash(const signed char *msg, int len); | 2333 | __u32 r5_hash(const signed char *msg, int len); |
2334 | 2334 | ||
2335 | #define reiserfs_set_le_bit __set_bit_le | ||
2335 | #define reiserfs_test_and_set_le_bit __test_and_set_bit_le | 2336 | #define reiserfs_test_and_set_le_bit __test_and_set_bit_le |
2337 | #define reiserfs_clear_le_bit __clear_bit_le | ||
2336 | #define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le | 2338 | #define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le |
2337 | #define reiserfs_test_le_bit test_bit_le | 2339 | #define reiserfs_test_le_bit test_bit_le |
2338 | #define reiserfs_find_next_zero_le_bit find_next_zero_bit_le | 2340 | #define reiserfs_find_next_zero_le_bit find_next_zero_bit_le |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 6deef5dc95fb..c2b71473266e 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -41,7 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags); | |||
41 | int reiserfs_lookup_privroot(struct super_block *sb); | 41 | int reiserfs_lookup_privroot(struct super_block *sb); |
42 | int reiserfs_delete_xattrs(struct inode *inode); | 42 | int reiserfs_delete_xattrs(struct inode *inode); |
43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); | 43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
44 | int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); | 44 | int reiserfs_permission(struct inode *inode, int mask); |
45 | 45 | ||
46 | #ifdef CONFIG_REISERFS_FS_XATTR | 46 | #ifdef CONFIG_REISERFS_FS_XATTR |
47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) | 47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index ab38ac80b0f9..b891de96000f 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -169,7 +169,7 @@ void ring_buffer_set_clock(struct ring_buffer *buffer, | |||
169 | size_t ring_buffer_page_len(void *page); | 169 | size_t ring_buffer_page_len(void *page); |
170 | 170 | ||
171 | 171 | ||
172 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); | 172 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer, int cpu); |
173 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | 173 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); |
174 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, | 174 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, |
175 | size_t len, int cpu, int full); | 175 | size_t len, int cpu, int full); |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 8d522ffeda33..de17134244f3 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
@@ -66,7 +66,7 @@ struct hrtimer_sleeper; | |||
66 | 66 | ||
67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
69 | , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ | 69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ |
70 | , .owner = NULL \ | 70 | , .owner = NULL \ |
71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
72 | 72 | ||
@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock); | |||
100 | 100 | ||
101 | #ifdef CONFIG_RT_MUTEXES | 101 | #ifdef CONFIG_RT_MUTEXES |
102 | # define INIT_RT_MUTEXES(tsk) \ | 102 | # define INIT_RT_MUTEXES(tsk) \ |
103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ | 103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ |
104 | INIT_RT_MUTEX_DEBUG(tsk) | 104 | INIT_RT_MUTEX_DEBUG(tsk) |
105 | #else | 105 | #else |
106 | # define INIT_RT_MUTEXES(tsk) | 106 | # define INIT_RT_MUTEXES(tsk) |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index bbad657a3725..8e872ead88b5 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -585,6 +585,8 @@ enum rtnetlink_groups { | |||
585 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR | 585 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR |
586 | RTNLGRP_PHONET_ROUTE, | 586 | RTNLGRP_PHONET_ROUTE, |
587 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | 587 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
588 | RTNLGRP_DCB, | ||
589 | #define RTNLGRP_DCB RTNLGRP_DCB | ||
588 | __RTNLGRP_MAX | 590 | __RTNLGRP_MAX |
589 | }; | 591 | }; |
590 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 592 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
@@ -758,8 +760,7 @@ extern int lockdep_rtnl_is_held(void); | |||
758 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() | 760 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() |
759 | */ | 761 | */ |
760 | #define rcu_dereference_rtnl(p) \ | 762 | #define rcu_dereference_rtnl(p) \ |
761 | rcu_dereference_check(p, rcu_read_lock_held() || \ | 763 | rcu_dereference_check(p, lockdep_rtnl_is_held()) |
762 | lockdep_rtnl_is_held()) | ||
763 | 764 | ||
764 | /** | 765 | /** |
765 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL | 766 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index a8afe9cd000c..6a6741440cb7 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | 16 | ||
17 | #include <asm/system.h> | 17 | #include <asm/system.h> |
18 | #include <asm/atomic.h> | 18 | #include <linux/atomic.h> |
19 | 19 | ||
20 | struct rw_semaphore; | 20 | struct rw_semaphore; |
21 | 21 | ||
@@ -124,19 +124,9 @@ extern void downgrade_write(struct rw_semaphore *sem); | |||
124 | */ | 124 | */ |
125 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); | 125 | extern void down_read_nested(struct rw_semaphore *sem, int subclass); |
126 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); | 126 | extern void down_write_nested(struct rw_semaphore *sem, int subclass); |
127 | /* | ||
128 | * Take/release a lock when not the owner will release it. | ||
129 | * | ||
130 | * [ This API should be avoided as much as possible - the | ||
131 | * proper abstraction for this case is completions. ] | ||
132 | */ | ||
133 | extern void down_read_non_owner(struct rw_semaphore *sem); | ||
134 | extern void up_read_non_owner(struct rw_semaphore *sem); | ||
135 | #else | 127 | #else |
136 | # define down_read_nested(sem, subclass) down_read(sem) | 128 | # define down_read_nested(sem, subclass) down_read(sem) |
137 | # define down_write_nested(sem, subclass) down_write(sem) | 129 | # define down_write_nested(sem, subclass) down_write(sem) |
138 | # define down_read_non_owner(sem) down_read(sem) | ||
139 | # define up_read_non_owner(sem) up_read(sem) | ||
140 | #endif | 130 | #endif |
141 | 131 | ||
142 | #endif /* _LINUX_RWSEM_H */ | 132 | #endif /* _LINUX_RWSEM_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 14a6c7b545de..4ac2c0578e0f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1292,7 +1292,7 @@ struct task_struct { | |||
1292 | int exit_state; | 1292 | int exit_state; |
1293 | int exit_code, exit_signal; | 1293 | int exit_code, exit_signal; |
1294 | int pdeath_signal; /* The signal sent when the parent dies */ | 1294 | int pdeath_signal; /* The signal sent when the parent dies */ |
1295 | unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ | 1295 | unsigned int jobctl; /* JOBCTL_*, siglock protected */ |
1296 | /* ??? */ | 1296 | /* ??? */ |
1297 | unsigned int personality; | 1297 | unsigned int personality; |
1298 | unsigned did_exec:1; | 1298 | unsigned did_exec:1; |
@@ -1512,7 +1512,6 @@ struct task_struct { | |||
1512 | short il_next; | 1512 | short il_next; |
1513 | short pref_node_fork; | 1513 | short pref_node_fork; |
1514 | #endif | 1514 | #endif |
1515 | atomic_t fs_excl; /* holding fs exclusive resources */ | ||
1516 | struct rcu_head rcu; | 1515 | struct rcu_head rcu; |
1517 | 1516 | ||
1518 | /* | 1517 | /* |
@@ -1768,6 +1767,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1768 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1767 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
1769 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1768 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
1770 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1769 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
1770 | #define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */ | ||
1771 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1771 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
1772 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ | 1772 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ |
1773 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1773 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
@@ -1813,15 +1813,34 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1813 | #define used_math() tsk_used_math(current) | 1813 | #define used_math() tsk_used_math(current) |
1814 | 1814 | ||
1815 | /* | 1815 | /* |
1816 | * task->group_stop flags | 1816 | * task->jobctl flags |
1817 | */ | 1817 | */ |
1818 | #define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ | 1818 | #define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */ |
1819 | #define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ | 1819 | |
1820 | #define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ | 1820 | #define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */ |
1821 | #define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ | 1821 | #define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */ |
1822 | #define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ | 1822 | #define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */ |
1823 | 1823 | #define JOBCTL_TRAP_STOP_BIT 19 /* trap for STOP */ | |
1824 | extern void task_clear_group_stop_pending(struct task_struct *task); | 1824 | #define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */ |
1825 | #define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */ | ||
1826 | #define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */ | ||
1827 | |||
1828 | #define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT) | ||
1829 | #define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT) | ||
1830 | #define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT) | ||
1831 | #define JOBCTL_TRAP_STOP (1 << JOBCTL_TRAP_STOP_BIT) | ||
1832 | #define JOBCTL_TRAP_NOTIFY (1 << JOBCTL_TRAP_NOTIFY_BIT) | ||
1833 | #define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT) | ||
1834 | #define JOBCTL_LISTENING (1 << JOBCTL_LISTENING_BIT) | ||
1835 | |||
1836 | #define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY) | ||
1837 | #define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK) | ||
1838 | |||
1839 | extern bool task_set_jobctl_pending(struct task_struct *task, | ||
1840 | unsigned int mask); | ||
1841 | extern void task_clear_jobctl_trapping(struct task_struct *task); | ||
1842 | extern void task_clear_jobctl_pending(struct task_struct *task, | ||
1843 | unsigned int mask); | ||
1825 | 1844 | ||
1826 | #ifdef CONFIG_PREEMPT_RCU | 1845 | #ifdef CONFIG_PREEMPT_RCU |
1827 | 1846 | ||
@@ -2136,7 +2155,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s | |||
2136 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); | 2155 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); |
2137 | 2156 | ||
2138 | return ret; | 2157 | return ret; |
2139 | } | 2158 | } |
2140 | 2159 | ||
2141 | extern void block_all_signals(int (*notifier)(void *priv), void *priv, | 2160 | extern void block_all_signals(int (*notifier)(void *priv), void *priv, |
2142 | sigset_t *mask); | 2161 | sigset_t *mask); |
@@ -2151,7 +2170,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_ | |||
2151 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 2170 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
2152 | extern int kill_pid(struct pid *pid, int sig, int priv); | 2171 | extern int kill_pid(struct pid *pid, int sig, int priv); |
2153 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 2172 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
2154 | extern int do_notify_parent(struct task_struct *, int); | 2173 | extern __must_check bool do_notify_parent(struct task_struct *, int); |
2155 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | 2174 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); |
2156 | extern void force_sig(int, struct task_struct *); | 2175 | extern void force_sig(int, struct task_struct *); |
2157 | extern int send_sig(int, struct task_struct *, int); | 2176 | extern int send_sig(int, struct task_struct *, int); |
@@ -2275,8 +2294,10 @@ static inline int get_nr_threads(struct task_struct *tsk) | |||
2275 | return tsk->signal->nr_threads; | 2294 | return tsk->signal->nr_threads; |
2276 | } | 2295 | } |
2277 | 2296 | ||
2278 | /* de_thread depends on thread_group_leader not being a pid based check */ | 2297 | static inline bool thread_group_leader(struct task_struct *p) |
2279 | #define thread_group_leader(p) (p == p->group_leader) | 2298 | { |
2299 | return p->exit_signal >= 0; | ||
2300 | } | ||
2280 | 2301 | ||
2281 | /* Do to the insanities of de_thread it is possible for a process | 2302 | /* Do to the insanities of de_thread it is possible for a process |
2282 | * to have the pid of the thread group leader without actually being | 2303 | * to have the pid of the thread group leader without actually being |
@@ -2309,11 +2330,6 @@ static inline int thread_group_empty(struct task_struct *p) | |||
2309 | #define delay_group_leader(p) \ | 2330 | #define delay_group_leader(p) \ |
2310 | (thread_group_leader(p) && !thread_group_empty(p)) | 2331 | (thread_group_leader(p) && !thread_group_empty(p)) |
2311 | 2332 | ||
2312 | static inline int task_detached(struct task_struct *p) | ||
2313 | { | ||
2314 | return p->exit_signal == -1; | ||
2315 | } | ||
2316 | |||
2317 | /* | 2333 | /* |
2318 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring | 2334 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring |
2319 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 2335 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
@@ -2510,7 +2526,7 @@ extern int _cond_resched(void); | |||
2510 | 2526 | ||
2511 | extern int __cond_resched_lock(spinlock_t *lock); | 2527 | extern int __cond_resched_lock(spinlock_t *lock); |
2512 | 2528 | ||
2513 | #ifdef CONFIG_PREEMPT | 2529 | #ifdef CONFIG_PREEMPT_COUNT |
2514 | #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET | 2530 | #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET |
2515 | #else | 2531 | #else |
2516 | #define PREEMPT_LOCK_OFFSET 0 | 2532 | #define PREEMPT_LOCK_OFFSET 0 |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 167c33361d9c..cc7a4e9cc7ad 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall) | |||
19 | extern long prctl_get_seccomp(void); | 19 | extern long prctl_get_seccomp(void); |
20 | extern long prctl_set_seccomp(unsigned long); | 20 | extern long prctl_set_seccomp(unsigned long); |
21 | 21 | ||
22 | static inline int seccomp_mode(seccomp_t *s) | ||
23 | { | ||
24 | return s->mode; | ||
25 | } | ||
26 | |||
22 | #else /* CONFIG_SECCOMP */ | 27 | #else /* CONFIG_SECCOMP */ |
23 | 28 | ||
24 | #include <linux/errno.h> | 29 | #include <linux/errno.h> |
@@ -37,6 +42,11 @@ static inline long prctl_set_seccomp(unsigned long arg2) | |||
37 | return -EINVAL; | 42 | return -EINVAL; |
38 | } | 43 | } |
39 | 44 | ||
45 | static inline int seccomp_mode(seccomp_t *s) | ||
46 | { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
40 | #endif /* CONFIG_SECCOMP */ | 50 | #endif /* CONFIG_SECCOMP */ |
41 | 51 | ||
42 | #endif /* _LINUX_SECCOMP_H */ | 52 | #endif /* _LINUX_SECCOMP_H */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 8ce59ef3e5af..ebd2a53a3d07 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1456,7 +1456,7 @@ struct security_operations { | |||
1456 | struct inode *new_dir, struct dentry *new_dentry); | 1456 | struct inode *new_dir, struct dentry *new_dentry); |
1457 | int (*inode_readlink) (struct dentry *dentry); | 1457 | int (*inode_readlink) (struct dentry *dentry); |
1458 | int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); | 1458 | int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); |
1459 | int (*inode_permission) (struct inode *inode, int mask, unsigned flags); | 1459 | int (*inode_permission) (struct inode *inode, int mask); |
1460 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); | 1460 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); |
1461 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); | 1461 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); |
1462 | int (*inode_setxattr) (struct dentry *dentry, const char *name, | 1462 | int (*inode_setxattr) (struct dentry *dentry, const char *name, |
@@ -1720,7 +1720,6 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1720 | int security_inode_readlink(struct dentry *dentry); | 1720 | int security_inode_readlink(struct dentry *dentry); |
1721 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | 1721 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); |
1722 | int security_inode_permission(struct inode *inode, int mask); | 1722 | int security_inode_permission(struct inode *inode, int mask); |
1723 | int security_inode_exec_permission(struct inode *inode, unsigned int flags); | ||
1724 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1723 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
1725 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1724 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
1726 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 1725 | int security_inode_setxattr(struct dentry *dentry, const char *name, |
@@ -2113,12 +2112,6 @@ static inline int security_inode_permission(struct inode *inode, int mask) | |||
2113 | return 0; | 2112 | return 0; |
2114 | } | 2113 | } |
2115 | 2114 | ||
2116 | static inline int security_inode_exec_permission(struct inode *inode, | ||
2117 | unsigned int flags) | ||
2118 | { | ||
2119 | return 0; | ||
2120 | } | ||
2121 | |||
2122 | static inline int security_inode_setattr(struct dentry *dentry, | 2115 | static inline int security_inode_setattr(struct dentry *dentry, |
2123 | struct iattr *attr) | 2116 | struct iattr *attr) |
2124 | { | 2117 | { |
diff --git a/include/linux/sem.h b/include/linux/sem.h index f2961afa2f66..1feb2de2ee57 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -77,7 +77,7 @@ struct seminfo { | |||
77 | #define SEMUSZ 20 /* sizeof struct sem_undo */ | 77 | #define SEMUSZ 20 /* sizeof struct sem_undo */ |
78 | 78 | ||
79 | #ifdef __KERNEL__ | 79 | #ifdef __KERNEL__ |
80 | #include <asm/atomic.h> | 80 | #include <linux/atomic.h> |
81 | #include <linux/rcupdate.h> | 81 | #include <linux/rcupdate.h> |
82 | #include <linux/cache.h> | 82 | #include <linux/cache.h> |
83 | 83 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 03c0232b4169..be720cd2038d 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -23,6 +23,7 @@ struct seq_file { | |||
23 | u64 version; | 23 | u64 version; |
24 | struct mutex lock; | 24 | struct mutex lock; |
25 | const struct seq_operations *op; | 25 | const struct seq_operations *op; |
26 | int poll_event; | ||
26 | void *private; | 27 | void *private; |
27 | }; | 28 | }; |
28 | 29 | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index a2afc9fbe186..8bffe9ae2ca0 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -8,6 +8,8 @@ | |||
8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define SCIx_NOT_SUPPORTED (-1) | ||
12 | |||
11 | enum { | 13 | enum { |
12 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | 14 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ |
13 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | 15 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ |
@@ -25,6 +27,28 @@ enum { | |||
25 | #define SCSCR_CKE1 (1 << 1) | 27 | #define SCSCR_CKE1 (1 << 1) |
26 | #define SCSCR_CKE0 (1 << 0) | 28 | #define SCSCR_CKE0 (1 << 0) |
27 | 29 | ||
30 | /* SCxSR SCI */ | ||
31 | #define SCI_TDRE 0x80 | ||
32 | #define SCI_RDRF 0x40 | ||
33 | #define SCI_ORER 0x20 | ||
34 | #define SCI_FER 0x10 | ||
35 | #define SCI_PER 0x08 | ||
36 | #define SCI_TEND 0x04 | ||
37 | |||
38 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) | ||
39 | |||
40 | /* SCxSR SCIF */ | ||
41 | #define SCIF_ER 0x0080 | ||
42 | #define SCIF_TEND 0x0040 | ||
43 | #define SCIF_TDFE 0x0020 | ||
44 | #define SCIF_BRK 0x0010 | ||
45 | #define SCIF_FER 0x0008 | ||
46 | #define SCIF_PER 0x0004 | ||
47 | #define SCIF_RDF 0x0002 | ||
48 | #define SCIF_DR 0x0001 | ||
49 | |||
50 | #define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) | ||
51 | |||
28 | /* Offsets into the sci_port->irqs array */ | 52 | /* Offsets into the sci_port->irqs array */ |
29 | enum { | 53 | enum { |
30 | SCIx_ERI_IRQ, | 54 | SCIx_ERI_IRQ, |
@@ -32,6 +56,24 @@ enum { | |||
32 | SCIx_TXI_IRQ, | 56 | SCIx_TXI_IRQ, |
33 | SCIx_BRI_IRQ, | 57 | SCIx_BRI_IRQ, |
34 | SCIx_NR_IRQS, | 58 | SCIx_NR_IRQS, |
59 | |||
60 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ | ||
61 | }; | ||
62 | |||
63 | enum { | ||
64 | SCIx_PROBE_REGTYPE, | ||
65 | |||
66 | SCIx_SCI_REGTYPE, | ||
67 | SCIx_IRDA_REGTYPE, | ||
68 | SCIx_SCIFA_REGTYPE, | ||
69 | SCIx_SCIFB_REGTYPE, | ||
70 | SCIx_SH3_SCIF_REGTYPE, | ||
71 | SCIx_SH4_SCIF_REGTYPE, | ||
72 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | ||
73 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, | ||
74 | SCIx_SH7705_SCIF_REGTYPE, | ||
75 | |||
76 | SCIx_NR_REGTYPES, | ||
35 | }; | 77 | }; |
36 | 78 | ||
37 | #define SCIx_IRQ_MUXED(irq) \ | 79 | #define SCIx_IRQ_MUXED(irq) \ |
@@ -42,8 +84,29 @@ enum { | |||
42 | [SCIx_BRI_IRQ] = (irq), \ | 84 | [SCIx_BRI_IRQ] = (irq), \ |
43 | } | 85 | } |
44 | 86 | ||
87 | #define SCIx_IRQ_IS_MUXED(port) \ | ||
88 | ((port)->cfg->irqs[SCIx_ERI_IRQ] == \ | ||
89 | (port)->cfg->irqs[SCIx_RXI_IRQ]) || \ | ||
90 | ((port)->cfg->irqs[SCIx_ERI_IRQ] && \ | ||
91 | !(port)->cfg->irqs[SCIx_RXI_IRQ]) | ||
92 | /* | ||
93 | * SCI register subset common for all port types. | ||
94 | * Not all registers will exist on all parts. | ||
95 | */ | ||
96 | enum { | ||
97 | SCSMR, SCBRR, SCSCR, SCxSR, | ||
98 | SCFCR, SCFDR, SCxTDR, SCxRDR, | ||
99 | SCLSR, SCTFDR, SCRFDR, SCSPTR, | ||
100 | |||
101 | SCIx_NR_REGS, | ||
102 | }; | ||
103 | |||
45 | struct device; | 104 | struct device; |
46 | 105 | ||
106 | struct plat_sci_port_ops { | ||
107 | void (*init_pins)(struct uart_port *, unsigned int cflag); | ||
108 | }; | ||
109 | |||
47 | /* | 110 | /* |
48 | * Platform device specific platform_data struct | 111 | * Platform device specific platform_data struct |
49 | */ | 112 | */ |
@@ -56,6 +119,18 @@ struct plat_sci_port { | |||
56 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | 119 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ |
57 | unsigned int scscr; /* SCSCR initialization */ | 120 | unsigned int scscr; /* SCSCR initialization */ |
58 | 121 | ||
122 | /* | ||
123 | * Platform overrides if necessary, defaults otherwise. | ||
124 | */ | ||
125 | int overrun_bit; | ||
126 | unsigned int error_mask; | ||
127 | |||
128 | int port_reg; | ||
129 | unsigned char regshift; | ||
130 | unsigned char regtype; | ||
131 | |||
132 | struct plat_sci_port_ops *ops; | ||
133 | |||
59 | struct device *dma_dev; | 134 | struct device *dma_dev; |
60 | 135 | ||
61 | unsigned int dma_slave_tx; | 136 | unsigned int dma_slave_tx; |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 9a52f72527dc..3ccf18648d0a 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr, | |||
147 | int sh_clk_div6_register(struct clk *clks, int nr); | 147 | int sh_clk_div6_register(struct clk *clks, int nr); |
148 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); | 148 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); |
149 | 149 | ||
150 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } | ||
151 | #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } | ||
152 | #define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk } | ||
153 | |||
150 | #endif /* __SH_CLOCK_H */ | 154 | #endif /* __SH_CLOCK_H */ |
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index b08cd4efa15c..cb2dd118cc0f 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h | |||
@@ -62,6 +62,12 @@ struct sh_dmae_pdata { | |||
62 | const unsigned int *ts_shift; | 62 | const unsigned int *ts_shift; |
63 | int ts_shift_num; | 63 | int ts_shift_num; |
64 | u16 dmaor_init; | 64 | u16 dmaor_init; |
65 | unsigned int chcr_offset; | ||
66 | u32 chcr_ie_bit; | ||
67 | |||
68 | unsigned int dmaor_is_32bit:1; | ||
69 | unsigned int needs_tend_set:1; | ||
70 | unsigned int no_dmars:1; | ||
65 | }; | 71 | }; |
66 | 72 | ||
67 | /* DMA register */ | 73 | /* DMA register */ |
@@ -71,6 +77,8 @@ struct sh_dmae_pdata { | |||
71 | #define CHCR 0x0C | 77 | #define CHCR 0x0C |
72 | #define DMAOR 0x40 | 78 | #define DMAOR 0x40 |
73 | 79 | ||
80 | #define TEND 0x18 /* USB-DMAC */ | ||
81 | |||
74 | /* DMAOR definitions */ | 82 | /* DMAOR definitions */ |
75 | #define DMAOR_AE 0x00000004 | 83 | #define DMAOR_AE 0x00000004 |
76 | #define DMAOR_NMIF 0x00000002 | 84 | #define DMAOR_NMIF 0x00000002 |
diff --git a/include/linux/shm.h b/include/linux/shm.h index eca6235a46c0..92808b86703b 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -95,6 +95,9 @@ struct shmid_kernel /* private to the kernel */ | |||
95 | pid_t shm_cprid; | 95 | pid_t shm_cprid; |
96 | pid_t shm_lprid; | 96 | pid_t shm_lprid; |
97 | struct user_struct *mlock_user; | 97 | struct user_struct *mlock_user; |
98 | |||
99 | /* The task created the shm object. NULL if the task is dead. */ | ||
100 | struct task_struct *shm_creator; | ||
98 | }; | 101 | }; |
99 | 102 | ||
100 | /* shm_mode upper byte flags */ | 103 | /* shm_mode upper byte flags */ |
@@ -106,6 +109,7 @@ struct shmid_kernel /* private to the kernel */ | |||
106 | #ifdef CONFIG_SYSVIPC | 109 | #ifdef CONFIG_SYSVIPC |
107 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 110 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
108 | extern int is_file_shm_hugepages(struct file *file); | 111 | extern int is_file_shm_hugepages(struct file *file); |
112 | extern void exit_shm(struct task_struct *task); | ||
109 | #else | 113 | #else |
110 | static inline long do_shmat(int shmid, char __user *shmaddr, | 114 | static inline long do_shmat(int shmid, char __user *shmaddr, |
111 | int shmflg, unsigned long *addr) | 115 | int shmflg, unsigned long *addr) |
@@ -116,6 +120,9 @@ static inline int is_file_shm_hugepages(struct file *file) | |||
116 | { | 120 | { |
117 | return 0; | 121 | return 0; |
118 | } | 122 | } |
123 | static inline void exit_shm(struct task_struct *task) | ||
124 | { | ||
125 | } | ||
119 | #endif | 126 | #endif |
120 | 127 | ||
121 | #endif /* __KERNEL__ */ | 128 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index aa08fa8fd79b..9291ac3cc627 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -8,22 +8,15 @@ | |||
8 | 8 | ||
9 | /* inode in-kernel data */ | 9 | /* inode in-kernel data */ |
10 | 10 | ||
11 | #define SHMEM_NR_DIRECT 16 | ||
12 | |||
13 | #define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t)) | ||
14 | |||
15 | struct shmem_inode_info { | 11 | struct shmem_inode_info { |
16 | spinlock_t lock; | 12 | spinlock_t lock; |
17 | unsigned long flags; | 13 | unsigned long flags; |
18 | unsigned long alloced; /* data pages alloced to file */ | 14 | unsigned long alloced; /* data pages alloced to file */ |
19 | unsigned long swapped; /* subtotal assigned to swap */ | ||
20 | unsigned long next_index; /* highest alloced index + 1 */ | ||
21 | struct shared_policy policy; /* NUMA memory alloc policy */ | ||
22 | struct page *i_indirect; /* top indirect blocks page */ | ||
23 | union { | 15 | union { |
24 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 16 | unsigned long swapped; /* subtotal assigned to swap */ |
25 | char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; | 17 | char *symlink; /* unswappable short symlink */ |
26 | }; | 18 | }; |
19 | struct shared_policy policy; /* NUMA memory alloc policy */ | ||
27 | struct list_head swaplist; /* chain of maybes on swap */ | 20 | struct list_head swaplist; /* chain of maybes on swap */ |
28 | struct list_head xattr_list; /* list of shmem_xattr */ | 21 | struct list_head xattr_list; /* list of shmem_xattr */ |
29 | struct inode vfs_inode; | 22 | struct inode vfs_inode; |
@@ -49,7 +42,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
49 | /* | 42 | /* |
50 | * Functions in mm/shmem.c called directly from elsewhere: | 43 | * Functions in mm/shmem.c called directly from elsewhere: |
51 | */ | 44 | */ |
52 | extern int init_tmpfs(void); | 45 | extern int shmem_init(void); |
53 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 46 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
54 | extern struct file *shmem_file_setup(const char *name, | 47 | extern struct file *shmem_file_setup(const char *name, |
55 | loff_t size, unsigned long flags); | 48 | loff_t size, unsigned long flags); |
@@ -59,8 +52,6 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, | |||
59 | pgoff_t index, gfp_t gfp_mask); | 52 | pgoff_t index, gfp_t gfp_mask); |
60 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); | 53 | extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); |
61 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 54 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
62 | extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | ||
63 | struct page **pagep, swp_entry_t *ent); | ||
64 | 55 | ||
65 | static inline struct page *shmem_read_mapping_page( | 56 | static inline struct page *shmem_read_mapping_page( |
66 | struct address_space *mapping, pgoff_t index) | 57 | struct address_space *mapping, pgoff_t index) |
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h new file mode 100644 index 000000000000..790651b4e5ba --- /dev/null +++ b/include/linux/shrinker.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _LINUX_SHRINKER_H | ||
2 | #define _LINUX_SHRINKER_H | ||
3 | |||
4 | /* | ||
5 | * This struct is used to pass information from page reclaim to the shrinkers. | ||
6 | * We consolidate the values for easier extention later. | ||
7 | */ | ||
8 | struct shrink_control { | ||
9 | gfp_t gfp_mask; | ||
10 | |||
11 | /* How many slab objects shrinker() should scan and try to reclaim */ | ||
12 | unsigned long nr_to_scan; | ||
13 | }; | ||
14 | |||
15 | /* | ||
16 | * A callback you can register to apply pressure to ageable caches. | ||
17 | * | ||
18 | * 'sc' is passed shrink_control which includes a count 'nr_to_scan' | ||
19 | * and a 'gfpmask'. It should look through the least-recently-used | ||
20 | * 'nr_to_scan' entries and attempt to free them up. It should return | ||
21 | * the number of objects which remain in the cache. If it returns -1, it means | ||
22 | * it cannot do any scanning at this time (eg. there is a risk of deadlock). | ||
23 | * | ||
24 | * The 'gfpmask' refers to the allocation we are currently trying to | ||
25 | * fulfil. | ||
26 | * | ||
27 | * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is | ||
28 | * querying the cache size, so a fastpath for that case is appropriate. | ||
29 | */ | ||
30 | struct shrinker { | ||
31 | int (*shrink)(struct shrinker *, struct shrink_control *sc); | ||
32 | int seeks; /* seeks to recreate an obj */ | ||
33 | long batch; /* reclaim batch size, 0 = default */ | ||
34 | |||
35 | /* These are for internal use */ | ||
36 | struct list_head list; | ||
37 | long nr; /* objs pending delete */ | ||
38 | }; | ||
39 | #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ | ||
40 | extern void register_shrinker(struct shrinker *); | ||
41 | extern void unregister_shrinker(struct shrinker *); | ||
42 | #endif | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c0a4f3ab0cc0..7b996ed86d5b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
21 | #include <linux/cache.h> | 21 | #include <linux/cache.h> |
22 | 22 | ||
23 | #include <asm/atomic.h> | 23 | #include <linux/atomic.h> |
24 | #include <asm/types.h> | 24 | #include <asm/types.h> |
25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
26 | #include <linux/net.h> | 26 | #include <linux/net.h> |
@@ -187,6 +187,20 @@ enum { | |||
187 | 187 | ||
188 | /* ensure the originating sk reference is available on driver level */ | 188 | /* ensure the originating sk reference is available on driver level */ |
189 | SKBTX_DRV_NEEDS_SK_REF = 1 << 3, | 189 | SKBTX_DRV_NEEDS_SK_REF = 1 << 3, |
190 | |||
191 | /* device driver supports TX zero-copy buffers */ | ||
192 | SKBTX_DEV_ZEROCOPY = 1 << 4, | ||
193 | }; | ||
194 | |||
195 | /* | ||
196 | * The callback notifies userspace to release buffers when skb DMA is done in | ||
197 | * lower device, the skb last reference should be 0 when calling this. | ||
198 | * The desc is used to track userspace buffer index. | ||
199 | */ | ||
200 | struct ubuf_info { | ||
201 | void (*callback)(void *); | ||
202 | void *arg; | ||
203 | unsigned long desc; | ||
190 | }; | 204 | }; |
191 | 205 | ||
192 | /* This data is invariant across clones and lives at | 206 | /* This data is invariant across clones and lives at |
@@ -211,6 +225,7 @@ struct skb_shared_info { | |||
211 | /* Intermediate layers must ensure that destructor_arg | 225 | /* Intermediate layers must ensure that destructor_arg |
212 | * remains valid until skb destructor */ | 226 | * remains valid until skb destructor */ |
213 | void * destructor_arg; | 227 | void * destructor_arg; |
228 | |||
214 | /* must be last field, see pskb_expand_head() */ | 229 | /* must be last field, see pskb_expand_head() */ |
215 | skb_frag_t frags[MAX_SKB_FRAGS]; | 230 | skb_frag_t frags[MAX_SKB_FRAGS]; |
216 | }; | 231 | }; |
@@ -270,15 +285,12 @@ typedef unsigned char *sk_buff_data_t; | |||
270 | * struct sk_buff - socket buffer | 285 | * struct sk_buff - socket buffer |
271 | * @next: Next buffer in list | 286 | * @next: Next buffer in list |
272 | * @prev: Previous buffer in list | 287 | * @prev: Previous buffer in list |
273 | * @sk: Socket we are owned by | ||
274 | * @tstamp: Time we arrived | 288 | * @tstamp: Time we arrived |
289 | * @sk: Socket we are owned by | ||
275 | * @dev: Device we arrived on/are leaving by | 290 | * @dev: Device we arrived on/are leaving by |
276 | * @transport_header: Transport layer header | 291 | * @cb: Control buffer. Free for use by every layer. Put private vars here |
277 | * @network_header: Network layer header | ||
278 | * @mac_header: Link layer header | ||
279 | * @_skb_refdst: destination entry (with norefcount bit) | 292 | * @_skb_refdst: destination entry (with norefcount bit) |
280 | * @sp: the security path, used for xfrm | 293 | * @sp: the security path, used for xfrm |
281 | * @cb: Control buffer. Free for use by every layer. Put private vars here | ||
282 | * @len: Length of actual data | 294 | * @len: Length of actual data |
283 | * @data_len: Data length | 295 | * @data_len: Data length |
284 | * @mac_len: Length of link layer header | 296 | * @mac_len: Length of link layer header |
@@ -286,40 +298,45 @@ typedef unsigned char *sk_buff_data_t; | |||
286 | * @csum: Checksum (must include start/offset pair) | 298 | * @csum: Checksum (must include start/offset pair) |
287 | * @csum_start: Offset from skb->head where checksumming should start | 299 | * @csum_start: Offset from skb->head where checksumming should start |
288 | * @csum_offset: Offset from csum_start where checksum should be stored | 300 | * @csum_offset: Offset from csum_start where checksum should be stored |
301 | * @priority: Packet queueing priority | ||
289 | * @local_df: allow local fragmentation | 302 | * @local_df: allow local fragmentation |
290 | * @cloned: Head may be cloned (check refcnt to be sure) | 303 | * @cloned: Head may be cloned (check refcnt to be sure) |
304 | * @ip_summed: Driver fed us an IP checksum | ||
291 | * @nohdr: Payload reference only, must not modify header | 305 | * @nohdr: Payload reference only, must not modify header |
306 | * @nfctinfo: Relationship of this skb to the connection | ||
292 | * @pkt_type: Packet class | 307 | * @pkt_type: Packet class |
293 | * @fclone: skbuff clone status | 308 | * @fclone: skbuff clone status |
294 | * @ip_summed: Driver fed us an IP checksum | ||
295 | * @priority: Packet queueing priority | ||
296 | * @users: User count - see {datagram,tcp}.c | ||
297 | * @protocol: Packet protocol from driver | ||
298 | * @truesize: Buffer size | ||
299 | * @head: Head of buffer | ||
300 | * @data: Data head pointer | ||
301 | * @tail: Tail pointer | ||
302 | * @end: End pointer | ||
303 | * @destructor: Destruct function | ||
304 | * @mark: Generic packet mark | ||
305 | * @nfct: Associated connection, if any | ||
306 | * @ipvs_property: skbuff is owned by ipvs | 309 | * @ipvs_property: skbuff is owned by ipvs |
307 | * @peeked: this packet has been seen already, so stats have been | 310 | * @peeked: this packet has been seen already, so stats have been |
308 | * done for it, don't do them again | 311 | * done for it, don't do them again |
309 | * @nf_trace: netfilter packet trace flag | 312 | * @nf_trace: netfilter packet trace flag |
310 | * @nfctinfo: Relationship of this skb to the connection | 313 | * @protocol: Packet protocol from driver |
314 | * @destructor: Destruct function | ||
315 | * @nfct: Associated connection, if any | ||
311 | * @nfct_reasm: netfilter conntrack re-assembly pointer | 316 | * @nfct_reasm: netfilter conntrack re-assembly pointer |
312 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 317 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
313 | * @skb_iif: ifindex of device we arrived on | 318 | * @skb_iif: ifindex of device we arrived on |
314 | * @rxhash: the packet hash computed on receive | ||
315 | * @queue_mapping: Queue mapping for multiqueue devices | ||
316 | * @tc_index: Traffic control index | 319 | * @tc_index: Traffic control index |
317 | * @tc_verd: traffic control verdict | 320 | * @tc_verd: traffic control verdict |
321 | * @rxhash: the packet hash computed on receive | ||
322 | * @queue_mapping: Queue mapping for multiqueue devices | ||
318 | * @ndisc_nodetype: router type (from link layer) | 323 | * @ndisc_nodetype: router type (from link layer) |
324 | * @ooo_okay: allow the mapping of a socket to a queue to be changed | ||
319 | * @dma_cookie: a cookie to one of several possible DMA operations | 325 | * @dma_cookie: a cookie to one of several possible DMA operations |
320 | * done by skb DMA functions | 326 | * done by skb DMA functions |
321 | * @secmark: security marking | 327 | * @secmark: security marking |
328 | * @mark: Generic packet mark | ||
329 | * @dropcount: total number of sk_receive_queue overflows | ||
322 | * @vlan_tci: vlan tag control information | 330 | * @vlan_tci: vlan tag control information |
331 | * @transport_header: Transport layer header | ||
332 | * @network_header: Network layer header | ||
333 | * @mac_header: Link layer header | ||
334 | * @tail: Tail pointer | ||
335 | * @end: End pointer | ||
336 | * @head: Head of buffer | ||
337 | * @data: Data head pointer | ||
338 | * @truesize: Buffer size | ||
339 | * @users: User count - see {datagram,tcp}.c | ||
323 | */ | 340 | */ |
324 | 341 | ||
325 | struct sk_buff { | 342 | struct sk_buff { |
@@ -1562,16 +1579,22 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1562 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1579 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1563 | } | 1580 | } |
1564 | 1581 | ||
1565 | static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | 1582 | static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, |
1566 | unsigned int length) | 1583 | unsigned int length, gfp_t gfp) |
1567 | { | 1584 | { |
1568 | struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); | 1585 | struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); |
1569 | 1586 | ||
1570 | if (NET_IP_ALIGN && skb) | 1587 | if (NET_IP_ALIGN && skb) |
1571 | skb_reserve(skb, NET_IP_ALIGN); | 1588 | skb_reserve(skb, NET_IP_ALIGN); |
1572 | return skb; | 1589 | return skb; |
1573 | } | 1590 | } |
1574 | 1591 | ||
1592 | static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | ||
1593 | unsigned int length) | ||
1594 | { | ||
1595 | return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC); | ||
1596 | } | ||
1597 | |||
1575 | /** | 1598 | /** |
1576 | * __netdev_alloc_page - allocate a page for ps-rx on a specific device | 1599 | * __netdev_alloc_page - allocate a page for ps-rx on a specific device |
1577 | * @dev: network device to receive on | 1600 | * @dev: network device to receive on |
@@ -2028,8 +2051,7 @@ static inline void sw_tx_timestamp(struct sk_buff *skb) | |||
2028 | * skb_tx_timestamp() - Driver hook for transmit timestamping | 2051 | * skb_tx_timestamp() - Driver hook for transmit timestamping |
2029 | * | 2052 | * |
2030 | * Ethernet MAC Drivers should call this function in their hard_xmit() | 2053 | * Ethernet MAC Drivers should call this function in their hard_xmit() |
2031 | * function as soon as possible after giving the sk_buff to the MAC | 2054 | * function immediately before giving the sk_buff to the MAC hardware. |
2032 | * hardware, but before freeing the sk_buff. | ||
2033 | * | 2055 | * |
2034 | * @skb: A socket buffer. | 2056 | * @skb: A socket buffer. |
2035 | */ | 2057 | */ |
@@ -2266,5 +2288,6 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb) | |||
2266 | } | 2288 | } |
2267 | 2289 | ||
2268 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); | 2290 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); |
2291 | |||
2269 | #endif /* __KERNEL__ */ | 2292 | #endif /* __KERNEL__ */ |
2270 | #endif /* _LINUX_SKBUFF_H */ | 2293 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/linux/slab.h b/include/linux/slab.h index ad4dd1c8d30a..573c809c33d9 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -134,6 +134,26 @@ unsigned int kmem_cache_size(struct kmem_cache *); | |||
134 | #define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) | 134 | #define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) |
135 | 135 | ||
136 | /* | 136 | /* |
137 | * Some archs want to perform DMA into kmalloc caches and need a guaranteed | ||
138 | * alignment larger than the alignment of a 64-bit integer. | ||
139 | * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that. | ||
140 | */ | ||
141 | #ifdef ARCH_DMA_MINALIGN | ||
142 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | ||
143 | #else | ||
144 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
145 | #endif | ||
146 | |||
147 | /* | ||
148 | * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. | ||
149 | * Intended for arches that get misalignment faults even for 64 bit integer | ||
150 | * aligned buffers. | ||
151 | */ | ||
152 | #ifndef ARCH_SLAB_MINALIGN | ||
153 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) | ||
154 | #endif | ||
155 | |||
156 | /* | ||
137 | * Common kmalloc functions provided by all allocators | 157 | * Common kmalloc functions provided by all allocators |
138 | */ | 158 | */ |
139 | void * __must_check __krealloc(const void *, size_t, gfp_t); | 159 | void * __must_check __krealloc(const void *, size_t, gfp_t); |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 83203ae9390b..d00e0bacda93 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -18,53 +18,25 @@ | |||
18 | #include <trace/events/kmem.h> | 18 | #include <trace/events/kmem.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Enforce a minimum alignment for the kmalloc caches. | ||
22 | * Usually, the kmalloc caches are cache_line_size() aligned, except when | ||
23 | * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned. | ||
24 | * Some archs want to perform DMA into kmalloc caches and need a guaranteed | ||
25 | * alignment larger than the alignment of a 64-bit integer. | ||
26 | * ARCH_KMALLOC_MINALIGN allows that. | ||
27 | * Note that increasing this value may disable some debug features. | ||
28 | */ | ||
29 | #ifdef ARCH_DMA_MINALIGN | ||
30 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | ||
31 | #else | ||
32 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
33 | #endif | ||
34 | |||
35 | #ifndef ARCH_SLAB_MINALIGN | ||
36 | /* | ||
37 | * Enforce a minimum alignment for all caches. | ||
38 | * Intended for archs that get misalignment faults even for BYTES_PER_WORD | ||
39 | * aligned buffers. Includes ARCH_KMALLOC_MINALIGN. | ||
40 | * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables | ||
41 | * some debug features. | ||
42 | */ | ||
43 | #define ARCH_SLAB_MINALIGN 0 | ||
44 | #endif | ||
45 | |||
46 | /* | ||
47 | * struct kmem_cache | 21 | * struct kmem_cache |
48 | * | 22 | * |
49 | * manages a cache. | 23 | * manages a cache. |
50 | */ | 24 | */ |
51 | 25 | ||
52 | struct kmem_cache { | 26 | struct kmem_cache { |
53 | /* 1) per-cpu data, touched during every alloc/free */ | 27 | /* 1) Cache tunables. Protected by cache_chain_mutex */ |
54 | struct array_cache *array[NR_CPUS]; | ||
55 | /* 2) Cache tunables. Protected by cache_chain_mutex */ | ||
56 | unsigned int batchcount; | 28 | unsigned int batchcount; |
57 | unsigned int limit; | 29 | unsigned int limit; |
58 | unsigned int shared; | 30 | unsigned int shared; |
59 | 31 | ||
60 | unsigned int buffer_size; | 32 | unsigned int buffer_size; |
61 | u32 reciprocal_buffer_size; | 33 | u32 reciprocal_buffer_size; |
62 | /* 3) touched by every alloc & free from the backend */ | 34 | /* 2) touched by every alloc & free from the backend */ |
63 | 35 | ||
64 | unsigned int flags; /* constant flags */ | 36 | unsigned int flags; /* constant flags */ |
65 | unsigned int num; /* # of objs per slab */ | 37 | unsigned int num; /* # of objs per slab */ |
66 | 38 | ||
67 | /* 4) cache_grow/shrink */ | 39 | /* 3) cache_grow/shrink */ |
68 | /* order of pgs per slab (2^n) */ | 40 | /* order of pgs per slab (2^n) */ |
69 | unsigned int gfporder; | 41 | unsigned int gfporder; |
70 | 42 | ||
@@ -80,11 +52,11 @@ struct kmem_cache { | |||
80 | /* constructor func */ | 52 | /* constructor func */ |
81 | void (*ctor)(void *obj); | 53 | void (*ctor)(void *obj); |
82 | 54 | ||
83 | /* 5) cache creation/removal */ | 55 | /* 4) cache creation/removal */ |
84 | const char *name; | 56 | const char *name; |
85 | struct list_head next; | 57 | struct list_head next; |
86 | 58 | ||
87 | /* 6) statistics */ | 59 | /* 5) statistics */ |
88 | #ifdef CONFIG_DEBUG_SLAB | 60 | #ifdef CONFIG_DEBUG_SLAB |
89 | unsigned long num_active; | 61 | unsigned long num_active; |
90 | unsigned long num_allocations; | 62 | unsigned long num_allocations; |
@@ -111,16 +83,18 @@ struct kmem_cache { | |||
111 | int obj_size; | 83 | int obj_size; |
112 | #endif /* CONFIG_DEBUG_SLAB */ | 84 | #endif /* CONFIG_DEBUG_SLAB */ |
113 | 85 | ||
86 | /* 6) per-cpu/per-node data, touched during every alloc/free */ | ||
114 | /* | 87 | /* |
115 | * We put nodelists[] at the end of kmem_cache, because we want to size | 88 | * We put array[] at the end of kmem_cache, because we want to size |
116 | * this array to nr_node_ids slots instead of MAX_NUMNODES | 89 | * this array to nr_cpu_ids slots instead of NR_CPUS |
117 | * (see kmem_cache_init()) | 90 | * (see kmem_cache_init()) |
118 | * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache | 91 | * We still use [NR_CPUS] and not [1] or [0] because cache_cache |
119 | * is statically defined, so we reserve the max number of nodes. | 92 | * is statically defined, so we reserve the max number of cpus. |
120 | */ | 93 | */ |
121 | struct kmem_list3 *nodelists[MAX_NUMNODES]; | 94 | struct kmem_list3 **nodelists; |
95 | struct array_cache *array[NR_CPUS]; | ||
122 | /* | 96 | /* |
123 | * Do not add fields after nodelists[] | 97 | * Do not add fields after array[] |
124 | */ | 98 | */ |
125 | }; | 99 | }; |
126 | 100 | ||
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index 4382db09df4f..0ec00b39d006 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
@@ -1,16 +1,6 @@ | |||
1 | #ifndef __LINUX_SLOB_DEF_H | 1 | #ifndef __LINUX_SLOB_DEF_H |
2 | #define __LINUX_SLOB_DEF_H | 2 | #define __LINUX_SLOB_DEF_H |
3 | 3 | ||
4 | #ifdef ARCH_DMA_MINALIGN | ||
5 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | ||
6 | #else | ||
7 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long) | ||
8 | #endif | ||
9 | |||
10 | #ifndef ARCH_SLAB_MINALIGN | ||
11 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long) | ||
12 | #endif | ||
13 | |||
14 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 4 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
15 | 5 | ||
16 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, | 6 | static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index c8668d161dd8..f58d6413d230 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -24,6 +24,7 @@ enum stat_item { | |||
24 | ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ | 24 | ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ |
25 | ALLOC_SLAB, /* Cpu slab acquired from page allocator */ | 25 | ALLOC_SLAB, /* Cpu slab acquired from page allocator */ |
26 | ALLOC_REFILL, /* Refill cpu slab from slab freelist */ | 26 | ALLOC_REFILL, /* Refill cpu slab from slab freelist */ |
27 | ALLOC_NODE_MISMATCH, /* Switching cpu slab */ | ||
27 | FREE_SLAB, /* Slab freed to the page allocator */ | 28 | FREE_SLAB, /* Slab freed to the page allocator */ |
28 | CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ | 29 | CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ |
29 | DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ | 30 | DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ |
@@ -31,8 +32,10 @@ enum stat_item { | |||
31 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ | 32 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ |
32 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ | 33 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ |
33 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ | 34 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ |
35 | DEACTIVATE_BYPASS, /* Implicit deactivation */ | ||
34 | ORDER_FALLBACK, /* Number of times fallback was necessary */ | 36 | ORDER_FALLBACK, /* Number of times fallback was necessary */ |
35 | CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ | 37 | CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ |
38 | CMPXCHG_DOUBLE_FAIL, /* Number of times that cmpxchg double did not match */ | ||
36 | NR_SLUB_STAT_ITEMS }; | 39 | NR_SLUB_STAT_ITEMS }; |
37 | 40 | ||
38 | struct kmem_cache_cpu { | 41 | struct kmem_cache_cpu { |
@@ -113,16 +116,6 @@ struct kmem_cache { | |||
113 | 116 | ||
114 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) | 117 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) |
115 | 118 | ||
116 | #ifdef ARCH_DMA_MINALIGN | ||
117 | #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN | ||
118 | #else | ||
119 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) | ||
120 | #endif | ||
121 | |||
122 | #ifndef ARCH_SLAB_MINALIGN | ||
123 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) | ||
124 | #endif | ||
125 | |||
126 | /* | 119 | /* |
127 | * Maximum kmalloc object size handled by SLUB. Larger object allocations | 120 | * Maximum kmalloc object size handled by SLUB. Larger object allocations |
128 | * are passed through to the page allocator. The page allocator "fastpath" | 121 | * are passed through to the page allocator. The page allocator "fastpath" |
@@ -228,6 +221,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order) | |||
228 | return ret; | 221 | return ret; |
229 | } | 222 | } |
230 | 223 | ||
224 | /** | ||
225 | * Calling this on allocated memory will check that the memory | ||
226 | * is expected to be in use, and print warnings if not. | ||
227 | */ | ||
228 | #ifdef CONFIG_SLUB_DEBUG | ||
229 | extern bool verify_mem_not_deleted(const void *x); | ||
230 | #else | ||
231 | static inline bool verify_mem_not_deleted(const void *x) | ||
232 | { | ||
233 | return true; | ||
234 | } | ||
235 | #endif | ||
236 | |||
231 | #ifdef CONFIG_TRACING | 237 | #ifdef CONFIG_TRACING |
232 | extern void * | 238 | extern void * |
233 | kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); | 239 | kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 4ef98e422fde..d0e77f607a79 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -8,8 +8,10 @@ | |||
8 | #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) | 8 | #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) |
9 | /* Implementation specific desired alignment */ | 9 | /* Implementation specific desired alignment */ |
10 | 10 | ||
11 | typedef unsigned short __kernel_sa_family_t; | ||
12 | |||
11 | struct __kernel_sockaddr_storage { | 13 | struct __kernel_sockaddr_storage { |
12 | unsigned short ss_family; /* address family */ | 14 | __kernel_sa_family_t ss_family; /* address family */ |
13 | /* Following field(s) are implementation specific */ | 15 | /* Following field(s) are implementation specific */ |
14 | char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; | 16 | char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; |
15 | /* space to achieve desired size, */ | 17 | /* space to achieve desired size, */ |
@@ -35,7 +37,7 @@ struct seq_file; | |||
35 | extern void socket_seq_show(struct seq_file *seq); | 37 | extern void socket_seq_show(struct seq_file *seq); |
36 | #endif | 38 | #endif |
37 | 39 | ||
38 | typedef unsigned short sa_family_t; | 40 | typedef __kernel_sa_family_t sa_family_t; |
39 | 41 | ||
40 | /* | 42 | /* |
41 | * 1003.1g requires sa_family_t and that sa_data is char. | 43 | * 1003.1g requires sa_family_t and that sa_data is char. |
@@ -192,7 +194,8 @@ struct ucred { | |||
192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ | 194 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
193 | #define AF_CAIF 37 /* CAIF sockets */ | 195 | #define AF_CAIF 37 /* CAIF sockets */ |
194 | #define AF_ALG 38 /* Algorithm sockets */ | 196 | #define AF_ALG 38 /* Algorithm sockets */ |
195 | #define AF_MAX 39 /* For now.. */ | 197 | #define AF_NFC 39 /* NFC sockets */ |
198 | #define AF_MAX 40 /* For now.. */ | ||
196 | 199 | ||
197 | /* Protocol families, same as address families. */ | 200 | /* Protocol families, same as address families. */ |
198 | #define PF_UNSPEC AF_UNSPEC | 201 | #define PF_UNSPEC AF_UNSPEC |
@@ -234,6 +237,7 @@ struct ucred { | |||
234 | #define PF_IEEE802154 AF_IEEE802154 | 237 | #define PF_IEEE802154 AF_IEEE802154 |
235 | #define PF_CAIF AF_CAIF | 238 | #define PF_CAIF AF_CAIF |
236 | #define PF_ALG AF_ALG | 239 | #define PF_ALG AF_ALG |
240 | #define PF_NFC AF_NFC | ||
237 | #define PF_MAX AF_MAX | 241 | #define PF_MAX AF_MAX |
238 | 242 | ||
239 | /* Maximum queue length specifiable by listen. */ | 243 | /* Maximum queue length specifiable by listen. */ |
diff --git a/include/linux/sonet.h b/include/linux/sonet.h index 67ad11fcf88b..de8832dd272b 100644 --- a/include/linux/sonet.h +++ b/include/linux/sonet.h | |||
@@ -58,7 +58,7 @@ struct sonet_stats { | |||
58 | 58 | ||
59 | #ifdef __KERNEL__ | 59 | #ifdef __KERNEL__ |
60 | 60 | ||
61 | #include <asm/atomic.h> | 61 | #include <linux/atomic.h> |
62 | 62 | ||
63 | struct k_sonet_stats { | 63 | struct k_sonet_stats { |
64 | #define __HANDLE_ITEM(i) atomic_t i | 64 | #define __HANDLE_ITEM(i) atomic_t i |
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h index d85c52f294a0..0aa6acc73317 100644 --- a/include/linux/spi/74x164.h +++ b/include/linux/spi/74x164.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef LINUX_SPI_74X164_H | 1 | #ifndef LINUX_SPI_74X164_H |
2 | #define LINUX_SPI_74X164_H | 2 | #define LINUX_SPI_74X164_H |
3 | 3 | ||
4 | #define GEN_74X164_DRIVER_NAME "74x164" | ||
5 | |||
6 | struct gen_74x164_chip_platform_data { | 4 | struct gen_74x164_chip_platform_data { |
7 | /* number assigned to the first GPIO */ | 5 | /* number assigned to the first GPIO */ |
8 | unsigned base; | 6 | unsigned base; |
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h index c42cff8ca191..2d676d5aaa89 100644 --- a/include/linux/spi/mcp23s08.h +++ b/include/linux/spi/mcp23s08.h | |||
@@ -22,13 +22,4 @@ struct mcp23s08_platform_data { | |||
22 | * base to base+15 (or base+31 for s17 variant). | 22 | * base to base+15 (or base+31 for s17 variant). |
23 | */ | 23 | */ |
24 | unsigned base; | 24 | unsigned base; |
25 | |||
26 | void *context; /* param to setup/teardown */ | ||
27 | |||
28 | int (*setup)(struct spi_device *spi, | ||
29 | int gpio, unsigned ngpio, | ||
30 | void *context); | ||
31 | int (*teardown)(struct spi_device *spi, | ||
32 | int gpio, unsigned ngpio, | ||
33 | void *context); | ||
34 | }; | 25 | }; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 0b22d51258e6..7df6c17b0281 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -384,7 +384,7 @@ static inline void assert_spin_locked(spinlock_t *lock) | |||
384 | * Pull the atomic_t declaration: | 384 | * Pull the atomic_t declaration: |
385 | * (asm-mips/atomic.h needs above definitions) | 385 | * (asm-mips/atomic.h needs above definitions) |
386 | */ | 386 | */ |
387 | #include <asm/atomic.h> | 387 | #include <linux/atomic.h> |
388 | /** | 388 | /** |
389 | * atomic_dec_and_lock - lock on reaching reference count zero | 389 | * atomic_dec_and_lock - lock on reaching reference count zero |
390 | * @atomic: the atomic counter | 390 | * @atomic: the atomic counter |
diff --git a/include/linux/splice.h b/include/linux/splice.h index 997c3b4c212b..26e5b613deda 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -88,5 +88,7 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, | |||
88 | extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *); | 88 | extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *); |
89 | extern void splice_shrink_spd(struct pipe_inode_info *, | 89 | extern void splice_shrink_spd(struct pipe_inode_info *, |
90 | struct splice_pipe_desc *); | 90 | struct splice_pipe_desc *); |
91 | extern void spd_release_page(struct splice_pipe_desc *, unsigned int); | ||
91 | 92 | ||
93 | extern const struct pipe_buf_operations page_cache_pipe_buf_ops; | ||
92 | #endif | 94 | #endif |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 252e44821787..8623217f84d0 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -27,6 +27,8 @@ struct ssb_sprom { | |||
27 | u8 et1mdcport; /* MDIO for enet1 */ | 27 | u8 et1mdcport; /* MDIO for enet1 */ |
28 | u8 board_rev; /* Board revision number from SPROM. */ | 28 | u8 board_rev; /* Board revision number from SPROM. */ |
29 | u8 country_code; /* Country Code */ | 29 | u8 country_code; /* Country Code */ |
30 | u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ | ||
31 | u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ | ||
30 | u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ | 32 | u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ |
31 | u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ | 33 | u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ |
32 | u16 pa0b0; | 34 | u16 pa0b0; |
@@ -99,7 +101,7 @@ struct ssb_sprom { | |||
99 | struct ssb_boardinfo { | 101 | struct ssb_boardinfo { |
100 | u16 vendor; | 102 | u16 vendor; |
101 | u16 type; | 103 | u16 type; |
102 | u16 rev; | 104 | u8 rev; |
103 | }; | 105 | }; |
104 | 106 | ||
105 | 107 | ||
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index a08d693d8324..1a6b0045b06b 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * gpio interface, extbus, and support for serial and parallel flashes. | 8 | * gpio interface, extbus, and support for serial and parallel flashes. |
9 | * | 9 | * |
10 | * Copyright 2005, Broadcom Corporation | 10 | * Copyright 2005, Broadcom Corporation |
11 | * Copyright 2006, Michael Buesch <mb@bu3sch.de> | 11 | * Copyright 2006, Michael Buesch <m@bues.ch> |
12 | * | 12 | * |
13 | * Licensed under the GPL version 2. See COPYING for details. | 13 | * Licensed under the GPL version 2. See COPYING for details. |
14 | */ | 14 | */ |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 25310f1d7f37..115b570e3bff 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -14,8 +14,8 @@ struct stack_trace { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | extern void save_stack_trace(struct stack_trace *trace); | 16 | extern void save_stack_trace(struct stack_trace *trace); |
17 | extern void save_stack_trace_regs(struct stack_trace *trace, | 17 | extern void save_stack_trace_regs(struct pt_regs *regs, |
18 | struct pt_regs *regs); | 18 | struct stack_trace *trace); |
19 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 19 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
20 | struct stack_trace *trace); | 20 | struct stack_trace *trace); |
21 | 21 | ||
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 9529e49b0385..0dddc9e42b6b 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -28,11 +28,21 @@ | |||
28 | 28 | ||
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | 30 | ||
31 | /* platform data for platform device structure's platform_data field */ | 31 | /* Platfrom data for platform device structure's platform_data field */ |
32 | |||
33 | struct stmmac_mdio_bus_data { | ||
34 | int bus_id; | ||
35 | int (*phy_reset)(void *priv); | ||
36 | unsigned int phy_mask; | ||
37 | int *irqs; | ||
38 | int probed_phy_irq; | ||
39 | }; | ||
32 | 40 | ||
33 | /* Private data for the STM on-board ethernet driver */ | ||
34 | struct plat_stmmacenet_data { | 41 | struct plat_stmmacenet_data { |
35 | int bus_id; | 42 | int bus_id; |
43 | int phy_addr; | ||
44 | int interface; | ||
45 | struct stmmac_mdio_bus_data *mdio_bus_data; | ||
36 | int pbl; | 46 | int pbl; |
37 | int clk_csr; | 47 | int clk_csr; |
38 | int has_gmac; | 48 | int has_gmac; |
@@ -40,6 +50,7 @@ struct plat_stmmacenet_data { | |||
40 | int tx_coe; | 50 | int tx_coe; |
41 | int bugged_jumbo; | 51 | int bugged_jumbo; |
42 | int pmt; | 52 | int pmt; |
53 | int force_sf_dma_mode; | ||
43 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 54 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
44 | void (*bus_setup)(void __iomem *ioaddr); | 55 | void (*bus_setup)(void __iomem *ioaddr); |
45 | int (*init)(struct platform_device *pdev); | 56 | int (*init)(struct platform_device *pdev); |
@@ -47,14 +58,4 @@ struct plat_stmmacenet_data { | |||
47 | void *custom_cfg; | 58 | void *custom_cfg; |
48 | void *bsp_priv; | 59 | void *bsp_priv; |
49 | }; | 60 | }; |
50 | |||
51 | struct plat_stmmacphy_data { | ||
52 | int bus_id; | ||
53 | int phy_addr; | ||
54 | unsigned int phy_mask; | ||
55 | int interface; | ||
56 | int (*phy_reset)(void *priv); | ||
57 | void *priv; | ||
58 | }; | ||
59 | #endif | 61 | #endif |
60 | |||
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 092dc9b1ce7d..2d04ea916760 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -94,7 +94,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask, | |||
94 | * stop_machine "Bogolock": stop the entire machine, disable | 94 | * stop_machine "Bogolock": stop the entire machine, disable |
95 | * interrupts. This is a very heavy lock, which is equivalent to | 95 | * interrupts. This is a very heavy lock, which is equivalent to |
96 | * grabbing every spinlock (and more). So the "read" side to such a | 96 | * grabbing every spinlock (and more). So the "read" side to such a |
97 | * lock is anything which disables preeempt. | 97 | * lock is anything which disables preemption. |
98 | */ | 98 | */ |
99 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 99 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
100 | 100 | ||
@@ -124,15 +124,19 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | |||
124 | */ | 124 | */ |
125 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | 125 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
126 | 126 | ||
127 | int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data, | ||
128 | const struct cpumask *cpus); | ||
129 | |||
127 | #else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ | 130 | #else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ |
128 | 131 | ||
129 | static inline int __stop_machine(int (*fn)(void *), void *data, | 132 | static inline int __stop_machine(int (*fn)(void *), void *data, |
130 | const struct cpumask *cpus) | 133 | const struct cpumask *cpus) |
131 | { | 134 | { |
135 | unsigned long flags; | ||
132 | int ret; | 136 | int ret; |
133 | local_irq_disable(); | 137 | local_irq_save(flags); |
134 | ret = fn(data); | 138 | ret = fn(data); |
135 | local_irq_enable(); | 139 | local_irq_restore(flags); |
136 | return ret; | 140 | return ret; |
137 | } | 141 | } |
138 | 142 | ||
@@ -142,5 +146,11 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
142 | return __stop_machine(fn, data, cpus); | 146 | return __stop_machine(fn, data, cpus); |
143 | } | 147 | } |
144 | 148 | ||
149 | static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data, | ||
150 | const struct cpumask *cpus) | ||
151 | { | ||
152 | return __stop_machine(fn, data, cpus); | ||
153 | } | ||
154 | |||
145 | #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ | 155 | #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ |
146 | #endif /* _LINUX_STOP_MACHINE */ | 156 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 8521067ed4f7..febc4dbec2ca 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/sunrpc/msg_prot.h> | 15 | #include <linux/sunrpc/msg_prot.h> |
16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
17 | 17 | ||
18 | #include <asm/atomic.h> | 18 | #include <linux/atomic.h> |
19 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
20 | 20 | ||
21 | /* size of the nodename buffer */ | 21 | /* size of the nodename buffer */ |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 082884295f80..f7f3ce340c08 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
31 | #include <linux/sunrpc/xprt.h> | 31 | #include <linux/sunrpc/xprt.h> |
32 | #include <linux/sunrpc/sched.h> | 32 | #include <linux/sunrpc/sched.h> |
33 | 33 | ||
34 | #ifdef CONFIG_NFS_V4_1 | 34 | #ifdef CONFIG_SUNRPC_BACKCHANNEL |
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | 35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); |
36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
@@ -47,7 +47,7 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
47 | return 1; | 47 | return 1; |
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | #else /* CONFIG_NFS_V4_1 */ | 50 | #else /* CONFIG_SUNRPC_BACKCHANNEL */ |
51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | 51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, |
52 | unsigned int min_reqs) | 52 | unsigned int min_reqs) |
53 | { | 53 | { |
@@ -62,6 +62,6 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) |
63 | { | 63 | { |
64 | } | 64 | } |
65 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
67 | 67 | ||
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 8d2eef1a8582..5efd8cef389e 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <asm/atomic.h> | 18 | #include <linux/atomic.h> |
19 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> |
20 | 20 | ||
21 | /* | 21 | /* |
@@ -256,13 +256,4 @@ static inline time_t get_expiry(char **bpp) | |||
256 | return rv - boot.tv_sec; | 256 | return rv - boot.tv_sec; |
257 | } | 257 | } |
258 | 258 | ||
259 | #ifdef CONFIG_NFSD_DEPRECATED | ||
260 | static inline void sunrpc_invalidate(struct cache_head *h, | ||
261 | struct cache_detail *detail) | ||
262 | { | ||
263 | h->expiry_time = seconds_since_boot() - 1; | ||
264 | detail->nextcheck = seconds_since_boot(); | ||
265 | } | ||
266 | #endif /* CONFIG_NFSD_DEPRECATED */ | ||
267 | |||
268 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ | 259 | #endif /* _LINUX_SUNRPC_CACHE_H_ */ |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index fe2d8e6b923b..e7756896f3ca 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -227,6 +227,10 @@ void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); | |||
227 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); | 227 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); |
228 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, | 228 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
229 | rpc_action action); | 229 | rpc_action action); |
230 | void rpc_sleep_on_priority(struct rpc_wait_queue *, | ||
231 | struct rpc_task *, | ||
232 | rpc_action action, | ||
233 | int priority); | ||
230 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, | 234 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, |
231 | struct rpc_task *); | 235 | struct rpc_task *); |
232 | void rpc_wake_up(struct rpc_wait_queue *); | 236 | void rpc_wake_up(struct rpc_wait_queue *); |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index ea29330b78bd..223588a976a0 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -92,7 +92,7 @@ struct svc_serv { | |||
92 | struct module * sv_module; /* optional module to count when | 92 | struct module * sv_module; /* optional module to count when |
93 | * adding threads */ | 93 | * adding threads */ |
94 | svc_thread_fn sv_function; /* main function for threads */ | 94 | svc_thread_fn sv_function; /* main function for threads */ |
95 | #if defined(CONFIG_NFS_V4_1) | 95 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
96 | struct list_head sv_cb_list; /* queue for callback requests | 96 | struct list_head sv_cb_list; /* queue for callback requests |
97 | * that arrive over the same | 97 | * that arrive over the same |
98 | * connection */ | 98 | * connection */ |
@@ -100,7 +100,7 @@ struct svc_serv { | |||
100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | 100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no |
101 | * entries in the svc_cb_list */ | 101 | * entries in the svc_cb_list */ |
102 | struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ | 102 | struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ |
103 | #endif /* CONFIG_NFS_V4_1 */ | 103 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
104 | }; | 104 | }; |
105 | 105 | ||
106 | /* | 106 | /* |
@@ -273,6 +273,7 @@ struct svc_rqst { | |||
273 | /* Catering to nfsd */ | 273 | /* Catering to nfsd */ |
274 | struct auth_domain * rq_client; /* RPC peer info */ | 274 | struct auth_domain * rq_client; /* RPC peer info */ |
275 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 275 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
276 | int rq_cachetype; | ||
276 | struct svc_cacherep * rq_cacherep; /* cache info */ | 277 | struct svc_cacherep * rq_cacherep; /* cache info */ |
277 | int rq_splice_ok; /* turned off in gss privacy | 278 | int rq_splice_ok; /* turned off in gss privacy |
278 | * to prevent encrypting page | 279 | * to prevent encrypting page |
diff --git a/include/linux/sunrpc/timer.h b/include/linux/sunrpc/timer.h index a67fd734c73b..697d6e69d61f 100644 --- a/include/linux/sunrpc/timer.h +++ b/include/linux/sunrpc/timer.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifndef _LINUX_SUNRPC_TIMER_H | 9 | #ifndef _LINUX_SUNRPC_TIMER_H |
10 | #define _LINUX_SUNRPC_TIMER_H | 10 | #define _LINUX_SUNRPC_TIMER_H |
11 | 11 | ||
12 | #include <asm/atomic.h> | 12 | #include <linux/atomic.h> |
13 | 13 | ||
14 | struct rpc_rtt { | 14 | struct rpc_rtt { |
15 | unsigned long timeo; /* default timeout value */ | 15 | unsigned long timeo; /* default timeout value */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 81cce3b3ee66..15518a152ac3 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
23 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
24 | #define RPC_MAX_SLOT_TABLE (128U) | 24 | #define RPC_MAX_SLOT_TABLE (128U) |
25 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * This describes a timeout strategy | 28 | * This describes a timeout strategy |
@@ -100,18 +101,18 @@ struct rpc_rqst { | |||
100 | ktime_t rq_xtime; /* transmit time stamp */ | 101 | ktime_t rq_xtime; /* transmit time stamp */ |
101 | int rq_ntrans; | 102 | int rq_ntrans; |
102 | 103 | ||
103 | #if defined(CONFIG_NFS_V4_1) | 104 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
104 | struct list_head rq_bc_list; /* Callback service list */ | 105 | struct list_head rq_bc_list; /* Callback service list */ |
105 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ | 106 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ |
106 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ | 107 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ |
107 | #endif /* CONFIG_NFS_V4_1 */ | 108 | #endif /* CONFIG_SUNRPC_BACKCHANEL */ |
108 | }; | 109 | }; |
109 | #define rq_svec rq_snd_buf.head | 110 | #define rq_svec rq_snd_buf.head |
110 | #define rq_slen rq_snd_buf.len | 111 | #define rq_slen rq_snd_buf.len |
111 | 112 | ||
112 | struct rpc_xprt_ops { | 113 | struct rpc_xprt_ops { |
113 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
114 | int (*reserve_xprt)(struct rpc_task *task); | 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
115 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
116 | void (*rpcbind)(struct rpc_task *task); | 117 | void (*rpcbind)(struct rpc_task *task); |
117 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 118 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
@@ -164,12 +165,12 @@ struct rpc_xprt { | |||
164 | 165 | ||
165 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ | 166 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ |
166 | struct rpc_wait_queue sending; /* requests waiting to send */ | 167 | struct rpc_wait_queue sending; /* requests waiting to send */ |
167 | struct rpc_wait_queue resend; /* requests waiting to resend */ | ||
168 | struct rpc_wait_queue pending; /* requests in flight */ | 168 | struct rpc_wait_queue pending; /* requests in flight */ |
169 | struct rpc_wait_queue backlog; /* waiting for slot */ | 169 | struct rpc_wait_queue backlog; /* waiting for slot */ |
170 | struct list_head free; /* free slots */ | 170 | struct list_head free; /* free slots */ |
171 | struct rpc_rqst * slot; /* slot table storage */ | 171 | unsigned int max_reqs; /* max number of slots */ |
172 | unsigned int max_reqs; /* total slots */ | 172 | unsigned int min_reqs; /* min number of slots */ |
173 | atomic_t num_reqs; /* total slots */ | ||
173 | unsigned long state; /* transport state */ | 174 | unsigned long state; /* transport state */ |
174 | unsigned char shutdown : 1, /* being shut down */ | 175 | unsigned char shutdown : 1, /* being shut down */ |
175 | resvport : 1; /* use a reserved port */ | 176 | resvport : 1; /* use a reserved port */ |
@@ -200,7 +201,7 @@ struct rpc_xprt { | |||
200 | u32 xid; /* Next XID value to use */ | 201 | u32 xid; /* Next XID value to use */ |
201 | struct rpc_task * snd_task; /* Task blocked in send */ | 202 | struct rpc_task * snd_task; /* Task blocked in send */ |
202 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | 203 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
203 | #if defined(CONFIG_NFS_V4_1) | 204 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
204 | struct svc_serv *bc_serv; /* The RPC service which will */ | 205 | struct svc_serv *bc_serv; /* The RPC service which will */ |
205 | /* process the callback */ | 206 | /* process the callback */ |
206 | unsigned int bc_alloc_count; /* Total number of preallocs */ | 207 | unsigned int bc_alloc_count; /* Total number of preallocs */ |
@@ -208,7 +209,7 @@ struct rpc_xprt { | |||
208 | * items */ | 209 | * items */ |
209 | struct list_head bc_pa_list; /* List of preallocated | 210 | struct list_head bc_pa_list; /* List of preallocated |
210 | * backchannel rpc_rqst's */ | 211 | * backchannel rpc_rqst's */ |
211 | #endif /* CONFIG_NFS_V4_1 */ | 212 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
212 | struct list_head recv; | 213 | struct list_head recv; |
213 | 214 | ||
214 | struct { | 215 | struct { |
@@ -228,15 +229,15 @@ struct rpc_xprt { | |||
228 | const char *address_strings[RPC_DISPLAY_MAX]; | 229 | const char *address_strings[RPC_DISPLAY_MAX]; |
229 | }; | 230 | }; |
230 | 231 | ||
231 | #if defined(CONFIG_NFS_V4_1) | 232 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
232 | /* | 233 | /* |
233 | * Backchannel flags | 234 | * Backchannel flags |
234 | */ | 235 | */ |
235 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ | 236 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ |
236 | /* buffer in use */ | 237 | /* buffer in use */ |
237 | #endif /* CONFIG_NFS_V4_1 */ | 238 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
238 | 239 | ||
239 | #if defined(CONFIG_NFS_V4_1) | 240 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
240 | static inline int bc_prealloc(struct rpc_rqst *req) | 241 | static inline int bc_prealloc(struct rpc_rqst *req) |
241 | { | 242 | { |
242 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); | 243 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); |
@@ -246,7 +247,7 @@ static inline int bc_prealloc(struct rpc_rqst *req) | |||
246 | { | 247 | { |
247 | return 0; | 248 | return 0; |
248 | } | 249 | } |
249 | #endif /* CONFIG_NFS_V4_1 */ | 250 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
250 | 251 | ||
251 | struct xprt_create { | 252 | struct xprt_create { |
252 | int ident; /* XPRT_TRANSPORT identifier */ | 253 | int ident; /* XPRT_TRANSPORT identifier */ |
@@ -271,8 +272,8 @@ struct xprt_class { | |||
271 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); | 272 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); |
272 | void xprt_connect(struct rpc_task *task); | 273 | void xprt_connect(struct rpc_task *task); |
273 | void xprt_reserve(struct rpc_task *task); | 274 | void xprt_reserve(struct rpc_task *task); |
274 | int xprt_reserve_xprt(struct rpc_task *task); | 275 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
275 | int xprt_reserve_xprt_cong(struct rpc_task *task); | 276 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
276 | int xprt_prepare_transmit(struct rpc_task *task); | 277 | int xprt_prepare_transmit(struct rpc_task *task); |
277 | void xprt_transmit(struct rpc_task *task); | 278 | void xprt_transmit(struct rpc_task *task); |
278 | void xprt_end_transmit(struct rpc_task *task); | 279 | void xprt_end_transmit(struct rpc_task *task); |
@@ -282,7 +283,9 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | |||
282 | void xprt_release(struct rpc_task *task); | 283 | void xprt_release(struct rpc_task *task); |
283 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); | 284 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
284 | void xprt_put(struct rpc_xprt *xprt); | 285 | void xprt_put(struct rpc_xprt *xprt); |
285 | struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req); | 286 | struct rpc_xprt * xprt_alloc(struct net *net, size_t size, |
287 | unsigned int num_prealloc, | ||
288 | unsigned int max_req); | ||
286 | void xprt_free(struct rpc_xprt *); | 289 | void xprt_free(struct rpc_xprt *); |
287 | 290 | ||
288 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) | 291 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) |
@@ -321,7 +324,6 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | |||
321 | #define XPRT_CLOSING (6) | 324 | #define XPRT_CLOSING (6) |
322 | #define XPRT_CONNECTION_ABORT (7) | 325 | #define XPRT_CONNECTION_ABORT (7) |
323 | #define XPRT_CONNECTION_CLOSE (8) | 326 | #define XPRT_CONNECTION_CLOSE (8) |
324 | #define XPRT_INITIALIZED (9) | ||
325 | 327 | ||
326 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 328 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
327 | { | 329 | { |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 083ffea7ba18..6bbcef22e105 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t; | |||
92 | * @enter() and @wake(), even if any of them fails. It is executed after | 92 | * @enter() and @wake(), even if any of them fails. It is executed after |
93 | * a failing @prepare. | 93 | * a failing @prepare. |
94 | * | 94 | * |
95 | * @suspend_again: Returns whether the system should suspend again (true) or | ||
96 | * not (false). If the platform wants to poll sensors or execute some | ||
97 | * code during suspended without invoking userspace and most of devices, | ||
98 | * suspend_again callback is the place assuming that periodic-wakeup or | ||
99 | * alarm-wakeup is already setup. This allows to execute some codes while | ||
100 | * being kept suspended in the view of userland and devices. | ||
101 | * | ||
95 | * @end: Called by the PM core right after resuming devices, to indicate to | 102 | * @end: Called by the PM core right after resuming devices, to indicate to |
96 | * the platform that the system has returned to the working state or | 103 | * the platform that the system has returned to the working state or |
97 | * the transition to the sleep state has been aborted. | 104 | * the transition to the sleep state has been aborted. |
@@ -113,6 +120,7 @@ struct platform_suspend_ops { | |||
113 | int (*enter)(suspend_state_t state); | 120 | int (*enter)(suspend_state_t state); |
114 | void (*wake)(void); | 121 | void (*wake)(void); |
115 | void (*finish)(void); | 122 | void (*finish)(void); |
123 | bool (*suspend_again)(void); | ||
116 | void (*end)(void); | 124 | void (*end)(void); |
117 | void (*recover)(void); | 125 | void (*recover)(void); |
118 | }; | 126 | }; |
@@ -260,6 +268,14 @@ static inline int hibernate(void) { return -ENOSYS; } | |||
260 | static inline bool system_entering_hibernation(void) { return false; } | 268 | static inline bool system_entering_hibernation(void) { return false; } |
261 | #endif /* CONFIG_HIBERNATION */ | 269 | #endif /* CONFIG_HIBERNATION */ |
262 | 270 | ||
271 | /* Hibernation and suspend events */ | ||
272 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | ||
273 | #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ | ||
274 | #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */ | ||
275 | #define PM_POST_SUSPEND 0x0004 /* Suspend finished */ | ||
276 | #define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */ | ||
277 | #define PM_POST_RESTORE 0x0006 /* Restore failed */ | ||
278 | |||
263 | #ifdef CONFIG_PM_SLEEP | 279 | #ifdef CONFIG_PM_SLEEP |
264 | void save_processor_state(void); | 280 | void save_processor_state(void); |
265 | void restore_processor_state(void); | 281 | void restore_processor_state(void); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a273468f8285..14d62490922e 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/node.h> | 10 | #include <linux/node.h> |
11 | 11 | ||
12 | #include <asm/atomic.h> | 12 | #include <linux/atomic.h> |
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | 14 | ||
15 | struct notifier_block; | 15 | struct notifier_block; |
@@ -251,14 +251,6 @@ static inline void lru_cache_add_file(struct page *page) | |||
251 | /* linux/mm/vmscan.c */ | 251 | /* linux/mm/vmscan.c */ |
252 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | 252 | extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, |
253 | gfp_t gfp_mask, nodemask_t *mask); | 253 | gfp_t gfp_mask, nodemask_t *mask); |
254 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
255 | gfp_t gfp_mask, bool noswap, | ||
256 | unsigned int swappiness); | ||
257 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
258 | gfp_t gfp_mask, bool noswap, | ||
259 | unsigned int swappiness, | ||
260 | struct zone *zone, | ||
261 | unsigned long *nr_scanned); | ||
262 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 254 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
263 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 255 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
264 | extern int vm_swappiness; | 256 | extern int vm_swappiness; |
@@ -299,7 +291,14 @@ static inline void scan_unevictable_unregister_node(struct node *node) | |||
299 | 291 | ||
300 | extern int kswapd_run(int nid); | 292 | extern int kswapd_run(int nid); |
301 | extern void kswapd_stop(int nid); | 293 | extern void kswapd_stop(int nid); |
302 | 294 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | |
295 | extern int mem_cgroup_swappiness(struct mem_cgroup *mem); | ||
296 | #else | ||
297 | static inline int mem_cgroup_swappiness(struct mem_cgroup *mem) | ||
298 | { | ||
299 | return vm_swappiness; | ||
300 | } | ||
301 | #endif | ||
303 | #ifdef CONFIG_SWAP | 302 | #ifdef CONFIG_SWAP |
304 | /* linux/mm/page_io.c */ | 303 | /* linux/mm/page_io.c */ |
305 | extern int swap_readpage(struct page *); | 304 | extern int swap_readpage(struct page *); |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index cd42e30b7c6e..2189d3ffc85d 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifndef _LINUX_SWAPOPS_H | ||
2 | #define _LINUX_SWAPOPS_H | ||
3 | |||
4 | #include <linux/radix-tree.h> | ||
5 | |||
1 | /* | 6 | /* |
2 | * swapcache pages are stored in the swapper_space radix tree. We want to | 7 | * swapcache pages are stored in the swapper_space radix tree. We want to |
3 | * get good packing density in that tree, so the index should be dense in | 8 | * get good packing density in that tree, so the index should be dense in |
@@ -76,6 +81,22 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) | |||
76 | return __swp_entry_to_pte(arch_entry); | 81 | return __swp_entry_to_pte(arch_entry); |
77 | } | 82 | } |
78 | 83 | ||
84 | static inline swp_entry_t radix_to_swp_entry(void *arg) | ||
85 | { | ||
86 | swp_entry_t entry; | ||
87 | |||
88 | entry.val = (unsigned long)arg >> RADIX_TREE_EXCEPTIONAL_SHIFT; | ||
89 | return entry; | ||
90 | } | ||
91 | |||
92 | static inline void *swp_to_radix_entry(swp_entry_t entry) | ||
93 | { | ||
94 | unsigned long value; | ||
95 | |||
96 | value = entry.val << RADIX_TREE_EXCEPTIONAL_SHIFT; | ||
97 | return (void *)(value | RADIX_TREE_EXCEPTIONAL_ENTRY); | ||
98 | } | ||
99 | |||
79 | #ifdef CONFIG_MIGRATION | 100 | #ifdef CONFIG_MIGRATION |
80 | static inline swp_entry_t make_migration_entry(struct page *page, int write) | 101 | static inline swp_entry_t make_migration_entry(struct page *page, int write) |
81 | { | 102 | { |
@@ -169,3 +190,5 @@ static inline int non_swap_entry(swp_entry_t entry) | |||
169 | return 0; | 190 | return 0; |
170 | } | 191 | } |
171 | #endif | 192 | #endif |
193 | |||
194 | #endif /* _LINUX_SWAPOPS_H */ | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index e2696d76a599..d7d2f2158142 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/lockdep.h> | 18 | #include <linux/lockdep.h> |
19 | #include <linux/kobject_ns.h> | 19 | #include <linux/kobject_ns.h> |
20 | #include <asm/atomic.h> | 20 | #include <linux/atomic.h> |
21 | 21 | ||
22 | struct kobject; | 22 | struct kobject; |
23 | struct module; | 23 | struct module; |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index 7138962664f8..b11f8ce2d3c0 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -67,7 +67,7 @@ enum { | |||
67 | TCF_META_ID_SK_FORWARD_ALLOCS, | 67 | TCF_META_ID_SK_FORWARD_ALLOCS, |
68 | TCF_META_ID_SK_SNDBUF, | 68 | TCF_META_ID_SK_SNDBUF, |
69 | TCF_META_ID_SK_ALLOCS, | 69 | TCF_META_ID_SK_ALLOCS, |
70 | TCF_META_ID_SK_ROUTE_CAPS, | 70 | __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */ |
71 | TCF_META_ID_SK_HASH, | 71 | TCF_META_ID_SK_HASH, |
72 | TCF_META_ID_SK_LINGERTIME, | 72 | TCF_META_ID_SK_LINGERTIME, |
73 | TCF_META_ID_SK_ACK_BACKLOG, | 73 | TCF_META_ID_SK_ACK_BACKLOG, |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index e64f4c67d0ef..531ede8006d9 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -282,6 +282,7 @@ struct tcp_request_sock { | |||
282 | #endif | 282 | #endif |
283 | u32 rcv_isn; | 283 | u32 rcv_isn; |
284 | u32 snt_isn; | 284 | u32 snt_isn; |
285 | u32 snt_synack; /* synack sent time */ | ||
285 | }; | 286 | }; |
286 | 287 | ||
287 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | 288 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index d3ec89fb4122..47b4a27e6e97 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -85,22 +85,6 @@ struct thermal_cooling_device { | |||
85 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | 85 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) |
86 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | 86 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) |
87 | 87 | ||
88 | #if defined(CONFIG_THERMAL_HWMON) | ||
89 | /* thermal zone devices with the same type share one hwmon device */ | ||
90 | struct thermal_hwmon_device { | ||
91 | char type[THERMAL_NAME_LENGTH]; | ||
92 | struct device *device; | ||
93 | int count; | ||
94 | struct list_head tz_list; | ||
95 | struct list_head node; | ||
96 | }; | ||
97 | |||
98 | struct thermal_hwmon_attr { | ||
99 | struct device_attribute attr; | ||
100 | char name[16]; | ||
101 | }; | ||
102 | #endif | ||
103 | |||
104 | struct thermal_zone_device { | 88 | struct thermal_zone_device { |
105 | int id; | 89 | int id; |
106 | char type[THERMAL_NAME_LENGTH]; | 90 | char type[THERMAL_NAME_LENGTH]; |
@@ -120,12 +104,6 @@ struct thermal_zone_device { | |||
120 | struct mutex lock; /* protect cooling devices list */ | 104 | struct mutex lock; /* protect cooling devices list */ |
121 | struct list_head node; | 105 | struct list_head node; |
122 | struct delayed_work poll_queue; | 106 | struct delayed_work poll_queue; |
123 | #if defined(CONFIG_THERMAL_HWMON) | ||
124 | struct list_head hwmon_node; | ||
125 | struct thermal_hwmon_device *hwmon; | ||
126 | struct thermal_hwmon_attr temp_input; /* hwmon sys attr */ | ||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | ||
128 | #endif | ||
129 | }; | 107 | }; |
130 | /* Adding event notification support elements */ | 108 | /* Adding event notification support elements */ |
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | 109 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index e95f5236611f..a71a2927a6a0 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -51,27 +51,12 @@ | |||
51 | #include <linux/security.h> | 51 | #include <linux/security.h> |
52 | struct linux_binprm; | 52 | struct linux_binprm; |
53 | 53 | ||
54 | /** | ||
55 | * tracehook_expect_breakpoints - guess if task memory might be touched | ||
56 | * @task: current task, making a new mapping | ||
57 | * | ||
58 | * Return nonzero if @task is expected to want breakpoint insertion in | ||
59 | * its memory at some point. A zero return is no guarantee it won't | ||
60 | * be done, but this is a hint that it's known to be likely. | ||
61 | * | ||
62 | * May be called with @task->mm->mmap_sem held for writing. | ||
63 | */ | ||
64 | static inline int tracehook_expect_breakpoints(struct task_struct *task) | ||
65 | { | ||
66 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
67 | } | ||
68 | |||
69 | /* | 54 | /* |
70 | * ptrace report for syscall entry and exit looks identical. | 55 | * ptrace report for syscall entry and exit looks identical. |
71 | */ | 56 | */ |
72 | static inline void ptrace_report_syscall(struct pt_regs *regs) | 57 | static inline void ptrace_report_syscall(struct pt_regs *regs) |
73 | { | 58 | { |
74 | int ptrace = task_ptrace(current); | 59 | int ptrace = current->ptrace; |
75 | 60 | ||
76 | if (!(ptrace & PT_PTRACED)) | 61 | if (!(ptrace & PT_PTRACED)) |
77 | return; | 62 | return; |
@@ -145,229 +130,6 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | |||
145 | } | 130 | } |
146 | 131 | ||
147 | /** | 132 | /** |
148 | * tracehook_unsafe_exec - check for exec declared unsafe due to tracing | ||
149 | * @task: current task doing exec | ||
150 | * | ||
151 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. | ||
152 | * | ||
153 | * @task->signal->cred_guard_mutex is held by the caller through the do_execve(). | ||
154 | */ | ||
155 | static inline int tracehook_unsafe_exec(struct task_struct *task) | ||
156 | { | ||
157 | int unsafe = 0; | ||
158 | int ptrace = task_ptrace(task); | ||
159 | if (ptrace & PT_PTRACED) { | ||
160 | if (ptrace & PT_PTRACE_CAP) | ||
161 | unsafe |= LSM_UNSAFE_PTRACE_CAP; | ||
162 | else | ||
163 | unsafe |= LSM_UNSAFE_PTRACE; | ||
164 | } | ||
165 | return unsafe; | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * tracehook_tracer_task - return the task that is tracing the given task | ||
170 | * @tsk: task to consider | ||
171 | * | ||
172 | * Returns NULL if no one is tracing @task, or the &struct task_struct | ||
173 | * pointer to its tracer. | ||
174 | * | ||
175 | * Must called under rcu_read_lock(). The pointer returned might be kept | ||
176 | * live only by RCU. During exec, this may be called with task_lock() | ||
177 | * held on @task, still held from when tracehook_unsafe_exec() was called. | ||
178 | */ | ||
179 | static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk) | ||
180 | { | ||
181 | if (task_ptrace(tsk) & PT_PTRACED) | ||
182 | return rcu_dereference(tsk->parent); | ||
183 | return NULL; | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * tracehook_report_exec - a successful exec was completed | ||
188 | * @fmt: &struct linux_binfmt that performed the exec | ||
189 | * @bprm: &struct linux_binprm containing exec details | ||
190 | * @regs: user-mode register state | ||
191 | * | ||
192 | * An exec just completed, we are shortly going to return to user mode. | ||
193 | * The freshly initialized register state can be seen and changed in @regs. | ||
194 | * The name, file and other pointers in @bprm are still on hand to be | ||
195 | * inspected, but will be freed as soon as this returns. | ||
196 | * | ||
197 | * Called with no locks, but with some kernel resources held live | ||
198 | * and a reference on @fmt->module. | ||
199 | */ | ||
200 | static inline void tracehook_report_exec(struct linux_binfmt *fmt, | ||
201 | struct linux_binprm *bprm, | ||
202 | struct pt_regs *regs) | ||
203 | { | ||
204 | if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) && | ||
205 | unlikely(task_ptrace(current) & PT_PTRACED)) | ||
206 | send_sig(SIGTRAP, current, 0); | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * tracehook_report_exit - task has begun to exit | ||
211 | * @exit_code: pointer to value destined for @current->exit_code | ||
212 | * | ||
213 | * @exit_code points to the value passed to do_exit(), which tracing | ||
214 | * might change here. This is almost the first thing in do_exit(), | ||
215 | * before freeing any resources or setting the %PF_EXITING flag. | ||
216 | * | ||
217 | * Called with no locks held. | ||
218 | */ | ||
219 | static inline void tracehook_report_exit(long *exit_code) | ||
220 | { | ||
221 | ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code); | ||
222 | } | ||
223 | |||
224 | /** | ||
225 | * tracehook_prepare_clone - prepare for new child to be cloned | ||
226 | * @clone_flags: %CLONE_* flags from clone/fork/vfork system call | ||
227 | * | ||
228 | * This is called before a new user task is to be cloned. | ||
229 | * Its return value will be passed to tracehook_finish_clone(). | ||
230 | * | ||
231 | * Called with no locks held. | ||
232 | */ | ||
233 | static inline int tracehook_prepare_clone(unsigned clone_flags) | ||
234 | { | ||
235 | if (clone_flags & CLONE_UNTRACED) | ||
236 | return 0; | ||
237 | |||
238 | if (clone_flags & CLONE_VFORK) { | ||
239 | if (current->ptrace & PT_TRACE_VFORK) | ||
240 | return PTRACE_EVENT_VFORK; | ||
241 | } else if ((clone_flags & CSIGNAL) != SIGCHLD) { | ||
242 | if (current->ptrace & PT_TRACE_CLONE) | ||
243 | return PTRACE_EVENT_CLONE; | ||
244 | } else if (current->ptrace & PT_TRACE_FORK) | ||
245 | return PTRACE_EVENT_FORK; | ||
246 | |||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | /** | ||
251 | * tracehook_finish_clone - new child created and being attached | ||
252 | * @child: new child task | ||
253 | * @clone_flags: %CLONE_* flags from clone/fork/vfork system call | ||
254 | * @trace: return value from tracehook_prepare_clone() | ||
255 | * | ||
256 | * This is called immediately after adding @child to its parent's children list. | ||
257 | * The @trace value is that returned by tracehook_prepare_clone(). | ||
258 | * | ||
259 | * Called with current's siglock and write_lock_irq(&tasklist_lock) held. | ||
260 | */ | ||
261 | static inline void tracehook_finish_clone(struct task_struct *child, | ||
262 | unsigned long clone_flags, int trace) | ||
263 | { | ||
264 | ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace); | ||
265 | } | ||
266 | |||
267 | /** | ||
268 | * tracehook_report_clone - in parent, new child is about to start running | ||
269 | * @regs: parent's user register state | ||
270 | * @clone_flags: flags from parent's system call | ||
271 | * @pid: new child's PID in the parent's namespace | ||
272 | * @child: new child task | ||
273 | * | ||
274 | * Called after a child is set up, but before it has been started running. | ||
275 | * This is not a good place to block, because the child has not started | ||
276 | * yet. Suspend the child here if desired, and then block in | ||
277 | * tracehook_report_clone_complete(). This must prevent the child from | ||
278 | * self-reaping if tracehook_report_clone_complete() uses the @child | ||
279 | * pointer; otherwise it might have died and been released by the time | ||
280 | * tracehook_report_clone_complete() is called. | ||
281 | * | ||
282 | * Called with no locks held, but the child cannot run until this returns. | ||
283 | */ | ||
284 | static inline void tracehook_report_clone(struct pt_regs *regs, | ||
285 | unsigned long clone_flags, | ||
286 | pid_t pid, struct task_struct *child) | ||
287 | { | ||
288 | if (unlikely(task_ptrace(child))) { | ||
289 | /* | ||
290 | * It doesn't matter who attached/attaching to this | ||
291 | * task, the pending SIGSTOP is right in any case. | ||
292 | */ | ||
293 | sigaddset(&child->pending.signal, SIGSTOP); | ||
294 | set_tsk_thread_flag(child, TIF_SIGPENDING); | ||
295 | } | ||
296 | } | ||
297 | |||
298 | /** | ||
299 | * tracehook_report_clone_complete - new child is running | ||
300 | * @trace: return value from tracehook_prepare_clone() | ||
301 | * @regs: parent's user register state | ||
302 | * @clone_flags: flags from parent's system call | ||
303 | * @pid: new child's PID in the parent's namespace | ||
304 | * @child: child task, already running | ||
305 | * | ||
306 | * This is called just after the child has started running. This is | ||
307 | * just before the clone/fork syscall returns, or blocks for vfork | ||
308 | * child completion if @clone_flags has the %CLONE_VFORK bit set. | ||
309 | * The @child pointer may be invalid if a self-reaping child died and | ||
310 | * tracehook_report_clone() took no action to prevent it from self-reaping. | ||
311 | * | ||
312 | * Called with no locks held. | ||
313 | */ | ||
314 | static inline void tracehook_report_clone_complete(int trace, | ||
315 | struct pt_regs *regs, | ||
316 | unsigned long clone_flags, | ||
317 | pid_t pid, | ||
318 | struct task_struct *child) | ||
319 | { | ||
320 | if (unlikely(trace)) | ||
321 | ptrace_event(0, trace, pid); | ||
322 | } | ||
323 | |||
324 | /** | ||
325 | * tracehook_report_vfork_done - vfork parent's child has exited or exec'd | ||
326 | * @child: child task, already running | ||
327 | * @pid: new child's PID in the parent's namespace | ||
328 | * | ||
329 | * Called after a %CLONE_VFORK parent has waited for the child to complete. | ||
330 | * The clone/vfork system call will return immediately after this. | ||
331 | * The @child pointer may be invalid if a self-reaping child died and | ||
332 | * tracehook_report_clone() took no action to prevent it from self-reaping. | ||
333 | * | ||
334 | * Called with no locks held. | ||
335 | */ | ||
336 | static inline void tracehook_report_vfork_done(struct task_struct *child, | ||
337 | pid_t pid) | ||
338 | { | ||
339 | ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * tracehook_prepare_release_task - task is being reaped, clean up tracing | ||
344 | * @task: task in %EXIT_DEAD state | ||
345 | * | ||
346 | * This is called in release_task() just before @task gets finally reaped | ||
347 | * and freed. This would be the ideal place to remove and clean up any | ||
348 | * tracing-related state for @task. | ||
349 | * | ||
350 | * Called with no locks held. | ||
351 | */ | ||
352 | static inline void tracehook_prepare_release_task(struct task_struct *task) | ||
353 | { | ||
354 | } | ||
355 | |||
356 | /** | ||
357 | * tracehook_finish_release_task - final tracing clean-up | ||
358 | * @task: task in %EXIT_DEAD state | ||
359 | * | ||
360 | * This is called in release_task() when @task is being in the middle of | ||
361 | * being reaped. After this, there must be no tracing entanglements. | ||
362 | * | ||
363 | * Called with write_lock_irq(&tasklist_lock) held. | ||
364 | */ | ||
365 | static inline void tracehook_finish_release_task(struct task_struct *task) | ||
366 | { | ||
367 | ptrace_release_task(task); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * tracehook_signal_handler - signal handler setup is complete | 133 | * tracehook_signal_handler - signal handler setup is complete |
372 | * @sig: number of signal being delivered | 134 | * @sig: number of signal being delivered |
373 | * @info: siginfo_t of signal being delivered | 135 | * @info: siginfo_t of signal being delivered |
@@ -390,151 +152,6 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info, | |||
390 | ptrace_notify(SIGTRAP); | 152 | ptrace_notify(SIGTRAP); |
391 | } | 153 | } |
392 | 154 | ||
393 | /** | ||
394 | * tracehook_consider_ignored_signal - suppress short-circuit of ignored signal | ||
395 | * @task: task receiving the signal | ||
396 | * @sig: signal number being sent | ||
397 | * | ||
398 | * Return zero iff tracing doesn't care to examine this ignored signal, | ||
399 | * so it can short-circuit normal delivery and never even get queued. | ||
400 | * | ||
401 | * Called with @task->sighand->siglock held. | ||
402 | */ | ||
403 | static inline int tracehook_consider_ignored_signal(struct task_struct *task, | ||
404 | int sig) | ||
405 | { | ||
406 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
407 | } | ||
408 | |||
409 | /** | ||
410 | * tracehook_consider_fatal_signal - suppress special handling of fatal signal | ||
411 | * @task: task receiving the signal | ||
412 | * @sig: signal number being sent | ||
413 | * | ||
414 | * Return nonzero to prevent special handling of this termination signal. | ||
415 | * Normally handler for signal is %SIG_DFL. It can be %SIG_IGN if @sig is | ||
416 | * ignored, in which case force_sig() is about to reset it to %SIG_DFL. | ||
417 | * When this returns zero, this signal might cause a quick termination | ||
418 | * that does not give the debugger a chance to intercept the signal. | ||
419 | * | ||
420 | * Called with or without @task->sighand->siglock held. | ||
421 | */ | ||
422 | static inline int tracehook_consider_fatal_signal(struct task_struct *task, | ||
423 | int sig) | ||
424 | { | ||
425 | return (task_ptrace(task) & PT_PTRACED) != 0; | ||
426 | } | ||
427 | |||
428 | /** | ||
429 | * tracehook_force_sigpending - let tracing force signal_pending(current) on | ||
430 | * | ||
431 | * Called when recomputing our signal_pending() flag. Return nonzero | ||
432 | * to force the signal_pending() flag on, so that tracehook_get_signal() | ||
433 | * will be called before the next return to user mode. | ||
434 | * | ||
435 | * Called with @current->sighand->siglock held. | ||
436 | */ | ||
437 | static inline int tracehook_force_sigpending(void) | ||
438 | { | ||
439 | return 0; | ||
440 | } | ||
441 | |||
442 | /** | ||
443 | * tracehook_get_signal - deliver synthetic signal to traced task | ||
444 | * @task: @current | ||
445 | * @regs: task_pt_regs(@current) | ||
446 | * @info: details of synthetic signal | ||
447 | * @return_ka: sigaction for synthetic signal | ||
448 | * | ||
449 | * Return zero to check for a real pending signal normally. | ||
450 | * Return -1 after releasing the siglock to repeat the check. | ||
451 | * Return a signal number to induce an artificial signal delivery, | ||
452 | * setting *@info and *@return_ka to specify its details and behavior. | ||
453 | * | ||
454 | * The @return_ka->sa_handler value controls the disposition of the | ||
455 | * signal, no matter the signal number. For %SIG_DFL, the return value | ||
456 | * is a representative signal to indicate the behavior (e.g. %SIGTERM | ||
457 | * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop, | ||
458 | * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number | ||
459 | * reported will be @info->si_signo instead. | ||
460 | * | ||
461 | * Called with @task->sighand->siglock held, before dequeuing pending signals. | ||
462 | */ | ||
463 | static inline int tracehook_get_signal(struct task_struct *task, | ||
464 | struct pt_regs *regs, | ||
465 | siginfo_t *info, | ||
466 | struct k_sigaction *return_ka) | ||
467 | { | ||
468 | return 0; | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * tracehook_finish_jctl - report about return from job control stop | ||
473 | * | ||
474 | * This is called by do_signal_stop() after wakeup. | ||
475 | */ | ||
476 | static inline void tracehook_finish_jctl(void) | ||
477 | { | ||
478 | } | ||
479 | |||
480 | #define DEATH_REAP -1 | ||
481 | #define DEATH_DELAYED_GROUP_LEADER -2 | ||
482 | |||
483 | /** | ||
484 | * tracehook_notify_death - task is dead, ready to notify parent | ||
485 | * @task: @current task now exiting | ||
486 | * @death_cookie: value to pass to tracehook_report_death() | ||
487 | * @group_dead: nonzero if this was the last thread in the group to die | ||
488 | * | ||
489 | * A return value >= 0 means call do_notify_parent() with that signal | ||
490 | * number. Negative return value can be %DEATH_REAP to self-reap right | ||
491 | * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our | ||
492 | * parent. Note that a return value of 0 means a do_notify_parent() call | ||
493 | * that sends no signal, but still wakes up a parent blocked in wait*(). | ||
494 | * | ||
495 | * Called with write_lock_irq(&tasklist_lock) held. | ||
496 | */ | ||
497 | static inline int tracehook_notify_death(struct task_struct *task, | ||
498 | void **death_cookie, int group_dead) | ||
499 | { | ||
500 | if (task_detached(task)) | ||
501 | return task->ptrace ? SIGCHLD : DEATH_REAP; | ||
502 | |||
503 | /* | ||
504 | * If something other than our normal parent is ptracing us, then | ||
505 | * send it a SIGCHLD instead of honoring exit_signal. exit_signal | ||
506 | * only has special meaning to our real parent. | ||
507 | */ | ||
508 | if (thread_group_empty(task) && !ptrace_reparented(task)) | ||
509 | return task->exit_signal; | ||
510 | |||
511 | return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER; | ||
512 | } | ||
513 | |||
514 | /** | ||
515 | * tracehook_report_death - task is dead and ready to be reaped | ||
516 | * @task: @current task now exiting | ||
517 | * @signal: return value from tracheook_notify_death() | ||
518 | * @death_cookie: value passed back from tracehook_notify_death() | ||
519 | * @group_dead: nonzero if this was the last thread in the group to die | ||
520 | * | ||
521 | * Thread has just become a zombie or is about to self-reap. If positive, | ||
522 | * @signal is the signal number just sent to the parent (usually %SIGCHLD). | ||
523 | * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is | ||
524 | * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie. | ||
525 | * The @death_cookie was passed back by tracehook_notify_death(). | ||
526 | * | ||
527 | * If normal reaping is not inhibited, @task->exit_state might be changing | ||
528 | * in parallel. | ||
529 | * | ||
530 | * Called without locks. | ||
531 | */ | ||
532 | static inline void tracehook_report_death(struct task_struct *task, | ||
533 | int signal, void *death_cookie, | ||
534 | int group_dead) | ||
535 | { | ||
536 | } | ||
537 | |||
538 | #ifdef TIF_NOTIFY_RESUME | 155 | #ifdef TIF_NOTIFY_RESUME |
539 | /** | 156 | /** |
540 | * set_notify_resume - cause tracehook_notify_resume() to be called | 157 | * set_notify_resume - cause tracehook_notify_resume() to be called |
diff --git a/include/linux/tty.h b/include/linux/tty.h index d6f05292e456..44bc0c5617e1 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -5,24 +5,6 @@ | |||
5 | * 'tty.h' defines some structures used by tty_io.c and some defines. | 5 | * 'tty.h' defines some structures used by tty_io.c and some defines. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifdef __KERNEL__ | ||
9 | #include <linux/fs.h> | ||
10 | #include <linux/major.h> | ||
11 | #include <linux/termios.h> | ||
12 | #include <linux/workqueue.h> | ||
13 | #include <linux/tty_driver.h> | ||
14 | #include <linux/tty_ldisc.h> | ||
15 | #include <linux/mutex.h> | ||
16 | |||
17 | #include <asm/system.h> | ||
18 | |||
19 | |||
20 | /* | ||
21 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are | ||
22 | * hardcoded at present.) | ||
23 | */ | ||
24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | ||
25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | ||
26 | #define NR_LDISCS 30 | 8 | #define NR_LDISCS 30 |
27 | 9 | ||
28 | /* line disciplines */ | 10 | /* line disciplines */ |
@@ -53,6 +35,25 @@ | |||
53 | #define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */ | 35 | #define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */ |
54 | #define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */ | 36 | #define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */ |
55 | 37 | ||
38 | #ifdef __KERNEL__ | ||
39 | #include <linux/fs.h> | ||
40 | #include <linux/major.h> | ||
41 | #include <linux/termios.h> | ||
42 | #include <linux/workqueue.h> | ||
43 | #include <linux/tty_driver.h> | ||
44 | #include <linux/tty_ldisc.h> | ||
45 | #include <linux/mutex.h> | ||
46 | |||
47 | #include <asm/system.h> | ||
48 | |||
49 | |||
50 | /* | ||
51 | * (Note: the *_driver.minor_start values 1, 64, 128, 192 are | ||
52 | * hardcoded at present.) | ||
53 | */ | ||
54 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | ||
55 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | ||
56 | |||
56 | /* | 57 | /* |
57 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 58 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
58 | * a c_cc[] character, but indicates that a particular special character | 59 | * a c_cc[] character, but indicates that a particular special character |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index b78cba466d3d..a316fba73518 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -59,6 +59,10 @@ struct usb_configuration; | |||
59 | * @hs_descriptors: Table of high speed descriptors, using interface and | 59 | * @hs_descriptors: Table of high speed descriptors, using interface and |
60 | * string identifiers assigned during @bind(). If this pointer is null, | 60 | * string identifiers assigned during @bind(). If this pointer is null, |
61 | * the function will not be available at high speed. | 61 | * the function will not be available at high speed. |
62 | * @ss_descriptors: Table of super speed descriptors, using interface and | ||
63 | * string identifiers assigned during @bind(). If this | ||
64 | * pointer is null after initiation, the function will not | ||
65 | * be available at super speed. | ||
62 | * @config: assigned when @usb_add_function() is called; this is the | 66 | * @config: assigned when @usb_add_function() is called; this is the |
63 | * configuration with which this function is associated. | 67 | * configuration with which this function is associated. |
64 | * @bind: Before the gadget can register, all of its functions bind() to the | 68 | * @bind: Before the gadget can register, all of its functions bind() to the |
@@ -77,6 +81,10 @@ struct usb_configuration; | |||
77 | * @setup: Used for interface-specific control requests. | 81 | * @setup: Used for interface-specific control requests. |
78 | * @suspend: Notifies functions when the host stops sending USB traffic. | 82 | * @suspend: Notifies functions when the host stops sending USB traffic. |
79 | * @resume: Notifies functions when the host restarts USB traffic. | 83 | * @resume: Notifies functions when the host restarts USB traffic. |
84 | * @get_status: Returns function status as a reply to | ||
85 | * GetStatus() request when the recepient is Interface. | ||
86 | * @func_suspend: callback to be called when | ||
87 | * SetFeature(FUNCTION_SUSPEND) is reseived | ||
80 | * | 88 | * |
81 | * A single USB function uses one or more interfaces, and should in most | 89 | * A single USB function uses one or more interfaces, and should in most |
82 | * cases support operation at both full and high speeds. Each function is | 90 | * cases support operation at both full and high speeds. Each function is |
@@ -106,6 +114,7 @@ struct usb_function { | |||
106 | struct usb_gadget_strings **strings; | 114 | struct usb_gadget_strings **strings; |
107 | struct usb_descriptor_header **descriptors; | 115 | struct usb_descriptor_header **descriptors; |
108 | struct usb_descriptor_header **hs_descriptors; | 116 | struct usb_descriptor_header **hs_descriptors; |
117 | struct usb_descriptor_header **ss_descriptors; | ||
109 | 118 | ||
110 | struct usb_configuration *config; | 119 | struct usb_configuration *config; |
111 | 120 | ||
@@ -132,6 +141,10 @@ struct usb_function { | |||
132 | void (*suspend)(struct usb_function *); | 141 | void (*suspend)(struct usb_function *); |
133 | void (*resume)(struct usb_function *); | 142 | void (*resume)(struct usb_function *); |
134 | 143 | ||
144 | /* USB 3.0 additions */ | ||
145 | int (*get_status)(struct usb_function *); | ||
146 | int (*func_suspend)(struct usb_function *, | ||
147 | u8 suspend_opt); | ||
135 | /* private: */ | 148 | /* private: */ |
136 | /* internals */ | 149 | /* internals */ |
137 | struct list_head list; | 150 | struct list_head list; |
@@ -145,20 +158,8 @@ int usb_function_activate(struct usb_function *); | |||
145 | 158 | ||
146 | int usb_interface_id(struct usb_configuration *, struct usb_function *); | 159 | int usb_interface_id(struct usb_configuration *, struct usb_function *); |
147 | 160 | ||
148 | /** | 161 | int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f, |
149 | * ep_choose - select descriptor endpoint at current device speed | 162 | struct usb_ep *_ep); |
150 | * @g: gadget, connected and running at some speed | ||
151 | * @hs: descriptor to use for high speed operation | ||
152 | * @fs: descriptor to use for full or low speed operation | ||
153 | */ | ||
154 | static inline struct usb_endpoint_descriptor * | ||
155 | ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs, | ||
156 | struct usb_endpoint_descriptor *fs) | ||
157 | { | ||
158 | if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH) | ||
159 | return hs; | ||
160 | return fs; | ||
161 | } | ||
162 | 163 | ||
163 | #define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */ | 164 | #define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */ |
164 | 165 | ||
@@ -231,6 +232,7 @@ struct usb_configuration { | |||
231 | struct list_head list; | 232 | struct list_head list; |
232 | struct list_head functions; | 233 | struct list_head functions; |
233 | u8 next_interface_id; | 234 | u8 next_interface_id; |
235 | unsigned superspeed:1; | ||
234 | unsigned highspeed:1; | 236 | unsigned highspeed:1; |
235 | unsigned fullspeed:1; | 237 | unsigned fullspeed:1; |
236 | struct usb_function *interface[MAX_CONFIG_INTERFACES]; | 238 | struct usb_function *interface[MAX_CONFIG_INTERFACES]; |
@@ -252,6 +254,7 @@ int usb_add_config(struct usb_composite_dev *, | |||
252 | * identifiers. | 254 | * identifiers. |
253 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 255 | * @strings: tables of strings, keyed by identifiers assigned during bind() |
254 | * and language IDs provided in control requests | 256 | * and language IDs provided in control requests |
257 | * @max_speed: Highest speed the driver supports. | ||
255 | * @needs_serial: set to 1 if the gadget needs userspace to provide | 258 | * @needs_serial: set to 1 if the gadget needs userspace to provide |
256 | * a serial number. If one is not provided, warning will be printed. | 259 | * a serial number. If one is not provided, warning will be printed. |
257 | * @unbind: Reverses bind; called as a side effect of unregistering | 260 | * @unbind: Reverses bind; called as a side effect of unregistering |
@@ -279,6 +282,7 @@ struct usb_composite_driver { | |||
279 | const char *iManufacturer; | 282 | const char *iManufacturer; |
280 | const struct usb_device_descriptor *dev; | 283 | const struct usb_device_descriptor *dev; |
281 | struct usb_gadget_strings **strings; | 284 | struct usb_gadget_strings **strings; |
285 | enum usb_device_speed max_speed; | ||
282 | unsigned needs_serial:1; | 286 | unsigned needs_serial:1; |
283 | 287 | ||
284 | int (*unbind)(struct usb_composite_dev *); | 288 | int (*unbind)(struct usb_composite_dev *); |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index dd1571db55e7..087f4b931833 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -15,7 +15,13 @@ | |||
15 | #ifndef __LINUX_USB_GADGET_H | 15 | #ifndef __LINUX_USB_GADGET_H |
16 | #define __LINUX_USB_GADGET_H | 16 | #define __LINUX_USB_GADGET_H |
17 | 17 | ||
18 | #include <linux/device.h> | ||
19 | #include <linux/errno.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/list.h> | ||
18 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/types.h> | ||
24 | #include <linux/usb/ch9.h> | ||
19 | 25 | ||
20 | struct usb_ep; | 26 | struct usb_ep; |
21 | 27 | ||
@@ -27,6 +33,7 @@ struct usb_ep; | |||
27 | * field, and the usb controller needs one, it is responsible | 33 | * field, and the usb controller needs one, it is responsible |
28 | * for mapping and unmapping the buffer. | 34 | * for mapping and unmapping the buffer. |
29 | * @length: Length of that data | 35 | * @length: Length of that data |
36 | * @stream_id: The stream id, when USB3.0 bulk streams are being used | ||
30 | * @no_interrupt: If true, hints that no completion irq is needed. | 37 | * @no_interrupt: If true, hints that no completion irq is needed. |
31 | * Helpful sometimes with deep request queues that are handled | 38 | * Helpful sometimes with deep request queues that are handled |
32 | * directly by DMA controllers. | 39 | * directly by DMA controllers. |
@@ -81,6 +88,7 @@ struct usb_request { | |||
81 | unsigned length; | 88 | unsigned length; |
82 | dma_addr_t dma; | 89 | dma_addr_t dma; |
83 | 90 | ||
91 | unsigned stream_id:16; | ||
84 | unsigned no_interrupt:1; | 92 | unsigned no_interrupt:1; |
85 | unsigned zero:1; | 93 | unsigned zero:1; |
86 | unsigned short_not_ok:1; | 94 | unsigned short_not_ok:1; |
@@ -131,8 +139,17 @@ struct usb_ep_ops { | |||
131 | * @maxpacket:The maximum packet size used on this endpoint. The initial | 139 | * @maxpacket:The maximum packet size used on this endpoint. The initial |
132 | * value can sometimes be reduced (hardware allowing), according to | 140 | * value can sometimes be reduced (hardware allowing), according to |
133 | * the endpoint descriptor used to configure the endpoint. | 141 | * the endpoint descriptor used to configure the endpoint. |
134 | * @driver_data:for use by the gadget driver. all other fields are | 142 | * @max_streams: The maximum number of streams supported |
135 | * read-only to gadget drivers. | 143 | * by this EP (0 - 16, actual number is 2^n) |
144 | * @mult: multiplier, 'mult' value for SS Isoc EPs | ||
145 | * @maxburst: the maximum number of bursts supported by this EP (for usb3) | ||
146 | * @driver_data:for use by the gadget driver. | ||
147 | * @address: used to identify the endpoint when finding descriptor that | ||
148 | * matches connection speed | ||
149 | * @desc: endpoint descriptor. This pointer is set before the endpoint is | ||
150 | * enabled and remains valid until the endpoint is disabled. | ||
151 | * @comp_desc: In case of SuperSpeed support, this is the endpoint companion | ||
152 | * descriptor that is used to configure the endpoint | ||
136 | * | 153 | * |
137 | * the bus controller driver lists all the general purpose endpoints in | 154 | * the bus controller driver lists all the general purpose endpoints in |
138 | * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, | 155 | * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, |
@@ -145,6 +162,12 @@ struct usb_ep { | |||
145 | const struct usb_ep_ops *ops; | 162 | const struct usb_ep_ops *ops; |
146 | struct list_head ep_list; | 163 | struct list_head ep_list; |
147 | unsigned maxpacket:16; | 164 | unsigned maxpacket:16; |
165 | unsigned max_streams:16; | ||
166 | unsigned mult:2; | ||
167 | unsigned maxburst:4; | ||
168 | u8 address; | ||
169 | const struct usb_endpoint_descriptor *desc; | ||
170 | const struct usb_ss_ep_comp_descriptor *comp_desc; | ||
148 | }; | 171 | }; |
149 | 172 | ||
150 | /*-------------------------------------------------------------------------*/ | 173 | /*-------------------------------------------------------------------------*/ |
@@ -153,11 +176,8 @@ struct usb_ep { | |||
153 | * usb_ep_enable - configure endpoint, making it usable | 176 | * usb_ep_enable - configure endpoint, making it usable |
154 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". | 177 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". |
155 | * drivers discover endpoints through the ep_list of a usb_gadget. | 178 | * drivers discover endpoints through the ep_list of a usb_gadget. |
156 | * @desc:descriptor for desired behavior. caller guarantees this pointer | ||
157 | * remains valid until the endpoint is disabled; the data byte order | ||
158 | * is little-endian (usb-standard). | ||
159 | * | 179 | * |
160 | * when configurations are set, or when interface settings change, the driver | 180 | * When configurations are set, or when interface settings change, the driver |
161 | * will enable or disable the relevant endpoints. while it is enabled, an | 181 | * will enable or disable the relevant endpoints. while it is enabled, an |
162 | * endpoint may be used for i/o until the driver receives a disconnect() from | 182 | * endpoint may be used for i/o until the driver receives a disconnect() from |
163 | * the host or until the endpoint is disabled. | 183 | * the host or until the endpoint is disabled. |
@@ -172,10 +192,9 @@ struct usb_ep { | |||
172 | * | 192 | * |
173 | * returns zero, or a negative error code. | 193 | * returns zero, or a negative error code. |
174 | */ | 194 | */ |
175 | static inline int usb_ep_enable(struct usb_ep *ep, | 195 | static inline int usb_ep_enable(struct usb_ep *ep) |
176 | const struct usb_endpoint_descriptor *desc) | ||
177 | { | 196 | { |
178 | return ep->ops->enable(ep, desc); | 197 | return ep->ops->enable(ep, ep->desc); |
179 | } | 198 | } |
180 | 199 | ||
181 | /** | 200 | /** |
@@ -416,7 +435,16 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep) | |||
416 | 435 | ||
417 | /*-------------------------------------------------------------------------*/ | 436 | /*-------------------------------------------------------------------------*/ |
418 | 437 | ||
438 | struct usb_dcd_config_params { | ||
439 | __u8 bU1devExitLat; /* U1 Device exit Latency */ | ||
440 | #define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ | ||
441 | __le16 bU2DevExitLat; /* U2 Device exit Latency */ | ||
442 | #define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */ | ||
443 | }; | ||
444 | |||
445 | |||
419 | struct usb_gadget; | 446 | struct usb_gadget; |
447 | struct usb_gadget_driver; | ||
420 | 448 | ||
421 | /* the rest of the api to the controller hardware: device operations, | 449 | /* the rest of the api to the controller hardware: device operations, |
422 | * which don't involve endpoints (or i/o). | 450 | * which don't involve endpoints (or i/o). |
@@ -430,6 +458,16 @@ struct usb_gadget_ops { | |||
430 | int (*pullup) (struct usb_gadget *, int is_on); | 458 | int (*pullup) (struct usb_gadget *, int is_on); |
431 | int (*ioctl)(struct usb_gadget *, | 459 | int (*ioctl)(struct usb_gadget *, |
432 | unsigned code, unsigned long param); | 460 | unsigned code, unsigned long param); |
461 | void (*get_config_params)(struct usb_dcd_config_params *); | ||
462 | int (*udc_start)(struct usb_gadget *, | ||
463 | struct usb_gadget_driver *); | ||
464 | int (*udc_stop)(struct usb_gadget *, | ||
465 | struct usb_gadget_driver *); | ||
466 | |||
467 | /* Those two are deprecated */ | ||
468 | int (*start)(struct usb_gadget_driver *, | ||
469 | int (*bind)(struct usb_gadget *)); | ||
470 | int (*stop)(struct usb_gadget_driver *); | ||
433 | }; | 471 | }; |
434 | 472 | ||
435 | /** | 473 | /** |
@@ -521,6 +559,24 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g) | |||
521 | } | 559 | } |
522 | 560 | ||
523 | /** | 561 | /** |
562 | * gadget_is_superspeed() - return true if the hardware handles | ||
563 | * supperspeed | ||
564 | * @g: controller that might support supper speed | ||
565 | */ | ||
566 | static inline int gadget_is_superspeed(struct usb_gadget *g) | ||
567 | { | ||
568 | #ifdef CONFIG_USB_GADGET_SUPERSPEED | ||
569 | /* | ||
570 | * runtime test would check "g->is_superspeed" ... that might be | ||
571 | * useful to work around hardware bugs, but is mostly pointless | ||
572 | */ | ||
573 | return 1; | ||
574 | #else | ||
575 | return 0; | ||
576 | #endif | ||
577 | } | ||
578 | |||
579 | /** | ||
524 | * gadget_is_otg - return true iff the hardware is OTG-ready | 580 | * gadget_is_otg - return true iff the hardware is OTG-ready |
525 | * @g: controller that might have a Mini-AB connector | 581 | * @g: controller that might have a Mini-AB connector |
526 | * | 582 | * |
@@ -821,6 +877,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
821 | */ | 877 | */ |
822 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); | 878 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); |
823 | 879 | ||
880 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | ||
881 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | ||
882 | |||
824 | /*-------------------------------------------------------------------------*/ | 883 | /*-------------------------------------------------------------------------*/ |
825 | 884 | ||
826 | /* utility to simplify dealing with string descriptors */ | 885 | /* utility to simplify dealing with string descriptors */ |
@@ -870,12 +929,6 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config, | |||
870 | struct usb_descriptor_header **usb_copy_descriptors( | 929 | struct usb_descriptor_header **usb_copy_descriptors( |
871 | struct usb_descriptor_header **); | 930 | struct usb_descriptor_header **); |
872 | 931 | ||
873 | /* return copy of endpoint descriptor given original descriptor set */ | ||
874 | struct usb_endpoint_descriptor *usb_find_endpoint( | ||
875 | struct usb_descriptor_header **src, | ||
876 | struct usb_descriptor_header **copy, | ||
877 | struct usb_endpoint_descriptor *match); | ||
878 | |||
879 | /** | 932 | /** |
880 | * usb_free_descriptors - free descriptors returned by usb_copy_descriptors() | 933 | * usb_free_descriptors - free descriptors returned by usb_copy_descriptors() |
881 | * @v: vector of descriptors | 934 | * @v: vector of descriptors |
@@ -892,6 +945,11 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v) | |||
892 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 945 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
893 | struct usb_endpoint_descriptor *); | 946 | struct usb_endpoint_descriptor *); |
894 | 947 | ||
948 | |||
949 | extern struct usb_ep *usb_ep_autoconfig_ss(struct usb_gadget *, | ||
950 | struct usb_endpoint_descriptor *, | ||
951 | struct usb_ss_ep_comp_descriptor *); | ||
952 | |||
895 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); | 953 | extern void usb_ep_autoconfig_reset(struct usb_gadget *); |
896 | 954 | ||
897 | #endif /* __LINUX_USB_GADGET_H */ | 955 | #endif /* __LINUX_USB_GADGET_H */ |
diff --git a/include/linux/usb/m66592.h b/include/linux/usb/m66592.h index cda9625e7df0..a4ba31ab2fed 100644 --- a/include/linux/usb/m66592.h +++ b/include/linux/usb/m66592.h | |||
@@ -38,6 +38,8 @@ struct m66592_platdata { | |||
38 | /* (external controller only) one = 3.3V, zero = 1.5V */ | 38 | /* (external controller only) one = 3.3V, zero = 1.5V */ |
39 | unsigned vif:1; | 39 | unsigned vif:1; |
40 | 40 | ||
41 | /* (external controller only) set one = WR0_N shorted to WR1_N */ | ||
42 | unsigned wr0_shorted_to_wr1:1; | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | #endif /* __LINUX_USB_M66592_H */ | 45 | #endif /* __LINUX_USB_M66592_H */ |
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h index 26d216734057..b6b8660d0c68 100644 --- a/include/linux/usb/r8a66597.h +++ b/include/linux/usb/r8a66597.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2009 Renesas Solutions Corp. | 4 | * Copyright (C) 2009 Renesas Solutions Corp. |
5 | * | 5 | * |
6 | * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 6 | * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -31,6 +31,9 @@ struct r8a66597_platdata { | |||
31 | /* This callback can control port power instead of DVSTCTR register. */ | 31 | /* This callback can control port power instead of DVSTCTR register. */ |
32 | void (*port_power)(int port, int power); | 32 | void (*port_power)(int port, int power); |
33 | 33 | ||
34 | /* This parameter is for BUSWAIT */ | ||
35 | u16 buswait; | ||
36 | |||
34 | /* set one = on chip controller, set zero = external controller */ | 37 | /* set one = on chip controller, set zero = external controller */ |
35 | unsigned on_chip:1; | 38 | unsigned on_chip:1; |
36 | 39 | ||
@@ -42,6 +45,9 @@ struct r8a66597_platdata { | |||
42 | 45 | ||
43 | /* set one = big endian, set zero = little endian */ | 46 | /* set one = big endian, set zero = little endian */ |
44 | unsigned endian:1; | 47 | unsigned endian:1; |
48 | |||
49 | /* (external controller only) set one = WR0_N shorted to WR1_N */ | ||
50 | unsigned wr0_shorted_to_wr1:1; | ||
45 | }; | 51 | }; |
46 | 52 | ||
47 | /* Register definitions */ | 53 | /* Register definitions */ |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index 3a7f1d982dd6..8977431259c6 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
@@ -110,6 +110,23 @@ struct renesas_usbhs_driver_param { | |||
110 | * delay time from notify_hotplug callback | 110 | * delay time from notify_hotplug callback |
111 | */ | 111 | */ |
112 | int detection_delay; | 112 | int detection_delay; |
113 | |||
114 | /* | ||
115 | * option: | ||
116 | * | ||
117 | * dma id for dmaengine | ||
118 | */ | ||
119 | int d0_tx_id; | ||
120 | int d0_rx_id; | ||
121 | int d1_tx_id; | ||
122 | int d1_rx_id; | ||
123 | |||
124 | /* | ||
125 | * option: | ||
126 | * | ||
127 | * pio <--> dma border. | ||
128 | */ | ||
129 | int pio_dma_border; /* default is 64byte */ | ||
113 | }; | 130 | }; |
114 | 131 | ||
115 | /* | 132 | /* |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 8a4c309d2344..fca24cc50436 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -376,7 +376,16 @@ struct v4l2_pix_format { | |||
376 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ | 376 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ |
377 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ | 377 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ |
378 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ | 378 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ |
379 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ | 379 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */ |
380 | #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */ | ||
381 | #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */ | ||
382 | #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ | ||
383 | #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ | ||
384 | #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ | ||
385 | #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */ | ||
386 | #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ | ||
387 | #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ | ||
388 | #define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */ | ||
380 | 389 | ||
381 | /* Vendor-specific formats */ | 390 | /* Vendor-specific formats */ |
382 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ | 391 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ |
@@ -402,6 +411,7 @@ struct v4l2_pix_format { | |||
402 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | 411 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ |
403 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | 412 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ |
404 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ | 413 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ |
414 | #define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */ | ||
405 | 415 | ||
406 | /* | 416 | /* |
407 | * F O R M A T E N U M E R A T I O N | 417 | * F O R M A T E N U M E R A T I O N |
@@ -1026,6 +1036,7 @@ struct v4l2_ext_controls { | |||
1026 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ | 1036 | #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ |
1027 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ | 1037 | #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ |
1028 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ | 1038 | #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ |
1039 | #define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */ | ||
1029 | 1040 | ||
1030 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1041 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
1031 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1042 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
@@ -1039,6 +1050,7 @@ enum v4l2_ctrl_type { | |||
1039 | V4L2_CTRL_TYPE_INTEGER64 = 5, | 1050 | V4L2_CTRL_TYPE_INTEGER64 = 5, |
1040 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | 1051 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, |
1041 | V4L2_CTRL_TYPE_STRING = 7, | 1052 | V4L2_CTRL_TYPE_STRING = 7, |
1053 | V4L2_CTRL_TYPE_BITMASK = 8, | ||
1042 | }; | 1054 | }; |
1043 | 1055 | ||
1044 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 1056 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
@@ -1144,14 +1156,19 @@ enum v4l2_colorfx { | |||
1144 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) | 1156 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) |
1145 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) | 1157 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) |
1146 | 1158 | ||
1159 | #define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39) | ||
1160 | #define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) | ||
1161 | |||
1147 | /* last CID + 1 */ | 1162 | /* last CID + 1 */ |
1148 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) | 1163 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+41) |
1164 | |||
1165 | /* Minimum number of buffer neede by the device */ | ||
1149 | 1166 | ||
1150 | /* MPEG-class control IDs defined by V4L2 */ | 1167 | /* MPEG-class control IDs defined by V4L2 */ |
1151 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1168 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
1152 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) | 1169 | #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) |
1153 | 1170 | ||
1154 | /* MPEG streams */ | 1171 | /* MPEG streams, specific to multiplexed streams */ |
1155 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) | 1172 | #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) |
1156 | enum v4l2_mpeg_stream_type { | 1173 | enum v4l2_mpeg_stream_type { |
1157 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ | 1174 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ |
@@ -1173,7 +1190,7 @@ enum v4l2_mpeg_stream_vbi_fmt { | |||
1173 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ | 1190 | V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ |
1174 | }; | 1191 | }; |
1175 | 1192 | ||
1176 | /* MPEG audio */ | 1193 | /* MPEG audio controls specific to multiplexed streams */ |
1177 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) | 1194 | #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) |
1178 | enum v4l2_mpeg_audio_sampling_freq { | 1195 | enum v4l2_mpeg_audio_sampling_freq { |
1179 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, | 1196 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, |
@@ -1289,7 +1306,7 @@ enum v4l2_mpeg_audio_ac3_bitrate { | |||
1289 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, | 1306 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, |
1290 | }; | 1307 | }; |
1291 | 1308 | ||
1292 | /* MPEG video */ | 1309 | /* MPEG video controls specific to multiplexed streams */ |
1293 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 1310 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
1294 | enum v4l2_mpeg_video_encoding { | 1311 | enum v4l2_mpeg_video_encoding { |
1295 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, | 1312 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, |
@@ -1317,6 +1334,141 @@ enum v4l2_mpeg_video_bitrate_mode { | |||
1317 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) | 1334 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) |
1318 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) | 1335 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) |
1319 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) | 1336 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) |
1337 | #define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) | ||
1338 | #define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213) | ||
1339 | #define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214) | ||
1340 | #define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215) | ||
1341 | #define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216) | ||
1342 | enum v4l2_mpeg_video_header_mode { | ||
1343 | V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0, | ||
1344 | V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1, | ||
1345 | |||
1346 | }; | ||
1347 | #define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217) | ||
1348 | #define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218) | ||
1349 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219) | ||
1350 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220) | ||
1351 | #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221) | ||
1352 | enum v4l2_mpeg_video_multi_slice_mode { | ||
1353 | V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0, | ||
1354 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1, | ||
1355 | V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2, | ||
1356 | }; | ||
1357 | #define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) | ||
1358 | #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) | ||
1359 | #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) | ||
1360 | #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302) | ||
1361 | #define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303) | ||
1362 | #define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304) | ||
1363 | #define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350) | ||
1364 | #define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351) | ||
1365 | #define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352) | ||
1366 | #define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353) | ||
1367 | #define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354) | ||
1368 | #define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355) | ||
1369 | #define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356) | ||
1370 | #define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357) | ||
1371 | enum v4l2_mpeg_video_h264_entropy_mode { | ||
1372 | V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0, | ||
1373 | V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1, | ||
1374 | }; | ||
1375 | #define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358) | ||
1376 | #define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359) | ||
1377 | enum v4l2_mpeg_video_h264_level { | ||
1378 | V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0, | ||
1379 | V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1, | ||
1380 | V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2, | ||
1381 | V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3, | ||
1382 | V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4, | ||
1383 | V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5, | ||
1384 | V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6, | ||
1385 | V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7, | ||
1386 | V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8, | ||
1387 | V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9, | ||
1388 | V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10, | ||
1389 | V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11, | ||
1390 | V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12, | ||
1391 | V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13, | ||
1392 | V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14, | ||
1393 | V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15, | ||
1394 | }; | ||
1395 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360) | ||
1396 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361) | ||
1397 | #define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362) | ||
1398 | enum v4l2_mpeg_video_h264_loop_filter_mode { | ||
1399 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0, | ||
1400 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1, | ||
1401 | V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2, | ||
1402 | }; | ||
1403 | #define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363) | ||
1404 | enum v4l2_mpeg_video_h264_profile { | ||
1405 | V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0, | ||
1406 | V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1, | ||
1407 | V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2, | ||
1408 | V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3, | ||
1409 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4, | ||
1410 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5, | ||
1411 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6, | ||
1412 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7, | ||
1413 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8, | ||
1414 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9, | ||
1415 | V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10, | ||
1416 | V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11, | ||
1417 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12, | ||
1418 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13, | ||
1419 | V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14, | ||
1420 | V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15, | ||
1421 | V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16, | ||
1422 | }; | ||
1423 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364) | ||
1424 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365) | ||
1425 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366) | ||
1426 | #define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367) | ||
1427 | enum v4l2_mpeg_video_h264_vui_sar_idc { | ||
1428 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0, | ||
1429 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1, | ||
1430 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2, | ||
1431 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3, | ||
1432 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4, | ||
1433 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5, | ||
1434 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6, | ||
1435 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7, | ||
1436 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8, | ||
1437 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9, | ||
1438 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10, | ||
1439 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11, | ||
1440 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12, | ||
1441 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13, | ||
1442 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14, | ||
1443 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15, | ||
1444 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16, | ||
1445 | V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17, | ||
1446 | }; | ||
1447 | #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) | ||
1448 | #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) | ||
1449 | #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) | ||
1450 | #define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403) | ||
1451 | #define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404) | ||
1452 | #define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405) | ||
1453 | enum v4l2_mpeg_video_mpeg4_level { | ||
1454 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0, | ||
1455 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1, | ||
1456 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2, | ||
1457 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3, | ||
1458 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4, | ||
1459 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5, | ||
1460 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6, | ||
1461 | V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7, | ||
1462 | }; | ||
1463 | #define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406) | ||
1464 | enum v4l2_mpeg_video_mpeg4_profile { | ||
1465 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0, | ||
1466 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1, | ||
1467 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2, | ||
1468 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3, | ||
1469 | V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4, | ||
1470 | }; | ||
1471 | #define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407) | ||
1320 | 1472 | ||
1321 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ | 1473 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
1322 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 1474 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
@@ -1359,6 +1511,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type { | |||
1359 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) | 1511 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) |
1360 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) | 1512 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) |
1361 | 1513 | ||
1514 | /* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ | ||
1515 | #define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100) | ||
1516 | |||
1517 | #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0) | ||
1518 | #define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1) | ||
1519 | #define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2) | ||
1520 | enum v4l2_mpeg_mfc51_video_frame_skip_mode { | ||
1521 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0, | ||
1522 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1, | ||
1523 | V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2, | ||
1524 | }; | ||
1525 | #define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3) | ||
1526 | enum v4l2_mpeg_mfc51_video_force_frame_type { | ||
1527 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0, | ||
1528 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1, | ||
1529 | V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2, | ||
1530 | }; | ||
1531 | #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4) | ||
1532 | #define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5) | ||
1533 | #define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6) | ||
1534 | #define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7) | ||
1535 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50) | ||
1536 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51) | ||
1537 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52) | ||
1538 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53) | ||
1539 | #define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54) | ||
1540 | |||
1362 | /* Camera class control IDs */ | 1541 | /* Camera class control IDs */ |
1363 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) | 1542 | #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) |
1364 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) | 1543 | #define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) |
@@ -1427,6 +1606,41 @@ enum v4l2_preemphasis { | |||
1427 | #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) | 1606 | #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) |
1428 | #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) | 1607 | #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) |
1429 | 1608 | ||
1609 | /* Flash and privacy (indicator) light controls */ | ||
1610 | #define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900) | ||
1611 | #define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1) | ||
1612 | |||
1613 | #define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1) | ||
1614 | enum v4l2_flash_led_mode { | ||
1615 | V4L2_FLASH_LED_MODE_NONE, | ||
1616 | V4L2_FLASH_LED_MODE_FLASH, | ||
1617 | V4L2_FLASH_LED_MODE_TORCH, | ||
1618 | }; | ||
1619 | |||
1620 | #define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2) | ||
1621 | enum v4l2_flash_strobe_source { | ||
1622 | V4L2_FLASH_STROBE_SOURCE_SOFTWARE, | ||
1623 | V4L2_FLASH_STROBE_SOURCE_EXTERNAL, | ||
1624 | }; | ||
1625 | |||
1626 | #define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3) | ||
1627 | #define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4) | ||
1628 | #define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5) | ||
1629 | |||
1630 | #define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6) | ||
1631 | #define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7) | ||
1632 | #define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8) | ||
1633 | #define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9) | ||
1634 | |||
1635 | #define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10) | ||
1636 | #define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0) | ||
1637 | #define V4L2_FLASH_FAULT_TIMEOUT (1 << 1) | ||
1638 | #define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2) | ||
1639 | #define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) | ||
1640 | |||
1641 | #define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) | ||
1642 | #define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) | ||
1643 | |||
1430 | /* | 1644 | /* |
1431 | * T U N I N G | 1645 | * T U N I N G |
1432 | */ | 1646 | */ |
@@ -1791,6 +2005,7 @@ struct v4l2_streamparm { | |||
1791 | #define V4L2_EVENT_ALL 0 | 2005 | #define V4L2_EVENT_ALL 0 |
1792 | #define V4L2_EVENT_VSYNC 1 | 2006 | #define V4L2_EVENT_VSYNC 1 |
1793 | #define V4L2_EVENT_EOS 2 | 2007 | #define V4L2_EVENT_EOS 2 |
2008 | #define V4L2_EVENT_CTRL 3 | ||
1794 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | 2009 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
1795 | 2010 | ||
1796 | /* Payload for V4L2_EVENT_VSYNC */ | 2011 | /* Payload for V4L2_EVENT_VSYNC */ |
@@ -1799,21 +2014,46 @@ struct v4l2_event_vsync { | |||
1799 | __u8 field; | 2014 | __u8 field; |
1800 | } __attribute__ ((packed)); | 2015 | } __attribute__ ((packed)); |
1801 | 2016 | ||
2017 | /* Payload for V4L2_EVENT_CTRL */ | ||
2018 | #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) | ||
2019 | #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) | ||
2020 | |||
2021 | struct v4l2_event_ctrl { | ||
2022 | __u32 changes; | ||
2023 | __u32 type; | ||
2024 | union { | ||
2025 | __s32 value; | ||
2026 | __s64 value64; | ||
2027 | }; | ||
2028 | __u32 flags; | ||
2029 | __s32 minimum; | ||
2030 | __s32 maximum; | ||
2031 | __s32 step; | ||
2032 | __s32 default_value; | ||
2033 | }; | ||
2034 | |||
1802 | struct v4l2_event { | 2035 | struct v4l2_event { |
1803 | __u32 type; | 2036 | __u32 type; |
1804 | union { | 2037 | union { |
1805 | struct v4l2_event_vsync vsync; | 2038 | struct v4l2_event_vsync vsync; |
2039 | struct v4l2_event_ctrl ctrl; | ||
1806 | __u8 data[64]; | 2040 | __u8 data[64]; |
1807 | } u; | 2041 | } u; |
1808 | __u32 pending; | 2042 | __u32 pending; |
1809 | __u32 sequence; | 2043 | __u32 sequence; |
1810 | struct timespec timestamp; | 2044 | struct timespec timestamp; |
1811 | __u32 reserved[9]; | 2045 | __u32 id; |
2046 | __u32 reserved[8]; | ||
1812 | }; | 2047 | }; |
1813 | 2048 | ||
2049 | #define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0) | ||
2050 | #define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1) | ||
2051 | |||
1814 | struct v4l2_event_subscription { | 2052 | struct v4l2_event_subscription { |
1815 | __u32 type; | 2053 | __u32 type; |
1816 | __u32 reserved[7]; | 2054 | __u32 id; |
2055 | __u32 flags; | ||
2056 | __u32 reserved[5]; | ||
1817 | }; | 2057 | }; |
1818 | 2058 | ||
1819 | /* | 2059 | /* |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 136040bba3e3..970d5a2a9047 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -63,6 +63,7 @@ struct virtio_net_config { | |||
63 | * specify GSO or CSUM features, you can simply ignore the header. */ | 63 | * specify GSO or CSUM features, you can simply ignore the header. */ |
64 | struct virtio_net_hdr { | 64 | struct virtio_net_hdr { |
65 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset | 65 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset |
66 | #define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid | ||
66 | __u8 flags; | 67 | __u8 flags; |
67 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame | 68 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame |
68 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) | 69 | #define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index bcd942fa611c..65efb92da996 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
8 | #include <linux/vm_event_item.h> | 8 | #include <linux/vm_event_item.h> |
9 | #include <asm/atomic.h> | 9 | #include <linux/atomic.h> |
10 | 10 | ||
11 | extern int sysctl_stat_interval; | 11 | extern int sysctl_stat_interval; |
12 | 12 | ||
diff --git a/include/linux/vt.h b/include/linux/vt.h index d5dd0bc408fd..30a8dd9c83ff 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -86,6 +86,13 @@ struct vt_setactivate { | |||
86 | 86 | ||
87 | #ifdef __KERNEL__ | 87 | #ifdef __KERNEL__ |
88 | 88 | ||
89 | /* Virtual Terminal events. */ | ||
90 | #define VT_ALLOCATE 0x0001 /* Console got allocated */ | ||
91 | #define VT_DEALLOCATE 0x0002 /* Console will be deallocated */ | ||
92 | #define VT_WRITE 0x0003 /* A char got output */ | ||
93 | #define VT_UPDATE 0x0004 /* A bigger update occurred */ | ||
94 | #define VT_PREWRITE 0x0005 /* A char is about to be written to the console */ | ||
95 | |||
89 | #ifdef CONFIG_VT_CONSOLE | 96 | #ifdef CONFIG_VT_CONSOLE |
90 | 97 | ||
91 | extern int vt_kmsg_redirect(int new); | 98 | extern int vt_kmsg_redirect(int new); |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 4d05e14ea60c..c2164fad0083 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -137,7 +137,7 @@ int vty_init(const struct file_operations *console_fops); | |||
137 | 137 | ||
138 | static inline bool vt_force_oops_output(struct vc_data *vc) | 138 | static inline bool vt_force_oops_output(struct vc_data *vc) |
139 | { | 139 | { |
140 | if (oops_in_progress && vc->vc_panic_force_write) | 140 | if (oops_in_progress && vc->vc_panic_force_write && panic_timeout >= 0) |
141 | return true; | 141 | return true; |
142 | return false; | 142 | return false; |
143 | } | 143 | } |
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 011bcfeb9f09..111843f88b2a 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
@@ -59,6 +59,84 @@ struct watchdog_info { | |||
59 | #define WATCHDOG_NOWAYOUT 0 | 59 | #define WATCHDOG_NOWAYOUT 0 |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | struct watchdog_ops; | ||
63 | struct watchdog_device; | ||
64 | |||
65 | /** struct watchdog_ops - The watchdog-devices operations | ||
66 | * | ||
67 | * @owner: The module owner. | ||
68 | * @start: The routine for starting the watchdog device. | ||
69 | * @stop: The routine for stopping the watchdog device. | ||
70 | * @ping: The routine that sends a keepalive ping to the watchdog device. | ||
71 | * @status: The routine that shows the status of the watchdog device. | ||
72 | * @set_timeout:The routine for setting the watchdog devices timeout value. | ||
73 | * @ioctl: The routines that handles extra ioctl calls. | ||
74 | * | ||
75 | * The watchdog_ops structure contains a list of low-level operations | ||
76 | * that control a watchdog device. It also contains the module that owns | ||
77 | * these operations. The start and stop function are mandatory, all other | ||
78 | * functions are optonal. | ||
79 | */ | ||
80 | struct watchdog_ops { | ||
81 | struct module *owner; | ||
82 | /* mandatory operations */ | ||
83 | int (*start)(struct watchdog_device *); | ||
84 | int (*stop)(struct watchdog_device *); | ||
85 | /* optional operations */ | ||
86 | int (*ping)(struct watchdog_device *); | ||
87 | unsigned int (*status)(struct watchdog_device *); | ||
88 | int (*set_timeout)(struct watchdog_device *, unsigned int); | ||
89 | long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long); | ||
90 | }; | ||
91 | |||
92 | /** struct watchdog_device - The structure that defines a watchdog device | ||
93 | * | ||
94 | * @info: Pointer to a watchdog_info structure. | ||
95 | * @ops: Pointer to the list of watchdog operations. | ||
96 | * @bootstatus: Status of the watchdog device at boot. | ||
97 | * @timeout: The watchdog devices timeout value. | ||
98 | * @min_timeout:The watchdog devices minimum timeout value. | ||
99 | * @max_timeout:The watchdog devices maximum timeout value. | ||
100 | * @driver-data:Pointer to the drivers private data. | ||
101 | * @status: Field that contains the devices internal status bits. | ||
102 | * | ||
103 | * The watchdog_device structure contains all information about a | ||
104 | * watchdog timer device. | ||
105 | * | ||
106 | * The driver-data field may not be accessed directly. It must be accessed | ||
107 | * via the watchdog_set_drvdata and watchdog_get_drvdata helpers. | ||
108 | */ | ||
109 | struct watchdog_device { | ||
110 | const struct watchdog_info *info; | ||
111 | const struct watchdog_ops *ops; | ||
112 | unsigned int bootstatus; | ||
113 | unsigned int timeout; | ||
114 | unsigned int min_timeout; | ||
115 | unsigned int max_timeout; | ||
116 | void *driver_data; | ||
117 | unsigned long status; | ||
118 | /* Bit numbers for status flags */ | ||
119 | #define WDOG_ACTIVE 0 /* Is the watchdog running/active */ | ||
120 | #define WDOG_DEV_OPEN 1 /* Opened via /dev/watchdog ? */ | ||
121 | #define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */ | ||
122 | #define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */ | ||
123 | }; | ||
124 | |||
125 | /* Use the following functions to manipulate watchdog driver specific data */ | ||
126 | static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) | ||
127 | { | ||
128 | wdd->driver_data = data; | ||
129 | } | ||
130 | |||
131 | static inline void *watchdog_get_drvdata(struct watchdog_device *wdd) | ||
132 | { | ||
133 | return wdd->driver_data; | ||
134 | } | ||
135 | |||
136 | /* drivers/watchdog/core/watchdog_core.c */ | ||
137 | extern int watchdog_register_device(struct watchdog_device *); | ||
138 | extern void watchdog_unregister_device(struct watchdog_device *); | ||
139 | |||
62 | #endif /* __KERNEL__ */ | 140 | #endif /* __KERNEL__ */ |
63 | 141 | ||
64 | #endif /* ifndef _LINUX_WATCHDOG_H */ | 142 | #endif /* ifndef _LINUX_WATCHDOG_H */ |
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h index 38e8c4d9289e..fd98bb968219 100644 --- a/include/linux/wm97xx.h +++ b/include/linux/wm97xx.h | |||
@@ -38,7 +38,11 @@ | |||
38 | #define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */ | 38 | #define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */ |
39 | #define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */ | 39 | #define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */ |
40 | #define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */ | 40 | #define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */ |
41 | #define WM97XX_ADCSEL_MASK 0x7000 | 41 | #define WM97XX_AUX_ID1 0x4000 |
42 | #define WM97XX_AUX_ID2 0x5000 | ||
43 | #define WM97XX_AUX_ID3 0x6000 | ||
44 | #define WM97XX_AUX_ID4 0x7000 | ||
45 | #define WM97XX_ADCSEL_MASK 0x7000 /* ADC selection mask */ | ||
42 | #define WM97XX_COO 0x0800 /* enable coordinate mode */ | 46 | #define WM97XX_COO 0x0800 /* enable coordinate mode */ |
43 | #define WM97XX_CTC 0x0400 /* enable continuous mode */ | 47 | #define WM97XX_CTC 0x0400 /* enable continuous mode */ |
44 | #define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */ | 48 | #define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */ |
@@ -61,13 +65,6 @@ | |||
61 | #define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */ | 65 | #define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */ |
62 | #define WM97XX_RPR 0x2000 /* wake up on pen down */ | 66 | #define WM97XX_RPR 0x2000 /* wake up on pen down */ |
63 | #define WM97XX_PEN_DOWN 0x8000 /* pen is down */ | 67 | #define WM97XX_PEN_DOWN 0x8000 /* pen is down */ |
64 | #define WM97XX_ADCSRC_MASK 0x7000 /* ADC source mask */ | ||
65 | |||
66 | #define WM97XX_AUX_ID1 0x8001 | ||
67 | #define WM97XX_AUX_ID2 0x8002 | ||
68 | #define WM97XX_AUX_ID3 0x8003 | ||
69 | #define WM97XX_AUX_ID4 0x8004 | ||
70 | |||
71 | 68 | ||
72 | /* WM9712 Bits */ | 69 | /* WM9712 Bits */ |
73 | #define WM9712_45W 0x1000 /* set for 5-wire touchscreen */ | 70 | #define WM9712_45W 0x1000 /* set for 5-wire touchscreen */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index f584aba78ca9..0d556deb497b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
11 | #include <linux/lockdep.h> | 11 | #include <linux/lockdep.h> |
12 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
13 | #include <asm/atomic.h> | 13 | #include <linux/atomic.h> |
14 | 14 | ||
15 | struct workqueue_struct; | 15 | struct workqueue_struct; |
16 | 16 | ||
@@ -255,7 +255,7 @@ enum { | |||
255 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 255 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
257 | 257 | ||
258 | WQ_DYING = 1 << 6, /* internal: workqueue is dying */ | 258 | WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */ |
259 | WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ | 259 | WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ |
260 | 260 | ||
261 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ | 261 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
@@ -355,6 +355,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |||
355 | struct delayed_work *work, unsigned long delay); | 355 | struct delayed_work *work, unsigned long delay); |
356 | 356 | ||
357 | extern void flush_workqueue(struct workqueue_struct *wq); | 357 | extern void flush_workqueue(struct workqueue_struct *wq); |
358 | extern void drain_workqueue(struct workqueue_struct *wq); | ||
358 | extern void flush_scheduled_work(void); | 359 | extern void flush_scheduled_work(void); |
359 | 360 | ||
360 | extern int schedule_work(struct work_struct *work); | 361 | extern int schedule_work(struct work_struct *work); |
@@ -412,21 +413,6 @@ static inline bool __cancel_delayed_work(struct delayed_work *work) | |||
412 | return ret; | 413 | return ret; |
413 | } | 414 | } |
414 | 415 | ||
415 | /* Obsolete. use cancel_delayed_work_sync() */ | ||
416 | static inline __deprecated | ||
417 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | ||
418 | struct delayed_work *work) | ||
419 | { | ||
420 | cancel_delayed_work_sync(work); | ||
421 | } | ||
422 | |||
423 | /* Obsolete. use cancel_delayed_work_sync() */ | ||
424 | static inline __deprecated | ||
425 | void cancel_rearming_delayed_work(struct delayed_work *work) | ||
426 | { | ||
427 | cancel_delayed_work_sync(work); | ||
428 | } | ||
429 | |||
430 | #ifndef CONFIG_SMP | 416 | #ifndef CONFIG_SMP |
431 | static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) | 417 | static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) |
432 | { | 418 | { |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 17e7ccc322a5..f1bfa12ea246 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -7,9 +7,39 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
9 | 9 | ||
10 | struct backing_dev_info; | 10 | /* |
11 | * The 1/4 region under the global dirty thresh is for smooth dirty throttling: | ||
12 | * | ||
13 | * (thresh - thresh/DIRTY_FULL_SCOPE, thresh) | ||
14 | * | ||
15 | * The 1/16 region above the global dirty limit will be put to maximum pauses: | ||
16 | * | ||
17 | * (limit, limit + limit/DIRTY_MAXPAUSE_AREA) | ||
18 | * | ||
19 | * The 1/16 region above the max-pause region, dirty exceeded bdi's will be put | ||
20 | * to loops: | ||
21 | * | ||
22 | * (limit + limit/DIRTY_MAXPAUSE_AREA, limit + limit/DIRTY_PASSGOOD_AREA) | ||
23 | * | ||
24 | * Further beyond, all dirtier tasks will enter a loop waiting (possibly long | ||
25 | * time) for the dirty pages to drop, unless written enough pages. | ||
26 | * | ||
27 | * The global dirty threshold is normally equal to the global dirty limit, | ||
28 | * except when the system suddenly allocates a lot of anonymous memory and | ||
29 | * knocks down the global dirty threshold quickly, in which case the global | ||
30 | * dirty limit will follow down slowly to prevent livelocking all dirtier tasks. | ||
31 | */ | ||
32 | #define DIRTY_SCOPE 8 | ||
33 | #define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) | ||
34 | #define DIRTY_MAXPAUSE_AREA 16 | ||
35 | #define DIRTY_PASSGOOD_AREA 8 | ||
11 | 36 | ||
12 | extern spinlock_t inode_wb_list_lock; | 37 | /* |
38 | * 4MB minimal write chunk size | ||
39 | */ | ||
40 | #define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10)) | ||
41 | |||
42 | struct backing_dev_info; | ||
13 | 43 | ||
14 | /* | 44 | /* |
15 | * fs/fs-writeback.c | 45 | * fs/fs-writeback.c |
@@ -26,11 +56,6 @@ enum writeback_sync_modes { | |||
26 | */ | 56 | */ |
27 | struct writeback_control { | 57 | struct writeback_control { |
28 | enum writeback_sync_modes sync_mode; | 58 | enum writeback_sync_modes sync_mode; |
29 | unsigned long *older_than_this; /* If !NULL, only write back inodes | ||
30 | older than this */ | ||
31 | unsigned long wb_start; /* Time writeback_inodes_wb was | ||
32 | called. This is needed to avoid | ||
33 | extra jobs and livelock */ | ||
34 | long nr_to_write; /* Write this many pages, and decrement | 59 | long nr_to_write; /* Write this many pages, and decrement |
35 | this for each page written */ | 60 | this for each page written */ |
36 | long pages_skipped; /* Pages which were not written */ | 61 | long pages_skipped; /* Pages which were not written */ |
@@ -43,13 +68,11 @@ struct writeback_control { | |||
43 | loff_t range_start; | 68 | loff_t range_start; |
44 | loff_t range_end; | 69 | loff_t range_end; |
45 | 70 | ||
46 | unsigned nonblocking:1; /* Don't get stuck on request queues */ | ||
47 | unsigned encountered_congestion:1; /* An output: a queue is full */ | ||
48 | unsigned for_kupdate:1; /* A kupdate writeback */ | 71 | unsigned for_kupdate:1; /* A kupdate writeback */ |
49 | unsigned for_background:1; /* A background writeback */ | 72 | unsigned for_background:1; /* A background writeback */ |
73 | unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ | ||
50 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 74 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
51 | unsigned range_cyclic:1; /* range_start is cyclic */ | 75 | unsigned range_cyclic:1; /* range_start is cyclic */ |
52 | unsigned more_io:1; /* more io to be dispatched */ | ||
53 | }; | 76 | }; |
54 | 77 | ||
55 | /* | 78 | /* |
@@ -62,8 +85,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); | |||
62 | int writeback_inodes_sb_if_idle(struct super_block *); | 85 | int writeback_inodes_sb_if_idle(struct super_block *); |
63 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); | 86 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); |
64 | void sync_inodes_sb(struct super_block *); | 87 | void sync_inodes_sb(struct super_block *); |
65 | void writeback_inodes_wb(struct bdi_writeback *wb, | 88 | long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages); |
66 | struct writeback_control *wbc); | ||
67 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 89 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
68 | void wakeup_flusher_threads(long nr_pages); | 90 | void wakeup_flusher_threads(long nr_pages); |
69 | 91 | ||
@@ -94,6 +116,8 @@ static inline void laptop_sync_completion(void) { } | |||
94 | #endif | 116 | #endif |
95 | void throttle_vm_writeout(gfp_t gfp_mask); | 117 | void throttle_vm_writeout(gfp_t gfp_mask); |
96 | 118 | ||
119 | extern unsigned long global_dirty_limit; | ||
120 | |||
97 | /* These are exported to sysctl. */ | 121 | /* These are exported to sysctl. */ |
98 | extern int dirty_background_ratio; | 122 | extern int dirty_background_ratio; |
99 | extern unsigned long dirty_background_bytes; | 123 | extern unsigned long dirty_background_bytes; |
@@ -128,6 +152,13 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty); | |||
128 | unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, | 152 | unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, |
129 | unsigned long dirty); | 153 | unsigned long dirty); |
130 | 154 | ||
155 | void __bdi_update_bandwidth(struct backing_dev_info *bdi, | ||
156 | unsigned long thresh, | ||
157 | unsigned long dirty, | ||
158 | unsigned long bdi_thresh, | ||
159 | unsigned long bdi_dirty, | ||
160 | unsigned long start_time); | ||
161 | |||
131 | void page_writeback_init(void); | 162 | void page_writeback_init(void); |
132 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, | 163 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, |
133 | unsigned long nr_pages_dirtied); | 164 | unsigned long nr_pages_dirtied); |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 7bf9db525e9e..dff42025649b 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
@@ -187,7 +187,7 @@ extern struct zorro_dev *zorro_find_device(zorro_id id, | |||
187 | 187 | ||
188 | #define zorro_resource_start(z) ((z)->resource.start) | 188 | #define zorro_resource_start(z) ((z)->resource.start) |
189 | #define zorro_resource_end(z) ((z)->resource.end) | 189 | #define zorro_resource_end(z) ((z)->resource.end) |
190 | #define zorro_resource_len(z) ((z)->resource.end-(z)->resource.start+1) | 190 | #define zorro_resource_len(z) (resource_size(&(z)->resource)) |
191 | #define zorro_resource_flags(z) ((z)->resource.flags) | 191 | #define zorro_resource_flags(z) ((z)->resource.flags) |
192 | 192 | ||
193 | #define zorro_request_device(z, name) \ | 193 | #define zorro_request_device(z, name) \ |