diff options
Diffstat (limited to 'include')
84 files changed, 1455 insertions, 607 deletions
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h index 50764550a60c..bcbab3e4a3be 100644 --- a/include/asm-generic/audit_change_attr.h +++ b/include/asm-generic/audit_change_attr.h | |||
@@ -20,3 +20,7 @@ __NR_chown32, | |||
20 | __NR_fchown32, | 20 | __NR_fchown32, |
21 | __NR_lchown32, | 21 | __NR_lchown32, |
22 | #endif | 22 | #endif |
23 | __NR_link, | ||
24 | #ifdef __NR_linkat | ||
25 | __NR_linkat, | ||
26 | #endif | ||
diff --git a/include/asm-generic/stat.h b/include/asm-generic/stat.h index 47e64170305d..bd8cad21998e 100644 --- a/include/asm-generic/stat.h +++ b/include/asm-generic/stat.h | |||
@@ -33,18 +33,18 @@ struct stat { | |||
33 | int st_blksize; /* Optimal block size for I/O. */ | 33 | int st_blksize; /* Optimal block size for I/O. */ |
34 | int __pad2; | 34 | int __pad2; |
35 | long st_blocks; /* Number 512-byte blocks allocated. */ | 35 | long st_blocks; /* Number 512-byte blocks allocated. */ |
36 | int st_atime; /* Time of last access. */ | 36 | long st_atime; /* Time of last access. */ |
37 | unsigned int st_atime_nsec; | 37 | unsigned long st_atime_nsec; |
38 | int st_mtime; /* Time of last modification. */ | 38 | long st_mtime; /* Time of last modification. */ |
39 | unsigned int st_mtime_nsec; | 39 | unsigned long st_mtime_nsec; |
40 | int st_ctime; /* Time of last status change. */ | 40 | long st_ctime; /* Time of last status change. */ |
41 | unsigned int st_ctime_nsec; | 41 | unsigned long st_ctime_nsec; |
42 | unsigned int __unused4; | 42 | unsigned int __unused4; |
43 | unsigned int __unused5; | 43 | unsigned int __unused5; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #if __BITS_PER_LONG != 64 | ||
47 | /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ | 46 | /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ |
47 | #if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64) | ||
48 | struct stat64 { | 48 | struct stat64 { |
49 | unsigned long long st_dev; /* Device. */ | 49 | unsigned long long st_dev; /* Device. */ |
50 | unsigned long long st_ino; /* File serial number. */ | 50 | unsigned long long st_ino; /* File serial number. */ |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 5afa5b52063e..beafc156a535 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -432,6 +432,10 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); | |||
432 | * together with the @destroy function, | 432 | * together with the @destroy function, |
433 | * enables driver-specific objects derived from a ttm_buffer_object. | 433 | * enables driver-specific objects derived from a ttm_buffer_object. |
434 | * On successful return, the object kref and list_kref are set to 1. | 434 | * On successful return, the object kref and list_kref are set to 1. |
435 | * If a failure occurs, the function will call the @destroy function, or | ||
436 | * kfree() if @destroy is NULL. Thus, after a failure, dereferencing @bo is | ||
437 | * illegal and will likely cause memory corruption. | ||
438 | * | ||
435 | * Returns | 439 | * Returns |
436 | * -ENOMEM: Out of memory. | 440 | * -ENOMEM: Out of memory. |
437 | * -EINVAL: Invalid placement flags. | 441 | * -EINVAL: Invalid placement flags. |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index d01b4ddbdc56..8e0c848326b6 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -206,14 +206,84 @@ struct ttm_tt { | |||
206 | struct ttm_mem_type_manager; | 206 | struct ttm_mem_type_manager; |
207 | 207 | ||
208 | struct ttm_mem_type_manager_func { | 208 | struct ttm_mem_type_manager_func { |
209 | /** | ||
210 | * struct ttm_mem_type_manager member init | ||
211 | * | ||
212 | * @man: Pointer to a memory type manager. | ||
213 | * @p_size: Implementation dependent, but typically the size of the | ||
214 | * range to be managed in pages. | ||
215 | * | ||
216 | * Called to initialize a private range manager. The function is | ||
217 | * expected to initialize the man::priv member. | ||
218 | * Returns 0 on success, negative error code on failure. | ||
219 | */ | ||
209 | int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size); | 220 | int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size); |
221 | |||
222 | /** | ||
223 | * struct ttm_mem_type_manager member takedown | ||
224 | * | ||
225 | * @man: Pointer to a memory type manager. | ||
226 | * | ||
227 | * Called to undo the setup done in init. All allocated resources | ||
228 | * should be freed. | ||
229 | */ | ||
210 | int (*takedown)(struct ttm_mem_type_manager *man); | 230 | int (*takedown)(struct ttm_mem_type_manager *man); |
231 | |||
232 | /** | ||
233 | * struct ttm_mem_type_manager member get_node | ||
234 | * | ||
235 | * @man: Pointer to a memory type manager. | ||
236 | * @bo: Pointer to the buffer object we're allocating space for. | ||
237 | * @placement: Placement details. | ||
238 | * @mem: Pointer to a struct ttm_mem_reg to be filled in. | ||
239 | * | ||
240 | * This function should allocate space in the memory type managed | ||
241 | * by @man. Placement details if | ||
242 | * applicable are given by @placement. If successful, | ||
243 | * @mem::mm_node should be set to a non-null value, and | ||
244 | * @mem::start should be set to a value identifying the beginning | ||
245 | * of the range allocated, and the function should return zero. | ||
246 | * If the memory region accomodate the buffer object, @mem::mm_node | ||
247 | * should be set to NULL, and the function should return 0. | ||
248 | * If a system error occured, preventing the request to be fulfilled, | ||
249 | * the function should return a negative error code. | ||
250 | * | ||
251 | * Note that @mem::mm_node will only be dereferenced by | ||
252 | * struct ttm_mem_type_manager functions and optionally by the driver, | ||
253 | * which has knowledge of the underlying type. | ||
254 | * | ||
255 | * This function may not be called from within atomic context, so | ||
256 | * an implementation can and must use either a mutex or a spinlock to | ||
257 | * protect any data structures managing the space. | ||
258 | */ | ||
211 | int (*get_node)(struct ttm_mem_type_manager *man, | 259 | int (*get_node)(struct ttm_mem_type_manager *man, |
212 | struct ttm_buffer_object *bo, | 260 | struct ttm_buffer_object *bo, |
213 | struct ttm_placement *placement, | 261 | struct ttm_placement *placement, |
214 | struct ttm_mem_reg *mem); | 262 | struct ttm_mem_reg *mem); |
263 | |||
264 | /** | ||
265 | * struct ttm_mem_type_manager member put_node | ||
266 | * | ||
267 | * @man: Pointer to a memory type manager. | ||
268 | * @mem: Pointer to a struct ttm_mem_reg to be filled in. | ||
269 | * | ||
270 | * This function frees memory type resources previously allocated | ||
271 | * and that are identified by @mem::mm_node and @mem::start. May not | ||
272 | * be called from within atomic context. | ||
273 | */ | ||
215 | void (*put_node)(struct ttm_mem_type_manager *man, | 274 | void (*put_node)(struct ttm_mem_type_manager *man, |
216 | struct ttm_mem_reg *mem); | 275 | struct ttm_mem_reg *mem); |
276 | |||
277 | /** | ||
278 | * struct ttm_mem_type_manager member debug | ||
279 | * | ||
280 | * @man: Pointer to a memory type manager. | ||
281 | * @prefix: Prefix to be used in printout to identify the caller. | ||
282 | * | ||
283 | * This function is called to print out the state of the memory | ||
284 | * type manager to aid debugging of out-of-memory conditions. | ||
285 | * It may not be called from within atomic context. | ||
286 | */ | ||
217 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); | 287 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); |
218 | }; | 288 | }; |
219 | 289 | ||
@@ -231,14 +301,13 @@ struct ttm_mem_type_manager { | |||
231 | uint64_t size; | 301 | uint64_t size; |
232 | uint32_t available_caching; | 302 | uint32_t available_caching; |
233 | uint32_t default_caching; | 303 | uint32_t default_caching; |
304 | const struct ttm_mem_type_manager_func *func; | ||
305 | void *priv; | ||
234 | 306 | ||
235 | /* | 307 | /* |
236 | * Protected by the bdev->lru_lock. | 308 | * Protected by the global->lru_lock. |
237 | * TODO: Consider one lru_lock per ttm_mem_type_manager. | ||
238 | * Plays ill with list removal, though. | ||
239 | */ | 309 | */ |
240 | const struct ttm_mem_type_manager_func *func; | 310 | |
241 | void *priv; | ||
242 | struct list_head lru; | 311 | struct list_head lru; |
243 | }; | 312 | }; |
244 | 313 | ||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 90e3ed3a3144..97319a8fc1e0 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -118,6 +118,7 @@ header-y += eventpoll.h | |||
118 | header-y += ext2_fs.h | 118 | header-y += ext2_fs.h |
119 | header-y += fadvise.h | 119 | header-y += fadvise.h |
120 | header-y += falloc.h | 120 | header-y += falloc.h |
121 | header-y += fanotify.h | ||
121 | header-y += fb.h | 122 | header-y += fb.h |
122 | header-y += fcntl.h | 123 | header-y += fcntl.h |
123 | header-y += fd.h | 124 | header-y += fd.h |
diff --git a/include/linux/atomic.h b/include/linux/atomic.h new file mode 100644 index 000000000000..96c038e43d66 --- /dev/null +++ b/include/linux/atomic.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef _LINUX_ATOMIC_H | ||
2 | #define _LINUX_ATOMIC_H | ||
3 | #include <asm/atomic.h> | ||
4 | |||
5 | /** | ||
6 | * atomic_inc_not_zero_hint - increment if not null | ||
7 | * @v: pointer of type atomic_t | ||
8 | * @hint: probable value of the atomic before the increment | ||
9 | * | ||
10 | * This version of atomic_inc_not_zero() gives a hint of probable | ||
11 | * value of the atomic. This helps processor to not read the memory | ||
12 | * before doing the atomic read/modify/write cycle, lowering | ||
13 | * number of bus transactions on some arches. | ||
14 | * | ||
15 | * Returns: 0 if increment was not done, 1 otherwise. | ||
16 | */ | ||
17 | #ifndef atomic_inc_not_zero_hint | ||
18 | static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint) | ||
19 | { | ||
20 | int val, c = hint; | ||
21 | |||
22 | /* sanity test, should be removed by compiler if hint is a constant */ | ||
23 | if (!hint) | ||
24 | return atomic_inc_not_zero(v); | ||
25 | |||
26 | do { | ||
27 | val = atomic_cmpxchg(v, c, c + 1); | ||
28 | if (val == c) | ||
29 | return 1; | ||
30 | c = val; | ||
31 | } while (c); | ||
32 | |||
33 | return 0; | ||
34 | } | ||
35 | #endif | ||
36 | |||
37 | #endif /* _LINUX_ATOMIC_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index e24afabc548f..8b5c0620abf9 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -102,6 +102,7 @@ | |||
102 | #define AUDIT_EOE 1320 /* End of multi-record event */ | 102 | #define AUDIT_EOE 1320 /* End of multi-record event */ |
103 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ | 103 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ |
104 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ | 104 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ |
105 | #define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */ | ||
105 | 106 | ||
106 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 107 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
107 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 108 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -478,6 +479,7 @@ extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
478 | const struct cred *new, | 479 | const struct cred *new, |
479 | const struct cred *old); | 480 | const struct cred *old); |
480 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 481 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); |
482 | extern void __audit_mmap_fd(int fd, int flags); | ||
481 | 483 | ||
482 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 484 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
483 | { | 485 | { |
@@ -531,6 +533,12 @@ static inline void audit_log_capset(pid_t pid, const struct cred *new, | |||
531 | __audit_log_capset(pid, new, old); | 533 | __audit_log_capset(pid, new, old); |
532 | } | 534 | } |
533 | 535 | ||
536 | static inline void audit_mmap_fd(int fd, int flags) | ||
537 | { | ||
538 | if (unlikely(!audit_dummy_context())) | ||
539 | __audit_mmap_fd(fd, flags); | ||
540 | } | ||
541 | |||
534 | extern int audit_n_rules; | 542 | extern int audit_n_rules; |
535 | extern int audit_signals; | 543 | extern int audit_signals; |
536 | #else | 544 | #else |
@@ -564,6 +572,7 @@ extern int audit_signals; | |||
564 | #define audit_mq_getsetattr(d,s) ((void)0) | 572 | #define audit_mq_getsetattr(d,s) ((void)0) |
565 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | 573 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) |
566 | #define audit_log_capset(pid, ncr, ocr) ((void)0) | 574 | #define audit_log_capset(pid, ncr, ocr) ((void)0) |
575 | #define audit_mmap_fd(fd, flags) ((void)0) | ||
567 | #define audit_ptrace(t) ((void)0) | 576 | #define audit_ptrace(t) ((void)0) |
568 | #define audit_n_rules 0 | 577 | #define audit_n_rules 0 |
569 | #define audit_signals 0 | 578 | #define audit_signals 0 |
diff --git a/include/linux/bio.h b/include/linux/bio.h index ba679992d39b..35dcdb3589bc 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -66,10 +66,6 @@ | |||
66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
69 | #define bio_empty_barrier(bio) \ | ||
70 | ((bio->bi_rw & REQ_HARDBARRIER) && \ | ||
71 | !bio_has_data(bio) && \ | ||
72 | !(bio->bi_rw & REQ_DISCARD)) | ||
73 | 69 | ||
74 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 70 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
75 | { | 71 | { |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 0437ab6bb54c..46ad5197537a 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -122,7 +122,6 @@ enum rq_flag_bits { | |||
122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | 122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | 123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
124 | 124 | ||
125 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
126 | __REQ_SYNC, /* request is sync (sync write or read) */ | 125 | __REQ_SYNC, /* request is sync (sync write or read) */ |
127 | __REQ_META, /* metadata io request */ | 126 | __REQ_META, /* metadata io request */ |
128 | __REQ_DISCARD, /* request to discard sectors */ | 127 | __REQ_DISCARD, /* request to discard sectors */ |
@@ -159,7 +158,6 @@ enum rq_flag_bits { | |||
159 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) | 158 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) |
160 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) | 159 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) |
161 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) | 160 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) |
162 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
163 | #define REQ_SYNC (1 << __REQ_SYNC) | 161 | #define REQ_SYNC (1 << __REQ_SYNC) |
164 | #define REQ_META (1 << __REQ_META) | 162 | #define REQ_META (1 << __REQ_META) |
165 | #define REQ_DISCARD (1 << __REQ_DISCARD) | 163 | #define REQ_DISCARD (1 << __REQ_DISCARD) |
@@ -168,8 +166,8 @@ enum rq_flag_bits { | |||
168 | #define REQ_FAILFAST_MASK \ | 166 | #define REQ_FAILFAST_MASK \ |
169 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) | 167 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) |
170 | #define REQ_COMMON_MASK \ | 168 | #define REQ_COMMON_MASK \ |
171 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ | 169 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ |
172 | REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 170 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
173 | #define REQ_CLONE_MASK REQ_COMMON_MASK | 171 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
174 | 172 | ||
175 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | 173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5027a599077d..aae86fd10c4f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -552,8 +552,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync) | |||
552 | * it already be started by driver. | 552 | * it already be started by driver. |
553 | */ | 553 | */ |
554 | #define RQ_NOMERGE_FLAGS \ | 554 | #define RQ_NOMERGE_FLAGS \ |
555 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \ | 555 | (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) |
556 | REQ_FLUSH | REQ_FUA) | ||
557 | #define rq_mergeable(rq) \ | 556 | #define rq_mergeable(rq) \ |
558 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ | 557 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
559 | (((rq)->cmd_flags & REQ_DISCARD) || \ | 558 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 7187bd8a75f6..749f01ccd26e 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -462,7 +462,8 @@ struct dccp_ackvec; | |||
462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking | 462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking |
463 | * @dccps_hc_tx_insert_options - sender wants to add options when sending | 463 | * @dccps_hc_tx_insert_options - sender wants to add options when sending |
464 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) | 464 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) |
465 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 465 | * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets |
466 | * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) | ||
466 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | 467 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) |
467 | */ | 468 | */ |
468 | struct dccp_sock { | 469 | struct dccp_sock { |
@@ -502,6 +503,7 @@ struct dccp_sock { | |||
502 | __u8 dccps_hc_rx_insert_options:1; | 503 | __u8 dccps_hc_rx_insert_options:1; |
503 | __u8 dccps_hc_tx_insert_options:1; | 504 | __u8 dccps_hc_tx_insert_options:1; |
504 | __u8 dccps_server_timewait:1; | 505 | __u8 dccps_server_timewait:1; |
506 | struct tasklet_struct dccps_xmitlet; | ||
505 | struct timer_list dccps_xmit_timer; | 507 | struct timer_list dccps_xmit_timer; |
506 | }; | 508 | }; |
507 | 509 | ||
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 9b2a0158f399..ef44c7a0638c 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.9rc2" | 56 | #define REL_VERSION "8.3.9" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 95 | 59 | #define PRO_VERSION_MAX 95 |
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h index 63531a6b4d2a..0f0121467fc4 100644 --- a/include/linux/fanotify.h +++ b/include/linux/fanotify.h | |||
@@ -6,18 +6,19 @@ | |||
6 | /* the following events that user-space can register for */ | 6 | /* the following events that user-space can register for */ |
7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ | 7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ |
8 | #define FAN_MODIFY 0x00000002 /* File was modified */ | 8 | #define FAN_MODIFY 0x00000002 /* File was modified */ |
9 | #define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */ | 9 | #define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */ |
10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */ | 10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ |
11 | #define FAN_OPEN 0x00000020 /* File was opened */ | 11 | #define FAN_OPEN 0x00000020 /* File was opened */ |
12 | 12 | ||
13 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
14 | |||
15 | /* FIXME currently Q's have no limit.... */ | ||
16 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | 13 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ |
17 | 14 | ||
18 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ | 15 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ |
19 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ | 16 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ |
20 | 17 | ||
18 | #define FAN_ONDIR 0x40000000 /* event occurred against dir */ | ||
19 | |||
20 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
21 | |||
21 | /* helper events */ | 22 | /* helper events */ |
22 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ | 23 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ |
23 | 24 | ||
@@ -25,7 +26,19 @@ | |||
25 | #define FAN_CLOEXEC 0x00000001 | 26 | #define FAN_CLOEXEC 0x00000001 |
26 | #define FAN_NONBLOCK 0x00000002 | 27 | #define FAN_NONBLOCK 0x00000002 |
27 | 28 | ||
28 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK) | 29 | /* These are NOT bitwise flags. Both bits are used togther. */ |
30 | #define FAN_CLASS_NOTIF 0x00000000 | ||
31 | #define FAN_CLASS_CONTENT 0x00000004 | ||
32 | #define FAN_CLASS_PRE_CONTENT 0x00000008 | ||
33 | #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ | ||
34 | FAN_CLASS_PRE_CONTENT) | ||
35 | |||
36 | #define FAN_UNLIMITED_QUEUE 0x00000010 | ||
37 | #define FAN_UNLIMITED_MARKS 0x00000020 | ||
38 | |||
39 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ | ||
40 | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ | ||
41 | FAN_UNLIMITED_MARKS) | ||
29 | 42 | ||
30 | /* flags used for fanotify_modify_mark() */ | 43 | /* flags used for fanotify_modify_mark() */ |
31 | #define FAN_MARK_ADD 0x00000001 | 44 | #define FAN_MARK_ADD 0x00000001 |
@@ -36,6 +49,10 @@ | |||
36 | #define FAN_MARK_IGNORED_MASK 0x00000020 | 49 | #define FAN_MARK_IGNORED_MASK 0x00000020 |
37 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 | 50 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 |
38 | #define FAN_MARK_FLUSH 0x00000080 | 51 | #define FAN_MARK_FLUSH 0x00000080 |
52 | #ifdef __KERNEL__ | ||
53 | /* not valid from userspace, only kernel internal */ | ||
54 | #define FAN_MARK_ONDIR 0x00000100 | ||
55 | #endif | ||
39 | 56 | ||
40 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ | 57 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ |
41 | FAN_MARK_REMOVE |\ | 58 | FAN_MARK_REMOVE |\ |
@@ -43,7 +60,8 @@ | |||
43 | FAN_MARK_ONLYDIR |\ | 60 | FAN_MARK_ONLYDIR |\ |
44 | FAN_MARK_MOUNT |\ | 61 | FAN_MARK_MOUNT |\ |
45 | FAN_MARK_IGNORED_MASK |\ | 62 | FAN_MARK_IGNORED_MASK |\ |
46 | FAN_MARK_IGNORED_SURV_MODIFY) | 63 | FAN_MARK_IGNORED_SURV_MODIFY |\ |
64 | FAN_MARK_FLUSH) | ||
47 | 65 | ||
48 | /* | 66 | /* |
49 | * All of the events - we build the list by hand so that we can add flags in | 67 | * All of the events - we build the list by hand so that we can add flags in |
@@ -70,10 +88,10 @@ | |||
70 | struct fanotify_event_metadata { | 88 | struct fanotify_event_metadata { |
71 | __u32 event_len; | 89 | __u32 event_len; |
72 | __u32 vers; | 90 | __u32 vers; |
73 | __u64 mask; | 91 | __aligned_u64 mask; |
74 | __s32 fd; | 92 | __s32 fd; |
75 | __s32 pid; | 93 | __s32 pid; |
76 | } __attribute__ ((packed)); | 94 | }; |
77 | 95 | ||
78 | struct fanotify_response { | 96 | struct fanotify_response { |
79 | __s32 fd; | 97 | __s32 fd; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1c73b50e81ff..334d68a17108 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1056,7 +1056,6 @@ struct lock_manager_operations { | |||
1056 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 1056 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); |
1057 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 1057 | void (*fl_notify)(struct file_lock *); /* unblock callback */ |
1058 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1058 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
1059 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | ||
1060 | void (*fl_release_private)(struct file_lock *); | 1059 | void (*fl_release_private)(struct file_lock *); |
1061 | void (*fl_break)(struct file_lock *); | 1060 | void (*fl_break)(struct file_lock *); |
1062 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | 1061 | int (*fl_mylease)(struct file_lock *, struct file_lock *); |
@@ -1129,6 +1128,7 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
1129 | extern int fcntl_getlease(struct file *filp); | 1128 | extern int fcntl_getlease(struct file *filp); |
1130 | 1129 | ||
1131 | /* fs/locks.c */ | 1130 | /* fs/locks.c */ |
1131 | void locks_free_lock(struct file_lock *fl); | ||
1132 | extern void locks_init_lock(struct file_lock *); | 1132 | extern void locks_init_lock(struct file_lock *); |
1133 | extern struct file_lock * locks_alloc_lock(void); | 1133 | extern struct file_lock * locks_alloc_lock(void); |
1134 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 1134 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
@@ -1772,6 +1772,8 @@ struct file_system_type { | |||
1772 | int fs_flags; | 1772 | int fs_flags; |
1773 | int (*get_sb) (struct file_system_type *, int, | 1773 | int (*get_sb) (struct file_system_type *, int, |
1774 | const char *, void *, struct vfsmount *); | 1774 | const char *, void *, struct vfsmount *); |
1775 | struct dentry *(*mount) (struct file_system_type *, int, | ||
1776 | const char *, void *); | ||
1775 | void (*kill_sb) (struct super_block *); | 1777 | void (*kill_sb) (struct super_block *); |
1776 | struct module *owner; | 1778 | struct module *owner; |
1777 | struct file_system_type * next; | 1779 | struct file_system_type * next; |
@@ -1787,17 +1789,25 @@ struct file_system_type { | |||
1787 | struct lock_class_key i_alloc_sem_key; | 1789 | struct lock_class_key i_alloc_sem_key; |
1788 | }; | 1790 | }; |
1789 | 1791 | ||
1790 | extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, | 1792 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, |
1791 | int (*fill_super)(struct super_block *, void *, int), | 1793 | void *data, int (*fill_super)(struct super_block *, void *, int)); |
1792 | struct vfsmount *mnt); | 1794 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, |
1795 | int flags, const char *dev_name, void *data, | ||
1796 | int (*fill_super)(struct super_block *, void *, int)); | ||
1793 | extern int get_sb_bdev(struct file_system_type *fs_type, | 1797 | extern int get_sb_bdev(struct file_system_type *fs_type, |
1794 | int flags, const char *dev_name, void *data, | 1798 | int flags, const char *dev_name, void *data, |
1795 | int (*fill_super)(struct super_block *, void *, int), | 1799 | int (*fill_super)(struct super_block *, void *, int), |
1796 | struct vfsmount *mnt); | 1800 | struct vfsmount *mnt); |
1801 | extern struct dentry *mount_single(struct file_system_type *fs_type, | ||
1802 | int flags, void *data, | ||
1803 | int (*fill_super)(struct super_block *, void *, int)); | ||
1797 | extern int get_sb_single(struct file_system_type *fs_type, | 1804 | extern int get_sb_single(struct file_system_type *fs_type, |
1798 | int flags, void *data, | 1805 | int flags, void *data, |
1799 | int (*fill_super)(struct super_block *, void *, int), | 1806 | int (*fill_super)(struct super_block *, void *, int), |
1800 | struct vfsmount *mnt); | 1807 | struct vfsmount *mnt); |
1808 | extern struct dentry *mount_nodev(struct file_system_type *fs_type, | ||
1809 | int flags, void *data, | ||
1810 | int (*fill_super)(struct super_block *, void *, int)); | ||
1801 | extern int get_sb_nodev(struct file_system_type *fs_type, | 1811 | extern int get_sb_nodev(struct file_system_type *fs_type, |
1802 | int flags, void *data, | 1812 | int flags, void *data, |
1803 | int (*fill_super)(struct super_block *, void *, int), | 1813 | int (*fill_super)(struct super_block *, void *, int), |
@@ -1813,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type, | |||
1813 | int (*test)(struct super_block *,void *), | 1823 | int (*test)(struct super_block *,void *), |
1814 | int (*set)(struct super_block *,void *), | 1824 | int (*set)(struct super_block *,void *), |
1815 | void *data); | 1825 | void *data); |
1816 | extern int get_sb_pseudo(struct file_system_type *, char *, | 1826 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
1817 | const struct super_operations *ops, unsigned long, | 1827 | const struct super_operations *ops, unsigned long); |
1818 | struct vfsmount *mnt); | ||
1819 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1828 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1820 | 1829 | ||
1821 | static inline void sb_mark_dirty(struct super_block *sb) | 1830 | static inline void sb_mark_dirty(struct super_block *sb) |
@@ -1858,6 +1867,7 @@ extern int current_umask(void); | |||
1858 | /* /sys/fs */ | 1867 | /* /sys/fs */ |
1859 | extern struct kobject *fs_kobj; | 1868 | extern struct kobject *fs_kobj; |
1860 | 1869 | ||
1870 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | ||
1861 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | 1871 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); |
1862 | 1872 | ||
1863 | #define FLOCK_VERIFY_READ 1 | 1873 | #define FLOCK_VERIFY_READ 1 |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index fc295d7ea463..781d4671415f 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -54,7 +54,6 @@ struct aoi_display_offset { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 57 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
59 | 58 | ||
60 | #define MFB_SET_ALPHA 0x80014d00 | 59 | #define MFB_SET_ALPHA 0x80014d00 |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 59d0df43ff9d..5c185fa27089 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -26,12 +26,12 @@ static inline void fsnotify_d_instantiate(struct dentry *dentry, | |||
26 | } | 26 | } |
27 | 27 | ||
28 | /* Notify this dentry's parent about a child's events. */ | 28 | /* Notify this dentry's parent about a child's events. */ |
29 | static inline void fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 29 | static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
30 | { | 30 | { |
31 | if (!dentry) | 31 | if (!dentry) |
32 | dentry = path->dentry; | 32 | dentry = path->dentry; |
33 | 33 | ||
34 | __fsnotify_parent(path, dentry, mask); | 34 | return __fsnotify_parent(path, dentry, mask); |
35 | } | 35 | } |
36 | 36 | ||
37 | /* simple call site for access decisions */ | 37 | /* simple call site for access decisions */ |
@@ -40,6 +40,7 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
40 | struct path *path = &file->f_path; | 40 | struct path *path = &file->f_path; |
41 | struct inode *inode = path->dentry->d_inode; | 41 | struct inode *inode = path->dentry->d_inode; |
42 | __u32 fsnotify_mask = 0; | 42 | __u32 fsnotify_mask = 0; |
43 | int ret; | ||
43 | 44 | ||
44 | if (file->f_mode & FMODE_NONOTIFY) | 45 | if (file->f_mode & FMODE_NONOTIFY) |
45 | return 0; | 46 | return 0; |
@@ -52,6 +53,10 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
52 | else | 53 | else |
53 | BUG(); | 54 | BUG(); |
54 | 55 | ||
56 | ret = fsnotify_parent(path, NULL, fsnotify_mask); | ||
57 | if (ret) | ||
58 | return ret; | ||
59 | |||
55 | return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 60 | return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); |
56 | } | 61 | } |
57 | 62 | ||
@@ -93,8 +98,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
93 | old_dir_mask |= FS_DN_RENAME; | 98 | old_dir_mask |= FS_DN_RENAME; |
94 | 99 | ||
95 | if (isdir) { | 100 | if (isdir) { |
96 | old_dir_mask |= FS_IN_ISDIR; | 101 | old_dir_mask |= FS_ISDIR; |
97 | new_dir_mask |= FS_IN_ISDIR; | 102 | new_dir_mask |= FS_ISDIR; |
98 | } | 103 | } |
99 | 104 | ||
100 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); | 105 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); |
@@ -132,7 +137,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | |||
132 | __u32 mask = FS_DELETE; | 137 | __u32 mask = FS_DELETE; |
133 | 138 | ||
134 | if (isdir) | 139 | if (isdir) |
135 | mask |= FS_IN_ISDIR; | 140 | mask |= FS_ISDIR; |
136 | 141 | ||
137 | fsnotify_parent(NULL, dentry, mask); | 142 | fsnotify_parent(NULL, dentry, mask); |
138 | } | 143 | } |
@@ -174,7 +179,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct | |||
174 | */ | 179 | */ |
175 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | 180 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) |
176 | { | 181 | { |
177 | __u32 mask = (FS_CREATE | FS_IN_ISDIR); | 182 | __u32 mask = (FS_CREATE | FS_ISDIR); |
178 | struct inode *d_inode = dentry->d_inode; | 183 | struct inode *d_inode = dentry->d_inode; |
179 | 184 | ||
180 | audit_inode_child(dentry, inode); | 185 | audit_inode_child(dentry, inode); |
@@ -192,7 +197,7 @@ static inline void fsnotify_access(struct file *file) | |||
192 | __u32 mask = FS_ACCESS; | 197 | __u32 mask = FS_ACCESS; |
193 | 198 | ||
194 | if (S_ISDIR(inode->i_mode)) | 199 | if (S_ISDIR(inode->i_mode)) |
195 | mask |= FS_IN_ISDIR; | 200 | mask |= FS_ISDIR; |
196 | 201 | ||
197 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 202 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
198 | fsnotify_parent(path, NULL, mask); | 203 | fsnotify_parent(path, NULL, mask); |
@@ -210,7 +215,7 @@ static inline void fsnotify_modify(struct file *file) | |||
210 | __u32 mask = FS_MODIFY; | 215 | __u32 mask = FS_MODIFY; |
211 | 216 | ||
212 | if (S_ISDIR(inode->i_mode)) | 217 | if (S_ISDIR(inode->i_mode)) |
213 | mask |= FS_IN_ISDIR; | 218 | mask |= FS_ISDIR; |
214 | 219 | ||
215 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 220 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
216 | fsnotify_parent(path, NULL, mask); | 221 | fsnotify_parent(path, NULL, mask); |
@@ -228,12 +233,13 @@ static inline void fsnotify_open(struct file *file) | |||
228 | __u32 mask = FS_OPEN; | 233 | __u32 mask = FS_OPEN; |
229 | 234 | ||
230 | if (S_ISDIR(inode->i_mode)) | 235 | if (S_ISDIR(inode->i_mode)) |
231 | mask |= FS_IN_ISDIR; | 236 | mask |= FS_ISDIR; |
232 | 237 | ||
233 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 238 | /* FMODE_NONOTIFY must never be set from user */ |
234 | fsnotify_parent(path, NULL, mask); | 239 | file->f_mode &= ~FMODE_NONOTIFY; |
235 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 240 | |
236 | } | 241 | fsnotify_parent(path, NULL, mask); |
242 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | ||
237 | } | 243 | } |
238 | 244 | ||
239 | /* | 245 | /* |
@@ -247,7 +253,7 @@ static inline void fsnotify_close(struct file *file) | |||
247 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; | 253 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; |
248 | 254 | ||
249 | if (S_ISDIR(inode->i_mode)) | 255 | if (S_ISDIR(inode->i_mode)) |
250 | mask |= FS_IN_ISDIR; | 256 | mask |= FS_ISDIR; |
251 | 257 | ||
252 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 258 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
253 | fsnotify_parent(path, NULL, mask); | 259 | fsnotify_parent(path, NULL, mask); |
@@ -264,7 +270,7 @@ static inline void fsnotify_xattr(struct dentry *dentry) | |||
264 | __u32 mask = FS_ATTRIB; | 270 | __u32 mask = FS_ATTRIB; |
265 | 271 | ||
266 | if (S_ISDIR(inode->i_mode)) | 272 | if (S_ISDIR(inode->i_mode)) |
267 | mask |= FS_IN_ISDIR; | 273 | mask |= FS_ISDIR; |
268 | 274 | ||
269 | fsnotify_parent(NULL, dentry, mask); | 275 | fsnotify_parent(NULL, dentry, mask); |
270 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 276 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
@@ -299,7 +305,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) | |||
299 | 305 | ||
300 | if (mask) { | 306 | if (mask) { |
301 | if (S_ISDIR(inode->i_mode)) | 307 | if (S_ISDIR(inode->i_mode)) |
302 | mask |= FS_IN_ISDIR; | 308 | mask |= FS_ISDIR; |
303 | 309 | ||
304 | fsnotify_parent(NULL, dentry, mask); | 310 | fsnotify_parent(NULL, dentry, mask); |
305 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 311 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index e40190d16878..0a68f924f06f 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -45,7 +45,7 @@ | |||
45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ | 45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ |
46 | 46 | ||
47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ | 47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ |
48 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ | 48 | #define FS_ISDIR 0x40000000 /* event occurred against dir */ |
49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ | 49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ |
50 | 50 | ||
51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ | 51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ |
@@ -64,13 +64,15 @@ | |||
64 | 64 | ||
65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) | 65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) |
66 | 66 | ||
67 | #define ALL_FSNOTIFY_PERM_EVENTS (FS_OPEN_PERM | FS_ACCESS_PERM) | ||
68 | |||
67 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ | 69 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ |
68 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ | 70 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ |
69 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ | 71 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ |
70 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ | 72 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ |
71 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ | 73 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ |
72 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ | 74 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ |
73 | FS_IN_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ | 75 | FS_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ |
74 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) | 76 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) |
75 | 77 | ||
76 | struct fsnotify_group; | 78 | struct fsnotify_group; |
@@ -129,6 +131,14 @@ struct fsnotify_group { | |||
129 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ | 131 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ |
130 | unsigned int q_len; /* events on the queue */ | 132 | unsigned int q_len; /* events on the queue */ |
131 | unsigned int max_events; /* maximum events allowed on the list */ | 133 | unsigned int max_events; /* maximum events allowed on the list */ |
134 | /* | ||
135 | * Valid fsnotify group priorities. Events are send in order from highest | ||
136 | * priority to lowest priority. We default to the lowest priority. | ||
137 | */ | ||
138 | #define FS_PRIO_0 0 /* normal notifiers, no permissions */ | ||
139 | #define FS_PRIO_1 1 /* fanotify content based access control */ | ||
140 | #define FS_PRIO_2 2 /* fanotify pre-content access */ | ||
141 | unsigned int priority; | ||
132 | 142 | ||
133 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ | 143 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ |
134 | spinlock_t mark_lock; /* protect marks_list */ | 144 | spinlock_t mark_lock; /* protect marks_list */ |
@@ -159,6 +169,8 @@ struct fsnotify_group { | |||
159 | bool bypass_perm; /* protected by access_mutex */ | 169 | bool bypass_perm; /* protected by access_mutex */ |
160 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | 170 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ |
161 | int f_flags; | 171 | int f_flags; |
172 | unsigned int max_marks; | ||
173 | struct user_struct *user; | ||
162 | } fanotify_data; | 174 | } fanotify_data; |
163 | #endif /* CONFIG_FANOTIFY */ | 175 | #endif /* CONFIG_FANOTIFY */ |
164 | }; | 176 | }; |
@@ -275,8 +287,8 @@ struct fsnotify_mark { | |||
275 | struct fsnotify_inode_mark i; | 287 | struct fsnotify_inode_mark i; |
276 | struct fsnotify_vfsmount_mark m; | 288 | struct fsnotify_vfsmount_mark m; |
277 | }; | 289 | }; |
278 | __u32 ignored_mask; /* events types to ignore */ | ||
279 | struct list_head free_g_list; /* tmp list used when freeing this mark */ | 290 | struct list_head free_g_list; /* tmp list used when freeing this mark */ |
291 | __u32 ignored_mask; /* events types to ignore */ | ||
280 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 | 292 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 |
281 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 | 293 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 |
282 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 | 294 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 |
@@ -294,7 +306,7 @@ struct fsnotify_mark { | |||
294 | /* main fsnotify call to send events */ | 306 | /* main fsnotify call to send events */ |
295 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 307 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
296 | const unsigned char *name, u32 cookie); | 308 | const unsigned char *name, u32 cookie); |
297 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); | 309 | extern int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); |
298 | extern void __fsnotify_inode_delete(struct inode *inode); | 310 | extern void __fsnotify_inode_delete(struct inode *inode); |
299 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | 311 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); |
300 | extern u32 fsnotify_get_cookie(void); | 312 | extern u32 fsnotify_get_cookie(void); |
@@ -423,8 +435,10 @@ static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int da | |||
423 | return 0; | 435 | return 0; |
424 | } | 436 | } |
425 | 437 | ||
426 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 438 | static inline int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
427 | {} | 439 | { |
440 | return 0; | ||
441 | } | ||
428 | 442 | ||
429 | static inline void __fsnotify_inode_delete(struct inode *inode) | 443 | static inline void __fsnotify_inode_delete(struct inode *inode) |
430 | {} | 444 | {} |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 8a389b608ce3..41cb31f14ee3 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -96,11 +96,15 @@ | |||
96 | */ | 96 | */ |
97 | #define in_nmi() (preempt_count() & NMI_MASK) | 97 | #define in_nmi() (preempt_count() & NMI_MASK) |
98 | 98 | ||
99 | #if defined(CONFIG_PREEMPT) | 99 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) |
100 | # define PREEMPT_INATOMIC_BASE kernel_locked() | 100 | # define PREEMPT_INATOMIC_BASE kernel_locked() |
101 | # define PREEMPT_CHECK_OFFSET 1 | ||
102 | #else | 101 | #else |
103 | # define PREEMPT_INATOMIC_BASE 0 | 102 | # define PREEMPT_INATOMIC_BASE 0 |
103 | #endif | ||
104 | |||
105 | #if defined(CONFIG_PREEMPT) | ||
106 | # define PREEMPT_CHECK_OFFSET 1 | ||
107 | #else | ||
104 | # define PREEMPT_CHECK_OFFSET 0 | 108 | # define PREEMPT_CHECK_OFFSET 0 |
105 | #endif | 109 | #endif |
106 | 110 | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index e9138198e823..b676c585574e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
8 | #include <linux/hardirq.h> | ||
8 | 9 | ||
9 | #include <asm/cacheflush.h> | 10 | #include <asm/cacheflush.h> |
10 | 11 | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index e844a0b18695..4bef5c557160 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -32,28 +32,6 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | /* --- Bit algorithm adapters */ | 34 | /* --- Bit algorithm adapters */ |
35 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | ||
36 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | ||
37 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | ||
38 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ | 35 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ |
39 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | ||
40 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
41 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | ||
42 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | ||
43 | #define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | ||
44 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | ||
45 | |||
46 | /* --- SGI adapters */ | ||
47 | #define I2C_HW_SGI_VINO 0x160000 | ||
48 | |||
49 | /* --- SMBus only adapters */ | ||
50 | #define I2C_HW_SMBUS_W9968CF 0x04000d | ||
51 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | ||
52 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | ||
53 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | ||
54 | |||
55 | /* --- Miscellaneous adapters */ | ||
56 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | ||
57 | #define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ | ||
58 | 36 | ||
59 | #endif /* LINUX_I2C_ID_H */ | 37 | #endif /* LINUX_I2C_ID_H */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1f66fa06a97c..56cfe23ffb39 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -353,7 +353,7 @@ struct i2c_algorithm { | |||
353 | */ | 353 | */ |
354 | struct i2c_adapter { | 354 | struct i2c_adapter { |
355 | struct module *owner; | 355 | struct module *owner; |
356 | unsigned int id; | 356 | unsigned int id __deprecated; |
357 | unsigned int class; /* classes to allow probing for */ | 357 | unsigned int class; /* classes to allow probing for */ |
358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
359 | void *algo_data; | 359 | void *algo_data; |
@@ -407,8 +407,6 @@ void i2c_unlock_adapter(struct i2c_adapter *); | |||
407 | 407 | ||
408 | /* i2c adapter classes (bitmask) */ | 408 | /* i2c adapter classes (bitmask) */ |
409 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 409 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ |
410 | #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ | ||
411 | #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ | ||
412 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 410 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
413 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 411 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ |
414 | 412 | ||
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 3c5d6b6e765c..cec17cf6cac2 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | 2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2010 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -77,13 +77,26 @@ | |||
77 | /* Configuration Register1 */ | 77 | /* Configuration Register1 */ |
78 | #define ADP5588_AUTO_INC (1 << 7) | 78 | #define ADP5588_AUTO_INC (1 << 7) |
79 | #define ADP5588_GPIEM_CFG (1 << 6) | 79 | #define ADP5588_GPIEM_CFG (1 << 6) |
80 | #define ADP5588_OVR_FLOW_M (1 << 5) | ||
80 | #define ADP5588_INT_CFG (1 << 4) | 81 | #define ADP5588_INT_CFG (1 << 4) |
82 | #define ADP5588_OVR_FLOW_IEN (1 << 3) | ||
83 | #define ADP5588_K_LCK_IM (1 << 2) | ||
81 | #define ADP5588_GPI_IEN (1 << 1) | 84 | #define ADP5588_GPI_IEN (1 << 1) |
85 | #define ADP5588_KE_IEN (1 << 0) | ||
82 | 86 | ||
83 | /* Interrupt Status Register */ | 87 | /* Interrupt Status Register */ |
88 | #define ADP5588_CMP2_INT (1 << 5) | ||
89 | #define ADP5588_CMP1_INT (1 << 4) | ||
90 | #define ADP5588_OVR_FLOW_INT (1 << 3) | ||
91 | #define ADP5588_K_LCK_INT (1 << 2) | ||
84 | #define ADP5588_GPI_INT (1 << 1) | 92 | #define ADP5588_GPI_INT (1 << 1) |
85 | #define ADP5588_KE_INT (1 << 0) | 93 | #define ADP5588_KE_INT (1 << 0) |
86 | 94 | ||
95 | /* Key Lock and Event Counter Register */ | ||
96 | #define ADP5588_K_LCK_EN (1 << 6) | ||
97 | #define ADP5588_LCK21 0x30 | ||
98 | #define ADP5588_KEC 0xF | ||
99 | |||
87 | #define ADP5588_MAXGPIO 18 | 100 | #define ADP5588_MAXGPIO 18 |
88 | #define ADP5588_BANK(offs) ((offs) >> 3) | 101 | #define ADP5588_BANK(offs) ((offs) >> 3) |
89 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) | 102 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index c2f3a72712ce..635e1faec412 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -339,6 +339,31 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | /** | ||
343 | * vlan_get_protocol - get protocol EtherType. | ||
344 | * @skb: skbuff to query | ||
345 | * | ||
346 | * Returns the EtherType of the packet, regardless of whether it is | ||
347 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
348 | */ | ||
349 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | ||
350 | { | ||
351 | __be16 protocol = 0; | ||
352 | |||
353 | if (vlan_tx_tag_present(skb) || | ||
354 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | ||
355 | protocol = skb->protocol; | ||
356 | else { | ||
357 | __be16 proto, *protop; | ||
358 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | ||
359 | h_vlan_encapsulated_proto), | ||
360 | sizeof(proto), &proto); | ||
361 | if (likely(protop)) | ||
362 | protocol = *protop; | ||
363 | } | ||
364 | |||
365 | return protocol; | ||
366 | } | ||
342 | #endif /* __KERNEL__ */ | 367 | #endif /* __KERNEL__ */ |
343 | 368 | ||
344 | /* VLAN IOCTLs are found in sockios.h */ | 369 | /* VLAN IOCTLs are found in sockios.h */ |
diff --git a/include/linux/input.h b/include/linux/input.h index 51af441f3a21..6ef44465db8d 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1406,6 +1406,8 @@ static inline void input_set_drvdata(struct input_dev *dev, void *data) | |||
1406 | int __must_check input_register_device(struct input_dev *); | 1406 | int __must_check input_register_device(struct input_dev *); |
1407 | void input_unregister_device(struct input_dev *); | 1407 | void input_unregister_device(struct input_dev *); |
1408 | 1408 | ||
1409 | void input_reset_device(struct input_dev *); | ||
1410 | |||
1409 | int __must_check input_register_handler(struct input_handler *); | 1411 | int __must_check input_register_handler(struct input_handler *); |
1410 | void input_unregister_handler(struct input_handler *); | 1412 | void input_unregister_handler(struct input_handler *); |
1411 | 1413 | ||
@@ -1421,7 +1423,7 @@ void input_release_device(struct input_handle *); | |||
1421 | int input_open_device(struct input_handle *); | 1423 | int input_open_device(struct input_handle *); |
1422 | void input_close_device(struct input_handle *); | 1424 | void input_close_device(struct input_handle *); |
1423 | 1425 | ||
1424 | int input_flush_device(struct input_handle* handle, struct file* file); | 1426 | int input_flush_device(struct input_handle *handle, struct file *file); |
1425 | 1427 | ||
1426 | void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 1428 | void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
1427 | void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1429 | void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 3e70b21884a9..b2eee896dcbc 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -76,7 +76,6 @@ int put_io_context(struct io_context *ioc); | |||
76 | void exit_io_context(struct task_struct *task); | 76 | void exit_io_context(struct task_struct *task); |
77 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 77 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
78 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 78 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
79 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | ||
80 | #else | 79 | #else |
81 | static inline void exit_io_context(struct task_struct *task) | 80 | static inline void exit_io_context(struct task_struct *task) |
82 | { | 81 | { |
diff --git a/include/linux/irq.h b/include/linux/irq.h index e9639115dff1..abde2527c699 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -412,6 +412,11 @@ static inline void irq_free_desc(unsigned int irq) | |||
412 | irq_free_descs(irq, 1); | 412 | irq_free_descs(irq, 1); |
413 | } | 413 | } |
414 | 414 | ||
415 | static inline int irq_reserve_irq(unsigned int irq) | ||
416 | { | ||
417 | return irq_reserve_irqs(irq, 1); | ||
418 | } | ||
419 | |||
415 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 420 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
416 | 421 | ||
417 | #endif /* !CONFIG_S390 */ | 422 | #endif /* !CONFIG_S390 */ |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 05aa8c23483f..3bc4dcab6e82 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -43,7 +43,7 @@ unsigned int irq_get_next_irq(unsigned int offset); | |||
43 | else | 43 | else |
44 | 44 | ||
45 | #ifdef CONFIG_SMP | 45 | #ifdef CONFIG_SMP |
46 | #define irq_node(irq) (irq_to_desc(irq)->node) | 46 | #define irq_node(irq) (irq_get_irq_data(irq)->node) |
47 | #else | 47 | #else |
48 | #define irq_node(irq) 0 | 48 | #define irq_node(irq) 0 |
49 | #endif | 49 | #endif |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index b67cb180e6e9..7880f18e4b86 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_JUMP_LABEL_H | 1 | #ifndef _LINUX_JUMP_LABEL_H |
2 | #define _LINUX_JUMP_LABEL_H | 2 | #define _LINUX_JUMP_LABEL_H |
3 | 3 | ||
4 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_HAVE_ARCH_JUMP_LABEL) | 4 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) |
5 | # include <asm/jump_label.h> | 5 | # include <asm/jump_label.h> |
6 | # define HAVE_JUMP_LABEL | 6 | # define HAVE_JUMP_LABEL |
7 | #endif | 7 | #endif |
@@ -18,6 +18,8 @@ struct module; | |||
18 | extern struct jump_entry __start___jump_table[]; | 18 | extern struct jump_entry __start___jump_table[]; |
19 | extern struct jump_entry __stop___jump_table[]; | 19 | extern struct jump_entry __stop___jump_table[]; |
20 | 20 | ||
21 | extern void jump_label_lock(void); | ||
22 | extern void jump_label_unlock(void); | ||
21 | extern void arch_jump_label_transform(struct jump_entry *entry, | 23 | extern void arch_jump_label_transform(struct jump_entry *entry, |
22 | enum jump_label_type type); | 24 | enum jump_label_type type); |
23 | extern void arch_jump_label_text_poke_early(jump_label_t addr); | 25 | extern void arch_jump_label_text_poke_early(jump_label_t addr); |
@@ -59,6 +61,9 @@ static inline int jump_label_text_reserved(void *start, void *end) | |||
59 | return 0; | 61 | return 0; |
60 | } | 62 | } |
61 | 63 | ||
64 | static inline void jump_label_lock(void) {} | ||
65 | static inline void jump_label_unlock(void) {} | ||
66 | |||
62 | #endif | 67 | #endif |
63 | 68 | ||
64 | #define COND_STMT(key, stmt) \ | 69 | #define COND_STMT(key, stmt) \ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 450092c1e35f..b6de9a6f7018 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -17,13 +17,11 @@ | |||
17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
18 | #include <linux/log2.h> | 18 | #include <linux/log2.h> |
19 | #include <linux/typecheck.h> | 19 | #include <linux/typecheck.h> |
20 | #include <linux/printk.h> | ||
20 | #include <linux/dynamic_debug.h> | 21 | #include <linux/dynamic_debug.h> |
21 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
22 | #include <asm/bug.h> | 23 | #include <asm/bug.h> |
23 | 24 | ||
24 | extern const char linux_banner[]; | ||
25 | extern const char linux_proc_banner[]; | ||
26 | |||
27 | #define USHRT_MAX ((u16)(~0U)) | 25 | #define USHRT_MAX ((u16)(~0U)) |
28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) | 26 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) | 27 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
@@ -60,7 +58,7 @@ extern const char linux_proc_banner[]; | |||
60 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
61 | #define roundup(x, y) ( \ | 59 | #define roundup(x, y) ( \ |
62 | { \ | 60 | { \ |
63 | typeof(y) __y = y; \ | 61 | const typeof(y) __y = y; \ |
64 | (((x) + (__y - 1)) / __y) * __y; \ | 62 | (((x) + (__y - 1)) / __y) * __y; \ |
65 | } \ | 63 | } \ |
66 | ) | 64 | ) |
@@ -110,31 +108,6 @@ extern const char linux_proc_banner[]; | |||
110 | */ | 108 | */ |
111 | #define lower_32_bits(n) ((u32)(n)) | 109 | #define lower_32_bits(n) ((u32)(n)) |
112 | 110 | ||
113 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
114 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
115 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
116 | #define KERN_ERR "<3>" /* error conditions */ | ||
117 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
118 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
119 | #define KERN_INFO "<6>" /* informational */ | ||
120 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
121 | |||
122 | /* Use the default kernel loglevel */ | ||
123 | #define KERN_DEFAULT "<d>" | ||
124 | /* | ||
125 | * Annotation for a "continued" line of log printout (only done after a | ||
126 | * line that had no enclosing \n). Only to be used by core/arch code | ||
127 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
128 | */ | ||
129 | #define KERN_CONT "<c>" | ||
130 | |||
131 | extern int console_printk[]; | ||
132 | |||
133 | #define console_loglevel (console_printk[0]) | ||
134 | #define default_message_loglevel (console_printk[1]) | ||
135 | #define minimum_console_loglevel (console_printk[2]) | ||
136 | #define default_console_loglevel (console_printk[3]) | ||
137 | |||
138 | struct completion; | 111 | struct completion; |
139 | struct pt_regs; | 112 | struct pt_regs; |
140 | struct user; | 113 | struct user; |
@@ -187,11 +160,6 @@ static inline void might_fault(void) | |||
187 | } | 160 | } |
188 | #endif | 161 | #endif |
189 | 162 | ||
190 | struct va_format { | ||
191 | const char *fmt; | ||
192 | va_list *va; | ||
193 | }; | ||
194 | |||
195 | extern struct atomic_notifier_head panic_notifier_list; | 163 | extern struct atomic_notifier_head panic_notifier_list; |
196 | extern long (*panic_blink)(int state); | 164 | extern long (*panic_blink)(int state); |
197 | NORET_TYPE void panic(const char * fmt, ...) | 165 | NORET_TYPE void panic(const char * fmt, ...) |
@@ -245,114 +213,8 @@ extern int func_ptr_is_kernel_text(void *ptr); | |||
245 | struct pid; | 213 | struct pid; |
246 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 214 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
247 | 215 | ||
248 | /* | ||
249 | * FW_BUG | ||
250 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
251 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
252 | * should be able to fix this issue or at least get a concrete idea of the | ||
253 | * problem by reading your message without the need of looking at the kernel | ||
254 | * code. | ||
255 | * | ||
256 | * Use it for definite and high priority BIOS bugs. | ||
257 | * | ||
258 | * FW_WARN | ||
259 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
260 | * and medium priority BIOS bugs. | ||
261 | * | ||
262 | * FW_INFO | ||
263 | * Use this one if you want to tell the user or vendor about something | ||
264 | * suspicious, but generally harmless related to the firmware. | ||
265 | * | ||
266 | * Use it for information or very low priority BIOS bugs. | ||
267 | */ | ||
268 | #define FW_BUG "[Firmware Bug]: " | ||
269 | #define FW_WARN "[Firmware Warn]: " | ||
270 | #define FW_INFO "[Firmware Info]: " | ||
271 | |||
272 | /* | ||
273 | * HW_ERR | ||
274 | * Add this to a message for hardware errors, so that user can report | ||
275 | * it to hardware vendor instead of LKML or software vendor. | ||
276 | */ | ||
277 | #define HW_ERR "[Hardware Error]: " | ||
278 | |||
279 | #ifdef CONFIG_PRINTK | ||
280 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
281 | __attribute__ ((format (printf, 1, 0))); | ||
282 | asmlinkage int printk(const char * fmt, ...) | ||
283 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
284 | |||
285 | /* | ||
286 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
287 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
288 | * printk_ratelimited() or plain old __ratelimit(). | ||
289 | */ | ||
290 | extern int __printk_ratelimit(const char *func); | ||
291 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
292 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
293 | unsigned int interval_msec); | ||
294 | |||
295 | extern int printk_delay_msec; | ||
296 | |||
297 | /* | ||
298 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
299 | */ | ||
300 | #define printk_once(x...) ({ \ | ||
301 | static bool __print_once; \ | ||
302 | \ | ||
303 | if (!__print_once) { \ | ||
304 | __print_once = true; \ | ||
305 | printk(x); \ | ||
306 | } \ | ||
307 | }) | ||
308 | |||
309 | void log_buf_kexec_setup(void); | ||
310 | #else | ||
311 | static inline int vprintk(const char *s, va_list args) | ||
312 | __attribute__ ((format (printf, 1, 0))); | ||
313 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
314 | static inline int printk(const char *s, ...) | ||
315 | __attribute__ ((format (printf, 1, 2))); | ||
316 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
317 | static inline int printk_ratelimit(void) { return 0; } | ||
318 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
319 | unsigned int interval_msec) \ | ||
320 | { return false; } | ||
321 | |||
322 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
323 | #define printk_once(x...) printk(x) | ||
324 | |||
325 | static inline void log_buf_kexec_setup(void) | ||
326 | { | ||
327 | } | ||
328 | #endif | ||
329 | |||
330 | /* | ||
331 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
332 | * gcc's format and side-effect checking. | ||
333 | */ | ||
334 | static inline __attribute__ ((format (printf, 1, 2))) | ||
335 | int no_printk(const char *s, ...) { return 0; } | ||
336 | |||
337 | extern int printk_needs_cpu(int cpu); | ||
338 | extern void printk_tick(void); | ||
339 | |||
340 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
341 | early_printk(const char *fmt, ...); | ||
342 | |||
343 | unsigned long int_sqrt(unsigned long); | 216 | unsigned long int_sqrt(unsigned long); |
344 | 217 | ||
345 | static inline void console_silent(void) | ||
346 | { | ||
347 | console_loglevel = 0; | ||
348 | } | ||
349 | |||
350 | static inline void console_verbose(void) | ||
351 | { | ||
352 | if (console_loglevel) | ||
353 | console_loglevel = 15; | ||
354 | } | ||
355 | |||
356 | extern void bust_spinlocks(int yes); | 218 | extern void bust_spinlocks(int yes); |
357 | extern void wake_up_klogd(void); | 219 | extern void wake_up_klogd(void); |
358 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 220 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
@@ -389,22 +251,6 @@ extern enum system_states { | |||
389 | #define TAINT_CRAP 10 | 251 | #define TAINT_CRAP 10 |
390 | #define TAINT_FIRMWARE_WORKAROUND 11 | 252 | #define TAINT_FIRMWARE_WORKAROUND 11 |
391 | 253 | ||
392 | extern void dump_stack(void) __cold; | ||
393 | |||
394 | enum { | ||
395 | DUMP_PREFIX_NONE, | ||
396 | DUMP_PREFIX_ADDRESS, | ||
397 | DUMP_PREFIX_OFFSET | ||
398 | }; | ||
399 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
400 | int rowsize, int groupsize, | ||
401 | char *linebuf, size_t linebuflen, bool ascii); | ||
402 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
403 | int prefix_type, int rowsize, int groupsize, | ||
404 | const void *buf, size_t len, bool ascii); | ||
405 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
406 | const void *buf, size_t len); | ||
407 | |||
408 | extern const char hex_asc[]; | 254 | extern const char hex_asc[]; |
409 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 255 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
410 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 256 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
@@ -418,94 +264,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
418 | 264 | ||
419 | extern int hex_to_bin(char ch); | 265 | extern int hex_to_bin(char ch); |
420 | 266 | ||
421 | #ifndef pr_fmt | ||
422 | #define pr_fmt(fmt) fmt | ||
423 | #endif | ||
424 | |||
425 | #define pr_emerg(fmt, ...) \ | ||
426 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
427 | #define pr_alert(fmt, ...) \ | ||
428 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
429 | #define pr_crit(fmt, ...) \ | ||
430 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
431 | #define pr_err(fmt, ...) \ | ||
432 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
433 | #define pr_warning(fmt, ...) \ | ||
434 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
435 | #define pr_warn pr_warning | ||
436 | #define pr_notice(fmt, ...) \ | ||
437 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
438 | #define pr_info(fmt, ...) \ | ||
439 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
440 | #define pr_cont(fmt, ...) \ | ||
441 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
442 | |||
443 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
444 | #ifdef DEBUG | ||
445 | #define pr_devel(fmt, ...) \ | ||
446 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
447 | #else | ||
448 | #define pr_devel(fmt, ...) \ | ||
449 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
450 | #endif | ||
451 | |||
452 | /* If you are writing a driver, please use dev_dbg instead */ | ||
453 | #if defined(DEBUG) | ||
454 | #define pr_debug(fmt, ...) \ | ||
455 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
456 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
457 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
458 | #define pr_debug(fmt, ...) \ | ||
459 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
460 | #else | ||
461 | #define pr_debug(fmt, ...) \ | ||
462 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
463 | #endif | ||
464 | |||
465 | /* | ||
466 | * ratelimited messages with local ratelimit_state, | ||
467 | * no local ratelimit_state used in the !PRINTK case | ||
468 | */ | ||
469 | #ifdef CONFIG_PRINTK | ||
470 | #define printk_ratelimited(fmt, ...) ({ \ | ||
471 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
472 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
473 | DEFAULT_RATELIMIT_BURST); \ | ||
474 | \ | ||
475 | if (__ratelimit(&_rs)) \ | ||
476 | printk(fmt, ##__VA_ARGS__); \ | ||
477 | }) | ||
478 | #else | ||
479 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
480 | #define printk_ratelimited printk | ||
481 | #endif | ||
482 | |||
483 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
484 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
485 | #define pr_alert_ratelimited(fmt, ...) \ | ||
486 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
487 | #define pr_crit_ratelimited(fmt, ...) \ | ||
488 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
489 | #define pr_err_ratelimited(fmt, ...) \ | ||
490 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
491 | #define pr_warning_ratelimited(fmt, ...) \ | ||
492 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
493 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
494 | #define pr_notice_ratelimited(fmt, ...) \ | ||
495 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
496 | #define pr_info_ratelimited(fmt, ...) \ | ||
497 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
498 | /* no pr_cont_ratelimited, don't do that... */ | ||
499 | /* If you are writing a driver, please use dev_dbg instead */ | ||
500 | #if defined(DEBUG) | ||
501 | #define pr_debug_ratelimited(fmt, ...) \ | ||
502 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
503 | #else | ||
504 | #define pr_debug_ratelimited(fmt, ...) \ | ||
505 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
506 | ##__VA_ARGS__); 0; }) | ||
507 | #endif | ||
508 | |||
509 | /* | 267 | /* |
510 | * General tracing related utility functions - trace_printk(), | 268 | * General tracing related utility functions - trace_printk(), |
511 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 269 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index cc96f0f23e04..092e4250a458 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -35,16 +35,6 @@ struct pt_regs; | |||
35 | */ | 35 | */ |
36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
37 | 37 | ||
38 | /** | ||
39 | * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook | ||
40 | * @regs: Current &struct pt_regs. | ||
41 | * | ||
42 | * This function will be called if the particular architecture must | ||
43 | * disable hardware debugging while it is processing gdb packets or | ||
44 | * handling exception. | ||
45 | */ | ||
46 | extern void kgdb_disable_hw_debug(struct pt_regs *regs); | ||
47 | |||
48 | struct tasklet_struct; | 38 | struct tasklet_struct; |
49 | struct task_struct; | 39 | struct task_struct; |
50 | struct uart_port; | 40 | struct uart_port; |
@@ -243,6 +233,8 @@ extern void kgdb_arch_late(void); | |||
243 | * breakpoint. | 233 | * breakpoint. |
244 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a | 234 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a |
245 | * hardware breakpoint. | 235 | * hardware breakpoint. |
236 | * @disable_hw_break: Allow an architecture to specify how to disable | ||
237 | * hardware breakpoints for a single cpu. | ||
246 | * @remove_all_hw_break: Allow an architecture to specify how to remove all | 238 | * @remove_all_hw_break: Allow an architecture to specify how to remove all |
247 | * hardware breakpoints. | 239 | * hardware breakpoints. |
248 | * @correct_hw_break: Allow an architecture to specify how to correct the | 240 | * @correct_hw_break: Allow an architecture to specify how to correct the |
@@ -256,6 +248,7 @@ struct kgdb_arch { | |||
256 | int (*remove_breakpoint)(unsigned long, char *); | 248 | int (*remove_breakpoint)(unsigned long, char *); |
257 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 249 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
258 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 250 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
251 | void (*disable_hw_break)(struct pt_regs *regs); | ||
259 | void (*remove_all_hw_break)(void); | 252 | void (*remove_all_hw_break)(void); |
260 | void (*correct_hw_break)(void); | 253 | void (*correct_hw_break)(void); |
261 | }; | 254 | }; |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h new file mode 100644 index 000000000000..38368d785f08 --- /dev/null +++ b/include/linux/leds-lp5521.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * LP5521 LED chip driver. | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5521_H | ||
24 | #define __LINUX_LP5521_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5521.txt */ | ||
27 | |||
28 | struct lp5521_led_config { | ||
29 | u8 chan_nr; | ||
30 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
31 | u8 max_current; | ||
32 | }; | ||
33 | |||
34 | #define LP5521_CLOCK_AUTO 0 | ||
35 | #define LP5521_CLOCK_INT 1 | ||
36 | #define LP5521_CLOCK_EXT 2 | ||
37 | |||
38 | struct lp5521_platform_data { | ||
39 | struct lp5521_led_config *led_config; | ||
40 | u8 num_channels; | ||
41 | u8 clock_mode; | ||
42 | int (*setup_resources)(void); | ||
43 | void (*release_resources)(void); | ||
44 | void (*enable)(bool state); | ||
45 | }; | ||
46 | |||
47 | #endif /* __LINUX_LP5521_H */ | ||
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h new file mode 100644 index 000000000000..796747637b80 --- /dev/null +++ b/include/linux/leds-lp5523.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * LP5523 LED Driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5523_H | ||
24 | #define __LINUX_LP5523_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5523.txt */ | ||
27 | |||
28 | struct lp5523_led_config { | ||
29 | u8 chan_nr; | ||
30 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
31 | u8 max_current; | ||
32 | }; | ||
33 | |||
34 | #define LP5523_CLOCK_AUTO 0 | ||
35 | #define LP5523_CLOCK_INT 1 | ||
36 | #define LP5523_CLOCK_EXT 2 | ||
37 | |||
38 | struct lp5523_platform_data { | ||
39 | struct lp5523_led_config *led_config; | ||
40 | u8 num_channels; | ||
41 | u8 clock_mode; | ||
42 | int (*setup_resources)(void); | ||
43 | void (*release_resources)(void); | ||
44 | void (*enable)(bool state); | ||
45 | }; | ||
46 | |||
47 | #endif /* __LINUX_LP5523_H */ | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index ba6986a11663..0f19df9e37b0 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/rwsem.h> | 17 | #include <linux/rwsem.h> |
18 | #include <linux/timer.h> | ||
18 | 19 | ||
19 | struct device; | 20 | struct device; |
20 | /* | 21 | /* |
@@ -45,10 +46,14 @@ struct led_classdev { | |||
45 | /* Get LED brightness level */ | 46 | /* Get LED brightness level */ |
46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); | 47 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); |
47 | 48 | ||
48 | /* Activate hardware accelerated blink, delays are in | 49 | /* |
49 | * miliseconds and if none is provided then a sensible default | 50 | * Activate hardware accelerated blink, delays are in milliseconds |
50 | * should be chosen. The call can adjust the timings if it can't | 51 | * and if both are zero then a sensible default should be chosen. |
51 | * match the values specified exactly. */ | 52 | * The call should adjust the timings in that case and if it can't |
53 | * match the values specified exactly. | ||
54 | * Deactivate blinking again when the brightness is set to a fixed | ||
55 | * value via the brightness_set() callback. | ||
56 | */ | ||
52 | int (*blink_set)(struct led_classdev *led_cdev, | 57 | int (*blink_set)(struct led_classdev *led_cdev, |
53 | unsigned long *delay_on, | 58 | unsigned long *delay_on, |
54 | unsigned long *delay_off); | 59 | unsigned long *delay_off); |
@@ -57,6 +62,10 @@ struct led_classdev { | |||
57 | struct list_head node; /* LED Device list */ | 62 | struct list_head node; /* LED Device list */ |
58 | const char *default_trigger; /* Trigger to use */ | 63 | const char *default_trigger; /* Trigger to use */ |
59 | 64 | ||
65 | unsigned long blink_delay_on, blink_delay_off; | ||
66 | struct timer_list blink_timer; | ||
67 | int blink_brightness; | ||
68 | |||
60 | #ifdef CONFIG_LEDS_TRIGGERS | 69 | #ifdef CONFIG_LEDS_TRIGGERS |
61 | /* Protects the trigger data below */ | 70 | /* Protects the trigger data below */ |
62 | struct rw_semaphore trigger_lock; | 71 | struct rw_semaphore trigger_lock; |
@@ -73,6 +82,36 @@ extern void led_classdev_unregister(struct led_classdev *led_cdev); | |||
73 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 82 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
74 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 83 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
75 | 84 | ||
85 | /** | ||
86 | * led_blink_set - set blinking with software fallback | ||
87 | * @led_cdev: the LED to start blinking | ||
88 | * @delay_on: the time it should be on (in ms) | ||
89 | * @delay_off: the time it should ble off (in ms) | ||
90 | * | ||
91 | * This function makes the LED blink, attempting to use the | ||
92 | * hardware acceleration if possible, but falling back to | ||
93 | * software blinking if there is no hardware blinking or if | ||
94 | * the LED refuses the passed values. | ||
95 | * | ||
96 | * Note that if software blinking is active, simply calling | ||
97 | * led_cdev->brightness_set() will not stop the blinking, | ||
98 | * use led_classdev_brightness_set() instead. | ||
99 | */ | ||
100 | extern void led_blink_set(struct led_classdev *led_cdev, | ||
101 | unsigned long *delay_on, | ||
102 | unsigned long *delay_off); | ||
103 | /** | ||
104 | * led_brightness_set - set LED brightness | ||
105 | * @led_cdev: the LED to set | ||
106 | * @brightness: the brightness to set it to | ||
107 | * | ||
108 | * Set an LED's brightness, and, if necessary, cancel the | ||
109 | * software blink timer that implements blinking when the | ||
110 | * hardware doesn't. | ||
111 | */ | ||
112 | extern void led_brightness_set(struct led_classdev *led_cdev, | ||
113 | enum led_brightness brightness); | ||
114 | |||
76 | /* | 115 | /* |
77 | * LED Triggers | 116 | * LED Triggers |
78 | */ | 117 | */ |
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h index d0f08018335d..1ff81b51b656 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #define MARVELL_PHY_ID_88E1121R 0x01410cb0 | 12 | #define MARVELL_PHY_ID_88E1121R 0x01410cb0 |
13 | #define MARVELL_PHY_ID_88E1145 0x01410cd0 | 13 | #define MARVELL_PHY_ID_88E1145 0x01410cd0 |
14 | #define MARVELL_PHY_ID_88E1240 0x01410e30 | 14 | #define MARVELL_PHY_ID_88E1240 0x01410e30 |
15 | #define MARVELL_PHY_ID_88EC048 0x01410e90 | 15 | #define MARVELL_PHY_ID_88E1318S 0x01410e90 |
16 | 16 | ||
17 | /* struct phy_device dev_flags definitions */ | 17 | /* struct phy_device dev_flags definitions */ |
18 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 | 18 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index d19e2114fd86..5c99da1078aa 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -59,19 +59,19 @@ struct sh_mmcif_plat_data { | |||
59 | #define MMCIF_CE_HOST_STS2 0x0000004C | 59 | #define MMCIF_CE_HOST_STS2 0x0000004C |
60 | #define MMCIF_CE_VERSION 0x0000007C | 60 | #define MMCIF_CE_VERSION 0x0000007C |
61 | 61 | ||
62 | extern inline u32 sh_mmcif_readl(void __iomem *addr, int reg) | 62 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) |
63 | { | 63 | { |
64 | return readl(addr + reg); | 64 | return readl(addr + reg); |
65 | } | 65 | } |
66 | 66 | ||
67 | extern inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | 67 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) |
68 | { | 68 | { |
69 | writel(val, addr + reg); | 69 | writel(val, addr + reg); |
70 | } | 70 | } |
71 | 71 | ||
72 | #define SH_MMCIF_BBS 512 /* boot block size */ | 72 | #define SH_MMCIF_BBS 512 /* boot block size */ |
73 | 73 | ||
74 | extern inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 74 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
75 | unsigned long cmd, unsigned long arg) | 75 | unsigned long cmd, unsigned long arg) |
76 | { | 76 | { |
77 | sh_mmcif_writel(base, MMCIF_CE_INT, 0); | 77 | sh_mmcif_writel(base, MMCIF_CE_INT, 0); |
@@ -79,7 +79,7 @@ extern inline void sh_mmcif_boot_cmd_send(void __iomem *base, | |||
79 | sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd); | 79 | sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd); |
80 | } | 80 | } |
81 | 81 | ||
82 | extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) | 82 | static inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) |
83 | { | 83 | { |
84 | unsigned long tmp; | 84 | unsigned long tmp; |
85 | int cnt; | 85 | int cnt; |
@@ -95,14 +95,14 @@ extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) | |||
95 | return -1; | 95 | return -1; |
96 | } | 96 | } |
97 | 97 | ||
98 | extern inline int sh_mmcif_boot_cmd(void __iomem *base, | 98 | static inline int sh_mmcif_boot_cmd(void __iomem *base, |
99 | unsigned long cmd, unsigned long arg) | 99 | unsigned long cmd, unsigned long arg) |
100 | { | 100 | { |
101 | sh_mmcif_boot_cmd_send(base, cmd, arg); | 101 | sh_mmcif_boot_cmd_send(base, cmd, arg); |
102 | return sh_mmcif_boot_cmd_poll(base, 0x00010000); | 102 | return sh_mmcif_boot_cmd_poll(base, 0x00010000); |
103 | } | 103 | } |
104 | 104 | ||
105 | extern inline int sh_mmcif_boot_do_read_single(void __iomem *base, | 105 | static inline int sh_mmcif_boot_do_read_single(void __iomem *base, |
106 | unsigned int block_nr, | 106 | unsigned int block_nr, |
107 | unsigned long *buf) | 107 | unsigned long *buf) |
108 | { | 108 | { |
@@ -125,7 +125,7 @@ extern inline int sh_mmcif_boot_do_read_single(void __iomem *base, | |||
125 | return 0; | 125 | return 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | extern inline int sh_mmcif_boot_do_read(void __iomem *base, | 128 | static inline int sh_mmcif_boot_do_read(void __iomem *base, |
129 | unsigned long first_block, | 129 | unsigned long first_block, |
130 | unsigned long nr_blocks, | 130 | unsigned long nr_blocks, |
131 | void *buf) | 131 | void *buf) |
@@ -143,7 +143,7 @@ extern inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
143 | return ret; | 143 | return ret; |
144 | } | 144 | } |
145 | 145 | ||
146 | extern inline void sh_mmcif_boot_init(void __iomem *base) | 146 | static inline void sh_mmcif_boot_init(void __iomem *base) |
147 | { | 147 | { |
148 | unsigned long tmp; | 148 | unsigned long tmp; |
149 | 149 | ||
@@ -177,7 +177,7 @@ extern inline void sh_mmcif_boot_init(void __iomem *base) | |||
177 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 177 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
178 | } | 178 | } |
179 | 179 | ||
180 | extern inline void sh_mmcif_boot_slurp(void __iomem *base, | 180 | static inline void sh_mmcif_boot_slurp(void __iomem *base, |
181 | unsigned char *buf, | 181 | unsigned char *buf, |
182 | unsigned long no_bytes) | 182 | unsigned long no_bytes) |
183 | { | 183 | { |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 7fa20beb2ab9..57cc0e63714f 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -84,7 +84,7 @@ struct nand_bbt_descr { | |||
84 | #define NAND_BBT_PERCHIP 0x00000080 | 84 | #define NAND_BBT_PERCHIP 0x00000080 |
85 | /* bbt has a version counter at offset veroffs */ | 85 | /* bbt has a version counter at offset veroffs */ |
86 | #define NAND_BBT_VERSION 0x00000100 | 86 | #define NAND_BBT_VERSION 0x00000100 |
87 | /* Create a bbt if none axists */ | 87 | /* Create a bbt if none exists */ |
88 | #define NAND_BBT_CREATE 0x00000200 | 88 | #define NAND_BBT_CREATE 0x00000200 |
89 | /* Search good / bad pattern through all pages of a block */ | 89 | /* Search good / bad pattern through all pages of a block */ |
90 | #define NAND_BBT_SCANALLPAGES 0x00000400 | 90 | #define NAND_BBT_SCANALLPAGES 0x00000400 |
@@ -102,6 +102,8 @@ struct nand_bbt_descr { | |||
102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 | 102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 |
103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ | 103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ |
104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 | 104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 |
105 | /* The bad block table does not OOB for marker */ | ||
106 | #define NAND_BBT_NO_OOB 0x00400000 | ||
105 | 107 | ||
106 | /* The maximum number of blocks to scan for a bbt */ | 108 | /* The maximum number of blocks to scan for a bbt */ |
107 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | 109 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d2118b0eac9a..4dd0c2cd7659 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -289,6 +289,7 @@ struct cfi_private { | |||
289 | must be of the same type. */ | 289 | must be of the same type. */ |
290 | int mfr, id; | 290 | int mfr, id; |
291 | int numchips; | 291 | int numchips; |
292 | map_word sector_erase_cmd; | ||
292 | unsigned long chipshift; /* Because they're of the same type */ | 293 | unsigned long chipshift; /* Because they're of the same type */ |
293 | const char *im_name; /* inter_module name for cmdset_setup */ | 294 | const char *im_name; /* inter_module name for cmdset_setup */ |
294 | struct flchip chips[0]; /* per-chip data structure for each chip */ | 295 | struct flchip chips[0]; /* per-chip data structure for each chip */ |
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h new file mode 100644 index 000000000000..5d2556700ec2 --- /dev/null +++ b/include/linux/mtd/fsmc.h | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * incude/mtd/fsmc.h | ||
3 | * | ||
4 | * ST Microelectronics | ||
5 | * Flexible Static Memory Controller (FSMC) | ||
6 | * platform data interface and header file | ||
7 | * | ||
8 | * Copyright © 2010 ST Microelectronics | ||
9 | * Vipin Kumar <vipin.kumar@st.com> | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public | ||
12 | * License version 2. This program is licensed "as is" without any | ||
13 | * warranty of any kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MTD_FSMC_H | ||
17 | #define __MTD_FSMC_H | ||
18 | |||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/mtd/physmap.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/mtd/partitions.h> | ||
23 | #include <asm/param.h> | ||
24 | |||
25 | #define FSMC_NAND_BW8 1 | ||
26 | #define FSMC_NAND_BW16 2 | ||
27 | |||
28 | /* | ||
29 | * The placement of the Command Latch Enable (CLE) and | ||
30 | * Address Latch Enable (ALE) is twised around in the | ||
31 | * SPEAR310 implementation. | ||
32 | */ | ||
33 | #if defined(CONFIG_MACH_SPEAR310) | ||
34 | #define PLAT_NAND_CLE (1 << 17) | ||
35 | #define PLAT_NAND_ALE (1 << 16) | ||
36 | #else | ||
37 | #define PLAT_NAND_CLE (1 << 16) | ||
38 | #define PLAT_NAND_ALE (1 << 17) | ||
39 | #endif | ||
40 | |||
41 | #define FSMC_MAX_NOR_BANKS 4 | ||
42 | #define FSMC_MAX_NAND_BANKS 4 | ||
43 | |||
44 | #define FSMC_FLASH_WIDTH8 1 | ||
45 | #define FSMC_FLASH_WIDTH16 2 | ||
46 | |||
47 | struct fsmc_nor_bank_regs { | ||
48 | uint32_t ctrl; | ||
49 | uint32_t ctrl_tim; | ||
50 | }; | ||
51 | |||
52 | /* ctrl register definitions */ | ||
53 | #define BANK_ENABLE (1 << 0) | ||
54 | #define MUXED (1 << 1) | ||
55 | #define NOR_DEV (2 << 2) | ||
56 | #define WIDTH_8 (0 << 4) | ||
57 | #define WIDTH_16 (1 << 4) | ||
58 | #define RSTPWRDWN (1 << 6) | ||
59 | #define WPROT (1 << 7) | ||
60 | #define WRT_ENABLE (1 << 12) | ||
61 | #define WAIT_ENB (1 << 13) | ||
62 | |||
63 | /* ctrl_tim register definitions */ | ||
64 | |||
65 | struct fsms_nand_bank_regs { | ||
66 | uint32_t pc; | ||
67 | uint32_t sts; | ||
68 | uint32_t comm; | ||
69 | uint32_t attrib; | ||
70 | uint32_t ioata; | ||
71 | uint32_t ecc1; | ||
72 | uint32_t ecc2; | ||
73 | uint32_t ecc3; | ||
74 | }; | ||
75 | |||
76 | #define FSMC_NOR_REG_SIZE 0x40 | ||
77 | |||
78 | struct fsmc_regs { | ||
79 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; | ||
80 | uint8_t reserved_1[0x40 - 0x20]; | ||
81 | struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; | ||
82 | uint8_t reserved_2[0xfe0 - 0xc0]; | ||
83 | uint32_t peripid0; /* 0xfe0 */ | ||
84 | uint32_t peripid1; /* 0xfe4 */ | ||
85 | uint32_t peripid2; /* 0xfe8 */ | ||
86 | uint32_t peripid3; /* 0xfec */ | ||
87 | uint32_t pcellid0; /* 0xff0 */ | ||
88 | uint32_t pcellid1; /* 0xff4 */ | ||
89 | uint32_t pcellid2; /* 0xff8 */ | ||
90 | uint32_t pcellid3; /* 0xffc */ | ||
91 | }; | ||
92 | |||
93 | #define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ) | ||
94 | |||
95 | /* pc register definitions */ | ||
96 | #define FSMC_RESET (1 << 0) | ||
97 | #define FSMC_WAITON (1 << 1) | ||
98 | #define FSMC_ENABLE (1 << 2) | ||
99 | #define FSMC_DEVTYPE_NAND (1 << 3) | ||
100 | #define FSMC_DEVWID_8 (0 << 4) | ||
101 | #define FSMC_DEVWID_16 (1 << 4) | ||
102 | #define FSMC_ECCEN (1 << 6) | ||
103 | #define FSMC_ECCPLEN_512 (0 << 7) | ||
104 | #define FSMC_ECCPLEN_256 (1 << 7) | ||
105 | #define FSMC_TCLR_1 (1 << 9) | ||
106 | #define FSMC_TAR_1 (1 << 13) | ||
107 | |||
108 | /* sts register definitions */ | ||
109 | #define FSMC_CODE_RDY (1 << 15) | ||
110 | |||
111 | /* comm register definitions */ | ||
112 | #define FSMC_TSET_0 (0 << 0) | ||
113 | #define FSMC_TWAIT_6 (6 << 8) | ||
114 | #define FSMC_THOLD_4 (4 << 16) | ||
115 | #define FSMC_THIZ_1 (1 << 24) | ||
116 | |||
117 | /* peripid2 register definitions */ | ||
118 | #define FSMC_REVISION_MSK (0xf) | ||
119 | #define FSMC_REVISION_SHFT (0x4) | ||
120 | |||
121 | #define FSMC_VER1 1 | ||
122 | #define FSMC_VER2 2 | ||
123 | #define FSMC_VER3 3 | ||
124 | #define FSMC_VER4 4 | ||
125 | #define FSMC_VER5 5 | ||
126 | #define FSMC_VER6 6 | ||
127 | #define FSMC_VER7 7 | ||
128 | #define FSMC_VER8 8 | ||
129 | |||
130 | static inline uint32_t get_fsmc_version(struct fsmc_regs *regs) | ||
131 | { | ||
132 | return (readl(®s->peripid2) >> FSMC_REVISION_SHFT) & | ||
133 | FSMC_REVISION_MSK; | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 | ||
138 | * and it has to be read consecutively and immediately after the 512 | ||
139 | * byte data block for hardware to generate the error bit offsets | ||
140 | * Managing the ecc bytes in the following way is easier. This way is | ||
141 | * similar to oobfree structure maintained already in u-boot nand driver | ||
142 | */ | ||
143 | #define MAX_ECCPLACE_ENTRIES 32 | ||
144 | |||
145 | struct fsmc_nand_eccplace { | ||
146 | uint8_t offset; | ||
147 | uint8_t length; | ||
148 | }; | ||
149 | |||
150 | struct fsmc_eccplace { | ||
151 | struct fsmc_nand_eccplace eccplace[MAX_ECCPLACE_ENTRIES]; | ||
152 | }; | ||
153 | |||
154 | /** | ||
155 | * fsmc_nand_platform_data - platform specific NAND controller config | ||
156 | * @partitions: partition table for the platform, use a default fallback | ||
157 | * if this is NULL | ||
158 | * @nr_partitions: the number of partitions in the previous entry | ||
159 | * @options: different options for the driver | ||
160 | * @width: bus width | ||
161 | * @bank: default bank | ||
162 | * @select_bank: callback to select a certain bank, this is | ||
163 | * platform-specific. If the controller only supports one bank | ||
164 | * this may be set to NULL | ||
165 | */ | ||
166 | struct fsmc_nand_platform_data { | ||
167 | struct mtd_partition *partitions; | ||
168 | unsigned int nr_partitions; | ||
169 | unsigned int options; | ||
170 | unsigned int width; | ||
171 | unsigned int bank; | ||
172 | void (*select_bank)(uint32_t bank, uint32_t busw); | ||
173 | }; | ||
174 | |||
175 | extern int __init fsmc_nor_init(struct platform_device *pdev, | ||
176 | unsigned long base, uint32_t bank, uint32_t width); | ||
177 | extern void __init fsmc_init_board_info(struct platform_device *pdev, | ||
178 | struct mtd_partition *partitions, unsigned int nr_partitions, | ||
179 | unsigned int width); | ||
180 | |||
181 | #endif /* __MTD_FSMC_H */ | ||
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 64ee53ce95a9..02cd5f9b79b8 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h | |||
@@ -37,14 +37,14 @@ struct INFTLrecord { | |||
37 | __u16 firstEUN; | 37 | __u16 firstEUN; |
38 | __u16 lastEUN; | 38 | __u16 lastEUN; |
39 | __u16 numfreeEUNs; | 39 | __u16 numfreeEUNs; |
40 | __u16 LastFreeEUN; /* To speed up finding a free EUN */ | 40 | __u16 LastFreeEUN; /* To speed up finding a free EUN */ |
41 | int head,sect,cyl; | 41 | int head,sect,cyl; |
42 | __u16 *PUtable; /* Physical Unit Table */ | 42 | __u16 *PUtable; /* Physical Unit Table */ |
43 | __u16 *VUtable; /* Virtual Unit Table */ | 43 | __u16 *VUtable; /* Virtual Unit Table */ |
44 | unsigned int nb_blocks; /* number of physical blocks */ | 44 | unsigned int nb_blocks; /* number of physical blocks */ |
45 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ | 45 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ |
46 | struct erase_info instr; | 46 | struct erase_info instr; |
47 | struct nand_ecclayout oobinfo; | 47 | struct nand_ecclayout oobinfo; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | int INFTL_mount(struct INFTLrecord *s); | 50 | int INFTL_mount(struct INFTLrecord *s); |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 8485e42a9b09..fe8d77ebec13 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -110,6 +110,21 @@ struct mtd_oob_ops { | |||
110 | uint8_t *oobbuf; | 110 | uint8_t *oobbuf; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define MTD_MAX_OOBFREE_ENTRIES_LARGE 32 | ||
114 | #define MTD_MAX_ECCPOS_ENTRIES_LARGE 448 | ||
115 | /* | ||
116 | * Internal ECC layout control structure. For historical reasons, there is a | ||
117 | * similar, smaller struct nand_ecclayout_user (in mtd-abi.h) that is retained | ||
118 | * for export to user-space via the ECCGETLAYOUT ioctl. | ||
119 | * nand_ecclayout should be expandable in the future simply by the above macros. | ||
120 | */ | ||
121 | struct nand_ecclayout { | ||
122 | __u32 eccbytes; | ||
123 | __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES_LARGE]; | ||
124 | __u32 oobavail; | ||
125 | struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE]; | ||
126 | }; | ||
127 | |||
113 | struct mtd_info { | 128 | struct mtd_info { |
114 | u_char type; | 129 | u_char type; |
115 | uint32_t flags; | 130 | uint32_t flags; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 102e12c58cb3..63e17d01fde9 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -27,15 +27,17 @@ | |||
27 | struct mtd_info; | 27 | struct mtd_info; |
28 | struct nand_flash_dev; | 28 | struct nand_flash_dev; |
29 | /* Scan and identify a NAND device */ | 29 | /* Scan and identify a NAND device */ |
30 | extern int nand_scan (struct mtd_info *mtd, int max_chips); | 30 | extern int nand_scan(struct mtd_info *mtd, int max_chips); |
31 | /* Separate phases of nand_scan(), allowing board driver to intervene | 31 | /* |
32 | * and override command or ECC setup according to flash type */ | 32 | * Separate phases of nand_scan(), allowing board driver to intervene |
33 | * and override command or ECC setup according to flash type. | ||
34 | */ | ||
33 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, | 35 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, |
34 | struct nand_flash_dev *table); | 36 | struct nand_flash_dev *table); |
35 | extern int nand_scan_tail(struct mtd_info *mtd); | 37 | extern int nand_scan_tail(struct mtd_info *mtd); |
36 | 38 | ||
37 | /* Free resources held by the NAND device */ | 39 | /* Free resources held by the NAND device */ |
38 | extern void nand_release (struct mtd_info *mtd); | 40 | extern void nand_release(struct mtd_info *mtd); |
39 | 41 | ||
40 | /* Internal helper for board drivers which need to override command function */ | 42 | /* Internal helper for board drivers which need to override command function */ |
41 | extern void nand_wait_ready(struct mtd_info *mtd); | 43 | extern void nand_wait_ready(struct mtd_info *mtd); |
@@ -49,12 +51,13 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | |||
49 | /* The maximum number of NAND chips in an array */ | 51 | /* The maximum number of NAND chips in an array */ |
50 | #define NAND_MAX_CHIPS 8 | 52 | #define NAND_MAX_CHIPS 8 |
51 | 53 | ||
52 | /* This constant declares the max. oobsize / page, which | 54 | /* |
55 | * This constant declares the max. oobsize / page, which | ||
53 | * is supported now. If you add a chip with bigger oobsize/page | 56 | * is supported now. If you add a chip with bigger oobsize/page |
54 | * adjust this accordingly. | 57 | * adjust this accordingly. |
55 | */ | 58 | */ |
56 | #define NAND_MAX_OOBSIZE 256 | 59 | #define NAND_MAX_OOBSIZE 576 |
57 | #define NAND_MAX_PAGESIZE 4096 | 60 | #define NAND_MAX_PAGESIZE 8192 |
58 | 61 | ||
59 | /* | 62 | /* |
60 | * Constants for hardware specific CLE/ALE/NCE function | 63 | * Constants for hardware specific CLE/ALE/NCE function |
@@ -88,6 +91,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | |||
88 | #define NAND_CMD_RNDIN 0x85 | 91 | #define NAND_CMD_RNDIN 0x85 |
89 | #define NAND_CMD_READID 0x90 | 92 | #define NAND_CMD_READID 0x90 |
90 | #define NAND_CMD_ERASE2 0xd0 | 93 | #define NAND_CMD_ERASE2 0xd0 |
94 | #define NAND_CMD_PARAM 0xec | ||
91 | #define NAND_CMD_RESET 0xff | 95 | #define NAND_CMD_RESET 0xff |
92 | 96 | ||
93 | #define NAND_CMD_LOCK 0x2a | 97 | #define NAND_CMD_LOCK 0x2a |
@@ -152,9 +156,10 @@ typedef enum { | |||
152 | #define NAND_GET_DEVICE 0x80 | 156 | #define NAND_GET_DEVICE 0x80 |
153 | 157 | ||
154 | 158 | ||
155 | /* Option constants for bizarre disfunctionality and real | 159 | /* |
156 | * features | 160 | * Option constants for bizarre disfunctionality and real |
157 | */ | 161 | * features. |
162 | */ | ||
158 | /* Chip can not auto increment pages */ | 163 | /* Chip can not auto increment pages */ |
159 | #define NAND_NO_AUTOINCR 0x00000001 | 164 | #define NAND_NO_AUTOINCR 0x00000001 |
160 | /* Buswitdh is 16 bit */ | 165 | /* Buswitdh is 16 bit */ |
@@ -165,19 +170,27 @@ typedef enum { | |||
165 | #define NAND_CACHEPRG 0x00000008 | 170 | #define NAND_CACHEPRG 0x00000008 |
166 | /* Chip has copy back function */ | 171 | /* Chip has copy back function */ |
167 | #define NAND_COPYBACK 0x00000010 | 172 | #define NAND_COPYBACK 0x00000010 |
168 | /* AND Chip which has 4 banks and a confusing page / block | 173 | /* |
169 | * assignment. See Renesas datasheet for further information */ | 174 | * AND Chip which has 4 banks and a confusing page / block |
175 | * assignment. See Renesas datasheet for further information. | ||
176 | */ | ||
170 | #define NAND_IS_AND 0x00000020 | 177 | #define NAND_IS_AND 0x00000020 |
171 | /* Chip has a array of 4 pages which can be read without | 178 | /* |
172 | * additional ready /busy waits */ | 179 | * Chip has a array of 4 pages which can be read without |
180 | * additional ready /busy waits. | ||
181 | */ | ||
173 | #define NAND_4PAGE_ARRAY 0x00000040 | 182 | #define NAND_4PAGE_ARRAY 0x00000040 |
174 | /* Chip requires that BBT is periodically rewritten to prevent | 183 | /* |
184 | * Chip requires that BBT is periodically rewritten to prevent | ||
175 | * bits from adjacent blocks from 'leaking' in altering data. | 185 | * bits from adjacent blocks from 'leaking' in altering data. |
176 | * This happens with the Renesas AG-AND chips, possibly others. */ | 186 | * This happens with the Renesas AG-AND chips, possibly others. |
187 | */ | ||
177 | #define BBT_AUTO_REFRESH 0x00000080 | 188 | #define BBT_AUTO_REFRESH 0x00000080 |
178 | /* Chip does not require ready check on read. True | 189 | /* |
190 | * Chip does not require ready check on read. True | ||
179 | * for all large page devices, as they do not support | 191 | * for all large page devices, as they do not support |
180 | * autoincrement.*/ | 192 | * autoincrement. |
193 | */ | ||
181 | #define NAND_NO_READRDY 0x00000100 | 194 | #define NAND_NO_READRDY 0x00000100 |
182 | /* Chip does not allow subpage writes */ | 195 | /* Chip does not allow subpage writes */ |
183 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 196 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
@@ -205,16 +218,27 @@ typedef enum { | |||
205 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) | 218 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
206 | 219 | ||
207 | /* Non chip related options */ | 220 | /* Non chip related options */ |
208 | /* Use a flash based bad block table. This option is passed to the | 221 | /* |
209 | * default bad block table function. */ | 222 | * Use a flash based bad block table. OOB identifier is saved in OOB area. |
223 | * This option is passed to the default bad block table function. | ||
224 | */ | ||
210 | #define NAND_USE_FLASH_BBT 0x00010000 | 225 | #define NAND_USE_FLASH_BBT 0x00010000 |
211 | /* This option skips the bbt scan during initialization. */ | 226 | /* This option skips the bbt scan during initialization. */ |
212 | #define NAND_SKIP_BBTSCAN 0x00020000 | 227 | #define NAND_SKIP_BBTSCAN 0x00020000 |
213 | /* This option is defined if the board driver allocates its own buffers | 228 | /* |
214 | (e.g. because it needs them DMA-coherent */ | 229 | * This option is defined if the board driver allocates its own buffers |
230 | * (e.g. because it needs them DMA-coherent). | ||
231 | */ | ||
215 | #define NAND_OWN_BUFFERS 0x00040000 | 232 | #define NAND_OWN_BUFFERS 0x00040000 |
216 | /* Chip may not exist, so silence any errors in scan */ | 233 | /* Chip may not exist, so silence any errors in scan */ |
217 | #define NAND_SCAN_SILENT_NODEV 0x00080000 | 234 | #define NAND_SCAN_SILENT_NODEV 0x00080000 |
235 | /* | ||
236 | * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch | ||
237 | * the OOB area. | ||
238 | */ | ||
239 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 | ||
240 | /* Create an empty BBT with no vendor information if the BBT is available */ | ||
241 | #define NAND_CREATE_EMPTY_BBT 0x00200000 | ||
218 | 242 | ||
219 | /* Options set by nand scan */ | 243 | /* Options set by nand scan */ |
220 | /* Nand scan has allocated controller struct */ | 244 | /* Nand scan has allocated controller struct */ |
@@ -227,15 +251,80 @@ typedef enum { | |||
227 | /* Keep gcc happy */ | 251 | /* Keep gcc happy */ |
228 | struct nand_chip; | 252 | struct nand_chip; |
229 | 253 | ||
254 | struct nand_onfi_params { | ||
255 | /* rev info and features block */ | ||
256 | /* 'O' 'N' 'F' 'I' */ | ||
257 | u8 sig[4]; | ||
258 | __le16 revision; | ||
259 | __le16 features; | ||
260 | __le16 opt_cmd; | ||
261 | u8 reserved[22]; | ||
262 | |||
263 | /* manufacturer information block */ | ||
264 | char manufacturer[12]; | ||
265 | char model[20]; | ||
266 | u8 jedec_id; | ||
267 | __le16 date_code; | ||
268 | u8 reserved2[13]; | ||
269 | |||
270 | /* memory organization block */ | ||
271 | __le32 byte_per_page; | ||
272 | __le16 spare_bytes_per_page; | ||
273 | __le32 data_bytes_per_ppage; | ||
274 | __le16 spare_bytes_per_ppage; | ||
275 | __le32 pages_per_block; | ||
276 | __le32 blocks_per_lun; | ||
277 | u8 lun_count; | ||
278 | u8 addr_cycles; | ||
279 | u8 bits_per_cell; | ||
280 | __le16 bb_per_lun; | ||
281 | __le16 block_endurance; | ||
282 | u8 guaranteed_good_blocks; | ||
283 | __le16 guaranteed_block_endurance; | ||
284 | u8 programs_per_page; | ||
285 | u8 ppage_attr; | ||
286 | u8 ecc_bits; | ||
287 | u8 interleaved_bits; | ||
288 | u8 interleaved_ops; | ||
289 | u8 reserved3[13]; | ||
290 | |||
291 | /* electrical parameter block */ | ||
292 | u8 io_pin_capacitance_max; | ||
293 | __le16 async_timing_mode; | ||
294 | __le16 program_cache_timing_mode; | ||
295 | __le16 t_prog; | ||
296 | __le16 t_bers; | ||
297 | __le16 t_r; | ||
298 | __le16 t_ccs; | ||
299 | __le16 src_sync_timing_mode; | ||
300 | __le16 src_ssync_features; | ||
301 | __le16 clk_pin_capacitance_typ; | ||
302 | __le16 io_pin_capacitance_typ; | ||
303 | __le16 input_pin_capacitance_typ; | ||
304 | u8 input_pin_capacitance_max; | ||
305 | u8 driver_strenght_support; | ||
306 | __le16 t_int_r; | ||
307 | __le16 t_ald; | ||
308 | u8 reserved4[7]; | ||
309 | |||
310 | /* vendor */ | ||
311 | u8 reserved5[90]; | ||
312 | |||
313 | __le16 crc; | ||
314 | } __attribute__((packed)); | ||
315 | |||
316 | #define ONFI_CRC_BASE 0x4F4E | ||
317 | |||
230 | /** | 318 | /** |
231 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices | 319 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices |
232 | * @lock: protection lock | 320 | * @lock: protection lock |
233 | * @active: the mtd device which holds the controller currently | 321 | * @active: the mtd device which holds the controller currently |
234 | * @wq: wait queue to sleep on if a NAND operation is in progress | 322 | * @wq: wait queue to sleep on if a NAND operation is in |
235 | * used instead of the per chip wait queue when a hw controller is available | 323 | * progress used instead of the per chip wait queue |
324 | * when a hw controller is available. | ||
236 | */ | 325 | */ |
237 | struct nand_hw_control { | 326 | struct nand_hw_control { |
238 | spinlock_t lock; | 327 | spinlock_t lock; |
239 | struct nand_chip *active; | 328 | struct nand_chip *active; |
240 | wait_queue_head_t wq; | 329 | wait_queue_head_t wq; |
241 | }; | 330 | }; |
@@ -256,51 +345,42 @@ struct nand_hw_control { | |||
256 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 345 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
257 | * @read_page_raw: function to read a raw page without ECC | 346 | * @read_page_raw: function to read a raw page without ECC |
258 | * @write_page_raw: function to write a raw page without ECC | 347 | * @write_page_raw: function to write a raw page without ECC |
259 | * @read_page: function to read a page according to the ecc generator requirements | 348 | * @read_page: function to read a page according to the ecc generator |
349 | * requirements. | ||
260 | * @read_subpage: function to read parts of the page covered by ECC. | 350 | * @read_subpage: function to read parts of the page covered by ECC. |
261 | * @write_page: function to write a page according to the ecc generator requirements | 351 | * @write_page: function to write a page according to the ecc generator |
352 | * requirements. | ||
262 | * @read_oob: function to read chip OOB data | 353 | * @read_oob: function to read chip OOB data |
263 | * @write_oob: function to write chip OOB data | 354 | * @write_oob: function to write chip OOB data |
264 | */ | 355 | */ |
265 | struct nand_ecc_ctrl { | 356 | struct nand_ecc_ctrl { |
266 | nand_ecc_modes_t mode; | 357 | nand_ecc_modes_t mode; |
267 | int steps; | 358 | int steps; |
268 | int size; | 359 | int size; |
269 | int bytes; | 360 | int bytes; |
270 | int total; | 361 | int total; |
271 | int prepad; | 362 | int prepad; |
272 | int postpad; | 363 | int postpad; |
273 | struct nand_ecclayout *layout; | 364 | struct nand_ecclayout *layout; |
274 | void (*hwctl)(struct mtd_info *mtd, int mode); | 365 | void (*hwctl)(struct mtd_info *mtd, int mode); |
275 | int (*calculate)(struct mtd_info *mtd, | 366 | int (*calculate)(struct mtd_info *mtd, const uint8_t *dat, |
276 | const uint8_t *dat, | 367 | uint8_t *ecc_code); |
277 | uint8_t *ecc_code); | 368 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc, |
278 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, | 369 | uint8_t *calc_ecc); |
279 | uint8_t *read_ecc, | 370 | int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, |
280 | uint8_t *calc_ecc); | 371 | uint8_t *buf, int page); |
281 | int (*read_page_raw)(struct mtd_info *mtd, | 372 | void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, |
282 | struct nand_chip *chip, | 373 | const uint8_t *buf); |
283 | uint8_t *buf, int page); | 374 | int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, |
284 | void (*write_page_raw)(struct mtd_info *mtd, | 375 | uint8_t *buf, int page); |
285 | struct nand_chip *chip, | 376 | int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, |
286 | const uint8_t *buf); | 377 | uint32_t offs, uint32_t len, uint8_t *buf); |
287 | int (*read_page)(struct mtd_info *mtd, | 378 | void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
288 | struct nand_chip *chip, | 379 | const uint8_t *buf); |
289 | uint8_t *buf, int page); | 380 | int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, |
290 | int (*read_subpage)(struct mtd_info *mtd, | 381 | int sndcmd); |
291 | struct nand_chip *chip, | 382 | int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, |
292 | uint32_t offs, uint32_t len, | 383 | int page); |
293 | uint8_t *buf); | ||
294 | void (*write_page)(struct mtd_info *mtd, | ||
295 | struct nand_chip *chip, | ||
296 | const uint8_t *buf); | ||
297 | int (*read_oob)(struct mtd_info *mtd, | ||
298 | struct nand_chip *chip, | ||
299 | int page, | ||
300 | int sndcmd); | ||
301 | int (*write_oob)(struct mtd_info *mtd, | ||
302 | struct nand_chip *chip, | ||
303 | int page); | ||
304 | }; | 384 | }; |
305 | 385 | ||
306 | /** | 386 | /** |
@@ -320,102 +400,132 @@ struct nand_buffers { | |||
320 | 400 | ||
321 | /** | 401 | /** |
322 | * struct nand_chip - NAND Private Flash Chip Data | 402 | * struct nand_chip - NAND Private Flash Chip Data |
323 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device | 403 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the |
324 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device | 404 | * flash device |
405 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the | ||
406 | * flash device. | ||
325 | * @read_byte: [REPLACEABLE] read one byte from the chip | 407 | * @read_byte: [REPLACEABLE] read one byte from the chip |
326 | * @read_word: [REPLACEABLE] read one word from the chip | 408 | * @read_word: [REPLACEABLE] read one word from the chip |
327 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip | 409 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip |
328 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer | 410 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer |
329 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data | 411 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip |
412 | * data. | ||
330 | * @select_chip: [REPLACEABLE] select chip nr | 413 | * @select_chip: [REPLACEABLE] select chip nr |
331 | * @block_bad: [REPLACEABLE] check, if the block is bad | 414 | * @block_bad: [REPLACEABLE] check, if the block is bad |
332 | * @block_markbad: [REPLACEABLE] mark the block bad | 415 | * @block_markbad: [REPLACEABLE] mark the block bad |
333 | * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling | 416 | * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling |
334 | * ALE/CLE/nCE. Also used to write command and address | 417 | * ALE/CLE/nCE. Also used to write command and address |
335 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line | 418 | * @init_size: [BOARDSPECIFIC] hardwarespecific funtion for setting |
336 | * If set to NULL no access to ready/busy is available and the ready/busy information | 419 | * mtd->oobsize, mtd->writesize and so on. |
337 | * is read from the chip status register | 420 | * @id_data contains the 8 bytes values of NAND_CMD_READID. |
338 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip | 421 | * Return with the bus width. |
339 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready | 422 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing |
423 | * device ready/busy line. If set to NULL no access to | ||
424 | * ready/busy is available and the ready/busy information | ||
425 | * is read from the chip status register. | ||
426 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing | ||
427 | * commands to the chip. | ||
428 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on | ||
429 | * ready. | ||
340 | * @ecc: [BOARDSPECIFIC] ecc control ctructure | 430 | * @ecc: [BOARDSPECIFIC] ecc control ctructure |
341 | * @buffers: buffer structure for read/write | 431 | * @buffers: buffer structure for read/write |
342 | * @hwcontrol: platform-specific hardware control structure | 432 | * @hwcontrol: platform-specific hardware control structure |
343 | * @ops: oob operation operands | 433 | * @ops: oob operation operands |
344 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 434 | * @erase_cmd: [INTERN] erase command write function, selectable due |
435 | * to AND support. | ||
345 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 436 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
346 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 437 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering |
438 | * data from array to read regs (tR). | ||
347 | * @state: [INTERN] the current state of the NAND device | 439 | * @state: [INTERN] the current state of the NAND device |
348 | * @oob_poi: poison value buffer | 440 | * @oob_poi: poison value buffer |
349 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 441 | * @page_shift: [INTERN] number of address bits in a page (column |
442 | * address bits). | ||
350 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 443 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
351 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 444 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
352 | * @chip_shift: [INTERN] number of address bits in one chip | 445 | * @chip_shift: [INTERN] number of address bits in one chip |
353 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 446 | * @options: [BOARDSPECIFIC] various chip options. They can partly |
354 | * special functionality. See the defines for further explanation | 447 | * be set to inform nand_scan about special functionality. |
355 | * @badblockpos: [INTERN] position of the bad block marker in the oob area | 448 | * See the defines for further explanation. |
449 | * @badblockpos: [INTERN] position of the bad block marker in the oob | ||
450 | * area. | ||
356 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 451 | * @cellinfo: [INTERN] MLC/multichip data from chip ident |
357 | * @numchips: [INTERN] number of physical chips | 452 | * @numchips: [INTERN] number of physical chips |
358 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 453 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
359 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 | 454 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 |
360 | * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf | 455 | * @pagebuf: [INTERN] holds the pagenumber which is currently in |
456 | * data_buf. | ||
361 | * @subpagesize: [INTERN] holds the subpagesize | 457 | * @subpagesize: [INTERN] holds the subpagesize |
458 | * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded), | ||
459 | * non 0 if ONFI supported. | ||
460 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is | ||
461 | * supported, 0 otherwise. | ||
362 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | 462 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme |
363 | * @bbt: [INTERN] bad block table pointer | 463 | * @bbt: [INTERN] bad block table pointer |
364 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup | 464 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash |
465 | * lookup. | ||
365 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor | 466 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor |
366 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan | 467 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial |
367 | * @controller: [REPLACEABLE] a pointer to a hardware controller structure | 468 | * bad block scan. |
368 | * which is shared among multiple independend devices | 469 | * @controller: [REPLACEABLE] a pointer to a hardware controller |
470 | * structure which is shared among multiple independend | ||
471 | * devices. | ||
369 | * @priv: [OPTIONAL] pointer to private chip date | 472 | * @priv: [OPTIONAL] pointer to private chip date |
370 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 473 | * @errstat: [OPTIONAL] hardware specific function to perform |
371 | * (determine if errors are correctable) | 474 | * additional error status checks (determine if errors are |
475 | * correctable). | ||
372 | * @write_page: [REPLACEABLE] High-level page write function | 476 | * @write_page: [REPLACEABLE] High-level page write function |
373 | */ | 477 | */ |
374 | 478 | ||
375 | struct nand_chip { | 479 | struct nand_chip { |
376 | void __iomem *IO_ADDR_R; | 480 | void __iomem *IO_ADDR_R; |
377 | void __iomem *IO_ADDR_W; | 481 | void __iomem *IO_ADDR_W; |
378 | 482 | ||
379 | uint8_t (*read_byte)(struct mtd_info *mtd); | 483 | uint8_t (*read_byte)(struct mtd_info *mtd); |
380 | u16 (*read_word)(struct mtd_info *mtd); | 484 | u16 (*read_word)(struct mtd_info *mtd); |
381 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); | 485 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
382 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); | 486 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
383 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); | 487 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
384 | void (*select_chip)(struct mtd_info *mtd, int chip); | 488 | void (*select_chip)(struct mtd_info *mtd, int chip); |
385 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); | 489 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); |
386 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 490 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
387 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 491 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); |
388 | unsigned int ctrl); | 492 | int (*init_size)(struct mtd_info *mtd, struct nand_chip *this, |
389 | int (*dev_ready)(struct mtd_info *mtd); | 493 | u8 *id_data); |
390 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); | 494 | int (*dev_ready)(struct mtd_info *mtd); |
391 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); | 495 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, |
392 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 496 | int page_addr); |
393 | int (*scan_bbt)(struct mtd_info *mtd); | 497 | int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
394 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | 498 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
395 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | 499 | int (*scan_bbt)(struct mtd_info *mtd); |
396 | const uint8_t *buf, int page, int cached, int raw); | 500 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, |
397 | 501 | int status, int page); | |
398 | int chip_delay; | 502 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
399 | unsigned int options; | 503 | const uint8_t *buf, int page, int cached, int raw); |
400 | 504 | ||
401 | int page_shift; | 505 | int chip_delay; |
402 | int phys_erase_shift; | 506 | unsigned int options; |
403 | int bbt_erase_shift; | 507 | |
404 | int chip_shift; | 508 | int page_shift; |
405 | int numchips; | 509 | int phys_erase_shift; |
406 | uint64_t chipsize; | 510 | int bbt_erase_shift; |
407 | int pagemask; | 511 | int chip_shift; |
408 | int pagebuf; | 512 | int numchips; |
409 | int subpagesize; | 513 | uint64_t chipsize; |
410 | uint8_t cellinfo; | 514 | int pagemask; |
411 | int badblockpos; | 515 | int pagebuf; |
412 | int badblockbits; | 516 | int subpagesize; |
413 | 517 | uint8_t cellinfo; | |
414 | flstate_t state; | 518 | int badblockpos; |
415 | 519 | int badblockbits; | |
416 | uint8_t *oob_poi; | 520 | |
417 | struct nand_hw_control *controller; | 521 | int onfi_version; |
418 | struct nand_ecclayout *ecclayout; | 522 | struct nand_onfi_params onfi_params; |
523 | |||
524 | flstate_t state; | ||
525 | |||
526 | uint8_t *oob_poi; | ||
527 | struct nand_hw_control *controller; | ||
528 | struct nand_ecclayout *ecclayout; | ||
419 | 529 | ||
420 | struct nand_ecc_ctrl ecc; | 530 | struct nand_ecc_ctrl ecc; |
421 | struct nand_buffers *buffers; | 531 | struct nand_buffers *buffers; |
@@ -423,13 +533,13 @@ struct nand_chip { | |||
423 | 533 | ||
424 | struct mtd_oob_ops ops; | 534 | struct mtd_oob_ops ops; |
425 | 535 | ||
426 | uint8_t *bbt; | 536 | uint8_t *bbt; |
427 | struct nand_bbt_descr *bbt_td; | 537 | struct nand_bbt_descr *bbt_td; |
428 | struct nand_bbt_descr *bbt_md; | 538 | struct nand_bbt_descr *bbt_md; |
429 | 539 | ||
430 | struct nand_bbt_descr *badblock_pattern; | 540 | struct nand_bbt_descr *badblock_pattern; |
431 | 541 | ||
432 | void *priv; | 542 | void *priv; |
433 | }; | 543 | }; |
434 | 544 | ||
435 | /* | 545 | /* |
@@ -473,7 +583,7 @@ struct nand_flash_dev { | |||
473 | */ | 583 | */ |
474 | struct nand_manufacturers { | 584 | struct nand_manufacturers { |
475 | int id; | 585 | int id; |
476 | char * name; | 586 | char *name; |
477 | }; | 587 | }; |
478 | 588 | ||
479 | extern struct nand_flash_dev nand_flash_ids[]; | 589 | extern struct nand_flash_dev nand_flash_ids[]; |
@@ -486,7 +596,7 @@ extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt); | |||
486 | extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | 596 | extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, |
487 | int allowbbt); | 597 | int allowbbt); |
488 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | 598 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, |
489 | size_t * retlen, uint8_t * buf); | 599 | size_t *retlen, uint8_t *buf); |
490 | 600 | ||
491 | /** | 601 | /** |
492 | * struct platform_nand_chip - chip level device structure | 602 | * struct platform_nand_chip - chip level device structure |
@@ -502,17 +612,16 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
502 | * @priv: hardware controller specific settings | 612 | * @priv: hardware controller specific settings |
503 | */ | 613 | */ |
504 | struct platform_nand_chip { | 614 | struct platform_nand_chip { |
505 | int nr_chips; | 615 | int nr_chips; |
506 | int chip_offset; | 616 | int chip_offset; |
507 | int nr_partitions; | 617 | int nr_partitions; |
508 | struct mtd_partition *partitions; | 618 | struct mtd_partition *partitions; |
509 | struct nand_ecclayout *ecclayout; | 619 | struct nand_ecclayout *ecclayout; |
510 | int chip_delay; | 620 | int chip_delay; |
511 | unsigned int options; | 621 | unsigned int options; |
512 | const char **part_probe_types; | 622 | const char **part_probe_types; |
513 | void (*set_parts)(uint64_t size, | 623 | void (*set_parts)(uint64_t size, struct platform_nand_chip *chip); |
514 | struct platform_nand_chip *chip); | 624 | void *priv; |
515 | void *priv; | ||
516 | }; | 625 | }; |
517 | 626 | ||
518 | /* Keep gcc happy */ | 627 | /* Keep gcc happy */ |
@@ -534,18 +643,15 @@ struct platform_device; | |||
534 | * All fields are optional and depend on the hardware driver requirements | 643 | * All fields are optional and depend on the hardware driver requirements |
535 | */ | 644 | */ |
536 | struct platform_nand_ctrl { | 645 | struct platform_nand_ctrl { |
537 | int (*probe)(struct platform_device *pdev); | 646 | int (*probe)(struct platform_device *pdev); |
538 | void (*remove)(struct platform_device *pdev); | 647 | void (*remove)(struct platform_device *pdev); |
539 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 648 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
540 | int (*dev_ready)(struct mtd_info *mtd); | 649 | int (*dev_ready)(struct mtd_info *mtd); |
541 | void (*select_chip)(struct mtd_info *mtd, int chip); | 650 | void (*select_chip)(struct mtd_info *mtd, int chip); |
542 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 651 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); |
543 | unsigned int ctrl); | 652 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
544 | void (*write_buf)(struct mtd_info *mtd, | 653 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
545 | const uint8_t *buf, int len); | 654 | void *priv; |
546 | void (*read_buf)(struct mtd_info *mtd, | ||
547 | uint8_t *buf, int len); | ||
548 | void *priv; | ||
549 | }; | 655 | }; |
550 | 656 | ||
551 | /** | 657 | /** |
@@ -554,8 +660,8 @@ struct platform_nand_ctrl { | |||
554 | * @ctrl: controller level device structure | 660 | * @ctrl: controller level device structure |
555 | */ | 661 | */ |
556 | struct platform_nand_data { | 662 | struct platform_nand_data { |
557 | struct platform_nand_chip chip; | 663 | struct platform_nand_chip chip; |
558 | struct platform_nand_ctrl ctrl; | 664 | struct platform_nand_ctrl ctrl; |
559 | }; | 665 | }; |
560 | 666 | ||
561 | /* Some helpers to access the data structures */ | 667 | /* Some helpers to access the data structures */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 274b6196091d..2b54316591d2 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -39,7 +39,7 @@ struct mtd_partition { | |||
39 | uint64_t size; /* partition size */ | 39 | uint64_t size; /* partition size */ |
40 | uint64_t offset; /* offset within the master MTD space */ | 40 | uint64_t offset; /* offset within the master MTD space */ |
41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ | 41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ |
42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ | 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #define MTDPART_OFS_NXTBLK (-2) | 45 | #define MTDPART_OFS_NXTBLK (-2) |
@@ -89,4 +89,9 @@ static inline int mtd_has_cmdlinepart(void) { return 1; } | |||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | 89 | static inline int mtd_has_cmdlinepart(void) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | int mtd_is_master(struct mtd_info *mtd); | ||
93 | int mtd_add_partition(struct mtd_info *master, char *name, | ||
94 | long long offset, long long length); | ||
95 | int mtd_del_partition(struct mtd_info *master, int partno); | ||
96 | |||
92 | #endif | 97 | #endif |
diff --git a/include/linux/mtd/super.h b/include/linux/mtd/super.h index 4016dd6fe336..f456230f9330 100644 --- a/include/linux/mtd/super.h +++ b/include/linux/mtd/super.h | |||
@@ -18,10 +18,9 @@ | |||
18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
19 | #include <linux/mount.h> | 19 | #include <linux/mount.h> |
20 | 20 | ||
21 | extern int get_sb_mtd(struct file_system_type *fs_type, int flags, | 21 | extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags, |
22 | const char *dev_name, void *data, | 22 | const char *dev_name, void *data, |
23 | int (*fill_super)(struct super_block *, void *, int), | 23 | int (*fill_super)(struct super_block *, void *, int)); |
24 | struct vfsmount *mnt); | ||
25 | extern void kill_mtd_super(struct super_block *sb); | 24 | extern void kill_mtd_super(struct super_block *sb); |
26 | 25 | ||
27 | 26 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 072652d94d9f..d8fd2c23a1b9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1554,6 +1554,11 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) | |||
1554 | 1554 | ||
1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) | 1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) |
1556 | { | 1556 | { |
1557 | if (WARN_ON(!dev_queue)) { | ||
1558 | printk(KERN_INFO "netif_stop_queue() cannot be called before " | ||
1559 | "register_netdev()"); | ||
1560 | return; | ||
1561 | } | ||
1557 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1562 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); |
1558 | } | 1563 | } |
1559 | 1564 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 89341c32631a..03317c8d4077 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -215,7 +215,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | |||
215 | int ret; | 215 | int ret; |
216 | 216 | ||
217 | if (!cond || | 217 | if (!cond || |
218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) | 218 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) |
219 | ret = okfn(skb); | 219 | ret = okfn(skb); |
220 | return ret; | 220 | return ret; |
221 | } | 221 | } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 87e2c2e7aed3..c6bcfe93b9ca 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2465,6 +2465,7 @@ | |||
2465 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 | 2465 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 |
2466 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 | 2466 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 |
2467 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f | 2467 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
2468 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | ||
2468 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40 | 2469 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40 |
2469 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2470 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
2470 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2471 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 057bf22a8323..40150f345982 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -747,6 +747,16 @@ struct perf_event { | |||
747 | u64 tstamp_running; | 747 | u64 tstamp_running; |
748 | u64 tstamp_stopped; | 748 | u64 tstamp_stopped; |
749 | 749 | ||
750 | /* | ||
751 | * timestamp shadows the actual context timing but it can | ||
752 | * be safely used in NMI interrupt context. It reflects the | ||
753 | * context time as it was when the event was last scheduled in. | ||
754 | * | ||
755 | * ctx_time already accounts for ctx->timestamp. Therefore to | ||
756 | * compute ctx_time for a sample, simply add perf_clock(). | ||
757 | */ | ||
758 | u64 shadow_ctx_time; | ||
759 | |||
750 | struct perf_event_attr attr; | 760 | struct perf_event_attr attr; |
751 | struct hw_perf_event hw; | 761 | struct hw_perf_event hw; |
752 | 762 | ||
diff --git a/include/linux/printk.h b/include/linux/printk.h new file mode 100644 index 000000000000..b772ca5fbdf0 --- /dev/null +++ b/include/linux/printk.h | |||
@@ -0,0 +1,248 @@ | |||
1 | #ifndef __KERNEL_PRINTK__ | ||
2 | #define __KERNEL_PRINTK__ | ||
3 | |||
4 | extern const char linux_banner[]; | ||
5 | extern const char linux_proc_banner[]; | ||
6 | |||
7 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
9 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
10 | #define KERN_ERR "<3>" /* error conditions */ | ||
11 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
13 | #define KERN_INFO "<6>" /* informational */ | ||
14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
15 | |||
16 | /* Use the default kernel loglevel */ | ||
17 | #define KERN_DEFAULT "<d>" | ||
18 | /* | ||
19 | * Annotation for a "continued" line of log printout (only done after a | ||
20 | * line that had no enclosing \n). Only to be used by core/arch code | ||
21 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
22 | */ | ||
23 | #define KERN_CONT "<c>" | ||
24 | |||
25 | extern int console_printk[]; | ||
26 | |||
27 | #define console_loglevel (console_printk[0]) | ||
28 | #define default_message_loglevel (console_printk[1]) | ||
29 | #define minimum_console_loglevel (console_printk[2]) | ||
30 | #define default_console_loglevel (console_printk[3]) | ||
31 | |||
32 | struct va_format { | ||
33 | const char *fmt; | ||
34 | va_list *va; | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * FW_BUG | ||
39 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
40 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
41 | * should be able to fix this issue or at least get a concrete idea of the | ||
42 | * problem by reading your message without the need of looking at the kernel | ||
43 | * code. | ||
44 | * | ||
45 | * Use it for definite and high priority BIOS bugs. | ||
46 | * | ||
47 | * FW_WARN | ||
48 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
49 | * and medium priority BIOS bugs. | ||
50 | * | ||
51 | * FW_INFO | ||
52 | * Use this one if you want to tell the user or vendor about something | ||
53 | * suspicious, but generally harmless related to the firmware. | ||
54 | * | ||
55 | * Use it for information or very low priority BIOS bugs. | ||
56 | */ | ||
57 | #define FW_BUG "[Firmware Bug]: " | ||
58 | #define FW_WARN "[Firmware Warn]: " | ||
59 | #define FW_INFO "[Firmware Info]: " | ||
60 | |||
61 | /* | ||
62 | * HW_ERR | ||
63 | * Add this to a message for hardware errors, so that user can report | ||
64 | * it to hardware vendor instead of LKML or software vendor. | ||
65 | */ | ||
66 | #define HW_ERR "[Hardware Error]: " | ||
67 | |||
68 | #ifdef CONFIG_PRINTK | ||
69 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
70 | __attribute__ ((format (printf, 1, 0))); | ||
71 | asmlinkage int printk(const char * fmt, ...) | ||
72 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
73 | |||
74 | /* | ||
75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
76 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
77 | * printk_ratelimited() or plain old __ratelimit(). | ||
78 | */ | ||
79 | extern int __printk_ratelimit(const char *func); | ||
80 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
81 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
82 | unsigned int interval_msec); | ||
83 | |||
84 | extern int printk_delay_msec; | ||
85 | extern int dmesg_restrict; | ||
86 | |||
87 | /* | ||
88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
89 | */ | ||
90 | #define printk_once(x...) ({ \ | ||
91 | static bool __print_once; \ | ||
92 | \ | ||
93 | if (!__print_once) { \ | ||
94 | __print_once = true; \ | ||
95 | printk(x); \ | ||
96 | } \ | ||
97 | }) | ||
98 | |||
99 | void log_buf_kexec_setup(void); | ||
100 | #else | ||
101 | static inline int vprintk(const char *s, va_list args) | ||
102 | __attribute__ ((format (printf, 1, 0))); | ||
103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
104 | static inline int printk(const char *s, ...) | ||
105 | __attribute__ ((format (printf, 1, 2))); | ||
106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
107 | static inline int printk_ratelimit(void) { return 0; } | ||
108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
109 | unsigned int interval_msec) \ | ||
110 | { return false; } | ||
111 | |||
112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
113 | #define printk_once(x...) printk(x) | ||
114 | |||
115 | static inline void log_buf_kexec_setup(void) | ||
116 | { | ||
117 | } | ||
118 | #endif | ||
119 | |||
120 | /* | ||
121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
122 | * gcc's format and side-effect checking. | ||
123 | */ | ||
124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
125 | int no_printk(const char *s, ...) { return 0; } | ||
126 | |||
127 | extern int printk_needs_cpu(int cpu); | ||
128 | extern void printk_tick(void); | ||
129 | |||
130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
131 | early_printk(const char *fmt, ...); | ||
132 | |||
133 | static inline void console_silent(void) | ||
134 | { | ||
135 | console_loglevel = 0; | ||
136 | } | ||
137 | |||
138 | static inline void console_verbose(void) | ||
139 | { | ||
140 | if (console_loglevel) | ||
141 | console_loglevel = 15; | ||
142 | } | ||
143 | |||
144 | extern void dump_stack(void) __cold; | ||
145 | |||
146 | enum { | ||
147 | DUMP_PREFIX_NONE, | ||
148 | DUMP_PREFIX_ADDRESS, | ||
149 | DUMP_PREFIX_OFFSET | ||
150 | }; | ||
151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
152 | int rowsize, int groupsize, | ||
153 | char *linebuf, size_t linebuflen, bool ascii); | ||
154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
155 | int prefix_type, int rowsize, int groupsize, | ||
156 | const void *buf, size_t len, bool ascii); | ||
157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
158 | const void *buf, size_t len); | ||
159 | |||
160 | #ifndef pr_fmt | ||
161 | #define pr_fmt(fmt) fmt | ||
162 | #endif | ||
163 | |||
164 | #define pr_emerg(fmt, ...) \ | ||
165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
166 | #define pr_alert(fmt, ...) \ | ||
167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
168 | #define pr_crit(fmt, ...) \ | ||
169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
170 | #define pr_err(fmt, ...) \ | ||
171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
172 | #define pr_warning(fmt, ...) \ | ||
173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
174 | #define pr_warn pr_warning | ||
175 | #define pr_notice(fmt, ...) \ | ||
176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
177 | #define pr_info(fmt, ...) \ | ||
178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
179 | #define pr_cont(fmt, ...) \ | ||
180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
181 | |||
182 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
183 | #ifdef DEBUG | ||
184 | #define pr_devel(fmt, ...) \ | ||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
186 | #else | ||
187 | #define pr_devel(fmt, ...) \ | ||
188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
189 | #endif | ||
190 | |||
191 | /* If you are writing a driver, please use dev_dbg instead */ | ||
192 | #if defined(DEBUG) | ||
193 | #define pr_debug(fmt, ...) \ | ||
194 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
195 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
196 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
197 | #define pr_debug(fmt, ...) \ | ||
198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
199 | #else | ||
200 | #define pr_debug(fmt, ...) \ | ||
201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
202 | #endif | ||
203 | |||
204 | /* | ||
205 | * ratelimited messages with local ratelimit_state, | ||
206 | * no local ratelimit_state used in the !PRINTK case | ||
207 | */ | ||
208 | #ifdef CONFIG_PRINTK | ||
209 | #define printk_ratelimited(fmt, ...) ({ \ | ||
210 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
211 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
212 | DEFAULT_RATELIMIT_BURST); \ | ||
213 | \ | ||
214 | if (__ratelimit(&_rs)) \ | ||
215 | printk(fmt, ##__VA_ARGS__); \ | ||
216 | }) | ||
217 | #else | ||
218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
219 | #define printk_ratelimited printk | ||
220 | #endif | ||
221 | |||
222 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
224 | #define pr_alert_ratelimited(fmt, ...) \ | ||
225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
226 | #define pr_crit_ratelimited(fmt, ...) \ | ||
227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
228 | #define pr_err_ratelimited(fmt, ...) \ | ||
229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
230 | #define pr_warning_ratelimited(fmt, ...) \ | ||
231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
232 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
235 | #define pr_info_ratelimited(fmt, ...) \ | ||
236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
237 | /* no pr_cont_ratelimited, don't do that... */ | ||
238 | /* If you are writing a driver, please use dev_dbg instead */ | ||
239 | #if defined(DEBUG) | ||
240 | #define pr_debug_ratelimited(fmt, ...) \ | ||
241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
242 | #else | ||
243 | #define pr_debug_ratelimited(fmt, ...) \ | ||
244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
245 | ##__VA_ARGS__); 0; }) | ||
246 | #endif | ||
247 | |||
248 | #endif | ||
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 01b3d759f1fc..e031e1a486d9 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
@@ -8,6 +8,7 @@ struct platform_pwm_backlight_data { | |||
8 | int pwm_id; | 8 | int pwm_id; |
9 | unsigned int max_brightness; | 9 | unsigned int max_brightness; |
10 | unsigned int dft_brightness; | 10 | unsigned int dft_brightness; |
11 | unsigned int lth_brightness; | ||
11 | unsigned int pwm_period_ns; | 12 | unsigned int pwm_period_ns; |
12 | int (*init)(struct device *dev); | 13 | int (*init)(struct device *dev); |
13 | int (*notify)(struct device *dev, int brightness); | 14 | int (*notify)(struct device *dev, int brightness); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index a39cbed9ee17..ab2baa5c4884 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -34,19 +34,13 @@ | |||
34 | * needed for RCU lookups (because root->height is unreliable). The only | 34 | * needed for RCU lookups (because root->height is unreliable). The only |
35 | * time callers need worry about this is when doing a lookup_slot under | 35 | * time callers need worry about this is when doing a lookup_slot under |
36 | * RCU. | 36 | * RCU. |
37 | * | ||
38 | * Indirect pointer in fact is also used to tag the last pointer of a node | ||
39 | * when it is shrunk, before we rcu free the node. See shrink code for | ||
40 | * details. | ||
37 | */ | 41 | */ |
38 | #define RADIX_TREE_INDIRECT_PTR 1 | 42 | #define RADIX_TREE_INDIRECT_PTR 1 |
39 | #define RADIX_TREE_RETRY ((void *)-1UL) | ||
40 | |||
41 | static inline void *radix_tree_ptr_to_indirect(void *ptr) | ||
42 | { | ||
43 | return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR); | ||
44 | } | ||
45 | 43 | ||
46 | static inline void *radix_tree_indirect_to_ptr(void *ptr) | ||
47 | { | ||
48 | return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR); | ||
49 | } | ||
50 | #define radix_tree_indirect_to_ptr(ptr) \ | 44 | #define radix_tree_indirect_to_ptr(ptr) \ |
51 | radix_tree_indirect_to_ptr((void __force *)(ptr)) | 45 | radix_tree_indirect_to_ptr((void __force *)(ptr)) |
52 | 46 | ||
@@ -140,16 +134,29 @@ do { \ | |||
140 | * removed. | 134 | * removed. |
141 | * | 135 | * |
142 | * For use with radix_tree_lookup_slot(). Caller must hold tree at least read | 136 | * For use with radix_tree_lookup_slot(). Caller must hold tree at least read |
143 | * locked across slot lookup and dereference. More likely, will be used with | 137 | * locked across slot lookup and dereference. Not required if write lock is |
144 | * radix_tree_replace_slot(), as well, so caller will hold tree write locked. | 138 | * held (ie. items cannot be concurrently inserted). |
139 | * | ||
140 | * radix_tree_deref_retry must be used to confirm validity of the pointer if | ||
141 | * only the read lock is held. | ||
145 | */ | 142 | */ |
146 | static inline void *radix_tree_deref_slot(void **pslot) | 143 | static inline void *radix_tree_deref_slot(void **pslot) |
147 | { | 144 | { |
148 | void *ret = rcu_dereference(*pslot); | 145 | return rcu_dereference(*pslot); |
149 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | ||
150 | ret = RADIX_TREE_RETRY; | ||
151 | return ret; | ||
152 | } | 146 | } |
147 | |||
148 | /** | ||
149 | * radix_tree_deref_retry - check radix_tree_deref_slot | ||
150 | * @arg: pointer returned by radix_tree_deref_slot | ||
151 | * Returns: 0 if retry is not required, otherwise retry is required | ||
152 | * | ||
153 | * radix_tree_deref_retry must be used with radix_tree_deref_slot. | ||
154 | */ | ||
155 | static inline int radix_tree_deref_retry(void *arg) | ||
156 | { | ||
157 | return unlikely((unsigned long)arg & RADIX_TREE_INDIRECT_PTR); | ||
158 | } | ||
159 | |||
153 | /** | 160 | /** |
154 | * radix_tree_replace_slot - replace item in a slot | 161 | * radix_tree_replace_slot - replace item in a slot |
155 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot | 162 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index e7320b5e82fb..3a8f0c9b2933 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -3,8 +3,8 @@ | |||
3 | 3 | ||
4 | struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, | 4 | struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, |
5 | int mode, dev_t dev); | 5 | int mode, dev_t dev); |
6 | extern int ramfs_get_sb(struct file_system_type *fs_type, | 6 | extern struct dentry *ramfs_mount(struct file_system_type *fs_type, |
7 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); | 7 | int flags, const char *dev_name, void *data); |
8 | 8 | ||
9 | #ifndef CONFIG_MMU | 9 | #ifndef CONFIG_MMU |
10 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | 10 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 88d36f9145ba..d01c96c1966e 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_RESOURCE_H | 2 | #define _LINUX_RESOURCE_H |
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | #include <linux/types.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Resource control/accounting header file for linux | 8 | * Resource control/accounting header file for linux |
diff --git a/include/linux/sched.h b/include/linux/sched.h index be7adb7588e5..d0036e52a24a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -672,6 +672,9 @@ struct user_struct { | |||
672 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ | 672 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ |
673 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ | 673 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ |
674 | #endif | 674 | #endif |
675 | #ifdef CONFIG_FANOTIFY | ||
676 | atomic_t fanotify_listeners; | ||
677 | #endif | ||
675 | #ifdef CONFIG_EPOLL | 678 | #ifdef CONFIG_EPOLL |
676 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 679 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ |
677 | #endif | 680 | #endif |
@@ -1080,7 +1083,7 @@ struct sched_class { | |||
1080 | struct task_struct *task); | 1083 | struct task_struct *task); |
1081 | 1084 | ||
1082 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1085 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1083 | void (*moved_group) (struct task_struct *p, int on_rq); | 1086 | void (*task_move_group) (struct task_struct *p, int on_rq); |
1084 | #endif | 1087 | #endif |
1085 | }; | 1088 | }; |
1086 | 1089 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index b8246a8df7d2..fd4d55fb8845 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -77,7 +77,6 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
77 | extern int cap_task_setscheduler(struct task_struct *p); | 77 | extern int cap_task_setscheduler(struct task_struct *p); |
78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
79 | extern int cap_task_setnice(struct task_struct *p, int nice); | 79 | extern int cap_task_setnice(struct task_struct *p, int nice); |
80 | extern int cap_syslog(int type, bool from_file); | ||
81 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); | 80 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); |
82 | 81 | ||
83 | struct msghdr; | 82 | struct msghdr; |
@@ -1388,7 +1387,7 @@ struct security_operations { | |||
1388 | int (*sysctl) (struct ctl_table *table, int op); | 1387 | int (*sysctl) (struct ctl_table *table, int op); |
1389 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1388 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
1390 | int (*quota_on) (struct dentry *dentry); | 1389 | int (*quota_on) (struct dentry *dentry); |
1391 | int (*syslog) (int type, bool from_file); | 1390 | int (*syslog) (int type); |
1392 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1391 | int (*settime) (struct timespec *ts, struct timezone *tz); |
1393 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); | 1392 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
1394 | 1393 | ||
@@ -1671,7 +1670,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap); | |||
1671 | int security_sysctl(struct ctl_table *table, int op); | 1670 | int security_sysctl(struct ctl_table *table, int op); |
1672 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1671 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1673 | int security_quota_on(struct dentry *dentry); | 1672 | int security_quota_on(struct dentry *dentry); |
1674 | int security_syslog(int type, bool from_file); | 1673 | int security_syslog(int type); |
1675 | int security_settime(struct timespec *ts, struct timezone *tz); | 1674 | int security_settime(struct timespec *ts, struct timezone *tz); |
1676 | int security_vm_enough_memory(long pages); | 1675 | int security_vm_enough_memory(long pages); |
1677 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1676 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
@@ -1901,9 +1900,9 @@ static inline int security_quota_on(struct dentry *dentry) | |||
1901 | return 0; | 1900 | return 0; |
1902 | } | 1901 | } |
1903 | 1902 | ||
1904 | static inline int security_syslog(int type, bool from_file) | 1903 | static inline int security_syslog(int type) |
1905 | { | 1904 | { |
1906 | return cap_syslog(type, from_file); | 1905 | return 0; |
1907 | } | 1906 | } |
1908 | 1907 | ||
1909 | static inline int security_settime(struct timespec *ts, struct timezone *tz) | 1908 | static inline int security_settime(struct timespec *ts, struct timezone *tz) |
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h index 5310d27abd2a..39fa04966aa8 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h | |||
@@ -29,9 +29,6 @@ struct semaphore { | |||
29 | #define DEFINE_SEMAPHORE(name) \ | 29 | #define DEFINE_SEMAPHORE(name) \ |
30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) | 30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) |
31 | 31 | ||
32 | #define DECLARE_MUTEX(name) \ | ||
33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) | ||
34 | |||
35 | static inline void sema_init(struct semaphore *sem, int val) | 32 | static inline void sema_init(struct semaphore *sem, int val) |
36 | { | 33 | { |
37 | static struct lock_class_key __key; | 34 | static struct lock_class_key __key; |
@@ -39,9 +36,6 @@ static inline void sema_init(struct semaphore *sem, int val) | |||
39 | lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); | 36 | lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); |
40 | } | 37 | } |
41 | 38 | ||
42 | #define init_MUTEX(sem) sema_init(sem, 1) | ||
43 | #define init_MUTEX_LOCKED(sem) sema_init(sem, 0) | ||
44 | |||
45 | extern void down(struct semaphore *sem); | 39 | extern void down(struct semaphore *sem); |
46 | extern int __must_check down_interruptible(struct semaphore *sem); | 40 | extern int __must_check down_interruptible(struct semaphore *sem); |
47 | extern int __must_check down_killable(struct semaphore *sem); | 41 | extern int __must_check down_killable(struct semaphore *sem); |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 4dca992f3093..cea0c38e7a63 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
@@ -122,6 +122,10 @@ int clk_rate_table_find(struct clk *clk, | |||
122 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, | 122 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, |
123 | unsigned int div_max, unsigned long rate); | 123 | unsigned int div_max, unsigned long rate); |
124 | 124 | ||
125 | long clk_round_parent(struct clk *clk, unsigned long target, | ||
126 | unsigned long *best_freq, unsigned long *parent_freq, | ||
127 | unsigned int div_min, unsigned int div_max); | ||
128 | |||
125 | #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ | 129 | #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ |
126 | { \ | 130 | { \ |
127 | .parent = _parent, \ | 131 | .parent = _parent, \ |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index f656d1a43dc0..5812fefbcedf 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
@@ -79,7 +79,7 @@ struct intc_hw_desc { | |||
79 | unsigned int nr_subgroups; | 79 | unsigned int nr_subgroups; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | #define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) | 82 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) |
83 | 83 | ||
84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ |
85 | prio_regs, sense_regs, ack_regs) \ | 85 | prio_regs, sense_regs, ack_regs) \ |
diff --git a/include/linux/sh_timer.h b/include/linux/sh_timer.h index 864bd56bd3b0..4d9dcd138315 100644 --- a/include/linux/sh_timer.h +++ b/include/linux/sh_timer.h | |||
@@ -5,7 +5,6 @@ struct sh_timer_config { | |||
5 | char *name; | 5 | char *name; |
6 | long channel_offset; | 6 | long channel_offset; |
7 | int timer_bit; | 7 | int timer_bit; |
8 | char *clk; | ||
9 | unsigned long clockevent_rating; | 8 | unsigned long clockevent_rating; |
10 | unsigned long clocksource_rating; | 9 | unsigned long clocksource_rating; |
11 | }; | 10 | }; |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 5146b50202ce..86b652fabf6e 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
322 | int offset, | 322 | int offset, |
323 | unsigned int len, __wsum *csump); | 323 | unsigned int len, __wsum *csump); |
324 | 324 | ||
325 | extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); | 325 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, |
328 | int offset, int len); | 328 | int offset, int len); |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 92e52a1e6af3..b4d7710bc38d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
204 | /** | 204 | /** |
205 | * struct spi_master - interface to SPI master controller | 205 | * struct spi_master - interface to SPI master controller |
206 | * @dev: device interface to this driver | 206 | * @dev: device interface to this driver |
207 | * @list: link with the global spi_master list | ||
207 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 208 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
208 | * given SPI controller. | 209 | * given SPI controller. |
209 | * @num_chipselect: chipselects are used to distinguish individual | 210 | * @num_chipselect: chipselects are used to distinguish individual |
@@ -238,6 +239,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
238 | struct spi_master { | 239 | struct spi_master { |
239 | struct device dev; | 240 | struct device dev; |
240 | 241 | ||
242 | struct list_head list; | ||
243 | |||
241 | /* other than negative (== assign one dynamically), bus_num is fully | 244 | /* other than negative (== assign one dynamically), bus_num is fully |
242 | * board-specific. usually that simplifies to being SOC-specific. | 245 | * board-specific. usually that simplifies to being SOC-specific. |
243 | * example: one SOC has three SPI controllers, numbered 0..2, | 246 | * example: one SOC has three SPI controllers, numbered 0..2, |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index bbdb680ffbe9..aea0d438e3c7 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -82,18 +82,28 @@ struct svc_xprt { | |||
82 | struct net *xpt_net; | 82 | struct net *xpt_net; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 85 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
86 | { | 86 | { |
87 | spin_lock(&xpt->xpt_lock); | 87 | spin_lock(&xpt->xpt_lock); |
88 | list_add(&u->list, &xpt->xpt_users); | 88 | list_del_init(&u->list); |
89 | spin_unlock(&xpt->xpt_lock); | 89 | spin_unlock(&xpt->xpt_lock); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 92 | static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
93 | { | 93 | { |
94 | spin_lock(&xpt->xpt_lock); | 94 | spin_lock(&xpt->xpt_lock); |
95 | list_del_init(&u->list); | 95 | if (test_bit(XPT_CLOSE, &xpt->xpt_flags)) { |
96 | /* | ||
97 | * The connection is about to be deleted soon (or, | ||
98 | * worse, may already be deleted--in which case we've | ||
99 | * already notified the xpt_users). | ||
100 | */ | ||
101 | spin_unlock(&xpt->xpt_lock); | ||
102 | return -ENOTCONN; | ||
103 | } | ||
104 | list_add(&u->list, &xpt->xpt_users); | ||
96 | spin_unlock(&xpt->xpt_lock); | 105 | spin_unlock(&xpt->xpt_lock); |
106 | return 0; | ||
97 | } | 107 | } |
98 | 108 | ||
99 | int svc_reg_xprt_class(struct svc_xprt_class *); | 109 | int svc_reg_xprt_class(struct svc_xprt_class *); |
diff --git a/include/linux/tty.h b/include/linux/tty.h index e500171c745f..c7ea9bc8897c 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -50,7 +50,7 @@ | |||
50 | #define N_V253 19 /* Codec control over voice modem */ | 50 | #define N_V253 19 /* Codec control over voice modem */ |
51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ |
52 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 52 | #define N_GSM0710 21 /* GSM 0710 Mux */ |
53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | 53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 56 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
@@ -541,8 +541,8 @@ extern void tty_audit_exit(void); | |||
541 | extern void tty_audit_fork(struct signal_struct *sig); | 541 | extern void tty_audit_fork(struct signal_struct *sig); |
542 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 542 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
543 | extern void tty_audit_push(struct tty_struct *tty); | 543 | extern void tty_audit_push(struct tty_struct *tty); |
544 | extern void tty_audit_push_task(struct task_struct *tsk, | 544 | extern int tty_audit_push_task(struct task_struct *tsk, |
545 | uid_t loginuid, u32 sessionid); | 545 | uid_t loginuid, u32 sessionid); |
546 | #else | 546 | #else |
547 | static inline void tty_audit_add_data(struct tty_struct *tty, | 547 | static inline void tty_audit_add_data(struct tty_struct *tty, |
548 | unsigned char *data, size_t size) | 548 | unsigned char *data, size_t size) |
@@ -560,9 +560,10 @@ static inline void tty_audit_fork(struct signal_struct *sig) | |||
560 | static inline void tty_audit_push(struct tty_struct *tty) | 560 | static inline void tty_audit_push(struct tty_struct *tty) |
561 | { | 561 | { |
562 | } | 562 | } |
563 | static inline void tty_audit_push_task(struct task_struct *tsk, | 563 | static inline int tty_audit_push_task(struct task_struct *tsk, |
564 | uid_t loginuid, u32 sessionid) | 564 | uid_t loginuid, u32 sessionid) |
565 | { | 565 | { |
566 | return 0; | ||
566 | } | 567 | } |
567 | #endif | 568 | #endif |
568 | 569 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 35fe6ab222bb..24300d8a1bc1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -797,7 +797,7 @@ struct usbdrv_wrap { | |||
797 | * @disconnect: Called when the interface is no longer accessible, usually | 797 | * @disconnect: Called when the interface is no longer accessible, usually |
798 | * because its device has been (or is being) disconnected or the | 798 | * because its device has been (or is being) disconnected or the |
799 | * driver module is being unloaded. | 799 | * driver module is being unloaded. |
800 | * @ioctl: Used for drivers that want to talk to userspace through | 800 | * @unlocked_ioctl: Used for drivers that want to talk to userspace through |
801 | * the "usbfs" filesystem. This lets devices provide ways to | 801 | * the "usbfs" filesystem. This lets devices provide ways to |
802 | * expose information to user space regardless of where they | 802 | * expose information to user space regardless of where they |
803 | * do (or don't) show up otherwise in the filesystem. | 803 | * do (or don't) show up otherwise in the filesystem. |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index ee2dd1d506ed..2387f9fc8138 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -89,6 +89,8 @@ struct musb_hdrc_config { | |||
89 | /* A GPIO controlling VRSEL in Blackfin */ | 89 | /* A GPIO controlling VRSEL in Blackfin */ |
90 | unsigned int gpio_vrsel; | 90 | unsigned int gpio_vrsel; |
91 | unsigned int gpio_vrsel_active; | 91 | unsigned int gpio_vrsel_active; |
92 | /* musb CLKIN in Blackfin in MHZ */ | ||
93 | unsigned char clkin; | ||
92 | #endif | 94 | #endif |
93 | 95 | ||
94 | }; | 96 | }; |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 09eec350054d..0ead399e08b5 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -58,7 +58,9 @@ struct writeback_control { | |||
58 | struct bdi_writeback; | 58 | struct bdi_writeback; |
59 | int inode_wait(void *); | 59 | int inode_wait(void *); |
60 | void writeback_inodes_sb(struct super_block *); | 60 | void writeback_inodes_sb(struct super_block *); |
61 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); | ||
61 | int writeback_inodes_sb_if_idle(struct super_block *); | 62 | int writeback_inodes_sb_if_idle(struct super_block *); |
63 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); | ||
62 | void sync_inodes_sb(struct super_block *); | 64 | void sync_inodes_sb(struct super_block *); |
63 | void writeback_inodes_wb(struct bdi_writeback *wb, | 65 | void writeback_inodes_wb(struct bdi_writeback *wb, |
64 | struct writeback_control *wbc); | 66 | struct writeback_control *wbc); |
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 4debb4514634..2f7d45bcbd24 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -52,6 +52,7 @@ struct mtd_oob_buf64 { | |||
52 | #define MTD_NANDFLASH 4 | 52 | #define MTD_NANDFLASH 4 |
53 | #define MTD_DATAFLASH 6 | 53 | #define MTD_DATAFLASH 6 |
54 | #define MTD_UBIVOLUME 7 | 54 | #define MTD_UBIVOLUME 7 |
55 | #define MTD_MLCNANDFLASH 8 | ||
55 | 56 | ||
56 | #define MTD_WRITEABLE 0x400 /* Device is writeable */ | 57 | #define MTD_WRITEABLE 0x400 /* Device is writeable */ |
57 | #define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ | 58 | #define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ |
@@ -119,7 +120,7 @@ struct otp_info { | |||
119 | #define OTPGETREGIONCOUNT _IOW('M', 14, int) | 120 | #define OTPGETREGIONCOUNT _IOW('M', 14, int) |
120 | #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) | 121 | #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) |
121 | #define OTPLOCK _IOR('M', 16, struct otp_info) | 122 | #define OTPLOCK _IOR('M', 16, struct otp_info) |
122 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) | 123 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) |
123 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) | 124 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) |
124 | #define MTDFILEMODE _IO('M', 19) | 125 | #define MTDFILEMODE _IO('M', 19) |
125 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) | 126 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) |
@@ -144,13 +145,18 @@ struct nand_oobfree { | |||
144 | }; | 145 | }; |
145 | 146 | ||
146 | #define MTD_MAX_OOBFREE_ENTRIES 8 | 147 | #define MTD_MAX_OOBFREE_ENTRIES 8 |
148 | #define MTD_MAX_ECCPOS_ENTRIES 64 | ||
147 | /* | 149 | /* |
148 | * ECC layout control structure. Exported to userspace for | 150 | * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl |
149 | * diagnosis and to allow creation of raw images | 151 | * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a |
152 | * complete set of ECC information. The ioctl truncates the larger internal | ||
153 | * structure to retain binary compatibility with the static declaration of the | ||
154 | * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of | ||
155 | * the user struct, not the MAX size of the internal struct nand_ecclayout. | ||
150 | */ | 156 | */ |
151 | struct nand_ecclayout { | 157 | struct nand_ecclayout_user { |
152 | __u32 eccbytes; | 158 | __u32 eccbytes; |
153 | __u32 eccpos[64]; | 159 | __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES]; |
154 | __u32 oobavail; | 160 | __u32 oobavail; |
155 | struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; | 161 | struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; |
156 | }; | 162 | }; |
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h index aa3c2f86a913..83327c808c86 100644 --- a/include/mtd/mtd-user.h +++ b/include/mtd/mtd-user.h | |||
@@ -29,6 +29,6 @@ typedef struct mtd_info_user mtd_info_t; | |||
29 | typedef struct erase_info_user erase_info_t; | 29 | typedef struct erase_info_user erase_info_t; |
30 | typedef struct region_info_user region_info_t; | 30 | typedef struct region_info_user region_info_t; |
31 | typedef struct nand_oobinfo nand_oobinfo_t; | 31 | typedef struct nand_oobinfo nand_oobinfo_t; |
32 | typedef struct nand_ecclayout nand_ecclayout_t; | 32 | typedef struct nand_ecclayout_user nand_ecclayout_t; |
33 | 33 | ||
34 | #endif /* __MTD_USER_H__ */ | 34 | #endif /* __MTD_USER_H__ */ |
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index 6da573c75d54..8eff83b95366 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h | |||
@@ -28,7 +28,7 @@ struct caif_param { | |||
28 | * @sockaddr: Socket address to connect. | 28 | * @sockaddr: Socket address to connect. |
29 | * @priority: Priority of the connection. | 29 | * @priority: Priority of the connection. |
30 | * @link_selector: Link selector (high bandwidth or low latency) | 30 | * @link_selector: Link selector (high bandwidth or low latency) |
31 | * @link_name: Name of the CAIF Link Layer to use. | 31 | * @ifindex: kernel index of the interface. |
32 | * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). | 32 | * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). |
33 | * | 33 | * |
34 | * This struct is used when connecting a CAIF channel. | 34 | * This struct is used when connecting a CAIF channel. |
@@ -39,7 +39,7 @@ struct caif_connect_request { | |||
39 | struct sockaddr_caif sockaddr; | 39 | struct sockaddr_caif sockaddr; |
40 | enum caif_channel_priority priority; | 40 | enum caif_channel_priority priority; |
41 | enum caif_link_selector link_selector; | 41 | enum caif_link_selector link_selector; |
42 | char link_name[16]; | 42 | int ifindex; |
43 | struct caif_param param; | 43 | struct caif_param param; |
44 | }; | 44 | }; |
45 | 45 | ||
diff --git a/include/net/caif/caif_spi.h b/include/net/caif/caif_spi.h index ce4570dff020..87c3d11b8e55 100644 --- a/include/net/caif/caif_spi.h +++ b/include/net/caif/caif_spi.h | |||
@@ -121,6 +121,8 @@ struct cfspi { | |||
121 | wait_queue_head_t wait; | 121 | wait_queue_head_t wait; |
122 | spinlock_t lock; | 122 | spinlock_t lock; |
123 | bool flow_stop; | 123 | bool flow_stop; |
124 | bool slave; | ||
125 | bool slave_talked; | ||
124 | #ifdef CONFIG_DEBUG_FS | 126 | #ifdef CONFIG_DEBUG_FS |
125 | enum cfspi_state dbg_state; | 127 | enum cfspi_state dbg_state; |
126 | u16 pcmd; | 128 | u16 pcmd; |
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index bd646faffa47..f688478bfb84 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h | |||
@@ -139,10 +139,10 @@ struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg, | |||
139 | enum cfcnfg_phy_preference phy_pref); | 139 | enum cfcnfg_phy_preference phy_pref); |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * cfcnfg_get_named() - Get the Physical Identifier of CAIF Link Layer | 142 | * cfcnfg_get_id_from_ifi() - Get the Physical Identifier of ifindex, |
143 | * it matches caif physical id with the kernel interface id. | ||
143 | * @cnfg: Configuration object | 144 | * @cnfg: Configuration object |
144 | * @name: Name of the Physical Layer (Caif Link Layer) | 145 | * @ifi: ifindex obtained from socket.c bindtodevice. |
145 | */ | 146 | */ |
146 | int cfcnfg_get_named(struct cfcnfg *cnfg, char *name); | 147 | int cfcnfg_get_id_from_ifi(struct cfcnfg *cnfg, int ifi); |
147 | |||
148 | #endif /* CFCNFG_H_ */ | 148 | #endif /* CFCNFG_H_ */ |
diff --git a/include/net/dn.h b/include/net/dn.h index e5469f7b67a3..a514a3cf4573 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -225,7 +225,7 @@ extern int decnet_di_count; | |||
225 | extern int decnet_dr_count; | 225 | extern int decnet_dr_count; |
226 | extern int decnet_no_fc_max_cwnd; | 226 | extern int decnet_no_fc_max_cwnd; |
227 | 227 | ||
228 | extern int sysctl_decnet_mem[3]; | 228 | extern long sysctl_decnet_mem[3]; |
229 | extern int sysctl_decnet_wmem[3]; | 229 | extern int sysctl_decnet_wmem[3]; |
230 | extern int sysctl_decnet_rmem[3]; | 230 | extern int sysctl_decnet_rmem[3]; |
231 | 231 | ||
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 1fa5306e3e23..51665b3461b8 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _NET_DST_OPS_H | 2 | #define _NET_DST_OPS_H |
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/percpu_counter.h> | 4 | #include <linux/percpu_counter.h> |
5 | #include <linux/cache.h> | ||
5 | 6 | ||
6 | struct dst_entry; | 7 | struct dst_entry; |
7 | struct kmem_cachep; | 8 | struct kmem_cachep; |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index ba3666d31766..07bdb5e9e8ac 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -158,6 +158,8 @@ extern int fib_table_flush(struct fib_table *table); | |||
158 | extern void fib_table_select_default(struct fib_table *table, | 158 | extern void fib_table_select_default(struct fib_table *table, |
159 | const struct flowi *flp, | 159 | const struct flowi *flp, |
160 | struct fib_result *res); | 160 | struct fib_result *res); |
161 | extern void fib_free_table(struct fib_table *tb); | ||
162 | |||
161 | 163 | ||
162 | 164 | ||
163 | #ifndef CONFIG_IP_MULTIPLE_TABLES | 165 | #ifndef CONFIG_IP_MULTIPLE_TABLES |
diff --git a/include/net/netlink.h b/include/net/netlink.h index f3b201d335b3..9801c55de5d6 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -384,7 +384,7 @@ static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, | |||
384 | * | 384 | * |
385 | * Returns the first attribute which matches the specified type. | 385 | * Returns the first attribute which matches the specified type. |
386 | */ | 386 | */ |
387 | static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, | 387 | static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, |
388 | int hdrlen, int attrtype) | 388 | int hdrlen, int attrtype) |
389 | { | 389 | { |
390 | return nla_find(nlmsg_attrdata(nlh, hdrlen), | 390 | return nla_find(nlmsg_attrdata(nlh, hdrlen), |
diff --git a/include/net/sock.h b/include/net/sock.h index c7a736228ca2..a6338d039857 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -762,7 +762,7 @@ struct proto { | |||
762 | 762 | ||
763 | /* Memory pressure */ | 763 | /* Memory pressure */ |
764 | void (*enter_memory_pressure)(struct sock *sk); | 764 | void (*enter_memory_pressure)(struct sock *sk); |
765 | atomic_t *memory_allocated; /* Current allocated memory. */ | 765 | atomic_long_t *memory_allocated; /* Current allocated memory. */ |
766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ | 766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ |
767 | /* | 767 | /* |
768 | * Pressure flag: try to collapse. | 768 | * Pressure flag: try to collapse. |
@@ -771,7 +771,7 @@ struct proto { | |||
771 | * is strict, actions are advisory and have some latency. | 771 | * is strict, actions are advisory and have some latency. |
772 | */ | 772 | */ |
773 | int *memory_pressure; | 773 | int *memory_pressure; |
774 | int *sysctl_mem; | 774 | long *sysctl_mem; |
775 | int *sysctl_wmem; | 775 | int *sysctl_wmem; |
776 | int *sysctl_rmem; | 776 | int *sysctl_rmem; |
777 | int max_header; | 777 | int max_header; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 4fee0424af7e..e36c874c7fb1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -224,7 +224,7 @@ extern int sysctl_tcp_fack; | |||
224 | extern int sysctl_tcp_reordering; | 224 | extern int sysctl_tcp_reordering; |
225 | extern int sysctl_tcp_ecn; | 225 | extern int sysctl_tcp_ecn; |
226 | extern int sysctl_tcp_dsack; | 226 | extern int sysctl_tcp_dsack; |
227 | extern int sysctl_tcp_mem[3]; | 227 | extern long sysctl_tcp_mem[3]; |
228 | extern int sysctl_tcp_wmem[3]; | 228 | extern int sysctl_tcp_wmem[3]; |
229 | extern int sysctl_tcp_rmem[3]; | 229 | extern int sysctl_tcp_rmem[3]; |
230 | extern int sysctl_tcp_app_win; | 230 | extern int sysctl_tcp_app_win; |
@@ -247,7 +247,7 @@ extern int sysctl_tcp_cookie_size; | |||
247 | extern int sysctl_tcp_thin_linear_timeouts; | 247 | extern int sysctl_tcp_thin_linear_timeouts; |
248 | extern int sysctl_tcp_thin_dupack; | 248 | extern int sysctl_tcp_thin_dupack; |
249 | 249 | ||
250 | extern atomic_t tcp_memory_allocated; | 250 | extern atomic_long_t tcp_memory_allocated; |
251 | extern struct percpu_counter tcp_sockets_allocated; | 251 | extern struct percpu_counter tcp_sockets_allocated; |
252 | extern int tcp_memory_pressure; | 252 | extern int tcp_memory_pressure; |
253 | 253 | ||
@@ -280,7 +280,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && | 282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && |
283 | atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) | 283 | atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) |
284 | return true; | 284 | return true; |
285 | return false; | 285 | return false; |
286 | } | 286 | } |
diff --git a/include/net/udp.h b/include/net/udp.h index 200b82848c9a..bb967dd59bf7 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -105,10 +105,10 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | |||
105 | 105 | ||
106 | extern struct proto udp_prot; | 106 | extern struct proto udp_prot; |
107 | 107 | ||
108 | extern atomic_t udp_memory_allocated; | 108 | extern atomic_long_t udp_memory_allocated; |
109 | 109 | ||
110 | /* sysctl variables for udp */ | 110 | /* sysctl variables for udp */ |
111 | extern int sysctl_udp_mem[3]; | 111 | extern long sysctl_udp_mem[3]; |
112 | extern int sysctl_udp_rmem_min; | 112 | extern int sysctl_udp_rmem_min; |
113 | extern int sysctl_udp_wmem_min; | 113 | extern int sysctl_udp_wmem_min; |
114 | 114 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 14be49b44e84..f986ab7ffe6f 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -721,7 +721,7 @@ struct libfc_function_template { | |||
721 | * struct fc_disc - Discovery context | 721 | * struct fc_disc - Discovery context |
722 | * @retry_count: Number of retries | 722 | * @retry_count: Number of retries |
723 | * @pending: 1 if discovery is pending, 0 if not | 723 | * @pending: 1 if discovery is pending, 0 if not |
724 | * @requesting: 1 if discovery has been requested, 0 if not | 724 | * @requested: 1 if discovery has been requested, 0 if not |
725 | * @seq_count: Number of sequences used for discovery | 725 | * @seq_count: Number of sequences used for discovery |
726 | * @buf_len: Length of the discovery buffer | 726 | * @buf_len: Length of the discovery buffer |
727 | * @disc_id: Discovery ID | 727 | * @disc_id: Discovery ID |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index a8f370126632..53a9e886612b 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -137,7 +137,7 @@ struct osd_request { | |||
137 | void *buff; | 137 | void *buff; |
138 | unsigned alloc_size; /* 0 here means: don't call kfree */ | 138 | unsigned alloc_size; /* 0 here means: don't call kfree */ |
139 | unsigned total_bytes; | 139 | unsigned total_bytes; |
140 | } set_attr, enc_get_attr, get_attr; | 140 | } cdb_cont, set_attr, enc_get_attr, get_attr; |
141 | 141 | ||
142 | struct _osd_io_info { | 142 | struct _osd_io_info { |
143 | struct bio *bio; | 143 | struct bio *bio; |
@@ -448,6 +448,20 @@ void osd_req_read(struct osd_request *or, | |||
448 | int osd_req_read_kern(struct osd_request *or, | 448 | int osd_req_read_kern(struct osd_request *or, |
449 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); | 449 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); |
450 | 450 | ||
451 | /* Scatter/Gather write/read commands */ | ||
452 | int osd_req_write_sg(struct osd_request *or, | ||
453 | const struct osd_obj_id *obj, struct bio *bio, | ||
454 | const struct osd_sg_entry *sglist, unsigned numentries); | ||
455 | int osd_req_read_sg(struct osd_request *or, | ||
456 | const struct osd_obj_id *obj, struct bio *bio, | ||
457 | const struct osd_sg_entry *sglist, unsigned numentries); | ||
458 | int osd_req_write_sg_kern(struct osd_request *or, | ||
459 | const struct osd_obj_id *obj, void **buff, | ||
460 | const struct osd_sg_entry *sglist, unsigned numentries); | ||
461 | int osd_req_read_sg_kern(struct osd_request *or, | ||
462 | const struct osd_obj_id *obj, void **buff, | ||
463 | const struct osd_sg_entry *sglist, unsigned numentries); | ||
464 | |||
451 | /* | 465 | /* |
452 | * Root/Partition/Collection/Object Attributes commands | 466 | * Root/Partition/Collection/Object Attributes commands |
453 | */ | 467 | */ |
diff --git a/include/scsi/osd_protocol.h b/include/scsi/osd_protocol.h index 685661283540..a6026da25f3e 100644 --- a/include/scsi/osd_protocol.h +++ b/include/scsi/osd_protocol.h | |||
@@ -631,4 +631,46 @@ static inline void osd_sec_set_caps(struct osd_capability_head *cap, | |||
631 | put_unaligned_le16(bit_mask, &cap->permissions_bit_mask); | 631 | put_unaligned_le16(bit_mask, &cap->permissions_bit_mask); |
632 | } | 632 | } |
633 | 633 | ||
634 | /* osd2r05a sec 5.3: CDB continuation segment formats */ | ||
635 | enum osd_continuation_segment_format { | ||
636 | CDB_CONTINUATION_FORMAT_V2 = 0x01, | ||
637 | }; | ||
638 | |||
639 | struct osd_continuation_segment_header { | ||
640 | u8 format; | ||
641 | u8 reserved1; | ||
642 | __be16 service_action; | ||
643 | __be32 reserved2; | ||
644 | u8 integrity_check[OSDv2_CRYPTO_KEYID_SIZE]; | ||
645 | } __packed; | ||
646 | |||
647 | /* osd2r05a sec 5.4.1: CDB continuation descriptors */ | ||
648 | enum osd_continuation_descriptor_type { | ||
649 | NO_MORE_DESCRIPTORS = 0x0000, | ||
650 | SCATTER_GATHER_LIST = 0x0001, | ||
651 | QUERY_LIST = 0x0002, | ||
652 | USER_OBJECT = 0x0003, | ||
653 | COPY_USER_OBJECT_SOURCE = 0x0101, | ||
654 | EXTENSION_CAPABILITIES = 0xFFEE | ||
655 | }; | ||
656 | |||
657 | struct osd_continuation_descriptor_header { | ||
658 | __be16 type; | ||
659 | u8 reserved; | ||
660 | u8 pad_length; | ||
661 | __be32 length; | ||
662 | } __packed; | ||
663 | |||
664 | |||
665 | /* osd2r05a sec 5.4.2: Scatter/gather list */ | ||
666 | struct osd_sg_list_entry { | ||
667 | __be64 offset; | ||
668 | __be64 len; | ||
669 | }; | ||
670 | |||
671 | struct osd_sg_continuation_descriptor { | ||
672 | struct osd_continuation_descriptor_header hdr; | ||
673 | struct osd_sg_list_entry entries[]; | ||
674 | }; | ||
675 | |||
634 | #endif /* ndef __OSD_PROTOCOL_H__ */ | 676 | #endif /* ndef __OSD_PROTOCOL_H__ */ |
diff --git a/include/scsi/osd_types.h b/include/scsi/osd_types.h index 3f5e88cc75c0..bd0be7ed4bcf 100644 --- a/include/scsi/osd_types.h +++ b/include/scsi/osd_types.h | |||
@@ -37,4 +37,9 @@ struct osd_attr { | |||
37 | void *val_ptr; /* in network order */ | 37 | void *val_ptr; /* in network order */ |
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct osd_sg_entry { | ||
41 | u64 offset; | ||
42 | u64 len; | ||
43 | }; | ||
44 | |||
40 | #endif /* ndef __OSD_TYPES_H__ */ | 45 | #endif /* ndef __OSD_TYPES_H__ */ |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 289010d3270b..e5e345fb2a5c 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -98,6 +98,103 @@ TRACE_EVENT(ext4_allocate_inode, | |||
98 | (unsigned long) __entry->dir, __entry->mode) | 98 | (unsigned long) __entry->dir, __entry->mode) |
99 | ); | 99 | ); |
100 | 100 | ||
101 | TRACE_EVENT(ext4_evict_inode, | ||
102 | TP_PROTO(struct inode *inode), | ||
103 | |||
104 | TP_ARGS(inode), | ||
105 | |||
106 | TP_STRUCT__entry( | ||
107 | __field( int, dev_major ) | ||
108 | __field( int, dev_minor ) | ||
109 | __field( ino_t, ino ) | ||
110 | __field( int, nlink ) | ||
111 | ), | ||
112 | |||
113 | TP_fast_assign( | ||
114 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
115 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
116 | __entry->ino = inode->i_ino; | ||
117 | __entry->nlink = inode->i_nlink; | ||
118 | ), | ||
119 | |||
120 | TP_printk("dev %d,%d ino %lu nlink %d", | ||
121 | __entry->dev_major, __entry->dev_minor, | ||
122 | (unsigned long) __entry->ino, __entry->nlink) | ||
123 | ); | ||
124 | |||
125 | TRACE_EVENT(ext4_drop_inode, | ||
126 | TP_PROTO(struct inode *inode, int drop), | ||
127 | |||
128 | TP_ARGS(inode, drop), | ||
129 | |||
130 | TP_STRUCT__entry( | ||
131 | __field( int, dev_major ) | ||
132 | __field( int, dev_minor ) | ||
133 | __field( ino_t, ino ) | ||
134 | __field( int, drop ) | ||
135 | ), | ||
136 | |||
137 | TP_fast_assign( | ||
138 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
139 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
140 | __entry->ino = inode->i_ino; | ||
141 | __entry->drop = drop; | ||
142 | ), | ||
143 | |||
144 | TP_printk("dev %d,%d ino %lu drop %d", | ||
145 | __entry->dev_major, __entry->dev_minor, | ||
146 | (unsigned long) __entry->ino, __entry->drop) | ||
147 | ); | ||
148 | |||
149 | TRACE_EVENT(ext4_mark_inode_dirty, | ||
150 | TP_PROTO(struct inode *inode, unsigned long IP), | ||
151 | |||
152 | TP_ARGS(inode, IP), | ||
153 | |||
154 | TP_STRUCT__entry( | ||
155 | __field( int, dev_major ) | ||
156 | __field( int, dev_minor ) | ||
157 | __field( ino_t, ino ) | ||
158 | __field(unsigned long, ip ) | ||
159 | ), | ||
160 | |||
161 | TP_fast_assign( | ||
162 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
163 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
164 | __entry->ino = inode->i_ino; | ||
165 | __entry->ip = IP; | ||
166 | ), | ||
167 | |||
168 | TP_printk("dev %d,%d ino %lu caller %pF", | ||
169 | __entry->dev_major, __entry->dev_minor, | ||
170 | (unsigned long) __entry->ino, (void *)__entry->ip) | ||
171 | ); | ||
172 | |||
173 | TRACE_EVENT(ext4_begin_ordered_truncate, | ||
174 | TP_PROTO(struct inode *inode, loff_t new_size), | ||
175 | |||
176 | TP_ARGS(inode, new_size), | ||
177 | |||
178 | TP_STRUCT__entry( | ||
179 | __field( int, dev_major ) | ||
180 | __field( int, dev_minor ) | ||
181 | __field( ino_t, ino ) | ||
182 | __field( loff_t, new_size ) | ||
183 | ), | ||
184 | |||
185 | TP_fast_assign( | ||
186 | __entry->dev_major = MAJOR(inode->i_sb->s_dev); | ||
187 | __entry->dev_minor = MINOR(inode->i_sb->s_dev); | ||
188 | __entry->ino = inode->i_ino; | ||
189 | __entry->new_size = new_size; | ||
190 | ), | ||
191 | |||
192 | TP_printk("dev %d,%d ino %lu new_size %lld", | ||
193 | __entry->dev_major, __entry->dev_minor, | ||
194 | (unsigned long) __entry->ino, | ||
195 | (long long) __entry->new_size) | ||
196 | ); | ||
197 | |||
101 | DECLARE_EVENT_CLASS(ext4__write_begin, | 198 | DECLARE_EVENT_CLASS(ext4__write_begin, |
102 | 199 | ||
103 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 200 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 55d700e8566e..daabae5817c6 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -49,7 +49,9 @@ struct sh_mobile_lcdc_sys_bus_ops { | |||
49 | unsigned long (*read_data)(void *handle); | 49 | unsigned long (*read_data)(void *handle); |
50 | }; | 50 | }; |
51 | 51 | ||
52 | struct module; | ||
52 | struct sh_mobile_lcdc_board_cfg { | 53 | struct sh_mobile_lcdc_board_cfg { |
54 | struct module *owner; | ||
53 | void *board_data; | 55 | void *board_data; |
54 | int (*setup_sys)(void *board_data, void *sys_ops_handle, | 56 | int (*setup_sys)(void *board_data, void *sys_ops_handle, |
55 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 57 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
@@ -70,7 +72,8 @@ struct sh_mobile_lcdc_chan_cfg { | |||
70 | int interface_type; /* selects RGBn or SYSn I/F, see above */ | 72 | int interface_type; /* selects RGBn or SYSn I/F, see above */ |
71 | int clock_divider; | 73 | int clock_divider; |
72 | unsigned long flags; /* LCDC_FLAGS_... */ | 74 | unsigned long flags; /* LCDC_FLAGS_... */ |
73 | struct fb_videomode lcd_cfg; | 75 | const struct fb_videomode *lcd_cfg; |
76 | int num_cfg; | ||
74 | struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; | 77 | struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; |
75 | struct sh_mobile_lcdc_board_cfg board_cfg; | 78 | struct sh_mobile_lcdc_board_cfg board_cfg; |
76 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ | 79 | struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ |
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h index b42cdfd92fee..17857fb4d550 100644 --- a/include/xen/privcmd.h +++ b/include/xen/privcmd.h | |||
@@ -34,13 +34,10 @@ | |||
34 | #define __LINUX_PUBLIC_PRIVCMD_H__ | 34 | #define __LINUX_PUBLIC_PRIVCMD_H__ |
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | #include <linux/compiler.h> | ||
37 | 38 | ||
38 | typedef unsigned long xen_pfn_t; | 39 | typedef unsigned long xen_pfn_t; |
39 | 40 | ||
40 | #ifndef __user | ||
41 | #define __user | ||
42 | #endif | ||
43 | |||
44 | struct privcmd_hypercall { | 41 | struct privcmd_hypercall { |
45 | __u64 op; | 42 | __u64 op; |
46 | __u64 arg[5]; | 43 | __u64 arg[5]; |