diff options
Diffstat (limited to 'include')
45 files changed, 725 insertions, 265 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/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/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/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/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/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/i2c.h b/include/linux/i2c.h index 1f66fa06a97c..889b35abaeda 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -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/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/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/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/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/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/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/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/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/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/tty.h b/include/linux/tty.h index e500171c745f..2a754748dd5f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -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/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/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/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/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 */ |