diff options
Diffstat (limited to 'include/linux')
265 files changed, 3738 insertions, 1779 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/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/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..3bac44cce142 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -144,6 +144,7 @@ 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 | ||
148 | #define BITMAP_LAST_WORD_MASK(nbits) \ | 149 | #define BITMAP_LAST_WORD_MASK(nbits) \ |
149 | ( \ | 150 | ( \ |
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/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..48e82af1159b 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; |
@@ -284,7 +284,6 @@ static inline void put_cred(const struct cred *_cred) | |||
284 | ({ \ | 284 | ({ \ |
285 | const struct task_struct *__t = (task); \ | 285 | const struct task_struct *__t = (task); \ |
286 | rcu_dereference_check(__t->real_cred, \ | 286 | rcu_dereference_check(__t->real_cred, \ |
287 | rcu_read_lock_held() || \ | ||
288 | task_is_dead(__t)); \ | 287 | task_is_dead(__t)); \ |
289 | }) | 288 | }) |
290 | 289 | ||
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/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..d37d2a793099 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> |
@@ -216,6 +216,7 @@ struct dentry_operations { | |||
216 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ | 216 | #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ |
217 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ | 217 | #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ |
218 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ | 218 | #define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ |
219 | #define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */ | ||
219 | #define DCACHE_MANAGED_DENTRY \ | 220 | #define DCACHE_MANAGED_DENTRY \ |
220 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 221 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
221 | 222 | ||
@@ -416,7 +417,12 @@ static inline bool d_mountpoint(struct dentry *dentry) | |||
416 | return dentry->d_flags & DCACHE_MOUNTED; | 417 | return dentry->d_flags & DCACHE_MOUNTED; |
417 | } | 418 | } |
418 | 419 | ||
419 | extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); | 420 | static inline bool d_need_lookup(struct dentry *dentry) |
421 | { | ||
422 | return dentry->d_flags & DCACHE_NEED_LOOKUP; | ||
423 | } | ||
424 | |||
425 | extern void d_clear_need_lookup(struct dentry *dentry); | ||
420 | 426 | ||
421 | extern int sysctl_vfs_cache_pressure; | 427 | extern int sysctl_vfs_cache_pressure; |
422 | 428 | ||
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.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/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/drbd_limits.h b/include/linux/drbd_limits.h index 246f576c981d..447c36752385 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -117,10 +117,10 @@ | |||
117 | /* drbdsetup XY resize -d Z | 117 | /* drbdsetup XY resize -d Z |
118 | * you are free to reduce the device size to nothing, if you want to. | 118 | * you are free to reduce the device size to nothing, if you want to. |
119 | * the upper limit with 64bit kernel, enough ram and flexible meta data | 119 | * the upper limit with 64bit kernel, enough ram and flexible meta data |
120 | * is 16 TB, currently. */ | 120 | * is 1 PiB, currently. */ |
121 | /* DRBD_MAX_SECTORS */ | 121 | /* DRBD_MAX_SECTORS */ |
122 | #define DRBD_DISK_SIZE_SECT_MIN 0 | 122 | #define DRBD_DISK_SIZE_SECT_MIN 0 |
123 | #define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30)) | 123 | #define DRBD_DISK_SIZE_SECT_MAX (1 * (2LLU << 40)) |
124 | #define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ | 124 | #define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ |
125 | 125 | ||
126 | #define DRBD_ON_IO_ERROR_DEF EP_PASS_ON | 126 | #define DRBD_ON_IO_ERROR_DEF EP_PASS_ON |
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/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..ec2572693925 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -101,6 +101,13 @@ typedef struct { | |||
101 | u64 attribute; | 101 | u64 attribute; |
102 | } efi_memory_desc_t; | 102 | } efi_memory_desc_t; |
103 | 103 | ||
104 | typedef struct { | ||
105 | efi_guid_t guid; | ||
106 | u32 headersize; | ||
107 | u32 flags; | ||
108 | u32 imagesize; | ||
109 | } efi_capsule_header_t; | ||
110 | |||
104 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); | 111 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); |
105 | 112 | ||
106 | /* | 113 | /* |
@@ -156,6 +163,9 @@ typedef struct { | |||
156 | unsigned long set_variable; | 163 | unsigned long set_variable; |
157 | unsigned long get_next_high_mono_count; | 164 | unsigned long get_next_high_mono_count; |
158 | unsigned long reset_system; | 165 | unsigned long reset_system; |
166 | unsigned long update_capsule; | ||
167 | unsigned long query_capsule_caps; | ||
168 | unsigned long query_variable_info; | ||
159 | } efi_runtime_services_t; | 169 | } efi_runtime_services_t; |
160 | 170 | ||
161 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); | 171 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); |
@@ -168,7 +178,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, | 178 | typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, |
169 | efi_guid_t *vendor); | 179 | efi_guid_t *vendor); |
170 | typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, | 180 | typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, |
171 | unsigned long attr, unsigned long data_size, | 181 | u32 attr, unsigned long data_size, |
172 | void *data); | 182 | void *data); |
173 | typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); | 183 | 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, | 184 | typedef void efi_reset_system_t (int reset_type, efi_status_t status, |
@@ -177,6 +187,17 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz | |||
177 | unsigned long descriptor_size, | 187 | unsigned long descriptor_size, |
178 | u32 descriptor_version, | 188 | u32 descriptor_version, |
179 | efi_memory_desc_t *virtual_map); | 189 | efi_memory_desc_t *virtual_map); |
190 | typedef efi_status_t efi_query_variable_info_t(u32 attr, | ||
191 | u64 *storage_space, | ||
192 | u64 *remaining_space, | ||
193 | u64 *max_variable_size); | ||
194 | typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **capsules, | ||
195 | unsigned long count, | ||
196 | unsigned long sg_list); | ||
197 | typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | ||
198 | unsigned long count, | ||
199 | u64 *max_size, | ||
200 | int *reset_type); | ||
180 | 201 | ||
181 | /* | 202 | /* |
182 | * EFI Configuration Table and GUID definitions | 203 | * EFI Configuration Table and GUID definitions |
@@ -218,6 +239,13 @@ typedef struct { | |||
218 | 239 | ||
219 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) | 240 | #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) |
220 | 241 | ||
242 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) | ||
243 | #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20)) | ||
244 | #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10)) | ||
245 | #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00)) | ||
246 | #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10)) | ||
247 | #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02)) | ||
248 | |||
221 | typedef struct { | 249 | typedef struct { |
222 | efi_table_hdr_t hdr; | 250 | efi_table_hdr_t hdr; |
223 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ | 251 | unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ |
@@ -250,6 +278,7 @@ struct efi_memory_map { | |||
250 | */ | 278 | */ |
251 | extern struct efi { | 279 | extern struct efi { |
252 | efi_system_table_t *systab; /* EFI system table */ | 280 | efi_system_table_t *systab; /* EFI system table */ |
281 | unsigned int runtime_version; /* Runtime services version */ | ||
253 | unsigned long mps; /* MPS table */ | 282 | unsigned long mps; /* MPS table */ |
254 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ | 283 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ |
255 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ | 284 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ |
@@ -266,6 +295,9 @@ extern struct efi { | |||
266 | efi_get_variable_t *get_variable; | 295 | efi_get_variable_t *get_variable; |
267 | efi_get_next_variable_t *get_next_variable; | 296 | efi_get_next_variable_t *get_next_variable; |
268 | efi_set_variable_t *set_variable; | 297 | efi_set_variable_t *set_variable; |
298 | efi_query_variable_info_t *query_variable_info; | ||
299 | efi_update_capsule_t *update_capsule; | ||
300 | efi_query_capsule_caps_t *query_capsule_caps; | ||
269 | efi_get_next_high_mono_count_t *get_next_high_mono_count; | 301 | efi_get_next_high_mono_count_t *get_next_high_mono_count; |
270 | efi_reset_system_t *reset_system; | 302 | efi_reset_system_t *reset_system; |
271 | efi_set_virtual_address_map_t *set_virtual_address_map; | 303 | efi_set_virtual_address_map_t *set_virtual_address_map; |
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..3ff060ac7810 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 |
@@ -27,23 +27,7 @@ struct fault_attr { | |||
27 | unsigned long count; | 27 | unsigned long count; |
28 | 28 | ||
29 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | 29 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS |
30 | 30 | struct dentry *dir; | |
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 | 31 | #endif |
48 | }; | 32 | }; |
49 | 33 | ||
@@ -57,7 +41,6 @@ struct fault_attr { | |||
57 | 41 | ||
58 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER | 42 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER |
59 | int setup_fault_attr(struct fault_attr *attr, char *str); | 43 | 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); | 44 | bool should_fail(struct fault_attr *attr, ssize_t size); |
62 | 45 | ||
63 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | 46 | #ifdef 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..f23bcb77260c 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; |
@@ -777,7 +780,7 @@ struct inode { | |||
777 | struct timespec i_ctime; | 780 | struct timespec i_ctime; |
778 | blkcnt_t i_blocks; | 781 | blkcnt_t i_blocks; |
779 | unsigned short i_bytes; | 782 | unsigned short i_bytes; |
780 | struct rw_semaphore i_alloc_sem; | 783 | atomic_t i_dio_count; |
781 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 784 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
782 | struct file_lock *i_flock; | 785 | struct file_lock *i_flock; |
783 | struct address_space *i_mapping; | 786 | struct address_space *i_mapping; |
@@ -1069,12 +1072,12 @@ struct file_lock_operations { | |||
1069 | }; | 1072 | }; |
1070 | 1073 | ||
1071 | struct lock_manager_operations { | 1074 | struct lock_manager_operations { |
1072 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 1075 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); |
1073 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 1076 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
1074 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1077 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
1075 | void (*fl_release_private)(struct file_lock *); | 1078 | void (*lm_release_private)(struct file_lock *); |
1076 | void (*fl_break)(struct file_lock *); | 1079 | void (*lm_break)(struct file_lock *); |
1077 | int (*fl_change)(struct file_lock **, int); | 1080 | int (*lm_change)(struct file_lock **, int); |
1078 | }; | 1081 | }; |
1079 | 1082 | ||
1080 | struct lock_manager { | 1083 | struct lock_manager { |
@@ -1396,6 +1399,11 @@ struct super_block { | |||
1396 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1399 | struct list_head s_dentry_lru; /* unused dentry lru */ |
1397 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1400 | int s_nr_dentry_unused; /* # of dentry on lru */ |
1398 | 1401 | ||
1402 | /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */ | ||
1403 | spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp; | ||
1404 | struct list_head s_inode_lru; /* unused inode lru */ | ||
1405 | int s_nr_inodes_unused; /* # of inodes on lru */ | ||
1406 | |||
1399 | struct block_device *s_bdev; | 1407 | struct block_device *s_bdev; |
1400 | struct backing_dev_info *s_bdi; | 1408 | struct backing_dev_info *s_bdi; |
1401 | struct mtd_info *s_mtd; | 1409 | struct mtd_info *s_mtd; |
@@ -1438,8 +1446,14 @@ struct super_block { | |||
1438 | * Saved pool identifier for cleancache (-1 means none) | 1446 | * Saved pool identifier for cleancache (-1 means none) |
1439 | */ | 1447 | */ |
1440 | int cleancache_poolid; | 1448 | int cleancache_poolid; |
1449 | |||
1450 | struct shrinker s_shrink; /* per-sb shrinker handle */ | ||
1441 | }; | 1451 | }; |
1442 | 1452 | ||
1453 | /* superblock cache pruning functions */ | ||
1454 | extern void prune_icache_sb(struct super_block *sb, int nr_to_scan); | ||
1455 | extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan); | ||
1456 | |||
1443 | extern struct timespec current_fs_time(struct super_block *sb); | 1457 | extern struct timespec current_fs_time(struct super_block *sb); |
1444 | 1458 | ||
1445 | /* | 1459 | /* |
@@ -1454,10 +1468,6 @@ enum { | |||
1454 | #define vfs_check_frozen(sb, level) \ | 1468 | #define vfs_check_frozen(sb, level) \ |
1455 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) | 1469 | wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) |
1456 | 1470 | ||
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 | /* | 1471 | /* |
1462 | * until VFS tracks user namespaces for inodes, just make all files | 1472 | * until VFS tracks user namespaces for inodes, just make all files |
1463 | * belong to init_user_ns | 1473 | * belong to init_user_ns |
@@ -1490,7 +1500,6 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1490 | /* | 1500 | /* |
1491 | * VFS file helper functions. | 1501 | * VFS file helper functions. |
1492 | */ | 1502 | */ |
1493 | extern int file_permission(struct file *, int); | ||
1494 | extern void inode_init_owner(struct inode *inode, const struct inode *dir, | 1503 | extern void inode_init_owner(struct inode *inode, const struct inode *dir, |
1495 | mode_t mode); | 1504 | mode_t mode); |
1496 | /* | 1505 | /* |
@@ -1538,11 +1547,6 @@ struct block_device_operations; | |||
1538 | #define HAVE_COMPAT_IOCTL 1 | 1547 | #define HAVE_COMPAT_IOCTL 1 |
1539 | #define HAVE_UNLOCKED_IOCTL 1 | 1548 | #define HAVE_UNLOCKED_IOCTL 1 |
1540 | 1549 | ||
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 { | 1550 | struct file_operations { |
1547 | struct module *owner; | 1551 | struct module *owner; |
1548 | loff_t (*llseek) (struct file *, loff_t, int); | 1552 | loff_t (*llseek) (struct file *, loff_t, int); |
@@ -1558,7 +1562,7 @@ struct file_operations { | |||
1558 | int (*open) (struct inode *, struct file *); | 1562 | int (*open) (struct inode *, struct file *); |
1559 | int (*flush) (struct file *, fl_owner_t id); | 1563 | int (*flush) (struct file *, fl_owner_t id); |
1560 | int (*release) (struct inode *, struct file *); | 1564 | int (*release) (struct inode *, struct file *); |
1561 | int (*fsync) (struct file *, int datasync); | 1565 | int (*fsync) (struct file *, loff_t, loff_t, int datasync); |
1562 | int (*aio_fsync) (struct kiocb *, int datasync); | 1566 | int (*aio_fsync) (struct kiocb *, int datasync); |
1563 | int (*fasync) (int, struct file *, int); | 1567 | int (*fasync) (int, struct file *, int); |
1564 | int (*lock) (struct file *, int, struct file_lock *); | 1568 | int (*lock) (struct file *, int, struct file_lock *); |
@@ -1573,13 +1577,11 @@ struct file_operations { | |||
1573 | loff_t len); | 1577 | loff_t len); |
1574 | }; | 1578 | }; |
1575 | 1579 | ||
1576 | #define IPERM_FLAG_RCU 0x0001 | ||
1577 | |||
1578 | struct inode_operations { | 1580 | struct inode_operations { |
1579 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1581 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
1580 | void * (*follow_link) (struct dentry *, struct nameidata *); | 1582 | void * (*follow_link) (struct dentry *, struct nameidata *); |
1581 | int (*permission) (struct inode *, int, unsigned int); | 1583 | int (*permission) (struct inode *, int); |
1582 | int (*check_acl)(struct inode *, int, unsigned int); | 1584 | struct posix_acl * (*get_acl)(struct inode *, int); |
1583 | 1585 | ||
1584 | int (*readlink) (struct dentry *, char __user *,int); | 1586 | int (*readlink) (struct dentry *, char __user *,int); |
1585 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1587 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
@@ -1645,6 +1647,8 @@ struct super_operations { | |||
1645 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1647 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
1646 | #endif | 1648 | #endif |
1647 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 1649 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
1650 | int (*nr_cached_objects)(struct super_block *); | ||
1651 | void (*free_cached_objects)(struct super_block *, int); | ||
1648 | }; | 1652 | }; |
1649 | 1653 | ||
1650 | /* | 1654 | /* |
@@ -1693,6 +1697,10 @@ struct super_operations { | |||
1693 | * set during data writeback, and cleared with a wakeup | 1697 | * set during data writeback, and cleared with a wakeup |
1694 | * on the bit address once it is done. | 1698 | * on the bit address once it is done. |
1695 | * | 1699 | * |
1700 | * I_REFERENCED Marks the inode as recently references on the LRU list. | ||
1701 | * | ||
1702 | * I_DIO_WAKEUP Never set. Only used as a key for wait_on_bit(). | ||
1703 | * | ||
1696 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1704 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1697 | */ | 1705 | */ |
1698 | #define I_DIRTY_SYNC (1 << 0) | 1706 | #define I_DIRTY_SYNC (1 << 0) |
@@ -1706,6 +1714,8 @@ struct super_operations { | |||
1706 | #define __I_SYNC 7 | 1714 | #define __I_SYNC 7 |
1707 | #define I_SYNC (1 << __I_SYNC) | 1715 | #define I_SYNC (1 << __I_SYNC) |
1708 | #define I_REFERENCED (1 << 8) | 1716 | #define I_REFERENCED (1 << 8) |
1717 | #define __I_DIO_WAKEUP 9 | ||
1718 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) | ||
1709 | 1719 | ||
1710 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1720 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1711 | 1721 | ||
@@ -1816,7 +1826,6 @@ struct file_system_type { | |||
1816 | struct lock_class_key i_lock_key; | 1826 | struct lock_class_key i_lock_key; |
1817 | struct lock_class_key i_mutex_key; | 1827 | struct lock_class_key i_mutex_key; |
1818 | struct lock_class_key i_mutex_dir_key; | 1828 | struct lock_class_key i_mutex_dir_key; |
1819 | struct lock_class_key i_alloc_sem_key; | ||
1820 | }; | 1829 | }; |
1821 | 1830 | ||
1822 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, | 1831 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, |
@@ -1837,6 +1846,8 @@ void kill_litter_super(struct super_block *sb); | |||
1837 | void deactivate_super(struct super_block *sb); | 1846 | void deactivate_super(struct super_block *sb); |
1838 | void deactivate_locked_super(struct super_block *sb); | 1847 | void deactivate_locked_super(struct super_block *sb); |
1839 | int set_anon_super(struct super_block *s, void *data); | 1848 | int set_anon_super(struct super_block *s, void *data); |
1849 | int get_anon_bdev(dev_t *); | ||
1850 | void free_anon_bdev(dev_t); | ||
1840 | struct super_block *sget(struct file_system_type *type, | 1851 | struct super_block *sget(struct file_system_type *type, |
1841 | int (*test)(struct super_block *,void *), | 1852 | int (*test)(struct super_block *,void *), |
1842 | int (*set)(struct super_block *,void *), | 1853 | int (*set)(struct super_block *,void *), |
@@ -1869,6 +1880,7 @@ extern int register_filesystem(struct file_system_type *); | |||
1869 | extern int unregister_filesystem(struct file_system_type *); | 1880 | extern int unregister_filesystem(struct file_system_type *); |
1870 | extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); | 1881 | extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); |
1871 | #define kern_mount(type) kern_mount_data(type, NULL) | 1882 | #define kern_mount(type) kern_mount_data(type, NULL) |
1883 | extern void kern_unmount(struct vfsmount *mnt); | ||
1872 | extern int may_umount_tree(struct vfsmount *); | 1884 | extern int may_umount_tree(struct vfsmount *); |
1873 | extern int may_umount(struct vfsmount *); | 1885 | extern int may_umount(struct vfsmount *); |
1874 | extern long do_mount(char *, char *, char *, unsigned long, void *); | 1886 | extern long do_mount(char *, char *, char *, unsigned long, void *); |
@@ -2188,16 +2200,38 @@ extern sector_t bmap(struct inode *, sector_t); | |||
2188 | #endif | 2200 | #endif |
2189 | extern int notify_change(struct dentry *, struct iattr *); | 2201 | extern int notify_change(struct dentry *, struct iattr *); |
2190 | extern int inode_permission(struct inode *, int); | 2202 | extern int inode_permission(struct inode *, int); |
2191 | extern int generic_permission(struct inode *, int, unsigned int, | 2203 | extern int generic_permission(struct inode *, int); |
2192 | int (*check_acl)(struct inode *, int, unsigned int)); | ||
2193 | 2204 | ||
2194 | static inline bool execute_ok(struct inode *inode) | 2205 | static inline bool execute_ok(struct inode *inode) |
2195 | { | 2206 | { |
2196 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); | 2207 | return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
2197 | } | 2208 | } |
2198 | 2209 | ||
2199 | extern int get_write_access(struct inode *); | 2210 | /* |
2200 | extern int deny_write_access(struct file *); | 2211 | * get_write_access() gets write permission for a file. |
2212 | * put_write_access() releases this write permission. | ||
2213 | * This is used for regular files. | ||
2214 | * We cannot support write (and maybe mmap read-write shared) accesses and | ||
2215 | * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode | ||
2216 | * can have the following values: | ||
2217 | * 0: no writers, no VM_DENYWRITE mappings | ||
2218 | * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist | ||
2219 | * > 0: (i_writecount) users are writing to the file. | ||
2220 | * | ||
2221 | * Normally we operate on that counter with atomic_{inc,dec} and it's safe | ||
2222 | * except for the cases where we don't hold i_writecount yet. Then we need to | ||
2223 | * use {get,deny}_write_access() - these functions check the sign and refuse | ||
2224 | * to do the change if sign is wrong. | ||
2225 | */ | ||
2226 | static inline int get_write_access(struct inode *inode) | ||
2227 | { | ||
2228 | return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY; | ||
2229 | } | ||
2230 | static inline int deny_write_access(struct file *file) | ||
2231 | { | ||
2232 | struct inode *inode = file->f_path.dentry->d_inode; | ||
2233 | return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; | ||
2234 | } | ||
2201 | static inline void put_write_access(struct inode * inode) | 2235 | static inline void put_write_access(struct inode * inode) |
2202 | { | 2236 | { |
2203 | atomic_dec(&inode->i_writecount); | 2237 | atomic_dec(&inode->i_writecount); |
@@ -2276,7 +2310,8 @@ extern void __iget(struct inode * inode); | |||
2276 | extern void iget_failed(struct inode *); | 2310 | extern void iget_failed(struct inode *); |
2277 | extern void end_writeback(struct inode *); | 2311 | extern void end_writeback(struct inode *); |
2278 | extern void __destroy_inode(struct inode *); | 2312 | extern void __destroy_inode(struct inode *); |
2279 | extern struct inode *new_inode(struct super_block *); | 2313 | extern struct inode *new_inode_pseudo(struct super_block *sb); |
2314 | extern struct inode *new_inode(struct super_block *sb); | ||
2280 | extern void free_inode_nonrcu(struct inode *inode); | 2315 | extern void free_inode_nonrcu(struct inode *inode); |
2281 | extern int should_remove_suid(struct dentry *); | 2316 | extern int should_remove_suid(struct dentry *); |
2282 | extern int file_remove_suid(struct file *); | 2317 | extern int file_remove_suid(struct file *); |
@@ -2317,7 +2352,8 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
2317 | /* fs/block_dev.c */ | 2352 | /* fs/block_dev.c */ |
2318 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2353 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
2319 | unsigned long nr_segs, loff_t pos); | 2354 | unsigned long nr_segs, loff_t pos); |
2320 | extern int blkdev_fsync(struct file *filp, int datasync); | 2355 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
2356 | int datasync); | ||
2321 | 2357 | ||
2322 | /* fs/splice.c */ | 2358 | /* fs/splice.c */ |
2323 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2359 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
@@ -2368,6 +2404,8 @@ enum { | |||
2368 | }; | 2404 | }; |
2369 | 2405 | ||
2370 | void dio_end_io(struct bio *bio, int error); | 2406 | void dio_end_io(struct bio *bio, int error); |
2407 | void inode_dio_wait(struct inode *inode); | ||
2408 | void inode_dio_done(struct inode *inode); | ||
2371 | 2409 | ||
2372 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 2410 | 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, | 2411 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
@@ -2375,14 +2413,17 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | |||
2375 | dio_submit_t submit_io, int flags); | 2413 | dio_submit_t submit_io, int flags); |
2376 | 2414 | ||
2377 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2415 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
2378 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 2416 | struct inode *inode, const struct iovec *iov, loff_t offset, |
2379 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | 2417 | unsigned long nr_segs, get_block_t get_block) |
2380 | dio_iodone_t end_io) | ||
2381 | { | 2418 | { |
2382 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 2419 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, |
2383 | nr_segs, get_block, end_io, NULL, | 2420 | offset, nr_segs, get_block, NULL, NULL, |
2384 | DIO_LOCKING | DIO_SKIP_HOLES); | 2421 | DIO_LOCKING | DIO_SKIP_HOLES); |
2385 | } | 2422 | } |
2423 | #else | ||
2424 | static inline void inode_dio_wait(struct inode *inode) | ||
2425 | { | ||
2426 | } | ||
2386 | #endif | 2427 | #endif |
2387 | 2428 | ||
2388 | extern const struct file_operations generic_ro_fops; | 2429 | extern const struct file_operations generic_ro_fops; |
@@ -2432,6 +2473,8 @@ extern struct super_block *get_active_super(struct block_device *bdev); | |||
2432 | extern struct super_block *user_get_super(dev_t); | 2473 | extern struct super_block *user_get_super(dev_t); |
2433 | extern void drop_super(struct super_block *sb); | 2474 | extern void drop_super(struct super_block *sb); |
2434 | extern void iterate_supers(void (*)(struct super_block *, void *), void *); | 2475 | extern void iterate_supers(void (*)(struct super_block *, void *), void *); |
2476 | extern void iterate_supers_type(struct file_system_type *, | ||
2477 | void (*)(struct super_block *, void *), void *); | ||
2435 | 2478 | ||
2436 | extern int dcache_dir_open(struct inode *, struct file *); | 2479 | extern int dcache_dir_open(struct inode *, struct file *); |
2437 | extern int dcache_dir_close(struct inode *, struct file *); | 2480 | extern int dcache_dir_close(struct inode *, struct file *); |
@@ -2444,7 +2487,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *); | |||
2444 | extern int simple_unlink(struct inode *, struct dentry *); | 2487 | extern int simple_unlink(struct inode *, struct dentry *); |
2445 | extern int simple_rmdir(struct inode *, struct dentry *); | 2488 | extern int simple_rmdir(struct inode *, struct dentry *); |
2446 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 2489 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); |
2447 | extern int noop_fsync(struct file *, int); | 2490 | extern int noop_fsync(struct file *, loff_t, loff_t, int); |
2448 | extern int simple_empty(struct dentry *); | 2491 | extern int simple_empty(struct dentry *); |
2449 | extern int simple_readpage(struct file *file, struct page *page); | 2492 | extern int simple_readpage(struct file *file, struct page *page); |
2450 | extern int simple_write_begin(struct file *file, struct address_space *mapping, | 2493 | extern int simple_write_begin(struct file *file, struct address_space *mapping, |
@@ -2469,7 +2512,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, | 2512 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, |
2470 | const void __user *from, size_t count); | 2513 | const void __user *from, size_t count); |
2471 | 2514 | ||
2472 | extern int generic_file_fsync(struct file *, int); | 2515 | extern int generic_file_fsync(struct file *, loff_t, loff_t, int); |
2473 | 2516 | ||
2474 | extern int generic_check_addressable(unsigned, u64); | 2517 | extern int generic_check_addressable(unsigned, u64); |
2475 | 2518 | ||
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 7c4d72f5581f..9ec20dec3353 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); | |||
204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); | 204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); |
205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, | 205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, |
206 | gfp_t); | 206 | gfp_t); |
207 | extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, | ||
208 | struct inode *); | ||
207 | 209 | ||
208 | /** | 210 | /** |
209 | * fscache_register_netfs - Register a filesystem as desiring caching services | 211 | * fscache_register_netfs - Register a filesystem as desiring caching services |
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie, | |||
643 | return false; | 645 | return false; |
644 | } | 646 | } |
645 | 647 | ||
648 | /** | ||
649 | * fscache_uncache_all_inode_pages - Uncache all an inode's pages | ||
650 | * @cookie: The cookie representing the inode's cache object. | ||
651 | * @inode: The inode to uncache pages from. | ||
652 | * | ||
653 | * Uncache all the pages in an inode that are marked PG_fscache, assuming them | ||
654 | * to be associated with the given cookie. | ||
655 | * | ||
656 | * This function may sleep. It will wait for pages that are being written out | ||
657 | * and will wait whilst the PG_fscache mark is removed by the cache. | ||
658 | */ | ||
659 | static inline | ||
660 | void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | ||
661 | struct inode *inode) | ||
662 | { | ||
663 | if (fscache_cookie_valid(cookie)) | ||
664 | __fscache_uncache_all_inode_pages(cookie, inode); | ||
665 | } | ||
666 | |||
646 | #endif /* _LINUX_FSCACHE_H */ | 667 | #endif /* _LINUX_FSCACHE_H */ |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index 781d4671415f..daa9952d2174 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -24,12 +24,6 @@ | |||
24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() |
25 | */ | 25 | */ |
26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) |
27 | /* Minimum value that the pixel clock can be set to in pico seconds | ||
28 | * This is determined by platform clock/3 where the minimum platform | ||
29 | * clock is 533MHz. This gives 5629 pico seconds. | ||
30 | */ | ||
31 | #define MIN_PIX_CLK 5629 | ||
32 | #define MAX_PIX_CLK 96096 | ||
33 | 27 | ||
34 | #include <linux/types.h> | 28 | #include <linux/types.h> |
35 | 29 | ||
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/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/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/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_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..068784e17972 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 */ |
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..c2ebfe66177c 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; |
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 8b4538446636..5f695041090c 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -96,11 +96,6 @@ enum { | |||
96 | 96 | ||
97 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) | 97 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) |
98 | 98 | ||
99 | static inline __deprecated bool CHECK_IRQ_PER_CPU(unsigned int status) | ||
100 | { | ||
101 | return status & IRQ_PER_CPU; | ||
102 | } | ||
103 | |||
104 | /* | 99 | /* |
105 | * Return value for chip->irq_set_affinity() | 100 | * Return value for chip->irq_set_affinity() |
106 | * | 101 | * |
@@ -676,7 +671,8 @@ void irq_gc_mask_disable_reg(struct irq_data *d); | |||
676 | void irq_gc_mask_set_bit(struct irq_data *d); | 671 | void irq_gc_mask_set_bit(struct irq_data *d); |
677 | void irq_gc_mask_clr_bit(struct irq_data *d); | 672 | void irq_gc_mask_clr_bit(struct irq_data *d); |
678 | void irq_gc_unmask_enable_reg(struct irq_data *d); | 673 | void irq_gc_unmask_enable_reg(struct irq_data *d); |
679 | void irq_gc_ack(struct irq_data *d); | 674 | void irq_gc_ack_set_bit(struct irq_data *d); |
675 | void irq_gc_ack_clr_bit(struct irq_data *d); | ||
680 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); | 676 | void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); |
681 | void irq_gc_eoi(struct irq_data *d); | 677 | void irq_gc_eoi(struct irq_data *d); |
682 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); | 678 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); |
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/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/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/memcontrol.h b/include/linux/memcontrol.h index 50940da6adf3..b96600786913 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 |
@@ -111,8 +121,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | |||
111 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 121 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); |
112 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 122 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
113 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, | 123 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, |
114 | struct zone *zone, | 124 | 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, | 125 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, |
117 | struct zone *zone); | 126 | struct zone *zone); |
118 | struct zone_reclaim_stat* | 127 | struct zone_reclaim_stat* |
@@ -120,6 +129,15 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page); | |||
120 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | 129 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, |
121 | struct task_struct *p); | 130 | struct task_struct *p); |
122 | 131 | ||
132 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
133 | gfp_t gfp_mask, bool noswap, | ||
134 | struct memcg_scanrecord *rec); | ||
135 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
136 | gfp_t gfp_mask, bool noswap, | ||
137 | struct zone *zone, | ||
138 | struct memcg_scanrecord *rec, | ||
139 | unsigned long *nr_scanned); | ||
140 | |||
123 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 141 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
124 | extern int do_swap_account; | 142 | extern int do_swap_account; |
125 | #endif | 143 | #endif |
@@ -313,8 +331,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | |||
313 | } | 331 | } |
314 | 332 | ||
315 | static inline unsigned long | 333 | static inline unsigned long |
316 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, | 334 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid, |
317 | enum lru_list lru) | 335 | unsigned int lru_mask) |
318 | { | 336 | { |
319 | return 0; | 337 | return 0; |
320 | } | 338 | } |
diff --git a/include/linux/memory.h b/include/linux/memory.h index e1e3b2b84f85..935699b30b7c 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/compiler.h> | 20 | #include <linux/compiler.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | 22 | ||
23 | #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) | ||
24 | |||
23 | struct memory_block { | 25 | struct memory_block { |
24 | unsigned long start_section_nr; | 26 | unsigned long start_section_nr; |
25 | unsigned long end_section_nr; | 27 | unsigned long end_section_nr; |
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/ds1wm.h b/include/linux/mfd/ds1wm.h index be469a357cbb..38a372a0e285 100644 --- a/include/linux/mfd/ds1wm.h +++ b/include/linux/mfd/ds1wm.h | |||
@@ -3,4 +3,11 @@ | |||
3 | struct ds1wm_driver_data { | 3 | struct ds1wm_driver_data { |
4 | int active_high; | 4 | int active_high; |
5 | int clock_rate; | 5 | int clock_rate; |
6 | /* in milliseconds, the amount of time to */ | ||
7 | /* sleep following a reset pulse. Zero */ | ||
8 | /* should work if your bus devices recover*/ | ||
9 | /* time respects the 1-wire spec since the*/ | ||
10 | /* ds1wm implements the precise timings of*/ | ||
11 | /* a reset pulse/presence detect sequence.*/ | ||
12 | unsigned int reset_recover_delay; | ||
6 | }; | 13 | }; |
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/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..73572c65d04f 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 */ |
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/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..3172a1c0f08e 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 | */ |
@@ -985,6 +988,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
985 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 988 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
986 | struct page **pages); | 989 | struct page **pages); |
987 | struct page *get_dump_page(unsigned long addr); | 990 | struct page *get_dump_page(unsigned long addr); |
991 | extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, | ||
992 | unsigned long address, unsigned int fault_flags); | ||
988 | 993 | ||
989 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 994 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
990 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 995 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
@@ -1121,44 +1126,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | |||
1121 | } | 1126 | } |
1122 | #endif | 1127 | #endif |
1123 | 1128 | ||
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); | 1129 | int vma_wants_writenotify(struct vm_area_struct *vma); |
1163 | 1130 | ||
1164 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, | 1131 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, |
@@ -1313,6 +1280,7 @@ extern void remove_active_range(unsigned int nid, unsigned long start_pfn, | |||
1313 | unsigned long end_pfn); | 1280 | unsigned long end_pfn); |
1314 | extern void remove_all_active_ranges(void); | 1281 | extern void remove_all_active_ranges(void); |
1315 | void sort_node_map(void); | 1282 | void sort_node_map(void); |
1283 | unsigned long node_map_pfn_alignment(void); | ||
1316 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, | 1284 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, |
1317 | unsigned long end_pfn); | 1285 | unsigned long end_pfn); |
1318 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | 1286 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, |
@@ -1445,8 +1413,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t); | |||
1445 | 1413 | ||
1446 | extern unsigned long do_brk(unsigned long, unsigned long); | 1414 | extern unsigned long do_brk(unsigned long, unsigned long); |
1447 | 1415 | ||
1448 | /* filemap.c */ | 1416 | /* truncate.c */ |
1449 | extern unsigned long page_unuse(struct page *); | ||
1450 | extern void truncate_inode_pages(struct address_space *, loff_t); | 1417 | extern void truncate_inode_pages(struct address_space *, loff_t); |
1451 | extern void truncate_inode_pages_range(struct address_space *, | 1418 | extern void truncate_inode_pages_range(struct address_space *, |
1452 | loff_t lstart, loff_t lend); | 1419 | loff_t lstart, loff_t lend); |
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 c6927a4d157f..b460fc2af8a1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -64,6 +64,19 @@ struct mmc_ext_csd { | |||
64 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
65 | unsigned int enhanced_area_size; /* Units: KB */ | 65 | unsigned int enhanced_area_size; /* Units: KB */ |
66 | unsigned int boot_size; /* in bytes */ | 66 | unsigned int boot_size; /* in bytes */ |
67 | u8 raw_partition_support; /* 160 */ | ||
68 | u8 raw_erased_mem_count; /* 181 */ | ||
69 | u8 raw_ext_csd_structure; /* 194 */ | ||
70 | u8 raw_card_type; /* 196 */ | ||
71 | u8 raw_s_a_timeout; /* 217 */ | ||
72 | u8 raw_hc_erase_gap_size; /* 221 */ | ||
73 | u8 raw_erase_timeout_mult; /* 223 */ | ||
74 | u8 raw_hc_erase_grp_size; /* 224 */ | ||
75 | u8 raw_sec_trim_mult; /* 229 */ | ||
76 | u8 raw_sec_erase_mult; /* 230 */ | ||
77 | u8 raw_sec_feature_support;/* 231 */ | ||
78 | u8 raw_trim_mult; /* 232 */ | ||
79 | u8 raw_sectors[4]; /* 212 - 4 bytes */ | ||
67 | }; | 80 | }; |
68 | 81 | ||
69 | struct sd_scr { | 82 | struct sd_scr { |
@@ -390,4 +403,4 @@ extern void mmc_unregister_driver(struct mmc_driver *); | |||
390 | extern void mmc_fixup_device(struct mmc_card *card, | 403 | extern void mmc_fixup_device(struct mmc_card *card, |
391 | const struct mmc_fixup *table); | 404 | const struct mmc_fixup *table); |
392 | 405 | ||
393 | #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..0f83858147a6 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -106,6 +106,15 @@ struct mmc_host_ops { | |||
106 | */ | 106 | */ |
107 | int (*enable)(struct mmc_host *host); | 107 | int (*enable)(struct mmc_host *host); |
108 | int (*disable)(struct mmc_host *host, int lazy); | 108 | int (*disable)(struct mmc_host *host, int lazy); |
109 | /* | ||
110 | * It is optional for the host to implement pre_req and post_req in | ||
111 | * order to support double buffering of requests (prepare one | ||
112 | * request while another request is active). | ||
113 | */ | ||
114 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | ||
115 | int err); | ||
116 | void (*pre_req)(struct mmc_host *host, struct mmc_request *req, | ||
117 | bool is_first_req); | ||
109 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 118 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
110 | /* | 119 | /* |
111 | * Avoid calling these three functions too often or in a "fast path", | 120 | * Avoid calling these three functions too often or in a "fast path", |
@@ -139,11 +148,22 @@ struct mmc_host_ops { | |||
139 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); | 148 | int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); |
140 | int (*execute_tuning)(struct mmc_host *host); | 149 | int (*execute_tuning)(struct mmc_host *host); |
141 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 150 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
151 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | ||
142 | }; | 152 | }; |
143 | 153 | ||
144 | struct mmc_card; | 154 | struct mmc_card; |
145 | struct device; | 155 | struct device; |
146 | 156 | ||
157 | struct mmc_async_req { | ||
158 | /* active mmc request */ | ||
159 | struct mmc_request *mrq; | ||
160 | /* | ||
161 | * Check error status of completed mmc request. | ||
162 | * Returns 0 if success otherwise non zero. | ||
163 | */ | ||
164 | int (*err_check) (struct mmc_card *, struct mmc_async_req *); | ||
165 | }; | ||
166 | |||
147 | struct mmc_host { | 167 | struct mmc_host { |
148 | struct device *parent; | 168 | struct device *parent; |
149 | struct device class_dev; | 169 | struct device class_dev; |
@@ -231,6 +251,7 @@ struct mmc_host { | |||
231 | unsigned int max_req_size; /* maximum number of bytes in one req */ | 251 | unsigned int max_req_size; /* maximum number of bytes in one req */ |
232 | unsigned int max_blk_size; /* maximum size of one mmc block */ | 252 | unsigned int max_blk_size; /* maximum size of one mmc block */ |
233 | unsigned int max_blk_count; /* maximum number of blocks in one req */ | 253 | unsigned int max_blk_count; /* maximum number of blocks in one req */ |
254 | unsigned int max_discard_to; /* max. discard timeout in ms */ | ||
234 | 255 | ||
235 | /* private data */ | 256 | /* private data */ |
236 | spinlock_t lock; /* lock for claim and bus ops */ | 257 | spinlock_t lock; /* lock for claim and bus ops */ |
@@ -281,6 +302,8 @@ struct mmc_host { | |||
281 | 302 | ||
282 | struct dentry *debugfs_root; | 303 | struct dentry *debugfs_root; |
283 | 304 | ||
305 | struct mmc_async_req *areq; /* active async req */ | ||
306 | |||
284 | unsigned long private[0] ____cacheline_aligned; | 307 | unsigned long private[0] ____cacheline_aligned; |
285 | }; | 308 | }; |
286 | 309 | ||
@@ -373,5 +396,4 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
373 | { | 396 | { |
374 | return host->caps & MMC_CAP_CMD23; | 397 | return host->caps & MMC_CAP_CMD23; |
375 | } | 398 | } |
376 | #endif | 399 | #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 54b8b4d7b68f..2ed0b6cf11c5 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, |
@@ -1097,12 +1062,6 @@ struct net_device { | |||
1097 | #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ | 1062 | #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ |
1098 | NETIF_F_FSO) | 1063 | NETIF_F_FSO) |
1099 | 1064 | ||
1100 | #define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \ | ||
1101 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ | ||
1102 | NETIF_F_HIGHDMA | \ | ||
1103 | NETIF_F_SCTP_CSUM | \ | ||
1104 | NETIF_F_ALL_FCOE) | ||
1105 | |||
1106 | /* | 1065 | /* |
1107 | * If one device supports one of these features, then enable them | 1066 | * If one device supports one of these features, then enable them |
1108 | * for all in netdev_increment_features. | 1067 | * for all in netdev_increment_features. |
@@ -1220,7 +1179,7 @@ struct net_device { | |||
1220 | 1179 | ||
1221 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 1180 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
1222 | 1181 | ||
1223 | #ifdef CONFIG_RPS | 1182 | #if defined(CONFIG_RPS) || defined(CONFIG_XPS) |
1224 | struct kset *queues_kset; | 1183 | struct kset *queues_kset; |
1225 | 1184 | ||
1226 | struct netdev_rx_queue *_rx; | 1185 | struct netdev_rx_queue *_rx; |
@@ -1348,9 +1307,6 @@ struct net_device { | |||
1348 | /* max exchange id for FCoE LRO by ddp */ | 1307 | /* max exchange id for FCoE LRO by ddp */ |
1349 | unsigned int fcoe_ddp_xid; | 1308 | unsigned int fcoe_ddp_xid; |
1350 | #endif | 1309 | #endif |
1351 | /* n-tuple filter list attached to this device */ | ||
1352 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; | ||
1353 | |||
1354 | /* phy device may attach itself for hardware timestamping */ | 1310 | /* phy device may attach itself for hardware timestamping */ |
1355 | struct phy_device *phydev; | 1311 | struct phy_device *phydev; |
1356 | 1312 | ||
@@ -1563,9 +1519,41 @@ struct packet_type { | |||
1563 | struct list_head list; | 1519 | struct list_head list; |
1564 | }; | 1520 | }; |
1565 | 1521 | ||
1566 | #include <linux/interrupt.h> | ||
1567 | #include <linux/notifier.h> | 1522 | #include <linux/notifier.h> |
1568 | 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 | |||
1569 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1557 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1570 | 1558 | ||
1571 | 1559 | ||
@@ -1648,12 +1636,9 @@ static inline void unregister_netdevice(struct net_device *dev) | |||
1648 | extern int netdev_refcnt_read(const struct net_device *dev); | 1636 | extern int netdev_refcnt_read(const struct net_device *dev); |
1649 | extern void free_netdev(struct net_device *dev); | 1637 | extern void free_netdev(struct net_device *dev); |
1650 | extern void synchronize_net(void); | 1638 | extern void synchronize_net(void); |
1651 | extern int register_netdevice_notifier(struct notifier_block *nb); | ||
1652 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | ||
1653 | extern int init_dummy_netdev(struct net_device *dev); | 1639 | extern int init_dummy_netdev(struct net_device *dev); |
1654 | extern void netdev_resync_ops(struct net_device *dev); | 1640 | extern void netdev_resync_ops(struct net_device *dev); |
1655 | 1641 | ||
1656 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | ||
1657 | 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); |
1658 | 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); |
1659 | 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); |
@@ -1786,8 +1771,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, | |||
1786 | 1771 | ||
1787 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); | 1772 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); |
1788 | 1773 | ||
1789 | #define HAVE_NETIF_QUEUE | ||
1790 | |||
1791 | extern void __netif_schedule(struct Qdisc *q); | 1774 | extern void __netif_schedule(struct Qdisc *q); |
1792 | 1775 | ||
1793 | static inline void netif_schedule_queue(struct netdev_queue *txq) | 1776 | static inline void netif_schedule_queue(struct netdev_queue *txq) |
@@ -2063,10 +2046,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb); | |||
2063 | */ | 2046 | */ |
2064 | extern void dev_kfree_skb_any(struct sk_buff *skb); | 2047 | extern void dev_kfree_skb_any(struct sk_buff *skb); |
2065 | 2048 | ||
2066 | #define HAVE_NETIF_RX 1 | ||
2067 | extern int netif_rx(struct sk_buff *skb); | 2049 | extern int netif_rx(struct sk_buff *skb); |
2068 | extern int netif_rx_ni(struct sk_buff *skb); | 2050 | extern int netif_rx_ni(struct sk_buff *skb); |
2069 | #define HAVE_NETIF_RECEIVE_SKB 1 | ||
2070 | extern int netif_receive_skb(struct sk_buff *skb); | 2051 | extern int netif_receive_skb(struct sk_buff *skb); |
2071 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | 2052 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
2072 | struct sk_buff *skb); | 2053 | struct sk_buff *skb); |
@@ -2246,7 +2227,6 @@ extern void netif_device_attach(struct net_device *dev); | |||
2246 | /* | 2227 | /* |
2247 | * Network interface message level settings | 2228 | * Network interface message level settings |
2248 | */ | 2229 | */ |
2249 | #define HAVE_NETIF_MSG 1 | ||
2250 | 2230 | ||
2251 | enum { | 2231 | enum { |
2252 | NETIF_MSG_DRV = 0x0001, | 2232 | NETIF_MSG_DRV = 0x0001, |
@@ -2564,7 +2544,6 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev) | |||
2564 | return (dev->features & ~dev->hw_features) | dev->wanted_features; | 2544 | return (dev->features & ~dev->hw_features) | dev->wanted_features; |
2565 | } | 2545 | } |
2566 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); | 2546 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); |
2567 | u32 netdev_fix_features(struct net_device *dev, u32 features); | ||
2568 | int __netdev_update_features(struct net_device *dev); | 2547 | int __netdev_update_features(struct net_device *dev); |
2569 | void netdev_update_features(struct net_device *dev); | 2548 | void netdev_update_features(struct net_device *dev); |
2570 | void netdev_change_features(struct net_device *dev); | 2549 | 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..2e17c5dbdcb8 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -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/nfs4.h b/include/linux/nfs4.h index 504b289ba680..a3c4bc800dce 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -563,6 +563,9 @@ 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, | ||
566 | }; | 569 | }; |
567 | 570 | ||
568 | /* nfs41 types */ | 571 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1b93b9c60e55..8b579beb6358 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; |
@@ -360,7 +360,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); | 360 | 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); | 361 | 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 *); | 362 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
363 | extern int nfs_permission(struct inode *, int, unsigned int); | 363 | extern int nfs_permission(struct inode *, int); |
364 | extern int nfs_open(struct inode *, struct file *); | 364 | extern int nfs_open(struct inode *, struct file *); |
365 | extern int nfs_release(struct inode *, struct file *); | 365 | extern int nfs_release(struct inode *, struct file *); |
366 | extern int nfs_attribute_timeout(struct inode *inode); | 366 | extern int nfs_attribute_timeout(struct inode *inode); |
@@ -372,7 +372,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); | 372 | 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); | 373 | 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); | 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 *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); | 375 | 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); | 376 | 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); | 377 | 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); | 378 | extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 87694ca86914..50a661f8b45a 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 | /* |
@@ -149,6 +151,7 @@ struct nfs_server { | |||
149 | struct rb_root openowner_id; | 151 | struct rb_root openowner_id; |
150 | struct rb_root lockowner_id; | 152 | struct rb_root lockowner_id; |
151 | #endif | 153 | #endif |
154 | struct list_head layouts; | ||
152 | struct list_head delegations; | 155 | struct list_head delegations; |
153 | void (*destroy)(struct nfs_server *); | 156 | void (*destroy)(struct nfs_server *); |
154 | 157 | ||
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..5b115956abac 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -269,9 +269,10 @@ struct nfs4_layoutcommit_data { | |||
269 | }; | 269 | }; |
270 | 270 | ||
271 | struct nfs4_layoutreturn_args { | 271 | struct nfs4_layoutreturn_args { |
272 | __u32 layout_type; | 272 | struct pnfs_layout_hdr *layout; |
273 | struct inode *inode; | 273 | struct inode *inode; |
274 | nfs4_stateid stateid; | 274 | nfs4_stateid stateid; |
275 | __u32 layout_type; | ||
275 | struct nfs4_sequence_args seq_args; | 276 | struct nfs4_sequence_args seq_args; |
276 | }; | 277 | }; |
277 | 278 | ||
@@ -1060,6 +1061,7 @@ struct server_scope { | |||
1060 | struct nfs41_exchange_id_res { | 1061 | struct nfs41_exchange_id_res { |
1061 | struct nfs_client *client; | 1062 | struct nfs_client *client; |
1062 | u32 flags; | 1063 | u32 flags; |
1064 | struct server_scope *server_scope; | ||
1063 | }; | 1065 | }; |
1064 | 1066 | ||
1065 | struct nfs41_create_session_args { | 1067 | struct nfs41_create_session_args { |
@@ -1083,6 +1085,34 @@ struct nfs41_reclaim_complete_args { | |||
1083 | struct nfs41_reclaim_complete_res { | 1085 | struct nfs41_reclaim_complete_res { |
1084 | struct nfs4_sequence_res seq_res; | 1086 | struct nfs4_sequence_res seq_res; |
1085 | }; | 1087 | }; |
1088 | |||
1089 | #define SECINFO_STYLE_CURRENT_FH 0 | ||
1090 | #define SECINFO_STYLE_PARENT 1 | ||
1091 | struct nfs41_secinfo_no_name_args { | ||
1092 | int style; | ||
1093 | struct nfs4_sequence_args seq_args; | ||
1094 | }; | ||
1095 | |||
1096 | struct nfs41_test_stateid_args { | ||
1097 | nfs4_stateid *stateid; | ||
1098 | struct nfs4_sequence_args seq_args; | ||
1099 | }; | ||
1100 | |||
1101 | struct nfs41_test_stateid_res { | ||
1102 | unsigned int status; | ||
1103 | struct nfs4_sequence_res seq_res; | ||
1104 | }; | ||
1105 | |||
1106 | struct nfs41_free_stateid_args { | ||
1107 | nfs4_stateid *stateid; | ||
1108 | struct nfs4_sequence_args seq_args; | ||
1109 | }; | ||
1110 | |||
1111 | struct nfs41_free_stateid_res { | ||
1112 | unsigned int status; | ||
1113 | struct nfs4_sequence_res seq_res; | ||
1114 | }; | ||
1115 | |||
1086 | #endif /* CONFIG_NFS_V4_1 */ | 1116 | #endif /* CONFIG_NFS_V4_1 */ |
1087 | 1117 | ||
1088 | struct nfs_page; | 1118 | struct nfs_page; |
@@ -1096,6 +1126,7 @@ struct nfs_read_data { | |||
1096 | struct rpc_cred *cred; | 1126 | struct rpc_cred *cred; |
1097 | struct nfs_fattr fattr; /* fattr storage */ | 1127 | struct nfs_fattr fattr; /* fattr storage */ |
1098 | struct list_head pages; /* Coalesced read requests */ | 1128 | struct list_head pages; /* Coalesced read requests */ |
1129 | struct list_head list; /* lists of struct nfs_read_data */ | ||
1099 | struct nfs_page *req; /* multi ops per nfs_page */ | 1130 | struct nfs_page *req; /* multi ops per nfs_page */ |
1100 | struct page **pagevec; | 1131 | struct page **pagevec; |
1101 | unsigned int npages; /* Max length of pagevec */ | 1132 | unsigned int npages; /* Max length of pagevec */ |
@@ -1119,6 +1150,7 @@ struct nfs_write_data { | |||
1119 | struct nfs_fattr fattr; | 1150 | struct nfs_fattr fattr; |
1120 | struct nfs_writeverf verf; | 1151 | struct nfs_writeverf verf; |
1121 | struct list_head pages; /* Coalesced requests we wish to flush */ | 1152 | struct list_head pages; /* Coalesced requests we wish to flush */ |
1153 | struct list_head list; /* lists of struct nfs_write_data */ | ||
1122 | struct nfs_page *req; /* multi ops per nfs_page */ | 1154 | struct nfs_page *req; /* multi ops per nfs_page */ |
1123 | struct page **pagevec; | 1155 | struct page **pagevec; |
1124 | unsigned int npages; /* Max length of pagevec */ | 1156 | 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..bd716f8908de 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -195,6 +195,13 @@ 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 | char *propname, | ||
200 | u32 *out_values, | ||
201 | size_t sz); | ||
202 | |||
203 | extern int of_property_read_string(struct device_node *np, char *propname, | ||
204 | const char **out_string); | ||
198 | extern int of_device_is_compatible(const struct device_node *device, | 205 | extern int of_device_is_compatible(const struct device_node *device, |
199 | const char *); | 206 | const char *); |
200 | extern int of_device_is_available(const struct device_node *device); | 207 | extern int of_device_is_available(const struct device_node *device); |
@@ -227,12 +234,32 @@ extern void of_attach_node(struct device_node *); | |||
227 | extern void of_detach_node(struct device_node *); | 234 | extern void of_detach_node(struct device_node *); |
228 | #endif | 235 | #endif |
229 | 236 | ||
230 | #else | 237 | #else /* CONFIG_OF */ |
231 | 238 | ||
232 | static inline bool of_have_populated_dt(void) | 239 | static inline bool of_have_populated_dt(void) |
233 | { | 240 | { |
234 | return false; | 241 | return false; |
235 | } | 242 | } |
236 | 243 | ||
244 | static inline int of_property_read_u32_array(const struct device_node *np, | ||
245 | char *propname, u32 *out_values, size_t sz) | ||
246 | { | ||
247 | return -ENOSYS; | ||
248 | } | ||
249 | |||
250 | static inline int of_property_read_string(struct device_node *np, | ||
251 | char *propname, const char **out_string) | ||
252 | { | ||
253 | return -ENOSYS; | ||
254 | } | ||
255 | |||
237 | #endif /* CONFIG_OF */ | 256 | #endif /* CONFIG_OF */ |
257 | |||
258 | static inline int of_property_read_u32(const struct device_node *np, | ||
259 | char *propname, | ||
260 | u32 *out_value) | ||
261 | { | ||
262 | return of_property_read_u32_array(np, propname, out_value, 1); | ||
263 | } | ||
264 | |||
238 | #endif /* _LINUX_OF_H */ | 265 | #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..aec8025c786a 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, |
@@ -60,8 +61,8 @@ extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); | |||
60 | #else /* CONFIG_OF_GPIO */ | 61 | #else /* CONFIG_OF_GPIO */ |
61 | 62 | ||
62 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 63 | /* 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, | 64 | static inline int of_get_named_gpio_flags(struct device_node *np, |
64 | enum of_gpio_flags *flags) | 65 | const char *list_name, int index, enum of_gpio_flags *flags) |
65 | { | 66 | { |
66 | return -ENOSYS; | 67 | return -ENOSYS; |
67 | } | 68 | } |
@@ -77,7 +78,38 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | |||
77 | #endif /* CONFIG_OF_GPIO */ | 78 | #endif /* CONFIG_OF_GPIO */ |
78 | 79 | ||
79 | /** | 80 | /** |
80 | * of_get_gpio - Get a GPIO number to use with GPIO API | 81 | * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API |
82 | * @np: device node to get GPIO from | ||
83 | * @index: index of the GPIO | ||
84 | * @flags: a flags pointer to fill in | ||
85 | * | ||
86 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | ||
87 | * value on the error condition. If @flags is not NULL the function also fills | ||
88 | * in flags for the GPIO. | ||
89 | */ | ||
90 | static inline int of_get_gpio_flags(struct device_node *np, int index, | ||
91 | enum of_gpio_flags *flags) | ||
92 | { | ||
93 | return of_get_named_gpio_flags(np, "gpios", index, flags); | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * of_get_named_gpio() - Get a GPIO number to use with GPIO API | ||
98 | * @np: device node to get GPIO from | ||
99 | * @propname: Name of property containing gpio specifier(s) | ||
100 | * @index: index of the GPIO | ||
101 | * | ||
102 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | ||
103 | * value on the error condition. | ||
104 | */ | ||
105 | static inline int of_get_named_gpio(struct device_node *np, | ||
106 | const char *propname, int index) | ||
107 | { | ||
108 | return of_get_named_gpio_flags(np, propname, index, NULL); | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * of_get_gpio() - Get a GPIO number to use with GPIO API | ||
81 | * @np: device node to get GPIO from | 113 | * @np: device node to get GPIO from |
82 | * @index: index of the GPIO | 114 | * @index: index of the GPIO |
83 | * | 115 | * |
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..3e5a1b189a41 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -135,7 +135,7 @@ enum pageflags { | |||
135 | * Macros to create function definitions for page flags | 135 | * Macros to create function definitions for page flags |
136 | */ | 136 | */ |
137 | #define TESTPAGEFLAG(uname, lname) \ | 137 | #define TESTPAGEFLAG(uname, lname) \ |
138 | static inline int Page##uname(struct page *page) \ | 138 | static inline int Page##uname(const struct page *page) \ |
139 | { return test_bit(PG_##lname, &page->flags); } | 139 | { return test_bit(PG_##lname, &page->flags); } |
140 | 140 | ||
141 | #define SETPAGEFLAG(uname, lname) \ | 141 | #define SETPAGEFLAG(uname, lname) \ |
@@ -173,7 +173,7 @@ static inline int __TestClearPage##uname(struct page *page) \ | |||
173 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) | 173 | __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) |
174 | 174 | ||
175 | #define PAGEFLAG_FALSE(uname) \ | 175 | #define PAGEFLAG_FALSE(uname) \ |
176 | static inline int Page##uname(struct page *page) \ | 176 | static inline int Page##uname(const struct page *page) \ |
177 | { return 0; } | 177 | { return 0; } |
178 | 178 | ||
179 | #define TESTSCFLAG(uname, lname) \ | 179 | #define TESTSCFLAG(uname, lname) \ |
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..3a5626df37ce 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> |
@@ -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..b00c4ec5056e 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 |
@@ -2822,7 +2832,11 @@ | |||
2822 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 | 2832 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 |
2823 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 | 2833 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 |
2824 | #define PCI_DEVICE_ID_NETMOS_9865 0x9865 | 2834 | #define PCI_DEVICE_ID_NETMOS_9865 0x9865 |
2835 | #define PCI_DEVICE_ID_NETMOS_9900 0x9900 | ||
2825 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 | 2836 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 |
2837 | #define PCI_DEVICE_ID_NETMOS_9904 0x9904 | ||
2838 | #define PCI_DEVICE_ID_NETMOS_9912 0x9912 | ||
2839 | #define PCI_DEVICE_ID_NETMOS_9922 0x9922 | ||
2826 | 2840 | ||
2827 | #define PCI_VENDOR_ID_3COM_2 0xa727 | 2841 | #define PCI_VENDOR_ID_3COM_2 0xa727 |
2828 | 2842 | ||
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..ad5186354d92 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 | \ |
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/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..9a53b99818e2 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -73,13 +73,12 @@ posix_acl_release(struct posix_acl *acl) | |||
73 | 73 | ||
74 | extern void posix_acl_init(struct posix_acl *, int); | 74 | extern void posix_acl_init(struct posix_acl *, int); |
75 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); | 75 | 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 *); | 76 | extern int posix_acl_valid(const struct posix_acl *); |
78 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 77 | 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); | 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); |
80 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); |
81 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); | 80 | extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *); |
82 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | 81 | extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); |
83 | 82 | ||
84 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 83 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
85 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 84 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
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/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/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..ce29a040c8dc 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -58,6 +58,7 @@ 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); | 60 | extern __u32 secure_ip_id(__be32 daddr); |
61 | extern __u32 secure_ipv6_id(const __be32 daddr[4]); | ||
61 | extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); | 62 | 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 | extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
63 | __be16 dport); | 64 | __be16 dport); |
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/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 a837b20ba190..20b03bf94748 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -808,7 +808,7 @@ enum cpu_idle_type { | |||
808 | * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the | 808 | * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the |
809 | * increased costs. | 809 | * increased costs. |
810 | */ | 810 | */ |
811 | #if BITS_PER_LONG > 32 | 811 | #if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */ |
812 | # define SCHED_LOAD_RESOLUTION 10 | 812 | # define SCHED_LOAD_RESOLUTION 10 |
813 | # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) | 813 | # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) |
814 | # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) | 814 | # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) |
@@ -844,6 +844,7 @@ enum cpu_idle_type { | |||
844 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 844 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
845 | #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ | 845 | #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ |
846 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ | 846 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ |
847 | #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ | ||
847 | 848 | ||
848 | enum powersavings_balance_level { | 849 | enum powersavings_balance_level { |
849 | POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ | 850 | POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ |
@@ -893,16 +894,21 @@ static inline int sd_power_saving_flags(void) | |||
893 | return 0; | 894 | return 0; |
894 | } | 895 | } |
895 | 896 | ||
896 | struct sched_group { | 897 | struct sched_group_power { |
897 | struct sched_group *next; /* Must be a circular list */ | ||
898 | atomic_t ref; | 898 | atomic_t ref; |
899 | |||
900 | /* | 899 | /* |
901 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 900 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
902 | * single CPU. | 901 | * single CPU. |
903 | */ | 902 | */ |
904 | unsigned int cpu_power, cpu_power_orig; | 903 | unsigned int power, power_orig; |
904 | }; | ||
905 | |||
906 | struct sched_group { | ||
907 | struct sched_group *next; /* Must be a circular list */ | ||
908 | atomic_t ref; | ||
909 | |||
905 | unsigned int group_weight; | 910 | unsigned int group_weight; |
911 | struct sched_group_power *sgp; | ||
906 | 912 | ||
907 | /* | 913 | /* |
908 | * The CPUs this group covers. | 914 | * The CPUs this group covers. |
@@ -1254,6 +1260,9 @@ struct task_struct { | |||
1254 | #ifdef CONFIG_PREEMPT_RCU | 1260 | #ifdef CONFIG_PREEMPT_RCU |
1255 | int rcu_read_lock_nesting; | 1261 | int rcu_read_lock_nesting; |
1256 | char rcu_read_unlock_special; | 1262 | char rcu_read_unlock_special; |
1263 | #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) | ||
1264 | int rcu_boosted; | ||
1265 | #endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */ | ||
1257 | struct list_head rcu_node_entry; | 1266 | struct list_head rcu_node_entry; |
1258 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | 1267 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ |
1259 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1268 | #ifdef CONFIG_TREE_PREEMPT_RCU |
@@ -1283,7 +1292,7 @@ struct task_struct { | |||
1283 | int exit_state; | 1292 | int exit_state; |
1284 | int exit_code, exit_signal; | 1293 | int exit_code, exit_signal; |
1285 | int pdeath_signal; /* The signal sent when the parent dies */ | 1294 | int pdeath_signal; /* The signal sent when the parent dies */ |
1286 | unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ | 1295 | unsigned int jobctl; /* JOBCTL_*, siglock protected */ |
1287 | /* ??? */ | 1296 | /* ??? */ |
1288 | unsigned int personality; | 1297 | unsigned int personality; |
1289 | unsigned did_exec:1; | 1298 | unsigned did_exec:1; |
@@ -1503,7 +1512,6 @@ struct task_struct { | |||
1503 | short il_next; | 1512 | short il_next; |
1504 | short pref_node_fork; | 1513 | short pref_node_fork; |
1505 | #endif | 1514 | #endif |
1506 | atomic_t fs_excl; /* holding fs exclusive resources */ | ||
1507 | struct rcu_head rcu; | 1515 | struct rcu_head rcu; |
1508 | 1516 | ||
1509 | /* | 1517 | /* |
@@ -1804,15 +1812,34 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1804 | #define used_math() tsk_used_math(current) | 1812 | #define used_math() tsk_used_math(current) |
1805 | 1813 | ||
1806 | /* | 1814 | /* |
1807 | * task->group_stop flags | 1815 | * task->jobctl flags |
1808 | */ | 1816 | */ |
1809 | #define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ | 1817 | #define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */ |
1810 | #define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ | 1818 | |
1811 | #define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ | 1819 | #define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */ |
1812 | #define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ | 1820 | #define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */ |
1813 | #define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ | 1821 | #define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */ |
1814 | 1822 | #define JOBCTL_TRAP_STOP_BIT 19 /* trap for STOP */ | |
1815 | extern void task_clear_group_stop_pending(struct task_struct *task); | 1823 | #define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */ |
1824 | #define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */ | ||
1825 | #define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */ | ||
1826 | |||
1827 | #define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT) | ||
1828 | #define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT) | ||
1829 | #define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT) | ||
1830 | #define JOBCTL_TRAP_STOP (1 << JOBCTL_TRAP_STOP_BIT) | ||
1831 | #define JOBCTL_TRAP_NOTIFY (1 << JOBCTL_TRAP_NOTIFY_BIT) | ||
1832 | #define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT) | ||
1833 | #define JOBCTL_LISTENING (1 << JOBCTL_LISTENING_BIT) | ||
1834 | |||
1835 | #define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY) | ||
1836 | #define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK) | ||
1837 | |||
1838 | extern bool task_set_jobctl_pending(struct task_struct *task, | ||
1839 | unsigned int mask); | ||
1840 | extern void task_clear_jobctl_trapping(struct task_struct *task); | ||
1841 | extern void task_clear_jobctl_pending(struct task_struct *task, | ||
1842 | unsigned int mask); | ||
1816 | 1843 | ||
1817 | #ifdef CONFIG_PREEMPT_RCU | 1844 | #ifdef CONFIG_PREEMPT_RCU |
1818 | 1845 | ||
@@ -2127,7 +2154,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s | |||
2127 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); | 2154 | spin_unlock_irqrestore(&tsk->sighand->siglock, flags); |
2128 | 2155 | ||
2129 | return ret; | 2156 | return ret; |
2130 | } | 2157 | } |
2131 | 2158 | ||
2132 | extern void block_all_signals(int (*notifier)(void *priv), void *priv, | 2159 | extern void block_all_signals(int (*notifier)(void *priv), void *priv, |
2133 | sigset_t *mask); | 2160 | sigset_t *mask); |
@@ -2142,7 +2169,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_ | |||
2142 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 2169 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
2143 | extern int kill_pid(struct pid *pid, int sig, int priv); | 2170 | extern int kill_pid(struct pid *pid, int sig, int priv); |
2144 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 2171 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
2145 | extern int do_notify_parent(struct task_struct *, int); | 2172 | extern __must_check bool do_notify_parent(struct task_struct *, int); |
2146 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | 2173 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); |
2147 | extern void force_sig(int, struct task_struct *); | 2174 | extern void force_sig(int, struct task_struct *); |
2148 | extern int send_sig(int, struct task_struct *, int); | 2175 | extern int send_sig(int, struct task_struct *, int); |
@@ -2266,8 +2293,10 @@ static inline int get_nr_threads(struct task_struct *tsk) | |||
2266 | return tsk->signal->nr_threads; | 2293 | return tsk->signal->nr_threads; |
2267 | } | 2294 | } |
2268 | 2295 | ||
2269 | /* de_thread depends on thread_group_leader not being a pid based check */ | 2296 | static inline bool thread_group_leader(struct task_struct *p) |
2270 | #define thread_group_leader(p) (p == p->group_leader) | 2297 | { |
2298 | return p->exit_signal >= 0; | ||
2299 | } | ||
2271 | 2300 | ||
2272 | /* Do to the insanities of de_thread it is possible for a process | 2301 | /* Do to the insanities of de_thread it is possible for a process |
2273 | * to have the pid of the thread group leader without actually being | 2302 | * to have the pid of the thread group leader without actually being |
@@ -2300,11 +2329,6 @@ static inline int thread_group_empty(struct task_struct *p) | |||
2300 | #define delay_group_leader(p) \ | 2329 | #define delay_group_leader(p) \ |
2301 | (thread_group_leader(p) && !thread_group_empty(p)) | 2330 | (thread_group_leader(p) && !thread_group_empty(p)) |
2302 | 2331 | ||
2303 | static inline int task_detached(struct task_struct *p) | ||
2304 | { | ||
2305 | return p->exit_signal == -1; | ||
2306 | } | ||
2307 | |||
2308 | /* | 2332 | /* |
2309 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring | 2333 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring |
2310 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 2334 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
@@ -2501,7 +2525,7 @@ extern int _cond_resched(void); | |||
2501 | 2525 | ||
2502 | extern int __cond_resched_lock(spinlock_t *lock); | 2526 | extern int __cond_resched_lock(spinlock_t *lock); |
2503 | 2527 | ||
2504 | #ifdef CONFIG_PREEMPT | 2528 | #ifdef CONFIG_PREEMPT_COUNT |
2505 | #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET | 2529 | #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET |
2506 | #else | 2530 | #else |
2507 | #define PREEMPT_LOCK_OFFSET 0 | 2531 | #define PREEMPT_LOCK_OFFSET 0 |
diff --git a/include/linux/sdla.h b/include/linux/sdla.h index 564acd3a71c1..9995c7fc3f60 100644 --- a/include/linux/sdla.h +++ b/include/linux/sdla.h | |||
@@ -112,11 +112,7 @@ struct sdla_dlci_conf { | |||
112 | short Tb_max; | 112 | short Tb_max; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | #ifndef __KERNEL__ | 115 | #ifdef __KERNEL__ |
116 | |||
117 | void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet); | ||
118 | |||
119 | #else | ||
120 | 116 | ||
121 | /* important Z80 window addresses */ | 117 | /* important Z80 window addresses */ |
122 | #define SDLA_CONTROL_WND 0xE000 | 118 | #define SDLA_CONTROL_WND 0xE000 |
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/shm.h b/include/linux/shm.h index eca6235a46c0..7d27ffde0190 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -106,6 +106,7 @@ struct shmid_kernel /* private to the kernel */ | |||
106 | #ifdef CONFIG_SYSVIPC | 106 | #ifdef CONFIG_SYSVIPC |
107 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 107 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
108 | extern int is_file_shm_hugepages(struct file *file); | 108 | extern int is_file_shm_hugepages(struct file *file); |
109 | extern void exit_shm(struct task_struct *task); | ||
109 | #else | 110 | #else |
110 | static inline long do_shmat(int shmid, char __user *shmaddr, | 111 | static inline long do_shmat(int shmid, char __user *shmaddr, |
111 | int shmflg, unsigned long *addr) | 112 | int shmflg, unsigned long *addr) |
@@ -116,6 +117,9 @@ static inline int is_file_shm_hugepages(struct file *file) | |||
116 | { | 117 | { |
117 | return 0; | 118 | return 0; |
118 | } | 119 | } |
120 | static inline void exit_shm(struct task_struct *task) | ||
121 | { | ||
122 | } | ||
119 | #endif | 123 | #endif |
120 | 124 | ||
121 | #endif /* __KERNEL__ */ | 125 | #endif /* __KERNEL__ */ |
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..4b35c06dfbc5 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -113,16 +113,6 @@ struct kmem_cache { | |||
113 | 113 | ||
114 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) | 114 | #define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) |
115 | 115 | ||
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 | /* | 116 | /* |
127 | * Maximum kmalloc object size handled by SLUB. Larger object allocations | 117 | * Maximum kmalloc object size handled by SLUB. Larger object allocations |
128 | * are passed through to the page allocator. The page allocator "fastpath" | 118 | * are passed through to the page allocator. The page allocator "fastpath" |
@@ -228,6 +218,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order) | |||
228 | return ret; | 218 | return ret; |
229 | } | 219 | } |
230 | 220 | ||
221 | /** | ||
222 | * Calling this on allocated memory will check that the memory | ||
223 | * is expected to be in use, and print warnings if not. | ||
224 | */ | ||
225 | #ifdef CONFIG_SLUB_DEBUG | ||
226 | extern bool verify_mem_not_deleted(const void *x); | ||
227 | #else | ||
228 | static inline bool verify_mem_not_deleted(const void *x) | ||
229 | { | ||
230 | return true; | ||
231 | } | ||
232 | #endif | ||
233 | |||
231 | #ifdef CONFIG_TRACING | 234 | #ifdef CONFIG_TRACING |
232 | extern void * | 235 | extern void * |
233 | kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); | 236 | 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..e17f82266639 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -192,7 +192,8 @@ struct ucred { | |||
192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ | 192 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
193 | #define AF_CAIF 37 /* CAIF sockets */ | 193 | #define AF_CAIF 37 /* CAIF sockets */ |
194 | #define AF_ALG 38 /* Algorithm sockets */ | 194 | #define AF_ALG 38 /* Algorithm sockets */ |
195 | #define AF_MAX 39 /* For now.. */ | 195 | #define AF_NFC 39 /* NFC sockets */ |
196 | #define AF_MAX 40 /* For now.. */ | ||
196 | 197 | ||
197 | /* Protocol families, same as address families. */ | 198 | /* Protocol families, same as address families. */ |
198 | #define PF_UNSPEC AF_UNSPEC | 199 | #define PF_UNSPEC AF_UNSPEC |
@@ -234,6 +235,7 @@ struct ucred { | |||
234 | #define PF_IEEE802154 AF_IEEE802154 | 235 | #define PF_IEEE802154 AF_IEEE802154 |
235 | #define PF_CAIF AF_CAIF | 236 | #define PF_CAIF AF_CAIF |
236 | #define PF_ALG AF_ALG | 237 | #define PF_ALG AF_ALG |
238 | #define PF_NFC AF_NFC | ||
237 | #define PF_MAX AF_MAX | 239 | #define PF_MAX AF_MAX |
238 | 240 | ||
239 | /* Maximum queue length specifiable by listen. */ | 241 | /* 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/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/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/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/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) \ |