diff options
Diffstat (limited to 'include/linux')
57 files changed, 1568 insertions, 224 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h index a30ef13c9e62..43dc2ebfaa0e 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -226,7 +226,8 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
226 | __put_ioctx(kioctx); \ | 226 | __put_ioctx(kioctx); \ |
227 | } while (0) | 227 | } while (0) |
228 | 228 | ||
229 | #define in_aio() !is_sync_wait(current->io_wait) | 229 | #define in_aio() (unlikely(!is_sync_wait(current->io_wait))) |
230 | |||
230 | /* may be used for debugging */ | 231 | /* may be used for debugging */ |
231 | #define warn_if_async() \ | 232 | #define warn_if_async() \ |
232 | do { \ | 233 | do { \ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a686eabe22d6..db5b00a792f5 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -854,7 +854,7 @@ static inline void put_dev_sector(Sector p) | |||
854 | 854 | ||
855 | struct work_struct; | 855 | struct work_struct; |
856 | int kblockd_schedule_work(struct work_struct *work); | 856 | int kblockd_schedule_work(struct work_struct *work); |
857 | void kblockd_flush(void); | 857 | void kblockd_flush_work(struct work_struct *work); |
858 | 858 | ||
859 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 859 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
860 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 860 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 2665ca04cf8f..bf297b03a4e4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -49,6 +49,7 @@ struct clocksource; | |||
49 | * @shift: cycle to nanosecond divisor (power of two) | 49 | * @shift: cycle to nanosecond divisor (power of two) |
50 | * @flags: flags describing special properties | 50 | * @flags: flags describing special properties |
51 | * @vread: vsyscall based read | 51 | * @vread: vsyscall based read |
52 | * @resume: resume function for the clocksource, if necessary | ||
52 | * @cycle_interval: Used internally by timekeeping core, please ignore. | 53 | * @cycle_interval: Used internally by timekeeping core, please ignore. |
53 | * @xtime_interval: Used internally by timekeeping core, please ignore. | 54 | * @xtime_interval: Used internally by timekeeping core, please ignore. |
54 | */ | 55 | */ |
@@ -65,6 +66,7 @@ struct clocksource { | |||
65 | u32 shift; | 66 | u32 shift; |
66 | unsigned long flags; | 67 | unsigned long flags; |
67 | cycle_t (*vread)(void); | 68 | cycle_t (*vread)(void); |
69 | void (*resume)(void); | ||
68 | 70 | ||
69 | /* timekeeping specific data, ignore */ | 71 | /* timekeeping specific data, ignore */ |
70 | cycle_t cycle_interval; | 72 | cycle_t cycle_interval; |
@@ -209,6 +211,7 @@ static inline void clocksource_calculate_interval(struct clocksource *c, | |||
209 | extern int clocksource_register(struct clocksource*); | 211 | extern int clocksource_register(struct clocksource*); |
210 | extern struct clocksource* clocksource_get_next(void); | 212 | extern struct clocksource* clocksource_get_next(void); |
211 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 213 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
214 | extern void clocksource_resume(void); | ||
212 | 215 | ||
213 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 216 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
214 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 217 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); |
diff --git a/include/linux/compat.h b/include/linux/compat.h index ccd863dd77fa..70a157a130bb 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -253,5 +253,8 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, | |||
253 | const compat_sigset_t __user *sigmask, | 253 | const compat_sigset_t __user *sigmask, |
254 | compat_size_t sigsetsize); | 254 | compat_size_t sigsetsize); |
255 | 255 | ||
256 | asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, | ||
257 | struct compat_timespec __user *t, int flags); | ||
258 | |||
256 | #endif /* CONFIG_COMPAT */ | 259 | #endif /* CONFIG_COMPAT */ |
257 | #endif /* _LINUX_COMPAT_H */ | 260 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index a9f794716a81..03ec2311fb29 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -40,3 +40,4 @@ | |||
40 | #define noinline __attribute__((noinline)) | 40 | #define noinline __attribute__((noinline)) |
41 | #define __attribute_pure__ __attribute__((pure)) | 41 | #define __attribute_pure__ __attribute__((pure)) |
42 | #define __attribute_const__ __attribute__((__const__)) | 42 | #define __attribute_const__ __attribute__((__const__)) |
43 | #define __maybe_unused __attribute__((unused)) | ||
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index ecd621fd27d2..a9e2863c2dbf 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -4,9 +4,11 @@ | |||
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #if __GNUC_MINOR__ >= 3 | 6 | #if __GNUC_MINOR__ >= 3 |
7 | # define __attribute_used__ __attribute__((__used__)) | 7 | # define __used __attribute__((__used__)) |
8 | # define __attribute_used__ __used /* deprecated */ | ||
8 | #else | 9 | #else |
9 | # define __attribute_used__ __attribute__((__unused__)) | 10 | # define __used __attribute__((__unused__)) |
11 | # define __attribute_used__ __used /* deprecated */ | ||
10 | #endif | 12 | #endif |
11 | 13 | ||
12 | #if __GNUC_MINOR__ >= 4 | 14 | #if __GNUC_MINOR__ >= 4 |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index fd0cc7c4a636..a03e9398a6c2 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -12,7 +12,8 @@ | |||
12 | # define __inline __inline __attribute__((always_inline)) | 12 | # define __inline __inline __attribute__((always_inline)) |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #define __attribute_used__ __attribute__((__used__)) | 15 | #define __used __attribute__((__used__)) |
16 | #define __attribute_used__ __used /* deprecated */ | ||
16 | #define __must_check __attribute__((warn_unused_result)) | 17 | #define __must_check __attribute__((warn_unused_result)) |
17 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 18 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
18 | #define __always_inline inline __attribute__((always_inline)) | 19 | #define __always_inline inline __attribute__((always_inline)) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 3b6949b41745..498c35920762 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -108,15 +108,30 @@ extern void __chk_io_ptr(const void __iomem *); | |||
108 | * Allow us to avoid 'defined but not used' warnings on functions and data, | 108 | * Allow us to avoid 'defined but not used' warnings on functions and data, |
109 | * as well as force them to be emitted to the assembly file. | 109 | * as well as force them to be emitted to the assembly file. |
110 | * | 110 | * |
111 | * As of gcc 3.3, static functions that are not marked with attribute((used)) | 111 | * As of gcc 3.4, static functions that are not marked with attribute((used)) |
112 | * may be elided from the assembly file. As of gcc 3.3, static data not so | 112 | * may be elided from the assembly file. As of gcc 3.4, static data not so |
113 | * marked will not be elided, but this may change in a future gcc version. | 113 | * marked will not be elided, but this may change in a future gcc version. |
114 | * | 114 | * |
115 | * NOTE: Because distributions shipped with a backported unit-at-a-time | ||
116 | * compiler in gcc 3.3, we must define __used to be __attribute__((used)) | ||
117 | * for gcc >=3.3 instead of 3.4. | ||
118 | * | ||
115 | * In prior versions of gcc, such functions and data would be emitted, but | 119 | * In prior versions of gcc, such functions and data would be emitted, but |
116 | * would be warned about except with attribute((unused)). | 120 | * would be warned about except with attribute((unused)). |
121 | * | ||
122 | * Mark functions that are referenced only in inline assembly as __used so | ||
123 | * the code is emitted even though it appears to be unreferenced. | ||
117 | */ | 124 | */ |
118 | #ifndef __attribute_used__ | 125 | #ifndef __attribute_used__ |
119 | # define __attribute_used__ /* unimplemented */ | 126 | # define __attribute_used__ /* deprecated */ |
127 | #endif | ||
128 | |||
129 | #ifndef __used | ||
130 | # define __used /* unimplemented */ | ||
131 | #endif | ||
132 | |||
133 | #ifndef __maybe_unused | ||
134 | # define __maybe_unused /* unimplemented */ | ||
120 | #endif | 135 | #endif |
121 | 136 | ||
122 | /* | 137 | /* |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 4395e5206746..7894dd0f3b77 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -54,7 +54,7 @@ struct ext3_block_alloc_info { | |||
54 | /* | 54 | /* |
55 | * Was i_next_alloc_goal in ext3_inode_info | 55 | * Was i_next_alloc_goal in ext3_inode_info |
56 | * is the *physical* companion to i_next_alloc_block. | 56 | * is the *physical* companion to i_next_alloc_block. |
57 | * it the the physical block number of the block which was most-recentl | 57 | * it the physical block number of the block which was most-recentl |
58 | * allocated to this file. This give us the goal (target) for the next | 58 | * allocated to this file. This give us the goal (target) for the next |
59 | * allocation when we detect linearly ascending requests. | 59 | * allocation when we detect linearly ascending requests. |
60 | */ | 60 | */ |
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h index bb42379cb7fd..d5b177e5b395 100644 --- a/include/linux/ext4_fs_i.h +++ b/include/linux/ext4_fs_i.h | |||
@@ -52,7 +52,7 @@ struct ext4_block_alloc_info { | |||
52 | /* | 52 | /* |
53 | * Was i_next_alloc_goal in ext4_inode_info | 53 | * Was i_next_alloc_goal in ext4_inode_info |
54 | * is the *physical* companion to i_next_alloc_block. | 54 | * is the *physical* companion to i_next_alloc_block. |
55 | * it the the physical block number of the block which was most-recentl | 55 | * it the physical block number of the block which was most-recentl |
56 | * allocated to this file. This give us the goal (target) for the next | 56 | * allocated to this file. This give us the goal (target) for the next |
57 | * allocation when we detect linearly ascending requests. | 57 | * allocation when we detect linearly ascending requests. |
58 | */ | 58 | */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index dff7a728948c..c654d0e9ce33 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -868,7 +868,7 @@ struct fb_info { | |||
868 | #define fb_writeq sbus_writeq | 868 | #define fb_writeq sbus_writeq |
869 | #define fb_memset sbus_memset_io | 869 | #define fb_memset sbus_memset_io |
870 | 870 | ||
871 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__) | 871 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__) || defined(__avr32__) |
872 | 872 | ||
873 | #define fb_readb __raw_readb | 873 | #define fb_readb __raw_readb |
874 | #define fb_readw __raw_readw | 874 | #define fb_readw __raw_readw |
diff --git a/include/linux/futex.h b/include/linux/futex.h index 820125c628c1..899fc7f20edd 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | 5 | ||
6 | union ktime; | ||
7 | |||
6 | /* Second argument to futex syscall */ | 8 | /* Second argument to futex syscall */ |
7 | 9 | ||
8 | 10 | ||
@@ -15,6 +17,19 @@ | |||
15 | #define FUTEX_LOCK_PI 6 | 17 | #define FUTEX_LOCK_PI 6 |
16 | #define FUTEX_UNLOCK_PI 7 | 18 | #define FUTEX_UNLOCK_PI 7 |
17 | #define FUTEX_TRYLOCK_PI 8 | 19 | #define FUTEX_TRYLOCK_PI 8 |
20 | #define FUTEX_CMP_REQUEUE_PI 9 | ||
21 | |||
22 | #define FUTEX_PRIVATE_FLAG 128 | ||
23 | #define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG | ||
24 | |||
25 | #define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG) | ||
26 | #define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG) | ||
27 | #define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG) | ||
28 | #define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG) | ||
29 | #define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG) | ||
30 | #define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG) | ||
31 | #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG) | ||
32 | #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) | ||
18 | 33 | ||
19 | /* | 34 | /* |
20 | * Support for robust futexes: the kernel cleans up held futexes at | 35 | * Support for robust futexes: the kernel cleans up held futexes at |
@@ -83,9 +98,14 @@ struct robust_list_head { | |||
83 | #define FUTEX_OWNER_DIED 0x40000000 | 98 | #define FUTEX_OWNER_DIED 0x40000000 |
84 | 99 | ||
85 | /* | 100 | /* |
101 | * Some processes have been requeued on this PI-futex | ||
102 | */ | ||
103 | #define FUTEX_WAITER_REQUEUED 0x20000000 | ||
104 | |||
105 | /* | ||
86 | * The rest of the robust-futex field is for the TID: | 106 | * The rest of the robust-futex field is for the TID: |
87 | */ | 107 | */ |
88 | #define FUTEX_TID_MASK 0x3fffffff | 108 | #define FUTEX_TID_MASK 0x0fffffff |
89 | 109 | ||
90 | /* | 110 | /* |
91 | * This limit protects against a deliberately circular list. | 111 | * This limit protects against a deliberately circular list. |
@@ -94,7 +114,7 @@ struct robust_list_head { | |||
94 | #define ROBUST_LIST_LIMIT 2048 | 114 | #define ROBUST_LIST_LIMIT 2048 |
95 | 115 | ||
96 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
97 | long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, | 117 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, |
98 | u32 __user *uaddr2, u32 val2, u32 val3); | 118 | u32 __user *uaddr2, u32 val2, u32 val3); |
99 | 119 | ||
100 | extern int | 120 | extern int |
@@ -106,9 +126,20 @@ handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); | |||
106 | * Don't rearrange members without looking at hash_futex(). | 126 | * Don't rearrange members without looking at hash_futex(). |
107 | * | 127 | * |
108 | * offset is aligned to a multiple of sizeof(u32) (== 4) by definition. | 128 | * offset is aligned to a multiple of sizeof(u32) (== 4) by definition. |
109 | * We set bit 0 to indicate if it's an inode-based key. | 129 | * We use the two low order bits of offset to tell what is the kind of key : |
110 | */ | 130 | * 00 : Private process futex (PTHREAD_PROCESS_PRIVATE) |
131 | * (no reference on an inode or mm) | ||
132 | * 01 : Shared futex (PTHREAD_PROCESS_SHARED) | ||
133 | * mapped on a file (reference on the underlying inode) | ||
134 | * 10 : Shared futex (PTHREAD_PROCESS_SHARED) | ||
135 | * (but private mapping on an mm, and reference taken on it) | ||
136 | */ | ||
137 | |||
138 | #define FUT_OFF_INODE 1 /* We set bit 0 if key has a reference on inode */ | ||
139 | #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */ | ||
140 | |||
111 | union futex_key { | 141 | union futex_key { |
142 | u32 __user *uaddr; | ||
112 | struct { | 143 | struct { |
113 | unsigned long pgoff; | 144 | unsigned long pgoff; |
114 | struct inode *inode; | 145 | struct inode *inode; |
@@ -125,7 +156,8 @@ union futex_key { | |||
125 | int offset; | 156 | int offset; |
126 | } both; | 157 | } both; |
127 | }; | 158 | }; |
128 | int get_futex_key(u32 __user *uaddr, union futex_key *key); | 159 | int get_futex_key(u32 __user *uaddr, struct rw_semaphore *shared, |
160 | union futex_key *key); | ||
129 | void get_futex_key_refs(union futex_key *key); | 161 | void get_futex_key_refs(union futex_key *key); |
130 | void drop_futex_key_refs(union futex_key *key); | 162 | void drop_futex_key_refs(union futex_key *key); |
131 | 163 | ||
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h index 80764f40be75..886f5faa08cb 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * fs/generic_acl.c | 2 | * include/linux/generic_acl.h |
3 | * | 3 | * |
4 | * (C) 2005 Andreas Gruenbacher <agruen@suse.de> | 4 | * (C) 2005 Andreas Gruenbacher <agruen@suse.de> |
5 | * | 5 | * |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 2c65da7cabb2..f589559cf070 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -413,6 +413,7 @@ char *disk_name (struct gendisk *hd, int part, char *buf); | |||
413 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); | 413 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
414 | extern void add_partition(struct gendisk *, int, sector_t, sector_t, int); | 414 | extern void add_partition(struct gendisk *, int, sector_t, sector_t, int); |
415 | extern void delete_partition(struct gendisk *, int); | 415 | extern void delete_partition(struct gendisk *, int); |
416 | extern void printk_all_partitions(void); | ||
416 | 417 | ||
417 | extern struct gendisk *alloc_disk_node(int minors, int node_id); | 418 | extern struct gendisk *alloc_disk_node(int minors, int node_id); |
418 | extern struct gendisk *alloc_disk(int minors); | 419 | extern struct gendisk *alloc_disk(int minors); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 97a36c3d96e2..0d2ef0b082a6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -176,10 +176,6 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
176 | #define free_page(addr) free_pages((addr),0) | 176 | #define free_page(addr) free_pages((addr),0) |
177 | 177 | ||
178 | void page_alloc_init(void); | 178 | void page_alloc_init(void); |
179 | #ifdef CONFIG_NUMA | 179 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); |
180 | void drain_node_pages(int node); | ||
181 | #else | ||
182 | static inline void drain_node_pages(int node) { }; | ||
183 | #endif | ||
184 | 180 | ||
185 | #endif /* __LINUX_GFP_H */ | 181 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index a515eb0afdfb..98e2cce996a4 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -94,17 +94,26 @@ static inline void clear_highpage(struct page *page) | |||
94 | 94 | ||
95 | /* | 95 | /* |
96 | * Same but also flushes aliased cache contents to RAM. | 96 | * Same but also flushes aliased cache contents to RAM. |
97 | * | ||
98 | * This must be a macro because KM_USER0 and friends aren't defined if | ||
99 | * !CONFIG_HIGHMEM | ||
97 | */ | 100 | */ |
98 | static inline void memclear_highpage_flush(struct page *page, unsigned int offset, unsigned int size) | 101 | #define zero_user_page(page, offset, size, km_type) \ |
102 | do { \ | ||
103 | void *kaddr; \ | ||
104 | \ | ||
105 | BUG_ON((offset) + (size) > PAGE_SIZE); \ | ||
106 | \ | ||
107 | kaddr = kmap_atomic(page, km_type); \ | ||
108 | memset((char *)kaddr + (offset), 0, (size)); \ | ||
109 | flush_dcache_page(page); \ | ||
110 | kunmap_atomic(kaddr, (km_type)); \ | ||
111 | } while (0) | ||
112 | |||
113 | static inline void __deprecated memclear_highpage_flush(struct page *page, | ||
114 | unsigned int offset, unsigned int size) | ||
99 | { | 115 | { |
100 | void *kaddr; | 116 | zero_user_page(page, offset, size, KM_USER0); |
101 | |||
102 | BUG_ON(offset + size > PAGE_SIZE); | ||
103 | |||
104 | kaddr = kmap_atomic(page, KM_USER0); | ||
105 | memset((char *)kaddr + offset, 0, size); | ||
106 | flush_dcache_page(page); | ||
107 | kunmap_atomic(kaddr, KM_USER0); | ||
108 | } | 117 | } |
109 | 118 | ||
110 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE | 119 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE |
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index 9ee0f800592f..111334f5b922 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -18,7 +18,7 @@ | |||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
19 | /* ------------------------------------------------------------------------- */ | 19 | /* ------------------------------------------------------------------------- */ |
20 | 20 | ||
21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
22 | Frodo Looijaard <frodol@dds.nl> */ | 22 | Frodo Looijaard <frodol@dds.nl> */ |
23 | 23 | ||
24 | #ifndef _LINUX_I2C_ALGO_BIT_H | 24 | #ifndef _LINUX_I2C_ALGO_BIT_H |
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 994eb86f882c..77afbb60fd11 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
@@ -19,7 +19,7 @@ | |||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
20 | /* ------------------------------------------------------------------------- */ | 20 | /* ------------------------------------------------------------------------- */ |
21 | 21 | ||
22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
23 | Frodo Looijaard <frodol@dds.nl> */ | 23 | Frodo Looijaard <frodol@dds.nl> */ |
24 | 24 | ||
25 | #ifndef _LINUX_I2C_ALGO_PCF_H | 25 | #ifndef _LINUX_I2C_ALGO_PCF_H |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 418dfb5adadd..df4e6a510310 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -223,8 +223,9 @@ typedef struct hw_regs_s { | |||
223 | /* | 223 | /* |
224 | * Register new hardware with ide | 224 | * Register new hardware with ide |
225 | */ | 225 | */ |
226 | int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp); | 226 | int ide_register_hw(hw_regs_t *, int, struct hwif_s **); |
227 | int ide_register_hw_with_fixup(hw_regs_t *, struct hwif_s **, void (*)(struct hwif_s *)); | 227 | int ide_register_hw_with_fixup(hw_regs_t *, int, struct hwif_s **, |
228 | void (*)(struct hwif_s *)); | ||
228 | 229 | ||
229 | /* | 230 | /* |
230 | * Set up hw_regs_t structure before calling ide_register_hw (optional) | 231 | * Set up hw_regs_t structure before calling ide_register_hw (optional) |
@@ -559,9 +560,10 @@ typedef struct ide_drive_s { | |||
559 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 560 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
560 | void *driver_data; /* extra driver data */ | 561 | void *driver_data; /* extra driver data */ |
561 | struct hd_driveid *id; /* drive model identification info */ | 562 | struct hd_driveid *id; /* drive model identification info */ |
563 | #ifdef CONFIG_IDE_PROC_FS | ||
562 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 564 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
563 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ | 565 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ |
564 | 566 | #endif | |
565 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 567 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
566 | 568 | ||
567 | unsigned long sleep; /* sleep until this time */ | 569 | unsigned long sleep; /* sleep until this time */ |
@@ -601,16 +603,12 @@ typedef struct ide_drive_s { | |||
601 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 603 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ |
602 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 604 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
603 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ | 605 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ |
604 | unsigned addressing; /* : 3; | ||
605 | * 0=28-bit | ||
606 | * 1=48-bit | ||
607 | * 2=48-bit doing 28-bit | ||
608 | * 3=64-bit | ||
609 | */ | ||
610 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 606 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
611 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 607 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
612 | unsigned post_reset : 1; | 608 | unsigned post_reset : 1; |
609 | unsigned udma33_warned : 1; | ||
613 | 610 | ||
611 | u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ | ||
614 | u8 quirk_list; /* considered quirky, set for a specific host */ | 612 | u8 quirk_list; /* considered quirky, set for a specific host */ |
615 | u8 init_speed; /* transfer rate set at boot */ | 613 | u8 init_speed; /* transfer rate set at boot */ |
616 | u8 current_speed; /* current transfer rate set */ | 614 | u8 current_speed; /* current transfer rate set */ |
@@ -717,11 +715,8 @@ typedef struct hwif_s { | |||
717 | int (*quirkproc)(ide_drive_t *); | 715 | int (*quirkproc)(ide_drive_t *); |
718 | /* driver soft-power interface */ | 716 | /* driver soft-power interface */ |
719 | int (*busproc)(ide_drive_t *, int); | 717 | int (*busproc)(ide_drive_t *, int); |
720 | // /* host rate limiter */ | ||
721 | // u8 (*ratemask)(ide_drive_t *); | ||
722 | // /* device rate limiter */ | ||
723 | // u8 (*ratefilter)(ide_drive_t *, u8); | ||
724 | #endif | 718 | #endif |
719 | u8 (*udma_filter)(ide_drive_t *); | ||
725 | 720 | ||
726 | void (*ata_input_data)(ide_drive_t *, void *, u32); | 721 | void (*ata_input_data)(ide_drive_t *, void *, u32); |
727 | void (*ata_output_data)(ide_drive_t *, void *, u32); | 722 | void (*ata_output_data)(ide_drive_t *, void *, u32); |
@@ -866,16 +861,22 @@ typedef struct hwgroup_s { | |||
866 | unsigned char cmd_buf[4]; | 861 | unsigned char cmd_buf[4]; |
867 | } ide_hwgroup_t; | 862 | } ide_hwgroup_t; |
868 | 863 | ||
869 | /* structure attached to the request for IDE_TASK_CMDS */ | 864 | typedef struct ide_driver_s ide_driver_t; |
865 | |||
866 | extern struct semaphore ide_setting_sem; | ||
867 | |||
868 | int set_io_32bit(ide_drive_t *, int); | ||
869 | int set_pio_mode(ide_drive_t *, int); | ||
870 | int set_using_dma(ide_drive_t *, int); | ||
870 | 871 | ||
872 | #ifdef CONFIG_IDE_PROC_FS | ||
871 | /* | 873 | /* |
872 | * configurable drive settings | 874 | * configurable drive settings |
873 | */ | 875 | */ |
874 | 876 | ||
875 | #define TYPE_INT 0 | 877 | #define TYPE_INT 0 |
876 | #define TYPE_INTA 1 | 878 | #define TYPE_BYTE 1 |
877 | #define TYPE_BYTE 2 | 879 | #define TYPE_SHORT 2 |
878 | #define TYPE_SHORT 3 | ||
879 | 880 | ||
880 | #define SETTING_READ (1 << 0) | 881 | #define SETTING_READ (1 << 0) |
881 | #define SETTING_WRITE (1 << 1) | 882 | #define SETTING_WRITE (1 << 1) |
@@ -885,8 +886,6 @@ typedef int (ide_procset_t)(ide_drive_t *, int); | |||
885 | typedef struct ide_settings_s { | 886 | typedef struct ide_settings_s { |
886 | char *name; | 887 | char *name; |
887 | int rw; | 888 | int rw; |
888 | int read_ioctl; | ||
889 | int write_ioctl; | ||
890 | int data_type; | 889 | int data_type; |
891 | int min; | 890 | int min; |
892 | int max; | 891 | int max; |
@@ -898,12 +897,7 @@ typedef struct ide_settings_s { | |||
898 | struct ide_settings_s *next; | 897 | struct ide_settings_s *next; |
899 | } ide_settings_t; | 898 | } ide_settings_t; |
900 | 899 | ||
901 | extern struct semaphore ide_setting_sem; | 900 | int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set); |
902 | extern int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set); | ||
903 | extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name); | ||
904 | extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting); | ||
905 | extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val); | ||
906 | extern void ide_add_generic_settings(ide_drive_t *drive); | ||
907 | 901 | ||
908 | /* | 902 | /* |
909 | * /proc/ide interface | 903 | * /proc/ide interface |
@@ -915,15 +909,15 @@ typedef struct { | |||
915 | write_proc_t *write_proc; | 909 | write_proc_t *write_proc; |
916 | } ide_proc_entry_t; | 910 | } ide_proc_entry_t; |
917 | 911 | ||
918 | #ifdef CONFIG_PROC_FS | 912 | void proc_ide_create(void); |
919 | extern struct proc_dir_entry *proc_ide_root; | 913 | void proc_ide_destroy(void); |
914 | void ide_proc_register_port(ide_hwif_t *); | ||
915 | void ide_proc_unregister_port(ide_hwif_t *); | ||
916 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | ||
917 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | ||
918 | |||
919 | void ide_add_generic_settings(ide_drive_t *); | ||
920 | 920 | ||
921 | extern void proc_ide_create(void); | ||
922 | extern void proc_ide_destroy(void); | ||
923 | extern void create_proc_ide_interfaces(void); | ||
924 | void destroy_proc_ide_interface(ide_hwif_t *); | ||
925 | extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *); | ||
926 | extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *); | ||
927 | read_proc_t proc_ide_read_capacity; | 921 | read_proc_t proc_ide_read_capacity; |
928 | read_proc_t proc_ide_read_geometry; | 922 | read_proc_t proc_ide_read_geometry; |
929 | 923 | ||
@@ -947,8 +941,13 @@ void ide_pci_create_host_proc(const char *, get_info_t *); | |||
947 | return len; \ | 941 | return len; \ |
948 | } | 942 | } |
949 | #else | 943 | #else |
950 | static inline void create_proc_ide_interfaces(void) { ; } | 944 | static inline void proc_ide_create(void) { ; } |
951 | static inline void destroy_proc_ide_interface(ide_hwif_t *hwif) { ; } | 945 | static inline void proc_ide_destroy(void) { ; } |
946 | static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } | ||
947 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | ||
948 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | ||
949 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | ||
950 | static inline void ide_add_generic_settings(ide_drive_t *drive) { ; } | ||
952 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | 951 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
953 | #endif | 952 | #endif |
954 | 953 | ||
@@ -991,7 +990,7 @@ enum { | |||
991 | * The gendriver.owner field should be set to the module owner of this driver. | 990 | * The gendriver.owner field should be set to the module owner of this driver. |
992 | * The gendriver.name field should be set to the name of this driver | 991 | * The gendriver.name field should be set to the name of this driver |
993 | */ | 992 | */ |
994 | typedef struct ide_driver_s { | 993 | struct ide_driver_s { |
995 | const char *version; | 994 | const char *version; |
996 | u8 media; | 995 | u8 media; |
997 | unsigned supports_dsc_overlap : 1; | 996 | unsigned supports_dsc_overlap : 1; |
@@ -999,12 +998,14 @@ typedef struct ide_driver_s { | |||
999 | int (*end_request)(ide_drive_t *, int, int); | 998 | int (*end_request)(ide_drive_t *, int, int); |
1000 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | 999 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); |
1001 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); | 1000 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); |
1002 | ide_proc_entry_t *proc; | ||
1003 | struct device_driver gen_driver; | 1001 | struct device_driver gen_driver; |
1004 | int (*probe)(ide_drive_t *); | 1002 | int (*probe)(ide_drive_t *); |
1005 | void (*remove)(ide_drive_t *); | 1003 | void (*remove)(ide_drive_t *); |
1006 | void (*shutdown)(ide_drive_t *); | 1004 | void (*shutdown)(ide_drive_t *); |
1007 | } ide_driver_t; | 1005 | #ifdef CONFIG_IDE_PROC_FS |
1006 | ide_proc_entry_t *proc; | ||
1007 | #endif | ||
1008 | }; | ||
1008 | 1009 | ||
1009 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 1010 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) |
1010 | 1011 | ||
@@ -1204,9 +1205,14 @@ void ide_init_disk(struct gendisk *, ide_drive_t *); | |||
1204 | 1205 | ||
1205 | extern int ideprobe_init(void); | 1206 | extern int ideprobe_init(void); |
1206 | 1207 | ||
1208 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER | ||
1207 | extern void ide_scan_pcibus(int scan_direction) __init; | 1209 | extern void ide_scan_pcibus(int scan_direction) __init; |
1208 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); | 1210 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); |
1209 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) | 1211 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) |
1212 | #else | ||
1213 | #define ide_pci_register_driver(d) pci_register_driver(d) | ||
1214 | #endif | ||
1215 | |||
1210 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); | 1216 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); |
1211 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); | 1217 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); |
1212 | 1218 | ||
@@ -1214,9 +1220,6 @@ extern void default_hwif_iops(ide_hwif_t *); | |||
1214 | extern void default_hwif_mmiops(ide_hwif_t *); | 1220 | extern void default_hwif_mmiops(ide_hwif_t *); |
1215 | extern void default_hwif_transport(ide_hwif_t *); | 1221 | extern void default_hwif_transport(ide_hwif_t *); |
1216 | 1222 | ||
1217 | void ide_register_subdriver(ide_drive_t *, ide_driver_t *); | ||
1218 | void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *); | ||
1219 | |||
1220 | #define ON_BOARD 1 | 1223 | #define ON_BOARD 1 |
1221 | #define NEVER_BOARD 0 | 1224 | #define NEVER_BOARD 0 |
1222 | 1225 | ||
@@ -1257,6 +1260,7 @@ typedef struct ide_pci_device_s { | |||
1257 | unsigned int extra; | 1260 | unsigned int extra; |
1258 | struct ide_pci_device_s *next; | 1261 | struct ide_pci_device_s *next; |
1259 | u8 flags; | 1262 | u8 flags; |
1263 | u8 udma_mask; | ||
1260 | } ide_pci_device_t; | 1264 | } ide_pci_device_t; |
1261 | 1265 | ||
1262 | extern int ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); | 1266 | extern int ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); |
@@ -1278,6 +1282,8 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1278 | int __ide_dma_bad_drive(ide_drive_t *); | 1282 | int __ide_dma_bad_drive(ide_drive_t *); |
1279 | int __ide_dma_good_drive(ide_drive_t *); | 1283 | int __ide_dma_good_drive(ide_drive_t *); |
1280 | int ide_use_dma(ide_drive_t *); | 1284 | int ide_use_dma(ide_drive_t *); |
1285 | u8 ide_max_dma_mode(ide_drive_t *); | ||
1286 | int ide_tune_dma(ide_drive_t *); | ||
1281 | void ide_dma_off(ide_drive_t *); | 1287 | void ide_dma_off(ide_drive_t *); |
1282 | void ide_dma_verbose(ide_drive_t *); | 1288 | void ide_dma_verbose(ide_drive_t *); |
1283 | int ide_set_dma(ide_drive_t *); | 1289 | int ide_set_dma(ide_drive_t *); |
@@ -1304,6 +1310,8 @@ extern int __ide_dma_timeout(ide_drive_t *); | |||
1304 | 1310 | ||
1305 | #else | 1311 | #else |
1306 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } | 1312 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } |
1313 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | ||
1314 | static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } | ||
1307 | static inline void ide_dma_off(ide_drive_t *drive) { ; } | 1315 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1308 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1316 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1309 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1317 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } |
@@ -1348,8 +1356,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1348 | } | 1356 | } |
1349 | 1357 | ||
1350 | /* ide-lib.c */ | 1358 | /* ide-lib.c */ |
1351 | extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode); | 1359 | u8 ide_rate_filter(ide_drive_t *, u8); |
1352 | extern u8 ide_rate_filter(u8 mode, u8 speed); | ||
1353 | extern int ide_dma_enable(ide_drive_t *drive); | 1360 | extern int ide_dma_enable(ide_drive_t *drive); |
1354 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1361 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1355 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1362 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 795102309bf1..45170b2fa253 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -95,7 +95,7 @@ extern struct group_info init_groups; | |||
95 | #define INIT_TASK(tsk) \ | 95 | #define INIT_TASK(tsk) \ |
96 | { \ | 96 | { \ |
97 | .state = 0, \ | 97 | .state = 0, \ |
98 | .thread_info = &init_thread_info, \ | 98 | .stack = &init_thread_info, \ |
99 | .usage = ATOMIC_INIT(2), \ | 99 | .usage = ATOMIC_INIT(2), \ |
100 | .flags = 0, \ | 100 | .flags = 0, \ |
101 | .lock_depth = -1, \ | 101 | .lock_depth = -1, \ |
diff --git a/include/linux/irda.h b/include/linux/irda.h index 09d8f105a5a8..945ba3110874 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h | |||
@@ -16,7 +16,7 @@ | |||
16 | * published by the Free Software Foundation; either version 2 of | 16 | * published by the Free Software Foundation; either version 2 of |
17 | * the License, or (at your option) any later version. | 17 | * the License, or (at your option) any later version. |
18 | * | 18 | * |
19 | * Neither Dag Brattli nor University of Tromsø admit liability nor | 19 | * Neither Dag Brattli nor University of Tromsø admit liability nor |
20 | * provide warranty for any of this software. This material is | 20 | * provide warranty for any of this software. This material is |
21 | * provided "AS-IS" and at no charge. | 21 | * provided "AS-IS" and at no charge. |
22 | * | 22 | * |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 1c65e7a9f186..00dd957e245b 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -30,4 +30,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu); | |||
30 | int kthread_stop(struct task_struct *k); | 30 | int kthread_stop(struct task_struct *k); |
31 | int kthread_should_stop(void); | 31 | int kthread_should_stop(void); |
32 | 32 | ||
33 | int kthreadd(void *unused); | ||
34 | extern struct task_struct *kthreadd_task; | ||
35 | |||
33 | #endif /* _LINUX_KTHREAD_H */ | 36 | #endif /* _LINUX_KTHREAD_H */ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 81bb9c7a4eb3..c762954bda14 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -43,7 +43,7 @@ | |||
43 | * plain scalar nanosecond based representation can be selected by the | 43 | * plain scalar nanosecond based representation can be selected by the |
44 | * config switch CONFIG_KTIME_SCALAR. | 44 | * config switch CONFIG_KTIME_SCALAR. |
45 | */ | 45 | */ |
46 | typedef union { | 46 | union ktime { |
47 | s64 tv64; | 47 | s64 tv64; |
48 | #if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR) | 48 | #if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR) |
49 | struct { | 49 | struct { |
@@ -54,7 +54,9 @@ typedef union { | |||
54 | # endif | 54 | # endif |
55 | } tv; | 55 | } tv; |
56 | #endif | 56 | #endif |
57 | } ktime_t; | 57 | }; |
58 | |||
59 | typedef union ktime ktime_t; /* Kill this */ | ||
58 | 60 | ||
59 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | 61 | #define KTIME_MAX ((s64)~((u64)1 << 63)) |
60 | #if (BITS_PER_LONG == 64) | 62 | #if (BITS_PER_LONG == 64) |
diff --git a/include/linux/mca.h b/include/linux/mca.h index 5cff2923092b..37972704617f 100644 --- a/include/linux/mca.h +++ b/include/linux/mca.h | |||
@@ -94,6 +94,7 @@ struct mca_bus { | |||
94 | struct mca_driver { | 94 | struct mca_driver { |
95 | const short *id_table; | 95 | const short *id_table; |
96 | void *driver_data; | 96 | void *driver_data; |
97 | int integrated_id; | ||
97 | struct device_driver driver; | 98 | struct device_driver driver; |
98 | }; | 99 | }; |
99 | #define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver) | 100 | #define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver) |
@@ -125,6 +126,7 @@ extern enum MCA_AdapterStatus mca_device_status(struct mca_device *mca_dev); | |||
125 | extern struct bus_type mca_bus_type; | 126 | extern struct bus_type mca_bus_type; |
126 | 127 | ||
127 | extern int mca_register_driver(struct mca_driver *drv); | 128 | extern int mca_register_driver(struct mca_driver *drv); |
129 | extern int mca_register_driver_integrated(struct mca_driver *, int); | ||
128 | extern void mca_unregister_driver(struct mca_driver *drv); | 130 | extern void mca_unregister_driver(struct mca_driver *drv); |
129 | 131 | ||
130 | /* WARNING: only called by the boot time device setup */ | 132 | /* WARNING: only called by the boot time device setup */ |
diff --git a/include/linux/meye.h b/include/linux/meye.h index 11ec45e9a132..39fd9c8ddd4b 100644 --- a/include/linux/meye.h +++ b/include/linux/meye.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net> | 4 | * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net> |
5 | * | 5 | * |
6 | * Copyright (C) 2001-2002 Alcôve <www.alcove.com> | 6 | * Copyright (C) 2001-2002 Alcôve <www.alcove.com> |
7 | * | 7 | * |
8 | * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com> | 8 | * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com> |
9 | * | 9 | * |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h new file mode 100644 index 000000000000..4fb552d12f7a --- /dev/null +++ b/include/linux/mlx4/cmd.h | |||
@@ -0,0 +1,178 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_CMD_H | ||
34 | #define MLX4_CMD_H | ||
35 | |||
36 | #include <linux/dma-mapping.h> | ||
37 | |||
38 | enum { | ||
39 | /* initialization and general commands */ | ||
40 | MLX4_CMD_SYS_EN = 0x1, | ||
41 | MLX4_CMD_SYS_DIS = 0x2, | ||
42 | MLX4_CMD_MAP_FA = 0xfff, | ||
43 | MLX4_CMD_UNMAP_FA = 0xffe, | ||
44 | MLX4_CMD_RUN_FW = 0xff6, | ||
45 | MLX4_CMD_MOD_STAT_CFG = 0x34, | ||
46 | MLX4_CMD_QUERY_DEV_CAP = 0x3, | ||
47 | MLX4_CMD_QUERY_FW = 0x4, | ||
48 | MLX4_CMD_ENABLE_LAM = 0xff8, | ||
49 | MLX4_CMD_DISABLE_LAM = 0xff7, | ||
50 | MLX4_CMD_QUERY_DDR = 0x5, | ||
51 | MLX4_CMD_QUERY_ADAPTER = 0x6, | ||
52 | MLX4_CMD_INIT_HCA = 0x7, | ||
53 | MLX4_CMD_CLOSE_HCA = 0x8, | ||
54 | MLX4_CMD_INIT_PORT = 0x9, | ||
55 | MLX4_CMD_CLOSE_PORT = 0xa, | ||
56 | MLX4_CMD_QUERY_HCA = 0xb, | ||
57 | MLX4_CMD_SET_PORT = 0xc, | ||
58 | MLX4_CMD_ACCESS_DDR = 0x2e, | ||
59 | MLX4_CMD_MAP_ICM = 0xffa, | ||
60 | MLX4_CMD_UNMAP_ICM = 0xff9, | ||
61 | MLX4_CMD_MAP_ICM_AUX = 0xffc, | ||
62 | MLX4_CMD_UNMAP_ICM_AUX = 0xffb, | ||
63 | MLX4_CMD_SET_ICM_SIZE = 0xffd, | ||
64 | |||
65 | /* TPT commands */ | ||
66 | MLX4_CMD_SW2HW_MPT = 0xd, | ||
67 | MLX4_CMD_QUERY_MPT = 0xe, | ||
68 | MLX4_CMD_HW2SW_MPT = 0xf, | ||
69 | MLX4_CMD_READ_MTT = 0x10, | ||
70 | MLX4_CMD_WRITE_MTT = 0x11, | ||
71 | MLX4_CMD_SYNC_TPT = 0x2f, | ||
72 | |||
73 | /* EQ commands */ | ||
74 | MLX4_CMD_MAP_EQ = 0x12, | ||
75 | MLX4_CMD_SW2HW_EQ = 0x13, | ||
76 | MLX4_CMD_HW2SW_EQ = 0x14, | ||
77 | MLX4_CMD_QUERY_EQ = 0x15, | ||
78 | |||
79 | /* CQ commands */ | ||
80 | MLX4_CMD_SW2HW_CQ = 0x16, | ||
81 | MLX4_CMD_HW2SW_CQ = 0x17, | ||
82 | MLX4_CMD_QUERY_CQ = 0x18, | ||
83 | MLX4_CMD_RESIZE_CQ = 0x2c, | ||
84 | |||
85 | /* SRQ commands */ | ||
86 | MLX4_CMD_SW2HW_SRQ = 0x35, | ||
87 | MLX4_CMD_HW2SW_SRQ = 0x36, | ||
88 | MLX4_CMD_QUERY_SRQ = 0x37, | ||
89 | MLX4_CMD_ARM_SRQ = 0x40, | ||
90 | |||
91 | /* QP/EE commands */ | ||
92 | MLX4_CMD_RST2INIT_QP = 0x19, | ||
93 | MLX4_CMD_INIT2RTR_QP = 0x1a, | ||
94 | MLX4_CMD_RTR2RTS_QP = 0x1b, | ||
95 | MLX4_CMD_RTS2RTS_QP = 0x1c, | ||
96 | MLX4_CMD_SQERR2RTS_QP = 0x1d, | ||
97 | MLX4_CMD_2ERR_QP = 0x1e, | ||
98 | MLX4_CMD_RTS2SQD_QP = 0x1f, | ||
99 | MLX4_CMD_SQD2SQD_QP = 0x38, | ||
100 | MLX4_CMD_SQD2RTS_QP = 0x20, | ||
101 | MLX4_CMD_2RST_QP = 0x21, | ||
102 | MLX4_CMD_QUERY_QP = 0x22, | ||
103 | MLX4_CMD_INIT2INIT_QP = 0x2d, | ||
104 | MLX4_CMD_SUSPEND_QP = 0x32, | ||
105 | MLX4_CMD_UNSUSPEND_QP = 0x33, | ||
106 | /* special QP and management commands */ | ||
107 | MLX4_CMD_CONF_SPECIAL_QP = 0x23, | ||
108 | MLX4_CMD_MAD_IFC = 0x24, | ||
109 | |||
110 | /* multicast commands */ | ||
111 | MLX4_CMD_READ_MCG = 0x25, | ||
112 | MLX4_CMD_WRITE_MCG = 0x26, | ||
113 | MLX4_CMD_MGID_HASH = 0x27, | ||
114 | |||
115 | /* miscellaneous commands */ | ||
116 | MLX4_CMD_DIAG_RPRT = 0x30, | ||
117 | MLX4_CMD_NOP = 0x31, | ||
118 | |||
119 | /* debug commands */ | ||
120 | MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, | ||
121 | MLX4_CMD_SET_DEBUG_MSG = 0x2b, | ||
122 | }; | ||
123 | |||
124 | enum { | ||
125 | MLX4_CMD_TIME_CLASS_A = 10000, | ||
126 | MLX4_CMD_TIME_CLASS_B = 10000, | ||
127 | MLX4_CMD_TIME_CLASS_C = 10000, | ||
128 | }; | ||
129 | |||
130 | enum { | ||
131 | MLX4_MAILBOX_SIZE = 4096 | ||
132 | }; | ||
133 | |||
134 | struct mlx4_dev; | ||
135 | |||
136 | struct mlx4_cmd_mailbox { | ||
137 | void *buf; | ||
138 | dma_addr_t dma; | ||
139 | }; | ||
140 | |||
141 | int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, | ||
142 | int out_is_imm, u32 in_modifier, u8 op_modifier, | ||
143 | u16 op, unsigned long timeout); | ||
144 | |||
145 | /* Invoke a command with no output parameter */ | ||
146 | static inline int mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u32 in_modifier, | ||
147 | u8 op_modifier, u16 op, unsigned long timeout) | ||
148 | { | ||
149 | return __mlx4_cmd(dev, in_param, NULL, 0, in_modifier, | ||
150 | op_modifier, op, timeout); | ||
151 | } | ||
152 | |||
153 | /* Invoke a command with an output mailbox */ | ||
154 | static inline int mlx4_cmd_box(struct mlx4_dev *dev, u64 in_param, u64 out_param, | ||
155 | u32 in_modifier, u8 op_modifier, u16 op, | ||
156 | unsigned long timeout) | ||
157 | { | ||
158 | return __mlx4_cmd(dev, in_param, &out_param, 0, in_modifier, | ||
159 | op_modifier, op, timeout); | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * Invoke a command with an immediate output parameter (and copy the | ||
164 | * output into the caller's out_param pointer after the command | ||
165 | * executes). | ||
166 | */ | ||
167 | static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u64 in_param, u64 *out_param, | ||
168 | u32 in_modifier, u8 op_modifier, u16 op, | ||
169 | unsigned long timeout) | ||
170 | { | ||
171 | return __mlx4_cmd(dev, in_param, out_param, 1, in_modifier, | ||
172 | op_modifier, op, timeout); | ||
173 | } | ||
174 | |||
175 | struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev); | ||
176 | void mlx4_free_cmd_mailbox(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox); | ||
177 | |||
178 | #endif /* MLX4_CMD_H */ | ||
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h new file mode 100644 index 000000000000..0181e0a57cbf --- /dev/null +++ b/include/linux/mlx4/cq.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_CQ_H | ||
34 | #define MLX4_CQ_H | ||
35 | |||
36 | #include <linux/types.h> | ||
37 | |||
38 | #include <linux/mlx4/device.h> | ||
39 | #include <linux/mlx4/doorbell.h> | ||
40 | |||
41 | struct mlx4_cqe { | ||
42 | __be32 my_qpn; | ||
43 | __be32 immed_rss_invalid; | ||
44 | __be32 g_mlpath_rqpn; | ||
45 | u8 sl; | ||
46 | u8 reserved1; | ||
47 | __be16 rlid; | ||
48 | u32 reserved2; | ||
49 | __be32 byte_cnt; | ||
50 | __be16 wqe_index; | ||
51 | __be16 checksum; | ||
52 | u8 reserved3[3]; | ||
53 | u8 owner_sr_opcode; | ||
54 | }; | ||
55 | |||
56 | struct mlx4_err_cqe { | ||
57 | __be32 my_qpn; | ||
58 | u32 reserved1[5]; | ||
59 | __be16 wqe_index; | ||
60 | u8 vendor_err_syndrome; | ||
61 | u8 syndrome; | ||
62 | u8 reserved2[3]; | ||
63 | u8 owner_sr_opcode; | ||
64 | }; | ||
65 | |||
66 | enum { | ||
67 | MLX4_CQE_OWNER_MASK = 0x80, | ||
68 | MLX4_CQE_IS_SEND_MASK = 0x40, | ||
69 | MLX4_CQE_OPCODE_MASK = 0x1f | ||
70 | }; | ||
71 | |||
72 | enum { | ||
73 | MLX4_CQE_SYNDROME_LOCAL_LENGTH_ERR = 0x01, | ||
74 | MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR = 0x02, | ||
75 | MLX4_CQE_SYNDROME_LOCAL_PROT_ERR = 0x04, | ||
76 | MLX4_CQE_SYNDROME_WR_FLUSH_ERR = 0x05, | ||
77 | MLX4_CQE_SYNDROME_MW_BIND_ERR = 0x06, | ||
78 | MLX4_CQE_SYNDROME_BAD_RESP_ERR = 0x10, | ||
79 | MLX4_CQE_SYNDROME_LOCAL_ACCESS_ERR = 0x11, | ||
80 | MLX4_CQE_SYNDROME_REMOTE_INVAL_REQ_ERR = 0x12, | ||
81 | MLX4_CQE_SYNDROME_REMOTE_ACCESS_ERR = 0x13, | ||
82 | MLX4_CQE_SYNDROME_REMOTE_OP_ERR = 0x14, | ||
83 | MLX4_CQE_SYNDROME_TRANSPORT_RETRY_EXC_ERR = 0x15, | ||
84 | MLX4_CQE_SYNDROME_RNR_RETRY_EXC_ERR = 0x16, | ||
85 | MLX4_CQE_SYNDROME_REMOTE_ABORTED_ERR = 0x22, | ||
86 | }; | ||
87 | |||
88 | static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd, | ||
89 | void __iomem *uar_page, | ||
90 | spinlock_t *doorbell_lock) | ||
91 | { | ||
92 | __be32 doorbell[2]; | ||
93 | u32 sn; | ||
94 | u32 ci; | ||
95 | |||
96 | sn = cq->arm_sn & 3; | ||
97 | ci = cq->cons_index & 0xffffff; | ||
98 | |||
99 | *cq->arm_db = cpu_to_be32(sn << 28 | cmd | ci); | ||
100 | |||
101 | /* | ||
102 | * Make sure that the doorbell record in host memory is | ||
103 | * written before ringing the doorbell via PCI MMIO. | ||
104 | */ | ||
105 | wmb(); | ||
106 | |||
107 | doorbell[0] = cpu_to_be32(sn << 28 | cmd | cq->cqn); | ||
108 | doorbell[1] = cpu_to_be32(ci); | ||
109 | |||
110 | mlx4_write64(doorbell, uar_page + MLX4_CQ_DOORBELL, doorbell_lock); | ||
111 | } | ||
112 | |||
113 | static inline void mlx4_cq_set_ci(struct mlx4_cq *cq) | ||
114 | { | ||
115 | *cq->set_ci_db = cpu_to_be32(cq->cons_index & 0xffffff); | ||
116 | } | ||
117 | |||
118 | enum { | ||
119 | MLX4_CQ_DB_REQ_NOT_SOL = 1 << 24, | ||
120 | MLX4_CQ_DB_REQ_NOT = 2 << 24 | ||
121 | }; | ||
122 | |||
123 | #endif /* MLX4_CQ_H */ | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h new file mode 100644 index 000000000000..8c5f8fd86841 --- /dev/null +++ b/include/linux/mlx4/device.h | |||
@@ -0,0 +1,331 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_DEVICE_H | ||
34 | #define MLX4_DEVICE_H | ||
35 | |||
36 | #include <linux/pci.h> | ||
37 | #include <linux/completion.h> | ||
38 | #include <linux/radix-tree.h> | ||
39 | |||
40 | #include <asm/atomic.h> | ||
41 | |||
42 | enum { | ||
43 | MLX4_FLAG_MSI_X = 1 << 0, | ||
44 | }; | ||
45 | |||
46 | enum { | ||
47 | MLX4_MAX_PORTS = 2 | ||
48 | }; | ||
49 | |||
50 | enum { | ||
51 | MLX4_DEV_CAP_FLAG_RC = 1 << 0, | ||
52 | MLX4_DEV_CAP_FLAG_UC = 1 << 1, | ||
53 | MLX4_DEV_CAP_FLAG_UD = 1 << 2, | ||
54 | MLX4_DEV_CAP_FLAG_SRQ = 1 << 6, | ||
55 | MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, | ||
56 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, | ||
57 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, | ||
58 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, | ||
59 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, | ||
60 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | ||
61 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, | ||
62 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, | ||
63 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 | ||
64 | }; | ||
65 | |||
66 | enum mlx4_event { | ||
67 | MLX4_EVENT_TYPE_COMP = 0x00, | ||
68 | MLX4_EVENT_TYPE_PATH_MIG = 0x01, | ||
69 | MLX4_EVENT_TYPE_COMM_EST = 0x02, | ||
70 | MLX4_EVENT_TYPE_SQ_DRAINED = 0x03, | ||
71 | MLX4_EVENT_TYPE_SRQ_QP_LAST_WQE = 0x13, | ||
72 | MLX4_EVENT_TYPE_SRQ_LIMIT = 0x14, | ||
73 | MLX4_EVENT_TYPE_CQ_ERROR = 0x04, | ||
74 | MLX4_EVENT_TYPE_WQ_CATAS_ERROR = 0x05, | ||
75 | MLX4_EVENT_TYPE_EEC_CATAS_ERROR = 0x06, | ||
76 | MLX4_EVENT_TYPE_PATH_MIG_FAILED = 0x07, | ||
77 | MLX4_EVENT_TYPE_WQ_INVAL_REQ_ERROR = 0x10, | ||
78 | MLX4_EVENT_TYPE_WQ_ACCESS_ERROR = 0x11, | ||
79 | MLX4_EVENT_TYPE_SRQ_CATAS_ERROR = 0x12, | ||
80 | MLX4_EVENT_TYPE_LOCAL_CATAS_ERROR = 0x08, | ||
81 | MLX4_EVENT_TYPE_PORT_CHANGE = 0x09, | ||
82 | MLX4_EVENT_TYPE_EQ_OVERFLOW = 0x0f, | ||
83 | MLX4_EVENT_TYPE_ECC_DETECT = 0x0e, | ||
84 | MLX4_EVENT_TYPE_CMD = 0x0a | ||
85 | }; | ||
86 | |||
87 | enum { | ||
88 | MLX4_PORT_CHANGE_SUBTYPE_DOWN = 1, | ||
89 | MLX4_PORT_CHANGE_SUBTYPE_ACTIVE = 4 | ||
90 | }; | ||
91 | |||
92 | enum { | ||
93 | MLX4_PERM_LOCAL_READ = 1 << 10, | ||
94 | MLX4_PERM_LOCAL_WRITE = 1 << 11, | ||
95 | MLX4_PERM_REMOTE_READ = 1 << 12, | ||
96 | MLX4_PERM_REMOTE_WRITE = 1 << 13, | ||
97 | MLX4_PERM_ATOMIC = 1 << 14 | ||
98 | }; | ||
99 | |||
100 | enum { | ||
101 | MLX4_OPCODE_NOP = 0x00, | ||
102 | MLX4_OPCODE_SEND_INVAL = 0x01, | ||
103 | MLX4_OPCODE_RDMA_WRITE = 0x08, | ||
104 | MLX4_OPCODE_RDMA_WRITE_IMM = 0x09, | ||
105 | MLX4_OPCODE_SEND = 0x0a, | ||
106 | MLX4_OPCODE_SEND_IMM = 0x0b, | ||
107 | MLX4_OPCODE_LSO = 0x0e, | ||
108 | MLX4_OPCODE_RDMA_READ = 0x10, | ||
109 | MLX4_OPCODE_ATOMIC_CS = 0x11, | ||
110 | MLX4_OPCODE_ATOMIC_FA = 0x12, | ||
111 | MLX4_OPCODE_ATOMIC_MASK_CS = 0x14, | ||
112 | MLX4_OPCODE_ATOMIC_MASK_FA = 0x15, | ||
113 | MLX4_OPCODE_BIND_MW = 0x18, | ||
114 | MLX4_OPCODE_FMR = 0x19, | ||
115 | MLX4_OPCODE_LOCAL_INVAL = 0x1b, | ||
116 | MLX4_OPCODE_CONFIG_CMD = 0x1f, | ||
117 | |||
118 | MLX4_RECV_OPCODE_RDMA_WRITE_IMM = 0x00, | ||
119 | MLX4_RECV_OPCODE_SEND = 0x01, | ||
120 | MLX4_RECV_OPCODE_SEND_IMM = 0x02, | ||
121 | MLX4_RECV_OPCODE_SEND_INVAL = 0x03, | ||
122 | |||
123 | MLX4_CQE_OPCODE_ERROR = 0x1e, | ||
124 | MLX4_CQE_OPCODE_RESIZE = 0x16, | ||
125 | }; | ||
126 | |||
127 | enum { | ||
128 | MLX4_STAT_RATE_OFFSET = 5 | ||
129 | }; | ||
130 | |||
131 | struct mlx4_caps { | ||
132 | u64 fw_ver; | ||
133 | int num_ports; | ||
134 | int vl_cap; | ||
135 | int mtu_cap; | ||
136 | int gid_table_len; | ||
137 | int pkey_table_len; | ||
138 | int local_ca_ack_delay; | ||
139 | int num_uars; | ||
140 | int bf_reg_size; | ||
141 | int bf_regs_per_page; | ||
142 | int max_sq_sg; | ||
143 | int max_rq_sg; | ||
144 | int num_qps; | ||
145 | int max_wqes; | ||
146 | int max_sq_desc_sz; | ||
147 | int max_rq_desc_sz; | ||
148 | int max_qp_init_rdma; | ||
149 | int max_qp_dest_rdma; | ||
150 | int reserved_qps; | ||
151 | int sqp_start; | ||
152 | int num_srqs; | ||
153 | int max_srq_wqes; | ||
154 | int max_srq_sge; | ||
155 | int reserved_srqs; | ||
156 | int num_cqs; | ||
157 | int max_cqes; | ||
158 | int reserved_cqs; | ||
159 | int num_eqs; | ||
160 | int reserved_eqs; | ||
161 | int num_mpts; | ||
162 | int num_mtt_segs; | ||
163 | int fmr_reserved_mtts; | ||
164 | int reserved_mtts; | ||
165 | int reserved_mrws; | ||
166 | int reserved_uars; | ||
167 | int num_mgms; | ||
168 | int num_amgms; | ||
169 | int reserved_mcgs; | ||
170 | int num_qp_per_mgm; | ||
171 | int num_pds; | ||
172 | int reserved_pds; | ||
173 | int mtt_entry_sz; | ||
174 | u32 page_size_cap; | ||
175 | u32 flags; | ||
176 | u16 stat_rate_support; | ||
177 | u8 port_width_cap; | ||
178 | }; | ||
179 | |||
180 | struct mlx4_buf_list { | ||
181 | void *buf; | ||
182 | dma_addr_t map; | ||
183 | }; | ||
184 | |||
185 | struct mlx4_buf { | ||
186 | union { | ||
187 | struct mlx4_buf_list direct; | ||
188 | struct mlx4_buf_list *page_list; | ||
189 | } u; | ||
190 | int nbufs; | ||
191 | int npages; | ||
192 | int page_shift; | ||
193 | }; | ||
194 | |||
195 | struct mlx4_mtt { | ||
196 | u32 first_seg; | ||
197 | int order; | ||
198 | int page_shift; | ||
199 | }; | ||
200 | |||
201 | struct mlx4_mr { | ||
202 | struct mlx4_mtt mtt; | ||
203 | u64 iova; | ||
204 | u64 size; | ||
205 | u32 key; | ||
206 | u32 pd; | ||
207 | u32 access; | ||
208 | int enabled; | ||
209 | }; | ||
210 | |||
211 | struct mlx4_uar { | ||
212 | unsigned long pfn; | ||
213 | int index; | ||
214 | }; | ||
215 | |||
216 | struct mlx4_cq { | ||
217 | void (*comp) (struct mlx4_cq *); | ||
218 | void (*event) (struct mlx4_cq *, enum mlx4_event); | ||
219 | |||
220 | struct mlx4_uar *uar; | ||
221 | |||
222 | u32 cons_index; | ||
223 | |||
224 | __be32 *set_ci_db; | ||
225 | __be32 *arm_db; | ||
226 | int arm_sn; | ||
227 | |||
228 | int cqn; | ||
229 | |||
230 | atomic_t refcount; | ||
231 | struct completion free; | ||
232 | }; | ||
233 | |||
234 | struct mlx4_qp { | ||
235 | void (*event) (struct mlx4_qp *, enum mlx4_event); | ||
236 | |||
237 | int qpn; | ||
238 | |||
239 | atomic_t refcount; | ||
240 | struct completion free; | ||
241 | }; | ||
242 | |||
243 | struct mlx4_srq { | ||
244 | void (*event) (struct mlx4_srq *, enum mlx4_event); | ||
245 | |||
246 | int srqn; | ||
247 | int max; | ||
248 | int max_gs; | ||
249 | int wqe_shift; | ||
250 | |||
251 | atomic_t refcount; | ||
252 | struct completion free; | ||
253 | }; | ||
254 | |||
255 | struct mlx4_av { | ||
256 | __be32 port_pd; | ||
257 | u8 reserved1; | ||
258 | u8 g_slid; | ||
259 | __be16 dlid; | ||
260 | u8 reserved2; | ||
261 | u8 gid_index; | ||
262 | u8 stat_rate; | ||
263 | u8 hop_limit; | ||
264 | __be32 sl_tclass_flowlabel; | ||
265 | u8 dgid[16]; | ||
266 | }; | ||
267 | |||
268 | struct mlx4_dev { | ||
269 | struct pci_dev *pdev; | ||
270 | unsigned long flags; | ||
271 | struct mlx4_caps caps; | ||
272 | struct radix_tree_root qp_table_tree; | ||
273 | }; | ||
274 | |||
275 | struct mlx4_init_port_param { | ||
276 | int set_guid0; | ||
277 | int set_node_guid; | ||
278 | int set_si_guid; | ||
279 | u16 mtu; | ||
280 | int port_width_cap; | ||
281 | u16 vl_cap; | ||
282 | u16 max_gid; | ||
283 | u16 max_pkey; | ||
284 | u64 guid0; | ||
285 | u64 node_guid; | ||
286 | u64 si_guid; | ||
287 | }; | ||
288 | |||
289 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, | ||
290 | struct mlx4_buf *buf); | ||
291 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); | ||
292 | |||
293 | int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); | ||
294 | void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); | ||
295 | |||
296 | int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); | ||
297 | void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); | ||
298 | |||
299 | int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, | ||
300 | struct mlx4_mtt *mtt); | ||
301 | void mlx4_mtt_cleanup(struct mlx4_dev *dev, struct mlx4_mtt *mtt); | ||
302 | u64 mlx4_mtt_addr(struct mlx4_dev *dev, struct mlx4_mtt *mtt); | ||
303 | |||
304 | int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, | ||
305 | int npages, int page_shift, struct mlx4_mr *mr); | ||
306 | void mlx4_mr_free(struct mlx4_dev *dev, struct mlx4_mr *mr); | ||
307 | int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr); | ||
308 | int mlx4_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | ||
309 | int start_index, int npages, u64 *page_list); | ||
310 | int mlx4_buf_write_mtt(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | ||
311 | struct mlx4_buf *buf); | ||
312 | |||
313 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, | ||
314 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq); | ||
315 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); | ||
316 | |||
317 | int mlx4_qp_alloc(struct mlx4_dev *dev, int sqpn, struct mlx4_qp *qp); | ||
318 | void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); | ||
319 | |||
320 | int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, | ||
321 | u64 db_rec, struct mlx4_srq *srq); | ||
322 | void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); | ||
323 | int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); | ||
324 | |||
325 | int mlx4_INIT_PORT(struct mlx4_dev *dev, struct mlx4_init_port_param *param, int port); | ||
326 | int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); | ||
327 | |||
328 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | ||
329 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | ||
330 | |||
331 | #endif /* MLX4_DEVICE_H */ | ||
diff --git a/include/linux/mlx4/doorbell.h b/include/linux/mlx4/doorbell.h new file mode 100644 index 000000000000..3f2da442d7cb --- /dev/null +++ b/include/linux/mlx4/doorbell.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | ||
3 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | ||
4 | * Copyright (c) 2005 Mellanox Technologies. All rights reserved. | ||
5 | * | ||
6 | * This software is available to you under a choice of one of two | ||
7 | * licenses. You may choose to be licensed under the terms of the GNU | ||
8 | * General Public License (GPL) Version 2, available from the file | ||
9 | * COPYING in the main directory of this source tree, or the | ||
10 | * OpenIB.org BSD license below: | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or | ||
13 | * without modification, are permitted provided that the following | ||
14 | * conditions are met: | ||
15 | * | ||
16 | * - Redistributions of source code must retain the above | ||
17 | * copyright notice, this list of conditions and the following | ||
18 | * disclaimer. | ||
19 | * | ||
20 | * - Redistributions in binary form must reproduce the above | ||
21 | * copyright notice, this list of conditions and the following | ||
22 | * disclaimer in the documentation and/or other materials | ||
23 | * provided with the distribution. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
28 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
29 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
30 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
31 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
32 | * SOFTWARE. | ||
33 | */ | ||
34 | |||
35 | #ifndef MLX4_DOORBELL_H | ||
36 | #define MLX4_DOORBELL_H | ||
37 | |||
38 | #include <linux/types.h> | ||
39 | #include <linux/io.h> | ||
40 | |||
41 | #define MLX4_SEND_DOORBELL 0x14 | ||
42 | #define MLX4_CQ_DOORBELL 0x20 | ||
43 | |||
44 | #if BITS_PER_LONG == 64 | ||
45 | /* | ||
46 | * Assume that we can just write a 64-bit doorbell atomically. s390 | ||
47 | * actually doesn't have writeq() but S/390 systems don't even have | ||
48 | * PCI so we won't worry about it. | ||
49 | */ | ||
50 | |||
51 | #define MLX4_DECLARE_DOORBELL_LOCK(name) | ||
52 | #define MLX4_INIT_DOORBELL_LOCK(ptr) do { } while (0) | ||
53 | #define MLX4_GET_DOORBELL_LOCK(ptr) (NULL) | ||
54 | |||
55 | static inline void mlx4_write64_raw(__be64 val, void __iomem *dest) | ||
56 | { | ||
57 | __raw_writeq((__force u64) val, dest); | ||
58 | } | ||
59 | |||
60 | static inline void mlx4_write64(__be32 val[2], void __iomem *dest, | ||
61 | spinlock_t *doorbell_lock) | ||
62 | { | ||
63 | __raw_writeq(*(u64 *) val, dest); | ||
64 | } | ||
65 | |||
66 | #else | ||
67 | |||
68 | /* | ||
69 | * Just fall back to a spinlock to protect the doorbell if | ||
70 | * BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit | ||
71 | * MMIO writes. | ||
72 | */ | ||
73 | |||
74 | #define MLX4_DECLARE_DOORBELL_LOCK(name) spinlock_t name; | ||
75 | #define MLX4_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr) | ||
76 | #define MLX4_GET_DOORBELL_LOCK(ptr) (ptr) | ||
77 | |||
78 | static inline void mlx4_write64_raw(__be64 val, void __iomem *dest) | ||
79 | { | ||
80 | __raw_writel(((__force u32 *) &val)[0], dest); | ||
81 | __raw_writel(((__force u32 *) &val)[1], dest + 4); | ||
82 | } | ||
83 | |||
84 | static inline void mlx4_write64(__be32 val[2], void __iomem *dest, | ||
85 | spinlock_t *doorbell_lock) | ||
86 | { | ||
87 | unsigned long flags; | ||
88 | |||
89 | spin_lock_irqsave(doorbell_lock, flags); | ||
90 | __raw_writel((__force u32) val[0], dest); | ||
91 | __raw_writel((__force u32) val[1], dest + 4); | ||
92 | spin_unlock_irqrestore(doorbell_lock, flags); | ||
93 | } | ||
94 | |||
95 | #endif | ||
96 | |||
97 | #endif /* MLX4_DOORBELL_H */ | ||
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h new file mode 100644 index 000000000000..1b835ca49df1 --- /dev/null +++ b/include/linux/mlx4/driver.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_DRIVER_H | ||
34 | #define MLX4_DRIVER_H | ||
35 | |||
36 | #include <linux/device.h> | ||
37 | |||
38 | struct mlx4_dev; | ||
39 | |||
40 | enum mlx4_dev_event { | ||
41 | MLX4_DEV_EVENT_CATASTROPHIC_ERROR, | ||
42 | MLX4_DEV_EVENT_PORT_UP, | ||
43 | MLX4_DEV_EVENT_PORT_DOWN, | ||
44 | MLX4_DEV_EVENT_PORT_REINIT, | ||
45 | }; | ||
46 | |||
47 | struct mlx4_interface { | ||
48 | void * (*add) (struct mlx4_dev *dev); | ||
49 | void (*remove)(struct mlx4_dev *dev, void *context); | ||
50 | void (*event) (struct mlx4_dev *dev, void *context, | ||
51 | enum mlx4_dev_event event, int subtype, | ||
52 | int port); | ||
53 | struct list_head list; | ||
54 | }; | ||
55 | |||
56 | int mlx4_register_interface(struct mlx4_interface *intf); | ||
57 | void mlx4_unregister_interface(struct mlx4_interface *intf); | ||
58 | |||
59 | #endif /* MLX4_DRIVER_H */ | ||
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h new file mode 100644 index 000000000000..9eeb61adf6a3 --- /dev/null +++ b/include/linux/mlx4/qp.h | |||
@@ -0,0 +1,288 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_QP_H | ||
34 | #define MLX4_QP_H | ||
35 | |||
36 | #include <linux/types.h> | ||
37 | |||
38 | #include <linux/mlx4/device.h> | ||
39 | |||
40 | #define MLX4_INVALID_LKEY 0x100 | ||
41 | |||
42 | enum mlx4_qp_optpar { | ||
43 | MLX4_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, | ||
44 | MLX4_QP_OPTPAR_RRE = 1 << 1, | ||
45 | MLX4_QP_OPTPAR_RAE = 1 << 2, | ||
46 | MLX4_QP_OPTPAR_RWE = 1 << 3, | ||
47 | MLX4_QP_OPTPAR_PKEY_INDEX = 1 << 4, | ||
48 | MLX4_QP_OPTPAR_Q_KEY = 1 << 5, | ||
49 | MLX4_QP_OPTPAR_RNR_TIMEOUT = 1 << 6, | ||
50 | MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH = 1 << 7, | ||
51 | MLX4_QP_OPTPAR_SRA_MAX = 1 << 8, | ||
52 | MLX4_QP_OPTPAR_RRA_MAX = 1 << 9, | ||
53 | MLX4_QP_OPTPAR_PM_STATE = 1 << 10, | ||
54 | MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, | ||
55 | MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, | ||
56 | MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, | ||
57 | MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16 | ||
58 | }; | ||
59 | |||
60 | enum mlx4_qp_state { | ||
61 | MLX4_QP_STATE_RST = 0, | ||
62 | MLX4_QP_STATE_INIT = 1, | ||
63 | MLX4_QP_STATE_RTR = 2, | ||
64 | MLX4_QP_STATE_RTS = 3, | ||
65 | MLX4_QP_STATE_SQER = 4, | ||
66 | MLX4_QP_STATE_SQD = 5, | ||
67 | MLX4_QP_STATE_ERR = 6, | ||
68 | MLX4_QP_STATE_SQ_DRAINING = 7, | ||
69 | MLX4_QP_NUM_STATE | ||
70 | }; | ||
71 | |||
72 | enum { | ||
73 | MLX4_QP_ST_RC = 0x0, | ||
74 | MLX4_QP_ST_UC = 0x1, | ||
75 | MLX4_QP_ST_RD = 0x2, | ||
76 | MLX4_QP_ST_UD = 0x3, | ||
77 | MLX4_QP_ST_MLX = 0x7 | ||
78 | }; | ||
79 | |||
80 | enum { | ||
81 | MLX4_QP_PM_MIGRATED = 0x3, | ||
82 | MLX4_QP_PM_ARMED = 0x0, | ||
83 | MLX4_QP_PM_REARM = 0x1 | ||
84 | }; | ||
85 | |||
86 | enum { | ||
87 | /* params1 */ | ||
88 | MLX4_QP_BIT_SRE = 1 << 15, | ||
89 | MLX4_QP_BIT_SWE = 1 << 14, | ||
90 | MLX4_QP_BIT_SAE = 1 << 13, | ||
91 | /* params2 */ | ||
92 | MLX4_QP_BIT_RRE = 1 << 15, | ||
93 | MLX4_QP_BIT_RWE = 1 << 14, | ||
94 | MLX4_QP_BIT_RAE = 1 << 13, | ||
95 | MLX4_QP_BIT_RIC = 1 << 4, | ||
96 | }; | ||
97 | |||
98 | struct mlx4_qp_path { | ||
99 | u8 fl; | ||
100 | u8 reserved1[2]; | ||
101 | u8 pkey_index; | ||
102 | u8 reserved2; | ||
103 | u8 grh_mylmc; | ||
104 | __be16 rlid; | ||
105 | u8 ackto; | ||
106 | u8 mgid_index; | ||
107 | u8 static_rate; | ||
108 | u8 hop_limit; | ||
109 | __be32 tclass_flowlabel; | ||
110 | u8 rgid[16]; | ||
111 | u8 sched_queue; | ||
112 | u8 snooper_flags; | ||
113 | u8 reserved3[2]; | ||
114 | u8 counter_index; | ||
115 | u8 reserved4[7]; | ||
116 | }; | ||
117 | |||
118 | struct mlx4_qp_context { | ||
119 | __be32 flags; | ||
120 | __be32 pd; | ||
121 | u8 mtu_msgmax; | ||
122 | u8 rq_size_stride; | ||
123 | u8 sq_size_stride; | ||
124 | u8 rlkey; | ||
125 | __be32 usr_page; | ||
126 | __be32 local_qpn; | ||
127 | __be32 remote_qpn; | ||
128 | struct mlx4_qp_path pri_path; | ||
129 | struct mlx4_qp_path alt_path; | ||
130 | __be32 params1; | ||
131 | u32 reserved1; | ||
132 | __be32 next_send_psn; | ||
133 | __be32 cqn_send; | ||
134 | u32 reserved2[2]; | ||
135 | __be32 last_acked_psn; | ||
136 | __be32 ssn; | ||
137 | __be32 params2; | ||
138 | __be32 rnr_nextrecvpsn; | ||
139 | __be32 srcd; | ||
140 | __be32 cqn_recv; | ||
141 | __be64 db_rec_addr; | ||
142 | __be32 qkey; | ||
143 | __be32 srqn; | ||
144 | __be32 msn; | ||
145 | __be16 rq_wqe_counter; | ||
146 | __be16 sq_wqe_counter; | ||
147 | u32 reserved3[2]; | ||
148 | __be32 param3; | ||
149 | __be32 nummmcpeers_basemkey; | ||
150 | u8 log_page_size; | ||
151 | u8 reserved4[2]; | ||
152 | u8 mtt_base_addr_h; | ||
153 | __be32 mtt_base_addr_l; | ||
154 | u32 reserved5[10]; | ||
155 | }; | ||
156 | |||
157 | enum { | ||
158 | MLX4_WQE_CTRL_FENCE = 1 << 6, | ||
159 | MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, | ||
160 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, | ||
161 | }; | ||
162 | |||
163 | struct mlx4_wqe_ctrl_seg { | ||
164 | __be32 owner_opcode; | ||
165 | u8 reserved2[3]; | ||
166 | u8 fence_size; | ||
167 | /* | ||
168 | * High 24 bits are SRC remote buffer; low 8 bits are flags: | ||
169 | * [7] SO (strong ordering) | ||
170 | * [5] TCP/UDP checksum | ||
171 | * [4] IP checksum | ||
172 | * [3:2] C (generate completion queue entry) | ||
173 | * [1] SE (solicited event) | ||
174 | */ | ||
175 | __be32 srcrb_flags; | ||
176 | /* | ||
177 | * imm is immediate data for send/RDMA write w/ immediate; | ||
178 | * also invalidation key for send with invalidate; input | ||
179 | * modifier for WQEs on CCQs. | ||
180 | */ | ||
181 | __be32 imm; | ||
182 | }; | ||
183 | |||
184 | enum { | ||
185 | MLX4_WQE_MLX_VL15 = 1 << 17, | ||
186 | MLX4_WQE_MLX_SLR = 1 << 16 | ||
187 | }; | ||
188 | |||
189 | struct mlx4_wqe_mlx_seg { | ||
190 | u8 owner; | ||
191 | u8 reserved1[2]; | ||
192 | u8 opcode; | ||
193 | u8 reserved2[3]; | ||
194 | u8 size; | ||
195 | /* | ||
196 | * [17] VL15 | ||
197 | * [16] SLR | ||
198 | * [15:12] static rate | ||
199 | * [11:8] SL | ||
200 | * [4] ICRC | ||
201 | * [3:2] C | ||
202 | * [0] FL (force loopback) | ||
203 | */ | ||
204 | __be32 flags; | ||
205 | __be16 rlid; | ||
206 | u16 reserved3; | ||
207 | }; | ||
208 | |||
209 | struct mlx4_wqe_datagram_seg { | ||
210 | __be32 av[8]; | ||
211 | __be32 dqpn; | ||
212 | __be32 qkey; | ||
213 | __be32 reservd[2]; | ||
214 | }; | ||
215 | |||
216 | struct mlx4_wqe_bind_seg { | ||
217 | __be32 flags1; | ||
218 | __be32 flags2; | ||
219 | __be32 new_rkey; | ||
220 | __be32 lkey; | ||
221 | __be64 addr; | ||
222 | __be64 length; | ||
223 | }; | ||
224 | |||
225 | struct mlx4_wqe_fmr_seg { | ||
226 | __be32 flags; | ||
227 | __be32 mem_key; | ||
228 | __be64 buf_list; | ||
229 | __be64 start_addr; | ||
230 | __be64 reg_len; | ||
231 | __be32 offset; | ||
232 | __be32 page_size; | ||
233 | u32 reserved[2]; | ||
234 | }; | ||
235 | |||
236 | struct mlx4_wqe_fmr_ext_seg { | ||
237 | u8 flags; | ||
238 | u8 reserved; | ||
239 | __be16 app_mask; | ||
240 | __be16 wire_app_tag; | ||
241 | __be16 mem_app_tag; | ||
242 | __be32 wire_ref_tag_base; | ||
243 | __be32 mem_ref_tag_base; | ||
244 | }; | ||
245 | |||
246 | struct mlx4_wqe_local_inval_seg { | ||
247 | u8 flags; | ||
248 | u8 reserved1[3]; | ||
249 | __be32 mem_key; | ||
250 | u8 reserved2[3]; | ||
251 | u8 guest_id; | ||
252 | __be64 pa; | ||
253 | }; | ||
254 | |||
255 | struct mlx4_wqe_raddr_seg { | ||
256 | __be64 raddr; | ||
257 | __be32 rkey; | ||
258 | u32 reserved; | ||
259 | }; | ||
260 | |||
261 | struct mlx4_wqe_atomic_seg { | ||
262 | __be64 swap_add; | ||
263 | __be64 compare; | ||
264 | }; | ||
265 | |||
266 | struct mlx4_wqe_data_seg { | ||
267 | __be32 byte_count; | ||
268 | __be32 lkey; | ||
269 | __be64 addr; | ||
270 | }; | ||
271 | |||
272 | struct mlx4_wqe_inline_seg { | ||
273 | __be32 byte_count; | ||
274 | }; | ||
275 | |||
276 | int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt, | ||
277 | enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state, | ||
278 | struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, | ||
279 | int sqd_event, struct mlx4_qp *qp); | ||
280 | |||
281 | static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) | ||
282 | { | ||
283 | return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1)); | ||
284 | } | ||
285 | |||
286 | void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp); | ||
287 | |||
288 | #endif /* MLX4_QP_H */ | ||
diff --git a/include/linux/mlx4/srq.h b/include/linux/mlx4/srq.h new file mode 100644 index 000000000000..799a0697a383 --- /dev/null +++ b/include/linux/mlx4/srq.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. | ||
3 | * | ||
4 | * This software is available to you under a choice of one of two | ||
5 | * licenses. You may choose to be licensed under the terms of the GNU | ||
6 | * General Public License (GPL) Version 2, available from the file | ||
7 | * COPYING in the main directory of this source tree, or the | ||
8 | * OpenIB.org BSD license below: | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or | ||
11 | * without modification, are permitted provided that the following | ||
12 | * conditions are met: | ||
13 | * | ||
14 | * - Redistributions of source code must retain the above | ||
15 | * copyright notice, this list of conditions and the following | ||
16 | * disclaimer. | ||
17 | * | ||
18 | * - Redistributions in binary form must reproduce the above | ||
19 | * copyright notice, this list of conditions and the following | ||
20 | * disclaimer in the documentation and/or other materials | ||
21 | * provided with the distribution. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
30 | * SOFTWARE. | ||
31 | */ | ||
32 | |||
33 | #ifndef MLX4_SRQ_H | ||
34 | #define MLX4_SRQ_H | ||
35 | |||
36 | struct mlx4_wqe_srq_next_seg { | ||
37 | u16 reserved1; | ||
38 | __be16 next_wqe_index; | ||
39 | u32 reserved2[3]; | ||
40 | }; | ||
41 | |||
42 | #endif /* MLX4_SRQ_H */ | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2f1544e83042..d09b1345a3a1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -83,6 +83,9 @@ struct per_cpu_pages { | |||
83 | 83 | ||
84 | struct per_cpu_pageset { | 84 | struct per_cpu_pageset { |
85 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ | 85 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ |
86 | #ifdef CONFIG_NUMA | ||
87 | s8 expire; | ||
88 | #endif | ||
86 | #ifdef CONFIG_SMP | 89 | #ifdef CONFIG_SMP |
87 | s8 stat_threshold; | 90 | s8 stat_threshold; |
88 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; | 91 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; |
diff --git a/include/linux/module.h b/include/linux/module.h index 6d3dc9c4ff96..792d483c9af7 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -356,6 +356,9 @@ struct module | |||
356 | keeping pointers to this stuff */ | 356 | keeping pointers to this stuff */ |
357 | char *args; | 357 | char *args; |
358 | }; | 358 | }; |
359 | #ifndef MODULE_ARCH_INIT | ||
360 | #define MODULE_ARCH_INIT {} | ||
361 | #endif | ||
359 | 362 | ||
360 | /* FIXME: It'd be nice to isolate modules during init, too, so they | 363 | /* FIXME: It'd be nice to isolate modules during init, too, so they |
361 | aren't used before they (may) fail. But presently too much code | 364 | aren't used before they (may) fail. But presently too much code |
diff --git a/include/linux/mount.h b/include/linux/mount.h index dab69afee2fa..6d3047d8c91c 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -33,7 +33,7 @@ struct mnt_namespace; | |||
33 | 33 | ||
34 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ | 34 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ |
35 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ | 35 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ |
36 | #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ | 36 | #define MNT_PNODE_MASK 0x3000 /* propagation flag mask */ |
37 | 37 | ||
38 | struct vfsmount { | 38 | struct vfsmount { |
39 | struct list_head mnt_hash; | 39 | struct list_head mnt_hash; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 45d482ce8397..fd64ccfbce02 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -9,10 +9,6 @@ | |||
9 | #ifndef __MTD_MTD_H__ | 9 | #ifndef __MTD_MTD_H__ |
10 | #define __MTD_MTD_H__ | 10 | #define __MTD_MTD_H__ |
11 | 11 | ||
12 | #ifndef __KERNEL__ | ||
13 | #error This is a kernel header. Perhaps include mtd-user.h instead? | ||
14 | #endif | ||
15 | |||
16 | #include <linux/types.h> | 12 | #include <linux/types.h> |
17 | #include <linux/module.h> | 13 | #include <linux/module.h> |
18 | #include <linux/uio.h> | 14 | #include <linux/uio.h> |
@@ -137,9 +133,6 @@ struct mtd_info { | |||
137 | int numeraseregions; | 133 | int numeraseregions; |
138 | struct mtd_erase_region_info *eraseregions; | 134 | struct mtd_erase_region_info *eraseregions; |
139 | 135 | ||
140 | /* This really shouldn't be here. It can go away in 2.5 */ | ||
141 | u_int32_t bank_size; | ||
142 | |||
143 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); | 136 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); |
144 | 137 | ||
145 | /* This stuff for eXecute-In-Place */ | 138 | /* This stuff for eXecute-In-Place */ |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index cf197ad62da6..d2365c8dcacc 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -560,6 +560,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
560 | * @chip_delay: R/B delay value in us | 560 | * @chip_delay: R/B delay value in us |
561 | * @options: Option flags, e.g. 16bit buswidth | 561 | * @options: Option flags, e.g. 16bit buswidth |
562 | * @ecclayout: ecc layout info structure | 562 | * @ecclayout: ecc layout info structure |
563 | * @part_probe_types: NULL-terminated array of probe types | ||
563 | * @priv: hardware controller specific settings | 564 | * @priv: hardware controller specific settings |
564 | */ | 565 | */ |
565 | struct platform_nand_chip { | 566 | struct platform_nand_chip { |
@@ -570,6 +571,7 @@ struct platform_nand_chip { | |||
570 | struct nand_ecclayout *ecclayout; | 571 | struct nand_ecclayout *ecclayout; |
571 | int chip_delay; | 572 | int chip_delay; |
572 | unsigned int options; | 573 | unsigned int options; |
574 | const char **part_probe_types; | ||
573 | void *priv; | 575 | void *priv; |
574 | }; | 576 | }; |
575 | 577 | ||
@@ -578,6 +580,8 @@ struct platform_nand_chip { | |||
578 | * @hwcontrol: platform specific hardware control structure | 580 | * @hwcontrol: platform specific hardware control structure |
579 | * @dev_ready: platform specific function to read ready/busy pin | 581 | * @dev_ready: platform specific function to read ready/busy pin |
580 | * @select_chip: platform specific chip select function | 582 | * @select_chip: platform specific chip select function |
583 | * @cmd_ctrl: platform specific function for controlling | ||
584 | * ALE/CLE/nCE. Also used to write command and address | ||
581 | * @priv: private data to transport driver specific settings | 585 | * @priv: private data to transport driver specific settings |
582 | * | 586 | * |
583 | * All fields are optional and depend on the hardware driver requirements | 587 | * All fields are optional and depend on the hardware driver requirements |
@@ -586,9 +590,21 @@ struct platform_nand_ctrl { | |||
586 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 590 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
587 | int (*dev_ready)(struct mtd_info *mtd); | 591 | int (*dev_ready)(struct mtd_info *mtd); |
588 | void (*select_chip)(struct mtd_info *mtd, int chip); | 592 | void (*select_chip)(struct mtd_info *mtd, int chip); |
593 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | ||
594 | unsigned int ctrl); | ||
589 | void *priv; | 595 | void *priv; |
590 | }; | 596 | }; |
591 | 597 | ||
598 | /** | ||
599 | * struct platform_nand_data - container structure for platform-specific data | ||
600 | * @chip: chip level chip structure | ||
601 | * @ctrl: controller level device structure | ||
602 | */ | ||
603 | struct platform_nand_data { | ||
604 | struct platform_nand_chip chip; | ||
605 | struct platform_nand_ctrl ctrl; | ||
606 | }; | ||
607 | |||
592 | /* Some helpers to access the data structures */ | 608 | /* Some helpers to access the data structures */ |
593 | static inline | 609 | static inline |
594 | struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd) | 610 | struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd) |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index b81bc2adaeff..0d50ea3df689 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -121,11 +121,12 @@ static inline int fastcall mutex_is_locked(struct mutex *lock) | |||
121 | * Also see Documentation/mutex-design.txt. | 121 | * Also see Documentation/mutex-design.txt. |
122 | */ | 122 | */ |
123 | extern void fastcall mutex_lock(struct mutex *lock); | 123 | extern void fastcall mutex_lock(struct mutex *lock); |
124 | extern int fastcall mutex_lock_interruptible(struct mutex *lock); | 124 | extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock); |
125 | 125 | ||
126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 127 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
128 | extern int mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass); | 128 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
129 | unsigned int subclass); | ||
129 | #else | 130 | #else |
130 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 131 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
131 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 132 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
diff --git a/include/linux/nfs4_acl.h b/include/linux/nfs4_acl.h index 409b6e02f337..c9c05a78e9bb 100644 --- a/include/linux/nfs4_acl.h +++ b/include/linux/nfs4_acl.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #define NFS4_ACL_MAX 170 | 44 | #define NFS4_ACL_MAX 170 |
45 | 45 | ||
46 | struct nfs4_acl *nfs4_acl_new(int); | 46 | struct nfs4_acl *nfs4_acl_new(int); |
47 | void nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t); | ||
48 | int nfs4_acl_get_whotype(char *, u32); | 47 | int nfs4_acl_get_whotype(char *, u32); |
49 | int nfs4_acl_write_who(int who, char *p); | 48 | int nfs4_acl_write_who(int who, char *p); |
50 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, | 49 | int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group, |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 10a43ed0527e..9431101bf876 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -112,32 +112,40 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); | |||
112 | 112 | ||
113 | #ifdef __KERNEL__ | 113 | #ifdef __KERNEL__ |
114 | 114 | ||
115 | extern int atomic_notifier_chain_register(struct atomic_notifier_head *, | 115 | extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh, |
116 | struct notifier_block *); | 116 | struct notifier_block *nb); |
117 | extern int blocking_notifier_chain_register(struct blocking_notifier_head *, | 117 | extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh, |
118 | struct notifier_block *); | 118 | struct notifier_block *nb); |
119 | extern int raw_notifier_chain_register(struct raw_notifier_head *, | 119 | extern int raw_notifier_chain_register(struct raw_notifier_head *nh, |
120 | struct notifier_block *); | 120 | struct notifier_block *nb); |
121 | extern int srcu_notifier_chain_register(struct srcu_notifier_head *, | 121 | extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh, |
122 | struct notifier_block *); | 122 | struct notifier_block *nb); |
123 | 123 | ||
124 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, | 124 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, |
125 | struct notifier_block *); | 125 | struct notifier_block *nb); |
126 | extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *, | 126 | extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh, |
127 | struct notifier_block *); | 127 | struct notifier_block *nb); |
128 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *, | 128 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh, |
129 | struct notifier_block *); | 129 | struct notifier_block *nb); |
130 | extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *, | 130 | extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh, |
131 | struct notifier_block *); | 131 | struct notifier_block *nb); |
132 | 132 | ||
133 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *, | 133 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh, |
134 | unsigned long val, void *v); | 134 | unsigned long val, void *v); |
135 | extern int blocking_notifier_call_chain(struct blocking_notifier_head *, | 135 | extern int __atomic_notifier_call_chain(struct atomic_notifier_head *nh, |
136 | unsigned long val, void *v, int nr_to_call, int *nr_calls); | ||
137 | extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh, | ||
136 | unsigned long val, void *v); | 138 | unsigned long val, void *v); |
137 | extern int raw_notifier_call_chain(struct raw_notifier_head *, | 139 | extern int __blocking_notifier_call_chain(struct blocking_notifier_head *nh, |
140 | unsigned long val, void *v, int nr_to_call, int *nr_calls); | ||
141 | extern int raw_notifier_call_chain(struct raw_notifier_head *nh, | ||
138 | unsigned long val, void *v); | 142 | unsigned long val, void *v); |
139 | extern int srcu_notifier_call_chain(struct srcu_notifier_head *, | 143 | extern int __raw_notifier_call_chain(struct raw_notifier_head *nh, |
144 | unsigned long val, void *v, int nr_to_call, int *nr_calls); | ||
145 | extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh, | ||
140 | unsigned long val, void *v); | 146 | unsigned long val, void *v); |
147 | extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh, | ||
148 | unsigned long val, void *v, int nr_to_call, int *nr_calls); | ||
141 | 149 | ||
142 | #define NOTIFY_DONE 0x0000 /* Don't care */ | 150 | #define NOTIFY_DONE 0x0000 /* Don't care */ |
143 | #define NOTIFY_OK 0x0001 /* Suits me */ | 151 | #define NOTIFY_OK 0x0001 /* Suits me */ |
@@ -186,6 +194,20 @@ extern int srcu_notifier_call_chain(struct srcu_notifier_head *, | |||
186 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ | 194 | #define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */ |
187 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | 195 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ |
188 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | 196 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ |
197 | #define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */ | ||
198 | #define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */ | ||
199 | |||
200 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend | ||
201 | * operation in progress | ||
202 | */ | ||
203 | #define CPU_TASKS_FROZEN 0x0010 | ||
204 | |||
205 | #define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) | ||
206 | #define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN) | ||
207 | #define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN) | ||
208 | #define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) | ||
209 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | ||
210 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | ||
189 | 211 | ||
190 | #endif /* __KERNEL__ */ | 212 | #endif /* __KERNEL__ */ |
191 | #endif /* _LINUX_NOTIFIER_H */ | 213 | #endif /* _LINUX_NOTIFIER_H */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6e8fa3049e5d..87545e0f0b58 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -107,26 +107,11 @@ typedef int __bitwise suspend_state_t; | |||
107 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) | 107 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) |
108 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) | 108 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) |
109 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) | 109 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) |
110 | #define PM_SUSPEND_DISK ((__force suspend_state_t) 4) | 110 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
111 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 5) | ||
112 | |||
113 | typedef int __bitwise suspend_disk_method_t; | ||
114 | |||
115 | /* invalid must be 0 so struct pm_ops initialisers can leave it out */ | ||
116 | #define PM_DISK_INVALID ((__force suspend_disk_method_t) 0) | ||
117 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 1) | ||
118 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 2) | ||
119 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 3) | ||
120 | #define PM_DISK_TEST ((__force suspend_disk_method_t) 4) | ||
121 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 5) | ||
122 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 6) | ||
123 | 111 | ||
124 | /** | 112 | /** |
125 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | 113 | * struct pm_ops - Callbacks for managing platform dependent suspend states. |
126 | * @valid: Callback to determine whether the given state can be entered. | 114 | * @valid: Callback to determine whether the given state can be entered. |
127 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is | ||
128 | * always valid and never passed to this call. If not assigned, | ||
129 | * no suspend states are valid. | ||
130 | * Valid states are advertised in /sys/power/state but can still | 115 | * Valid states are advertised in /sys/power/state but can still |
131 | * be rejected by prepare or enter if the conditions aren't right. | 116 | * be rejected by prepare or enter if the conditions aren't right. |
132 | * There is a %pm_valid_only_mem function available that can be assigned | 117 | * There is a %pm_valid_only_mem function available that can be assigned |
@@ -140,24 +125,12 @@ typedef int __bitwise suspend_disk_method_t; | |||
140 | * | 125 | * |
141 | * @finish: Called when the system has left the given state and all devices | 126 | * @finish: Called when the system has left the given state and all devices |
142 | * are resumed. The return value is ignored. | 127 | * are resumed. The return value is ignored. |
143 | * | ||
144 | * @pm_disk_mode: The generic code always allows one of the shutdown methods | ||
145 | * %PM_DISK_SHUTDOWN, %PM_DISK_REBOOT, %PM_DISK_TEST and | ||
146 | * %PM_DISK_TESTPROC. If this variable is set, the mode it is set | ||
147 | * to is allowed in addition to those modes and is also made default. | ||
148 | * When this mode is sent selected, the @prepare call will be called | ||
149 | * before suspending to disk (if present), the @enter call should be | ||
150 | * present and will be called after all state has been saved and the | ||
151 | * machine is ready to be powered off; the @finish callback is called | ||
152 | * after state has been restored. All these calls are called with | ||
153 | * %PM_SUSPEND_DISK as the state. | ||
154 | */ | 128 | */ |
155 | struct pm_ops { | 129 | struct pm_ops { |
156 | int (*valid)(suspend_state_t state); | 130 | int (*valid)(suspend_state_t state); |
157 | int (*prepare)(suspend_state_t state); | 131 | int (*prepare)(suspend_state_t state); |
158 | int (*enter)(suspend_state_t state); | 132 | int (*enter)(suspend_state_t state); |
159 | int (*finish)(suspend_state_t state); | 133 | int (*finish)(suspend_state_t state); |
160 | suspend_disk_method_t pm_disk_mode; | ||
161 | }; | 134 | }; |
162 | 135 | ||
163 | /** | 136 | /** |
@@ -276,8 +249,6 @@ extern void device_power_up(void); | |||
276 | extern void device_resume(void); | 249 | extern void device_resume(void); |
277 | 250 | ||
278 | #ifdef CONFIG_PM | 251 | #ifdef CONFIG_PM |
279 | extern suspend_disk_method_t pm_disk_mode; | ||
280 | |||
281 | extern int device_suspend(pm_message_t state); | 252 | extern int device_suspend(pm_message_t state); |
282 | extern int device_prepare_suspend(pm_message_t state); | 253 | extern int device_prepare_suspend(pm_message_t state); |
283 | 254 | ||
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 0deb842541ac..f9e77d2ee320 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -87,10 +87,10 @@ do { \ | |||
87 | * management of their lifetimes must be completely managed by API users. | 87 | * management of their lifetimes must be completely managed by API users. |
88 | * | 88 | * |
89 | * For API usage, in general, | 89 | * For API usage, in general, |
90 | * - any function _modifying_ the the tree or tags (inserting or deleting | 90 | * - any function _modifying_ the tree or tags (inserting or deleting |
91 | * items, setting or clearing tags must exclude other modifications, and | 91 | * items, setting or clearing tags must exclude other modifications, and |
92 | * exclude any functions reading the tree. | 92 | * exclude any functions reading the tree. |
93 | * - any function _reading_ the the tree or tags (looking up items or tags, | 93 | * - any function _reading_ the tree or tags (looking up items or tags, |
94 | * gang lookups) must exclude modifications to the tree, but may occur | 94 | * gang lookups) must exclude modifications to the tree, but may occur |
95 | * concurrently with other readers. | 95 | * concurrently with other readers. |
96 | * | 96 | * |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 759a0f97bec2..6cd8c4425fc7 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/timer.h> | ||
15 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
16 | #include <linux/list.h> | 17 | #include <linux/list.h> |
17 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
@@ -38,7 +39,7 @@ struct rchan_buf | |||
38 | size_t subbufs_consumed; /* count of sub-buffers consumed */ | 39 | size_t subbufs_consumed; /* count of sub-buffers consumed */ |
39 | struct rchan *chan; /* associated channel */ | 40 | struct rchan *chan; /* associated channel */ |
40 | wait_queue_head_t read_wait; /* reader wait queue */ | 41 | wait_queue_head_t read_wait; /* reader wait queue */ |
41 | struct delayed_work wake_readers; /* reader wake-up work struct */ | 42 | struct timer_list timer; /* reader wake-up timer */ |
42 | struct dentry *dentry; /* channel file dentry */ | 43 | struct dentry *dentry; /* channel file dentry */ |
43 | struct kref kref; /* channel buffer refcount */ | 44 | struct kref kref; /* channel buffer refcount */ |
44 | struct page **page_array; /* array of current buffer pages */ | 45 | struct page **page_array; /* array of current buffer pages */ |
diff --git a/include/linux/rslib.h b/include/linux/rslib.h index ace25acfdc97..746580c1939c 100644 --- a/include/linux/rslib.h +++ b/include/linux/rslib.h | |||
@@ -34,6 +34,7 @@ | |||
34 | * @prim: Primitive element, index form | 34 | * @prim: Primitive element, index form |
35 | * @iprim: prim-th root of 1, index form | 35 | * @iprim: prim-th root of 1, index form |
36 | * @gfpoly: The primitive generator polynominal | 36 | * @gfpoly: The primitive generator polynominal |
37 | * @gffunc: Function to generate the field, if non-canonical representation | ||
37 | * @users: Users of this structure | 38 | * @users: Users of this structure |
38 | * @list: List entry for the rs control list | 39 | * @list: List entry for the rs control list |
39 | */ | 40 | */ |
@@ -48,6 +49,7 @@ struct rs_control { | |||
48 | int prim; | 49 | int prim; |
49 | int iprim; | 50 | int iprim; |
50 | int gfpoly; | 51 | int gfpoly; |
52 | int (*gffunc)(int); | ||
51 | int users; | 53 | int users; |
52 | struct list_head list; | 54 | struct list_head list; |
53 | }; | 55 | }; |
@@ -77,6 +79,8 @@ int decode_rs16(struct rs_control *rs, uint16_t *data, uint16_t *par, int len, | |||
77 | /* Create or get a matching rs control structure */ | 79 | /* Create or get a matching rs control structure */ |
78 | struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, | 80 | struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, |
79 | int nroots); | 81 | int nroots); |
82 | struct rs_control *init_rs_non_canonical(int symsize, int (*func)(int), | ||
83 | int fcr, int prim, int nroots); | ||
80 | 84 | ||
81 | /* Release a rs control structure */ | 85 | /* Release a rs control structure */ |
82 | void free_rs(struct rs_control *rs); | 86 | void free_rs(struct rs_control *rs); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3d95c480f58d..17b72d88c4cb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -817,7 +817,7 @@ struct prio_array; | |||
817 | 817 | ||
818 | struct task_struct { | 818 | struct task_struct { |
819 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 819 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
820 | struct thread_info *thread_info; | 820 | void *stack; |
821 | atomic_t usage; | 821 | atomic_t usage; |
822 | unsigned int flags; /* per process flags, defined below */ | 822 | unsigned int flags; /* per process flags, defined below */ |
823 | unsigned int ptrace; | 823 | unsigned int ptrace; |
@@ -1317,6 +1317,7 @@ extern int in_egroup_p(gid_t); | |||
1317 | 1317 | ||
1318 | extern void proc_caches_init(void); | 1318 | extern void proc_caches_init(void); |
1319 | extern void flush_signals(struct task_struct *); | 1319 | extern void flush_signals(struct task_struct *); |
1320 | extern void ignore_signals(struct task_struct *); | ||
1320 | extern void flush_signal_handlers(struct task_struct *, int force_default); | 1321 | extern void flush_signal_handlers(struct task_struct *, int force_default); |
1321 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); | 1322 | extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info); |
1322 | 1323 | ||
@@ -1512,8 +1513,8 @@ static inline void unlock_task_sighand(struct task_struct *tsk, | |||
1512 | 1513 | ||
1513 | #ifndef __HAVE_THREAD_FUNCTIONS | 1514 | #ifndef __HAVE_THREAD_FUNCTIONS |
1514 | 1515 | ||
1515 | #define task_thread_info(task) (task)->thread_info | 1516 | #define task_thread_info(task) ((struct thread_info *)(task)->stack) |
1516 | #define task_stack_page(task) ((void*)((task)->thread_info)) | 1517 | #define task_stack_page(task) ((task)->stack) |
1517 | 1518 | ||
1518 | static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) | 1519 | static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) |
1519 | { | 1520 | { |
@@ -1523,7 +1524,7 @@ static inline void setup_thread_stack(struct task_struct *p, struct task_struct | |||
1523 | 1524 | ||
1524 | static inline unsigned long *end_of_stack(struct task_struct *p) | 1525 | static inline unsigned long *end_of_stack(struct task_struct *p) |
1525 | { | 1526 | { |
1526 | return (unsigned long *)(p->thread_info + 1); | 1527 | return (unsigned long *)(task_thread_info(p) + 1); |
1527 | } | 1528 | } |
1528 | 1529 | ||
1529 | #endif | 1530 | #endif |
diff --git a/include/linux/security.h b/include/linux/security.h index 47e82c120f9a..9eb9e0fe0331 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -322,7 +322,7 @@ struct request_sock; | |||
322 | * @dir contains the inode structure of parent of the new file. | 322 | * @dir contains the inode structure of parent of the new file. |
323 | * @dentry contains the dentry structure of the new file. | 323 | * @dentry contains the dentry structure of the new file. |
324 | * @mode contains the mode of the new file. | 324 | * @mode contains the mode of the new file. |
325 | * @dev contains the the device number. | 325 | * @dev contains the device number. |
326 | * Return 0 if permission is granted. | 326 | * Return 0 if permission is granted. |
327 | * @inode_rename: | 327 | * @inode_rename: |
328 | * Check for permission to rename a file or directory. | 328 | * Check for permission to rename a file or directory. |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 14749056dd63..3fa0fab4a04b 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -243,6 +243,131 @@ extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, | |||
243 | 243 | ||
244 | extern struct kmem_cache *sighand_cachep; | 244 | extern struct kmem_cache *sighand_cachep; |
245 | 245 | ||
246 | /* | ||
247 | * In POSIX a signal is sent either to a specific thread (Linux task) | ||
248 | * or to the process as a whole (Linux thread group). How the signal | ||
249 | * is sent determines whether it's to one thread or the whole group, | ||
250 | * which determines which signal mask(s) are involved in blocking it | ||
251 | * from being delivered until later. When the signal is delivered, | ||
252 | * either it's caught or ignored by a user handler or it has a default | ||
253 | * effect that applies to the whole thread group (POSIX process). | ||
254 | * | ||
255 | * The possible effects an unblocked signal set to SIG_DFL can have are: | ||
256 | * ignore - Nothing Happens | ||
257 | * terminate - kill the process, i.e. all threads in the group, | ||
258 | * similar to exit_group. The group leader (only) reports | ||
259 | * WIFSIGNALED status to its parent. | ||
260 | * coredump - write a core dump file describing all threads using | ||
261 | * the same mm and then kill all those threads | ||
262 | * stop - stop all the threads in the group, i.e. TASK_STOPPED state | ||
263 | * | ||
264 | * SIGKILL and SIGSTOP cannot be caught, blocked, or ignored. | ||
265 | * Other signals when not blocked and set to SIG_DFL behaves as follows. | ||
266 | * The job control signals also have other special effects. | ||
267 | * | ||
268 | * +--------------------+------------------+ | ||
269 | * | POSIX signal | default action | | ||
270 | * +--------------------+------------------+ | ||
271 | * | SIGHUP | terminate | | ||
272 | * | SIGINT | terminate | | ||
273 | * | SIGQUIT | coredump | | ||
274 | * | SIGILL | coredump | | ||
275 | * | SIGTRAP | coredump | | ||
276 | * | SIGABRT/SIGIOT | coredump | | ||
277 | * | SIGBUS | coredump | | ||
278 | * | SIGFPE | coredump | | ||
279 | * | SIGKILL | terminate(+) | | ||
280 | * | SIGUSR1 | terminate | | ||
281 | * | SIGSEGV | coredump | | ||
282 | * | SIGUSR2 | terminate | | ||
283 | * | SIGPIPE | terminate | | ||
284 | * | SIGALRM | terminate | | ||
285 | * | SIGTERM | terminate | | ||
286 | * | SIGCHLD | ignore | | ||
287 | * | SIGCONT | ignore(*) | | ||
288 | * | SIGSTOP | stop(*)(+) | | ||
289 | * | SIGTSTP | stop(*) | | ||
290 | * | SIGTTIN | stop(*) | | ||
291 | * | SIGTTOU | stop(*) | | ||
292 | * | SIGURG | ignore | | ||
293 | * | SIGXCPU | coredump | | ||
294 | * | SIGXFSZ | coredump | | ||
295 | * | SIGVTALRM | terminate | | ||
296 | * | SIGPROF | terminate | | ||
297 | * | SIGPOLL/SIGIO | terminate | | ||
298 | * | SIGSYS/SIGUNUSED | coredump | | ||
299 | * | SIGSTKFLT | terminate | | ||
300 | * | SIGWINCH | ignore | | ||
301 | * | SIGPWR | terminate | | ||
302 | * | SIGRTMIN-SIGRTMAX | terminate | | ||
303 | * +--------------------+------------------+ | ||
304 | * | non-POSIX signal | default action | | ||
305 | * +--------------------+------------------+ | ||
306 | * | SIGEMT | coredump | | ||
307 | * +--------------------+------------------+ | ||
308 | * | ||
309 | * (+) For SIGKILL and SIGSTOP the action is "always", not just "default". | ||
310 | * (*) Special job control effects: | ||
311 | * When SIGCONT is sent, it resumes the process (all threads in the group) | ||
312 | * from TASK_STOPPED state and also clears any pending/queued stop signals | ||
313 | * (any of those marked with "stop(*)"). This happens regardless of blocking, | ||
314 | * catching, or ignoring SIGCONT. When any stop signal is sent, it clears | ||
315 | * any pending/queued SIGCONT signals; this happens regardless of blocking, | ||
316 | * catching, or ignored the stop signal, though (except for SIGSTOP) the | ||
317 | * default action of stopping the process may happen later or never. | ||
318 | */ | ||
319 | |||
320 | #ifdef SIGEMT | ||
321 | #define SIGEMT_MASK rt_sigmask(SIGEMT) | ||
322 | #else | ||
323 | #define SIGEMT_MASK 0 | ||
324 | #endif | ||
325 | |||
326 | #if SIGRTMIN > BITS_PER_LONG | ||
327 | #define rt_sigmask(sig) (1ULL << ((sig)-1)) | ||
328 | #else | ||
329 | #define rt_sigmask(sig) sigmask(sig) | ||
330 | #endif | ||
331 | #define siginmask(sig, mask) (rt_sigmask(sig) & (mask)) | ||
332 | |||
333 | #define SIG_KERNEL_ONLY_MASK (\ | ||
334 | rt_sigmask(SIGKILL) | rt_sigmask(SIGSTOP)) | ||
335 | |||
336 | #define SIG_KERNEL_STOP_MASK (\ | ||
337 | rt_sigmask(SIGSTOP) | rt_sigmask(SIGTSTP) | \ | ||
338 | rt_sigmask(SIGTTIN) | rt_sigmask(SIGTTOU) ) | ||
339 | |||
340 | #define SIG_KERNEL_COREDUMP_MASK (\ | ||
341 | rt_sigmask(SIGQUIT) | rt_sigmask(SIGILL) | \ | ||
342 | rt_sigmask(SIGTRAP) | rt_sigmask(SIGABRT) | \ | ||
343 | rt_sigmask(SIGFPE) | rt_sigmask(SIGSEGV) | \ | ||
344 | rt_sigmask(SIGBUS) | rt_sigmask(SIGSYS) | \ | ||
345 | rt_sigmask(SIGXCPU) | rt_sigmask(SIGXFSZ) | \ | ||
346 | SIGEMT_MASK ) | ||
347 | |||
348 | #define SIG_KERNEL_IGNORE_MASK (\ | ||
349 | rt_sigmask(SIGCONT) | rt_sigmask(SIGCHLD) | \ | ||
350 | rt_sigmask(SIGWINCH) | rt_sigmask(SIGURG) ) | ||
351 | |||
352 | #define sig_kernel_only(sig) \ | ||
353 | (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_ONLY_MASK)) | ||
354 | #define sig_kernel_coredump(sig) \ | ||
355 | (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_COREDUMP_MASK)) | ||
356 | #define sig_kernel_ignore(sig) \ | ||
357 | (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_IGNORE_MASK)) | ||
358 | #define sig_kernel_stop(sig) \ | ||
359 | (((sig) < SIGRTMIN) && siginmask(sig, SIG_KERNEL_STOP_MASK)) | ||
360 | |||
361 | #define sig_needs_tasklist(sig) ((sig) == SIGCONT) | ||
362 | |||
363 | #define sig_user_defined(t, signr) \ | ||
364 | (((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) && \ | ||
365 | ((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN)) | ||
366 | |||
367 | #define sig_fatal(t, signr) \ | ||
368 | (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ | ||
369 | (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) | ||
370 | |||
246 | #endif /* __KERNEL__ */ | 371 | #endif /* __KERNEL__ */ |
247 | 372 | ||
248 | #endif /* _LINUX_SIGNAL_H */ | 373 | #endif /* _LINUX_SIGNAL_H */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 7ba23ec8211b..3f70149eabbb 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -83,7 +83,6 @@ void smp_prepare_boot_cpu(void); | |||
83 | * These macros fold the SMP functionality into a single CPU system | 83 | * These macros fold the SMP functionality into a single CPU system |
84 | */ | 84 | */ |
85 | #define raw_smp_processor_id() 0 | 85 | #define raw_smp_processor_id() 0 |
86 | #define hard_smp_processor_id() 0 | ||
87 | static inline int up_smp_call_function(void) | 86 | static inline int up_smp_call_function(void) |
88 | { | 87 | { |
89 | return 0; | 88 | return 0; |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index f56d24734950..34d4b075f7b8 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2005 Narayanan R S <nars@kadamba.org> | 6 | * Copyright (C) 2005 Narayanan R S <nars@kadamba.org> |
7 | 7 | ||
8 | * Copyright (C) 2001-2002 Alcôve <www.alcove.com> | 8 | * Copyright (C) 2001-2002 Alcôve <www.alcove.com> |
9 | * | 9 | * |
10 | * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> | 10 | * Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> |
11 | * | 11 | * |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 35fa4d5aadd0..4a7ae8ab6eb8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -396,4 +396,23 @@ char * svc_print_addr(struct svc_rqst *, char *, size_t); | |||
396 | 396 | ||
397 | #define RPC_MAX_ADDRBUFLEN (63U) | 397 | #define RPC_MAX_ADDRBUFLEN (63U) |
398 | 398 | ||
399 | /* | ||
400 | * When we want to reduce the size of the reserved space in the response | ||
401 | * buffer, we need to take into account the size of any checksum data that | ||
402 | * may be at the end of the packet. This is difficult to determine exactly | ||
403 | * for all cases without actually generating the checksum, so we just use a | ||
404 | * static value. | ||
405 | */ | ||
406 | static inline void | ||
407 | svc_reserve_auth(struct svc_rqst *rqstp, int space) | ||
408 | { | ||
409 | int added_space = 0; | ||
410 | |||
411 | switch(rqstp->rq_authop->flavour) { | ||
412 | case RPC_AUTH_GSS: | ||
413 | added_space = RPC_MAX_AUTH_SIZE; | ||
414 | } | ||
415 | return svc_reserve(rqstp, space + added_space); | ||
416 | } | ||
417 | |||
399 | #endif /* SUNRPC_SVC_H */ | 418 | #endif /* SUNRPC_SVC_H */ |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 7909687557bf..e21dd93ac4b7 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -37,7 +37,8 @@ struct svc_sock { | |||
37 | 37 | ||
38 | atomic_t sk_reserved; /* space on outq that is reserved */ | 38 | atomic_t sk_reserved; /* space on outq that is reserved */ |
39 | 39 | ||
40 | spinlock_t sk_defer_lock; /* protects sk_deferred */ | 40 | spinlock_t sk_lock; /* protects sk_deferred and |
41 | * sk_info_authunix */ | ||
41 | struct list_head sk_deferred; /* deferred requests that need to | 42 | struct list_head sk_deferred; /* deferred requests that need to |
42 | * be revisted */ | 43 | * be revisted */ |
43 | struct mutex sk_mutex; /* to serialize sending data */ | 44 | struct mutex sk_mutex; /* to serialize sending data */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 1f2f7ba9e709..9c7cb6430666 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -32,6 +32,24 @@ static inline int pm_prepare_console(void) { return 0; } | |||
32 | static inline void pm_restore_console(void) {} | 32 | static inline void pm_restore_console(void) {} |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /** | ||
36 | * struct hibernation_ops - hibernation platform support | ||
37 | * | ||
38 | * The methods in this structure allow a platform to override the default | ||
39 | * mechanism of shutting down the machine during a hibernation transition. | ||
40 | * | ||
41 | * All three methods must be assigned. | ||
42 | * | ||
43 | * @prepare: prepare system for hibernation | ||
44 | * @enter: shut down system after state has been saved to disk | ||
45 | * @finish: finish/clean up after state has been reloaded | ||
46 | */ | ||
47 | struct hibernation_ops { | ||
48 | int (*prepare)(void); | ||
49 | int (*enter)(void); | ||
50 | void (*finish)(void); | ||
51 | }; | ||
52 | |||
35 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) | 53 | #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) |
36 | /* kernel/power/snapshot.c */ | 54 | /* kernel/power/snapshot.c */ |
37 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 55 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
@@ -47,12 +65,18 @@ extern int swsusp_page_is_forbidden(struct page *); | |||
47 | extern void swsusp_set_page_free(struct page *); | 65 | extern void swsusp_set_page_free(struct page *); |
48 | extern void swsusp_unset_page_free(struct page *); | 66 | extern void swsusp_unset_page_free(struct page *); |
49 | extern unsigned long get_safe_page(gfp_t gfp_mask); | 67 | extern unsigned long get_safe_page(gfp_t gfp_mask); |
68 | |||
69 | extern void hibernation_set_ops(struct hibernation_ops *ops); | ||
70 | extern int hibernate(void); | ||
50 | #else | 71 | #else |
51 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} | 72 | static inline void register_nosave_region(unsigned long b, unsigned long e) {} |
52 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} | 73 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) {} |
53 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 74 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
54 | static inline void swsusp_set_page_free(struct page *p) {} | 75 | static inline void swsusp_set_page_free(struct page *p) {} |
55 | static inline void swsusp_unset_page_free(struct page *p) {} | 76 | static inline void swsusp_unset_page_free(struct page *p) {} |
77 | |||
78 | static inline void hibernation_set_ops(struct hibernation_ops *ops) {} | ||
79 | static inline int hibernate(void) { return -ENOSYS; } | ||
56 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ | 80 | #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */ |
57 | 81 | ||
58 | void save_processor_state(void); | 82 | void save_processor_state(void); |
diff --git a/include/linux/svga.h b/include/linux/svga.h index e1cc552e04fe..13ad0b82ac28 100644 --- a/include/linux/svga.h +++ b/include/linux/svga.h | |||
@@ -113,6 +113,8 @@ void svga_tilefill(struct fb_info *info, struct fb_tilerect *rect); | |||
113 | void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit); | 113 | void svga_tileblit(struct fb_info *info, struct fb_tileblit *blit); |
114 | void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor); | 114 | void svga_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor); |
115 | int svga_get_tilemax(struct fb_info *info); | 115 | int svga_get_tilemax(struct fb_info *info); |
116 | void svga_get_caps(struct fb_info *info, struct fb_blit_caps *caps, | ||
117 | struct fb_var_screeninfo *var); | ||
116 | 118 | ||
117 | int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node); | 119 | int svga_compute_pll(const struct svga_pll *pll, u32 f_wanted, u16 *m, u16 *n, u16 *r, int node); |
118 | int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node); | 120 | int svga_check_timings(const struct svga_timing_regs *tm, struct fb_var_screeninfo *var, int node); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 1912c6cbef55..3139f4412297 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -576,6 +576,8 @@ asmlinkage long sys_fstatat64(int dfd, char __user *filename, | |||
576 | struct stat64 __user *statbuf, int flag); | 576 | struct stat64 __user *statbuf, int flag); |
577 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, | 577 | asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, |
578 | int bufsiz); | 578 | int bufsiz); |
579 | asmlinkage long sys_utimensat(int dfd, char __user *filename, | ||
580 | struct timespec __user *utimes, int flags); | ||
579 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | 581 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, |
580 | struct compat_timeval __user *t); | 582 | struct compat_timeval __user *t); |
581 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | 583 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, |
diff --git a/include/linux/usb.h b/include/linux/usb.h index cfbd2bb8fa2c..94bd38a6d947 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -126,7 +126,7 @@ enum usb_interface_condition { | |||
126 | * Each interface may have alternate settings. The initial configuration | 126 | * Each interface may have alternate settings. The initial configuration |
127 | * of a device sets altsetting 0, but the device driver can change | 127 | * of a device sets altsetting 0, but the device driver can change |
128 | * that setting using usb_set_interface(). Alternate settings are often | 128 | * that setting using usb_set_interface(). Alternate settings are often |
129 | * used to control the the use of periodic endpoints, such as by having | 129 | * used to control the use of periodic endpoints, such as by having |
130 | * different endpoints use different amounts of reserved USB bandwidth. | 130 | * different endpoints use different amounts of reserved USB bandwidth. |
131 | * All standards-conformant USB devices that use isochronous endpoints | 131 | * All standards-conformant USB devices that use isochronous endpoints |
132 | * will use them in non-default settings. | 132 | * will use them in non-default settings. |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index acb1f105870c..d9325cf8a134 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -212,8 +212,6 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
212 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 212 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
213 | 213 | ||
214 | void refresh_cpu_vm_stats(int); | 214 | void refresh_cpu_vm_stats(int); |
215 | void refresh_vm_stats(void); | ||
216 | |||
217 | #else /* CONFIG_SMP */ | 215 | #else /* CONFIG_SMP */ |
218 | 216 | ||
219 | /* | 217 | /* |
@@ -260,7 +258,6 @@ static inline void __dec_zone_page_state(struct page *page, | |||
260 | #define mod_zone_page_state __mod_zone_page_state | 258 | #define mod_zone_page_state __mod_zone_page_state |
261 | 259 | ||
262 | static inline void refresh_cpu_vm_stats(int cpu) { } | 260 | static inline void refresh_cpu_vm_stats(int cpu) { } |
263 | static inline void refresh_vm_stats(void) { } | ||
264 | #endif | 261 | #endif |
265 | 262 | ||
266 | #endif /* _LINUX_VMSTAT_H */ | 263 | #endif /* _LINUX_VMSTAT_H */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index f16ba1e0687d..d555f31c0746 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -24,15 +24,13 @@ typedef void (*work_func_t)(struct work_struct *work); | |||
24 | struct work_struct { | 24 | struct work_struct { |
25 | atomic_long_t data; | 25 | atomic_long_t data; |
26 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ | 26 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ |
27 | #define WORK_STRUCT_NOAUTOREL 1 /* F if work item automatically released on exec */ | ||
28 | #define WORK_STRUCT_FLAG_MASK (3UL) | 27 | #define WORK_STRUCT_FLAG_MASK (3UL) |
29 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | 28 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) |
30 | struct list_head entry; | 29 | struct list_head entry; |
31 | work_func_t func; | 30 | work_func_t func; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | #define WORK_DATA_INIT(autorelease) \ | 33 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) |
35 | ATOMIC_LONG_INIT((autorelease) << WORK_STRUCT_NOAUTOREL) | ||
36 | 34 | ||
37 | struct delayed_work { | 35 | struct delayed_work { |
38 | struct work_struct work; | 36 | struct work_struct work; |
@@ -44,14 +42,8 @@ struct execute_work { | |||
44 | }; | 42 | }; |
45 | 43 | ||
46 | #define __WORK_INITIALIZER(n, f) { \ | 44 | #define __WORK_INITIALIZER(n, f) { \ |
47 | .data = WORK_DATA_INIT(0), \ | 45 | .data = WORK_DATA_INIT(), \ |
48 | .entry = { &(n).entry, &(n).entry }, \ | 46 | .entry = { &(n).entry, &(n).entry }, \ |
49 | .func = (f), \ | ||
50 | } | ||
51 | |||
52 | #define __WORK_INITIALIZER_NAR(n, f) { \ | ||
53 | .data = WORK_DATA_INIT(1), \ | ||
54 | .entry = { &(n).entry, &(n).entry }, \ | ||
55 | .func = (f), \ | 47 | .func = (f), \ |
56 | } | 48 | } |
57 | 49 | ||
@@ -60,23 +52,12 @@ struct execute_work { | |||
60 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | 52 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ |
61 | } | 53 | } |
62 | 54 | ||
63 | #define __DELAYED_WORK_INITIALIZER_NAR(n, f) { \ | ||
64 | .work = __WORK_INITIALIZER_NAR((n).work, (f)), \ | ||
65 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | ||
66 | } | ||
67 | |||
68 | #define DECLARE_WORK(n, f) \ | 55 | #define DECLARE_WORK(n, f) \ |
69 | struct work_struct n = __WORK_INITIALIZER(n, f) | 56 | struct work_struct n = __WORK_INITIALIZER(n, f) |
70 | 57 | ||
71 | #define DECLARE_WORK_NAR(n, f) \ | ||
72 | struct work_struct n = __WORK_INITIALIZER_NAR(n, f) | ||
73 | |||
74 | #define DECLARE_DELAYED_WORK(n, f) \ | 58 | #define DECLARE_DELAYED_WORK(n, f) \ |
75 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) | 59 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) |
76 | 60 | ||
77 | #define DECLARE_DELAYED_WORK_NAR(n, f) \ | ||
78 | struct dwork_struct n = __DELAYED_WORK_INITIALIZER_NAR(n, f) | ||
79 | |||
80 | /* | 61 | /* |
81 | * initialize a work item's function pointer | 62 | * initialize a work item's function pointer |
82 | */ | 63 | */ |
@@ -95,16 +76,9 @@ struct execute_work { | |||
95 | * assignment of the work data initializer allows the compiler | 76 | * assignment of the work data initializer allows the compiler |
96 | * to generate better code. | 77 | * to generate better code. |
97 | */ | 78 | */ |
98 | #define INIT_WORK(_work, _func) \ | 79 | #define INIT_WORK(_work, _func) \ |
99 | do { \ | ||
100 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(0); \ | ||
101 | INIT_LIST_HEAD(&(_work)->entry); \ | ||
102 | PREPARE_WORK((_work), (_func)); \ | ||
103 | } while (0) | ||
104 | |||
105 | #define INIT_WORK_NAR(_work, _func) \ | ||
106 | do { \ | 80 | do { \ |
107 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(1); \ | 81 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
108 | INIT_LIST_HEAD(&(_work)->entry); \ | 82 | INIT_LIST_HEAD(&(_work)->entry); \ |
109 | PREPARE_WORK((_work), (_func)); \ | 83 | PREPARE_WORK((_work), (_func)); \ |
110 | } while (0) | 84 | } while (0) |
@@ -115,12 +89,6 @@ struct execute_work { | |||
115 | init_timer(&(_work)->timer); \ | 89 | init_timer(&(_work)->timer); \ |
116 | } while (0) | 90 | } while (0) |
117 | 91 | ||
118 | #define INIT_DELAYED_WORK_NAR(_work, _func) \ | ||
119 | do { \ | ||
120 | INIT_WORK_NAR(&(_work)->work, (_func)); \ | ||
121 | init_timer(&(_work)->timer); \ | ||
122 | } while (0) | ||
123 | |||
124 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ | 92 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ |
125 | do { \ | 93 | do { \ |
126 | INIT_WORK(&(_work)->work, (_func)); \ | 94 | INIT_WORK(&(_work)->work, (_func)); \ |
@@ -143,24 +111,10 @@ struct execute_work { | |||
143 | work_pending(&(w)->work) | 111 | work_pending(&(w)->work) |
144 | 112 | ||
145 | /** | 113 | /** |
146 | * work_release - Release a work item under execution | 114 | * work_clear_pending - for internal use only, mark a work item as not pending |
147 | * @work: The work item to release | 115 | * @work: The work item in question |
148 | * | ||
149 | * This is used to release a work item that has been initialised with automatic | ||
150 | * release mode disabled (WORK_STRUCT_NOAUTOREL is set). This gives the work | ||
151 | * function the opportunity to grab auxiliary data from the container of the | ||
152 | * work_struct before clearing the pending bit as the work_struct may be | ||
153 | * subject to deallocation the moment the pending bit is cleared. | ||
154 | * | ||
155 | * In such a case, this should be called in the work function after it has | ||
156 | * fetched any data it may require from the containter of the work_struct. | ||
157 | * After this function has been called, the work_struct may be scheduled for | ||
158 | * further execution or it may be deallocated unless other precautions are | ||
159 | * taken. | ||
160 | * | ||
161 | * This should also be used to release a delayed work item. | ||
162 | */ | 116 | */ |
163 | #define work_release(work) \ | 117 | #define work_clear_pending(work) \ |
164 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) | 118 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) |
165 | 119 | ||
166 | 120 | ||
@@ -174,27 +128,28 @@ extern struct workqueue_struct *__create_workqueue(const char *name, | |||
174 | extern void destroy_workqueue(struct workqueue_struct *wq); | 128 | extern void destroy_workqueue(struct workqueue_struct *wq); |
175 | 129 | ||
176 | extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); | 130 | extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); |
177 | extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *work, unsigned long delay)); | 131 | extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, |
132 | struct delayed_work *work, unsigned long delay)); | ||
178 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 133 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, |
179 | struct delayed_work *work, unsigned long delay); | 134 | struct delayed_work *work, unsigned long delay); |
135 | |||
180 | extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); | 136 | extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); |
137 | extern void flush_scheduled_work(void); | ||
181 | 138 | ||
182 | extern int FASTCALL(schedule_work(struct work_struct *work)); | 139 | extern int FASTCALL(schedule_work(struct work_struct *work)); |
183 | extern int FASTCALL(run_scheduled_work(struct work_struct *work)); | 140 | extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, |
184 | extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay)); | 141 | unsigned long delay)); |
185 | 142 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | |
186 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay); | 143 | unsigned long delay); |
187 | extern int schedule_on_each_cpu(work_func_t func); | 144 | extern int schedule_on_each_cpu(work_func_t func); |
188 | extern void flush_scheduled_work(void); | ||
189 | extern int current_is_keventd(void); | 145 | extern int current_is_keventd(void); |
190 | extern int keventd_up(void); | 146 | extern int keventd_up(void); |
191 | 147 | ||
192 | extern void init_workqueues(void); | 148 | extern void init_workqueues(void); |
193 | void cancel_rearming_delayed_work(struct delayed_work *work); | ||
194 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | ||
195 | struct delayed_work *); | ||
196 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 149 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
197 | 150 | ||
151 | extern void cancel_work_sync(struct work_struct *work); | ||
152 | |||
198 | /* | 153 | /* |
199 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 154 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
200 | * function may still be running on return from cancel_delayed_work(), unless | 155 | * function may still be running on return from cancel_delayed_work(), unless |
@@ -207,8 +162,18 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
207 | 162 | ||
208 | ret = del_timer(&work->timer); | 163 | ret = del_timer(&work->timer); |
209 | if (ret) | 164 | if (ret) |
210 | work_release(&work->work); | 165 | work_clear_pending(&work->work); |
211 | return ret; | 166 | return ret; |
212 | } | 167 | } |
213 | 168 | ||
169 | extern void cancel_rearming_delayed_work(struct delayed_work *work); | ||
170 | |||
171 | /* Obsolete. use cancel_rearming_delayed_work() */ | ||
172 | static inline | ||
173 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | ||
174 | struct delayed_work *work) | ||
175 | { | ||
176 | cancel_rearming_delayed_work(work); | ||
177 | } | ||
178 | |||
214 | #endif | 179 | #endif |