aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-14 08:58:01 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-14 08:58:01 -0400
commit51ca3c679194e7435c25b8e77b0a73c597e41ae9 (patch)
treea681dca369607ab0f371d5246b0f75140b860a8a /include/linux
parentb55793f7528ce1b73c25b3ac8a86a6cda2a0f9a4 (diff)
parentb635acec48bcaa9183fcbf4e3955616b0d4119b5 (diff)
Merge branch 'linus' into x86/core
Conflicts: arch/x86/kernel/genapic_64.c include/asm-x86/kvm_host.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/agp_backend.h5
-rw-r--r--include/linux/bitmap.h1
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/bootmem.h4
-rw-r--r--include/linux/buffer_head.h8
-rw-r--r--include/linux/byteorder.h372
-rw-r--r--include/linux/completion.h45
-rw-r--r--include/linux/configfs.h68
-rw-r--r--include/linux/connector.h3
-rw-r--r--include/linux/cpufreq.h1
-rw-r--r--include/linux/cpumask.h2
-rw-r--r--include/linux/cred.h50
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/dm9000.h1
-rw-r--r--include/linux/ethtool.h17
-rw-r--r--include/linux/file.h3
-rw-r--r--include/linux/firmware-map.h26
-rw-r--r--include/linux/harrier_defs.h212
-rw-r--r--include/linux/i2c-id.h2
-rw-r--r--include/linux/i2c-pnx.h4
-rw-r--r--include/linux/ide.h40
-rw-r--r--include/linux/ieee80211.h13
-rw-r--r--include/linux/ihex.h2
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/interrupt.h29
-rw-r--r--include/linux/iommu-helper.h1
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/ip_vs.h245
-rw-r--r--include/linux/kallsyms.h3
-rw-r--r--include/linux/kernel.h20
-rw-r--r--include/linux/kexec.h4
-rw-r--r--include/linux/kvm.h1
-rw-r--r--include/linux/kvm_host.h24
-rw-r--r--include/linux/libata.h9
-rw-r--r--include/linux/list.h87
-rw-r--r--include/linux/lockdep.h70
-rw-r--r--include/linux/mISDNif.h32
-rw-r--r--include/linux/maple.h14
-rw-r--r--include/linux/mfd/t7l66xb.h36
-rw-r--r--include/linux/mfd/tc6387xb.h23
-rw-r--r--include/linux/mfd/tc6393xb.h9
-rw-r--r--include/linux/mfd/tmio.h19
-rw-r--r--include/linux/mlx4/cq.h36
-rw-r--r--include/linux/mm.h23
-rw-r--r--include/linux/mount.h3
-rw-r--r--include/linux/mtd/mtd.h6
-rw-r--r--include/linux/mtd/nand.h4
-rw-r--r--include/linux/netdevice.h90
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h3
-rw-r--r--include/linux/page-flags.h5
-rw-r--r--include/linux/pagemap.h90
-rw-r--r--include/linux/parser.h2
-rw-r--r--include/linux/pci.h11
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/pm_qos_params.h2
-rw-r--r--include/linux/power_supply.h1
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/quotaops.h2
-rw-r--r--include/linux/raid/md_k.h1
-rw-r--r--include/linux/rcuclassic.h2
-rw-r--r--include/linux/regulator/bq24022.h21
-rw-r--r--include/linux/regulator/consumer.h284
-rw-r--r--include/linux/regulator/driver.h99
-rw-r--r--include/linux/regulator/fixed.h22
-rw-r--r--include/linux/regulator/machine.h104
-rw-r--r--include/linux/rfkill.h8
-rw-r--r--include/linux/sched.h32
-rw-r--r--include/linux/seq_file.h12
-rw-r--r--include/linux/skbuff.h12
-rw-r--r--include/linux/slub_def.h1
-rw-r--r--include/linux/snmp.h2
-rw-r--r--include/linux/spi/orion_spi.h17
-rw-r--r--include/linux/spinlock.h6
-rw-r--r--include/linux/spinlock_api_smp.h2
-rw-r--r--include/linux/swab.h309
-rw-r--r--include/linux/tracehook.h24
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/usb/musb.h98
-rw-r--r--include/linux/usb/serial.h3
-rw-r--r--include/linux/vt_kern.h3
81 files changed, 2342 insertions, 518 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4c4142c5aa6e..327f60658d94 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -97,6 +97,7 @@ header-y += ioctl.h
97header-y += ip6_tunnel.h 97header-y += ip6_tunnel.h
98header-y += ipmi_msgdefs.h 98header-y += ipmi_msgdefs.h
99header-y += ipsec.h 99header-y += ipsec.h
100header-y += ip_vs.h
100header-y += ipx.h 101header-y += ipx.h
101header-y += irda.h 102header-y += irda.h
102header-y += iso_fs.h 103header-y += iso_fs.h
@@ -355,6 +356,7 @@ unifdef-y += virtio_balloon.h
355unifdef-y += virtio_console.h 356unifdef-y += virtio_console.h
356unifdef-y += virtio_pci.h 357unifdef-y += virtio_pci.h
357unifdef-y += virtio_ring.h 358unifdef-y += virtio_ring.h
359unifdef-y += virtio_rng.h
358unifdef-y += vt.h 360unifdef-y += vt.h
359unifdef-y += wait.h 361unifdef-y += wait.h
360unifdef-y += wanrouter.h 362unifdef-y += wanrouter.h
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index 972b12bcfb36..2b8df8b420fd 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -30,6 +30,8 @@
30#ifndef _AGP_BACKEND_H 30#ifndef _AGP_BACKEND_H
31#define _AGP_BACKEND_H 1 31#define _AGP_BACKEND_H 1
32 32
33#include <linux/list.h>
34
33enum chipset_type { 35enum chipset_type {
34 NOT_SUPPORTED, 36 NOT_SUPPORTED,
35 SUPPORTED, 37 SUPPORTED,
@@ -78,6 +80,8 @@ struct agp_memory {
78 bool is_bound; 80 bool is_bound;
79 bool is_flushed; 81 bool is_flushed;
80 bool vmalloc_flag; 82 bool vmalloc_flag;
83 /* list of agp_memory mapped to the aperture */
84 struct list_head mapped_list;
81}; 85};
82 86
83#define AGP_NORMAL_MEMORY 0 87#define AGP_NORMAL_MEMORY 0
@@ -96,6 +100,7 @@ extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t,
96extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); 100extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);
97extern int agp_bind_memory(struct agp_memory *, off_t); 101extern int agp_bind_memory(struct agp_memory *, off_t);
98extern int agp_unbind_memory(struct agp_memory *); 102extern int agp_unbind_memory(struct agp_memory *);
103extern int agp_rebind_memory(void);
99extern void agp_enable(struct agp_bridge_data *, u32); 104extern void agp_enable(struct agp_bridge_data *, u32);
100extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); 105extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
101extern void agp_backend_release(struct agp_bridge_data *); 106extern void agp_backend_release(struct agp_bridge_data *);
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 1abfe664c444..89781fd48859 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -110,6 +110,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);
110 110
111extern int bitmap_scnprintf(char *buf, unsigned int len, 111extern int bitmap_scnprintf(char *buf, unsigned int len,
112 const unsigned long *src, int nbits); 112 const unsigned long *src, int nbits);
113extern int bitmap_scnprintf_len(unsigned int nr_bits);
113extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, 114extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
114 unsigned long *dst, int nbits); 115 unsigned long *dst, int nbits);
115extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, 116extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 88d68081a0f1..e61f22be4d0e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -655,6 +655,7 @@ extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
655extern void blk_insert_request(struct request_queue *, struct request *, int, void *); 655extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
656extern void blk_requeue_request(struct request_queue *, struct request *); 656extern void blk_requeue_request(struct request_queue *, struct request *);
657extern void blk_plug_device(struct request_queue *); 657extern void blk_plug_device(struct request_queue *);
658extern void blk_plug_device_unlocked(struct request_queue *);
658extern int blk_remove_plug(struct request_queue *); 659extern int blk_remove_plug(struct request_queue *);
659extern void blk_recount_segments(struct request_queue *, struct bio *); 660extern void blk_recount_segments(struct request_queue *, struct bio *);
660extern int scsi_cmd_ioctl(struct file *, struct request_queue *, 661extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 652470b687c9..95837bfb5256 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -97,10 +97,14 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
97#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 97#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
98#define alloc_bootmem(x) \ 98#define alloc_bootmem(x) \
99 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 99 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
100#define alloc_bootmem_nopanic(x) \
101 __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
100#define alloc_bootmem_low(x) \ 102#define alloc_bootmem_low(x) \
101 __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) 103 __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
102#define alloc_bootmem_pages(x) \ 104#define alloc_bootmem_pages(x) \
103 __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 105 __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
106#define alloc_bootmem_pages_nopanic(x) \
107 __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
104#define alloc_bootmem_low_pages(x) \ 108#define alloc_bootmem_low_pages(x) \
105 __alloc_bootmem_low(x, PAGE_SIZE, 0) 109 __alloc_bootmem_low(x, PAGE_SIZE, 0)
106#define alloc_bootmem_node(pgdat, x) \ 110#define alloc_bootmem_node(pgdat, x) \
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 50cfe8ceb478..eadaab44015f 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -115,7 +115,6 @@ BUFFER_FNS(Uptodate, uptodate)
115BUFFER_FNS(Dirty, dirty) 115BUFFER_FNS(Dirty, dirty)
116TAS_BUFFER_FNS(Dirty, dirty) 116TAS_BUFFER_FNS(Dirty, dirty)
117BUFFER_FNS(Lock, locked) 117BUFFER_FNS(Lock, locked)
118TAS_BUFFER_FNS(Lock, locked)
119BUFFER_FNS(Req, req) 118BUFFER_FNS(Req, req)
120TAS_BUFFER_FNS(Req, req) 119TAS_BUFFER_FNS(Req, req)
121BUFFER_FNS(Mapped, mapped) 120BUFFER_FNS(Mapped, mapped)
@@ -321,10 +320,15 @@ static inline void wait_on_buffer(struct buffer_head *bh)
321 __wait_on_buffer(bh); 320 __wait_on_buffer(bh);
322} 321}
323 322
323static inline int trylock_buffer(struct buffer_head *bh)
324{
325 return likely(!test_and_set_bit(BH_Lock, &bh->b_state));
326}
327
324static inline void lock_buffer(struct buffer_head *bh) 328static inline void lock_buffer(struct buffer_head *bh)
325{ 329{
326 might_sleep(); 330 might_sleep();
327 if (test_set_buffer_locked(bh)) 331 if (!trylock_buffer(bh))
328 __lock_buffer(bh); 332 __lock_buffer(bh);
329} 333}
330 334
diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h
new file mode 100644
index 000000000000..29f002d73d98
--- /dev/null
+++ b/include/linux/byteorder.h
@@ -0,0 +1,372 @@
1#ifndef _LINUX_BYTEORDER_H
2#define _LINUX_BYTEORDER_H
3
4#include <linux/types.h>
5#include <linux/swab.h>
6
7#if defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
8# error Fix asm/byteorder.h to define one endianness
9#endif
10
11#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
12# error Fix asm/byteorder.h to define arch endianness
13#endif
14
15#ifdef __LITTLE_ENDIAN
16# undef __LITTLE_ENDIAN
17# define __LITTLE_ENDIAN 1234
18#endif
19
20#ifdef __BIG_ENDIAN
21# undef __BIG_ENDIAN
22# define __BIG_ENDIAN 4321
23#endif
24
25#if defined(__LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN_BITFIELD)
26# define __LITTLE_ENDIAN_BITFIELD
27#endif
28
29#if defined(__BIG_ENDIAN) && !defined(__BIG_ENDIAN_BITFIELD)
30# define __BIG_ENDIAN_BITFIELD
31#endif
32
33#ifdef __LITTLE_ENDIAN
34# define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
35# define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
36# define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
37# define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
38# define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
39# define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
40
41# define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
42# define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
43# define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
44# define __cpu_to_be16(x) ((__force __be16)__swab16(x))
45# define __cpu_to_be32(x) ((__force __be32)__swab32(x))
46# define __cpu_to_be64(x) ((__force __be64)__swab64(x))
47#endif
48
49#ifdef __BIG_ENDIAN
50# define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
51# define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
52# define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
53# define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
54# define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
55# define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
56
57# define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
58# define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
59# define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
60# define __cpu_to_le16(x) ((__force __le16)__swab16(x))
61# define __cpu_to_le32(x) ((__force __le32)__swab32(x))
62# define __cpu_to_le64(x) ((__force __le64)__swab64(x))
63#endif
64
65/*
66 * These helpers could be phased out over time as the base version
67 * handles constant folding.
68 */
69#define __constant_htonl(x) __cpu_to_be32(x)
70#define __constant_ntohl(x) __be32_to_cpu(x)
71#define __constant_htons(x) __cpu_to_be16(x)
72#define __constant_ntohs(x) __be16_to_cpu(x)
73
74#define __constant_le16_to_cpu(x) __le16_to_cpu(x)
75#define __constant_le32_to_cpu(x) __le32_to_cpu(x)
76#define __constant_le64_to_cpu(x) __le64_to_cpu(x)
77#define __constant_be16_to_cpu(x) __be16_to_cpu(x)
78#define __constant_be32_to_cpu(x) __be32_to_cpu(x)
79#define __constant_be64_to_cpu(x) __be64_to_cpu(x)
80
81#define __constant_cpu_to_le16(x) __cpu_to_le16(x)
82#define __constant_cpu_to_le32(x) __cpu_to_le32(x)
83#define __constant_cpu_to_le64(x) __cpu_to_le64(x)
84#define __constant_cpu_to_be16(x) __cpu_to_be16(x)
85#define __constant_cpu_to_be32(x) __cpu_to_be32(x)
86#define __constant_cpu_to_be64(x) __cpu_to_be64(x)
87
88static inline void __le16_to_cpus(__u16 *p)
89{
90#ifdef __BIG_ENDIAN
91 __swab16s(p);
92#endif
93}
94
95static inline void __cpu_to_le16s(__u16 *p)
96{
97#ifdef __BIG_ENDIAN
98 __swab16s(p);
99#endif
100}
101
102static inline void __le32_to_cpus(__u32 *p)
103{
104#ifdef __BIG_ENDIAN
105 __swab32s(p);
106#endif
107}
108
109static inline void __cpu_to_le32s(__u32 *p)
110{
111#ifdef __BIG_ENDIAN
112 __swab32s(p);
113#endif
114}
115
116static inline void __le64_to_cpus(__u64 *p)
117{
118#ifdef __BIG_ENDIAN
119 __swab64s(p);
120#endif
121}
122
123static inline void __cpu_to_le64s(__u64 *p)
124{
125#ifdef __BIG_ENDIAN
126 __swab64s(p);
127#endif
128}
129
130static inline void __be16_to_cpus(__u16 *p)
131{
132#ifdef __LITTLE_ENDIAN
133 __swab16s(p);
134#endif
135}
136
137static inline void __cpu_to_be16s(__u16 *p)
138{
139#ifdef __LITTLE_ENDIAN
140 __swab16s(p);
141#endif
142}
143
144static inline void __be32_to_cpus(__u32 *p)
145{
146#ifdef __LITTLE_ENDIAN
147 __swab32s(p);
148#endif
149}
150
151static inline void __cpu_to_be32s(__u32 *p)
152{
153#ifdef __LITTLE_ENDIAN
154 __swab32s(p);
155#endif
156}
157
158static inline void __be64_to_cpus(__u64 *p)
159{
160#ifdef __LITTLE_ENDIAN
161 __swab64s(p);
162#endif
163}
164
165static inline void __cpu_to_be64s(__u64 *p)
166{
167#ifdef __LITTLE_ENDIAN
168 __swab64s(p);
169#endif
170}
171
172static inline __u16 __le16_to_cpup(const __le16 *p)
173{
174#ifdef __LITTLE_ENDIAN
175 return (__force __u16)*p;
176#else
177 return __swab16p((__force __u16 *)p);
178#endif
179}
180
181static inline __u32 __le32_to_cpup(const __le32 *p)
182{
183#ifdef __LITTLE_ENDIAN
184 return (__force __u32)*p;
185#else
186 return __swab32p((__force __u32 *)p);
187#endif
188}
189
190static inline __u64 __le64_to_cpup(const __le64 *p)
191{
192#ifdef __LITTLE_ENDIAN
193 return (__force __u64)*p;
194#else
195 return __swab64p((__force __u64 *)p);
196#endif
197}
198
199static inline __le16 __cpu_to_le16p(const __u16 *p)
200{
201#ifdef __LITTLE_ENDIAN
202 return (__force __le16)*p;
203#else
204 return (__force __le16)__swab16p(p);
205#endif
206}
207
208static inline __le32 __cpu_to_le32p(const __u32 *p)
209{
210#ifdef __LITTLE_ENDIAN
211 return (__force __le32)*p;
212#else
213 return (__force __le32)__swab32p(p);
214#endif
215}
216
217static inline __le64 __cpu_to_le64p(const __u64 *p)
218{
219#ifdef __LITTLE_ENDIAN
220 return (__force __le64)*p;
221#else
222 return (__force __le64)__swab64p(p);
223#endif
224}
225
226static inline __u16 __be16_to_cpup(const __be16 *p)
227{
228#ifdef __BIG_ENDIAN
229 return (__force __u16)*p;
230#else
231 return __swab16p((__force __u16 *)p);
232#endif
233}
234
235static inline __u32 __be32_to_cpup(const __be32 *p)
236{
237#ifdef __BIG_ENDIAN
238 return (__force __u32)*p;
239#else
240 return __swab32p((__force __u32 *)p);
241#endif
242}
243
244static inline __u64 __be64_to_cpup(const __be64 *p)
245{
246#ifdef __BIG_ENDIAN
247 return (__force __u64)*p;
248#else
249 return __swab64p((__force __u64 *)p);
250#endif
251}
252
253static inline __be16 __cpu_to_be16p(const __u16 *p)
254{
255#ifdef __BIG_ENDIAN
256 return (__force __be16)*p;
257#else
258 return (__force __be16)__swab16p(p);
259#endif
260}
261
262static inline __be32 __cpu_to_be32p(const __u32 *p)
263{
264#ifdef __BIG_ENDIAN
265 return (__force __be32)*p;
266#else
267 return (__force __be32)__swab32p(p);
268#endif
269}
270
271static inline __be64 __cpu_to_be64p(const __u64 *p)
272{
273#ifdef __BIG_ENDIAN
274 return (__force __be64)*p;
275#else
276 return (__force __be64)__swab64p(p);
277#endif
278}
279
280#ifdef __KERNEL__
281
282# define le16_to_cpu __le16_to_cpu
283# define le32_to_cpu __le32_to_cpu
284# define le64_to_cpu __le64_to_cpu
285# define be16_to_cpu __be16_to_cpu
286# define be32_to_cpu __be32_to_cpu
287# define be64_to_cpu __be64_to_cpu
288# define cpu_to_le16 __cpu_to_le16
289# define cpu_to_le32 __cpu_to_le32
290# define cpu_to_le64 __cpu_to_le64
291# define cpu_to_be16 __cpu_to_be16
292# define cpu_to_be32 __cpu_to_be32
293# define cpu_to_be64 __cpu_to_be64
294
295# define le16_to_cpup __le16_to_cpup
296# define le32_to_cpup __le32_to_cpup
297# define le64_to_cpup __le64_to_cpup
298# define be16_to_cpup __be16_to_cpup
299# define be32_to_cpup __be32_to_cpup
300# define be64_to_cpup __be64_to_cpup
301# define cpu_to_le16p __cpu_to_le16p
302# define cpu_to_le32p __cpu_to_le32p
303# define cpu_to_le64p __cpu_to_le64p
304# define cpu_to_be16p __cpu_to_be16p
305# define cpu_to_be32p __cpu_to_be32p
306# define cpu_to_be64p __cpu_to_be64p
307
308# define le16_to_cpus __le16_to_cpus
309# define le32_to_cpus __le32_to_cpus
310# define le64_to_cpus __le64_to_cpus
311# define be16_to_cpus __be16_to_cpus
312# define be32_to_cpus __be32_to_cpus
313# define be64_to_cpus __be64_to_cpus
314# define cpu_to_le16s __cpu_to_le16s
315# define cpu_to_le32s __cpu_to_le32s
316# define cpu_to_le64s __cpu_to_le64s
317# define cpu_to_be16s __cpu_to_be16s
318# define cpu_to_be32s __cpu_to_be32s
319# define cpu_to_be64s __cpu_to_be64s
320
321/*
322 * They have to be macros in order to do the constant folding
323 * correctly - if the argument passed into a inline function
324 * it is no longer constant according to gcc..
325 */
326# undef ntohl
327# undef ntohs
328# undef htonl
329# undef htons
330
331# define ___htonl(x) __cpu_to_be32(x)
332# define ___htons(x) __cpu_to_be16(x)
333# define ___ntohl(x) __be32_to_cpu(x)
334# define ___ntohs(x) __be16_to_cpu(x)
335
336# define htonl(x) ___htonl(x)
337# define ntohl(x) ___ntohl(x)
338# define htons(x) ___htons(x)
339# define ntohs(x) ___ntohs(x)
340
341static inline void le16_add_cpu(__le16 *var, u16 val)
342{
343 *var = cpu_to_le16(le16_to_cpup(var) + val);
344}
345
346static inline void le32_add_cpu(__le32 *var, u32 val)
347{
348 *var = cpu_to_le32(le32_to_cpup(var) + val);
349}
350
351static inline void le64_add_cpu(__le64 *var, u64 val)
352{
353 *var = cpu_to_le64(le64_to_cpup(var) + val);
354}
355
356static inline void be16_add_cpu(__be16 *var, u16 val)
357{
358 *var = cpu_to_be16(be16_to_cpup(var) + val);
359}
360
361static inline void be32_add_cpu(__be32 *var, u32 val)
362{
363 *var = cpu_to_be32(be32_to_cpup(var) + val);
364}
365
366static inline void be64_add_cpu(__be64 *var, u64 val)
367{
368 *var = cpu_to_be64(be64_to_cpup(var) + val);
369}
370
371#endif /* __KERNEL__ */
372#endif /* _LINUX_BYTEORDER_H */
diff --git a/include/linux/completion.h b/include/linux/completion.h
index d2961b66d53d..57faa60de9bd 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -55,4 +55,49 @@ extern void complete_all(struct completion *);
55 55
56#define INIT_COMPLETION(x) ((x).done = 0) 56#define INIT_COMPLETION(x) ((x).done = 0)
57 57
58
59/**
60 * try_wait_for_completion - try to decrement a completion without blocking
61 * @x: completion structure
62 *
63 * Returns: 0 if a decrement cannot be done without blocking
64 * 1 if a decrement succeeded.
65 *
66 * If a completion is being used as a counting completion,
67 * attempt to decrement the counter without blocking. This
68 * enables us to avoid waiting if the resource the completion
69 * is protecting is not available.
70 */
71static inline bool try_wait_for_completion(struct completion *x)
72{
73 int ret = 1;
74
75 spin_lock_irq(&x->wait.lock);
76 if (!x->done)
77 ret = 0;
78 else
79 x->done--;
80 spin_unlock_irq(&x->wait.lock);
81 return ret;
82}
83
84/**
85 * completion_done - Test to see if a completion has any waiters
86 * @x: completion structure
87 *
88 * Returns: 0 if there are waiters (wait_for_completion() in progress)
89 * 1 if there are no waiters.
90 *
91 */
92static inline bool completion_done(struct completion *x)
93{
94 int ret = 1;
95
96 spin_lock_irq(&x->wait.lock);
97 if (!x->done)
98 ret = 0;
99 spin_unlock_irq(&x->wait.lock);
100 return ret;
101}
102
58#endif 103#endif
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index d62c19ff041c..7f627775c947 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -40,6 +40,7 @@
40#include <linux/list.h> 40#include <linux/list.h>
41#include <linux/kref.h> 41#include <linux/kref.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/err.h>
43 44
44#include <asm/atomic.h> 45#include <asm/atomic.h>
45 46
@@ -129,8 +130,25 @@ struct configfs_attribute {
129/* 130/*
130 * Users often need to create attribute structures for their configurable 131 * Users often need to create attribute structures for their configurable
131 * attributes, containing a configfs_attribute member and function pointers 132 * attributes, containing a configfs_attribute member and function pointers
132 * for the show() and store() operations on that attribute. They can use 133 * for the show() and store() operations on that attribute. If they don't
133 * this macro (similar to sysfs' __ATTR) to make defining attributes easier. 134 * need anything else on the extended attribute structure, they can use
135 * this macro to define it The argument _item is the name of the
136 * config_item structure.
137 */
138#define CONFIGFS_ATTR_STRUCT(_item) \
139struct _item##_attribute { \
140 struct configfs_attribute attr; \
141 ssize_t (*show)(struct _item *, char *); \
142 ssize_t (*store)(struct _item *, const char *, size_t); \
143}
144
145/*
146 * With the extended attribute structure, users can use this macro
147 * (similar to sysfs' __ATTR) to make defining attributes easier.
148 * An example:
149 * #define MYITEM_ATTR(_name, _mode, _show, _store) \
150 * struct myitem_attribute childless_attr_##_name = \
151 * __CONFIGFS_ATTR(_name, _mode, _show, _store)
134 */ 152 */
135#define __CONFIGFS_ATTR(_name, _mode, _show, _store) \ 153#define __CONFIGFS_ATTR(_name, _mode, _show, _store) \
136{ \ 154{ \
@@ -142,6 +160,52 @@ struct configfs_attribute {
142 .show = _show, \ 160 .show = _show, \
143 .store = _store, \ 161 .store = _store, \
144} 162}
163/* Here is a readonly version, only requiring a show() operation */
164#define __CONFIGFS_ATTR_RO(_name, _show) \
165{ \
166 .attr = { \
167 .ca_name = __stringify(_name), \
168 .ca_mode = 0444, \
169 .ca_owner = THIS_MODULE, \
170 }, \
171 .show = _show, \
172}
173
174/*
175 * With these extended attributes, the simple show_attribute() and
176 * store_attribute() operations need to call the show() and store() of the
177 * attributes. This is a common pattern, so we provide a macro to define
178 * them. The argument _item is the name of the config_item structure.
179 * This macro expects the attributes to be named "struct <name>_attribute"
180 * and the function to_<name>() to exist;
181 */
182#define CONFIGFS_ATTR_OPS(_item) \
183static ssize_t _item##_attr_show(struct config_item *item, \
184 struct configfs_attribute *attr, \
185 char *page) \
186{ \
187 struct _item *_item = to_##_item(item); \
188 struct _item##_attribute *_item##_attr = \
189 container_of(attr, struct _item##_attribute, attr); \
190 ssize_t ret = 0; \
191 \
192 if (_item##_attr->show) \
193 ret = _item##_attr->show(_item, page); \
194 return ret; \
195} \
196static ssize_t _item##_attr_store(struct config_item *item, \
197 struct configfs_attribute *attr, \
198 const char *page, size_t count) \
199{ \
200 struct _item *_item = to_##_item(item); \
201 struct _item##_attribute *_item##_attr = \
202 container_of(attr, struct _item##_attribute, attr); \
203 ssize_t ret = -EINVAL; \
204 \
205 if (_item##_attr->store) \
206 ret = _item##_attr->store(_item, page, count); \
207 return ret; \
208}
145 209
146/* 210/*
147 * If allow_link() exists, the item can symlink(2) out to other 211 * If allow_link() exists, the item can symlink(2) out to other
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 96a89d3d6727..5c7f9468f753 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -38,8 +38,9 @@
38#define CN_W1_VAL 0x1 38#define CN_W1_VAL 0x1
39#define CN_IDX_V86D 0x4 39#define CN_IDX_V86D 0x4
40#define CN_VAL_V86D_UVESAFB 0x1 40#define CN_VAL_V86D_UVESAFB 0x1
41#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */
41 42
42#define CN_NETLINK_USERS 5 43#define CN_NETLINK_USERS 6
43 44
44/* 45/*
45 * Maximum connector's message size. 46 * Maximum connector's message size.
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 2270ca5ec631..6fd5668aa572 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -106,6 +106,7 @@ struct cpufreq_policy {
106#define CPUFREQ_ADJUST (0) 106#define CPUFREQ_ADJUST (0)
107#define CPUFREQ_INCOMPATIBLE (1) 107#define CPUFREQ_INCOMPATIBLE (1)
108#define CPUFREQ_NOTIFY (2) 108#define CPUFREQ_NOTIFY (2)
109#define CPUFREQ_START (3)
109 110
110#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ 111#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
111#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ 112#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 96d0509fb8d8..d3219d73f8e6 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -287,7 +287,7 @@ static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
287 * gcc optimizes it out (it's a constant) and there's no huge stack 287 * gcc optimizes it out (it's a constant) and there's no huge stack
288 * variable created: 288 * variable created:
289 */ 289 */
290#define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); }) 290#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))
291 291
292 292
293#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) 293#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
diff --git a/include/linux/cred.h b/include/linux/cred.h
new file mode 100644
index 000000000000..b69222cc1fd2
--- /dev/null
+++ b/include/linux/cred.h
@@ -0,0 +1,50 @@
1/* Credentials management
2 *
3 * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _LINUX_CRED_H
13#define _LINUX_CRED_H
14
15#define get_current_user() (get_uid(current->user))
16
17#define task_uid(task) ((task)->uid)
18#define task_gid(task) ((task)->gid)
19#define task_euid(task) ((task)->euid)
20#define task_egid(task) ((task)->egid)
21
22#define current_uid() (current->uid)
23#define current_gid() (current->gid)
24#define current_euid() (current->euid)
25#define current_egid() (current->egid)
26#define current_suid() (current->suid)
27#define current_sgid() (current->sgid)
28#define current_fsuid() (current->fsuid)
29#define current_fsgid() (current->fsgid)
30#define current_cap() (current->cap_effective)
31
32#define current_uid_gid(_uid, _gid) \
33do { \
34 *(_uid) = current->uid; \
35 *(_gid) = current->gid; \
36} while(0)
37
38#define current_euid_egid(_uid, _gid) \
39do { \
40 *(_uid) = current->euid; \
41 *(_gid) = current->egid; \
42} while(0)
43
44#define current_fsuid_fsgid(_uid, _gid) \
45do { \
46 *(_uid) = current->fsuid; \
47 *(_gid) = current->fsgid; \
48} while(0)
49
50#endif /* _LINUX_CRED_H */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 98202c672fde..07aa198f19ed 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -230,6 +230,7 @@ extern void d_delete(struct dentry *);
230extern struct dentry * d_alloc(struct dentry *, const struct qstr *); 230extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
231extern struct dentry * d_alloc_anon(struct inode *); 231extern struct dentry * d_alloc_anon(struct inode *);
232extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 232extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
233extern struct dentry * d_add_ci(struct inode *, struct dentry *, struct qstr *);
233extern void shrink_dcache_sb(struct super_block *); 234extern void shrink_dcache_sb(struct super_block *);
234extern void shrink_dcache_parent(struct dentry *); 235extern void shrink_dcache_parent(struct dentry *);
235extern void shrink_dcache_for_umount(struct super_block *); 236extern void shrink_dcache_for_umount(struct super_block *);
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index fc82446b6425..c30879cf93bc 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -27,6 +27,7 @@
27 27
28struct dm9000_plat_data { 28struct dm9000_plat_data {
29 unsigned int flags; 29 unsigned int flags;
30 unsigned char dev_addr[6];
30 31
31 /* allow replacement IO routines */ 32 /* allow replacement IO routines */
32 33
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 8bb5e87df365..b4b038b89ee6 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -27,9 +27,24 @@ struct ethtool_cmd {
27 __u8 autoneg; /* Enable or disable autonegotiation */ 27 __u8 autoneg; /* Enable or disable autonegotiation */
28 __u32 maxtxpkt; /* Tx pkts before generating tx int */ 28 __u32 maxtxpkt; /* Tx pkts before generating tx int */
29 __u32 maxrxpkt; /* Rx pkts before generating rx int */ 29 __u32 maxrxpkt; /* Rx pkts before generating rx int */
30 __u32 reserved[4]; 30 __u16 speed_hi;
31 __u16 reserved2;
32 __u32 reserved[3];
31}; 33};
32 34
35static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
36 __u32 speed)
37{
38
39 ep->speed = (__u16)speed;
40 ep->speed_hi = (__u16)(speed >> 16);
41}
42
43static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
44{
45 return (ep->speed_hi << 16) | ep->speed;
46}
47
33#define ETHTOOL_BUSINFO_LEN 32 48#define ETHTOOL_BUSINFO_LEN 32
34/* these strings are set to whatever the driver author decides... */ 49/* these strings are set to whatever the driver author decides... */
35struct ethtool_drvinfo { 50struct ethtool_drvinfo {
diff --git a/include/linux/file.h b/include/linux/file.h
index 27c64bdc68c9..a20259e248a5 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -34,8 +34,9 @@ extern struct file *fget(unsigned int fd);
34extern struct file *fget_light(unsigned int fd, int *fput_needed); 34extern struct file *fget_light(unsigned int fd, int *fput_needed);
35extern void set_close_on_exec(unsigned int fd, int flag); 35extern void set_close_on_exec(unsigned int fd, int flag);
36extern void put_filp(struct file *); 36extern void put_filp(struct file *);
37extern int alloc_fd(unsigned start, unsigned flags);
37extern int get_unused_fd(void); 38extern int get_unused_fd(void);
38extern int get_unused_fd_flags(int flags); 39#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
39extern void put_unused_fd(unsigned int fd); 40extern void put_unused_fd(unsigned int fd);
40 41
41extern void fd_install(unsigned int fd, struct file *file); 42extern void fd_install(unsigned int fd, struct file *file);
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
index acbdbcc16051..6e199c8dfacc 100644
--- a/include/linux/firmware-map.h
+++ b/include/linux/firmware-map.h
@@ -24,34 +24,8 @@
24 */ 24 */
25#ifdef CONFIG_FIRMWARE_MEMMAP 25#ifdef CONFIG_FIRMWARE_MEMMAP
26 26
27/**
28 * Adds a firmware mapping entry. This function uses kmalloc() for memory
29 * allocation. Use firmware_map_add_early() if you want to use the bootmem
30 * allocator.
31 *
32 * That function must be called before late_initcall.
33 *
34 * @start: Start of the memory range.
35 * @end: End of the memory range (inclusive).
36 * @type: Type of the memory range.
37 *
38 * Returns 0 on success, or -ENOMEM if no memory could be allocated.
39 */
40int firmware_map_add(resource_size_t start, resource_size_t end, 27int firmware_map_add(resource_size_t start, resource_size_t end,
41 const char *type); 28 const char *type);
42
43/**
44 * Adds a firmware mapping entry. This function uses the bootmem allocator
45 * for memory allocation. Use firmware_map_add() if you want to use kmalloc().
46 *
47 * That function must be called before late_initcall.
48 *
49 * @start: Start of the memory range.
50 * @end: End of the memory range (inclusive).
51 * @type: Type of the memory range.
52 *
53 * Returns 0 on success, or -ENOMEM if no memory could be allocated.
54 */
55int firmware_map_add_early(resource_size_t start, resource_size_t end, 29int firmware_map_add_early(resource_size_t start, resource_size_t end,
56 const char *type); 30 const char *type);
57 31
diff --git a/include/linux/harrier_defs.h b/include/linux/harrier_defs.h
deleted file mode 100644
index efef11db790f..000000000000
--- a/include/linux/harrier_defs.h
+++ /dev/null
@@ -1,212 +0,0 @@
1/*
2 * include/linux/harrier_defs.h
3 *
4 * Definitions for Motorola MCG Harrier North Bridge & Memory controller
5 *
6 * Author: Dale Farnsworth
7 * dale.farnsworth@mvista.com
8 *
9 * Extracted from asm-ppc/harrier.h by:
10 * Randy Vinson
11 * rvinson@mvista.com
12 *
13 * Copyright 2001-2002 MontaVista Software Inc.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 */
20
21#ifndef __ASMPPC_HARRIER_DEFS_H
22#define __ASMPPC_HARRIER_DEFS_H
23
24#define HARRIER_DEFAULT_XCSR_BASE 0xfeff0000
25
26#define HARRIER_VEND_DEV_ID 0x1057480b
27
28#define HARRIER_VENI_OFF 0x00
29
30#define HARRIER_REVI_OFF 0x05
31#define HARRIER_UCTL_OFF 0xd0
32#define HARRIER_XTAL64_MASK 0x02
33
34#define HARRIER_MISC_CSR_OFF 0x1c
35#define HARRIER_RSTOUT 0x01000000
36#define HARRIER_SYSCON 0x08000000
37#define HARRIER_EREADY 0x10000000
38#define HARRIER_ERDYS 0x20000000
39
40/* Function exception registers */
41#define HARRIER_FEEN_OFF 0x40 /* enable */
42#define HARRIER_FEST_OFF 0x44 /* status */
43#define HARRIER_FEMA_OFF 0x48 /* mask */
44#define HARRIER_FECL_OFF 0x4c /* clear */
45
46#define HARRIER_FE_DMA 0x80
47#define HARRIER_FE_MIDB 0x40
48#define HARRIER_FE_MIM0 0x20
49#define HARRIER_FE_MIM1 0x10
50#define HARRIER_FE_MIP 0x08
51#define HARRIER_FE_UA0 0x04
52#define HARRIER_FE_UA1 0x02
53#define HARRIER_FE_ABT 0x01
54
55#define HARRIER_SERIAL_0_OFF 0xc0
56
57#define HARRIER_MBAR_OFF 0xe0
58#define HARRIER_MBAR_MSK 0xfffc0000
59#define HARRIER_MPIC_CSR_OFF 0xe4
60#define HARRIER_MPIC_OPI_ENABLE 0x40
61#define HARRIER_MPIC_IFEVP_OFF 0x10200
62#define HARRIER_MPIC_IFEVP_VECT_MSK 0xff
63#define HARRIER_MPIC_IFEDE_OFF 0x10210
64
65/*
66 * Define the Memory Controller register offsets.
67 */
68#define HARRIER_SDBA_OFF 0x110
69#define HARRIER_SDBB_OFF 0x114
70#define HARRIER_SDBC_OFF 0x118
71#define HARRIER_SDBD_OFF 0x11c
72#define HARRIER_SDBE_OFF 0x120
73#define HARRIER_SDBF_OFF 0x124
74#define HARRIER_SDBG_OFF 0x128
75#define HARRIER_SDBH_OFF 0x12c
76
77#define HARRIER_SDB_ENABLE 0x00000100
78#define HARRIER_SDB_SIZE_MASK 0xf
79#define HARRIER_SDB_SIZE_SHIFT 16
80#define HARRIER_SDB_BASE_MASK 0xff
81#define HARRIER_SDB_BASE_SHIFT 24
82
83/*
84 * Define outbound register offsets.
85 */
86#define HARRIER_OTAD0_OFF 0x220
87#define HARRIER_OTOF0_OFF 0x224
88#define HARRIER_OTAD1_OFF 0x228
89#define HARRIER_OTOF1_OFF 0x22c
90#define HARRIER_OTAD2_OFF 0x230
91#define HARRIER_OTOF2_OFF 0x234
92#define HARRIER_OTAD3_OFF 0x238
93#define HARRIER_OTOF3_OFF 0x23c
94
95#define HARRIER_OTADX_START_MSK 0xffff0000UL
96#define HARRIER_OTADX_END_MSK 0x0000ffffUL
97
98#define HARRIER_OTOFX_OFF_MSK 0xffff0000UL
99#define HARRIER_OTOFX_ENA 0x80UL
100#define HARRIER_OTOFX_WPE 0x10UL
101#define HARRIER_OTOFX_SGE 0x08UL
102#define HARRIER_OTOFX_RAE 0x04UL
103#define HARRIER_OTOFX_MEM 0x02UL
104#define HARRIER_OTOFX_IOM 0x01UL
105
106/*
107 * Define generic message passing register offsets
108 */
109/* Mirrored registers (visible from both PowerPC and PCI space) */
110#define HARRIER_XCSR_MP_BASE_OFF 0x290 /* base offset in XCSR space */
111#define HARRIER_PMEP_MP_BASE_OFF 0x100 /* base offset in PMEM space */
112#define HARRIER_MGOM0_OFF 0x00 /* outbound msg 0 */
113#define HARRIER_MGOM1_OFF 0x04 /* outbound msg 1 */
114#define HARRIER_MGOD_OFF 0x08 /* outbound doorbells */
115
116#define HARRIER_MGIM0_OFF 0x10 /* inbound msg 0 */
117#define HARRIER_MGIM1_OFF 0x14 /* inbound msg 1 */
118#define HARRIER_MGID_OFF 0x18 /* inbound doorbells */
119
120/* PowerPC-only registers */
121#define HARRIER_MGIDM_OFF 0x20 /* inbound doorbell mask */
122
123/* PCI-only registers */
124#define HARRIER_PMEP_MGST_OFF 0x20 /* (outbound) interrupt status */
125#define HARRIER_PMEP_MGMS_OFF 0x24 /* (outbound) interrupt mask */
126#define HARRIER_MG_OMI0 (1<<4)
127#define HARRIER_MG_OMI1 (1<<5)
128
129#define HARRIER_PMEP_MGODM_OFF 0x28 /* outbound doorbell mask */
130
131/*
132 * Define PCI configuration space register offsets
133 */
134#define HARRIER_XCSR_TO_PCFS_OFF 0x300
135
136/*
137 * Define message passing attribute register offset
138 */
139#define HARRIER_MPAT_OFF 0x44
140
141/*
142 * Define inbound attribute register offsets.
143 */
144#define HARRIER_ITSZ0_OFF 0x48
145#define HARRIER_ITAT0_OFF 0x4c
146
147#define HARRIER_ITSZ1_OFF 0x50
148#define HARRIER_ITAT1_OFF 0x54
149
150#define HARRIER_ITSZ2_OFF 0x58
151#define HARRIER_ITAT2_OFF 0x5c
152
153#define HARRIER_ITSZ3_OFF 0x60
154#define HARRIER_ITAT3_OFF 0x64
155
156/* inbound translation size constants */
157#define HARRIER_ITSZ_MSK 0xff
158#define HARRIER_ITSZ_4KB 0x00
159#define HARRIER_ITSZ_8KB 0x01
160#define HARRIER_ITSZ_16KB 0x02
161#define HARRIER_ITSZ_32KB 0x03
162#define HARRIER_ITSZ_64KB 0x04
163#define HARRIER_ITSZ_128KB 0x05
164#define HARRIER_ITSZ_256KB 0x06
165#define HARRIER_ITSZ_512KB 0x07
166#define HARRIER_ITSZ_1MB 0x08
167#define HARRIER_ITSZ_2MB 0x09
168#define HARRIER_ITSZ_4MB 0x0A
169#define HARRIER_ITSZ_8MB 0x0B
170#define HARRIER_ITSZ_16MB 0x0C
171#define HARRIER_ITSZ_32MB 0x0D
172#define HARRIER_ITSZ_64MB 0x0E
173#define HARRIER_ITSZ_128MB 0x0F
174#define HARRIER_ITSZ_256MB 0x10
175#define HARRIER_ITSZ_512MB 0x11
176#define HARRIER_ITSZ_1GB 0x12
177#define HARRIER_ITSZ_2GB 0x13
178
179/* inbound translation offset */
180#define HARRIER_ITOF_SHIFT 0x10
181#define HARRIER_ITOF_MSK 0xffff
182
183/* inbound translation atttributes */
184#define HARRIER_ITAT_PRE (1<<3)
185#define HARRIER_ITAT_RAE (1<<4)
186#define HARRIER_ITAT_WPE (1<<5)
187#define HARRIER_ITAT_MEM (1<<6)
188#define HARRIER_ITAT_ENA (1<<7)
189#define HARRIER_ITAT_GBL (1<<16)
190
191#define HARRIER_LBA_OFF 0x80
192#define HARRIER_LBA_MSK (1<<31)
193
194#define HARRIER_XCSR_SIZE 1024
195
196/* macros to calculate message passing register offsets */
197#define HARRIER_MP_XCSR(x) ((u32)HARRIER_XCSR_MP_BASE_OFF + (u32)x)
198
199#define HARRIER_MP_PMEP(x) ((u32)HARRIER_PMEP_MP_BASE_OFF + (u32)x)
200
201/*
202 * Define PCI configuration space register offsets
203 */
204#define HARRIER_MPBAR_OFF PCI_BASE_ADDRESS_0
205#define HARRIER_ITBAR0_OFF PCI_BASE_ADDRESS_1
206#define HARRIER_ITBAR1_OFF PCI_BASE_ADDRESS_2
207#define HARRIER_ITBAR2_OFF PCI_BASE_ADDRESS_3
208#define HARRIER_ITBAR3_OFF PCI_BASE_ADDRESS_4
209
210#define HARRIER_XCSR_CONFIG(x) ((u32)HARRIER_XCSR_TO_PCFS_OFF + (u32)x)
211
212#endif /* __ASMPPC_HARRIER_DEFS_H */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 4862398e05bf..bf34c5f4c051 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -39,7 +39,6 @@
39#define I2C_DRIVERID_SAA7111A 8 /* video input processor */ 39#define I2C_DRIVERID_SAA7111A 8 /* video input processor */
40#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ 40#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
41#define I2C_DRIVERID_SAA7110 22 /* video decoder */ 41#define I2C_DRIVERID_SAA7110 22 /* video decoder */
42#define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */
43#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ 42#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */
44#define I2C_DRIVERID_PCF8583 25 /* real time clock */ 43#define I2C_DRIVERID_PCF8583 25 /* real time clock */
45#define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */ 44#define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */
@@ -95,7 +94,6 @@
95#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ 94#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
96#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ 95#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
97#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ 96#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */
98#define I2C_HW_B_G400 0x010009 /* Matrox G400 */
99#define I2C_HW_B_I810 0x01000a /* Intel I810 */ 97#define I2C_HW_B_I810 0x01000a /* Intel I810 */
100#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ 98#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */
101#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ 99#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index e6e9c814da61..f13255e06406 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -12,7 +12,9 @@
12#ifndef __I2C_PNX_H__ 12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__ 13#define __I2C_PNX_H__
14 14
15#include <asm/arch/i2c.h> 15#include <linux/pm.h>
16
17struct platform_device;
16 18
17struct i2c_pnx_mif { 19struct i2c_pnx_mif {
18 int ret; /* Return value */ 20 int ret; /* Return value */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index b846bc44a27e..87c12ed96954 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -219,18 +219,7 @@ static inline int __ide_default_irq(unsigned long base)
219#include <asm-generic/ide_iops.h> 219#include <asm-generic/ide_iops.h>
220#endif 220#endif
221 221
222#ifndef MAX_HWIFS 222#define MAX_HWIFS 10
223#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA)
224# define MAX_HWIFS 1
225#else
226# define MAX_HWIFS 10
227#endif
228#endif
229
230#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
231#undef MAX_HWIFS
232#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
233#endif
234 223
235/* Currently only m68k, apus and m8xx need it */ 224/* Currently only m68k, apus and m8xx need it */
236#ifndef IDE_ARCH_ACK_INTR 225#ifndef IDE_ARCH_ACK_INTR
@@ -509,24 +498,33 @@ struct ide_tp_ops {
509 498
510extern const struct ide_tp_ops default_tp_ops; 499extern const struct ide_tp_ops default_tp_ops;
511 500
501/**
502 * struct ide_port_ops - IDE port operations
503 *
504 * @init_dev: host specific initialization of a device
505 * @set_pio_mode: routine to program host for PIO mode
506 * @set_dma_mode: routine to program host for DMA mode
507 * @selectproc: tweaks hardware to select drive
508 * @reset_poll: chipset polling based on hba specifics
509 * @pre_reset: chipset specific changes to default for device-hba resets
510 * @resetproc: routine to reset controller after a disk reset
511 * @maskproc: special host masking for drive selection
512 * @quirkproc: check host's drive quirk list
513 *
514 * @mdma_filter: filter MDMA modes
515 * @udma_filter: filter UDMA modes
516 *
517 * @cable_detect: detect cable type
518 */
512struct ide_port_ops { 519struct ide_port_ops {
513 /* host specific initialization of a device */
514 void (*init_dev)(ide_drive_t *); 520 void (*init_dev)(ide_drive_t *);
515 /* routine to program host for PIO mode */
516 void (*set_pio_mode)(ide_drive_t *, const u8); 521 void (*set_pio_mode)(ide_drive_t *, const u8);
517 /* routine to program host for DMA mode */
518 void (*set_dma_mode)(ide_drive_t *, const u8); 522 void (*set_dma_mode)(ide_drive_t *, const u8);
519 /* tweaks hardware to select drive */
520 void (*selectproc)(ide_drive_t *); 523 void (*selectproc)(ide_drive_t *);
521 /* chipset polling based on hba specifics */
522 int (*reset_poll)(ide_drive_t *); 524 int (*reset_poll)(ide_drive_t *);
523 /* chipset specific changes to default for device-hba resets */
524 void (*pre_reset)(ide_drive_t *); 525 void (*pre_reset)(ide_drive_t *);
525 /* routine to reset controller after a disk reset */
526 void (*resetproc)(ide_drive_t *); 526 void (*resetproc)(ide_drive_t *);
527 /* special host masking for drive selection */
528 void (*maskproc)(ide_drive_t *, int); 527 void (*maskproc)(ide_drive_t *, int);
529 /* check host's drive quirk list */
530 void (*quirkproc)(ide_drive_t *); 528 void (*quirkproc)(ide_drive_t *);
531 529
532 u8 (*mdma_filter)(ide_drive_t *); 530 u8 (*mdma_filter)(ide_drive_t *);
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index a1630ba0b87c..7f4df7c7659d 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -506,6 +506,19 @@ struct ieee80211_channel_sw_ie {
506 u8 count; 506 u8 count;
507} __attribute__ ((packed)); 507} __attribute__ ((packed));
508 508
509/**
510 * struct ieee80211_tim
511 *
512 * This structure refers to "Traffic Indication Map information element"
513 */
514struct ieee80211_tim_ie {
515 u8 dtim_count;
516 u8 dtim_period;
517 u8 bitmap_ctrl;
518 /* variable size: 1 - 251 bytes */
519 u8 virtual_map[0];
520} __attribute__ ((packed));
521
509struct ieee80211_mgmt { 522struct ieee80211_mgmt {
510 __le16 frame_control; 523 __le16 frame_control;
511 __le16 duration; 524 __le16 duration;
diff --git a/include/linux/ihex.h b/include/linux/ihex.h
index 2baace2788a7..31d8629e75a1 100644
--- a/include/linux/ihex.h
+++ b/include/linux/ihex.h
@@ -18,7 +18,7 @@ struct ihex_binrec {
18 __be32 addr; 18 __be32 addr;
19 __be16 len; 19 __be16 len;
20 uint8_t data[0]; 20 uint8_t data[0];
21} __attribute__((aligned(4))); 21} __attribute__((packed));
22 22
23/* Find the next record, taking into account the 4-byte alignment */ 23/* Find the next record, taking into account the 4-byte alignment */
24static inline const struct ihex_binrec * 24static inline const struct ihex_binrec *
diff --git a/include/linux/init.h b/include/linux/init.h
index 11b84e106053..93538b696e3d 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -139,6 +139,7 @@ extern initcall_t __con_initcall_start[], __con_initcall_end[];
139extern initcall_t __security_initcall_start[], __security_initcall_end[]; 139extern initcall_t __security_initcall_start[], __security_initcall_end[];
140 140
141/* Defined in init/main.c */ 141/* Defined in init/main.c */
142extern int do_one_initcall(initcall_t fn);
142extern char __initdata boot_command_line[]; 143extern char __initdata boot_command_line[];
143extern char *saved_command_line; 144extern char *saved_command_line;
144extern unsigned int reset_devices; 145extern unsigned int reset_devices;
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 62aa4f895abe..58ff4e74b2f3 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -223,35 +223,6 @@ static inline int disable_irq_wake(unsigned int irq)
223#define or_softirq_pending(x) (local_softirq_pending() |= (x)) 223#define or_softirq_pending(x) (local_softirq_pending() |= (x))
224#endif 224#endif
225 225
226/*
227 * Temporary defines for UP kernels, until all code gets fixed.
228 */
229#ifndef CONFIG_SMP
230static inline void __deprecated cli(void)
231{
232 local_irq_disable();
233}
234static inline void __deprecated sti(void)
235{
236 local_irq_enable();
237}
238static inline void __deprecated save_flags(unsigned long *x)
239{
240 local_save_flags(*x);
241}
242#define save_flags(x) save_flags(&x)
243static inline void __deprecated restore_flags(unsigned long x)
244{
245 local_irq_restore(x);
246}
247
248static inline void __deprecated save_and_cli(unsigned long *x)
249{
250 local_irq_save(*x);
251}
252#define save_and_cli(x) save_and_cli(&x)
253#endif /* CONFIG_SMP */
254
255/* Some architectures might implement lazy enabling/disabling of 226/* Some architectures might implement lazy enabling/disabling of
256 * interrupts. In some cases, such as stop_machine, we might want 227 * interrupts. In some cases, such as stop_machine, we might want
257 * to ensure that after a local_irq_disable(), interrupts have 228 * to ensure that after a local_irq_disable(), interrupts have
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
index f8598f583944..c975caf75385 100644
--- a/include/linux/iommu-helper.h
+++ b/include/linux/iommu-helper.h
@@ -8,4 +8,3 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
8 unsigned long align_mask); 8 unsigned long align_mask);
9extern void iommu_area_free(unsigned long *map, unsigned long start, 9extern void iommu_area_free(unsigned long *map, unsigned long start,
10 unsigned int nr); 10 unsigned int nr);
11extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len);
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 2cd07cc29687..22d2115458c6 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -118,6 +118,10 @@ extern int allocate_resource(struct resource *root, struct resource *new,
118int adjust_resource(struct resource *res, resource_size_t start, 118int adjust_resource(struct resource *res, resource_size_t start,
119 resource_size_t size); 119 resource_size_t size);
120resource_size_t resource_alignment(struct resource *res); 120resource_size_t resource_alignment(struct resource *res);
121static inline resource_size_t resource_size(struct resource *res)
122{
123 return res->end - res->start + 1;
124}
121 125
122/* Convenience shorthand with allocation */ 126/* Convenience shorthand with allocation */
123#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 127#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
new file mode 100644
index 000000000000..ec6eb49af2d8
--- /dev/null
+++ b/include/linux/ip_vs.h
@@ -0,0 +1,245 @@
1/*
2 * IP Virtual Server
3 * data structure and functionality definitions
4 */
5
6#ifndef _IP_VS_H
7#define _IP_VS_H
8
9#include <linux/types.h> /* For __beXX types in userland */
10
11#define IP_VS_VERSION_CODE 0x010201
12#define NVERSION(version) \
13 (version >> 16) & 0xFF, \
14 (version >> 8) & 0xFF, \
15 version & 0xFF
16
17/*
18 * Virtual Service Flags
19 */
20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
22
23/*
24 * Destination Server Flags
25 */
26#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */
27#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */
28
29/*
30 * IPVS sync daemon states
31 */
32#define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */
33#define IP_VS_STATE_MASTER 0x0001 /* started as master */
34#define IP_VS_STATE_BACKUP 0x0002 /* started as backup */
35
36/*
37 * IPVS socket options
38 */
39#define IP_VS_BASE_CTL (64+1024+64) /* base */
40
41#define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */
42#define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1)
43#define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2)
44#define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3)
45#define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4)
46#define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5)
47#define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6)
48#define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7)
49#define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8)
50#define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9)
51#define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10)
52#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11)
53#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12)
54#define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13)
55#define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14)
56#define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15)
57#define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO
58
59#define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL
60#define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1)
61#define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2)
62#define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3)
63#define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4)
64#define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */
65#define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6)
66#define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7)
67#define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON
68
69
70/*
71 * IPVS Connection Flags
72 */
73#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */
74#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */
75#define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */
76#define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */
77#define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */
78#define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */
79#define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */
80#define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */
81#define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */
82#define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */
83#define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */
84#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */
85#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
86#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
87#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
88
89#define IP_VS_SCHEDNAME_MAXLEN 16
90#define IP_VS_IFNAME_MAXLEN 16
91
92
93/*
94 * The struct ip_vs_service_user and struct ip_vs_dest_user are
95 * used to set IPVS rules through setsockopt.
96 */
97struct ip_vs_service_user {
98 /* virtual service addresses */
99 u_int16_t protocol;
100 __be32 addr; /* virtual ip address */
101 __be16 port;
102 u_int32_t fwmark; /* firwall mark of service */
103
104 /* virtual service options */
105 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
106 unsigned flags; /* virtual service flags */
107 unsigned timeout; /* persistent timeout in sec */
108 __be32 netmask; /* persistent netmask */
109};
110
111
112struct ip_vs_dest_user {
113 /* destination server address */
114 __be32 addr;
115 __be16 port;
116
117 /* real server options */
118 unsigned conn_flags; /* connection flags */
119 int weight; /* destination weight */
120
121 /* thresholds for active connections */
122 u_int32_t u_threshold; /* upper threshold */
123 u_int32_t l_threshold; /* lower threshold */
124};
125
126
127/*
128 * IPVS statistics object (for user space)
129 */
130struct ip_vs_stats_user
131{
132 __u32 conns; /* connections scheduled */
133 __u32 inpkts; /* incoming packets */
134 __u32 outpkts; /* outgoing packets */
135 __u64 inbytes; /* incoming bytes */
136 __u64 outbytes; /* outgoing bytes */
137
138 __u32 cps; /* current connection rate */
139 __u32 inpps; /* current in packet rate */
140 __u32 outpps; /* current out packet rate */
141 __u32 inbps; /* current in byte rate */
142 __u32 outbps; /* current out byte rate */
143};
144
145
146/* The argument to IP_VS_SO_GET_INFO */
147struct ip_vs_getinfo {
148 /* version number */
149 unsigned int version;
150
151 /* size of connection hash table */
152 unsigned int size;
153
154 /* number of virtual services */
155 unsigned int num_services;
156};
157
158
159/* The argument to IP_VS_SO_GET_SERVICE */
160struct ip_vs_service_entry {
161 /* which service: user fills in these */
162 u_int16_t protocol;
163 __be32 addr; /* virtual address */
164 __be16 port;
165 u_int32_t fwmark; /* firwall mark of service */
166
167 /* service options */
168 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
169 unsigned flags; /* virtual service flags */
170 unsigned timeout; /* persistent timeout */
171 __be32 netmask; /* persistent netmask */
172
173 /* number of real servers */
174 unsigned int num_dests;
175
176 /* statistics */
177 struct ip_vs_stats_user stats;
178};
179
180
181struct ip_vs_dest_entry {
182 __be32 addr; /* destination address */
183 __be16 port;
184 unsigned conn_flags; /* connection flags */
185 int weight; /* destination weight */
186
187 u_int32_t u_threshold; /* upper threshold */
188 u_int32_t l_threshold; /* lower threshold */
189
190 u_int32_t activeconns; /* active connections */
191 u_int32_t inactconns; /* inactive connections */
192 u_int32_t persistconns; /* persistent connections */
193
194 /* statistics */
195 struct ip_vs_stats_user stats;
196};
197
198
199/* The argument to IP_VS_SO_GET_DESTS */
200struct ip_vs_get_dests {
201 /* which service: user fills in these */
202 u_int16_t protocol;
203 __be32 addr; /* virtual address */
204 __be16 port;
205 u_int32_t fwmark; /* firwall mark of service */
206
207 /* number of real servers */
208 unsigned int num_dests;
209
210 /* the real servers */
211 struct ip_vs_dest_entry entrytable[0];
212};
213
214
215/* The argument to IP_VS_SO_GET_SERVICES */
216struct ip_vs_get_services {
217 /* number of virtual services */
218 unsigned int num_services;
219
220 /* service table */
221 struct ip_vs_service_entry entrytable[0];
222};
223
224
225/* The argument to IP_VS_SO_GET_TIMEOUT */
226struct ip_vs_timeout_user {
227 int tcp_timeout;
228 int tcp_fin_timeout;
229 int udp_timeout;
230};
231
232
233/* The argument to IP_VS_SO_GET_DAEMON */
234struct ip_vs_daemon_user {
235 /* sync daemon state (master/backup) */
236 int state;
237
238 /* multicast interface name */
239 char mcast_ifn[IP_VS_IFNAME_MAXLEN];
240
241 /* SyncID we belong to */
242 int syncid;
243};
244
245#endif /* _IP_VS_H */
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 57aefa160a92..b96144887444 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -108,8 +108,7 @@ static inline void print_fn_descriptor_symbol(const char *fmt, void *addr)
108 108
109static inline void print_ip_sym(unsigned long ip) 109static inline void print_ip_sym(unsigned long ip)
110{ 110{
111 printk("[<%p>]", (void *) ip); 111 printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
112 print_symbol(" %s\n", ip);
113} 112}
114 113
115#endif /*_LINUX_KALLSYMS_H*/ 114#endif /*_LINUX_KALLSYMS_H*/
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fdbbf72ca2eb..2651f805ba6d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -75,6 +75,12 @@ extern const char linux_proc_banner[];
75 */ 75 */
76#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) 76#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
77 77
78/**
79 * lower_32_bits - return bits 0-31 of a number
80 * @n: the number we're accessing
81 */
82#define lower_32_bits(n) ((u32)(n))
83
78#define KERN_EMERG "<0>" /* system is unusable */ 84#define KERN_EMERG "<0>" /* system is unusable */
79#define KERN_ALERT "<1>" /* action must be taken immediately */ 85#define KERN_ALERT "<1>" /* action must be taken immediately */
80#define KERN_CRIT "<2>" /* critical conditions */ 86#define KERN_CRIT "<2>" /* critical conditions */
@@ -102,6 +108,13 @@ struct completion;
102struct pt_regs; 108struct pt_regs;
103struct user; 109struct user;
104 110
111#ifdef CONFIG_PREEMPT_VOLUNTARY
112extern int _cond_resched(void);
113# define might_resched() _cond_resched()
114#else
115# define might_resched() do { } while (0)
116#endif
117
105/** 118/**
106 * might_sleep - annotation for functions that can sleep 119 * might_sleep - annotation for functions that can sleep
107 * 120 *
@@ -112,13 +125,6 @@ struct user;
112 * be bitten later when the calling function happens to sleep when it is not 125 * be bitten later when the calling function happens to sleep when it is not
113 * supposed to. 126 * supposed to.
114 */ 127 */
115#ifdef CONFIG_PREEMPT_VOLUNTARY
116extern int _cond_resched(void);
117# define might_resched() _cond_resched()
118#else
119# define might_resched() do { } while (0)
120#endif
121
122#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 128#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
123 void __might_sleep(char *file, int line); 129 void __might_sleep(char *file, int line);
124# define might_sleep() \ 130# define might_sleep() \
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 82f88a8a827b..32110cede64f 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -130,8 +130,8 @@ void vmcoreinfo_append_str(const char *fmt, ...)
130 __attribute__ ((format (printf, 1, 2))); 130 __attribute__ ((format (printf, 1, 2)));
131unsigned long paddr_vmcoreinfo_note(void); 131unsigned long paddr_vmcoreinfo_note(void);
132 132
133#define VMCOREINFO_OSRELEASE(name) \ 133#define VMCOREINFO_OSRELEASE(value) \
134 vmcoreinfo_append_str("OSRELEASE=%s\n", #name) 134 vmcoreinfo_append_str("OSRELEASE=%s\n", value)
135#define VMCOREINFO_PAGESIZE(value) \ 135#define VMCOREINFO_PAGESIZE(value) \
136 vmcoreinfo_append_str("PAGESIZE=%ld\n", value) 136 vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
137#define VMCOREINFO_SYMBOL(name) \ 137#define VMCOREINFO_SYMBOL(name) \
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 0ea064cbfbc8..69511f74f912 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -371,6 +371,7 @@ struct kvm_trace_rec {
371#define KVM_CAP_PV_MMU 13 371#define KVM_CAP_PV_MMU 13
372#define KVM_CAP_MP_STATE 14 372#define KVM_CAP_MP_STATE 14
373#define KVM_CAP_COALESCED_MMIO 15 373#define KVM_CAP_COALESCED_MMIO 15
374#define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */
374 375
375/* 376/*
376 * ioctls for VM fds 377 * ioctls for VM fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 07d68a8ae8e9..8525afc53107 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -121,6 +121,12 @@ struct kvm {
121 struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; 121 struct kvm_coalesced_mmio_dev *coalesced_mmio_dev;
122 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; 122 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
123#endif 123#endif
124
125#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
126 struct mmu_notifier mmu_notifier;
127 unsigned long mmu_notifier_seq;
128 long mmu_notifier_count;
129#endif
124}; 130};
125 131
126/* The guest did something we don't support. */ 132/* The guest did something we don't support. */
@@ -332,4 +338,22 @@ int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
332#define kvm_trace_cleanup() ((void)0) 338#define kvm_trace_cleanup() ((void)0)
333#endif 339#endif
334 340
341#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
342static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
343{
344 if (unlikely(vcpu->kvm->mmu_notifier_count))
345 return 1;
346 /*
347 * Both reads happen under the mmu_lock and both values are
348 * modified under mmu_lock, so there's no need of smb_rmb()
349 * here in between, otherwise mmu_notifier_count should be
350 * read before mmu_notifier_seq, see
351 * mmu_notifier_invalidate_range_end write side.
352 */
353 if (vcpu->kvm->mmu_notifier_seq != mmu_seq)
354 return 1;
355 return 0;
356}
357#endif
358
335#endif 359#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5b247b8a6b3b..06b80337303b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -60,9 +60,9 @@
60 60
61/* note: prints function name for you */ 61/* note: prints function name for you */
62#ifdef ATA_DEBUG 62#ifdef ATA_DEBUG
63#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) 63#define DPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
64#ifdef ATA_VERBOSE_DEBUG 64#ifdef ATA_VERBOSE_DEBUG
65#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) 65#define VPRINTK(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
66#else 66#else
67#define VPRINTK(fmt, args...) 67#define VPRINTK(fmt, args...)
68#endif /* ATA_VERBOSE_DEBUG */ 68#endif /* ATA_VERBOSE_DEBUG */
@@ -71,7 +71,7 @@
71#define VPRINTK(fmt, args...) 71#define VPRINTK(fmt, args...)
72#endif /* ATA_DEBUG */ 72#endif /* ATA_DEBUG */
73 73
74#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) 74#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args)
75 75
76/* NEW: debug levels */ 76/* NEW: debug levels */
77#define HAVE_LIBATA_MSG 1 77#define HAVE_LIBATA_MSG 1
@@ -750,6 +750,7 @@ struct ata_port_operations {
750 void (*set_piomode)(struct ata_port *ap, struct ata_device *dev); 750 void (*set_piomode)(struct ata_port *ap, struct ata_device *dev);
751 void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev); 751 void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev);
752 int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev); 752 int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
753 unsigned int (*read_id)(struct ata_device *dev, struct ata_taskfile *tf, u16 *id);
753 754
754 void (*dev_config)(struct ata_device *dev); 755 void (*dev_config)(struct ata_device *dev);
755 756
@@ -951,6 +952,8 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
951 unsigned int ofs, unsigned int len); 952 unsigned int ofs, unsigned int len);
952extern void ata_id_c_string(const u16 *id, unsigned char *s, 953extern void ata_id_c_string(const u16 *id, unsigned char *s,
953 unsigned int ofs, unsigned int len); 954 unsigned int ofs, unsigned int len);
955extern unsigned int ata_do_dev_read_id(struct ata_device *dev,
956 struct ata_taskfile *tf, u16 *id);
954extern void ata_qc_complete(struct ata_queued_cmd *qc); 957extern void ata_qc_complete(struct ata_queued_cmd *qc);
955extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); 958extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active);
956extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, 959extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
diff --git a/include/linux/list.h b/include/linux/list.h
index 453916bc0412..db35ef02e745 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -214,22 +214,62 @@ static inline int list_is_singular(const struct list_head *head)
214 return !list_empty(head) && (head->next == head->prev); 214 return !list_empty(head) && (head->next == head->prev);
215} 215}
216 216
217static inline void __list_cut_position(struct list_head *list,
218 struct list_head *head, struct list_head *entry)
219{
220 struct list_head *new_first = entry->next;
221 list->next = head->next;
222 list->next->prev = list;
223 list->prev = entry;
224 entry->next = list;
225 head->next = new_first;
226 new_first->prev = head;
227}
228
229/**
230 * list_cut_position - cut a list into two
231 * @list: a new list to add all removed entries
232 * @head: a list with entries
233 * @entry: an entry within head, could be the head itself
234 * and if so we won't cut the list
235 *
236 * This helper moves the initial part of @head, up to and
237 * including @entry, from @head to @list. You should
238 * pass on @entry an element you know is on @head. @list
239 * should be an empty list or a list you do not care about
240 * losing its data.
241 *
242 */
243static inline void list_cut_position(struct list_head *list,
244 struct list_head *head, struct list_head *entry)
245{
246 if (list_empty(head))
247 return;
248 if (list_is_singular(head) &&
249 (head->next != entry && head != entry))
250 return;
251 if (entry == head)
252 INIT_LIST_HEAD(list);
253 else
254 __list_cut_position(list, head, entry);
255}
256
217static inline void __list_splice(const struct list_head *list, 257static inline void __list_splice(const struct list_head *list,
218 struct list_head *head) 258 struct list_head *prev,
259 struct list_head *next)
219{ 260{
220 struct list_head *first = list->next; 261 struct list_head *first = list->next;
221 struct list_head *last = list->prev; 262 struct list_head *last = list->prev;
222 struct list_head *at = head->next;
223 263
224 first->prev = head; 264 first->prev = prev;
225 head->next = first; 265 prev->next = first;
226 266
227 last->next = at; 267 last->next = next;
228 at->prev = last; 268 next->prev = last;
229} 269}
230 270
231/** 271/**
232 * list_splice - join two lists 272 * list_splice - join two lists, this is designed for stacks
233 * @list: the new list to add. 273 * @list: the new list to add.
234 * @head: the place to add it in the first list. 274 * @head: the place to add it in the first list.
235 */ 275 */
@@ -237,7 +277,19 @@ static inline void list_splice(const struct list_head *list,
237 struct list_head *head) 277 struct list_head *head)
238{ 278{
239 if (!list_empty(list)) 279 if (!list_empty(list))
240 __list_splice(list, head); 280 __list_splice(list, head, head->next);
281}
282
283/**
284 * list_splice_tail - join two lists, each list being a queue
285 * @list: the new list to add.
286 * @head: the place to add it in the first list.
287 */
288static inline void list_splice_tail(struct list_head *list,
289 struct list_head *head)
290{
291 if (!list_empty(list))
292 __list_splice(list, head->prev, head);
241} 293}
242 294
243/** 295/**
@@ -251,7 +303,24 @@ static inline void list_splice_init(struct list_head *list,
251 struct list_head *head) 303 struct list_head *head)
252{ 304{
253 if (!list_empty(list)) { 305 if (!list_empty(list)) {
254 __list_splice(list, head); 306 __list_splice(list, head, head->next);
307 INIT_LIST_HEAD(list);
308 }
309}
310
311/**
312 * list_splice_tail_init - join two lists and reinitialise the emptied list
313 * @list: the new list to add.
314 * @head: the place to add it in the first list.
315 *
316 * Each of the lists is a queue.
317 * The list at @list is reinitialised
318 */
319static inline void list_splice_tail_init(struct list_head *list,
320 struct list_head *head)
321{
322 if (!list_empty(list)) {
323 __list_splice(list, head->prev, head);
255 INIT_LIST_HEAD(list); 324 INIT_LIST_HEAD(list);
256 } 325 }
257} 326}
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 2486eb4edbf1..331e5f1c2d8e 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -89,6 +89,7 @@ struct lock_class {
89 89
90 struct lockdep_subclass_key *key; 90 struct lockdep_subclass_key *key;
91 unsigned int subclass; 91 unsigned int subclass;
92 unsigned int dep_gen_id;
92 93
93 /* 94 /*
94 * IRQ/softirq usage tracking bits: 95 * IRQ/softirq usage tracking bits:
@@ -189,6 +190,14 @@ struct lock_chain {
189 u64 chain_key; 190 u64 chain_key;
190}; 191};
191 192
193#define MAX_LOCKDEP_KEYS_BITS 13
194/*
195 * Subtract one because we offset hlock->class_idx by 1 in order
196 * to make 0 mean no class. This avoids overflowing the class_idx
197 * bitfield and hitting the BUG in hlock_class().
198 */
199#define MAX_LOCKDEP_KEYS ((1UL << MAX_LOCKDEP_KEYS_BITS) - 1)
200
192struct held_lock { 201struct held_lock {
193 /* 202 /*
194 * One-way hash of the dependency chain up to this point. We 203 * One-way hash of the dependency chain up to this point. We
@@ -205,14 +214,14 @@ struct held_lock {
205 * with zero), here we store the previous hash value: 214 * with zero), here we store the previous hash value:
206 */ 215 */
207 u64 prev_chain_key; 216 u64 prev_chain_key;
208 struct lock_class *class;
209 unsigned long acquire_ip; 217 unsigned long acquire_ip;
210 struct lockdep_map *instance; 218 struct lockdep_map *instance;
211 219 struct lockdep_map *nest_lock;
212#ifdef CONFIG_LOCK_STAT 220#ifdef CONFIG_LOCK_STAT
213 u64 waittime_stamp; 221 u64 waittime_stamp;
214 u64 holdtime_stamp; 222 u64 holdtime_stamp;
215#endif 223#endif
224 unsigned int class_idx:MAX_LOCKDEP_KEYS_BITS;
216 /* 225 /*
217 * The lock-stack is unified in that the lock chains of interrupt 226 * The lock-stack is unified in that the lock chains of interrupt
218 * contexts nest ontop of process context chains, but we 'separate' 227 * contexts nest ontop of process context chains, but we 'separate'
@@ -226,11 +235,11 @@ struct held_lock {
226 * The following field is used to detect when we cross into an 235 * The following field is used to detect when we cross into an
227 * interrupt context: 236 * interrupt context:
228 */ 237 */
229 int irq_context; 238 unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */
230 int trylock; 239 unsigned int trylock:1;
231 int read; 240 unsigned int read:2; /* see lock_acquire() comment */
232 int check; 241 unsigned int check:2; /* see lock_acquire() comment */
233 int hardirqs_off; 242 unsigned int hardirqs_off:1;
234}; 243};
235 244
236/* 245/*
@@ -294,11 +303,15 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
294 * 2: full validation 303 * 2: full validation
295 */ 304 */
296extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, 305extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
297 int trylock, int read, int check, unsigned long ip); 306 int trylock, int read, int check,
307 struct lockdep_map *nest_lock, unsigned long ip);
298 308
299extern void lock_release(struct lockdep_map *lock, int nested, 309extern void lock_release(struct lockdep_map *lock, int nested,
300 unsigned long ip); 310 unsigned long ip);
301 311
312extern void lock_set_subclass(struct lockdep_map *lock, unsigned int subclass,
313 unsigned long ip);
314
302# define INIT_LOCKDEP .lockdep_recursion = 0, 315# define INIT_LOCKDEP .lockdep_recursion = 0,
303 316
304#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) 317#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0)
@@ -313,8 +326,9 @@ static inline void lockdep_on(void)
313{ 326{
314} 327}
315 328
316# define lock_acquire(l, s, t, r, c, i) do { } while (0) 329# define lock_acquire(l, s, t, r, c, n, i) do { } while (0)
317# define lock_release(l, n, i) do { } while (0) 330# define lock_release(l, n, i) do { } while (0)
331# define lock_set_subclass(l, s, i) do { } while (0)
318# define lockdep_init() do { } while (0) 332# define lockdep_init() do { } while (0)
319# define lockdep_info() do { } while (0) 333# define lockdep_info() do { } while (0)
320# define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0) 334# define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0)
@@ -400,9 +414,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
400 414
401#ifdef CONFIG_DEBUG_LOCK_ALLOC 415#ifdef CONFIG_DEBUG_LOCK_ALLOC
402# ifdef CONFIG_PROVE_LOCKING 416# ifdef CONFIG_PROVE_LOCKING
403# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) 417# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
418# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
404# else 419# else
405# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) 420# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
421# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, NULL, i)
406# endif 422# endif
407# define spin_release(l, n, i) lock_release(l, n, i) 423# define spin_release(l, n, i) lock_release(l, n, i)
408#else 424#else
@@ -412,11 +428,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
412 428
413#ifdef CONFIG_DEBUG_LOCK_ALLOC 429#ifdef CONFIG_DEBUG_LOCK_ALLOC
414# ifdef CONFIG_PROVE_LOCKING 430# ifdef CONFIG_PROVE_LOCKING
415# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) 431# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
416# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, i) 432# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, NULL, i)
417# else 433# else
418# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) 434# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
419# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, i) 435# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, NULL, i)
420# endif 436# endif
421# define rwlock_release(l, n, i) lock_release(l, n, i) 437# define rwlock_release(l, n, i) lock_release(l, n, i)
422#else 438#else
@@ -427,9 +443,9 @@ static inline void print_irqtrace_events(struct task_struct *curr)
427 443
428#ifdef CONFIG_DEBUG_LOCK_ALLOC 444#ifdef CONFIG_DEBUG_LOCK_ALLOC
429# ifdef CONFIG_PROVE_LOCKING 445# ifdef CONFIG_PROVE_LOCKING
430# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) 446# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
431# else 447# else
432# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) 448# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
433# endif 449# endif
434# define mutex_release(l, n, i) lock_release(l, n, i) 450# define mutex_release(l, n, i) lock_release(l, n, i)
435#else 451#else
@@ -439,11 +455,11 @@ static inline void print_irqtrace_events(struct task_struct *curr)
439 455
440#ifdef CONFIG_DEBUG_LOCK_ALLOC 456#ifdef CONFIG_DEBUG_LOCK_ALLOC
441# ifdef CONFIG_PROVE_LOCKING 457# ifdef CONFIG_PROVE_LOCKING
442# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, i) 458# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i)
443# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, i) 459# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i)
444# else 460# else
445# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, i) 461# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
446# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, i) 462# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i)
447# endif 463# endif
448# define rwsem_release(l, n, i) lock_release(l, n, i) 464# define rwsem_release(l, n, i) lock_release(l, n, i)
449#else 465#else
@@ -452,4 +468,16 @@ static inline void print_irqtrace_events(struct task_struct *curr)
452# define rwsem_release(l, n, i) do { } while (0) 468# define rwsem_release(l, n, i) do { } while (0)
453#endif 469#endif
454 470
471#ifdef CONFIG_DEBUG_LOCK_ALLOC
472# ifdef CONFIG_PROVE_LOCKING
473# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
474# else
475# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
476# endif
477# define lock_map_release(l) lock_release(l, 1, _THIS_IP_)
478#else
479# define lock_map_acquire(l) do { } while (0)
480# define lock_map_release(l) do { } while (0)
481#endif
482
455#endif /* __LINUX_LOCKDEP_H */ 483#endif /* __LINUX_LOCKDEP_H */
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h
index 5c948f337817..8f2d60da04e7 100644
--- a/include/linux/mISDNif.h
+++ b/include/linux/mISDNif.h
@@ -37,7 +37,7 @@
37 */ 37 */
38#define MISDN_MAJOR_VERSION 1 38#define MISDN_MAJOR_VERSION 1
39#define MISDN_MINOR_VERSION 0 39#define MISDN_MINOR_VERSION 0
40#define MISDN_RELEASE 18 40#define MISDN_RELEASE 19
41 41
42/* primitives for information exchange 42/* primitives for information exchange
43 * generell format 43 * generell format
@@ -242,7 +242,8 @@ struct mISDNhead {
242#define TEI_SAPI 63 242#define TEI_SAPI 63
243#define CTRL_SAPI 0 243#define CTRL_SAPI 0
244 244
245#define MISDN_CHMAP_SIZE 4 245#define MISDN_MAX_CHANNEL 127
246#define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3)
246 247
247#define SOL_MISDN 0 248#define SOL_MISDN 0
248 249
@@ -275,11 +276,32 @@ struct mISDN_devinfo {
275 u_int Dprotocols; 276 u_int Dprotocols;
276 u_int Bprotocols; 277 u_int Bprotocols;
277 u_int protocol; 278 u_int protocol;
278 u_long channelmap[MISDN_CHMAP_SIZE]; 279 u_char channelmap[MISDN_CHMAP_SIZE];
279 u_int nrbchan; 280 u_int nrbchan;
280 char name[MISDN_MAX_IDLEN]; 281 char name[MISDN_MAX_IDLEN];
281}; 282};
282 283
284static inline int
285test_channelmap(u_int nr, u_char *map)
286{
287 if (nr <= MISDN_MAX_CHANNEL)
288 return map[nr >> 3] & (1 << (nr & 7));
289 else
290 return 0;
291}
292
293static inline void
294set_channelmap(u_int nr, u_char *map)
295{
296 map[nr >> 3] |= (1 << (nr & 7));
297}
298
299static inline void
300clear_channelmap(u_int nr, u_char *map)
301{
302 map[nr >> 3] &= ~(1 << (nr & 7));
303}
304
283/* CONTROL_CHANNEL parameters */ 305/* CONTROL_CHANNEL parameters */
284#define MISDN_CTRL_GETOP 0x0000 306#define MISDN_CTRL_GETOP 0x0000
285#define MISDN_CTRL_LOOP 0x0001 307#define MISDN_CTRL_LOOP 0x0001
@@ -405,7 +427,7 @@ struct mISDNdevice {
405 u_int Dprotocols; 427 u_int Dprotocols;
406 u_int Bprotocols; 428 u_int Bprotocols;
407 u_int nrbchan; 429 u_int nrbchan;
408 u_long channelmap[MISDN_CHMAP_SIZE]; 430 u_char channelmap[MISDN_CHMAP_SIZE];
409 struct list_head bchannels; 431 struct list_head bchannels;
410 struct mISDNchannel *teimgr; 432 struct mISDNchannel *teimgr;
411 struct device dev; 433 struct device dev;
@@ -430,7 +452,7 @@ struct mISDNstack {
430#endif 452#endif
431}; 453};
432 454
433/* global alloc/queue dunctions */ 455/* global alloc/queue functions */
434 456
435static inline struct sk_buff * 457static inline struct sk_buff *
436mI_alloc_skb(unsigned int len, gfp_t gfp_mask) 458mI_alloc_skb(unsigned int len, gfp_t gfp_mask)
diff --git a/include/linux/maple.h b/include/linux/maple.h
index 523a286bb477..c23d3f51ba40 100644
--- a/include/linux/maple.h
+++ b/include/linux/maple.h
@@ -2,6 +2,7 @@
2#define __LINUX_MAPLE_H 2#define __LINUX_MAPLE_H
3 3
4#include <linux/device.h> 4#include <linux/device.h>
5#include <mach/maple.h>
5 6
6extern struct bus_type maple_bus_type; 7extern struct bus_type maple_bus_type;
7 8
@@ -33,6 +34,7 @@ struct mapleq {
33 void *sendbuf, *recvbuf, *recvbufdcsp; 34 void *sendbuf, *recvbuf, *recvbufdcsp;
34 unsigned char length; 35 unsigned char length;
35 enum maple_code command; 36 enum maple_code command;
37 struct mutex mutex;
36}; 38};
37 39
38struct maple_devinfo { 40struct maple_devinfo {
@@ -49,7 +51,6 @@ struct maple_devinfo {
49struct maple_device { 51struct maple_device {
50 struct maple_driver *driver; 52 struct maple_driver *driver;
51 struct mapleq *mq; 53 struct mapleq *mq;
52 void *private_data;
53 void (*callback) (struct mapleq * mq); 54 void (*callback) (struct mapleq * mq);
54 unsigned long when, interval, function; 55 unsigned long when, interval, function;
55 struct maple_devinfo devinfo; 56 struct maple_devinfo devinfo;
@@ -68,10 +69,17 @@ void maple_getcond_callback(struct maple_device *dev,
68 void (*callback) (struct mapleq * mq), 69 void (*callback) (struct mapleq * mq),
69 unsigned long interval, 70 unsigned long interval,
70 unsigned long function); 71 unsigned long function);
71int maple_driver_register(struct device_driver *drv); 72int maple_driver_register(struct maple_driver *);
72void maple_add_packet(struct mapleq *mq); 73void maple_driver_unregister(struct maple_driver *);
74
75int maple_add_packet_sleeps(struct maple_device *mdev, u32 function,
76 u32 command, u32 length, void *data);
77void maple_clear_dev(struct maple_device *mdev);
73 78
74#define to_maple_dev(n) container_of(n, struct maple_device, dev) 79#define to_maple_dev(n) container_of(n, struct maple_device, dev)
75#define to_maple_driver(n) container_of(n, struct maple_driver, drv) 80#define to_maple_driver(n) container_of(n, struct maple_driver, drv)
76 81
82#define maple_get_drvdata(d) dev_get_drvdata(&(d)->dev)
83#define maple_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
84
77#endif /* __LINUX_MAPLE_H */ 85#endif /* __LINUX_MAPLE_H */
diff --git a/include/linux/mfd/t7l66xb.h b/include/linux/mfd/t7l66xb.h
new file mode 100644
index 000000000000..e83c7f2036f9
--- /dev/null
+++ b/include/linux/mfd/t7l66xb.h
@@ -0,0 +1,36 @@
1/*
2 * This file contains the definitions for the T7L66XB
3 *
4 * (C) Copyright 2005 Ian Molton <spyro@f2s.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#ifndef MFD_T7L66XB_H
12#define MFD_T7L66XB_H
13
14#include <linux/mfd/core.h>
15#include <linux/mfd/tmio.h>
16
17struct t7l66xb_platform_data {
18 int (*enable_clk32k)(struct platform_device *dev);
19 void (*disable_clk32k)(struct platform_device *dev);
20 int (*enable)(struct platform_device *dev);
21 int (*disable)(struct platform_device *dev);
22 int (*suspend)(struct platform_device *dev);
23 int (*resume)(struct platform_device *dev);
24
25 int irq_base; /* The base for subdevice irqs */
26
27 struct tmio_nand_data *nand_data;
28};
29
30
31#define IRQ_T7L66XB_MMC (1)
32#define IRQ_T7L66XB_NAND (3)
33
34#define T7L66XB_NR_IRQS 8
35
36#endif
diff --git a/include/linux/mfd/tc6387xb.h b/include/linux/mfd/tc6387xb.h
new file mode 100644
index 000000000000..fa06e0610b8e
--- /dev/null
+++ b/include/linux/mfd/tc6387xb.h
@@ -0,0 +1,23 @@
1/*
2 * This file contains the definitions for the TC6387XB
3 *
4 * (C) Copyright 2005 Ian Molton <spyro@f2s.com>
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 */
10#ifndef MFD_TC6387XB_H
11#define MFD_TC6387XB_H
12
13struct tc6387xb_platform_data {
14 int (*enable_clk32k)(struct platform_device *dev);
15 void (*disable_clk32k)(struct platform_device *dev);
16
17 int (*enable)(struct platform_device *dev);
18 int (*disable)(struct platform_device *dev);
19 int (*suspend)(struct platform_device *dev);
20 int (*resume)(struct platform_device *dev);
21};
22
23#endif
diff --git a/include/linux/mfd/tc6393xb.h b/include/linux/mfd/tc6393xb.h
index 7cc824a58f7c..fec7b3f7a81f 100644
--- a/include/linux/mfd/tc6393xb.h
+++ b/include/linux/mfd/tc6393xb.h
@@ -14,8 +14,8 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#ifndef TC6393XB_H 17#ifndef MFD_TC6393XB_H
18#define TC6393XB_H 18#define MFD_TC6393XB_H
19 19
20/* Also one should provide the CK3P6MI clock */ 20/* Also one should provide the CK3P6MI clock */
21struct tc6393xb_platform_data { 21struct tc6393xb_platform_data {
@@ -29,7 +29,7 @@ struct tc6393xb_platform_data {
29 int (*suspend)(struct platform_device *dev); 29 int (*suspend)(struct platform_device *dev);
30 int (*resume)(struct platform_device *dev); 30 int (*resume)(struct platform_device *dev);
31 31
32 int irq_base; /* a base for cascaded irq */ 32 int irq_base; /* base for subdevice irqs */
33 int gpio_base; 33 int gpio_base;
34 34
35 struct tmio_nand_data *nand_data; 35 struct tmio_nand_data *nand_data;
@@ -40,9 +40,6 @@ struct tc6393xb_platform_data {
40 */ 40 */
41#define IRQ_TC6393_NAND 0 41#define IRQ_TC6393_NAND 0
42#define IRQ_TC6393_MMC 1 42#define IRQ_TC6393_MMC 1
43#define IRQ_TC6393_OHCI 2
44#define IRQ_TC6393_SERIAL 3
45#define IRQ_TC6393_FB 4
46 43
47#define TC6393XB_NR_IRQS 8 44#define TC6393XB_NR_IRQS 8
48 45
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 9438d8c9ac1c..ec612e66391c 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,6 +1,21 @@
1#ifndef MFD_TMIO_H 1#ifndef MFD_TMIO_H
2#define MFD_TMIO_H 2#define MFD_TMIO_H
3 3
4#define tmio_ioread8(addr) readb(addr)
5#define tmio_ioread16(addr) readw(addr)
6#define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
7#define tmio_ioread32(addr) \
8 (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
9
10#define tmio_iowrite8(val, addr) writeb((val), (addr))
11#define tmio_iowrite16(val, addr) writew((val), (addr))
12#define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
13#define tmio_iowrite32(val, addr) \
14 do { \
15 writew((val), (addr)); \
16 writew((val) >> 16, (addr) + 2); \
17 } while (0)
18
4/* 19/*
5 * data for the NAND controller 20 * data for the NAND controller
6 */ 21 */
@@ -10,8 +25,4 @@ struct tmio_nand_data {
10 unsigned int num_partitions; 25 unsigned int num_partitions;
11}; 26};
12 27
13#define TMIO_NAND_CONFIG "tmio-nand-config"
14#define TMIO_NAND_CONTROL "tmio-nand-control"
15#define TMIO_NAND_IRQ "tmio-nand"
16
17#endif 28#endif
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h
index 071cf96cf01f..6f65b2c8bb89 100644
--- a/include/linux/mlx4/cq.h
+++ b/include/linux/mlx4/cq.h
@@ -39,17 +39,18 @@
39#include <linux/mlx4/doorbell.h> 39#include <linux/mlx4/doorbell.h>
40 40
41struct mlx4_cqe { 41struct mlx4_cqe {
42 __be32 my_qpn; 42 __be32 vlan_my_qpn;
43 __be32 immed_rss_invalid; 43 __be32 immed_rss_invalid;
44 __be32 g_mlpath_rqpn; 44 __be32 g_mlpath_rqpn;
45 u8 sl; 45 __be16 sl_vid;
46 u8 reserved1;
47 __be16 rlid; 46 __be16 rlid;
48 __be32 ipoib_status; 47 __be16 status;
48 u8 ipv6_ext_mask;
49 u8 badfcs_enc;
49 __be32 byte_cnt; 50 __be32 byte_cnt;
50 __be16 wqe_index; 51 __be16 wqe_index;
51 __be16 checksum; 52 __be16 checksum;
52 u8 reserved2[3]; 53 u8 reserved[3];
53 u8 owner_sr_opcode; 54 u8 owner_sr_opcode;
54}; 55};
55 56
@@ -64,6 +65,11 @@ struct mlx4_err_cqe {
64}; 65};
65 66
66enum { 67enum {
68 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29,
69 MLX4_CQE_QPN_MASK = 0xffffff,
70};
71
72enum {
67 MLX4_CQE_OWNER_MASK = 0x80, 73 MLX4_CQE_OWNER_MASK = 0x80,
68 MLX4_CQE_IS_SEND_MASK = 0x40, 74 MLX4_CQE_IS_SEND_MASK = 0x40,
69 MLX4_CQE_OPCODE_MASK = 0x1f 75 MLX4_CQE_OPCODE_MASK = 0x1f
@@ -86,13 +92,19 @@ enum {
86}; 92};
87 93
88enum { 94enum {
89 MLX4_CQE_IPOIB_STATUS_IPV4 = 1 << 22, 95 MLX4_CQE_STATUS_IPV4 = 1 << 6,
90 MLX4_CQE_IPOIB_STATUS_IPV4F = 1 << 23, 96 MLX4_CQE_STATUS_IPV4F = 1 << 7,
91 MLX4_CQE_IPOIB_STATUS_IPV6 = 1 << 24, 97 MLX4_CQE_STATUS_IPV6 = 1 << 8,
92 MLX4_CQE_IPOIB_STATUS_IPV4OPT = 1 << 25, 98 MLX4_CQE_STATUS_IPV4OPT = 1 << 9,
93 MLX4_CQE_IPOIB_STATUS_TCP = 1 << 26, 99 MLX4_CQE_STATUS_TCP = 1 << 10,
94 MLX4_CQE_IPOIB_STATUS_UDP = 1 << 27, 100 MLX4_CQE_STATUS_UDP = 1 << 11,
95 MLX4_CQE_IPOIB_STATUS_IPOK = 1 << 28, 101 MLX4_CQE_STATUS_IPOK = 1 << 12,
102};
103
104enum {
105 MLX4_CQE_LLC = 1,
106 MLX4_CQE_SNAP = 1 << 1,
107 MLX4_CQE_BAD_FCS = 1 << 4,
96}; 108};
97 109
98static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, 110static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 866a3dbe5c75..fa651609b65d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -744,6 +744,8 @@ struct zap_details {
744struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, 744struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
745 pte_t pte); 745 pte_t pte);
746 746
747int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
748 unsigned long size);
747unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, 749unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
748 unsigned long size, struct zap_details *); 750 unsigned long size, struct zap_details *);
749unsigned long unmap_vmas(struct mmu_gather **tlb, 751unsigned long unmap_vmas(struct mmu_gather **tlb,
@@ -832,7 +834,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma,
832 struct vm_area_struct **pprev, unsigned long start, 834 struct vm_area_struct **pprev, unsigned long start,
833 unsigned long end, unsigned long newflags); 835 unsigned long end, unsigned long newflags);
834 836
835#ifdef CONFIG_HAVE_GET_USER_PAGES_FAST
836/* 837/*
837 * get_user_pages_fast provides equivalent functionality to get_user_pages, 838 * get_user_pages_fast provides equivalent functionality to get_user_pages,
838 * operating on current and current->mm (force=0 and doesn't return any vmas). 839 * operating on current and current->mm (force=0 and doesn't return any vmas).
@@ -846,25 +847,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma,
846int get_user_pages_fast(unsigned long start, int nr_pages, int write, 847int get_user_pages_fast(unsigned long start, int nr_pages, int write,
847 struct page **pages); 848 struct page **pages);
848 849
849#else
850/*
851 * Should probably be moved to asm-generic, and architectures can include it if
852 * they don't implement their own get_user_pages_fast.
853 */
854#define get_user_pages_fast(start, nr_pages, write, pages) \
855({ \
856 struct mm_struct *mm = current->mm; \
857 int ret; \
858 \
859 down_read(&mm->mmap_sem); \
860 ret = get_user_pages(current, mm, start, nr_pages, \
861 write, 0, pages, NULL); \
862 up_read(&mm->mmap_sem); \
863 \
864 ret; \
865})
866#endif
867
868/* 850/*
869 * A callback you can register to apply pressure to ageable caches. 851 * A callback you can register to apply pressure to ageable caches.
870 * 852 *
@@ -1041,7 +1023,6 @@ extern unsigned long absent_pages_in_range(unsigned long start_pfn,
1041extern void get_pfn_range_for_nid(unsigned int nid, 1023extern void get_pfn_range_for_nid(unsigned int nid,
1042 unsigned long *start_pfn, unsigned long *end_pfn); 1024 unsigned long *start_pfn, unsigned long *end_pfn);
1043extern unsigned long find_min_pfn_with_active_regions(void); 1025extern unsigned long find_min_pfn_with_active_regions(void);
1044extern unsigned long find_max_pfn_with_active_regions(void);
1045extern void free_bootmem_with_active_regions(int nid, 1026extern void free_bootmem_with_active_regions(int nid,
1046 unsigned long max_low_pfn); 1027 unsigned long max_low_pfn);
1047typedef int (*work_fn_t)(unsigned long, unsigned long, void *); 1028typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
diff --git a/include/linux/mount.h b/include/linux/mount.h
index b5efaa2132ab..30a1d63b6fb5 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -105,7 +105,8 @@ extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
105 105
106struct nameidata; 106struct nameidata;
107 107
108extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, 108struct path;
109extern int do_add_mount(struct vfsmount *newmnt, struct path *path,
109 int mnt_flags, struct list_head *fslist); 110 int mnt_flags, struct list_head *fslist);
110 111
111extern void mark_mounts_for_expiry(struct list_head *mounts); 112extern void mark_mounts_for_expiry(struct list_head *mounts);
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 4ed40caff4e5..922636548558 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -272,7 +272,11 @@ static inline void mtd_erase_callback(struct erase_info *instr)
272 printk(KERN_INFO args); \ 272 printk(KERN_INFO args); \
273 } while(0) 273 } while(0)
274#else /* CONFIG_MTD_DEBUG */ 274#else /* CONFIG_MTD_DEBUG */
275#define DEBUG(n, args...) do { } while(0) 275#define DEBUG(n, args...) \
276 do { \
277 if (0) \
278 printk(KERN_INFO args); \
279 } while(0)
276 280
277#endif /* CONFIG_MTD_DEBUG */ 281#endif /* CONFIG_MTD_DEBUG */
278 282
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 83f678702dff..81774e5facf4 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -177,7 +177,9 @@ typedef enum {
177#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) 177#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
178#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) 178#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
179#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) 179#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
180#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT)) 180/* Large page NAND with SOFT_ECC should support subpage reads */
181#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \
182 && (chip->page_shift > 9))
181 183
182/* Mask to zero out the chip options, which come from the id table */ 184/* Mask to zero out the chip options, which come from the id table */
183#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 185#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b4d056ceab96..488c56e649b5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -61,9 +61,7 @@ struct wireless_dev;
61#define NET_XMIT_DROP 1 /* skb dropped */ 61#define NET_XMIT_DROP 1 /* skb dropped */
62#define NET_XMIT_CN 2 /* congestion notification */ 62#define NET_XMIT_CN 2 /* congestion notification */
63#define NET_XMIT_POLICED 3 /* skb is shot by police */ 63#define NET_XMIT_POLICED 3 /* skb is shot by police */
64#define NET_XMIT_BYPASS 4 /* packet does not leave via dequeue; 64#define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */
65 (TC use only - dev_queue_xmit
66 returns this as NET_XMIT_SUCCESS) */
67 65
68/* Backlog congestion levels */ 66/* Backlog congestion levels */
69#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 67#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
@@ -440,6 +438,7 @@ static inline void napi_synchronize(const struct napi_struct *n)
440enum netdev_queue_state_t 438enum netdev_queue_state_t
441{ 439{
442 __QUEUE_STATE_XOFF, 440 __QUEUE_STATE_XOFF,
441 __QUEUE_STATE_FROZEN,
443}; 442};
444 443
445struct netdev_queue { 444struct netdev_queue {
@@ -636,7 +635,7 @@ struct net_device
636 unsigned int real_num_tx_queues; 635 unsigned int real_num_tx_queues;
637 636
638 unsigned long tx_queue_len; /* Max frames per queue allowed */ 637 unsigned long tx_queue_len; /* Max frames per queue allowed */
639 638 spinlock_t tx_global_lock;
640/* 639/*
641 * One part is mostly used on xmit path (device) 640 * One part is mostly used on xmit path (device)
642 */ 641 */
@@ -1099,6 +1098,11 @@ static inline int netif_queue_stopped(const struct net_device *dev)
1099 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); 1098 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1100} 1099}
1101 1100
1101static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue)
1102{
1103 return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state);
1104}
1105
1102/** 1106/**
1103 * netif_running - test if up 1107 * netif_running - test if up
1104 * @dev: network device 1108 * @dev: network device
@@ -1475,6 +1479,26 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
1475 txq->xmit_lock_owner = smp_processor_id(); 1479 txq->xmit_lock_owner = smp_processor_id();
1476} 1480}
1477 1481
1482static inline int __netif_tx_trylock(struct netdev_queue *txq)
1483{
1484 int ok = spin_trylock(&txq->_xmit_lock);
1485 if (likely(ok))
1486 txq->xmit_lock_owner = smp_processor_id();
1487 return ok;
1488}
1489
1490static inline void __netif_tx_unlock(struct netdev_queue *txq)
1491{
1492 txq->xmit_lock_owner = -1;
1493 spin_unlock(&txq->_xmit_lock);
1494}
1495
1496static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
1497{
1498 txq->xmit_lock_owner = -1;
1499 spin_unlock_bh(&txq->_xmit_lock);
1500}
1501
1478/** 1502/**
1479 * netif_tx_lock - grab network device transmit lock 1503 * netif_tx_lock - grab network device transmit lock
1480 * @dev: network device 1504 * @dev: network device
@@ -1484,12 +1508,23 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
1484 */ 1508 */
1485static inline void netif_tx_lock(struct net_device *dev) 1509static inline void netif_tx_lock(struct net_device *dev)
1486{ 1510{
1487 int cpu = smp_processor_id();
1488 unsigned int i; 1511 unsigned int i;
1512 int cpu;
1489 1513
1514 spin_lock(&dev->tx_global_lock);
1515 cpu = smp_processor_id();
1490 for (i = 0; i < dev->num_tx_queues; i++) { 1516 for (i = 0; i < dev->num_tx_queues; i++) {
1491 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); 1517 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1518
1519 /* We are the only thread of execution doing a
1520 * freeze, but we have to grab the _xmit_lock in
1521 * order to synchronize with threads which are in
1522 * the ->hard_start_xmit() handler and already
1523 * checked the frozen bit.
1524 */
1492 __netif_tx_lock(txq, cpu); 1525 __netif_tx_lock(txq, cpu);
1526 set_bit(__QUEUE_STATE_FROZEN, &txq->state);
1527 __netif_tx_unlock(txq);
1493 } 1528 }
1494} 1529}
1495 1530
@@ -1499,40 +1534,22 @@ static inline void netif_tx_lock_bh(struct net_device *dev)
1499 netif_tx_lock(dev); 1534 netif_tx_lock(dev);
1500} 1535}
1501 1536
1502static inline int __netif_tx_trylock(struct netdev_queue *txq)
1503{
1504 int ok = spin_trylock(&txq->_xmit_lock);
1505 if (likely(ok))
1506 txq->xmit_lock_owner = smp_processor_id();
1507 return ok;
1508}
1509
1510static inline int netif_tx_trylock(struct net_device *dev)
1511{
1512 return __netif_tx_trylock(netdev_get_tx_queue(dev, 0));
1513}
1514
1515static inline void __netif_tx_unlock(struct netdev_queue *txq)
1516{
1517 txq->xmit_lock_owner = -1;
1518 spin_unlock(&txq->_xmit_lock);
1519}
1520
1521static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
1522{
1523 txq->xmit_lock_owner = -1;
1524 spin_unlock_bh(&txq->_xmit_lock);
1525}
1526
1527static inline void netif_tx_unlock(struct net_device *dev) 1537static inline void netif_tx_unlock(struct net_device *dev)
1528{ 1538{
1529 unsigned int i; 1539 unsigned int i;
1530 1540
1531 for (i = 0; i < dev->num_tx_queues; i++) { 1541 for (i = 0; i < dev->num_tx_queues; i++) {
1532 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); 1542 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1533 __netif_tx_unlock(txq);
1534 }
1535 1543
1544 /* No need to grab the _xmit_lock here. If the
1545 * queue is not stopped for another reason, we
1546 * force a schedule.
1547 */
1548 clear_bit(__QUEUE_STATE_FROZEN, &txq->state);
1549 if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
1550 __netif_schedule(txq->qdisc);
1551 }
1552 spin_unlock(&dev->tx_global_lock);
1536} 1553}
1537 1554
1538static inline void netif_tx_unlock_bh(struct net_device *dev) 1555static inline void netif_tx_unlock_bh(struct net_device *dev)
@@ -1556,13 +1573,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
1556static inline void netif_tx_disable(struct net_device *dev) 1573static inline void netif_tx_disable(struct net_device *dev)
1557{ 1574{
1558 unsigned int i; 1575 unsigned int i;
1576 int cpu;
1559 1577
1560 netif_tx_lock_bh(dev); 1578 local_bh_disable();
1579 cpu = smp_processor_id();
1561 for (i = 0; i < dev->num_tx_queues; i++) { 1580 for (i = 0; i < dev->num_tx_queues; i++) {
1562 struct netdev_queue *txq = netdev_get_tx_queue(dev, i); 1581 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1582
1583 __netif_tx_lock(txq, cpu);
1563 netif_tx_stop_queue(txq); 1584 netif_tx_stop_queue(txq);
1585 __netif_tx_unlock(txq);
1564 } 1586 }
1565 netif_tx_unlock_bh(dev); 1587 local_bh_enable();
1566} 1588}
1567 1589
1568static inline void netif_addr_lock(struct net_device *dev) 1590static inline void netif_addr_lock(struct net_device *dev)
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 22ce29995f13..a049df4f2236 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -30,6 +30,9 @@ enum tcp_conntrack {
30/* Be liberal in window checking */ 30/* Be liberal in window checking */
31#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 31#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
32 32
33/* Has unacknowledged data */
34#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
35
33struct nf_ct_tcp_flags { 36struct nf_ct_tcp_flags {
34 u_int8_t flags; 37 u_int8_t flags;
35 u_int8_t mask; 38 u_int8_t mask;
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 54590a9a103e..c74d3e875314 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -163,7 +163,7 @@ static inline int Page##uname(struct page *page) \
163 163
164struct page; /* forward declaration */ 164struct page; /* forward declaration */
165 165
166PAGEFLAG(Locked, locked) TESTSCFLAG(Locked, locked) 166TESTPAGEFLAG(Locked, locked)
167PAGEFLAG(Error, error) 167PAGEFLAG(Error, error)
168PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) 168PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced)
169PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) 169PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty)
@@ -239,9 +239,6 @@ static inline void __SetPageUptodate(struct page *page)
239{ 239{
240 smp_wmb(); 240 smp_wmb();
241 __set_bit(PG_uptodate, &(page)->flags); 241 __set_bit(PG_uptodate, &(page)->flags);
242#ifdef CONFIG_S390
243 page_clear_dirty(page);
244#endif
245} 242}
246 243
247static inline void SetPageUptodate(struct page *page) 244static inline void SetPageUptodate(struct page *page)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index a39b38ccdc97..5da31c12101c 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -143,6 +143,29 @@ static inline int page_cache_get_speculative(struct page *page)
143 return 1; 143 return 1;
144} 144}
145 145
146/*
147 * Same as above, but add instead of inc (could just be merged)
148 */
149static inline int page_cache_add_speculative(struct page *page, int count)
150{
151 VM_BUG_ON(in_interrupt());
152
153#if !defined(CONFIG_SMP) && defined(CONFIG_CLASSIC_RCU)
154# ifdef CONFIG_PREEMPT
155 VM_BUG_ON(!in_atomic());
156# endif
157 VM_BUG_ON(page_count(page) == 0);
158 atomic_add(count, &page->_count);
159
160#else
161 if (unlikely(!atomic_add_unless(&page->_count, count, 0)))
162 return 0;
163#endif
164 VM_BUG_ON(PageCompound(page) && page != compound_head(page));
165
166 return 1;
167}
168
146static inline int page_freeze_refs(struct page *page, int count) 169static inline int page_freeze_refs(struct page *page, int count)
147{ 170{
148 return likely(atomic_cmpxchg(&page->_count, count, 0) == count); 171 return likely(atomic_cmpxchg(&page->_count, count, 0) == count);
@@ -227,29 +250,6 @@ static inline struct page *read_mapping_page(struct address_space *mapping,
227 return read_cache_page(mapping, index, filler, data); 250 return read_cache_page(mapping, index, filler, data);
228} 251}
229 252
230int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
231 pgoff_t index, gfp_t gfp_mask);
232int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
233 pgoff_t index, gfp_t gfp_mask);
234extern void remove_from_page_cache(struct page *page);
235extern void __remove_from_page_cache(struct page *page);
236
237/*
238 * Like add_to_page_cache_locked, but used to add newly allocated pages:
239 * the page is new, so we can just run SetPageLocked() against it.
240 */
241static inline int add_to_page_cache(struct page *page,
242 struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask)
243{
244 int error;
245
246 SetPageLocked(page);
247 error = add_to_page_cache_locked(page, mapping, offset, gfp_mask);
248 if (unlikely(error))
249 ClearPageLocked(page);
250 return error;
251}
252
253/* 253/*
254 * Return byte-offset into filesystem object for page. 254 * Return byte-offset into filesystem object for page.
255 */ 255 */
@@ -271,13 +271,28 @@ extern int __lock_page_killable(struct page *page);
271extern void __lock_page_nosync(struct page *page); 271extern void __lock_page_nosync(struct page *page);
272extern void unlock_page(struct page *page); 272extern void unlock_page(struct page *page);
273 273
274static inline void set_page_locked(struct page *page)
275{
276 set_bit(PG_locked, &page->flags);
277}
278
279static inline void clear_page_locked(struct page *page)
280{
281 clear_bit(PG_locked, &page->flags);
282}
283
284static inline int trylock_page(struct page *page)
285{
286 return !test_and_set_bit(PG_locked, &page->flags);
287}
288
274/* 289/*
275 * lock_page may only be called if we have the page's inode pinned. 290 * lock_page may only be called if we have the page's inode pinned.
276 */ 291 */
277static inline void lock_page(struct page *page) 292static inline void lock_page(struct page *page)
278{ 293{
279 might_sleep(); 294 might_sleep();
280 if (TestSetPageLocked(page)) 295 if (!trylock_page(page))
281 __lock_page(page); 296 __lock_page(page);
282} 297}
283 298
@@ -289,7 +304,7 @@ static inline void lock_page(struct page *page)
289static inline int lock_page_killable(struct page *page) 304static inline int lock_page_killable(struct page *page)
290{ 305{
291 might_sleep(); 306 might_sleep();
292 if (TestSetPageLocked(page)) 307 if (!trylock_page(page))
293 return __lock_page_killable(page); 308 return __lock_page_killable(page);
294 return 0; 309 return 0;
295} 310}
@@ -301,7 +316,7 @@ static inline int lock_page_killable(struct page *page)
301static inline void lock_page_nosync(struct page *page) 316static inline void lock_page_nosync(struct page *page)
302{ 317{
303 might_sleep(); 318 might_sleep();
304 if (TestSetPageLocked(page)) 319 if (!trylock_page(page))
305 __lock_page_nosync(page); 320 __lock_page_nosync(page);
306} 321}
307 322
@@ -386,4 +401,27 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size)
386 return ret; 401 return ret;
387} 402}
388 403
404int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
405 pgoff_t index, gfp_t gfp_mask);
406int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
407 pgoff_t index, gfp_t gfp_mask);
408extern void remove_from_page_cache(struct page *page);
409extern void __remove_from_page_cache(struct page *page);
410
411/*
412 * Like add_to_page_cache_locked, but used to add newly allocated pages:
413 * the page is new, so we can just run set_page_locked() against it.
414 */
415static inline int add_to_page_cache(struct page *page,
416 struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask)
417{
418 int error;
419
420 set_page_locked(page);
421 error = add_to_page_cache_locked(page, mapping, offset, gfp_mask);
422 if (unlikely(error))
423 clear_page_locked(page);
424 return error;
425}
426
389#endif /* _LINUX_PAGEMAP_H */ 427#endif /* _LINUX_PAGEMAP_H */
diff --git a/include/linux/parser.h b/include/linux/parser.h
index cc554ca8bc78..7dcd05075756 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -14,7 +14,7 @@ struct match_token {
14 const char *pattern; 14 const char *pattern;
15}; 15};
16 16
17typedef const struct match_token match_table_t[]; 17typedef struct match_token match_table_t[];
18 18
19/* Maximum number of arguments that match_token will find in a pattern */ 19/* Maximum number of arguments that match_token will find in a pattern */
20enum {MAX_OPT_ARGS = 3}; 20enum {MAX_OPT_ARGS = 3};
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 825be3878f68..c0e14008a3c2 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -641,6 +641,7 @@ int pci_restore_state(struct pci_dev *dev);
641int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 641int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
642pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 642pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
643bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 643bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
644void pci_pme_active(struct pci_dev *dev, bool enable);
644int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 645int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);
645pci_power_t pci_target_state(struct pci_dev *dev); 646pci_power_t pci_target_state(struct pci_dev *dev);
646int pci_prepare_to_sleep(struct pci_dev *dev); 647int pci_prepare_to_sleep(struct pci_dev *dev);
@@ -680,10 +681,12 @@ void pci_enable_bridges(struct pci_bus *bus);
680/* Proper probing supporting hot-pluggable devices */ 681/* Proper probing supporting hot-pluggable devices */
681int __must_check __pci_register_driver(struct pci_driver *, struct module *, 682int __must_check __pci_register_driver(struct pci_driver *, struct module *,
682 const char *mod_name); 683 const char *mod_name);
683static inline int __must_check pci_register_driver(struct pci_driver *driver) 684
684{ 685/*
685 return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 686 * pci_register_driver must be a macro so that KBUILD_MODNAME can be expanded
686} 687 */
688#define pci_register_driver(driver) \
689 __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
687 690
688void pci_unregister_driver(struct pci_driver *dev); 691void pci_unregister_driver(struct pci_driver *dev);
689void pci_remove_behind_bridge(struct pci_dev *dev); 692void pci_remove_behind_bridge(struct pci_dev *dev);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 35a78415accc..9ec2bcce8e83 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2177,8 +2177,6 @@
2177#define PCI_DEVICE_ID_HERC_WIN 0x5732 2177#define PCI_DEVICE_ID_HERC_WIN 0x5732
2178#define PCI_DEVICE_ID_HERC_UNI 0x5832 2178#define PCI_DEVICE_ID_HERC_UNI 0x5832
2179 2179
2180#define PCI_VENDOR_ID_RDC 0x17f3
2181
2182#define PCI_VENDOR_ID_SITECOM 0x182d 2180#define PCI_VENDOR_ID_SITECOM 0x182d
2183#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 2181#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
2184 2182
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
index 2e4e97bd19f7..d74f75ed1e47 100644
--- a/include/linux/pm_qos_params.h
+++ b/include/linux/pm_qos_params.h
@@ -1,6 +1,6 @@
1/* interface for the pm_qos_power infrastructure of the linux kernel. 1/* interface for the pm_qos_power infrastructure of the linux kernel.
2 * 2 *
3 * Mark Gross 3 * Mark Gross <mgross@linux.intel.com>
4 */ 4 */
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/notifier.h> 6#include <linux/notifier.h>
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 68ed19ccf1f7..ea96ead1d39d 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -78,6 +78,7 @@ enum power_supply_property {
78 POWER_SUPPLY_PROP_CHARGE_EMPTY, 78 POWER_SUPPLY_PROP_CHARGE_EMPTY,
79 POWER_SUPPLY_PROP_CHARGE_NOW, 79 POWER_SUPPLY_PROP_CHARGE_NOW,
80 POWER_SUPPLY_PROP_CHARGE_AVG, 80 POWER_SUPPLY_PROP_CHARGE_AVG,
81 POWER_SUPPLY_PROP_CHARGE_COUNTER,
81 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 82 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
82 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 83 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
83 POWER_SUPPLY_PROP_ENERGY_FULL, 84 POWER_SUPPLY_PROP_ENERGY_FULL,
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index fd31756e1a00..ea7416c901d1 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -172,7 +172,7 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
172 child->ptrace = 0; 172 child->ptrace = 0;
173 if (unlikely(ptrace)) { 173 if (unlikely(ptrace)) {
174 child->ptrace = current->ptrace; 174 child->ptrace = current->ptrace;
175 __ptrace_link(child, current->parent); 175 ptrace_link(child, current->parent);
176 } 176 }
177} 177}
178 178
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 742187f7a05c..ca6b9b5c8d52 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -43,6 +43,8 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
43 43
44int vfs_quota_on(struct super_block *sb, int type, int format_id, 44int vfs_quota_on(struct super_block *sb, int type, int format_id,
45 char *path, int remount); 45 char *path, int remount);
46int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
47 struct path *path);
46int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 48int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
47 int format_id, int type); 49 int format_id, int type);
48int vfs_quota_off(struct super_block *sb, int type, int remount); 50int vfs_quota_off(struct super_block *sb, int type, int remount);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 9f2549ac0e2d..c200b9a34aff 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -128,6 +128,7 @@ struct mddev_s
128#define MD_CHANGE_DEVS 0 /* Some device status has changed */ 128#define MD_CHANGE_DEVS 0 /* Some device status has changed */
129#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ 129#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */
130#define MD_CHANGE_PENDING 2 /* superblock update in progress */ 130#define MD_CHANGE_PENDING 2 /* superblock update in progress */
131#define MD_NOTIFY_ARRAY_STATE 3 /* atomic context wants to notify userspace */
131 132
132 int ro; 133 int ro;
133 134
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h
index 8c774905dcfe..4ab843622727 100644
--- a/include/linux/rcuclassic.h
+++ b/include/linux/rcuclassic.h
@@ -117,7 +117,7 @@ extern int rcu_needs_cpu(int cpu);
117#ifdef CONFIG_DEBUG_LOCK_ALLOC 117#ifdef CONFIG_DEBUG_LOCK_ALLOC
118extern struct lockdep_map rcu_lock_map; 118extern struct lockdep_map rcu_lock_map;
119# define rcu_read_acquire() \ 119# define rcu_read_acquire() \
120 lock_acquire(&rcu_lock_map, 0, 0, 2, 1, _THIS_IP_) 120 lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
121# define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) 121# define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_)
122#else 122#else
123# define rcu_read_acquire() do { } while (0) 123# define rcu_read_acquire() do { } while (0)
diff --git a/include/linux/regulator/bq24022.h b/include/linux/regulator/bq24022.h
new file mode 100644
index 000000000000..e84b0a9feda5
--- /dev/null
+++ b/include/linux/regulator/bq24022.h
@@ -0,0 +1,21 @@
1/*
2 * Support for TI bq24022 (bqTINY-II) Dual Input (USB/AC Adpater)
3 * 1-Cell Li-Ion Charger connected via GPIOs.
4 *
5 * Copyright (c) 2008 Philipp Zabel
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13/**
14 * bq24022_mach_info - platform data for bq24022
15 * @gpio_nce: GPIO line connected to the nCE pin, used to enable / disable charging
16 * @gpio_iset2: GPIO line connected to the ISET2 pin, used to limit charging current to 100 mA / 500 mA
17 */
18struct bq24022_mach_info {
19 int gpio_nce;
20 int gpio_iset2;
21};
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
new file mode 100644
index 000000000000..afdc4558bb94
--- /dev/null
+++ b/include/linux/regulator/consumer.h
@@ -0,0 +1,284 @@
1/*
2 * consumer.h -- SoC Regulator consumer support.
3 *
4 * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Liam Girdwood <lg@opensource.wolfsonmicro.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Regulator Consumer Interface.
13 *
14 * A Power Management Regulator framework for SoC based devices.
15 * Features:-
16 * o Voltage and current level control.
17 * o Operating mode control.
18 * o Regulator status.
19 * o sysfs entries for showing client devices and status
20 *
21 * EXPERIMENTAL FEATURES:
22 * Dynamic Regulator operating Mode Switching (DRMS) - allows regulators
23 * to use most efficient operating mode depending upon voltage and load and
24 * is transparent to client drivers.
25 *
26 * e.g. Devices x,y,z share regulator r. Device x and y draw 20mA each during
27 * IO and 1mA at idle. Device z draws 100mA when under load and 5mA when
28 * idling. Regulator r has > 90% efficiency in NORMAL mode at loads > 100mA
29 * but this drops rapidly to 60% when below 100mA. Regulator r has > 90%
30 * efficiency in IDLE mode at loads < 10mA. Thus regulator r will operate
31 * in normal mode for loads > 10mA and in IDLE mode for load <= 10mA.
32 *
33 */
34
35#ifndef __LINUX_REGULATOR_CONSUMER_H_
36#define __LINUX_REGULATOR_CONSUMER_H_
37
38/*
39 * Regulator operating modes.
40 *
41 * Regulators can run in a variety of different operating modes depending on
42 * output load. This allows further system power savings by selecting the
43 * best (and most efficient) regulator mode for a desired load.
44 *
45 * Most drivers will only care about NORMAL. The modes below are generic and
46 * will probably not match the naming convention of your regulator data sheet
47 * but should match the use cases in the datasheet.
48 *
49 * In order of power efficiency (least efficient at top).
50 *
51 * Mode Description
52 * FAST Regulator can handle fast changes in it's load.
53 * e.g. useful in CPU voltage & frequency scaling where
54 * load can quickly increase with CPU frequency increases.
55 *
56 * NORMAL Normal regulator power supply mode. Most drivers will
57 * use this mode.
58 *
59 * IDLE Regulator runs in a more efficient mode for light
60 * loads. Can be used for devices that have a low power
61 * requirement during periods of inactivity. This mode
62 * may be more noisy than NORMAL and may not be able
63 * to handle fast load switching.
64 *
65 * STANDBY Regulator runs in the most efficient mode for very
66 * light loads. Can be used by devices when they are
67 * in a sleep/standby state. This mode is likely to be
68 * the most noisy and may not be able to handle fast load
69 * switching.
70 *
71 * NOTE: Most regulators will only support a subset of these modes. Some
72 * will only just support NORMAL.
73 *
74 * These modes can be OR'ed together to make up a mask of valid register modes.
75 */
76
77#define REGULATOR_MODE_FAST 0x1
78#define REGULATOR_MODE_NORMAL 0x2
79#define REGULATOR_MODE_IDLE 0x4
80#define REGULATOR_MODE_STANDBY 0x8
81
82/*
83 * Regulator notifier events.
84 *
85 * UNDER_VOLTAGE Regulator output is under voltage.
86 * OVER_CURRENT Regulator output current is too high.
87 * REGULATION_OUT Regulator output is out of regulation.
88 * FAIL Regulator output has failed.
89 * OVER_TEMP Regulator over temp.
90 * FORCE_DISABLE Regulator shut down by software.
91 *
92 * NOTE: These events can be OR'ed together when passed into handler.
93 */
94
95#define REGULATOR_EVENT_UNDER_VOLTAGE 0x01
96#define REGULATOR_EVENT_OVER_CURRENT 0x02
97#define REGULATOR_EVENT_REGULATION_OUT 0x04
98#define REGULATOR_EVENT_FAIL 0x08
99#define REGULATOR_EVENT_OVER_TEMP 0x10
100#define REGULATOR_EVENT_FORCE_DISABLE 0x20
101
102struct regulator;
103
104/**
105 * struct regulator_bulk_data - Data used for bulk regulator operations.
106 *
107 * @supply The name of the supply. Initialised by the user before
108 * using the bulk regulator APIs.
109 * @consumer The regulator consumer for the supply. This will be managed
110 * by the bulk API.
111 *
112 * The regulator APIs provide a series of regulator_bulk_() API calls as
113 * a convenience to consumers which require multiple supplies. This
114 * structure is used to manage data for these calls.
115 */
116struct regulator_bulk_data {
117 const char *supply;
118 struct regulator *consumer;
119};
120
121#if defined(CONFIG_REGULATOR)
122
123/* regulator get and put */
124struct regulator *__must_check regulator_get(struct device *dev,
125 const char *id);
126void regulator_put(struct regulator *regulator);
127
128/* regulator output control and status */
129int regulator_enable(struct regulator *regulator);
130int regulator_disable(struct regulator *regulator);
131int regulator_force_disable(struct regulator *regulator);
132int regulator_is_enabled(struct regulator *regulator);
133
134int regulator_bulk_get(struct device *dev, int num_consumers,
135 struct regulator_bulk_data *consumers);
136int regulator_bulk_enable(int num_consumers,
137 struct regulator_bulk_data *consumers);
138int regulator_bulk_disable(int num_consumers,
139 struct regulator_bulk_data *consumers);
140void regulator_bulk_free(int num_consumers,
141 struct regulator_bulk_data *consumers);
142
143int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
144int regulator_get_voltage(struct regulator *regulator);
145int regulator_set_current_limit(struct regulator *regulator,
146 int min_uA, int max_uA);
147int regulator_get_current_limit(struct regulator *regulator);
148
149int regulator_set_mode(struct regulator *regulator, unsigned int mode);
150unsigned int regulator_get_mode(struct regulator *regulator);
151int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
152
153/* regulator notifier block */
154int regulator_register_notifier(struct regulator *regulator,
155 struct notifier_block *nb);
156int regulator_unregister_notifier(struct regulator *regulator,
157 struct notifier_block *nb);
158
159/* driver data - core doesn't touch */
160void *regulator_get_drvdata(struct regulator *regulator);
161void regulator_set_drvdata(struct regulator *regulator, void *data);
162
163#else
164
165/*
166 * Make sure client drivers will still build on systems with no software
167 * controllable voltage or current regulators.
168 */
169static inline struct regulator *__must_check regulator_get(struct device *dev,
170 const char *id)
171{
172 /* Nothing except the stubbed out regulator API should be
173 * looking at the value except to check if it is an error
174 * value so the actual return value doesn't matter.
175 */
176 return (struct regulator *)id;
177}
178static inline void regulator_put(struct regulator *regulator)
179{
180}
181
182static inline int regulator_enable(struct regulator *regulator)
183{
184 return 0;
185}
186
187static inline int regulator_disable(struct regulator *regulator)
188{
189 return 0;
190}
191
192static inline int regulator_is_enabled(struct regulator *regulator)
193{
194 return 1;
195}
196
197static inline int regulator_bulk_get(struct device *dev,
198 int num_consumers,
199 struct regulator_bulk_data *consumers)
200{
201 return 0;
202}
203
204static inline int regulator_bulk_enable(int num_consumers,
205 struct regulator_bulk_data *consumers)
206{
207 return 0;
208}
209
210static inline int regulator_bulk_disable(int num_consumers,
211 struct regulator_bulk_data *consumers)
212{
213 return 0;
214}
215
216static inline void regulator_bulk_free(int num_consumers,
217 struct regulator_bulk_data *consumers)
218{
219}
220
221static inline int regulator_set_voltage(struct regulator *regulator,
222 int min_uV, int max_uV)
223{
224 return 0;
225}
226
227static inline int regulator_get_voltage(struct regulator *regulator)
228{
229 return 0;
230}
231
232static inline int regulator_set_current_limit(struct regulator *regulator,
233 int min_uA, int max_uA)
234{
235 return 0;
236}
237
238static inline int regulator_get_current_limit(struct regulator *regulator)
239{
240 return 0;
241}
242
243static inline int regulator_set_mode(struct regulator *regulator,
244 unsigned int mode)
245{
246 return 0;
247}
248
249static inline unsigned int regulator_get_mode(struct regulator *regulator)
250{
251 return REGULATOR_MODE_NORMAL;
252}
253
254static inline int regulator_set_optimum_mode(struct regulator *regulator,
255 int load_uA)
256{
257 return REGULATOR_MODE_NORMAL;
258}
259
260static inline int regulator_register_notifier(struct regulator *regulator,
261 struct notifier_block *nb)
262{
263 return 0;
264}
265
266static inline int regulator_unregister_notifier(struct regulator *regulator,
267 struct notifier_block *nb)
268{
269 return 0;
270}
271
272static inline void *regulator_get_drvdata(struct regulator *regulator)
273{
274 return NULL;
275}
276
277static inline void regulator_set_drvdata(struct regulator *regulator,
278 void *data)
279{
280}
281
282#endif
283
284#endif
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
new file mode 100644
index 000000000000..1d712c7172a2
--- /dev/null
+++ b/include/linux/regulator/driver.h
@@ -0,0 +1,99 @@
1/*
2 * driver.h -- SoC Regulator driver support.
3 *
4 * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Liam Girdwood <lg@opensource.wolfsonmicro.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Regulator Driver Interface.
13 */
14
15#ifndef __LINUX_REGULATOR_DRIVER_H_
16#define __LINUX_REGULATOR_DRIVER_H_
17
18#include <linux/device.h>
19#include <linux/regulator/consumer.h>
20
21struct regulator_constraints;
22struct regulator_dev;
23
24/**
25 * struct regulator_ops - regulator operations.
26 *
27 * This struct describes regulator operations.
28 */
29struct regulator_ops {
30
31 /* get/set regulator voltage */
32 int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV);
33 int (*get_voltage) (struct regulator_dev *);
34
35 /* get/set regulator current */
36 int (*set_current_limit) (struct regulator_dev *,
37 int min_uA, int max_uA);
38 int (*get_current_limit) (struct regulator_dev *);
39
40 /* enable/disable regulator */
41 int (*enable) (struct regulator_dev *);
42 int (*disable) (struct regulator_dev *);
43 int (*is_enabled) (struct regulator_dev *);
44
45 /* get/set regulator operating mode (defined in regulator.h) */
46 int (*set_mode) (struct regulator_dev *, unsigned int mode);
47 unsigned int (*get_mode) (struct regulator_dev *);
48
49 /* get most efficient regulator operating mode for load */
50 unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV,
51 int output_uV, int load_uA);
52
53 /* the operations below are for configuration of regulator state when
54 * it's parent PMIC enters a global STANBY/HIBERNATE state */
55
56 /* set regulator suspend voltage */
57 int (*set_suspend_voltage) (struct regulator_dev *, int uV);
58
59 /* enable/disable regulator in suspend state */
60 int (*set_suspend_enable) (struct regulator_dev *);
61 int (*set_suspend_disable) (struct regulator_dev *);
62
63 /* set regulator suspend operating mode (defined in regulator.h) */
64 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
65};
66
67/*
68 * Regulators can either control voltage or current.
69 */
70enum regulator_type {
71 REGULATOR_VOLTAGE,
72 REGULATOR_CURRENT,
73};
74
75/**
76 * struct regulator_desc - Regulator descriptor
77 *
78 */
79struct regulator_desc {
80 const char *name;
81 int id;
82 struct regulator_ops *ops;
83 int irq;
84 enum regulator_type type;
85 struct module *owner;
86};
87
88
89struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
90 void *reg_data);
91void regulator_unregister(struct regulator_dev *rdev);
92
93int regulator_notifier_call_chain(struct regulator_dev *rdev,
94 unsigned long event, void *data);
95
96void *rdev_get_drvdata(struct regulator_dev *rdev);
97int rdev_get_id(struct regulator_dev *rdev);
98
99#endif
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
new file mode 100644
index 000000000000..1387a5d2190e
--- /dev/null
+++ b/include/linux/regulator/fixed.h
@@ -0,0 +1,22 @@
1/*
2 * fixed.h
3 *
4 * Copyright 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
12 */
13
14#ifndef __REGULATOR_FIXED_H
15#define __REGULATOR_FIXED_H
16
17struct fixed_voltage_config {
18 const char *supply_name;
19 int microvolts;
20};
21
22#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
new file mode 100644
index 000000000000..11e737dbfcf2
--- /dev/null
+++ b/include/linux/regulator/machine.h
@@ -0,0 +1,104 @@
1/*
2 * machine.h -- SoC Regulator support, machine/board driver API.
3 *
4 * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
5 *
6 * Author: Liam Girdwood <lg@opensource.wolfsonmicro.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 version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Regulator Machine/Board Interface.
13 */
14
15#ifndef __LINUX_REGULATOR_MACHINE_H_
16#define __LINUX_REGULATOR_MACHINE_H_
17
18#include <linux/regulator/consumer.h>
19#include <linux/suspend.h>
20
21struct regulator;
22
23/*
24 * Regulator operation constraint flags. These flags are used to enable
25 * certain regulator operations and can be OR'ed together.
26 *
27 * VOLTAGE: Regulator output voltage can be changed by software on this
28 * board/machine.
29 * CURRENT: Regulator output current can be changed by software on this
30 * board/machine.
31 * MODE: Regulator operating mode can be changed by software on this
32 * board/machine.
33 * STATUS: Regulator can be enabled and disabled.
34 * DRMS: Dynamic Regulator Mode Switching is enabled for this regulator.
35 */
36
37#define REGULATOR_CHANGE_VOLTAGE 0x1
38#define REGULATOR_CHANGE_CURRENT 0x2
39#define REGULATOR_CHANGE_MODE 0x4
40#define REGULATOR_CHANGE_STATUS 0x8
41#define REGULATOR_CHANGE_DRMS 0x10
42
43/**
44 * struct regulator_state - regulator state during low power syatem states
45 *
46 * This describes a regulators state during a system wide low power state.
47 */
48struct regulator_state {
49 int uV; /* suspend voltage */
50 unsigned int mode; /* suspend regulator operating mode */
51 int enabled; /* is regulator enabled in this suspend state */
52};
53
54/**
55 * struct regulation_constraints - regulator operating constraints.
56 *
57 * This struct describes regulator and board/machine specific constraints.
58 */
59struct regulation_constraints {
60
61 char *name;
62
63 /* voltage output range (inclusive) - for voltage control */
64 int min_uV;
65 int max_uV;
66
67 /* current output range (inclusive) - for current control */
68 int min_uA;
69 int max_uA;
70
71 /* valid regulator operating modes for this machine */
72 unsigned int valid_modes_mask;
73
74 /* valid operations for regulator on this machine */
75 unsigned int valid_ops_mask;
76
77 /* regulator input voltage - only if supply is another regulator */
78 int input_uV;
79
80 /* regulator suspend states for global PMIC STANDBY/HIBERNATE */
81 struct regulator_state state_disk;
82 struct regulator_state state_mem;
83 struct regulator_state state_standby;
84 suspend_state_t initial_state; /* suspend state to set at init */
85
86 /* constriant flags */
87 unsigned always_on:1; /* regulator never off when system is on */
88 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
89 unsigned apply_uV:1; /* apply uV constraint iff min == max */
90};
91
92int regulator_set_supply(const char *regulator, const char *regulator_supply);
93
94const char *regulator_get_supply(const char *regulator);
95
96int regulator_set_machine_constraints(const char *regulator,
97 struct regulation_constraints *constraints);
98
99int regulator_set_device_supply(const char *regulator, struct device *dev,
100 const char *supply);
101
102int regulator_suspend_prepare(suspend_state_t state);
103
104#endif
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index c5f6e54ec6ae..741d1a62cc3f 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -68,7 +68,8 @@ enum rfkill_state {
68 * @user_claim_unsupported: Whether the hardware supports exclusive 68 * @user_claim_unsupported: Whether the hardware supports exclusive
69 * RF-kill control by userspace. Set this before registering. 69 * RF-kill control by userspace. Set this before registering.
70 * @user_claim: Set when the switch is controlled exlusively by userspace. 70 * @user_claim: Set when the switch is controlled exlusively by userspace.
71 * @mutex: Guards switch state transitions 71 * @mutex: Guards switch state transitions. It serializes callbacks
72 * and also protects the state.
72 * @data: Pointer to the RF button drivers private data which will be 73 * @data: Pointer to the RF button drivers private data which will be
73 * passed along when toggling radio state. 74 * passed along when toggling radio state.
74 * @toggle_radio(): Mandatory handler to control state of the radio. 75 * @toggle_radio(): Mandatory handler to control state of the radio.
@@ -89,12 +90,13 @@ struct rfkill {
89 const char *name; 90 const char *name;
90 enum rfkill_type type; 91 enum rfkill_type type;
91 92
92 enum rfkill_state state;
93 bool user_claim_unsupported; 93 bool user_claim_unsupported;
94 bool user_claim; 94 bool user_claim;
95 95
96 /* the mutex serializes callbacks and also protects
97 * the state */
96 struct mutex mutex; 98 struct mutex mutex;
97 99 enum rfkill_state state;
98 void *data; 100 void *data;
99 int (*toggle_radio)(void *data, enum rfkill_state state); 101 int (*toggle_radio)(void *data, enum rfkill_state state);
100 int (*get_state)(void *data, enum rfkill_state *state); 102 int (*get_state)(void *data, enum rfkill_state *state);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5270d449ff9d..cfb0d87b99fc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -87,6 +87,7 @@ struct sched_param {
87#include <linux/task_io_accounting.h> 87#include <linux/task_io_accounting.h>
88#include <linux/kobject.h> 88#include <linux/kobject.h>
89#include <linux/latencytop.h> 89#include <linux/latencytop.h>
90#include <linux/cred.h>
90 91
91#include <asm/processor.h> 92#include <asm/processor.h>
92 93
@@ -1551,16 +1552,10 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1551 1552
1552extern unsigned long long sched_clock(void); 1553extern unsigned long long sched_clock(void);
1553 1554
1554#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK 1555extern void sched_clock_init(void);
1555static inline void sched_clock_init(void) 1556extern u64 sched_clock_cpu(int cpu);
1556{
1557}
1558
1559static inline u64 sched_clock_cpu(int cpu)
1560{
1561 return sched_clock();
1562}
1563 1557
1558#ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
1564static inline void sched_clock_tick(void) 1559static inline void sched_clock_tick(void)
1565{ 1560{
1566} 1561}
@@ -1572,28 +1567,11 @@ static inline void sched_clock_idle_sleep_event(void)
1572static inline void sched_clock_idle_wakeup_event(u64 delta_ns) 1567static inline void sched_clock_idle_wakeup_event(u64 delta_ns)
1573{ 1568{
1574} 1569}
1575 1570#else
1576#ifdef CONFIG_NO_HZ
1577static inline void sched_clock_tick_stop(int cpu)
1578{
1579}
1580
1581static inline void sched_clock_tick_start(int cpu)
1582{
1583}
1584#endif
1585
1586#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1587extern void sched_clock_init(void);
1588extern u64 sched_clock_cpu(int cpu);
1589extern void sched_clock_tick(void); 1571extern void sched_clock_tick(void);
1590extern void sched_clock_idle_sleep_event(void); 1572extern void sched_clock_idle_sleep_event(void);
1591extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1573extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1592#ifdef CONFIG_NO_HZ
1593extern void sched_clock_tick_stop(int cpu);
1594extern void sched_clock_tick_start(int cpu);
1595#endif 1574#endif
1596#endif /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */
1597 1575
1598/* 1576/*
1599 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu 1577 * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index a66304a09955..a1783b229ef4 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -4,6 +4,8 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/string.h> 5#include <linux/string.h>
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <linux/cpumask.h>
8#include <linux/nodemask.h>
7 9
8struct seq_operations; 10struct seq_operations;
9struct file; 11struct file;
@@ -47,6 +49,16 @@ int seq_path(struct seq_file *, struct path *, char *);
47int seq_dentry(struct seq_file *, struct dentry *, char *); 49int seq_dentry(struct seq_file *, struct dentry *, char *);
48int seq_path_root(struct seq_file *m, struct path *path, struct path *root, 50int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
49 char *esc); 51 char *esc);
52int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits);
53static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask)
54{
55 return seq_bitmap(m, mask->bits, NR_CPUS);
56}
57
58static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask)
59{
60 return seq_bitmap(m, mask->bits, MAX_NUMNODES);
61}
50 62
51int single_open(struct file *, int (*)(struct seq_file *, void *), void *); 63int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
52int single_release(struct inode *, struct file *); 64int single_release(struct inode *, struct file *);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7ea44f6621f2..358661c9990e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -243,6 +243,7 @@ typedef unsigned char *sk_buff_data_t;
243 * @tc_index: Traffic control index 243 * @tc_index: Traffic control index
244 * @tc_verd: traffic control verdict 244 * @tc_verd: traffic control verdict
245 * @ndisc_nodetype: router type (from link layer) 245 * @ndisc_nodetype: router type (from link layer)
246 * @do_not_encrypt: set to prevent encryption of this frame
246 * @dma_cookie: a cookie to one of several possible DMA operations 247 * @dma_cookie: a cookie to one of several possible DMA operations
247 * done by skb DMA functions 248 * done by skb DMA functions
248 * @secmark: security marking 249 * @secmark: security marking
@@ -316,7 +317,10 @@ struct sk_buff {
316#ifdef CONFIG_IPV6_NDISC_NODETYPE 317#ifdef CONFIG_IPV6_NDISC_NODETYPE
317 __u8 ndisc_nodetype:2; 318 __u8 ndisc_nodetype:2;
318#endif 319#endif
319 /* 14 bit hole */ 320#if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE)
321 __u8 do_not_encrypt:1;
322#endif
323 /* 0/13/14 bit hole */
320 324
321#ifdef CONFIG_NET_DMA 325#ifdef CONFIG_NET_DMA
322 dma_cookie_t dma_cookie; 326 dma_cookie_t dma_cookie;
@@ -897,7 +901,7 @@ extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta);
897static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) 901static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len)
898{ 902{
899 if (len > skb_headlen(skb) && 903 if (len > skb_headlen(skb) &&
900 !__pskb_pull_tail(skb, len-skb_headlen(skb))) 904 !__pskb_pull_tail(skb, len - skb_headlen(skb)))
901 return NULL; 905 return NULL;
902 skb->len -= len; 906 skb->len -= len;
903 return skb->data += len; 907 return skb->data += len;
@@ -914,7 +918,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
914 return 1; 918 return 1;
915 if (unlikely(len > skb->len)) 919 if (unlikely(len > skb->len))
916 return 0; 920 return 0;
917 return __pskb_pull_tail(skb, len-skb_headlen(skb)) != NULL; 921 return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL;
918} 922}
919 923
920/** 924/**
@@ -1317,7 +1321,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len)
1317 unsigned int size = skb->len; 1321 unsigned int size = skb->len;
1318 if (likely(size >= len)) 1322 if (likely(size >= len))
1319 return 0; 1323 return 0;
1320 return skb_pad(skb, len-size); 1324 return skb_pad(skb, len - size);
1321} 1325}
1322 1326
1323static inline int skb_add_data(struct sk_buff *skb, 1327static inline int skb_add_data(struct sk_buff *skb,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 5bad61a93f65..2f5c16b1aacd 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -46,6 +46,7 @@ struct kmem_cache_cpu {
46struct kmem_cache_node { 46struct kmem_cache_node {
47 spinlock_t list_lock; /* Protect partial list and nr_partial */ 47 spinlock_t list_lock; /* Protect partial list and nr_partial */
48 unsigned long nr_partial; 48 unsigned long nr_partial;
49 unsigned long min_partial;
49 struct list_head partial; 50 struct list_head partial;
50#ifdef CONFIG_SLUB_DEBUG 51#ifdef CONFIG_SLUB_DEBUG
51 atomic_long_t nr_slabs; 52 atomic_long_t nr_slabs;
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 5df62ef1280c..7a6e6bba4a71 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -214,6 +214,8 @@ enum
214 LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */ 214 LINUX_MIB_TCPDSACKIGNOREDOLD, /* TCPSACKIgnoredOld */
215 LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */ 215 LINUX_MIB_TCPDSACKIGNOREDNOUNDO, /* TCPSACKIgnoredNoUndo */
216 LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */ 216 LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */
217 LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */
218 LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */
217 __LINUX_MIB_MAX 219 __LINUX_MIB_MAX
218}; 220};
219 221
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
new file mode 100644
index 000000000000..b4d9fa6f797c
--- /dev/null
+++ b/include/linux/spi/orion_spi.h
@@ -0,0 +1,17 @@
1/*
2 * orion_spi.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __LINUX_SPI_ORION_SPI_H
10#define __LINUX_SPI_ORION_SPI_H
11
12struct orion_spi_info {
13 u32 tclk; /* no <linux/clk.h> support yet */
14};
15
16
17#endif
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 61e5610ad165..e0c0fccced46 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -183,8 +183,14 @@ do { \
183 183
184#ifdef CONFIG_DEBUG_LOCK_ALLOC 184#ifdef CONFIG_DEBUG_LOCK_ALLOC
185# define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass) 185# define spin_lock_nested(lock, subclass) _spin_lock_nested(lock, subclass)
186# define spin_lock_nest_lock(lock, nest_lock) \
187 do { \
188 typecheck(struct lockdep_map *, &(nest_lock)->dep_map);\
189 _spin_lock_nest_lock(lock, &(nest_lock)->dep_map); \
190 } while (0)
186#else 191#else
187# define spin_lock_nested(lock, subclass) _spin_lock(lock) 192# define spin_lock_nested(lock, subclass) _spin_lock(lock)
193# define spin_lock_nest_lock(lock, nest_lock) _spin_lock(lock)
188#endif 194#endif
189 195
190#define write_lock(lock) _write_lock(lock) 196#define write_lock(lock) _write_lock(lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 8a2307ce7296..d79845d034b5 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -22,6 +22,8 @@ int in_lock_functions(unsigned long addr);
22void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); 22void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
23void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) 23void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
24 __acquires(lock); 24 __acquires(lock);
25void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map)
26 __acquires(lock);
25void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); 27void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock);
26void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); 28void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock);
27void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); 29void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock);
diff --git a/include/linux/swab.h b/include/linux/swab.h
new file mode 100644
index 000000000000..270d5c208a89
--- /dev/null
+++ b/include/linux/swab.h
@@ -0,0 +1,309 @@
1#ifndef _LINUX_SWAB_H
2#define _LINUX_SWAB_H
3
4#include <linux/types.h>
5#include <linux/compiler.h>
6#include <asm/byteorder.h>
7
8/*
9 * casts are necessary for constants, because we never know how for sure
10 * how U/UL/ULL map to __u16, __u32, __u64. At least not in a portable way.
11 */
12#define __const_swab16(x) ((__u16)( \
13 (((__u16)(x) & (__u16)0x00ffU) << 8) | \
14 (((__u16)(x) & (__u16)0xff00U) >> 8)))
15
16#define __const_swab32(x) ((__u32)( \
17 (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
18 (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
19 (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
20 (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
21
22#define __const_swab64(x) ((__u64)( \
23 (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
24 (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
25 (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
26 (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
27 (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
28 (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
29 (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
30 (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
31
32#define __const_swahw32(x) ((__u32)( \
33 (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
34 (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
35
36#define __const_swahb32(x) ((__u32)( \
37 (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
38 (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
39
40/*
41 * Implement the following as inlines, but define the interface using
42 * macros to allow constant folding when possible:
43 * ___swab16, ___swab32, ___swab64, ___swahw32, ___swahb32
44 */
45
46static inline __attribute_const__ __u16 ___swab16(__u16 val)
47{
48#ifdef __arch_swab16
49 return __arch_swab16(val);
50#elif defined(__arch_swab16p)
51 return __arch_swab16p(&val);
52#else
53 return __const_swab16(val);
54#endif
55}
56
57static inline __attribute_const__ __u32 ___swab32(__u32 val)
58{
59#ifdef __arch_swab32
60 return __arch_swab32(val);
61#elif defined(__arch_swab32p)
62 return __arch_swab32p(&val);
63#else
64 return __const_swab32(val);
65#endif
66}
67
68static inline __attribute_const__ __u64 ___swab64(__u64 val)
69{
70#ifdef __arch_swab64
71 return __arch_swab64(val);
72#elif defined(__arch_swab64p)
73 return __arch_swab64p(&val);
74#elif defined(__SWAB_64_THRU_32__)
75 __u32 h = val >> 32;
76 __u32 l = val & ((1ULL << 32) - 1);
77 return (((__u64)___swab32(l)) << 32) | ((__u64)(___swab32(h)));
78#else
79 return __const_swab64(val);
80#endif
81}
82
83static inline __attribute_const__ __u32 ___swahw32(__u32 val)
84{
85#ifdef __arch_swahw32
86 return __arch_swahw32(val);
87#elif defined(__arch_swahw32p)
88 return __arch_swahw32p(&val);
89#else
90 return __const_swahw32(val);
91#endif
92}
93
94static inline __attribute_const__ __u32 ___swahb32(__u32 val)
95{
96#ifdef __arch_swahb32
97 return __arch_swahb32(val);
98#elif defined(__arch_swahb32p)
99 return __arch_swahb32p(&val);
100#else
101 return __const_swahb32(val);
102#endif
103}
104
105/**
106 * __swab16 - return a byteswapped 16-bit value
107 * @x: value to byteswap
108 */
109#define __swab16(x) \
110 (__builtin_constant_p((__u16)(x)) ? \
111 __const_swab16((x)) : \
112 ___swab16((x)))
113
114/**
115 * __swab32 - return a byteswapped 32-bit value
116 * @x: value to byteswap
117 */
118#define __swab32(x) \
119 (__builtin_constant_p((__u32)(x)) ? \
120 __const_swab32((x)) : \
121 ___swab32((x)))
122
123/**
124 * __swab64 - return a byteswapped 64-bit value
125 * @x: value to byteswap
126 */
127#define __swab64(x) \
128 (__builtin_constant_p((__u64)(x)) ? \
129 __const_swab64((x)) : \
130 ___swab64((x)))
131
132/**
133 * __swahw32 - return a word-swapped 32-bit value
134 * @x: value to wordswap
135 *
136 * __swahw32(0x12340000) is 0x00001234
137 */
138#define __swahw32(x) \
139 (__builtin_constant_p((__u32)(x)) ? \
140 __const_swahw32((x)) : \
141 ___swahw32((x)))
142
143/**
144 * __swahb32 - return a high and low byte-swapped 32-bit value
145 * @x: value to byteswap
146 *
147 * __swahb32(0x12345678) is 0x34127856
148 */
149#define __swahb32(x) \
150 (__builtin_constant_p((__u32)(x)) ? \
151 __const_swahb32((x)) : \
152 ___swahb32((x)))
153
154/**
155 * __swab16p - return a byteswapped 16-bit value from a pointer
156 * @p: pointer to a naturally-aligned 16-bit value
157 */
158static inline __u16 __swab16p(const __u16 *p)
159{
160#ifdef __arch_swab16p
161 return __arch_swab16p(p);
162#else
163 return __swab16(*p);
164#endif
165}
166
167/**
168 * __swab32p - return a byteswapped 32-bit value from a pointer
169 * @p: pointer to a naturally-aligned 32-bit value
170 */
171static inline __u32 __swab32p(const __u32 *p)
172{
173#ifdef __arch_swab32p
174 return __arch_swab32p(p);
175#else
176 return __swab32(*p);
177#endif
178}
179
180/**
181 * __swab64p - return a byteswapped 64-bit value from a pointer
182 * @p: pointer to a naturally-aligned 64-bit value
183 */
184static inline __u64 __swab64p(const __u64 *p)
185{
186#ifdef __arch_swab64p
187 return __arch_swab64p(p);
188#else
189 return __swab64(*p);
190#endif
191}
192
193/**
194 * __swahw32p - return a wordswapped 32-bit value from a pointer
195 * @p: pointer to a naturally-aligned 32-bit value
196 *
197 * See __swahw32() for details of wordswapping.
198 */
199static inline __u32 __swahw32p(const __u32 *p)
200{
201#ifdef __arch_swahw32p
202 return __arch_swahw32p(p);
203#else
204 return __swahw32(*p);
205#endif
206}
207
208/**
209 * __swahb32p - return a high and low byteswapped 32-bit value from a pointer
210 * @p: pointer to a naturally-aligned 32-bit value
211 *
212 * See __swahb32() for details of high/low byteswapping.
213 */
214static inline __u32 __swahb32p(const __u32 *p)
215{
216#ifdef __arch_swahb32p
217 return __arch_swahb32p(p);
218#else
219 return __swahb32(*p);
220#endif
221}
222
223/**
224 * __swab16s - byteswap a 16-bit value in-place
225 * @p: pointer to a naturally-aligned 16-bit value
226 */
227static inline void __swab16s(__u16 *p)
228{
229#ifdef __arch_swab16s
230 __arch_swab16s(p);
231#else
232 *p = __swab16p(p);
233#endif
234}
235/**
236 * __swab32s - byteswap a 32-bit value in-place
237 * @p: pointer to a naturally-aligned 32-bit value
238 */
239static inline void __swab32s(__u32 *p)
240{
241#ifdef __arch_swab32s
242 __arch_swab32s(p);
243#else
244 *p = __swab32p(p);
245#endif
246}
247
248/**
249 * __swab64s - byteswap a 64-bit value in-place
250 * @p: pointer to a naturally-aligned 64-bit value
251 */
252static inline void __swab64s(__u64 *p)
253{
254#ifdef __arch_swab64s
255 __arch_swab64s(p);
256#else
257 *p = __swab64p(p);
258#endif
259}
260
261/**
262 * __swahw32s - wordswap a 32-bit value in-place
263 * @p: pointer to a naturally-aligned 32-bit value
264 *
265 * See __swahw32() for details of wordswapping
266 */
267static inline void __swahw32s(__u32 *p)
268{
269#ifdef __arch_swahw32s
270 __arch_swahw32s(p);
271#else
272 *p = __swahw32p(p);
273#endif
274}
275
276/**
277 * __swahb32s - high and low byteswap a 32-bit value in-place
278 * @p: pointer to a naturally-aligned 32-bit value
279 *
280 * See __swahb32() for details of high and low byte swapping
281 */
282static inline void __swahb32s(__u32 *p)
283{
284#ifdef __arch_swahb32s
285 __arch_swahb32s(p);
286#else
287 *p = __swahb32p(p);
288#endif
289}
290
291#ifdef __KERNEL__
292# define swab16 __swab16
293# define swab32 __swab32
294# define swab64 __swab64
295# define swahw32 __swahw32
296# define swahb32 __swahb32
297# define swab16p __swab16p
298# define swab32p __swab32p
299# define swab64p __swab64p
300# define swahw32p __swahw32p
301# define swahb32p __swahb32p
302# define swab16s __swab16s
303# define swab32s __swab32s
304# define swab64s __swab64s
305# define swahw32s __swahw32s
306# define swahb32s __swahb32s
307#endif /* __KERNEL__ */
308
309#endif /* _LINUX_SWAB_H */
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index b1875582c1a1..b48d81969574 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -280,7 +280,7 @@ static inline void tracehook_report_clone(int trace, struct pt_regs *regs,
280 unsigned long clone_flags, 280 unsigned long clone_flags,
281 pid_t pid, struct task_struct *child) 281 pid_t pid, struct task_struct *child)
282{ 282{
283 if (unlikely(trace)) { 283 if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) {
284 /* 284 /*
285 * The child starts up with an immediate SIGSTOP. 285 * The child starts up with an immediate SIGSTOP.
286 */ 286 */
@@ -487,14 +487,20 @@ static inline int tracehook_notify_jctl(int notify, int why)
487 return notify || (current->ptrace & PT_PTRACED); 487 return notify || (current->ptrace & PT_PTRACED);
488} 488}
489 489
490#define DEATH_REAP -1
491#define DEATH_DELAYED_GROUP_LEADER -2
492
490/** 493/**
491 * tracehook_notify_death - task is dead, ready to notify parent 494 * tracehook_notify_death - task is dead, ready to notify parent
492 * @task: @current task now exiting 495 * @task: @current task now exiting
493 * @death_cookie: value to pass to tracehook_report_death() 496 * @death_cookie: value to pass to tracehook_report_death()
494 * @group_dead: nonzero if this was the last thread in the group to die 497 * @group_dead: nonzero if this was the last thread in the group to die
495 * 498 *
496 * Return the signal number to send our parent with do_notify_parent(), or 499 * A return value >= 0 means call do_notify_parent() with that signal
497 * zero to send no signal and leave a zombie, or -1 to self-reap right now. 500 * number. Negative return value can be %DEATH_REAP to self-reap right
501 * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
502 * parent. Note that a return value of 0 means a do_notify_parent() call
503 * that sends no signal, but still wakes up a parent blocked in wait*().
498 * 504 *
499 * Called with write_lock_irq(&tasklist_lock) held. 505 * Called with write_lock_irq(&tasklist_lock) held.
500 */ 506 */
@@ -502,7 +508,7 @@ static inline int tracehook_notify_death(struct task_struct *task,
502 void **death_cookie, int group_dead) 508 void **death_cookie, int group_dead)
503{ 509{
504 if (task->exit_signal == -1) 510 if (task->exit_signal == -1)
505 return task->ptrace ? SIGCHLD : -1; 511 return task->ptrace ? SIGCHLD : DEATH_REAP;
506 512
507 /* 513 /*
508 * If something other than our normal parent is ptracing us, then 514 * If something other than our normal parent is ptracing us, then
@@ -512,21 +518,21 @@ static inline int tracehook_notify_death(struct task_struct *task,
512 if (thread_group_empty(task) && !ptrace_reparented(task)) 518 if (thread_group_empty(task) && !ptrace_reparented(task))
513 return task->exit_signal; 519 return task->exit_signal;
514 520
515 return task->ptrace ? SIGCHLD : 0; 521 return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
516} 522}
517 523
518/** 524/**
519 * tracehook_report_death - task is dead and ready to be reaped 525 * tracehook_report_death - task is dead and ready to be reaped
520 * @task: @current task now exiting 526 * @task: @current task now exiting
521 * @signal: signal number sent to parent, or 0 or -1 527 * @signal: return value from tracheook_notify_death()
522 * @death_cookie: value passed back from tracehook_notify_death() 528 * @death_cookie: value passed back from tracehook_notify_death()
523 * @group_dead: nonzero if this was the last thread in the group to die 529 * @group_dead: nonzero if this was the last thread in the group to die
524 * 530 *
525 * Thread has just become a zombie or is about to self-reap. If positive, 531 * Thread has just become a zombie or is about to self-reap. If positive,
526 * @signal is the signal number just sent to the parent (usually %SIGCHLD). 532 * @signal is the signal number just sent to the parent (usually %SIGCHLD).
527 * If @signal is -1, this thread will self-reap. If @signal is 0, this is 533 * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is
528 * a delayed_group_leader() zombie. The @death_cookie was passed back by 534 * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
529 * tracehook_notify_death(). 535 * The @death_cookie was passed back by tracehook_notify_death().
530 * 536 *
531 * If normal reaping is not inhibited, @task->exit_state might be changing 537 * If normal reaping is not inhibited, @task->exit_state might be changing
532 * in parallel. 538 * in parallel.
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 5811c5da69f9..0924cd9c30f6 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -110,6 +110,8 @@ enum usb_interface_condition {
110 * @sysfs_files_created: sysfs attributes exist 110 * @sysfs_files_created: sysfs attributes exist
111 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup 111 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
112 * capability during autosuspend. 112 * capability during autosuspend.
113 * @needs_binding: flag set when the driver should be re-probed or unbound
114 * following a reset or suspend operation it doesn't support.
113 * @dev: driver model's view of this device 115 * @dev: driver model's view of this device
114 * @usb_dev: if an interface is bound to the USB major, this will point 116 * @usb_dev: if an interface is bound to the USB major, this will point
115 * to the sysfs representation for that device. 117 * to the sysfs representation for that device.
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
new file mode 100644
index 000000000000..630962c04ca4
--- /dev/null
+++ b/include/linux/usb/musb.h
@@ -0,0 +1,98 @@
1/*
2 * This is used to for host and peripheral modes of the driver for
3 * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
4 *
5 * Board initialization should put one of these into dev->platform_data,
6 * probably on some platform_device named "musb_hdrc". It encapsulates
7 * key configuration differences between boards.
8 */
9
10/* The USB role is defined by the connector used on the board, so long as
11 * standards are being followed. (Developer boards sometimes won't.)
12 */
13enum musb_mode {
14 MUSB_UNDEFINED = 0,
15 MUSB_HOST, /* A or Mini-A connector */
16 MUSB_PERIPHERAL, /* B or Mini-B connector */
17 MUSB_OTG /* Mini-AB connector */
18};
19
20struct clk;
21
22struct musb_hdrc_eps_bits {
23 const char name[16];
24 u8 bits;
25};
26
27struct musb_hdrc_config {
28 /* MUSB configuration-specific details */
29 unsigned multipoint:1; /* multipoint device */
30 unsigned dyn_fifo:1; /* supports dynamic fifo sizing */
31 unsigned soft_con:1; /* soft connect required */
32 unsigned utm_16:1; /* utm data witdh is 16 bits */
33 unsigned big_endian:1; /* true if CPU uses big-endian */
34 unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */
35 unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */
36 unsigned high_iso_tx:1; /* Tx ep required for HB iso */
37 unsigned high_iso_rx:1; /* Rx ep required for HD iso */
38 unsigned dma:1; /* supports DMA */
39 unsigned vendor_req:1; /* vendor registers required */
40
41 u8 num_eps; /* number of endpoints _with_ ep0 */
42 u8 dma_channels; /* number of dma channels */
43 u8 dyn_fifo_size; /* dynamic size in bytes */
44 u8 vendor_ctrl; /* vendor control reg width */
45 u8 vendor_stat; /* vendor status reg witdh */
46 u8 dma_req_chan; /* bitmask for required dma channels */
47 u8 ram_bits; /* ram address size */
48
49 struct musb_hdrc_eps_bits *eps_bits;
50};
51
52struct musb_hdrc_platform_data {
53 /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
54 u8 mode;
55
56 /* for clk_get() */
57 const char *clock;
58
59 /* (HOST or OTG) switch VBUS on/off */
60 int (*set_vbus)(struct device *dev, int is_on);
61
62 /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
63 u8 power;
64
65 /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
66 u8 min_power;
67
68 /* (HOST or OTG) msec/2 after VBUS on till power good */
69 u8 potpgt;
70
71 /* Power the device on or off */
72 int (*set_power)(int state);
73
74 /* Turn device clock on or off */
75 int (*set_clock)(struct clk *clock, int is_on);
76
77 /* MUSB configuration-specific details */
78 struct musb_hdrc_config *config;
79};
80
81
82/* TUSB 6010 support */
83
84#define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */
85#define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
86#define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
87
88#ifdef CONFIG_ARCH_OMAP2
89
90extern int __init tusb6010_setup_interface(
91 struct musb_hdrc_platform_data *data,
92 unsigned ps_refclk, unsigned waitpin,
93 unsigned async_cs, unsigned sync_cs,
94 unsigned irq, unsigned dmachan);
95
96extern int tusb6010_platform_retime(unsigned is_refclk);
97
98#endif /* OMAP2 */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 09a3e6a7518f..655341d0f534 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -17,7 +17,8 @@
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18 18
19#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ 19#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
20#define SERIAL_TTY_MINORS 255 /* loads of devices :) */ 20#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
21#define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */
21 22
22/* The maximum number of ports one device can grab at once */ 23/* The maximum number of ports one device can grab at once */
23#define MAX_NUM_PORTS 8 24#define MAX_NUM_PORTS 8
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 14c0e91be9b5..1c78d56c57e5 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -74,7 +74,7 @@ void con_protect_unimap(struct vc_data *vc, int rdonly);
74int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); 74int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
75 75
76#define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ 76#define vc_translate(vc, c) ((vc)->vc_translate[(c) | \
77 (vc)->vc_toggle_meta ? 0x80 : 0]) 77 ((vc)->vc_toggle_meta ? 0x80 : 0)])
78#else 78#else
79#define con_set_trans_old(arg) (0) 79#define con_set_trans_old(arg) (0)
80#define con_get_trans_old(arg) (-EINVAL) 80#define con_get_trans_old(arg) (-EINVAL)
@@ -86,6 +86,7 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
86#define con_copy_unimap(d, s) (0) 86#define con_copy_unimap(d, s) (0)
87#define con_get_unimap(vc, ct, uct, list) (-EINVAL) 87#define con_get_unimap(vc, ct, uct, list) (-EINVAL)
88#define con_free_unimap(vc) do { ; } while (0) 88#define con_free_unimap(vc) do { ; } while (0)
89#define con_protect_unimap(vc, rdonly) do { ; } while (0)
89 90
90#define vc_translate(vc, c) (c) 91#define vc_translate(vc, c) (c)
91#endif 92#endif