diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-08 01:31:11 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-08 01:31:11 -0400 |
commit | 334d0dd8b660557608142f0f77abc6812b48f08b (patch) | |
tree | 9393a9aa099d7d42deda5f9f5054796c0c769be7 /include/linux | |
parent | 3f07d8796262f6aee135c8dd9a91210da9f888e4 (diff) | |
parent | 5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux')
85 files changed, 2384 insertions, 878 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 4ff0f57d0add..9f05279e7dd3 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -96,6 +96,7 @@ header-y += iso_fs.h | |||
96 | header-y += ixjuser.h | 96 | header-y += ixjuser.h |
97 | header-y += jffs2.h | 97 | header-y += jffs2.h |
98 | header-y += keyctl.h | 98 | header-y += keyctl.h |
99 | header-y += kvm.h | ||
99 | header-y += limits.h | 100 | header-y += limits.h |
100 | header-y += lock_dlm_plock.h | 101 | header-y += lock_dlm_plock.h |
101 | header-y += magic.h | 102 | header-y += magic.h |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 81c07cd18643..0365ec9fc0c9 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -122,9 +122,9 @@ extern void *alloc_large_system_hash(const char *tablename, | |||
122 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ | 122 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ |
123 | 123 | ||
124 | /* Only NUMA needs hash distribution. | 124 | /* Only NUMA needs hash distribution. |
125 | * IA64 is known to have sufficient vmalloc space. | 125 | * IA64 and x86_64 have sufficient vmalloc space. |
126 | */ | 126 | */ |
127 | #if defined(CONFIG_NUMA) && defined(CONFIG_IA64) | 127 | #if defined(CONFIG_NUMA) && (defined(CONFIG_IA64) || defined(CONFIG_X86_64)) |
128 | #define HASHDIST_DEFAULT 1 | 128 | #define HASHDIST_DEFAULT 1 |
129 | #else | 129 | #else |
130 | #define HASHDIST_DEFAULT 0 | 130 | #define HASHDIST_DEFAULT 0 |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index dd27b1c7227f..5c6e12853a9b 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -165,7 +165,7 @@ int sync_mapping_buffers(struct address_space *mapping); | |||
165 | void unmap_underlying_metadata(struct block_device *bdev, sector_t block); | 165 | void unmap_underlying_metadata(struct block_device *bdev, sector_t block); |
166 | 166 | ||
167 | void mark_buffer_async_write(struct buffer_head *bh); | 167 | void mark_buffer_async_write(struct buffer_head *bh); |
168 | void invalidate_bdev(struct block_device *, int); | 168 | void invalidate_bdev(struct block_device *); |
169 | int sync_blockdev(struct block_device *bdev); | 169 | int sync_blockdev(struct block_device *bdev); |
170 | void __wait_on_buffer(struct buffer_head *); | 170 | void __wait_on_buffer(struct buffer_head *); |
171 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); | 171 | wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); |
@@ -182,6 +182,7 @@ void __brelse(struct buffer_head *); | |||
182 | void __bforget(struct buffer_head *); | 182 | void __bforget(struct buffer_head *); |
183 | void __breadahead(struct block_device *, sector_t block, unsigned int size); | 183 | void __breadahead(struct block_device *, sector_t block, unsigned int size); |
184 | struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size); | 184 | struct buffer_head *__bread(struct block_device *, sector_t block, unsigned size); |
185 | void invalidate_bh_lrus(void); | ||
185 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); | 186 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); |
186 | void free_buffer_head(struct buffer_head * bh); | 187 | void free_buffer_head(struct buffer_head * bh); |
187 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); | 188 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); |
@@ -319,7 +320,7 @@ static inline int inode_has_buffers(struct inode *inode) { return 0; } | |||
319 | static inline void invalidate_inode_buffers(struct inode *inode) {} | 320 | static inline void invalidate_inode_buffers(struct inode *inode) {} |
320 | static inline int remove_inode_buffers(struct inode *inode) { return 1; } | 321 | static inline int remove_inode_buffers(struct inode *inode) { return 1; } |
321 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } | 322 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } |
322 | static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {} | 323 | static inline void invalidate_bdev(struct block_device *bdev) {} |
323 | 324 | ||
324 | 325 | ||
325 | #endif /* CONFIG_BLOCK */ | 326 | #endif /* CONFIG_BLOCK */ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 9008eabb9c3d..a9f794716a81 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -22,6 +22,9 @@ | |||
22 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 22 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
23 | (typeof(ptr)) (__ptr + (off)); }) | 23 | (typeof(ptr)) (__ptr + (off)); }) |
24 | 24 | ||
25 | /* &a[0] degrades to a pointer: a different type from an array */ | ||
26 | #define __must_be_array(a) \ | ||
27 | BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) | ||
25 | 28 | ||
26 | #define inline inline __attribute__((always_inline)) | 29 | #define inline inline __attribute__((always_inline)) |
27 | #define __inline__ __inline__ __attribute__((always_inline)) | 30 | #define __inline__ __inline__ __attribute__((always_inline)) |
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 1698b845761f..ecd621fd27d2 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -13,4 +13,10 @@ | |||
13 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | /* | ||
17 | * A trick to suppress uninitialized variable warning without generating any | ||
18 | * code | ||
19 | */ | ||
20 | #define uninitialized_var(x) x = x | ||
21 | |||
16 | #define __always_inline inline __attribute__((always_inline)) | 22 | #define __always_inline inline __attribute__((always_inline)) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 6f5cc6f0e7a6..fd0cc7c4a636 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -16,3 +16,9 @@ | |||
16 | #define __must_check __attribute__((warn_unused_result)) | 16 | #define __must_check __attribute__((warn_unused_result)) |
17 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 17 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
18 | #define __always_inline inline __attribute__((always_inline)) | 18 | #define __always_inline inline __attribute__((always_inline)) |
19 | |||
20 | /* | ||
21 | * A trick to suppress uninitialized variable warning without generating any | ||
22 | * code | ||
23 | */ | ||
24 | #define uninitialized_var(x) x = x | ||
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 1d1c3ceaff4e..b769961e6f23 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
@@ -21,4 +21,9 @@ | |||
21 | __ptr = (unsigned long) (ptr); \ | 21 | __ptr = (unsigned long) (ptr); \ |
22 | (typeof(ptr)) (__ptr + (off)); }) | 22 | (typeof(ptr)) (__ptr + (off)); }) |
23 | 23 | ||
24 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ | ||
25 | #define __must_be_array(a) 0 | ||
26 | |||
24 | #endif | 27 | #endif |
28 | |||
29 | #define uninitialized_var(x) x | ||
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 0899e2cdcdd1..963051a967d6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -32,7 +32,15 @@ | |||
32 | * CPUFREQ NOTIFIER INTERFACE * | 32 | * CPUFREQ NOTIFIER INTERFACE * |
33 | *********************************************************************/ | 33 | *********************************************************************/ |
34 | 34 | ||
35 | #ifdef CONFIG_CPU_FREQ | ||
35 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 36 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
37 | #else | ||
38 | static inline int cpufreq_register_notifier(struct notifier_block *nb, | ||
39 | unsigned int list) | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | #endif | ||
36 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | 44 | int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); |
37 | 45 | ||
38 | #define CPUFREQ_TRANSITION_NOTIFIER (0) | 46 | #define CPUFREQ_TRANSITION_NOTIFIER (0) |
@@ -257,21 +265,25 @@ struct freq_attr { | |||
257 | /********************************************************************* | 265 | /********************************************************************* |
258 | * CPUFREQ 2.6. INTERFACE * | 266 | * CPUFREQ 2.6. INTERFACE * |
259 | *********************************************************************/ | 267 | *********************************************************************/ |
260 | int cpufreq_set_policy(struct cpufreq_policy *policy); | ||
261 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); | 268 | int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); |
262 | int cpufreq_update_policy(unsigned int cpu); | 269 | int cpufreq_update_policy(unsigned int cpu); |
263 | 270 | ||
264 | /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ | ||
265 | unsigned int cpufreq_get(unsigned int cpu); | ||
266 | 271 | ||
267 | /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ | 272 | /* |
273 | * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it | ||
274 | */ | ||
268 | #ifdef CONFIG_CPU_FREQ | 275 | #ifdef CONFIG_CPU_FREQ |
269 | unsigned int cpufreq_quick_get(unsigned int cpu); | 276 | unsigned int cpufreq_quick_get(unsigned int cpu); |
277 | unsigned int cpufreq_get(unsigned int cpu); | ||
270 | #else | 278 | #else |
271 | static inline unsigned int cpufreq_quick_get(unsigned int cpu) | 279 | static inline unsigned int cpufreq_quick_get(unsigned int cpu) |
272 | { | 280 | { |
273 | return 0; | 281 | return 0; |
274 | } | 282 | } |
283 | static inline unsigned int cpufreq_get(unsigned int cpu) | ||
284 | { | ||
285 | return 0; | ||
286 | } | ||
275 | #endif | 287 | #endif |
276 | 288 | ||
277 | 289 | ||
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 32503657f14f..22c7ac5cd80c 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -14,5 +14,13 @@ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | |||
14 | extern const struct file_operations proc_vmcore_operations; | 14 | extern const struct file_operations proc_vmcore_operations; |
15 | extern struct proc_dir_entry *proc_vmcore; | 15 | extern struct proc_dir_entry *proc_vmcore; |
16 | 16 | ||
17 | /* Architecture code defines this if there are other possible ELF | ||
18 | * machine types, e.g. on bi-arch capable hardware. */ | ||
19 | #ifndef vmcore_elf_check_arch_cross | ||
20 | #define vmcore_elf_check_arch_cross(x) 0 | ||
21 | #endif | ||
22 | |||
23 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | ||
24 | |||
17 | #endif /* CONFIG_CRASH_DUMP */ | 25 | #endif /* CONFIG_CRASH_DUMP */ |
18 | #endif /* LINUX_CRASHDUMP_H */ | 26 | #endif /* LINUX_CRASHDUMP_H */ |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 779aa78ee643..0de7e2ace822 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 | 57 | #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 |
58 | #define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 | 58 | #define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 |
59 | #define CRYPTO_TFM_REQ_MAY_BACKLOG 0x00000400 | ||
59 | #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 | 60 | #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 |
60 | #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 | 61 | #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 |
61 | #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 | 62 | #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 |
@@ -88,11 +89,38 @@ | |||
88 | #endif | 89 | #endif |
89 | 90 | ||
90 | struct scatterlist; | 91 | struct scatterlist; |
92 | struct crypto_ablkcipher; | ||
93 | struct crypto_async_request; | ||
91 | struct crypto_blkcipher; | 94 | struct crypto_blkcipher; |
92 | struct crypto_hash; | 95 | struct crypto_hash; |
96 | struct crypto_queue; | ||
93 | struct crypto_tfm; | 97 | struct crypto_tfm; |
94 | struct crypto_type; | 98 | struct crypto_type; |
95 | 99 | ||
100 | typedef void (*crypto_completion_t)(struct crypto_async_request *req, int err); | ||
101 | |||
102 | struct crypto_async_request { | ||
103 | struct list_head list; | ||
104 | crypto_completion_t complete; | ||
105 | void *data; | ||
106 | struct crypto_tfm *tfm; | ||
107 | |||
108 | u32 flags; | ||
109 | }; | ||
110 | |||
111 | struct ablkcipher_request { | ||
112 | struct crypto_async_request base; | ||
113 | |||
114 | unsigned int nbytes; | ||
115 | |||
116 | void *info; | ||
117 | |||
118 | struct scatterlist *src; | ||
119 | struct scatterlist *dst; | ||
120 | |||
121 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | ||
122 | }; | ||
123 | |||
96 | struct blkcipher_desc { | 124 | struct blkcipher_desc { |
97 | struct crypto_blkcipher *tfm; | 125 | struct crypto_blkcipher *tfm; |
98 | void *info; | 126 | void *info; |
@@ -116,6 +144,19 @@ struct hash_desc { | |||
116 | * Algorithms: modular crypto algorithm implementations, managed | 144 | * Algorithms: modular crypto algorithm implementations, managed |
117 | * via crypto_register_alg() and crypto_unregister_alg(). | 145 | * via crypto_register_alg() and crypto_unregister_alg(). |
118 | */ | 146 | */ |
147 | struct ablkcipher_alg { | ||
148 | int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key, | ||
149 | unsigned int keylen); | ||
150 | int (*encrypt)(struct ablkcipher_request *req); | ||
151 | int (*decrypt)(struct ablkcipher_request *req); | ||
152 | |||
153 | struct crypto_queue *queue; | ||
154 | |||
155 | unsigned int min_keysize; | ||
156 | unsigned int max_keysize; | ||
157 | unsigned int ivsize; | ||
158 | }; | ||
159 | |||
119 | struct blkcipher_alg { | 160 | struct blkcipher_alg { |
120 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, | 161 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, |
121 | unsigned int keylen); | 162 | unsigned int keylen); |
@@ -170,6 +211,7 @@ struct compress_alg { | |||
170 | unsigned int slen, u8 *dst, unsigned int *dlen); | 211 | unsigned int slen, u8 *dst, unsigned int *dlen); |
171 | }; | 212 | }; |
172 | 213 | ||
214 | #define cra_ablkcipher cra_u.ablkcipher | ||
173 | #define cra_blkcipher cra_u.blkcipher | 215 | #define cra_blkcipher cra_u.blkcipher |
174 | #define cra_cipher cra_u.cipher | 216 | #define cra_cipher cra_u.cipher |
175 | #define cra_digest cra_u.digest | 217 | #define cra_digest cra_u.digest |
@@ -194,6 +236,7 @@ struct crypto_alg { | |||
194 | const struct crypto_type *cra_type; | 236 | const struct crypto_type *cra_type; |
195 | 237 | ||
196 | union { | 238 | union { |
239 | struct ablkcipher_alg ablkcipher; | ||
197 | struct blkcipher_alg blkcipher; | 240 | struct blkcipher_alg blkcipher; |
198 | struct cipher_alg cipher; | 241 | struct cipher_alg cipher; |
199 | struct digest_alg digest; | 242 | struct digest_alg digest; |
@@ -232,6 +275,15 @@ static inline int crypto_has_alg(const char *name, u32 type, u32 mask) | |||
232 | * crypto_free_*(), as well as the various helpers below. | 275 | * crypto_free_*(), as well as the various helpers below. |
233 | */ | 276 | */ |
234 | 277 | ||
278 | struct ablkcipher_tfm { | ||
279 | int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key, | ||
280 | unsigned int keylen); | ||
281 | int (*encrypt)(struct ablkcipher_request *req); | ||
282 | int (*decrypt)(struct ablkcipher_request *req); | ||
283 | unsigned int ivsize; | ||
284 | unsigned int reqsize; | ||
285 | }; | ||
286 | |||
235 | struct blkcipher_tfm { | 287 | struct blkcipher_tfm { |
236 | void *iv; | 288 | void *iv; |
237 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, | 289 | int (*setkey)(struct crypto_tfm *tfm, const u8 *key, |
@@ -290,6 +342,7 @@ struct compress_tfm { | |||
290 | u8 *dst, unsigned int *dlen); | 342 | u8 *dst, unsigned int *dlen); |
291 | }; | 343 | }; |
292 | 344 | ||
345 | #define crt_ablkcipher crt_u.ablkcipher | ||
293 | #define crt_blkcipher crt_u.blkcipher | 346 | #define crt_blkcipher crt_u.blkcipher |
294 | #define crt_cipher crt_u.cipher | 347 | #define crt_cipher crt_u.cipher |
295 | #define crt_hash crt_u.hash | 348 | #define crt_hash crt_u.hash |
@@ -300,6 +353,7 @@ struct crypto_tfm { | |||
300 | u32 crt_flags; | 353 | u32 crt_flags; |
301 | 354 | ||
302 | union { | 355 | union { |
356 | struct ablkcipher_tfm ablkcipher; | ||
303 | struct blkcipher_tfm blkcipher; | 357 | struct blkcipher_tfm blkcipher; |
304 | struct cipher_tfm cipher; | 358 | struct cipher_tfm cipher; |
305 | struct hash_tfm hash; | 359 | struct hash_tfm hash; |
@@ -311,6 +365,10 @@ struct crypto_tfm { | |||
311 | void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; | 365 | void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; |
312 | }; | 366 | }; |
313 | 367 | ||
368 | struct crypto_ablkcipher { | ||
369 | struct crypto_tfm base; | ||
370 | }; | ||
371 | |||
314 | struct crypto_blkcipher { | 372 | struct crypto_blkcipher { |
315 | struct crypto_tfm base; | 373 | struct crypto_tfm base; |
316 | }; | 374 | }; |
@@ -330,12 +388,21 @@ struct crypto_hash { | |||
330 | enum { | 388 | enum { |
331 | CRYPTOA_UNSPEC, | 389 | CRYPTOA_UNSPEC, |
332 | CRYPTOA_ALG, | 390 | CRYPTOA_ALG, |
391 | CRYPTOA_TYPE, | ||
392 | __CRYPTOA_MAX, | ||
333 | }; | 393 | }; |
334 | 394 | ||
395 | #define CRYPTOA_MAX (__CRYPTOA_MAX - 1) | ||
396 | |||
335 | struct crypto_attr_alg { | 397 | struct crypto_attr_alg { |
336 | char name[CRYPTO_MAX_ALG_NAME]; | 398 | char name[CRYPTO_MAX_ALG_NAME]; |
337 | }; | 399 | }; |
338 | 400 | ||
401 | struct crypto_attr_type { | ||
402 | u32 type; | ||
403 | u32 mask; | ||
404 | }; | ||
405 | |||
339 | /* | 406 | /* |
340 | * Transform user interface. | 407 | * Transform user interface. |
341 | */ | 408 | */ |
@@ -411,6 +478,167 @@ static inline unsigned int crypto_tfm_ctx_alignment(void) | |||
411 | /* | 478 | /* |
412 | * API wrappers. | 479 | * API wrappers. |
413 | */ | 480 | */ |
481 | static inline struct crypto_ablkcipher *__crypto_ablkcipher_cast( | ||
482 | struct crypto_tfm *tfm) | ||
483 | { | ||
484 | return (struct crypto_ablkcipher *)tfm; | ||
485 | } | ||
486 | |||
487 | static inline struct crypto_ablkcipher *crypto_alloc_ablkcipher( | ||
488 | const char *alg_name, u32 type, u32 mask) | ||
489 | { | ||
490 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
491 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | ||
492 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
493 | |||
494 | return __crypto_ablkcipher_cast( | ||
495 | crypto_alloc_base(alg_name, type, mask)); | ||
496 | } | ||
497 | |||
498 | static inline struct crypto_tfm *crypto_ablkcipher_tfm( | ||
499 | struct crypto_ablkcipher *tfm) | ||
500 | { | ||
501 | return &tfm->base; | ||
502 | } | ||
503 | |||
504 | static inline void crypto_free_ablkcipher(struct crypto_ablkcipher *tfm) | ||
505 | { | ||
506 | crypto_free_tfm(crypto_ablkcipher_tfm(tfm)); | ||
507 | } | ||
508 | |||
509 | static inline int crypto_has_ablkcipher(const char *alg_name, u32 type, | ||
510 | u32 mask) | ||
511 | { | ||
512 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
513 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | ||
514 | mask |= CRYPTO_ALG_TYPE_MASK; | ||
515 | |||
516 | return crypto_has_alg(alg_name, type, mask); | ||
517 | } | ||
518 | |||
519 | static inline struct ablkcipher_tfm *crypto_ablkcipher_crt( | ||
520 | struct crypto_ablkcipher *tfm) | ||
521 | { | ||
522 | return &crypto_ablkcipher_tfm(tfm)->crt_ablkcipher; | ||
523 | } | ||
524 | |||
525 | static inline unsigned int crypto_ablkcipher_ivsize( | ||
526 | struct crypto_ablkcipher *tfm) | ||
527 | { | ||
528 | return crypto_ablkcipher_crt(tfm)->ivsize; | ||
529 | } | ||
530 | |||
531 | static inline unsigned int crypto_ablkcipher_blocksize( | ||
532 | struct crypto_ablkcipher *tfm) | ||
533 | { | ||
534 | return crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(tfm)); | ||
535 | } | ||
536 | |||
537 | static inline unsigned int crypto_ablkcipher_alignmask( | ||
538 | struct crypto_ablkcipher *tfm) | ||
539 | { | ||
540 | return crypto_tfm_alg_alignmask(crypto_ablkcipher_tfm(tfm)); | ||
541 | } | ||
542 | |||
543 | static inline u32 crypto_ablkcipher_get_flags(struct crypto_ablkcipher *tfm) | ||
544 | { | ||
545 | return crypto_tfm_get_flags(crypto_ablkcipher_tfm(tfm)); | ||
546 | } | ||
547 | |||
548 | static inline void crypto_ablkcipher_set_flags(struct crypto_ablkcipher *tfm, | ||
549 | u32 flags) | ||
550 | { | ||
551 | crypto_tfm_set_flags(crypto_ablkcipher_tfm(tfm), flags); | ||
552 | } | ||
553 | |||
554 | static inline void crypto_ablkcipher_clear_flags(struct crypto_ablkcipher *tfm, | ||
555 | u32 flags) | ||
556 | { | ||
557 | crypto_tfm_clear_flags(crypto_ablkcipher_tfm(tfm), flags); | ||
558 | } | ||
559 | |||
560 | static inline int crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm, | ||
561 | const u8 *key, unsigned int keylen) | ||
562 | { | ||
563 | return crypto_ablkcipher_crt(tfm)->setkey(tfm, key, keylen); | ||
564 | } | ||
565 | |||
566 | static inline struct crypto_ablkcipher *crypto_ablkcipher_reqtfm( | ||
567 | struct ablkcipher_request *req) | ||
568 | { | ||
569 | return __crypto_ablkcipher_cast(req->base.tfm); | ||
570 | } | ||
571 | |||
572 | static inline int crypto_ablkcipher_encrypt(struct ablkcipher_request *req) | ||
573 | { | ||
574 | struct ablkcipher_tfm *crt = | ||
575 | crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req)); | ||
576 | return crt->encrypt(req); | ||
577 | } | ||
578 | |||
579 | static inline int crypto_ablkcipher_decrypt(struct ablkcipher_request *req) | ||
580 | { | ||
581 | struct ablkcipher_tfm *crt = | ||
582 | crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req)); | ||
583 | return crt->decrypt(req); | ||
584 | } | ||
585 | |||
586 | static inline int crypto_ablkcipher_reqsize(struct crypto_ablkcipher *tfm) | ||
587 | { | ||
588 | return crypto_ablkcipher_crt(tfm)->reqsize; | ||
589 | } | ||
590 | |||
591 | static inline void ablkcipher_request_set_tfm( | ||
592 | struct ablkcipher_request *req, struct crypto_ablkcipher *tfm) | ||
593 | { | ||
594 | req->base.tfm = crypto_ablkcipher_tfm(tfm); | ||
595 | } | ||
596 | |||
597 | static inline struct ablkcipher_request *ablkcipher_request_cast( | ||
598 | struct crypto_async_request *req) | ||
599 | { | ||
600 | return container_of(req, struct ablkcipher_request, base); | ||
601 | } | ||
602 | |||
603 | static inline struct ablkcipher_request *ablkcipher_request_alloc( | ||
604 | struct crypto_ablkcipher *tfm, gfp_t gfp) | ||
605 | { | ||
606 | struct ablkcipher_request *req; | ||
607 | |||
608 | req = kmalloc(sizeof(struct ablkcipher_request) + | ||
609 | crypto_ablkcipher_reqsize(tfm), gfp); | ||
610 | |||
611 | if (likely(req)) | ||
612 | ablkcipher_request_set_tfm(req, tfm); | ||
613 | |||
614 | return req; | ||
615 | } | ||
616 | |||
617 | static inline void ablkcipher_request_free(struct ablkcipher_request *req) | ||
618 | { | ||
619 | kfree(req); | ||
620 | } | ||
621 | |||
622 | static inline void ablkcipher_request_set_callback( | ||
623 | struct ablkcipher_request *req, | ||
624 | u32 flags, crypto_completion_t complete, void *data) | ||
625 | { | ||
626 | req->base.complete = complete; | ||
627 | req->base.data = data; | ||
628 | req->base.flags = flags; | ||
629 | } | ||
630 | |||
631 | static inline void ablkcipher_request_set_crypt( | ||
632 | struct ablkcipher_request *req, | ||
633 | struct scatterlist *src, struct scatterlist *dst, | ||
634 | unsigned int nbytes, void *iv) | ||
635 | { | ||
636 | req->src = src; | ||
637 | req->dst = dst; | ||
638 | req->nbytes = nbytes; | ||
639 | req->info = iv; | ||
640 | } | ||
641 | |||
414 | static inline struct crypto_blkcipher *__crypto_blkcipher_cast( | 642 | static inline struct crypto_blkcipher *__crypto_blkcipher_cast( |
415 | struct crypto_tfm *tfm) | 643 | struct crypto_tfm *tfm) |
416 | { | 644 | { |
@@ -427,9 +655,9 @@ static inline struct crypto_blkcipher *crypto_blkcipher_cast( | |||
427 | static inline struct crypto_blkcipher *crypto_alloc_blkcipher( | 655 | static inline struct crypto_blkcipher *crypto_alloc_blkcipher( |
428 | const char *alg_name, u32 type, u32 mask) | 656 | const char *alg_name, u32 type, u32 mask) |
429 | { | 657 | { |
430 | type &= ~CRYPTO_ALG_TYPE_MASK; | 658 | type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); |
431 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 659 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
432 | mask |= CRYPTO_ALG_TYPE_MASK; | 660 | mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC; |
433 | 661 | ||
434 | return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask)); | 662 | return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask)); |
435 | } | 663 | } |
@@ -447,9 +675,9 @@ static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm) | |||
447 | 675 | ||
448 | static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask) | 676 | static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask) |
449 | { | 677 | { |
450 | type &= ~CRYPTO_ALG_TYPE_MASK; | 678 | type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); |
451 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; | 679 | type |= CRYPTO_ALG_TYPE_BLKCIPHER; |
452 | mask |= CRYPTO_ALG_TYPE_MASK; | 680 | mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC; |
453 | 681 | ||
454 | return crypto_has_alg(alg_name, type, mask); | 682 | return crypto_has_alg(alg_name, type, mask); |
455 | } | 683 | } |
diff --git a/include/linux/device.h b/include/linux/device.h index a0cd2ced31a9..6579068134d1 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -53,7 +53,7 @@ struct bus_type { | |||
53 | const char * name; | 53 | const char * name; |
54 | struct module * owner; | 54 | struct module * owner; |
55 | 55 | ||
56 | struct subsystem subsys; | 56 | struct kset subsys; |
57 | struct kset drivers; | 57 | struct kset drivers; |
58 | struct kset devices; | 58 | struct kset devices; |
59 | struct klist klist_devices; | 59 | struct klist klist_devices; |
@@ -80,7 +80,6 @@ struct bus_type { | |||
80 | int (*resume)(struct device * dev); | 80 | int (*resume)(struct device * dev); |
81 | 81 | ||
82 | unsigned int drivers_autoprobe:1; | 82 | unsigned int drivers_autoprobe:1; |
83 | unsigned int multithread_probe:1; | ||
84 | }; | 83 | }; |
85 | 84 | ||
86 | extern int __must_check bus_register(struct bus_type * bus); | 85 | extern int __must_check bus_register(struct bus_type * bus); |
@@ -179,7 +178,7 @@ struct class { | |||
179 | const char * name; | 178 | const char * name; |
180 | struct module * owner; | 179 | struct module * owner; |
181 | 180 | ||
182 | struct subsystem subsys; | 181 | struct kset subsys; |
183 | struct list_head children; | 182 | struct list_head children; |
184 | struct list_head devices; | 183 | struct list_head devices; |
185 | struct list_head interfaces; | 184 | struct list_head interfaces; |
@@ -559,8 +558,8 @@ extern void device_shutdown(void); | |||
559 | 558 | ||
560 | 559 | ||
561 | /* drivers/base/firmware.c */ | 560 | /* drivers/base/firmware.c */ |
562 | extern int __must_check firmware_register(struct subsystem *); | 561 | extern int __must_check firmware_register(struct kset *); |
563 | extern void firmware_unregister(struct subsystem *); | 562 | extern void firmware_unregister(struct kset *); |
564 | 563 | ||
565 | /* debugging and troubleshooting/diagnostic helpers. */ | 564 | /* debugging and troubleshooting/diagnostic helpers. */ |
566 | extern const char *dev_driver_string(struct device *dev); | 565 | extern const char *dev_driver_string(struct device *dev); |
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h index 2a2dd189b9fd..c2735cab2ebf 100644 --- a/include/linux/dlm_device.h +++ b/include/linux/dlm_device.h | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | /* Version of the device interface */ | 20 | /* Version of the device interface */ |
21 | #define DLM_DEVICE_VERSION_MAJOR 5 | 21 | #define DLM_DEVICE_VERSION_MAJOR 5 |
22 | #define DLM_DEVICE_VERSION_MINOR 0 | 22 | #define DLM_DEVICE_VERSION_MINOR 1 |
23 | #define DLM_DEVICE_VERSION_PATCH 0 | 23 | #define DLM_DEVICE_VERSION_PATCH 0 |
24 | 24 | ||
25 | /* struct passed to the lock write */ | 25 | /* struct passed to the lock write */ |
@@ -44,6 +44,11 @@ struct dlm_lspace_params { | |||
44 | char name[0]; | 44 | char name[0]; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | struct dlm_purge_params { | ||
48 | __u32 nodeid; | ||
49 | __u32 pid; | ||
50 | }; | ||
51 | |||
47 | struct dlm_write_request { | 52 | struct dlm_write_request { |
48 | __u32 version[3]; | 53 | __u32 version[3]; |
49 | __u8 cmd; | 54 | __u8 cmd; |
@@ -53,6 +58,7 @@ struct dlm_write_request { | |||
53 | union { | 58 | union { |
54 | struct dlm_lock_params lock; | 59 | struct dlm_lock_params lock; |
55 | struct dlm_lspace_params lspace; | 60 | struct dlm_lspace_params lspace; |
61 | struct dlm_purge_params purge; | ||
56 | } i; | 62 | } i; |
57 | }; | 63 | }; |
58 | 64 | ||
@@ -76,6 +82,7 @@ struct dlm_lock_result { | |||
76 | #define DLM_USER_QUERY 3 | 82 | #define DLM_USER_QUERY 3 |
77 | #define DLM_USER_CREATE_LOCKSPACE 4 | 83 | #define DLM_USER_CREATE_LOCKSPACE 4 |
78 | #define DLM_USER_REMOVE_LOCKSPACE 5 | 84 | #define DLM_USER_REMOVE_LOCKSPACE 5 |
85 | #define DLM_USER_PURGE 6 | ||
79 | 86 | ||
80 | /* Arbitrary length restriction */ | 87 | /* Arbitrary length restriction */ |
81 | #define MAX_LS_NAME_LEN 64 | 88 | #define MAX_LS_NAME_LEN 64 |
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 666e0a5f00fc..0311bad838b1 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #define EM_V850 87 /* NEC v850 */ | 30 | #define EM_V850 87 /* NEC v850 */ |
31 | #define EM_M32R 88 /* Renesas M32R */ | 31 | #define EM_M32R 88 /* Renesas M32R */ |
32 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | 32 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ |
33 | #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ | ||
33 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | 34 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ |
34 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ | 35 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ |
35 | 36 | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 60713e6ea297..8b17ffe222c4 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -83,6 +83,23 @@ typedef __s64 Elf64_Sxword; | |||
83 | #define DT_DEBUG 21 | 83 | #define DT_DEBUG 21 |
84 | #define DT_TEXTREL 22 | 84 | #define DT_TEXTREL 22 |
85 | #define DT_JMPREL 23 | 85 | #define DT_JMPREL 23 |
86 | #define DT_ENCODING 32 | ||
87 | #define OLD_DT_LOOS 0x60000000 | ||
88 | #define DT_LOOS 0x6000000d | ||
89 | #define DT_HIOS 0x6ffff000 | ||
90 | #define DT_VALRNGLO 0x6ffffd00 | ||
91 | #define DT_VALRNGHI 0x6ffffdff | ||
92 | #define DT_ADDRRNGLO 0x6ffffe00 | ||
93 | #define DT_ADDRRNGHI 0x6ffffeff | ||
94 | #define DT_VERSYM 0x6ffffff0 | ||
95 | #define DT_RELACOUNT 0x6ffffff9 | ||
96 | #define DT_RELCOUNT 0x6ffffffa | ||
97 | #define DT_FLAGS_1 0x6ffffffb | ||
98 | #define DT_VERDEF 0x6ffffffc | ||
99 | #define DT_VERDEFNUM 0x6ffffffd | ||
100 | #define DT_VERNEED 0x6ffffffe | ||
101 | #define DT_VERNEEDNUM 0x6fffffff | ||
102 | #define OLD_DT_HIOS 0x6fffffff | ||
86 | #define DT_LOPROC 0x70000000 | 103 | #define DT_LOPROC 0x70000000 |
87 | #define DT_HIPROC 0x7fffffff | 104 | #define DT_HIPROC 0x7fffffff |
88 | 105 | ||
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h index 67396db141e8..9a1e0674e56c 100644 --- a/include/linux/elfnote.h +++ b/include/linux/elfnote.h | |||
@@ -39,12 +39,12 @@ | |||
39 | * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) | 39 | * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) |
40 | */ | 40 | */ |
41 | #define ELFNOTE(name, type, desctype, descdata) \ | 41 | #define ELFNOTE(name, type, desctype, descdata) \ |
42 | .pushsection .note.name ; \ | 42 | .pushsection .note.name, "",@note ; \ |
43 | .align 4 ; \ | 43 | .align 4 ; \ |
44 | .long 2f - 1f /* namesz */ ; \ | 44 | .long 2f - 1f /* namesz */ ; \ |
45 | .long 4f - 3f /* descsz */ ; \ | 45 | .long 4f - 3f /* descsz */ ; \ |
46 | .long type ; \ | 46 | .long type ; \ |
47 | 1:.asciz "name" ; \ | 47 | 1:.asciz #name ; \ |
48 | 2:.align 4 ; \ | 48 | 2:.align 4 ; \ |
49 | 3:desctype descdata ; \ | 49 | 3:desctype descdata ; \ |
50 | 4:.align 4 ; \ | 50 | 4:.align 4 ; \ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 745c988359c0..071c67abed86 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -71,6 +71,18 @@ static inline int is_multicast_ether_addr(const u8 *addr) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * is_local_ether_addr - Determine if the Ethernet address is locally-assigned | ||
75 | * one (IEEE 802). | ||
76 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
77 | * | ||
78 | * Return true if the address is a local address. | ||
79 | */ | ||
80 | static inline int is_local_ether_addr(const u8 *addr) | ||
81 | { | ||
82 | return (0x02 & addr[0]); | ||
83 | } | ||
84 | |||
85 | /** | ||
74 | * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast | 86 | * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast |
75 | * @addr: Pointer to a six-byte array containing the Ethernet address | 87 | * @addr: Pointer to a six-byte array containing the Ethernet address |
76 | * | 88 | * |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index c6310aef5ab0..f2d248f8cc92 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -434,6 +434,7 @@ struct ethtool_ops { | |||
434 | #define SUPPORTED_10000baseT_Full (1 << 12) | 434 | #define SUPPORTED_10000baseT_Full (1 << 12) |
435 | #define SUPPORTED_Pause (1 << 13) | 435 | #define SUPPORTED_Pause (1 << 13) |
436 | #define SUPPORTED_Asym_Pause (1 << 14) | 436 | #define SUPPORTED_Asym_Pause (1 << 14) |
437 | #define SUPPORTED_2500baseX_Full (1 << 15) | ||
437 | 438 | ||
438 | /* Indicates what features are advertised by the interface. */ | 439 | /* Indicates what features are advertised by the interface. */ |
439 | #define ADVERTISED_10baseT_Half (1 << 0) | 440 | #define ADVERTISED_10baseT_Half (1 << 0) |
@@ -451,6 +452,7 @@ struct ethtool_ops { | |||
451 | #define ADVERTISED_10000baseT_Full (1 << 12) | 452 | #define ADVERTISED_10000baseT_Full (1 << 12) |
452 | #define ADVERTISED_Pause (1 << 13) | 453 | #define ADVERTISED_Pause (1 << 13) |
453 | #define ADVERTISED_Asym_Pause (1 << 14) | 454 | #define ADVERTISED_Asym_Pause (1 << 14) |
455 | #define ADVERTISED_2500baseX_Full (1 << 15) | ||
454 | 456 | ||
455 | /* The following are all involved in forcing a particular link | 457 | /* The following are all involved in forcing a particular link |
456 | * mode for the device for setting things. When getting the | 458 | * mode for the device for setting things. When getting the |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index 996f5611cd59..40b93265d4ba 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -3,6 +3,10 @@ | |||
3 | 3 | ||
4 | #include <asm/fcntl.h> | 4 | #include <asm/fcntl.h> |
5 | 5 | ||
6 | /* Cancel a blocking posix lock; internal use only until we expose an | ||
7 | * asynchronous lock api to userspace: */ | ||
8 | #define F_CANCELLK (F_LINUX_SPECIFIC_BASE+5) | ||
9 | |||
6 | #define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) | 10 | #define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) |
7 | #define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) | 11 | #define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) |
8 | 12 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 095a9c9a64fb..bc6d27cecaac 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -696,12 +696,13 @@ struct file_ra_state { | |||
696 | unsigned long size; | 696 | unsigned long size; |
697 | unsigned long flags; /* ra flags RA_FLAG_xxx*/ | 697 | unsigned long flags; /* ra flags RA_FLAG_xxx*/ |
698 | unsigned long cache_hit; /* cache hit count*/ | 698 | unsigned long cache_hit; /* cache hit count*/ |
699 | unsigned long prev_page; /* Cache last read() position */ | 699 | unsigned long prev_index; /* Cache last read() position */ |
700 | unsigned long ahead_start; /* Ahead window */ | 700 | unsigned long ahead_start; /* Ahead window */ |
701 | unsigned long ahead_size; | 701 | unsigned long ahead_size; |
702 | unsigned long ra_pages; /* Maximum readahead window */ | 702 | unsigned long ra_pages; /* Maximum readahead window */ |
703 | unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ | 703 | unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ |
704 | unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ | 704 | unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ |
705 | unsigned int prev_offset; /* Offset where last read() ended in a page */ | ||
705 | }; | 706 | }; |
706 | #define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ | 707 | #define RA_FLAG_MISS 0x01 /* a cache miss occured against this file */ |
707 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ | 708 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ |
@@ -785,6 +786,7 @@ struct file_lock_operations { | |||
785 | struct lock_manager_operations { | 786 | struct lock_manager_operations { |
786 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 787 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); |
787 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 788 | void (*fl_notify)(struct file_lock *); /* unblock callback */ |
789 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | ||
788 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 790 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
789 | void (*fl_release_private)(struct file_lock *); | 791 | void (*fl_release_private)(struct file_lock *); |
790 | void (*fl_break)(struct file_lock *); | 792 | void (*fl_break)(struct file_lock *); |
@@ -856,11 +858,13 @@ extern void locks_init_lock(struct file_lock *); | |||
856 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 858 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
857 | extern void locks_remove_posix(struct file *, fl_owner_t); | 859 | extern void locks_remove_posix(struct file *, fl_owner_t); |
858 | extern void locks_remove_flock(struct file *); | 860 | extern void locks_remove_flock(struct file *); |
859 | extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); | 861 | extern int posix_test_lock(struct file *, struct file_lock *); |
860 | extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); | 862 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
861 | extern int posix_lock_file(struct file *, struct file_lock *); | ||
862 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 863 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
863 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 864 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
865 | extern int vfs_test_lock(struct file *, struct file_lock *); | ||
866 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | ||
867 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | ||
864 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 868 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
865 | extern int __break_lease(struct inode *inode, unsigned int flags); | 869 | extern int __break_lease(struct inode *inode, unsigned int flags); |
866 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 870 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
@@ -1416,7 +1420,7 @@ extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | |||
1416 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | 1420 | extern int vfs_statfs(struct dentry *, struct kstatfs *); |
1417 | 1421 | ||
1418 | /* /sys/fs */ | 1422 | /* /sys/fs */ |
1419 | extern struct subsystem fs_subsys; | 1423 | extern struct kset fs_subsys; |
1420 | 1424 | ||
1421 | #define FLOCK_VERIFY_READ 1 | 1425 | #define FLOCK_VERIFY_READ 1 |
1422 | #define FLOCK_VERIFY_WRITE 2 | 1426 | #define FLOCK_VERIFY_WRITE 2 |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 2a7d15bcde46..97a36c3d96e2 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -40,7 +40,6 @@ struct vm_area_struct; | |||
40 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */ | 40 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */ |
41 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */ | 41 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */ |
42 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */ | 42 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */ |
43 | #define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */ | ||
44 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ | 43 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ |
45 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ | 44 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ |
46 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 45 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
@@ -53,7 +52,7 @@ struct vm_area_struct; | |||
53 | /* if you forget to add the bitmask here kernel will crash, period */ | 52 | /* if you forget to add the bitmask here kernel will crash, period */ |
54 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 53 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
55 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 54 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
56 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 55 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ |
57 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) | 56 | __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) |
58 | 57 | ||
59 | /* This equals 0, but use constants in case they ever change */ | 58 | /* This equals 0, but use constants in case they ever change */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 645d440807c2..a515eb0afdfb 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -27,6 +27,8 @@ static inline void flush_kernel_dcache_page(struct page *page) | |||
27 | unsigned int nr_free_highpages(void); | 27 | unsigned int nr_free_highpages(void); |
28 | extern unsigned long totalhigh_pages; | 28 | extern unsigned long totalhigh_pages; |
29 | 29 | ||
30 | void kmap_flush_unused(void); | ||
31 | |||
30 | #else /* CONFIG_HIGHMEM */ | 32 | #else /* CONFIG_HIGHMEM */ |
31 | 33 | ||
32 | static inline unsigned int nr_free_highpages(void) { return 0; } | 34 | static inline unsigned int nr_free_highpages(void) { return 0; } |
@@ -42,11 +44,20 @@ static inline void *kmap(struct page *page) | |||
42 | 44 | ||
43 | #define kunmap(page) do { (void) (page); } while (0) | 45 | #define kunmap(page) do { (void) (page); } while (0) |
44 | 46 | ||
45 | #define kmap_atomic(page, idx) \ | 47 | #include <asm/kmap_types.h> |
46 | ({ pagefault_disable(); page_address(page); }) | 48 | |
49 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | ||
50 | { | ||
51 | pagefault_disable(); | ||
52 | return page_address(page); | ||
53 | } | ||
54 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) | ||
55 | |||
47 | #define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0) | 56 | #define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0) |
48 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | 57 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) |
49 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 58 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
59 | |||
60 | #define kmap_flush_unused() do {} while(0) | ||
50 | #endif | 61 | #endif |
51 | 62 | ||
52 | #endif /* CONFIG_HIGHMEM */ | 63 | #endif /* CONFIG_HIGHMEM */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 3f3e7a648da3..b4570b62ab85 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -189,4 +189,10 @@ static inline void set_file_hugepages(struct file *file) | |||
189 | 189 | ||
190 | #endif /* !CONFIG_HUGETLBFS */ | 190 | #endif /* !CONFIG_HUGETLBFS */ |
191 | 191 | ||
192 | #ifdef HAVE_ARCH_HUGETLB_UNMAPPED_AREA | ||
193 | unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | ||
194 | unsigned long len, unsigned long pgoff, | ||
195 | unsigned long flags); | ||
196 | #endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */ | ||
197 | |||
192 | #endif /* _LINUX_HUGETLB_H */ | 198 | #endif /* _LINUX_HUGETLB_H */ |
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index 937da70cb4c4..9ee0f800592f 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -38,11 +38,14 @@ struct i2c_algo_bit_data { | |||
38 | int (*getscl) (void *data); | 38 | int (*getscl) (void *data); |
39 | 39 | ||
40 | /* local settings */ | 40 | /* local settings */ |
41 | int udelay; /* half-clock-cycle time in microsecs */ | 41 | int udelay; /* half clock cycle time in us, |
42 | /* i.e. clock is (500 / udelay) KHz */ | 42 | minimum 2 us for fast-mode I2C, |
43 | minimum 5 us for standard-mode I2C and SMBus, | ||
44 | maximum 50 us for SMBus */ | ||
43 | int timeout; /* in jiffies */ | 45 | int timeout; /* in jiffies */ |
44 | }; | 46 | }; |
45 | 47 | ||
46 | int i2c_bit_add_bus(struct i2c_adapter *); | 48 | int i2c_bit_add_bus(struct i2c_adapter *); |
49 | int i2c_bit_add_numbered_bus(struct i2c_adapter *); | ||
47 | 50 | ||
48 | #endif /* _LINUX_I2C_ALGO_BIT_H */ | 51 | #endif /* _LINUX_I2C_ALGO_BIT_H */ |
diff --git a/include/linux/i2c-gpio.h b/include/linux/i2c-gpio.h new file mode 100644 index 000000000000..c1bcb1f1d73b --- /dev/null +++ b/include/linux/i2c-gpio.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * i2c-gpio interface to platform code | ||
3 | * | ||
4 | * Copyright (C) 2007 Atmel Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef _LINUX_I2C_GPIO_H | ||
11 | #define _LINUX_I2C_GPIO_H | ||
12 | |||
13 | /** | ||
14 | * struct i2c_gpio_platform_data - Platform-dependent data for i2c-gpio | ||
15 | * @sda_pin: GPIO pin ID to use for SDA | ||
16 | * @scl_pin: GPIO pin ID to use for SCL | ||
17 | * @udelay: signal toggle delay. SCL frequency is (500 / udelay) kHz | ||
18 | * @timeout: clock stretching timeout in jiffies. If the slave keeps | ||
19 | * SCL low for longer than this, the transfer will time out. | ||
20 | * @sda_is_open_drain: SDA is configured as open drain, i.e. the pin | ||
21 | * isn't actively driven high when setting the output value high. | ||
22 | * gpio_get_value() must return the actual pin state even if the | ||
23 | * pin is configured as an output. | ||
24 | * @scl_is_open_drain: SCL is set up as open drain. Same requirements | ||
25 | * as for sda_is_open_drain apply. | ||
26 | * @scl_is_output_only: SCL output drivers cannot be turned off. | ||
27 | */ | ||
28 | struct i2c_gpio_platform_data { | ||
29 | unsigned int sda_pin; | ||
30 | unsigned int scl_pin; | ||
31 | int udelay; | ||
32 | int timeout; | ||
33 | unsigned int sda_is_open_drain:1; | ||
34 | unsigned int scl_is_open_drain:1; | ||
35 | unsigned int scl_is_output_only:1; | ||
36 | }; | ||
37 | |||
38 | #endif /* _LINUX_I2C_GPIO_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 9c21dc793d7b..0e8da684ce68 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -258,8 +258,9 @@ | |||
258 | /* --- MCP107 adapter */ | 258 | /* --- MCP107 adapter */ |
259 | #define I2C_HW_MPC107 0x0d0000 | 259 | #define I2C_HW_MPC107 0x0d0000 |
260 | 260 | ||
261 | /* --- Marvell mv64xxx i2c adapter */ | 261 | /* --- Embedded adapters */ |
262 | #define I2C_HW_MV64XXX 0x190000 | 262 | #define I2C_HW_MV64XXX 0x190000 |
263 | #define I2C_HW_BLACKFIN 0x190001 /* ADI Blackfin I2C TWI driver */ | ||
263 | 264 | ||
264 | /* --- Miscellaneous adapters */ | 265 | /* --- Miscellaneous adapters */ |
265 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | 266 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9428092017e3..cae7d618030c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -35,11 +35,6 @@ | |||
35 | #include <linux/sched.h> /* for completion */ | 35 | #include <linux/sched.h> /* for completion */ |
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | 37 | ||
38 | /* --- For i2c-isa ---------------------------------------------------- */ | ||
39 | |||
40 | extern void i2c_adapter_dev_release(struct device *dev); | ||
41 | extern struct device_driver i2c_adapter_driver; | ||
42 | extern struct class i2c_adapter_class; | ||
43 | extern struct bus_type i2c_bus_type; | 38 | extern struct bus_type i2c_bus_type; |
44 | 39 | ||
45 | /* --- General options ------------------------------------------------ */ | 40 | /* --- General options ------------------------------------------------ */ |
@@ -87,6 +82,9 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, | |||
87 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); | 82 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); |
88 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | 83 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, |
89 | u8 command, u16 value); | 84 | u8 command, u16 value); |
85 | /* Returns the number of read bytes */ | ||
86 | extern s32 i2c_smbus_read_block_data(struct i2c_client *client, | ||
87 | u8 command, u8 *values); | ||
90 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 88 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
91 | u8 command, u8 length, | 89 | u8 command, u8 length, |
92 | const u8 *values); | 90 | const u8 *values); |
@@ -114,7 +112,7 @@ struct i2c_driver { | |||
114 | * can be used by the driver to test if the bus meets its conditions | 112 | * can be used by the driver to test if the bus meets its conditions |
115 | * & seek for the presence of the chip(s) it supports. If found, it | 113 | * & seek for the presence of the chip(s) it supports. If found, it |
116 | * registers the client(s) that are on the bus to the i2c admin. via | 114 | * registers the client(s) that are on the bus to the i2c admin. via |
117 | * i2c_attach_client. | 115 | * i2c_attach_client. (LEGACY I2C DRIVERS ONLY) |
118 | */ | 116 | */ |
119 | int (*attach_adapter)(struct i2c_adapter *); | 117 | int (*attach_adapter)(struct i2c_adapter *); |
120 | int (*detach_adapter)(struct i2c_adapter *); | 118 | int (*detach_adapter)(struct i2c_adapter *); |
@@ -122,10 +120,17 @@ struct i2c_driver { | |||
122 | /* tells the driver that a client is about to be deleted & gives it | 120 | /* tells the driver that a client is about to be deleted & gives it |
123 | * the chance to remove its private data. Also, if the client struct | 121 | * the chance to remove its private data. Also, if the client struct |
124 | * has been dynamically allocated by the driver in the function above, | 122 | * has been dynamically allocated by the driver in the function above, |
125 | * it must be freed here. | 123 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) |
126 | */ | 124 | */ |
127 | int (*detach_client)(struct i2c_client *); | 125 | int (*detach_client)(struct i2c_client *); |
128 | 126 | ||
127 | /* Standard driver model interfaces, for "new style" i2c drivers. | ||
128 | * With the driver model, device enumeration is NEVER done by drivers; | ||
129 | * it's done by infrastructure. (NEW STYLE DRIVERS ONLY) | ||
130 | */ | ||
131 | int (*probe)(struct i2c_client *); | ||
132 | int (*remove)(struct i2c_client *); | ||
133 | |||
129 | /* driver model interfaces that don't relate to enumeration */ | 134 | /* driver model interfaces that don't relate to enumeration */ |
130 | void (*shutdown)(struct i2c_client *); | 135 | void (*shutdown)(struct i2c_client *); |
131 | int (*suspend)(struct i2c_client *, pm_message_t mesg); | 136 | int (*suspend)(struct i2c_client *, pm_message_t mesg); |
@@ -141,25 +146,34 @@ struct i2c_driver { | |||
141 | }; | 146 | }; |
142 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) | 147 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) |
143 | 148 | ||
144 | #define I2C_NAME_SIZE 50 | 149 | #define I2C_NAME_SIZE 20 |
145 | 150 | ||
146 | /* | 151 | /** |
147 | * i2c_client identifies a single device (i.e. chip) that is connected to an | 152 | * struct i2c_client - represent an I2C slave device |
148 | * i2c bus. The behaviour is defined by the routines of the driver. This | 153 | * @addr: Address used on the I2C bus connected to the parent adapter. |
149 | * function is mainly used for lookup & other admin. functions. | 154 | * @name: Indicates the type of the device, usually a chip name that's |
155 | * generic enough to hide second-sourcing and compatible revisions. | ||
156 | * @dev: Driver model device node for the slave. | ||
157 | * @driver_name: Identifies new-style driver used with this device; also | ||
158 | * used as the module name for hotplug/coldplug modprobe support. | ||
159 | * | ||
160 | * An i2c_client identifies a single device (i.e. chip) connected to an | ||
161 | * i2c bus. The behaviour is defined by the routines of the driver. | ||
150 | */ | 162 | */ |
151 | struct i2c_client { | 163 | struct i2c_client { |
152 | unsigned int flags; /* div., see below */ | 164 | unsigned short flags; /* div., see below */ |
153 | unsigned short addr; /* chip address - NOTE: 7bit */ | 165 | unsigned short addr; /* chip address - NOTE: 7bit */ |
154 | /* addresses are stored in the */ | 166 | /* addresses are stored in the */ |
155 | /* _LOWER_ 7 bits */ | 167 | /* _LOWER_ 7 bits */ |
168 | char name[I2C_NAME_SIZE]; | ||
156 | struct i2c_adapter *adapter; /* the adapter we sit on */ | 169 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
157 | struct i2c_driver *driver; /* and our access routines */ | 170 | struct i2c_driver *driver; /* and our access routines */ |
158 | int usage_count; /* How many accesses currently */ | 171 | int usage_count; /* How many accesses currently */ |
159 | /* to the client */ | 172 | /* to the client */ |
160 | struct device dev; /* the device structure */ | 173 | struct device dev; /* the device structure */ |
174 | int irq; /* irq issued by device (or -1) */ | ||
175 | char driver_name[KOBJ_NAME_LEN]; | ||
161 | struct list_head list; | 176 | struct list_head list; |
162 | char name[I2C_NAME_SIZE]; | ||
163 | struct completion released; | 177 | struct completion released; |
164 | }; | 178 | }; |
165 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 179 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
@@ -179,6 +193,76 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) | |||
179 | dev_set_drvdata (&dev->dev, data); | 193 | dev_set_drvdata (&dev->dev, data); |
180 | } | 194 | } |
181 | 195 | ||
196 | /** | ||
197 | * struct i2c_board_info - template for device creation | ||
198 | * @driver_name: identifies the driver to be bound to the device | ||
199 | * @type: optional chip type information, to initialize i2c_client.name | ||
200 | * @flags: to initialize i2c_client.flags | ||
201 | * @addr: stored in i2c_client.addr | ||
202 | * @platform_data: stored in i2c_client.dev.platform_data | ||
203 | * @irq: stored in i2c_client.irq | ||
204 | |||
205 | * I2C doesn't actually support hardware probing, although controllers and | ||
206 | * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's | ||
207 | * a device at a given address. Drivers commonly need more information than | ||
208 | * that, such as chip type, configuration, associated IRQ, and so on. | ||
209 | * | ||
210 | * i2c_board_info is used to build tables of information listing I2C devices | ||
211 | * that are present. This information is used to grow the driver model tree | ||
212 | * for "new style" I2C drivers. For mainboards this is done statically using | ||
213 | * i2c_register_board_info(), where @bus_num represents an adapter that isn't | ||
214 | * yet available. For add-on boards, i2c_new_device() does this dynamically | ||
215 | * with the adapter already known. | ||
216 | */ | ||
217 | struct i2c_board_info { | ||
218 | char driver_name[KOBJ_NAME_LEN]; | ||
219 | char type[I2C_NAME_SIZE]; | ||
220 | unsigned short flags; | ||
221 | unsigned short addr; | ||
222 | void *platform_data; | ||
223 | int irq; | ||
224 | }; | ||
225 | |||
226 | /** | ||
227 | * I2C_BOARD_INFO - macro used to list an i2c device and its driver | ||
228 | * @driver: identifies the driver to use with the device | ||
229 | * @dev_addr: the device's address on the bus. | ||
230 | * | ||
231 | * This macro initializes essential fields of a struct i2c_board_info, | ||
232 | * declaring what has been provided on a particular board. Optional | ||
233 | * fields (such as the chip type, its associated irq, or device-specific | ||
234 | * platform_data) are provided using conventional syntax. | ||
235 | */ | ||
236 | #define I2C_BOARD_INFO(driver,dev_addr) \ | ||
237 | .driver_name = (driver), .addr = (dev_addr) | ||
238 | |||
239 | |||
240 | /* Add-on boards should register/unregister their devices; e.g. a board | ||
241 | * with integrated I2C, a config eeprom, sensors, and a codec that's | ||
242 | * used in conjunction with the primary hardware. | ||
243 | */ | ||
244 | extern struct i2c_client * | ||
245 | i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info); | ||
246 | |||
247 | /* If you don't know the exact address of an I2C device, use this variant | ||
248 | * instead, which can probe for device presence in a list of possible | ||
249 | * addresses. | ||
250 | */ | ||
251 | extern struct i2c_client * | ||
252 | i2c_new_probed_device(struct i2c_adapter *adap, | ||
253 | struct i2c_board_info *info, | ||
254 | unsigned short const *addr_list); | ||
255 | |||
256 | extern void i2c_unregister_device(struct i2c_client *); | ||
257 | |||
258 | /* Mainboard arch_initcall() code should register all its I2C devices. | ||
259 | * This is done at arch_initcall time, before declaring any i2c adapters. | ||
260 | * Modules for add-on boards must use other calls. | ||
261 | */ | ||
262 | extern int | ||
263 | i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n); | ||
264 | |||
265 | |||
182 | /* | 266 | /* |
183 | * The following structs are for those who like to implement new bus drivers: | 267 | * The following structs are for those who like to implement new bus drivers: |
184 | * i2c_algorithm is the interface to a class of hardware solutions which can | 268 | * i2c_algorithm is the interface to a class of hardware solutions which can |
@@ -228,17 +312,14 @@ struct i2c_adapter { | |||
228 | int timeout; | 312 | int timeout; |
229 | int retries; | 313 | int retries; |
230 | struct device dev; /* the adapter device */ | 314 | struct device dev; /* the adapter device */ |
231 | struct class_device class_dev; /* the class device */ | ||
232 | 315 | ||
233 | int nr; | 316 | int nr; |
234 | struct list_head clients; | 317 | struct list_head clients; |
235 | struct list_head list; | 318 | struct list_head list; |
236 | char name[I2C_NAME_SIZE]; | 319 | char name[48]; |
237 | struct completion dev_released; | 320 | struct completion dev_released; |
238 | struct completion class_dev_released; | ||
239 | }; | 321 | }; |
240 | #define dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) | 322 | #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) |
241 | #define class_dev_to_i2c_adapter(d) container_of(d, struct i2c_adapter, class_dev) | ||
242 | 323 | ||
243 | static inline void *i2c_get_adapdata (struct i2c_adapter *dev) | 324 | static inline void *i2c_get_adapdata (struct i2c_adapter *dev) |
244 | { | 325 | { |
@@ -290,9 +371,10 @@ struct i2c_client_address_data { | |||
290 | */ | 371 | */ |
291 | extern int i2c_add_adapter(struct i2c_adapter *); | 372 | extern int i2c_add_adapter(struct i2c_adapter *); |
292 | extern int i2c_del_adapter(struct i2c_adapter *); | 373 | extern int i2c_del_adapter(struct i2c_adapter *); |
374 | extern int i2c_add_numbered_adapter(struct i2c_adapter *); | ||
293 | 375 | ||
294 | extern int i2c_register_driver(struct module *, struct i2c_driver *); | 376 | extern int i2c_register_driver(struct module *, struct i2c_driver *); |
295 | extern int i2c_del_driver(struct i2c_driver *); | 377 | extern void i2c_del_driver(struct i2c_driver *); |
296 | 378 | ||
297 | static inline int i2c_add_driver(struct i2c_driver *driver) | 379 | static inline int i2c_add_driver(struct i2c_driver *driver) |
298 | { | 380 | { |
@@ -365,6 +447,7 @@ struct i2c_msg { | |||
365 | #define I2C_M_REV_DIR_ADDR 0x2000 | 447 | #define I2C_M_REV_DIR_ADDR 0x2000 |
366 | #define I2C_M_IGNORE_NAK 0x1000 | 448 | #define I2C_M_IGNORE_NAK 0x1000 |
367 | #define I2C_M_NO_RD_ACK 0x0800 | 449 | #define I2C_M_NO_RD_ACK 0x0800 |
450 | #define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ | ||
368 | __u16 len; /* msg length */ | 451 | __u16 len; /* msg length */ |
369 | __u8 *buf; /* pointer to msg data */ | 452 | __u8 *buf; /* pointer to msg data */ |
370 | }; | 453 | }; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index d3bbc7188b6a..418dfb5adadd 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -613,7 +613,6 @@ typedef struct ide_drive_s { | |||
613 | 613 | ||
614 | u8 quirk_list; /* considered quirky, set for a specific host */ | 614 | u8 quirk_list; /* considered quirky, set for a specific host */ |
615 | u8 init_speed; /* transfer rate set at boot */ | 615 | u8 init_speed; /* transfer rate set at boot */ |
616 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ | ||
617 | u8 current_speed; /* current transfer rate set */ | 616 | u8 current_speed; /* current transfer rate set */ |
618 | u8 desired_speed; /* desired transfer rate set */ | 617 | u8 desired_speed; /* desired transfer rate set */ |
619 | u8 dn; /* now wide spread use */ | 618 | u8 dn; /* now wide spread use */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h new file mode 100644 index 000000000000..ecd61e8438a5 --- /dev/null +++ b/include/linux/ieee80211.h | |||
@@ -0,0 +1,342 @@ | |||
1 | /* | ||
2 | * IEEE 802.11 defines | ||
3 | * | ||
4 | * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen | ||
5 | * <jkmaline@cc.hut.fi> | ||
6 | * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi> | ||
7 | * Copyright (c) 2005, Devicescape Software, Inc. | ||
8 | * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #ifndef IEEE80211_H | ||
16 | #define IEEE80211_H | ||
17 | |||
18 | #include <linux/types.h> | ||
19 | |||
20 | #define FCS_LEN 4 | ||
21 | |||
22 | #define IEEE80211_FCTL_VERS 0x0003 | ||
23 | #define IEEE80211_FCTL_FTYPE 0x000c | ||
24 | #define IEEE80211_FCTL_STYPE 0x00f0 | ||
25 | #define IEEE80211_FCTL_TODS 0x0100 | ||
26 | #define IEEE80211_FCTL_FROMDS 0x0200 | ||
27 | #define IEEE80211_FCTL_MOREFRAGS 0x0400 | ||
28 | #define IEEE80211_FCTL_RETRY 0x0800 | ||
29 | #define IEEE80211_FCTL_PM 0x1000 | ||
30 | #define IEEE80211_FCTL_MOREDATA 0x2000 | ||
31 | #define IEEE80211_FCTL_PROTECTED 0x4000 | ||
32 | #define IEEE80211_FCTL_ORDER 0x8000 | ||
33 | |||
34 | #define IEEE80211_SCTL_FRAG 0x000F | ||
35 | #define IEEE80211_SCTL_SEQ 0xFFF0 | ||
36 | |||
37 | #define IEEE80211_FTYPE_MGMT 0x0000 | ||
38 | #define IEEE80211_FTYPE_CTL 0x0004 | ||
39 | #define IEEE80211_FTYPE_DATA 0x0008 | ||
40 | |||
41 | /* management */ | ||
42 | #define IEEE80211_STYPE_ASSOC_REQ 0x0000 | ||
43 | #define IEEE80211_STYPE_ASSOC_RESP 0x0010 | ||
44 | #define IEEE80211_STYPE_REASSOC_REQ 0x0020 | ||
45 | #define IEEE80211_STYPE_REASSOC_RESP 0x0030 | ||
46 | #define IEEE80211_STYPE_PROBE_REQ 0x0040 | ||
47 | #define IEEE80211_STYPE_PROBE_RESP 0x0050 | ||
48 | #define IEEE80211_STYPE_BEACON 0x0080 | ||
49 | #define IEEE80211_STYPE_ATIM 0x0090 | ||
50 | #define IEEE80211_STYPE_DISASSOC 0x00A0 | ||
51 | #define IEEE80211_STYPE_AUTH 0x00B0 | ||
52 | #define IEEE80211_STYPE_DEAUTH 0x00C0 | ||
53 | #define IEEE80211_STYPE_ACTION 0x00D0 | ||
54 | |||
55 | /* control */ | ||
56 | #define IEEE80211_STYPE_PSPOLL 0x00A0 | ||
57 | #define IEEE80211_STYPE_RTS 0x00B0 | ||
58 | #define IEEE80211_STYPE_CTS 0x00C0 | ||
59 | #define IEEE80211_STYPE_ACK 0x00D0 | ||
60 | #define IEEE80211_STYPE_CFEND 0x00E0 | ||
61 | #define IEEE80211_STYPE_CFENDACK 0x00F0 | ||
62 | |||
63 | /* data */ | ||
64 | #define IEEE80211_STYPE_DATA 0x0000 | ||
65 | #define IEEE80211_STYPE_DATA_CFACK 0x0010 | ||
66 | #define IEEE80211_STYPE_DATA_CFPOLL 0x0020 | ||
67 | #define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 | ||
68 | #define IEEE80211_STYPE_NULLFUNC 0x0040 | ||
69 | #define IEEE80211_STYPE_CFACK 0x0050 | ||
70 | #define IEEE80211_STYPE_CFPOLL 0x0060 | ||
71 | #define IEEE80211_STYPE_CFACKPOLL 0x0070 | ||
72 | #define IEEE80211_STYPE_QOS_DATA 0x0080 | ||
73 | #define IEEE80211_STYPE_QOS_DATA_CFACK 0x0090 | ||
74 | #define IEEE80211_STYPE_QOS_DATA_CFPOLL 0x00A0 | ||
75 | #define IEEE80211_STYPE_QOS_DATA_CFACKPOLL 0x00B0 | ||
76 | #define IEEE80211_STYPE_QOS_NULLFUNC 0x00C0 | ||
77 | #define IEEE80211_STYPE_QOS_CFACK 0x00D0 | ||
78 | #define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 | ||
79 | #define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 | ||
80 | |||
81 | |||
82 | /* miscellaneous IEEE 802.11 constants */ | ||
83 | #define IEEE80211_MAX_FRAG_THRESHOLD 2346 | ||
84 | #define IEEE80211_MAX_RTS_THRESHOLD 2347 | ||
85 | #define IEEE80211_MAX_AID 2007 | ||
86 | #define IEEE80211_MAX_TIM_LEN 251 | ||
87 | #define IEEE80211_MAX_DATA_LEN 2304 | ||
88 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | ||
89 | 6.2.1.1.2. | ||
90 | |||
91 | The figure in section 7.1.2 suggests a body size of up to 2312 | ||
92 | bytes is allowed, which is a bit confusing, I suspect this | ||
93 | represents the 2304 bytes of real data, plus a possible 8 bytes of | ||
94 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ | ||
95 | |||
96 | #define IEEE80211_MAX_SSID_LEN 32 | ||
97 | |||
98 | struct ieee80211_hdr { | ||
99 | __le16 frame_control; | ||
100 | __le16 duration_id; | ||
101 | u8 addr1[6]; | ||
102 | u8 addr2[6]; | ||
103 | u8 addr3[6]; | ||
104 | __le16 seq_ctrl; | ||
105 | u8 addr4[6]; | ||
106 | } __attribute__ ((packed)); | ||
107 | |||
108 | |||
109 | struct ieee80211_mgmt { | ||
110 | __le16 frame_control; | ||
111 | __le16 duration; | ||
112 | u8 da[6]; | ||
113 | u8 sa[6]; | ||
114 | u8 bssid[6]; | ||
115 | __le16 seq_ctrl; | ||
116 | union { | ||
117 | struct { | ||
118 | __le16 auth_alg; | ||
119 | __le16 auth_transaction; | ||
120 | __le16 status_code; | ||
121 | /* possibly followed by Challenge text */ | ||
122 | u8 variable[0]; | ||
123 | } __attribute__ ((packed)) auth; | ||
124 | struct { | ||
125 | __le16 reason_code; | ||
126 | } __attribute__ ((packed)) deauth; | ||
127 | struct { | ||
128 | __le16 capab_info; | ||
129 | __le16 listen_interval; | ||
130 | /* followed by SSID and Supported rates */ | ||
131 | u8 variable[0]; | ||
132 | } __attribute__ ((packed)) assoc_req; | ||
133 | struct { | ||
134 | __le16 capab_info; | ||
135 | __le16 status_code; | ||
136 | __le16 aid; | ||
137 | /* followed by Supported rates */ | ||
138 | u8 variable[0]; | ||
139 | } __attribute__ ((packed)) assoc_resp, reassoc_resp; | ||
140 | struct { | ||
141 | __le16 capab_info; | ||
142 | __le16 listen_interval; | ||
143 | u8 current_ap[6]; | ||
144 | /* followed by SSID and Supported rates */ | ||
145 | u8 variable[0]; | ||
146 | } __attribute__ ((packed)) reassoc_req; | ||
147 | struct { | ||
148 | __le16 reason_code; | ||
149 | } __attribute__ ((packed)) disassoc; | ||
150 | struct { | ||
151 | __le64 timestamp; | ||
152 | __le16 beacon_int; | ||
153 | __le16 capab_info; | ||
154 | /* followed by some of SSID, Supported rates, | ||
155 | * FH Params, DS Params, CF Params, IBSS Params, TIM */ | ||
156 | u8 variable[0]; | ||
157 | } __attribute__ ((packed)) beacon; | ||
158 | struct { | ||
159 | /* only variable items: SSID, Supported rates */ | ||
160 | u8 variable[0]; | ||
161 | } __attribute__ ((packed)) probe_req; | ||
162 | struct { | ||
163 | __le64 timestamp; | ||
164 | __le16 beacon_int; | ||
165 | __le16 capab_info; | ||
166 | /* followed by some of SSID, Supported rates, | ||
167 | * FH Params, DS Params, CF Params, IBSS Params */ | ||
168 | u8 variable[0]; | ||
169 | } __attribute__ ((packed)) probe_resp; | ||
170 | struct { | ||
171 | u8 category; | ||
172 | union { | ||
173 | struct { | ||
174 | u8 action_code; | ||
175 | u8 dialog_token; | ||
176 | u8 status_code; | ||
177 | u8 variable[0]; | ||
178 | } __attribute__ ((packed)) wme_action; | ||
179 | struct{ | ||
180 | u8 action_code; | ||
181 | u8 element_id; | ||
182 | u8 length; | ||
183 | u8 switch_mode; | ||
184 | u8 new_chan; | ||
185 | u8 switch_count; | ||
186 | } __attribute__((packed)) chan_switch; | ||
187 | } u; | ||
188 | } __attribute__ ((packed)) action; | ||
189 | } u; | ||
190 | } __attribute__ ((packed)); | ||
191 | |||
192 | |||
193 | /* Control frames */ | ||
194 | struct ieee80211_rts { | ||
195 | __le16 frame_control; | ||
196 | __le16 duration; | ||
197 | u8 ra[6]; | ||
198 | u8 ta[6]; | ||
199 | } __attribute__ ((packed)); | ||
200 | |||
201 | struct ieee80211_cts { | ||
202 | __le16 frame_control; | ||
203 | __le16 duration; | ||
204 | u8 ra[6]; | ||
205 | } __attribute__ ((packed)); | ||
206 | |||
207 | |||
208 | /* Authentication algorithms */ | ||
209 | #define WLAN_AUTH_OPEN 0 | ||
210 | #define WLAN_AUTH_SHARED_KEY 1 | ||
211 | #define WLAN_AUTH_FAST_BSS_TRANSITION 2 | ||
212 | #define WLAN_AUTH_LEAP 128 | ||
213 | |||
214 | #define WLAN_AUTH_CHALLENGE_LEN 128 | ||
215 | |||
216 | #define WLAN_CAPABILITY_ESS (1<<0) | ||
217 | #define WLAN_CAPABILITY_IBSS (1<<1) | ||
218 | #define WLAN_CAPABILITY_CF_POLLABLE (1<<2) | ||
219 | #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3) | ||
220 | #define WLAN_CAPABILITY_PRIVACY (1<<4) | ||
221 | #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) | ||
222 | #define WLAN_CAPABILITY_PBCC (1<<6) | ||
223 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) | ||
224 | /* 802.11h */ | ||
225 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | ||
226 | #define WLAN_CAPABILITY_QOS (1<<9) | ||
227 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | ||
228 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | ||
229 | |||
230 | /* Status codes */ | ||
231 | enum ieee80211_statuscode { | ||
232 | WLAN_STATUS_SUCCESS = 0, | ||
233 | WLAN_STATUS_UNSPECIFIED_FAILURE = 1, | ||
234 | WLAN_STATUS_CAPS_UNSUPPORTED = 10, | ||
235 | WLAN_STATUS_REASSOC_NO_ASSOC = 11, | ||
236 | WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, | ||
237 | WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, | ||
238 | WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, | ||
239 | WLAN_STATUS_CHALLENGE_FAIL = 15, | ||
240 | WLAN_STATUS_AUTH_TIMEOUT = 16, | ||
241 | WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, | ||
242 | WLAN_STATUS_ASSOC_DENIED_RATES = 18, | ||
243 | /* 802.11b */ | ||
244 | WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, | ||
245 | WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, | ||
246 | WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, | ||
247 | /* 802.11h */ | ||
248 | WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, | ||
249 | WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, | ||
250 | WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, | ||
251 | /* 802.11g */ | ||
252 | WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, | ||
253 | WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, | ||
254 | /* 802.11i */ | ||
255 | WLAN_STATUS_INVALID_IE = 40, | ||
256 | WLAN_STATUS_INVALID_GROUP_CIPHER = 41, | ||
257 | WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, | ||
258 | WLAN_STATUS_INVALID_AKMP = 43, | ||
259 | WLAN_STATUS_UNSUPP_RSN_VERSION = 44, | ||
260 | WLAN_STATUS_INVALID_RSN_IE_CAP = 45, | ||
261 | WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, | ||
262 | }; | ||
263 | |||
264 | |||
265 | /* Reason codes */ | ||
266 | enum ieee80211_reasoncode { | ||
267 | WLAN_REASON_UNSPECIFIED = 1, | ||
268 | WLAN_REASON_PREV_AUTH_NOT_VALID = 2, | ||
269 | WLAN_REASON_DEAUTH_LEAVING = 3, | ||
270 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, | ||
271 | WLAN_REASON_DISASSOC_AP_BUSY = 5, | ||
272 | WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, | ||
273 | WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, | ||
274 | WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, | ||
275 | WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, | ||
276 | /* 802.11h */ | ||
277 | WLAN_REASON_DISASSOC_BAD_POWER = 10, | ||
278 | WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, | ||
279 | /* 802.11i */ | ||
280 | WLAN_REASON_INVALID_IE = 13, | ||
281 | WLAN_REASON_MIC_FAILURE = 14, | ||
282 | WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, | ||
283 | WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, | ||
284 | WLAN_REASON_IE_DIFFERENT = 17, | ||
285 | WLAN_REASON_INVALID_GROUP_CIPHER = 18, | ||
286 | WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, | ||
287 | WLAN_REASON_INVALID_AKMP = 20, | ||
288 | WLAN_REASON_UNSUPP_RSN_VERSION = 21, | ||
289 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, | ||
290 | WLAN_REASON_IEEE8021X_FAILED = 23, | ||
291 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | ||
292 | }; | ||
293 | |||
294 | |||
295 | /* Information Element IDs */ | ||
296 | enum ieee80211_eid { | ||
297 | WLAN_EID_SSID = 0, | ||
298 | WLAN_EID_SUPP_RATES = 1, | ||
299 | WLAN_EID_FH_PARAMS = 2, | ||
300 | WLAN_EID_DS_PARAMS = 3, | ||
301 | WLAN_EID_CF_PARAMS = 4, | ||
302 | WLAN_EID_TIM = 5, | ||
303 | WLAN_EID_IBSS_PARAMS = 6, | ||
304 | WLAN_EID_CHALLENGE = 16, | ||
305 | /* 802.11d */ | ||
306 | WLAN_EID_COUNTRY = 7, | ||
307 | WLAN_EID_HP_PARAMS = 8, | ||
308 | WLAN_EID_HP_TABLE = 9, | ||
309 | WLAN_EID_REQUEST = 10, | ||
310 | /* 802.11h */ | ||
311 | WLAN_EID_PWR_CONSTRAINT = 32, | ||
312 | WLAN_EID_PWR_CAPABILITY = 33, | ||
313 | WLAN_EID_TPC_REQUEST = 34, | ||
314 | WLAN_EID_TPC_REPORT = 35, | ||
315 | WLAN_EID_SUPPORTED_CHANNELS = 36, | ||
316 | WLAN_EID_CHANNEL_SWITCH = 37, | ||
317 | WLAN_EID_MEASURE_REQUEST = 38, | ||
318 | WLAN_EID_MEASURE_REPORT = 39, | ||
319 | WLAN_EID_QUIET = 40, | ||
320 | WLAN_EID_IBSS_DFS = 41, | ||
321 | /* 802.11g */ | ||
322 | WLAN_EID_ERP_INFO = 42, | ||
323 | WLAN_EID_EXT_SUPP_RATES = 50, | ||
324 | /* 802.11i */ | ||
325 | WLAN_EID_RSN = 48, | ||
326 | WLAN_EID_WPA = 221, | ||
327 | WLAN_EID_GENERIC = 221, | ||
328 | WLAN_EID_VENDOR_SPECIFIC = 221, | ||
329 | WLAN_EID_QOS_PARAMETER = 222 | ||
330 | }; | ||
331 | |||
332 | /* cipher suite selectors */ | ||
333 | #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 | ||
334 | #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 | ||
335 | #define WLAN_CIPHER_SUITE_TKIP 0x000FAC02 | ||
336 | /* reserved: 0x000FAC03 */ | ||
337 | #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 | ||
338 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | ||
339 | |||
340 | #define WLAN_MAX_KEY_LEN 32 | ||
341 | |||
342 | #endif /* IEEE80211_H */ | ||
diff --git a/include/linux/init.h b/include/linux/init.h index e290a010e3f2..dbbdbd1bec77 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -52,9 +52,14 @@ | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | /* For assembly routines */ | 54 | /* For assembly routines */ |
55 | #ifdef CONFIG_HOTPLUG_CPU | ||
56 | #define __INIT .section ".text","ax" | ||
57 | #define __INITDATA .section ".data","aw" | ||
58 | #else | ||
55 | #define __INIT .section ".init.text","ax" | 59 | #define __INIT .section ".init.text","ax" |
56 | #define __FINIT .previous | ||
57 | #define __INITDATA .section ".init.data","aw" | 60 | #define __INITDATA .section ".init.data","aw" |
61 | #endif | ||
62 | #define __FINIT .previous | ||
58 | 63 | ||
59 | #ifndef __ASSEMBLY__ | 64 | #ifndef __ASSEMBLY__ |
60 | /* | 65 | /* |
@@ -228,7 +233,7 @@ void __init parse_early_param(void); | |||
228 | #define __obsolete_setup(str) /* nothing */ | 233 | #define __obsolete_setup(str) /* nothing */ |
229 | #endif | 234 | #endif |
230 | 235 | ||
231 | /* Data marked not to be saved by software_suspend() */ | 236 | /* Data marked not to be saved by software suspend */ |
232 | #define __nosavedata __attribute__ ((__section__ (".data.nosave"))) | 237 | #define __nosavedata __attribute__ ((__section__ (".data.nosave"))) |
233 | 238 | ||
234 | /* This means "can be init if no module support, otherwise module load | 239 | /* This means "can be init if no module support, otherwise module load |
diff --git a/include/linux/input.h b/include/linux/input.h index 1789ee9df4dd..be2bf3a2b031 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -677,6 +677,7 @@ struct input_absinfo { | |||
677 | #define BUS_I2C 0x18 | 677 | #define BUS_I2C 0x18 |
678 | #define BUS_HOST 0x19 | 678 | #define BUS_HOST 0x19 |
679 | #define BUS_GSC 0x1A | 679 | #define BUS_GSC 0x1A |
680 | #define BUS_ATARI 0x1B | ||
680 | 681 | ||
681 | /* | 682 | /* |
682 | * Values describing the status of a force-feedback effect | 683 | * Values describing the status of a force-feedback effect |
@@ -989,6 +990,10 @@ struct input_dev { | |||
989 | #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match" | 990 | #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match" |
990 | #endif | 991 | #endif |
991 | 992 | ||
993 | #if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING | ||
994 | #error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match" | ||
995 | #endif | ||
996 | |||
992 | #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX | 997 | #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX |
993 | #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match" | 998 | #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match" |
994 | #endif | 999 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 838cf5a5bd7f..0319f665dd3f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -185,10 +185,14 @@ static inline int disable_irq_wake(unsigned int irq) | |||
185 | * validator need to define the methods below in their asm/irq.h | 185 | * validator need to define the methods below in their asm/irq.h |
186 | * files, under an #ifdef CONFIG_LOCKDEP section. | 186 | * files, under an #ifdef CONFIG_LOCKDEP section. |
187 | */ | 187 | */ |
188 | # ifndef CONFIG_LOCKDEP | 188 | #ifndef CONFIG_LOCKDEP |
189 | # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq) | 189 | # define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq) |
190 | # define disable_irq_nosync_lockdep_irqsave(irq, flags) \ | ||
191 | disable_irq_nosync(irq) | ||
190 | # define disable_irq_lockdep(irq) disable_irq(irq) | 192 | # define disable_irq_lockdep(irq) disable_irq(irq) |
191 | # define enable_irq_lockdep(irq) enable_irq(irq) | 193 | # define enable_irq_lockdep(irq) enable_irq(irq) |
194 | # define enable_irq_lockdep_irqrestore(irq, flags) \ | ||
195 | enable_irq(irq) | ||
192 | # endif | 196 | # endif |
193 | 197 | ||
194 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 198 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e2f41b051b12..144b615f3a89 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -35,7 +35,8 @@ extern const char linux_proc_banner[]; | |||
35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) |
36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) |
37 | 37 | ||
38 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 38 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) |
39 | |||
39 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 40 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
40 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 41 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
41 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 42 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index eb0e63ef297f..c288e41ba331 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -124,7 +124,6 @@ struct kset_uevent_ops { | |||
124 | }; | 124 | }; |
125 | 125 | ||
126 | struct kset { | 126 | struct kset { |
127 | struct subsystem * subsys; | ||
128 | struct kobj_type * ktype; | 127 | struct kobj_type * ktype; |
129 | struct list_head list; | 128 | struct list_head list; |
130 | spinlock_t list_lock; | 129 | spinlock_t list_lock; |
@@ -171,32 +170,23 @@ extern struct kobject * kset_find_obj(struct kset *, const char *); | |||
171 | #define set_kset_name(str) .kset = { .kobj = { .name = str } } | 170 | #define set_kset_name(str) .kset = { .kobj = { .name = str } } |
172 | 171 | ||
173 | 172 | ||
174 | |||
175 | struct subsystem { | ||
176 | struct kset kset; | ||
177 | }; | ||
178 | |||
179 | #define decl_subsys(_name,_type,_uevent_ops) \ | 173 | #define decl_subsys(_name,_type,_uevent_ops) \ |
180 | struct subsystem _name##_subsys = { \ | 174 | struct kset _name##_subsys = { \ |
181 | .kset = { \ | 175 | .kobj = { .name = __stringify(_name) }, \ |
182 | .kobj = { .name = __stringify(_name) }, \ | 176 | .ktype = _type, \ |
183 | .ktype = _type, \ | 177 | .uevent_ops =_uevent_ops, \ |
184 | .uevent_ops =_uevent_ops, \ | ||
185 | } \ | ||
186 | } | 178 | } |
187 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ | 179 | #define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ |
188 | struct subsystem _varname##_subsys = { \ | 180 | struct kset _varname##_subsys = { \ |
189 | .kset = { \ | 181 | .kobj = { .name = __stringify(_name) }, \ |
190 | .kobj = { .name = __stringify(_name) }, \ | 182 | .ktype = _type, \ |
191 | .ktype = _type, \ | 183 | .uevent_ops =_uevent_ops, \ |
192 | .uevent_ops =_uevent_ops, \ | ||
193 | } \ | ||
194 | } | 184 | } |
195 | 185 | ||
196 | /* The global /sys/kernel/ subsystem for people to chain off of */ | 186 | /* The global /sys/kernel/ subsystem for people to chain off of */ |
197 | extern struct subsystem kernel_subsys; | 187 | extern struct kset kernel_subsys; |
198 | /* The global /sys/hypervisor/ subsystem */ | 188 | /* The global /sys/hypervisor/ subsystem */ |
199 | extern struct subsystem hypervisor_subsys; | 189 | extern struct kset hypervisor_subsys; |
200 | 190 | ||
201 | /** | 191 | /** |
202 | * Helpers for setting the kset of registered objects. | 192 | * Helpers for setting the kset of registered objects. |
@@ -214,7 +204,7 @@ extern struct subsystem hypervisor_subsys; | |||
214 | */ | 204 | */ |
215 | 205 | ||
216 | #define kobj_set_kset_s(obj,subsys) \ | 206 | #define kobj_set_kset_s(obj,subsys) \ |
217 | (obj)->kobj.kset = &(subsys).kset | 207 | (obj)->kobj.kset = &(subsys) |
218 | 208 | ||
219 | /** | 209 | /** |
220 | * kset_set_kset_s(obj,subsys) - set kset for embedded kset. | 210 | * kset_set_kset_s(obj,subsys) - set kset for embedded kset. |
@@ -228,7 +218,7 @@ extern struct subsystem hypervisor_subsys; | |||
228 | */ | 218 | */ |
229 | 219 | ||
230 | #define kset_set_kset_s(obj,subsys) \ | 220 | #define kset_set_kset_s(obj,subsys) \ |
231 | (obj)->kset.kobj.kset = &(subsys).kset | 221 | (obj)->kset.kobj.kset = &(subsys) |
232 | 222 | ||
233 | /** | 223 | /** |
234 | * subsys_set_kset(obj,subsys) - set kset for subsystem | 224 | * subsys_set_kset(obj,subsys) - set kset for subsystem |
@@ -241,29 +231,31 @@ extern struct subsystem hypervisor_subsys; | |||
241 | */ | 231 | */ |
242 | 232 | ||
243 | #define subsys_set_kset(obj,_subsys) \ | 233 | #define subsys_set_kset(obj,_subsys) \ |
244 | (obj)->subsys.kset.kobj.kset = &(_subsys).kset | 234 | (obj)->subsys.kobj.kset = &(_subsys) |
245 | 235 | ||
246 | extern void subsystem_init(struct subsystem *); | 236 | extern void subsystem_init(struct kset *); |
247 | extern int __must_check subsystem_register(struct subsystem *); | 237 | extern int __must_check subsystem_register(struct kset *); |
248 | extern void subsystem_unregister(struct subsystem *); | 238 | extern void subsystem_unregister(struct kset *); |
249 | 239 | ||
250 | static inline struct subsystem * subsys_get(struct subsystem * s) | 240 | static inline struct kset *subsys_get(struct kset *s) |
251 | { | 241 | { |
252 | return s ? container_of(kset_get(&s->kset),struct subsystem,kset) : NULL; | 242 | if (s) |
243 | return kset_get(s); | ||
244 | return NULL; | ||
253 | } | 245 | } |
254 | 246 | ||
255 | static inline void subsys_put(struct subsystem * s) | 247 | static inline void subsys_put(struct kset *s) |
256 | { | 248 | { |
257 | kset_put(&s->kset); | 249 | kset_put(s); |
258 | } | 250 | } |
259 | 251 | ||
260 | struct subsys_attribute { | 252 | struct subsys_attribute { |
261 | struct attribute attr; | 253 | struct attribute attr; |
262 | ssize_t (*show)(struct subsystem *, char *); | 254 | ssize_t (*show)(struct kset *, char *); |
263 | ssize_t (*store)(struct subsystem *, const char *, size_t); | 255 | ssize_t (*store)(struct kset *, const char *, size_t); |
264 | }; | 256 | }; |
265 | 257 | ||
266 | extern int __must_check subsys_create_file(struct subsystem * , | 258 | extern int __must_check subsys_create_file(struct kset *, |
267 | struct subsys_attribute *); | 259 | struct subsys_attribute *); |
268 | 260 | ||
269 | #if defined(CONFIG_HOTPLUG) | 261 | #if defined(CONFIG_HOTPLUG) |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 275354ffa1cb..e6edca81ab84 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/ioctl.h> | 12 | #include <linux/ioctl.h> |
13 | 13 | ||
14 | #define KVM_API_VERSION 4 | 14 | #define KVM_API_VERSION 12 |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Architectural interrupt line count, and the size of the bitmap needed | 17 | * Architectural interrupt line count, and the size of the bitmap needed |
@@ -33,37 +33,39 @@ struct kvm_memory_region { | |||
33 | /* for kvm_memory_region::flags */ | 33 | /* for kvm_memory_region::flags */ |
34 | #define KVM_MEM_LOG_DIRTY_PAGES 1UL | 34 | #define KVM_MEM_LOG_DIRTY_PAGES 1UL |
35 | 35 | ||
36 | 36 | struct kvm_memory_alias { | |
37 | #define KVM_EXIT_TYPE_FAIL_ENTRY 1 | 37 | __u32 slot; /* this has a different namespace than memory slots */ |
38 | #define KVM_EXIT_TYPE_VM_EXIT 2 | 38 | __u32 flags; |
39 | __u64 guest_phys_addr; | ||
40 | __u64 memory_size; | ||
41 | __u64 target_phys_addr; | ||
42 | }; | ||
39 | 43 | ||
40 | enum kvm_exit_reason { | 44 | enum kvm_exit_reason { |
41 | KVM_EXIT_UNKNOWN = 0, | 45 | KVM_EXIT_UNKNOWN = 0, |
42 | KVM_EXIT_EXCEPTION = 1, | 46 | KVM_EXIT_EXCEPTION = 1, |
43 | KVM_EXIT_IO = 2, | 47 | KVM_EXIT_IO = 2, |
44 | KVM_EXIT_CPUID = 3, | 48 | KVM_EXIT_HYPERCALL = 3, |
45 | KVM_EXIT_DEBUG = 4, | 49 | KVM_EXIT_DEBUG = 4, |
46 | KVM_EXIT_HLT = 5, | 50 | KVM_EXIT_HLT = 5, |
47 | KVM_EXIT_MMIO = 6, | 51 | KVM_EXIT_MMIO = 6, |
48 | KVM_EXIT_IRQ_WINDOW_OPEN = 7, | 52 | KVM_EXIT_IRQ_WINDOW_OPEN = 7, |
49 | KVM_EXIT_SHUTDOWN = 8, | 53 | KVM_EXIT_SHUTDOWN = 8, |
54 | KVM_EXIT_FAIL_ENTRY = 9, | ||
55 | KVM_EXIT_INTR = 10, | ||
50 | }; | 56 | }; |
51 | 57 | ||
52 | /* for KVM_RUN */ | 58 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
53 | struct kvm_run { | 59 | struct kvm_run { |
54 | /* in */ | 60 | /* in */ |
55 | __u32 emulated; /* skip current instruction */ | ||
56 | __u32 mmio_completed; /* mmio request completed */ | ||
57 | __u8 request_interrupt_window; | 61 | __u8 request_interrupt_window; |
58 | __u8 padding1[7]; | 62 | __u8 padding1[7]; |
59 | 63 | ||
60 | /* out */ | 64 | /* out */ |
61 | __u32 exit_type; | ||
62 | __u32 exit_reason; | 65 | __u32 exit_reason; |
63 | __u32 instruction_length; | ||
64 | __u8 ready_for_interrupt_injection; | 66 | __u8 ready_for_interrupt_injection; |
65 | __u8 if_flag; | 67 | __u8 if_flag; |
66 | __u16 padding2; | 68 | __u8 padding2[2]; |
67 | 69 | ||
68 | /* in (pre_kvm_run), out (post_kvm_run) */ | 70 | /* in (pre_kvm_run), out (post_kvm_run) */ |
69 | __u64 cr8; | 71 | __u64 cr8; |
@@ -72,29 +74,26 @@ struct kvm_run { | |||
72 | union { | 74 | union { |
73 | /* KVM_EXIT_UNKNOWN */ | 75 | /* KVM_EXIT_UNKNOWN */ |
74 | struct { | 76 | struct { |
75 | __u32 hardware_exit_reason; | 77 | __u64 hardware_exit_reason; |
76 | } hw; | 78 | } hw; |
79 | /* KVM_EXIT_FAIL_ENTRY */ | ||
80 | struct { | ||
81 | __u64 hardware_entry_failure_reason; | ||
82 | } fail_entry; | ||
77 | /* KVM_EXIT_EXCEPTION */ | 83 | /* KVM_EXIT_EXCEPTION */ |
78 | struct { | 84 | struct { |
79 | __u32 exception; | 85 | __u32 exception; |
80 | __u32 error_code; | 86 | __u32 error_code; |
81 | } ex; | 87 | } ex; |
82 | /* KVM_EXIT_IO */ | 88 | /* KVM_EXIT_IO */ |
83 | struct { | 89 | struct kvm_io { |
84 | #define KVM_EXIT_IO_IN 0 | 90 | #define KVM_EXIT_IO_IN 0 |
85 | #define KVM_EXIT_IO_OUT 1 | 91 | #define KVM_EXIT_IO_OUT 1 |
86 | __u8 direction; | 92 | __u8 direction; |
87 | __u8 size; /* bytes */ | 93 | __u8 size; /* bytes */ |
88 | __u8 string; | ||
89 | __u8 string_down; | ||
90 | __u8 rep; | ||
91 | __u8 pad; | ||
92 | __u16 port; | 94 | __u16 port; |
93 | __u64 count; | 95 | __u32 count; |
94 | union { | 96 | __u64 data_offset; /* relative to kvm_run start */ |
95 | __u64 address; | ||
96 | __u32 value; | ||
97 | }; | ||
98 | } io; | 97 | } io; |
99 | struct { | 98 | struct { |
100 | } debug; | 99 | } debug; |
@@ -105,6 +104,13 @@ struct kvm_run { | |||
105 | __u32 len; | 104 | __u32 len; |
106 | __u8 is_write; | 105 | __u8 is_write; |
107 | } mmio; | 106 | } mmio; |
107 | /* KVM_EXIT_HYPERCALL */ | ||
108 | struct { | ||
109 | __u64 args[6]; | ||
110 | __u64 ret; | ||
111 | __u32 longmode; | ||
112 | __u32 pad; | ||
113 | } hypercall; | ||
108 | }; | 114 | }; |
109 | }; | 115 | }; |
110 | 116 | ||
@@ -118,6 +124,21 @@ struct kvm_regs { | |||
118 | __u64 rip, rflags; | 124 | __u64 rip, rflags; |
119 | }; | 125 | }; |
120 | 126 | ||
127 | /* for KVM_GET_FPU and KVM_SET_FPU */ | ||
128 | struct kvm_fpu { | ||
129 | __u8 fpr[8][16]; | ||
130 | __u16 fcw; | ||
131 | __u16 fsw; | ||
132 | __u8 ftwx; /* in fxsave format */ | ||
133 | __u8 pad1; | ||
134 | __u16 last_opcode; | ||
135 | __u64 last_ip; | ||
136 | __u64 last_dp; | ||
137 | __u8 xmm[16][16]; | ||
138 | __u32 mxcsr; | ||
139 | __u32 pad2; | ||
140 | }; | ||
141 | |||
121 | struct kvm_segment { | 142 | struct kvm_segment { |
122 | __u64 base; | 143 | __u64 base; |
123 | __u32 limit; | 144 | __u32 limit; |
@@ -210,38 +231,74 @@ struct kvm_dirty_log { | |||
210 | }; | 231 | }; |
211 | }; | 232 | }; |
212 | 233 | ||
234 | struct kvm_cpuid_entry { | ||
235 | __u32 function; | ||
236 | __u32 eax; | ||
237 | __u32 ebx; | ||
238 | __u32 ecx; | ||
239 | __u32 edx; | ||
240 | __u32 padding; | ||
241 | }; | ||
242 | |||
243 | /* for KVM_SET_CPUID */ | ||
244 | struct kvm_cpuid { | ||
245 | __u32 nent; | ||
246 | __u32 padding; | ||
247 | struct kvm_cpuid_entry entries[0]; | ||
248 | }; | ||
249 | |||
250 | /* for KVM_SET_SIGNAL_MASK */ | ||
251 | struct kvm_signal_mask { | ||
252 | __u32 len; | ||
253 | __u8 sigset[0]; | ||
254 | }; | ||
255 | |||
213 | #define KVMIO 0xAE | 256 | #define KVMIO 0xAE |
214 | 257 | ||
215 | /* | 258 | /* |
216 | * ioctls for /dev/kvm fds: | 259 | * ioctls for /dev/kvm fds: |
217 | */ | 260 | */ |
218 | #define KVM_GET_API_VERSION _IO(KVMIO, 1) | 261 | #define KVM_GET_API_VERSION _IO(KVMIO, 0x00) |
219 | #define KVM_CREATE_VM _IO(KVMIO, 2) /* returns a VM fd */ | 262 | #define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */ |
220 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) | 263 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list) |
264 | /* | ||
265 | * Check if a kvm extension is available. Argument is extension number, | ||
266 | * return is 1 (yes) or 0 (no, sorry). | ||
267 | */ | ||
268 | #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) | ||
269 | /* | ||
270 | * Get size for mmap(vcpu_fd) | ||
271 | */ | ||
272 | #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ | ||
221 | 273 | ||
222 | /* | 274 | /* |
223 | * ioctls for VM fds | 275 | * ioctls for VM fds |
224 | */ | 276 | */ |
225 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) | 277 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) |
226 | /* | 278 | /* |
227 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns | 279 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns |
228 | * a vcpu fd. | 280 | * a vcpu fd. |
229 | */ | 281 | */ |
230 | #define KVM_CREATE_VCPU _IOW(KVMIO, 11, int) | 282 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
231 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) | 283 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
284 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) | ||
232 | 285 | ||
233 | /* | 286 | /* |
234 | * ioctls for vcpu fds | 287 | * ioctls for vcpu fds |
235 | */ | 288 | */ |
236 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) | 289 | #define KVM_RUN _IO(KVMIO, 0x80) |
237 | #define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs) | 290 | #define KVM_GET_REGS _IOR(KVMIO, 0x81, struct kvm_regs) |
238 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) | 291 | #define KVM_SET_REGS _IOW(KVMIO, 0x82, struct kvm_regs) |
239 | #define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs) | 292 | #define KVM_GET_SREGS _IOR(KVMIO, 0x83, struct kvm_sregs) |
240 | #define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) | 293 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) |
241 | #define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) | 294 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) |
242 | #define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) | 295 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) |
243 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) | 296 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) |
244 | #define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) | 297 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) |
245 | #define KVM_SET_MSRS _IOW(KVMIO, 14, struct kvm_msrs) | 298 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) |
299 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) | ||
300 | #define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask) | ||
301 | #define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu) | ||
302 | #define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) | ||
246 | 303 | ||
247 | #endif | 304 | #endif |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index ac25b5649c59..05707e2fccae 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -88,7 +88,7 @@ struct nlm_wait; | |||
88 | /* | 88 | /* |
89 | * Memory chunk for NLM client RPC request. | 89 | * Memory chunk for NLM client RPC request. |
90 | */ | 90 | */ |
91 | #define NLMCLNT_OHSIZE (sizeof(utsname()->nodename)+10) | 91 | #define NLMCLNT_OHSIZE ((__NEW_UTS_LEN) + 10u) |
92 | struct nlm_rqst { | 92 | struct nlm_rqst { |
93 | unsigned int a_flags; /* initial RPC task flags */ | 93 | unsigned int a_flags; /* initial RPC task flags */ |
94 | struct nlm_host * a_host; /* host handle */ | 94 | struct nlm_host * a_host; /* host handle */ |
@@ -119,6 +119,9 @@ struct nlm_file { | |||
119 | * couldn't be granted because of a conflicting lock). | 119 | * couldn't be granted because of a conflicting lock). |
120 | */ | 120 | */ |
121 | #define NLM_NEVER (~(unsigned long) 0) | 121 | #define NLM_NEVER (~(unsigned long) 0) |
122 | /* timeout on non-blocking call: */ | ||
123 | #define NLM_TIMEOUT (7 * HZ) | ||
124 | |||
122 | struct nlm_block { | 125 | struct nlm_block { |
123 | struct kref b_count; /* Reference count */ | 126 | struct kref b_count; /* Reference count */ |
124 | struct list_head b_list; /* linked list of all blocks */ | 127 | struct list_head b_list; /* linked list of all blocks */ |
@@ -130,6 +133,13 @@ struct nlm_block { | |||
130 | unsigned int b_id; /* block id */ | 133 | unsigned int b_id; /* block id */ |
131 | unsigned char b_granted; /* VFS granted lock */ | 134 | unsigned char b_granted; /* VFS granted lock */ |
132 | struct nlm_file * b_file; /* file in question */ | 135 | struct nlm_file * b_file; /* file in question */ |
136 | struct cache_req * b_cache_req; /* deferred request handling */ | ||
137 | struct file_lock * b_fl; /* set for GETLK */ | ||
138 | struct cache_deferred_req * b_deferred_req; | ||
139 | unsigned int b_flags; /* block flags */ | ||
140 | #define B_QUEUED 1 /* lock queued */ | ||
141 | #define B_GOT_CALLBACK 2 /* got lock or conflicting lock */ | ||
142 | #define B_TIMED_OUT 4 /* filesystem too slow to respond */ | ||
133 | }; | 143 | }; |
134 | 144 | ||
135 | /* | 145 | /* |
@@ -185,8 +195,8 @@ typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref) | |||
185 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | 195 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, |
186 | struct nlm_lock *, int, struct nlm_cookie *); | 196 | struct nlm_lock *, int, struct nlm_cookie *); |
187 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 197 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
188 | __be32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, | 198 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, |
189 | struct nlm_lock *); | 199 | struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *); |
190 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 200 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
191 | unsigned long nlmsvc_retry_blocked(void); | 201 | unsigned long nlmsvc_retry_blocked(void); |
192 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 202 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 75e55dcdeb18..e10a90a93b5d 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -2,18 +2,29 @@ | |||
2 | #define _LINUX_MIGRATE_H | 2 | #define _LINUX_MIGRATE_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <linux/mempolicy.h> | ||
6 | #include <linux/pagemap.h> | ||
5 | 7 | ||
6 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 8 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
7 | 9 | ||
10 | #ifdef CONFIG_MIGRATION | ||
8 | /* Check if a vma is migratable */ | 11 | /* Check if a vma is migratable */ |
9 | static inline int vma_migratable(struct vm_area_struct *vma) | 12 | static inline int vma_migratable(struct vm_area_struct *vma) |
10 | { | 13 | { |
11 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | 14 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) |
12 | return 0; | 15 | return 0; |
16 | /* | ||
17 | * Migration allocates pages in the highest zone. If we cannot | ||
18 | * do so then migration (at least from node to node) is not | ||
19 | * possible. | ||
20 | */ | ||
21 | if (vma->vm_file && | ||
22 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
23 | < policy_zone) | ||
24 | return 0; | ||
13 | return 1; | 25 | return 1; |
14 | } | 26 | } |
15 | 27 | ||
16 | #ifdef CONFIG_MIGRATION | ||
17 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 28 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
18 | extern int putback_lru_pages(struct list_head *l); | 29 | extern int putback_lru_pages(struct list_head *l); |
19 | extern int migrate_page(struct address_space *, | 30 | extern int migrate_page(struct address_space *, |
@@ -28,6 +39,8 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
28 | const nodemask_t *from, const nodemask_t *to, | 39 | const nodemask_t *from, const nodemask_t *to, |
29 | unsigned long flags); | 40 | unsigned long flags); |
30 | #else | 41 | #else |
42 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
43 | { return 0; } | ||
31 | 44 | ||
32 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 45 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
33 | { return -ENOSYS; } | 46 | { return -ENOSYS; } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 326da7d500c7..dff9ea32606a 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #define TUN_MINOR 200 | 30 | #define TUN_MINOR 200 |
31 | #define HPET_MINOR 228 | 31 | #define HPET_MINOR 228 |
32 | #define KVM_MINOR 232 | ||
32 | 33 | ||
33 | struct device; | 34 | struct device; |
34 | 35 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 60e0e4a592d2..4670ebd1f622 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -267,21 +267,31 @@ static inline int get_page_unless_zero(struct page *page) | |||
267 | return atomic_inc_not_zero(&page->_count); | 267 | return atomic_inc_not_zero(&page->_count); |
268 | } | 268 | } |
269 | 269 | ||
270 | static inline struct page *compound_head(struct page *page) | ||
271 | { | ||
272 | if (unlikely(PageTail(page))) | ||
273 | return page->first_page; | ||
274 | return page; | ||
275 | } | ||
276 | |||
270 | static inline int page_count(struct page *page) | 277 | static inline int page_count(struct page *page) |
271 | { | 278 | { |
272 | if (unlikely(PageCompound(page))) | 279 | return atomic_read(&compound_head(page)->_count); |
273 | page = (struct page *)page_private(page); | ||
274 | return atomic_read(&page->_count); | ||
275 | } | 280 | } |
276 | 281 | ||
277 | static inline void get_page(struct page *page) | 282 | static inline void get_page(struct page *page) |
278 | { | 283 | { |
279 | if (unlikely(PageCompound(page))) | 284 | page = compound_head(page); |
280 | page = (struct page *)page_private(page); | ||
281 | VM_BUG_ON(atomic_read(&page->_count) == 0); | 285 | VM_BUG_ON(atomic_read(&page->_count) == 0); |
282 | atomic_inc(&page->_count); | 286 | atomic_inc(&page->_count); |
283 | } | 287 | } |
284 | 288 | ||
289 | static inline struct page *virt_to_head_page(const void *x) | ||
290 | { | ||
291 | struct page *page = virt_to_page(x); | ||
292 | return compound_head(page); | ||
293 | } | ||
294 | |||
285 | /* | 295 | /* |
286 | * Setup the page count before being freed into the page allocator for | 296 | * Setup the page count before being freed into the page allocator for |
287 | * the first time (boot or memory hotplug) | 297 | * the first time (boot or memory hotplug) |
@@ -314,6 +324,18 @@ static inline compound_page_dtor *get_compound_page_dtor(struct page *page) | |||
314 | return (compound_page_dtor *)page[1].lru.next; | 324 | return (compound_page_dtor *)page[1].lru.next; |
315 | } | 325 | } |
316 | 326 | ||
327 | static inline int compound_order(struct page *page) | ||
328 | { | ||
329 | if (!PageHead(page)) | ||
330 | return 0; | ||
331 | return (unsigned long)page[1].lru.prev; | ||
332 | } | ||
333 | |||
334 | static inline void set_compound_order(struct page *page, unsigned long order) | ||
335 | { | ||
336 | page[1].lru.prev = (void *)order; | ||
337 | } | ||
338 | |||
317 | /* | 339 | /* |
318 | * Multiple processes may "see" the same page. E.g. for untouched | 340 | * Multiple processes may "see" the same page. E.g. for untouched |
319 | * mappings of /dev/null, all processes see the same page full of | 341 | * mappings of /dev/null, all processes see the same page full of |
@@ -850,8 +872,26 @@ static inline int vma_wants_writenotify(struct vm_area_struct *vma) | |||
850 | 872 | ||
851 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); | 873 | extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); |
852 | 874 | ||
875 | #ifdef __PAGETABLE_PUD_FOLDED | ||
876 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | ||
877 | unsigned long address) | ||
878 | { | ||
879 | return 0; | ||
880 | } | ||
881 | #else | ||
853 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | 882 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); |
883 | #endif | ||
884 | |||
885 | #ifdef __PAGETABLE_PMD_FOLDED | ||
886 | static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud, | ||
887 | unsigned long address) | ||
888 | { | ||
889 | return 0; | ||
890 | } | ||
891 | #else | ||
854 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | 892 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
893 | #endif | ||
894 | |||
855 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); | 895 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); |
856 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); | 896 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); |
857 | 897 | ||
@@ -1130,6 +1170,11 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1130 | #define FOLL_GET 0x04 /* do get_page on page */ | 1170 | #define FOLL_GET 0x04 /* do get_page on page */ |
1131 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ | 1171 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ |
1132 | 1172 | ||
1173 | typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr, | ||
1174 | void *data); | ||
1175 | extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, | ||
1176 | unsigned long size, pte_fn_t fn, void *data); | ||
1177 | |||
1133 | #ifdef CONFIG_PROC_FS | 1178 | #ifdef CONFIG_PROC_FS |
1134 | void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); | 1179 | void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); |
1135 | #else | 1180 | #else |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index c3852fd4a1cc..e30687bad075 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -19,10 +19,16 @@ struct page { | |||
19 | unsigned long flags; /* Atomic flags, some possibly | 19 | unsigned long flags; /* Atomic flags, some possibly |
20 | * updated asynchronously */ | 20 | * updated asynchronously */ |
21 | atomic_t _count; /* Usage count, see below. */ | 21 | atomic_t _count; /* Usage count, see below. */ |
22 | atomic_t _mapcount; /* Count of ptes mapped in mms, | 22 | union { |
23 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
23 | * to show when page is mapped | 24 | * to show when page is mapped |
24 | * & limit reverse map searches. | 25 | * & limit reverse map searches. |
25 | */ | 26 | */ |
27 | struct { /* SLUB uses */ | ||
28 | short unsigned int inuse; | ||
29 | short unsigned int offset; | ||
30 | }; | ||
31 | }; | ||
26 | union { | 32 | union { |
27 | struct { | 33 | struct { |
28 | unsigned long private; /* Mapping-private opaque data: | 34 | unsigned long private; /* Mapping-private opaque data: |
@@ -43,8 +49,15 @@ struct page { | |||
43 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 49 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS |
44 | spinlock_t ptl; | 50 | spinlock_t ptl; |
45 | #endif | 51 | #endif |
52 | struct { /* SLUB uses */ | ||
53 | struct page *first_page; /* Compound pages */ | ||
54 | struct kmem_cache *slab; /* Pointer to slab */ | ||
55 | }; | ||
56 | }; | ||
57 | union { | ||
58 | pgoff_t index; /* Our offset within mapping. */ | ||
59 | void *freelist; /* SLUB: pointer to free object */ | ||
46 | }; | 60 | }; |
47 | pgoff_t index; /* Our offset within mapping. */ | ||
48 | struct list_head lru; /* Pageout list, eg. active_list | 61 | struct list_head lru; /* Pageout list, eg. active_list |
49 | * protected by zone->lru_lock ! | 62 | * protected by zone->lru_lock ! |
50 | */ | 63 | */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index e45712acfac5..badf702fcff4 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef LINUX_MMC_CARD_H | 10 | #ifndef LINUX_MMC_CARD_H |
11 | #define LINUX_MMC_CARD_H | 11 | #define LINUX_MMC_CARD_H |
12 | 12 | ||
13 | #include <linux/mmc/mmc.h> | 13 | #include <linux/mmc/core.h> |
14 | 14 | ||
15 | struct mmc_cid { | 15 | struct mmc_cid { |
16 | unsigned int manfid; | 16 | unsigned int manfid; |
@@ -41,6 +41,7 @@ struct mmc_csd { | |||
41 | 41 | ||
42 | struct mmc_ext_csd { | 42 | struct mmc_ext_csd { |
43 | unsigned int hs_max_dtr; | 43 | unsigned int hs_max_dtr; |
44 | unsigned int sectors; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | struct sd_scr { | 47 | struct sd_scr { |
@@ -60,18 +61,17 @@ struct mmc_host; | |||
60 | * MMC device | 61 | * MMC device |
61 | */ | 62 | */ |
62 | struct mmc_card { | 63 | struct mmc_card { |
63 | struct list_head node; /* node in hosts devices list */ | ||
64 | struct mmc_host *host; /* the host this device belongs to */ | 64 | struct mmc_host *host; /* the host this device belongs to */ |
65 | struct device dev; /* the device */ | 65 | struct device dev; /* the device */ |
66 | unsigned int rca; /* relative card address of device */ | 66 | unsigned int rca; /* relative card address of device */ |
67 | unsigned int type; /* card type */ | ||
68 | #define MMC_TYPE_MMC 0 /* MMC card */ | ||
69 | #define MMC_TYPE_SD 1 /* SD card */ | ||
67 | unsigned int state; /* (our) card state */ | 70 | unsigned int state; /* (our) card state */ |
68 | #define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ | 71 | #define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ |
69 | #define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ | 72 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
70 | #define MMC_STATE_BAD (1<<2) /* unrecognised device */ | 73 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
71 | #define MMC_STATE_SDCARD (1<<3) /* is an SD card */ | 74 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
72 | #define MMC_STATE_READONLY (1<<4) /* card is read-only */ | ||
73 | #define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */ | ||
74 | #define MMC_STATE_BLOCKADDR (1<<6) /* card uses block-addressing */ | ||
75 | u32 raw_cid[4]; /* raw card CID */ | 75 | u32 raw_cid[4]; /* raw card CID */ |
76 | u32 raw_csd[4]; /* raw card CSD */ | 76 | u32 raw_csd[4]; /* raw card CSD */ |
77 | u32 raw_scr[2]; /* raw card SCR */ | 77 | u32 raw_scr[2]; /* raw card SCR */ |
@@ -82,18 +82,15 @@ struct mmc_card { | |||
82 | struct sd_switch_caps sw_caps; /* switch (CMD6) caps */ | 82 | struct sd_switch_caps sw_caps; /* switch (CMD6) caps */ |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) | ||
86 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) | ||
87 | |||
85 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) | 88 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) |
86 | #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) | ||
87 | #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) | ||
88 | #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) | ||
89 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) | 89 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) |
90 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 90 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
91 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 91 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
92 | 92 | ||
93 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 93 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
94 | #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) | ||
95 | #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) | ||
96 | #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) | ||
97 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 94 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
98 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 95 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
99 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 96 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
@@ -119,11 +116,4 @@ struct mmc_driver { | |||
119 | extern int mmc_register_driver(struct mmc_driver *); | 116 | extern int mmc_register_driver(struct mmc_driver *); |
120 | extern void mmc_unregister_driver(struct mmc_driver *); | 117 | extern void mmc_unregister_driver(struct mmc_driver *); |
121 | 118 | ||
122 | static inline int mmc_card_claim_host(struct mmc_card *card) | ||
123 | { | ||
124 | return __mmc_claim_host(card->host, card); | ||
125 | } | ||
126 | |||
127 | #define mmc_card_release_host(c) mmc_release_host((c)->host) | ||
128 | |||
129 | #endif | 119 | #endif |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h new file mode 100644 index 000000000000..04bbe12fae8d --- /dev/null +++ b/include/linux/mmc/core.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mmc/core.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef LINUX_MMC_CORE_H | ||
9 | #define LINUX_MMC_CORE_H | ||
10 | |||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/device.h> | ||
13 | |||
14 | struct request; | ||
15 | struct mmc_data; | ||
16 | struct mmc_request; | ||
17 | |||
18 | struct mmc_command { | ||
19 | u32 opcode; | ||
20 | u32 arg; | ||
21 | u32 resp[4]; | ||
22 | unsigned int flags; /* expected response type */ | ||
23 | #define MMC_RSP_PRESENT (1 << 0) | ||
24 | #define MMC_RSP_136 (1 << 1) /* 136 bit response */ | ||
25 | #define MMC_RSP_CRC (1 << 2) /* expect valid crc */ | ||
26 | #define MMC_RSP_BUSY (1 << 3) /* card may send busy */ | ||
27 | #define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ | ||
28 | #define MMC_CMD_MASK (3 << 5) /* command type */ | ||
29 | #define MMC_CMD_AC (0 << 5) | ||
30 | #define MMC_CMD_ADTC (1 << 5) | ||
31 | #define MMC_CMD_BC (2 << 5) | ||
32 | #define MMC_CMD_BCR (3 << 5) | ||
33 | |||
34 | /* | ||
35 | * These are the response types, and correspond to valid bit | ||
36 | * patterns of the above flags. One additional valid pattern | ||
37 | * is all zeros, which means we don't expect a response. | ||
38 | */ | ||
39 | #define MMC_RSP_NONE (0) | ||
40 | #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
41 | #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) | ||
42 | #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) | ||
43 | #define MMC_RSP_R3 (MMC_RSP_PRESENT) | ||
44 | #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
45 | #define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
46 | |||
47 | #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) | ||
48 | |||
49 | /* | ||
50 | * These are the command types. | ||
51 | */ | ||
52 | #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) | ||
53 | |||
54 | unsigned int retries; /* max number of retries */ | ||
55 | unsigned int error; /* command error */ | ||
56 | |||
57 | #define MMC_ERR_NONE 0 | ||
58 | #define MMC_ERR_TIMEOUT 1 | ||
59 | #define MMC_ERR_BADCRC 2 | ||
60 | #define MMC_ERR_FIFO 3 | ||
61 | #define MMC_ERR_FAILED 4 | ||
62 | #define MMC_ERR_INVALID 5 | ||
63 | |||
64 | struct mmc_data *data; /* data segment associated with cmd */ | ||
65 | struct mmc_request *mrq; /* associated request */ | ||
66 | }; | ||
67 | |||
68 | struct mmc_data { | ||
69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | ||
70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | ||
71 | unsigned int blksz; /* data block size */ | ||
72 | unsigned int blocks; /* number of blocks */ | ||
73 | unsigned int error; /* data error */ | ||
74 | unsigned int flags; | ||
75 | |||
76 | #define MMC_DATA_WRITE (1 << 8) | ||
77 | #define MMC_DATA_READ (1 << 9) | ||
78 | #define MMC_DATA_STREAM (1 << 10) | ||
79 | #define MMC_DATA_MULTI (1 << 11) | ||
80 | |||
81 | unsigned int bytes_xfered; | ||
82 | |||
83 | struct mmc_command *stop; /* stop command */ | ||
84 | struct mmc_request *mrq; /* associated request */ | ||
85 | |||
86 | unsigned int sg_len; /* size of scatter list */ | ||
87 | struct scatterlist *sg; /* I/O scatter list */ | ||
88 | }; | ||
89 | |||
90 | struct mmc_request { | ||
91 | struct mmc_command *cmd; | ||
92 | struct mmc_data *data; | ||
93 | struct mmc_command *stop; | ||
94 | |||
95 | void *done_data; /* completion data */ | ||
96 | void (*done)(struct mmc_request *);/* completion function */ | ||
97 | }; | ||
98 | |||
99 | struct mmc_host; | ||
100 | struct mmc_card; | ||
101 | |||
102 | extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | ||
103 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | ||
104 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | ||
105 | struct mmc_command *, int); | ||
106 | |||
107 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *, int); | ||
108 | |||
109 | extern void mmc_claim_host(struct mmc_host *host); | ||
110 | extern void mmc_release_host(struct mmc_host *host); | ||
111 | |||
112 | #endif | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bfcef8a1ad8b..b1350dfd3e91 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -10,36 +10,13 @@ | |||
10 | #ifndef LINUX_MMC_HOST_H | 10 | #ifndef LINUX_MMC_HOST_H |
11 | #define LINUX_MMC_HOST_H | 11 | #define LINUX_MMC_HOST_H |
12 | 12 | ||
13 | #include <linux/mmc/mmc.h> | 13 | #include <linux/mmc/core.h> |
14 | 14 | ||
15 | struct mmc_ios { | 15 | struct mmc_ios { |
16 | unsigned int clock; /* clock rate */ | 16 | unsigned int clock; /* clock rate */ |
17 | unsigned short vdd; | 17 | unsigned short vdd; |
18 | 18 | ||
19 | #define MMC_VDD_150 0 | 19 | /* vdd stores the bit number of the selected voltage range from below. */ |
20 | #define MMC_VDD_155 1 | ||
21 | #define MMC_VDD_160 2 | ||
22 | #define MMC_VDD_165 3 | ||
23 | #define MMC_VDD_170 4 | ||
24 | #define MMC_VDD_180 5 | ||
25 | #define MMC_VDD_190 6 | ||
26 | #define MMC_VDD_200 7 | ||
27 | #define MMC_VDD_210 8 | ||
28 | #define MMC_VDD_220 9 | ||
29 | #define MMC_VDD_230 10 | ||
30 | #define MMC_VDD_240 11 | ||
31 | #define MMC_VDD_250 12 | ||
32 | #define MMC_VDD_260 13 | ||
33 | #define MMC_VDD_270 14 | ||
34 | #define MMC_VDD_280 15 | ||
35 | #define MMC_VDD_290 16 | ||
36 | #define MMC_VDD_300 17 | ||
37 | #define MMC_VDD_310 18 | ||
38 | #define MMC_VDD_320 19 | ||
39 | #define MMC_VDD_330 20 | ||
40 | #define MMC_VDD_340 21 | ||
41 | #define MMC_VDD_350 22 | ||
42 | #define MMC_VDD_360 23 | ||
43 | 20 | ||
44 | unsigned char bus_mode; /* command output mode */ | 21 | unsigned char bus_mode; /* command output mode */ |
45 | 22 | ||
@@ -88,6 +65,24 @@ struct mmc_host { | |||
88 | unsigned int f_max; | 65 | unsigned int f_max; |
89 | u32 ocr_avail; | 66 | u32 ocr_avail; |
90 | 67 | ||
68 | #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */ | ||
69 | #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ | ||
70 | #define MMC_VDD_21_22 0x00000200 /* VDD voltage 2.1 ~ 2.2 */ | ||
71 | #define MMC_VDD_22_23 0x00000400 /* VDD voltage 2.2 ~ 2.3 */ | ||
72 | #define MMC_VDD_23_24 0x00000800 /* VDD voltage 2.3 ~ 2.4 */ | ||
73 | #define MMC_VDD_24_25 0x00001000 /* VDD voltage 2.4 ~ 2.5 */ | ||
74 | #define MMC_VDD_25_26 0x00002000 /* VDD voltage 2.5 ~ 2.6 */ | ||
75 | #define MMC_VDD_26_27 0x00004000 /* VDD voltage 2.6 ~ 2.7 */ | ||
76 | #define MMC_VDD_27_28 0x00008000 /* VDD voltage 2.7 ~ 2.8 */ | ||
77 | #define MMC_VDD_28_29 0x00010000 /* VDD voltage 2.8 ~ 2.9 */ | ||
78 | #define MMC_VDD_29_30 0x00020000 /* VDD voltage 2.9 ~ 3.0 */ | ||
79 | #define MMC_VDD_30_31 0x00040000 /* VDD voltage 3.0 ~ 3.1 */ | ||
80 | #define MMC_VDD_31_32 0x00080000 /* VDD voltage 3.1 ~ 3.2 */ | ||
81 | #define MMC_VDD_32_33 0x00100000 /* VDD voltage 3.2 ~ 3.3 */ | ||
82 | #define MMC_VDD_33_34 0x00200000 /* VDD voltage 3.3 ~ 3.4 */ | ||
83 | #define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ | ||
84 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | ||
85 | |||
91 | unsigned long caps; /* Host capabilities */ | 86 | unsigned long caps; /* Host capabilities */ |
92 | 87 | ||
93 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 88 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
@@ -106,6 +101,8 @@ struct mmc_host { | |||
106 | unsigned int max_blk_count; /* maximum number of blocks in one req */ | 101 | unsigned int max_blk_count; /* maximum number of blocks in one req */ |
107 | 102 | ||
108 | /* private data */ | 103 | /* private data */ |
104 | spinlock_t lock; /* lock for claim and bus ops */ | ||
105 | |||
109 | struct mmc_ios ios; /* current io bus settings */ | 106 | struct mmc_ios ios; /* current io bus settings */ |
110 | u32 ocr; /* the current OCR setting */ | 107 | u32 ocr; /* the current OCR setting */ |
111 | 108 | ||
@@ -113,15 +110,19 @@ struct mmc_host { | |||
113 | #define MMC_MODE_MMC 0 | 110 | #define MMC_MODE_MMC 0 |
114 | #define MMC_MODE_SD 1 | 111 | #define MMC_MODE_SD 1 |
115 | 112 | ||
116 | struct list_head cards; /* devices attached to this host */ | 113 | struct mmc_card *card; /* device attached to this host */ |
117 | 114 | ||
118 | wait_queue_head_t wq; | 115 | wait_queue_head_t wq; |
119 | spinlock_t lock; /* claimed lock */ | ||
120 | unsigned int claimed:1; /* host exclusively claimed */ | 116 | unsigned int claimed:1; /* host exclusively claimed */ |
121 | 117 | ||
122 | struct mmc_card *card_selected; /* the selected MMC card */ | ||
123 | |||
124 | struct delayed_work detect; | 118 | struct delayed_work detect; |
119 | #ifdef CONFIG_MMC_DEBUG | ||
120 | unsigned int removed:1; /* host is being removed */ | ||
121 | #endif | ||
122 | |||
123 | const struct mmc_bus_ops *bus_ops; /* current bus driver */ | ||
124 | unsigned int bus_refs; /* reference counter */ | ||
125 | unsigned int bus_dead:1; /* bus has been released */ | ||
125 | 126 | ||
126 | unsigned long private[0] ____cacheline_aligned; | 127 | unsigned long private[0] ____cacheline_aligned; |
127 | }; | 128 | }; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index cdc54be804f1..e3ed9b95040e 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -1,119 +1,257 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mmc/mmc.h | 2 | * Header for MultiMediaCard (MMC) |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * Copyright 2002 Hewlett-Packard Company |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * |
6 | * published by the Free Software Foundation. | 6 | * Use consistent with the GNU GPL is permitted, |
7 | * provided that this copyright notice is | ||
8 | * preserved in its entirety in all copies and derived works. | ||
9 | * | ||
10 | * HEWLETT-PACKARD COMPANY MAKES NO WARRANTIES, EXPRESSED OR IMPLIED, | ||
11 | * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS | ||
12 | * FITNESS FOR ANY PARTICULAR PURPOSE. | ||
13 | * | ||
14 | * Many thanks to Alessandro Rubini and Jonathan Corbet! | ||
15 | * | ||
16 | * Based strongly on code by: | ||
17 | * | ||
18 | * Author: Yong-iL Joh <tolkien@mizi.com> | ||
19 | * Date : $Date: 2002/06/18 12:37:30 $ | ||
20 | * | ||
21 | * Author: Andrew Christian | ||
22 | * 15 May 2002 | ||
7 | */ | 23 | */ |
8 | #ifndef MMC_H | 24 | |
9 | #define MMC_H | 25 | #ifndef MMC_MMC_H |
10 | 26 | #define MMC_MMC_H | |
11 | #include <linux/list.h> | 27 | |
12 | #include <linux/interrupt.h> | 28 | /* Standard MMC commands (4.1) type argument response */ |
13 | #include <linux/device.h> | 29 | /* class 1 */ |
14 | 30 | #define MMC_GO_IDLE_STATE 0 /* bc */ | |
15 | struct request; | 31 | #define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ |
16 | struct mmc_data; | 32 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
17 | struct mmc_request; | 33 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
18 | 34 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | |
19 | struct mmc_command { | 35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ |
20 | u32 opcode; | 36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
21 | u32 arg; | 37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ |
22 | u32 resp[4]; | 38 | #define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ |
23 | unsigned int flags; /* expected response type */ | 39 | #define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ |
24 | #define MMC_RSP_PRESENT (1 << 0) | 40 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ |
25 | #define MMC_RSP_136 (1 << 1) /* 136 bit response */ | 41 | #define MMC_STOP_TRANSMISSION 12 /* ac R1b */ |
26 | #define MMC_RSP_CRC (1 << 2) /* expect valid crc */ | 42 | #define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ |
27 | #define MMC_RSP_BUSY (1 << 3) /* card may send busy */ | 43 | #define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ |
28 | #define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ | 44 | |
29 | #define MMC_CMD_MASK (3 << 5) /* command type */ | 45 | /* class 2 */ |
30 | #define MMC_CMD_AC (0 << 5) | 46 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ |
31 | #define MMC_CMD_ADTC (1 << 5) | 47 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ |
32 | #define MMC_CMD_BC (2 << 5) | 48 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ |
33 | #define MMC_CMD_BCR (3 << 5) | 49 | |
50 | /* class 3 */ | ||
51 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | ||
52 | |||
53 | /* class 4 */ | ||
54 | #define MMC_SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */ | ||
55 | #define MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ | ||
56 | #define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ | ||
57 | #define MMC_PROGRAM_CID 26 /* adtc R1 */ | ||
58 | #define MMC_PROGRAM_CSD 27 /* adtc R1 */ | ||
59 | |||
60 | /* class 6 */ | ||
61 | #define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ | ||
62 | #define MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ | ||
63 | #define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ | ||
64 | |||
65 | /* class 5 */ | ||
66 | #define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ | ||
67 | #define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ | ||
68 | #define MMC_ERASE 38 /* ac R1b */ | ||
69 | |||
70 | /* class 9 */ | ||
71 | #define MMC_FAST_IO 39 /* ac <Complex> R4 */ | ||
72 | #define MMC_GO_IRQ_STATE 40 /* bcr R5 */ | ||
73 | |||
74 | /* class 7 */ | ||
75 | #define MMC_LOCK_UNLOCK 42 /* adtc R1b */ | ||
76 | |||
77 | /* class 8 */ | ||
78 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ | ||
79 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ | ||
34 | 80 | ||
35 | /* | 81 | /* |
36 | * These are the response types, and correspond to valid bit | 82 | * MMC_SWITCH argument format: |
37 | * patterns of the above flags. One additional valid pattern | 83 | * |
38 | * is all zeros, which means we don't expect a response. | 84 | * [31:26] Always 0 |
85 | * [25:24] Access Mode | ||
86 | * [23:16] Location of target Byte in EXT_CSD | ||
87 | * [15:08] Value Byte | ||
88 | * [07:03] Always 0 | ||
89 | * [02:00] Command Set | ||
39 | */ | 90 | */ |
40 | #define MMC_RSP_NONE (0) | ||
41 | #define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
42 | #define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) | ||
43 | #define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) | ||
44 | #define MMC_RSP_R3 (MMC_RSP_PRESENT) | ||
45 | #define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
46 | #define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) | ||
47 | |||
48 | #define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) | ||
49 | 91 | ||
50 | /* | 92 | /* |
51 | * These are the command types. | 93 | MMC status in R1 |
94 | Type | ||
95 | e : error bit | ||
96 | s : status bit | ||
97 | r : detected and set for the actual command response | ||
98 | x : detected and set during command execution. the host must poll | ||
99 | the card by sending status command in order to read these bits. | ||
100 | Clear condition | ||
101 | a : according to the card state | ||
102 | b : always related to the previous command. Reception of | ||
103 | a valid command will clear it (with a delay of one command) | ||
104 | c : clear by read | ||
52 | */ | 105 | */ |
53 | #define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK) | ||
54 | 106 | ||
55 | unsigned int retries; /* max number of retries */ | 107 | #define R1_OUT_OF_RANGE (1 << 31) /* er, c */ |
56 | unsigned int error; /* command error */ | 108 | #define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ |
109 | #define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ | ||
110 | #define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ | ||
111 | #define R1_ERASE_PARAM (1 << 27) /* ex, c */ | ||
112 | #define R1_WP_VIOLATION (1 << 26) /* erx, c */ | ||
113 | #define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ | ||
114 | #define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ | ||
115 | #define R1_COM_CRC_ERROR (1 << 23) /* er, b */ | ||
116 | #define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ | ||
117 | #define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ | ||
118 | #define R1_CC_ERROR (1 << 20) /* erx, c */ | ||
119 | #define R1_ERROR (1 << 19) /* erx, c */ | ||
120 | #define R1_UNDERRUN (1 << 18) /* ex, c */ | ||
121 | #define R1_OVERRUN (1 << 17) /* ex, c */ | ||
122 | #define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ | ||
123 | #define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ | ||
124 | #define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ | ||
125 | #define R1_ERASE_RESET (1 << 13) /* sr, c */ | ||
126 | #define R1_STATUS(x) (x & 0xFFFFE000) | ||
127 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | ||
128 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | ||
129 | #define R1_APP_CMD (1 << 5) /* sr, c */ | ||
57 | 130 | ||
58 | #define MMC_ERR_NONE 0 | 131 | /* These are unpacked versions of the actual responses */ |
59 | #define MMC_ERR_TIMEOUT 1 | ||
60 | #define MMC_ERR_BADCRC 2 | ||
61 | #define MMC_ERR_FIFO 3 | ||
62 | #define MMC_ERR_FAILED 4 | ||
63 | #define MMC_ERR_INVALID 5 | ||
64 | 132 | ||
65 | struct mmc_data *data; /* data segment associated with cmd */ | 133 | struct _mmc_csd { |
66 | struct mmc_request *mrq; /* associated request */ | 134 | u8 csd_structure; |
135 | u8 spec_vers; | ||
136 | u8 taac; | ||
137 | u8 nsac; | ||
138 | u8 tran_speed; | ||
139 | u16 ccc; | ||
140 | u8 read_bl_len; | ||
141 | u8 read_bl_partial; | ||
142 | u8 write_blk_misalign; | ||
143 | u8 read_blk_misalign; | ||
144 | u8 dsr_imp; | ||
145 | u16 c_size; | ||
146 | u8 vdd_r_curr_min; | ||
147 | u8 vdd_r_curr_max; | ||
148 | u8 vdd_w_curr_min; | ||
149 | u8 vdd_w_curr_max; | ||
150 | u8 c_size_mult; | ||
151 | union { | ||
152 | struct { /* MMC system specification version 3.1 */ | ||
153 | u8 erase_grp_size; | ||
154 | u8 erase_grp_mult; | ||
155 | } v31; | ||
156 | struct { /* MMC system specification version 2.2 */ | ||
157 | u8 sector_size; | ||
158 | u8 erase_grp_size; | ||
159 | } v22; | ||
160 | } erase; | ||
161 | u8 wp_grp_size; | ||
162 | u8 wp_grp_enable; | ||
163 | u8 default_ecc; | ||
164 | u8 r2w_factor; | ||
165 | u8 write_bl_len; | ||
166 | u8 write_bl_partial; | ||
167 | u8 file_format_grp; | ||
168 | u8 copy; | ||
169 | u8 perm_write_protect; | ||
170 | u8 tmp_write_protect; | ||
171 | u8 file_format; | ||
172 | u8 ecc; | ||
67 | }; | 173 | }; |
68 | 174 | ||
69 | struct mmc_data { | 175 | /* |
70 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 176 | * OCR bits are mostly in host.h |
71 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 177 | */ |
72 | unsigned int blksz; /* data block size */ | 178 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ |
73 | unsigned int blocks; /* number of blocks */ | ||
74 | unsigned int error; /* data error */ | ||
75 | unsigned int flags; | ||
76 | 179 | ||
77 | #define MMC_DATA_WRITE (1 << 8) | 180 | /* |
78 | #define MMC_DATA_READ (1 << 9) | 181 | * Card Command Classes (CCC) |
79 | #define MMC_DATA_STREAM (1 << 10) | 182 | */ |
80 | #define MMC_DATA_MULTI (1 << 11) | 183 | #define CCC_BASIC (1<<0) /* (0) Basic protocol functions */ |
184 | /* (CMD0,1,2,3,4,7,9,10,12,13,15) */ | ||
185 | #define CCC_STREAM_READ (1<<1) /* (1) Stream read commands */ | ||
186 | /* (CMD11) */ | ||
187 | #define CCC_BLOCK_READ (1<<2) /* (2) Block read commands */ | ||
188 | /* (CMD16,17,18) */ | ||
189 | #define CCC_STREAM_WRITE (1<<3) /* (3) Stream write commands */ | ||
190 | /* (CMD20) */ | ||
191 | #define CCC_BLOCK_WRITE (1<<4) /* (4) Block write commands */ | ||
192 | /* (CMD16,24,25,26,27) */ | ||
193 | #define CCC_ERASE (1<<5) /* (5) Ability to erase blocks */ | ||
194 | /* (CMD32,33,34,35,36,37,38,39) */ | ||
195 | #define CCC_WRITE_PROT (1<<6) /* (6) Able to write protect blocks */ | ||
196 | /* (CMD28,29,30) */ | ||
197 | #define CCC_LOCK_CARD (1<<7) /* (7) Able to lock down card */ | ||
198 | /* (CMD16,CMD42) */ | ||
199 | #define CCC_APP_SPEC (1<<8) /* (8) Application specific */ | ||
200 | /* (CMD55,56,57,ACMD*) */ | ||
201 | #define CCC_IO_MODE (1<<9) /* (9) I/O mode */ | ||
202 | /* (CMD5,39,40,52,53) */ | ||
203 | #define CCC_SWITCH (1<<10) /* (10) High speed switch */ | ||
204 | /* (CMD6,34,35,36,37,50) */ | ||
205 | /* (11) Reserved */ | ||
206 | /* (CMD?) */ | ||
81 | 207 | ||
82 | unsigned int bytes_xfered; | 208 | /* |
209 | * CSD field definitions | ||
210 | */ | ||
83 | 211 | ||
84 | struct mmc_command *stop; /* stop command */ | 212 | #define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ |
85 | struct mmc_request *mrq; /* associated request */ | 213 | #define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ |
214 | #define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */ | ||
215 | #define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */ | ||
86 | 216 | ||
87 | unsigned int sg_len; /* size of scatter list */ | 217 | #define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ |
88 | struct scatterlist *sg; /* I/O scatter list */ | 218 | #define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ |
89 | }; | 219 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ |
220 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */ | ||
221 | #define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */ | ||
90 | 222 | ||
91 | struct mmc_request { | 223 | /* |
92 | struct mmc_command *cmd; | 224 | * EXT_CSD fields |
93 | struct mmc_data *data; | 225 | */ |
94 | struct mmc_command *stop; | ||
95 | 226 | ||
96 | void *done_data; /* completion data */ | 227 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
97 | void (*done)(struct mmc_request *);/* completion function */ | 228 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
98 | }; | 229 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
230 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | ||
231 | |||
232 | /* | ||
233 | * EXT_CSD field definitions | ||
234 | */ | ||
99 | 235 | ||
100 | struct mmc_host; | 236 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
101 | struct mmc_card; | 237 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
238 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) | ||
102 | 239 | ||
103 | extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 240 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ |
104 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 241 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ |
105 | extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int, | ||
106 | struct mmc_command *, int); | ||
107 | 242 | ||
108 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *, int); | 243 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ |
244 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | ||
245 | #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ | ||
109 | 246 | ||
110 | extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); | 247 | /* |
248 | * MMC_SWITCH access modes | ||
249 | */ | ||
111 | 250 | ||
112 | static inline void mmc_claim_host(struct mmc_host *host) | 251 | #define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ |
113 | { | 252 | #define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */ |
114 | __mmc_claim_host(host, (struct mmc_card *)-1); | 253 | #define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ |
115 | } | 254 | #define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ |
116 | 255 | ||
117 | extern void mmc_release_host(struct mmc_host *host); | 256 | #endif /* MMC_MMC_PROTOCOL_H */ |
118 | 257 | ||
119 | #endif | ||
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h deleted file mode 100644 index c90b6768329d..000000000000 --- a/include/linux/mmc/protocol.h +++ /dev/null | |||
@@ -1,327 +0,0 @@ | |||
1 | /* | ||
2 | * Header for MultiMediaCard (MMC) | ||
3 | * | ||
4 | * Copyright 2002 Hewlett-Packard Company | ||
5 | * | ||
6 | * Use consistent with the GNU GPL is permitted, | ||
7 | * provided that this copyright notice is | ||
8 | * preserved in its entirety in all copies and derived works. | ||
9 | * | ||
10 | * HEWLETT-PACKARD COMPANY MAKES NO WARRANTIES, EXPRESSED OR IMPLIED, | ||
11 | * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS | ||
12 | * FITNESS FOR ANY PARTICULAR PURPOSE. | ||
13 | * | ||
14 | * Many thanks to Alessandro Rubini and Jonathan Corbet! | ||
15 | * | ||
16 | * Based strongly on code by: | ||
17 | * | ||
18 | * Author: Yong-iL Joh <tolkien@mizi.com> | ||
19 | * Date : $Date: 2002/06/18 12:37:30 $ | ||
20 | * | ||
21 | * Author: Andrew Christian | ||
22 | * 15 May 2002 | ||
23 | */ | ||
24 | |||
25 | #ifndef MMC_MMC_PROTOCOL_H | ||
26 | #define MMC_MMC_PROTOCOL_H | ||
27 | |||
28 | /* Standard MMC commands (4.1) type argument response */ | ||
29 | /* class 1 */ | ||
30 | #define MMC_GO_IDLE_STATE 0 /* bc */ | ||
31 | #define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ | ||
32 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ | ||
33 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ | ||
34 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | ||
35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ | ||
36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ | ||
37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ | ||
38 | #define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ | ||
39 | #define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ | ||
40 | #define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ | ||
41 | #define MMC_STOP_TRANSMISSION 12 /* ac R1b */ | ||
42 | #define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */ | ||
43 | #define MMC_GO_INACTIVE_STATE 15 /* ac [31:16] RCA */ | ||
44 | |||
45 | /* class 2 */ | ||
46 | #define MMC_SET_BLOCKLEN 16 /* ac [31:0] block len R1 */ | ||
47 | #define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ | ||
48 | #define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ | ||
49 | |||
50 | /* class 3 */ | ||
51 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | ||
52 | |||
53 | /* class 4 */ | ||
54 | #define MMC_SET_BLOCK_COUNT 23 /* adtc [31:0] data addr R1 */ | ||
55 | #define MMC_WRITE_BLOCK 24 /* adtc [31:0] data addr R1 */ | ||
56 | #define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ | ||
57 | #define MMC_PROGRAM_CID 26 /* adtc R1 */ | ||
58 | #define MMC_PROGRAM_CSD 27 /* adtc R1 */ | ||
59 | |||
60 | /* class 6 */ | ||
61 | #define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ | ||
62 | #define MMC_CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */ | ||
63 | #define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ | ||
64 | |||
65 | /* class 5 */ | ||
66 | #define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ | ||
67 | #define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ | ||
68 | #define MMC_ERASE 38 /* ac R1b */ | ||
69 | |||
70 | /* class 9 */ | ||
71 | #define MMC_FAST_IO 39 /* ac <Complex> R4 */ | ||
72 | #define MMC_GO_IRQ_STATE 40 /* bcr R5 */ | ||
73 | |||
74 | /* class 7 */ | ||
75 | #define MMC_LOCK_UNLOCK 42 /* adtc R1b */ | ||
76 | |||
77 | /* class 8 */ | ||
78 | #define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ | ||
79 | #define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */ | ||
80 | |||
81 | /* SD commands type argument response */ | ||
82 | /* class 0 */ | ||
83 | /* This is basically the same command as for MMC with some quirks. */ | ||
84 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ | ||
85 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ | ||
86 | |||
87 | /* class 10 */ | ||
88 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ | ||
89 | |||
90 | /* Application commands */ | ||
91 | #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ | ||
92 | #define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */ | ||
93 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ | ||
94 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ | ||
95 | |||
96 | /* | ||
97 | * MMC_SWITCH argument format: | ||
98 | * | ||
99 | * [31:26] Always 0 | ||
100 | * [25:24] Access Mode | ||
101 | * [23:16] Location of target Byte in EXT_CSD | ||
102 | * [15:08] Value Byte | ||
103 | * [07:03] Always 0 | ||
104 | * [02:00] Command Set | ||
105 | */ | ||
106 | |||
107 | /* | ||
108 | * SD_SWITCH argument format: | ||
109 | * | ||
110 | * [31] Check (0) or switch (1) | ||
111 | * [30:24] Reserved (0) | ||
112 | * [23:20] Function group 6 | ||
113 | * [19:16] Function group 5 | ||
114 | * [15:12] Function group 4 | ||
115 | * [11:8] Function group 3 | ||
116 | * [7:4] Function group 2 | ||
117 | * [3:0] Function group 1 | ||
118 | */ | ||
119 | |||
120 | /* | ||
121 | * SD_SEND_IF_COND argument format: | ||
122 | * | ||
123 | * [31:12] Reserved (0) | ||
124 | * [11:8] Host Voltage Supply Flags | ||
125 | * [7:0] Check Pattern (0xAA) | ||
126 | */ | ||
127 | |||
128 | /* | ||
129 | MMC status in R1 | ||
130 | Type | ||
131 | e : error bit | ||
132 | s : status bit | ||
133 | r : detected and set for the actual command response | ||
134 | x : detected and set during command execution. the host must poll | ||
135 | the card by sending status command in order to read these bits. | ||
136 | Clear condition | ||
137 | a : according to the card state | ||
138 | b : always related to the previous command. Reception of | ||
139 | a valid command will clear it (with a delay of one command) | ||
140 | c : clear by read | ||
141 | */ | ||
142 | |||
143 | #define R1_OUT_OF_RANGE (1 << 31) /* er, c */ | ||
144 | #define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ | ||
145 | #define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ | ||
146 | #define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ | ||
147 | #define R1_ERASE_PARAM (1 << 27) /* ex, c */ | ||
148 | #define R1_WP_VIOLATION (1 << 26) /* erx, c */ | ||
149 | #define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ | ||
150 | #define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ | ||
151 | #define R1_COM_CRC_ERROR (1 << 23) /* er, b */ | ||
152 | #define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ | ||
153 | #define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ | ||
154 | #define R1_CC_ERROR (1 << 20) /* erx, c */ | ||
155 | #define R1_ERROR (1 << 19) /* erx, c */ | ||
156 | #define R1_UNDERRUN (1 << 18) /* ex, c */ | ||
157 | #define R1_OVERRUN (1 << 17) /* ex, c */ | ||
158 | #define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ | ||
159 | #define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ | ||
160 | #define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ | ||
161 | #define R1_ERASE_RESET (1 << 13) /* sr, c */ | ||
162 | #define R1_STATUS(x) (x & 0xFFFFE000) | ||
163 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | ||
164 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | ||
165 | #define R1_APP_CMD (1 << 5) /* sr, c */ | ||
166 | |||
167 | /* These are unpacked versions of the actual responses */ | ||
168 | |||
169 | struct _mmc_csd { | ||
170 | u8 csd_structure; | ||
171 | u8 spec_vers; | ||
172 | u8 taac; | ||
173 | u8 nsac; | ||
174 | u8 tran_speed; | ||
175 | u16 ccc; | ||
176 | u8 read_bl_len; | ||
177 | u8 read_bl_partial; | ||
178 | u8 write_blk_misalign; | ||
179 | u8 read_blk_misalign; | ||
180 | u8 dsr_imp; | ||
181 | u16 c_size; | ||
182 | u8 vdd_r_curr_min; | ||
183 | u8 vdd_r_curr_max; | ||
184 | u8 vdd_w_curr_min; | ||
185 | u8 vdd_w_curr_max; | ||
186 | u8 c_size_mult; | ||
187 | union { | ||
188 | struct { /* MMC system specification version 3.1 */ | ||
189 | u8 erase_grp_size; | ||
190 | u8 erase_grp_mult; | ||
191 | } v31; | ||
192 | struct { /* MMC system specification version 2.2 */ | ||
193 | u8 sector_size; | ||
194 | u8 erase_grp_size; | ||
195 | } v22; | ||
196 | } erase; | ||
197 | u8 wp_grp_size; | ||
198 | u8 wp_grp_enable; | ||
199 | u8 default_ecc; | ||
200 | u8 r2w_factor; | ||
201 | u8 write_bl_len; | ||
202 | u8 write_bl_partial; | ||
203 | u8 file_format_grp; | ||
204 | u8 copy; | ||
205 | u8 perm_write_protect; | ||
206 | u8 tmp_write_protect; | ||
207 | u8 file_format; | ||
208 | u8 ecc; | ||
209 | }; | ||
210 | |||
211 | #define MMC_VDD_145_150 0x00000001 /* VDD voltage 1.45 - 1.50 */ | ||
212 | #define MMC_VDD_150_155 0x00000002 /* VDD voltage 1.50 - 1.55 */ | ||
213 | #define MMC_VDD_155_160 0x00000004 /* VDD voltage 1.55 - 1.60 */ | ||
214 | #define MMC_VDD_160_165 0x00000008 /* VDD voltage 1.60 - 1.65 */ | ||
215 | #define MMC_VDD_165_170 0x00000010 /* VDD voltage 1.65 - 1.70 */ | ||
216 | #define MMC_VDD_17_18 0x00000020 /* VDD voltage 1.7 - 1.8 */ | ||
217 | #define MMC_VDD_18_19 0x00000040 /* VDD voltage 1.8 - 1.9 */ | ||
218 | #define MMC_VDD_19_20 0x00000080 /* VDD voltage 1.9 - 2.0 */ | ||
219 | #define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */ | ||
220 | #define MMC_VDD_21_22 0x00000200 /* VDD voltage 2.1 ~ 2.2 */ | ||
221 | #define MMC_VDD_22_23 0x00000400 /* VDD voltage 2.2 ~ 2.3 */ | ||
222 | #define MMC_VDD_23_24 0x00000800 /* VDD voltage 2.3 ~ 2.4 */ | ||
223 | #define MMC_VDD_24_25 0x00001000 /* VDD voltage 2.4 ~ 2.5 */ | ||
224 | #define MMC_VDD_25_26 0x00002000 /* VDD voltage 2.5 ~ 2.6 */ | ||
225 | #define MMC_VDD_26_27 0x00004000 /* VDD voltage 2.6 ~ 2.7 */ | ||
226 | #define MMC_VDD_27_28 0x00008000 /* VDD voltage 2.7 ~ 2.8 */ | ||
227 | #define MMC_VDD_28_29 0x00010000 /* VDD voltage 2.8 ~ 2.9 */ | ||
228 | #define MMC_VDD_29_30 0x00020000 /* VDD voltage 2.9 ~ 3.0 */ | ||
229 | #define MMC_VDD_30_31 0x00040000 /* VDD voltage 3.0 ~ 3.1 */ | ||
230 | #define MMC_VDD_31_32 0x00080000 /* VDD voltage 3.1 ~ 3.2 */ | ||
231 | #define MMC_VDD_32_33 0x00100000 /* VDD voltage 3.2 ~ 3.3 */ | ||
232 | #define MMC_VDD_33_34 0x00200000 /* VDD voltage 3.3 ~ 3.4 */ | ||
233 | #define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ | ||
234 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | ||
235 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ | ||
236 | |||
237 | /* | ||
238 | * Card Command Classes (CCC) | ||
239 | */ | ||
240 | #define CCC_BASIC (1<<0) /* (0) Basic protocol functions */ | ||
241 | /* (CMD0,1,2,3,4,7,9,10,12,13,15) */ | ||
242 | #define CCC_STREAM_READ (1<<1) /* (1) Stream read commands */ | ||
243 | /* (CMD11) */ | ||
244 | #define CCC_BLOCK_READ (1<<2) /* (2) Block read commands */ | ||
245 | /* (CMD16,17,18) */ | ||
246 | #define CCC_STREAM_WRITE (1<<3) /* (3) Stream write commands */ | ||
247 | /* (CMD20) */ | ||
248 | #define CCC_BLOCK_WRITE (1<<4) /* (4) Block write commands */ | ||
249 | /* (CMD16,24,25,26,27) */ | ||
250 | #define CCC_ERASE (1<<5) /* (5) Ability to erase blocks */ | ||
251 | /* (CMD32,33,34,35,36,37,38,39) */ | ||
252 | #define CCC_WRITE_PROT (1<<6) /* (6) Able to write protect blocks */ | ||
253 | /* (CMD28,29,30) */ | ||
254 | #define CCC_LOCK_CARD (1<<7) /* (7) Able to lock down card */ | ||
255 | /* (CMD16,CMD42) */ | ||
256 | #define CCC_APP_SPEC (1<<8) /* (8) Application specific */ | ||
257 | /* (CMD55,56,57,ACMD*) */ | ||
258 | #define CCC_IO_MODE (1<<9) /* (9) I/O mode */ | ||
259 | /* (CMD5,39,40,52,53) */ | ||
260 | #define CCC_SWITCH (1<<10) /* (10) High speed switch */ | ||
261 | /* (CMD6,34,35,36,37,50) */ | ||
262 | /* (11) Reserved */ | ||
263 | /* (CMD?) */ | ||
264 | |||
265 | /* | ||
266 | * CSD field definitions | ||
267 | */ | ||
268 | |||
269 | #define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ | ||
270 | #define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ | ||
271 | #define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */ | ||
272 | #define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */ | ||
273 | |||
274 | #define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ | ||
275 | #define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ | ||
276 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ | ||
277 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */ | ||
278 | #define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */ | ||
279 | |||
280 | /* | ||
281 | * EXT_CSD fields | ||
282 | */ | ||
283 | |||
284 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | ||
285 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | ||
286 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | ||
287 | |||
288 | /* | ||
289 | * EXT_CSD field definitions | ||
290 | */ | ||
291 | |||
292 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | ||
293 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | ||
294 | #define EXT_CSD_CMD_SET_CPSECURE (1<<2) | ||
295 | |||
296 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | ||
297 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | ||
298 | |||
299 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | ||
300 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | ||
301 | #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ | ||
302 | |||
303 | /* | ||
304 | * MMC_SWITCH access modes | ||
305 | */ | ||
306 | |||
307 | #define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */ | ||
308 | #define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */ | ||
309 | #define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ | ||
310 | #define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ | ||
311 | |||
312 | /* | ||
313 | * SCR field definitions | ||
314 | */ | ||
315 | |||
316 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ | ||
317 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ | ||
318 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ | ||
319 | |||
320 | /* | ||
321 | * SD bus widths | ||
322 | */ | ||
323 | #define SD_BUS_WIDTH_1 0 | ||
324 | #define SD_BUS_WIDTH_4 2 | ||
325 | |||
326 | #endif /* MMC_MMC_PROTOCOL_H */ | ||
327 | |||
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h new file mode 100644 index 000000000000..f310062cffb4 --- /dev/null +++ b/include/linux/mmc/sd.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * include/linux/mmc/sd.h | ||
3 | * | ||
4 | * Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or (at | ||
9 | * your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef MMC_SD_H | ||
13 | #define MMC_SD_H | ||
14 | |||
15 | /* SD commands type argument response */ | ||
16 | /* class 0 */ | ||
17 | /* This is basically the same command as for MMC with some quirks. */ | ||
18 | #define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ | ||
19 | #define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */ | ||
20 | |||
21 | /* class 10 */ | ||
22 | #define SD_SWITCH 6 /* adtc [31:0] See below R1 */ | ||
23 | |||
24 | /* Application commands */ | ||
25 | #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ | ||
26 | #define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */ | ||
27 | #define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */ | ||
28 | #define SD_APP_SEND_SCR 51 /* adtc R1 */ | ||
29 | |||
30 | /* | ||
31 | * SD_SWITCH argument format: | ||
32 | * | ||
33 | * [31] Check (0) or switch (1) | ||
34 | * [30:24] Reserved (0) | ||
35 | * [23:20] Function group 6 | ||
36 | * [19:16] Function group 5 | ||
37 | * [15:12] Function group 4 | ||
38 | * [11:8] Function group 3 | ||
39 | * [7:4] Function group 2 | ||
40 | * [3:0] Function group 1 | ||
41 | */ | ||
42 | |||
43 | /* | ||
44 | * SD_SEND_IF_COND argument format: | ||
45 | * | ||
46 | * [31:12] Reserved (0) | ||
47 | * [11:8] Host Voltage Supply Flags | ||
48 | * [7:0] Check Pattern (0xAA) | ||
49 | */ | ||
50 | |||
51 | /* | ||
52 | * SCR field definitions | ||
53 | */ | ||
54 | |||
55 | #define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ | ||
56 | #define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ | ||
57 | #define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ | ||
58 | |||
59 | /* | ||
60 | * SD bus widths | ||
61 | */ | ||
62 | #define SD_BUS_WIDTH_1 0 | ||
63 | #define SD_BUS_WIDTH_4 2 | ||
64 | |||
65 | /* | ||
66 | * SD_SWITCH mode | ||
67 | */ | ||
68 | #define SD_SWITCH_CHECK 0 | ||
69 | #define SD_SWITCH_SET 1 | ||
70 | |||
71 | /* | ||
72 | * SD_SWITCH function groups | ||
73 | */ | ||
74 | #define SD_SWITCH_GRP_ACCESS 0 | ||
75 | |||
76 | /* | ||
77 | * SD_SWITCH access modes | ||
78 | */ | ||
79 | #define SD_SWITCH_ACCESS_DEF 0 | ||
80 | #define SD_SWITCH_ACCESS_HS 1 | ||
81 | |||
82 | #endif | ||
83 | |||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ee9e3143df4f..2f1544e83042 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -784,6 +784,18 @@ void sparse_init(void); | |||
784 | void memory_present(int nid, unsigned long start, unsigned long end); | 784 | void memory_present(int nid, unsigned long start, unsigned long end); |
785 | unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); | 785 | unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); |
786 | 786 | ||
787 | /* | ||
788 | * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we | ||
789 | * need to check pfn validility within that MAX_ORDER_NR_PAGES block. | ||
790 | * pfn_valid_within() should be used in this case; we optimise this away | ||
791 | * when we have no holes within a MAX_ORDER_NR_PAGES block. | ||
792 | */ | ||
793 | #ifdef CONFIG_HOLES_IN_ZONE | ||
794 | #define pfn_valid_within(pfn) pfn_valid(pfn) | ||
795 | #else | ||
796 | #define pfn_valid_within(pfn) (1) | ||
797 | #endif | ||
798 | |||
787 | #endif /* !__ASSEMBLY__ */ | 799 | #endif /* !__ASSEMBLY__ */ |
788 | #endif /* __KERNEL__ */ | 800 | #endif /* __KERNEL__ */ |
789 | #endif /* _LINUX_MMZONE_H */ | 801 | #endif /* _LINUX_MMZONE_H */ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e96b2dee10bb..af04a555b52c 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -262,6 +262,7 @@ struct i2c_device_id { | |||
262 | 262 | ||
263 | /* Input */ | 263 | /* Input */ |
264 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | 264 | #define INPUT_DEVICE_ID_EV_MAX 0x1f |
265 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 | ||
265 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff | 266 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff |
266 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | 267 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
267 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | 268 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f |
diff --git a/include/linux/module.h b/include/linux/module.h index 95679eb8571e..f0b0faf42d5d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -568,7 +568,7 @@ struct device_driver; | |||
568 | #ifdef CONFIG_SYSFS | 568 | #ifdef CONFIG_SYSFS |
569 | struct module; | 569 | struct module; |
570 | 570 | ||
571 | extern struct subsystem module_subsys; | 571 | extern struct kset module_subsys; |
572 | 572 | ||
573 | int mod_sysfs_init(struct module *mod); | 573 | int mod_sysfs_init(struct module *mod); |
574 | int mod_sysfs_setup(struct module *mod, | 574 | int mod_sysfs_setup(struct module *mod, |
diff --git a/include/linux/msi.h b/include/linux/msi.h index e38fe6822cb4..94bb46d82efd 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef LINUX_MSI_H | 1 | #ifndef LINUX_MSI_H |
2 | #define LINUX_MSI_H | 2 | #define LINUX_MSI_H |
3 | 3 | ||
4 | #include <linux/list.h> | ||
5 | |||
4 | struct msi_msg { | 6 | struct msi_msg { |
5 | u32 address_lo; /* low 32 bits of msi message address */ | 7 | u32 address_lo; /* low 32 bits of msi message address */ |
6 | u32 address_hi; /* high 32 bits of msi message address */ | 8 | u32 address_hi; /* high 32 bits of msi message address */ |
@@ -24,10 +26,8 @@ struct msi_desc { | |||
24 | unsigned default_irq; /* default pre-assigned irq */ | 26 | unsigned default_irq; /* default pre-assigned irq */ |
25 | }msi_attrib; | 27 | }msi_attrib; |
26 | 28 | ||
27 | struct { | 29 | unsigned int irq; |
28 | __u16 head; | 30 | struct list_head list; |
29 | __u16 tail; | ||
30 | }link; | ||
31 | 31 | ||
32 | void __iomem *mask_base; | 32 | void __iomem *mask_base; |
33 | struct pci_dev *dev; | 33 | struct pci_dev *dev; |
@@ -41,6 +41,9 @@ struct msi_desc { | |||
41 | */ | 41 | */ |
42 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); | 42 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); |
43 | void arch_teardown_msi_irq(unsigned int irq); | 43 | void arch_teardown_msi_irq(unsigned int irq); |
44 | extern int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | ||
45 | extern void arch_teardown_msi_irqs(struct pci_dev *dev); | ||
46 | extern int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | ||
44 | 47 | ||
45 | 48 | ||
46 | #endif /* LINUX_MSI_H */ | 49 | #endif /* LINUX_MSI_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ac0c92b1e002..30446222b396 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -304,7 +304,7 @@ struct net_device | |||
304 | 304 | ||
305 | unsigned long state; | 305 | unsigned long state; |
306 | 306 | ||
307 | struct net_device *next; | 307 | struct list_head dev_list; |
308 | 308 | ||
309 | /* The device initialization function. Called only once. */ | 309 | /* The device initialization function. Called only once. */ |
310 | int (*init)(struct net_device *dev); | 310 | int (*init)(struct net_device *dev); |
@@ -575,13 +575,36 @@ struct packet_type { | |||
575 | #include <linux/notifier.h> | 575 | #include <linux/notifier.h> |
576 | 576 | ||
577 | extern struct net_device loopback_dev; /* The loopback */ | 577 | extern struct net_device loopback_dev; /* The loopback */ |
578 | extern struct net_device *dev_base; /* All devices */ | 578 | extern struct list_head dev_base_head; /* All devices */ |
579 | extern rwlock_t dev_base_lock; /* Device list lock */ | 579 | extern rwlock_t dev_base_lock; /* Device list lock */ |
580 | 580 | ||
581 | #define for_each_netdev(d) \ | ||
582 | list_for_each_entry(d, &dev_base_head, dev_list) | ||
583 | #define for_each_netdev_safe(d, n) \ | ||
584 | list_for_each_entry_safe(d, n, &dev_base_head, dev_list) | ||
585 | #define for_each_netdev_continue(d) \ | ||
586 | list_for_each_entry_continue(d, &dev_base_head, dev_list) | ||
587 | #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) | ||
588 | |||
589 | static inline struct net_device *next_net_device(struct net_device *dev) | ||
590 | { | ||
591 | struct list_head *lh; | ||
592 | |||
593 | lh = dev->dev_list.next; | ||
594 | return lh == &dev_base_head ? NULL : net_device_entry(lh); | ||
595 | } | ||
596 | |||
597 | static inline struct net_device *first_net_device(void) | ||
598 | { | ||
599 | return list_empty(&dev_base_head) ? NULL : | ||
600 | net_device_entry(dev_base_head.next); | ||
601 | } | ||
602 | |||
581 | extern int netdev_boot_setup_check(struct net_device *dev); | 603 | extern int netdev_boot_setup_check(struct net_device *dev); |
582 | extern unsigned long netdev_boot_base(const char *prefix, int unit); | 604 | extern unsigned long netdev_boot_base(const char *prefix, int unit); |
583 | extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); | 605 | extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); |
584 | extern struct net_device *dev_getfirstbyhwtype(unsigned short type); | 606 | extern struct net_device *dev_getfirstbyhwtype(unsigned short type); |
607 | extern struct net_device *__dev_getfirstbyhwtype(unsigned short type); | ||
585 | extern void dev_add_pack(struct packet_type *pt); | 608 | extern void dev_add_pack(struct packet_type *pt); |
586 | extern void dev_remove_pack(struct packet_type *pt); | 609 | extern void dev_remove_pack(struct packet_type *pt); |
587 | extern void __dev_remove_pack(struct packet_type *pt); | 610 | extern void __dev_remove_pack(struct packet_type *pt); |
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index 4e6bbce04ff8..535e4219d2bb 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h | |||
@@ -87,24 +87,6 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | |||
87 | /* delete keymap entries */ | 87 | /* delete keymap entries */ |
88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); | 88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); |
89 | 89 | ||
90 | /* get pointer to gre key, if present */ | ||
91 | static inline __be32 *gre_key(struct gre_hdr *greh) | ||
92 | { | ||
93 | if (!greh->key) | ||
94 | return NULL; | ||
95 | if (greh->csum || greh->routing) | ||
96 | return (__be32 *)(greh+sizeof(*greh)+4); | ||
97 | return (__be32 *)(greh+sizeof(*greh)); | ||
98 | } | ||
99 | |||
100 | /* get pointer ot gre csum, if present */ | ||
101 | static inline __sum16 *gre_csum(struct gre_hdr *greh) | ||
102 | { | ||
103 | if (!greh->csum) | ||
104 | return NULL; | ||
105 | return (__sum16 *)(greh+sizeof(*greh)); | ||
106 | } | ||
107 | |||
108 | extern void nf_ct_gre_keymap_flush(void); | 90 | extern void nf_ct_gre_keymap_flush(void); |
109 | extern void nf_nat_need_gre(void); | 91 | extern void nf_nat_need_gre(void); |
110 | 92 | ||
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 19060030bac9..533ee351a273 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -55,18 +55,25 @@ static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) | |||
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) | ||
59 | { | ||
60 | switch (skb->protocol) { | ||
61 | case __constant_htons(ETH_P_8021Q): | ||
62 | return VLAN_HLEN; | ||
63 | case __constant_htons(ETH_P_PPP_SES): | ||
64 | return PPPOE_SES_HLEN; | ||
65 | default: | ||
66 | return 0; | ||
67 | } | ||
68 | } | ||
69 | |||
58 | /* This is called by the IP fragmenting code and it ensures there is | 70 | /* This is called by the IP fragmenting code and it ensures there is |
59 | * enough room for the encapsulating header (if there is one). */ | 71 | * enough room for the encapsulating header (if there is one). */ |
60 | static inline int nf_bridge_pad(const struct sk_buff *skb) | 72 | static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) |
61 | { | 73 | { |
62 | int padding = 0; | 74 | if (skb->nf_bridge) |
63 | 75 | return nf_bridge_encap_header_len(skb); | |
64 | if (skb->nf_bridge && skb->protocol == htons(ETH_P_8021Q)) | 76 | return 0; |
65 | padding = VLAN_HLEN; | ||
66 | else if (skb->nf_bridge && skb->protocol == htons(ETH_P_PPP_SES)) | ||
67 | padding = PPPOE_SES_HLEN; | ||
68 | |||
69 | return padding; | ||
70 | } | 77 | } |
71 | 78 | ||
72 | struct bridge_skb_cb { | 79 | struct bridge_skb_cb { |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index f41688f56632..2e23353c28a5 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -31,7 +31,7 @@ struct sockaddr_nl | |||
31 | { | 31 | { |
32 | sa_family_t nl_family; /* AF_NETLINK */ | 32 | sa_family_t nl_family; /* AF_NETLINK */ |
33 | unsigned short nl_pad; /* zero */ | 33 | unsigned short nl_pad; /* zero */ |
34 | __u32 nl_pid; /* process pid */ | 34 | __u32 nl_pid; /* port ID */ |
35 | __u32 nl_groups; /* multicast groups mask */ | 35 | __u32 nl_groups; /* multicast groups mask */ |
36 | }; | 36 | }; |
37 | 37 | ||
@@ -41,7 +41,7 @@ struct nlmsghdr | |||
41 | __u16 nlmsg_type; /* Message content */ | 41 | __u16 nlmsg_type; /* Message content */ |
42 | __u16 nlmsg_flags; /* Additional flags */ | 42 | __u16 nlmsg_flags; /* Additional flags */ |
43 | __u32 nlmsg_seq; /* Sequence number */ | 43 | __u32 nlmsg_seq; /* Sequence number */ |
44 | __u32 nlmsg_pid; /* Sending process PID */ | 44 | __u32 nlmsg_pid; /* Sending process port ID */ |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* Flags values */ | 47 | /* Flags values */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index e9ae0c6e2c62..0543439a97af 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -455,7 +455,7 @@ nfs_have_writebacks(struct inode *inode) | |||
455 | /* | 455 | /* |
456 | * Allocate nfs_write_data structures | 456 | * Allocate nfs_write_data structures |
457 | */ | 457 | */ |
458 | extern struct nfs_write_data *nfs_writedata_alloc(size_t len); | 458 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages); |
459 | 459 | ||
460 | /* | 460 | /* |
461 | * linux/fs/nfs/read.c | 461 | * linux/fs/nfs/read.c |
@@ -469,7 +469,7 @@ extern void nfs_readdata_release(void *data); | |||
469 | /* | 469 | /* |
470 | * Allocate nfs_read_data structures | 470 | * Allocate nfs_read_data structures |
471 | */ | 471 | */ |
472 | extern struct nfs_read_data *nfs_readdata_alloc(size_t len); | 472 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages); |
473 | 473 | ||
474 | /* | 474 | /* |
475 | * linux/fs/nfs3proc.c | 475 | * linux/fs/nfs3proc.c |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 659c75438454..cc8b9c59acb8 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -61,6 +61,7 @@ struct nfs_mount_data { | |||
61 | #define NFS_MOUNT_NOACL 0x0800 /* 4 */ | 61 | #define NFS_MOUNT_NOACL 0x0800 /* 4 */ |
62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ | 62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ |
63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ | 63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ |
64 | #define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ | ||
64 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 65 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
65 | 66 | ||
66 | #endif | 67 | #endif |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 16b0266b14fd..41afab6b5f09 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -21,8 +21,7 @@ | |||
21 | /* | 21 | /* |
22 | * Valid flags for the radix tree | 22 | * Valid flags for the radix tree |
23 | */ | 23 | */ |
24 | #define NFS_PAGE_TAG_DIRTY 0 | 24 | #define NFS_PAGE_TAG_WRITEBACK 0 |
25 | #define NFS_PAGE_TAG_WRITEBACK 1 | ||
26 | 25 | ||
27 | /* | 26 | /* |
28 | * Valid flags for a dirty buffer | 27 | * Valid flags for a dirty buffer |
@@ -39,7 +38,7 @@ struct nfs_page { | |||
39 | struct page *wb_page; /* page to read in/write out */ | 38 | struct page *wb_page; /* page to read in/write out */ |
40 | struct nfs_open_context *wb_context; /* File state context info */ | 39 | struct nfs_open_context *wb_context; /* File state context info */ |
41 | atomic_t wb_complete; /* i/os we're waiting for */ | 40 | atomic_t wb_complete; /* i/os we're waiting for */ |
42 | unsigned long wb_index; /* Offset >> PAGE_CACHE_SHIFT */ | 41 | pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */ |
43 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ | 42 | unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ |
44 | wb_pgbase, /* Start of page data */ | 43 | wb_pgbase, /* Start of page data */ |
45 | wb_bytes; /* Length of request */ | 44 | wb_bytes; /* Length of request */ |
@@ -48,6 +47,19 @@ struct nfs_page { | |||
48 | struct nfs_writeverf wb_verf; /* Commit cookie */ | 47 | struct nfs_writeverf wb_verf; /* Commit cookie */ |
49 | }; | 48 | }; |
50 | 49 | ||
50 | struct nfs_pageio_descriptor { | ||
51 | struct list_head pg_list; | ||
52 | unsigned long pg_bytes_written; | ||
53 | size_t pg_count; | ||
54 | size_t pg_bsize; | ||
55 | unsigned int pg_base; | ||
56 | |||
57 | struct inode *pg_inode; | ||
58 | int (*pg_doio)(struct inode *, struct list_head *, unsigned int, size_t, int); | ||
59 | int pg_ioflags; | ||
60 | int pg_error; | ||
61 | }; | ||
62 | |||
51 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 63 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
52 | 64 | ||
53 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, | 65 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, |
@@ -59,13 +71,16 @@ extern void nfs_clear_request(struct nfs_page *req); | |||
59 | extern void nfs_release_request(struct nfs_page *req); | 71 | extern void nfs_release_request(struct nfs_page *req); |
60 | 72 | ||
61 | 73 | ||
62 | extern long nfs_scan_dirty(struct address_space *mapping, | ||
63 | struct writeback_control *wbc, | ||
64 | struct list_head *dst); | ||
65 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, | 74 | extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, |
66 | unsigned long idx_start, unsigned int npages); | 75 | pgoff_t idx_start, unsigned int npages); |
67 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, | 76 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, |
68 | unsigned int); | 77 | struct inode *inode, |
78 | int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), | ||
79 | size_t bsize, | ||
80 | int how); | ||
81 | extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, | ||
82 | struct nfs_page *); | ||
83 | extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc); | ||
69 | extern int nfs_wait_on_request(struct nfs_page *); | 84 | extern int nfs_wait_on_request(struct nfs_page *); |
70 | extern void nfs_unlock_request(struct nfs_page *req); | 85 | extern void nfs_unlock_request(struct nfs_page *req); |
71 | extern int nfs_set_page_writeback_locked(struct nfs_page *req); | 86 | extern int nfs_set_page_writeback_locked(struct nfs_page *req); |
diff --git a/include/linux/nubus.h b/include/linux/nubus.h index 870e66a96286..cdb3e9b8db54 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h | |||
@@ -28,18 +28,18 @@ enum nubus_category { | |||
28 | }; | 28 | }; |
29 | 29 | ||
30 | enum nubus_type_network { | 30 | enum nubus_type_network { |
31 | NUBUS_TYPE_ETHERNET = 0x0001, | 31 | NUBUS_TYPE_ETHERNET = 0x0001, |
32 | NUBUS_TYPE_RS232 = 0x0002 | 32 | NUBUS_TYPE_RS232 = 0x0002 |
33 | }; | 33 | }; |
34 | 34 | ||
35 | enum nubus_type_display { | 35 | enum nubus_type_display { |
36 | NUBUS_TYPE_VIDEO = 0x0001 | 36 | NUBUS_TYPE_VIDEO = 0x0001 |
37 | }; | 37 | }; |
38 | 38 | ||
39 | enum nubus_type_cpu { | 39 | enum nubus_type_cpu { |
40 | NUBUS_TYPE_68020 = 0x0003, | 40 | NUBUS_TYPE_68020 = 0x0003, |
41 | NUBUS_TYPE_68030 = 0x0004, | 41 | NUBUS_TYPE_68030 = 0x0004, |
42 | NUBUS_TYPE_68040 = 0x0005 | 42 | NUBUS_TYPE_68040 = 0x0005 |
43 | }; | 43 | }; |
44 | 44 | ||
45 | /* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots) | 45 | /* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots) |
@@ -56,6 +56,7 @@ enum nubus_type_cpu { | |||
56 | * | 56 | * |
57 | * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272> | 57 | * SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272> |
58 | * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271> | 58 | * SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271> |
59 | * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281> | ||
59 | * Sonic Systems Ethernet A-Series Card: <4,1,268,256> | 60 | * Sonic Systems Ethernet A-Series Card: <4,1,268,256> |
60 | * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision) | 61 | * Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision) |
61 | * ROM on the above card: <2,1,0,0> | 62 | * ROM on the above card: <2,1,0,0> |
@@ -80,24 +81,26 @@ enum nubus_type_cpu { | |||
80 | /* Add known DrSW values here */ | 81 | /* Add known DrSW values here */ |
81 | enum nubus_drsw { | 82 | enum nubus_drsw { |
82 | /* NUBUS_CAT_DISPLAY */ | 83 | /* NUBUS_CAT_DISPLAY */ |
83 | NUBUS_DRSW_APPLE = 0x0001, | 84 | NUBUS_DRSW_APPLE = 0x0001, |
84 | NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */ | 85 | NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */ |
85 | 86 | ||
86 | /* NUBUS_CAT_NETWORK */ | 87 | /* NUBUS_CAT_NETWORK */ |
87 | NUBUS_DRSW_CABLETRON = 0x0001, | 88 | NUBUS_DRSW_3COM = 0x0000, |
88 | NUBUS_DRSW_SONIC_LC = 0x0001, | 89 | NUBUS_DRSW_CABLETRON = 0x0001, |
89 | NUBUS_DRSW_KINETICS = 0x0103, | 90 | NUBUS_DRSW_SONIC_LC = 0x0001, |
90 | NUBUS_DRSW_ASANTE = 0x0104, | 91 | NUBUS_DRSW_KINETICS = 0x0103, |
91 | NUBUS_DRSW_DAYNA = 0x010b, | 92 | NUBUS_DRSW_ASANTE = 0x0104, |
92 | NUBUS_DRSW_FARALLON = 0x010c, | 93 | NUBUS_DRSW_TECHWORKS = 0x0109, |
93 | NUBUS_DRSW_APPLE_SN = 0x010f, | 94 | NUBUS_DRSW_DAYNA = 0x010b, |
94 | NUBUS_DRSW_DAYNA2 = 0x0115, | 95 | NUBUS_DRSW_FARALLON = 0x010c, |
96 | NUBUS_DRSW_APPLE_SN = 0x010f, | ||
97 | NUBUS_DRSW_DAYNA2 = 0x0115, | ||
95 | NUBUS_DRSW_FOCUS = 0x011a, | 98 | NUBUS_DRSW_FOCUS = 0x011a, |
96 | NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */ | 99 | NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */ |
97 | NUBUS_DRSW_DAYNA_LC = 0x011e, | 100 | NUBUS_DRSW_DAYNA_LC = 0x011e, |
98 | 101 | ||
99 | /* NUBUS_CAT_CPU */ | 102 | /* NUBUS_CAT_CPU */ |
100 | NUBUS_DRSW_NONE = 0x0000, | 103 | NUBUS_DRSW_NONE = 0x0000, |
101 | }; | 104 | }; |
102 | 105 | ||
103 | /* DrHW: Uniquely identifies the hardware interface to a board (or at | 106 | /* DrHW: Uniquely identifies the hardware interface to a board (or at |
@@ -107,27 +110,48 @@ enum nubus_drsw { | |||
107 | /* Add known DrHW values here */ | 110 | /* Add known DrHW values here */ |
108 | enum nubus_drhw { | 111 | enum nubus_drhw { |
109 | /* NUBUS_CAT_DISPLAY */ | 112 | /* NUBUS_CAT_DISPLAY */ |
110 | NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */ | 113 | NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */ |
111 | NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High Res Video card */ | 114 | NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */ |
112 | NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */ | 115 | NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */ |
113 | NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */ | 116 | NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */ |
114 | NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */ | 117 | NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */ |
115 | NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */ | 118 | NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */ |
119 | NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */ | ||
120 | NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */ | ||
121 | NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */ | ||
122 | NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */ | ||
116 | NUBUS_DRHW_APPLE_VALKYRIE = 0x002e, | 123 | NUBUS_DRHW_APPLE_VALKYRIE = 0x002e, |
117 | NUBUS_DRHW_THUNDER24 = 0x02cb, /* SuperMac Thunder/24 */ | 124 | NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */ |
125 | NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */ | ||
126 | NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */ | ||
127 | NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */ | ||
128 | NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */ | ||
129 | NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */ | ||
130 | NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */ | ||
131 | NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */ | ||
132 | NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ | ||
133 | NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ | ||
134 | NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ | ||
135 | NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */ | ||
136 | NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ | ||
137 | NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ | ||
138 | NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ | ||
139 | NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ | ||
140 | NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ | ||
141 | NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ | ||
118 | 142 | ||
119 | /* NUBUS_CAT_NETWORK */ | 143 | /* NUBUS_CAT_NETWORK */ |
120 | NUBUS_DRHW_INTERLAN = 0x0100, | 144 | NUBUS_DRHW_INTERLAN = 0x0100, |
121 | NUBUS_DRHW_SMC9194 = 0x0101, | 145 | NUBUS_DRHW_SMC9194 = 0x0101, |
122 | NUBUS_DRHW_KINETICS = 0x0106, | 146 | NUBUS_DRHW_KINETICS = 0x0106, |
123 | NUBUS_DRHW_CABLETRON = 0x0109, | 147 | NUBUS_DRHW_CABLETRON = 0x0109, |
124 | NUBUS_DRHW_ASANTE_LC = 0x010f, | 148 | NUBUS_DRHW_ASANTE_LC = 0x010f, |
125 | NUBUS_DRHW_SONIC = 0x0110, | 149 | NUBUS_DRHW_SONIC = 0x0110, |
126 | NUBUS_DRHW_SONIC_NB = 0x0118, | 150 | NUBUS_DRHW_TECHWORKS = 0x0112, |
127 | NUBUS_DRHW_SONIC_LC = 0x0119, | 151 | NUBUS_DRHW_APPLE_SONIC_NB = 0x0118, |
128 | 152 | NUBUS_DRHW_APPLE_SONIC_LC = 0x0119, | |
129 | /* NUBUS_CAT_COMMUNICATIONS */ | 153 | NUBUS_DRHW_FOCUS = 0x011c, |
130 | NUBUS_DRHW_DOVEFAX = 0x0100, | 154 | NUBUS_DRHW_SONNET = 0x011d, |
131 | }; | 155 | }; |
132 | 156 | ||
133 | /* Resource IDs: These are the identifiers for the various weird and | 157 | /* Resource IDs: These are the identifiers for the various weird and |
@@ -153,17 +177,17 @@ enum nubus_res_id { | |||
153 | 177 | ||
154 | /* Category-specific resources. */ | 178 | /* Category-specific resources. */ |
155 | enum nubus_board_res_id { | 179 | enum nubus_board_res_id { |
156 | NUBUS_RESID_BOARDID = 0x0020, | 180 | NUBUS_RESID_BOARDID = 0x0020, |
157 | NUBUS_RESID_PRAMINITDATA = 0x0021, | 181 | NUBUS_RESID_PRAMINITDATA = 0x0021, |
158 | NUBUS_RESID_PRIMARYINIT = 0x0022, | 182 | NUBUS_RESID_PRIMARYINIT = 0x0022, |
159 | NUBUS_RESID_TIMEOUTCONST = 0x0023, | 183 | NUBUS_RESID_TIMEOUTCONST = 0x0023, |
160 | NUBUS_RESID_VENDORINFO = 0x0024, | 184 | NUBUS_RESID_VENDORINFO = 0x0024, |
161 | NUBUS_RESID_BOARDFLAGS = 0x0025, | 185 | NUBUS_RESID_BOARDFLAGS = 0x0025, |
162 | NUBUS_RESID_SECONDINIT = 0x0026, | 186 | NUBUS_RESID_SECONDINIT = 0x0026, |
163 | 187 | ||
164 | /* Not sure why Apple put these next two in here */ | 188 | /* Not sure why Apple put these next two in here */ |
165 | NUBUS_RESID_VIDNAMES = 0x0041, | 189 | NUBUS_RESID_VIDNAMES = 0x0041, |
166 | NUBUS_RESID_VIDMODES = 0x007e | 190 | NUBUS_RESID_VIDMODES = 0x007e |
167 | }; | 191 | }; |
168 | 192 | ||
169 | /* Fields within the vendor info directory */ | 193 | /* Fields within the vendor info directory */ |
@@ -185,13 +209,13 @@ enum nubus_cpu_res_id { | |||
185 | }; | 209 | }; |
186 | 210 | ||
187 | enum nubus_display_res_id { | 211 | enum nubus_display_res_id { |
188 | NUBUS_RESID_GAMMADIR = 0x0040, | 212 | NUBUS_RESID_GAMMADIR = 0x0040, |
189 | NUBUS_RESID_FIRSTMODE = 0x0080, | 213 | NUBUS_RESID_FIRSTMODE = 0x0080, |
190 | NUBUS_RESID_SECONDMODE = 0x0081, | 214 | NUBUS_RESID_SECONDMODE = 0x0081, |
191 | NUBUS_RESID_THIRDMODE = 0x0082, | 215 | NUBUS_RESID_THIRDMODE = 0x0082, |
192 | NUBUS_RESID_FOURTHMODE = 0x0083, | 216 | NUBUS_RESID_FOURTHMODE = 0x0083, |
193 | NUBUS_RESID_FIFTHMODE = 0x0084, | 217 | NUBUS_RESID_FIFTHMODE = 0x0084, |
194 | NUBUS_RESID_SIXTHMODE = 0x0085 | 218 | NUBUS_RESID_SIXTHMODE = 0x0085 |
195 | }; | 219 | }; |
196 | 220 | ||
197 | struct nubus_dir | 221 | struct nubus_dir |
@@ -214,7 +238,7 @@ struct nubus_board { | |||
214 | struct nubus_board* next; | 238 | struct nubus_board* next; |
215 | struct nubus_dev* first_dev; | 239 | struct nubus_dev* first_dev; |
216 | 240 | ||
217 | /* Only 9-E actually exist, though 0-8 are also theoretically | 241 | /* Only 9-E actually exist, though 0-8 are also theoretically |
218 | possible, and 0 is a special case which represents the | 242 | possible, and 0 is a special case which represents the |
219 | motherboard and onboard peripherals (Ethernet, video) */ | 243 | motherboard and onboard peripherals (Ethernet, video) */ |
220 | int slot; | 244 | int slot; |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 96326594e55d..ae2d79f2107e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #define PAGE_FLAGS_H | 6 | #define PAGE_FLAGS_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/mm_types.h> | ||
9 | 10 | ||
10 | /* | 11 | /* |
11 | * Various page->flags bits: | 12 | * Various page->flags bits: |
@@ -82,13 +83,11 @@ | |||
82 | #define PG_private 11 /* If pagecache, has fs-private data */ | 83 | #define PG_private 11 /* If pagecache, has fs-private data */ |
83 | 84 | ||
84 | #define PG_writeback 12 /* Page is under writeback */ | 85 | #define PG_writeback 12 /* Page is under writeback */ |
85 | #define PG_nosave 13 /* Used for system suspend/resume */ | ||
86 | #define PG_compound 14 /* Part of a compound page */ | 86 | #define PG_compound 14 /* Part of a compound page */ |
87 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ | 87 | #define PG_swapcache 15 /* Swap page: swp_entry_t in private */ |
88 | 88 | ||
89 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | 89 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
90 | #define PG_reclaim 17 /* To be reclaimed asap */ | 90 | #define PG_reclaim 17 /* To be reclaimed asap */ |
91 | #define PG_nosave_free 18 /* Used for system suspend/resume */ | ||
92 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 91 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
93 | 92 | ||
94 | /* PG_owner_priv_1 users should have descriptive aliases */ | 93 | /* PG_owner_priv_1 users should have descriptive aliases */ |
@@ -214,16 +213,6 @@ static inline void SetPageUptodate(struct page *page) | |||
214 | ret; \ | 213 | ret; \ |
215 | }) | 214 | }) |
216 | 215 | ||
217 | #define PageNosave(page) test_bit(PG_nosave, &(page)->flags) | ||
218 | #define SetPageNosave(page) set_bit(PG_nosave, &(page)->flags) | ||
219 | #define TestSetPageNosave(page) test_and_set_bit(PG_nosave, &(page)->flags) | ||
220 | #define ClearPageNosave(page) clear_bit(PG_nosave, &(page)->flags) | ||
221 | #define TestClearPageNosave(page) test_and_clear_bit(PG_nosave, &(page)->flags) | ||
222 | |||
223 | #define PageNosaveFree(page) test_bit(PG_nosave_free, &(page)->flags) | ||
224 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) | ||
225 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) | ||
226 | |||
227 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) | 216 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) |
228 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) | 217 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) |
229 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) | 218 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) |
@@ -241,6 +230,34 @@ static inline void SetPageUptodate(struct page *page) | |||
241 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) | 230 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
242 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) | 231 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
243 | 232 | ||
233 | /* | ||
234 | * PG_reclaim is used in combination with PG_compound to mark the | ||
235 | * head and tail of a compound page | ||
236 | * | ||
237 | * PG_compound & PG_reclaim => Tail page | ||
238 | * PG_compound & ~PG_reclaim => Head page | ||
239 | */ | ||
240 | |||
241 | #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim)) | ||
242 | |||
243 | #define PageTail(page) ((page->flags & PG_head_tail_mask) \ | ||
244 | == PG_head_tail_mask) | ||
245 | |||
246 | static inline void __SetPageTail(struct page *page) | ||
247 | { | ||
248 | page->flags |= PG_head_tail_mask; | ||
249 | } | ||
250 | |||
251 | static inline void __ClearPageTail(struct page *page) | ||
252 | { | ||
253 | page->flags &= ~PG_head_tail_mask; | ||
254 | } | ||
255 | |||
256 | #define PageHead(page) ((page->flags & PG_head_tail_mask) \ | ||
257 | == (1L << PG_compound)) | ||
258 | #define __SetPageHead(page) __SetPageCompound(page) | ||
259 | #define __ClearPageHead(page) __ClearPageCompound(page) | ||
260 | |||
244 | #ifdef CONFIG_SWAP | 261 | #ifdef CONFIG_SWAP |
245 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 262 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
246 | #define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) | 263 | #define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7a8dcb82a699..b4def5e083ed 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -95,12 +95,23 @@ static inline struct page *grab_cache_page(struct address_space *mapping, unsign | |||
95 | 95 | ||
96 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, | 96 | extern struct page * grab_cache_page_nowait(struct address_space *mapping, |
97 | unsigned long index); | 97 | unsigned long index); |
98 | extern struct page * read_cache_page_async(struct address_space *mapping, | ||
99 | unsigned long index, filler_t *filler, | ||
100 | void *data); | ||
98 | extern struct page * read_cache_page(struct address_space *mapping, | 101 | extern struct page * read_cache_page(struct address_space *mapping, |
99 | unsigned long index, filler_t *filler, | 102 | unsigned long index, filler_t *filler, |
100 | void *data); | 103 | void *data); |
101 | extern int read_cache_pages(struct address_space *mapping, | 104 | extern int read_cache_pages(struct address_space *mapping, |
102 | struct list_head *pages, filler_t *filler, void *data); | 105 | struct list_head *pages, filler_t *filler, void *data); |
103 | 106 | ||
107 | static inline struct page *read_mapping_page_async( | ||
108 | struct address_space *mapping, | ||
109 | unsigned long index, void *data) | ||
110 | { | ||
111 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | ||
112 | return read_cache_page_async(mapping, index, filler, data); | ||
113 | } | ||
114 | |||
104 | static inline struct page *read_mapping_page(struct address_space *mapping, | 115 | static inline struct page *read_mapping_page(struct address_space *mapping, |
105 | unsigned long index, void *data) | 116 | unsigned long index, void *data) |
106 | { | 117 | { |
diff --git a/include/linux/parser.h b/include/linux/parser.h index fa3332861a09..26b2bdfcaf06 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
@@ -11,7 +11,7 @@ | |||
11 | /* associates an integer enumerator with a pattern string. */ | 11 | /* associates an integer enumerator with a pattern string. */ |
12 | struct match_token { | 12 | struct match_token { |
13 | int token; | 13 | int token; |
14 | char *pattern; | 14 | const char *pattern; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | typedef struct match_token match_table_t[]; | 17 | typedef struct match_token match_table_t[]; |
@@ -29,5 +29,5 @@ int match_token(char *, match_table_t table, substring_t args[]); | |||
29 | int match_int(substring_t *, int *result); | 29 | int match_int(substring_t *, int *result); |
30 | int match_octal(substring_t *, int *result); | 30 | int match_octal(substring_t *, int *result); |
31 | int match_hex(substring_t *, int *result); | 31 | int match_hex(substring_t *, int *result); |
32 | void match_strcpy(char *, substring_t *); | 32 | void match_strcpy(char *, const substring_t *); |
33 | char *match_strdup(substring_t *); | 33 | char *match_strdup(const substring_t *); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 972491089ac9..fbf3766dac1e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -96,6 +96,19 @@ enum pci_channel_state { | |||
96 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, | 96 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | typedef unsigned int __bitwise pcie_reset_state_t; | ||
100 | |||
101 | enum pcie_reset_state { | ||
102 | /* Reset is NOT asserted (Use to deassert reset) */ | ||
103 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, | ||
104 | |||
105 | /* Use #PERST to reset PCI-E device */ | ||
106 | pcie_warm_reset = (__force pcie_reset_state_t) 2, | ||
107 | |||
108 | /* Use PCI-E Hot Reset to reset device */ | ||
109 | pcie_hot_reset = (__force pcie_reset_state_t) 3 | ||
110 | }; | ||
111 | |||
99 | typedef unsigned short __bitwise pci_bus_flags_t; | 112 | typedef unsigned short __bitwise pci_bus_flags_t; |
100 | enum pci_bus_flags { | 113 | enum pci_bus_flags { |
101 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, | 114 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
@@ -176,10 +189,12 @@ struct pci_dev { | |||
176 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ | 189 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ |
177 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ | 190 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ |
178 | #ifdef CONFIG_PCI_MSI | 191 | #ifdef CONFIG_PCI_MSI |
179 | unsigned int first_msi_irq; | 192 | struct list_head msi_list; |
180 | #endif | 193 | #endif |
181 | }; | 194 | }; |
182 | 195 | ||
196 | extern struct pci_dev *alloc_pci_dev(void); | ||
197 | |||
183 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) | 198 | #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) |
184 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) | 199 | #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) |
185 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 200 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
@@ -392,12 +407,6 @@ struct pci_driver { | |||
392 | .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ | 407 | .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ |
393 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID | 408 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID |
394 | 409 | ||
395 | /* | ||
396 | * pci_module_init is obsolete, this stays here till we fix up all usages of it | ||
397 | * in the tree. | ||
398 | */ | ||
399 | #define pci_module_init pci_register_driver | ||
400 | |||
401 | /** | 410 | /** |
402 | * PCI_VDEVICE - macro used to describe a specific pci device in short form | 411 | * PCI_VDEVICE - macro used to describe a specific pci device in short form |
403 | * @vend: the vendor name | 412 | * @vend: the vendor name |
@@ -532,6 +541,7 @@ static inline int pci_is_managed(struct pci_dev *pdev) | |||
532 | 541 | ||
533 | void pci_disable_device(struct pci_dev *dev); | 542 | void pci_disable_device(struct pci_dev *dev); |
534 | void pci_set_master(struct pci_dev *dev); | 543 | void pci_set_master(struct pci_dev *dev); |
544 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | ||
535 | #define HAVE_PCI_SET_MWI | 545 | #define HAVE_PCI_SET_MWI |
536 | int __must_check pci_set_mwi(struct pci_dev *dev); | 546 | int __must_check pci_set_mwi(struct pci_dev *dev); |
537 | void pci_clear_mwi(struct pci_dev *dev); | 547 | void pci_clear_mwi(struct pci_dev *dev); |
@@ -730,6 +740,9 @@ static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) { | |||
730 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } | 740 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { return PCI_D0; } |
731 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } | 741 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) { return 0; } |
732 | 742 | ||
743 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) { return -EIO; } | ||
744 | static inline void pci_release_regions(struct pci_dev *dev) { } | ||
745 | |||
733 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 746 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
734 | 747 | ||
735 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | 748 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index a675a05c4091..ab4cb6ecd47c 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -174,7 +174,7 @@ extern int pci_hp_register (struct hotplug_slot *slot); | |||
174 | extern int pci_hp_deregister (struct hotplug_slot *slot); | 174 | extern int pci_hp_deregister (struct hotplug_slot *slot); |
175 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 175 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, |
176 | struct hotplug_slot_info *info); | 176 | struct hotplug_slot_info *info); |
177 | extern struct subsystem pci_hotplug_slots_subsys; | 177 | extern struct kset pci_hotplug_slots_subsys; |
178 | 178 | ||
179 | /* PCI Setting Record (Type 0) */ | 179 | /* PCI Setting Record (Type 0) */ |
180 | struct hpp_type0 { | 180 | struct hpp_type0 { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1b0ddbb8a804..ae849f0d4430 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1213,11 +1213,13 @@ | |||
1213 | #define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 | 1213 | #define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 |
1214 | #define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 | 1214 | #define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 |
1215 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 | 1215 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 |
1216 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB | ||
1216 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC | 1217 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC |
1217 | #define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE | 1218 | #define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE |
1218 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF | 1219 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF |
1219 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 | 1220 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 |
1220 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 | 1221 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 |
1222 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_SMBUS 0x0446 | ||
1221 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 | 1223 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 |
1222 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 | 1224 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 |
1223 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | 1225 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 |
@@ -1924,6 +1926,7 @@ | |||
1924 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 1926 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
1925 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | 1927 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 |
1926 | #define PCI_DEVICE_ID_NX2_5709 0x1639 | 1928 | #define PCI_DEVICE_ID_NX2_5709 0x1639 |
1929 | #define PCI_DEVICE_ID_NX2_5709S 0x163a | ||
1927 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 | 1930 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 |
1928 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 | 1931 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 |
1929 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 | 1932 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 600e3d387ffc..b72be2f79e6a 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -11,9 +11,16 @@ | |||
11 | 11 | ||
12 | /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */ | 12 | /* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */ |
13 | #ifndef PERCPU_ENOUGH_ROOM | 13 | #ifndef PERCPU_ENOUGH_ROOM |
14 | #define PERCPU_ENOUGH_ROOM 32768 | 14 | #ifdef CONFIG_MODULES |
15 | #define PERCPU_MODULE_RESERVE 8192 | ||
16 | #else | ||
17 | #define PERCPU_MODULE_RESERVE 0 | ||
15 | #endif | 18 | #endif |
16 | 19 | ||
20 | #define PERCPU_ENOUGH_ROOM \ | ||
21 | (__per_cpu_end - __per_cpu_start + PERCPU_MODULE_RESERVE) | ||
22 | #endif /* PERCPU_ENOUGH_ROOM */ | ||
23 | |||
17 | /* | 24 | /* |
18 | * Must be an lvalue. Since @var must be a simple identifier, | 25 | * Must be an lvalue. Since @var must be a simple identifier, |
19 | * we force a syntax error here if it isn't. | 26 | * we force a syntax error here if it isn't. |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 3e628f990fdf..95f518b17684 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -18,6 +18,9 @@ | |||
18 | #define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */ | 18 | #define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */ |
19 | #define RED_ACTIVE 0x170FC2A5UL /* when obj is active */ | 19 | #define RED_ACTIVE 0x170FC2A5UL /* when obj is active */ |
20 | 20 | ||
21 | #define SLUB_RED_INACTIVE 0xbb | ||
22 | #define SLUB_RED_ACTIVE 0xcc | ||
23 | |||
21 | /* ...and for poisoning */ | 24 | /* ...and for poisoning */ |
22 | #define POISON_INUSE 0x5a /* for use-uninitialised poisoning */ | 25 | #define POISON_INUSE 0x5a /* for use-uninitialised poisoning */ |
23 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | 26 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ |
@@ -26,9 +29,6 @@ | |||
26 | /********** arch/$ARCH/mm/init.c **********/ | 29 | /********** arch/$ARCH/mm/init.c **********/ |
27 | #define POISON_FREE_INITMEM 0xcc | 30 | #define POISON_FREE_INITMEM 0xcc |
28 | 31 | ||
29 | /********** arch/x86_64/mm/init.c **********/ | ||
30 | #define POISON_FREE_INITDATA 0xba | ||
31 | |||
32 | /********** arch/ia64/hp/common/sba_iommu.c **********/ | 32 | /********** arch/ia64/hp/common/sba_iommu.c **********/ |
33 | /* | 33 | /* |
34 | * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a | 34 | * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index be4652a0545a..f4f7a63cae1f 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -104,6 +104,7 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | |||
104 | unsigned long task_vsize(struct mm_struct *); | 104 | unsigned long task_vsize(struct mm_struct *); |
105 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | 105 | int task_statm(struct mm_struct *, int *, int *, int *, int *); |
106 | char *task_mem(struct mm_struct *, char *); | 106 | char *task_mem(struct mm_struct *, char *); |
107 | void clear_refs_smap(struct mm_struct *mm); | ||
107 | 108 | ||
108 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, | 109 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, |
109 | struct proc_dir_entry *parent); | 110 | struct proc_dir_entry *parent); |
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h new file mode 100644 index 000000000000..9371c6116df3 --- /dev/null +++ b/include/linux/quicklist.h | |||
@@ -0,0 +1,94 @@ | |||
1 | #ifndef LINUX_QUICKLIST_H | ||
2 | #define LINUX_QUICKLIST_H | ||
3 | /* | ||
4 | * Fast allocations and disposal of pages. Pages must be in the condition | ||
5 | * as needed after allocation when they are freed. Per cpu lists of pages | ||
6 | * are kept that only contain node local pages. | ||
7 | * | ||
8 | * (C) 2007, SGI. Christoph Lameter <clameter@sgi.com> | ||
9 | */ | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/gfp.h> | ||
12 | #include <linux/percpu.h> | ||
13 | |||
14 | #ifdef CONFIG_QUICKLIST | ||
15 | |||
16 | struct quicklist { | ||
17 | void *page; | ||
18 | int nr_pages; | ||
19 | }; | ||
20 | |||
21 | DECLARE_PER_CPU(struct quicklist, quicklist)[CONFIG_NR_QUICK]; | ||
22 | |||
23 | /* | ||
24 | * The two key functions quicklist_alloc and quicklist_free are inline so | ||
25 | * that they may be custom compiled for the platform. | ||
26 | * Specifying a NULL ctor can remove constructor support. Specifying | ||
27 | * a constant quicklist allows the determination of the exact address | ||
28 | * in the per cpu area. | ||
29 | * | ||
30 | * The fast patch in quicklist_alloc touched only a per cpu cacheline and | ||
31 | * the first cacheline of the page itself. There is minmal overhead involved. | ||
32 | */ | ||
33 | static inline void *quicklist_alloc(int nr, gfp_t flags, void (*ctor)(void *)) | ||
34 | { | ||
35 | struct quicklist *q; | ||
36 | void **p = NULL; | ||
37 | |||
38 | q =&get_cpu_var(quicklist)[nr]; | ||
39 | p = q->page; | ||
40 | if (likely(p)) { | ||
41 | q->page = p[0]; | ||
42 | p[0] = NULL; | ||
43 | q->nr_pages--; | ||
44 | } | ||
45 | put_cpu_var(quicklist); | ||
46 | if (likely(p)) | ||
47 | return p; | ||
48 | |||
49 | p = (void *)__get_free_page(flags | __GFP_ZERO); | ||
50 | if (ctor && p) | ||
51 | ctor(p); | ||
52 | return p; | ||
53 | } | ||
54 | |||
55 | static inline void __quicklist_free(int nr, void (*dtor)(void *), void *p, | ||
56 | struct page *page) | ||
57 | { | ||
58 | struct quicklist *q; | ||
59 | int nid = page_to_nid(page); | ||
60 | |||
61 | if (unlikely(nid != numa_node_id())) { | ||
62 | if (dtor) | ||
63 | dtor(p); | ||
64 | __free_page(page); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | q = &get_cpu_var(quicklist)[nr]; | ||
69 | *(void **)p = q->page; | ||
70 | q->page = p; | ||
71 | q->nr_pages++; | ||
72 | put_cpu_var(quicklist); | ||
73 | } | ||
74 | |||
75 | static inline void quicklist_free(int nr, void (*dtor)(void *), void *pp) | ||
76 | { | ||
77 | __quicklist_free(nr, dtor, pp, virt_to_page(pp)); | ||
78 | } | ||
79 | |||
80 | static inline void quicklist_free_page(int nr, void (*dtor)(void *), | ||
81 | struct page *page) | ||
82 | { | ||
83 | __quicklist_free(nr, dtor, page_address(page), page); | ||
84 | } | ||
85 | |||
86 | void quicklist_trim(int nr, void (*dtor)(void *), | ||
87 | unsigned long min_pages, unsigned long max_free); | ||
88 | |||
89 | unsigned long quicklist_total_size(void); | ||
90 | |||
91 | #endif | ||
92 | |||
93 | #endif /* LINUX_QUICKLIST_H */ | ||
94 | |||
diff --git a/include/linux/reboot_fixups.h b/include/linux/reboot_fixups.h deleted file mode 100644 index 480ea2d489d8..000000000000 --- a/include/linux/reboot_fixups.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _LINUX_REBOOT_FIXUPS_H | ||
2 | #define _LINUX_REBOOT_FIXUPS_H | ||
3 | |||
4 | #ifdef CONFIG_X86_REBOOTFIXUPS | ||
5 | extern void mach_reboot_fixups(void); | ||
6 | #else | ||
7 | #define mach_reboot_fixups() ((void)(0)) | ||
8 | #endif | ||
9 | |||
10 | #endif /* _LINUX_REBOOT_FIXUPS_H */ | ||
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h new file mode 100644 index 000000000000..7c1ffbab7865 --- /dev/null +++ b/include/linux/rfkill.h | |||
@@ -0,0 +1,89 @@ | |||
1 | #ifndef __RFKILL_H | ||
2 | #define __RFKILL_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2006 Ivo van Doorn | ||
6 | * Copyright (C) 2007 Dmitry Torokhov | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the | ||
20 | * Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/list.h> | ||
27 | #include <linux/mutex.h> | ||
28 | #include <linux/device.h> | ||
29 | |||
30 | /** | ||
31 | * enum rfkill_type - type of rfkill switch. | ||
32 | * RFKILL_TYPE_WLAN: switch is no a Wireless network devices. | ||
33 | * RFKILL_TYPE_BlUETOOTH: switch is on a bluetooth device. | ||
34 | * RFKILL_TYPE_IRDA: switch is on an infrared devices. | ||
35 | */ | ||
36 | enum rfkill_type { | ||
37 | RFKILL_TYPE_WLAN = 0, | ||
38 | RFKILL_TYPE_BLUETOOTH = 1, | ||
39 | RFKILL_TYPE_IRDA = 2, | ||
40 | RFKILL_TYPE_MAX = 3, | ||
41 | }; | ||
42 | |||
43 | enum rfkill_state { | ||
44 | RFKILL_STATE_OFF = 0, | ||
45 | RFKILL_STATE_ON = 1, | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * struct rfkill - rfkill control structure. | ||
50 | * @name: Name of the switch. | ||
51 | * @type: Radio type which the button controls, the value stored | ||
52 | * here should be a value from enum rfkill_type. | ||
53 | * @state: State of the switch (on/off). | ||
54 | * @user_claim: Set when the switch is controlled exlusively by userspace. | ||
55 | * @mutex: Guards switch state transitions | ||
56 | * @data: Pointer to the RF button drivers private data which will be | ||
57 | * passed along when toggling radio state. | ||
58 | * @toggle_radio(): Mandatory handler to control state of the radio. | ||
59 | * @dev: Device structure integrating the switch into device tree. | ||
60 | * @node: Used to place switch into list of all switches known to the | ||
61 | * the system. | ||
62 | * | ||
63 | * This structure represents a RF switch located on a network device. | ||
64 | */ | ||
65 | struct rfkill { | ||
66 | char *name; | ||
67 | enum rfkill_type type; | ||
68 | |||
69 | enum rfkill_state state; | ||
70 | bool user_claim; | ||
71 | |||
72 | struct mutex mutex; | ||
73 | |||
74 | void *data; | ||
75 | int (*toggle_radio)(void *data, enum rfkill_state state); | ||
76 | |||
77 | struct device dev; | ||
78 | struct list_head node; | ||
79 | }; | ||
80 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | ||
81 | |||
82 | struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type); | ||
83 | void rfkill_free(struct rfkill *rfkill); | ||
84 | int rfkill_register(struct rfkill *rfkill); | ||
85 | void rfkill_unregister(struct rfkill *rfkill); | ||
86 | |||
87 | void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state); | ||
88 | |||
89 | #endif /* RFKILL_H */ | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 586aaba91720..aa2653a159f4 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -39,7 +39,8 @@ | |||
39 | #define PORT_RSA 13 | 39 | #define PORT_RSA 13 |
40 | #define PORT_NS16550A 14 | 40 | #define PORT_NS16550A 14 |
41 | #define PORT_XSCALE 15 | 41 | #define PORT_XSCALE 15 |
42 | #define PORT_MAX_8250 15 /* max port ID */ | 42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ |
43 | #define PORT_MAX_8250 16 /* max port ID */ | ||
43 | 44 | ||
44 | /* | 45 | /* |
45 | * ARM specific type numbers. These are not currently guaranteed | 46 | * ARM specific type numbers. These are not currently guaranteed |
@@ -135,6 +136,9 @@ | |||
135 | /* Xilinx uartlite */ | 136 | /* Xilinx uartlite */ |
136 | #define PORT_UARTLITE 74 | 137 | #define PORT_UARTLITE 74 |
137 | 138 | ||
139 | /* Blackfin bf5xx */ | ||
140 | #define PORT_BFIN 75 | ||
141 | |||
138 | #ifdef __KERNEL__ | 142 | #ifdef __KERNEL__ |
139 | 143 | ||
140 | #include <linux/compiler.h> | 144 | #include <linux/compiler.h> |
@@ -230,6 +234,8 @@ struct uart_port { | |||
230 | #define UPIO_MEM32 (3) | 234 | #define UPIO_MEM32 (3) |
231 | #define UPIO_AU (4) /* Au1x00 type IO */ | 235 | #define UPIO_AU (4) /* Au1x00 type IO */ |
232 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | 236 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ |
237 | #define UPIO_DWAPB (6) /* DesignWare APB UART */ | ||
238 | #define UPIO_RM9000 (7) /* RM9000 type IO */ | ||
233 | 239 | ||
234 | unsigned int read_status_mask; /* driver specific */ | 240 | unsigned int read_status_mask; /* driver specific */ |
235 | unsigned int ignore_status_mask; /* driver specific */ | 241 | unsigned int ignore_status_mask; /* driver specific */ |
@@ -260,6 +266,7 @@ struct uart_port { | |||
260 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 266 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
261 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 267 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
262 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 268 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
269 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) | ||
263 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | 270 | #define UPF_DEAD ((__force upf_t) (1 << 30)) |
264 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) | 271 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) |
265 | 272 | ||
@@ -276,6 +283,7 @@ struct uart_port { | |||
276 | struct device *dev; /* parent device */ | 283 | struct device *dev; /* parent device */ |
277 | unsigned char hub6; /* this should be in the 8250 driver */ | 284 | unsigned char hub6; /* this should be in the 8250 driver */ |
278 | unsigned char unused[3]; | 285 | unsigned char unused[3]; |
286 | void *private_data; /* generic platform data pointer */ | ||
279 | }; | 287 | }; |
280 | 288 | ||
281 | /* | 289 | /* |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 3c8a6aa77415..1c5ed7d92b0f 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -38,6 +38,8 @@ | |||
38 | #define UART_IIR_RDI 0x04 /* Receiver data interrupt */ | 38 | #define UART_IIR_RDI 0x04 /* Receiver data interrupt */ |
39 | #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */ | 39 | #define UART_IIR_RLSI 0x06 /* Receiver line status interrupt */ |
40 | 40 | ||
41 | #define UART_IIR_BUSY 0x07 /* DesignWare APB Busy Detect */ | ||
42 | |||
41 | #define UART_FCR 2 /* Out: FIFO Control Register */ | 43 | #define UART_FCR 2 /* Out: FIFO Control Register */ |
42 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ | 44 | #define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */ |
43 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ | 45 | #define UART_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 253a2b9be9d6..e7367c74e1bb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -197,7 +197,7 @@ typedef unsigned char *sk_buff_data_t; | |||
197 | * @tstamp: Time we arrived | 197 | * @tstamp: Time we arrived |
198 | * @dev: Device we arrived on/are leaving by | 198 | * @dev: Device we arrived on/are leaving by |
199 | * @iif: ifindex of device we arrived on | 199 | * @iif: ifindex of device we arrived on |
200 | * @h: Transport layer header | 200 | * @transport_header: Transport layer header |
201 | * @network_header: Network layer header | 201 | * @network_header: Network layer header |
202 | * @mac_header: Link layer header | 202 | * @mac_header: Link layer header |
203 | * @dst: destination entry | 203 | * @dst: destination entry |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 1ef822e31c77..71829efc40ba 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -21,28 +21,25 @@ typedef struct kmem_cache kmem_cache_t __deprecated; | |||
21 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. | 21 | * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. |
22 | */ | 22 | */ |
23 | #define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */ | 23 | #define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */ |
24 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* DEBUG: Call constructor (as verifier) */ | ||
25 | #define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */ | 24 | #define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */ |
26 | #define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */ | 25 | #define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */ |
27 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ | 26 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ |
28 | #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ | 27 | #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ |
29 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* Force alignment even if debuggin is active */ | ||
30 | #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ | 28 | #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ |
31 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | 29 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |
32 | #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ | 30 | #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ |
33 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ | 31 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ |
34 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | 32 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ |
33 | #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ | ||
35 | 34 | ||
36 | /* Flags passed to a constructor functions */ | 35 | /* Flags passed to a constructor functions */ |
37 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */ | 36 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */ |
38 | #define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */ | ||
39 | #define SLAB_CTOR_VERIFY 0x004UL /* Tell constructor it's a verify call */ | ||
40 | 37 | ||
41 | /* | 38 | /* |
42 | * struct kmem_cache related prototypes | 39 | * struct kmem_cache related prototypes |
43 | */ | 40 | */ |
44 | void __init kmem_cache_init(void); | 41 | void __init kmem_cache_init(void); |
45 | extern int slab_is_available(void); | 42 | int slab_is_available(void); |
46 | 43 | ||
47 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, | 44 | struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, |
48 | unsigned long, | 45 | unsigned long, |
@@ -57,6 +54,18 @@ unsigned int kmem_cache_size(struct kmem_cache *); | |||
57 | const char *kmem_cache_name(struct kmem_cache *); | 54 | const char *kmem_cache_name(struct kmem_cache *); |
58 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | 55 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); |
59 | 56 | ||
57 | /* | ||
58 | * Please use this macro to create slab caches. Simply specify the | ||
59 | * name of the structure and maybe some flags that are listed above. | ||
60 | * | ||
61 | * The alignment of the struct determines object alignment. If you | ||
62 | * f.e. add ____cacheline_aligned_in_smp to the struct declaration | ||
63 | * then the objects will be properly aligned in SMP configurations. | ||
64 | */ | ||
65 | #define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\ | ||
66 | sizeof(struct __struct), __alignof__(struct __struct),\ | ||
67 | (__flags), NULL, NULL) | ||
68 | |||
60 | #ifdef CONFIG_NUMA | 69 | #ifdef CONFIG_NUMA |
61 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 70 | extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
62 | #else | 71 | #else |
@@ -72,8 +81,9 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
72 | */ | 81 | */ |
73 | void *__kmalloc(size_t, gfp_t); | 82 | void *__kmalloc(size_t, gfp_t); |
74 | void *__kzalloc(size_t, gfp_t); | 83 | void *__kzalloc(size_t, gfp_t); |
84 | void * __must_check krealloc(const void *, size_t, gfp_t); | ||
75 | void kfree(const void *); | 85 | void kfree(const void *); |
76 | unsigned int ksize(const void *); | 86 | size_t ksize(const void *); |
77 | 87 | ||
78 | /** | 88 | /** |
79 | * kcalloc - allocate memory for an array. The memory is set to zero. | 89 | * kcalloc - allocate memory for an array. The memory is set to zero. |
@@ -94,9 +104,14 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
94 | * the appropriate general cache at compile time. | 104 | * the appropriate general cache at compile time. |
95 | */ | 105 | */ |
96 | 106 | ||
97 | #ifdef CONFIG_SLAB | 107 | #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) |
108 | #ifdef CONFIG_SLUB | ||
109 | #include <linux/slub_def.h> | ||
110 | #else | ||
98 | #include <linux/slab_def.h> | 111 | #include <linux/slab_def.h> |
112 | #endif /* !CONFIG_SLUB */ | ||
99 | #else | 113 | #else |
114 | |||
100 | /* | 115 | /* |
101 | * Fallback definitions for an allocator not wanting to provide | 116 | * Fallback definitions for an allocator not wanting to provide |
102 | * its own optimized kmalloc definitions (like SLOB). | 117 | * its own optimized kmalloc definitions (like SLOB). |
@@ -183,7 +198,7 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node) | |||
183 | * allocator where we care about the real place the memory allocation | 198 | * allocator where we care about the real place the memory allocation |
184 | * request comes from. | 199 | * request comes from. |
185 | */ | 200 | */ |
186 | #ifdef CONFIG_DEBUG_SLAB | 201 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) |
187 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | 202 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); |
188 | #define kmalloc_track_caller(size, flags) \ | 203 | #define kmalloc_track_caller(size, flags) \ |
189 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | 204 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) |
@@ -201,7 +216,7 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | |||
201 | * standard allocator where we care about the real place the memory | 216 | * standard allocator where we care about the real place the memory |
202 | * allocation request comes from. | 217 | * allocation request comes from. |
203 | */ | 218 | */ |
204 | #ifdef CONFIG_DEBUG_SLAB | 219 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) |
205 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | 220 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); |
206 | #define kmalloc_node_track_caller(size, flags, node) \ | 221 | #define kmalloc_node_track_caller(size, flags, node) \ |
207 | __kmalloc_node_track_caller(size, flags, node, \ | 222 | __kmalloc_node_track_caller(size, flags, node, \ |
@@ -218,6 +233,9 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | |||
218 | 233 | ||
219 | #endif /* DEBUG_SLAB */ | 234 | #endif /* DEBUG_SLAB */ |
220 | 235 | ||
236 | extern const struct seq_operations slabinfo_op; | ||
237 | ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *); | ||
238 | |||
221 | #endif /* __KERNEL__ */ | 239 | #endif /* __KERNEL__ */ |
222 | #endif /* _LINUX_SLAB_H */ | 240 | #endif /* _LINUX_SLAB_H */ |
223 | 241 | ||
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h new file mode 100644 index 000000000000..ea27065e80e6 --- /dev/null +++ b/include/linux/slub_def.h | |||
@@ -0,0 +1,206 @@ | |||
1 | #ifndef _LINUX_SLUB_DEF_H | ||
2 | #define _LINUX_SLUB_DEF_H | ||
3 | |||
4 | /* | ||
5 | * SLUB : A Slab allocator without object queues. | ||
6 | * | ||
7 | * (C) 2007 SGI, Christoph Lameter <clameter@sgi.com> | ||
8 | */ | ||
9 | #include <linux/types.h> | ||
10 | #include <linux/gfp.h> | ||
11 | #include <linux/workqueue.h> | ||
12 | #include <linux/kobject.h> | ||
13 | |||
14 | struct kmem_cache_node { | ||
15 | spinlock_t list_lock; /* Protect partial list and nr_partial */ | ||
16 | unsigned long nr_partial; | ||
17 | atomic_long_t nr_slabs; | ||
18 | struct list_head partial; | ||
19 | struct list_head full; | ||
20 | }; | ||
21 | |||
22 | /* | ||
23 | * Slab cache management. | ||
24 | */ | ||
25 | struct kmem_cache { | ||
26 | /* Used for retriving partial slabs etc */ | ||
27 | unsigned long flags; | ||
28 | int size; /* The size of an object including meta data */ | ||
29 | int objsize; /* The size of an object without meta data */ | ||
30 | int offset; /* Free pointer offset. */ | ||
31 | unsigned int order; | ||
32 | |||
33 | /* | ||
34 | * Avoid an extra cache line for UP, SMP and for the node local to | ||
35 | * struct kmem_cache. | ||
36 | */ | ||
37 | struct kmem_cache_node local_node; | ||
38 | |||
39 | /* Allocation and freeing of slabs */ | ||
40 | int objects; /* Number of objects in slab */ | ||
41 | int refcount; /* Refcount for slab cache destroy */ | ||
42 | void (*ctor)(void *, struct kmem_cache *, unsigned long); | ||
43 | void (*dtor)(void *, struct kmem_cache *, unsigned long); | ||
44 | int inuse; /* Offset to metadata */ | ||
45 | int align; /* Alignment */ | ||
46 | const char *name; /* Name (only for display!) */ | ||
47 | struct list_head list; /* List of slab caches */ | ||
48 | struct kobject kobj; /* For sysfs */ | ||
49 | |||
50 | #ifdef CONFIG_NUMA | ||
51 | int defrag_ratio; | ||
52 | struct kmem_cache_node *node[MAX_NUMNODES]; | ||
53 | #endif | ||
54 | struct page *cpu_slab[NR_CPUS]; | ||
55 | }; | ||
56 | |||
57 | /* | ||
58 | * Kmalloc subsystem. | ||
59 | */ | ||
60 | #define KMALLOC_SHIFT_LOW 3 | ||
61 | |||
62 | #ifdef CONFIG_LARGE_ALLOCS | ||
63 | #define KMALLOC_SHIFT_HIGH 25 | ||
64 | #else | ||
65 | #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256 | ||
66 | #define KMALLOC_SHIFT_HIGH 20 | ||
67 | #else | ||
68 | #define KMALLOC_SHIFT_HIGH 18 | ||
69 | #endif | ||
70 | #endif | ||
71 | |||
72 | /* | ||
73 | * We keep the general caches in an array of slab caches that are used for | ||
74 | * 2^x bytes of allocations. | ||
75 | */ | ||
76 | extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; | ||
77 | |||
78 | /* | ||
79 | * Sorry that the following has to be that ugly but some versions of GCC | ||
80 | * have trouble with constant propagation and loops. | ||
81 | */ | ||
82 | static inline int kmalloc_index(int size) | ||
83 | { | ||
84 | /* | ||
85 | * We should return 0 if size == 0 but we use the smallest object | ||
86 | * here for SLAB legacy reasons. | ||
87 | */ | ||
88 | WARN_ON_ONCE(size == 0); | ||
89 | |||
90 | if (size > 64 && size <= 96) | ||
91 | return 1; | ||
92 | if (size > 128 && size <= 192) | ||
93 | return 2; | ||
94 | if (size <= 8) return 3; | ||
95 | if (size <= 16) return 4; | ||
96 | if (size <= 32) return 5; | ||
97 | if (size <= 64) return 6; | ||
98 | if (size <= 128) return 7; | ||
99 | if (size <= 256) return 8; | ||
100 | if (size <= 512) return 9; | ||
101 | if (size <= 1024) return 10; | ||
102 | if (size <= 2 * 1024) return 11; | ||
103 | if (size <= 4 * 1024) return 12; | ||
104 | if (size <= 8 * 1024) return 13; | ||
105 | if (size <= 16 * 1024) return 14; | ||
106 | if (size <= 32 * 1024) return 15; | ||
107 | if (size <= 64 * 1024) return 16; | ||
108 | if (size <= 128 * 1024) return 17; | ||
109 | if (size <= 256 * 1024) return 18; | ||
110 | #if KMALLOC_SHIFT_HIGH > 18 | ||
111 | if (size <= 512 * 1024) return 19; | ||
112 | if (size <= 1024 * 1024) return 20; | ||
113 | #endif | ||
114 | #if KMALLOC_SHIFT_HIGH > 20 | ||
115 | if (size <= 2 * 1024 * 1024) return 21; | ||
116 | if (size <= 4 * 1024 * 1024) return 22; | ||
117 | if (size <= 8 * 1024 * 1024) return 23; | ||
118 | if (size <= 16 * 1024 * 1024) return 24; | ||
119 | if (size <= 32 * 1024 * 1024) return 25; | ||
120 | #endif | ||
121 | return -1; | ||
122 | |||
123 | /* | ||
124 | * What we really wanted to do and cannot do because of compiler issues is: | ||
125 | * int i; | ||
126 | * for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) | ||
127 | * if (size <= (1 << i)) | ||
128 | * return i; | ||
129 | */ | ||
130 | } | ||
131 | |||
132 | /* | ||
133 | * Find the slab cache for a given combination of allocation flags and size. | ||
134 | * | ||
135 | * This ought to end up with a global pointer to the right cache | ||
136 | * in kmalloc_caches. | ||
137 | */ | ||
138 | static inline struct kmem_cache *kmalloc_slab(size_t size) | ||
139 | { | ||
140 | int index = kmalloc_index(size); | ||
141 | |||
142 | if (index == 0) | ||
143 | return NULL; | ||
144 | |||
145 | if (index < 0) { | ||
146 | /* | ||
147 | * Generate a link failure. Would be great if we could | ||
148 | * do something to stop the compile here. | ||
149 | */ | ||
150 | extern void __kmalloc_size_too_large(void); | ||
151 | __kmalloc_size_too_large(); | ||
152 | } | ||
153 | return &kmalloc_caches[index]; | ||
154 | } | ||
155 | |||
156 | #ifdef CONFIG_ZONE_DMA | ||
157 | #define SLUB_DMA __GFP_DMA | ||
158 | #else | ||
159 | /* Disable DMA functionality */ | ||
160 | #define SLUB_DMA 0 | ||
161 | #endif | ||
162 | |||
163 | static inline void *kmalloc(size_t size, gfp_t flags) | ||
164 | { | ||
165 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | ||
166 | struct kmem_cache *s = kmalloc_slab(size); | ||
167 | |||
168 | if (!s) | ||
169 | return NULL; | ||
170 | |||
171 | return kmem_cache_alloc(s, flags); | ||
172 | } else | ||
173 | return __kmalloc(size, flags); | ||
174 | } | ||
175 | |||
176 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
177 | { | ||
178 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | ||
179 | struct kmem_cache *s = kmalloc_slab(size); | ||
180 | |||
181 | if (!s) | ||
182 | return NULL; | ||
183 | |||
184 | return kmem_cache_zalloc(s, flags); | ||
185 | } else | ||
186 | return __kzalloc(size, flags); | ||
187 | } | ||
188 | |||
189 | #ifdef CONFIG_NUMA | ||
190 | extern void *__kmalloc_node(size_t size, gfp_t flags, int node); | ||
191 | |||
192 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | ||
193 | { | ||
194 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | ||
195 | struct kmem_cache *s = kmalloc_slab(size); | ||
196 | |||
197 | if (!s) | ||
198 | return NULL; | ||
199 | |||
200 | return kmem_cache_alloc_node(s, flags, node); | ||
201 | } else | ||
202 | return __kmalloc_node(size, flags, node); | ||
203 | } | ||
204 | #endif | ||
205 | |||
206 | #endif /* _LINUX_SLUB_DEF_H */ | ||
diff --git a/include/linux/spi/ad7877.h b/include/linux/spi/ad7877.h new file mode 100644 index 000000000000..cdbed816f25e --- /dev/null +++ b/include/linux/spi/ad7877.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* linux/spi/ad7877.h */ | ||
2 | |||
3 | /* Touchscreen characteristics vary between boards and models. The | ||
4 | * platform_data for the device's "struct device" holds this information. | ||
5 | * | ||
6 | * It's OK if the min/max values are zero. | ||
7 | */ | ||
8 | struct ad7877_platform_data { | ||
9 | u16 model; /* 7877 */ | ||
10 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | ||
11 | u16 x_plate_ohms; | ||
12 | u16 y_plate_ohms; | ||
13 | |||
14 | u16 x_min, x_max; | ||
15 | u16 y_min, y_max; | ||
16 | u16 pressure_min, pressure_max; | ||
17 | |||
18 | u8 stopacq_polarity; /* 1 = Active HIGH, 0 = Active LOW */ | ||
19 | u8 first_conversion_delay; /* 0 = 0.5us, 1 = 128us, 2 = 1ms, 3 = 8ms */ | ||
20 | u8 acquisition_time; /* 0 = 2us, 1 = 4us, 2 = 8us, 3 = 16us */ | ||
21 | u8 averaging; /* 0 = 1, 1 = 4, 2 = 8, 3 = 16 */ | ||
22 | u8 pen_down_acc_interval; /* 0 = covert once, 1 = every 0.5 ms, | ||
23 | 2 = ever 1 ms, 3 = every 8 ms,*/ | ||
24 | }; | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index c7a78eef2b4f..66611423c8ee 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -84,7 +84,8 @@ struct rpc_procinfo { | |||
84 | u32 p_proc; /* RPC procedure number */ | 84 | u32 p_proc; /* RPC procedure number */ |
85 | kxdrproc_t p_encode; /* XDR encode function */ | 85 | kxdrproc_t p_encode; /* XDR encode function */ |
86 | kxdrproc_t p_decode; /* XDR decode function */ | 86 | kxdrproc_t p_decode; /* XDR decode function */ |
87 | unsigned int p_bufsiz; /* req. buffer size */ | 87 | unsigned int p_arglen; /* argument hdr length (u32) */ |
88 | unsigned int p_replen; /* reply hdr length (u32) */ | ||
88 | unsigned int p_count; /* call count */ | 89 | unsigned int p_count; /* call count */ |
89 | unsigned int p_timer; /* Which RTT timer to use */ | 90 | unsigned int p_timer; /* Which RTT timer to use */ |
90 | u32 p_statidx; /* Which procedure to account */ | 91 | u32 p_statidx; /* Which procedure to account */ |
@@ -121,8 +122,8 @@ struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | |||
121 | int rpc_shutdown_client(struct rpc_clnt *); | 122 | int rpc_shutdown_client(struct rpc_clnt *); |
122 | int rpc_destroy_client(struct rpc_clnt *); | 123 | int rpc_destroy_client(struct rpc_clnt *); |
123 | void rpc_release_client(struct rpc_clnt *); | 124 | void rpc_release_client(struct rpc_clnt *); |
124 | void rpc_getport(struct rpc_task *); | 125 | int rpcb_register(u32, u32, int, unsigned short, int *); |
125 | int rpc_register(u32, u32, int, unsigned short, int *); | 126 | void rpcb_getport(struct rpc_task *); |
126 | 127 | ||
127 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); | 128 | void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); |
128 | 129 | ||
@@ -144,7 +145,7 @@ char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | |||
144 | /* | 145 | /* |
145 | * Helper function for NFSroot support | 146 | * Helper function for NFSroot support |
146 | */ | 147 | */ |
147 | int rpc_getport_external(struct sockaddr_in *, __u32, __u32, int); | 148 | int rpcb_getport_external(struct sockaddr_in *, __u32, __u32, int); |
148 | 149 | ||
149 | #endif /* __KERNEL__ */ | 150 | #endif /* __KERNEL__ */ |
150 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 151 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index b7c7307ceec6..3912cf16361e 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #define RPCDBG_DEBUG 0x0004 | 17 | #define RPCDBG_DEBUG 0x0004 |
18 | #define RPCDBG_NFS 0x0008 | 18 | #define RPCDBG_NFS 0x0008 |
19 | #define RPCDBG_AUTH 0x0010 | 19 | #define RPCDBG_AUTH 0x0010 |
20 | #define RPCDBG_PMAP 0x0020 | 20 | #define RPCDBG_BIND 0x0020 |
21 | #define RPCDBG_SCHED 0x0040 | 21 | #define RPCDBG_SCHED 0x0040 |
22 | #define RPCDBG_TRANS 0x0080 | 22 | #define RPCDBG_TRANS 0x0080 |
23 | #define RPCDBG_SVCSOCK 0x0100 | 23 | #define RPCDBG_SVCSOCK 0x0100 |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 606cb2165232..784d4c3ef651 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -78,10 +78,6 @@ enum rpc_auth_stat { | |||
78 | RPCSEC_GSS_CTXPROBLEM = 14 | 78 | RPCSEC_GSS_CTXPROBLEM = 14 |
79 | }; | 79 | }; |
80 | 80 | ||
81 | #define RPC_PMAP_PROGRAM 100000 | ||
82 | #define RPC_PMAP_VERSION 2 | ||
83 | #define RPC_PMAP_PORT 111 | ||
84 | |||
85 | #define RPC_MAXNETNAMELEN 256 | 81 | #define RPC_MAXNETNAMELEN 256 |
86 | 82 | ||
87 | /* | 83 | /* |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 3069ecca0129..2047fb202a13 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -264,7 +264,7 @@ struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | |||
264 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 264 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
265 | void rpc_delay(struct rpc_task *, unsigned long); | 265 | void rpc_delay(struct rpc_task *, unsigned long); |
266 | void * rpc_malloc(struct rpc_task *, size_t); | 266 | void * rpc_malloc(struct rpc_task *, size_t); |
267 | void rpc_free(struct rpc_task *); | 267 | void rpc_free(void *); |
268 | int rpciod_up(void); | 268 | int rpciod_up(void); |
269 | void rpciod_down(void); | 269 | void rpciod_down(void); |
270 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 270 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index f780e72fc417..fa89ce6ce076 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -84,7 +84,9 @@ struct rpc_rqst { | |||
84 | struct list_head rq_list; | 84 | struct list_head rq_list; |
85 | 85 | ||
86 | __u32 * rq_buffer; /* XDR encode buffer */ | 86 | __u32 * rq_buffer; /* XDR encode buffer */ |
87 | size_t rq_bufsize; | 87 | size_t rq_bufsize, |
88 | rq_callsize, | ||
89 | rq_rcvsize; | ||
88 | 90 | ||
89 | struct xdr_buf rq_private_buf; /* The receive buffer | 91 | struct xdr_buf rq_private_buf; /* The receive buffer |
90 | * used in the softirq. | 92 | * used in the softirq. |
@@ -112,7 +114,7 @@ struct rpc_xprt_ops { | |||
112 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 114 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
113 | void (*connect)(struct rpc_task *task); | 115 | void (*connect)(struct rpc_task *task); |
114 | void * (*buf_alloc)(struct rpc_task *task, size_t size); | 116 | void * (*buf_alloc)(struct rpc_task *task, size_t size); |
115 | void (*buf_free)(struct rpc_task *task); | 117 | void (*buf_free)(void *buffer); |
116 | int (*send_request)(struct rpc_task *task); | 118 | int (*send_request)(struct rpc_task *task); |
117 | void (*set_retrans_timeout)(struct rpc_task *task); | 119 | void (*set_retrans_timeout)(struct rpc_task *task); |
118 | void (*timer)(struct rpc_task *task); | 120 | void (*timer)(struct rpc_task *task); |
@@ -150,6 +152,7 @@ struct rpc_xprt { | |||
150 | unsigned long state; /* transport state */ | 152 | unsigned long state; /* transport state */ |
151 | unsigned char shutdown : 1, /* being shut down */ | 153 | unsigned char shutdown : 1, /* being shut down */ |
152 | resvport : 1; /* use a reserved port */ | 154 | resvport : 1; /* use a reserved port */ |
155 | unsigned int bind_index; /* bind function index */ | ||
153 | 156 | ||
154 | /* | 157 | /* |
155 | * Connection of transports | 158 | * Connection of transports |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index bf99bd49f8ef..96868be9c211 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/notifier.h> | 8 | #include <linux/notifier.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/pm.h> | 10 | #include <linux/pm.h> |
11 | #include <linux/mm.h> | ||
11 | 12 | ||
12 | /* struct pbe is used for creating lists of pages that should be restored | 13 | /* struct pbe is used for creating lists of pages that should be restored |
13 | * atomically during the resume from disk, because the page frames they have | 14 | * atomically during the resume from disk, because the page frames they have |
@@ -23,36 +24,32 @@ struct pbe { | |||
23 | extern void drain_local_pages(void); | 24 | extern void drain_local_pages(void); |
24 | extern void mark_free_pages(struct zone *zone); | 25 | extern void mark_free_pages(struct zone *zone); |
25 | 26 | ||
26 | #ifdef CONFIG_PM | 27 | #if defined(CONFIG_PM) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) |
27 | /* kernel/power/swsusp.c */ | ||
28 | extern int software_suspend(void); | ||
29 | |||
30 | #if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) | ||
31 | extern int pm_prepare_console(void); | 28 | extern int pm_prepare_console(void); |
32 | extern void pm_restore_console(void); | 29 | extern void pm_restore_console(void); |
33 | #else | 30 | #else |
34 | static inline int pm_prepare_console(void) { return 0; } | 31 | static inline int pm_prepare_console(void) { return 0; } |
35 | static inline void pm_restore_console(void) {} | 32 | static inline void pm_restore_console(void) {} |
36 | #endif /* defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) */ | 33 | #endif |
34 | |||
35 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) | ||
36 | /* kernel/power/snapshot.c */ | ||
37 | extern void __init register_nosave_region(unsigned long, unsigned long); | ||
38 | extern int swsusp_page_is_forbidden(struct page *); | ||
39 | extern void swsusp_set_page_free(struct page *); | ||
40 | extern void swsusp_unset_page_free(struct page *); | ||
41 | extern unsigned long get_safe_page(gfp_t gfp_mask); | ||
37 | #else | 42 | #else |
38 | static inline int software_suspend(void) | 43 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} |
39 | { | 44 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
40 | printk("Warning: fake suspend called\n"); | 45 | static inline void swsusp_set_page_free(struct page *p) {} |
41 | return -ENOSYS; | 46 | static inline void swsusp_unset_page_free(struct page *p) {} |
42 | } | 47 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ |
43 | #endif /* CONFIG_PM */ | ||
44 | 48 | ||
45 | void save_processor_state(void); | 49 | void save_processor_state(void); |
46 | void restore_processor_state(void); | 50 | void restore_processor_state(void); |
47 | struct saved_context; | 51 | struct saved_context; |
48 | void __save_processor_state(struct saved_context *ctxt); | 52 | void __save_processor_state(struct saved_context *ctxt); |
49 | void __restore_processor_state(struct saved_context *ctxt); | 53 | void __restore_processor_state(struct saved_context *ctxt); |
50 | unsigned long get_safe_page(gfp_t gfp_mask); | ||
51 | |||
52 | /* | ||
53 | * XXX: We try to keep some more pages free so that I/O operations succeed | ||
54 | * without paging. Might this be more? | ||
55 | */ | ||
56 | #define PAGES_FOR_IO 1024 | ||
57 | 54 | ||
58 | #endif /* _LINUX_SWSUSP_H */ | 55 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/tifm.h b/include/linux/tifm.h index 3deb0a6c1370..2a196982601f 100644 --- a/include/linux/tifm.h +++ b/include/linux/tifm.h | |||
@@ -14,16 +14,16 @@ | |||
14 | 14 | ||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/wait.h> | ||
18 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
19 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
20 | #include <linux/kthread.h> | 19 | #include <linux/workqueue.h> |
21 | 20 | ||
22 | /* Host registers (relative to pci base address): */ | 21 | /* Host registers (relative to pci base address): */ |
23 | enum { | 22 | enum { |
24 | FM_SET_INTERRUPT_ENABLE = 0x008, | 23 | FM_SET_INTERRUPT_ENABLE = 0x008, |
25 | FM_CLEAR_INTERRUPT_ENABLE = 0x00c, | 24 | FM_CLEAR_INTERRUPT_ENABLE = 0x00c, |
26 | FM_INTERRUPT_STATUS = 0x014 }; | 25 | FM_INTERRUPT_STATUS = 0x014 |
26 | }; | ||
27 | 27 | ||
28 | /* Socket registers (relative to socket base address): */ | 28 | /* Socket registers (relative to socket base address): */ |
29 | enum { | 29 | enum { |
@@ -58,14 +58,8 @@ enum { | |||
58 | SOCK_MS_DATA = 0x188, | 58 | SOCK_MS_DATA = 0x188, |
59 | SOCK_MS_STATUS = 0x18c, | 59 | SOCK_MS_STATUS = 0x18c, |
60 | SOCK_MS_SYSTEM = 0x190, | 60 | SOCK_MS_SYSTEM = 0x190, |
61 | SOCK_FIFO_ACCESS = 0x200 }; | 61 | SOCK_FIFO_ACCESS = 0x200 |
62 | 62 | }; | |
63 | |||
64 | #define TIFM_IRQ_ENABLE 0x80000000 | ||
65 | #define TIFM_IRQ_SOCKMASK(x) (x) | ||
66 | #define TIFM_IRQ_CARDMASK(x) ((x) << 8) | ||
67 | #define TIFM_IRQ_FIFOMASK(x) ((x) << 16) | ||
68 | #define TIFM_IRQ_SETALL 0xffffffff | ||
69 | 63 | ||
70 | #define TIFM_CTRL_LED 0x00000040 | 64 | #define TIFM_CTRL_LED 0x00000040 |
71 | #define TIFM_CTRL_FAST_CLK 0x00000100 | 65 | #define TIFM_CTRL_FAST_CLK 0x00000100 |
@@ -73,63 +67,76 @@ enum { | |||
73 | #define TIFM_SOCK_STATE_OCCUPIED 0x00000008 | 67 | #define TIFM_SOCK_STATE_OCCUPIED 0x00000008 |
74 | #define TIFM_SOCK_STATE_POWERED 0x00000080 | 68 | #define TIFM_SOCK_STATE_POWERED 0x00000080 |
75 | 69 | ||
76 | #define TIFM_FIFO_ENABLE 0x00000001 /* Meaning of this constant is unverified */ | 70 | #define TIFM_FIFO_ENABLE 0x00000001 |
71 | #define TIFM_FIFO_READY 0x00000001 | ||
77 | #define TIFM_FIFO_INT_SETALL 0x0000ffff | 72 | #define TIFM_FIFO_INT_SETALL 0x0000ffff |
78 | #define TIFM_FIFO_INTMASK 0x00000005 /* Meaning of this constant is unverified */ | 73 | #define TIFM_FIFO_INTMASK 0x00000005 |
74 | |||
75 | #define TIFM_DMA_RESET 0x00000002 | ||
76 | #define TIFM_DMA_TX 0x00008000 | ||
77 | #define TIFM_DMA_EN 0x00000001 | ||
78 | #define TIFM_DMA_TSIZE 0x0000007f | ||
79 | 79 | ||
80 | #define TIFM_DMA_RESET 0x00000002 /* Meaning of this constant is unverified */ | 80 | #define TIFM_TYPE_XD 1 |
81 | #define TIFM_DMA_TX 0x00008000 /* Meaning of this constant is unverified */ | 81 | #define TIFM_TYPE_MS 2 |
82 | #define TIFM_DMA_EN 0x00000001 /* Meaning of this constant is unverified */ | 82 | #define TIFM_TYPE_SD 3 |
83 | 83 | ||
84 | typedef enum {FM_NULL = 0, FM_XD = 0x01, FM_MS = 0x02, FM_SD = 0x03} tifm_media_id; | 84 | struct tifm_device_id { |
85 | unsigned char type; | ||
86 | }; | ||
85 | 87 | ||
86 | struct tifm_driver; | 88 | struct tifm_driver; |
87 | struct tifm_dev { | 89 | struct tifm_dev { |
88 | char __iomem *addr; | 90 | char __iomem *addr; |
89 | spinlock_t lock; | 91 | spinlock_t lock; |
90 | tifm_media_id media_id; | 92 | unsigned char type; |
91 | unsigned int socket_id; | 93 | unsigned int socket_id; |
92 | 94 | ||
93 | void (*signal_irq)(struct tifm_dev *sock, | 95 | void (*card_event)(struct tifm_dev *sock); |
94 | unsigned int sock_irq_status); | 96 | void (*data_event)(struct tifm_dev *sock); |
95 | 97 | ||
96 | struct tifm_driver *drv; | 98 | struct device dev; |
97 | struct device dev; | ||
98 | }; | 99 | }; |
99 | 100 | ||
100 | struct tifm_driver { | 101 | struct tifm_driver { |
101 | tifm_media_id *id_table; | 102 | struct tifm_device_id *id_table; |
102 | int (*probe)(struct tifm_dev *dev); | 103 | int (*probe)(struct tifm_dev *dev); |
103 | void (*remove)(struct tifm_dev *dev); | 104 | void (*remove)(struct tifm_dev *dev); |
104 | int (*suspend)(struct tifm_dev *dev, | 105 | int (*suspend)(struct tifm_dev *dev, |
105 | pm_message_t state); | 106 | pm_message_t state); |
106 | int (*resume)(struct tifm_dev *dev); | 107 | int (*resume)(struct tifm_dev *dev); |
107 | 108 | ||
108 | struct device_driver driver; | 109 | struct device_driver driver; |
109 | }; | 110 | }; |
110 | 111 | ||
111 | struct tifm_adapter { | 112 | struct tifm_adapter { |
112 | char __iomem *addr; | 113 | char __iomem *addr; |
113 | spinlock_t lock; | 114 | spinlock_t lock; |
114 | unsigned int irq_status; | 115 | unsigned int irq_status; |
115 | unsigned int socket_change_set; | 116 | unsigned int socket_change_set; |
116 | wait_queue_head_t change_set_notify; | 117 | unsigned int id; |
117 | unsigned int id; | 118 | unsigned int num_sockets; |
118 | unsigned int num_sockets; | 119 | struct completion *finish_me; |
119 | struct tifm_dev **sockets; | 120 | |
120 | struct task_struct *media_switcher; | 121 | struct work_struct media_switcher; |
121 | struct class_device cdev; | 122 | struct class_device cdev; |
122 | struct device *dev; | 123 | |
123 | 124 | void (*eject)(struct tifm_adapter *fm, | |
124 | void (*eject)(struct tifm_adapter *fm, struct tifm_dev *sock); | 125 | struct tifm_dev *sock); |
126 | |||
127 | struct tifm_dev *sockets[0]; | ||
125 | }; | 128 | }; |
126 | 129 | ||
127 | struct tifm_adapter *tifm_alloc_adapter(void); | 130 | struct tifm_adapter *tifm_alloc_adapter(unsigned int num_sockets, |
128 | void tifm_free_device(struct device *dev); | 131 | struct device *dev); |
129 | void tifm_free_adapter(struct tifm_adapter *fm); | 132 | int tifm_add_adapter(struct tifm_adapter *fm); |
130 | int tifm_add_adapter(struct tifm_adapter *fm, int (*mediathreadfn)(void *data)); | ||
131 | void tifm_remove_adapter(struct tifm_adapter *fm); | 133 | void tifm_remove_adapter(struct tifm_adapter *fm); |
132 | struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm); | 134 | void tifm_free_adapter(struct tifm_adapter *fm); |
135 | |||
136 | void tifm_free_device(struct device *dev); | ||
137 | struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, | ||
138 | unsigned char type); | ||
139 | |||
133 | int tifm_register_driver(struct tifm_driver *drv); | 140 | int tifm_register_driver(struct tifm_driver *drv); |
134 | void tifm_unregister_driver(struct tifm_driver *drv); | 141 | void tifm_unregister_driver(struct tifm_driver *drv); |
135 | void tifm_eject(struct tifm_dev *sock); | 142 | void tifm_eject(struct tifm_dev *sock); |
@@ -137,11 +144,11 @@ int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, | |||
137 | int direction); | 144 | int direction); |
138 | void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, | 145 | void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, |
139 | int direction); | 146 | int direction); |
140 | 147 | void tifm_queue_work(struct work_struct *work); | |
141 | 148 | ||
142 | static inline void *tifm_get_drvdata(struct tifm_dev *dev) | 149 | static inline void *tifm_get_drvdata(struct tifm_dev *dev) |
143 | { | 150 | { |
144 | return dev_get_drvdata(&dev->dev); | 151 | return dev_get_drvdata(&dev->dev); |
145 | } | 152 | } |
146 | 153 | ||
147 | static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data) | 154 | static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data) |
@@ -149,8 +156,4 @@ static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data) | |||
149 | dev_set_drvdata(&dev->dev, data); | 156 | dev_set_drvdata(&dev->dev, data); |
150 | } | 157 | } |
151 | 158 | ||
152 | struct tifm_device_id { | ||
153 | tifm_media_id media_id; | ||
154 | }; | ||
155 | |||
156 | #endif | 159 | #endif |
diff --git a/include/linux/usb_sl811.h b/include/linux/usb_sl811.h new file mode 100644 index 000000000000..4f2d012d7309 --- /dev/null +++ b/include/linux/usb_sl811.h | |||
@@ -0,0 +1,26 @@ | |||
1 | |||
2 | /* | ||
3 | * board initialization should put one of these into dev->platform_data | ||
4 | * and place the sl811hs onto platform_bus named "sl811-hcd". | ||
5 | */ | ||
6 | |||
7 | struct sl811_platform_data { | ||
8 | unsigned can_wakeup:1; | ||
9 | |||
10 | /* given port_power, msec/2 after power on till power good */ | ||
11 | u8 potpg; | ||
12 | |||
13 | /* mA/2 power supplied on this port (max = default = 250) */ | ||
14 | u8 power; | ||
15 | |||
16 | /* sl811 relies on an external source of VBUS current */ | ||
17 | void (*port_power)(struct device *dev, int is_on); | ||
18 | |||
19 | /* pulse sl811 nRST (probably with a GPIO) */ | ||
20 | void (*reset)(struct device *dev); | ||
21 | |||
22 | // some boards need something like these: | ||
23 | // int (*check_overcurrent)(struct device *dev); | ||
24 | // void (*clock_enable)(struct device *dev, int is_on); | ||
25 | }; | ||
26 | |||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 0c78f7f4a976..daa6c125f66e 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -59,6 +59,8 @@ struct writeback_control { | |||
59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
60 | unsigned for_writepages:1; /* This is a writepages() call */ | 60 | unsigned for_writepages:1; /* This is a writepages() call */ |
61 | unsigned range_cyclic:1; /* range_start is cyclic */ | 61 | unsigned range_cyclic:1; /* range_start is cyclic */ |
62 | |||
63 | void *fs_private; /* For use by ->writepages() */ | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | /* | 66 | /* |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index a5d53e0fe152..b58adc52448d 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -243,17 +243,6 @@ enum xfrm_ae_ftype_t { | |||
243 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) | 243 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) |
244 | }; | 244 | }; |
245 | 245 | ||
246 | /* SAD Table filter flags */ | ||
247 | enum xfrm_sad_ftype_t { | ||
248 | XFRM_SAD_UNSPEC, | ||
249 | XFRM_SAD_HMASK=1, | ||
250 | XFRM_SAD_HMAX=2, | ||
251 | XFRM_SAD_CNT=4, | ||
252 | __XFRM_SAD_MAX | ||
253 | |||
254 | #define XFRM_SAD_MAX (__XFRM_SAD_MAX - 1) | ||
255 | }; | ||
256 | |||
257 | struct xfrm_userpolicy_type { | 246 | struct xfrm_userpolicy_type { |
258 | __u8 type; | 247 | __u8 type; |
259 | __u16 reserved1; | 248 | __u16 reserved1; |
@@ -287,44 +276,41 @@ enum xfrm_attr_type_t { | |||
287 | 276 | ||
288 | enum xfrm_sadattr_type_t { | 277 | enum xfrm_sadattr_type_t { |
289 | XFRMA_SAD_UNSPEC, | 278 | XFRMA_SAD_UNSPEC, |
290 | XFRMA_SADHMASK, | 279 | XFRMA_SAD_CNT, |
291 | XFRMA_SADHMAX, | 280 | XFRMA_SAD_HINFO, |
292 | XFRMA_SADCNT, | ||
293 | __XFRMA_SAD_MAX | 281 | __XFRMA_SAD_MAX |
294 | 282 | ||
295 | #define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1) | 283 | #define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1) |
296 | }; | 284 | }; |
297 | 285 | ||
298 | /* SPD Table filter flags */ | 286 | struct xfrmu_sadhinfo { |
299 | enum xfrm_spd_ftype_t { | 287 | __u32 sadhcnt; /* current hash bkts */ |
300 | XFRM_SPD_UNSPEC, | 288 | __u32 sadhmcnt; /* max allowed hash bkts */ |
301 | XFRM_SPD_HMASK=1, | ||
302 | XFRM_SPD_HMAX=2, | ||
303 | XFRM_SPD_ICNT=4, | ||
304 | XFRM_SPD_OCNT=8, | ||
305 | XFRM_SPD_FCNT=16, | ||
306 | XFRM_SPD_ISCNT=32, | ||
307 | XFRM_SPD_OSCNT=64, | ||
308 | XFRM_SPD_FSCNT=128, | ||
309 | __XFRM_SPD_MAX | ||
310 | |||
311 | #define XFRM_SPD_MAX (__XFRM_SPD_MAX - 1) | ||
312 | }; | 289 | }; |
290 | |||
313 | enum xfrm_spdattr_type_t { | 291 | enum xfrm_spdattr_type_t { |
314 | XFRMA_SPD_UNSPEC, | 292 | XFRMA_SPD_UNSPEC, |
315 | XFRMA_SPDHMASK, | 293 | XFRMA_SPD_INFO, |
316 | XFRMA_SPDHMAX, | 294 | XFRMA_SPD_HINFO, |
317 | XFRMA_SPDICNT, | ||
318 | XFRMA_SPDOCNT, | ||
319 | XFRMA_SPDFCNT, | ||
320 | XFRMA_SPDISCNT, | ||
321 | XFRMA_SPDOSCNT, | ||
322 | XFRMA_SPDFSCNT, | ||
323 | __XFRMA_SPD_MAX | 295 | __XFRMA_SPD_MAX |
324 | 296 | ||
325 | #define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1) | 297 | #define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1) |
326 | }; | 298 | }; |
327 | 299 | ||
300 | struct xfrmu_spdinfo { | ||
301 | __u32 incnt; | ||
302 | __u32 outcnt; | ||
303 | __u32 fwdcnt; | ||
304 | __u32 inscnt; | ||
305 | __u32 outscnt; | ||
306 | __u32 fwdscnt; | ||
307 | }; | ||
308 | |||
309 | struct xfrmu_spdhinfo { | ||
310 | __u32 spdhcnt; | ||
311 | __u32 spdhmcnt; | ||
312 | }; | ||
313 | |||
328 | struct xfrm_usersa_info { | 314 | struct xfrm_usersa_info { |
329 | struct xfrm_selector sel; | 315 | struct xfrm_selector sel; |
330 | struct xfrm_id id; | 316 | struct xfrm_id id; |