diff options
Diffstat (limited to 'include')
81 files changed, 2401 insertions, 323 deletions
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h index 5541101b58ae..ad854a4a3af6 100644 --- a/include/asm-alpha/termbits.h +++ b/include/asm-alpha/termbits.h | |||
@@ -25,6 +25,19 @@ struct termios { | |||
25 | speed_t c_ospeed; /* output speed */ | 25 | speed_t c_ospeed; /* output speed */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /* Alpha has matching termios and ktermios */ | ||
29 | |||
30 | struct ktermios { | ||
31 | tcflag_t c_iflag; /* input mode flags */ | ||
32 | tcflag_t c_oflag; /* output mode flags */ | ||
33 | tcflag_t c_cflag; /* control mode flags */ | ||
34 | tcflag_t c_lflag; /* local mode flags */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
37 | speed_t c_ispeed; /* input speed */ | ||
38 | speed_t c_ospeed; /* output speed */ | ||
39 | }; | ||
40 | |||
28 | /* c_cc characters */ | 41 | /* c_cc characters */ |
29 | #define VEOF 0 | 42 | #define VEOF 0 |
30 | #define VEOL 1 | 43 | #define VEOL 1 |
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index 90894214cace..93a58e7862b0 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -31,6 +31,9 @@ struct s3c2410fb_hw { | |||
31 | struct s3c2410fb_mach_info { | 31 | struct s3c2410fb_mach_info { |
32 | unsigned char fixed_syncs; /* do not update sync/border */ | 32 | unsigned char fixed_syncs; /* do not update sync/border */ |
33 | 33 | ||
34 | /* LCD types */ | ||
35 | int type; | ||
36 | |||
34 | /* Screen size */ | 37 | /* Screen size */ |
35 | int width; | 38 | int width; |
36 | int height; | 39 | int height; |
diff --git a/include/asm-arm/termbits.h b/include/asm-arm/termbits.h index bbc6e1d24d3f..a3f4fe1742d0 100644 --- a/include/asm-arm/termbits.h +++ b/include/asm-arm/termbits.h | |||
@@ -15,6 +15,18 @@ struct termios { | |||
15 | cc_t c_cc[NCCS]; /* control characters */ | 15 | cc_t c_cc[NCCS]; /* control characters */ |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct ktermios { | ||
19 | tcflag_t c_iflag; /* input mode flags */ | ||
20 | tcflag_t c_oflag; /* output mode flags */ | ||
21 | tcflag_t c_cflag; /* control mode flags */ | ||
22 | tcflag_t c_lflag; /* local mode flags */ | ||
23 | cc_t c_line; /* line discipline */ | ||
24 | cc_t c_cc[NCCS]; /* control characters */ | ||
25 | speed_t c_ispeed; /* input speed */ | ||
26 | speed_t c_ospeed; /* output speed */ | ||
27 | }; | ||
28 | |||
29 | |||
18 | /* c_cc characters */ | 30 | /* c_cc characters */ |
19 | #define VINTR 0 | 31 | #define VINTR 0 |
20 | #define VQUIT 1 | 32 | #define VQUIT 1 |
diff --git a/include/asm-arm26/termbits.h b/include/asm-arm26/termbits.h index bbc6e1d24d3f..a3f4fe1742d0 100644 --- a/include/asm-arm26/termbits.h +++ b/include/asm-arm26/termbits.h | |||
@@ -15,6 +15,18 @@ struct termios { | |||
15 | cc_t c_cc[NCCS]; /* control characters */ | 15 | cc_t c_cc[NCCS]; /* control characters */ |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct ktermios { | ||
19 | tcflag_t c_iflag; /* input mode flags */ | ||
20 | tcflag_t c_oflag; /* output mode flags */ | ||
21 | tcflag_t c_cflag; /* control mode flags */ | ||
22 | tcflag_t c_lflag; /* local mode flags */ | ||
23 | cc_t c_line; /* line discipline */ | ||
24 | cc_t c_cc[NCCS]; /* control characters */ | ||
25 | speed_t c_ispeed; /* input speed */ | ||
26 | speed_t c_ospeed; /* output speed */ | ||
27 | }; | ||
28 | |||
29 | |||
18 | /* c_cc characters */ | 30 | /* c_cc characters */ |
19 | #define VINTR 0 | 31 | #define VINTR 0 |
20 | #define VQUIT 1 | 32 | #define VQUIT 1 |
diff --git a/include/asm-avr32/termbits.h b/include/asm-avr32/termbits.h index 9dc6eacafa33..c215fafdae4d 100644 --- a/include/asm-avr32/termbits.h +++ b/include/asm-avr32/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h index be0836d2f282..8d8cec225fe1 100644 --- a/include/asm-cris/termbits.h +++ b/include/asm-cris/termbits.h | |||
@@ -19,6 +19,17 @@ struct termios { | |||
19 | cc_t c_cc[NCCS]; /* control characters */ | 19 | cc_t c_cc[NCCS]; /* control characters */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct ktermios { | ||
23 | tcflag_t c_iflag; /* input mode flags */ | ||
24 | tcflag_t c_oflag; /* output mode flags */ | ||
25 | tcflag_t c_cflag; /* control mode flags */ | ||
26 | tcflag_t c_lflag; /* local mode flags */ | ||
27 | cc_t c_line; /* line discipline */ | ||
28 | cc_t c_cc[NCCS]; /* control characters */ | ||
29 | speed_t c_ispeed; /* input speed */ | ||
30 | speed_t c_ospeed; /* output speed */ | ||
31 | }; | ||
32 | |||
22 | /* c_cc characters */ | 33 | /* c_cc characters */ |
23 | #define VINTR 0 | 34 | #define VINTR 0 |
24 | #define VQUIT 1 | 35 | #define VQUIT 1 |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 1f70d47148bd..f8560edf59ff 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -256,6 +256,50 @@ int __ffs(unsigned long x) | |||
256 | return 31 - bit; | 256 | return 31 - bit; |
257 | } | 257 | } |
258 | 258 | ||
259 | /* | ||
260 | * special slimline version of fls() for calculating ilog2_u32() | ||
261 | * - note: no protection against n == 0 | ||
262 | */ | ||
263 | #define ARCH_HAS_ILOG2_U32 | ||
264 | static inline __attribute__((const)) | ||
265 | int __ilog2_u32(u32 n) | ||
266 | { | ||
267 | int bit; | ||
268 | asm("scan %1,gr0,%0" : "=r"(bit) : "r"(n)); | ||
269 | return 31 - bit; | ||
270 | } | ||
271 | |||
272 | /* | ||
273 | * special slimline version of fls64() for calculating ilog2_u64() | ||
274 | * - note: no protection against n == 0 | ||
275 | */ | ||
276 | #define ARCH_HAS_ILOG2_U64 | ||
277 | static inline __attribute__((const)) | ||
278 | int __ilog2_u64(u64 n) | ||
279 | { | ||
280 | union { | ||
281 | u64 ll; | ||
282 | struct { u32 h, l; }; | ||
283 | } _; | ||
284 | int bit, x, y; | ||
285 | |||
286 | _.ll = n; | ||
287 | |||
288 | asm(" subcc %3,gr0,gr0,icc0 \n" | ||
289 | " ckeq icc0,cc4 \n" | ||
290 | " cscan.p %3,gr0,%0 ,cc4,0 \n" | ||
291 | " setlos #63,%1 \n" | ||
292 | " cscan.p %4,gr0,%0 ,cc4,1 \n" | ||
293 | " setlos #31,%2 \n" | ||
294 | " csub.p %1,%0,%0 ,cc4,0 \n" | ||
295 | " csub %2,%0,%0 ,cc4,1 \n" | ||
296 | : "=&r"(bit), "=r"(x), "=r"(y) | ||
297 | : "0r"(_.h), "r"(_.l) | ||
298 | : "icc0", "cc4" | ||
299 | ); | ||
300 | return bit; | ||
301 | } | ||
302 | |||
259 | #include <asm-generic/bitops/sched.h> | 303 | #include <asm-generic/bitops/sched.h> |
260 | #include <asm-generic/bitops/hweight.h> | 304 | #include <asm-generic/bitops/hweight.h> |
261 | 305 | ||
diff --git a/include/asm-frv/termbits.h b/include/asm-frv/termbits.h index 74f20d6e292f..2d6d389cff49 100644 --- a/include/asm-frv/termbits.h +++ b/include/asm-frv/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index c92ae0f166ff..a06eecd48292 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -4,6 +4,22 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | |||
8 | #ifdef CONFIG_GENERIC_BUG | ||
9 | #ifndef __ASSEMBLY__ | ||
10 | struct bug_entry { | ||
11 | unsigned long bug_addr; | ||
12 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
13 | const char *file; | ||
14 | unsigned short line; | ||
15 | #endif | ||
16 | unsigned short flags; | ||
17 | }; | ||
18 | #endif /* __ASSEMBLY__ */ | ||
19 | |||
20 | #define BUGFLAG_WARNING (1<<0) | ||
21 | #endif /* CONFIG_GENERIC_BUG */ | ||
22 | |||
7 | #ifndef HAVE_ARCH_BUG | 23 | #ifndef HAVE_ARCH_BUG |
8 | #define BUG() do { \ | 24 | #define BUG() do { \ |
9 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ | 25 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ |
@@ -19,7 +35,7 @@ | |||
19 | #define WARN_ON(condition) ({ \ | 35 | #define WARN_ON(condition) ({ \ |
20 | typeof(condition) __ret_warn_on = (condition); \ | 36 | typeof(condition) __ret_warn_on = (condition); \ |
21 | if (unlikely(__ret_warn_on)) { \ | 37 | if (unlikely(__ret_warn_on)) { \ |
22 | printk("BUG: warning at %s:%d/%s()\n", __FILE__, \ | 38 | printk("WARNING at %s:%d %s()\n", __FILE__, \ |
23 | __LINE__, __FUNCTION__); \ | 39 | __LINE__, __FUNCTION__); \ |
24 | dump_stack(); \ | 40 | dump_stack(); \ |
25 | } \ | 41 | } \ |
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index a96b5d986b6e..b55052ce2330 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h | |||
@@ -4,21 +4,51 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | #ifndef __ASSEMBLY__ | 5 | #ifndef __ASSEMBLY__ |
6 | 6 | ||
7 | #include <linux/compiler.h> | 7 | #include <linux/log2.h> |
8 | 8 | ||
9 | /* Pure 2^n version of get_order */ | 9 | /* |
10 | static __inline__ __attribute_const__ int get_order(unsigned long size) | 10 | * non-const pure 2^n version of get_order |
11 | * - the arch may override these in asm/bitops.h if they can be implemented | ||
12 | * more efficiently than using the arch log2 routines | ||
13 | * - we use the non-const log2() instead if the arch has defined one suitable | ||
14 | */ | ||
15 | #ifndef ARCH_HAS_GET_ORDER | ||
16 | static inline __attribute__((const)) | ||
17 | int __get_order(unsigned long size, int page_shift) | ||
11 | { | 18 | { |
19 | #if BITS_PER_LONG == 32 && defined(ARCH_HAS_ILOG2_U32) | ||
20 | int order = __ilog2_u32(size) - page_shift; | ||
21 | return order >= 0 ? order : 0; | ||
22 | #elif BITS_PER_LONG == 64 && defined(ARCH_HAS_ILOG2_U64) | ||
23 | int order = __ilog2_u64(size) - page_shift; | ||
24 | return order >= 0 ? order : 0; | ||
25 | #else | ||
12 | int order; | 26 | int order; |
13 | 27 | ||
14 | size = (size - 1) >> (PAGE_SHIFT - 1); | 28 | size = (size - 1) >> (page_shift - 1); |
15 | order = -1; | 29 | order = -1; |
16 | do { | 30 | do { |
17 | size >>= 1; | 31 | size >>= 1; |
18 | order++; | 32 | order++; |
19 | } while (size); | 33 | } while (size); |
20 | return order; | 34 | return order; |
35 | #endif | ||
21 | } | 36 | } |
37 | #endif | ||
38 | |||
39 | /** | ||
40 | * get_order - calculate log2(pages) to hold a block of the specified size | ||
41 | * @n - size | ||
42 | * | ||
43 | * calculate allocation order based on the current page size | ||
44 | * - this can be used to initialise global variables from constant data | ||
45 | */ | ||
46 | #define get_order(n) \ | ||
47 | ( \ | ||
48 | __builtin_constant_p(n) ? \ | ||
49 | ((n < (1UL << PAGE_SHIFT)) ? 0 : ilog2(n) - PAGE_SHIFT) : \ | ||
50 | __get_order(n, PAGE_SHIFT) \ | ||
51 | ) | ||
22 | 52 | ||
23 | #endif /* __ASSEMBLY__ */ | 53 | #endif /* __ASSEMBLY__ */ |
24 | #endif /* __KERNEL__ */ | 54 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h index 1e58ca39592c..3769e6bd63b1 100644 --- a/include/asm-generic/termios.h +++ b/include/asm-generic/termios.h | |||
@@ -11,7 +11,7 @@ | |||
11 | /* | 11 | /* |
12 | * Translate a "termio" structure into a "termios". Ugh. | 12 | * Translate a "termio" structure into a "termios". Ugh. |
13 | */ | 13 | */ |
14 | static inline int user_termio_to_kernel_termios(struct termios *termios, | 14 | static inline int user_termio_to_kernel_termios(struct ktermios *termios, |
15 | struct termio __user *termio) | 15 | struct termio __user *termio) |
16 | { | 16 | { |
17 | unsigned short tmp; | 17 | unsigned short tmp; |
@@ -48,7 +48,7 @@ static inline int user_termio_to_kernel_termios(struct termios *termios, | |||
48 | * Translate a "termios" structure into a "termio". Ugh. | 48 | * Translate a "termios" structure into a "termio". Ugh. |
49 | */ | 49 | */ |
50 | static inline int kernel_termios_to_user_termio(struct termio __user *termio, | 50 | static inline int kernel_termios_to_user_termio(struct termio __user *termio, |
51 | struct termios *termios) | 51 | struct ktermios *termios) |
52 | { | 52 | { |
53 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || | 53 | if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || |
54 | put_user(termios->c_oflag, &termio->c_oflag) < 0 || | 54 | put_user(termios->c_oflag, &termio->c_oflag) < 0 || |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 4d4c62d11059..6e9fcebbf89f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -218,6 +218,14 @@ | |||
218 | .stab.indexstr 0 : { *(.stab.indexstr) } \ | 218 | .stab.indexstr 0 : { *(.stab.indexstr) } \ |
219 | .comment 0 : { *(.comment) } | 219 | .comment 0 : { *(.comment) } |
220 | 220 | ||
221 | #define BUG_TABLE \ | ||
222 | . = ALIGN(8); \ | ||
223 | __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ | ||
224 | __start___bug_table = .; \ | ||
225 | *(__bug_table) \ | ||
226 | __stop___bug_table = .; \ | ||
227 | } | ||
228 | |||
221 | #define NOTES \ | 229 | #define NOTES \ |
222 | .notes : { *(.note.*) } :note | 230 | .notes : { *(.note.*) } :note |
223 | 231 | ||
diff --git a/include/asm-h8300/termbits.h b/include/asm-h8300/termbits.h index fa69ae00eda3..6a1f4d3807b4 100644 --- a/include/asm-h8300/termbits.h +++ b/include/asm-h8300/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h index 8062cdbf2587..b0fd78ca2619 100644 --- a/include/asm-i386/bug.h +++ b/include/asm-i386/bug.h | |||
@@ -4,20 +4,32 @@ | |||
4 | 4 | ||
5 | /* | 5 | /* |
6 | * Tell the user there is some problem. | 6 | * Tell the user there is some problem. |
7 | * The offending file and line are encoded after the "officially | 7 | * The offending file and line are encoded encoded in the __bug_table section. |
8 | * undefined" opcode for parsing in the trap handler. | ||
9 | */ | 8 | */ |
10 | 9 | ||
11 | #ifdef CONFIG_BUG | 10 | #ifdef CONFIG_BUG |
12 | #define HAVE_ARCH_BUG | 11 | #define HAVE_ARCH_BUG |
12 | |||
13 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 13 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
14 | #define BUG() \ | 14 | #define BUG() \ |
15 | __asm__ __volatile__( "ud2\n" \ | 15 | do { \ |
16 | "\t.word %c0\n" \ | 16 | asm volatile("1:\tud2\n" \ |
17 | "\t.long %c1\n" \ | 17 | ".pushsection __bug_table,\"a\"\n" \ |
18 | : : "i" (__LINE__), "i" (__FILE__)) | 18 | "2:\t.long 1b, %c0\n" \ |
19 | "\t.word %c1, 0\n" \ | ||
20 | "\t.org 2b+%c2\n" \ | ||
21 | ".popsection" \ | ||
22 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
23 | "i" (sizeof(struct bug_entry))); \ | ||
24 | for(;;) ; \ | ||
25 | } while(0) | ||
26 | |||
19 | #else | 27 | #else |
20 | #define BUG() __asm__ __volatile__("ud2\n") | 28 | #define BUG() \ |
29 | do { \ | ||
30 | asm volatile("ud2"); \ | ||
31 | for(;;) ; \ | ||
32 | } while(0) | ||
21 | #endif | 33 | #endif |
22 | #endif | 34 | #endif |
23 | 35 | ||
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 73465d2892b9..0fc240c80f49 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h | |||
@@ -40,13 +40,14 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
40 | 40 | ||
41 | static __inline__ unsigned long ide_default_io_base(int index) | 41 | static __inline__ unsigned long ide_default_io_base(int index) |
42 | { | 42 | { |
43 | struct pci_dev *pdev; | ||
43 | /* | 44 | /* |
44 | * If PCI is present then it is not safe to poke around | 45 | * If PCI is present then it is not safe to poke around |
45 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 46 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |
46 | * defined compatibility mode ports for PCI. A user can | 47 | * defined compatibility mode ports for PCI. A user can |
47 | * override this using ide= but we must default safe. | 48 | * override this using ide= but we must default safe. |
48 | */ | 49 | */ |
49 | if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { | 50 | if ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL)) == NULL) { |
50 | switch(index) { | 51 | switch(index) { |
51 | case 2: return 0x1e8; | 52 | case 2: return 0x1e8; |
52 | case 3: return 0x168; | 53 | case 3: return 0x168; |
@@ -54,6 +55,7 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
54 | case 5: return 0x160; | 55 | case 5: return 0x160; |
55 | } | 56 | } |
56 | } | 57 | } |
58 | pci_dev_put(pdev); | ||
57 | switch (index) { | 59 | switch (index) { |
58 | case 0: return 0x1f0; | 60 | case 0: return 0x1f0; |
59 | case 1: return 0x170; | 61 | case 1: return 0x170; |
diff --git a/include/asm-i386/termbits.h b/include/asm-i386/termbits.h index 72c10e3190f8..12baf1d6343f 100644 --- a/include/asm-i386/termbits.h +++ b/include/asm-i386/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-ia64/termbits.h b/include/asm-ia64/termbits.h index b9e843f7dc42..4531a511bde5 100644 --- a/include/asm-ia64/termbits.h +++ b/include/asm-ia64/termbits.h | |||
@@ -26,6 +26,17 @@ struct termios { | |||
26 | cc_t c_cc[NCCS]; /* control characters */ | 26 | cc_t c_cc[NCCS]; /* control characters */ |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct ktermios { | ||
30 | tcflag_t c_iflag; /* input mode flags */ | ||
31 | tcflag_t c_oflag; /* output mode flags */ | ||
32 | tcflag_t c_cflag; /* control mode flags */ | ||
33 | tcflag_t c_lflag; /* local mode flags */ | ||
34 | cc_t c_line; /* line discipline */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | speed_t c_ispeed; /* input speed */ | ||
37 | speed_t c_ospeed; /* output speed */ | ||
38 | }; | ||
39 | |||
29 | /* c_cc characters */ | 40 | /* c_cc characters */ |
30 | #define VINTR 0 | 41 | #define VINTR 0 |
31 | #define VQUIT 1 | 42 | #define VQUIT 1 |
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index 219a0f74eff3..c82ebe8f250d 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h | |||
@@ -32,7 +32,8 @@ | |||
32 | static __inline__ int ide_default_irq(unsigned long base) | 32 | static __inline__ int ide_default_irq(unsigned long base) |
33 | { | 33 | { |
34 | switch (base) { | 34 | switch (base) { |
35 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) | 35 | #if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ |
36 | || defined(CONFIG_PLAT_OPSPUT) | ||
36 | case 0x1f0: return PLD_IRQ_CFIREQ; | 37 | case 0x1f0: return PLD_IRQ_CFIREQ; |
37 | default: | 38 | default: |
38 | return 0; | 39 | return 0; |
diff --git a/include/asm-m32r/m32102.h b/include/asm-m32r/m32102.h index a1f0d1fe9eb8..52807f8db166 100644 --- a/include/asm-m32r/m32102.h +++ b/include/asm-m32r/m32102.h | |||
@@ -104,7 +104,8 @@ | |||
104 | #define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ | 104 | #define M32R_MFT5RLD_PORTL (0x0C+M32R_MFT5_OFFSET) /* MFT4 reload */ |
105 | #define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ | 105 | #define M32R_MFT5CMPRLD_PORTL (0x10+M32R_MFT5_OFFSET) /* MFT4 compare reload */ |
106 | 106 | ||
107 | #if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32104) | 107 | #if (defined(CONFIG_CHIP_M32700) && !defined(CONFIG_PLAT_MAPPI2)) \ |
108 | || defined(CONFIG_CHIP_M32104) | ||
108 | #define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ | 109 | #define M32R_MFTCR_MFT0MSK (1UL<<31) /* b0 */ |
109 | #define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ | 110 | #define M32R_MFTCR_MFT1MSK (1UL<<30) /* b1 */ |
110 | #define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ | 111 | #define M32R_MFTCR_MFT2MSK (1UL<<29) /* b2 */ |
@@ -117,7 +118,7 @@ | |||
117 | #define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ | 118 | #define M32R_MFTCR_MFT3EN (1UL<<20) /* b11 */ |
118 | #define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ | 119 | #define M32R_MFTCR_MFT4EN (1UL<<19) /* b12 */ |
119 | #define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ | 120 | #define M32R_MFTCR_MFT5EN (1UL<<18) /* b13 */ |
120 | #else /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ | 121 | #else |
121 | #define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ | 122 | #define M32R_MFTCR_MFT0MSK (1UL<<15) /* b16 */ |
122 | #define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ | 123 | #define M32R_MFTCR_MFT1MSK (1UL<<14) /* b17 */ |
123 | #define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ | 124 | #define M32R_MFTCR_MFT2MSK (1UL<<13) /* b18 */ |
@@ -130,7 +131,7 @@ | |||
130 | #define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ | 131 | #define M32R_MFTCR_MFT3EN (1UL<<4) /* b27 */ |
131 | #define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ | 132 | #define M32R_MFTCR_MFT4EN (1UL<<3) /* b28 */ |
132 | #define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ | 133 | #define M32R_MFTCR_MFT5EN (1UL<<2) /* b29 */ |
133 | #endif /* not CONFIG_CHIP_M32700 && not CONFIG_CHIP_M32104 */ | 134 | #endif |
134 | 135 | ||
135 | #define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ | 136 | #define M32R_MFTMOD_CC_MASK (1UL<<15) /* b16 */ |
136 | #define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ | 137 | #define M32R_MFTMOD_TCCR (1UL<<13) /* b18 */ |
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 2d2a6c97331e..632b4ce4269a 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -33,21 +33,10 @@ | |||
33 | #define PT_R15 PT_SP | 33 | #define PT_R15 PT_SP |
34 | 34 | ||
35 | /* processor status and miscellaneous context registers. */ | 35 | /* processor status and miscellaneous context registers. */ |
36 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
37 | #define PT_ACC0H 15 | 36 | #define PT_ACC0H 15 |
38 | #define PT_ACC0L 16 | 37 | #define PT_ACC0L 16 |
39 | #define PT_ACC1H 17 | 38 | #define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */ |
40 | #define PT_ACC1L 18 | 39 | #define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */ |
41 | #define PT_ACCH PT_ACC0H | ||
42 | #define PT_ACCL PT_ACC0L | ||
43 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
44 | #define PT_ACCH 15 | ||
45 | #define PT_ACCL 16 | ||
46 | #define PT_DUMMY_ACC1H 17 | ||
47 | #define PT_DUMMY_ACC1L 18 | ||
48 | #else | ||
49 | #error unknown isa conifiguration | ||
50 | #endif | ||
51 | #define PT_PSW 19 | 40 | #define PT_PSW 19 |
52 | #define PT_BPC 20 | 41 | #define PT_BPC 20 |
53 | #define PT_BBPSW 21 | 42 | #define PT_BBPSW 21 |
@@ -103,19 +92,10 @@ struct pt_regs { | |||
103 | long syscall_nr; | 92 | long syscall_nr; |
104 | 93 | ||
105 | /* Saved main processor status and miscellaneous context registers. */ | 94 | /* Saved main processor status and miscellaneous context registers. */ |
106 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
107 | unsigned long acc0h; | 95 | unsigned long acc0h; |
108 | unsigned long acc0l; | 96 | unsigned long acc0l; |
109 | unsigned long acc1h; | 97 | unsigned long acc1h; /* ISA_DSP_LEVEL2 only */ |
110 | unsigned long acc1l; | 98 | unsigned long acc1l; /* ISA_DSP_LEVEL2 only */ |
111 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
112 | unsigned long acch; | ||
113 | unsigned long accl; | ||
114 | unsigned long dummy_acc1h; | ||
115 | unsigned long dummy_acc1l; | ||
116 | #else | ||
117 | #error unknown isa configuration | ||
118 | #endif | ||
119 | unsigned long psw; | 99 | unsigned long psw; |
120 | unsigned long bpc; /* saved PC for TRAP syscalls */ | 100 | unsigned long bpc; /* saved PC for TRAP syscalls */ |
121 | unsigned long bbpsw; | 101 | unsigned long bbpsw; |
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h index 73025c0c41a1..62537dc4dec9 100644 --- a/include/asm-m32r/sigcontext.h +++ b/include/asm-m32r/sigcontext.h | |||
@@ -23,19 +23,10 @@ struct sigcontext { | |||
23 | unsigned long sc_r12; | 23 | unsigned long sc_r12; |
24 | 24 | ||
25 | /* Saved main processor status and miscellaneous context registers. */ | 25 | /* Saved main processor status and miscellaneous context registers. */ |
26 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
27 | unsigned long sc_acc0h; | 26 | unsigned long sc_acc0h; |
28 | unsigned long sc_acc0l; | 27 | unsigned long sc_acc0l; |
29 | unsigned long sc_acc1h; | 28 | unsigned long sc_acc1h; /* ISA_DSP_LEVEL2 only */ |
30 | unsigned long sc_acc1l; | 29 | unsigned long sc_acc1l; /* ISA_DSP_LEVEL2 only */ |
31 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
32 | unsigned long sc_acch; | ||
33 | unsigned long sc_accl; | ||
34 | unsigned long sc_dummy_acc1h; | ||
35 | unsigned long sc_dummy_acc1l; | ||
36 | #else | ||
37 | #error unknown isa configuration | ||
38 | #endif | ||
39 | unsigned long sc_psw; | 30 | unsigned long sc_psw; |
40 | unsigned long sc_bpc; /* saved PC for TRAP syscalls */ | 31 | unsigned long sc_bpc; /* saved PC for TRAP syscalls */ |
41 | unsigned long sc_bbpsw; | 32 | unsigned long sc_bbpsw; |
diff --git a/include/asm-m32r/termbits.h b/include/asm-m32r/termbits.h index 5ace3702df75..faf2bd0504c1 100644 --- a/include/asm-m32r/termbits.h +++ b/include/asm-m32r/termbits.h | |||
@@ -19,6 +19,17 @@ struct termios { | |||
19 | cc_t c_cc[NCCS]; /* control characters */ | 19 | cc_t c_cc[NCCS]; /* control characters */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct ktermios { | ||
23 | tcflag_t c_iflag; /* input mode flags */ | ||
24 | tcflag_t c_oflag; /* output mode flags */ | ||
25 | tcflag_t c_cflag; /* control mode flags */ | ||
26 | tcflag_t c_lflag; /* local mode flags */ | ||
27 | cc_t c_line; /* line discipline */ | ||
28 | cc_t c_cc[NCCS]; /* control characters */ | ||
29 | speed_t c_ispeed; /* input speed */ | ||
30 | speed_t c_ospeed; /* output speed */ | ||
31 | }; | ||
32 | |||
22 | /* c_cc characters */ | 33 | /* c_cc characters */ |
23 | #define VINTR 0 | 34 | #define VINTR 0 |
24 | #define VQUIT 1 | 35 | #define VQUIT 1 |
diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h index e9eec3eb0718..a194092240fb 100644 --- a/include/asm-m68k/termbits.h +++ b/include/asm-m68k/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-mips/termbits.h b/include/asm-mips/termbits.h index b62ec7c521cc..0bbe07b42a07 100644 --- a/include/asm-mips/termbits.h +++ b/include/asm-mips/termbits.h | |||
@@ -30,6 +30,17 @@ struct termios { | |||
30 | cc_t c_cc[NCCS]; /* control characters */ | 30 | cc_t c_cc[NCCS]; /* control characters */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct ktermios { | ||
34 | tcflag_t c_iflag; /* input mode flags */ | ||
35 | tcflag_t c_oflag; /* output mode flags */ | ||
36 | tcflag_t c_cflag; /* control mode flags */ | ||
37 | tcflag_t c_lflag; /* local mode flags */ | ||
38 | cc_t c_line; /* line discipline */ | ||
39 | cc_t c_cc[NCCS]; /* control characters */ | ||
40 | speed_t c_ispeed; /* input speed */ | ||
41 | speed_t c_ospeed; /* output speed */ | ||
42 | }; | ||
43 | |||
33 | /* c_cc characters */ | 44 | /* c_cc characters */ |
34 | #define VINTR 0 /* Interrupt character [ISIG]. */ | 45 | #define VINTR 0 /* Interrupt character [ISIG]. */ |
35 | #define VQUIT 1 /* Quit character [ISIG]. */ | 46 | #define VQUIT 1 /* Quit character [ISIG]. */ |
diff --git a/include/asm-parisc/termbits.h b/include/asm-parisc/termbits.h index 372b634892c9..a46e299a9391 100644 --- a/include/asm-parisc/termbits.h +++ b/include/asm-parisc/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index c341063d0804..0288144ea024 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -190,7 +190,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) | |||
190 | * Return the zero-based bit position (LE, not IBM bit numbering) of | 190 | * Return the zero-based bit position (LE, not IBM bit numbering) of |
191 | * the most significant 1-bit in a double word. | 191 | * the most significant 1-bit in a double word. |
192 | */ | 192 | */ |
193 | static __inline__ int __ilog2(unsigned long x) | 193 | static __inline__ __attribute__((const)) |
194 | int __ilog2(unsigned long x) | ||
194 | { | 195 | { |
195 | int lz; | 196 | int lz; |
196 | 197 | ||
@@ -198,6 +199,24 @@ static __inline__ int __ilog2(unsigned long x) | |||
198 | return BITS_PER_LONG - 1 - lz; | 199 | return BITS_PER_LONG - 1 - lz; |
199 | } | 200 | } |
200 | 201 | ||
202 | static inline __attribute__((const)) | ||
203 | int __ilog2_u32(u32 n) | ||
204 | { | ||
205 | int bit; | ||
206 | asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); | ||
207 | return 31 - bit; | ||
208 | } | ||
209 | |||
210 | #ifdef __powerpc64__ | ||
211 | static inline __attribute__((const)) | ||
212 | int __ilog2_u64(u32 n) | ||
213 | { | ||
214 | int bit; | ||
215 | asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n)); | ||
216 | return 63 - bit; | ||
217 | } | ||
218 | #endif | ||
219 | |||
201 | /* | 220 | /* |
202 | * Determines the bit position of the least significant 0 bit in the | 221 | * Determines the bit position of the least significant 0 bit in the |
203 | * specified double word. The returned bit position will be | 222 | * specified double word. The returned bit position will be |
diff --git a/include/asm-powerpc/page_32.h b/include/asm-powerpc/page_32.h index 2677bad70f40..07f6d3cf5e5a 100644 --- a/include/asm-powerpc/page_32.h +++ b/include/asm-powerpc/page_32.h | |||
@@ -26,15 +26,7 @@ extern void clear_pages(void *page, int order); | |||
26 | static inline void clear_page(void *page) { clear_pages(page, 0); } | 26 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
27 | extern void copy_page(void *to, void *from); | 27 | extern void copy_page(void *to, void *from); |
28 | 28 | ||
29 | /* Pure 2^n version of get_order */ | 29 | #include <asm-generic/page.h> |
30 | extern __inline__ int get_order(unsigned long size) | ||
31 | { | ||
32 | int lz; | ||
33 | |||
34 | size = (size-1) >> PAGE_SHIFT; | ||
35 | asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); | ||
36 | return 32 - lz; | ||
37 | } | ||
38 | 30 | ||
39 | #endif /* __ASSEMBLY__ */ | 31 | #endif /* __ASSEMBLY__ */ |
40 | 32 | ||
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h index 6d533b07aaf5..5e79198f7d18 100644 --- a/include/asm-powerpc/termbits.h +++ b/include/asm-powerpc/termbits.h | |||
@@ -30,6 +30,19 @@ struct termios { | |||
30 | speed_t c_ospeed; /* output speed */ | 30 | speed_t c_ospeed; /* output speed */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* For PowerPC the termios and ktermios are the same */ | ||
34 | |||
35 | struct ktermios { | ||
36 | tcflag_t c_iflag; /* input mode flags */ | ||
37 | tcflag_t c_oflag; /* output mode flags */ | ||
38 | tcflag_t c_cflag; /* control mode flags */ | ||
39 | tcflag_t c_lflag; /* local mode flags */ | ||
40 | cc_t c_cc[NCCS]; /* control characters */ | ||
41 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
42 | speed_t c_ispeed; /* input speed */ | ||
43 | speed_t c_ospeed; /* output speed */ | ||
44 | }; | ||
45 | |||
33 | /* c_cc characters */ | 46 | /* c_cc characters */ |
34 | #define VINTR 0 | 47 | #define VINTR 0 |
35 | #define VQUIT 1 | 48 | #define VQUIT 1 |
diff --git a/include/asm-s390/termbits.h b/include/asm-s390/termbits.h index eb3f8bfabf61..585c78a6e407 100644 --- a/include/asm-s390/termbits.h +++ b/include/asm-s390/termbits.h | |||
@@ -25,6 +25,17 @@ struct termios { | |||
25 | cc_t c_cc[NCCS]; /* control characters */ | 25 | cc_t c_cc[NCCS]; /* control characters */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | struct ktermios { | ||
29 | tcflag_t c_iflag; /* input mode flags */ | ||
30 | tcflag_t c_oflag; /* output mode flags */ | ||
31 | tcflag_t c_cflag; /* control mode flags */ | ||
32 | tcflag_t c_lflag; /* local mode flags */ | ||
33 | cc_t c_line; /* line discipline */ | ||
34 | cc_t c_cc[NCCS]; /* control characters */ | ||
35 | speed_t c_ispeed; /* input speed */ | ||
36 | speed_t c_ospeed; /* output speed */ | ||
37 | }; | ||
38 | |||
28 | /* c_cc characters */ | 39 | /* c_cc characters */ |
29 | #define VINTR 0 | 40 | #define VINTR 0 |
30 | #define VQUIT 1 | 41 | #define VQUIT 1 |
diff --git a/include/asm-sh/termbits.h b/include/asm-sh/termbits.h index 4f9822a8e7b4..f1b7b46f4e9a 100644 --- a/include/asm-sh/termbits.h +++ b/include/asm-sh/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-sparc/termbits.h b/include/asm-sparc/termbits.h index 1794d71134b7..5eb00a105d7c 100644 --- a/include/asm-sparc/termbits.h +++ b/include/asm-sparc/termbits.h | |||
@@ -31,6 +31,18 @@ struct termios { | |||
31 | #endif | 31 | #endif |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct ktermios { | ||
35 | tcflag_t c_iflag; /* input mode flags */ | ||
36 | tcflag_t c_oflag; /* output mode flags */ | ||
37 | tcflag_t c_cflag; /* control mode flags */ | ||
38 | tcflag_t c_lflag; /* local mode flags */ | ||
39 | cc_t c_line; /* line discipline */ | ||
40 | cc_t c_cc[NCCS]; /* control characters */ | ||
41 | cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ | ||
42 | speed_t c_ispeed; /* input speed */ | ||
43 | speed_t c_ospeed; /* output speed */ | ||
44 | }; | ||
45 | |||
34 | /* c_cc characters */ | 46 | /* c_cc characters */ |
35 | #define VINTR 0 | 47 | #define VINTR 0 |
36 | #define VQUIT 1 | 48 | #define VQUIT 1 |
diff --git a/include/asm-sparc64/termbits.h b/include/asm-sparc64/termbits.h index b07715273ed4..705cd44b4173 100644 --- a/include/asm-sparc64/termbits.h +++ b/include/asm-sparc64/termbits.h | |||
@@ -33,6 +33,18 @@ struct termios { | |||
33 | #endif | 33 | #endif |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct ktermios { | ||
37 | tcflag_t c_iflag; /* input mode flags */ | ||
38 | tcflag_t c_oflag; /* output mode flags */ | ||
39 | tcflag_t c_cflag; /* control mode flags */ | ||
40 | tcflag_t c_lflag; /* local mode flags */ | ||
41 | cc_t c_line; /* line discipline */ | ||
42 | cc_t c_cc[NCCS]; /* control characters */ | ||
43 | cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ | ||
44 | speed_t c_ispeed; /* input speed */ | ||
45 | speed_t c_ospeed; /* output speed */ | ||
46 | }; | ||
47 | |||
36 | /* c_cc characters */ | 48 | /* c_cc characters */ |
37 | #define VINTR 0 | 49 | #define VINTR 0 |
38 | #define VQUIT 1 | 50 | #define VQUIT 1 |
diff --git a/include/asm-um/bug.h b/include/asm-um/bug.h index 1e22fa26ff06..3357c5e2468e 100644 --- a/include/asm-um/bug.h +++ b/include/asm-um/bug.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #ifndef __UM_BUG_H | 1 | #ifndef __UM_BUG_H |
2 | #define __UM_BUG_H | 2 | #define __UM_BUG_H |
3 | #include <asm-generic/bug.h> | 3 | |
4 | #include <asm/arch/bug.h> | ||
5 | |||
4 | #endif | 6 | #endif |
diff --git a/include/asm-v850/termbits.h b/include/asm-v850/termbits.h index 212d4e279263..f3b433032089 100644 --- a/include/asm-v850/termbits.h +++ b/include/asm-v850/termbits.h | |||
@@ -17,6 +17,17 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct ktermios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
20 | /* c_cc characters */ | 31 | /* c_cc characters */ |
21 | #define VINTR 0 | 32 | #define VINTR 0 |
22 | #define VQUIT 1 | 33 | #define VQUIT 1 |
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h index 80ac1fe966ac..682606414913 100644 --- a/include/asm-x86_64/bug.h +++ b/include/asm-x86_64/bug.h | |||
@@ -1,30 +1,30 @@ | |||
1 | #ifndef __ASM_X8664_BUG_H | 1 | #ifndef __ASM_X8664_BUG_H |
2 | #define __ASM_X8664_BUG_H 1 | 2 | #define __ASM_X8664_BUG_H 1 |
3 | 3 | ||
4 | #include <linux/stringify.h> | ||
5 | |||
6 | /* | ||
7 | * Tell the user there is some problem. The exception handler decodes | ||
8 | * this frame. | ||
9 | */ | ||
10 | struct bug_frame { | ||
11 | unsigned char ud2[2]; | ||
12 | unsigned char push; | ||
13 | signed int filename; | ||
14 | unsigned char ret; | ||
15 | unsigned short line; | ||
16 | } __attribute__((packed)); | ||
17 | |||
18 | #ifdef CONFIG_BUG | 4 | #ifdef CONFIG_BUG |
19 | #define HAVE_ARCH_BUG | 5 | #define HAVE_ARCH_BUG |
20 | /* We turn the bug frame into valid instructions to not confuse | 6 | |
21 | the disassembler. Thanks to Jan Beulich & Suresh Siddha | 7 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
22 | for nice instruction selection. | 8 | #define BUG() \ |
23 | The magic numbers generate mov $64bitimm,%eax ; ret $offset. */ | 9 | do { \ |
24 | #define BUG() \ | 10 | asm volatile("1:\tud2\n" \ |
25 | asm volatile( \ | 11 | ".pushsection __bug_table,\"a\"\n" \ |
26 | "ud2 ; pushq $%c1 ; ret $%c0" :: \ | 12 | "2:\t.quad 1b, %c0\n" \ |
27 | "i"(__LINE__), "i" (__FILE__)) | 13 | "\t.word %c1, 0\n" \ |
14 | "\t.org 2b+%c2\n" \ | ||
15 | ".popsection" \ | ||
16 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
17 | "i" (sizeof(struct bug_entry))); \ | ||
18 | for(;;) ; \ | ||
19 | } while(0) | ||
20 | #else | ||
21 | #define BUG() \ | ||
22 | do { \ | ||
23 | asm volatile("ud2"); \ | ||
24 | for(;;) ; \ | ||
25 | } while(0) | ||
26 | #endif | ||
27 | |||
28 | void out_of_line_bug(void); | 28 | void out_of_line_bug(void); |
29 | #else | 29 | #else |
30 | static inline void out_of_line_bug(void) { } | 30 | static inline void out_of_line_bug(void) { } |
diff --git a/include/asm-x86_64/ioctls.h b/include/asm-x86_64/ioctls.h index 62caf8b6e4e1..3fc0b15a0d7e 100644 --- a/include/asm-x86_64/ioctls.h +++ b/include/asm-x86_64/ioctls.h | |||
@@ -46,6 +46,10 @@ | |||
46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | 46 | #define TIOCSBRK 0x5427 /* BSD compatibility */ |
47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | 47 | #define TIOCCBRK 0x5428 /* BSD compatibility */ |
48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | 48 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ |
49 | #define TCGETS2 _IOR('T',0x2A, struct termios2) | ||
50 | #define TCSETS2 _IOW('T',0x2B, struct termios2) | ||
51 | #define TCSETSW2 _IOW('T',0x2C, struct termios2) | ||
52 | #define TCSETSF2 _IOW('T',0x2D, struct termios2) | ||
49 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 53 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
50 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 54 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
51 | 55 | ||
diff --git a/include/asm-x86_64/termbits.h b/include/asm-x86_64/termbits.h index bd950946e52c..6cfc3bb10c1a 100644 --- a/include/asm-x86_64/termbits.h +++ b/include/asm-x86_64/termbits.h | |||
@@ -17,6 +17,28 @@ struct termios { | |||
17 | cc_t c_cc[NCCS]; /* control characters */ | 17 | cc_t c_cc[NCCS]; /* control characters */ |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct termios2 { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | speed_t c_ispeed; /* input speed */ | ||
28 | speed_t c_ospeed; /* output speed */ | ||
29 | }; | ||
30 | |||
31 | struct ktermios { | ||
32 | tcflag_t c_iflag; /* input mode flags */ | ||
33 | tcflag_t c_oflag; /* output mode flags */ | ||
34 | tcflag_t c_cflag; /* control mode flags */ | ||
35 | tcflag_t c_lflag; /* local mode flags */ | ||
36 | cc_t c_line; /* line discipline */ | ||
37 | cc_t c_cc[NCCS]; /* control characters */ | ||
38 | speed_t c_ispeed; /* input speed */ | ||
39 | speed_t c_ospeed; /* output speed */ | ||
40 | }; | ||
41 | |||
20 | /* c_cc characters */ | 42 | /* c_cc characters */ |
21 | #define VINTR 0 | 43 | #define VINTR 0 |
22 | #define VQUIT 1 | 44 | #define VQUIT 1 |
@@ -118,6 +140,7 @@ struct termios { | |||
118 | #define HUPCL 0002000 | 140 | #define HUPCL 0002000 |
119 | #define CLOCAL 0004000 | 141 | #define CLOCAL 0004000 |
120 | #define CBAUDEX 0010000 | 142 | #define CBAUDEX 0010000 |
143 | #define BOTHER 0010000 /* non standard rate */ | ||
121 | #define B57600 0010001 | 144 | #define B57600 0010001 |
122 | #define B115200 0010002 | 145 | #define B115200 0010002 |
123 | #define B230400 0010003 | 146 | #define B230400 0010003 |
@@ -133,10 +156,12 @@ struct termios { | |||
133 | #define B3000000 0010015 | 156 | #define B3000000 0010015 |
134 | #define B3500000 0010016 | 157 | #define B3500000 0010016 |
135 | #define B4000000 0010017 | 158 | #define B4000000 0010017 |
136 | #define CIBAUD 002003600000 /* input baud rate (not used) */ | 159 | #define CIBAUD 002003600000 /* input baud rate */ |
137 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | 160 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ |
138 | #define CRTSCTS 020000000000 /* flow control */ | 161 | #define CRTSCTS 020000000000 /* flow control */ |
139 | 162 | ||
163 | #define IBSHIFT 8 /* Shift from CBAUD to CIBAUD */ | ||
164 | |||
140 | /* c_lflag bits */ | 165 | /* c_lflag bits */ |
141 | #define ISIG 0000001 | 166 | #define ISIG 0000001 |
142 | #define ICANON 0000002 | 167 | #define ICANON 0000002 |
diff --git a/include/asm-x86_64/termios.h b/include/asm-x86_64/termios.h index 041a91f7ddfb..443b225537f0 100644 --- a/include/asm-x86_64/termios.h +++ b/include/asm-x86_64/termios.h | |||
@@ -98,8 +98,10 @@ struct termio { | |||
98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 98 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ |
99 | }) | 99 | }) |
100 | 100 | ||
101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) | 101 | #define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) |
102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) | 102 | #define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) |
103 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | ||
104 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | ||
103 | 105 | ||
104 | #endif /* __KERNEL__ */ | 106 | #endif /* __KERNEL__ */ |
105 | 107 | ||
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h new file mode 100644 index 000000000000..05e540d6963a --- /dev/null +++ b/include/linux/bitrev.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef _LINUX_BITREV_H | ||
2 | #define _LINUX_BITREV_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | extern u8 const byte_rev_table[256]; | ||
7 | |||
8 | static inline u8 bitrev8(u8 byte) | ||
9 | { | ||
10 | return byte_rev_table[byte]; | ||
11 | } | ||
12 | |||
13 | extern u32 bitrev32(u32 in); | ||
14 | |||
15 | #endif /* _LINUX_BITREV_H */ | ||
diff --git a/include/linux/bug.h b/include/linux/bug.h new file mode 100644 index 000000000000..42aa0a54b6f4 --- /dev/null +++ b/include/linux/bug.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef _LINUX_BUG_H | ||
2 | #define _LINUX_BUG_H | ||
3 | |||
4 | #include <linux/module.h> | ||
5 | #include <asm/bug.h> | ||
6 | |||
7 | enum bug_trap_type { | ||
8 | BUG_TRAP_TYPE_NONE = 0, | ||
9 | BUG_TRAP_TYPE_WARN = 1, | ||
10 | BUG_TRAP_TYPE_BUG = 2, | ||
11 | }; | ||
12 | |||
13 | #ifdef CONFIG_GENERIC_BUG | ||
14 | #include <asm-generic/bug.h> | ||
15 | |||
16 | static inline int is_warning_bug(const struct bug_entry *bug) | ||
17 | { | ||
18 | return bug->flags & BUGFLAG_WARNING; | ||
19 | } | ||
20 | |||
21 | const struct bug_entry *find_bug(unsigned long bugaddr); | ||
22 | |||
23 | enum bug_trap_type report_bug(unsigned long bug_addr); | ||
24 | |||
25 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
26 | struct module *); | ||
27 | void module_bug_cleanup(struct module *); | ||
28 | |||
29 | /* These are defined by the architecture */ | ||
30 | int is_valid_bugaddr(unsigned long addr); | ||
31 | |||
32 | #else /* !CONFIG_GENERIC_BUG */ | ||
33 | |||
34 | static inline enum bug_trap_type report_bug(unsigned long bug_addr) | ||
35 | { | ||
36 | return BUG_TRAP_TYPE_BUG; | ||
37 | } | ||
38 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
39 | const Elf_Shdr *sechdrs, | ||
40 | struct module *mod) | ||
41 | { | ||
42 | return 0; | ||
43 | } | ||
44 | static inline void module_bug_cleanup(struct module *mod) {} | ||
45 | |||
46 | #endif /* CONFIG_GENERIC_BUG */ | ||
47 | #endif /* _LINUX_BUG_H */ | ||
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 56c0645789a9..e20dd1f9b40a 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h | |||
@@ -6,10 +6,10 @@ | |||
6 | #define _LINUX_CRC32_H | 6 | #define _LINUX_CRC32_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/bitrev.h> | ||
9 | 10 | ||
10 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); | 11 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); |
11 | extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); | 12 | extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); |
12 | extern u32 bitreverse(u32 in); | ||
13 | 13 | ||
14 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) | 14 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) |
15 | 15 | ||
@@ -21,7 +21,7 @@ extern u32 bitreverse(u32 in); | |||
21 | * is in bit nr 0], thus it must be reversed before use. Except for | 21 | * is in bit nr 0], thus it must be reversed before use. Except for |
22 | * nics that bit swap the result internally... | 22 | * nics that bit swap the result internally... |
23 | */ | 23 | */ |
24 | #define ether_crc(length, data) bitreverse(crc32_le(~0, data, length)) | 24 | #define ether_crc(length, data) bitrev32(crc32_le(~0, data, length)) |
25 | #define ether_crc_le(length, data) crc32_le(~0, data, length) | 25 | #define ether_crc_le(length, data) crc32_le(~0, data, length) |
26 | 26 | ||
27 | #endif /* _LINUX_CRC32_H */ | 27 | #endif /* _LINUX_CRC32_H */ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 03ef41c1eaac..499f5373e213 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -39,7 +39,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); | |||
39 | * The map function must return: | 39 | * The map function must return: |
40 | * < 0: error | 40 | * < 0: error |
41 | * = 0: The target will handle the io by resubmitting it later | 41 | * = 0: The target will handle the io by resubmitting it later |
42 | * > 0: simple remap complete | 42 | * = 1: simple remap complete |
43 | * = 2: The target wants to push back the io | ||
43 | */ | 44 | */ |
44 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | 45 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, |
45 | union map_info *map_context); | 46 | union map_info *map_context); |
@@ -50,6 +51,7 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | |||
50 | * 0 : ended successfully | 51 | * 0 : ended successfully |
51 | * 1 : for some reason the io has still not completed (eg, | 52 | * 1 : for some reason the io has still not completed (eg, |
52 | * multipath target might want to requeue a failed io). | 53 | * multipath target might want to requeue a failed io). |
54 | * 2 : The target wants to push back the io | ||
53 | */ | 55 | */ |
54 | typedef int (*dm_endio_fn) (struct dm_target *ti, | 56 | typedef int (*dm_endio_fn) (struct dm_target *ti, |
55 | struct bio *bio, int error, | 57 | struct bio *bio, int error, |
@@ -173,7 +175,7 @@ void *dm_get_mdptr(struct mapped_device *md); | |||
173 | /* | 175 | /* |
174 | * A device can still be used while suspended, but I/O is deferred. | 176 | * A device can still be used while suspended, but I/O is deferred. |
175 | */ | 177 | */ |
176 | int dm_suspend(struct mapped_device *md, int with_lockfs); | 178 | int dm_suspend(struct mapped_device *md, unsigned suspend_flags); |
177 | int dm_resume(struct mapped_device *md); | 179 | int dm_resume(struct mapped_device *md); |
178 | 180 | ||
179 | /* | 181 | /* |
@@ -188,6 +190,7 @@ int dm_wait_event(struct mapped_device *md, int event_nr); | |||
188 | const char *dm_device_name(struct mapped_device *md); | 190 | const char *dm_device_name(struct mapped_device *md); |
189 | struct gendisk *dm_disk(struct mapped_device *md); | 191 | struct gendisk *dm_disk(struct mapped_device *md); |
190 | int dm_suspended(struct mapped_device *md); | 192 | int dm_suspended(struct mapped_device *md); |
193 | int dm_noflush_suspending(struct dm_target *ti); | ||
191 | 194 | ||
192 | /* | 195 | /* |
193 | * Geometry functions. | 196 | * Geometry functions. |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 8853fc4d1c5e..b93486107821 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 10 | 288 | #define DM_VERSION_MINOR 11 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-10-12)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
@@ -323,4 +323,9 @@ typedef char ioctl_struct[308]; | |||
323 | */ | 323 | */ |
324 | #define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ | 324 | #define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ |
325 | 325 | ||
326 | /* | ||
327 | * Set this to suspend without flushing queued ios. | ||
328 | */ | ||
329 | #define DM_NOFLUSH_FLAG (1 << 11) /* In */ | ||
330 | |||
326 | #endif /* _LINUX_DM_IOCTL_H */ | 331 | #endif /* _LINUX_DM_IOCTL_H */ |
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h new file mode 100644 index 000000000000..32368c4f0326 --- /dev/null +++ b/include/linux/fault-inject.h | |||
@@ -0,0 +1,84 @@ | |||
1 | #ifndef _LINUX_FAULT_INJECT_H | ||
2 | #define _LINUX_FAULT_INJECT_H | ||
3 | |||
4 | #ifdef CONFIG_FAULT_INJECTION | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | #include <linux/debugfs.h> | ||
8 | #include <asm/atomic.h> | ||
9 | |||
10 | /* | ||
11 | * For explanation of the elements of this struct, see | ||
12 | * Documentation/fault-injection/fault-injection.txt | ||
13 | */ | ||
14 | struct fault_attr { | ||
15 | unsigned long probability; | ||
16 | unsigned long interval; | ||
17 | atomic_t times; | ||
18 | atomic_t space; | ||
19 | unsigned long verbose; | ||
20 | u32 task_filter; | ||
21 | unsigned long stacktrace_depth; | ||
22 | unsigned long require_start; | ||
23 | unsigned long require_end; | ||
24 | unsigned long reject_start; | ||
25 | unsigned long reject_end; | ||
26 | |||
27 | unsigned long count; | ||
28 | |||
29 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | ||
30 | |||
31 | struct { | ||
32 | struct dentry *dir; | ||
33 | |||
34 | struct dentry *probability_file; | ||
35 | struct dentry *interval_file; | ||
36 | struct dentry *times_file; | ||
37 | struct dentry *space_file; | ||
38 | struct dentry *verbose_file; | ||
39 | struct dentry *task_filter_file; | ||
40 | struct dentry *stacktrace_depth_file; | ||
41 | struct dentry *require_start_file; | ||
42 | struct dentry *require_end_file; | ||
43 | struct dentry *reject_start_file; | ||
44 | struct dentry *reject_end_file; | ||
45 | } dentries; | ||
46 | |||
47 | #endif | ||
48 | }; | ||
49 | |||
50 | #define FAULT_ATTR_INITIALIZER { \ | ||
51 | .interval = 1, \ | ||
52 | .times = ATOMIC_INIT(1), \ | ||
53 | .require_end = ULONG_MAX, \ | ||
54 | .stacktrace_depth = 32, \ | ||
55 | .verbose = 2, \ | ||
56 | } | ||
57 | |||
58 | #define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER | ||
59 | int setup_fault_attr(struct fault_attr *attr, char *str); | ||
60 | void should_fail_srandom(unsigned long entropy); | ||
61 | bool should_fail(struct fault_attr *attr, ssize_t size); | ||
62 | |||
63 | #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS | ||
64 | |||
65 | int init_fault_attr_dentries(struct fault_attr *attr, const char *name); | ||
66 | void cleanup_fault_attr_dentries(struct fault_attr *attr); | ||
67 | |||
68 | #else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | ||
69 | |||
70 | static inline int init_fault_attr_dentries(struct fault_attr *attr, | ||
71 | const char *name) | ||
72 | { | ||
73 | return -ENODEV; | ||
74 | } | ||
75 | |||
76 | static inline void cleanup_fault_attr_dentries(struct fault_attr *attr) | ||
77 | { | ||
78 | } | ||
79 | |||
80 | #endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ | ||
81 | |||
82 | #endif /* CONFIG_FAULT_INJECTION */ | ||
83 | |||
84 | #endif /* _LINUX_FAULT_INJECT_H */ | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index fa23e0671bb3..6fe56aaa6685 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -970,11 +970,11 @@ extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs, | |||
970 | /* drivers/video/fbcmap.c */ | 970 | /* drivers/video/fbcmap.c */ |
971 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 971 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); |
972 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); | 972 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); |
973 | extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to); | 973 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); |
974 | extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to); | 974 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); |
975 | extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); | 975 | extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); |
976 | extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); | 976 | extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); |
977 | extern struct fb_cmap *fb_default_cmap(int len); | 977 | extern const struct fb_cmap *fb_default_cmap(int len); |
978 | extern void fb_invert_cmaps(void); | 978 | extern void fb_invert_cmaps(void); |
979 | 979 | ||
980 | struct fb_videomode { | 980 | struct fb_videomode { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 70b99fbb560b..adce6e1d70c2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -269,6 +269,7 @@ extern int dir_notify_enable; | |||
269 | #include <linux/types.h> | 269 | #include <linux/types.h> |
270 | #include <linux/kdev_t.h> | 270 | #include <linux/kdev_t.h> |
271 | #include <linux/dcache.h> | 271 | #include <linux/dcache.h> |
272 | #include <linux/namei.h> | ||
272 | #include <linux/stat.h> | 273 | #include <linux/stat.h> |
273 | #include <linux/cache.h> | 274 | #include <linux/cache.h> |
274 | #include <linux/kobject.h> | 275 | #include <linux/kobject.h> |
@@ -482,21 +483,6 @@ struct block_device { | |||
482 | }; | 483 | }; |
483 | 484 | ||
484 | /* | 485 | /* |
485 | * bdev->bd_mutex nesting subclasses for the lock validator: | ||
486 | * | ||
487 | * 0: normal | ||
488 | * 1: 'whole' | ||
489 | * 2: 'partition' | ||
490 | */ | ||
491 | enum bdev_bd_mutex_lock_class | ||
492 | { | ||
493 | BD_MUTEX_NORMAL, | ||
494 | BD_MUTEX_WHOLE, | ||
495 | BD_MUTEX_PARTITION | ||
496 | }; | ||
497 | |||
498 | |||
499 | /* | ||
500 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache | 486 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache |
501 | * radix trees | 487 | * radix trees |
502 | */ | 488 | */ |
@@ -726,8 +712,9 @@ struct file { | |||
726 | struct list_head fu_list; | 712 | struct list_head fu_list; |
727 | struct rcu_head fu_rcuhead; | 713 | struct rcu_head fu_rcuhead; |
728 | } f_u; | 714 | } f_u; |
729 | struct dentry *f_dentry; | 715 | struct path f_path; |
730 | struct vfsmount *f_vfsmnt; | 716 | #define f_dentry f_path.dentry |
717 | #define f_vfsmnt f_path.mnt | ||
731 | const struct file_operations *f_op; | 718 | const struct file_operations *f_op; |
732 | atomic_t f_count; | 719 | atomic_t f_count; |
733 | unsigned int f_flags; | 720 | unsigned int f_flags; |
@@ -1239,7 +1226,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | |||
1239 | static inline void file_accessed(struct file *file) | 1226 | static inline void file_accessed(struct file *file) |
1240 | { | 1227 | { |
1241 | if (!(file->f_flags & O_NOATIME)) | 1228 | if (!(file->f_flags & O_NOATIME)) |
1242 | touch_atime(file->f_vfsmnt, file->f_dentry); | 1229 | touch_atime(file->f_path.mnt, file->f_path.dentry); |
1243 | } | 1230 | } |
1244 | 1231 | ||
1245 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1232 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
@@ -1499,7 +1486,6 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1499 | extern void bd_forget(struct inode *inode); | 1486 | extern void bd_forget(struct inode *inode); |
1500 | extern void bdput(struct block_device *); | 1487 | extern void bdput(struct block_device *); |
1501 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1488 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1502 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | ||
1503 | extern const struct address_space_operations def_blk_aops; | 1489 | extern const struct address_space_operations def_blk_aops; |
1504 | #else | 1490 | #else |
1505 | static inline void bd_forget(struct inode *inode) {} | 1491 | static inline void bd_forget(struct inode *inode) {} |
@@ -1517,7 +1503,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | |||
1517 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1503 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1518 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1504 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1519 | extern int blkdev_put(struct block_device *); | 1505 | extern int blkdev_put(struct block_device *); |
1520 | extern int blkdev_put_partition(struct block_device *); | ||
1521 | extern int bd_claim(struct block_device *, void *); | 1506 | extern int bd_claim(struct block_device *, void *); |
1522 | extern void bd_release(struct block_device *); | 1507 | extern void bd_release(struct block_device *); |
1523 | #ifdef CONFIG_SYSFS | 1508 | #ifdef CONFIG_SYSFS |
@@ -1632,7 +1617,7 @@ static inline void put_write_access(struct inode * inode) | |||
1632 | static inline void allow_write_access(struct file *file) | 1617 | static inline void allow_write_access(struct file *file) |
1633 | { | 1618 | { |
1634 | if (file) | 1619 | if (file) |
1635 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1620 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
1636 | } | 1621 | } |
1637 | extern int do_pipe(int *); | 1622 | extern int do_pipe(int *); |
1638 | extern struct file *create_read_pipe(struct file *f); | 1623 | extern struct file *create_read_pipe(struct file *f); |
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h new file mode 100644 index 000000000000..bb516ceeefc9 --- /dev/null +++ b/include/linux/fs_stack.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _LINUX_FS_STACK_H | ||
2 | #define _LINUX_FS_STACK_H | ||
3 | |||
4 | /* This file defines generic functions used primarily by stackable | ||
5 | * filesystems; none of these functions require i_mutex to be held. | ||
6 | */ | ||
7 | |||
8 | #include <linux/fs.h> | ||
9 | |||
10 | /* externs for fs/stack.c */ | ||
11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src, | ||
12 | int (*get_nlinks)(struct inode *)); | ||
13 | |||
14 | extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src); | ||
15 | |||
16 | /* inlines */ | ||
17 | static inline void fsstack_copy_attr_atime(struct inode *dest, | ||
18 | const struct inode *src) | ||
19 | { | ||
20 | dest->i_atime = src->i_atime; | ||
21 | } | ||
22 | |||
23 | static inline void fsstack_copy_attr_times(struct inode *dest, | ||
24 | const struct inode *src) | ||
25 | { | ||
26 | dest->i_atime = src->i_atime; | ||
27 | dest->i_mtime = src->i_mtime; | ||
28 | dest->i_ctime = src->i_ctime; | ||
29 | } | ||
30 | |||
31 | #endif /* _LINUX_FS_STACK_H */ | ||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index d4f219ffaa5d..dfc4e4f68da4 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
164 | */ | 164 | */ |
165 | static inline void fsnotify_close(struct file *file) | 165 | static inline void fsnotify_close(struct file *file) |
166 | { | 166 | { |
167 | struct dentry *dentry = file->f_dentry; | 167 | struct dentry *dentry = file->f_path.dentry; |
168 | struct inode *inode = dentry->d_inode; | 168 | struct inode *inode = dentry->d_inode; |
169 | const char *name = dentry->d_name.name; | 169 | const char *name = dentry->d_name.name; |
170 | mode_t mode = file->f_mode; | 170 | mode_t mode = file->f_mode; |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index e25384561955..5412da28fa47 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty); | |||
91 | int gs_block_til_ready(void *port, struct file *filp); | 91 | int gs_block_til_ready(void *port, struct file *filp); |
92 | void gs_close(struct tty_struct *tty, struct file *filp); | 92 | void gs_close(struct tty_struct *tty, struct file *filp); |
93 | void gs_set_termios (struct tty_struct * tty, | 93 | void gs_set_termios (struct tty_struct * tty, |
94 | struct termios * old_termios); | 94 | struct ktermios * old_termios); |
95 | int gs_init_port(struct gs_port *port); | 95 | int gs_init_port(struct gs_port *port); |
96 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); | 96 | int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); |
97 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); | 97 | int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 41f276fdd185..0a022b2f63fc 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -83,6 +83,9 @@ struct hd_struct { | |||
83 | struct kobject *holder_dir; | 83 | struct kobject *holder_dir; |
84 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ | 84 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ |
85 | int policy, partno; | 85 | int policy, partno; |
86 | #ifdef CONFIG_FAIL_MAKE_REQUEST | ||
87 | int make_it_fail; | ||
88 | #endif | ||
86 | }; | 89 | }; |
87 | 90 | ||
88 | #define GENHD_FL_REMOVABLE 1 | 91 | #define GENHD_FL_REMOVABLE 1 |
@@ -90,6 +93,7 @@ struct hd_struct { | |||
90 | #define GENHD_FL_CD 8 | 93 | #define GENHD_FL_CD 8 |
91 | #define GENHD_FL_UP 16 | 94 | #define GENHD_FL_UP 16 |
92 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 95 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
96 | #define GENHD_FL_FAIL 64 | ||
93 | 97 | ||
94 | struct disk_stats { | 98 | struct disk_stats { |
95 | unsigned long sectors[2]; /* READs and WRITEs */ | 99 | unsigned long sectors[2]; /* READs and WRITEs */ |
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h new file mode 100644 index 000000000000..f04d6d75c098 --- /dev/null +++ b/include/linux/hid-debug.h | |||
@@ -0,0 +1,757 @@ | |||
1 | /* | ||
2 | * $Id: hid-debug.h,v 1.8 2001/09/25 09:37:57 vojtech Exp $ | ||
3 | * | ||
4 | * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de> | ||
5 | * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz> | ||
6 | * | ||
7 | * Some debug stuff for the HID parser. | ||
8 | */ | ||
9 | |||
10 | /* | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
24 | * | ||
25 | * Should you need to contact me, the author, you can do so either by | ||
26 | * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: | ||
27 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | ||
28 | */ | ||
29 | |||
30 | #include <linux/input.h> | ||
31 | |||
32 | struct hid_usage_entry { | ||
33 | unsigned page; | ||
34 | unsigned usage; | ||
35 | char *description; | ||
36 | }; | ||
37 | |||
38 | static const struct hid_usage_entry hid_usage_table[] = { | ||
39 | { 0, 0, "Undefined" }, | ||
40 | { 1, 0, "GenericDesktop" }, | ||
41 | {0, 0x01, "Pointer"}, | ||
42 | {0, 0x02, "Mouse"}, | ||
43 | {0, 0x04, "Joystick"}, | ||
44 | {0, 0x05, "GamePad"}, | ||
45 | {0, 0x06, "Keyboard"}, | ||
46 | {0, 0x07, "Keypad"}, | ||
47 | {0, 0x08, "MultiAxis"}, | ||
48 | {0, 0x30, "X"}, | ||
49 | {0, 0x31, "Y"}, | ||
50 | {0, 0x32, "Z"}, | ||
51 | {0, 0x33, "Rx"}, | ||
52 | {0, 0x34, "Ry"}, | ||
53 | {0, 0x35, "Rz"}, | ||
54 | {0, 0x36, "Slider"}, | ||
55 | {0, 0x37, "Dial"}, | ||
56 | {0, 0x38, "Wheel"}, | ||
57 | {0, 0x39, "HatSwitch"}, | ||
58 | {0, 0x3a, "CountedBuffer"}, | ||
59 | {0, 0x3b, "ByteCount"}, | ||
60 | {0, 0x3c, "MotionWakeup"}, | ||
61 | {0, 0x3d, "Start"}, | ||
62 | {0, 0x3e, "Select"}, | ||
63 | {0, 0x40, "Vx"}, | ||
64 | {0, 0x41, "Vy"}, | ||
65 | {0, 0x42, "Vz"}, | ||
66 | {0, 0x43, "Vbrx"}, | ||
67 | {0, 0x44, "Vbry"}, | ||
68 | {0, 0x45, "Vbrz"}, | ||
69 | {0, 0x46, "Vno"}, | ||
70 | {0, 0x80, "SystemControl"}, | ||
71 | {0, 0x81, "SystemPowerDown"}, | ||
72 | {0, 0x82, "SystemSleep"}, | ||
73 | {0, 0x83, "SystemWakeUp"}, | ||
74 | {0, 0x84, "SystemContextMenu"}, | ||
75 | {0, 0x85, "SystemMainMenu"}, | ||
76 | {0, 0x86, "SystemAppMenu"}, | ||
77 | {0, 0x87, "SystemMenuHelp"}, | ||
78 | {0, 0x88, "SystemMenuExit"}, | ||
79 | {0, 0x89, "SystemMenuSelect"}, | ||
80 | {0, 0x8a, "SystemMenuRight"}, | ||
81 | {0, 0x8b, "SystemMenuLeft"}, | ||
82 | {0, 0x8c, "SystemMenuUp"}, | ||
83 | {0, 0x8d, "SystemMenuDown"}, | ||
84 | {0, 0x90, "D-PadUp"}, | ||
85 | {0, 0x91, "D-PadDown"}, | ||
86 | {0, 0x92, "D-PadRight"}, | ||
87 | {0, 0x93, "D-PadLeft"}, | ||
88 | { 2, 0, "Simulation" }, | ||
89 | {0, 0xb0, "Aileron"}, | ||
90 | {0, 0xb1, "AileronTrim"}, | ||
91 | {0, 0xb2, "Anti-Torque"}, | ||
92 | {0, 0xb3, "Autopilot"}, | ||
93 | {0, 0xb4, "Chaff"}, | ||
94 | {0, 0xb5, "Collective"}, | ||
95 | {0, 0xb6, "DiveBrake"}, | ||
96 | {0, 0xb7, "ElectronicCountermeasures"}, | ||
97 | {0, 0xb8, "Elevator"}, | ||
98 | {0, 0xb9, "ElevatorTrim"}, | ||
99 | {0, 0xba, "Rudder"}, | ||
100 | {0, 0xbb, "Throttle"}, | ||
101 | {0, 0xbc, "FlightCommunications"}, | ||
102 | {0, 0xbd, "FlareRelease"}, | ||
103 | {0, 0xbe, "LandingGear"}, | ||
104 | {0, 0xbf, "ToeBrake"}, | ||
105 | { 7, 0, "Keyboard" }, | ||
106 | { 8, 0, "LED" }, | ||
107 | {0, 0x01, "NumLock"}, | ||
108 | {0, 0x02, "CapsLock"}, | ||
109 | {0, 0x03, "ScrollLock"}, | ||
110 | {0, 0x04, "Compose"}, | ||
111 | {0, 0x05, "Kana"}, | ||
112 | {0, 0x4b, "GenericIndicator"}, | ||
113 | { 9, 0, "Button" }, | ||
114 | { 10, 0, "Ordinal" }, | ||
115 | { 12, 0, "Consumer" }, | ||
116 | {0, 0x238, "HorizontalWheel"}, | ||
117 | { 13, 0, "Digitizers" }, | ||
118 | {0, 0x01, "Digitizer"}, | ||
119 | {0, 0x02, "Pen"}, | ||
120 | {0, 0x03, "LightPen"}, | ||
121 | {0, 0x04, "TouchScreen"}, | ||
122 | {0, 0x05, "TouchPad"}, | ||
123 | {0, 0x20, "Stylus"}, | ||
124 | {0, 0x21, "Puck"}, | ||
125 | {0, 0x22, "Finger"}, | ||
126 | {0, 0x30, "TipPressure"}, | ||
127 | {0, 0x31, "BarrelPressure"}, | ||
128 | {0, 0x32, "InRange"}, | ||
129 | {0, 0x33, "Touch"}, | ||
130 | {0, 0x34, "UnTouch"}, | ||
131 | {0, 0x35, "Tap"}, | ||
132 | {0, 0x39, "TabletFunctionKey"}, | ||
133 | {0, 0x3a, "ProgramChangeKey"}, | ||
134 | {0, 0x3c, "Invert"}, | ||
135 | {0, 0x42, "TipSwitch"}, | ||
136 | {0, 0x43, "SecondaryTipSwitch"}, | ||
137 | {0, 0x44, "BarrelSwitch"}, | ||
138 | {0, 0x45, "Eraser"}, | ||
139 | {0, 0x46, "TabletPick"}, | ||
140 | { 15, 0, "PhysicalInterfaceDevice" }, | ||
141 | {0, 0x00, "Undefined"}, | ||
142 | {0, 0x01, "Physical_Interface_Device"}, | ||
143 | {0, 0x20, "Normal"}, | ||
144 | {0, 0x21, "Set_Effect_Report"}, | ||
145 | {0, 0x22, "Effect_Block_Index"}, | ||
146 | {0, 0x23, "Parameter_Block_Offset"}, | ||
147 | {0, 0x24, "ROM_Flag"}, | ||
148 | {0, 0x25, "Effect_Type"}, | ||
149 | {0, 0x26, "ET_Constant_Force"}, | ||
150 | {0, 0x27, "ET_Ramp"}, | ||
151 | {0, 0x28, "ET_Custom_Force_Data"}, | ||
152 | {0, 0x30, "ET_Square"}, | ||
153 | {0, 0x31, "ET_Sine"}, | ||
154 | {0, 0x32, "ET_Triangle"}, | ||
155 | {0, 0x33, "ET_Sawtooth_Up"}, | ||
156 | {0, 0x34, "ET_Sawtooth_Down"}, | ||
157 | {0, 0x40, "ET_Spring"}, | ||
158 | {0, 0x41, "ET_Damper"}, | ||
159 | {0, 0x42, "ET_Inertia"}, | ||
160 | {0, 0x43, "ET_Friction"}, | ||
161 | {0, 0x50, "Duration"}, | ||
162 | {0, 0x51, "Sample_Period"}, | ||
163 | {0, 0x52, "Gain"}, | ||
164 | {0, 0x53, "Trigger_Button"}, | ||
165 | {0, 0x54, "Trigger_Repeat_Interval"}, | ||
166 | {0, 0x55, "Axes_Enable"}, | ||
167 | {0, 0x56, "Direction_Enable"}, | ||
168 | {0, 0x57, "Direction"}, | ||
169 | {0, 0x58, "Type_Specific_Block_Offset"}, | ||
170 | {0, 0x59, "Block_Type"}, | ||
171 | {0, 0x5A, "Set_Envelope_Report"}, | ||
172 | {0, 0x5B, "Attack_Level"}, | ||
173 | {0, 0x5C, "Attack_Time"}, | ||
174 | {0, 0x5D, "Fade_Level"}, | ||
175 | {0, 0x5E, "Fade_Time"}, | ||
176 | {0, 0x5F, "Set_Condition_Report"}, | ||
177 | {0, 0x60, "CP_Offset"}, | ||
178 | {0, 0x61, "Positive_Coefficient"}, | ||
179 | {0, 0x62, "Negative_Coefficient"}, | ||
180 | {0, 0x63, "Positive_Saturation"}, | ||
181 | {0, 0x64, "Negative_Saturation"}, | ||
182 | {0, 0x65, "Dead_Band"}, | ||
183 | {0, 0x66, "Download_Force_Sample"}, | ||
184 | {0, 0x67, "Isoch_Custom_Force_Enable"}, | ||
185 | {0, 0x68, "Custom_Force_Data_Report"}, | ||
186 | {0, 0x69, "Custom_Force_Data"}, | ||
187 | {0, 0x6A, "Custom_Force_Vendor_Defined_Data"}, | ||
188 | {0, 0x6B, "Set_Custom_Force_Report"}, | ||
189 | {0, 0x6C, "Custom_Force_Data_Offset"}, | ||
190 | {0, 0x6D, "Sample_Count"}, | ||
191 | {0, 0x6E, "Set_Periodic_Report"}, | ||
192 | {0, 0x6F, "Offset"}, | ||
193 | {0, 0x70, "Magnitude"}, | ||
194 | {0, 0x71, "Phase"}, | ||
195 | {0, 0x72, "Period"}, | ||
196 | {0, 0x73, "Set_Constant_Force_Report"}, | ||
197 | {0, 0x74, "Set_Ramp_Force_Report"}, | ||
198 | {0, 0x75, "Ramp_Start"}, | ||
199 | {0, 0x76, "Ramp_End"}, | ||
200 | {0, 0x77, "Effect_Operation_Report"}, | ||
201 | {0, 0x78, "Effect_Operation"}, | ||
202 | {0, 0x79, "Op_Effect_Start"}, | ||
203 | {0, 0x7A, "Op_Effect_Start_Solo"}, | ||
204 | {0, 0x7B, "Op_Effect_Stop"}, | ||
205 | {0, 0x7C, "Loop_Count"}, | ||
206 | {0, 0x7D, "Device_Gain_Report"}, | ||
207 | {0, 0x7E, "Device_Gain"}, | ||
208 | {0, 0x7F, "PID_Pool_Report"}, | ||
209 | {0, 0x80, "RAM_Pool_Size"}, | ||
210 | {0, 0x81, "ROM_Pool_Size"}, | ||
211 | {0, 0x82, "ROM_Effect_Block_Count"}, | ||
212 | {0, 0x83, "Simultaneous_Effects_Max"}, | ||
213 | {0, 0x84, "Pool_Alignment"}, | ||
214 | {0, 0x85, "PID_Pool_Move_Report"}, | ||
215 | {0, 0x86, "Move_Source"}, | ||
216 | {0, 0x87, "Move_Destination"}, | ||
217 | {0, 0x88, "Move_Length"}, | ||
218 | {0, 0x89, "PID_Block_Load_Report"}, | ||
219 | {0, 0x8B, "Block_Load_Status"}, | ||
220 | {0, 0x8C, "Block_Load_Success"}, | ||
221 | {0, 0x8D, "Block_Load_Full"}, | ||
222 | {0, 0x8E, "Block_Load_Error"}, | ||
223 | {0, 0x8F, "Block_Handle"}, | ||
224 | {0, 0x90, "PID_Block_Free_Report"}, | ||
225 | {0, 0x91, "Type_Specific_Block_Handle"}, | ||
226 | {0, 0x92, "PID_State_Report"}, | ||
227 | {0, 0x94, "Effect_Playing"}, | ||
228 | {0, 0x95, "PID_Device_Control_Report"}, | ||
229 | {0, 0x96, "PID_Device_Control"}, | ||
230 | {0, 0x97, "DC_Enable_Actuators"}, | ||
231 | {0, 0x98, "DC_Disable_Actuators"}, | ||
232 | {0, 0x99, "DC_Stop_All_Effects"}, | ||
233 | {0, 0x9A, "DC_Device_Reset"}, | ||
234 | {0, 0x9B, "DC_Device_Pause"}, | ||
235 | {0, 0x9C, "DC_Device_Continue"}, | ||
236 | {0, 0x9F, "Device_Paused"}, | ||
237 | {0, 0xA0, "Actuators_Enabled"}, | ||
238 | {0, 0xA4, "Safety_Switch"}, | ||
239 | {0, 0xA5, "Actuator_Override_Switch"}, | ||
240 | {0, 0xA6, "Actuator_Power"}, | ||
241 | {0, 0xA7, "Start_Delay"}, | ||
242 | {0, 0xA8, "Parameter_Block_Size"}, | ||
243 | {0, 0xA9, "Device_Managed_Pool"}, | ||
244 | {0, 0xAA, "Shared_Parameter_Blocks"}, | ||
245 | {0, 0xAB, "Create_New_Effect_Report"}, | ||
246 | {0, 0xAC, "RAM_Pool_Available"}, | ||
247 | { 0x84, 0, "Power Device" }, | ||
248 | { 0x84, 0x02, "PresentStatus" }, | ||
249 | { 0x84, 0x03, "ChangeStatus" }, | ||
250 | { 0x84, 0x04, "UPS" }, | ||
251 | { 0x84, 0x05, "PowerSupply" }, | ||
252 | { 0x84, 0x10, "BatterySystem" }, | ||
253 | { 0x84, 0x11, "BatterySystemID" }, | ||
254 | { 0x84, 0x12, "Battery" }, | ||
255 | { 0x84, 0x13, "BatteryID" }, | ||
256 | { 0x84, 0x14, "Charger" }, | ||
257 | { 0x84, 0x15, "ChargerID" }, | ||
258 | { 0x84, 0x16, "PowerConverter" }, | ||
259 | { 0x84, 0x17, "PowerConverterID" }, | ||
260 | { 0x84, 0x18, "OutletSystem" }, | ||
261 | { 0x84, 0x19, "OutletSystemID" }, | ||
262 | { 0x84, 0x1a, "Input" }, | ||
263 | { 0x84, 0x1b, "InputID" }, | ||
264 | { 0x84, 0x1c, "Output" }, | ||
265 | { 0x84, 0x1d, "OutputID" }, | ||
266 | { 0x84, 0x1e, "Flow" }, | ||
267 | { 0x84, 0x1f, "FlowID" }, | ||
268 | { 0x84, 0x20, "Outlet" }, | ||
269 | { 0x84, 0x21, "OutletID" }, | ||
270 | { 0x84, 0x22, "Gang" }, | ||
271 | { 0x84, 0x24, "PowerSummary" }, | ||
272 | { 0x84, 0x25, "PowerSummaryID" }, | ||
273 | { 0x84, 0x30, "Voltage" }, | ||
274 | { 0x84, 0x31, "Current" }, | ||
275 | { 0x84, 0x32, "Frequency" }, | ||
276 | { 0x84, 0x33, "ApparentPower" }, | ||
277 | { 0x84, 0x35, "PercentLoad" }, | ||
278 | { 0x84, 0x40, "ConfigVoltage" }, | ||
279 | { 0x84, 0x41, "ConfigCurrent" }, | ||
280 | { 0x84, 0x43, "ConfigApparentPower" }, | ||
281 | { 0x84, 0x53, "LowVoltageTransfer" }, | ||
282 | { 0x84, 0x54, "HighVoltageTransfer" }, | ||
283 | { 0x84, 0x56, "DelayBeforeStartup" }, | ||
284 | { 0x84, 0x57, "DelayBeforeShutdown" }, | ||
285 | { 0x84, 0x58, "Test" }, | ||
286 | { 0x84, 0x5a, "AudibleAlarmControl" }, | ||
287 | { 0x84, 0x60, "Present" }, | ||
288 | { 0x84, 0x61, "Good" }, | ||
289 | { 0x84, 0x62, "InternalFailure" }, | ||
290 | { 0x84, 0x65, "Overload" }, | ||
291 | { 0x84, 0x66, "OverCharged" }, | ||
292 | { 0x84, 0x67, "OverTemperature" }, | ||
293 | { 0x84, 0x68, "ShutdownRequested" }, | ||
294 | { 0x84, 0x69, "ShutdownImminent" }, | ||
295 | { 0x84, 0x6b, "SwitchOn/Off" }, | ||
296 | { 0x84, 0x6c, "Switchable" }, | ||
297 | { 0x84, 0x6d, "Used" }, | ||
298 | { 0x84, 0x6e, "Boost" }, | ||
299 | { 0x84, 0x73, "CommunicationLost" }, | ||
300 | { 0x84, 0xfd, "iManufacturer" }, | ||
301 | { 0x84, 0xfe, "iProduct" }, | ||
302 | { 0x84, 0xff, "iSerialNumber" }, | ||
303 | { 0x85, 0, "Battery System" }, | ||
304 | { 0x85, 0x01, "SMBBatteryMode" }, | ||
305 | { 0x85, 0x02, "SMBBatteryStatus" }, | ||
306 | { 0x85, 0x03, "SMBAlarmWarning" }, | ||
307 | { 0x85, 0x04, "SMBChargerMode" }, | ||
308 | { 0x85, 0x05, "SMBChargerStatus" }, | ||
309 | { 0x85, 0x06, "SMBChargerSpecInfo" }, | ||
310 | { 0x85, 0x07, "SMBSelectorState" }, | ||
311 | { 0x85, 0x08, "SMBSelectorPresets" }, | ||
312 | { 0x85, 0x09, "SMBSelectorInfo" }, | ||
313 | { 0x85, 0x29, "RemainingCapacityLimit" }, | ||
314 | { 0x85, 0x2c, "CapacityMode" }, | ||
315 | { 0x85, 0x42, "BelowRemainingCapacityLimit" }, | ||
316 | { 0x85, 0x44, "Charging" }, | ||
317 | { 0x85, 0x45, "Discharging" }, | ||
318 | { 0x85, 0x4b, "NeedReplacement" }, | ||
319 | { 0x85, 0x66, "RemainingCapacity" }, | ||
320 | { 0x85, 0x68, "RunTimeToEmpty" }, | ||
321 | { 0x85, 0x6a, "AverageTimeToFull" }, | ||
322 | { 0x85, 0x83, "DesignCapacity" }, | ||
323 | { 0x85, 0x85, "ManufacturerDate" }, | ||
324 | { 0x85, 0x89, "iDeviceChemistry" }, | ||
325 | { 0x85, 0x8b, "Rechargable" }, | ||
326 | { 0x85, 0x8f, "iOEMInformation" }, | ||
327 | { 0x85, 0x8d, "CapacityGranularity1" }, | ||
328 | { 0x85, 0xd0, "ACPresent" }, | ||
329 | /* pages 0xff00 to 0xffff are vendor-specific */ | ||
330 | { 0xffff, 0, "Vendor-specific-FF" }, | ||
331 | { 0, 0, NULL } | ||
332 | }; | ||
333 | |||
334 | static void resolv_usage_page(unsigned page) { | ||
335 | const struct hid_usage_entry *p; | ||
336 | |||
337 | for (p = hid_usage_table; p->description; p++) | ||
338 | if (p->page == page) { | ||
339 | printk("%s", p->description); | ||
340 | return; | ||
341 | } | ||
342 | printk("%04x", page); | ||
343 | } | ||
344 | |||
345 | static void resolv_usage(unsigned usage) { | ||
346 | const struct hid_usage_entry *p; | ||
347 | |||
348 | resolv_usage_page(usage >> 16); | ||
349 | printk("."); | ||
350 | for (p = hid_usage_table; p->description; p++) | ||
351 | if (p->page == (usage >> 16)) { | ||
352 | for(++p; p->description && p->usage != 0; p++) | ||
353 | if (p->usage == (usage & 0xffff)) { | ||
354 | printk("%s", p->description); | ||
355 | return; | ||
356 | } | ||
357 | break; | ||
358 | } | ||
359 | printk("%04x", usage & 0xffff); | ||
360 | } | ||
361 | |||
362 | __inline__ static void tab(int n) { | ||
363 | while (n--) printk(" "); | ||
364 | } | ||
365 | |||
366 | static void hid_dump_field(struct hid_field *field, int n) { | ||
367 | int j; | ||
368 | |||
369 | if (field->physical) { | ||
370 | tab(n); | ||
371 | printk("Physical("); | ||
372 | resolv_usage(field->physical); printk(")\n"); | ||
373 | } | ||
374 | if (field->logical) { | ||
375 | tab(n); | ||
376 | printk("Logical("); | ||
377 | resolv_usage(field->logical); printk(")\n"); | ||
378 | } | ||
379 | tab(n); printk("Usage(%d)\n", field->maxusage); | ||
380 | for (j = 0; j < field->maxusage; j++) { | ||
381 | tab(n+2);resolv_usage(field->usage[j].hid); printk("\n"); | ||
382 | } | ||
383 | if (field->logical_minimum != field->logical_maximum) { | ||
384 | tab(n); printk("Logical Minimum(%d)\n", field->logical_minimum); | ||
385 | tab(n); printk("Logical Maximum(%d)\n", field->logical_maximum); | ||
386 | } | ||
387 | if (field->physical_minimum != field->physical_maximum) { | ||
388 | tab(n); printk("Physical Minimum(%d)\n", field->physical_minimum); | ||
389 | tab(n); printk("Physical Maximum(%d)\n", field->physical_maximum); | ||
390 | } | ||
391 | if (field->unit_exponent) { | ||
392 | tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent); | ||
393 | } | ||
394 | if (field->unit) { | ||
395 | char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" }; | ||
396 | char *units[5][8] = { | ||
397 | { "None", "None", "None", "None", "None", "None", "None", "None" }, | ||
398 | { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | ||
399 | { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | ||
400 | { "None", "Inch", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" }, | ||
401 | { "None", "Degrees", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" } | ||
402 | }; | ||
403 | |||
404 | int i; | ||
405 | int sys; | ||
406 | __u32 data = field->unit; | ||
407 | |||
408 | /* First nibble tells us which system we're in. */ | ||
409 | sys = data & 0xf; | ||
410 | data >>= 4; | ||
411 | |||
412 | if(sys > 4) { | ||
413 | tab(n); printk("Unit(Invalid)\n"); | ||
414 | } | ||
415 | else { | ||
416 | int earlier_unit = 0; | ||
417 | |||
418 | tab(n); printk("Unit(%s : ", systems[sys]); | ||
419 | |||
420 | for (i=1 ; i<sizeof(__u32)*2 ; i++) { | ||
421 | char nibble = data & 0xf; | ||
422 | data >>= 4; | ||
423 | if (nibble != 0) { | ||
424 | if(earlier_unit++ > 0) | ||
425 | printk("*"); | ||
426 | printk("%s", units[sys][i]); | ||
427 | if(nibble != 1) { | ||
428 | /* This is a _signed_ nibble(!) */ | ||
429 | |||
430 | int val = nibble & 0x7; | ||
431 | if(nibble & 0x08) | ||
432 | val = -((0x7 & ~val) +1); | ||
433 | printk("^%d", val); | ||
434 | } | ||
435 | } | ||
436 | } | ||
437 | printk(")\n"); | ||
438 | } | ||
439 | } | ||
440 | tab(n); printk("Report Size(%u)\n", field->report_size); | ||
441 | tab(n); printk("Report Count(%u)\n", field->report_count); | ||
442 | tab(n); printk("Report Offset(%u)\n", field->report_offset); | ||
443 | |||
444 | tab(n); printk("Flags( "); | ||
445 | j = field->flags; | ||
446 | printk("%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : ""); | ||
447 | printk("%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array "); | ||
448 | printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute "); | ||
449 | printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : ""); | ||
450 | printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : ""); | ||
451 | printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : ""); | ||
452 | printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : ""); | ||
453 | printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : ""); | ||
454 | printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); | ||
455 | printk(")\n"); | ||
456 | } | ||
457 | |||
458 | static void __attribute__((unused)) hid_dump_device(struct hid_device *device) { | ||
459 | struct hid_report_enum *report_enum; | ||
460 | struct hid_report *report; | ||
461 | struct list_head *list; | ||
462 | unsigned i,k; | ||
463 | static char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; | ||
464 | |||
465 | for (i = 0; i < HID_REPORT_TYPES; i++) { | ||
466 | report_enum = device->report_enum + i; | ||
467 | list = report_enum->report_list.next; | ||
468 | while (list != &report_enum->report_list) { | ||
469 | report = (struct hid_report *) list; | ||
470 | tab(2); | ||
471 | printk("%s", table[i]); | ||
472 | if (report->id) | ||
473 | printk("(%d)", report->id); | ||
474 | printk("[%s]", table[report->type]); | ||
475 | printk("\n"); | ||
476 | for (k = 0; k < report->maxfield; k++) { | ||
477 | tab(4); | ||
478 | printk("Field(%d)\n", k); | ||
479 | hid_dump_field(report->field[k], 6); | ||
480 | } | ||
481 | list = list->next; | ||
482 | } | ||
483 | } | ||
484 | } | ||
485 | |||
486 | static void __attribute__((unused)) hid_dump_input(struct hid_usage *usage, __s32 value) { | ||
487 | printk("hid-debug: input "); | ||
488 | resolv_usage(usage->hid); | ||
489 | printk(" = %d\n", value); | ||
490 | } | ||
491 | |||
492 | |||
493 | static char *events[EV_MAX + 1] = { | ||
494 | [EV_SYN] = "Sync", [EV_KEY] = "Key", | ||
495 | [EV_REL] = "Relative", [EV_ABS] = "Absolute", | ||
496 | [EV_MSC] = "Misc", [EV_LED] = "LED", | ||
497 | [EV_SND] = "Sound", [EV_REP] = "Repeat", | ||
498 | [EV_FF] = "ForceFeedback", [EV_PWR] = "Power", | ||
499 | [EV_FF_STATUS] = "ForceFeedbackStatus", | ||
500 | }; | ||
501 | |||
502 | static char *syncs[2] = { | ||
503 | [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config", | ||
504 | }; | ||
505 | static char *keys[KEY_MAX + 1] = { | ||
506 | [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc", | ||
507 | [KEY_1] = "1", [KEY_2] = "2", | ||
508 | [KEY_3] = "3", [KEY_4] = "4", | ||
509 | [KEY_5] = "5", [KEY_6] = "6", | ||
510 | [KEY_7] = "7", [KEY_8] = "8", | ||
511 | [KEY_9] = "9", [KEY_0] = "0", | ||
512 | [KEY_MINUS] = "Minus", [KEY_EQUAL] = "Equal", | ||
513 | [KEY_BACKSPACE] = "Backspace", [KEY_TAB] = "Tab", | ||
514 | [KEY_Q] = "Q", [KEY_W] = "W", | ||
515 | [KEY_E] = "E", [KEY_R] = "R", | ||
516 | [KEY_T] = "T", [KEY_Y] = "Y", | ||
517 | [KEY_U] = "U", [KEY_I] = "I", | ||
518 | [KEY_O] = "O", [KEY_P] = "P", | ||
519 | [KEY_LEFTBRACE] = "LeftBrace", [KEY_RIGHTBRACE] = "RightBrace", | ||
520 | [KEY_ENTER] = "Enter", [KEY_LEFTCTRL] = "LeftControl", | ||
521 | [KEY_A] = "A", [KEY_S] = "S", | ||
522 | [KEY_D] = "D", [KEY_F] = "F", | ||
523 | [KEY_G] = "G", [KEY_H] = "H", | ||
524 | [KEY_J] = "J", [KEY_K] = "K", | ||
525 | [KEY_L] = "L", [KEY_SEMICOLON] = "Semicolon", | ||
526 | [KEY_APOSTROPHE] = "Apostrophe", [KEY_GRAVE] = "Grave", | ||
527 | [KEY_LEFTSHIFT] = "LeftShift", [KEY_BACKSLASH] = "BackSlash", | ||
528 | [KEY_Z] = "Z", [KEY_X] = "X", | ||
529 | [KEY_C] = "C", [KEY_V] = "V", | ||
530 | [KEY_B] = "B", [KEY_N] = "N", | ||
531 | [KEY_M] = "M", [KEY_COMMA] = "Comma", | ||
532 | [KEY_DOT] = "Dot", [KEY_SLASH] = "Slash", | ||
533 | [KEY_RIGHTSHIFT] = "RightShift", [KEY_KPASTERISK] = "KPAsterisk", | ||
534 | [KEY_LEFTALT] = "LeftAlt", [KEY_SPACE] = "Space", | ||
535 | [KEY_CAPSLOCK] = "CapsLock", [KEY_F1] = "F1", | ||
536 | [KEY_F2] = "F2", [KEY_F3] = "F3", | ||
537 | [KEY_F4] = "F4", [KEY_F5] = "F5", | ||
538 | [KEY_F6] = "F6", [KEY_F7] = "F7", | ||
539 | [KEY_F8] = "F8", [KEY_F9] = "F9", | ||
540 | [KEY_F10] = "F10", [KEY_NUMLOCK] = "NumLock", | ||
541 | [KEY_SCROLLLOCK] = "ScrollLock", [KEY_KP7] = "KP7", | ||
542 | [KEY_KP8] = "KP8", [KEY_KP9] = "KP9", | ||
543 | [KEY_KPMINUS] = "KPMinus", [KEY_KP4] = "KP4", | ||
544 | [KEY_KP5] = "KP5", [KEY_KP6] = "KP6", | ||
545 | [KEY_KPPLUS] = "KPPlus", [KEY_KP1] = "KP1", | ||
546 | [KEY_KP2] = "KP2", [KEY_KP3] = "KP3", | ||
547 | [KEY_KP0] = "KP0", [KEY_KPDOT] = "KPDot", | ||
548 | [KEY_ZENKAKUHANKAKU] = "Zenkaku/Hankaku", [KEY_102ND] = "102nd", | ||
549 | [KEY_F11] = "F11", [KEY_F12] = "F12", | ||
550 | [KEY_RO] = "RO", [KEY_KATAKANA] = "Katakana", | ||
551 | [KEY_HIRAGANA] = "HIRAGANA", [KEY_HENKAN] = "Henkan", | ||
552 | [KEY_KATAKANAHIRAGANA] = "Katakana/Hiragana", [KEY_MUHENKAN] = "Muhenkan", | ||
553 | [KEY_KPJPCOMMA] = "KPJpComma", [KEY_KPENTER] = "KPEnter", | ||
554 | [KEY_RIGHTCTRL] = "RightCtrl", [KEY_KPSLASH] = "KPSlash", | ||
555 | [KEY_SYSRQ] = "SysRq", [KEY_RIGHTALT] = "RightAlt", | ||
556 | [KEY_LINEFEED] = "LineFeed", [KEY_HOME] = "Home", | ||
557 | [KEY_UP] = "Up", [KEY_PAGEUP] = "PageUp", | ||
558 | [KEY_LEFT] = "Left", [KEY_RIGHT] = "Right", | ||
559 | [KEY_END] = "End", [KEY_DOWN] = "Down", | ||
560 | [KEY_PAGEDOWN] = "PageDown", [KEY_INSERT] = "Insert", | ||
561 | [KEY_DELETE] = "Delete", [KEY_MACRO] = "Macro", | ||
562 | [KEY_MUTE] = "Mute", [KEY_VOLUMEDOWN] = "VolumeDown", | ||
563 | [KEY_VOLUMEUP] = "VolumeUp", [KEY_POWER] = "Power", | ||
564 | [KEY_KPEQUAL] = "KPEqual", [KEY_KPPLUSMINUS] = "KPPlusMinus", | ||
565 | [KEY_PAUSE] = "Pause", [KEY_KPCOMMA] = "KPComma", | ||
566 | [KEY_HANGUEL] = "Hangeul", [KEY_HANJA] = "Hanja", | ||
567 | [KEY_YEN] = "Yen", [KEY_LEFTMETA] = "LeftMeta", | ||
568 | [KEY_RIGHTMETA] = "RightMeta", [KEY_COMPOSE] = "Compose", | ||
569 | [KEY_STOP] = "Stop", [KEY_AGAIN] = "Again", | ||
570 | [KEY_PROPS] = "Props", [KEY_UNDO] = "Undo", | ||
571 | [KEY_FRONT] = "Front", [KEY_COPY] = "Copy", | ||
572 | [KEY_OPEN] = "Open", [KEY_PASTE] = "Paste", | ||
573 | [KEY_FIND] = "Find", [KEY_CUT] = "Cut", | ||
574 | [KEY_HELP] = "Help", [KEY_MENU] = "Menu", | ||
575 | [KEY_CALC] = "Calc", [KEY_SETUP] = "Setup", | ||
576 | [KEY_SLEEP] = "Sleep", [KEY_WAKEUP] = "WakeUp", | ||
577 | [KEY_FILE] = "File", [KEY_SENDFILE] = "SendFile", | ||
578 | [KEY_DELETEFILE] = "DeleteFile", [KEY_XFER] = "X-fer", | ||
579 | [KEY_PROG1] = "Prog1", [KEY_PROG2] = "Prog2", | ||
580 | [KEY_WWW] = "WWW", [KEY_MSDOS] = "MSDOS", | ||
581 | [KEY_COFFEE] = "Coffee", [KEY_DIRECTION] = "Direction", | ||
582 | [KEY_CYCLEWINDOWS] = "CycleWindows", [KEY_MAIL] = "Mail", | ||
583 | [KEY_BOOKMARKS] = "Bookmarks", [KEY_COMPUTER] = "Computer", | ||
584 | [KEY_BACK] = "Back", [KEY_FORWARD] = "Forward", | ||
585 | [KEY_CLOSECD] = "CloseCD", [KEY_EJECTCD] = "EjectCD", | ||
586 | [KEY_EJECTCLOSECD] = "EjectCloseCD", [KEY_NEXTSONG] = "NextSong", | ||
587 | [KEY_PLAYPAUSE] = "PlayPause", [KEY_PREVIOUSSONG] = "PreviousSong", | ||
588 | [KEY_STOPCD] = "StopCD", [KEY_RECORD] = "Record", | ||
589 | [KEY_REWIND] = "Rewind", [KEY_PHONE] = "Phone", | ||
590 | [KEY_ISO] = "ISOKey", [KEY_CONFIG] = "Config", | ||
591 | [KEY_HOMEPAGE] = "HomePage", [KEY_REFRESH] = "Refresh", | ||
592 | [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", | ||
593 | [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", | ||
594 | [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", | ||
595 | [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New", | ||
596 | [KEY_REDO] = "Redo", [KEY_F13] = "F13", | ||
597 | [KEY_F14] = "F14", [KEY_F15] = "F15", | ||
598 | [KEY_F16] = "F16", [KEY_F17] = "F17", | ||
599 | [KEY_F18] = "F18", [KEY_F19] = "F19", | ||
600 | [KEY_F20] = "F20", [KEY_F21] = "F21", | ||
601 | [KEY_F22] = "F22", [KEY_F23] = "F23", | ||
602 | [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD", | ||
603 | [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", | ||
604 | [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", | ||
605 | [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", | ||
606 | [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost", | ||
607 | [KEY_PRINT] = "Print", [KEY_HP] = "HP", | ||
608 | [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", | ||
609 | [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", | ||
610 | [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", | ||
611 | [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", | ||
612 | [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", | ||
613 | [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel", | ||
614 | [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp", | ||
615 | [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", | ||
616 | [BTN_0] = "Btn0", [BTN_1] = "Btn1", | ||
617 | [BTN_2] = "Btn2", [BTN_3] = "Btn3", | ||
618 | [BTN_4] = "Btn4", [BTN_5] = "Btn5", | ||
619 | [BTN_6] = "Btn6", [BTN_7] = "Btn7", | ||
620 | [BTN_8] = "Btn8", [BTN_9] = "Btn9", | ||
621 | [BTN_LEFT] = "LeftBtn", [BTN_RIGHT] = "RightBtn", | ||
622 | [BTN_MIDDLE] = "MiddleBtn", [BTN_SIDE] = "SideBtn", | ||
623 | [BTN_EXTRA] = "ExtraBtn", [BTN_FORWARD] = "ForwardBtn", | ||
624 | [BTN_BACK] = "BackBtn", [BTN_TASK] = "TaskBtn", | ||
625 | [BTN_TRIGGER] = "Trigger", [BTN_THUMB] = "ThumbBtn", | ||
626 | [BTN_THUMB2] = "ThumbBtn2", [BTN_TOP] = "TopBtn", | ||
627 | [BTN_TOP2] = "TopBtn2", [BTN_PINKIE] = "PinkieBtn", | ||
628 | [BTN_BASE] = "BaseBtn", [BTN_BASE2] = "BaseBtn2", | ||
629 | [BTN_BASE3] = "BaseBtn3", [BTN_BASE4] = "BaseBtn4", | ||
630 | [BTN_BASE5] = "BaseBtn5", [BTN_BASE6] = "BaseBtn6", | ||
631 | [BTN_DEAD] = "BtnDead", [BTN_A] = "BtnA", | ||
632 | [BTN_B] = "BtnB", [BTN_C] = "BtnC", | ||
633 | [BTN_X] = "BtnX", [BTN_Y] = "BtnY", | ||
634 | [BTN_Z] = "BtnZ", [BTN_TL] = "BtnTL", | ||
635 | [BTN_TR] = "BtnTR", [BTN_TL2] = "BtnTL2", | ||
636 | [BTN_TR2] = "BtnTR2", [BTN_SELECT] = "BtnSelect", | ||
637 | [BTN_START] = "BtnStart", [BTN_MODE] = "BtnMode", | ||
638 | [BTN_THUMBL] = "BtnThumbL", [BTN_THUMBR] = "BtnThumbR", | ||
639 | [BTN_TOOL_PEN] = "ToolPen", [BTN_TOOL_RUBBER] = "ToolRubber", | ||
640 | [BTN_TOOL_BRUSH] = "ToolBrush", [BTN_TOOL_PENCIL] = "ToolPencil", | ||
641 | [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", | ||
642 | [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", | ||
643 | [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", | ||
644 | [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap", | ||
645 | [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn", | ||
646 | [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", | ||
647 | [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", | ||
648 | [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", | ||
649 | [KEY_OPTION] = "Option", [KEY_INFO] = "Info", | ||
650 | [KEY_TIME] = "Time", [KEY_VENDOR] = "Vendor", | ||
651 | [KEY_ARCHIVE] = "Archive", [KEY_PROGRAM] = "Program", | ||
652 | [KEY_CHANNEL] = "Channel", [KEY_FAVORITES] = "Favorites", | ||
653 | [KEY_EPG] = "EPG", [KEY_PVR] = "PVR", | ||
654 | [KEY_MHP] = "MHP", [KEY_LANGUAGE] = "Language", | ||
655 | [KEY_TITLE] = "Title", [KEY_SUBTITLE] = "Subtitle", | ||
656 | [KEY_ANGLE] = "Angle", [KEY_ZOOM] = "Zoom", | ||
657 | [KEY_MODE] = "Mode", [KEY_KEYBOARD] = "Keyboard", | ||
658 | [KEY_SCREEN] = "Screen", [KEY_PC] = "PC", | ||
659 | [KEY_TV] = "TV", [KEY_TV2] = "TV2", | ||
660 | [KEY_VCR] = "VCR", [KEY_VCR2] = "VCR2", | ||
661 | [KEY_SAT] = "Sat", [KEY_SAT2] = "Sat2", | ||
662 | [KEY_CD] = "CD", [KEY_TAPE] = "Tape", | ||
663 | [KEY_RADIO] = "Radio", [KEY_TUNER] = "Tuner", | ||
664 | [KEY_PLAYER] = "Player", [KEY_TEXT] = "Text", | ||
665 | [KEY_DVD] = "DVD", [KEY_AUX] = "Aux", | ||
666 | [KEY_MP3] = "MP3", [KEY_AUDIO] = "Audio", | ||
667 | [KEY_VIDEO] = "Video", [KEY_DIRECTORY] = "Directory", | ||
668 | [KEY_LIST] = "List", [KEY_MEMO] = "Memo", | ||
669 | [KEY_CALENDAR] = "Calendar", [KEY_RED] = "Red", | ||
670 | [KEY_GREEN] = "Green", [KEY_YELLOW] = "Yellow", | ||
671 | [KEY_BLUE] = "Blue", [KEY_CHANNELUP] = "ChannelUp", | ||
672 | [KEY_CHANNELDOWN] = "ChannelDown", [KEY_FIRST] = "First", | ||
673 | [KEY_LAST] = "Last", [KEY_AB] = "AB", | ||
674 | [KEY_NEXT] = "Next", [KEY_RESTART] = "Restart", | ||
675 | [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", | ||
676 | [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", | ||
677 | [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", | ||
678 | [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", | ||
679 | [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", | ||
680 | [KEY_DEL_LINE] = "DeleteLine", | ||
681 | [KEY_SEND] = "Send", [KEY_REPLY] = "Reply", | ||
682 | [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save", | ||
683 | [KEY_DOCUMENTS] = "Documents", | ||
684 | [KEY_FN] = "Fn", [KEY_FN_ESC] = "Fn+ESC", | ||
685 | [KEY_FN_1] = "Fn+1", [KEY_FN_2] = "Fn+2", | ||
686 | [KEY_FN_B] = "Fn+B", [KEY_FN_D] = "Fn+D", | ||
687 | [KEY_FN_E] = "Fn+E", [KEY_FN_F] = "Fn+F", | ||
688 | [KEY_FN_S] = "Fn+S", | ||
689 | [KEY_FN_F1] = "Fn+F1", [KEY_FN_F2] = "Fn+F2", | ||
690 | [KEY_FN_F3] = "Fn+F3", [KEY_FN_F4] = "Fn+F4", | ||
691 | [KEY_FN_F5] = "Fn+F5", [KEY_FN_F6] = "Fn+F6", | ||
692 | [KEY_FN_F7] = "Fn+F7", [KEY_FN_F8] = "Fn+F8", | ||
693 | [KEY_FN_F9] = "Fn+F9", [KEY_FN_F10] = "Fn+F10", | ||
694 | [KEY_FN_F11] = "Fn+F11", [KEY_FN_F12] = "Fn+F12", | ||
695 | [KEY_KBDILLUMTOGGLE] = "KbdIlluminationToggle", | ||
696 | [KEY_KBDILLUMDOWN] = "KbdIlluminationDown", | ||
697 | [KEY_KBDILLUMUP] = "KbdIlluminationUp", | ||
698 | [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode", | ||
699 | }; | ||
700 | |||
701 | static char *relatives[REL_MAX + 1] = { | ||
702 | [REL_X] = "X", [REL_Y] = "Y", | ||
703 | [REL_Z] = "Z", [REL_HWHEEL] = "HWheel", | ||
704 | [REL_DIAL] = "Dial", [REL_WHEEL] = "Wheel", | ||
705 | [REL_MISC] = "Misc", | ||
706 | }; | ||
707 | |||
708 | static char *absolutes[ABS_MAX + 1] = { | ||
709 | [ABS_X] = "X", [ABS_Y] = "Y", | ||
710 | [ABS_Z] = "Z", [ABS_RX] = "Rx", | ||
711 | [ABS_RY] = "Ry", [ABS_RZ] = "Rz", | ||
712 | [ABS_THROTTLE] = "Throttle", [ABS_RUDDER] = "Rudder", | ||
713 | [ABS_WHEEL] = "Wheel", [ABS_GAS] = "Gas", | ||
714 | [ABS_BRAKE] = "Brake", [ABS_HAT0X] = "Hat0X", | ||
715 | [ABS_HAT0Y] = "Hat0Y", [ABS_HAT1X] = "Hat1X", | ||
716 | [ABS_HAT1Y] = "Hat1Y", [ABS_HAT2X] = "Hat2X", | ||
717 | [ABS_HAT2Y] = "Hat2Y", [ABS_HAT3X] = "Hat3X", | ||
718 | [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure", | ||
719 | [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", | ||
720 | [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "Tool Width", | ||
721 | [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", | ||
722 | }; | ||
723 | |||
724 | static char *misc[MSC_MAX + 1] = { | ||
725 | [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", | ||
726 | [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData" | ||
727 | }; | ||
728 | |||
729 | static char *leds[LED_MAX + 1] = { | ||
730 | [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock", | ||
731 | [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", | ||
732 | [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", | ||
733 | [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute", | ||
734 | [LED_MISC] = "Misc", | ||
735 | }; | ||
736 | |||
737 | static char *repeats[REP_MAX + 1] = { | ||
738 | [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" | ||
739 | }; | ||
740 | |||
741 | static char *sounds[SND_MAX + 1] = { | ||
742 | [SND_CLICK] = "Click", [SND_BELL] = "Bell", | ||
743 | [SND_TONE] = "Tone" | ||
744 | }; | ||
745 | |||
746 | static char **names[EV_MAX + 1] = { | ||
747 | [EV_SYN] = syncs, [EV_KEY] = keys, | ||
748 | [EV_REL] = relatives, [EV_ABS] = absolutes, | ||
749 | [EV_MSC] = misc, [EV_LED] = leds, | ||
750 | [EV_SND] = sounds, [EV_REP] = repeats, | ||
751 | }; | ||
752 | |||
753 | static void __attribute__((unused)) resolv_event(__u8 type, __u16 code) { | ||
754 | |||
755 | printk("%s.%s", events[type] ? events[type] : "?", | ||
756 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); | ||
757 | } | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h new file mode 100644 index 000000000000..770120add15a --- /dev/null +++ b/include/linux/hid.h | |||
@@ -0,0 +1,528 @@ | |||
1 | #ifndef __HID_H | ||
2 | #define __HID_H | ||
3 | |||
4 | /* | ||
5 | * $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $ | ||
6 | * | ||
7 | * Copyright (c) 1999 Andreas Gal | ||
8 | * Copyright (c) 2000-2001 Vojtech Pavlik | ||
9 | * Copyright (c) 2006 Jiri Kosina | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
26 | * | ||
27 | * Should you need to contact me, the author, you can do so either by | ||
28 | * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: | ||
29 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | ||
30 | */ | ||
31 | |||
32 | #include <linux/types.h> | ||
33 | #include <linux/slab.h> | ||
34 | #include <linux/list.h> | ||
35 | #include <linux/timer.h> | ||
36 | #include <linux/workqueue.h> | ||
37 | #include <linux/input.h> | ||
38 | |||
39 | /* | ||
40 | * USB HID (Human Interface Device) interface class code | ||
41 | */ | ||
42 | |||
43 | #define USB_INTERFACE_CLASS_HID 3 | ||
44 | |||
45 | /* | ||
46 | * USB HID interface subclass and protocol codes | ||
47 | */ | ||
48 | |||
49 | #define USB_INTERFACE_SUBCLASS_BOOT 1 | ||
50 | #define USB_INTERFACE_PROTOCOL_KEYBOARD 1 | ||
51 | #define USB_INTERFACE_PROTOCOL_MOUSE 2 | ||
52 | |||
53 | /* | ||
54 | * HID class requests | ||
55 | */ | ||
56 | |||
57 | #define HID_REQ_GET_REPORT 0x01 | ||
58 | #define HID_REQ_GET_IDLE 0x02 | ||
59 | #define HID_REQ_GET_PROTOCOL 0x03 | ||
60 | #define HID_REQ_SET_REPORT 0x09 | ||
61 | #define HID_REQ_SET_IDLE 0x0A | ||
62 | #define HID_REQ_SET_PROTOCOL 0x0B | ||
63 | |||
64 | /* | ||
65 | * HID class descriptor types | ||
66 | */ | ||
67 | |||
68 | #define HID_DT_HID (USB_TYPE_CLASS | 0x01) | ||
69 | #define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) | ||
70 | #define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) | ||
71 | |||
72 | /* | ||
73 | * We parse each description item into this structure. Short items data | ||
74 | * values are expanded to 32-bit signed int, long items contain a pointer | ||
75 | * into the data area. | ||
76 | */ | ||
77 | |||
78 | struct hid_item { | ||
79 | unsigned format; | ||
80 | __u8 size; | ||
81 | __u8 type; | ||
82 | __u8 tag; | ||
83 | union { | ||
84 | __u8 u8; | ||
85 | __s8 s8; | ||
86 | __u16 u16; | ||
87 | __s16 s16; | ||
88 | __u32 u32; | ||
89 | __s32 s32; | ||
90 | __u8 *longdata; | ||
91 | } data; | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * HID report item format | ||
96 | */ | ||
97 | |||
98 | #define HID_ITEM_FORMAT_SHORT 0 | ||
99 | #define HID_ITEM_FORMAT_LONG 1 | ||
100 | |||
101 | /* | ||
102 | * Special tag indicating long items | ||
103 | */ | ||
104 | |||
105 | #define HID_ITEM_TAG_LONG 15 | ||
106 | |||
107 | /* | ||
108 | * HID report descriptor item type (prefix bit 2,3) | ||
109 | */ | ||
110 | |||
111 | #define HID_ITEM_TYPE_MAIN 0 | ||
112 | #define HID_ITEM_TYPE_GLOBAL 1 | ||
113 | #define HID_ITEM_TYPE_LOCAL 2 | ||
114 | #define HID_ITEM_TYPE_RESERVED 3 | ||
115 | |||
116 | /* | ||
117 | * HID report descriptor main item tags | ||
118 | */ | ||
119 | |||
120 | #define HID_MAIN_ITEM_TAG_INPUT 8 | ||
121 | #define HID_MAIN_ITEM_TAG_OUTPUT 9 | ||
122 | #define HID_MAIN_ITEM_TAG_FEATURE 11 | ||
123 | #define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10 | ||
124 | #define HID_MAIN_ITEM_TAG_END_COLLECTION 12 | ||
125 | |||
126 | /* | ||
127 | * HID report descriptor main item contents | ||
128 | */ | ||
129 | |||
130 | #define HID_MAIN_ITEM_CONSTANT 0x001 | ||
131 | #define HID_MAIN_ITEM_VARIABLE 0x002 | ||
132 | #define HID_MAIN_ITEM_RELATIVE 0x004 | ||
133 | #define HID_MAIN_ITEM_WRAP 0x008 | ||
134 | #define HID_MAIN_ITEM_NONLINEAR 0x010 | ||
135 | #define HID_MAIN_ITEM_NO_PREFERRED 0x020 | ||
136 | #define HID_MAIN_ITEM_NULL_STATE 0x040 | ||
137 | #define HID_MAIN_ITEM_VOLATILE 0x080 | ||
138 | #define HID_MAIN_ITEM_BUFFERED_BYTE 0x100 | ||
139 | |||
140 | /* | ||
141 | * HID report descriptor collection item types | ||
142 | */ | ||
143 | |||
144 | #define HID_COLLECTION_PHYSICAL 0 | ||
145 | #define HID_COLLECTION_APPLICATION 1 | ||
146 | #define HID_COLLECTION_LOGICAL 2 | ||
147 | |||
148 | /* | ||
149 | * HID report descriptor global item tags | ||
150 | */ | ||
151 | |||
152 | #define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0 | ||
153 | #define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1 | ||
154 | #define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2 | ||
155 | #define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3 | ||
156 | #define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4 | ||
157 | #define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5 | ||
158 | #define HID_GLOBAL_ITEM_TAG_UNIT 6 | ||
159 | #define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7 | ||
160 | #define HID_GLOBAL_ITEM_TAG_REPORT_ID 8 | ||
161 | #define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9 | ||
162 | #define HID_GLOBAL_ITEM_TAG_PUSH 10 | ||
163 | #define HID_GLOBAL_ITEM_TAG_POP 11 | ||
164 | |||
165 | /* | ||
166 | * HID report descriptor local item tags | ||
167 | */ | ||
168 | |||
169 | #define HID_LOCAL_ITEM_TAG_USAGE 0 | ||
170 | #define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1 | ||
171 | #define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2 | ||
172 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3 | ||
173 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4 | ||
174 | #define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5 | ||
175 | #define HID_LOCAL_ITEM_TAG_STRING_INDEX 7 | ||
176 | #define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8 | ||
177 | #define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9 | ||
178 | #define HID_LOCAL_ITEM_TAG_DELIMITER 10 | ||
179 | |||
180 | /* | ||
181 | * HID usage tables | ||
182 | */ | ||
183 | |||
184 | #define HID_USAGE_PAGE 0xffff0000 | ||
185 | |||
186 | #define HID_UP_UNDEFINED 0x00000000 | ||
187 | #define HID_UP_GENDESK 0x00010000 | ||
188 | #define HID_UP_SIMULATION 0x00020000 | ||
189 | #define HID_UP_KEYBOARD 0x00070000 | ||
190 | #define HID_UP_LED 0x00080000 | ||
191 | #define HID_UP_BUTTON 0x00090000 | ||
192 | #define HID_UP_ORDINAL 0x000a0000 | ||
193 | #define HID_UP_CONSUMER 0x000c0000 | ||
194 | #define HID_UP_DIGITIZER 0x000d0000 | ||
195 | #define HID_UP_PID 0x000f0000 | ||
196 | #define HID_UP_HPVENDOR 0xff7f0000 | ||
197 | #define HID_UP_MSVENDOR 0xff000000 | ||
198 | #define HID_UP_CUSTOM 0x00ff0000 | ||
199 | #define HID_UP_LOGIVENDOR 0xffbc0000 | ||
200 | |||
201 | #define HID_USAGE 0x0000ffff | ||
202 | |||
203 | #define HID_GD_POINTER 0x00010001 | ||
204 | #define HID_GD_MOUSE 0x00010002 | ||
205 | #define HID_GD_JOYSTICK 0x00010004 | ||
206 | #define HID_GD_GAMEPAD 0x00010005 | ||
207 | #define HID_GD_KEYBOARD 0x00010006 | ||
208 | #define HID_GD_KEYPAD 0x00010007 | ||
209 | #define HID_GD_MULTIAXIS 0x00010008 | ||
210 | #define HID_GD_X 0x00010030 | ||
211 | #define HID_GD_Y 0x00010031 | ||
212 | #define HID_GD_Z 0x00010032 | ||
213 | #define HID_GD_RX 0x00010033 | ||
214 | #define HID_GD_RY 0x00010034 | ||
215 | #define HID_GD_RZ 0x00010035 | ||
216 | #define HID_GD_SLIDER 0x00010036 | ||
217 | #define HID_GD_DIAL 0x00010037 | ||
218 | #define HID_GD_WHEEL 0x00010038 | ||
219 | #define HID_GD_HATSWITCH 0x00010039 | ||
220 | #define HID_GD_BUFFER 0x0001003a | ||
221 | #define HID_GD_BYTECOUNT 0x0001003b | ||
222 | #define HID_GD_MOTION 0x0001003c | ||
223 | #define HID_GD_START 0x0001003d | ||
224 | #define HID_GD_SELECT 0x0001003e | ||
225 | #define HID_GD_VX 0x00010040 | ||
226 | #define HID_GD_VY 0x00010041 | ||
227 | #define HID_GD_VZ 0x00010042 | ||
228 | #define HID_GD_VBRX 0x00010043 | ||
229 | #define HID_GD_VBRY 0x00010044 | ||
230 | #define HID_GD_VBRZ 0x00010045 | ||
231 | #define HID_GD_VNO 0x00010046 | ||
232 | #define HID_GD_FEATURE 0x00010047 | ||
233 | #define HID_GD_UP 0x00010090 | ||
234 | #define HID_GD_DOWN 0x00010091 | ||
235 | #define HID_GD_RIGHT 0x00010092 | ||
236 | #define HID_GD_LEFT 0x00010093 | ||
237 | |||
238 | /* | ||
239 | * HID report types --- Ouch! HID spec says 1 2 3! | ||
240 | */ | ||
241 | |||
242 | #define HID_INPUT_REPORT 0 | ||
243 | #define HID_OUTPUT_REPORT 1 | ||
244 | #define HID_FEATURE_REPORT 2 | ||
245 | |||
246 | /* | ||
247 | * HID device quirks. | ||
248 | */ | ||
249 | |||
250 | #define HID_QUIRK_INVERT 0x00000001 | ||
251 | #define HID_QUIRK_NOTOUCH 0x00000002 | ||
252 | #define HID_QUIRK_IGNORE 0x00000004 | ||
253 | #define HID_QUIRK_NOGET 0x00000008 | ||
254 | #define HID_QUIRK_HIDDEV 0x00000010 | ||
255 | #define HID_QUIRK_BADPAD 0x00000020 | ||
256 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | ||
257 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080 | ||
258 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 | ||
259 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 | ||
260 | #define HID_QUIRK_MIGHTYMOUSE 0x00000400 | ||
261 | #define HID_QUIRK_CYMOTION 0x00000800 | ||
262 | #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 | ||
263 | #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 | ||
264 | #define HID_QUIRK_INVERT_HWHEEL 0x00004000 | ||
265 | #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 | ||
266 | #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 | ||
267 | |||
268 | /* | ||
269 | * This is the global environment of the parser. This information is | ||
270 | * persistent for main-items. The global environment can be saved and | ||
271 | * restored with PUSH/POP statements. | ||
272 | */ | ||
273 | |||
274 | struct hid_global { | ||
275 | unsigned usage_page; | ||
276 | __s32 logical_minimum; | ||
277 | __s32 logical_maximum; | ||
278 | __s32 physical_minimum; | ||
279 | __s32 physical_maximum; | ||
280 | __s32 unit_exponent; | ||
281 | unsigned unit; | ||
282 | unsigned report_id; | ||
283 | unsigned report_size; | ||
284 | unsigned report_count; | ||
285 | }; | ||
286 | |||
287 | /* | ||
288 | * This is the local environment. It is persistent up the next main-item. | ||
289 | */ | ||
290 | |||
291 | #define HID_MAX_DESCRIPTOR_SIZE 4096 | ||
292 | #define HID_MAX_USAGES 1024 | ||
293 | #define HID_DEFAULT_NUM_COLLECTIONS 16 | ||
294 | |||
295 | struct hid_local { | ||
296 | unsigned usage[HID_MAX_USAGES]; /* usage array */ | ||
297 | unsigned collection_index[HID_MAX_USAGES]; /* collection index array */ | ||
298 | unsigned usage_index; | ||
299 | unsigned usage_minimum; | ||
300 | unsigned delimiter_depth; | ||
301 | unsigned delimiter_branch; | ||
302 | }; | ||
303 | |||
304 | /* | ||
305 | * This is the collection stack. We climb up the stack to determine | ||
306 | * application and function of each field. | ||
307 | */ | ||
308 | |||
309 | struct hid_collection { | ||
310 | unsigned type; | ||
311 | unsigned usage; | ||
312 | unsigned level; | ||
313 | }; | ||
314 | |||
315 | struct hid_usage { | ||
316 | unsigned hid; /* hid usage code */ | ||
317 | unsigned collection_index; /* index into collection array */ | ||
318 | /* hidinput data */ | ||
319 | __u16 code; /* input driver code */ | ||
320 | __u8 type; /* input driver type */ | ||
321 | __s8 hat_min; /* hat switch fun */ | ||
322 | __s8 hat_max; /* ditto */ | ||
323 | __s8 hat_dir; /* ditto */ | ||
324 | }; | ||
325 | |||
326 | struct hid_input; | ||
327 | |||
328 | struct hid_field { | ||
329 | unsigned physical; /* physical usage for this field */ | ||
330 | unsigned logical; /* logical usage for this field */ | ||
331 | unsigned application; /* application usage for this field */ | ||
332 | struct hid_usage *usage; /* usage table for this function */ | ||
333 | unsigned maxusage; /* maximum usage index */ | ||
334 | unsigned flags; /* main-item flags (i.e. volatile,array,constant) */ | ||
335 | unsigned report_offset; /* bit offset in the report */ | ||
336 | unsigned report_size; /* size of this field in the report */ | ||
337 | unsigned report_count; /* number of this field in the report */ | ||
338 | unsigned report_type; /* (input,output,feature) */ | ||
339 | __s32 *value; /* last known value(s) */ | ||
340 | __s32 logical_minimum; | ||
341 | __s32 logical_maximum; | ||
342 | __s32 physical_minimum; | ||
343 | __s32 physical_maximum; | ||
344 | __s32 unit_exponent; | ||
345 | unsigned unit; | ||
346 | struct hid_report *report; /* associated report */ | ||
347 | unsigned index; /* index into report->field[] */ | ||
348 | /* hidinput data */ | ||
349 | struct hid_input *hidinput; /* associated input structure */ | ||
350 | __u16 dpad; /* dpad input code */ | ||
351 | }; | ||
352 | |||
353 | #define HID_MAX_FIELDS 64 | ||
354 | |||
355 | struct hid_report { | ||
356 | struct list_head list; | ||
357 | unsigned id; /* id of this report */ | ||
358 | unsigned type; /* report type */ | ||
359 | struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */ | ||
360 | unsigned maxfield; /* maximum valid field index */ | ||
361 | unsigned size; /* size of the report (bits) */ | ||
362 | struct hid_device *device; /* associated device */ | ||
363 | }; | ||
364 | |||
365 | struct hid_report_enum { | ||
366 | unsigned numbered; | ||
367 | struct list_head report_list; | ||
368 | struct hid_report *report_id_hash[256]; | ||
369 | }; | ||
370 | |||
371 | #define HID_REPORT_TYPES 3 | ||
372 | |||
373 | #define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ | ||
374 | #define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ | ||
375 | #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ | ||
376 | #define HID_OUTPUT_FIFO_SIZE 64 | ||
377 | |||
378 | struct hid_control_fifo { | ||
379 | unsigned char dir; | ||
380 | struct hid_report *report; | ||
381 | }; | ||
382 | |||
383 | #define HID_CLAIMED_INPUT 1 | ||
384 | #define HID_CLAIMED_HIDDEV 2 | ||
385 | |||
386 | #define HID_CTRL_RUNNING 1 | ||
387 | #define HID_OUT_RUNNING 2 | ||
388 | #define HID_IN_RUNNING 3 | ||
389 | #define HID_RESET_PENDING 4 | ||
390 | #define HID_SUSPENDED 5 | ||
391 | #define HID_CLEAR_HALT 6 | ||
392 | |||
393 | struct hid_input { | ||
394 | struct list_head list; | ||
395 | struct hid_report *report; | ||
396 | struct input_dev *input; | ||
397 | }; | ||
398 | |||
399 | struct hid_device { /* device report descriptor */ | ||
400 | __u8 *rdesc; | ||
401 | unsigned rsize; | ||
402 | struct hid_collection *collection; /* List of HID collections */ | ||
403 | unsigned collection_size; /* Number of allocated hid_collections */ | ||
404 | unsigned maxcollection; /* Number of parsed collections */ | ||
405 | unsigned maxapplication; /* Number of applications */ | ||
406 | unsigned short bus; /* BUS ID */ | ||
407 | unsigned short vendor; /* Vendor ID */ | ||
408 | unsigned short product; /* Product ID */ | ||
409 | unsigned version; /* HID version */ | ||
410 | unsigned country; /* HID country */ | ||
411 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | ||
412 | |||
413 | struct device *dev; /* device */ | ||
414 | |||
415 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | ||
416 | unsigned quirks; /* Various quirks the device can pull on us */ | ||
417 | |||
418 | struct list_head inputs; /* The list of inputs */ | ||
419 | void *hiddev; /* The hiddev structure */ | ||
420 | int minor; /* Hiddev minor number */ | ||
421 | |||
422 | wait_queue_head_t wait; /* For sleeping */ | ||
423 | |||
424 | int open; /* is the device open by anyone? */ | ||
425 | char name[128]; /* Device name */ | ||
426 | char phys[64]; /* Device physical location */ | ||
427 | char uniq[64]; /* Device unique identifier (serial #) */ | ||
428 | |||
429 | void *driver_data; | ||
430 | |||
431 | /* device-specific function pointers */ | ||
432 | int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int); | ||
433 | int (*hidinput_open) (struct input_dev *); | ||
434 | void (*hidinput_close) (struct input_dev *); | ||
435 | |||
436 | /* hiddev event handler */ | ||
437 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, | ||
438 | struct hid_usage *, __s32); | ||
439 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | ||
440 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | ||
441 | unsigned int pb_fnmode; | ||
442 | unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; | ||
443 | unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; | ||
444 | #endif | ||
445 | }; | ||
446 | |||
447 | #define HID_GLOBAL_STACK_SIZE 4 | ||
448 | #define HID_COLLECTION_STACK_SIZE 4 | ||
449 | |||
450 | struct hid_parser { | ||
451 | struct hid_global global; | ||
452 | struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; | ||
453 | unsigned global_stack_ptr; | ||
454 | struct hid_local local; | ||
455 | unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; | ||
456 | unsigned collection_stack_ptr; | ||
457 | struct hid_device *device; | ||
458 | }; | ||
459 | |||
460 | struct hid_class_descriptor { | ||
461 | __u8 bDescriptorType; | ||
462 | __u16 wDescriptorLength; | ||
463 | } __attribute__ ((packed)); | ||
464 | |||
465 | struct hid_descriptor { | ||
466 | __u8 bLength; | ||
467 | __u8 bDescriptorType; | ||
468 | __u16 bcdHID; | ||
469 | __u8 bCountryCode; | ||
470 | __u8 bNumDescriptors; | ||
471 | |||
472 | struct hid_class_descriptor desc[1]; | ||
473 | } __attribute__ ((packed)); | ||
474 | |||
475 | #ifdef DEBUG | ||
476 | #include "hid-debug.h" | ||
477 | #else | ||
478 | #define hid_dump_input(a,b) do { } while (0) | ||
479 | #define hid_dump_device(c) do { } while (0) | ||
480 | #define hid_dump_field(a,b) do { } while (0) | ||
481 | #define resolv_usage(a) do { } while (0) | ||
482 | #define resolv_event(a,b) do { } while (0) | ||
483 | #endif | ||
484 | |||
485 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | ||
486 | /* We ignore a few input applications that are not widely used */ | ||
487 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) | ||
488 | |||
489 | /* HID core API */ | ||
490 | extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); | ||
491 | extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); | ||
492 | extern int hidinput_connect(struct hid_device *); | ||
493 | extern void hidinput_disconnect(struct hid_device *); | ||
494 | |||
495 | int hid_set_field(struct hid_field *, unsigned, __s32); | ||
496 | int hid_input_report(struct hid_device *, int type, u8 *, int, int); | ||
497 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | ||
498 | void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt); | ||
499 | void hid_output_report(struct hid_report *report, __u8 *data); | ||
500 | void hid_free_device(struct hid_device *device); | ||
501 | struct hid_device *hid_parse_report(__u8 *start, unsigned size); | ||
502 | |||
503 | #ifdef CONFIG_HID_FF | ||
504 | int hid_ff_init(struct hid_device *hid); | ||
505 | |||
506 | int hid_lgff_init(struct hid_device *hid); | ||
507 | int hid_tmff_init(struct hid_device *hid); | ||
508 | int hid_zpff_init(struct hid_device *hid); | ||
509 | #ifdef CONFIG_HID_PID | ||
510 | int hid_pidff_init(struct hid_device *hid); | ||
511 | #else | ||
512 | static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } | ||
513 | #endif | ||
514 | |||
515 | #else | ||
516 | static inline int hid_ff_init(struct hid_device *hid) { return -1; } | ||
517 | #endif | ||
518 | #ifdef DEBUG | ||
519 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ | ||
520 | __FILE__ , ## arg) | ||
521 | #else | ||
522 | #define dbg(format, arg...) do {} while (0) | ||
523 | #endif | ||
524 | |||
525 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | ||
526 | __FILE__ , ## arg) | ||
527 | #endif | ||
528 | |||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 733790d4f7db..7272ff9ee77c 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/utsname.h> | 7 | #include <linux/utsname.h> |
8 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
9 | #include <linux/ipc.h> | 9 | #include <linux/ipc.h> |
10 | #include <linux/pid_namespace.h> | ||
10 | 11 | ||
11 | #define INIT_FDTABLE \ | 12 | #define INIT_FDTABLE \ |
12 | { \ | 13 | { \ |
@@ -57,25 +58,28 @@ | |||
57 | .cpu_vm_mask = CPU_MASK_ALL, \ | 58 | .cpu_vm_mask = CPU_MASK_ALL, \ |
58 | } | 59 | } |
59 | 60 | ||
60 | #define INIT_SIGNALS(sig) { \ | 61 | #define INIT_SIGNALS(sig) { \ |
61 | .count = ATOMIC_INIT(1), \ | 62 | .count = ATOMIC_INIT(1), \ |
62 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 63 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
63 | .shared_pending = { \ | 64 | .shared_pending = { \ |
64 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ | 65 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ |
65 | .signal = {{0}}}, \ | 66 | .signal = {{0}}}, \ |
66 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 67 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
67 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 68 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
68 | .rlim = INIT_RLIMITS, \ | 69 | .rlim = INIT_RLIMITS, \ |
69 | .pgrp = 1, \ | 70 | .pgrp = 1, \ |
70 | .session = 1, \ | 71 | .tty_old_pgrp = 0, \ |
72 | { .__session = 1}, \ | ||
71 | } | 73 | } |
72 | 74 | ||
73 | extern struct nsproxy init_nsproxy; | 75 | extern struct nsproxy init_nsproxy; |
74 | #define INIT_NSPROXY(nsproxy) { \ | 76 | #define INIT_NSPROXY(nsproxy) { \ |
77 | .pid_ns = &init_pid_ns, \ | ||
75 | .count = ATOMIC_INIT(1), \ | 78 | .count = ATOMIC_INIT(1), \ |
76 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ | 79 | .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \ |
80 | .id = 0, \ | ||
77 | .uts_ns = &init_uts_ns, \ | 81 | .uts_ns = &init_uts_ns, \ |
78 | .namespace = NULL, \ | 82 | .mnt_ns = NULL, \ |
79 | INIT_IPC_NS(ipc_ns) \ | 83 | INIT_IPC_NS(ipc_ns) \ |
80 | } | 84 | } |
81 | 85 | ||
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 62991148d5a5..3c7875b7ab5b 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -511,8 +511,8 @@ typedef struct modem_info { | |||
511 | #endif | 511 | #endif |
512 | struct tty_struct *tty; /* Pointer to corresponding tty */ | 512 | struct tty_struct *tty; /* Pointer to corresponding tty */ |
513 | atemu emu; /* AT-emulator data */ | 513 | atemu emu; /* AT-emulator data */ |
514 | struct termios normal_termios; /* For saving termios structs */ | 514 | struct ktermios normal_termios; /* For saving termios structs */ |
515 | struct termios callout_termios; | 515 | struct ktermios callout_termios; |
516 | wait_queue_head_t open_wait, close_wait; | 516 | wait_queue_head_t open_wait, close_wait; |
517 | struct semaphore write_sem; | 517 | struct semaphore write_sem; |
518 | spinlock_t readlock; | 518 | spinlock_t readlock; |
@@ -525,8 +525,8 @@ typedef struct _isdn_modem { | |||
525 | int refcount; /* Number of opens */ | 525 | int refcount; /* Number of opens */ |
526 | struct tty_driver *tty_modem; /* tty-device */ | 526 | struct tty_driver *tty_modem; /* tty-device */ |
527 | struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ | 527 | struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ |
528 | struct termios *modem_termios[ISDN_MAX_CHANNELS]; | 528 | struct ktermios *modem_termios[ISDN_MAX_CHANNELS]; |
529 | struct termios *modem_termios_locked[ISDN_MAX_CHANNELS]; | 529 | struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS]; |
530 | modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ | 530 | modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ |
531 | } isdn_modem_t; | 531 | } isdn_modem_t; |
532 | 532 | ||
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index b55e2a035605..106a5e85e5c4 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -49,13 +49,13 @@ | |||
49 | * communication with the slave board will always be on a per port | 49 | * communication with the slave board will always be on a per port |
50 | * basis. | 50 | * basis. |
51 | */ | 51 | */ |
52 | typedef struct { | 52 | struct stliport { |
53 | unsigned long magic; | 53 | unsigned long magic; |
54 | int portnr; | 54 | unsigned int portnr; |
55 | int panelnr; | 55 | unsigned int panelnr; |
56 | int brdnr; | 56 | unsigned int brdnr; |
57 | unsigned long state; | 57 | unsigned long state; |
58 | int devnr; | 58 | unsigned int devnr; |
59 | int flags; | 59 | int flags; |
60 | int baud_base; | 60 | int baud_base; |
61 | int custom_divisor; | 61 | int custom_divisor; |
@@ -72,7 +72,7 @@ typedef struct { | |||
72 | wait_queue_head_t close_wait; | 72 | wait_queue_head_t close_wait; |
73 | wait_queue_head_t raw_wait; | 73 | wait_queue_head_t raw_wait; |
74 | struct work_struct tqhangup; | 74 | struct work_struct tqhangup; |
75 | asysigs_t asig; | 75 | struct asysigs asig; |
76 | unsigned long addr; | 76 | unsigned long addr; |
77 | unsigned long rxoffset; | 77 | unsigned long rxoffset; |
78 | unsigned long txoffset; | 78 | unsigned long txoffset; |
@@ -83,31 +83,31 @@ typedef struct { | |||
83 | unsigned char reqbit; | 83 | unsigned char reqbit; |
84 | unsigned char portidx; | 84 | unsigned char portidx; |
85 | unsigned char portbit; | 85 | unsigned char portbit; |
86 | } stliport_t; | 86 | }; |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * Use a structure of function pointers to do board level operations. | 89 | * Use a structure of function pointers to do board level operations. |
90 | * These include, enable/disable, paging shared memory, interrupting, etc. | 90 | * These include, enable/disable, paging shared memory, interrupting, etc. |
91 | */ | 91 | */ |
92 | typedef struct stlibrd { | 92 | struct stlibrd { |
93 | unsigned long magic; | 93 | unsigned long magic; |
94 | int brdnr; | 94 | unsigned int brdnr; |
95 | int brdtype; | 95 | unsigned int brdtype; |
96 | int state; | 96 | unsigned int state; |
97 | int nrpanels; | 97 | unsigned int nrpanels; |
98 | int nrports; | 98 | unsigned int nrports; |
99 | int nrdevs; | 99 | unsigned int nrdevs; |
100 | unsigned int iobase; | 100 | unsigned int iobase; |
101 | int iosize; | 101 | int iosize; |
102 | unsigned long memaddr; | 102 | unsigned long memaddr; |
103 | void __iomem *membase; | 103 | void __iomem *membase; |
104 | int memsize; | 104 | unsigned long memsize; |
105 | int pagesize; | 105 | int pagesize; |
106 | int hostoffset; | 106 | int hostoffset; |
107 | int slaveoffset; | 107 | int slaveoffset; |
108 | int bitsize; | 108 | int bitsize; |
109 | int enabval; | 109 | int enabval; |
110 | int panels[STL_MAXPANELS]; | 110 | unsigned int panels[STL_MAXPANELS]; |
111 | int panelids[STL_MAXPANELS]; | 111 | int panelids[STL_MAXPANELS]; |
112 | void (*init)(struct stlibrd *brdp); | 112 | void (*init)(struct stlibrd *brdp); |
113 | void (*enable)(struct stlibrd *brdp); | 113 | void (*enable)(struct stlibrd *brdp); |
@@ -116,8 +116,8 @@ typedef struct stlibrd { | |||
116 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); | 116 | void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); |
117 | void (*intr)(struct stlibrd *brdp); | 117 | void (*intr)(struct stlibrd *brdp); |
118 | void (*reset)(struct stlibrd *brdp); | 118 | void (*reset)(struct stlibrd *brdp); |
119 | stliport_t *ports[STL_MAXPORTS]; | 119 | struct stliport *ports[STL_MAXPORTS]; |
120 | } stlibrd_t; | 120 | }; |
121 | 121 | ||
122 | 122 | ||
123 | /* | 123 | /* |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6738283ac385..e8bfac34d2ba 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/log2.h> | ||
16 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
17 | #include <asm/bug.h> | 18 | #include <asm/bug.h> |
18 | 19 | ||
@@ -157,20 +158,6 @@ static inline int printk(const char *s, ...) { return 0; } | |||
157 | 158 | ||
158 | unsigned long int_sqrt(unsigned long); | 159 | unsigned long int_sqrt(unsigned long); |
159 | 160 | ||
160 | static inline int __attribute_pure__ long_log2(unsigned long x) | ||
161 | { | ||
162 | int r = 0; | ||
163 | for (x >>= 1; x > 0; x >>= 1) | ||
164 | r++; | ||
165 | return r; | ||
166 | } | ||
167 | |||
168 | static inline unsigned long | ||
169 | __attribute_const__ roundup_pow_of_two(unsigned long x) | ||
170 | { | ||
171 | return 1UL << fls_long(x - 1); | ||
172 | } | ||
173 | |||
174 | extern int printk_ratelimit(void); | 161 | extern int printk_ratelimit(void); |
175 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | 162 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); |
176 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 163 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 8c39654549d8..0c962b82a9de 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -206,7 +206,7 @@ void nlmsvc_invalidate_all(void); | |||
206 | static __inline__ struct inode * | 206 | static __inline__ struct inode * |
207 | nlmsvc_file_inode(struct nlm_file *file) | 207 | nlmsvc_file_inode(struct nlm_file *file) |
208 | { | 208 | { |
209 | return file->f_file->f_dentry->d_inode; | 209 | return file->f_file->f_path.dentry->d_inode; |
210 | } | 210 | } |
211 | 211 | ||
212 | /* | 212 | /* |
diff --git a/include/linux/log2.h b/include/linux/log2.h new file mode 100644 index 000000000000..d02e1a547a7e --- /dev/null +++ b/include/linux/log2.h | |||
@@ -0,0 +1,157 @@ | |||
1 | /* Integer base 2 logarithm calculation | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_LOG2_H | ||
13 | #define _LINUX_LOG2_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/bitops.h> | ||
17 | |||
18 | /* | ||
19 | * deal with unrepresentable constant logarithms | ||
20 | */ | ||
21 | extern __attribute__((const, noreturn)) | ||
22 | int ____ilog2_NaN(void); | ||
23 | |||
24 | /* | ||
25 | * non-constant log of base 2 calculators | ||
26 | * - the arch may override these in asm/bitops.h if they can be implemented | ||
27 | * more efficiently than using fls() and fls64() | ||
28 | * - the arch is not required to handle n==0 if implementing the fallback | ||
29 | */ | ||
30 | #ifndef CONFIG_ARCH_HAS_ILOG2_U32 | ||
31 | static inline __attribute__((const)) | ||
32 | int __ilog2_u32(u32 n) | ||
33 | { | ||
34 | return fls(n) - 1; | ||
35 | } | ||
36 | #endif | ||
37 | |||
38 | #ifndef CONFIG_ARCH_HAS_ILOG2_U64 | ||
39 | static inline __attribute__((const)) | ||
40 | int __ilog2_u64(u64 n) | ||
41 | { | ||
42 | return fls64(n) - 1; | ||
43 | } | ||
44 | #endif | ||
45 | |||
46 | /* | ||
47 | * round up to nearest power of two | ||
48 | */ | ||
49 | static inline __attribute__((const)) | ||
50 | unsigned long __roundup_pow_of_two(unsigned long n) | ||
51 | { | ||
52 | return 1UL << fls_long(n - 1); | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value | ||
57 | * @n - parameter | ||
58 | * | ||
59 | * constant-capable log of base 2 calculation | ||
60 | * - this can be used to initialise global variables from constant data, hence | ||
61 | * the massive ternary operator construction | ||
62 | * | ||
63 | * selects the appropriately-sized optimised version depending on sizeof(n) | ||
64 | */ | ||
65 | #define ilog2(n) \ | ||
66 | ( \ | ||
67 | __builtin_constant_p(n) ? ( \ | ||
68 | (n) < 1 ? ____ilog2_NaN() : \ | ||
69 | (n) & (1ULL << 63) ? 63 : \ | ||
70 | (n) & (1ULL << 62) ? 62 : \ | ||
71 | (n) & (1ULL << 61) ? 61 : \ | ||
72 | (n) & (1ULL << 60) ? 60 : \ | ||
73 | (n) & (1ULL << 59) ? 59 : \ | ||
74 | (n) & (1ULL << 58) ? 58 : \ | ||
75 | (n) & (1ULL << 57) ? 57 : \ | ||
76 | (n) & (1ULL << 56) ? 56 : \ | ||
77 | (n) & (1ULL << 55) ? 55 : \ | ||
78 | (n) & (1ULL << 54) ? 54 : \ | ||
79 | (n) & (1ULL << 53) ? 53 : \ | ||
80 | (n) & (1ULL << 52) ? 52 : \ | ||
81 | (n) & (1ULL << 51) ? 51 : \ | ||
82 | (n) & (1ULL << 50) ? 50 : \ | ||
83 | (n) & (1ULL << 49) ? 49 : \ | ||
84 | (n) & (1ULL << 48) ? 48 : \ | ||
85 | (n) & (1ULL << 47) ? 47 : \ | ||
86 | (n) & (1ULL << 46) ? 46 : \ | ||
87 | (n) & (1ULL << 45) ? 45 : \ | ||
88 | (n) & (1ULL << 44) ? 44 : \ | ||
89 | (n) & (1ULL << 43) ? 43 : \ | ||
90 | (n) & (1ULL << 42) ? 42 : \ | ||
91 | (n) & (1ULL << 41) ? 41 : \ | ||
92 | (n) & (1ULL << 40) ? 40 : \ | ||
93 | (n) & (1ULL << 39) ? 39 : \ | ||
94 | (n) & (1ULL << 38) ? 38 : \ | ||
95 | (n) & (1ULL << 37) ? 37 : \ | ||
96 | (n) & (1ULL << 36) ? 36 : \ | ||
97 | (n) & (1ULL << 35) ? 35 : \ | ||
98 | (n) & (1ULL << 34) ? 34 : \ | ||
99 | (n) & (1ULL << 33) ? 33 : \ | ||
100 | (n) & (1ULL << 32) ? 32 : \ | ||
101 | (n) & (1ULL << 31) ? 31 : \ | ||
102 | (n) & (1ULL << 30) ? 30 : \ | ||
103 | (n) & (1ULL << 29) ? 29 : \ | ||
104 | (n) & (1ULL << 28) ? 28 : \ | ||
105 | (n) & (1ULL << 27) ? 27 : \ | ||
106 | (n) & (1ULL << 26) ? 26 : \ | ||
107 | (n) & (1ULL << 25) ? 25 : \ | ||
108 | (n) & (1ULL << 24) ? 24 : \ | ||
109 | (n) & (1ULL << 23) ? 23 : \ | ||
110 | (n) & (1ULL << 22) ? 22 : \ | ||
111 | (n) & (1ULL << 21) ? 21 : \ | ||
112 | (n) & (1ULL << 20) ? 20 : \ | ||
113 | (n) & (1ULL << 19) ? 19 : \ | ||
114 | (n) & (1ULL << 18) ? 18 : \ | ||
115 | (n) & (1ULL << 17) ? 17 : \ | ||
116 | (n) & (1ULL << 16) ? 16 : \ | ||
117 | (n) & (1ULL << 15) ? 15 : \ | ||
118 | (n) & (1ULL << 14) ? 14 : \ | ||
119 | (n) & (1ULL << 13) ? 13 : \ | ||
120 | (n) & (1ULL << 12) ? 12 : \ | ||
121 | (n) & (1ULL << 11) ? 11 : \ | ||
122 | (n) & (1ULL << 10) ? 10 : \ | ||
123 | (n) & (1ULL << 9) ? 9 : \ | ||
124 | (n) & (1ULL << 8) ? 8 : \ | ||
125 | (n) & (1ULL << 7) ? 7 : \ | ||
126 | (n) & (1ULL << 6) ? 6 : \ | ||
127 | (n) & (1ULL << 5) ? 5 : \ | ||
128 | (n) & (1ULL << 4) ? 4 : \ | ||
129 | (n) & (1ULL << 3) ? 3 : \ | ||
130 | (n) & (1ULL << 2) ? 2 : \ | ||
131 | (n) & (1ULL << 1) ? 1 : \ | ||
132 | (n) & (1ULL << 0) ? 0 : \ | ||
133 | ____ilog2_NaN() \ | ||
134 | ) : \ | ||
135 | (sizeof(n) <= 4) ? \ | ||
136 | __ilog2_u32(n) : \ | ||
137 | __ilog2_u64(n) \ | ||
138 | ) | ||
139 | |||
140 | /** | ||
141 | * roundup_pow_of_two - round the given value up to nearest power of two | ||
142 | * @n - parameter | ||
143 | * | ||
144 | * round the given balue up to the nearest power of two | ||
145 | * - the result is undefined when n == 0 | ||
146 | * - this can be used to initialise global variables from constant data | ||
147 | */ | ||
148 | #define roundup_pow_of_two(n) \ | ||
149 | ( \ | ||
150 | __builtin_constant_p(n) ? ( \ | ||
151 | (n == 1) ? 0 : \ | ||
152 | (1UL << (ilog2((n) - 1) + 1)) \ | ||
153 | ) : \ | ||
154 | __roundup_pow_of_two(n) \ | ||
155 | ) | ||
156 | |||
157 | #endif /* _LINUX_LOG2_H */ | ||
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h new file mode 100644 index 000000000000..4af0b1fc282a --- /dev/null +++ b/include/linux/mnt_namespace.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct mnt_namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_mnt_ns(int, struct task_struct *); | ||
18 | extern void __put_mnt_ns(struct mnt_namespace *ns); | ||
19 | extern struct mnt_namespace *dup_mnt_ns(struct task_struct *, | ||
20 | struct fs_struct *); | ||
21 | |||
22 | static inline void put_mnt_ns(struct mnt_namespace *ns) | ||
23 | { | ||
24 | if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | ||
25 | /* releases vfsmount_lock */ | ||
26 | __put_mnt_ns(ns); | ||
27 | } | ||
28 | |||
29 | static inline void exit_mnt_ns(struct task_struct *p) | ||
30 | { | ||
31 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | ||
32 | if (ns) | ||
33 | put_mnt_ns(ns); | ||
34 | } | ||
35 | |||
36 | static inline void get_mnt_ns(struct mnt_namespace *ns) | ||
37 | { | ||
38 | atomic_inc(&ns->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/module.h b/include/linux/module.h index d33df2408e05..10f771a49997 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -319,6 +319,13 @@ struct module | |||
319 | 319 | ||
320 | unsigned int taints; /* same bits as kernel:tainted */ | 320 | unsigned int taints; /* same bits as kernel:tainted */ |
321 | 321 | ||
322 | #ifdef CONFIG_GENERIC_BUG | ||
323 | /* Support for BUG */ | ||
324 | struct list_head bug_list; | ||
325 | struct bug_entry *bug_table; | ||
326 | unsigned num_bugs; | ||
327 | #endif | ||
328 | |||
322 | #ifdef CONFIG_MODULE_UNLOAD | 329 | #ifdef CONFIG_MODULE_UNLOAD |
323 | /* Reference counts */ | 330 | /* Reference counts */ |
324 | struct module_ref ref[NR_CPUS]; | 331 | struct module_ref ref[NR_CPUS]; |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 403d1a97c512..e357dc86a4de 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -20,7 +20,7 @@ | |||
20 | struct super_block; | 20 | struct super_block; |
21 | struct vfsmount; | 21 | struct vfsmount; |
22 | struct dentry; | 22 | struct dentry; |
23 | struct namespace; | 23 | struct mnt_namespace; |
24 | 24 | ||
25 | #define MNT_NOSUID 0x01 | 25 | #define MNT_NOSUID 0x01 |
26 | #define MNT_NODEV 0x02 | 26 | #define MNT_NODEV 0x02 |
@@ -52,7 +52,7 @@ struct vfsmount { | |||
52 | struct list_head mnt_slave_list;/* list of slave mounts */ | 52 | struct list_head mnt_slave_list;/* list of slave mounts */ |
53 | struct list_head mnt_slave; /* slave list entry */ | 53 | struct list_head mnt_slave; /* slave list entry */ |
54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ | 54 | struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ |
55 | struct namespace *mnt_namespace; /* containing namespace */ | 55 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
56 | int mnt_pinned; | 56 | int mnt_pinned; |
57 | }; | 57 | }; |
58 | 58 | ||
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index b2b91c477563..a7544afd7582 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -125,8 +125,10 @@ extern int 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 | #else | 129 | #else |
129 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 130 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
131 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | ||
130 | #endif | 132 | #endif |
131 | 133 | ||
132 | /* | 134 | /* |
diff --git a/include/linux/namei.h b/include/linux/namei.h index f5f19606effb..d39a5a67e979 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -29,6 +29,11 @@ struct nameidata { | |||
29 | } intent; | 29 | } intent; |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct path { | ||
33 | struct vfsmount *mnt; | ||
34 | struct dentry *dentry; | ||
35 | }; | ||
36 | |||
32 | /* | 37 | /* |
33 | * Type of the last component on LOOKUP_PARENT | 38 | * Type of the last component on LOOKUP_PARENT |
34 | */ | 39 | */ |
diff --git a/include/linux/namespace.h b/include/linux/namespace.h deleted file mode 100644 index d137009f0b2b..000000000000 --- a/include/linux/namespace.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef _NAMESPACE_H_ | ||
2 | #define _NAMESPACE_H_ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/mount.h> | ||
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | |||
9 | struct namespace { | ||
10 | atomic_t count; | ||
11 | struct vfsmount * root; | ||
12 | struct list_head list; | ||
13 | wait_queue_head_t poll; | ||
14 | int event; | ||
15 | }; | ||
16 | |||
17 | extern int copy_namespace(int, struct task_struct *); | ||
18 | extern void __put_namespace(struct namespace *namespace); | ||
19 | extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *); | ||
20 | |||
21 | static inline void put_namespace(struct namespace *namespace) | ||
22 | { | ||
23 | if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock)) | ||
24 | /* releases vfsmount_lock */ | ||
25 | __put_namespace(namespace); | ||
26 | } | ||
27 | |||
28 | static inline void exit_namespace(struct task_struct *p) | ||
29 | { | ||
30 | struct namespace *namespace = p->nsproxy->namespace; | ||
31 | if (namespace) { | ||
32 | put_namespace(namespace); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | static inline void get_namespace(struct namespace *namespace) | ||
37 | { | ||
38 | atomic_inc(&namespace->count); | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 971d1c6dfc4b..fdfb0e44912f 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -4,9 +4,10 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | struct namespace; | 7 | struct mnt_namespace; |
8 | struct uts_namespace; | 8 | struct uts_namespace; |
9 | struct ipc_namespace; | 9 | struct ipc_namespace; |
10 | struct pid_namespace; | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * A structure to contain pointers to all per-process | 13 | * A structure to contain pointers to all per-process |
@@ -23,9 +24,11 @@ struct ipc_namespace; | |||
23 | struct nsproxy { | 24 | struct nsproxy { |
24 | atomic_t count; | 25 | atomic_t count; |
25 | spinlock_t nslock; | 26 | spinlock_t nslock; |
27 | unsigned long id; | ||
26 | struct uts_namespace *uts_ns; | 28 | struct uts_namespace *uts_ns; |
27 | struct ipc_namespace *ipc_ns; | 29 | struct ipc_namespace *ipc_ns; |
28 | struct namespace *namespace; | 30 | struct mnt_namespace *mnt_ns; |
31 | struct pid_namespace *pid_ns; | ||
29 | }; | 32 | }; |
30 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
31 | 34 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4d972bbef316..51180dba9a98 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1785,14 +1785,17 @@ | |||
1785 | #define PCI_DEVICE_ID_MOXA_C104 0x1040 | 1785 | #define PCI_DEVICE_ID_MOXA_C104 0x1040 |
1786 | #define PCI_DEVICE_ID_MOXA_CP104U 0x1041 | 1786 | #define PCI_DEVICE_ID_MOXA_CP104U 0x1041 |
1787 | #define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 | 1787 | #define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 |
1788 | #define PCI_DEVICE_ID_MOXA_CP104EL 0x1043 | ||
1788 | #define PCI_DEVICE_ID_MOXA_CT114 0x1140 | 1789 | #define PCI_DEVICE_ID_MOXA_CT114 0x1140 |
1789 | #define PCI_DEVICE_ID_MOXA_CP114 0x1141 | 1790 | #define PCI_DEVICE_ID_MOXA_CP114 0x1141 |
1790 | #define PCI_DEVICE_ID_MOXA_CP118U 0x1180 | 1791 | #define PCI_DEVICE_ID_MOXA_CP118U 0x1180 |
1792 | #define PCI_DEVICE_ID_MOXA_CP118EL 0x1181 | ||
1791 | #define PCI_DEVICE_ID_MOXA_CP132 0x1320 | 1793 | #define PCI_DEVICE_ID_MOXA_CP132 0x1320 |
1792 | #define PCI_DEVICE_ID_MOXA_CP132U 0x1321 | 1794 | #define PCI_DEVICE_ID_MOXA_CP132U 0x1321 |
1793 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 | 1795 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 |
1794 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 | 1796 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 |
1795 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 | 1797 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 |
1798 | #define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 | ||
1796 | 1799 | ||
1797 | #define PCI_VENDOR_ID_CCD 0x1397 | 1800 | #define PCI_VENDOR_ID_CCD 0x1397 |
1798 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 | 1801 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 2c0007d17218..4dec047b1837 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -35,8 +35,9 @@ enum pid_type | |||
35 | * | 35 | * |
36 | * Holding a reference to struct pid solves both of these problems. | 36 | * Holding a reference to struct pid solves both of these problems. |
37 | * It is small so holding a reference does not consume a lot of | 37 | * It is small so holding a reference does not consume a lot of |
38 | * resources, and since a new struct pid is allocated when the numeric | 38 | * resources, and since a new struct pid is allocated when the numeric pid |
39 | * pid value is reused we don't mistakenly refer to new processes. | 39 | * value is reused (when pids wrap around) we don't mistakenly refer to new |
40 | * processes. | ||
40 | */ | 41 | */ |
41 | 42 | ||
42 | struct pid | 43 | struct pid |
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h new file mode 100644 index 000000000000..d2a9d419f01f --- /dev/null +++ b/include/linux/pid_namespace.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef _LINUX_PID_NS_H | ||
2 | #define _LINUX_PID_NS_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | #include <linux/nsproxy.h> | ||
9 | #include <linux/kref.h> | ||
10 | |||
11 | struct pidmap { | ||
12 | atomic_t nr_free; | ||
13 | void *page; | ||
14 | }; | ||
15 | |||
16 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
17 | |||
18 | struct pid_namespace { | ||
19 | struct kref kref; | ||
20 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
21 | int last_pid; | ||
22 | struct task_struct *child_reaper; | ||
23 | }; | ||
24 | |||
25 | extern struct pid_namespace init_pid_ns; | ||
26 | |||
27 | static inline void get_pid_ns(struct pid_namespace *ns) | ||
28 | { | ||
29 | kref_get(&ns->kref); | ||
30 | } | ||
31 | |||
32 | extern int copy_pid_ns(int flags, struct task_struct *tsk); | ||
33 | extern void free_pid_ns(struct kref *kref); | ||
34 | |||
35 | static inline void put_pid_ns(struct pid_namespace *ns) | ||
36 | { | ||
37 | kref_put(&ns->kref, free_pid_ns); | ||
38 | } | ||
39 | |||
40 | static inline struct task_struct *child_reaper(struct task_struct *tsk) | ||
41 | { | ||
42 | return tsk->nsproxy->pid_ns->child_reaper; | ||
43 | } | ||
44 | |||
45 | #endif /* _LINUX_PID_NS_H */ | ||
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 8a94c717c266..5ea4f05683f6 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
@@ -111,6 +111,13 @@ struct pkt_ctrl_command { | |||
111 | #include <linux/blkdev.h> | 111 | #include <linux/blkdev.h> |
112 | #include <linux/completion.h> | 112 | #include <linux/completion.h> |
113 | #include <linux/cdrom.h> | 113 | #include <linux/cdrom.h> |
114 | #include <linux/kobject.h> | ||
115 | #include <linux/sysfs.h> | ||
116 | |||
117 | /* default bio write queue congestion marks */ | ||
118 | #define PKT_WRITE_CONGESTION_ON 10000 | ||
119 | #define PKT_WRITE_CONGESTION_OFF 9000 | ||
120 | |||
114 | 121 | ||
115 | struct packet_settings | 122 | struct packet_settings |
116 | { | 123 | { |
@@ -241,6 +248,14 @@ struct packet_stacked_data | |||
241 | }; | 248 | }; |
242 | #define PSD_POOL_SIZE 64 | 249 | #define PSD_POOL_SIZE 64 |
243 | 250 | ||
251 | struct pktcdvd_kobj | ||
252 | { | ||
253 | struct kobject kobj; | ||
254 | struct pktcdvd_device *pd; | ||
255 | }; | ||
256 | #define to_pktcdvdkobj(_k) \ | ||
257 | ((struct pktcdvd_kobj*)container_of(_k,struct pktcdvd_kobj,kobj)) | ||
258 | |||
244 | struct pktcdvd_device | 259 | struct pktcdvd_device |
245 | { | 260 | { |
246 | struct block_device *bdev; /* dev attached */ | 261 | struct block_device *bdev; /* dev attached */ |
@@ -271,6 +286,16 @@ struct pktcdvd_device | |||
271 | 286 | ||
272 | struct packet_iosched iosched; | 287 | struct packet_iosched iosched; |
273 | struct gendisk *disk; | 288 | struct gendisk *disk; |
289 | |||
290 | int write_congestion_off; | ||
291 | int write_congestion_on; | ||
292 | |||
293 | struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */ | ||
294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ | ||
295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ | ||
296 | |||
297 | struct dentry *dfs_d_root; /* debugfs: devname directory */ | ||
298 | struct dentry *dfs_f_info; /* debugfs: info file */ | ||
274 | }; | 299 | }; |
275 | 300 | ||
276 | #endif /* __KERNEL__ */ | 301 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/pspace.h b/include/linux/pspace.h deleted file mode 100644 index 91d48b8b2d99..000000000000 --- a/include/linux/pspace.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifndef _LINUX_PSPACE_H | ||
2 | #define _LINUX_PSPACE_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | |||
9 | struct pidmap { | ||
10 | atomic_t nr_free; | ||
11 | void *page; | ||
12 | }; | ||
13 | |||
14 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
15 | |||
16 | struct pspace { | ||
17 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
18 | int last_pid; | ||
19 | }; | ||
20 | |||
21 | extern struct pspace init_pspace; | ||
22 | |||
23 | #endif /* _LINUX_PSPACE_H */ | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index d0e4dce33ad5..c3fc6caaad3f 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1159,7 +1159,7 @@ znodes are the way! */ | |||
1159 | #define PATH_READA 0x1 /* do read ahead */ | 1159 | #define PATH_READA 0x1 /* do read ahead */ |
1160 | #define PATH_READA_BACK 0x2 /* read backwards */ | 1160 | #define PATH_READA_BACK 0x2 /* read backwards */ |
1161 | 1161 | ||
1162 | struct path { | 1162 | struct treepath { |
1163 | int path_length; /* Length of the array above. */ | 1163 | int path_length; /* Length of the array above. */ |
1164 | int reada; | 1164 | int reada; |
1165 | struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ | 1165 | struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ |
@@ -1169,7 +1169,7 @@ struct path { | |||
1169 | #define pos_in_item(path) ((path)->pos_in_item) | 1169 | #define pos_in_item(path) ((path)->pos_in_item) |
1170 | 1170 | ||
1171 | #define INITIALIZE_PATH(var) \ | 1171 | #define INITIALIZE_PATH(var) \ |
1172 | struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} | 1172 | struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} |
1173 | 1173 | ||
1174 | /* Get path element by path and path position. */ | 1174 | /* Get path element by path and path position. */ |
1175 | #define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) | 1175 | #define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) |
@@ -1327,7 +1327,7 @@ struct tree_balance { | |||
1327 | int need_balance_dirty; | 1327 | int need_balance_dirty; |
1328 | struct super_block *tb_sb; | 1328 | struct super_block *tb_sb; |
1329 | struct reiserfs_transaction_handle *transaction_handle; | 1329 | struct reiserfs_transaction_handle *transaction_handle; |
1330 | struct path *tb_path; | 1330 | struct treepath *tb_path; |
1331 | struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ | 1331 | struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ |
1332 | struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ | 1332 | struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ |
1333 | struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ | 1333 | struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ |
@@ -1793,41 +1793,41 @@ static inline void copy_key(struct reiserfs_key *to, | |||
1793 | memcpy(to, from, KEY_SIZE); | 1793 | memcpy(to, from, KEY_SIZE); |
1794 | } | 1794 | } |
1795 | 1795 | ||
1796 | int comp_items(const struct item_head *stored_ih, const struct path *p_s_path); | 1796 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path); |
1797 | const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path, | 1797 | const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path, |
1798 | const struct super_block *p_s_sb); | 1798 | const struct super_block *p_s_sb); |
1799 | int search_by_key(struct super_block *, const struct cpu_key *, | 1799 | int search_by_key(struct super_block *, const struct cpu_key *, |
1800 | struct path *, int); | 1800 | struct treepath *, int); |
1801 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) | 1801 | #define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) |
1802 | int search_for_position_by_key(struct super_block *p_s_sb, | 1802 | int search_for_position_by_key(struct super_block *p_s_sb, |
1803 | const struct cpu_key *p_s_cpu_key, | 1803 | const struct cpu_key *p_s_cpu_key, |
1804 | struct path *p_s_search_path); | 1804 | struct treepath *p_s_search_path); |
1805 | extern void decrement_bcount(struct buffer_head *p_s_bh); | 1805 | extern void decrement_bcount(struct buffer_head *p_s_bh); |
1806 | void decrement_counters_in_path(struct path *p_s_search_path); | 1806 | void decrement_counters_in_path(struct treepath *p_s_search_path); |
1807 | void pathrelse(struct path *p_s_search_path); | 1807 | void pathrelse(struct treepath *p_s_search_path); |
1808 | int reiserfs_check_path(struct path *p); | 1808 | int reiserfs_check_path(struct treepath *p); |
1809 | void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path); | 1809 | void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path); |
1810 | 1810 | ||
1811 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | 1811 | int reiserfs_insert_item(struct reiserfs_transaction_handle *th, |
1812 | struct path *path, | 1812 | struct treepath *path, |
1813 | const struct cpu_key *key, | 1813 | const struct cpu_key *key, |
1814 | struct item_head *ih, | 1814 | struct item_head *ih, |
1815 | struct inode *inode, const char *body); | 1815 | struct inode *inode, const char *body); |
1816 | 1816 | ||
1817 | int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, | 1817 | int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, |
1818 | struct path *path, | 1818 | struct treepath *path, |
1819 | const struct cpu_key *key, | 1819 | const struct cpu_key *key, |
1820 | struct inode *inode, | 1820 | struct inode *inode, |
1821 | const char *body, int paste_size); | 1821 | const char *body, int paste_size); |
1822 | 1822 | ||
1823 | int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | 1823 | int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, |
1824 | struct path *path, | 1824 | struct treepath *path, |
1825 | struct cpu_key *key, | 1825 | struct cpu_key *key, |
1826 | struct inode *inode, | 1826 | struct inode *inode, |
1827 | struct page *page, loff_t new_file_size); | 1827 | struct page *page, loff_t new_file_size); |
1828 | 1828 | ||
1829 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, | 1829 | int reiserfs_delete_item(struct reiserfs_transaction_handle *th, |
1830 | struct path *path, | 1830 | struct treepath *path, |
1831 | const struct cpu_key *key, | 1831 | const struct cpu_key *key, |
1832 | struct inode *inode, struct buffer_head *p_s_un_bh); | 1832 | struct inode *inode, struct buffer_head *p_s_un_bh); |
1833 | 1833 | ||
@@ -1858,7 +1858,7 @@ void padd_item(char *item, int total_length, int length); | |||
1858 | #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ | 1858 | #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ |
1859 | 1859 | ||
1860 | int restart_transaction(struct reiserfs_transaction_handle *th, | 1860 | int restart_transaction(struct reiserfs_transaction_handle *th, |
1861 | struct inode *inode, struct path *path); | 1861 | struct inode *inode, struct treepath *path); |
1862 | void reiserfs_read_locked_inode(struct inode *inode, | 1862 | void reiserfs_read_locked_inode(struct inode *inode, |
1863 | struct reiserfs_iget_args *args); | 1863 | struct reiserfs_iget_args *args); |
1864 | int reiserfs_find_actor(struct inode *inode, void *p); | 1864 | int reiserfs_find_actor(struct inode *inode, void *p); |
@@ -1905,7 +1905,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); | |||
1905 | /* namei.c */ | 1905 | /* namei.c */ |
1906 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); | 1906 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); |
1907 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | 1907 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
1908 | struct path *path, struct reiserfs_dir_entry *de); | 1908 | struct treepath *path, struct reiserfs_dir_entry *de); |
1909 | struct dentry *reiserfs_get_parent(struct dentry *); | 1909 | struct dentry *reiserfs_get_parent(struct dentry *); |
1910 | /* procfs.c */ | 1910 | /* procfs.c */ |
1911 | 1911 | ||
@@ -1956,9 +1956,9 @@ extern const struct file_operations reiserfs_dir_operations; | |||
1956 | 1956 | ||
1957 | /* tail_conversion.c */ | 1957 | /* tail_conversion.c */ |
1958 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, | 1958 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |
1959 | struct path *, struct buffer_head *, loff_t); | 1959 | struct treepath *, struct buffer_head *, loff_t); |
1960 | int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, | 1960 | int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, |
1961 | struct page *, struct path *, const struct cpu_key *, | 1961 | struct page *, struct treepath *, const struct cpu_key *, |
1962 | loff_t, char *); | 1962 | loff_t, char *); |
1963 | void reiserfs_unmap_buffer(struct buffer_head *); | 1963 | void reiserfs_unmap_buffer(struct buffer_head *); |
1964 | 1964 | ||
@@ -2045,7 +2045,7 @@ struct __reiserfs_blocknr_hint { | |||
2045 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ | 2045 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ |
2046 | long block; /* file offset, in blocks */ | 2046 | long block; /* file offset, in blocks */ |
2047 | struct in_core_key key; | 2047 | struct in_core_key key; |
2048 | struct path *path; /* search path, used by allocator to deternine search_start by | 2048 | struct treepath *path; /* search path, used by allocator to deternine search_start by |
2049 | * various ways */ | 2049 | * various ways */ |
2050 | struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and | 2050 | struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and |
2051 | * bitmap blocks changes */ | 2051 | * bitmap blocks changes */ |
@@ -2101,7 +2101,7 @@ static inline int reiserfs_new_form_blocknrs(struct tree_balance *tb, | |||
2101 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | 2101 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle |
2102 | *th, struct inode *inode, | 2102 | *th, struct inode *inode, |
2103 | b_blocknr_t * new_blocknrs, | 2103 | b_blocknr_t * new_blocknrs, |
2104 | struct path *path, long block) | 2104 | struct treepath *path, long block) |
2105 | { | 2105 | { |
2106 | reiserfs_blocknr_hint_t hint = { | 2106 | reiserfs_blocknr_hint_t hint = { |
2107 | .th = th, | 2107 | .th = th, |
@@ -2118,7 +2118,7 @@ static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | |||
2118 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle | 2118 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle |
2119 | *th, struct inode *inode, | 2119 | *th, struct inode *inode, |
2120 | b_blocknr_t * new_blocknrs, | 2120 | b_blocknr_t * new_blocknrs, |
2121 | struct path *path, long block) | 2121 | struct treepath *path, long block) |
2122 | { | 2122 | { |
2123 | reiserfs_blocknr_hint_t hint = { | 2123 | reiserfs_blocknr_hint_t hint = { |
2124 | .th = th, | 2124 | .th = th, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dede82c63445..ad9c46071ff8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -436,7 +436,12 @@ struct signal_struct { | |||
436 | /* job control IDs */ | 436 | /* job control IDs */ |
437 | pid_t pgrp; | 437 | pid_t pgrp; |
438 | pid_t tty_old_pgrp; | 438 | pid_t tty_old_pgrp; |
439 | pid_t session; | 439 | |
440 | union { | ||
441 | pid_t session __deprecated; | ||
442 | pid_t __session; | ||
443 | }; | ||
444 | |||
440 | /* boolean value for session group leader */ | 445 | /* boolean value for session group leader */ |
441 | int leader; | 446 | int leader; |
442 | 447 | ||
@@ -1040,6 +1045,9 @@ struct task_struct { | |||
1040 | #ifdef CONFIG_TASK_DELAY_ACCT | 1045 | #ifdef CONFIG_TASK_DELAY_ACCT |
1041 | struct task_delay_info *delays; | 1046 | struct task_delay_info *delays; |
1042 | #endif | 1047 | #endif |
1048 | #ifdef CONFIG_FAULT_INJECTION | ||
1049 | int make_it_fail; | ||
1050 | #endif | ||
1043 | }; | 1051 | }; |
1044 | 1052 | ||
1045 | static inline pid_t process_group(struct task_struct *tsk) | 1053 | static inline pid_t process_group(struct task_struct *tsk) |
@@ -1047,6 +1055,21 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1047 | return tsk->signal->pgrp; | 1055 | return tsk->signal->pgrp; |
1048 | } | 1056 | } |
1049 | 1057 | ||
1058 | static inline pid_t signal_session(struct signal_struct *sig) | ||
1059 | { | ||
1060 | return sig->__session; | ||
1061 | } | ||
1062 | |||
1063 | static inline pid_t process_session(struct task_struct *tsk) | ||
1064 | { | ||
1065 | return signal_session(tsk->signal); | ||
1066 | } | ||
1067 | |||
1068 | static inline void set_signal_session(struct signal_struct *sig, pid_t session) | ||
1069 | { | ||
1070 | sig->__session = session; | ||
1071 | } | ||
1072 | |||
1050 | static inline struct pid *task_pid(struct task_struct *task) | 1073 | static inline struct pid *task_pid(struct task_struct *task) |
1051 | { | 1074 | { |
1052 | return task->pids[PIDTYPE_PID].pid; | 1075 | return task->pids[PIDTYPE_PID].pid; |
@@ -1240,7 +1263,6 @@ extern struct mm_struct init_mm; | |||
1240 | 1263 | ||
1241 | #define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) | 1264 | #define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) |
1242 | extern struct task_struct *find_task_by_pid_type(int type, int pid); | 1265 | extern struct task_struct *find_task_by_pid_type(int type, int pid); |
1243 | extern void set_special_pids(pid_t session, pid_t pgrp); | ||
1244 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1266 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
1245 | 1267 | ||
1246 | /* per-UID process charging. */ | 1268 | /* per-UID process charging. */ |
@@ -1381,7 +1403,6 @@ extern NORET_TYPE void do_group_exit(int); | |||
1381 | extern void daemonize(const char *, ...); | 1403 | extern void daemonize(const char *, ...); |
1382 | extern int allow_signal(int); | 1404 | extern int allow_signal(int); |
1383 | extern int disallow_signal(int); | 1405 | extern int disallow_signal(int); |
1384 | extern struct task_struct *child_reaper; | ||
1385 | 1406 | ||
1386 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); | 1407 | extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); |
1387 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); | 1408 | extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 827672136646..cf23813cbec2 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -166,8 +166,8 @@ struct uart_ops { | |||
166 | void (*break_ctl)(struct uart_port *, int ctl); | 166 | void (*break_ctl)(struct uart_port *, int ctl); |
167 | int (*startup)(struct uart_port *); | 167 | int (*startup)(struct uart_port *); |
168 | void (*shutdown)(struct uart_port *); | 168 | void (*shutdown)(struct uart_port *); |
169 | void (*set_termios)(struct uart_port *, struct termios *new, | 169 | void (*set_termios)(struct uart_port *, struct ktermios *new, |
170 | struct termios *old); | 170 | struct ktermios *old); |
171 | void (*pm)(struct uart_port *, unsigned int state, | 171 | void (*pm)(struct uart_port *, unsigned int state, |
172 | unsigned int oldstate); | 172 | unsigned int oldstate); |
173 | int (*set_wake)(struct uart_port *, unsigned int state); | 173 | int (*set_wake)(struct uart_port *, unsigned int state); |
@@ -361,8 +361,8 @@ void uart_write_wakeup(struct uart_port *port); | |||
361 | */ | 361 | */ |
362 | void uart_update_timeout(struct uart_port *port, unsigned int cflag, | 362 | void uart_update_timeout(struct uart_port *port, unsigned int cflag, |
363 | unsigned int baud); | 363 | unsigned int baud); |
364 | unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, | 364 | unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, |
365 | struct termios *old, unsigned int min, | 365 | struct ktermios *old, unsigned int min, |
366 | unsigned int max); | 366 | unsigned int max); |
367 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); | 367 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); |
368 | 368 | ||
diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 13a37f137ea2..4a0a329beafb 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
@@ -52,11 +52,11 @@ | |||
52 | * protection - since "write" code only needs to change the head, and | 52 | * protection - since "write" code only needs to change the head, and |
53 | * interrupt code only needs to change the tail. | 53 | * interrupt code only needs to change the tail. |
54 | */ | 54 | */ |
55 | typedef struct { | 55 | struct stlrq { |
56 | char *buf; | 56 | char *buf; |
57 | char *head; | 57 | char *head; |
58 | char *tail; | 58 | char *tail; |
59 | } stlrq_t; | 59 | }; |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Port, panel and board structures to hold status info about each. | 62 | * Port, panel and board structures to hold status info about each. |
@@ -67,14 +67,14 @@ typedef struct { | |||
67 | * is associated with, this makes it (fairly) easy to get back to the | 67 | * is associated with, this makes it (fairly) easy to get back to the |
68 | * board/panel info for a port. | 68 | * board/panel info for a port. |
69 | */ | 69 | */ |
70 | typedef struct stlport { | 70 | struct stlport { |
71 | unsigned long magic; | 71 | unsigned long magic; |
72 | int portnr; | 72 | unsigned int portnr; |
73 | int panelnr; | 73 | unsigned int panelnr; |
74 | int brdnr; | 74 | unsigned int brdnr; |
75 | int ioaddr; | 75 | int ioaddr; |
76 | int uartaddr; | 76 | int uartaddr; |
77 | int pagenr; | 77 | unsigned int pagenr; |
78 | long istate; | 78 | long istate; |
79 | int flags; | 79 | int flags; |
80 | int baud_base; | 80 | int baud_base; |
@@ -97,31 +97,31 @@ typedef struct stlport { | |||
97 | wait_queue_head_t close_wait; | 97 | wait_queue_head_t close_wait; |
98 | struct work_struct tqueue; | 98 | struct work_struct tqueue; |
99 | comstats_t stats; | 99 | comstats_t stats; |
100 | stlrq_t tx; | 100 | struct stlrq tx; |
101 | } stlport_t; | 101 | }; |
102 | 102 | ||
103 | typedef struct stlpanel { | 103 | struct stlpanel { |
104 | unsigned long magic; | 104 | unsigned long magic; |
105 | int panelnr; | 105 | unsigned int panelnr; |
106 | int brdnr; | 106 | unsigned int brdnr; |
107 | int pagenr; | 107 | unsigned int pagenr; |
108 | int nrports; | 108 | unsigned int nrports; |
109 | int iobase; | 109 | int iobase; |
110 | void *uartp; | 110 | void *uartp; |
111 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); | 111 | void (*isr)(struct stlpanel *panelp, unsigned int iobase); |
112 | unsigned int hwid; | 112 | unsigned int hwid; |
113 | unsigned int ackmask; | 113 | unsigned int ackmask; |
114 | stlport_t *ports[STL_PORTSPERPANEL]; | 114 | struct stlport *ports[STL_PORTSPERPANEL]; |
115 | } stlpanel_t; | 115 | }; |
116 | 116 | ||
117 | typedef struct stlbrd { | 117 | struct stlbrd { |
118 | unsigned long magic; | 118 | unsigned long magic; |
119 | int brdnr; | 119 | unsigned int brdnr; |
120 | int brdtype; | 120 | unsigned int brdtype; |
121 | int state; | 121 | unsigned int state; |
122 | int nrpanels; | 122 | unsigned int nrpanels; |
123 | int nrports; | 123 | unsigned int nrports; |
124 | int nrbnks; | 124 | unsigned int nrbnks; |
125 | int irq; | 125 | int irq; |
126 | int irqtype; | 126 | int irqtype; |
127 | int (*isr)(struct stlbrd *brdp); | 127 | int (*isr)(struct stlbrd *brdp); |
@@ -136,9 +136,9 @@ typedef struct stlbrd { | |||
136 | unsigned long clk; | 136 | unsigned long clk; |
137 | unsigned int bnkpageaddr[STL_MAXBANKS]; | 137 | unsigned int bnkpageaddr[STL_MAXBANKS]; |
138 | unsigned int bnkstataddr[STL_MAXBANKS]; | 138 | unsigned int bnkstataddr[STL_MAXBANKS]; |
139 | stlpanel_t *bnk2panel[STL_MAXBANKS]; | 139 | struct stlpanel *bnk2panel[STL_MAXBANKS]; |
140 | stlpanel_t *panels[STL_MAXPANELS]; | 140 | struct stlpanel *panels[STL_MAXPANELS]; |
141 | } stlbrd_t; | 141 | }; |
142 | 142 | ||
143 | 143 | ||
144 | /* | 144 | /* |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f717f0898238..65cbcf22c31e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -175,7 +175,7 @@ struct tty_struct { | |||
175 | int index; | 175 | int index; |
176 | struct tty_ldisc ldisc; | 176 | struct tty_ldisc ldisc; |
177 | struct mutex termios_mutex; | 177 | struct mutex termios_mutex; |
178 | struct termios *termios, *termios_locked; | 178 | struct ktermios *termios, *termios_locked; |
179 | char name[64]; | 179 | char name[64]; |
180 | int pgrp; | 180 | int pgrp; |
181 | int session; | 181 | int session; |
@@ -258,7 +258,7 @@ struct tty_struct { | |||
258 | 258 | ||
259 | extern void tty_write_flush(struct tty_struct *); | 259 | extern void tty_write_flush(struct tty_struct *); |
260 | 260 | ||
261 | extern struct termios tty_std_termios; | 261 | extern struct ktermios tty_std_termios; |
262 | 262 | ||
263 | extern int kmsg_redirect; | 263 | extern int kmsg_redirect; |
264 | 264 | ||
@@ -293,8 +293,9 @@ extern int tty_hung_up_p(struct file * filp); | |||
293 | extern void do_SAK(struct tty_struct *tty); | 293 | extern void do_SAK(struct tty_struct *tty); |
294 | extern void disassociate_ctty(int priv); | 294 | extern void disassociate_ctty(int priv); |
295 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 295 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
296 | extern int tty_get_baud_rate(struct tty_struct *tty); | 296 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
297 | extern int tty_termios_baud_rate(struct termios *termios); | 297 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
298 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | ||
298 | 299 | ||
299 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); | 300 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); |
300 | extern void tty_ldisc_deref(struct tty_ldisc *); | 301 | extern void tty_ldisc_deref(struct tty_ldisc *); |
@@ -309,6 +310,12 @@ extern void tty_ldisc_flush(struct tty_struct *tty); | |||
309 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 310 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, |
310 | unsigned long arg); | 311 | unsigned long arg); |
311 | 312 | ||
313 | extern dev_t tty_devnum(struct tty_struct *tty); | ||
314 | extern void proc_clear_tty(struct task_struct *p); | ||
315 | extern void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); | ||
316 | extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); | ||
317 | extern struct tty_struct *get_current_tty(void); | ||
318 | |||
312 | extern struct mutex tty_mutex; | 319 | extern struct mutex tty_mutex; |
313 | 320 | ||
314 | /* n_tty.c */ | 321 | /* n_tty.c */ |
@@ -335,10 +342,5 @@ extern void console_print(const char *); | |||
335 | extern int vt_ioctl(struct tty_struct *tty, struct file * file, | 342 | extern int vt_ioctl(struct tty_struct *tty, struct file * file, |
336 | unsigned int cmd, unsigned long arg); | 343 | unsigned int cmd, unsigned long arg); |
337 | 344 | ||
338 | static inline dev_t tty_devnum(struct tty_struct *tty) | ||
339 | { | ||
340 | return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index; | ||
341 | } | ||
342 | |||
343 | #endif /* __KERNEL__ */ | 345 | #endif /* __KERNEL__ */ |
344 | #endif | 346 | #endif |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 5c8473bb6882..659487e3ebeb 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -53,7 +53,7 @@ | |||
53 | * device-specific ioctl's. If the ioctl number passed in cmd | 53 | * device-specific ioctl's. If the ioctl number passed in cmd |
54 | * is not recognized by the driver, it should return ENOIOCTLCMD. | 54 | * is not recognized by the driver, it should return ENOIOCTLCMD. |
55 | * | 55 | * |
56 | * void (*set_termios)(struct tty_struct *tty, struct termios * old); | 56 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
57 | * | 57 | * |
58 | * This routine allows the tty driver to be notified when | 58 | * This routine allows the tty driver to be notified when |
59 | * device's termios settings have changed. Note that a | 59 | * device's termios settings have changed. Note that a |
@@ -132,7 +132,7 @@ struct tty_operations { | |||
132 | int (*chars_in_buffer)(struct tty_struct *tty); | 132 | int (*chars_in_buffer)(struct tty_struct *tty); |
133 | int (*ioctl)(struct tty_struct *tty, struct file * file, | 133 | int (*ioctl)(struct tty_struct *tty, struct file * file, |
134 | unsigned int cmd, unsigned long arg); | 134 | unsigned int cmd, unsigned long arg); |
135 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 135 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
136 | void (*throttle)(struct tty_struct * tty); | 136 | void (*throttle)(struct tty_struct * tty); |
137 | void (*unthrottle)(struct tty_struct * tty); | 137 | void (*unthrottle)(struct tty_struct * tty); |
138 | void (*stop)(struct tty_struct *tty); | 138 | void (*stop)(struct tty_struct *tty); |
@@ -165,7 +165,7 @@ struct tty_driver { | |||
165 | int num; /* number of devices allocated */ | 165 | int num; /* number of devices allocated */ |
166 | short type; /* type of tty driver */ | 166 | short type; /* type of tty driver */ |
167 | short subtype; /* subtype of tty driver */ | 167 | short subtype; /* subtype of tty driver */ |
168 | struct termios init_termios; /* Initial termios */ | 168 | struct ktermios init_termios; /* Initial termios */ |
169 | int flags; /* tty driver flags */ | 169 | int flags; /* tty driver flags */ |
170 | int refcount; /* for loadable tty drivers */ | 170 | int refcount; /* for loadable tty drivers */ |
171 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ | 171 | struct proc_dir_entry *proc_entry; /* /proc fs entry */ |
@@ -175,8 +175,8 @@ struct tty_driver { | |||
175 | * Pointer to the tty data structures | 175 | * Pointer to the tty data structures |
176 | */ | 176 | */ |
177 | struct tty_struct **ttys; | 177 | struct tty_struct **ttys; |
178 | struct termios **termios; | 178 | struct ktermios **termios; |
179 | struct termios **termios_locked; | 179 | struct ktermios **termios_locked; |
180 | void *driver_state; /* only used for the PTY driver */ | 180 | void *driver_state; /* only used for the PTY driver */ |
181 | 181 | ||
182 | /* | 182 | /* |
@@ -193,7 +193,7 @@ struct tty_driver { | |||
193 | int (*chars_in_buffer)(struct tty_struct *tty); | 193 | int (*chars_in_buffer)(struct tty_struct *tty); |
194 | int (*ioctl)(struct tty_struct *tty, struct file * file, | 194 | int (*ioctl)(struct tty_struct *tty, struct file * file, |
195 | unsigned int cmd, unsigned long arg); | 195 | unsigned int cmd, unsigned long arg); |
196 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 196 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
197 | void (*throttle)(struct tty_struct * tty); | 197 | void (*throttle)(struct tty_struct * tty); |
198 | void (*unthrottle)(struct tty_struct * tty); | 198 | void (*unthrottle)(struct tty_struct * tty); |
199 | void (*stop)(struct tty_struct *tty); | 199 | void (*stop)(struct tty_struct *tty); |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 83c6e6c10ebb..d75932e27710 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -59,7 +59,7 @@ | |||
59 | * low-level driver can "grab" an ioctl request before the line | 59 | * low-level driver can "grab" an ioctl request before the line |
60 | * discpline has a chance to see it. | 60 | * discpline has a chance to see it. |
61 | * | 61 | * |
62 | * void (*set_termios)(struct tty_struct *tty, struct termios * old); | 62 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
63 | * | 63 | * |
64 | * This function notifies the line discpline that a change has | 64 | * This function notifies the line discpline that a change has |
65 | * been made to the termios structure. | 65 | * been made to the termios structure. |
@@ -118,7 +118,7 @@ struct tty_ldisc { | |||
118 | const unsigned char * buf, size_t nr); | 118 | const unsigned char * buf, size_t nr); |
119 | int (*ioctl)(struct tty_struct * tty, struct file * file, | 119 | int (*ioctl)(struct tty_struct * tty, struct file * file, |
120 | unsigned int cmd, unsigned long arg); | 120 | unsigned int cmd, unsigned long arg); |
121 | void (*set_termios)(struct tty_struct *tty, struct termios * old); | 121 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
122 | unsigned int (*poll)(struct tty_struct *, struct file *, | 122 | unsigned int (*poll)(struct tty_struct *, struct file *, |
123 | struct poll_table_struct *); | 123 | struct poll_table_struct *); |
124 | int (*hangup)(struct tty_struct *tty); | 124 | int (*hangup)(struct tty_struct *tty); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 91b3ea2bbb14..10f99e5f1a97 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -218,7 +218,7 @@ struct usb_serial_driver { | |||
218 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); | 218 | int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); |
219 | int (*write_room) (struct usb_serial_port *port); | 219 | int (*write_room) (struct usb_serial_port *port); |
220 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); | 220 | int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); |
221 | void (*set_termios) (struct usb_serial_port *port, struct termios * old); | 221 | void (*set_termios) (struct usb_serial_port *port, struct ktermios * old); |
222 | void (*break_ctl) (struct usb_serial_port *port, int break_state); | 222 | void (*break_ctl) (struct usb_serial_port *port, int break_state); |
223 | int (*chars_in_buffer) (struct usb_serial_port *port); | 223 | int (*chars_in_buffer) (struct usb_serial_port *port); |
224 | void (*throttle) (struct usb_serial_port *port); | 224 | void (*throttle) (struct usb_serial_port *port); |
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 87699cb4ef8c..8dabdd603fe1 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
@@ -126,7 +126,7 @@ extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, | |||
126 | extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, | 126 | extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, |
127 | unsigned int cmd, unsigned long arg); | 127 | unsigned int cmd, unsigned long arg); |
128 | extern void ircomm_tty_set_termios(struct tty_struct *tty, | 128 | extern void ircomm_tty_set_termios(struct tty_struct *tty, |
129 | struct termios *old_termios); | 129 | struct ktermios *old_termios); |
130 | extern hashbin_t *ircomm_tty; | 130 | extern hashbin_t *ircomm_tty; |
131 | 131 | ||
132 | #endif | 132 | #endif |
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h index 3bde0f5cd55c..20b9002712ef 100644 --- a/include/video/mbxfb.h +++ b/include/video/mbxfb.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __MBX_FB_H | 1 | #ifndef __MBX_FB_H |
2 | #define __MBX_FB_H | 2 | #define __MBX_FB_H |
3 | 3 | ||
4 | #include <asm/ioctl.h> | ||
5 | #include <asm/types.h> | ||
6 | |||
4 | struct mbxfb_val { | 7 | struct mbxfb_val { |
5 | unsigned int defval; | 8 | unsigned int defval; |
6 | unsigned int min; | 9 | unsigned int min; |
@@ -25,4 +28,32 @@ struct mbxfb_platform_data { | |||
25 | int (*remove)(struct fb_info *fb); | 28 | int (*remove)(struct fb_info *fb); |
26 | }; | 29 | }; |
27 | 30 | ||
31 | /* planar */ | ||
32 | #define MBXFB_FMT_YUV12 0 | ||
33 | |||
34 | /* packed */ | ||
35 | #define MBXFB_FMT_UY0VY1 1 | ||
36 | #define MBXFB_FMT_VY0UY1 2 | ||
37 | #define MBXFB_FMT_Y0UY1V 3 | ||
38 | #define MBXFB_FMT_Y0VY1U 4 | ||
39 | struct mbxfb_overlaySetup { | ||
40 | __u32 enable; | ||
41 | __u32 x, y; | ||
42 | __u32 width, height; | ||
43 | __u32 alpha; | ||
44 | __u32 fmt; | ||
45 | __u32 mem_offset; | ||
46 | __u32 scaled_width; | ||
47 | __u32 scaled_height; | ||
48 | |||
49 | /* Filled by the driver */ | ||
50 | __u32 U_offset; | ||
51 | __u32 V_offset; | ||
52 | |||
53 | __u16 Y_stride; | ||
54 | __u16 UV_stride; | ||
55 | }; | ||
56 | |||
57 | #define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup) | ||
58 | |||
28 | #endif /* __MBX_FB_H */ | 59 | #endif /* __MBX_FB_H */ |
diff --git a/include/video/pm3fb.h b/include/video/pm3fb.h index ac021379ac40..94c7d2da90ea 100644 --- a/include/video/pm3fb.h +++ b/include/video/pm3fb.h | |||
@@ -607,16 +607,16 @@ | |||
607 | #define PM3FBDestReadModeOr 0xac98 | 607 | #define PM3FBDestReadModeOr 0xac98 |
608 | #define PM3FBDestReadMode_ReadDisable 0<<0 | 608 | #define PM3FBDestReadMode_ReadDisable 0<<0 |
609 | #define PM3FBDestReadMode_ReadEnable 1<<0 | 609 | #define PM3FBDestReadMode_ReadEnable 1<<0 |
610 | #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2 | 610 | #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2) |
611 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7 | 611 | #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7) |
612 | #define PM3FBDestReadMode_Enable0 1<<8 | 612 | #define PM3FBDestReadMode_Enable0 1<<8 |
613 | #define PM3FBDestReadMode_Enable1 1<<9 | 613 | #define PM3FBDestReadMode_Enable1 1<<9 |
614 | #define PM3FBDestReadMode_Enable2 1<<10 | 614 | #define PM3FBDestReadMode_Enable2 1<<10 |
615 | #define PM3FBDestReadMode_Enable3 1<<11 | 615 | #define PM3FBDestReadMode_Enable3 1<<11 |
616 | #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12 | 616 | #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12) |
617 | #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14 | 617 | #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14) |
618 | #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16 | 618 | #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16) |
619 | #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18 | 619 | #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18) |
620 | #define PM3FBDestReadMode_Origin0 1<<20 | 620 | #define PM3FBDestReadMode_Origin0 1<<20 |
621 | #define PM3FBDestReadMode_Origin1 1<<21 | 621 | #define PM3FBDestReadMode_Origin1 1<<21 |
622 | #define PM3FBDestReadMode_Origin2 1<<22 | 622 | #define PM3FBDestReadMode_Origin2 1<<22 |
@@ -640,16 +640,16 @@ | |||
640 | #define PM3FBSourceReadModeOr 0xaca8 | 640 | #define PM3FBSourceReadModeOr 0xaca8 |
641 | #define PM3FBSourceReadMode_ReadDisable (0<<0) | 641 | #define PM3FBSourceReadMode_ReadDisable (0<<0) |
642 | #define PM3FBSourceReadMode_ReadEnable (1<<0) | 642 | #define PM3FBSourceReadMode_ReadEnable (1<<0) |
643 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2 | 643 | #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2) |
644 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7 | 644 | #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7) |
645 | #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8 | 645 | #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8) |
646 | #define PM3FBSourceReadMode_Origin 1<<10 | 646 | #define PM3FBSourceReadMode_Origin 1<<10 |
647 | #define PM3FBSourceReadMode_Blocking 1<<11 | 647 | #define PM3FBSourceReadMode_Blocking 1<<11 |
648 | #define PM3FBSourceReadMode_UserTexelCoord 1<<13 | 648 | #define PM3FBSourceReadMode_UserTexelCoord 1<<13 |
649 | #define PM3FBSourceReadMode_WrapXEnable 1<<14 | 649 | #define PM3FBSourceReadMode_WrapXEnable 1<<14 |
650 | #define PM3FBSourceReadMode_WrapYEnable 1<<15 | 650 | #define PM3FBSourceReadMode_WrapYEnable 1<<15 |
651 | #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16 | 651 | #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16) |
652 | #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20 | 652 | #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20) |
653 | #define PM3FBSourceReadMode_ExternalSourceData 1<<24 | 653 | #define PM3FBSourceReadMode_ExternalSourceData 1<<24 |
654 | #define PM3FBWriteBufferAddr0 0xb000 | 654 | #define PM3FBWriteBufferAddr0 0xb000 |
655 | #define PM3FBWriteBufferAddr1 0xb008 | 655 | #define PM3FBWriteBufferAddr1 0xb008 |
@@ -942,7 +942,7 @@ | |||
942 | #define PM3Window 0x8980 | 942 | #define PM3Window 0x8980 |
943 | #define PM3Window_ForceLBUpdate 1<<3 | 943 | #define PM3Window_ForceLBUpdate 1<<3 |
944 | #define PM3Window_LBUpdateSource 1<<4 | 944 | #define PM3Window_LBUpdateSource 1<<4 |
945 | #define PM3Window_FrameCount(c) (((c)&0xff)<<9 | 945 | #define PM3Window_FrameCount(c) (((c)&0xff)<<9) |
946 | #define PM3Window_StencilFCP 1<<17 | 946 | #define PM3Window_StencilFCP 1<<17 |
947 | #define PM3Window_DepthFCP 1<<18 | 947 | #define PM3Window_DepthFCP 1<<18 |
948 | #define PM3Window_OverrideWriteFiltering 1<<19 | 948 | #define PM3Window_OverrideWriteFiltering 1<<19 |