diff options
Diffstat (limited to 'include/linux')
96 files changed, 2998 insertions, 832 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 | |||
97 | header-y += ip6_tunnel.h | 97 | header-y += ip6_tunnel.h |
98 | header-y += ipmi_msgdefs.h | 98 | header-y += ipmi_msgdefs.h |
99 | header-y += ipsec.h | 99 | header-y += ipsec.h |
100 | header-y += ip_vs.h | ||
100 | header-y += ipx.h | 101 | header-y += ipx.h |
101 | header-y += irda.h | 102 | header-y += irda.h |
102 | header-y += iso_fs.h | 103 | header-y += iso_fs.h |
@@ -355,6 +356,7 @@ unifdef-y += virtio_balloon.h | |||
355 | unifdef-y += virtio_console.h | 356 | unifdef-y += virtio_console.h |
356 | unifdef-y += virtio_pci.h | 357 | unifdef-y += virtio_pci.h |
357 | unifdef-y += virtio_ring.h | 358 | unifdef-y += virtio_ring.h |
359 | unifdef-y += virtio_rng.h | ||
358 | unifdef-y += vt.h | 360 | unifdef-y += vt.h |
359 | unifdef-y += wait.h | 361 | unifdef-y += wait.h |
360 | unifdef-y += wanrouter.h | 362 | unifdef-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 | |||
33 | enum chipset_type { | 35 | enum 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, | |||
96 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); | 100 | extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); |
97 | extern int agp_bind_memory(struct agp_memory *, off_t); | 101 | extern int agp_bind_memory(struct agp_memory *, off_t); |
98 | extern int agp_unbind_memory(struct agp_memory *); | 102 | extern int agp_unbind_memory(struct agp_memory *); |
103 | extern int agp_rebind_memory(void); | ||
99 | extern void agp_enable(struct agp_bridge_data *, u32); | 104 | extern void agp_enable(struct agp_bridge_data *, u32); |
100 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 105 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
101 | extern void agp_backend_release(struct agp_bridge_data *); | 106 | extern 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 | ||
111 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 111 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
112 | const unsigned long *src, int nbits); | 112 | const unsigned long *src, int nbits); |
113 | extern int bitmap_scnprintf_len(unsigned int nr_bits); | ||
113 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | 114 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, |
114 | unsigned long *dst, int nbits); | 115 | unsigned long *dst, int nbits); |
115 | extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen, | 116 | extern 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); | |||
655 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | 655 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
656 | extern void blk_requeue_request(struct request_queue *, struct request *); | 656 | extern void blk_requeue_request(struct request_queue *, struct request *); |
657 | extern void blk_plug_device(struct request_queue *); | 657 | extern void blk_plug_device(struct request_queue *); |
658 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
658 | extern int blk_remove_plug(struct request_queue *); | 659 | extern int blk_remove_plug(struct request_queue *); |
659 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 660 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
660 | extern int scsi_cmd_ioctl(struct file *, struct request_queue *, | 661 | extern 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 82aa36c53ea7..eadaab44015f 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -115,7 +115,6 @@ BUFFER_FNS(Uptodate, uptodate) | |||
115 | BUFFER_FNS(Dirty, dirty) | 115 | BUFFER_FNS(Dirty, dirty) |
116 | TAS_BUFFER_FNS(Dirty, dirty) | 116 | TAS_BUFFER_FNS(Dirty, dirty) |
117 | BUFFER_FNS(Lock, locked) | 117 | BUFFER_FNS(Lock, locked) |
118 | TAS_BUFFER_FNS(Lock, locked) | ||
119 | BUFFER_FNS(Req, req) | 118 | BUFFER_FNS(Req, req) |
120 | TAS_BUFFER_FNS(Req, req) | 119 | TAS_BUFFER_FNS(Req, req) |
121 | BUFFER_FNS(Mapped, mapped) | 120 | BUFFER_FNS(Mapped, mapped) |
@@ -205,6 +204,8 @@ void block_invalidatepage(struct page *page, unsigned long offset); | |||
205 | int block_write_full_page(struct page *page, get_block_t *get_block, | 204 | int block_write_full_page(struct page *page, get_block_t *get_block, |
206 | struct writeback_control *wbc); | 205 | struct writeback_control *wbc); |
207 | int block_read_full_page(struct page*, get_block_t*); | 206 | int block_read_full_page(struct page*, get_block_t*); |
207 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, | ||
208 | unsigned long from); | ||
208 | int block_write_begin(struct file *, struct address_space *, | 209 | int block_write_begin(struct file *, struct address_space *, |
209 | loff_t, unsigned, unsigned, | 210 | loff_t, unsigned, unsigned, |
210 | struct page **, void **, get_block_t*); | 211 | struct page **, void **, get_block_t*); |
@@ -319,10 +320,15 @@ static inline void wait_on_buffer(struct buffer_head *bh) | |||
319 | __wait_on_buffer(bh); | 320 | __wait_on_buffer(bh); |
320 | } | 321 | } |
321 | 322 | ||
323 | static inline int trylock_buffer(struct buffer_head *bh) | ||
324 | { | ||
325 | return likely(!test_and_set_bit(BH_Lock, &bh->b_state)); | ||
326 | } | ||
327 | |||
322 | static inline void lock_buffer(struct buffer_head *bh) | 328 | static inline void lock_buffer(struct buffer_head *bh) |
323 | { | 329 | { |
324 | might_sleep(); | 330 | might_sleep(); |
325 | if (test_set_buffer_locked(bh)) | 331 | if (!trylock_buffer(bh)) |
326 | __lock_buffer(bh); | 332 | __lock_buffer(bh); |
327 | } | 333 | } |
328 | 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 | |||
88 | static inline void __le16_to_cpus(__u16 *p) | ||
89 | { | ||
90 | #ifdef __BIG_ENDIAN | ||
91 | __swab16s(p); | ||
92 | #endif | ||
93 | } | ||
94 | |||
95 | static inline void __cpu_to_le16s(__u16 *p) | ||
96 | { | ||
97 | #ifdef __BIG_ENDIAN | ||
98 | __swab16s(p); | ||
99 | #endif | ||
100 | } | ||
101 | |||
102 | static inline void __le32_to_cpus(__u32 *p) | ||
103 | { | ||
104 | #ifdef __BIG_ENDIAN | ||
105 | __swab32s(p); | ||
106 | #endif | ||
107 | } | ||
108 | |||
109 | static inline void __cpu_to_le32s(__u32 *p) | ||
110 | { | ||
111 | #ifdef __BIG_ENDIAN | ||
112 | __swab32s(p); | ||
113 | #endif | ||
114 | } | ||
115 | |||
116 | static inline void __le64_to_cpus(__u64 *p) | ||
117 | { | ||
118 | #ifdef __BIG_ENDIAN | ||
119 | __swab64s(p); | ||
120 | #endif | ||
121 | } | ||
122 | |||
123 | static inline void __cpu_to_le64s(__u64 *p) | ||
124 | { | ||
125 | #ifdef __BIG_ENDIAN | ||
126 | __swab64s(p); | ||
127 | #endif | ||
128 | } | ||
129 | |||
130 | static inline void __be16_to_cpus(__u16 *p) | ||
131 | { | ||
132 | #ifdef __LITTLE_ENDIAN | ||
133 | __swab16s(p); | ||
134 | #endif | ||
135 | } | ||
136 | |||
137 | static inline void __cpu_to_be16s(__u16 *p) | ||
138 | { | ||
139 | #ifdef __LITTLE_ENDIAN | ||
140 | __swab16s(p); | ||
141 | #endif | ||
142 | } | ||
143 | |||
144 | static inline void __be32_to_cpus(__u32 *p) | ||
145 | { | ||
146 | #ifdef __LITTLE_ENDIAN | ||
147 | __swab32s(p); | ||
148 | #endif | ||
149 | } | ||
150 | |||
151 | static inline void __cpu_to_be32s(__u32 *p) | ||
152 | { | ||
153 | #ifdef __LITTLE_ENDIAN | ||
154 | __swab32s(p); | ||
155 | #endif | ||
156 | } | ||
157 | |||
158 | static inline void __be64_to_cpus(__u64 *p) | ||
159 | { | ||
160 | #ifdef __LITTLE_ENDIAN | ||
161 | __swab64s(p); | ||
162 | #endif | ||
163 | } | ||
164 | |||
165 | static inline void __cpu_to_be64s(__u64 *p) | ||
166 | { | ||
167 | #ifdef __LITTLE_ENDIAN | ||
168 | __swab64s(p); | ||
169 | #endif | ||
170 | } | ||
171 | |||
172 | static 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 | |||
181 | static 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 | |||
190 | static 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 | |||
199 | static 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 | |||
208 | static 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 | |||
217 | static 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 | |||
226 | static 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 | |||
235 | static 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 | |||
244 | static 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 | |||
253 | static 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 | |||
262 | static 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 | |||
271 | static 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 | |||
341 | static inline void le16_add_cpu(__le16 *var, u16 val) | ||
342 | { | ||
343 | *var = cpu_to_le16(le16_to_cpup(var) + val); | ||
344 | } | ||
345 | |||
346 | static inline void le32_add_cpu(__le32 *var, u32 val) | ||
347 | { | ||
348 | *var = cpu_to_le32(le32_to_cpup(var) + val); | ||
349 | } | ||
350 | |||
351 | static inline void le64_add_cpu(__le64 *var, u64 val) | ||
352 | { | ||
353 | *var = cpu_to_le64(le64_to_cpup(var) + val); | ||
354 | } | ||
355 | |||
356 | static inline void be16_add_cpu(__be16 *var, u16 val) | ||
357 | { | ||
358 | *var = cpu_to_be16(be16_to_cpup(var) + val); | ||
359 | } | ||
360 | |||
361 | static inline void be32_add_cpu(__be32 *var, u32 val) | ||
362 | { | ||
363 | *var = cpu_to_be32(be32_to_cpup(var) + val); | ||
364 | } | ||
365 | |||
366 | static 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 | */ | ||
71 | static 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 | */ | ||
92 | static 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) \ | ||
139 | struct _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) \ | ||
183 | static 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 | } \ | ||
196 | static 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 1b5c98e7fef7..d3219d73f8e6 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -62,15 +62,7 @@ | |||
62 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | 62 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids |
63 | * | 63 | * |
64 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | 64 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set |
65 | *ifdef CONFIG_HAS_CPUMASK_OF_CPU | 65 | * (can be used as an lvalue) |
66 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t *v | ||
67 | * cpumask_of_cpu_ptr_next(v, cpu) Sets v = &cpumask_of_cpu_map[cpu] | ||
68 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
69 | *else | ||
70 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t _v and *v = &_v | ||
71 | * cpumask_of_cpu_ptr_next(v, cpu) Sets _v = cpumask_of_cpu(cpu) | ||
72 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
73 | *endif | ||
74 | * CPU_MASK_ALL Initializer - all bits set | 66 | * CPU_MASK_ALL Initializer - all bits set |
75 | * CPU_MASK_NONE Initializer - no bits set | 67 | * CPU_MASK_NONE Initializer - no bits set |
76 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | 68 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask |
@@ -273,37 +265,30 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
273 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 265 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
274 | } | 266 | } |
275 | 267 | ||
268 | /* | ||
269 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
270 | * | ||
271 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
272 | * padding to the left and the right, and return the constant pointer | ||
273 | * appropriately offset. | ||
274 | */ | ||
275 | extern const unsigned long | ||
276 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
277 | |||
278 | static inline const cpumask_t *get_cpu_mask(unsigned int cpu) | ||
279 | { | ||
280 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
281 | p -= cpu / BITS_PER_LONG; | ||
282 | return (const cpumask_t *)p; | ||
283 | } | ||
284 | |||
285 | /* | ||
286 | * In cases where we take the address of the cpumask immediately, | ||
287 | * gcc optimizes it out (it's a constant) and there's no huge stack | ||
288 | * variable created: | ||
289 | */ | ||
290 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
276 | 291 | ||
277 | #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP | ||
278 | extern cpumask_t *cpumask_of_cpu_map; | ||
279 | #define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu]) | ||
280 | #define cpumask_of_cpu_ptr(v, cpu) \ | ||
281 | const cpumask_t *v = &cpumask_of_cpu(cpu) | ||
282 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
283 | const cpumask_t *v | ||
284 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
285 | v = &cpumask_of_cpu(cpu) | ||
286 | #else | ||
287 | #define cpumask_of_cpu(cpu) \ | ||
288 | ({ \ | ||
289 | typeof(_unused_cpumask_arg_) m; \ | ||
290 | if (sizeof(m) == sizeof(unsigned long)) { \ | ||
291 | m.bits[0] = 1UL<<(cpu); \ | ||
292 | } else { \ | ||
293 | cpus_clear(m); \ | ||
294 | cpu_set((cpu), m); \ | ||
295 | } \ | ||
296 | m; \ | ||
297 | }) | ||
298 | #define cpumask_of_cpu_ptr(v, cpu) \ | ||
299 | cpumask_t _##v = cpumask_of_cpu(cpu); \ | ||
300 | const cpumask_t *v = &_##v | ||
301 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
302 | cpumask_t _##v; \ | ||
303 | const cpumask_t *v = &_##v | ||
304 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
305 | _##v = cpumask_of_cpu(cpu) | ||
306 | #endif | ||
307 | 292 | ||
308 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | 293 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) |
309 | 294 | ||
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) \ | ||
33 | do { \ | ||
34 | *(_uid) = current->uid; \ | ||
35 | *(_gid) = current->gid; \ | ||
36 | } while(0) | ||
37 | |||
38 | #define current_euid_egid(_uid, _gid) \ | ||
39 | do { \ | ||
40 | *(_uid) = current->euid; \ | ||
41 | *(_gid) = current->egid; \ | ||
42 | } while(0) | ||
43 | |||
44 | #define current_fsuid_fsgid(_uid, _gid) \ | ||
45 | do { \ | ||
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 *); | |||
230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | 230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); |
231 | extern struct dentry * d_alloc_anon(struct inode *); | 231 | extern struct dentry * d_alloc_anon(struct inode *); |
232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
233 | extern struct dentry * d_add_ci(struct inode *, struct dentry *, struct qstr *); | ||
233 | extern void shrink_dcache_sb(struct super_block *); | 234 | extern void shrink_dcache_sb(struct super_block *); |
234 | extern void shrink_dcache_parent(struct dentry *); | 235 | extern void shrink_dcache_parent(struct dentry *); |
235 | extern void shrink_dcache_for_umount(struct super_block *); | 236 | extern 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 | ||
28 | struct dm9000_plat_data { | 28 | struct 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 | ||
35 | static 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 | |||
43 | static 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... */ |
35 | struct ethtool_drvinfo { | 50 | struct 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); | |||
34 | extern struct file *fget_light(unsigned int fd, int *fput_needed); | 34 | extern struct file *fget_light(unsigned int fd, int *fput_needed); |
35 | extern void set_close_on_exec(unsigned int fd, int flag); | 35 | extern void set_close_on_exec(unsigned int fd, int flag); |
36 | extern void put_filp(struct file *); | 36 | extern void put_filp(struct file *); |
37 | extern int alloc_fd(unsigned start, unsigned flags); | ||
37 | extern int get_unused_fd(void); | 38 | extern int get_unused_fd(void); |
38 | extern int get_unused_fd_flags(int flags); | 39 | #define get_unused_fd_flags(flags) alloc_fd(0, (flags)) |
39 | extern void put_unused_fd(unsigned int fd); | 40 | extern void put_unused_fd(unsigned int fd); |
40 | 41 | ||
41 | extern void fd_install(unsigned int fd, struct file *file); | 42 | extern 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 | */ | ||
40 | int firmware_map_add(resource_size_t start, resource_size_t end, | 27 | int 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 | */ | ||
55 | int firmware_map_add_early(resource_size_t start, resource_size_t end, | 29 | int 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/fs.h b/include/linux/fs.h index 8252b045e624..580b513668fe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -443,6 +443,27 @@ static inline size_t iov_iter_count(struct iov_iter *i) | |||
443 | return i->count; | 443 | return i->count; |
444 | } | 444 | } |
445 | 445 | ||
446 | /* | ||
447 | * "descriptor" for what we're up to with a read. | ||
448 | * This allows us to use the same read code yet | ||
449 | * have multiple different users of the data that | ||
450 | * we read from a file. | ||
451 | * | ||
452 | * The simplest case just copies the data to user | ||
453 | * mode. | ||
454 | */ | ||
455 | typedef struct { | ||
456 | size_t written; | ||
457 | size_t count; | ||
458 | union { | ||
459 | char __user *buf; | ||
460 | void *data; | ||
461 | } arg; | ||
462 | int error; | ||
463 | } read_descriptor_t; | ||
464 | |||
465 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | ||
466 | unsigned long, unsigned long); | ||
446 | 467 | ||
447 | struct address_space_operations { | 468 | struct address_space_operations { |
448 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 469 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
@@ -484,6 +505,8 @@ struct address_space_operations { | |||
484 | int (*migratepage) (struct address_space *, | 505 | int (*migratepage) (struct address_space *, |
485 | struct page *, struct page *); | 506 | struct page *, struct page *); |
486 | int (*launder_page) (struct page *); | 507 | int (*launder_page) (struct page *); |
508 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | ||
509 | unsigned long); | ||
487 | }; | 510 | }; |
488 | 511 | ||
489 | /* | 512 | /* |
@@ -1198,27 +1221,6 @@ struct block_device_operations { | |||
1198 | struct module *owner; | 1221 | struct module *owner; |
1199 | }; | 1222 | }; |
1200 | 1223 | ||
1201 | /* | ||
1202 | * "descriptor" for what we're up to with a read. | ||
1203 | * This allows us to use the same read code yet | ||
1204 | * have multiple different users of the data that | ||
1205 | * we read from a file. | ||
1206 | * | ||
1207 | * The simplest case just copies the data to user | ||
1208 | * mode. | ||
1209 | */ | ||
1210 | typedef struct { | ||
1211 | size_t written; | ||
1212 | size_t count; | ||
1213 | union { | ||
1214 | char __user * buf; | ||
1215 | void *data; | ||
1216 | } arg; | ||
1217 | int error; | ||
1218 | } read_descriptor_t; | ||
1219 | |||
1220 | typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); | ||
1221 | |||
1222 | /* These macros are for out of kernel modules to test that | 1224 | /* These macros are for out of kernel modules to test that |
1223 | * the kernel supports the unlocked_ioctl and compat_ioctl | 1225 | * the kernel supports the unlocked_ioctl and compat_ioctl |
1224 | * fields in struct file_operations. */ | 1226 | * fields in struct file_operations. */ |
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 | |||
17 | struct platform_device; | ||
16 | 18 | ||
17 | struct i2c_pnx_mif { | 19 | struct 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 | ||
510 | extern const struct ide_tp_ops default_tp_ops; | 499 | extern 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 | */ | ||
512 | struct ide_port_ops { | 519 | struct 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 | */ | ||
514 | struct 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 | |||
509 | struct ieee80211_mgmt { | 522 | struct 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 */ |
24 | static inline const struct ihex_binrec * | 24 | static 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[]; | |||
139 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; | 139 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; |
140 | 140 | ||
141 | /* Defined in init/main.c */ | 141 | /* Defined in init/main.c */ |
142 | extern int do_one_initcall(initcall_t fn); | ||
142 | extern char __initdata boot_command_line[]; | 143 | extern char __initdata boot_command_line[]; |
143 | extern char *saved_command_line; | 144 | extern char *saved_command_line; |
144 | extern unsigned int reset_devices; | 145 | extern 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 | ||
230 | static inline void __deprecated cli(void) | ||
231 | { | ||
232 | local_irq_disable(); | ||
233 | } | ||
234 | static inline void __deprecated sti(void) | ||
235 | { | ||
236 | local_irq_enable(); | ||
237 | } | ||
238 | static inline void __deprecated save_flags(unsigned long *x) | ||
239 | { | ||
240 | local_save_flags(*x); | ||
241 | } | ||
242 | #define save_flags(x) save_flags(&x) | ||
243 | static inline void __deprecated restore_flags(unsigned long x) | ||
244 | { | ||
245 | local_irq_restore(x); | ||
246 | } | ||
247 | |||
248 | static 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/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, | |||
118 | int adjust_resource(struct resource *res, resource_size_t start, | 118 | int adjust_resource(struct resource *res, resource_size_t start, |
119 | resource_size_t size); | 119 | resource_size_t size); |
120 | resource_size_t resource_alignment(struct resource *res); | 120 | resource_size_t resource_alignment(struct resource *res); |
121 | static 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 | */ | ||
97 | struct 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 | |||
112 | struct 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 | */ | ||
130 | struct 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 */ | ||
147 | struct 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 */ | ||
160 | struct 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 | |||
181 | struct 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 */ | ||
200 | struct 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 */ | ||
216 | struct 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 */ | ||
226 | struct 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 */ | ||
234 | struct 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 | ||
109 | static inline void print_ip_sym(unsigned long ip) | 109 | static 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; | |||
102 | struct pt_regs; | 108 | struct pt_regs; |
103 | struct user; | 109 | struct user; |
104 | 110 | ||
111 | #ifdef CONFIG_PREEMPT_VOLUNTARY | ||
112 | extern 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 | ||
116 | extern 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))); |
131 | unsigned long paddr_vmcoreinfo_note(void); | 131 | unsigned 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 | ||
342 | static 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); |
952 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 953 | extern 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); |
955 | extern unsigned int ata_do_dev_read_id(struct ata_device *dev, | ||
956 | struct ata_taskfile *tf, u16 *id); | ||
954 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 957 | extern void ata_qc_complete(struct ata_queued_cmd *qc); |
955 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); | 958 | extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active); |
956 | extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | 959 | extern 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 | ||
217 | static 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 | */ | ||
243 | static 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 | |||
217 | static inline void __list_splice(const struct list_head *list, | 257 | static 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 | */ | ||
288 | static 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 | */ | ||
319 | static 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 | |||
192 | struct held_lock { | 201 | struct 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 | */ |
296 | extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | 305 | extern 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 | ||
299 | extern void lock_release(struct lockdep_map *lock, int nested, | 309 | extern void lock_release(struct lockdep_map *lock, int nested, |
300 | unsigned long ip); | 310 | unsigned long ip); |
301 | 311 | ||
312 | extern 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 | ||
284 | static inline int | ||
285 | test_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 | |||
293 | static inline void | ||
294 | set_channelmap(u_int nr, u_char *map) | ||
295 | { | ||
296 | map[nr >> 3] |= (1 << (nr & 7)); | ||
297 | } | ||
298 | |||
299 | static inline void | ||
300 | clear_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 | ||
435 | static inline struct sk_buff * | 457 | static inline struct sk_buff * |
436 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) | 458 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) |
diff --git a/include/linux/maple.h b/include/linux/maple.h index d31e36ebb436..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 | ||
6 | extern struct bus_type maple_bus_type; | 7 | extern 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 | ||
38 | struct maple_devinfo { | 40 | struct maple_devinfo { |
@@ -49,7 +51,6 @@ struct maple_devinfo { | |||
49 | struct maple_device { | 51 | struct 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; |
@@ -61,8 +62,6 @@ struct maple_device { | |||
61 | 62 | ||
62 | struct maple_driver { | 63 | struct maple_driver { |
63 | unsigned long function; | 64 | unsigned long function; |
64 | int (*connect) (struct maple_device * dev); | ||
65 | void (*disconnect) (struct maple_device * dev); | ||
66 | struct device_driver drv; | 65 | struct device_driver drv; |
67 | }; | 66 | }; |
68 | 67 | ||
@@ -70,10 +69,17 @@ void maple_getcond_callback(struct maple_device *dev, | |||
70 | void (*callback) (struct mapleq * mq), | 69 | void (*callback) (struct mapleq * mq), |
71 | unsigned long interval, | 70 | unsigned long interval, |
72 | unsigned long function); | 71 | unsigned long function); |
73 | int maple_driver_register(struct device_driver *drv); | 72 | int maple_driver_register(struct maple_driver *); |
74 | void maple_add_packet(struct mapleq *mq); | 73 | void maple_driver_unregister(struct maple_driver *); |
74 | |||
75 | int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, | ||
76 | u32 command, u32 length, void *data); | ||
77 | void maple_clear_dev(struct maple_device *mdev); | ||
75 | 78 | ||
76 | #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) |
77 | #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) |
78 | 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 | |||
79 | #endif /* __LINUX_MAPLE_H */ | 85 | #endif /* __LINUX_MAPLE_H */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index bb3dd0545928..49ef857cdb2d 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -1,5 +1,3 @@ | |||
1 | #ifndef MFD_CORE_H | ||
2 | #define MFD_CORE_H | ||
3 | /* | 1 | /* |
4 | * drivers/mfd/mfd-core.h | 2 | * drivers/mfd/mfd-core.h |
5 | * | 3 | * |
@@ -13,6 +11,9 @@ | |||
13 | * | 11 | * |
14 | */ | 12 | */ |
15 | 13 | ||
14 | #ifndef MFD_CORE_H | ||
15 | #define MFD_CORE_H | ||
16 | |||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -28,7 +29,13 @@ struct mfd_cell { | |||
28 | int (*suspend)(struct platform_device *dev); | 29 | int (*suspend)(struct platform_device *dev); |
29 | int (*resume)(struct platform_device *dev); | 30 | int (*resume)(struct platform_device *dev); |
30 | 31 | ||
31 | void *driver_data; /* driver-specific data */ | 32 | /* driver-specific data for MFD-aware "cell" drivers */ |
33 | void *driver_data; | ||
34 | |||
35 | /* platform_data can be used to either pass data to "generic" | ||
36 | driver or as a hook to mfd_cell for the "cell" drivers */ | ||
37 | void *platform_data; | ||
38 | size_t data_size; | ||
32 | 39 | ||
33 | /* | 40 | /* |
34 | * This resources can be specified relatievly to the parent device. | 41 | * This resources can be specified relatievly to the parent device. |
@@ -38,18 +45,11 @@ struct mfd_cell { | |||
38 | const struct resource *resources; | 45 | const struct resource *resources; |
39 | }; | 46 | }; |
40 | 47 | ||
41 | static inline struct mfd_cell * | 48 | extern int mfd_add_devices(struct device *parent, int id, |
42 | mfd_get_cell(struct platform_device *pdev) | 49 | const struct mfd_cell *cells, int n_devs, |
43 | { | 50 | struct resource *mem_base, |
44 | return (struct mfd_cell *)pdev->dev.platform_data; | 51 | int irq_base); |
45 | } | ||
46 | |||
47 | extern int mfd_add_devices( | ||
48 | struct platform_device *parent, | ||
49 | const struct mfd_cell *cells, int n_devs, | ||
50 | struct resource *mem_base, | ||
51 | int irq_base); | ||
52 | 52 | ||
53 | extern void mfd_remove_devices(struct platform_device *parent); | 53 | extern void mfd_remove_devices(struct device *parent); |
54 | 54 | ||
55 | #endif | 55 | #endif |
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 | |||
17 | struct 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 | |||
13 | struct 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 */ |
21 | struct tc6393xb_platform_data { | 21 | struct 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 | ||
41 | struct mlx4_cqe { | 41 | struct 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 | ||
66 | enum { | 67 | enum { |
68 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, | ||
69 | MLX4_CQE_QPN_MASK = 0xffffff, | ||
70 | }; | ||
71 | |||
72 | enum { | ||
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 | ||
88 | enum { | 94 | enum { |
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 | |||
104 | enum { | ||
105 | MLX4_CQE_LLC = 1, | ||
106 | MLX4_CQE_SNAP = 1 << 1, | ||
107 | MLX4_CQE_BAD_FCS = 1 << 4, | ||
96 | }; | 108 | }; |
97 | 109 | ||
98 | static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, | 110 | static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6e695eaab4ce..fa651609b65d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -744,6 +744,8 @@ struct zap_details { | |||
744 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | 744 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, |
745 | pte_t pte); | 745 | pte_t pte); |
746 | 746 | ||
747 | int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | ||
748 | unsigned long size); | ||
747 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | 749 | unsigned 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 *); |
749 | unsigned long unmap_vmas(struct mmu_gather **tlb, | 751 | unsigned 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, | |||
846 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 847 | int 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, | |||
1041 | extern void get_pfn_range_for_nid(unsigned int nid, | 1023 | extern 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); |
1043 | extern unsigned long find_min_pfn_with_active_regions(void); | 1025 | extern unsigned long find_min_pfn_with_active_regions(void); |
1044 | extern unsigned long find_max_pfn_with_active_regions(void); | ||
1045 | extern void free_bootmem_with_active_regions(int nid, | 1026 | extern void free_bootmem_with_active_regions(int nid, |
1046 | unsigned long max_low_pfn); | 1027 | unsigned long max_low_pfn); |
1047 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); | 1028 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); |
@@ -1104,6 +1085,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **, | |||
1104 | unsigned long addr, unsigned long len, pgoff_t pgoff); | 1085 | unsigned long addr, unsigned long len, pgoff_t pgoff); |
1105 | extern void exit_mmap(struct mm_struct *); | 1086 | extern void exit_mmap(struct mm_struct *); |
1106 | 1087 | ||
1088 | extern int mm_take_all_locks(struct mm_struct *mm); | ||
1089 | extern void mm_drop_all_locks(struct mm_struct *mm); | ||
1090 | |||
1107 | #ifdef CONFIG_PROC_FS | 1091 | #ifdef CONFIG_PROC_FS |
1108 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ | 1092 | /* From fs/proc/base.c. callers must _not_ hold the mm's exe_file_lock */ |
1109 | extern void added_exe_file_vma(struct mm_struct *mm); | 1093 | extern void added_exe_file_vma(struct mm_struct *mm); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 746f975b58ef..386edbe2cb4e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/rbtree.h> | 10 | #include <linux/rbtree.h> |
11 | #include <linux/rwsem.h> | 11 | #include <linux/rwsem.h> |
12 | #include <linux/completion.h> | 12 | #include <linux/completion.h> |
13 | #include <linux/cpumask.h> | ||
13 | #include <asm/page.h> | 14 | #include <asm/page.h> |
14 | #include <asm/mmu.h> | 15 | #include <asm/mmu.h> |
15 | 16 | ||
@@ -253,6 +254,9 @@ struct mm_struct { | |||
253 | struct file *exe_file; | 254 | struct file *exe_file; |
254 | unsigned long num_exe_file_vmas; | 255 | unsigned long num_exe_file_vmas; |
255 | #endif | 256 | #endif |
257 | #ifdef CONFIG_MMU_NOTIFIER | ||
258 | struct mmu_notifier_mm *mmu_notifier_mm; | ||
259 | #endif | ||
256 | }; | 260 | }; |
257 | 261 | ||
258 | #endif /* _LINUX_MM_TYPES_H */ | 262 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h new file mode 100644 index 000000000000..b77486d152cd --- /dev/null +++ b/include/linux/mmu_notifier.h | |||
@@ -0,0 +1,279 @@ | |||
1 | #ifndef _LINUX_MMU_NOTIFIER_H | ||
2 | #define _LINUX_MMU_NOTIFIER_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/mm_types.h> | ||
7 | |||
8 | struct mmu_notifier; | ||
9 | struct mmu_notifier_ops; | ||
10 | |||
11 | #ifdef CONFIG_MMU_NOTIFIER | ||
12 | |||
13 | /* | ||
14 | * The mmu notifier_mm structure is allocated and installed in | ||
15 | * mm->mmu_notifier_mm inside the mm_take_all_locks() protected | ||
16 | * critical section and it's released only when mm_count reaches zero | ||
17 | * in mmdrop(). | ||
18 | */ | ||
19 | struct mmu_notifier_mm { | ||
20 | /* all mmu notifiers registerd in this mm are queued in this list */ | ||
21 | struct hlist_head list; | ||
22 | /* to serialize the list modifications and hlist_unhashed */ | ||
23 | spinlock_t lock; | ||
24 | }; | ||
25 | |||
26 | struct mmu_notifier_ops { | ||
27 | /* | ||
28 | * Called either by mmu_notifier_unregister or when the mm is | ||
29 | * being destroyed by exit_mmap, always before all pages are | ||
30 | * freed. This can run concurrently with other mmu notifier | ||
31 | * methods (the ones invoked outside the mm context) and it | ||
32 | * should tear down all secondary mmu mappings and freeze the | ||
33 | * secondary mmu. If this method isn't implemented you've to | ||
34 | * be sure that nothing could possibly write to the pages | ||
35 | * through the secondary mmu by the time the last thread with | ||
36 | * tsk->mm == mm exits. | ||
37 | * | ||
38 | * As side note: the pages freed after ->release returns could | ||
39 | * be immediately reallocated by the gart at an alias physical | ||
40 | * address with a different cache model, so if ->release isn't | ||
41 | * implemented because all _software_ driven memory accesses | ||
42 | * through the secondary mmu are terminated by the time the | ||
43 | * last thread of this mm quits, you've also to be sure that | ||
44 | * speculative _hardware_ operations can't allocate dirty | ||
45 | * cachelines in the cpu that could not be snooped and made | ||
46 | * coherent with the other read and write operations happening | ||
47 | * through the gart alias address, so leading to memory | ||
48 | * corruption. | ||
49 | */ | ||
50 | void (*release)(struct mmu_notifier *mn, | ||
51 | struct mm_struct *mm); | ||
52 | |||
53 | /* | ||
54 | * clear_flush_young is called after the VM is | ||
55 | * test-and-clearing the young/accessed bitflag in the | ||
56 | * pte. This way the VM will provide proper aging to the | ||
57 | * accesses to the page through the secondary MMUs and not | ||
58 | * only to the ones through the Linux pte. | ||
59 | */ | ||
60 | int (*clear_flush_young)(struct mmu_notifier *mn, | ||
61 | struct mm_struct *mm, | ||
62 | unsigned long address); | ||
63 | |||
64 | /* | ||
65 | * Before this is invoked any secondary MMU is still ok to | ||
66 | * read/write to the page previously pointed to by the Linux | ||
67 | * pte because the page hasn't been freed yet and it won't be | ||
68 | * freed until this returns. If required set_page_dirty has to | ||
69 | * be called internally to this method. | ||
70 | */ | ||
71 | void (*invalidate_page)(struct mmu_notifier *mn, | ||
72 | struct mm_struct *mm, | ||
73 | unsigned long address); | ||
74 | |||
75 | /* | ||
76 | * invalidate_range_start() and invalidate_range_end() must be | ||
77 | * paired and are called only when the mmap_sem and/or the | ||
78 | * locks protecting the reverse maps are held. The subsystem | ||
79 | * must guarantee that no additional references are taken to | ||
80 | * the pages in the range established between the call to | ||
81 | * invalidate_range_start() and the matching call to | ||
82 | * invalidate_range_end(). | ||
83 | * | ||
84 | * Invalidation of multiple concurrent ranges may be | ||
85 | * optionally permitted by the driver. Either way the | ||
86 | * establishment of sptes is forbidden in the range passed to | ||
87 | * invalidate_range_begin/end for the whole duration of the | ||
88 | * invalidate_range_begin/end critical section. | ||
89 | * | ||
90 | * invalidate_range_start() is called when all pages in the | ||
91 | * range are still mapped and have at least a refcount of one. | ||
92 | * | ||
93 | * invalidate_range_end() is called when all pages in the | ||
94 | * range have been unmapped and the pages have been freed by | ||
95 | * the VM. | ||
96 | * | ||
97 | * The VM will remove the page table entries and potentially | ||
98 | * the page between invalidate_range_start() and | ||
99 | * invalidate_range_end(). If the page must not be freed | ||
100 | * because of pending I/O or other circumstances then the | ||
101 | * invalidate_range_start() callback (or the initial mapping | ||
102 | * by the driver) must make sure that the refcount is kept | ||
103 | * elevated. | ||
104 | * | ||
105 | * If the driver increases the refcount when the pages are | ||
106 | * initially mapped into an address space then either | ||
107 | * invalidate_range_start() or invalidate_range_end() may | ||
108 | * decrease the refcount. If the refcount is decreased on | ||
109 | * invalidate_range_start() then the VM can free pages as page | ||
110 | * table entries are removed. If the refcount is only | ||
111 | * droppped on invalidate_range_end() then the driver itself | ||
112 | * will drop the last refcount but it must take care to flush | ||
113 | * any secondary tlb before doing the final free on the | ||
114 | * page. Pages will no longer be referenced by the linux | ||
115 | * address space but may still be referenced by sptes until | ||
116 | * the last refcount is dropped. | ||
117 | */ | ||
118 | void (*invalidate_range_start)(struct mmu_notifier *mn, | ||
119 | struct mm_struct *mm, | ||
120 | unsigned long start, unsigned long end); | ||
121 | void (*invalidate_range_end)(struct mmu_notifier *mn, | ||
122 | struct mm_struct *mm, | ||
123 | unsigned long start, unsigned long end); | ||
124 | }; | ||
125 | |||
126 | /* | ||
127 | * The notifier chains are protected by mmap_sem and/or the reverse map | ||
128 | * semaphores. Notifier chains are only changed when all reverse maps and | ||
129 | * the mmap_sem locks are taken. | ||
130 | * | ||
131 | * Therefore notifier chains can only be traversed when either | ||
132 | * | ||
133 | * 1. mmap_sem is held. | ||
134 | * 2. One of the reverse map locks is held (i_mmap_lock or anon_vma->lock). | ||
135 | * 3. No other concurrent thread can access the list (release) | ||
136 | */ | ||
137 | struct mmu_notifier { | ||
138 | struct hlist_node hlist; | ||
139 | const struct mmu_notifier_ops *ops; | ||
140 | }; | ||
141 | |||
142 | static inline int mm_has_notifiers(struct mm_struct *mm) | ||
143 | { | ||
144 | return unlikely(mm->mmu_notifier_mm); | ||
145 | } | ||
146 | |||
147 | extern int mmu_notifier_register(struct mmu_notifier *mn, | ||
148 | struct mm_struct *mm); | ||
149 | extern int __mmu_notifier_register(struct mmu_notifier *mn, | ||
150 | struct mm_struct *mm); | ||
151 | extern void mmu_notifier_unregister(struct mmu_notifier *mn, | ||
152 | struct mm_struct *mm); | ||
153 | extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | ||
154 | extern void __mmu_notifier_release(struct mm_struct *mm); | ||
155 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
156 | unsigned long address); | ||
157 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
158 | unsigned long address); | ||
159 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
160 | unsigned long start, unsigned long end); | ||
161 | extern void __mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
162 | unsigned long start, unsigned long end); | ||
163 | |||
164 | static inline void mmu_notifier_release(struct mm_struct *mm) | ||
165 | { | ||
166 | if (mm_has_notifiers(mm)) | ||
167 | __mmu_notifier_release(mm); | ||
168 | } | ||
169 | |||
170 | static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
171 | unsigned long address) | ||
172 | { | ||
173 | if (mm_has_notifiers(mm)) | ||
174 | return __mmu_notifier_clear_flush_young(mm, address); | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
179 | unsigned long address) | ||
180 | { | ||
181 | if (mm_has_notifiers(mm)) | ||
182 | __mmu_notifier_invalidate_page(mm, address); | ||
183 | } | ||
184 | |||
185 | static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
186 | unsigned long start, unsigned long end) | ||
187 | { | ||
188 | if (mm_has_notifiers(mm)) | ||
189 | __mmu_notifier_invalidate_range_start(mm, start, end); | ||
190 | } | ||
191 | |||
192 | static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
193 | unsigned long start, unsigned long end) | ||
194 | { | ||
195 | if (mm_has_notifiers(mm)) | ||
196 | __mmu_notifier_invalidate_range_end(mm, start, end); | ||
197 | } | ||
198 | |||
199 | static inline void mmu_notifier_mm_init(struct mm_struct *mm) | ||
200 | { | ||
201 | mm->mmu_notifier_mm = NULL; | ||
202 | } | ||
203 | |||
204 | static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | ||
205 | { | ||
206 | if (mm_has_notifiers(mm)) | ||
207 | __mmu_notifier_mm_destroy(mm); | ||
208 | } | ||
209 | |||
210 | /* | ||
211 | * These two macros will sometime replace ptep_clear_flush. | ||
212 | * ptep_clear_flush is impleemnted as macro itself, so this also is | ||
213 | * implemented as a macro until ptep_clear_flush will converted to an | ||
214 | * inline function, to diminish the risk of compilation failure. The | ||
215 | * invalidate_page method over time can be moved outside the PT lock | ||
216 | * and these two macros can be later removed. | ||
217 | */ | ||
218 | #define ptep_clear_flush_notify(__vma, __address, __ptep) \ | ||
219 | ({ \ | ||
220 | pte_t __pte; \ | ||
221 | struct vm_area_struct *___vma = __vma; \ | ||
222 | unsigned long ___address = __address; \ | ||
223 | __pte = ptep_clear_flush(___vma, ___address, __ptep); \ | ||
224 | mmu_notifier_invalidate_page(___vma->vm_mm, ___address); \ | ||
225 | __pte; \ | ||
226 | }) | ||
227 | |||
228 | #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \ | ||
229 | ({ \ | ||
230 | int __young; \ | ||
231 | struct vm_area_struct *___vma = __vma; \ | ||
232 | unsigned long ___address = __address; \ | ||
233 | __young = ptep_clear_flush_young(___vma, ___address, __ptep); \ | ||
234 | __young |= mmu_notifier_clear_flush_young(___vma->vm_mm, \ | ||
235 | ___address); \ | ||
236 | __young; \ | ||
237 | }) | ||
238 | |||
239 | #else /* CONFIG_MMU_NOTIFIER */ | ||
240 | |||
241 | static inline void mmu_notifier_release(struct mm_struct *mm) | ||
242 | { | ||
243 | } | ||
244 | |||
245 | static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | ||
246 | unsigned long address) | ||
247 | { | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | ||
252 | unsigned long address) | ||
253 | { | ||
254 | } | ||
255 | |||
256 | static inline void mmu_notifier_invalidate_range_start(struct mm_struct *mm, | ||
257 | unsigned long start, unsigned long end) | ||
258 | { | ||
259 | } | ||
260 | |||
261 | static inline void mmu_notifier_invalidate_range_end(struct mm_struct *mm, | ||
262 | unsigned long start, unsigned long end) | ||
263 | { | ||
264 | } | ||
265 | |||
266 | static inline void mmu_notifier_mm_init(struct mm_struct *mm) | ||
267 | { | ||
268 | } | ||
269 | |||
270 | static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | ||
271 | { | ||
272 | } | ||
273 | |||
274 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | ||
275 | #define ptep_clear_flush_notify ptep_clear_flush | ||
276 | |||
277 | #endif /* CONFIG_MMU_NOTIFIER */ | ||
278 | |||
279 | #endif /* _LINUX_MMU_NOTIFIER_H */ | ||
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 | ||
106 | struct nameidata; | 106 | struct nameidata; |
107 | 107 | ||
108 | extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, | 108 | struct path; |
109 | extern 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 | ||
111 | extern void mark_mounts_for_expiry(struct list_head *mounts); | 112 | extern 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) | |||
440 | enum netdev_queue_state_t | 438 | enum netdev_queue_state_t |
441 | { | 439 | { |
442 | __QUEUE_STATE_XOFF, | 440 | __QUEUE_STATE_XOFF, |
441 | __QUEUE_STATE_FROZEN, | ||
443 | }; | 442 | }; |
444 | 443 | ||
445 | struct netdev_queue { | 444 | struct 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 | ||
1101 | static 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 | ||
1482 | static 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 | |||
1490 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1491 | { | ||
1492 | txq->xmit_lock_owner = -1; | ||
1493 | spin_unlock(&txq->_xmit_lock); | ||
1494 | } | ||
1495 | |||
1496 | static 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 | */ |
1485 | static inline void netif_tx_lock(struct net_device *dev) | 1509 | static 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 | ||
1502 | static 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 | |||
1510 | static inline int netif_tx_trylock(struct net_device *dev) | ||
1511 | { | ||
1512 | return __netif_tx_trylock(netdev_get_tx_queue(dev, 0)); | ||
1513 | } | ||
1514 | |||
1515 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1516 | { | ||
1517 | txq->xmit_lock_owner = -1; | ||
1518 | spin_unlock(&txq->_xmit_lock); | ||
1519 | } | ||
1520 | |||
1521 | static 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 | |||
1527 | static inline void netif_tx_unlock(struct net_device *dev) | 1537 | static 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 | ||
1538 | static inline void netif_tx_unlock_bh(struct net_device *dev) | 1555 | static 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) | |||
1556 | static inline void netif_tx_disable(struct net_device *dev) | 1573 | static 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 | ||
1568 | static inline void netif_addr_lock(struct net_device *dev) | 1590 | static 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 | |||
33 | struct nf_ct_tcp_flags { | 36 | struct 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/of.h b/include/linux/of.h index 59a61bdc98b6..79886ade070f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -70,5 +70,6 @@ extern int of_n_addr_cells(struct device_node *np); | |||
70 | extern int of_n_size_cells(struct device_node *np); | 70 | extern int of_n_size_cells(struct device_node *np); |
71 | extern const struct of_device_id *of_match_node( | 71 | extern const struct of_device_id *of_match_node( |
72 | const struct of_device_id *matches, const struct device_node *node); | 72 | const struct of_device_id *matches, const struct device_node *node); |
73 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | ||
73 | 74 | ||
74 | #endif /* _LINUX_OF_H */ | 75 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_spi.h b/include/linux/of_spi.h new file mode 100644 index 000000000000..5f71ee8c0868 --- /dev/null +++ b/include/linux/of_spi.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * OpenFirmware SPI support routines | ||
3 | * Copyright (C) 2008 Secret Lab Technologies Ltd. | ||
4 | * | ||
5 | * Support routines for deriving SPI device attachments from the device | ||
6 | * tree. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_SPI_H | ||
10 | #define __LINUX_OF_SPI_H | ||
11 | |||
12 | #include <linux/of.h> | ||
13 | #include <linux/spi/spi.h> | ||
14 | |||
15 | extern void of_register_spi_devices(struct spi_master *master, | ||
16 | struct device_node *np); | ||
17 | |||
18 | #endif /* __LINUX_OF_SPI */ | ||
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 | ||
164 | struct page; /* forward declaration */ | 164 | struct page; /* forward declaration */ |
165 | 165 | ||
166 | PAGEFLAG(Locked, locked) TESTSCFLAG(Locked, locked) | 166 | TESTPAGEFLAG(Locked, locked) |
167 | PAGEFLAG(Error, error) | 167 | PAGEFLAG(Error, error) |
168 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) | 168 | PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) |
169 | PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | 169 | PAGEFLAG(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 | ||
247 | static inline void SetPageUptodate(struct page *page) | 244 | static inline void SetPageUptodate(struct page *page) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index a81d81890422..5da31c12101c 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -20,6 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ | 21 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ |
22 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ | 22 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ |
23 | #define AS_MM_ALL_LOCKS (__GFP_BITS_SHIFT + 2) /* under mm_take_all_locks() */ | ||
23 | 24 | ||
24 | static inline void mapping_set_error(struct address_space *mapping, int error) | 25 | static inline void mapping_set_error(struct address_space *mapping, int error) |
25 | { | 26 | { |
@@ -142,6 +143,29 @@ static inline int page_cache_get_speculative(struct page *page) | |||
142 | return 1; | 143 | return 1; |
143 | } | 144 | } |
144 | 145 | ||
146 | /* | ||
147 | * Same as above, but add instead of inc (could just be merged) | ||
148 | */ | ||
149 | static 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 | |||
145 | static inline int page_freeze_refs(struct page *page, int count) | 169 | static inline int page_freeze_refs(struct page *page, int count) |
146 | { | 170 | { |
147 | return likely(atomic_cmpxchg(&page->_count, count, 0) == count); | 171 | return likely(atomic_cmpxchg(&page->_count, count, 0) == count); |
@@ -226,29 +250,6 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
226 | return read_cache_page(mapping, index, filler, data); | 250 | return read_cache_page(mapping, index, filler, data); |
227 | } | 251 | } |
228 | 252 | ||
229 | int add_to_page_cache_locked(struct page *page, struct address_space *mapping, | ||
230 | pgoff_t index, gfp_t gfp_mask); | ||
231 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | ||
232 | pgoff_t index, gfp_t gfp_mask); | ||
233 | extern void remove_from_page_cache(struct page *page); | ||
234 | extern void __remove_from_page_cache(struct page *page); | ||
235 | |||
236 | /* | ||
237 | * Like add_to_page_cache_locked, but used to add newly allocated pages: | ||
238 | * the page is new, so we can just run SetPageLocked() against it. | ||
239 | */ | ||
240 | static inline int add_to_page_cache(struct page *page, | ||
241 | struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) | ||
242 | { | ||
243 | int error; | ||
244 | |||
245 | SetPageLocked(page); | ||
246 | error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); | ||
247 | if (unlikely(error)) | ||
248 | ClearPageLocked(page); | ||
249 | return error; | ||
250 | } | ||
251 | |||
252 | /* | 253 | /* |
253 | * Return byte-offset into filesystem object for page. | 254 | * Return byte-offset into filesystem object for page. |
254 | */ | 255 | */ |
@@ -270,13 +271,28 @@ extern int __lock_page_killable(struct page *page); | |||
270 | extern void __lock_page_nosync(struct page *page); | 271 | extern void __lock_page_nosync(struct page *page); |
271 | extern void unlock_page(struct page *page); | 272 | extern void unlock_page(struct page *page); |
272 | 273 | ||
274 | static inline void set_page_locked(struct page *page) | ||
275 | { | ||
276 | set_bit(PG_locked, &page->flags); | ||
277 | } | ||
278 | |||
279 | static inline void clear_page_locked(struct page *page) | ||
280 | { | ||
281 | clear_bit(PG_locked, &page->flags); | ||
282 | } | ||
283 | |||
284 | static inline int trylock_page(struct page *page) | ||
285 | { | ||
286 | return !test_and_set_bit(PG_locked, &page->flags); | ||
287 | } | ||
288 | |||
273 | /* | 289 | /* |
274 | * 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. |
275 | */ | 291 | */ |
276 | static inline void lock_page(struct page *page) | 292 | static inline void lock_page(struct page *page) |
277 | { | 293 | { |
278 | might_sleep(); | 294 | might_sleep(); |
279 | if (TestSetPageLocked(page)) | 295 | if (!trylock_page(page)) |
280 | __lock_page(page); | 296 | __lock_page(page); |
281 | } | 297 | } |
282 | 298 | ||
@@ -288,7 +304,7 @@ static inline void lock_page(struct page *page) | |||
288 | static inline int lock_page_killable(struct page *page) | 304 | static inline int lock_page_killable(struct page *page) |
289 | { | 305 | { |
290 | might_sleep(); | 306 | might_sleep(); |
291 | if (TestSetPageLocked(page)) | 307 | if (!trylock_page(page)) |
292 | return __lock_page_killable(page); | 308 | return __lock_page_killable(page); |
293 | return 0; | 309 | return 0; |
294 | } | 310 | } |
@@ -300,7 +316,7 @@ static inline int lock_page_killable(struct page *page) | |||
300 | static inline void lock_page_nosync(struct page *page) | 316 | static inline void lock_page_nosync(struct page *page) |
301 | { | 317 | { |
302 | might_sleep(); | 318 | might_sleep(); |
303 | if (TestSetPageLocked(page)) | 319 | if (!trylock_page(page)) |
304 | __lock_page_nosync(page); | 320 | __lock_page_nosync(page); |
305 | } | 321 | } |
306 | 322 | ||
@@ -385,4 +401,27 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size) | |||
385 | return ret; | 401 | return ret; |
386 | } | 402 | } |
387 | 403 | ||
404 | int add_to_page_cache_locked(struct page *page, struct address_space *mapping, | ||
405 | pgoff_t index, gfp_t gfp_mask); | ||
406 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | ||
407 | pgoff_t index, gfp_t gfp_mask); | ||
408 | extern void remove_from_page_cache(struct page *page); | ||
409 | extern 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 | */ | ||
415 | static 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 | |||
388 | #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 | ||
17 | typedef const struct match_token match_table_t[]; | 17 | typedef 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 */ |
20 | enum {MAX_OPT_ARGS = 3}; | 20 | enum {MAX_OPT_ARGS = 3}; |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index a1a1e618e996..91ba0b338b47 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
@@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | |||
27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 29 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); |
30 | extern void pcie_no_aspm(void); | ||
30 | #else | 31 | #else |
31 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 32 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
32 | { | 33 | { |
@@ -40,6 +41,10 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) | |||
40 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) | 41 | static inline void pci_disable_link_state(struct pci_dev *pdev, int state) |
41 | { | 42 | { |
42 | } | 43 | } |
44 | |||
45 | static inline void pcie_no_aspm(void) | ||
46 | { | ||
47 | } | ||
43 | #endif | 48 | #endif |
44 | 49 | ||
45 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ | 50 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1d296d31abe0..c0e14008a3c2 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -124,6 +124,8 @@ enum pci_dev_flags { | |||
124 | * generation too. | 124 | * generation too. |
125 | */ | 125 | */ |
126 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, | 126 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, |
127 | /* Device configuration is irrevocably lost if disabled into D3 */ | ||
128 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | ||
127 | }; | 129 | }; |
128 | 130 | ||
129 | typedef unsigned short __bitwise pci_bus_flags_t; | 131 | typedef unsigned short __bitwise pci_bus_flags_t; |
@@ -639,6 +641,7 @@ int pci_restore_state(struct pci_dev *dev); | |||
639 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 641 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
640 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 642 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
641 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 643 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
644 | void pci_pme_active(struct pci_dev *dev, bool enable); | ||
642 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 645 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); |
643 | pci_power_t pci_target_state(struct pci_dev *dev); | 646 | pci_power_t pci_target_state(struct pci_dev *dev); |
644 | int pci_prepare_to_sleep(struct pci_dev *dev); | 647 | int pci_prepare_to_sleep(struct pci_dev *dev); |
@@ -678,10 +681,12 @@ void pci_enable_bridges(struct pci_bus *bus); | |||
678 | /* Proper probing supporting hot-pluggable devices */ | 681 | /* Proper probing supporting hot-pluggable devices */ |
679 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, | 682 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
680 | const char *mod_name); | 683 | const char *mod_name); |
681 | static inline int __must_check pci_register_driver(struct pci_driver *driver) | 684 | |
682 | { | 685 | /* |
683 | return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); | 686 | * pci_register_driver must be a macro so that KBUILD_MODNAME can be expanded |
684 | } | 687 | */ |
688 | #define pci_register_driver(driver) \ | ||
689 | __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) | ||
685 | 690 | ||
686 | void pci_unregister_driver(struct pci_driver *dev); | 691 | void pci_unregister_driver(struct pci_driver *dev); |
687 | void pci_remove_behind_bridge(struct pci_dev *dev); | 692 | void 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/pci_regs.h b/include/linux/pci_regs.h index 19958b929905..450684f7eaac 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -374,6 +374,7 @@ | |||
374 | #define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ | 374 | #define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ |
375 | #define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ | 375 | #define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ |
376 | #define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ | 376 | #define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ |
377 | #define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */ | ||
377 | #define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ | 378 | #define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ |
378 | #define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ | 379 | #define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ |
379 | #define PCI_EXP_DEVCTL 8 /* Device Control */ | 380 | #define PCI_EXP_DEVCTL 8 /* Device Control */ |
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 | ||
44 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 44 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
45 | char *path, int remount); | 45 | char *path, int remount); |
46 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | ||
47 | struct path *path); | ||
46 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 48 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
47 | int format_id, int type); | 49 | int format_id, int type); |
48 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 50 | int 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 |
118 | extern struct lockdep_map rcu_lock_map; | 118 | extern 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/rculist.h b/include/linux/rculist.h index b0f39be08b6c..eb4443c7e05b 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -98,6 +98,34 @@ static inline void list_del_rcu(struct list_head *entry) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * hlist_del_init_rcu - deletes entry from hash list with re-initialization | ||
102 | * @n: the element to delete from the hash list. | ||
103 | * | ||
104 | * Note: list_unhashed() on the node return true after this. It is | ||
105 | * useful for RCU based read lockfree traversal if the writer side | ||
106 | * must know if the list entry is still hashed or already unhashed. | ||
107 | * | ||
108 | * In particular, it means that we can not poison the forward pointers | ||
109 | * that may still be used for walking the hash list and we can only | ||
110 | * zero the pprev pointer so list_unhashed() will return true after | ||
111 | * this. | ||
112 | * | ||
113 | * The caller must take whatever precautions are necessary (such as | ||
114 | * holding appropriate locks) to avoid racing with another | ||
115 | * list-mutation primitive, such as hlist_add_head_rcu() or | ||
116 | * hlist_del_rcu(), running on this same list. However, it is | ||
117 | * perfectly legal to run concurrently with the _rcu list-traversal | ||
118 | * primitives, such as hlist_for_each_entry_rcu(). | ||
119 | */ | ||
120 | static inline void hlist_del_init_rcu(struct hlist_node *n) | ||
121 | { | ||
122 | if (!hlist_unhashed(n)) { | ||
123 | __hlist_del(n); | ||
124 | n->pprev = NULL; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | /** | ||
101 | * list_replace_rcu - replace old entry by new one | 129 | * list_replace_rcu - replace old entry by new one |
102 | * @old : the element to be replaced | 130 | * @old : the element to be replaced |
103 | * @new : the new element to insert | 131 | * @new : the new element to insert |
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 | */ | ||
18 | struct 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 | |||
102 | struct 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 | */ | ||
116 | struct regulator_bulk_data { | ||
117 | const char *supply; | ||
118 | struct regulator *consumer; | ||
119 | }; | ||
120 | |||
121 | #if defined(CONFIG_REGULATOR) | ||
122 | |||
123 | /* regulator get and put */ | ||
124 | struct regulator *__must_check regulator_get(struct device *dev, | ||
125 | const char *id); | ||
126 | void regulator_put(struct regulator *regulator); | ||
127 | |||
128 | /* regulator output control and status */ | ||
129 | int regulator_enable(struct regulator *regulator); | ||
130 | int regulator_disable(struct regulator *regulator); | ||
131 | int regulator_force_disable(struct regulator *regulator); | ||
132 | int regulator_is_enabled(struct regulator *regulator); | ||
133 | |||
134 | int regulator_bulk_get(struct device *dev, int num_consumers, | ||
135 | struct regulator_bulk_data *consumers); | ||
136 | int regulator_bulk_enable(int num_consumers, | ||
137 | struct regulator_bulk_data *consumers); | ||
138 | int regulator_bulk_disable(int num_consumers, | ||
139 | struct regulator_bulk_data *consumers); | ||
140 | void regulator_bulk_free(int num_consumers, | ||
141 | struct regulator_bulk_data *consumers); | ||
142 | |||
143 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | ||
144 | int regulator_get_voltage(struct regulator *regulator); | ||
145 | int regulator_set_current_limit(struct regulator *regulator, | ||
146 | int min_uA, int max_uA); | ||
147 | int regulator_get_current_limit(struct regulator *regulator); | ||
148 | |||
149 | int regulator_set_mode(struct regulator *regulator, unsigned int mode); | ||
150 | unsigned int regulator_get_mode(struct regulator *regulator); | ||
151 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | ||
152 | |||
153 | /* regulator notifier block */ | ||
154 | int regulator_register_notifier(struct regulator *regulator, | ||
155 | struct notifier_block *nb); | ||
156 | int regulator_unregister_notifier(struct regulator *regulator, | ||
157 | struct notifier_block *nb); | ||
158 | |||
159 | /* driver data - core doesn't touch */ | ||
160 | void *regulator_get_drvdata(struct regulator *regulator); | ||
161 | void 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 | */ | ||
169 | static 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 | } | ||
178 | static inline void regulator_put(struct regulator *regulator) | ||
179 | { | ||
180 | } | ||
181 | |||
182 | static inline int regulator_enable(struct regulator *regulator) | ||
183 | { | ||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | static inline int regulator_disable(struct regulator *regulator) | ||
188 | { | ||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | static inline int regulator_is_enabled(struct regulator *regulator) | ||
193 | { | ||
194 | return 1; | ||
195 | } | ||
196 | |||
197 | static inline int regulator_bulk_get(struct device *dev, | ||
198 | int num_consumers, | ||
199 | struct regulator_bulk_data *consumers) | ||
200 | { | ||
201 | return 0; | ||
202 | } | ||
203 | |||
204 | static inline int regulator_bulk_enable(int num_consumers, | ||
205 | struct regulator_bulk_data *consumers) | ||
206 | { | ||
207 | return 0; | ||
208 | } | ||
209 | |||
210 | static inline int regulator_bulk_disable(int num_consumers, | ||
211 | struct regulator_bulk_data *consumers) | ||
212 | { | ||
213 | return 0; | ||
214 | } | ||
215 | |||
216 | static inline void regulator_bulk_free(int num_consumers, | ||
217 | struct regulator_bulk_data *consumers) | ||
218 | { | ||
219 | } | ||
220 | |||
221 | static inline int regulator_set_voltage(struct regulator *regulator, | ||
222 | int min_uV, int max_uV) | ||
223 | { | ||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | static inline int regulator_get_voltage(struct regulator *regulator) | ||
228 | { | ||
229 | return 0; | ||
230 | } | ||
231 | |||
232 | static inline int regulator_set_current_limit(struct regulator *regulator, | ||
233 | int min_uA, int max_uA) | ||
234 | { | ||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | static inline int regulator_get_current_limit(struct regulator *regulator) | ||
239 | { | ||
240 | return 0; | ||
241 | } | ||
242 | |||
243 | static inline int regulator_set_mode(struct regulator *regulator, | ||
244 | unsigned int mode) | ||
245 | { | ||
246 | return 0; | ||
247 | } | ||
248 | |||
249 | static inline unsigned int regulator_get_mode(struct regulator *regulator) | ||
250 | { | ||
251 | return REGULATOR_MODE_NORMAL; | ||
252 | } | ||
253 | |||
254 | static inline int regulator_set_optimum_mode(struct regulator *regulator, | ||
255 | int load_uA) | ||
256 | { | ||
257 | return REGULATOR_MODE_NORMAL; | ||
258 | } | ||
259 | |||
260 | static inline int regulator_register_notifier(struct regulator *regulator, | ||
261 | struct notifier_block *nb) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int regulator_unregister_notifier(struct regulator *regulator, | ||
267 | struct notifier_block *nb) | ||
268 | { | ||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static inline void *regulator_get_drvdata(struct regulator *regulator) | ||
273 | { | ||
274 | return NULL; | ||
275 | } | ||
276 | |||
277 | static 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 | |||
21 | struct regulator_constraints; | ||
22 | struct regulator_dev; | ||
23 | |||
24 | /** | ||
25 | * struct regulator_ops - regulator operations. | ||
26 | * | ||
27 | * This struct describes regulator operations. | ||
28 | */ | ||
29 | struct 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 | */ | ||
70 | enum regulator_type { | ||
71 | REGULATOR_VOLTAGE, | ||
72 | REGULATOR_CURRENT, | ||
73 | }; | ||
74 | |||
75 | /** | ||
76 | * struct regulator_desc - Regulator descriptor | ||
77 | * | ||
78 | */ | ||
79 | struct 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 | |||
89 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | ||
90 | void *reg_data); | ||
91 | void regulator_unregister(struct regulator_dev *rdev); | ||
92 | |||
93 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | ||
94 | unsigned long event, void *data); | ||
95 | |||
96 | void *rdev_get_drvdata(struct regulator_dev *rdev); | ||
97 | int 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 | |||
17 | struct 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 | |||
21 | struct 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 | */ | ||
48 | struct 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 | */ | ||
59 | struct 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 | |||
92 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | ||
93 | |||
94 | const char *regulator_get_supply(const char *regulator); | ||
95 | |||
96 | int regulator_set_machine_constraints(const char *regulator, | ||
97 | struct regulation_constraints *constraints); | ||
98 | |||
99 | int regulator_set_device_supply(const char *regulator, struct device *dev, | ||
100 | const char *supply); | ||
101 | |||
102 | int 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/rmap.h b/include/linux/rmap.h index 1383692ac5bd..69407f85e10b 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -26,6 +26,14 @@ | |||
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | spinlock_t lock; /* Serialize access to vma list */ | 28 | spinlock_t lock; /* Serialize access to vma list */ |
29 | /* | ||
30 | * NOTE: the LSB of the head.next is set by | ||
31 | * mm_take_all_locks() _after_ taking the above lock. So the | ||
32 | * head must only be read/written after taking the above lock | ||
33 | * to be sure to see a valid next pointer. The LSB bit itself | ||
34 | * is serialized by a system wide lock only visible to | ||
35 | * mm_take_all_locks() (mm_all_locks_mutex). | ||
36 | */ | ||
29 | struct list_head head; /* List of private "related" vmas */ | 37 | struct list_head head; /* List of private "related" vmas */ |
30 | }; | 38 | }; |
31 | 39 | ||
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 | ||
1552 | extern unsigned long long sched_clock(void); | 1553 | extern unsigned long long sched_clock(void); |
1553 | 1554 | ||
1554 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | 1555 | extern void sched_clock_init(void); |
1555 | static inline void sched_clock_init(void) | 1556 | extern u64 sched_clock_cpu(int cpu); |
1556 | { | ||
1557 | } | ||
1558 | |||
1559 | static inline u64 sched_clock_cpu(int cpu) | ||
1560 | { | ||
1561 | return sched_clock(); | ||
1562 | } | ||
1563 | 1557 | ||
1558 | #ifndef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK | ||
1564 | static inline void sched_clock_tick(void) | 1559 | static inline void sched_clock_tick(void) |
1565 | { | 1560 | { |
1566 | } | 1561 | } |
@@ -1572,28 +1567,11 @@ static inline void sched_clock_idle_sleep_event(void) | |||
1572 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | 1567 | static inline void sched_clock_idle_wakeup_event(u64 delta_ns) |
1573 | { | 1568 | { |
1574 | } | 1569 | } |
1575 | 1570 | #else | |
1576 | #ifdef CONFIG_NO_HZ | ||
1577 | static inline void sched_clock_tick_stop(int cpu) | ||
1578 | { | ||
1579 | } | ||
1580 | |||
1581 | static inline void sched_clock_tick_start(int cpu) | ||
1582 | { | ||
1583 | } | ||
1584 | #endif | ||
1585 | |||
1586 | #else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */ | ||
1587 | extern void sched_clock_init(void); | ||
1588 | extern u64 sched_clock_cpu(int cpu); | ||
1589 | extern void sched_clock_tick(void); | 1571 | extern void sched_clock_tick(void); |
1590 | extern void sched_clock_idle_sleep_event(void); | 1572 | extern void sched_clock_idle_sleep_event(void); |
1591 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1573 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1592 | #ifdef CONFIG_NO_HZ | ||
1593 | extern void sched_clock_tick_stop(int cpu); | ||
1594 | extern 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 | ||
8 | struct seq_operations; | 10 | struct seq_operations; |
9 | struct file; | 11 | struct file; |
@@ -47,6 +49,16 @@ int seq_path(struct seq_file *, struct path *, char *); | |||
47 | int seq_dentry(struct seq_file *, struct dentry *, char *); | 49 | int seq_dentry(struct seq_file *, struct dentry *, char *); |
48 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, | 50 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, |
49 | char *esc); | 51 | char *esc); |
52 | int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits); | ||
53 | static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask) | ||
54 | { | ||
55 | return seq_bitmap(m, mask->bits, NR_CPUS); | ||
56 | } | ||
57 | |||
58 | static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) | ||
59 | { | ||
60 | return seq_bitmap(m, mask->bits, MAX_NUMNODES); | ||
61 | } | ||
50 | 62 | ||
51 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); | 63 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *); |
52 | int single_release(struct inode *, struct file *); | 64 | int single_release(struct inode *, struct file *); |
diff --git a/include/linux/serio.h b/include/linux/serio.h index e72716cca577..25641d9e0ea8 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -87,11 +87,10 @@ void serio_unregister_port(struct serio *serio); | |||
87 | void serio_unregister_child_port(struct serio *serio); | 87 | void serio_unregister_child_port(struct serio *serio); |
88 | 88 | ||
89 | int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); | 89 | int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); |
90 | static inline int serio_register_driver(struct serio_driver *drv) | 90 | static inline int __must_check serio_register_driver(struct serio_driver *drv) |
91 | { | 91 | { |
92 | return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); | 92 | return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); |
93 | } | 93 | } |
94 | int serio_register_driver(struct serio_driver *drv); | ||
95 | void serio_unregister_driver(struct serio_driver *drv); | 94 | void serio_unregister_driver(struct serio_driver *drv); |
96 | 95 | ||
97 | static inline int serio_write(struct serio *serio, unsigned char data) | 96 | static inline int serio_write(struct serio *serio, unsigned char data) |
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); | |||
897 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | 901 | static 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 | ||
1323 | static inline int skb_add_data(struct sk_buff *skb, | 1327 | static 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 { | |||
46 | struct kmem_cache_node { | 46 | struct 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 | |||
12 | struct orion_spi_info { | ||
13 | u32 tclk; /* no <linux/clk.h> support yet */ | ||
14 | }; | ||
15 | |||
16 | |||
17 | #endif | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a9cc29d46653..4be01bb44377 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -778,8 +778,20 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n) | |||
778 | * use spi_new_device() to describe each device. You can also call | 778 | * use spi_new_device() to describe each device. You can also call |
779 | * spi_unregister_device() to start making that device vanish, but | 779 | * spi_unregister_device() to start making that device vanish, but |
780 | * normally that would be handled by spi_unregister_master(). | 780 | * normally that would be handled by spi_unregister_master(). |
781 | * | ||
782 | * You can also use spi_alloc_device() and spi_add_device() to use a two | ||
783 | * stage registration sequence for each spi_device. This gives the caller | ||
784 | * some more control over the spi_device structure before it is registered, | ||
785 | * but requires that caller to initialize fields that would otherwise | ||
786 | * be defined using the board info. | ||
781 | */ | 787 | */ |
782 | extern struct spi_device * | 788 | extern struct spi_device * |
789 | spi_alloc_device(struct spi_master *master); | ||
790 | |||
791 | extern int | ||
792 | spi_add_device(struct spi_device *spi); | ||
793 | |||
794 | extern struct spi_device * | ||
783 | spi_new_device(struct spi_master *, struct spi_board_info *); | 795 | spi_new_device(struct spi_master *, struct spi_board_info *); |
784 | 796 | ||
785 | static inline void | 797 | static inline void |
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); | |||
22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); | 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); |
23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) |
24 | __acquires(lock); | 24 | __acquires(lock); |
25 | void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map) | ||
26 | __acquires(lock); | ||
25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); | 27 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); |
26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); | 28 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); |
27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); | 29 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 5bfc553bdb21..f1cb0ba6d715 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -5,41 +5,43 @@ | |||
5 | (and more). So the "read" side to such a lock is anything which | 5 | (and more). So the "read" side to such a lock is anything which |
6 | diables preeempt. */ | 6 | diables preeempt. */ |
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <linux/cpumask.h> | ||
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
10 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
12 | |||
13 | /* Deprecated, but useful for transition. */ | ||
14 | #define ALL_CPUS ~0U | ||
15 | |||
11 | /** | 16 | /** |
12 | * stop_machine_run: freeze the machine on all CPUs and run this function | 17 | * stop_machine: freeze the machine on all CPUs and run this function |
13 | * @fn: the function to run | 18 | * @fn: the function to run |
14 | * @data: the data ptr for the @fn() | 19 | * @data: the data ptr for the @fn() |
15 | * @cpu: the cpu to run @fn() on (or any, if @cpu == NR_CPUS. | 20 | * @cpus: the cpus to run the @fn() on (NULL = any online cpu) |
16 | * | 21 | * |
17 | * Description: This causes a thread to be scheduled on every other cpu, | 22 | * Description: This causes a thread to be scheduled on every cpu, |
18 | * each of which disables interrupts, and finally interrupts are disabled | 23 | * each of which disables interrupts. The result is that noone is |
19 | * on the current CPU. The result is that noone is holding a spinlock | 24 | * holding a spinlock or inside any other preempt-disabled region when |
20 | * or inside any other preempt-disabled region when @fn() runs. | 25 | * @fn() runs. |
21 | * | 26 | * |
22 | * This can be thought of as a very heavy write lock, equivalent to | 27 | * This can be thought of as a very heavy write lock, equivalent to |
23 | * grabbing every spinlock in the kernel. */ | 28 | * grabbing every spinlock in the kernel. */ |
24 | int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu); | 29 | int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); |
25 | 30 | ||
26 | /** | 31 | /** |
27 | * __stop_machine_run: freeze the machine on all CPUs and run this function | 32 | * __stop_machine: freeze the machine on all CPUs and run this function |
28 | * @fn: the function to run | 33 | * @fn: the function to run |
29 | * @data: the data ptr for the @fn | 34 | * @data: the data ptr for the @fn |
30 | * @cpu: the cpu to run @fn on (or any, if @cpu == NR_CPUS. | 35 | * @cpus: the cpus to run the @fn() on (NULL = any online cpu) |
31 | * | 36 | * |
32 | * Description: This is a special version of the above, which returns the | 37 | * Description: This is a special version of the above, which assumes cpus |
33 | * thread which has run @fn(): kthread_stop will return the return value | 38 | * won't come or go while it's being called. Used by hotplug cpu. |
34 | * of @fn(). Used by hotplug cpu. | ||
35 | */ | 39 | */ |
36 | struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, | 40 | int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); |
37 | unsigned int cpu); | ||
38 | |||
39 | #else | 41 | #else |
40 | 42 | ||
41 | static inline int stop_machine_run(int (*fn)(void *), void *data, | 43 | static inline int stop_machine(int (*fn)(void *), void *data, |
42 | unsigned int cpu) | 44 | const cpumask_t *cpus) |
43 | { | 45 | { |
44 | int ret; | 46 | int ret; |
45 | local_irq_disable(); | 47 | local_irq_disable(); |
@@ -48,4 +50,18 @@ static inline int stop_machine_run(int (*fn)(void *), void *data, | |||
48 | return ret; | 50 | return ret; |
49 | } | 51 | } |
50 | #endif /* CONFIG_SMP */ | 52 | #endif /* CONFIG_SMP */ |
53 | |||
54 | static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data, | ||
55 | unsigned int cpu) | ||
56 | { | ||
57 | /* If they don't care which cpu fn runs on, just pick one. */ | ||
58 | if (cpu == NR_CPUS) | ||
59 | return stop_machine(fn, data, NULL); | ||
60 | else if (cpu == ~0U) | ||
61 | return stop_machine(fn, data, &cpu_possible_map); | ||
62 | else { | ||
63 | cpumask_t cpus = cpumask_of_cpu(cpu); | ||
64 | return stop_machine(fn, data, &cpus); | ||
65 | } | ||
66 | } | ||
51 | #endif /* _LINUX_STOP_MACHINE */ | 67 | #endif /* _LINUX_STOP_MACHINE */ |
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 | |||
46 | static 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 | |||
57 | static 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 | |||
68 | static 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 | |||
83 | static 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 | |||
94 | static 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 | */ | ||
158 | static 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 | */ | ||
171 | static 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 | */ | ||
184 | static 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 | */ | ||
199 | static 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 | */ | ||
214 | static 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 | */ | ||
227 | static 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 | */ | ||
239 | static 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 | */ | ||
252 | static 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 | */ | ||
267 | static 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 | */ | ||
282 | static 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 | */ | ||
13 | enum 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 | |||
20 | struct clk; | ||
21 | |||
22 | struct musb_hdrc_eps_bits { | ||
23 | const char name[16]; | ||
24 | u8 bits; | ||
25 | }; | ||
26 | |||
27 | struct 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 | |||
52 | struct 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 | |||
90 | extern 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 | |||
96 | extern 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/videodev.h b/include/linux/videodev.h index 9385a566aed8..15a653d41132 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h | |||
@@ -17,6 +17,21 @@ | |||
17 | 17 | ||
18 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) | 18 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) |
19 | 19 | ||
20 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
21 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
22 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
23 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
24 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
25 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
26 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
27 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
28 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
29 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
30 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
31 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
32 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
33 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
34 | |||
20 | struct video_capability | 35 | struct video_capability |
21 | { | 36 | { |
22 | char name[32]; | 37 | char name[32]; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 2e66a95e8d32..e466bd54a50e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -71,6 +71,11 @@ | |||
71 | */ | 71 | */ |
72 | #define VIDEO_MAX_FRAME 32 | 72 | #define VIDEO_MAX_FRAME 32 |
73 | 73 | ||
74 | #ifndef __KERNEL__ | ||
75 | |||
76 | /* These defines are V4L1 specific and should not be used with the V4L2 API! | ||
77 | They will be removed from this header in the future. */ | ||
78 | |||
74 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | 79 | #define VID_TYPE_CAPTURE 1 /* Can capture */ |
75 | #define VID_TYPE_TUNER 2 /* Can tune */ | 80 | #define VID_TYPE_TUNER 2 /* Can tune */ |
76 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | 81 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ |
@@ -85,14 +90,15 @@ | |||
85 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | 90 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ |
86 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | 91 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ |
87 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | 92 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ |
93 | #endif | ||
88 | 94 | ||
89 | /* | 95 | /* |
90 | * M I S C E L L A N E O U S | 96 | * M I S C E L L A N E O U S |
91 | */ | 97 | */ |
92 | 98 | ||
93 | /* Four-character-code (FOURCC) */ | 99 | /* Four-character-code (FOURCC) */ |
94 | #define v4l2_fourcc(a,b,c,d)\ | 100 | #define v4l2_fourcc(a, b, c, d)\ |
95 | (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) | 101 | ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) |
96 | 102 | ||
97 | /* | 103 | /* |
98 | * E N U M S | 104 | * E N U M S |
@@ -226,8 +232,7 @@ struct v4l2_fract { | |||
226 | /* | 232 | /* |
227 | * D R I V E R C A P A B I L I T I E S | 233 | * D R I V E R C A P A B I L I T I E S |
228 | */ | 234 | */ |
229 | struct v4l2_capability | 235 | struct v4l2_capability { |
230 | { | ||
231 | __u8 driver[16]; /* i.e. "bttv" */ | 236 | __u8 driver[16]; /* i.e. "bttv" */ |
232 | __u8 card[32]; /* i.e. "Hauppauge WinTV" */ | 237 | __u8 card[32]; /* i.e. "Hauppauge WinTV" */ |
233 | __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ | 238 | __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ |
@@ -259,8 +264,7 @@ struct v4l2_capability | |||
259 | /* | 264 | /* |
260 | * V I D E O I M A G E F O R M A T | 265 | * V I D E O I M A G E F O R M A T |
261 | */ | 266 | */ |
262 | struct v4l2_pix_format | 267 | struct v4l2_pix_format { |
263 | { | ||
264 | __u32 width; | 268 | __u32 width; |
265 | __u32 height; | 269 | __u32 height; |
266 | __u32 pixelformat; | 270 | __u32 pixelformat; |
@@ -272,68 +276,69 @@ struct v4l2_pix_format | |||
272 | }; | 276 | }; |
273 | 277 | ||
274 | /* Pixel format FOURCC depth Description */ | 278 | /* Pixel format FOURCC depth Description */ |
275 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ | 279 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ |
276 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */ | 280 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ |
277 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ | 281 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ |
278 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ | 282 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ |
279 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */ | 283 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ |
280 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */ | 284 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ |
281 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */ | 285 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ |
282 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */ | 286 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ |
283 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ | 287 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ |
284 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ | 288 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ |
285 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ | 289 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
286 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y','1','6',' ') /* 16 Greyscale */ | 290 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
287 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P','A','L','8') /* 8 8-bit palette */ | 291 | #define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ |
288 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ | 292 | #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ |
289 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ | 293 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
290 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */ | 294 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ |
291 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */ | 295 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ |
292 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */ | 296 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ |
293 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */ | 297 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ |
294 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */ | 298 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ |
295 | #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y','4','4','4') /* 16 xxxxyyyy uuuuvvvv */ | 299 | #define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */ |
296 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y','U','V','O') /* 16 YUV-5-5-5 */ | 300 | #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ |
297 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y','U','V','P') /* 16 YUV-5-6-5 */ | 301 | #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ |
298 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y','U','V','4') /* 32 YUV-8-8-8-8 */ | 302 | #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ |
299 | 303 | ||
300 | /* two planes -- one Y, one Cr + Cb interleaved */ | 304 | /* two planes -- one Y, one Cr + Cb interleaved */ |
301 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */ | 305 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
302 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */ | 306 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ |
303 | 307 | ||
304 | /* The following formats are not defined in the V4L2 specification */ | 308 | /* The following formats are not defined in the V4L2 specification */ |
305 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */ | 309 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ |
306 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ | 310 | #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ |
307 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ | 311 | #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */ |
308 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ | 312 | #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ |
309 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ | 313 | #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ |
310 | 314 | ||
311 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 315 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
312 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 316 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
313 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G') /* 8 GBGB.. RGRG.. */ | 317 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
314 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ | 318 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ |
315 | 319 | ||
316 | /* compressed formats */ | 320 | /* compressed formats */ |
317 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ | 321 | #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ |
318 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ | 322 | #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ |
319 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ | 323 | #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ |
320 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ | 324 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ |
321 | 325 | ||
322 | /* Vendor-specific formats */ | 326 | /* Vendor-specific formats */ |
323 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ | 327 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
324 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ | 328 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
325 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ | 329 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ |
326 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ | 330 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ |
327 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ | 331 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ |
328 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */ | 332 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */ |
329 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */ | 333 | #define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */ |
330 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */ | 334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ |
335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | ||
336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | ||
331 | 337 | ||
332 | /* | 338 | /* |
333 | * F O R M A T E N U M E R A T I O N | 339 | * F O R M A T E N U M E R A T I O N |
334 | */ | 340 | */ |
335 | struct v4l2_fmtdesc | 341 | struct v4l2_fmtdesc { |
336 | { | ||
337 | __u32 index; /* Format number */ | 342 | __u32 index; /* Format number */ |
338 | enum v4l2_buf_type type; /* buffer type */ | 343 | enum v4l2_buf_type type; /* buffer type */ |
339 | __u32 flags; | 344 | __u32 flags; |
@@ -349,21 +354,18 @@ struct v4l2_fmtdesc | |||
349 | /* | 354 | /* |
350 | * F R A M E S I Z E E N U M E R A T I O N | 355 | * F R A M E S I Z E E N U M E R A T I O N |
351 | */ | 356 | */ |
352 | enum v4l2_frmsizetypes | 357 | enum v4l2_frmsizetypes { |
353 | { | ||
354 | V4L2_FRMSIZE_TYPE_DISCRETE = 1, | 358 | V4L2_FRMSIZE_TYPE_DISCRETE = 1, |
355 | V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, | 359 | V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, |
356 | V4L2_FRMSIZE_TYPE_STEPWISE = 3, | 360 | V4L2_FRMSIZE_TYPE_STEPWISE = 3, |
357 | }; | 361 | }; |
358 | 362 | ||
359 | struct v4l2_frmsize_discrete | 363 | struct v4l2_frmsize_discrete { |
360 | { | ||
361 | __u32 width; /* Frame width [pixel] */ | 364 | __u32 width; /* Frame width [pixel] */ |
362 | __u32 height; /* Frame height [pixel] */ | 365 | __u32 height; /* Frame height [pixel] */ |
363 | }; | 366 | }; |
364 | 367 | ||
365 | struct v4l2_frmsize_stepwise | 368 | struct v4l2_frmsize_stepwise { |
366 | { | ||
367 | __u32 min_width; /* Minimum frame width [pixel] */ | 369 | __u32 min_width; /* Minimum frame width [pixel] */ |
368 | __u32 max_width; /* Maximum frame width [pixel] */ | 370 | __u32 max_width; /* Maximum frame width [pixel] */ |
369 | __u32 step_width; /* Frame width step size [pixel] */ | 371 | __u32 step_width; /* Frame width step size [pixel] */ |
@@ -372,8 +374,7 @@ struct v4l2_frmsize_stepwise | |||
372 | __u32 step_height; /* Frame height step size [pixel] */ | 374 | __u32 step_height; /* Frame height step size [pixel] */ |
373 | }; | 375 | }; |
374 | 376 | ||
375 | struct v4l2_frmsizeenum | 377 | struct v4l2_frmsizeenum { |
376 | { | ||
377 | __u32 index; /* Frame size number */ | 378 | __u32 index; /* Frame size number */ |
378 | __u32 pixel_format; /* Pixel format */ | 379 | __u32 pixel_format; /* Pixel format */ |
379 | __u32 type; /* Frame size type the device supports. */ | 380 | __u32 type; /* Frame size type the device supports. */ |
@@ -389,22 +390,19 @@ struct v4l2_frmsizeenum | |||
389 | /* | 390 | /* |
390 | * F R A M E R A T E E N U M E R A T I O N | 391 | * F R A M E R A T E E N U M E R A T I O N |
391 | */ | 392 | */ |
392 | enum v4l2_frmivaltypes | 393 | enum v4l2_frmivaltypes { |
393 | { | ||
394 | V4L2_FRMIVAL_TYPE_DISCRETE = 1, | 394 | V4L2_FRMIVAL_TYPE_DISCRETE = 1, |
395 | V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, | 395 | V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, |
396 | V4L2_FRMIVAL_TYPE_STEPWISE = 3, | 396 | V4L2_FRMIVAL_TYPE_STEPWISE = 3, |
397 | }; | 397 | }; |
398 | 398 | ||
399 | struct v4l2_frmival_stepwise | 399 | struct v4l2_frmival_stepwise { |
400 | { | ||
401 | struct v4l2_fract min; /* Minimum frame interval [s] */ | 400 | struct v4l2_fract min; /* Minimum frame interval [s] */ |
402 | struct v4l2_fract max; /* Maximum frame interval [s] */ | 401 | struct v4l2_fract max; /* Maximum frame interval [s] */ |
403 | struct v4l2_fract step; /* Frame interval step size [s] */ | 402 | struct v4l2_fract step; /* Frame interval step size [s] */ |
404 | }; | 403 | }; |
405 | 404 | ||
406 | struct v4l2_frmivalenum | 405 | struct v4l2_frmivalenum { |
407 | { | ||
408 | __u32 index; /* Frame format index */ | 406 | __u32 index; /* Frame format index */ |
409 | __u32 pixel_format; /* Pixel format */ | 407 | __u32 pixel_format; /* Pixel format */ |
410 | __u32 width; /* Frame width */ | 408 | __u32 width; /* Frame width */ |
@@ -423,8 +421,7 @@ struct v4l2_frmivalenum | |||
423 | /* | 421 | /* |
424 | * T I M E C O D E | 422 | * T I M E C O D E |
425 | */ | 423 | */ |
426 | struct v4l2_timecode | 424 | struct v4l2_timecode { |
427 | { | ||
428 | __u32 type; | 425 | __u32 type; |
429 | __u32 flags; | 426 | __u32 flags; |
430 | __u8 frames; | 427 | __u8 frames; |
@@ -449,8 +446,7 @@ struct v4l2_timecode | |||
449 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 | 446 | #define V4L2_TC_USERBITS_8BITCHARS 0x0008 |
450 | /* The above is based on SMPTE timecodes */ | 447 | /* The above is based on SMPTE timecodes */ |
451 | 448 | ||
452 | struct v4l2_jpegcompression | 449 | struct v4l2_jpegcompression { |
453 | { | ||
454 | int quality; | 450 | int quality; |
455 | 451 | ||
456 | int APPn; /* Number of APP segment to be written, | 452 | int APPn; /* Number of APP segment to be written, |
@@ -482,16 +478,14 @@ struct v4l2_jpegcompression | |||
482 | /* | 478 | /* |
483 | * M E M O R Y - M A P P I N G B U F F E R S | 479 | * M E M O R Y - M A P P I N G B U F F E R S |
484 | */ | 480 | */ |
485 | struct v4l2_requestbuffers | 481 | struct v4l2_requestbuffers { |
486 | { | ||
487 | __u32 count; | 482 | __u32 count; |
488 | enum v4l2_buf_type type; | 483 | enum v4l2_buf_type type; |
489 | enum v4l2_memory memory; | 484 | enum v4l2_memory memory; |
490 | __u32 reserved[2]; | 485 | __u32 reserved[2]; |
491 | }; | 486 | }; |
492 | 487 | ||
493 | struct v4l2_buffer | 488 | struct v4l2_buffer { |
494 | { | ||
495 | __u32 index; | 489 | __u32 index; |
496 | enum v4l2_buf_type type; | 490 | enum v4l2_buf_type type; |
497 | __u32 bytesused; | 491 | __u32 bytesused; |
@@ -525,13 +519,12 @@ struct v4l2_buffer | |||
525 | /* | 519 | /* |
526 | * O V E R L A Y P R E V I E W | 520 | * O V E R L A Y P R E V I E W |
527 | */ | 521 | */ |
528 | struct v4l2_framebuffer | 522 | struct v4l2_framebuffer { |
529 | { | ||
530 | __u32 capability; | 523 | __u32 capability; |
531 | __u32 flags; | 524 | __u32 flags; |
532 | /* FIXME: in theory we should pass something like PCI device + memory | 525 | /* FIXME: in theory we should pass something like PCI device + memory |
533 | * region + offset instead of some physical address */ | 526 | * region + offset instead of some physical address */ |
534 | void* base; | 527 | void *base; |
535 | struct v4l2_pix_format fmt; | 528 | struct v4l2_pix_format fmt; |
536 | }; | 529 | }; |
537 | /* Flags for the 'capability' field. Read only */ | 530 | /* Flags for the 'capability' field. Read only */ |
@@ -550,14 +543,12 @@ struct v4l2_framebuffer | |||
550 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 | 543 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 |
551 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 | 544 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 |
552 | 545 | ||
553 | struct v4l2_clip | 546 | struct v4l2_clip { |
554 | { | ||
555 | struct v4l2_rect c; | 547 | struct v4l2_rect c; |
556 | struct v4l2_clip __user *next; | 548 | struct v4l2_clip __user *next; |
557 | }; | 549 | }; |
558 | 550 | ||
559 | struct v4l2_window | 551 | struct v4l2_window { |
560 | { | ||
561 | struct v4l2_rect w; | 552 | struct v4l2_rect w; |
562 | enum v4l2_field field; | 553 | enum v4l2_field field; |
563 | __u32 chromakey; | 554 | __u32 chromakey; |
@@ -570,8 +561,7 @@ struct v4l2_window | |||
570 | /* | 561 | /* |
571 | * C A P T U R E P A R A M E T E R S | 562 | * C A P T U R E P A R A M E T E R S |
572 | */ | 563 | */ |
573 | struct v4l2_captureparm | 564 | struct v4l2_captureparm { |
574 | { | ||
575 | __u32 capability; /* Supported modes */ | 565 | __u32 capability; /* Supported modes */ |
576 | __u32 capturemode; /* Current mode */ | 566 | __u32 capturemode; /* Current mode */ |
577 | struct v4l2_fract timeperframe; /* Time per frame in .1us units */ | 567 | struct v4l2_fract timeperframe; /* Time per frame in .1us units */ |
@@ -584,8 +574,7 @@ struct v4l2_captureparm | |||
584 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ | 574 | #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ |
585 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ | 575 | #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ |
586 | 576 | ||
587 | struct v4l2_outputparm | 577 | struct v4l2_outputparm { |
588 | { | ||
589 | __u32 capability; /* Supported modes */ | 578 | __u32 capability; /* Supported modes */ |
590 | __u32 outputmode; /* Current mode */ | 579 | __u32 outputmode; /* Current mode */ |
591 | struct v4l2_fract timeperframe; /* Time per frame in seconds */ | 580 | struct v4l2_fract timeperframe; /* Time per frame in seconds */ |
@@ -702,8 +691,7 @@ typedef __u64 v4l2_std_id; | |||
702 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ | 691 | #define V4L2_STD_ALL (V4L2_STD_525_60 |\ |
703 | V4L2_STD_625_50) | 692 | V4L2_STD_625_50) |
704 | 693 | ||
705 | struct v4l2_standard | 694 | struct v4l2_standard { |
706 | { | ||
707 | __u32 index; | 695 | __u32 index; |
708 | v4l2_std_id id; | 696 | v4l2_std_id id; |
709 | __u8 name[24]; | 697 | __u8 name[24]; |
@@ -715,8 +703,7 @@ struct v4l2_standard | |||
715 | /* | 703 | /* |
716 | * V I D E O I N P U T S | 704 | * V I D E O I N P U T S |
717 | */ | 705 | */ |
718 | struct v4l2_input | 706 | struct v4l2_input { |
719 | { | ||
720 | __u32 index; /* Which input */ | 707 | __u32 index; /* Which input */ |
721 | __u8 name[32]; /* Label */ | 708 | __u8 name[32]; /* Label */ |
722 | __u32 type; /* Type of input */ | 709 | __u32 type; /* Type of input */ |
@@ -753,8 +740,7 @@ struct v4l2_input | |||
753 | /* | 740 | /* |
754 | * V I D E O O U T P U T S | 741 | * V I D E O O U T P U T S |
755 | */ | 742 | */ |
756 | struct v4l2_output | 743 | struct v4l2_output { |
757 | { | ||
758 | __u32 index; /* Which output */ | 744 | __u32 index; /* Which output */ |
759 | __u8 name[32]; /* Label */ | 745 | __u8 name[32]; /* Label */ |
760 | __u32 type; /* Type of output */ | 746 | __u32 type; /* Type of output */ |
@@ -771,14 +757,12 @@ struct v4l2_output | |||
771 | /* | 757 | /* |
772 | * C O N T R O L S | 758 | * C O N T R O L S |
773 | */ | 759 | */ |
774 | struct v4l2_control | 760 | struct v4l2_control { |
775 | { | ||
776 | __u32 id; | 761 | __u32 id; |
777 | __s32 value; | 762 | __s32 value; |
778 | }; | 763 | }; |
779 | 764 | ||
780 | struct v4l2_ext_control | 765 | struct v4l2_ext_control { |
781 | { | ||
782 | __u32 id; | 766 | __u32 id; |
783 | __u32 reserved2[2]; | 767 | __u32 reserved2[2]; |
784 | union { | 768 | union { |
@@ -788,8 +772,7 @@ struct v4l2_ext_control | |||
788 | }; | 772 | }; |
789 | } __attribute__ ((packed)); | 773 | } __attribute__ ((packed)); |
790 | 774 | ||
791 | struct v4l2_ext_controls | 775 | struct v4l2_ext_controls { |
792 | { | ||
793 | __u32 ctrl_class; | 776 | __u32 ctrl_class; |
794 | __u32 count; | 777 | __u32 count; |
795 | __u32 error_idx; | 778 | __u32 error_idx; |
@@ -807,8 +790,7 @@ struct v4l2_ext_controls | |||
807 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | 790 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) |
808 | 791 | ||
809 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 792 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
810 | struct v4l2_queryctrl | 793 | struct v4l2_queryctrl { |
811 | { | ||
812 | __u32 id; | 794 | __u32 id; |
813 | enum v4l2_ctrl_type type; | 795 | enum v4l2_ctrl_type type; |
814 | __u8 name[32]; /* Whatever */ | 796 | __u8 name[32]; /* Whatever */ |
@@ -821,8 +803,7 @@ struct v4l2_queryctrl | |||
821 | }; | 803 | }; |
822 | 804 | ||
823 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ | 805 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ |
824 | struct v4l2_querymenu | 806 | struct v4l2_querymenu { |
825 | { | ||
826 | __u32 id; | 807 | __u32 id; |
827 | __u32 index; | 808 | __u32 index; |
828 | __u8 name[32]; /* Whatever */ | 809 | __u8 name[32]; /* Whatever */ |
@@ -1104,8 +1085,7 @@ enum v4l2_exposure_auto_type { | |||
1104 | /* | 1085 | /* |
1105 | * T U N I N G | 1086 | * T U N I N G |
1106 | */ | 1087 | */ |
1107 | struct v4l2_tuner | 1088 | struct v4l2_tuner { |
1108 | { | ||
1109 | __u32 index; | 1089 | __u32 index; |
1110 | __u8 name[32]; | 1090 | __u8 name[32]; |
1111 | enum v4l2_tuner_type type; | 1091 | enum v4l2_tuner_type type; |
@@ -1119,8 +1099,7 @@ struct v4l2_tuner | |||
1119 | __u32 reserved[4]; | 1099 | __u32 reserved[4]; |
1120 | }; | 1100 | }; |
1121 | 1101 | ||
1122 | struct v4l2_modulator | 1102 | struct v4l2_modulator { |
1123 | { | ||
1124 | __u32 index; | 1103 | __u32 index; |
1125 | __u8 name[32]; | 1104 | __u8 name[32]; |
1126 | __u32 capability; | 1105 | __u32 capability; |
@@ -1153,8 +1132,7 @@ struct v4l2_modulator | |||
1153 | #define V4L2_TUNER_MODE_LANG1 0x0003 | 1132 | #define V4L2_TUNER_MODE_LANG1 0x0003 |
1154 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 | 1133 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 |
1155 | 1134 | ||
1156 | struct v4l2_frequency | 1135 | struct v4l2_frequency { |
1157 | { | ||
1158 | __u32 tuner; | 1136 | __u32 tuner; |
1159 | enum v4l2_tuner_type type; | 1137 | enum v4l2_tuner_type type; |
1160 | __u32 frequency; | 1138 | __u32 frequency; |
@@ -1172,8 +1150,7 @@ struct v4l2_hw_freq_seek { | |||
1172 | /* | 1150 | /* |
1173 | * A U D I O | 1151 | * A U D I O |
1174 | */ | 1152 | */ |
1175 | struct v4l2_audio | 1153 | struct v4l2_audio { |
1176 | { | ||
1177 | __u32 index; | 1154 | __u32 index; |
1178 | __u8 name[32]; | 1155 | __u8 name[32]; |
1179 | __u32 capability; | 1156 | __u32 capability; |
@@ -1188,8 +1165,7 @@ struct v4l2_audio | |||
1188 | /* Flags for the 'mode' field */ | 1165 | /* Flags for the 'mode' field */ |
1189 | #define V4L2_AUDMODE_AVL 0x00001 | 1166 | #define V4L2_AUDMODE_AVL 0x00001 |
1190 | 1167 | ||
1191 | struct v4l2_audioout | 1168 | struct v4l2_audioout { |
1192 | { | ||
1193 | __u32 index; | 1169 | __u32 index; |
1194 | __u8 name[32]; | 1170 | __u8 name[32]; |
1195 | __u32 capability; | 1171 | __u32 capability; |
@@ -1253,8 +1229,7 @@ struct v4l2_encoder_cmd { | |||
1253 | */ | 1229 | */ |
1254 | 1230 | ||
1255 | /* Raw VBI */ | 1231 | /* Raw VBI */ |
1256 | struct v4l2_vbi_format | 1232 | struct v4l2_vbi_format { |
1257 | { | ||
1258 | __u32 sampling_rate; /* in 1 Hz */ | 1233 | __u32 sampling_rate; /* in 1 Hz */ |
1259 | __u32 offset; | 1234 | __u32 offset; |
1260 | __u32 samples_per_line; | 1235 | __u32 samples_per_line; |
@@ -1266,8 +1241,8 @@ struct v4l2_vbi_format | |||
1266 | }; | 1241 | }; |
1267 | 1242 | ||
1268 | /* VBI flags */ | 1243 | /* VBI flags */ |
1269 | #define V4L2_VBI_UNSYNC (1<< 0) | 1244 | #define V4L2_VBI_UNSYNC (1 << 0) |
1270 | #define V4L2_VBI_INTERLACED (1<< 1) | 1245 | #define V4L2_VBI_INTERLACED (1 << 1) |
1271 | 1246 | ||
1272 | /* Sliced VBI | 1247 | /* Sliced VBI |
1273 | * | 1248 | * |
@@ -1276,8 +1251,7 @@ struct v4l2_vbi_format | |||
1276 | * notice in the definitive implementation. | 1251 | * notice in the definitive implementation. |
1277 | */ | 1252 | */ |
1278 | 1253 | ||
1279 | struct v4l2_sliced_vbi_format | 1254 | struct v4l2_sliced_vbi_format { |
1280 | { | ||
1281 | __u16 service_set; | 1255 | __u16 service_set; |
1282 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 1256 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
1283 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 1257 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
@@ -1301,8 +1275,7 @@ struct v4l2_sliced_vbi_format | |||
1301 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 1275 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1302 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 1276 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1303 | 1277 | ||
1304 | struct v4l2_sliced_vbi_cap | 1278 | struct v4l2_sliced_vbi_cap { |
1305 | { | ||
1306 | __u16 service_set; | 1279 | __u16 service_set; |
1307 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field | 1280 | /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field |
1308 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field | 1281 | service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field |
@@ -1313,8 +1286,7 @@ struct v4l2_sliced_vbi_cap | |||
1313 | __u32 reserved[3]; /* must be 0 */ | 1286 | __u32 reserved[3]; /* must be 0 */ |
1314 | }; | 1287 | }; |
1315 | 1288 | ||
1316 | struct v4l2_sliced_vbi_data | 1289 | struct v4l2_sliced_vbi_data { |
1317 | { | ||
1318 | __u32 id; | 1290 | __u32 id; |
1319 | __u32 field; /* 0: first field, 1: second field */ | 1291 | __u32 field; /* 0: first field, 1: second field */ |
1320 | __u32 line; /* 1-23 */ | 1292 | __u32 line; /* 1-23 */ |
@@ -1328,27 +1300,23 @@ struct v4l2_sliced_vbi_data | |||
1328 | 1300 | ||
1329 | /* Stream data format | 1301 | /* Stream data format |
1330 | */ | 1302 | */ |
1331 | struct v4l2_format | 1303 | struct v4l2_format { |
1332 | { | ||
1333 | enum v4l2_buf_type type; | 1304 | enum v4l2_buf_type type; |
1334 | union | 1305 | union { |
1335 | { | 1306 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ |
1336 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 1307 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
1337 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 1308 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
1338 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 1309 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
1339 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 1310 | __u8 raw_data[200]; /* user-defined */ |
1340 | __u8 raw_data[200]; // user-defined | ||
1341 | } fmt; | 1311 | } fmt; |
1342 | }; | 1312 | }; |
1343 | 1313 | ||
1344 | 1314 | ||
1345 | /* Stream type-dependent parameters | 1315 | /* Stream type-dependent parameters |
1346 | */ | 1316 | */ |
1347 | struct v4l2_streamparm | 1317 | struct v4l2_streamparm { |
1348 | { | ||
1349 | enum v4l2_buf_type type; | 1318 | enum v4l2_buf_type type; |
1350 | union | 1319 | union { |
1351 | { | ||
1352 | struct v4l2_captureparm capture; | 1320 | struct v4l2_captureparm capture; |
1353 | struct v4l2_outputparm output; | 1321 | struct v4l2_outputparm output; |
1354 | __u8 raw_data[200]; /* user-defined */ | 1322 | __u8 raw_data[200]; /* user-defined */ |
@@ -1386,92 +1354,86 @@ struct v4l2_chip_ident { | |||
1386 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 1354 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
1387 | * | 1355 | * |
1388 | */ | 1356 | */ |
1389 | #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability) | 1357 | #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability) |
1390 | #define VIDIOC_RESERVED _IO ('V', 1) | 1358 | #define VIDIOC_RESERVED _IO('V', 1) |
1391 | #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) | 1359 | #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc) |
1392 | #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) | 1360 | #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format) |
1393 | #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) | 1361 | #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format) |
1394 | #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) | 1362 | #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers) |
1395 | #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) | 1363 | #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer) |
1396 | #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) | 1364 | #define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer) |
1397 | #define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer) | 1365 | #define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) |
1398 | #define VIDIOC_OVERLAY _IOW ('V', 14, int) | 1366 | #define VIDIOC_OVERLAY _IOW('V', 14, int) |
1399 | #define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer) | 1367 | #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) |
1400 | #define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer) | 1368 | #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) |
1401 | #define VIDIOC_STREAMON _IOW ('V', 18, int) | 1369 | #define VIDIOC_STREAMON _IOW('V', 18, int) |
1402 | #define VIDIOC_STREAMOFF _IOW ('V', 19, int) | 1370 | #define VIDIOC_STREAMOFF _IOW('V', 19, int) |
1403 | #define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm) | 1371 | #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm) |
1404 | #define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm) | 1372 | #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) |
1405 | #define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id) | 1373 | #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id) |
1406 | #define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id) | 1374 | #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id) |
1407 | #define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard) | 1375 | #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard) |
1408 | #define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input) | 1376 | #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input) |
1409 | #define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control) | 1377 | #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control) |
1410 | #define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control) | 1378 | #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control) |
1411 | #define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner) | 1379 | #define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner) |
1412 | #define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner) | 1380 | #define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner) |
1413 | #define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio) | 1381 | #define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio) |
1414 | #define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio) | 1382 | #define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio) |
1415 | #define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl) | 1383 | #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl) |
1416 | #define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu) | 1384 | #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) |
1417 | #define VIDIOC_G_INPUT _IOR ('V', 38, int) | 1385 | #define VIDIOC_G_INPUT _IOR('V', 38, int) |
1418 | #define VIDIOC_S_INPUT _IOWR ('V', 39, int) | 1386 | #define VIDIOC_S_INPUT _IOWR('V', 39, int) |
1419 | #define VIDIOC_G_OUTPUT _IOR ('V', 46, int) | 1387 | #define VIDIOC_G_OUTPUT _IOR('V', 46, int) |
1420 | #define VIDIOC_S_OUTPUT _IOWR ('V', 47, int) | 1388 | #define VIDIOC_S_OUTPUT _IOWR('V', 47, int) |
1421 | #define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output) | 1389 | #define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output) |
1422 | #define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout) | 1390 | #define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout) |
1423 | #define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout) | 1391 | #define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout) |
1424 | #define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator) | 1392 | #define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator) |
1425 | #define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator) | 1393 | #define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator) |
1426 | #define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency) | 1394 | #define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency) |
1427 | #define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency) | 1395 | #define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency) |
1428 | #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap) | 1396 | #define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap) |
1429 | #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop) | 1397 | #define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop) |
1430 | #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop) | 1398 | #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) |
1431 | #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) | 1399 | #define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression) |
1432 | #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) | 1400 | #define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression) |
1433 | #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id) | 1401 | #define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id) |
1434 | #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format) | 1402 | #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) |
1435 | #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio) | 1403 | #define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) |
1436 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 1404 | #define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) |
1437 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1405 | #define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority) |
1438 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1406 | #define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority) |
1439 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) | 1407 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap) |
1440 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1408 | #define VIDIOC_LOG_STATUS _IO('V', 70) |
1441 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1409 | #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls) |
1442 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1410 | #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls) |
1443 | #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) | 1411 | #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls) |
1444 | #if 1 | 1412 | #if 1 |
1445 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1413 | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) |
1446 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1414 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) |
1447 | #define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) | 1415 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) |
1448 | #define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) | 1416 | #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) |
1449 | #define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) | 1417 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) |
1450 | 1418 | ||
1451 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 1419 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
1452 | #define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) | 1420 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) |
1453 | #define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) | 1421 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) |
1454 | 1422 | ||
1455 | #define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) | 1423 | #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) |
1456 | #endif | 1424 | #endif |
1457 | #define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek) | 1425 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
1458 | 1426 | ||
1459 | #ifdef __OLD_VIDIOC_ | 1427 | #ifdef __OLD_VIDIOC_ |
1460 | /* for compatibility, will go away some day */ | 1428 | /* for compatibility, will go away some day */ |
1461 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) | 1429 | #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) |
1462 | #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) | 1430 | #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm) |
1463 | #define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control) | 1431 | #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control) |
1464 | #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) | 1432 | #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio) |
1465 | #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) | 1433 | #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout) |
1466 | #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) | 1434 | #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap) |
1467 | #endif | 1435 | #endif |
1468 | 1436 | ||
1469 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | 1437 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
1470 | 1438 | ||
1471 | #endif /* __LINUX_VIDEODEV2_H */ | 1439 | #endif /* __LINUX_VIDEODEV2_H */ |
1472 | |||
1473 | /* | ||
1474 | * Local variables: | ||
1475 | * c-basic-offset: 8 | ||
1476 | * End: | ||
1477 | */ | ||
diff --git a/include/linux/videotext.h b/include/linux/videotext.h index 018f92047ff8..3e68c8d1c7f7 100644 --- a/include/linux/videotext.h +++ b/include/linux/videotext.h | |||
@@ -45,10 +45,10 @@ | |||
45 | #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ | 45 | #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ |
46 | #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ | 46 | #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Definitions for VTXIOCGETINFO | 49 | * Definitions for VTXIOCGETINFO |
50 | */ | 50 | */ |
51 | 51 | ||
52 | #define SAA5243 0 | 52 | #define SAA5243 0 |
53 | #define SAA5246 1 | 53 | #define SAA5246 1 |
54 | #define SAA5249 2 | 54 | #define SAA5249 2 |
@@ -57,10 +57,10 @@ | |||
57 | 57 | ||
58 | typedef struct { | 58 | typedef struct { |
59 | int version_major, version_minor; /* version of driver; if version_major changes, driver */ | 59 | int version_major, version_minor; /* version of driver; if version_major changes, driver */ |
60 | /* is not backward compatible!!! CHECK THIS!!! */ | 60 | /* is not backward compatible!!! CHECK THIS!!! */ |
61 | int numpages; /* number of page-buffers of vtx-chipset */ | 61 | int numpages; /* number of page-buffers of vtx-chipset */ |
62 | int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or | 62 | int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or |
63 | * SAA5249) */ | 63 | * SAA5249) */ |
64 | } | 64 | } |
65 | vtx_info_t; | 65 | vtx_info_t; |
66 | 66 | ||
@@ -81,7 +81,7 @@ vtx_info_t; | |||
81 | #define PGMASK_HOUR (HR_TEN | HR_UNIT) | 81 | #define PGMASK_HOUR (HR_TEN | HR_UNIT) |
82 | #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) | 82 | #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) |
83 | 83 | ||
84 | typedef struct | 84 | typedef struct |
85 | { | 85 | { |
86 | int page; /* number of requested page (hexadecimal) */ | 86 | int page; /* number of requested page (hexadecimal) */ |
87 | int hour; /* requested hour (hexadecimal) */ | 87 | int hour; /* requested hour (hexadecimal) */ |
@@ -98,11 +98,11 @@ vtx_pagereq_t; | |||
98 | /* | 98 | /* |
99 | * Definitions for VTXIOC{GETSTAT,PUTSTAT} | 99 | * Definitions for VTXIOC{GETSTAT,PUTSTAT} |
100 | */ | 100 | */ |
101 | 101 | ||
102 | #define VTX_PAGESIZE (40 * 24) | 102 | #define VTX_PAGESIZE (40 * 24) |
103 | #define VTX_VIRTUALSIZE (40 * 49) | 103 | #define VTX_VIRTUALSIZE (40 * 49) |
104 | 104 | ||
105 | typedef struct | 105 | typedef struct |
106 | { | 106 | { |
107 | int pagenum; /* number of page (hexadecimal) */ | 107 | int pagenum; /* number of page (hexadecimal) */ |
108 | int hour; /* hour (hexadecimal) */ | 108 | int hour; /* hour (hexadecimal) */ |
@@ -121,5 +121,5 @@ typedef struct | |||
121 | unsigned hamming : 1; /* hamming-error occurred */ | 121 | unsigned hamming : 1; /* hamming-error occurred */ |
122 | } | 122 | } |
123 | vtx_pageinfo_t; | 123 | vtx_pageinfo_t; |
124 | 124 | ||
125 | #endif /* _VTX_H */ | 125 | #endif /* _VTX_H */ |
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); | |||
74 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | 74 | int 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 |